blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
listlengths
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
986 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
23 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
145 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
122 values
content
stringlengths
3
10.4M
authors
listlengths
1
1
author_id
stringlengths
0
158
d09ef6438d6f441be39f15438b6808b9c6382204
60ae6b7bc57b2b8555b7abc3d8cfb37b3c72bdce
/BT01/B19.cpp
41963bc45bf7c848a8b1e1e66d213777eb40e9a7
[]
no_license
phvtquang/BT_INT2215
7e5301cbf4b5155e2578cbc52169fa192fab980a
8bb9d577104f7a718a9512bc62f7a6fc7c698102
refs/heads/main
2023-03-29T16:15:17.147792
2021-04-04T11:38:55
2021-04-04T11:38:55
341,636,844
0
0
null
null
null
null
UTF-8
C++
false
false
382
cpp
#include <iostream> using namespace std; int main() { int x, y, z; bool b; cout << "nhap ba so" << endl; cout << "1 = "; cin >> x; cout << "2 = "; cin >> y; cout << "3 = "; cin >> z; if ((x < y) && (y < z)) { b = true; cout << "true"; } else { b = false; cout << "false"; } return 0; }
[ "quangphamviet0@gmail.com" ]
quangphamviet0@gmail.com
9aaf6bb199232a71111cb9f9c206ef7095f56fc1
3553b623f019c4914f99ade83754c289a11338a8
/dodo/dodo/boj17825.cpp
5b6edd1464b1c6fafc5051185281030d8009da42
[]
no_license
WonJin4631/AlgorithmStudy
752e6dd9e71177a9098acc149f4d40778bf4c294
28e036f54dd6dd4553c1e6ac82fed509609c325b
refs/heads/master
2023-01-07T03:32:45.185292
2020-11-01T03:55:33
2020-11-02T07:51:28
168,090,955
0
0
null
null
null
null
UHC
C++
false
false
2,115
cpp
#include<iostream> #include<vector> using namespace std; /* 4개 말 10개 주사위 수 말이 이동 멈출때 위치 점수 추가 같은자리에 이동 불가 종료위치 이상 갈때 종료위치 종료위치 말 이동 안됨 */ int move_list[11]; int map[] = { 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,0/*여기까지21*/,10,13,16,19,25/*오른쪽 26*/,20,22,24,25,30,35,40/*위로 33*/,30,28,27,26,25 /*왼쪽 38*/}; int mal[5] = { 0 }; int summal[5] = { 0 }; int visit[47]; bool fin[5] = { false }; int ans = 0; int change(int cur,int num) { int n_pos =num + cur; if (cur >= 0 && cur <= 20) { if (n_pos == 5) return 22; if (n_pos == 10) return 27; if (n_pos == 15) return 34; if (n_pos > 20) return 21; } else if (cur >= 22 && cur <= 26) { if (n_pos >= 30) return 21; if (n_pos == 29) return 20; else if (n_pos == 26) return 30; else if (n_pos > 26) return 30 - (26 - cur) + num; } else if (cur >= 27 && cur <= 33) { if (n_pos == 33) return 20; if (n_pos > 33) return 21; } else if (cur >= 34 && cur <= 38) { if (n_pos >= 42) return 21; if (n_pos == 41) return 20; else if (n_pos == 38) return 30; else if(n_pos>38) return 30 - (38 - cur) + num; } return n_pos; } void solve(int cnt,int sum) { if (cnt == 10) { if (ans < sum) { ans = sum; } return; } for (int i = 0; i < 4; i++) { //종료 위치에 있는말 이동안함 if (mal[i] == 21) continue; int curpos = mal[i]; int nextpos = change(curpos, move_list[cnt]); //다음 자리에 말이 위치하면 안움직임 if (visit[nextpos] == 1) continue; //말이 종료시에 if (nextpos == 21) { visit[curpos] = 0; mal[i] = nextpos; solve(cnt + 1, sum); mal[i] = curpos; visit[curpos] = 1; } //아닐시 else { visit[curpos] = 0; visit[nextpos] = 1; mal[i] = nextpos; solve(cnt + 1, sum+map[mal[i]]); mal[i] = curpos; visit[curpos] = 1; visit[nextpos] = 0; } } } int main() { for (int i = 0; i < 10; i++) { cin >> move_list[i]; } solve(0,0); cout << ans << '\n'; }
[ "pwj4119@gmail.com" ]
pwj4119@gmail.com
c3fd38299e85c4279f858013701ac8d41c9c353d
3053e477f91dcfa12fcfe094408b0fbf8fa14de6
/Resources/Utils/calculateEM/source/main.cpp
2afe609802b9db9d2acd6e7cb0818cc79fd660cf
[ "MIT" ]
permissive
sjbradshaw/HYDRAD
eb19013f3869601bcc6754a9a58f6c2acfae8616
4d5eb698570d8a631995be8bff52138dd4f4ef5e
refs/heads/master
2023-04-18T03:48:30.574642
2021-05-05T14:44:56
2021-05-05T14:44:56
109,440,613
0
0
null
null
null
null
UTF-8
C++
false
false
2,982
cpp
// **** // * // * A routine to calculate the emission measure and the differential emission measure // * from spatially averaged electron densities and temperatures // * // * (c) Dr. Stephen J. Bradshaw // * // * Date last modified: 11/11/2015 // * // **** #include <stdio.h> #include <stdlib.h> #include <math.h> #include "../../../source/file.h" int main(void) { FILE *pCONFIGFile, *pINPUTFile, *pOUTPUTFile; char szINPUTFilename[256], szOUTPUTFilename[256]; char szBuffer[256]; double *pfEM; double fdR, fLogTmax, fLogTmin, fdexStep; double fTimeStamp, fn, fTe, fTH; double fLogTe, fEM_T, fDEM_T; int iNumElements, iNumFiles, iNumRows, iBin; int i, j; // Open the configuration file pCONFIGFile = fopen( "config.cfg", "r" ); // Get the line-of-sight depth ReadDouble( pCONFIGFile, &fdR ); fscanf( pCONFIGFile, "%s", szBuffer ); // Get the temperature range of the emission measure ReadDouble( pCONFIGFile, &fLogTmin ); fscanf( pCONFIGFile, "%s", szBuffer ); ReadDouble( pCONFIGFile, &fLogTmax ); fscanf( pCONFIGFile, "%s", szBuffer ); ReadDouble( pCONFIGFile, &fdexStep ); fscanf( pCONFIGFile, "%s", szBuffer ); iNumElements = ( fLogTmax - fLogTmin ) / fdexStep; pfEM = (double*)malloc( sizeof(double) * iNumElements ); // Get the number of input files fscanf( pCONFIGFile, "%i", &iNumFiles ); fscanf( pCONFIGFile, "%s", szBuffer ); for( i=0; i<iNumFiles; i++ ) { // Reset the emission measure for( j=0; j<iNumElements; j++ ) pfEM[j] = 0.0; // Get the filename of the input file fscanf( pCONFIGFile, "%s", szINPUTFilename ); fscanf( pCONFIGFile, "%s", szBuffer ); // Open the input file pINPUTFile = fopen( szINPUTFilename, "r" ); // Get the number of rows from the input file fscanf( pINPUTFile, "%i", &iNumRows ); for( j=0; j<iNumRows; j++ ) { // Get the timestamp ReadDouble( pINPUTFile, &fTimeStamp ); // Get the number density ReadDouble( pINPUTFile, &fn ); // Get the electron temperature ReadDouble( pINPUTFile, &fTe ); // Get the hydrogen temperature ReadDouble( pINPUTFile, &fTH ); // Find the temperature bin to fill with the emission measure fLogTe = log10( fTe ); iBin = ( fLogTe - fLogTmin ) / fdexStep; if( iBin >= 0 && iBin < iNumElements ) pfEM[iBin] += fn * fn; } fclose( pINPUTFile ); // Get the filename of the output file fscanf( pCONFIGFile, "%s", szOUTPUTFilename ); fscanf( pCONFIGFile, "%s", szBuffer ); // Open the output file pOUTPUTFile = fopen( szOUTPUTFilename, "w" ); fLogTe = fLogTmin + (fdexStep/2.0); for( j=0; j<iNumElements; j++ ) { fEM_T = ((fdR*pfEM[j])/(double)iNumRows)/fdexStep; fDEM_T = fEM_T / ( log(10) * pow(10.0,fLogTe) ); fprintf( pOUTPUTFile, "%.4g\t%.4g\t%.4g\n", fLogTe, fEM_T, fDEM_T ); fLogTe += fdexStep; } fclose( pOUTPUTFile ); } free( pfEM ); fclose( pCONFIGFile ); return 0; }
[ "wtb2@rice.edu" ]
wtb2@rice.edu
9d03bff698440de82307d9479577dfdbedba995e
57f624cd3cc3647fc0b8975bbdea821b3b6cba08
/adaboost/algorithm/weak_classifier_impl.cpp
20613bf885ad3469bf6b609ee5b640ce5f0a71b1
[]
no_license
2537369758/adaboost
7b73c059f506b4a69ebe1118231d68d021d1ec1f
bbd7f2676cbe53f72324c862ddfcab27d0718259
refs/heads/master
2023-04-01T20:33:01.136821
2020-12-05T11:25:26
2020-12-05T11:25:26
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,239
cpp
#ifndef ADABOOST_ALGORITHM_WEAK_CLASSIFIER_IMPL_CPP #define ADABOOST_ALGORITHM_WEAK_CLASSIFIER_IMPL_CPP #include<adaboost/core/data_structures.hpp> #include<adaboost/algorithm/weak_classifier.hpp> #include<adaboost/algorithm/naive_decision_stump.hpp> #include<adaboost/utils/utils.hpp> #include<string> namespace adaboost { namespace algorithm { using namespace adaboost::core; Properties:: ~Properties() { } template <class data_type> BinaryWeakClassifier<data_type>* BinaryWeakClassifierFactory<data_type>:: create_BinaryWeakClassifier (Properties* classifier_information, std::string classifier_type) { BinaryWeakClassifier<data_type>* weak_classifier; if( classifier_type == "BinaryNaiveDecisionStump" ) { BinaryNaiveDecisionStumpProperties<data_type>* _info = dynamic_cast<BinaryNaiveDecisionStumpProperties<data_type>*>(classifier_information); weak_classifier = BinaryNaiveDecisionStump<data_type> ::create_BinaryNaiveDecisionStump(_info); } else { std::string msg = "Currently, " + classifier_type + " isn't supported by BinaryAdaBoost."; adaboost::utils::check(false, msg); } return weak_classifier; } template <class data_type> BinaryWeakClassifierFactory<data_type>* BinaryWeakClassifierFactory<data_type>:: create_BinaryWeakClassifierFactory () { BinaryWeakClassifierFactory<data_type>* factory = new BinaryWeakClassifierFactory<data_type>(); memory_manager->register_object(factory); return factory; }; template <class data_type> BinaryWeakClassifierFactory<data_type>:: BinaryWeakClassifierFactory() { }; template <class data_type> BinaryWeakClassifierFactory<data_type>:: ~BinaryWeakClassifierFactory() { }; #include "adaboost/templates/instantiated_templates_weak_classifier.hpp" } } #endif
[ "noreply@github.com" ]
2537369758.noreply@github.com
0300f9f9bd50918ac6ea91919c29384d55f8be60
a02efe134cb6e0c0acfee5349e8a88fb844114b3
/Lab/GradeIndependentIf/main.cpp
35287a1fd5910b7af89d472a97495d51a3aa102c
[]
no_license
zmiller928/MillerZachary_CSC5_Spring2017
051c2c5c22d7846b6b5e17db50fbc4f3e1e7bec6
62624d1e5896a0a4550fd5ae73d4c5b1545dd595
refs/heads/master
2020-05-18T13:03:50.073784
2017-04-18T04:27:55
2017-04-18T04:27:55
84,238,016
0
0
null
null
null
null
UTF-8
C++
false
false
1,054
cpp
/* * File: main.cpp * Author: Zachary Miller * Purpose: Grade branching exercise * Created on March 16, 2017, 11:23 AM */ #include <iostream> using namespace std; int main(int argc, char** argv) { unsigned short score; //Integer scores valid from 0-100 char grade; cout << "The program produces a grade from a score input" << endl; cout << "The date type used is an integer (0-100)" << endl; cout << "Type in the score:" << endl; cin >> score; if (!(score >= 0 && score <=100)) { cout << "You failed to type an integer between 0 and 100" << endl; return 1; //Use DeMorgans Law to make clearer } if (score >= 90 && score <= 100) grade = 'A'; if (score >= 80 && score < 90) grade = 'B'; if (score >= 70 && score < 80) grade = 'C'; if (score >= 60 && score < 70) grade = 'D'; if (score < 60) grade = 'F'; cout << "For a score = " << score << " your grade is an " << grade << "." << endl; return 0; }
[ "zackyftw@gmail.com" ]
zackyftw@gmail.com
80d9de982d5d687da3c19111e38b1e1514927e73
9fc919b7e778361bc81137f6a0a1abe6acbc74bc
/onerut_normal_operator/src/domain_oscillator.cpp
d7b5d2381e3f39af28ff9bdddc80a6eb963bfb92
[]
no_license
MateuszSnamina/onerut
315f712d36d2ebc797e0292b9d78b7629d81df2c
a38b3790f995aac1a89f415c47f27f7b63bf8c0d
refs/heads/master
2020-04-16T10:41:44.417458
2019-06-02T21:49:07
2019-06-02T21:49:07
165,513,612
0
0
null
null
null
null
UTF-8
C++
false
false
529
cpp
#include<cassert> #include<onerut_normal_operator/domain_oscillator.hpp> namespace onerut_normal_operator { OscillatorDomain::OscillatorDomain(uint32_t n_max_stars) : n_max_stars(n_max_stars) { } uint32_t OscillatorDomain::size() const { return n_max_stars; } std::string OscillatorDomain::state_name(uint32_t index) const { assert(index < size()); const auto & n_stars = index; const std::string name = "nu_" + std::to_string(n_stars); return name; } }
[ "mateusz.snamina@gmail.com" ]
mateusz.snamina@gmail.com
bbbd6312e6eac9ca580fda84f3dbdd7e8a089944
d2b81ede3d3a516f5313835ce07dfea97db46c87
/diophantine/quartics_simple2.1.cpp
c48d65a5dbf7bbfdbba2ce6bc3d3ef5b23557b7c
[]
no_license
p15-git-acc/code
8b847ad95cd59a13446f595ac65d96d6bc45b512
59337447523018dfab71cbbbda53b4bb88b7ce59
refs/heads/master
2022-12-16T14:38:09.073676
2020-09-16T09:23:00
2020-09-16T09:23:00
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,455
cpp
// version 2.1 use SSE instructions to move nodes // stop after first solution // #include "inttypes.h" #include "stdio.h" #include <stdlib.h> #include <malloc.h> #include <iostream> #include <assert.h> unsigned long int H; // runs to height<=H // 128 bit unsigned built in to GCC (efficiency?) typedef __uint128_t bigint; // a node in our heap typedef struct{ //unsigned int node_no; __attribute__ ((aligned(16))) long unsigned int a; long unsigned int b; bigint pq; } node; void print_bigint(bigint i) { printf("%ju",(uintmax_t) i); } void print_node(node n) { printf("[%lu,%lu,",n.a,n.b); print_bigint(n.pq); printf("]\n"); } void print_heap(node *heap, int last_one) { for(int i=0;i<=last_one;i++) print_node(heap[i]); } inline long unsigned int gcd (long unsigned int a, long unsigned int b) /* Euclid algorithm gcd */ { unsigned int c; while(a!=0) { c=a; a=b%a; b=c; }; return(b); }; inline long unsigned int gcd (long unsigned int a, long unsigned int b, long unsigned int c) { return(gcd(gcd(a,b),c)); } inline long unsigned int gcd (long unsigned int a, long unsigned int b, long unsigned int c, long unsigned int d) { return(gcd(gcd(a,b),gcd(c,d))); } void print_solution(node n1, node n2) { printf("solution found\n"); print_node(n1); print_node(n2); printf("Terminating search.\n"); //exit(0); } // res<-a*x^4 inline bigint p(long unsigned int x, long unsigned int a) { bigint res=x; res*=res; res*=res; res*=a; return(res); } // returns 0 if top <left and top < right // returns 1 if top > left < right // returns -1 if top > right < left inline int comp_nodes(node top, node left, node right) { if(left.pq<=right.pq) // left <= right { if(top.pq<=left.pq) // top <= left <= right return(0); else // top > left and top <= right return(1); // so swap left } // right < left if(top.pq<=right.pq) // top <= right < left return(0); else return(-1); } // use the 128 bit XMM registers to swap two nodes #define swap_node(x,y) \ { \ __asm( \ "movapd %0,%%XMM0\n\t" \ "movapd %1,%%XMM1\n\t" \ "movapd %%XMM0,%1\n\t" \ "movapd %%XMM1,%0\n\t" \ "movapd %2,%%XMM0\n\t" \ "movapd %3,%%XMM1\n\t" \ "movapd %%XMM0,%3\n\t" \ "movapd %%XMM1,%2" \ : "=m" (x), "=m" (y), "=m" (x.pq), "=m" (y.pq) \ : \ : "xmm0","xmm1"); \ } inline void balance_heap (node *heap, int heap_end) { int this_ptr=0,left_ptr,right_ptr,cmp; while(true) { left_ptr=(this_ptr<<1)+1; right_ptr=(this_ptr+1)<<1; if(left_ptr<=heap_end) // it has a left child { if(right_ptr<=heap_end) // it has a left and right children { cmp=comp_nodes(heap[this_ptr],heap[left_ptr],heap[right_ptr]); //printf("comp of %d %d %d returned %d\n",this_ptr,left_ptr,right_ptr,cmp); if(cmp>0) // swap with left { swap_node(heap[this_ptr],heap[left_ptr]); this_ptr=left_ptr; continue; } if(cmp<0) // swap with right { swap_node(heap[this_ptr],heap[right_ptr]); this_ptr=right_ptr; continue; } // parent node is in right place so stop return; } else // this node only has a left child { if(heap[left_ptr].pq<heap[this_ptr].pq) // left<this swap_node(heap[this_ptr],heap[left_ptr]); return; // tree is balanced } } else // this node is at bottom return; } } #define pop_node(heap,heap_end){heap[0]=heap[heap_end];\ balance_heap(heap,heap_end-1);} void check_eqn(long unsigned int A1, long unsigned int A2, long unsigned int A3, long unsigned int A4, node *lnodes, node *rnodes, bigint *ps, bigint *qs) { int cmp; bigint temp,temp1; // set up left heap temp1=p(1,A1); for(long unsigned int i=0;i<H;i++) { lnodes[i].a=1; lnodes[i].b=i+1; lnodes[i].pq=temp1+p(lnodes[i].b,A2); } //printf("Left heap now\n");print_heap(lnodes,H-1); // set up right heap temp1=p(1,A3); for(long unsigned int i=0;i<H;i++) { rnodes[i].a=1; rnodes[i].b=i+1; rnodes[i].pq=temp1+p(rnodes[i].b,A4); } //printf("Right heap now\n");print_heap(rnodes,H-1); int left_end=H-1; int right_end=H-1; while(true) { //printf("Iterating with left=");print_node(lnodes[0]); //printf(" and right=");print_node(rnodes[0]); if(lnodes[0].pq<rnodes[0].pq) // left<right { if(lnodes[0].a<H) // more left nodes to add { lnodes[0].pq+=ps[lnodes[0].a-1]; lnodes[0].a++; //printf("L Pushing ");print_node(lnodes[0]); balance_heap(lnodes,H-1); //print_heap(lnodes,H-1); } else // no more left nodes, so just pop pop_node(lnodes,left_end--); if(left_end<0) // heap empty { //print_node(rnodes[0]); printf("No solutions found.\n"); return; } continue; } if(lnodes[0].pq>rnodes[0].pq) // right<left { if(rnodes[0].a<H) { rnodes[0].pq+=qs[rnodes[0].a-1]; rnodes[0].a++; //printf("R Pushing ");print_node(rnodes[0]); balance_heap(rnodes,H-1); //print_heap(rnodes,H-1); } else pop_node(rnodes,right_end--); if(right_end<0) { //print_node(lnodes[0]); printf("No solutions found.\n"); return; } continue; } // right=left //if(gcd(lnodes[0].a,lnodes[0].b,rnodes[0].a,rnodes[0].b)==1) print_solution(lnodes[0],rnodes[0]); return; } } int main(int argc, char **argv) { node *lnodes,*rnodes,left_node,right_node; bigint *ps,*qs; int cmp; unsigned long int As[4]; // this defines the equation if(argc!=6) { printf("Incorrect command line, #args=%d\n",argc); exit(0); } H=atoi(argv[1]); for(int i=0;i<4;i++) As[i]=atoi(argv[i+2]); assert(lnodes=(node *) memalign(16,H*sizeof(node))); assert(rnodes=(node *) memalign(16,H*sizeof(node))); assert(ps=(bigint *) malloc(H*sizeof(bigint))); assert(qs=(bigint *) malloc(H*sizeof(bigint))); printf("Looking for solutions to %lux^4+%luy^4=%luu^4+%luv^4 to height %lu\n", As[0],As[1],As[2],As[3],H); for(int i=0;i<H;i++) { ps[i]=p(i+1,As[0]); qs[i]=p(i+1,As[2]); } for(int i=0;i<H-1;i++) { ps[i]=ps[i+1]-ps[i]; qs[i]=qs[i+1]-qs[i]; } check_eqn(As[0],As[1],As[2],As[3],lnodes,rnodes,ps,qs); }
[ "dave.platt@bris.ac.uk" ]
dave.platt@bris.ac.uk
839186555f6d89353b8553c2973044be962a1fc6
3a5b4dbc8c755e4ae2a041d52c9c486dcffa169f
/KALMAN_FILTER_PID.ino
e596386e791a61ddc82a741cfe91c12f43f74b68
[]
no_license
hamzakarim94/Control-Systems
fdd6c4f4545efdb82030d2731675e0c87a820203
005cd5f8309e0fb4f2c08842c2499da256640b64
refs/heads/main
2023-07-01T13:41:35.323069
2021-08-03T16:27:26
2021-08-03T16:27:26
392,381,152
0
0
null
null
null
null
UTF-8
C++
false
false
2,172
ino
#include "MegunoLink.h" float count[]={0,0}; float reading[]={0,0,0,0}; float EST[]={0,0}; float EST2[]={0,0}; float P_I_D2[]= {0,0}; float P_I_D[]= {0,0}; unsigned long input[]={0,0}; int M1F,M1B,M2F,M2B; float encoder_count, pgain1 ,pgain2,dgain,igain,igain2 ,dgain2,setpoint,I,I2,P,P2,D,D2 ,encoder_count2,time_counter, avg_speedy, avg_speedy2,Xkp,Xkp1,Tsright,Tsleft,PWM; float R = 0.45; float H = 1; float Q = 0.102; float Pk = 0; float U_hat = 0; float KG=0; int now_time,start_time; void setup() { // put your setup code here, to run once: M1F=6; M1B=5; M2F = 9; M2B = 10; // put your setup code here, to run once: pinMode(M1F, OUTPUT); pinMode(M1B, OUTPUT); pinMode(M2F, OUTPUT); pinMode(M2B, OUTPUT); pinMode(2, INPUT); pinMode(3, INPUT); // attachInterrupt(digitalPinToInterrupt(2), encode1, CHANGE); attachInterrupt(digitalPinToInterrupt(3), encode2, CHANGE); Serial.begin(9600); setpoint = 1 ; digitalWrite(M1B,LOW); digitalWrite(M2B,LOW); pgain2=2.53;//3.83; dgain2=0.033;//0.6; igain2=2.3; start_time = millis(); EST[0]= 0; EST2[0]= 0; } void loop() { now_time = millis(); int diff_time = now_time - start_time; if (diff_time >= 250) { start_time = now_time; reading[3] = (encoder_count2/20); EST2[1] =KALMAN(reading[3]); //PWM = 0.215*pow(P_I_D2[1],2)+13.7*(P_I_D2[1])-0.231; //if(PWM<0){PWM = 0;} P2=(setpoint-EST2[1])*(pgain2);//3 I=I+(setpoint-EST2[1]); I2 =17 + igain2*I;//0.5 //I2=I*igain2; D2=((setpoint-EST2[1])-(setpoint-EST2[0]))*dgain2; P_I_D2[1]= P2+I2+D2; analogWrite(M2F,P_I_D2[1]); Serial.println(EST2[1]); EST2[0]=EST2[1]; P_I_D2[0]=P_I_D2[1]; time_counter++; encoder_count2=0; encoder_count=0; } } void encode2() { encoder_count2++; //Serial.println(encoder_count); } void encode1() { encoder_count++; //Serial.println(encoder_count); } float KALMAN(float U) { KG = Pk*H/(H*Pk*H+R); U_hat = U_hat + KG*(U-U_hat); Pk = (1-KG*H)*Pk+Q; //Serial.println(KG); return U_hat; }
[ "noreply@github.com" ]
hamzakarim94.noreply@github.com
fd4ac2103f34ede5a20be5e98fcb1fe8d636217f
f859143b4f2fafc5619b822618339167556f3174
/CaSh/FastApp/DeferredShadingFastApp.h
67c60b643e06df03773a66c35fa6af6ad81568fa
[]
no_license
BentleyBlanks/SKTRenderer
ef8ee1d2e36259dd30becf9f3b48677da0472210
2f3cf944e2872920c21764c27ee8b10d4d9ad500
refs/heads/master
2021-04-15T17:19:27.654944
2018-03-06T08:32:48
2018-03-06T08:32:48
126,149,197
8
0
null
null
null
null
UTF-8
C++
false
false
4,227
h
#pragma once #include "FastApp.h" #include "d3d11.h" #include "D3DCompiler.h" #include <vector> #include "Vector3.h" #include "Vector2.h" #include "Matrix.h" using std::vector; #define PAD16(x) (((x)+15)/16*16) class DefferedShadingFastApp : public FastApp { public: struct Vertex_PNT { RBVector3 pos; RBVector3 normal; RBVector2 texcoord; }; struct Vertex_PNTT { RBVector3 pos; RBVector3 normal; RBVector2 texcoord; RBVector3 tangent; }; struct Vertex_PT { RBVector3 pos; RBVector2 texcoord; }; struct MatrixBuffer { RBMatrix m; RBMatrix v; RBMatrix p; }; struct ScreenSize { uint32 w; uint32 h; f32 hipow; float factor_l; RBMatrix inv_projection; RBMatrix mv; float metallic; int shading_model; }; virtual bool preinit() override; virtual bool init() override; virtual void update(f32 dt) override; virtual void draw() override; virtual void ter() override; virtual void postter() override; DefferedShadingFastApp(class AppBase* app); virtual ~DefferedShadingFastApp(); DefferedShadingFastApp(const DefferedShadingFastApp& o) = delete; DefferedShadingFastApp& operator=(const DefferedShadingFastApp& o) = delete; protected: void load_models_generate_buffer(const char* filename); void load_assets(); void create_rhires(); void set_matrix(const RBMatrix& m,const RBMatrix& v,const RBMatrix& p); void set_screen_size(); void set_gpass_vbuffer(); void handle_input(f32 dt); private: void show_error_message(ID3D10Blob* error, const char* filename); ID3D11Texture2D* _bufferA; ID3D11RenderTargetView* _bufferA_target_view; ID3D11ShaderResourceView* _bufferA_shader_view; ID3D11Texture2D* _bufferB; ID3D11RenderTargetView* _bufferB_target_view; ID3D11ShaderResourceView* _bufferB_shader_view; ID3D11Texture2D* _bufferC; ID3D11RenderTargetView* _bufferC_target_view; ID3D11ShaderResourceView* _bufferC_shader_view; ID3D11Texture2D* _bufferDepth; ID3D11RenderTargetView* _bufferDepth_target_view; ID3D11ShaderResourceView* _bufferDepth_shader_view; ID3D11Texture2D* _buffer_lighting; ID3D11RenderTargetView* _buffer_lighting_target_view; ID3D11ShaderResourceView* _buffer_lighting_shader_view; ID3D11Texture2D* _buffer_depth_stencil; ID3D11ShaderResourceView* _buffer_depth_stencil_shader_view; ID3D11DepthStencilView* _buffer_depth_stencil_ds_view; ID3D11Texture2D* _env_texture; ID3D11ShaderResourceView* _env_texture_shader_view; ID3D11Texture2D* _mat_texture; ID3D11ShaderResourceView* _mat_texture_shader_view; ID3D11Texture2D* _normal_texture; ID3D11ShaderResourceView* _normal_texture_shader_view; ID3D11Texture2D* _env_texture_single; ID3D11ShaderResourceView* _env_texture_single_shader_view; ID3D11Texture2D* _env_texture_hdr; ID3D11ShaderResourceView* _env_texture_hdr_shader_view; /** models */ ID3D11Buffer* _index_buffer; ID3D11Buffer* _vertex_buffer; ID3D11Texture2D* _texture1; ID3D11ShaderResourceView* _texture1_sview; ID3D11Buffer* _index_buffer_lighting; ID3D11Buffer* _vertex_buffer_lighting; ID3D11VertexShader* _def_vertex_shader; ID3D11GeometryShader* _def_geometry_shader; ID3D11PixelShader* _def_pixel_shader; ID3D11VertexShader* _def_vertex_shader_light; ID3D11PixelShader* _def_pixel_shader_light; ID3D11DepthStencilState* _depth_stencil_state; ID3D11DepthStencilState* _depth_stencil_state_disable; ID3D11BlendState* _blending_state; ID3D11BlendState* _blending_state_disable; ID3D11Buffer* _matrix_buffer; ID3D11Buffer* _screen_size_buffer; ID3D11Buffer* _dv_cbuffer; ID3D11InputLayout* _layout; ID3D11InputLayout* _layout_lighting; ID3D11SamplerState* _sample_state; ID3D11RasterizerState* _raster_state; ID3D11Device* _device; ID3D11DeviceContext* _context; IDXGIFactory1* _gi_factory; std::vector<Vertex_PNTT> _vecs; std::vector<u32> _idxs; Vertex_PT quad[4]; uint16 quad_idx[6]; class RBCamera* _cam; RBVector2 _cam_move_speed; RBVector2 _cam_rotate_speed; int old_x, old_y; float _high_light; float _factor_l; float _metallic; int _shading_model; float _zplus; pD3DCompile compile_shader; HMODULE CompilerDLL; };
[ "wubuguiqazwsxmail@gmail.com" ]
wubuguiqazwsxmail@gmail.com
f4ed8d15020018036765ada5b58cc7176fb344ee
cfb800c5125eab02977d786ff2a9d352ed7f8975
/Tron3k/Project/Core/Game/Role/Weapon/WeaponTypes/Mobility/Melee.cpp
5c424a5a6d55aa76d73dd6ef35c10559eed2f77d
[]
no_license
Pristin/Tron3k
8e83b09b16731f7b9d305ce3f125965dc14687bd
57d267eccbcdf1185df54290620d5a67acca0969
refs/heads/master
2020-05-23T10:20:42.033667
2017-01-30T13:26:39
2017-01-30T13:26:39
80,422,879
0
0
null
null
null
null
UTF-8
C++
false
false
555
cpp
#include"Melee.h" Melee::Melee() { } Melee::~Melee() { } bool Melee::shoot() { bool ableToShoot = false; if (firingSpeedCurrentDelay < FLT_EPSILON) { firingSpeedCurrentDelay = firingSpeed; ableToShoot = true; } return ableToShoot; } void Melee::init() { weaponType = WEAPON_TYPE::MELEE; maxClipSize = 1; currentClipAmmo = maxClipSize; currentBulletId = 0; firingSpeed = 1.0f; firingSpeedCurrentDelay = 0; reloadTime = 0.0f; rldTimer = 0; } int Melee::update(float deltaTime) { countDownFiringSpeed(deltaTime); return 0; }
[ "martin_nygren9405@hotmail.com" ]
martin_nygren9405@hotmail.com
4bc98fe098a90d4dde61f6c653cb787cb4567e5a
4436cff177e22f2f7bef995e9ac5bd1c1cbd17d0
/ProjectKatamari/PKCameraManager.h
d598fe41aaba701f0eee6d2cf554d98c15b126af
[]
no_license
zrma/ComputerGraphics
3f969bc24e599005e32545ea661b9de98b5f920a
cb3f9efdb504d3688aa5483b99a0b21eed4d7fa6
refs/heads/master
2016-09-06T17:11:53.263294
2014-02-25T07:10:57
2014-02-25T07:10:57
null
0
0
null
null
null
null
UTF-8
C++
false
false
578
h
#pragma once #include "PKDefine.h" #include "PKEnumSet.h" typedef array2d_<GLfloat, MATRIX_3D_ROW, MATRIX_3D_COL>::type GLmatrix; class CPKCameraManager { SINGLETON(CPKCameraManager); private: CPKCameraManager(void); ~CPKCameraManager(void); public: void Init(); void Update(); GLmatrix GetMatrix() { return m_Matrix; } void MatrixInverse(GLfloat *OpenGLmatIn, GLfloat *matOut); void SetFocus( int x, int y ) { m_FocusX = x; m_FocusY = y; } private: void CalcMatrix( TransType trans, int sign ); int m_FocusX; int m_FocusY; GLmatrix m_Matrix; };
[ "bulbitain@nhnnext.org" ]
bulbitain@nhnnext.org
e14e3a6385e7110aa4f29b05699d6734731689dd
5a7c45fd67dcc04a3f78f31b850349a1a3883b3a
/jmidi/jdksmidi_track.cpp
9093c8f36d0cef3f9a4ea794cae9da1f71fab910
[]
no_license
bergsail/pianopi
1f1daf567321852f160445afffbe59548a365ae9
707dd03721351485e4eced8453892fe9c2fb2ec3
refs/heads/master
2020-12-24T07:48:23.679038
2016-11-10T10:12:52
2016-11-10T10:12:52
73,365,219
4
1
null
null
null
null
UTF-8
C++
false
false
14,122
cpp
/* * libjdksmidi-2004 C++ Class Library for MIDI * * Copyright (C) 2004 J.D. Koftinoff Software, Ltd. * www.jdkoftinoff.com * jeffk@jdkoftinoff.com * * *** RELEASED UNDER THE GNU GENERAL PUBLIC LICENSE (GPL) April 27, 2004 *** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ** Copyright 1986 to 1998 By J.D. Koftinoff Software, Ltd. ** ** All rights reserved. ** ** No one may duplicate this source code in any form for any reason ** without the written permission given by J.D. Koftinoff Software, Ltd. ** */ // // Copyright (C) 2010 V.R.Madgazin // www.vmgames.com vrm@vmgames.com // #include "world.h" #include "track.h" #ifndef DEBUG_MDTRACK # define DEBUG_MDTRACK 0 #endif #if DEBUG_MDTRACK # undef DBG # define DBG(a) a #endif namespace jdksmidi { const MIDITimedBigMessage * MIDITrackChunk::GetEventAddress ( int event_num ) const { return &buf[event_num]; } MIDITimedBigMessage * MIDITrackChunk::GetEventAddress ( int event_num ) { return &buf[event_num]; } MIDITrack::MIDITrack ( int size ) { buf_size = 0; num_events = 0; for ( int i = 0; i < MIDIChunksPerTrack; ++i ) chunk[i] = 0; if ( size ) { Expand ( size ); } } MIDITrack::MIDITrack ( const MIDITrack &t ) { buf_size = 0; num_events = 0; for ( int i = 0; i < t.GetNumEvents(); ++i ) { const MIDITimedBigMessage *src; src = t.GetEventAddress ( i ); PutEvent ( *src ); // it execute Expand() } } MIDITrack::~MIDITrack() { for ( int i = 0; i < buf_size / MIDITrackChunkSize; ++i ) { jdks_safe_delete_object( chunk[i] ); // VRM } } void MIDITrack::Clear() { num_events = 0; } bool MIDITrack::EventsOrderOK() const // funcVRM { if ( num_events < 2 ) return true; MIDIClockTime time0 = GetEventAddress(0)->GetTime(); for ( int i = 1; i < num_events; ++i ) { MIDIClockTime time1 = GetEventAddress(i)->GetTime(); if ( time0 > time1 ) return false; time0 = time1; } return true; } void MIDITrack::SortEventsOrder() // funcVRM { std::vector< Event_time > et( num_events ); int n; for ( n = 0; n < num_events; ++n ) { et[n].event_number = n; et[n].time = GetEventAddress(n)->GetTime(); } std::stable_sort( et.begin(), et.end(), Event_time::less ); MIDITrack trk( num_events ); for ( n = 0; n < num_events; ++n ) { int event_num = et[n].event_number; const MIDITimedBigMessage *src; src = GetEventAddress( event_num ); trk.PutEvent( *src ); // add src event to trk } *this = trk; } int MIDITrack::RemoveIdenticalEvents( int max_distance_between_identical_events ) // funcVRM { int removed = 0; for ( int n = 0; n < num_events; ++n ) { MIDITimedBigMessage *mn = GetEvent( n ); for (int i = 1; i < max_distance_between_identical_events; ++i) { if ( (n+i) >= num_events ) break; MIDITimedBigMessage *mni = GetEvent( n+i ); if ( *mn == *mni ) { ++removed; MakeEventNoOp( n ); break; } } } return removed; } const MIDITrack & MIDITrack::operator = ( const MIDITrack & src ) // funcVRM { if ( num_events == src.num_events ) { for ( int n = 0; n < num_events; ++n ) { const MIDITimedBigMessage * msg = src.GetEventAddress( n ); SetEvent( n, *msg ); } } else { this->~MIDITrack(); buf_size = 0; num_events = 0; for ( int i = 0; i < src.GetNumEvents(); ++i ) { const MIDITimedBigMessage *msg = src.GetEventAddress ( i ); PutEvent ( *msg ); // it execute Expand() } } return *this; } void MIDITrack::ClearAndMerge ( const MIDITrack *src1, const MIDITrack *src2 ) { Clear(); const MIDITimedBigMessage *ev1; int cur_trk1ev = 0; int num_trk1ev = src1->GetNumEvents(); const MIDITimedBigMessage *ev2; int cur_trk2ev = 0; int num_trk2ev = src2->GetNumEvents(); MIDIClockTime last_data_end_time = 0; while ( cur_trk1ev < num_trk1ev || cur_trk2ev < num_trk2ev ) { // skip any NOPs on track 1 ev1 = src1->GetEventAddress ( cur_trk1ev ); ev2 = src2->GetEventAddress ( cur_trk2ev ); bool has_ev1 = ( cur_trk1ev < num_trk1ev ) && ev1; bool has_ev2 = ( cur_trk2ev < num_trk2ev ) && ev2; if ( has_ev1 && ev1->IsNoOp() ) { cur_trk1ev++; continue; } // skip any NOPs on track 2 if ( has_ev2 && ev2->IsNoOp() ) { cur_trk2ev++; continue; } // skip all data end if ( has_ev1 && ev1->IsDataEnd() ) { if ( ev1->GetTime() > last_data_end_time ) { last_data_end_time = ev1->GetTime(); } cur_trk1ev++; continue; } if ( has_ev2 && ev2->IsDataEnd() ) { if ( ev2->GetTime() > last_data_end_time ) { last_data_end_time = ev2->GetTime(); } cur_trk2ev++; continue; } if ( ( has_ev1 && !has_ev2 ) ) { // nothing left on trk 2 if ( !ev1->IsNoOp() ) { if ( ev1->GetTime() > last_data_end_time ) { last_data_end_time = ev1->GetTime(); } PutEvent ( *ev1 ); ++cur_trk1ev; } } else if ( ( !has_ev1 && has_ev2 ) ) { // nothing left on trk 1 if ( !ev2->IsNoOp() ) { PutEvent ( *ev2 ); ++cur_trk2ev; } } else if ( has_ev1 && has_ev2 ) { int trk = 1; if ( ( ev1->GetTime() <= ev2->GetTime() ) ) { trk = 1; } else { trk = 2; } if ( trk == 1 ) { if ( ev1->GetTime() > last_data_end_time ) { last_data_end_time = ev1->GetTime(); } PutEvent ( *ev1 ); ++cur_trk1ev; } else { if ( ev2->GetTime() > last_data_end_time ) { last_data_end_time = ev2->GetTime(); } PutEvent ( *ev2 ); ++cur_trk2ev; } } } // put single final data end event MIDITimedBigMessage dataend; dataend.SetTime ( last_data_end_time ); dataend.SetDataEnd(); PutEvent ( dataend ); } #if 0 bool MIDITrack::Insert ( int start_event, int num ) { // TO DO: Insert return true; } bool MIDITrack::Delete ( int start_event, int num ) { // TO DO: Delete return true; } void MIDITrack::QSort ( int left, int right ) { int i, j; MIDITimedBigMessage *x, y; i = left; j = right; // search for a non NOP message for our median int pos = ( left + right ) / 2; for ( ; pos <= right; ++pos ) { x = GetEventAddress ( pos ); if ( x && !x->IsNoOp() ) break; } if ( GetEventAddress ( pos )->IsNoOp() ) { for ( pos = ( left + right ) / 2; pos >= left; --pos ) { x = GetEventAddress ( pos ); if ( x && !x->IsNoOp() ) break; } } if ( x && x->IsNoOp() ) return; do { while ( MIDITimedMessage::CompareEvents ( *GetEventAddress ( i ), *x ) == 2 && i < right ) ++i; while ( MIDITimedMessage::CompareEvents ( *x, *GetEventAddress ( j ) ) == 2 && j > left ) --j; if ( i <= j ) { y = *GetEventAddress ( i ); *GetEventAddress ( i ) = *GetEventAddress ( j ); *GetEventAddress ( j ) = y; ++i; --j; } } while ( i <= j ); if ( left < j ) { QSort ( left, j ); } if ( i < right ) { QSort ( i, right ); } } void MIDITrack::Sort() { // // A simple single buffer sorting algorithm. // // first, see if we need sorting by checking each element // with the next. they should all be in order. // // if not, do qsort algorithm unsigned int i; unsigned int first_out_of_order_item = 0; for ( i = 0; i < num_events - 1; ++i ) { first_out_of_order_item = i + 1; if ( MIDITimedMessage::CompareEvents ( *GetEventAddress ( i ), *GetEventAddress ( first_out_of_order_item ) ) == 1 ) break; } if ( first_out_of_order_item >= num_events - 1 ) { // return; // no need for sort } QSort ( 0, num_events - 1 ); } #endif void MIDITrack::Shrink() { int num_chunks_used = ( int ) ( ( num_events / MIDITrackChunkSize ) + 1 ); int num_chunks_alloced = ( int ) ( buf_size / MIDITrackChunkSize ); if ( num_chunks_used < num_chunks_alloced ) { for ( int i = num_chunks_used; i < num_chunks_alloced; ++i ) { jdks_safe_delete_object( chunk[i] ); } buf_size = num_chunks_used * MIDITrackChunkSize; } } bool MIDITrack::Expand ( int increase_amount ) { int num_chunks_to_expand = ( int ) ( ( increase_amount / MIDITrackChunkSize ) + 1 ); int num_chunks_alloced = ( int ) ( buf_size / MIDITrackChunkSize ); int new_last_chunk_num = ( int ) ( num_chunks_to_expand + num_chunks_alloced ); if ( new_last_chunk_num >= MIDIChunksPerTrack ) { return false; } for ( int i = num_chunks_alloced; i < new_last_chunk_num; ++i ) { chunk[i] = new MIDITrackChunk; if ( !chunk[i] ) { buf_size = ( i - 1 ) * MIDITrackChunkSize; return false; } } buf_size = new_last_chunk_num * MIDITrackChunkSize; return true; } MIDITimedBigMessage * MIDITrack::GetEventAddress ( int event_num ) { return chunk[ event_num/ ( MIDITrackChunkSize ) ]->GetEventAddress ( ( event_num % MIDITrackChunkSize ) ); } const MIDITimedBigMessage * MIDITrack::GetEventAddress ( int event_num ) const { return chunk[ event_num/ ( MIDITrackChunkSize ) ]->GetEventAddress ( ( event_num % MIDITrackChunkSize ) ); } bool MIDITrack::PutEvent ( const MIDITimedBigMessage &msg ) { if ( num_events >= buf_size ) { if ( !Expand() ) return false; } GetEventAddress ( num_events++ )->Copy ( msg ); return true; } bool MIDITrack::PutEvent2 ( MIDITimedBigMessage &msg ) // funcVRM { if ( PutEvent ( msg ) ) { MIDIClockTime t = msg.GetTime(); msg.Clear(); msg.SetTime( t ); return true; } return false; } bool MIDITrack::PutEvent ( const MIDITimedMessage &msg, const MIDISystemExclusive *sysex ) // VRM { MIDITimedBigMessage m ( msg, sysex ); // VRM return PutEvent ( m ); // VRM } bool MIDITrack::PutTextEvent ( MIDIClockTime time, int meta_event_type, const char *text, int length ) // funcVRM { MIDITimedMessage msg; msg.SetTime( time ); msg.SetMetaEvent( meta_event_type , 0 ); if ( length == 0 ) length = (int) strlen( text ); MIDISystemExclusive sysex( length ); for ( int i = 0; i < length; ++i ) sysex.PutSysByte ( text[i] ); return PutEvent( msg, &sysex ); } bool MIDITrack::GetEvent ( int event_num, MIDITimedBigMessage *msg ) const { if ( event_num >= num_events ) { return false; } else { msg->Copy ( *GetEventAddress ( event_num ) ); return true; } } bool MIDITrack::SetEvent ( int event_num, const MIDITimedBigMessage &msg ) { if ( event_num >= num_events ) { return false; } else { GetEventAddress ( event_num )->Copy ( msg ); return true; } } bool MIDITrack::MakeEventNoOp ( int event_num ) { if ( event_num >= num_events ) { return false; } else { MIDITimedBigMessage *ev = GetEventAddress ( event_num ); if ( ev ) ev->SetNoOp(); // VRM return true; } } bool MIDITrack::FindEventNumber ( MIDIClockTime time, int *event_num ) const { ENTER ( "MIDITrack::FindEventNumber( int , int * )" ); // TO DO: try make this a binary search for ( int i = 0; i < num_events; ++i ) { const MIDITimedBigMessage *msg = GetEventAddress ( i ); if ( msg->GetTime() >= time ) { *event_num = i; return true; } } *event_num = num_events; return false; } const MIDITimedBigMessage *MIDITrack::GetEvent ( int event_num ) const { if ( event_num >= num_events ) { return 0; } else { return GetEventAddress ( event_num ); } } MIDITimedBigMessage *MIDITrack::GetEvent ( int event_num ) { if ( event_num >= num_events ) { return 0; } else { return GetEventAddress ( event_num ); } } }
[ "noreply@github.com" ]
bergsail.noreply@github.com
31f6069c929005fe3778b44390abdb48474dfb28
8b28fd4982c102e615849b294b8a6b64eeceb017
/src/net.cpp
179b99e1730485e6e914b1a07b7150a7da91a2d7
[ "MIT" ]
permissive
RdeWilde/Breakout-Chain-Client
40147c502b45a41ccc0915b485260594eec11668
76c328f75dbce0250550892c30089ce168a85420
refs/heads/master
2020-05-23T07:54:11.751146
2016-12-01T20:07:25
2016-12-01T20:07:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
58,328
cpp
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "irc.h" #include "db.h" #include "net.h" #include "init.h" #include "strlcpy.h" #include "addrman.h" #include "ui_interface.h" #include "onionseed.h" #ifdef WIN32 #include <string.h> #endif #ifdef USE_UPNP #include <miniupnpc/miniwget.h> #include <miniupnpc/miniupnpc.h> #include <miniupnpc/upnpcommands.h> #include <miniupnpc/upnperrors.h> #endif extern unsigned short onion_port; using namespace std; using namespace boost; extern "C" { int tor_main(int argc, char *argv[]); } static const int MAX_OUTBOUND_CONNECTIONS = 16; void ThreadMessageHandler2(void* parg); void ThreadSocketHandler2(void* parg); void ThreadOpenConnections2(void* parg); void ThreadOpenAddedConnections2(void* parg); #ifdef USE_UPNP void ThreadMapPort2(void* parg); #endif void ThreadDNSAddressSeed2(void* parg); bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false); struct LocalServiceInfo { int nScore; int nPort; }; // // Global state variables // bool fClient = false; bool fDiscover = true; bool fUseUPnP = false; uint64_t nLocalServices = (fClient ? 0 : NODE_NETWORK); static CCriticalSection cs_mapLocalHost; static map<CNetAddr, LocalServiceInfo> mapLocalHost; static bool vfReachable[NET_MAX] = {}; static bool vfLimited[NET_MAX] = {}; static CNode* pnodeLocalHost = NULL; CAddress addrSeenByPeer(CService("0.0.0.0", 0), nLocalServices); uint64_t nLocalHostNonce = 0; array<int, THREAD_MAX> vnThreadsRunning; static std::vector<SOCKET> vhListenSocket; CAddrMan addrman; vector<CNode*> vNodes; CCriticalSection cs_vNodes; map<CInv, CDataStream> mapRelay; deque<pair<int64_t, CInv> > vRelayExpiration; CCriticalSection cs_mapRelay; map<CInv, int64_t> mapAlreadyAskedFor; static deque<string> vOneShots; CCriticalSection cs_vOneShots; set<CNetAddr> setservAddNodeAddresses; CCriticalSection cs_setservAddNodeAddresses; static CSemaphore *semOutbound = NULL; void AddOneShot(string strDest) { LOCK(cs_vOneShots); vOneShots.push_back(strDest); } unsigned short GetListenPort() { return (unsigned short)(GetArg("-port", GetDefaultPort())); } unsigned short GetTorPort() { return onion_port; } void CNode::PushGetBlocks(CBlockIndex* pindexBegin, uint256 hashEnd) { // Filter out duplicate requests if (pindexBegin == pindexLastGetBlocksBegin && hashEnd == hashLastGetBlocksEnd) return; pindexLastGetBlocksBegin = pindexBegin; hashLastGetBlocksEnd = hashEnd; PushMessage("getblocks", CBlockLocator(pindexBegin), hashEnd); } // find 'best' local address for a particular peer bool GetLocal(CService& addr, const CNetAddr *paddrPeer) { if (fNoListen) return false; int nBestScore = -1; int nBestReachability = -1; { LOCK(cs_mapLocalHost); for (map<CNetAddr, LocalServiceInfo>::iterator it = mapLocalHost.begin(); it != mapLocalHost.end(); it++) { int nScore = (*it).second.nScore; int nReachability = (*it).first.GetReachabilityFrom(paddrPeer); if (nReachability > nBestReachability || (nReachability == nBestReachability && nScore > nBestScore)) { addr = CService((*it).first, (*it).second.nPort); nBestReachability = nReachability; nBestScore = nScore; } } } return nBestScore >= 0; } // get best local address for a particular peer as a CAddress CAddress GetLocalAddress(const CNetAddr *paddrPeer) { CAddress ret(CService("0.0.0.0",0),0); CService addr; if (GetLocal(addr, paddrPeer)) { ret = CAddress(addr); ret.nServices = nLocalServices; ret.nTime = GetAdjustedTime(); } return ret; } bool RecvLine(SOCKET hSocket, string& strLine) { strLine = ""; while (true) { char c; int nBytes = recv(hSocket, &c, 1, 0); if (nBytes > 0) { if (c == '\n') continue; if (c == '\r') return true; strLine += c; if (strLine.size() >= 9000) return true; } else if (nBytes <= 0) { if (fShutdown) return false; if (nBytes < 0) { int nErr = WSAGetLastError(); if (nErr == WSAEMSGSIZE) continue; if (nErr == WSAEWOULDBLOCK || nErr == WSAEINTR || nErr == WSAEINPROGRESS) { MilliSleep(10); continue; } } if (!strLine.empty()) return true; if (nBytes == 0) { // socket closed printf("socket closed\n"); return false; } else { // socket error int nErr = WSAGetLastError(); printf("recv failed: %d\n", nErr); return false; } } } } // Is our peer's addrLocal potentially useful as an external IP source? bool IsPeerAddrLocalGood(CNode *pnode) { return fDiscover && pnode->addr.IsRoutable() && pnode->addrLocal.IsRoutable() && !IsLimited(pnode->addrLocal.GetNetwork()); } // used when scores of local addresses may have changed // pushes better local address to peers void static AdvertizeLocal() { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) { if (pnode->fSuccessfullyConnected) { CAddress addrLocal = GetLocalAddress(&pnode->addr); if (addrLocal.IsRoutable() && (CService)addrLocal != (CService)pnode->addrLocal) { pnode->PushAddress(addrLocal); pnode->addrLocal = addrLocal; } } } } void SetReachable(enum Network net, bool fFlag) { LOCK(cs_mapLocalHost); vfReachable[net] = fFlag; if (net == NET_IPV6 && fFlag) vfReachable[NET_IPV4] = true; } // learn a new local address bool AddLocal(const CService& addr, int nScore) { if (!addr.IsRoutable()) return false; if (!fDiscover && nScore < LOCAL_MANUAL) return false; if (IsLimited(addr)) return false; printf("AddLocal(%s,%i)\n", addr.ToString().c_str(), nScore); { LOCK(cs_mapLocalHost); bool fAlready = mapLocalHost.count(addr) > 0; LocalServiceInfo &info = mapLocalHost[addr]; if (!fAlready || nScore >= info.nScore) { info.nScore = nScore + (fAlready ? 1 : 0); info.nPort = addr.GetPort(); } SetReachable(addr.GetNetwork()); } AdvertizeLocal(); return true; } bool AddLocal(const CNetAddr &addr, int nScore) { return AddLocal(CService(addr, GetListenPort()), nScore); } /** Make a particular network entirely off-limits (no automatic connects to it) */ void SetLimited(enum Network net, bool fLimited) { if (net == NET_UNROUTABLE) return; LOCK(cs_mapLocalHost); vfLimited[net] = fLimited; } bool IsLimited(enum Network net) { LOCK(cs_mapLocalHost); return vfLimited[net]; } bool IsLimited(const CNetAddr &addr) { return IsLimited(addr.GetNetwork()); } /** vote for a local address */ bool SeenLocal(const CService& addr) { { LOCK(cs_mapLocalHost); if (mapLocalHost.count(addr) == 0) return false; mapLocalHost[addr].nScore++; } AdvertizeLocal(); return true; } /** check whether a given address is potentially local */ bool IsLocal(const CService& addr) { LOCK(cs_mapLocalHost); return mapLocalHost.count(addr) > 0; } /** check whether a given address is in a network we can probably connect to */ bool IsReachable(const CNetAddr& addr) { LOCK(cs_mapLocalHost); enum Network net = addr.GetNetwork(); return vfReachable[net] && !vfLimited[net]; } bool GetMyExternalIP2(const CService& addrConnect, const char* pszGet, const char* pszKeyword, CNetAddr& ipRet) { SOCKET hSocket; if (!ConnectSocket(addrConnect, hSocket)) return error("GetMyExternalIP() : connection to %s failed", addrConnect.ToString().c_str()); send(hSocket, pszGet, strlen(pszGet), MSG_NOSIGNAL); string strLine; while (RecvLine(hSocket, strLine)) { if (strLine.empty()) // HTTP response is separated from headers by blank line { while (true) { if (!RecvLine(hSocket, strLine)) { closesocket(hSocket); return false; } if (pszKeyword == NULL) break; if (strLine.find(pszKeyword) != string::npos) { strLine = strLine.substr(strLine.find(pszKeyword) + strlen(pszKeyword)); break; } } closesocket(hSocket); if (strLine.find("<") != string::npos) strLine = strLine.substr(0, strLine.find("<")); strLine = strLine.substr(strspn(strLine.c_str(), " \t\n\r")); while (strLine.size() > 0 && isspace(strLine[strLine.size()-1])) strLine.resize(strLine.size()-1); CService addr(strLine,0,true); printf("GetMyExternalIP() received [%s] %s\n", strLine.c_str(), addr.ToString().c_str()); if (!addr.IsValid() || !addr.IsRoutable()) return false; ipRet.SetIP(addr); return true; } } closesocket(hSocket); return error("GetMyExternalIP() : connection closed"); } // We now get our external IP from the IRC server first and only use this as a backup bool GetMyExternalIP(CNetAddr& ipRet) { CService addrConnect; const char* pszGet; const char* pszKeyword; for (int nLookup = 0; nLookup <= 1; nLookup++) for (int nHost = 1; nHost <= 2; nHost++) { // We should be phasing out our use of sites like these. If we need // replacements, we should ask for volunteers to put this simple // php file on their web server that prints the client IP: // <?php echo $_SERVER["REMOTE_ADDR"]; ?> if (nHost == 1) { addrConnect = CService("91.198.22.70",80); // checkip.dyndns.org if (nLookup == 1) { CService addrIP("checkip.dyndns.org", 80, true); if (addrIP.IsValid()) addrConnect = addrIP; } pszGet = "GET / HTTP/1.1\r\n" "Host: checkip.dyndns.org\r\n" "User-Agent: breakout\r\n" "Connection: close\r\n" "\r\n"; pszKeyword = "Address:"; } else if (nHost == 2) { addrConnect = CService("74.208.43.192", 80); // www.showmyip.com if (nLookup == 1) { CService addrIP("www.showmyip.com", 80, true); if (addrIP.IsValid()) addrConnect = addrIP; } pszGet = "GET /simple/ HTTP/1.1\r\n" "Host: www.showmyip.com\r\n" "User-Agent: breakout\r\n" "Connection: close\r\n" "\r\n"; pszKeyword = NULL; // Returns just IP address } if (GetMyExternalIP2(addrConnect, pszGet, pszKeyword, ipRet)) return true; } return false; } void ThreadGetMyExternalIP(void* parg) { // Make this thread recognisable as the external IP detection thread RenameThread("breakout-ext-ip"); CNetAddr addrLocalHost; if (GetMyExternalIP(addrLocalHost)) { printf("GetMyExternalIP() returned %s\n", addrLocalHost.ToStringIP().c_str()); AddLocal(addrLocalHost, LOCAL_HTTP); } } void AddressCurrentlyConnected(const CService& addr) { addrman.Connected(addr); } CNode* FindNode(const CNetAddr& ip) { { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) if ((CNetAddr)pnode->addr == ip) return (pnode); } return NULL; } CNode* FindNode(std::string addrName) { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) if (pnode->addrName == addrName) return (pnode); return NULL; } CNode* FindNode(const CService& addr) { { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) if ((CService)pnode->addr == addr) return (pnode); } return NULL; } CNode* ConnectNode(CAddress addrConnect, const char *pszDest) { if (pszDest == NULL) { if (IsLocal(addrConnect)) return NULL; // Look for an existing connection CNode* pnode = FindNode((CService)addrConnect); if (pnode) { pnode->AddRef(); return pnode; } } /// debug print printf("trying connection %s lastseen=%.1fhrs\n", pszDest ? pszDest : addrConnect.ToString().c_str(), pszDest ? 0 : (double)(GetAdjustedTime() - addrConnect.nTime)/3600.0); // Connect SOCKET hSocket; if (pszDest ? ConnectSocketByName(addrConnect, hSocket, pszDest, GetDefaultPort()) : ConnectSocket(addrConnect, hSocket)) { addrman.Attempt(addrConnect); /// debug print printf("connected %s\n", pszDest ? pszDest : addrConnect.ToString().c_str()); // Set to non-blocking #ifdef WIN32 u_long nOne = 1; if (ioctlsocket(hSocket, FIONBIO, &nOne) == SOCKET_ERROR) printf("ConnectSocket() : ioctlsocket non-blocking setting failed, error %d\n", WSAGetLastError()); #else if (fcntl(hSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR) printf("ConnectSocket() : fcntl non-blocking setting failed, error %d\n", errno); #endif // Add node CNode* pnode = new CNode(hSocket, addrConnect, pszDest ? pszDest : "", false); pnode->AddRef(); { LOCK(cs_vNodes); vNodes.push_back(pnode); } pnode->nTimeConnected = GetTime(); return pnode; } else { return NULL; } } void CNode::CloseSocketDisconnect() { fDisconnect = true; if (hSocket != INVALID_SOCKET) { printf("disconnecting node %s\n", addrName.c_str()); closesocket(hSocket); hSocket = INVALID_SOCKET; vRecv.clear(); } } void CNode::Cleanup() { } void CNode::PushVersion() { /// when NTP implemented, change to just nTime = GetAdjustedTime() int64_t nTime = (fInbound ? GetAdjustedTime() : GetTime()); CAddress addrYou = (addr.IsRoutable() && !IsProxy(addr) ? addr : CAddress(CService("0.0.0.0",0))); CAddress addrMe = GetLocalAddress(&addr); RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce)); printf("send version message: version %d, blocks=%d, us=%s, them=%s, peer=%s\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString().c_str(), addrYou.ToString().c_str(), addr.ToString().c_str()); PushMessage("version", PROTOCOL_VERSION, nLocalServices, nTime, addrYou, addrMe, nLocalHostNonce, FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector<string>()), nBestHeight); } std::map<CNetAddr, int64_t> CNode::setBanned; CCriticalSection CNode::cs_setBanned; void CNode::ClearBanned() { setBanned.clear(); } bool CNode::IsBanned(CNetAddr ip) { bool fResult = false; { LOCK(cs_setBanned); std::map<CNetAddr, int64_t>::iterator i = setBanned.find(ip); if (i != setBanned.end()) { int64_t t = (*i).second; if (GetTime() < t) fResult = true; } } return fResult; } bool CNode::Misbehaving(int howmuch) { if (addr.IsLocal()) { printf("Warning: Local node %s misbehaving (delta: %d)!\n", addrName.c_str(), howmuch); return false; } nMisbehavior += howmuch; if (nMisbehavior >= GetArg("-banscore", 100)) { int64_t banTime = GetTime()+GetArg("-bantime", 60*60*24); // Default 24-hour ban printf("Misbehaving: %s (%d -> %d) DISCONNECTING\n", addr.ToString().c_str(), nMisbehavior-howmuch, nMisbehavior); { LOCK(cs_setBanned); if (setBanned[addr] < banTime) setBanned[addr] = banTime; } CloseSocketDisconnect(); return true; } else printf("Misbehaving: %s (%d -> %d)\n", addr.ToString().c_str(), nMisbehavior-howmuch, nMisbehavior); return false; } #undef X #define X(name) stats.name = name void CNode::copyStats(CNodeStats &stats) { X(nServices); X(nLastSend); X(nLastRecv); X(nTimeConnected); X(addrName); X(nVersion); X(strSubVer); X(fInbound); X(nStartingHeight); X(nMisbehavior); } #undef X void ThreadSocketHandler(void* parg) { // Make this thread recognisable as the networking thread RenameThread("breakout-net"); try { vnThreadsRunning[THREAD_SOCKETHANDLER]++; ThreadSocketHandler2(parg); vnThreadsRunning[THREAD_SOCKETHANDLER]--; } catch (std::exception& e) { vnThreadsRunning[THREAD_SOCKETHANDLER]--; PrintException(&e, "ThreadSocketHandler()"); } catch (...) { vnThreadsRunning[THREAD_SOCKETHANDLER]--; throw; // support pthread_cancel() } printf("ThreadSocketHandler exited\n"); } void ThreadSocketHandler2(void* parg) { printf("ThreadSocketHandler started\n"); list<CNode*> vNodesDisconnected; unsigned int nPrevNodeCount = 0; while (true) { // // Disconnect nodes // { LOCK(cs_vNodes); // Disconnect unused nodes vector<CNode*> vNodesCopy = vNodes; BOOST_FOREACH(CNode* pnode, vNodesCopy) { if (pnode->fDisconnect || (pnode->GetRefCount() <= 0 && pnode->vRecv.empty() && pnode->vSend.empty())) { // remove from vNodes vNodes.erase(remove(vNodes.begin(), vNodes.end(), pnode), vNodes.end()); // release outbound grant (if any) pnode->grantOutbound.Release(); // close socket and cleanup pnode->CloseSocketDisconnect(); pnode->Cleanup(); // hold in disconnected pool until all refs are released if (pnode->fNetworkNode || pnode->fInbound) pnode->Release(); vNodesDisconnected.push_back(pnode); } } // Delete disconnected nodes list<CNode*> vNodesDisconnectedCopy = vNodesDisconnected; BOOST_FOREACH(CNode* pnode, vNodesDisconnectedCopy) { // wait until threads are done using it if (pnode->GetRefCount() <= 0) { bool fDelete = false; { TRY_LOCK(pnode->cs_vSend, lockSend); if (lockSend) { TRY_LOCK(pnode->cs_vRecv, lockRecv); if (lockRecv) { TRY_LOCK(pnode->cs_mapRequests, lockReq); if (lockReq) { TRY_LOCK(pnode->cs_inventory, lockInv); if (lockInv) fDelete = true; } } } } if (fDelete) { vNodesDisconnected.remove(pnode); delete pnode; } } } } if (vNodes.size() != nPrevNodeCount) { nPrevNodeCount = vNodes.size(); uiInterface.NotifyNumConnectionsChanged(vNodes.size()); } // // Find which sockets have data to receive // struct timeval timeout; timeout.tv_sec = 0; timeout.tv_usec = 50000; // frequency to poll pnode->vSend fd_set fdsetRecv; fd_set fdsetSend; fd_set fdsetError; FD_ZERO(&fdsetRecv); FD_ZERO(&fdsetSend); FD_ZERO(&fdsetError); SOCKET hSocketMax = 0; bool have_fds = false; BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket) { FD_SET(hListenSocket, &fdsetRecv); hSocketMax = max(hSocketMax, hListenSocket); have_fds = true; } { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) { if (pnode->hSocket == INVALID_SOCKET) continue; FD_SET(pnode->hSocket, &fdsetRecv); FD_SET(pnode->hSocket, &fdsetError); hSocketMax = max(hSocketMax, pnode->hSocket); have_fds = true; { TRY_LOCK(pnode->cs_vSend, lockSend); if (lockSend && !pnode->vSend.empty()) FD_SET(pnode->hSocket, &fdsetSend); } } } vnThreadsRunning[THREAD_SOCKETHANDLER]--; int nSelect = select(have_fds ? hSocketMax + 1 : 0, &fdsetRecv, &fdsetSend, &fdsetError, &timeout); vnThreadsRunning[THREAD_SOCKETHANDLER]++; if (fShutdown) return; if (nSelect == SOCKET_ERROR) { if (have_fds) { int nErr = WSAGetLastError(); printf("socket select error %d\n", nErr); for (unsigned int i = 0; i <= hSocketMax; i++) FD_SET(i, &fdsetRecv); } FD_ZERO(&fdsetSend); FD_ZERO(&fdsetError); MilliSleep(timeout.tv_usec/1000); } // // Accept new connections // BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket) if (hListenSocket != INVALID_SOCKET && FD_ISSET(hListenSocket, &fdsetRecv)) { struct sockaddr_storage sockaddr; socklen_t len = sizeof(sockaddr); SOCKET hSocket = accept(hListenSocket, (struct sockaddr*)&sockaddr, &len); CAddress addr; int nInbound = 0; if (hSocket != INVALID_SOCKET) if (!addr.SetSockAddr((const struct sockaddr*)&sockaddr)) printf("Warning: Unknown socket family\n"); { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) if (pnode->fInbound) nInbound++; } if (hSocket == INVALID_SOCKET) { int nErr = WSAGetLastError(); if (nErr != WSAEWOULDBLOCK) printf("socket error accept failed: %d\n", nErr); } else if (nInbound >= GetArg("-maxconnections", 125) - MAX_OUTBOUND_CONNECTIONS) { closesocket(hSocket); } else if (CNode::IsBanned(addr)) { printf("connection from %s dropped (banned)\n", addr.ToString().c_str()); closesocket(hSocket); } else { printf("accepted connection %s\n", addr.ToString().c_str()); CNode* pnode = new CNode(hSocket, addr, "", true); pnode->AddRef(); { LOCK(cs_vNodes); vNodes.push_back(pnode); } } } // // Service each socket // vector<CNode*> vNodesCopy; { LOCK(cs_vNodes); vNodesCopy = vNodes; BOOST_FOREACH(CNode* pnode, vNodesCopy) pnode->AddRef(); } BOOST_FOREACH(CNode* pnode, vNodesCopy) { if (fShutdown) return; // // Receive // if (pnode->hSocket == INVALID_SOCKET) continue; if (FD_ISSET(pnode->hSocket, &fdsetRecv) || FD_ISSET(pnode->hSocket, &fdsetError)) { TRY_LOCK(pnode->cs_vRecv, lockRecv); if (lockRecv) { CDataStream& vRecv = pnode->vRecv; unsigned int nPos = vRecv.size(); if (nPos > ReceiveBufferSize()) { if (!pnode->fDisconnect) printf("socket recv flood control disconnect (%"PRIszu" bytes)\n", vRecv.size()); pnode->CloseSocketDisconnect(); } else { // typical socket buffer is 8K-64K char pchBuf[0x10000]; int nBytes = recv(pnode->hSocket, pchBuf, sizeof(pchBuf), MSG_DONTWAIT); if (nBytes > 0) { vRecv.resize(nPos + nBytes); memcpy(&vRecv[nPos], pchBuf, nBytes); pnode->nLastRecv = GetTime(); } else if (nBytes == 0) { // socket closed gracefully if (!pnode->fDisconnect) printf("socket closed\n"); pnode->CloseSocketDisconnect(); } else if (nBytes < 0) { // error int nErr = WSAGetLastError(); if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) { if (!pnode->fDisconnect) printf("socket recv error %d\n", nErr); pnode->CloseSocketDisconnect(); } } } } } // // Send // if (pnode->hSocket == INVALID_SOCKET) continue; if (FD_ISSET(pnode->hSocket, &fdsetSend)) { TRY_LOCK(pnode->cs_vSend, lockSend); if (lockSend) { CDataStream& vSend = pnode->vSend; if (!vSend.empty()) { int nBytes = send(pnode->hSocket, &vSend[0], vSend.size(), MSG_NOSIGNAL | MSG_DONTWAIT); if (nBytes > 0) { vSend.erase(vSend.begin(), vSend.begin() + nBytes); pnode->nLastSend = GetTime(); } else if (nBytes < 0) { // error int nErr = WSAGetLastError(); if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) { printf("socket send error %d\n", nErr); pnode->CloseSocketDisconnect(); } } } } } // // Inactivity checking // if (pnode->vSend.empty()) pnode->nLastSendEmpty = GetTime(); if (GetTime() - pnode->nTimeConnected > 60) { if (pnode->nLastRecv == 0 || pnode->nLastSend == 0) { printf("socket no message in first 60 seconds, %d %d\n", pnode->nLastRecv != 0, pnode->nLastSend != 0); pnode->fDisconnect = true; } else if (GetTime() - pnode->nLastSend > 90*60 && GetTime() - pnode->nLastSendEmpty > 90*60) { printf("socket not sending\n"); pnode->fDisconnect = true; } else if (GetTime() - pnode->nLastRecv > 90*60) { printf("socket inactivity timeout\n"); pnode->fDisconnect = true; } } } { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodesCopy) pnode->Release(); } MilliSleep(10); } } #ifdef USE_UPNP void ThreadMapPort(void* parg) { // Make this thread recognisable as the UPnP thread RenameThread("breakout-UPnP"); try { vnThreadsRunning[THREAD_UPNP]++; ThreadMapPort2(parg); vnThreadsRunning[THREAD_UPNP]--; } catch (std::exception& e) { vnThreadsRunning[THREAD_UPNP]--; PrintException(&e, "ThreadMapPort()"); } catch (...) { vnThreadsRunning[THREAD_UPNP]--; PrintException(NULL, "ThreadMapPort()"); } printf("ThreadMapPort exited\n"); } void ThreadMapPort2(void* parg) { printf("ThreadMapPort started\n"); std::string port = strprintf("%u", GetListenPort()); const char * multicastif = 0; const char * minissdpdpath = 0; struct UPNPDev * devlist = 0; char lanaddr[64]; #ifndef UPNPDISCOVER_SUCCESS /* miniupnpc 1.5 */ devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0); #else /* miniupnpc 1.6 */ int error = 0; devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error); #endif struct UPNPUrls urls; struct IGDdatas data; int r; r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr)); if (r == 1) { if (fDiscover) { char externalIPAddress[40]; r = UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIPAddress); if(r != UPNPCOMMAND_SUCCESS) printf("UPnP: GetExternalIPAddress() returned %d\n", r); else { if(externalIPAddress[0]) { printf("UPnP: ExternalIPAddress = %s\n", externalIPAddress); AddLocal(CNetAddr(externalIPAddress), LOCAL_UPNP); } else printf("UPnP: GetExternalIPAddress failed.\n"); } } string strDesc = "breakout " + FormatFullVersion(); #ifndef UPNPDISCOVER_SUCCESS /* miniupnpc 1.5 */ r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", 0); #else /* miniupnpc 1.6 */ r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", 0, "0"); #endif if(r!=UPNPCOMMAND_SUCCESS) printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n", port.c_str(), port.c_str(), lanaddr, r, strupnperror(r)); else printf("UPnP Port Mapping successful.\n"); int i = 1; while (true) { if (fShutdown || !fUseUPnP) { r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port.c_str(), "TCP", 0); printf("UPNP_DeletePortMapping() returned : %d\n", r); freeUPNPDevlist(devlist); devlist = 0; FreeUPNPUrls(&urls); return; } if (i % 600 == 0) // Refresh every 20 minutes { #ifndef UPNPDISCOVER_SUCCESS /* miniupnpc 1.5 */ r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", 0); #else /* miniupnpc 1.6 */ r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", 0, "0"); #endif if(r!=UPNPCOMMAND_SUCCESS) printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n", port.c_str(), port.c_str(), lanaddr, r, strupnperror(r)); else printf("UPnP Port Mapping successful.\n");; } MilliSleep(2000); i++; } } else { printf("No valid UPnP IGDs found\n"); freeUPNPDevlist(devlist); devlist = 0; if (r != 0) FreeUPNPUrls(&urls); while (true) { if (fShutdown || !fUseUPnP) return; MilliSleep(2000); } } } void MapPort() { if (fUseUPnP && vnThreadsRunning[THREAD_UPNP] < 1) { if (!NewThread(ThreadMapPort, NULL)) printf("Error: ThreadMapPort(ThreadMapPort) failed\n"); } } #else void MapPort() { // Intentionally left blank. } #endif void ThreadOnionSeed(void* parg) { // Make this thread recognisable as the tor thread RenameThread("onionseed"); static const char *(*strOnionSeed)[1] = fTestNet ? strTestNetOnionSeed : strMainNetOnionSeed; int found = 0; printf("Loading addresses from .onion seeds\n"); for (unsigned int seed_idx = 0; strOnionSeed[seed_idx][0] != NULL; seed_idx++) { CNetAddr parsed; if ( !parsed.SetSpecial( strOnionSeed[seed_idx][0] ) ) { throw runtime_error("ThreadOnionSeed() : invalid .onion seed"); } int nOneDay = 24*3600; CAddress addr = CAddress(CService(parsed, GetDefaultPort())); addr.nTime = GetTime() - 3*nOneDay - GetRand(4*nOneDay); // use a random age between 3 and 7 days old found++; addrman.Add(addr, parsed); } printf("%d addresses found from .onion seeds\n", found); } unsigned int pnSeed[] = { 0xdf4bd379, 0x7934d29b, 0x26bc02ad, 0x7ab743ad, 0x0ab3a7bc, 0x375ab5bc, 0xc90b1617, 0x5352fd17, 0x5efc6c18, 0xccdc7d18, 0x443d9118, 0x84031b18, 0x347c1e18, 0x86512418, 0xfcfe9031, 0xdb5eb936, 0xef8d2e3a, 0xcf51f23c, 0x18ab663e, 0x36e0df40, 0xde48b641, 0xad3e4e41, 0xd0f32b44, 0x09733b44, 0x6a51f545, 0xe593ef48, 0xc5f5ef48, 0x96f4f148, 0xd354d34a, 0x36206f4c, 0xceefe953, 0x50468c55, 0x89d38d55, 0x65e61a5a, 0x16b1b95d, 0x702b135e, 0x0f57245e, 0xdaab5f5f, 0xba15ef63, }; void DumpAddresses() { int64_t nStart = GetTimeMillis(); CAddrDB adb; adb.Write(addrman); printf("Flushed %d addresses to peers.dat %" PRId64 "ms\n", addrman.size(), GetTimeMillis() - nStart); } void ThreadDumpAddress2(void* parg) { vnThreadsRunning[THREAD_DUMPADDRESS]++; while (!fShutdown) { DumpAddresses(); vnThreadsRunning[THREAD_DUMPADDRESS]--; MilliSleep(600000); vnThreadsRunning[THREAD_DUMPADDRESS]++; } vnThreadsRunning[THREAD_DUMPADDRESS]--; } void ThreadDumpAddress(void* parg) { // Make this thread recognisable as the address dumping thread RenameThread("breakout-adrdump"); try { ThreadDumpAddress2(parg); } catch (std::exception& e) { PrintException(&e, "ThreadDumpAddress()"); } printf("ThreadDumpAddress exited\n"); } void ThreadOpenConnections(void* parg) { // Make this thread recognisable as the connection opening thread RenameThread("breakout-opencon"); try { vnThreadsRunning[THREAD_OPENCONNECTIONS]++; ThreadOpenConnections2(parg); vnThreadsRunning[THREAD_OPENCONNECTIONS]--; } catch (std::exception& e) { vnThreadsRunning[THREAD_OPENCONNECTIONS]--; PrintException(&e, "ThreadOpenConnections()"); } catch (...) { vnThreadsRunning[THREAD_OPENCONNECTIONS]--; PrintException(NULL, "ThreadOpenConnections()"); } printf("ThreadOpenConnections exited\n"); } void static ProcessOneShot() { string strDest; { LOCK(cs_vOneShots); if (vOneShots.empty()) return; strDest = vOneShots.front(); vOneShots.pop_front(); } CAddress addr; CSemaphoreGrant grant(*semOutbound, true); if (grant) { if (!OpenNetworkConnection(addr, &grant, strDest.c_str(), true)) AddOneShot(strDest); } } void static ThreadStakeMiner(void* parg) { printf("ThreadStakeMiner started\n"); CWallet* pwallet = (CWallet*)parg; try { vnThreadsRunning[THREAD_STAKE_MINER]++; StakeMiner(pwallet); vnThreadsRunning[THREAD_STAKE_MINER]--; } catch (std::exception& e) { vnThreadsRunning[THREAD_STAKE_MINER]--; PrintException(&e, "ThreadStakeMiner()"); } catch (...) { vnThreadsRunning[THREAD_STAKE_MINER]--; PrintException(NULL, "ThreadStakeMiner()"); } printf("ThreadStakeMiner exiting, %d threads remaining\n", vnThreadsRunning[THREAD_STAKE_MINER]); } void ThreadOpenConnections2(void* parg) { printf("ThreadOpenConnections started\n"); // Connect to specific addresses if (mapArgs.count("-connect") && mapMultiArgs["-connect"].size() > 0) { for (int64_t nLoop = 0;; nLoop++) { ProcessOneShot(); BOOST_FOREACH(string strAddr, mapMultiArgs["-connect"]) { CAddress addr; OpenNetworkConnection(addr, NULL, strAddr.c_str()); for (int i = 0; i < 10 && i < nLoop; i++) { MilliSleep(500); if (fShutdown) return; } } MilliSleep(500); } } // Initiate network connections int64_t nStart = GetTime(); while (true) { ProcessOneShot(); vnThreadsRunning[THREAD_OPENCONNECTIONS]--; MilliSleep(500); vnThreadsRunning[THREAD_OPENCONNECTIONS]++; if (fShutdown) return; vnThreadsRunning[THREAD_OPENCONNECTIONS]--; CSemaphoreGrant grant(*semOutbound); vnThreadsRunning[THREAD_OPENCONNECTIONS]++; if (fShutdown) return; // Add seed nodes if IRC isn't working if (addrman.size()==0 && (GetTime() - nStart > 60) && !fTestNet) { std::vector<CAddress> vAdd; for (unsigned int i = 0; i < ARRAYLEN(pnSeed); i++) { // It'll only connect to one or two seed nodes because once it connects, // it'll get a pile of addresses with newer timestamps. // Seed nodes are given a random 'last seen time' of between one and two // weeks ago. const int64_t nOneWeek = 7*24*60*60; struct in_addr ip; memcpy(&ip, &pnSeed[i], sizeof(ip)); CAddress addr(CService(ip, GetDefaultPort())); addr.nTime = GetTime()-GetRand(nOneWeek)-nOneWeek; vAdd.push_back(addr); } addrman.Add(vAdd, CNetAddr("127.0.0.1")); } // // Choose an address to connect to based on most recently seen // CAddress addrConnect; // Only connect out to one peer per network group (/16 for IPv4). // Do this here so we don't have to critsect vNodes inside mapAddresses critsect. int nOutbound = 0; set<vector<unsigned char> > setConnected; { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) { if (!pnode->fInbound) { setConnected.insert(pnode->addr.GetGroup()); nOutbound++; } } } int64_t nANow = GetAdjustedTime(); int nTries = 0; while (true) { // use an nUnkBias between 10 (no outgoing connections) and 90 (8 outgoing connections) CAddress addr = addrman.Select(10 + min(nOutbound,8)*10); // if we selected an invalid address, restart if (!addr.IsValid() || setConnected.count(addr.GetGroup()) || IsLocal(addr)) break; // If we didn't find an appropriate destination after trying 100 addresses fetched from addrman, // stop this loop, and let the outer loop run again (which sleeps, adds seed nodes, recalculates // already-connected network ranges, ...) before trying new addrman addresses. nTries++; if (nTries > 100) break; if (IsLimited(addr)) continue; // only consider very recently tried nodes after 30 failed attempts if (nANow - addr.nLastTry < 600 && nTries < 30) continue; // do not allow non-default ports, unless after 50 invalid addresses selected already if (addr.GetPort() != GetDefaultPort() && nTries < 50) continue; addrConnect = addr; break; } if (addrConnect.IsValid()) OpenNetworkConnection(addrConnect, &grant); } } void ThreadOpenAddedConnections(void* parg) { // Make this thread recognisable as the connection opening thread RenameThread("breakout-opencon"); try { vnThreadsRunning[THREAD_ADDEDCONNECTIONS]++; ThreadOpenAddedConnections2(parg); vnThreadsRunning[THREAD_ADDEDCONNECTIONS]--; } catch (std::exception& e) { vnThreadsRunning[THREAD_ADDEDCONNECTIONS]--; PrintException(&e, "ThreadOpenAddedConnections()"); } catch (...) { vnThreadsRunning[THREAD_ADDEDCONNECTIONS]--; PrintException(NULL, "ThreadOpenAddedConnections()"); } printf("ThreadOpenAddedConnections exited\n"); } void ThreadOpenAddedConnections2(void* parg) { printf("ThreadOpenAddedConnections started\n"); if (mapArgs.count("-addnode") == 0) return; if (HaveNameProxy()) { while(!fShutdown) { BOOST_FOREACH(string& strAddNode, mapMultiArgs["-addnode"]) { CAddress addr; CSemaphoreGrant grant(*semOutbound); OpenNetworkConnection(addr, &grant, strAddNode.c_str()); MilliSleep(500); } vnThreadsRunning[THREAD_ADDEDCONNECTIONS]--; MilliSleep(120000); // Retry every 2 minutes vnThreadsRunning[THREAD_ADDEDCONNECTIONS]++; } return; } vector<vector<CService> > vservAddressesToAdd(0); BOOST_FOREACH(string& strAddNode, mapMultiArgs["-addnode"]) { vector<CService> vservNode(0); if(Lookup(strAddNode.c_str(), vservNode, GetDefaultPort(), fNameLookup, 0)) { vservAddressesToAdd.push_back(vservNode); { LOCK(cs_setservAddNodeAddresses); BOOST_FOREACH(CService& serv, vservNode) setservAddNodeAddresses.insert(serv); } } } while (true) { vector<vector<CService> > vservConnectAddresses = vservAddressesToAdd; // Attempt to connect to each IP for each addnode entry until at least one is successful per addnode entry // (keeping in mind that addnode entries can have many IPs if fNameLookup) { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) for (vector<vector<CService> >::iterator it = vservConnectAddresses.begin(); it != vservConnectAddresses.end(); it++) BOOST_FOREACH(CService& addrNode, *(it)) if (pnode->addr == addrNode) { it = vservConnectAddresses.erase(it); it--; break; } } BOOST_FOREACH(vector<CService>& vserv, vservConnectAddresses) { CSemaphoreGrant grant(*semOutbound); OpenNetworkConnection(CAddress(*(vserv.begin())), &grant); MilliSleep(500); if (fShutdown) return; } if (fShutdown) return; vnThreadsRunning[THREAD_ADDEDCONNECTIONS]--; MilliSleep(120000); // Retry every 2 minutes vnThreadsRunning[THREAD_ADDEDCONNECTIONS]++; if (fShutdown) return; } } // if successful, this moves the passed grant to the constructed node bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound, const char *strDest, bool fOneShot) { // // Initiate outbound network connection // if (fShutdown) return false; if (!strDest) if (IsLocal(addrConnect) || FindNode((CNetAddr)addrConnect) || CNode::IsBanned(addrConnect) || FindNode(addrConnect.ToStringIPPort().c_str())) return false; if (strDest && FindNode(strDest)) return false; vnThreadsRunning[THREAD_OPENCONNECTIONS]--; CNode* pnode = ConnectNode(addrConnect, strDest); vnThreadsRunning[THREAD_OPENCONNECTIONS]++; if (fShutdown) return false; if (!pnode) return false; if (grantOutbound) grantOutbound->MoveTo(pnode->grantOutbound); pnode->fNetworkNode = true; if (fOneShot) pnode->fOneShot = true; return true; } void ThreadMessageHandler(void* parg) { // Make this thread recognisable as the message handling thread RenameThread("breakout-msghand"); try { vnThreadsRunning[THREAD_MESSAGEHANDLER]++; ThreadMessageHandler2(parg); vnThreadsRunning[THREAD_MESSAGEHANDLER]--; } catch (std::exception& e) { vnThreadsRunning[THREAD_MESSAGEHANDLER]--; PrintException(&e, "ThreadMessageHandler()"); } catch (...) { vnThreadsRunning[THREAD_MESSAGEHANDLER]--; PrintException(NULL, "ThreadMessageHandler()"); } printf("ThreadMessageHandler exited\n"); } void ThreadMessageHandler2(void* parg) { printf("ThreadMessageHandler started\n"); SetThreadPriority(THREAD_PRIORITY_BELOW_NORMAL); while (!fShutdown) { vector<CNode*> vNodesCopy; { LOCK(cs_vNodes); vNodesCopy = vNodes; BOOST_FOREACH(CNode* pnode, vNodesCopy) pnode->AddRef(); } // Poll the connected nodes for messages CNode* pnodeTrickle = NULL; if (!vNodesCopy.empty()) pnodeTrickle = vNodesCopy[GetRand(vNodesCopy.size())]; BOOST_FOREACH(CNode* pnode, vNodesCopy) { // Receive messages { TRY_LOCK(pnode->cs_vRecv, lockRecv); if (lockRecv) ProcessMessages(pnode); } if (fShutdown) return; // Send messages { TRY_LOCK(pnode->cs_vSend, lockSend); if (lockSend) SendMessages(pnode, pnode == pnodeTrickle); } if (fShutdown) return; } { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodesCopy) pnode->Release(); } // Wait and allow messages to bunch up. // Reduce vnThreadsRunning so StopNode has permission to exit while // we're sleeping, but we must always check fShutdown after doing this. vnThreadsRunning[THREAD_MESSAGEHANDLER]--; MilliSleep(100); if (fRequestShutdown) StartShutdown(); vnThreadsRunning[THREAD_MESSAGEHANDLER]++; if (fShutdown) return; } } bool BindListenPort(const CService &addrBind, string& strError) { strError = ""; int nOne = 1; #ifdef WIN32 // Initialize Windows Sockets WSADATA wsadata; int ret = WSAStartup(MAKEWORD(2,2), &wsadata); if (ret != NO_ERROR) { strError = strprintf("Error: TCP/IP socket library failed to start (WSAStartup returned error %d)", ret); printf("%s\n", strError.c_str()); return false; } #endif // Create socket for listening for incoming connections struct sockaddr_storage sockaddr; socklen_t len = sizeof(sockaddr); if (!addrBind.GetSockAddr((struct sockaddr*)&sockaddr, &len)) { strError = strprintf("Error: bind address family for %s not supported", addrBind.ToString().c_str()); printf("%s\n", strError.c_str()); return false; } SOCKET hListenSocket = socket(((struct sockaddr*)&sockaddr)->sa_family, SOCK_STREAM, IPPROTO_TCP); if (hListenSocket == INVALID_SOCKET) { strError = strprintf("Error: Couldn't open socket for incoming connections (socket returned error %d)", WSAGetLastError()); printf("%s\n", strError.c_str()); return false; } #ifdef SO_NOSIGPIPE // Different way of disabling SIGPIPE on BSD setsockopt(hListenSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&nOne, sizeof(int)); #endif #ifndef WIN32 // Allow binding if the port is still in TIME_WAIT state after // the program was closed and restarted. Not an issue on windows. setsockopt(hListenSocket, SOL_SOCKET, SO_REUSEADDR, (void*)&nOne, sizeof(int)); #endif #ifdef WIN32 // Set to non-blocking, incoming connections will also inherit this if (ioctlsocket(hListenSocket, FIONBIO, (u_long*)&nOne) == SOCKET_ERROR) #else if (fcntl(hListenSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR) #endif { strError = strprintf("Error: Couldn't set properties on socket for incoming connections (error %d)", WSAGetLastError()); printf("%s\n", strError.c_str()); return false; } // some systems don't have IPV6_V6ONLY but are always v6only; others do have the option // and enable it by default or not. Try to enable it, if possible. if (addrBind.IsIPv6()) { #ifdef IPV6_V6ONLY #ifdef WIN32 setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&nOne, sizeof(int)); #else setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&nOne, sizeof(int)); #endif #endif #ifdef WIN32 int nProtLevel = 10 /* PROTECTION_LEVEL_UNRESTRICTED */; int nParameterId = 23 /* IPV6_PROTECTION_LEVEl */; // this call is allowed to fail setsockopt(hListenSocket, IPPROTO_IPV6, nParameterId, (const char*)&nProtLevel, sizeof(int)); #endif } if (::bind(hListenSocket, (struct sockaddr*)&sockaddr, len) == SOCKET_ERROR) { int nErr = WSAGetLastError(); if (nErr == WSAEADDRINUSE) strError = strprintf(_("Unable to bind to %s on this computer. breakout is probably already running."), addrBind.ToString().c_str()); else strError = strprintf(_("Unable to bind to %s on this computer (bind returned error %d, %s)"), addrBind.ToString().c_str(), nErr, strerror(nErr)); printf("%s\n", strError.c_str()); return false; } printf("Bound to %s\n", addrBind.ToString().c_str()); // Listen for incoming connections if (listen(hListenSocket, SOMAXCONN) == SOCKET_ERROR) { strError = strprintf("Error: Listening for incoming connections failed (listen returned error %d)", WSAGetLastError()); printf("%s\n", strError.c_str()); return false; } vhListenSocket.push_back(hListenSocket); if (addrBind.IsRoutable() && fDiscover) AddLocal(addrBind, LOCAL_BIND); return true; } void static Discover() { // no network discovery } static void run_tor() { fprintf(stdout, "TOR thread started.\n"); std::string logDecl = "notice file " + GetDataDir().string() + "/tor/tor.log"; char* argv[4]; argv[0] = (char*)"tor"; argv[1] = (char*)"--hush"; argv[2] = (char*)"--Log"; argv[3] = (char*)logDecl.c_str(); tor_main(4, argv); } void StartTor(void* parg) { // Make this thread recognisable as the tor thread RenameThread("onion"); try { run_tor(); } catch (std::exception& e) { PrintException(&e, "StartTor()"); } printf("Onion thread exited."); } void StartNode(void* parg) { // Make this thread recognisable as the startup thread RenameThread("breakout-start"); if (semOutbound == NULL) { // initialize semaphore int nMaxOutbound = min(MAX_OUTBOUND_CONNECTIONS, (int)GetArg("-maxconnections", 125)); semOutbound = new CSemaphore(nMaxOutbound); } if (pnodeLocalHost == NULL) pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress(CService("127.0.0.1", 0), nLocalServices)); printf("StartNode(): pnodeLocalHost addr: %s\n", pnodeLocalHost->addr.ToString().c_str()); Discover(); // // Start threads // // start the onion seeder if (!GetBoolArg("-onionseed", true)) printf(".onion seeding disabled\n"); else if (!NewThread(ThreadOnionSeed, NULL)) printf("Error: could not start .onion seeding\n"); // Map ports with UPnP (default) #ifdef USE_UPNP if (fUseUPnP) MapPort(fUseUPnP); #endif // Send and receive from sockets, accept connections if (!NewThread(ThreadSocketHandler, NULL)) printf("Error: NewThread(ThreadSocketHandler) failed\n"); // Initiate outbound connections from -addnode if (!NewThread(ThreadOpenAddedConnections, NULL)) printf("Error: NewThread(ThreadOpenAddedConnections) failed\n"); // Initiate outbound connections if (!NewThread(ThreadOpenConnections, NULL)) printf("Error: NewThread(ThreadOpenConnections) failed\n"); // Process messages if (!NewThread(ThreadMessageHandler, NULL)) printf("Error: NewThread(ThreadMessageHandler) failed\n"); // Dump network addresses if (!NewThread(ThreadDumpAddress, NULL)) printf("Error; NewThread(ThreadDumpAddress) failed\n"); // Mine proof-of-stake blocks in the background if (!GetBoolArg("-staking", true)) { printf("Staking disabled\n"); } else { if (!NewThread(ThreadStakeMiner, pwalletMain)) { printf("Error: NewThread(ThreadStakeMiner) failed\n"); } } } bool StopNode() { printf("StopNode()\n"); fShutdown = true; nTransactionsUpdated++; int64_t nStart = GetTime(); if (semOutbound) for (int i=0; i<MAX_OUTBOUND_CONNECTIONS; i++) semOutbound->post(); do { int nThreadsRunning = 0; for (int n = 0; n < THREAD_MAX; n++) nThreadsRunning += vnThreadsRunning[n]; if (nThreadsRunning == 0) break; if (GetTime() - nStart > 20) break; MilliSleep(20); } while(true); if (vnThreadsRunning[THREAD_SOCKETHANDLER] > 0) printf("ThreadSocketHandler still running\n"); if (vnThreadsRunning[THREAD_OPENCONNECTIONS] > 0) printf("ThreadOpenConnections still running\n"); if (vnThreadsRunning[THREAD_MESSAGEHANDLER] > 0) printf("ThreadMessageHandler still running\n"); if (vnThreadsRunning[THREAD_RPCLISTENER] > 0) printf("ThreadRPCListener still running\n"); if (vnThreadsRunning[THREAD_RPCHANDLER] > 0) printf("ThreadsRPCServer still running\n"); #ifdef USE_UPNP if (vnThreadsRunning[THREAD_UPNP] > 0) printf("ThreadMapPort still running\n"); #endif if (vnThreadsRunning[THREAD_DNSSEED] > 0) printf("ThreadDNSAddressSeed still running\n"); if (vnThreadsRunning[THREAD_ADDEDCONNECTIONS] > 0) printf("ThreadOpenAddedConnections still running\n"); if (vnThreadsRunning[THREAD_DUMPADDRESS] > 0) printf("ThreadDumpAddresses still running\n"); if (vnThreadsRunning[THREAD_STAKE_MINER] > 0) printf("ThreadStakeMiner still running\n"); while (vnThreadsRunning[THREAD_MESSAGEHANDLER] > 0 || vnThreadsRunning[THREAD_RPCHANDLER] > 0) MilliSleep(20); MilliSleep(50); DumpAddresses(); return true; } class CNetCleanup { public: CNetCleanup() { } ~CNetCleanup() { // Close sockets BOOST_FOREACH(CNode* pnode, vNodes) if (pnode->hSocket != INVALID_SOCKET) closesocket(pnode->hSocket); BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket) if (hListenSocket != INVALID_SOCKET) if (closesocket(hListenSocket) == SOCKET_ERROR) printf("closesocket(hListenSocket) failed with error %d\n", WSAGetLastError()); #ifdef WIN32 // Shutdown Windows Sockets WSACleanup(); #endif } } instance_of_cnetcleanup; void RelayTransaction(const CTransaction& tx, const uint256& hash) { CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(10000); ss << tx; RelayTransaction(tx, hash, ss); } void RelayTransaction(const CTransaction& tx, const uint256& hash, const CDataStream& ss) { CInv inv(MSG_TX, hash); { LOCK(cs_mapRelay); // Expire old relay messages while (!vRelayExpiration.empty() && vRelayExpiration.front().first < GetTime()) { mapRelay.erase(vRelayExpiration.front().second); vRelayExpiration.pop_front(); } // Save original serialized message so newer versions are preserved mapRelay.insert(std::make_pair(inv, ss)); vRelayExpiration.push_back(std::make_pair(GetTime() + 15 * 60, inv)); } RelayInventory(inv); }
[ "BreakoutCoin@users.noreply.github.com" ]
BreakoutCoin@users.noreply.github.com
3b9cba10b738acbc07edf04fb92ac8642b680801
d0c44dd3da2ef8c0ff835982a437946cbf4d2940
/cmake-build-debug/programs_tiling/function14303/function14303_schedule_12/function14303_schedule_12.cpp
32a28b332f3bf9d4aa0428f21ef70fac1c9bb2c3
[]
no_license
IsraMekki/tiramisu_code_generator
8b3f1d63cff62ba9f5242c019058d5a3119184a3
5a259d8e244af452e5301126683fa4320c2047a3
refs/heads/master
2020-04-29T17:27:57.987172
2019-04-23T16:50:32
2019-04-23T16:50:32
176,297,755
1
2
null
null
null
null
UTF-8
C++
false
false
716
cpp
#include <tiramisu/tiramisu.h> using namespace tiramisu; int main(int argc, char **argv){ tiramisu::init("function14303_schedule_12"); constant c0("c0", 64), c1("c1", 64), c2("c2", 64), c3("c3", 128); var i0("i0", 0, c0), i1("i1", 0, c1), i2("i2", 0, c2), i3("i3", 0, c3), i01("i01"), i02("i02"), i03("i03"), i04("i04"); computation comp0("comp0", {i0, i1, i2, i3}, 7 * 6); comp0.tile(i2, i3, 64, 64, i01, i02, i03, i04); comp0.parallelize(i0); buffer buf0("buf0", {64, 64, 64, 128}, p_int32, a_output); comp0.store_in(&buf0); tiramisu::codegen({&buf0}, "../data/programs/function14303/function14303_schedule_12/function14303_schedule_12.o"); return 0; }
[ "ei_mekki@esi.dz" ]
ei_mekki@esi.dz
d9d6fcd14d18d5eec925c1edfc6a86d3b4360de8
e0d50712461f60626ab6600a230e5b5f475c636c
/sfx/sfx_source_point.h
0761e34c3ea7476d0c6367db16dc771db93d54d9
[ "MIT" ]
permissive
astrellon/Rouge
a4939c519da900d0a42d10ae0bff427ac4c2aa56
088f55b331284238e807e0562b9cbbed6428c20f
refs/heads/master
2021-01-23T08:39:52.749013
2018-08-31T07:33:38
2018-08-31T07:33:38
11,255,211
0
0
null
null
null
null
UTF-8
C++
false
false
434
h
#pragma once #include <sfx/sfx_isource.h> namespace am { namespace sfx { class ISound; class SourcePoint : public ISource { public: SourcePoint(); SourcePoint(ISound *sound); ~SourcePoint(); void setSourceRelative(bool value); bool isSourceRelative() const; virtual float calcGain() const; virtual bool isOutOfRange() const; protected: bool mSourceRelative; virtual void applyToSource(); }; } }
[ "sovereign250@gmail.com" ]
sovereign250@gmail.com
80047afea16ecf79711d5bdd6dab90f51a0748a6
bbbee24280c8e6d690f37c546a5c0e0e58680146
/6a.cpp
d510b5ae95dc35c2471b3c687ee0b5d5d942fa1f
[]
no_license
shiva807/1BM17CS096_ADA
647a7881b33506f651ae28641e62d5ae3b270303
80e211e7f4a2f517e77313d466e9cb77ab5bda2b
refs/heads/master
2020-07-01T00:08:42.866007
2019-11-20T07:29:47
2019-11-20T07:29:47
200,991,320
0
0
null
null
null
null
UTF-8
C++
false
false
602
cpp
//solving n-queens problem using backtracking #include<iostream> using namespace std; int x[4]; bool place(int k, int i) { int j; for(j=1; j<k; j++) { if(x[j]==i || abs(x[j]-i)==abs(j-k)) return false; } return true; } void nqueens(int k, int n) { for(int i=1; i<=n; i++) { if(place(k,i)) { x[k]=i; if(k==n) { for(int m=1; m<=n; m++) cout<<x[m]; cout<<endl; } else nqueens(k+1, n); } } } int main() { int n; cout<<"Enter number of queens: "; cin>>n; cout<<"The possible solutions are: "<<endl; nqueens(1,n); }
[ "noreply@github.com" ]
shiva807.noreply@github.com
f804449b1910d29848eed9d239b39c187817ac14
5dc072fc293a960fa5614b545b26c2eeea330f44
/src/hypercube.hpp
330759b051cc08bfa053ac097e90f3eb5a2d33f9
[]
no_license
Ahajha/snake-in-a-box
efd576f36745e47ba679af6a78dc931409e135a2
452acedc2162f9672c4aef2c902f7cd95737c1de
refs/heads/master
2023-01-22T10:47:18.490019
2020-11-15T06:27:50
2020-11-15T06:27:50
297,303,166
2
0
null
null
null
null
UTF-8
C++
false
false
1,229
hpp
#ifndef HYPERCUBE_HPP #define HYPERCUBE_HPP #include <array> #include <iostream> // Hypercube graph capable of keeping track of // induced vertices and degrees of vertices // with respect to how many induced neighbors // vertices have. template <unsigned N> struct hypercube { constexpr static unsigned numVertices = 1 << N; private: constexpr static std::array<std::array<unsigned, N>, numVertices> makeAdjLists(); public: // Format of array is [i] gives the adjacency list of vertex i, and // [i][j] gives the vertex obtained by starting from vertex i and // moving across dimension j. constexpr static auto adjLists = makeAdjLists(); struct vertex { bool induced; uint8_t effectiveDegree; vertex() : induced(false), effectiveDegree(0) {} }; std::array<vertex,numVertices> vertices; unsigned numInduced; hypercube(); // Reduce is the inverse of induce. void induce(unsigned); void reduce(unsigned); bool operator==(const hypercube& other) const; // Prints which vertices are induced as Xs, and those that are not // as _s, all on one line. template<unsigned M> friend std::ostream& operator<<(std::ostream& stream, const hypercube<M>& h); }; #include "hypercube.tpp" #endif
[ "ahajha@gmail.com" ]
ahajha@gmail.com
e835fc1cbd56a873a983ff7715e0ac6326a679a5
c61c802fea3e3ccca3f611f8a3d9fe72a8053504
/src/modules.cpp
93fb208a1cc1297adde0ca62e2a19ae37a064269
[]
no_license
Johncorex/perfect-source
fce01617061641d04f9c36d4696b34fc219dae38
2d37b382ecf25364388ed4a8e390c3fb6e1577b9
refs/heads/master
2020-07-25T14:41:15.983264
2019-09-13T19:50:23
2019-09-13T19:50:23
208,326,464
0
0
null
null
null
null
UTF-8
C++
false
false
5,306
cpp
/** * The Forgotten Server - a free and open-source MMORPG server emulator * Copyright (C) 2019 Mark Samman <mark.samman@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "otpch.h" #include "modules.h" #include "player.h" Modules::Modules() : scriptInterface("Modules Interface") { scriptInterface.initState(); } void Modules::clear() { //clear recvbyte list for (auto& it : recvbyteList) { it.second.clearEvent(); } //clear lua state scriptInterface.reInitState(); } LuaScriptInterface& Modules::getScriptInterface() { return scriptInterface; } std::string Modules::getScriptBaseName() const { return "modules"; } Event_ptr Modules::getEvent(const std::string& nodeName) { if (strcasecmp(nodeName.c_str(), "module") != 0) { return nullptr; } return Event_ptr(new Module(&scriptInterface)); } bool Modules::registerEvent(Event_ptr event, const pugi::xml_node&) { Module_ptr module {static_cast<Module*>(event.release())}; if (module->getEventType() == MODULE_TYPE_NONE) { std::cout << "Error: [Modules::registerEvent] Trying to register event without type!" << std::endl; return false; } Module* oldModule = getEventByRecvbyte(module->getRecvbyte(), false); if (oldModule) { if (!oldModule->isLoaded() && oldModule->getEventType() == module->getEventType()) { oldModule->copyEvent(module.get()); } return false; } else { auto it = recvbyteList.find(module->getRecvbyte()); if (it != recvbyteList.end()) { it->second = *module; } else { recvbyteList.emplace(module->getRecvbyte(), std::move(*module)); } return true; } } Module* Modules::getEventByRecvbyte(uint8_t recvbyte, bool force) { ModulesList::iterator it = recvbyteList.find(recvbyte); if (it != recvbyteList.end()) { if (!force || it->second.isLoaded()) { return &it->second; } } return nullptr; } void Modules::executeOnRecvbyte(Player* player, NetworkMessage& msg, uint8_t byte) const { for (auto& it : recvbyteList) { Module module = it.second; if (module.getEventType() == MODULE_TYPE_RECVBYTE && module.getRecvbyte() == byte && player->canRunModule(module.getRecvbyte())) { player->setModuleDelay(module.getRecvbyte(), module.getDelay()); module.executeOnRecvbyte(player, msg); return; } } } ///////////////////////////////////// Module::Module(LuaScriptInterface* interface) : Event(interface), type(MODULE_TYPE_NONE), loaded(false) {} bool Module::configureEvent(const pugi::xml_node& node) { delay = 0; pugi::xml_attribute typeAttribute = node.attribute("type"); if (!typeAttribute) { std::cout << "[Error - Modules::configureEvent] Missing type for module." << std::endl; return false; } std::string tmpStr = asLowerCaseString(typeAttribute.as_string()); if (tmpStr == "recvbyte") { pugi::xml_attribute byteAttribute = node.attribute("byte"); if (!byteAttribute) { std::cout << "[Error - Modules::configureEvent] Missing byte for module typed recvbyte." << std::endl; return false; } recvbyte = static_cast<uint8_t>(byteAttribute.as_int()); type = MODULE_TYPE_RECVBYTE; } else { std::cout << "[Error - Modules::configureEvent] Invalid type for module." << std::endl; return false; } pugi::xml_attribute delayAttribute = node.attribute("delay"); if (delayAttribute) { delay = static_cast<uint16_t>(delayAttribute.as_uint()); } loaded = true; return true; } std::string Module::getScriptEventName() const { switch (type) { case MODULE_TYPE_RECVBYTE: return "onRecvbyte"; default: return std::string(); } } void Module::copyEvent(Module* module) { scriptId = module->scriptId; scriptInterface = module->scriptInterface; scripted = module->scripted; loaded = module->loaded; } void Module::clearEvent() { scriptId = 0; scriptInterface = nullptr; scripted = false; loaded = false; } void Module::executeOnRecvbyte(Player* player, NetworkMessage& msg) { //onAdvance(player, skill, oldLevel, newLevel) if (!scriptInterface->reserveScriptEnv()) { std::cout << "[Error - CreatureEvent::executeAdvance] Call stack overflow" << std::endl; return; } ScriptEnvironment* env = scriptInterface->getScriptEnv(); env->setScriptId(scriptId, scriptInterface); lua_State* L = scriptInterface->getLuaState(); scriptInterface->pushFunction(scriptId); LuaScriptInterface::pushUserdata<Player>(L, player); LuaScriptInterface::setMetatable(L, -1, "Player"); LuaScriptInterface::pushUserdata<NetworkMessage>(L, const_cast<NetworkMessage*>(&msg)); LuaScriptInterface::setWeakMetatable(L, -1, "NetworkMessage"); lua_pushnumber(L, recvbyte); scriptInterface->callVoidFunction(3); }
[ "gjohnes2018@gmail.com" ]
gjohnes2018@gmail.com
79a6a4207eab38df5f291adee9c4a0acaf465d1e
3dfb9dec1846d2faafa32bf8cb064d53ca25cba4
/CMPE243/HW/Unit testing/sensor.cpp
cafd045ff29097e2c2087b23098bced4088dc904
[]
no_license
ychen928/my_SJSU_projects
3fcb80eaeb50f1f949ec2cc36d5729b4d16a4634
6454367d793e70bc96122deb20d15e11bb717e2a
refs/heads/master
2021-08-28T06:23:53.741225
2017-12-11T11:53:33
2017-12-11T11:53:33
107,641,465
0
0
null
null
null
null
UTF-8
C++
false
false
68
cpp
int read_sensor_value(int sensor_value) { return sensor_value; }
[ "ychen2809@gmail.com" ]
ychen2809@gmail.com
e35a9906361ca7f52b6816f3b3e0291423ca1c57
a0423109d0dd871a0e5ae7be64c57afd062c3375
/Aplicacion Movil/generated/bundles/login-transition/build/Android/Preview/app/src/main/include/Uno.ArgumentNullException.h
370ddf470bdaf697a9d19fbb38a4a13acd8a1349
[ "Apache-2.0" ]
permissive
marferfer/SpinOff-LoL
1c8a823302dac86133aa579d26ff90698bfc1ad6
a9dba8ac9dd476ec1ef94712d9a8e76d3b45aca8
refs/heads/master
2020-03-29T20:09:20.322768
2018-10-09T10:19:33
2018-10-09T10:19:33
150,298,258
0
0
null
null
null
null
UTF-8
C++
false
false
828
h
// This file was generated based on C:/Users/JuanJose/AppData/Local/Fusetools/Packages/UnoCore/1.9.0/Source/Uno/Exceptions/ArgumentNullException.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.ArgumentException.h> namespace g{namespace Uno{struct ArgumentNullException;}} namespace g{ namespace Uno{ // public sealed class ArgumentNullException :6 // { ::g::Uno::Exception_type* ArgumentNullException_typeof(); void ArgumentNullException__ctor_5_fn(ArgumentNullException* __this, uString* paramName); void ArgumentNullException__New6_fn(uString* paramName, ArgumentNullException** __retval); struct ArgumentNullException : ::g::Uno::ArgumentException { void ctor_5(uString* paramName); static ArgumentNullException* New6(uString* paramName); }; // } }} // ::g::Uno
[ "mariofdezfdez@hotmail.com" ]
mariofdezfdez@hotmail.com
f9e0da01fa6e8ace380b7e1e9e5ec78cc27cf4f5
33035c05aad9bca0b0cefd67529bdd70399a9e04
/src/boost_hana_fwd_monadic_fold_right.hpp
cfe6d18add04907e69c4765f63d70ab7c43e86df
[ "LicenseRef-scancode-unknown-license-reference", "BSL-1.0" ]
permissive
elvisbugs/BoostForArduino
7e2427ded5fd030231918524f6a91554085a8e64
b8c912bf671868e2182aa703ed34076c59acf474
refs/heads/master
2023-03-25T13:11:58.527671
2021-03-27T02:37:29
2021-03-27T02:37:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
49
hpp
#include <boost/hana/fwd/monadic_fold_right.hpp>
[ "k@kekyo.net" ]
k@kekyo.net
a144e44e03e0f60f75206ce23d030f2b812bbe72
7ed7151f5523aba4d747a69920ebd193d6ac891b
/平成26年/数位DP/HDU3943.cpp
943cb7f73643822a6556eefa9d94d5c9680da0f1
[ "LicenseRef-scancode-public-domain", "CC0-1.0" ]
permissive
zjkmxy/algo-problems
5965db9969855f208ae839d42a32a9b55781b590
7f2019a2ba650370e1e7af8ee96e6bfa5b4e3f87
refs/heads/master
2020-08-16T09:30:00.026431
2019-10-22T05:07:07
2019-10-22T05:07:07
215,485,779
0
0
null
null
null
null
GB18030
C++
false
false
1,982
cpp
//区间(P,Q]之间第K_i大的Nya数(含X个4和Y个7的数)。 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<queue> using namespace std; typedef signed long long LL; LL dp[30][10][21][21]; //位数,元素,4,7 void dp_calc() { int i, j, k, l, x; for(i=0;i<=9;i++) { dp[0][i][0][0] = 1; } dp[0][4][0][0] = 0; dp[0][4][1][0] = 1; dp[0][7][0][0] = 0; dp[0][7][0][1] = 1; for(i=1;i<30;i++) { for(j=0;j<10;j++) { for(k=0;k<=20;k++) { for(l=0;l<=20;l++) { for(x=0;x<10;x++) { switch(j) { case 4: if(k > 0) dp[i][j][k][l] += dp[i-1][x][k-1][l];//这里坑了我很久,因为k-1是负数的时候会得到错误的结果 break; case 7: if(l > 0) dp[i][j][k][l] += dp[i-1][x][k][l-1]; break; default: dp[i][j][k][l] += dp[i-1][x][k][l]; break; } } } } } } } LL calc(LL ans, int x, int y) { int i = 0, j, k; int dig[30]; LL ret = 0; while(ans > 0) { dig[i] = ans % 10; ans /= 10; i++; } dig[i] = 0; for(j=i-1;j>=0;j--) { for(k=0;k<dig[j];k++) { ret += dp[j][k][x][y]; } if(dig[j] == 4) { x--; } if(dig[j] == 7) { y--; } if(x < 0 || y < 0) break; } if(x == 0 && y == 0) ret++; return ret; } LL bisearch(LL p, LL q, int x, int y, LL k) { LL equ, mid, cur; equ = calc(p, x, y) + k; if(equ > calc(q, x, y)) return -1; //答案在(p,q]区间内 while(q > p + 1) { mid = (p + q) >> 1; cur = calc(mid, x, y); if(cur >= equ) { q = mid; }else{ p = mid; } } return q; } int main() { int t, x, y, n, i; LL ans, p, k, q; dp_calc(); scanf("%d",&t); for(i=1;i<=t;i++) { printf("Case #%d:\n",i); scanf("%I64d%I64d%d%d%d",&p,&q,&x,&y,&n); while(n--) { scanf("%I64d",&k); ans = bisearch(p, q, x, y, k); if(ans >= 0) printf("%I64d\n",ans); else printf("Nya!\n"); } } return 0; }
[ "bitmxy@gmail.com" ]
bitmxy@gmail.com
b0460e7205c1b236691aa73e513ee79b1b5dff1f
d1a7d51a1d1da1373ee03e44dc344e1793cd6fba
/arduinmove_feb3/arduinmove_feb3/arduinmove_feb3.ino
b3231674f0c1f83622650e3261f42aabcde91b0f
[]
no_license
ColeMcKechney/Robotics
d42daab48ae3b9934db9c99a5b583682d8375585
ec79f6e3f99c7569155784f3a8dea8a4e32e1e19
refs/heads/master
2021-01-04T12:54:24.469116
2020-02-27T19:14:20
2020-02-27T19:14:20
240,560,180
0
1
null
2020-02-19T17:21:49
2020-02-14T17:10:50
C++
UTF-8
C++
false
false
3,398
ino
#include <LobotServoController.h> LobotServoController myse(Serial); void setup() { Serial.begin(9600); while(!Serial); } void loop() { start(); delay (500); grab(); delay(500); hold(); delay(500); rotate(); delay(500); place(); delay(500); //myse.moveServo(6,160,2000); //move No.0 Servo in 1000ms to 500 position //delay(2000); //Serial.flush(); //myse.moveServo(3,900,2000); //move No.0 Servo in 1000ms to 1500 position // delay(2000); // Serial.flush(); // myse.moveServo(5,150,2000); //move No.0 Servo in 1000ms to 1500 position // delay(2000); // Serial.flush(); // myse.moveServo(4,850,2000); //move No.0 Servo in 1000ms to 1500 position // delay(2000); // Serial.flush(); //myse.moveServo(2,900,2000); //move No.0 Servo in 1000ms to 1500 position //delay(2000); //Serial.flush(); // myse.moveServo(1,900,2000); //move No.0 Servo in 1000ms to 1500 position // delay(2000); // Serial.flush(); } void start(){ myse.moveServo(3,500,2000); //move No.0 Servo in 1000ms to 1500 position delay(1000); Serial.flush(); myse.moveServo(5,500,2000); //move No.0 Servo in 1000ms to 1500 position delay(1000); Serial.flush(); myse.moveServo(4,500,2000); //move No.0 Servo in 1000ms to 1500 position delay(1000); Serial.flush(); myse.moveServo(2,500,2000); //move No.0 Servo in 1000ms to 1500 position delay(1000); Serial.flush(); myse.moveServo(1,0,2000); //move No.0 Servo in 1000ms to 1500 position delay(1000); Serial.flush(); myse.moveServo(6,940,2000); //move No.0 Servo in 1000ms to 1500 position delay(1000); Serial.flush(); } void grab(){ myse.moveServo(3,600,500); //move No.0 Servo in 1000ms to 500 position delay(100); Serial.flush(); myse.moveServo(5,150,1500); //move No.0 Servo in 1000ms to 1500 position delay(100); Serial.flush(); myse.moveServo(4,600,500); //move No.0 Servo in 1000ms to 1500 position delay(100); Serial.flush(); myse.moveServo(1,400,2000); //move No.0 Servo in 1000ms to 1500 position delay(2000); Serial.flush(); } void hold(){ myse.moveServo(6,940,2000); //move No.0 Servo in 1000ms to 1500 position delay(1000); Serial.flush(); myse.moveServo(3,500,2000); //move No.0 Servo in 1000ms to 1500 position delay(1000); Serial.flush(); myse.moveServo(5,500,2000); //move No.0 Servo in 1000ms to 1500 position delay(1000); Serial.flush(); myse.moveServo(4,500,2000); //move No.0 Servo in 1000ms to 1500 position delay(1000); Serial.flush(); myse.moveServo(2,500,2000); //move No.0 Servo in 1000ms to 1500 position delay(1000); Serial.flush(); myse.moveServo(1,400,2000); //move No.0 Servo in 1000ms to 1500 position delay(1000); Serial.flush(); } void rotate(){ myse.moveServo(6,160,2000); //move No.0 Servo in 1000ms to 1500 position delay(1000); Serial.flush(); } void place(){ myse.moveServo(3,600,500); //move No.0 Servo in 1000ms to 500 position delay(2000); Serial.flush(); myse.moveServo(5,150,1500); //move No.0 Servo in 1000ms to 1500 position delay(2000); Serial.flush(); myse.moveServo(4,600,500); //move No.0 Servo in 1000ms to 1500 position delay(2000); Serial.flush(); myse.moveServo(1,0,2000); //move No.0 Servo in 1000ms to 1500 position delay(2000); Serial.flush(); }
[ "noreply@github.com" ]
ColeMcKechney.noreply@github.com
f8437976bec80df5972f1e2d06fed314ff8b0d81
eaae950ea581cf441ebaaeaa584d15f22a235f65
/tests/sqlite/localURIDatabase/src/testCode/testRequestReply/requesterProcess/main.cpp
9ac798dba34e2fe9214cc9b7a70e7a591516ad13
[]
no_license
charlesrwest/societyOfMachines
ab4f95ae6fdf0a9e470d962185fd76e737167aae
1d8091d2d0e990b20597110a564a0fdd89b08039
refs/heads/master
2020-12-24T16:49:19.085136
2015-03-01T00:26:51
2015-03-01T00:26:51
22,320,803
0
0
null
null
null
null
UTF-8
C++
false
false
2,150
cpp
#include<stdio.h> #include "localURIDatabase.h" #include "utilityFunctions.h" #include<vector> #include<string> #include<exception> #include<unistd.h> #include "localURIEngine.hpp" #include "SOMScopeGuard.hpp" #include "localReplier.hpp" #include "localRequester.hpp" #include "SOMException.hpp" /* This program is meant to be used with replierProcess. It seaches for repliers that have tag "tag4" and sends requests to the first one it finds. */ int main(int argc, char **argv) { try { //Start the URI engine localURIEngine::startEngine("../IPCDirectory/"); //Construct the query to find repliers with the "tag4" tag localURIQuery myQuery1; myQuery1.add_requiredtags("tag4"); //Send the query std::vector<localURI> queryResults1; queryResults1 = localURIEngine::getRepliers(myQuery1); //Thread-safe //Print out the URIs that were found printf("Matching URIs:\n"); for(int i=0; i<queryResults1.size(); i++) { printf("%s\n", uriToString(queryResults1[i]).c_str()); } //Check to make sure at least one match was found if(queryResults1.size() == 0) { fprintf(stderr, "Error, no repliers match required criteria\n"); return 1; } //Build a requester with the first matching URI localRequester myRequester(queryResults1[0]); //Send over 9000 requests zmq::message_t messageBuffer; for(int i=0; i<9001; i++) { //Build the request string std::string requestString = "Request number " + std::to_string(i); //Send request printf("Sending request %s\n", requestString.c_str()); if(myRequester.sendRequest(requestString.c_str(), requestString.size()) != 1) { throw SOMException("Requester had a spot of trouble sending request\n", UNKNOWN, __FILE__, __LINE__); } //Restore the message buffer to a blank slate messageBuffer.rebuild(); //Get the reply if(myRequester.getReply(&messageBuffer) != 1) { throw SOMException("Requester had a spot of trouble getting reply\n", UNKNOWN, __FILE__, __LINE__); } //Print out what the replier sent printf("Received: "); fwrite(messageBuffer.data(), 1, messageBuffer.size(), stdout); printf("\n"); } } catch(const std::exception &inputException) { fprintf(stderr, "%s", inputException.what()); } return 0; }
[ "crwest@ncsu.edu" ]
crwest@ncsu.edu
2ed35f7d7dbcdbb4d0758dc86d90b3653ded34dd
b33a9177edaaf6bf185ef20bf87d36eada719d4f
/qtbase/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
e6267e8b6c0e2da4f866d7c3d187efb1b1f3499b
[ "LicenseRef-scancode-proprietary-license", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-commercial-license", "LGPL-2.0-or-later", "LGPL-2.1-only", "GFDL-1.3-only", "LicenseRef-scancode-qt-commercial-1.1", "LGPL-3.0-only", "LicenseRef-scancode-qt-company-exception-lgpl-2.1", ...
permissive
wgnet/wds_qt
ab8c093b8c6eead9adf4057d843e00f04915d987
8db722fd367d2d0744decf99ac7bafaba8b8a3d3
refs/heads/master
2021-04-02T11:07:10.181067
2020-06-02T10:29:03
2020-06-02T10:34:19
248,267,925
1
0
Apache-2.0
2020-04-30T12:16:53
2020-03-18T15:20:38
null
UTF-8
C++
false
false
3,228
cpp
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** 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 The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/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 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include <qtest.h> #include <QtCore/qvariant.h> #define ITERATION_COUNT 1e5 class tst_QGuiVariant : public QObject { Q_OBJECT public: tst_QGuiVariant(); virtual ~tst_QGuiVariant(); private slots: void createGuiType_data(); void createGuiType(); void createGuiTypeCopy_data(); void createGuiTypeCopy(); }; tst_QGuiVariant::tst_QGuiVariant() { } tst_QGuiVariant::~tst_QGuiVariant() { } void tst_QGuiVariant::createGuiType_data() { QTest::addColumn<int>("typeId"); for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i) QTest::newRow(QMetaType::typeName(i)) << i; } // Tests how fast a Qt GUI type can be default-constructed by a // QVariant. The purpose of this benchmark is to measure the overhead // of creating (and destroying) a QVariant compared to creating the // type directly. void tst_QGuiVariant::createGuiType() { QFETCH(int, typeId); QBENCHMARK { for (int i = 0; i < ITERATION_COUNT; ++i) QVariant(typeId, (void *)0); } } void tst_QGuiVariant::createGuiTypeCopy_data() { createGuiType_data(); } // Tests how fast a Qt GUI type can be copy-constructed by a // QVariant. The purpose of this benchmark is to measure the overhead // of creating (and destroying) a QVariant compared to creating the // type directly. void tst_QGuiVariant::createGuiTypeCopy() { QFETCH(int, typeId); QVariant other(typeId, (void *)0); const void *copy = other.constData(); QBENCHMARK { for (int i = 0; i < ITERATION_COUNT; ++i) QVariant(typeId, copy); } } QTEST_MAIN(tst_QGuiVariant) #include "tst_qguivariant.moc"
[ "p_pavlov@wargaming.net" ]
p_pavlov@wargaming.net
740ae376b1114bbb9fa6b1c11a10dc6fec54a821
ac4ca0a2c6b41832a84853c58c619940e15ed779
/include/marnav/nmea/zfo.hpp
57ed2da7fe3b56650e25c18c4579f21613cc9734
[ "BSD-3-Clause", "BSD-4-Clause" ]
permissive
mariokonrad/marnav
12c2fff7117dfee356b8318e8e964ee8d6e81459
01c55205736fcc8157891b84e3efe387a221ff3a
refs/heads/master
2023-06-08T13:53:39.701103
2023-04-28T15:15:06
2023-05-04T15:50:15
37,308,245
84
48
NOASSERTION
2023-06-05T14:16:36
2015-06-12T07:26:41
C++
UTF-8
C++
false
false
1,571
hpp
#ifndef MARNAV_NMEA_ZFO_HPP #define MARNAV_NMEA_ZFO_HPP #include <marnav/nmea/sentence.hpp> #include <marnav/nmea/time.hpp> #include <marnav/nmea/waypoint.hpp> #include <optional> namespace marnav::nmea { /// @brief ZFO - UTC & Time from origin Waypoint /// /// @code /// 1 2 3 /// | | | /// $--ZFO,hhmmss.ss,hhmmss.ss,c--c*hh<CR><LF> /// @endcode /// /// Field Number: /// 1. Universal Time Coordinated (UTC) /// 2. Elapsed Time /// 3. Origin Waypoint ID /// class zfo : public sentence { friend class detail::factory; public: constexpr static sentence_id ID = sentence_id::ZFO; constexpr static const char * TAG = "ZFO"; zfo(); zfo(const zfo &) = default; zfo & operator=(const zfo &) = default; zfo(zfo &&) = default; zfo & operator=(zfo &&) = default; protected: zfo(talker talk, fields::const_iterator first, fields::const_iterator last); void append_data_to(std::string &, const version &) const override; private: std::optional<nmea::time> time_utc_; std::optional<nmea::duration> time_elapsed_; std::optional<waypoint> waypoint_id_; public: std::optional<nmea::time> get_time_utc() const { return time_utc_; } std::optional<nmea::duration> get_time_elapsed() const { return time_elapsed_; } std::optional<waypoint> get_waypoint_id() const { return waypoint_id_; } void set_time_utc(const nmea::time & t) noexcept { time_utc_ = t; } void set_time_elapsed(const nmea::duration & t) noexcept { time_elapsed_ = t; } void set_waypoint_id(const waypoint & id) { waypoint_id_ = id; } }; } #endif
[ "mario.konrad@gmx.net" ]
mario.konrad@gmx.net
b7bfd095085da0931384af482c7115d2f8df47ca
2fd1f7cb28d069d38391496946a18df0b9736cf7
/20190716/20190716_p2.cpp
b04ef328934d9c81e866de48f737f3148891173e
[]
no_license
jyb2605/SW-Algorithm
c268bb5186b70a95bf5aefeb8dd3a236c04ced94
51f39694fad2752a3383381f6f514d6e0d9b275d
refs/heads/master
2020-06-21T09:03:03.335460
2019-07-17T15:15:55
2019-07-17T15:15:55
197,402,426
0
0
null
null
null
null
UTF-8
C++
false
false
801
cpp
/* * D2 * 1945. 간단한 소인수분해 */ #include <iostream> #include <vector> using namespace std; int main() { int testcase; cin >> testcase; for (int _case = 1; _case <= testcase; _case++) { int number; cin >> number; cout << '#' << _case << ' '; int count = 0; while ((number % 2) == 0) { number /= 2; count++; } cout << count << ' '; count = 0; while ((number % 3) == 0) { number /= 3; count++; } cout << count << ' '; count = 0; while ((number % 5) == 0) { number /= 5; count++; } cout << count << ' '; count = 0; while ((number % 7) == 0) { number /= 7; count++; } cout << count << ' '; count = 0; while ((number % 11) == 0) { number /= 11; count++; } cout << count<<'\n'; } return 0; }
[ "jyb2605@gmail.com" ]
jyb2605@gmail.com
d7ccb6631c561457e19bc4a3bde074885fb461df
d05174cfc67cdf43d085ed631a3ef239766b3eec
/person_profiler/common/split.hpp
6768c4401d5ef1e1461969716594a81088ca9cd8
[]
no_license
crastinus/person_profiler
483a62c3d7e3349bab6393631aad5c87d12b8af6
01392591d041a4563f0d75a450b8ebdf8fa2632d
refs/heads/master
2020-04-08T02:10:41.324457
2019-01-14T04:48:02
2019-01-14T04:48:02
158,925,471
0
0
null
null
null
null
UTF-8
C++
false
false
364
hpp
#pragma once #include <vector> #include <string> enum class split_opts { allow_blank = 0, skip_blank = 1 }; std::vector<std::string> split_any(std::string const& source_str, char const* separators, split_opts options = split_opts::allow_blank); template<typename Type> std::vector<Type> split_to(std::string const& source_str, char const* separators);
[ "crastin@yandex.ru" ]
crastin@yandex.ru
565aaefc299cc7d52188181691333ee643039701
c360e28952459a353156e654da7ab1fc2c0adc50
/maker_yaogan_test/maker_yaogan_test.ino
b08d72f18827ae24377fccc5ad6a48647551e037
[]
no_license
az666/arduino_projects
ec8fd40d63154f6ad2369edfb50f4278a38e67e8
94f4dd52a51a52c416a2580c766f8c29529826fb
refs/heads/master
2020-03-19T23:41:13.364066
2018-06-12T04:11:18
2018-06-12T04:11:18
137,015,588
0
0
null
null
null
null
UTF-8
C++
false
false
532
ino
int X=A0; int Y=A1; int BUTTON=7; void setup(void) { Serial.begin(9600);//设置串口通信9600波特率 pinMode(BUTTON,INPUT_PULLUP); } void loop(void) { Serial.print("X="); Serial.print(analogRead(X));//读取摇杆X轴的值,串口显示 Serial.print(","); Serial.print("Y="); Serial.print(analogRead(Y));//读取摇杆Y轴的值,串口显示 Serial.print(","); Serial.print("BUTTON state = "); Serial.println(digitalRead(BUTTON));//读按键值,串口显示 delay(100); //100ms刷新一次 }
[ "noreply@github.com" ]
az666.noreply@github.com
cb332d6ef0e7ab246126c5b81c9c38b898b3b476
a94008428e172058c1ed532911f36399c5f3dc7c
/TouchGFX/generated/fonts/src/Kerning_arial_28_4bpp.cpp
e6a551f46b210975c5732a7d56f6636e2745daae
[]
no_license
HanesSciarrone/ATIOGUI
a07097ee0837a9e39abd0b21e17b4673d27c3174
c895e4ab51253ebe975b02a8d3b9b057307b3149
refs/heads/master
2023-03-18T05:02:02.031953
2021-02-08T22:58:05
2021-02-08T22:58:05
291,339,164
0
0
null
null
null
null
UTF-8
C++
false
false
7,255
cpp
#include <touchgfx/Font.hpp> FONT_KERNING_LOCATION_FLASH_PRAGMA KEEP extern const touchgfx::KerningNode kerning_arial_28_4bpp[] FONT_KERNING_LOCATION_FLASH_ATTRIBUTE = { { 0x0041, -2 }, // (First char = [0x0041, A], Second char = [0x0020, ], Kerning dist = -2) { 0x004C, -1 }, // (First char = [0x004C, L], Second char = [0x0020, ], Kerning dist = -1) { 0x0046, -3 }, // (First char = [0x0046, F], Second char = [0x002C, ,], Kerning dist = -3) { 0x0050, -4 }, // (First char = [0x0050, P], Second char = [0x002C, ,], Kerning dist = -4) { 0x0054, -3 }, // (First char = [0x0054, T], Second char = [0x002C, ,], Kerning dist = -3) { 0x0056, -3 }, // (First char = [0x0056, V], Second char = [0x002C, ,], Kerning dist = -3) { 0x0057, -2 }, // (First char = [0x0057, W], Second char = [0x002C, ,], Kerning dist = -2) { 0x0059, -4 }, // (First char = [0x0059, Y], Second char = [0x002C, ,], Kerning dist = -4) { 0x0072, -2 }, // (First char = [0x0072, r], Second char = [0x002C, ,], Kerning dist = -2) { 0x0076, -2 }, // (First char = [0x0076, v], Second char = [0x002C, ,], Kerning dist = -2) { 0x0077, -2 }, // (First char = [0x0077, w], Second char = [0x002C, ,], Kerning dist = -2) { 0x0079, -2 }, // (First char = [0x0079, y], Second char = [0x002C, ,], Kerning dist = -2) { 0x0054, -2 }, // (First char = [0x0054, T], Second char = [0x002D, -], Kerning dist = -2) { 0x0056, -2 }, // (First char = [0x0056, V], Second char = [0x002D, -], Kerning dist = -2) { 0x0059, -3 }, // (First char = [0x0059, Y], Second char = [0x002D, -], Kerning dist = -3) { 0x0046, -3 }, // (First char = [0x0046, F], Second char = [0x002E, .], Kerning dist = -3) { 0x0050, -4 }, // (First char = [0x0050, P], Second char = [0x002E, .], Kerning dist = -4) { 0x0054, -3 }, // (First char = [0x0054, T], Second char = [0x002E, .], Kerning dist = -3) { 0x0056, -3 }, // (First char = [0x0056, V], Second char = [0x002E, .], Kerning dist = -3) { 0x0057, -2 }, // (First char = [0x0057, W], Second char = [0x002E, .], Kerning dist = -2) { 0x0059, -4 }, // (First char = [0x0059, Y], Second char = [0x002E, .], Kerning dist = -4) { 0x0072, -2 }, // (First char = [0x0072, r], Second char = [0x002E, .], Kerning dist = -2) { 0x0076, -2 }, // (First char = [0x0076, v], Second char = [0x002E, .], Kerning dist = -2) { 0x0077, -2 }, // (First char = [0x0077, w], Second char = [0x002E, .], Kerning dist = -2) { 0x0079, -2 }, // (First char = [0x0079, y], Second char = [0x002E, .], Kerning dist = -2) { 0x0031, -2 }, // (First char = [0x0031, 1], Second char = [0x0031, 1], Kerning dist = -2) { 0x0054, -3 }, // (First char = [0x0054, T], Second char = [0x003A, :], Kerning dist = -3) { 0x0056, -1 }, // (First char = [0x0056, V], Second char = [0x003A, :], Kerning dist = -1) { 0x0059, -2 }, // (First char = [0x0059, Y], Second char = [0x003A, :], Kerning dist = -2) { 0x0054, -3 }, // (First char = [0x0054, T], Second char = [0x003B, ;], Kerning dist = -3) { 0x0056, -1 }, // (First char = [0x0056, V], Second char = [0x003B, ;], Kerning dist = -1) { 0x0059, -2 }, // (First char = [0x0059, Y], Second char = [0x003B, ;], Kerning dist = -2) { 0x0020, -2 }, // (First char = [0x0020, ], Second char = [0x0041, A], Kerning dist = -2) { 0x0046, -2 }, // (First char = [0x0046, F], Second char = [0x0041, A], Kerning dist = -2) { 0x0050, -2 }, // (First char = [0x0050, P], Second char = [0x0041, A], Kerning dist = -2) { 0x0054, -2 }, // (First char = [0x0054, T], Second char = [0x0041, A], Kerning dist = -2) { 0x0056, -2 }, // (First char = [0x0056, V], Second char = [0x0041, A], Kerning dist = -2) { 0x0057, -1 }, // (First char = [0x0057, W], Second char = [0x0041, A], Kerning dist = -1) { 0x0059, -2 }, // (First char = [0x0059, Y], Second char = [0x0041, A], Kerning dist = -2) { 0x0041, -2 }, // (First char = [0x0041, A], Second char = [0x0054, T], Kerning dist = -2) { 0x004C, -2 }, // (First char = [0x004C, L], Second char = [0x0054, T], Kerning dist = -2) { 0x0041, -2 }, // (First char = [0x0041, A], Second char = [0x0056, V], Kerning dist = -2) { 0x004C, -2 }, // (First char = [0x004C, L], Second char = [0x0056, V], Kerning dist = -2) { 0x0041, -1 }, // (First char = [0x0041, A], Second char = [0x0057, W], Kerning dist = -1) { 0x004C, -2 }, // (First char = [0x004C, L], Second char = [0x0057, W], Kerning dist = -2) { 0x0041, -2 }, // (First char = [0x0041, A], Second char = [0x0059, Y], Kerning dist = -2) { 0x004C, -2 }, // (First char = [0x004C, L], Second char = [0x0059, Y], Kerning dist = -2) { 0x0054, -3 }, // (First char = [0x0054, T], Second char = [0x0061, a], Kerning dist = -3) { 0x0056, -2 }, // (First char = [0x0056, V], Second char = [0x0061, a], Kerning dist = -2) { 0x0057, -1 }, // (First char = [0x0057, W], Second char = [0x0061, a], Kerning dist = -1) { 0x0059, -2 }, // (First char = [0x0059, Y], Second char = [0x0061, a], Kerning dist = -2) { 0x0054, -3 }, // (First char = [0x0054, T], Second char = [0x0063, c], Kerning dist = -3) { 0x0054, -3 }, // (First char = [0x0054, T], Second char = [0x0065, e], Kerning dist = -3) { 0x0056, -2 }, // (First char = [0x0056, V], Second char = [0x0065, e], Kerning dist = -2) { 0x0059, -3 }, // (First char = [0x0059, Y], Second char = [0x0065, e], Kerning dist = -3) { 0x0054, -1 }, // (First char = [0x0054, T], Second char = [0x0069, i], Kerning dist = -1) { 0x0059, -1 }, // (First char = [0x0059, Y], Second char = [0x0069, i], Kerning dist = -1) { 0x0054, -3 }, // (First char = [0x0054, T], Second char = [0x006F, o], Kerning dist = -3) { 0x0056, -2 }, // (First char = [0x0056, V], Second char = [0x006F, o], Kerning dist = -2) { 0x0059, -3 }, // (First char = [0x0059, Y], Second char = [0x006F, o], Kerning dist = -3) { 0x0059, -2 }, // (First char = [0x0059, Y], Second char = [0x0070, p], Kerning dist = -2) { 0x0059, -3 }, // (First char = [0x0059, Y], Second char = [0x0071, q], Kerning dist = -3) { 0x0054, -1 }, // (First char = [0x0054, T], Second char = [0x0072, r], Kerning dist = -1) { 0x0056, -1 }, // (First char = [0x0056, V], Second char = [0x0072, r], Kerning dist = -1) { 0x0054, -3 }, // (First char = [0x0054, T], Second char = [0x0073, s], Kerning dist = -3) { 0x0054, -1 }, // (First char = [0x0054, T], Second char = [0x0075, u], Kerning dist = -1) { 0x0056, -1 }, // (First char = [0x0056, V], Second char = [0x0075, u], Kerning dist = -1) { 0x0059, -2 }, // (First char = [0x0059, Y], Second char = [0x0075, u], Kerning dist = -2) { 0x0059, -2 }, // (First char = [0x0059, Y], Second char = [0x0076, v], Kerning dist = -2) { 0x0054, -2 }, // (First char = [0x0054, T], Second char = [0x0077, w], Kerning dist = -2) { 0x004C, -1 }, // (First char = [0x004C, L], Second char = [0x0079, y], Kerning dist = -1) { 0x0054, -2 }, // (First char = [0x0054, T], Second char = [0x0079, y], Kerning dist = -2) { 0x0056, -1 }, // (First char = [0x0056, V], Second char = [0x0079, y], Kerning dist = -1) };
[ "hsciarrone@atioinc.com" ]
hsciarrone@atioinc.com
e8b530b46a0c794f87781fd6dbf38186f52c179c
3ea34c23f90326359c3c64281680a7ee237ff0f2
/Data/2451/H
cb2e7858153ea4b728cdf85e74b67bc723760a18
[]
no_license
lcnbr/EM
c6b90c02ba08422809e94882917c87ae81b501a2
aec19cb6e07e6659786e92db0ccbe4f3d0b6c317
refs/heads/master
2023-04-28T20:25:40.955518
2020-02-16T23:14:07
2020-02-16T23:14:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
91,826
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | foam-extend: Open Source Cstd::filesystem::create_directory();FD | | \\ / O peration | Version: 4.0 | | \\ / A nd | Web: http://www.foam-extend.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "Data/2451"; object H; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField nonuniform List<vector> 4096 ( (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.8187504071923e-12,1.14778763052927e-11,-1.21530559580352e-11) (3.20420316287273e-12,2.32687804570544e-11,-1.17877857354911e-11) (4.56804805136083e-12,3.791624613847e-11,-1.08481892719083e-11) (6.55394423721697e-12,5.97827913812408e-11,-9.56345790397223e-12) (7.0818578151963e-12,9.25810768631403e-11,-7.85370590722618e-12) (5.65324870868563e-12,1.44964527640633e-10,-5.56572872310898e-12) (4.24563829734528e-12,2.30746096638789e-10,-3.13767454158745e-12) (3.22193232558615e-12,3.73937292358355e-10,-1.68313543185932e-12) (3.45703184780961e-12,6.11346470731087e-10,-1.01286431527076e-12) (4.01730700978986e-12,9.41392798683354e-10,-3.89238476151437e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.48898016153696e-12,1.07678410322294e-11,-2.57958462616229e-11) (6.56267673127115e-12,2.21569144259161e-11,-2.52828065970737e-11) (9.07365378992e-12,3.66233658068171e-11,-2.35593486856966e-11) (1.21958341230709e-11,5.83362390540329e-11,-2.10174952536704e-11) (1.2915444036109e-11,9.08665050882313e-11,-1.70116929711256e-11) (1.06294845591983e-11,1.43342470969556e-10,-1.18913910765516e-11) (8.02415431989563e-12,2.30012651019529e-10,-7.32794123227275e-12) (7.16414808138779e-12,3.73841156806806e-10,-4.59189902444297e-12) (8.42813138868945e-12,6.11397089541822e-10,-3.10113628997794e-12) (9.4292383181083e-12,9.41646119135592e-10,-1.60599876230596e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.80550388131997e-12,9.95594459709606e-12,-4.31756794346278e-11) (9.35426269376243e-12,2.03919019154172e-11,-4.17503156272778e-11) (1.3480235569295e-11,3.3986048401264e-11,-3.90844989607859e-11) (1.75214789712406e-11,5.44093779619977e-11,-3.5604407005325e-11) (1.88685383747311e-11,8.58807640228851e-11,-2.98098058565179e-11) (1.70321946836611e-11,1.38878288176485e-10,-2.24892319693527e-11) (1.38345625444735e-11,2.27261132600451e-10,-1.56821662910626e-11) (1.15298843393158e-11,3.72969888905714e-10,-1.11362810264584e-11) (1.21685809495875e-11,6.11247804794656e-10,-8.13271983373469e-12) (1.3262028376648e-11,9.41537393538789e-10,-4.67099186223234e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.4561927338781e-12,8.69511379046852e-12,-6.54363272542706e-11) (1.14348925536472e-11,1.80679725376759e-11,-6.40114805270037e-11) (1.72217324306164e-11,3.02474379758813e-11,-6.09014493494568e-11) (2.12335480089143e-11,4.84316315873462e-11,-5.64155529125501e-11) (2.3795001754922e-11,7.8333532326241e-11,-4.98519379080403e-11) (2.34804995307597e-11,1.31302649210515e-10,-4.13832406379872e-11) (2.08416462304793e-11,2.21663163491101e-10,-3.2617491592108e-11) (1.70146116936711e-11,3.70208012553864e-10,-2.52520802333692e-11) (1.55859629620856e-11,6.09327150721924e-10,-1.84489188219773e-11) (1.64743082475945e-11,9.39020987474547e-10,-1.01224744032123e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.37614040342334e-12,7.00445647157128e-12,-9.80149098794369e-11) (1.18419855575092e-11,1.4637403103667e-11,-9.65528416871989e-11) (1.83918226402356e-11,2.47681373302511e-11,-9.36365449788377e-11) (2.24160779671168e-11,4.0639667837471e-11,-8.94006191572874e-11) (2.55127474961355e-11,6.85848415169955e-11,-8.35447849466775e-11) (2.6287250514386e-11,1.20553534600669e-10,-7.58763649291562e-11) (2.39601982622256e-11,2.12459002732294e-10,-6.63345396424466e-11) (2.07177873568613e-11,3.63426613051275e-10,-5.30143351025988e-11) (1.98322861629659e-11,6.0213122427939e-10,-3.79553052623326e-11) (2.08174673464569e-11,9.30739745528964e-10,-2.00375663774415e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.63089424365217e-12,5.12864612646027e-12,-1.49136770449975e-10) (1.25657455377936e-11,1.07456686191003e-11,-1.47729917316285e-10) (1.85913010356784e-11,1.91085813129937e-11,-1.45576585879826e-10) (2.21567496480185e-11,3.30016928969409e-11,-1.42269959085773e-10) (2.44709725599113e-11,5.87177168052822e-11,-1.3730632590661e-10) (2.51224442758762e-11,1.09012714882724e-10,-1.2987612581142e-10) (2.40806892742251e-11,2.01464807602519e-10,-1.17476048128414e-10) (2.18186658567619e-11,3.50892785268856e-10,-9.79390265389889e-11) (2.17853171452702e-11,5.86712035362133e-10,-7.17646189065499e-11) (2.27487848270091e-11,9.13421508562247e-10,-3.8407006024624e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.09622732325186e-12,4.02304589160919e-12,-2.3138876099835e-10) (1.23570033968032e-11,8.07682883507952e-12,-2.30145167996741e-10) (1.7623684425857e-11,1.48323846583206e-11,-2.28784720333968e-10) (1.97644938634351e-11,2.67929608328454e-11,-2.26340879549467e-10) (2.0807637239026e-11,4.96130625827349e-11,-2.21905609994046e-10) (2.20768381241459e-11,9.58789734444911e-11,-2.13686719893525e-10) (2.40260185005549e-11,1.84652663589364e-10,-1.96884874119453e-10) (2.4064762815423e-11,3.27353345677019e-10,-1.69953632374563e-10) (2.50059362616108e-11,5.56248097022939e-10,-1.27764334694452e-10) (2.54132690311838e-11,8.7836847650639e-10,-6.96911297317356e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.84393924006723e-12,2.64110382799315e-12,-3.70513150301485e-10) (1.07656207957774e-11,5.74310538667767e-12,-3.70132341264506e-10) (1.48966212755489e-11,1.12359156638406e-11,-3.69292321901254e-10) (1.64711231091253e-11,2.13593859323102e-11,-3.67039928226601e-10) (1.66475356081901e-11,4.13217599839425e-11,-3.62387396271595e-10) (1.85993500828792e-11,8.20491543317339e-11,-3.52531529089892e-10) (2.17963716616387e-11,1.59499596486399e-10,-3.3154213205083e-10) (2.41194761054079e-11,2.8665243194418e-10,-2.9176932326967e-10) (2.60586179134209e-11,5.00384057724787e-10,-2.26247507909167e-10) (2.59561561569622e-11,8.11102600235256e-10,-1.28194515609484e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.23637243644051e-12,1.40069461582446e-12,-6.04587180592413e-10) (1.0731398180861e-11,3.55003920202821e-12,-6.04600413834341e-10) (1.28999636195453e-11,7.75387201055491e-12,-6.03882231905284e-10) (1.33945376615199e-11,1.57041707630562e-11,-6.01346124492301e-10) (1.32535840954767e-11,3.10083728063376e-11,-5.95711844000611e-10) (1.62081820941248e-11,6.16120678303237e-11,-5.82925461074133e-10) (2.00557342883549e-11,1.19812105203404e-10,-5.55442880268234e-10) (2.29410376028993e-11,2.2134229204894e-10,-5.01471436977561e-10) (2.56176359527175e-11,4.03557004351687e-10,-4.056558640718e-10) (2.55013311594491e-11,6.84219230249334e-10,-2.43538214352614e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.96206377843e-12,6.81923822922544e-13,-9.34303391210821e-10) (1.05385667855296e-11,1.9523799161242e-12,-9.33793730874773e-10) (1.08662440845415e-11,4.19949039445886e-12,-9.32418699585681e-10) (1.0294627529394e-11,8.58123770070591e-12,-9.29450432188968e-10) (1.06143905909445e-11,1.68822387965811e-11,-9.22866350998492e-10) (1.5057840846281e-11,3.34897244222131e-11,-9.07807671572915e-10) (1.96756520586229e-11,6.5519597583837e-11,-8.75148850811226e-10) (2.28485926213368e-11,1.25343259971967e-10,-8.10130987784926e-10) (2.58928177420813e-11,2.42081867245817e-10,-6.85245330635968e-10) (2.61773118337826e-11,4.41516767782893e-10,-4.42591371375628e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.16351545770839e-12,2.11294348838524e-11,-2.34281540131157e-11) (3.37647273042781e-12,4.32179473230313e-11,-2.24443576074927e-11) (4.57619701505761e-12,7.02866471869865e-11,-2.04955468483149e-11) (6.29074456767825e-12,1.09262703240527e-10,-1.74759474176973e-11) (6.50845240593031e-12,1.67277068593688e-10,-1.30247775462524e-11) (4.84725119825548e-12,2.58334309006821e-10,-7.89350491716156e-12) (3.52454480696823e-12,4.04764610388597e-10,-3.04628454585673e-12) (2.64779676040863e-12,6.53530610389321e-10,-2.69972665434527e-13) (2.7827871975862e-12,1.12767165047311e-09,4.50366557507435e-13) (3.37474808093106e-12,2.21190261236036e-09,2.79931436302164e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.78783693212173e-12,2.00695002777006e-11,-4.76448113487592e-11) (6.60423133039636e-12,4.11881873655296e-11,-4.63086850742612e-11) (9.16911776345324e-12,6.73695583559383e-11,-4.2709840726774e-11) (1.21168929325485e-11,1.0560785661371e-10,-3.67966704388933e-11) (1.27808832068846e-11,1.6303374699755e-10,-2.76556506347129e-11) (1.0530217507964e-11,2.54558715668315e-10,-1.68906651402285e-11) (8.03963053102897e-12,4.03553065109702e-10,-7.29263693236112e-12) (6.54465324829797e-12,6.53983623967288e-10,-2.60076247092262e-12) (7.08227860850892e-12,1.12848572718097e-09,-1.26482815092831e-12) (7.93196515271893e-12,2.21260026278914e-09,-7.9191678826047e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.64097088059804e-12,1.82553139333408e-11,-7.97183630430755e-11) (9.01237540501722e-12,3.74494396361198e-11,-7.71288000698553e-11) (1.37387540392297e-11,6.17056315085556e-11,-7.18934694274352e-11) (1.7704624197093e-11,9.75833324998267e-11,-6.36635125171454e-11) (1.90951961841637e-11,1.53187432117541e-10,-5.10052401434297e-11) (1.78007679713518e-11,2.45877137773386e-10,-3.5190350272855e-11) (1.48866463891919e-11,3.99955799333892e-10,-1.95302697682126e-11) (1.12881994982493e-11,6.54468313854871e-10,-1.19806383774113e-11) (1.06275070506401e-11,1.1298855530278e-09,-8.92430978819059e-12) (1.11074425784069e-11,2.21353666000273e-09,-5.47067531222834e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.72200332550779e-12,1.54631325432126e-11,-1.20958191773376e-10) (1.17554308101058e-11,3.22266881294706e-11,-1.17782457674241e-10) (1.82151366393318e-11,5.35816046103514e-11,-1.11601728321134e-10) (2.24618967542821e-11,8.53730991122615e-11,-1.02072932757293e-10) (2.50749952940981e-11,1.37177017491328e-10,-8.81774388372497e-11) (2.54638650947369e-11,2.29319515019395e-10,-6.95135149241457e-11) (2.26803956305418e-11,3.90550738884734e-10,-4.9031705749356e-11) (1.69928497849743e-11,6.53202202327103e-10,-3.69681031812589e-11) (1.44554449863815e-11,1.12967672514434e-09,-2.75539702502165e-11) (1.46330757908142e-11,2.21155019538164e-09,-1.53502186778325e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.78988255629676e-12,1.22451917215442e-11,-1.7909000408388e-10) (1.28174233337132e-11,2.58485541974544e-11,-1.76134356171447e-10) (1.98154528359422e-11,4.33597113348702e-11,-1.70435939072273e-10) (2.41982186970276e-11,6.99081246391282e-11,-1.61588638268053e-10) (2.77114521903407e-11,1.1555464838632e-10,-1.49372676310015e-10) (2.82862449456268e-11,2.033129432169e-10,-1.34391596837197e-10) (2.16341888521492e-11,3.69616239283536e-10,-1.20104579943304e-10) (1.81925852991998e-11,6.45983980323373e-10,-9.31867646179048e-11) (1.73337361951821e-11,1.12192841486561e-09,-6.58615437859952e-11) (1.80981379351007e-11,2.20079206272179e-09,-3.46446303814206e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.32964134481278e-12,9.25819390415288e-12,-2.68411847819523e-10) (1.30812538853523e-11,1.93418160263814e-11,-2.65886319611226e-10) (1.95608708962932e-11,3.28115153473624e-11,-2.61341531997061e-10) (2.3401848532968e-11,5.41794253886739e-11,-2.54515540924256e-10) (2.61454266872835e-11,9.38206674589206e-11,-2.45125781505305e-10) (2.58561080310581e-11,1.7837751503836e-10,-2.32322563216631e-10) (2.13558116980106e-11,3.52837095161743e-10,-2.13488384945672e-10) (1.91836978161958e-11,6.27641824831618e-10,-1.77589682592421e-10) (1.88916426024712e-11,1.09759853683076e-09,-1.28458398587259e-10) (1.93948108585931e-11,2.17217952304522e-09,-6.80229438734332e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.2345763852577e-12,6.92256454220454e-12,-4.09219300150431e-10) (1.33302791824328e-11,1.39889351756373e-11,-4.07066845888195e-10) (1.87763126358378e-11,2.39737559277986e-11,-4.0393671180748e-10) (2.07627992085399e-11,4.07683357156661e-11,-3.99695067444595e-10) (2.08800497373203e-11,7.39815460133792e-11,-3.94007601622364e-10) (1.91048114628623e-11,1.50040669987475e-10,-3.83571050660767e-10) (2.22478438586333e-11,3.23351883120826e-10,-3.516680641671e-10) (2.25763788680611e-11,5.86124558486118e-10,-3.08305778074564e-10) (2.27967705967899e-11,1.04350723570606e-09,-2.28414645164946e-10) (2.2988015570994e-11,2.11003341659795e-09,-1.23218715704608e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.70353941525635e-12,4.47451417418037e-12,-6.49699901708684e-10) (1.21186676171761e-11,9.74959817223162e-12,-6.48562113047587e-10) (1.61262712541859e-11,1.7991357635824e-11,-6.46351925228153e-10) (1.74738063233742e-11,3.23477555865371e-11,-6.4284492839135e-10) (1.71050556040627e-11,6.33795810650473e-11,-6.3782632434183e-10) (1.80470395452524e-11,1.34422584570239e-10,-6.26373131499678e-10) (2.17110541635072e-11,2.81788098951888e-10,-5.93031184351241e-10) (2.39078006399734e-11,5.09640043023721e-10,-5.20804662944954e-10) (2.48326789869878e-11,9.4254729828158e-10,-4.01134602810058e-10) (2.46450105327861e-11,1.99127048413895e-09,-2.27849902378801e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.96837647127023e-12,2.62707072267954e-12,-1.11677081027511e-09) (1.16108755377081e-11,6.23363543087318e-12,-1.11614849331303e-09) (1.39182378226604e-11,1.27784540028811e-11,-1.11443510129743e-09) (1.48831902321843e-11,2.46200127325555e-11,-1.11056557237903e-09) (1.45933351787715e-11,4.96420565583212e-11,-1.10292208973838e-09) (1.68479446963155e-11,1.03824944890388e-10,-1.08441031479786e-09) (2.03767986172519e-11,2.10109518769224e-10,-1.03897673972917e-09) (2.31244967740983e-11,3.91541888488217e-10,-9.44064931306826e-10) (2.4975123339381e-11,7.71703671845453e-10,-7.75023959994829e-10) (2.46655792733143e-11,1.76577120712999e-09,-4.8369214479909e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.13432726530468e-12,1.54171859443914e-12,-2.19848541709843e-09) (1.11159154125618e-11,3.63270315612398e-12,-2.19720066867607e-09) (1.20974670822858e-11,7.12714883125377e-12,-2.19451135529455e-09) (1.22917840396245e-11,1.37670705223852e-11,-2.18983924303928e-09) (1.24379499619398e-11,2.76630420224144e-11,-2.1798223846664e-09) (1.58887445067935e-11,5.68857465356902e-11,-2.15587523939855e-09) (2.01773866161474e-11,1.14221801817335e-10,-2.10095548386101e-09) (2.33061954443916e-11,2.22559346601127e-10,-1.98808880107881e-09) (2.53207257275607e-11,4.81363515735087e-10,-1.76600885081069e-09) (2.51027082411356e-11,1.28305197559792e-09,-1.28402343137723e-09) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.23965365795826e-12,2.67400893930104e-11,-3.25138324262703e-11) (3.45742192826219e-12,5.61691803733145e-11,-3.08706858648025e-11) (4.47368641632474e-12,9.23572294174461e-11,-2.77359926630042e-11) (5.49442132323849e-12,1.4261759768324e-10,-2.2879248676111e-11) (5.62050137254328e-12,2.14503962308605e-10,-1.5494475943343e-11) (3.77562416566291e-12,3.20903007795691e-10,-6.44517621601847e-12) (1.95977820514244e-12,4.78031322961152e-10,1.48186007644162e-12) (1.47444395929061e-12,7.06782459241937e-10,4.51404911734531e-12) (2.13914561119503e-12,1.0321346788424e-09,3.70502689711972e-12) (2.95702908830502e-12,1.42785204950107e-09,1.50216507493402e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.2658970016504e-12,2.57038715058094e-11,-6.55835358367795e-11) (6.74413471179496e-12,5.39352099655984e-11,-6.31689489809131e-11) (8.91987432151641e-12,8.84894132307216e-11,-5.74776682574523e-11) (1.1000397242915e-11,1.36751684947402e-10,-4.79694441024496e-11) (1.18622125930007e-11,2.07340437747884e-10,-3.31300414204548e-11) (9.61376719483485e-12,3.14900438513738e-10,-1.38444811313038e-11) (6.94502184445644e-12,4.77409436437633e-10,4.21862933785248e-12) (4.72402904218086e-12,7.09753064245218e-10,8.84847621836139e-12) (5.20954139858842e-12,1.03575310985291e-09,6.23151336941393e-12) (6.2036511513565e-12,1.43050109321509e-09,2.51554321121881e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.84358929561354e-12,2.34816139752477e-11,-1.08236081022163e-10) (8.99979627038318e-12,4.90588911447171e-11,-1.04501791890867e-10) (1.36328240278699e-11,8.0183620833349e-11,-9.62477797230969e-11) (1.72565852102216e-11,1.24053651299832e-10,-8.23320019951771e-11) (1.92907209398612e-11,1.91066908656076e-10,-6.05724466096625e-11) (1.86983102206307e-11,3.00328426188343e-10,-2.97725189290228e-11) (1.67420754485607e-11,4.76020642066678e-10,4.40548707880895e-12) (9.49798243552886e-12,7.16457904538635e-10,8.60877005640343e-12) (7.38270045927674e-12,1.04284729142264e-09,2.91118659943549e-12) (7.62323188666586e-12,1.43583993861212e-09,-5.14100810153971e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.76421004743716e-12,1.95691778634599e-11,-1.62434487963827e-10) (1.19528353902535e-11,4.11633465635401e-11,-1.5780072655855e-10) (1.89082343501039e-11,6.72270931412794e-11,-1.48102648039447e-10) (2.40313773066922e-11,1.04163227733798e-10,-1.32050017877309e-10) (2.80334404862563e-11,1.62904776869215e-10,-1.0679613739924e-10) (3.09886277222915e-11,2.68902962512031e-10,-6.73467619703684e-11) (3.15512926638901e-11,4.69768634480099e-10,-1.37493715514679e-11) (1.4796938857942e-11,7.28878435773256e-10,-1.30538499979492e-11) (1.00000036930431e-11,1.05253655389505e-09,-1.68741120360033e-11) (1.00409897721294e-11,1.44038691771662e-09,-1.18228080526122e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.82123246081921e-12,1.4846497723219e-11,-2.34442164052012e-10) (1.36257444068184e-11,3.18030352798093e-11,-2.30367650653601e-10) (2.1516348017842e-11,5.19240011308031e-11,-2.21572606505599e-10) (2.77109559895342e-11,7.91244572615591e-11,-2.06722253902906e-10) (3.44643536461823e-11,1.22242755527262e-10,-1.85349023629553e-10) (3.89346562293437e-11,2.06943499250455e-10,-1.59795620775274e-10) (1.14955176476026e-11,4.12588950114528e-10,-1.64033508626029e-10) (9.2095199588438e-12,7.41091301619733e-10,-1.05832265170909e-10) (1.04467008272367e-11,1.05674804189913e-09,-7.28168982981728e-11) (1.20660472298854e-11,1.43546078381189e-09,-3.86575517176209e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.13974249867865e-12,1.08462338261186e-11,-3.3778579370753e-10) (1.38893471215525e-11,2.2788470717617e-11,-3.34391410911433e-10) (2.15726392429346e-11,3.63189428714571e-11,-3.27750067209028e-10) (2.74231787884776e-11,5.38816656639288e-11,-3.17385446846764e-10) (3.31813298429732e-11,8.38665520862468e-11,-3.03594160673738e-10) (3.53587748111321e-11,1.60915332854262e-10,-2.85841209438669e-10) (1.49423213860495e-11,4.16003436807758e-10,-2.80962435796892e-10) (1.15696801559831e-11,7.32941114210592e-10,-2.22961455369105e-10) (1.2547489014018e-11,1.03440177076866e-09,-1.5658016319279e-10) (1.35179734313724e-11,1.40450957335912e-09,-8.13731887391965e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.53017249160067e-12,7.60389149778839e-12,-4.86222455566526e-10) (1.44394821042085e-11,1.5299200294806e-11,-4.83184380438588e-10) (2.05170665653514e-11,2.34202002493816e-11,-4.79026776047325e-10) (2.34959135152735e-11,3.28863223106288e-11,-4.75470550174956e-10) (2.10454637242069e-11,4.76146074659666e-11,-4.75681645907828e-10) (2.81991038649376e-12,9.42442467669745e-11,-4.80745712106623e-10) (2.04493419351883e-11,3.83814801877995e-10,-4.12747229563028e-10) (1.91697614200877e-11,6.85996075703714e-10,-3.99440887479432e-10) (1.85607785615606e-11,9.68667652183538e-10,-2.78619419300914e-10) (1.85322323258273e-11,1.32923630594385e-09,-1.43709123202535e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.41319420590054e-12,4.70314592282048e-12,-7.02623421529213e-10) (1.34244425393074e-11,1.00546488660281e-11,-7.00485353238365e-10) (1.78321780493454e-11,1.66546231170331e-11,-6.97957507759798e-10) (2.01829451290619e-11,2.61368454818998e-11,-6.96750029379899e-10) (1.93893872677267e-11,5.00474832353527e-11,-6.99281597667206e-10) (1.53027320771734e-11,1.25455137232251e-10,-7.04541280571331e-10) (2.11631129400366e-11,3.51581314892791e-10,-6.87135266949781e-10) (2.23358950393244e-11,5.68350535320727e-10,-5.85294234704765e-10) (2.23916049922544e-11,8.37833458865991e-10,-4.26670904382109e-10) (2.229438516351e-11,1.18919327779244e-09,-2.29919247039711e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.43141163728922e-12,2.68893340614442e-12,-1.01773848881451e-09) (1.24984157968805e-11,6.44943447408444e-12,-1.01653008213846e-09) (1.57000140765639e-11,1.21735186682429e-11,-1.01480437895163e-09) (1.80926498014179e-11,2.19240672291551e-11,-1.01243793111164e-09) (1.80605747746527e-11,4.68376758768813e-11,-1.00864715249769e-09) (1.83535679819952e-11,1.1071020811102e-10,-9.96871643925412e-10) (2.13527071470351e-11,2.47246778851303e-10,-9.54200174307891e-10) (2.30660673480923e-11,4.11307094248721e-10,-8.38339286781063e-10) (2.39834642545725e-11,6.43487129330333e-10,-6.48343428294037e-10) (2.36926660061137e-11,9.61651200841292e-10,-3.71775999412913e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.39129743663316e-12,1.41889919155385e-12,-1.40840609290491e-09) (1.20593051869682e-11,3.69566605274113e-12,-1.40749450129985e-09) (1.45525036585412e-11,7.06419303482317e-12,-1.40509999818431e-09) (1.60419961889667e-11,1.32669799252503e-11,-1.40086483538163e-09) (1.61538467167557e-11,2.83754513660687e-11,-1.39172131993641e-09) (1.78547355042744e-11,6.28975060667673e-11,-1.36850408070608e-09) (2.15325056516697e-11,1.28950567214055e-10,-1.31005482925277e-09) (2.37855917762521e-11,2.21447808231076e-10,-1.18308687459893e-09) (2.4698822029798e-11,3.68090820387949e-10,-9.61590511327858e-10) (2.41312524625178e-11,5.9126732972011e-10,-5.9257268294769e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.63272498370286e-12,2.96757447304379e-11,-3.79312664760086e-11) (2.55669913415875e-12,6.35653474736977e-11,-3.60419126521511e-11) (3.48475861617153e-12,1.04086303437644e-10,-3.22694349480844e-11) (3.97556132631873e-12,1.58921954619395e-10,-2.56531675931135e-11) (3.73472620594341e-12,2.34648093892181e-10,-1.54125241410133e-11) (1.85115715520239e-12,3.39603505580151e-10,-2.31777213622228e-12) (-4.50524312297618e-13,4.82993831917277e-10,9.39955202613194e-12) (-6.8713882376125e-13,6.61689849383991e-10,1.17373258372549e-11) (7.23576422825165e-13,8.61515381159068e-10,8.24008247287658e-12) (1.81015044920767e-12,1.03204508119327e-09,3.64854028216913e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.07356767634831e-12,2.81814489969496e-11,-7.82808357676397e-11) (5.92917280922577e-12,6.01876127754404e-11,-7.46706462926959e-11) (7.71744256386431e-12,9.83333516560934e-11,-6.74138781351193e-11) (8.85902820854075e-12,1.50428409043164e-10,-5.4683933804689e-11) (8.85018139563316e-12,2.24113349986397e-10,-3.37367248345585e-11) (6.12266905108862e-12,3.3089507535765e-10,-3.59610909811393e-12) (3.70396933488883e-12,4.8409926411981e-10,2.85063171512159e-11) (6.36151597783995e-13,6.68180556828946e-10,3.00638770739326e-11) (1.83132998708713e-12,8.68558240613717e-10,1.87353957629765e-11) (3.38034896535152e-12,1.03781142216654e-09,7.95813083972621e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.0217362760971e-12,2.55407866552764e-11,-1.27065413947366e-10) (8.64132868378345e-12,5.40818653872713e-11,-1.219285749458e-10) (1.26735739920178e-11,8.74574156787424e-11,-1.11253236382273e-10) (1.53874533907562e-11,1.32648856561469e-10,-9.21468303198683e-11) (1.66529250460793e-11,1.99145833941526e-10,-5.9559709545205e-11) (1.59457678890235e-11,3.06902398268248e-10,-4.82312608640934e-12) (1.87908000576736e-11,4.93472045641248e-10,7.68764883168722e-11) (2.77503465769441e-12,6.88191891535916e-10,6.02690978854349e-11) (1.11872539634894e-12,8.85136742001e-10,2.86787635191932e-11) (2.56215197254782e-12,1.05020555252393e-09,9.52859031705446e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.85312878244544e-12,2.11934273332211e-11,-1.8796646824722e-10) (1.16150681548842e-11,4.44467876388001e-11,-1.81958169561909e-10) (1.81586961984353e-11,7.08138029141902e-11,-1.69450124774441e-10) (2.38162673008396e-11,1.0476820939266e-10,-1.4703558871332e-10) (2.92460863993534e-11,1.5341700628588e-10,-1.06790391628043e-10) (3.93507005649495e-11,2.4531412466347e-10,-2.41984059424603e-11) (8.80354554759431e-11,5.43550357085695e-10,2.06081712854474e-10) (6.40433504940791e-12,7.4212362197994e-10,8.58305474486828e-11) (7.37211705675718e-13,9.14657799013198e-10,2.00998188037141e-11) (3.14431562392276e-12,1.06587208569937e-09,1.15086051388553e-14) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.74698295950146e-12,1.60957062684215e-11,-2.64254993185956e-10) (1.38452648210199e-11,3.31786438188926e-11,-2.58816018797267e-10) (2.22710536744774e-11,5.11840526497198e-11,-2.47115340859456e-10) (3.1580517313801e-11,6.98826704719721e-11,-2.26026829167972e-10) (4.7287154232934e-11,8.52108205449131e-11,-1.89721721327706e-10) (8.92007104762747e-11,7.50434501373453e-11,-1.23587523807167e-10) (-5.01202125007522e-11,1.02300031177433e-09,-4.58008029749316e-17) (-1.56556595048169e-11,8.70565215981328e-10,-7.00392829827285e-11) (-1.36637462286248e-12,9.52526422335111e-10,-5.56984054338848e-11) (4.35970596536146e-12,1.07416461186988e-09,-3.30922690403497e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.98770203091458e-12,1.14195732199585e-11,-3.64484780151465e-10) (1.47372738419652e-11,2.23012600086166e-11,-3.59984853003891e-10) (2.41067615027653e-11,3.13738528221503e-11,-3.51149094263044e-10) (3.46272359687268e-11,3.54165587910824e-11,-3.36487755818197e-10) (5.16803232281498e-11,2.5234677071662e-11,-3.12494719325175e-10) (9.71510872566262e-11,-1.30645804376573e-11,-2.57130657644726e-10) (-1.08700241120245e-11,1.04291945452007e-09,-5.83959679260964e-16) (-7.86657351332181e-12,8.9339710596532e-10,-2.18325553190052e-10) (3.07463314556754e-12,9.4267425092785e-10,-1.56074298292321e-10) (7.41805210724753e-12,1.04790852495004e-09,-8.12142850298791e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.39284293871594e-12,7.12929995310962e-12,-4.94118211096108e-10) (1.55264291416547e-11,1.32250640606214e-11,-4.90896431102803e-10) (2.37264178253652e-11,1.51416716340398e-11,-4.86221252128238e-10) (3.04564860769015e-11,5.53868347570896e-12,-4.83942677444655e-10) (2.36766541535103e-11,-4.76154947301627e-11,-4.9944439258442e-10) (-9.63894626223596e-11,-2.99561959189178e-10,-6.19455426538744e-10) (3.93764868369896e-11,1.25037440166335e-09,-1.37330059644698e-09) (1.59938336244499e-11,8.76813286399755e-10,-5.87823088624216e-10) (1.4484675780657e-11,8.78410998040551e-10,-3.15865359852368e-10) (1.48661372747809e-11,9.71126629763152e-10,-1.48012199024058e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.28933843177794e-12,3.90862915941435e-12,-6.56174339629719e-10) (1.45018114526667e-11,7.69079243192476e-12,-6.54103462445431e-10) (2.1105804118237e-11,8.78552151986512e-12,-6.52176872357795e-10) (2.69272916689828e-11,4.10292452441421e-12,-6.54588031862344e-10) (2.78588775304695e-11,-6.91879782372694e-12,-6.71854549601761e-10) (1.26416475766311e-11,1.36295457603019e-11,-7.33440840735386e-10) (2.36566167367289e-11,5.04273288252731e-10,-8.69769566142182e-10) (2.0756005788582e-11,6.13986313333644e-10,-6.36597359650631e-10) (1.99862771857179e-11,7.13520826227212e-10,-4.14822126596286e-10) (1.99172150746332e-11,8.25244747275849e-10,-2.08675076698874e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.49303917567374e-12,1.89637814007146e-12,-8.4415306410393e-10) (1.35264810314066e-11,4.75706279955725e-12,-8.43087962844244e-10) (1.84428918701677e-11,7.20869550162282e-12,-8.42090431069694e-10) (2.29589584912153e-11,9.88164031636497e-12,-8.42790117144589e-10) (2.47472907131995e-11,2.29113328055447e-11,-8.48032605548451e-10) (2.34948004086829e-11,8.0055324755438e-11,-8.58614039145283e-10) (2.37880312573414e-11,2.70749371875984e-10,-8.51683845545579e-10) (2.29294948788953e-11,3.94660162523466e-10,-7.1232456355928e-10) (2.28123443157408e-11,5.0943083667363e-10,-5.14925845528749e-10) (2.23005377144469e-11,6.18331916130883e-10,-2.75575887532425e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.8986050231288e-12,9.05672948029719e-13,-1.00916334763493e-09) (1.33604681241734e-11,2.79395904996401e-12,-1.00849086802817e-09) (1.73815338906894e-11,4.92446888887242e-12,-1.00681710200235e-09) (2.0165460668982e-11,8.47944044121956e-12,-1.00456772771907e-09) (2.13120588525035e-11,2.03860628225143e-11,-1.0010160595094e-09) (2.23029901177849e-11,5.44632695812849e-11,-9.88085756846282e-10) (2.35151182117499e-11,1.28035742637611e-10,-9.41511320782074e-10) (2.37370367364374e-11,1.9786372596736e-10,-8.15940493112145e-10) (2.37718140373737e-11,2.71607187741581e-10,-6.17636331346136e-10) (2.28258992349806e-11,3.43936502425164e-10,-3.4489139196598e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.23766689334826e-12,3.09821545102671e-11,-4.02695377304149e-11) (2.16195612835107e-12,6.68110706424187e-11,-3.91035371671574e-11) (2.62144304276195e-12,1.089010594577e-10,-3.52103338178771e-11) (2.22846345044754e-12,1.63883831107653e-10,-2.73536629331566e-11) (1.17471810693048e-12,2.35926393254996e-10,-1.52368110167754e-11) (-1.15773678462627e-12,3.30441602540204e-10,6.13940024435577e-13) (-3.89373032597118e-12,4.52794635261132e-10,1.63395762127117e-11) (-3.68060290436601e-12,5.88418107526504e-10,1.8535195368796e-11) (-1.72774084109625e-12,7.15478024348842e-10,1.25698956788586e-11) (-3.0765024175624e-13,8.02175273936187e-10,5.6908010065025e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.10404054311505e-12,2.92616625002629e-11,-8.58776019434457e-11) (4.77815203980183e-12,6.30001408516451e-11,-8.25408071086539e-11) (5.8634342107964e-12,1.0229465684292e-10,-7.430516257245e-11) (5.691371720063e-12,1.53639488427883e-10,-5.91416008219349e-11) (3.67708170410489e-12,2.22082169728683e-10,-3.38988439144562e-11) (-1.98708010883366e-12,3.17030096788091e-10,4.52055529827293e-12) (-7.22637210922297e-12,4.53137883845903e-10,5.32379639237916e-11) (-8.04670179834761e-12,5.96285038834587e-10,5.25456260329861e-11) (-3.96990647687018e-12,7.23949222951769e-10,3.09339722770758e-11) (-1.05565055233711e-12,8.09398155071016e-10,1.27620754386236e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.23225659655674e-12,2.61569932468287e-11,-1.38459998872264e-10) (7.60106786875393e-12,5.58156137521508e-11,-1.33194826457322e-10) (1.02107806941825e-11,8.9417239677772e-11,-1.20968746713297e-10) (1.06809797848423e-11,1.31684701099315e-10,-9.9001000567147e-11) (7.64516924291264e-12,1.87863091510842e-10,-6.06839781276952e-11) (-4.1655729094114e-12,2.73932117528587e-10,9.67814518228401e-12) (-1.46801209552632e-11,4.62687322082744e-10,1.65542800906322e-10) (-1.95663614201275e-11,6.23648460460578e-10,1.30007146493081e-10) (-9.25215841376872e-12,7.45771717672157e-10,5.80212809358465e-11) (-3.57579088575685e-12,8.25066302709455e-10,1.95073822117487e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.94255116192154e-12,2.16192060095357e-11,-2.0044968258809e-10) (1.0375167187333e-11,4.52023791365516e-11,-1.94271149394017e-10) (1.53739104018026e-11,7.0512183289977e-11,-1.80020608030375e-10) (1.84566091362708e-11,9.82566138776648e-11,-1.54920731600438e-10) (1.48602864547194e-11,1.24111709162794e-10,-1.12869484826421e-10) (-2.06587437059068e-11,1.26178725900104e-10,-4.95698637387546e-11) (-2.71163333806896e-10,5.2607164187212e-10,1.74773760544678e-16) (-5.63065303069974e-11,7.07650663176716e-10,3.11521825187139e-10) (-1.70431014177223e-11,7.89376019767749e-10,7.80690954330433e-11) (-5.13670194166304e-12,8.47871503492373e-10,1.58375427436416e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.98414161926888e-12,1.64575397111898e-11,-2.74569896870184e-10) (1.30219706934783e-11,3.3038551862476e-11,-2.6857645043108e-10) (2.09927418105707e-11,4.91258481999256e-11,-2.54758875222949e-10) (2.97415211543997e-11,6.22706853742109e-11,-2.29407020504164e-10) (4.11291001856741e-11,6.71304336914447e-11,-1.85203945251246e-10) (5.37212630449797e-11,5.9808716479248e-11,-1.10936659993851e-10) (-1.18064566341242e-16,7.22658115112092e-16,-2.93444008258104e-17) (-5.28284270376153e-11,9.57136004607371e-10,5.96300743163797e-17) (-1.41203396091788e-11,8.55477765493306e-10,-2.03546497776723e-11) (-2.47647615503445e-12,8.65898234284218e-10,-2.07276929286226e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.7780481501772e-12,1.11994010119312e-11,-3.64847678195579e-10) (1.49777110491252e-11,2.10716417897718e-11,-3.59528243734355e-10) (2.5677604246008e-11,2.76906828555342e-11,-3.48040302018504e-10) (4.05120747911163e-11,2.57889120852035e-11,-3.2652318097599e-10) (6.91664333494956e-11,7.75266841355013e-12,-2.86049800257507e-10) (1.265183923232e-10,-2.52058706836219e-11,-1.99227680096694e-10) (-2.02493411094052e-18,5.47065219110972e-16,-5.36551585975358e-17) (-5.35340088455881e-11,9.29793911637959e-10,-2.66541880785658e-16) (-7.5221272295117e-12,8.46161993649755e-10,-1.08087815428578e-10) (2.98566226415348e-12,8.43508849534351e-10,-6.80381312309309e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.39173373911204e-12,6.29687582747793e-12,-4.69979248419052e-10) (1.63855217958056e-11,1.09411575907078e-11,-4.66290060878025e-10) (2.78039932559499e-11,9.75548919292588e-12,-4.5932422992705e-10) (4.73939601679337e-11,-6.55127189256552e-12,-4.48197010014044e-10) (1.02990991201411e-10,-5.74084329196994e-11,-4.28996891544721e-10) (3.44264202336258e-10,-1.6557500488118e-10,-3.68803828434981e-10) (9.24249549328501e-17,7.52893705047052e-16,-9.30088271555237e-16) (6.86307791868796e-12,9.93838912870607e-10,-6.37932219265928e-10) (1.1521686765752e-11,7.95075402162522e-10,-3.09386389775391e-10) (1.27358207379363e-11,7.72839924742592e-10,-1.38518253936434e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.23071226675967e-12,3.22913879447165e-12,-5.86065708547381e-10) (1.55089509974466e-11,5.21553176427041e-12,-5.83649992017181e-10) (2.50937896410024e-11,1.21214873361392e-12,-5.80625415514485e-10) (3.84150936164913e-11,-1.88514434435277e-11,-5.80519334325108e-10) (5.96150380347859e-11,-8.50414122574546e-11,-5.95508853218535e-10) (8.25445939883129e-11,-3.20216028442046e-10,-6.73843107977998e-10) (2.40083266220148e-11,6.37932100251056e-10,-1.04339833235075e-09) (1.83069235442984e-11,6.27033025784215e-10,-6.44957671386293e-10) (1.79292168418893e-11,6.14861254423354e-10,-3.83447285054641e-10) (1.81549695208248e-11,6.32790527505405e-10,-1.83510786019873e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.41864310807292e-12,1.2799835920148e-12,-6.98197618443613e-10) (1.44920530063683e-11,2.66094492257169e-12,-6.96845173121006e-10) (2.1426804557886e-11,1.35105090030008e-12,-6.95418409985426e-10) (2.96036467701862e-11,-4.68222463954323e-12,-6.96266174088703e-10) (3.78539942930774e-11,-1.28953992184331e-11,-7.04970621774398e-10) (4.21566619831193e-11,6.61197802661958e-12,-7.30613551205739e-10) (2.71423785094042e-11,2.70941076593595e-10,-7.69807388794051e-10) (2.2327213404471e-11,3.64262616517371e-10,-6.12365201618267e-10) (2.12860352514995e-11,4.13508550236177e-10,-4.18959238855015e-10) (2.11200638877536e-11,4.49621587373629e-10,-2.14266262876192e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.13179836440241e-12,4.1650183537897e-13,-7.78720825797471e-10) (1.44806611483115e-11,1.46242968909906e-12,-7.7794841006182e-10) (2.00566284962843e-11,1.89896359272963e-12,-7.7631228072456e-10) (2.50932329005298e-11,2.20417257916354e-12,-7.74617870398266e-10) (2.87678190119024e-11,7.67543287444758e-12,-7.74199491508637e-10) (3.01918236348613e-11,3.50572718587528e-11,-7.69833554459651e-10) (2.59800331794322e-11,1.1715727532638e-10,-7.38588864137739e-10) (2.32966009377911e-11,1.71883408977552e-10,-6.21307956493093e-10) (2.26340623988173e-11,2.09751893960957e-10,-4.48527238060135e-10) (2.18710096941285e-11,2.36537372061439e-10,-2.37571859150057e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.79215834009402e-12,3.17826892514696e-11,-4.10773687246957e-11) (2.07968256984172e-12,6.88217964647114e-11,-3.98164099594923e-11) (1.37117477282118e-12,1.10909808405992e-10,-3.58012060984962e-11) (3.55954213839935e-13,1.63381034430672e-10,-2.84556987163106e-11) (-8.31809407967663e-13,2.28963620731797e-10,-1.67377072410251e-11) (-3.4718672208171e-12,3.10670037032559e-10,-3.63775921983785e-13) (-6.43259806675886e-12,4.11564712483592e-10,1.64741152081661e-11) (-5.58223452260173e-12,5.14753518779671e-10,1.92802942353458e-11) (-3.31984477161686e-12,6.01977399685901e-10,1.30286195649083e-11) (-1.83973037002549e-12,6.55121380825489e-10,5.96213014436835e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.87191496176828e-12,3.00179886096734e-11,-8.85291182961585e-11) (3.727034603082e-12,6.4818203525144e-11,-8.50812189657247e-11) (3.57728962543589e-12,1.04118648787952e-10,-7.66418396738978e-11) (2.40340214113766e-12,1.52471011930126e-10,-6.16220899354328e-11) (-5.23239290777389e-13,2.13451331799941e-10,-3.64481049828537e-11) (-7.60650947486022e-12,2.94180943945203e-10,2.62457821942718e-12) (-1.60834724552926e-11,4.08199682665432e-10,5.29641744848037e-11) (-1.37984696684014e-11,5.20004669365247e-10,5.44138172489799e-11) (-7.62050435889361e-12,6.08491479817218e-10,3.25897239464528e-11) (-3.96172275217007e-12,6.60639167533158e-10,1.35780115527347e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.50487141890411e-12,2.65831549370936e-11,-1.42581439558017e-10) (5.9882227403413e-12,5.68934564944447e-11,-1.37326474743286e-10) (7.14809093581167e-12,9.01268863302134e-11,-1.24905283257183e-10) (5.79204456704058e-12,1.28809885232324e-10,-1.0288629365508e-10) (1.03442828094439e-12,1.76075751722514e-10,-6.49672060740983e-11) (-1.22768370049719e-11,2.44673823707858e-10,4.53673359798433e-12) (-4.25287863313917e-11,4.06047824042188e-10,1.58658349838292e-10) (-3.15826985790956e-11,5.39889863521059e-10,1.32035073974363e-10) (-1.43425617852819e-11,6.26524600471486e-10,6.07561747359644e-11) (-6.87360945710742e-12,6.73795090101924e-10,2.08845895925567e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.92568426622446e-12,2.20247509962954e-11,-2.04193627615769e-10) (8.28845309775338e-12,4.60601729619469e-11,-1.98119057596008e-10) (1.16603690619581e-11,7.04594018901679e-11,-1.83571173763558e-10) (1.2391290865701e-11,9.41737246932557e-11,-1.58039863502353e-10) (8.54194083840384e-12,1.10507217297826e-10,-1.17026593534956e-10) (-3.85877279758036e-12,9.41593822728834e-11,-5.87241355922497e-11) (-5.6614065006267e-11,4.34918542806602e-10,9.88033675992562e-17) (-7.23391419835593e-11,6.06282864763957e-10,3.04253399624387e-10) (-2.09132944538438e-11,6.63505515650254e-10,8.20572628009148e-11) (-7.32588998982367e-12,6.93480813444131e-10,1.82709576395826e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.24883387939185e-12,1.71314540961442e-11,-2.734179082324e-10) (1.11713055580766e-11,3.41640795851359e-11,-2.67257718943438e-10) (1.70760524361594e-11,4.91879946378736e-11,-2.52572682790941e-10) (2.2020219190511e-11,6.00002595911951e-11,-2.2578229178382e-10) (2.62395802061385e-11,6.23500601658524e-11,-1.80339434758409e-10) (2.77992195584111e-11,5.50842989764789e-11,-1.07019343372552e-10) (-3.14461454823108e-17,3.6457511913893e-16,-2.75321021041905e-17) (-5.13162466045675e-12,8.15837740281381e-10,6.87254505224197e-17) (-4.43152461463594e-12,7.19690103044568e-10,-1.45087374373122e-11) (-8.14784333761681e-13,7.08314662880048e-10,-1.67673981557522e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.3611388734226e-12,1.20460530752797e-11,-3.51537198960433e-10) (1.36202535323198e-11,2.2342834292948e-11,-3.45716338416114e-10) (2.20956768661523e-11,2.8434014766988e-11,-3.3257009713346e-10) (3.2378878050308e-11,2.59584303630571e-11,-3.07881121128973e-10) (4.75054145219503e-11,1.00427310996013e-11,-2.62015820845127e-10) (6.76599000792224e-11,-1.50527347763388e-11,-1.72047113365283e-10) (5.03330214110161e-18,2.15747233665455e-16,-4.5610936627187e-17) (-9.4914611915367e-12,7.88063448503891e-10,-1.97159100255857e-16) (3.51478006005938e-12,7.08521617805301e-10,-9.2722358229005e-11) (5.61645582493573e-12,6.86572950748091e-10,-5.91589808734109e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.77028323105979e-12,7.32703714389885e-12,-4.35390734264387e-10) (1.51453166713045e-11,1.21525726013982e-11,-4.30944874774436e-10) (2.52201138022697e-11,1.08494977939276e-11,-4.21738675727882e-10) (4.04940132495676e-11,-4.87895113499983e-12,-4.04958393648817e-10) (7.0430907429409e-11,-4.80539227532112e-11,-3.72667673474536e-10) (1.30102327550393e-10,-1.24524314426807e-10,-2.90583196243154e-10) (3.42452613656835e-17,3.47278228181393e-16,-4.66837082067393e-16) (4.51231355145226e-11,8.49052889583654e-10,-5.46857422141791e-10) (2.08676986659678e-11,6.63136428308922e-10,-2.68407078191825e-10) (1.4266964038697e-11,6.23034404199906e-10,-1.20055676139964e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.76415093902754e-12,3.993260598043e-12,-5.19533552758312e-10) (1.5038961336433e-11,5.66924859419987e-12,-5.1628183369778e-10) (2.48488062849208e-11,7.17129107991814e-13,-5.11252513887554e-10) (3.9235393705959e-11,-2.17960387923564e-11,-5.06250535983876e-10) (6.58032797552326e-11,-9.27115058127856e-11,-5.11184865319996e-10) (1.25271811892447e-10,-3.25307215239899e-10,-5.68650420785679e-10) (-7.44131068498596e-12,5.46857317520956e-10,-8.86629552775525e-10) (1.95669464794755e-11,5.35354885071334e-10,-5.5146513208227e-10) (1.93454219943422e-11,5.05903487737601e-10,-3.25564114752491e-10) (1.78131236326895e-11,5.00530078847901e-10,-1.54148712154213e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.9296795421712e-12,1.80736028863197e-12,-5.90925159915041e-10) (1.42638051042711e-11,2.91753504778177e-12,-5.8858870263859e-10) (2.17266559686397e-11,3.74367719917141e-13,-5.85325224983026e-10) (3.14216972371876e-11,-8.45167866504948e-12,-5.82936823952755e-10) (4.29260916315437e-11,-2.29162911203956e-11,-5.86539438384281e-10) (5.29052057392693e-11,-1.40216104751574e-11,-6.05716493210307e-10) (2.34839926008566e-11,2.29248436629187e-10,-6.40112005287478e-10) (2.13004581810435e-11,3.06219061164472e-10,-5.04084008123324e-10) (2.0349715547884e-11,3.32630200477885e-10,-3.38622130401019e-10) (1.99380163238279e-11,3.46426527068899e-10,-1.70235935461924e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.77588446413102e-12,5.41071309109813e-13,-6.36248636463918e-10) (1.430696150015e-11,1.60361644857355e-12,-6.3481906147349e-10) (2.02611817627209e-11,1.39387159174181e-12,-6.31410599767799e-10) (2.6879026590064e-11,-2.64378127289824e-14,-6.27103715205252e-10) (3.20773148373645e-11,2.03190368243918e-12,-6.23781380689004e-10) (3.40044051717011e-11,2.41785530877702e-11,-6.18425130560886e-10) (2.58564008611656e-11,9.83837281771217e-11,-5.91018021227635e-10) (2.23992914823847e-11,1.42256714211716e-10,-4.89477227734905e-10) (2.14305774497008e-11,1.65189126013776e-10,-3.45338804491388e-10) (2.08365226054877e-11,1.77777595873747e-10,-1.78930992599842e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.29590021675413e-12,3.25898549632806e-11,-4.14041396950743e-11) (2.0680716483777e-12,6.92559374365421e-11,-3.98332308991431e-11) (8.16827008678594e-13,1.10315632282143e-10,-3.58849171880295e-11) (-4.52014760898014e-13,1.59308787341112e-10,-2.9548145790404e-11) (-1.69345179516443e-12,2.18751772295415e-10,-1.95431334744738e-11) (-3.82066526361237e-12,2.89037983050407e-10,-5.3612795737139e-12) (-5.87374727579805e-12,3.71608076872863e-10,8.80377565821735e-12) (-4.58171043773422e-12,4.52572916214283e-10,1.17952675040775e-11) (-2.76743548233033e-12,5.17367381974296e-10,7.93883288454528e-12) (-1.39538693329689e-12,5.54346880218329e-10,3.57367940592346e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.85884930392134e-12,3.09014943035452e-11,-8.84536434038778e-11) (3.21240234193028e-12,6.53986047286795e-11,-8.5175491229881e-11) (2.54930234473805e-12,1.04124744020791e-10,-7.74500361781089e-11) (8.90543886363708e-13,1.49265349028874e-10,-6.39026481126592e-11) (-2.2203424156603e-12,2.04263965143299e-10,-4.19161818511692e-11) (-8.43898550291602e-12,2.73087615034668e-10,-9.25070904118501e-12) (-1.53812565962164e-11,3.6489283884116e-10,3.06704435449092e-11) (-1.18595705216965e-11,4.53805420224194e-10,3.49595615657133e-11) (-6.64191261945129e-12,5.20689170788068e-10,2.15981102485883e-11) (-3.53963376835586e-12,5.57330566365565e-10,8.9674124585496e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.80831054497028e-12,2.79671807597717e-11,-1.42014069792085e-10) (4.40031478673793e-12,5.81924546111827e-11,-1.37183976407265e-10) (4.79658577375625e-12,9.11475623802679e-11,-1.25957574081323e-10) (2.50911752511591e-12,1.27584647700512e-10,-1.0607032808461e-10) (-2.90097696641482e-12,1.70503566869622e-10,-7.35860593026558e-11) (-1.58840118103391e-11,2.27565548642597e-10,-1.83920087958344e-11) (-4.47762292318607e-11,3.47223522097663e-10,9.44388628185355e-11) (-2.66968005835851e-11,4.58587599065321e-10,8.26818068828967e-11) (-1.14518918205391e-11,5.2948909325383e-10,3.81845627508355e-11) (-5.67474320677274e-12,5.6449419674006e-10,1.26959002394617e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.74441114661116e-12,2.37977519175164e-11,-2.02087930426359e-10) (5.63666264214015e-12,4.81281265557395e-11,-1.96455921418216e-10) (7.40046605300863e-12,7.27343962491457e-11,-1.83303326387066e-10) (5.55148600039923e-12,9.61544559788065e-11,-1.60159895410637e-10) (-1.60335997235575e-12,1.13310312118063e-10,-1.25277080563573e-10) (-2.35079238968094e-11,1.00031206107808e-10,-8.29642974576688e-11) (7.40508124041945e-11,3.0276596359566e-10,-8.76328133370707e-11) (-5.9697880677514e-11,4.76472247444275e-10,1.77976394311456e-10) (-1.33115766868523e-11,5.4507973378714e-10,4.37527086951161e-11) (-3.88878178619018e-12,5.72774929865591e-10,7.49841452807357e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.17404561125713e-12,1.87286238234738e-11,-2.67270212885565e-10) (8.30751469779739e-12,3.67365852289074e-11,-2.61405861978641e-10) (1.103964129994e-11,5.2537914824694e-11,-2.47415239942391e-10) (1.06191913932272e-11,6.48396425675103e-11,-2.22804817170094e-10) (5.22681788654132e-12,7.12567403569229e-11,-1.83368439640415e-10) (-9.08306252920534e-12,7.75407390536749e-11,-1.20083356880862e-10) (2.11241873645541e-17,3.69623139998323e-16,-1.00947994647017e-16) (3.71514732798012e-11,5.33910251833651e-10,-6.95550827749528e-11) (8.99562134312938e-12,5.63665092507958e-10,-3.80314531605717e-11) (4.15952964253674e-12,5.7429637486488e-10,-2.25091788789732e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.25929426046991e-12,1.33802780526984e-11,-3.34521741052599e-10) (1.06642739412188e-11,2.52042101530925e-11,-3.29011482453114e-10) (1.49912178347019e-11,3.3111658348526e-11,-3.15841304114276e-10) (1.73509592645642e-11,3.45725224191668e-11,-2.92776945476278e-10) (1.56333608949051e-11,2.65865198724394e-11,-2.5277098372256e-10) (5.08441197534e-12,1.16212570176399e-11,-1.75243256349417e-10) (2.50504712538332e-17,2.48077421375938e-16,-1.34723560705516e-16) (2.22412587986045e-11,5.06699032281262e-10,-1.08207594723513e-10) (1.53365922008991e-11,5.43420601711187e-10,-1.03684363854455e-10) (9.9960214996764e-12,5.48738743363677e-10,-5.67086671643737e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.65820028693212e-12,8.98172867367075e-12,-4.0257908114974e-10) (1.24224416319562e-11,1.57012865777718e-11,-3.98131026007783e-10) (1.85722004091471e-11,1.72296241313602e-11,-3.87724628048976e-10) (2.51203807326246e-11,8.72834320569213e-12,-3.70067738634896e-10) (3.30040132576204e-11,-1.7840417225678e-11,-3.38287162584758e-10) (4.03024989574043e-11,-6.55570057839389e-11,-2.62847673950561e-10) (1.93072384145166e-17,3.10132988416338e-16,-4.26254422295802e-16) (8.03707960768793e-11,4.84458742063571e-10,-3.64851937091649e-10) (2.97492371853593e-11,4.92893733338884e-10,-2.11229325653464e-10) (1.67156132506974e-11,4.90440566483162e-10,-9.89877117787296e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.69833218788774e-12,5.6584066461367e-12,-4.65528087102237e-10) (1.27613550726146e-11,9.03802929010849e-12,-4.61916411080484e-10) (2.0189589769342e-11,7.09820811460194e-12,-4.54763267171636e-10) (3.08253629147554e-11,-6.36609089197039e-12,-4.45340921065516e-10) (5.34736205285312e-11,-4.96319063405058e-11,-4.37150950726883e-10) (1.31965339117548e-10,-1.84801736329412e-10,-4.43070488061027e-10) (-2.49968504864601e-11,3.23282581042743e-10,-5.15729148420252e-10) (2.28017530565474e-11,3.73531100099357e-10,-3.97660901923036e-10) (2.12033066557691e-11,3.88315857067905e-10,-2.55318905867276e-10) (1.77679632573982e-11,3.93174041675987e-10,-1.24114982263126e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.85951124523792e-12,2.9415883591323e-12,-5.14308789246082e-10) (1.23142460479257e-11,5.24208122160021e-12,-5.11278151916352e-10) (1.83187510665375e-11,4.66351283207057e-12,-5.05789613010825e-10) (2.65990708163725e-11,-5.10325218166987e-14,-4.99154199991526e-10) (3.7154951654754e-11,-7.43739032910919e-12,-4.9314258430323e-10) (4.91005542535098e-11,5.10278003750587e-12,-4.90081402907956e-10) (1.83207038887095e-11,1.66558340395426e-10,-4.82069805122386e-10) (1.9800927411489e-11,2.33273366019039e-10,-3.91977804617405e-10) (1.94045950728915e-11,2.60311278669627e-10,-2.68422789337103e-10) (1.83510120570923e-11,2.71243705581607e-10,-1.35470708790408e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.88738078281257e-12,1.0185018328761e-12,-5.42221884583643e-10) (1.25021162430325e-11,2.52959656516735e-12,-5.39985685100164e-10) (1.73481687919159e-11,3.16697654838009e-12,-5.34569367786929e-10) (2.35302542610877e-11,2.94175446164337e-12,-5.27246154817366e-10) (2.87529683916849e-11,5.68736877856026e-12,-5.18288053551991e-10) (3.07758489262212e-11,2.39525665812458e-11,-5.03878171775489e-10) (2.26993355455569e-11,7.75304660992389e-11,-4.69481106459699e-10) (2.05175824505858e-11,1.12059007870968e-10,-3.87402855985405e-10) (2.02118915719104e-11,1.30085098412427e-10,-2.72741968515703e-10) (1.9683125879388e-11,1.38461559193671e-10,-1.4048938898494e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.41335208061484e-12,3.2330535661653e-11,-4.22332046060195e-11) (1.97709064508034e-12,6.85134701290521e-11,-4.04362113647784e-11) (6.70943872441276e-13,1.08642334597964e-10,-3.67733437543705e-11) (-4.13588764599338e-13,1.546986488493e-10,-3.14137278861592e-11) (-1.38749854382045e-12,2.09114501618809e-10,-2.33427467595816e-11) (-2.03535247980664e-12,2.71435629112882e-10,-1.27168489677849e-11) (-2.15000108998066e-12,3.40500450293285e-10,-2.58050939582956e-12) (-1.95777982807084e-12,4.06278056954453e-10,1.33296658226909e-12) (-1.7240708175214e-12,4.5754050416759e-10,1.47618790105758e-12) (-8.05393674603941e-13,4.85545802948943e-10,7.907017267006e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.51501067370702e-12,3.08849211738002e-11,-8.88291986771e-11) (2.69309740766315e-12,6.50770996615678e-11,-8.5702458503838e-11) (1.97909591978741e-12,1.03189795956311e-10,-7.88027056107262e-11) (5.84778953244136e-13,1.46392870720813e-10,-6.70485131182933e-11) (-1.12541695194987e-12,1.97974010379736e-10,-4.92905005631952e-11) (-2.83807169695614e-12,2.60089677138595e-10,-2.55158750087883e-11) (-2.0010578735115e-12,3.35083074428648e-10,-5.32801937651816e-13) (-3.28029804569985e-12,4.05224142453556e-10,7.5665412740339e-12) (-2.81113729514256e-12,4.57752694608363e-10,5.96283551974714e-12) (-1.73585168428741e-12,4.85882308845344e-10,2.6372025819748e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.14764600240567e-12,2.83660041093813e-11,-1.40984103801302e-10) (3.23824051623584e-12,5.87653807419178e-11,-1.36386804028421e-10) (3.32250590819062e-12,9.19941181230838e-11,-1.26303661959202e-10) (1.45504046489007e-12,1.2885471700393e-10,-1.09138854118228e-10) (-9.01772721709868e-13,1.73343750162876e-10,-8.32014287429317e-11) (-1.18054088993401e-12,2.32496980349422e-10,-4.42270694638225e-11) (1.14383852057969e-11,3.24299630727122e-10,9.58741895012045e-12) (-8.42048304667829e-14,4.04422443242773e-10,1.60335052395928e-11) (-1.55386984248201e-12,4.59498904068188e-10,7.01514078408266e-12) (-1.25957609285874e-12,4.87072955889278e-10,1.49322841108905e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.18153023250206e-12,2.43546292315966e-11,-1.98064233037636e-10) (3.87560893779946e-12,4.97640286781002e-11,-1.92860938132792e-10) (4.45351650105649e-12,7.61118747282518e-11,-1.81398504313709e-10) (1.98348456460718e-12,1.03481683081533e-10,-1.61682046527619e-10) (-1.86257131710347e-12,1.33264021044877e-10,-1.32012926603373e-10) (3.65105903673035e-12,1.75856994931247e-10,-8.49747773350033e-11) (1.1120719872824e-10,3.21659809291645e-10,2.72966518083072e-11) (1.7087800549469e-11,4.10097112509514e-10,1.1238099239637e-11) (4.35735875935867e-12,4.61842018637179e-10,-6.08082419799186e-12) (2.08818774254825e-12,4.85610316787543e-10,-7.02539165605346e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.6580404751247e-12,1.94331306595483e-11,-2.58247328564215e-10) (5.8492677373342e-12,3.93817832385032e-11,-2.52934915404481e-10) (5.85547500380732e-12,5.80146675622198e-11,-2.40853278414541e-10) (1.44993401188977e-12,7.48009378707093e-11,-2.21329295356966e-10) (-1.33880443885165e-11,8.46983968082378e-11,-1.94868558212965e-10) (-6.32468364260211e-11,6.31221757446222e-11,-1.68932253482687e-10) (6.95551244968639e-11,4.21257339503505e-10,-1.93847527228511e-10) (3.28390632177584e-11,4.32043639905095e-10,-9.92569356822254e-11) (1.37178378581839e-11,4.6121730001495e-10,-5.93130338102185e-11) (7.20798226478656e-12,4.76671220270162e-10,-2.97867083594396e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.14758503996701e-12,1.48220893926653e-11,-3.17548601309628e-10) (6.99701917773794e-12,2.92909819919376e-11,-3.12382677101652e-10) (7.80889341386611e-12,4.11488088741436e-11,-3.00774952966941e-10) (3.18917672432599e-12,4.96635752207531e-11,-2.833055835138e-10) (-1.74674293801158e-11,5.09357017038105e-11,-2.60629402906125e-10) (-9.29804468489165e-11,3.43206382713369e-11,-2.40917260830837e-10) (1.08207422994856e-10,3.72556392789102e-10,-2.70203155097229e-10) (3.99583181472417e-11,4.07465057659622e-10,-1.73806071719732e-10) (1.88877638831957e-11,4.35589203563409e-10,-1.12941504589997e-10) (1.15855312158366e-11,4.47553401742404e-10,-5.61329337959472e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.53346717251479e-12,1.10699932623084e-11,-3.75188654835281e-10) (8.67930096074648e-12,2.08363706100759e-11,-3.70536030774031e-10) (1.10467270118651e-11,2.73324066464857e-11,-3.60432960712426e-10) (8.43423878013772e-12,2.92521283258889e-11,-3.46121983121536e-10) (-1.06439862617309e-11,2.16425305783526e-11,-3.29872577266366e-10) (-1.03300018193253e-10,-1.24740616286529e-11,-3.28436522680752e-10) (4.15692592347244e-11,3.57469916476799e-10,-4.53714241831037e-10) (3.7675826602862e-11,3.66136047272009e-10,-2.8331410989765e-10) (2.20854995815887e-11,3.8504750777315e-10,-1.74136107604099e-10) (1.49944262791145e-11,3.9375223598145e-10,-8.37519445214502e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.80347445315001e-12,7.7513980360187e-12,-4.25318615161075e-10) (9.40415923221957e-12,1.42026506860552e-11,-4.20904306817776e-10) (1.32019389458032e-11,1.74734819821984e-11,-4.12241164457963e-10) (1.63203342059405e-11,1.73593940948085e-11,-4.01107070629419e-10) (1.71986418512837e-11,1.40136477272199e-11,-3.89354234976574e-10) (1.4719483109835e-11,2.68466976719976e-11,-3.83754899337494e-10) (1.36591436636818e-11,2.13637855106451e-10,-3.93022717500595e-10) (2.07174910811087e-11,2.76166590052368e-10,-3.07216875701113e-10) (1.80039614499115e-11,3.03179964900486e-10,-2.04792326969778e-10) (1.55833170886812e-11,3.14050428852658e-10,-1.01823384011238e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.75196044180049e-12,4.41146128991821e-12,-4.60958505506824e-10) (9.53819179882738e-12,8.65406744168637e-12,-4.57077957001331e-10) (1.31798743309328e-11,1.13398497654694e-11,-4.494233900662e-10) (1.75946681446114e-11,1.34448287024074e-11,-4.39441591020022e-10) (2.09690111518014e-11,1.90886092507001e-11,-4.26898550915898e-10) (2.22391699241892e-11,4.55782176302686e-11,-4.11411422894967e-10) (1.72565776799546e-11,1.29953680058356e-10,-3.85013542520002e-10) (1.74602702792675e-11,1.80269414657008e-10,-3.13480593980273e-10) (1.66786947833948e-11,2.05726902947948e-10,-2.17273845263423e-10) (1.56624496546192e-11,2.16184720820011e-10,-1.10382998996794e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.66968313221005e-12,1.77308585711281e-12,-4.80619644782703e-10) (9.61539549496494e-12,3.80944809217725e-12,-4.77070681571103e-10) (1.31919323707326e-11,5.72654883027391e-12,-4.69571671318842e-10) (1.75139074573571e-11,8.02390709799688e-12,-4.59118934597335e-10) (2.00304553937422e-11,1.36418370189213e-11,-4.44810980296396e-10) (2.03313501916718e-11,2.99716935601905e-11,-4.22988767264273e-10) (1.81515511704991e-11,6.33656924280163e-11,-3.84780129043096e-10) (1.79157028518464e-11,8.87782327189899e-11,-3.15870092597643e-10) (1.80444104535592e-11,1.03528226773279e-10,-2.22329256541445e-10) (1.76552960881139e-11,1.09951320367787e-10,-1.14188992552429e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.06197332724948e-12,3.20088499439045e-11,-4.31741213813608e-11) (1.75059350216084e-12,6.73805203952913e-11,-4.1436473785627e-11) (7.63866645865486e-13,1.06731801362678e-10,-3.79953528406502e-11) (-1.78791762680947e-13,1.50779374464174e-10,-3.32522991813068e-11) (-8.72905096573258e-13,2.01087516282487e-10,-2.67367372338301e-11) (-8.25740077415595e-13,2.58325776040345e-10,-1.88699351226367e-11) (-6.46101203447828e-13,3.19578776141005e-10,-1.11472252319217e-11) (-1.04708664601234e-12,3.76247819952114e-10,-6.27895055322504e-12) (-1.25077508392768e-12,4.19052885804023e-10,-3.46340996497999e-12) (-3.51197844272294e-13,4.42635400269914e-10,-1.72124305080901e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.9071875648526e-12,3.10072524958459e-11,-8.93059402320218e-11) (2.10506343418538e-12,6.45223591277498e-11,-8.66666918728518e-11) (1.4205812605901e-12,1.0218663249858e-10,-8.03539586461364e-11) (3.64920115060196e-13,1.44156226183127e-10,-7.00084867668288e-11) (-2.69782289517419e-13,1.92883887388305e-10,-5.58193724194605e-11) (-2.2844797894666e-13,2.50254880966852e-10,-3.86236211628059e-11) (6.83042616376265e-13,3.1452451131982e-10,-2.16062102284339e-11) (-8.74893080646294e-13,3.73094280100917e-10,-1.13075875637936e-11) (-1.23171381720493e-12,4.16843233883693e-10,-6.38876884047529e-12) (-2.8929614621351e-13,4.40682800734984e-10,-3.33993705597166e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.5617211073019e-12,2.87978310070407e-11,-1.40184851315249e-10) (2.1564505108403e-12,5.88556288165317e-11,-1.35728808674337e-10) (2.03994146205994e-12,9.24777329312597e-11,-1.26513103199924e-10) (8.90649011976147e-13,1.30322360331928e-10,-1.11681299826277e-10) (2.03597117175063e-13,1.75676706822972e-10,-9.12264482663453e-11) (1.64495611433762e-12,2.32978515153865e-10,-6.47470494553231e-11) (7.6321203516925e-12,3.04715514847243e-10,-3.59002810248572e-11) (3.25949035834473e-12,3.67918396016548e-10,-2.10623112093241e-11) (1.62492796150673e-12,4.13128764960258e-10,-1.41172386833114e-11) (1.69629141994899e-12,4.36651628059518e-10,-7.52307811020723e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.89973389968017e-12,2.4739874171717e-11,-1.94909336278195e-10) (2.79542055832395e-12,5.07127847264629e-11,-1.89689379567547e-10) (2.83426588102787e-12,7.89656426405891e-11,-1.78966621766569e-10) (9.95109851194073e-13,1.10749456120782e-10,-1.62032889160425e-10) (-3.35096348874216e-13,1.4947309186352e-10,-1.38802505356602e-10) (4.11444908003508e-12,2.04754807134654e-10,-1.07859867707008e-10) (2.76682210850553e-11,2.94812951955576e-10,-6.78090701410023e-11) (1.24601965914924e-11,3.62747173459534e-10,-4.72813597470508e-11) (5.92664483962103e-12,4.07003590135261e-10,-3.29205188290309e-11) (4.00189260391106e-12,4.28870022266588e-10,-1.72574587305488e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.95666858226938e-12,2.01817823923599e-11,-2.50380318484915e-10) (3.85843199395746e-12,4.13959465065974e-11,-2.45090010426417e-10) (3.19735063431977e-12,6.35478258516482e-11,-2.34180159813854e-10) (1.26559517830469e-13,8.82216952725384e-11,-2.17596400385949e-10) (-5.56165401436689e-12,1.18222316149809e-10,-1.96437115342204e-10) (-9.53002520688198e-12,1.66783764125584e-10,-1.73247062085541e-10) (2.36654796649474e-11,2.94634053593875e-10,-1.52145964857109e-10) (1.74737435912458e-11,3.55869755570241e-10,-1.07535781626182e-10) (9.81960885904188e-12,3.94360875453378e-10,-6.98971629171169e-11) (6.53909243308429e-12,4.1296936691919e-10,-3.50245085196971e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.73375696238176e-12,1.62503039990931e-11,-3.04403981549816e-10) (3.84390642488048e-12,3.25991143713069e-11,-2.99067235143945e-10) (4.15592618838385e-12,4.87984821275849e-11,-2.88427704066e-10) (9.24443011521099e-13,6.71623662930858e-11,-2.73017553329308e-10) (-7.88640032994992e-12,9.10428739237263e-11,-2.54619040617541e-10) (-1.68998526825234e-11,1.36625198571799e-10,-2.3645966194135e-10) (2.68968159296954e-11,2.66076093681761e-10,-2.20502960827371e-10) (2.04227614050508e-11,3.28727487238166e-10,-1.65681566795428e-10) (1.26208888794218e-11,3.64840211339376e-10,-1.10004191243939e-10) (9.25376318089587e-12,3.80819113304976e-10,-5.49057666068737e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.19943833751393e-12,1.24650657548021e-11,-3.55676233613928e-10) (5.20995082317087e-12,2.43896810017603e-11,-3.50593380338311e-10) (6.59467408524562e-12,3.58468211365595e-11,-3.40711409056262e-10) (4.07756715604547e-12,4.90812242536324e-11,-3.26715906847618e-10) (-4.45115799617754e-12,6.70945612355678e-11,-3.10682826838134e-10) (-1.73430583436354e-11,1.05630948152779e-10,-2.97535765109687e-10) (1.50011886717446e-11,2.29911350834778e-10,-2.93333780708807e-10) (1.84672815289854e-11,2.85191258847383e-10,-2.23470636193555e-10) (1.35688793715952e-11,3.16461054526736e-10,-1.48208526001695e-10) (1.09442888864346e-11,3.30155481217072e-10,-7.36141023595784e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.72910285596946e-12,9.04895098479566e-12,-3.99017670591401e-10) (6.28960011676141e-12,1.75519248220272e-11,-3.93955559866051e-10) (8.20147733400592e-12,2.55385048441297e-11,-3.84461693401023e-10) (8.48206394549363e-12,3.50903888482755e-11,-3.71437504613513e-10) (6.52434468871696e-12,5.01974045597822e-11,-3.5545279793439e-10) (5.25578131475939e-12,8.54640875192812e-11,-3.37533518590526e-10) (1.15374769122232e-11,1.6863567868739e-10,-3.13100230692515e-10) (1.41901177451377e-11,2.20224438043828e-10,-2.50510152343099e-10) (1.24880804439218e-11,2.48979074462449e-10,-1.71686416647259e-10) (1.16256411100945e-11,2.61658022291181e-10,-8.68848176143258e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.509787369113e-12,5.74620445161894e-12,-4.28012167585005e-10) (6.72824421321709e-12,1.12462565969155e-11,-4.23351823752959e-10) (8.81137621995769e-12,1.68321413920825e-11,-4.14036443607719e-10) (1.0472549644902e-11,2.37925257737597e-11,-4.01133225962865e-10) (1.09286553626139e-11,3.61517933710052e-11,-3.84034005198113e-10) (1.14478136192744e-11,6.30092251805501e-11,-3.60993625827262e-10) (1.23116167706259e-11,1.11163465893397e-10,-3.25212837567798e-10) (1.27447035004233e-11,1.48015393992422e-10,-2.63461908915834e-10) (1.19865246914588e-11,1.70037059381455e-10,-1.83516702741157e-10) (1.15128511100468e-11,1.79731751367718e-10,-9.36569416540446e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.89380577772287e-12,2.83255215937795e-12,-4.43810933417082e-10) (5.92583333488094e-12,5.27911174347001e-12,-4.39146218750201e-10) (8.46574447949935e-12,8.40744246146863e-12,-4.30243931690419e-10) (1.12298602544164e-11,1.24102471975375e-11,-4.17067072137253e-10) (1.18500793805412e-11,1.96100189991844e-11,-3.98599150703712e-10) (1.20944055306878e-11,3.35633523954431e-11,-3.72189866763495e-10) (1.26072071530556e-11,5.53518470439847e-11,-3.3199212911378e-10) (1.31530995146442e-11,7.40167053954867e-11,-2.7029121005918e-10) (1.34323732378108e-11,8.58898545489787e-11,-1.89869845020667e-10) (1.34176239034579e-11,9.11174919463469e-11,-9.73534721677266e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.32592317960932e-12,3.07754672632601e-11,-4.33816299508475e-11) (1.16763382470801e-12,6.5306278230181e-11,-4.1385256709121e-11) (5.65981850624089e-13,1.05206132901868e-10,-3.7736881344351e-11) (-7.12054291019602e-14,1.48592944614363e-10,-3.30372885801848e-11) (-5.36078313604132e-13,1.97547574676784e-10,-2.74723384666967e-11) (-4.7755489462295e-13,2.52323763855265e-10,-2.10589423011511e-11) (-4.60111060966225e-13,3.09281468930955e-10,-1.44683398917404e-11) (-7.09087383049896e-13,3.61313347490482e-10,-9.64030197374002e-12) (-7.83290077790601e-13,4.0013484156239e-10,-6.11590043087574e-12) (-1.19841360166427e-13,4.21470106612401e-10,-3.39475147747771e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.477360694485e-12,3.01050172011543e-11,-8.8112439556318e-11) (1.45906051871319e-12,6.28255366901139e-11,-8.53152124123702e-11) (7.84008948623283e-13,1.01072521988282e-10,-7.89756197621556e-11) (9.67161884584291e-15,1.42956789071799e-10,-6.93589145540791e-11) (-2.58352980826276e-13,1.90598100197641e-10,-5.75418183712225e-11) (3.05068996600101e-14,2.45255606551273e-10,-4.38657960036434e-11) (1.93416424288429e-13,3.0399331995196e-10,-2.98319633457313e-11) (-6.17827719589201e-13,3.57079858564565e-10,-1.94650680266029e-11) (-5.66076678279558e-13,3.96630402531207e-10,-1.26143286946416e-11) (4.019394732997e-13,4.17955513774757e-10,-6.72044176477444e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.16363530174992e-12,2.87851507516966e-11,-1.38726639026286e-10) (1.08358912648199e-12,5.79450045586169e-11,-1.3364961778191e-10) (7.20228379053811e-13,9.22398257288389e-11,-1.24711246976773e-10) (8.70166319379118e-15,1.31149364507789e-10,-1.11340597490806e-10) (-7.21867343922716e-14,1.76663724849237e-10,-9.42191396975622e-11) (1.02189570308211e-12,2.3125228079301e-10,-7.33734517472918e-11) (2.69671342786097e-12,2.93819841057107e-10,-5.16235394474072e-11) (1.48564038932552e-12,3.49611291513029e-10,-3.54791658005029e-11) (1.155942213385e-12,3.9017043892306e-10,-2.37867265857369e-11) (1.95481910267168e-12,4.1163701148328e-10,-1.23786850991147e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.23786896840748e-12,2.48717648090589e-11,-1.91383506569908e-10) (1.38950097719288e-12,5.00902228799791e-11,-1.858155494473e-10) (1.31835006384867e-12,7.95894046219128e-11,-1.75781074235703e-10) (2.9248689561706e-13,1.14036608377747e-10,-1.60628326124871e-10) (-2.69582847586123e-14,1.55745850164562e-10,-1.41054335286087e-10) (2.03469452314306e-12,2.1052426419622e-10,-1.16834462210844e-10) (7.31940905286181e-12,2.80372180838055e-10,-8.94864314802322e-11) (4.97677356270953e-12,3.39404492687591e-10,-6.53172969542228e-11) (2.90629942305056e-12,3.79918339649824e-10,-4.35068418285497e-11) (2.6450892207711e-12,4.01213145486833e-10,-2.23726174440051e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.59783891707441e-12,2.05416766548755e-11,-2.44480838154179e-10) (1.7454135167024e-12,4.14452486455659e-11,-2.39085958010285e-10) (1.36293493043494e-12,6.57550065749083e-11,-2.29248614285019e-10) (2.66034535510253e-14,9.47551044346041e-11,-2.14161032859139e-10) (-1.57226504492805e-12,1.3149901880456e-10,-1.94925095217482e-10) (-4.72556881541764e-13,1.85210927988744e-10,-1.72542136898952e-10) (7.61325634613596e-12,2.63522455364879e-10,-1.45880947660426e-10) (6.97739321420971e-12,3.22570811124674e-10,-1.10214264673633e-10) (4.46761857562462e-12,3.61690414688318e-10,-7.36798642234141e-11) (3.66483752759167e-12,3.81485617263592e-10,-3.7649665090819e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.18224880079533e-12,1.67446354280433e-11,-2.96154466265015e-10) (1.41380871649108e-12,3.33533184369996e-11,-2.90722125403537e-10) (1.69743644274048e-12,5.20303600794642e-11,-2.8108859826104e-10) (6.07072339188696e-13,7.55457702465205e-11,-2.66739541031681e-10) (-2.09746631800516e-12,1.07543795441082e-10,-2.48696006366632e-10) (-1.8623033775144e-12,1.58077181868704e-10,-2.28175124354328e-10) (8.24016474475064e-12,2.35469028724211e-10,-2.0118773544036e-10) (8.28161424437727e-12,2.93013803888653e-10,-1.56593628897476e-10) (5.90162105496439e-12,3.30127834131363e-10,-1.06160979963641e-10) (5.01162866187214e-12,3.47500789700366e-10,-5.38529012147922e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.532699831916e-12,1.24945433673562e-11,-3.43813483664625e-10) (2.16573572085337e-12,2.51336000109991e-11,-3.38779580241938e-10) (2.9074881690715e-12,3.93787392928427e-11,-3.29790267485654e-10) (2.03532255188569e-12,5.81093079206435e-11,-3.16412476280409e-10) (-7.01063048843585e-13,8.49254471108211e-11,-2.98936808369526e-10) (-1.37818211097646e-12,1.29227489577195e-10,-2.78521851862621e-10) (6.41371630381375e-12,1.99115086926088e-10,-2.50889648892963e-10) (8.17199214067573e-12,2.50862769199181e-10,-1.9859708217835e-10) (6.45643579380157e-12,2.83721376437482e-10,-1.35560402578016e-10) (5.82764545275267e-12,2.98659517147449e-10,-6.86373978480059e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.96973866383277e-12,8.99333977658942e-12,-3.83093249573178e-10) (3.10140187681829e-12,1.8310022975574e-11,-3.7828149532171e-10) (3.8836519985482e-12,2.89084362566767e-11,-3.69044116677154e-10) (3.79522034089277e-12,4.26689625616586e-11,-3.5586937836389e-10) (2.65067653361124e-12,6.38094275550804e-11,-3.3816367297561e-10) (3.27735575546407e-12,1.00217104496504e-10,-3.15254064855762e-10) (6.41961135683857e-12,1.53236236515314e-10,-2.81166112465477e-10) (7.57542610067397e-12,1.95998081739525e-10,-2.25697883029691e-10) (6.62849649198687e-12,2.23254807501293e-10,-1.56198538012795e-10) (6.66709441921959e-12,2.35849764752198e-10,-7.99013203677286e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.76309582930761e-12,6.15132418896098e-12,-4.09711928850677e-10) (3.38000892142505e-12,1.21740462078102e-11,-4.05271875153669e-10) (4.33285750572118e-12,1.96173499419798e-11,-3.95835905331714e-10) (4.7556074563615e-12,2.8758477514268e-11,-3.82026397349851e-10) (4.43005036358313e-12,4.35504959688453e-11,-3.63410928337903e-10) (5.11289814492667e-12,6.94065078616771e-11,-3.38123018084949e-10) (6.37230696806763e-12,1.04187618436354e-10,-2.99248072994354e-10) (6.79818592269182e-12,1.34074162823311e-10,-2.41306337001819e-10) (6.27396843682349e-12,1.53586086348214e-10,-1.68228654907372e-10) (6.47016887737438e-12,1.62615538803692e-10,-8.6358323751042e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.06164327021848e-12,3.47436632127383e-12,-4.2383655071163e-10) (2.30265801856701e-12,6.1180853072816e-12,-4.19300541120138e-10) (3.69632738780398e-12,1.01406994658384e-11,-4.10879797794289e-10) (5.17218601841267e-12,1.48986159586785e-11,-3.97042770940646e-10) (5.05081443951203e-12,2.26926360794513e-11,-3.76971968963555e-10) (5.46002027640765e-12,3.56444609160374e-11,-3.49228518444592e-10) (6.25813514244922e-12,5.26181894118763e-11,-3.08124037252147e-10) (6.74843987161573e-12,6.77946666515572e-11,-2.49247712697822e-10) (6.80585493384753e-12,7.79897236287038e-11,-1.74704606174649e-10) (7.18164368207517e-12,8.27273839300221e-11,-8.99090276120973e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) ) ; boundaryField { fuel { type fixedValue; value uniform (0.1 0 0); } air { type fixedValue; value uniform (-0.1 0 0); } outlet { type zeroGradient; } frontAndBack { type empty; } } // ************************************************************************* //
[ "huberlulu@gmail.com" ]
huberlulu@gmail.com
a081fba3b7ef8fd27bb9918e123939e2b74b390c
aa5c1a530f95d629e686ac9124caf1a49a9f23e9
/compiler/src/iree/compiler/Codegen/Common/ExtractAddressComputation.cpp
f3704e966e27f68f59a8ef57ae58f010843a1692
[ "Apache-2.0", "LLVM-exception", "LicenseRef-scancode-unknown-license-reference" ]
permissive
openxla/iree
eacf5b239559e1d3b40c38039ac4c26315b523f7
13ef677e556d0a1d154e45b052fe016256057f65
refs/heads/main
2023-09-06T01:19:49.598662
2023-09-04T07:01:30
2023-09-04T07:01:30
208,145,128
387
110
Apache-2.0
2023-09-14T20:48:00
2019-09-12T20:57:39
C++
UTF-8
C++
false
false
4,671
cpp
// Copyright 2023 The IREE Authors // // Licensed under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "iree/compiler/Codegen/Common/ExtractAddressComputation.h" #include "iree/compiler/Codegen/Common/PassDetail.h" #include "iree/compiler/Codegen/Common/Passes.h" #include "llvm/Support/Debug.h" #include "mlir/Dialect/Arith/IR/Arith.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/Dialect/Utils/StaticValueUtils.h" #include "mlir/Transforms/GreedyPatternRewriteDriver.h" #define DEBUG_TYPE "extract-address-computation" using namespace mlir; namespace mlir { namespace iree_compiler { //===----------------------------------------------------------------------===// // Helper functions for the `load base[off0...]` // => `load (subview base[off0...])[0...]` pattern. //===----------------------------------------------------------------------===// // Matches getSrcMemRef specs for LoadOp. // \see LoadLikeOpRewriter. static Value getLoadOpSrcMemRef(memref::LoadOp loadOp) { return loadOp.getMemRef(); } // Matches rebuildOpFromAddressAndIndices specs for LoadOp. // \see LoadLikeOpRewriter. static memref::LoadOp rebuildLoadOp(RewriterBase &rewriter, memref::LoadOp loadOp, Value srcMemRef, ArrayRef<Value> indices) { Location loc = loadOp.getLoc(); return rewriter.create<memref::LoadOp>(loc, srcMemRef, indices, loadOp.getNontemporal()); } SmallVector<OpFoldResult> getLoadOpViewSizeForEachDim(RewriterBase &rewriter, memref::LoadOp loadOp) { MemRefType ldTy = loadOp.getMemRefType(); unsigned loadRank = ldTy.getRank(); return SmallVector<OpFoldResult>(loadRank, rewriter.getIndexAttr(1)); } //===----------------------------------------------------------------------===// // Helper functions for the `store val, base[off0...]` // => `store val, (subview base[off0...])[0...]` pattern. //===----------------------------------------------------------------------===// // Matches getSrcMemRef specs for StoreOp. // \see LoadStoreLikeOpRewriter. static Value getStoreOpSrcMemRef(memref::StoreOp storeOp) { return storeOp.getMemRef(); } // Matches rebuildOpFromAddressAndIndices specs for StoreOp. // \see LoadStoreLikeOpRewriter. static memref::StoreOp rebuildStoreOp(RewriterBase &rewriter, memref::StoreOp storeOp, Value srcMemRef, ArrayRef<Value> indices) { Location loc = storeOp.getLoc(); return rewriter.create<memref::StoreOp>(loc, storeOp.getValueToStore(), srcMemRef, indices, storeOp.getNontemporal()); } SmallVector<OpFoldResult> getStoreOpViewSizeForEachDim(RewriterBase &rewriter, memref::StoreOp storeOp) { MemRefType ldTy = storeOp.getMemRefType(); unsigned loadRank = ldTy.getRank(); return SmallVector<OpFoldResult>(loadRank, rewriter.getIndexAttr(1)); } void populateExtractAddressComputationPatterns(RewritePatternSet &patterns) { patterns.add<StoreLoadLikeOpRewriter< memref::LoadOp, /*getSrcMemRef=*/getLoadOpSrcMemRef, /*rebuildOpFromAddressAndIndices=*/rebuildLoadOp, /*getViewSizeForEachDim=*/getLoadOpViewSizeForEachDim>, StoreLoadLikeOpRewriter< memref::StoreOp, /*getSrcMemRef=*/getStoreOpSrcMemRef, /*rebuildOpFromAddressAndIndices=*/rebuildStoreOp, /*getViewSizeForEachDim=*/getStoreOpViewSizeForEachDim>>( patterns.getContext()); } //===----------------------------------------------------------------------===// // Pass registration //===----------------------------------------------------------------------===// namespace { struct ExtractAddressComputationPass : public ExtractAddressComputationBase<ExtractAddressComputationPass> { void runOnOperation() override; }; } // namespace void ExtractAddressComputationPass::runOnOperation() { RewritePatternSet patterns(&getContext()); populateExtractAddressComputationPatterns(patterns); if (failed( applyPatternsAndFoldGreedily(getOperation(), std::move(patterns)))) { return signalPassFailure(); } } std::unique_ptr<Pass> createExtractAddressComputationPass() { return std::make_unique<ExtractAddressComputationPass>(); } } // namespace iree_compiler } // namespace mlir
[ "noreply@github.com" ]
openxla.noreply@github.com
1bc0ed1c075e5aadf4bb62917489793a6c7ced48
f9e23433aaa32cca6567ef0a5295af2600a3f236
/src/graphics/delete_shader.cpp
ea7a4ab6791a0dc3f76872e324afb3b7bd52a8d8
[ "BSD-2-Clause" ]
permissive
TetraSomia/liblapin
72d8bbcf48b4acb39d079884e50d80cd38827c52
f5ee3ce9b0fff8459ec15d5e24287f2c16e5ae35
refs/heads/main
2023-06-02T02:28:38.107596
2021-06-13T18:54:09
2021-06-13T18:54:09
376,612,564
1
0
null
null
null
null
UTF-8
C++
false
false
240
cpp
// Jason Brillante "Damdoshi" // Hanged Bunny Studio 2014-2015 // // Bibliothèque Lapin #include "lapin_private.h" void bunny_delete_shader(t_bunny_shader *_shader) { sf::Shader *shader = (sf::Shader*)_shader; delete shader; }
[ "arthur.josso@obspm.fr" ]
arthur.josso@obspm.fr
2417a8b9432fba32186cecec15fbab167cd7a487
cf9fc8b34de889922a8cf84dbf3fdf51b01f2312
/under/FunctionWithParam.cpp
45a5e0467ae1a518755334128fc5747685fa54ba
[]
no_license
cks920402/cpp
71f920b5fcf3741ff69760859f7db40bb2ad1199
62ae8872cbccb17b1e65844ae2bbccb35d46a27b
refs/heads/master
2023-01-08T23:34:33.051080
2020-11-13T08:48:43
2020-11-13T08:48:43
311,860,713
0
0
null
null
null
null
UTF-8
C++
false
false
196
cpp
#include <iostream> using namespace std; int max(int num_first, int num_second){ int result; if (num_first > num_second) result=num_first; else result=num_second; return result; }
[ "cks70001559@gmail.com" ]
cks70001559@gmail.com
ad7b61cd4c49b27563c351901728be33d527eff7
5388c95e89ccd03bb1a18aaa663785efc4d6e767
/Test002-FontBlitting/MainWindow.h
ea5504011df9dbff2e27ef0a42fb994a579f5ee6
[]
no_license
egrath/Tests
59397a79432bdf9c4dda9684fbdced4253ef7497
d50a2420f0bd2a78acdee1f419d5bd2d7c0a731d
refs/heads/master
2022-10-23T01:35:53.820355
2020-06-12T05:46:04
2020-06-12T05:46:04
251,276,549
0
0
null
null
null
null
UTF-8
C++
false
false
251
h
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include "ui_MainWindow.h" class MainWindow : public QMainWindow { private: Ui_MainWindow *m_Ui = nullptr; public: MainWindow(); ~MainWindow(); }; #endif // MAINWINDOW_H
[ "egon.rath@gmail.com" ]
egon.rath@gmail.com
d48bcff5880ac712e04b0d6ae7506981b75360cd
b4f42eed62aa7ef0e28f04c1f455f030115ec58e
/messagingfw/sendas/test/sendastestmtm/src/csendastestuimtm.cpp
549ca09e41345a3ebdadf4b09f43a089f950f7f0
[]
no_license
SymbianSource/oss.FCL.sf.mw.messagingmw
6addffd79d854f7a670cbb5d89341b0aa6e8c849
7af85768c2d2bc370cbb3b95e01103f7b7577455
refs/heads/master
2021-01-17T16:45:41.697969
2010-11-03T17:11:46
2010-11-03T17:11:46
71,851,820
1
0
null
null
null
null
UTF-8
C++
false
false
3,675
cpp
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" // which accompanies this distribution, and is available // at the URL "http://www.eclipse.org/legal/epl-v10.html". // // Initial Contributors: // Nokia Corporation - initial contribution. // // Contributors: // // Description: // #include "csendastestuimtm.h" _LIT(KSendAsTestUiMtmResourceFile, "\\resource\\messaging\\sendastestuimtm.rss"); EXPORT_C CSendAsTestUiMtm* CSendAsTestUiMtm::NewL(CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll) { CSendAsTestUiMtm* self = new (ELeave) CSendAsTestUiMtm(aBaseMtm, aRegisteredMtmDll); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); return self; } CSendAsTestUiMtm::~CSendAsTestUiMtm() { } CSendAsTestUiMtm::CSendAsTestUiMtm(CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll) : CBaseMtmUi(aBaseMtm, aRegisteredMtmDll) { } void CSendAsTestUiMtm::ConstructL() { CBaseMtmUi::ConstructL(); } /* * Methods from CBaseMtmUi */ CMsvOperation* CSendAsTestUiMtm::OpenL(TRequestStatus& /*aStatus*/) { User::Leave(KErrNotSupported); return NULL; } CMsvOperation* CSendAsTestUiMtm::CloseL(TRequestStatus& /*aStatus*/) { User::Leave(KErrNotSupported); return NULL; } CMsvOperation* CSendAsTestUiMtm::EditL(TRequestStatus& aStatus) { TMsvEntry entry = BaseMtm().Entry().Entry(); entry.SetMtmData3(1234567890); // Show we've been called by touching the TMsvEntry. BaseMtm().Entry().ChangeL(entry); return CMsvCompletedOperation::NewL(Session(), Type(), KNullDesC8, BaseMtm().Entry().OwningService(), aStatus, entry.iError); } CMsvOperation* CSendAsTestUiMtm::ViewL(TRequestStatus& /*aStatus*/) { User::Leave(KErrNotSupported); return NULL; } CMsvOperation* CSendAsTestUiMtm::OpenL(TRequestStatus& /*aStatus*/, const CMsvEntrySelection& /*aSelection*/) { User::Leave(KErrNotSupported); return NULL; } CMsvOperation* CSendAsTestUiMtm::CloseL(TRequestStatus& /*aStatus*/, const CMsvEntrySelection& /*aSelection*/) { User::Leave(KErrNotSupported); return NULL; } CMsvOperation* CSendAsTestUiMtm::EditL(TRequestStatus& /*aStatus*/, const CMsvEntrySelection& /*aSelection*/) { User::Leave(KErrNotSupported); return NULL; } CMsvOperation* CSendAsTestUiMtm::ViewL(TRequestStatus& /*aStatus*/, const CMsvEntrySelection& /*aSelection*/) { User::Leave(KErrNotSupported); return NULL; } CMsvOperation* CSendAsTestUiMtm::CancelL(TRequestStatus& /*aStatus*/, const CMsvEntrySelection& /*aSelection*/) { User::Leave(KErrNotSupported); return NULL; } CMsvOperation* CSendAsTestUiMtm::ReplyL(TMsvId /*aDestination*/, TMsvPartList /*aPartlist*/, TRequestStatus& /*aCompletionStatus*/) { User::Leave(KErrNotSupported); return NULL; } CMsvOperation* CSendAsTestUiMtm::ForwardL(TMsvId /*aDestination*/, TMsvPartList /*aPartlist*/, TRequestStatus& /*aCompletionStatus*/) { User::Leave(KErrNotSupported); return NULL; } CMsvOperation* CSendAsTestUiMtm::ConfirmSendL(TRequestStatus& aStatus, const CMsvEntrySelection& /*aSelection*/, const TSecurityInfo& /*aClientInfo*/) { // Use the error value of the context entry to indicate whether the send is // confirmed (iError == KErrNone) or not (iError != KErrNone). TMsvEntry entry = BaseMtm().Entry().Entry(); return CMsvCompletedOperation::NewL(Session(), Type(), KNullDesC8, BaseMtm().Entry().OwningService(), aStatus, entry.iError); } void CSendAsTestUiMtm::GetResourceFileName(TFileName& aFileName) const { aFileName = KSendAsTestUiMtmResourceFile(); }
[ "none@none" ]
none@none
114e23d84315ba7f524cda36914441542a8fe03e
91b66eaad3fa6821075abfe54b6fa89b73a89af7
/branches/sandbox/cardboard/src/detection.cpp
52a39815485eb213ac8b8536daace094a7ccc995
[]
no_license
yutakage/mit-ros-pkg
635acf0783763affbc3d1b7280d19f70d12c5b95
05508bb956819eeff71c26ac9ecf62d3d3aab5db
refs/heads/master
2023-03-19T06:21:45.511617
2019-02-05T20:53:10
2019-02-05T20:53:10
null
0
0
null
null
null
null
UTF-8
C++
false
false
41,704
cpp
#include <cardboard/detection.h> #include <cardboard/models.h> #include <cardboard/optimization.h> #include <cardboard/ply.h> #include <cardboard/util.h> #include "fitness.h" #include <cardboard/common.h> #include <cardboard/testing.h> #include <cardboard/SceneHypothesis.h> #include <cardboard/DetectModels.h> #include <cardboard/AlignModels.h> #include <pthread.h> #include <sensor_msgs/PointCloud.h> #include <sensor_msgs/PointCloud2.h> #include <sensor_msgs/point_cloud_conversion.h> #include <pcl/point_types.h> #include <pcl/io/pcd_io.h> #include <pcl/kdtree/kdtree_flann.h> #include <pcl/features/normal_3d.h> #include <pcl/surface/gp3.h> namespace cardboard { //------------------ INTERNAL CLASSES -------------------// class ModelPoseOptimizer : public GradientFreeRandomizedGradientOptimizer { private: ModelTester *model_tester_; const Model &model_; Matrix4f initial_pose_; public: ModelPoseOptimizer(ModelTester *T, const Model &model); float evaluate(VectorXf x); Matrix4f x2affine(VectorXf x); Matrix4f optimizeAffine(const Matrix4f &initial_pose); }; //--------------------- ModelPoseOptimizer class --------------------// ModelPoseOptimizer::ModelPoseOptimizer(ModelTester *T, const Model &model) : GradientFreeRandomizedGradientOptimizer(.07, Vector4f(.004, .004, 0, .03), 3.0), // TODO: clean this up model_tester_(T), model_(model) { } Matrix4f ModelPoseOptimizer::x2affine(VectorXf x) { Matrix4f A_shift = Matrix4f::Identity(); // shift to origin Vector3f t = initial_pose_.topRightCorner(3,1); A_shift.col(3) << -t, 1; A_shift(3,3) = 1; t += x.topRows(3); float theta = x(3); Quaternionf q(cos(theta/2.0), 0, 0, sin(theta/2.0)); Matrix4f A = pose_to_affine_matrix(t, q); // rotate, then unshift and translate by x(0:2) return A * A_shift * initial_pose_; } float ModelPoseOptimizer::evaluate(VectorXf x) { Matrix4f A = x2affine(x); return model_tester_->testHypothesis(model_, A); } Matrix4f ModelPoseOptimizer::optimizeAffine(const Matrix4f &initial_pose) { initial_pose_ = initial_pose; VectorXf x0 = VectorXf::Zero(4); VectorXf x = optimize(x0); return x2affine(x); } //------------Helper Functions --------------------------// double square(double num){ return num*num; } int findClosestPoseIndex(geometry_msgs::Pose initPose, vector<geometry_msgs::Pose> cluster_poses){ double smallestDist = -1; int smallestIndex = 0; for (uint i = 0; i < cluster_poses.size(); i++){ geometry_msgs::Pose clusterPose = cluster_poses[i]; double xDist = clusterPose.position.x - initPose.position.x; double yDist = clusterPose.position.y - initPose.position.y; double zDist = clusterPose.position.z - initPose.position.z; double eucDist = sqrt(square(xDist)+square(yDist)+square(zDist)); if (smallestDist == -1) smallestDist = eucDist; if (eucDist < smallestDist){ smallestDist = eucDist; smallestIndex = i; } } return smallestIndex; } // dbug -- move this to table_tracker static double adjust_table_height(const PointCloudXYZ &cloud, double table_height_init) { cardboard::init_rand(); int i, j, iter = 100, n = cloud.points.size(); double thresh = .01; double zmin = table_height_init, dmin = 1000*n; for (i = 0; i < iter; i++) { int j = rand() % n; double z = cloud.points[j].z; //printf("j = %d, z = %.2f\n", j, z); if (fabs(z - table_height_init) > .1) continue; double d = 0.0; for (j = 0; j < n; j += 10) { double dz = fabs(z - cloud.points[j].z); if (dz > thresh) dz = thresh; d += dz; } if (d < dmin) { dmin = d; zmin = z; } } return zmin; } /* convert a tf transform to an eigen transform */ void transformTFToEigen(const tf::Transform &t, Affine3f &k) { for(int i=0; i<3; i++) { k.matrix()(i,3) = t.getOrigin()[i]; for(int j=0; j<3; j++) { k.matrix()(i,j) = t.getBasis()[i][j]; } } // Fill in identity in last row for (int col = 0 ; col < 3; col ++) k.matrix()(3, col) = 0; k.matrix()(3,3) = 1; } /* project a point cloud into the XY plane */ void flatten_point_cloud(const PointCloudXYZ &cloud_in, PointCloudXYZ &cloud_out) { cloud_out = cloud_in; for (size_t i = 0; i < cloud_out.points.size(); i++) cloud_out.points[i].z = 0; } /** \brief Check if a 2d point (X and Y coordinates considered only!) is inside or outside a given polygon. This * method assumes that both the point and the polygon are projected onto the XY plane. * \note (This is highly optimized code taken from http://www.visibone.com/inpoly/) * Copyright (c) 1995-1996 Galacticomm, Inc. Freeware source code. * \param point a 3D point projected onto the same plane as the polygon * \param polygon a polygon */ static bool isXYPointIn2DXYPolygon (const pcl::PointXYZ &point, const geometry_msgs::Polygon &polygon) { bool in_poly = false; double x1, x2, y1, y2; int nr_poly_points = polygon.points.size (); double xold = polygon.points[nr_poly_points - 1].x; double yold = polygon.points[nr_poly_points - 1].y; for (int i = 0; i < nr_poly_points; i++) { double xnew = polygon.points[i].x; double ynew = polygon.points[i].y; if (xnew > xold) { x1 = xold; x2 = xnew; y1 = yold; y2 = ynew; } else { x1 = xnew; x2 = xold; y1 = ynew; y2 = yold; } if ( (xnew < point.x) == (point.x <= xold) && (point.y - y1) * (x2 - x1) < (y2 - y1) * (point.x - x1) ) { in_poly = !in_poly; } xold = xnew; yold = ynew; } return (in_poly); } /* filter a point cloud based on a polygon in the XY plane */ static void polygon_filter(const geometry_msgs::Polygon &polygon, const PointCloudXYZ &cloud_in, PointCloudXYZ &cloud_out) { cloud_out.height = 1; cloud_out.is_dense = false; cloud_out.points.resize(0); for (size_t i = 0; i < cloud_in.points.size(); i++) { if (isXYPointIn2DXYPolygon(cloud_in.points[i], polygon)) cloud_out.push_back(cloud_in.points[i]); } cloud_out.width = cloud_out.points.size(); } static void crossproduct(double vector1[],double vector2[], double Xproduct[]) { //initialize the cross product vector //calculate the i,j,k coefficients of the cross product Xproduct[0]=vector1[1]*vector2[2]-vector2[1]*vector1[2]; Xproduct[1]=vector1[0]*vector2[2]-vector2[0]*vector1[2]; Xproduct[2]=vector1[0]*vector2[1]-vector2[0]*vector1[1]; } static double dotProduct(double v1[], double v2[]) { double dp = v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2]; return dp; } static vector<geometry_msgs::Polygon> find_horizontal_surfaces(const vector<geometry_msgs::Polygon> &surface_polygons) { printf("break 1\n"); vector<geometry_msgs::Polygon> horizontal_surfaces; vector<geometry_msgs::Polygon> horizontal_surfaces_sorted; //TODO: Sort by height for (int i = 0; i < surface_polygons.size(); i++) { geometry_msgs::Polygon current = surface_polygons[i]; geometry_msgs::Point32 p1, p2, p3; p1 = current.points[0]; p2 = current.points[1]; p3 = current.points[2]; double v1[3] = {p1.x - p2.x, p1.y - p2.y, p1.z - p2.z}; double v2[3] = {p3.x - p2.x, p3.y - p2.y, p3.z - p2.z}; double normal[3]; crossproduct(v1, v2, normal); double mag = sqrt((normal[0]*normal[0] + normal[1]*normal[1] + normal[2]*normal[2])); if (fabs(normal[2]/mag) > .9) { horizontal_surfaces.push_back(current); printf("horizontal normal is (%f, %f, %f)\n", normal[0]/mag, normal[1]/mag, normal[2]/mag); } } printf("break 2\n"); double lowestValBigger = 0; for (int j = 0; j < horizontal_surfaces.size(); j++) { double currentMin = 1000; //FIND OUT HOW SCALED geometry_msgs::Polygon currentMinPlane; for (int k = 0; k < horizontal_surfaces.size(); k++) { if (horizontal_surfaces[k].points[0].z > lowestValBigger) { if (horizontal_surfaces[k].points[0].z < currentMin) { currentMin = horizontal_surfaces[k].points[0].z; currentMinPlane = horizontal_surfaces[k]; } } } lowestValBigger = currentMin; horizontal_surfaces_sorted.push_back(currentMinPlane); } printf("break 3\n"); return horizontal_surfaces_sorted; } static vector<geometry_msgs::Polygon> find_nonhorizontal_surfaces(const vector<geometry_msgs::Polygon> &surface_polygons) { printf("break 1\n"); vector<geometry_msgs::Polygon> nonhorizontal_surfaces; for (int i = 0; i < surface_polygons.size(); i++) { geometry_msgs::Polygon current = surface_polygons[i]; geometry_msgs::Point32 p1, p2, p3; p1 = current.points[0]; p2 = current.points[1]; p3 = current.points[2]; double v1[3] = {p1.x - p2.x, p1.y - p2.y, p1.z - p2.z}; double v2[3] = {p3.x - p2.x, p3.y - p2.y, p3.z - p2.z}; double normal[3]; crossproduct(v1, v2, normal); double mag = sqrt((normal[0]*normal[0] + normal[1]*normal[1] + normal[2]*normal[2])); if (fabs(normal[2]/mag) <= .9) { nonhorizontal_surfaces.push_back(current); printf("non-horizontal normal is (%f, %f, %f)\n", normal[0]/mag, normal[1]/mag, normal[2]/mag); } } printf("break 2\n"); return nonhorizontal_surfaces; } static void remove_plane_points(const vector<geometry_msgs::Polygon> &plane_polygons, const PointCloudXYZ &cloud_in, PointCloudXYZ &cloud_out) { printf("break 1\n"); // TODO: remove points near planes (optional: only remove points within polygon) bool inNewCloud[cloud_in.points.size()]; for (int k = 0; k < cloud_in.points.size(); k++) { inNewCloud[k] = true; } printf("break 2\n"); for (int i = 0; i < plane_polygons.size(); i++) { geometry_msgs::Point32 p1, p2, p3; p1 = plane_polygons[i].points[0]; p2 = plane_polygons[i].points[1]; p3 = plane_polygons[i].points[2]; double v1[] = {p1.x - p2.x, p1.y - p2.y, p1.z - p2.z}; double v2[] = {p3.x - p2.x, p3.y - p2.y, p3.z - p2.z}; double normal[3]; crossproduct(v1, v2, normal); double mag = sqrt((normal[0]*normal[0]+ normal[1]*normal[1] + normal[2]*normal[2])); normal[0] = normal[0]/mag; normal[1] = normal[1]/mag; normal[2] = normal[2]/mag; for (int j = 0; j < cloud_in.points.size(); j++) { pcl::PointXYZ cloudPoint = cloud_in.points[j]; double planeToPoint[] = {cloudPoint.x - p1.x, cloudPoint.y - p1.y, cloudPoint.z - p1.z}; double distFromPlane = fabs(dotProduct(planeToPoint, normal)); if (distFromPlane < .06) { //FIND OUT HOW THIS IS SCALED!!!! inNewCloud[j] = false; } } } printf("break 3\n"); cloud_out.points.resize(0); for (int n = 0; n < cloud_in.points.size(); n++) { if (inNewCloud[n]) { cloud_out.points.push_back(cloud_in.points[n]); } } printf("break 4\n"); } //--------------------- EXTERNAL API --------------------// SceneHypothesis *detect_models(sensor_msgs::PointCloud2 &msg, string target_frame, vector<geometry_msgs::Polygon> surface_polygons, tf::TransformListener *tf_listener, double table_filter_thresh, ModelManager *model_manager, std::vector<string> models, ros::Publisher &debug_pub) //dbug { // get the cloud in PCL format in the right coordinate frame PointCloudXYZ cloud, cloud2, full_cloud; pcl::fromROSMsg(msg, cloud); if (!pcl_ros::transformPointCloud(target_frame, cloud, cloud2, *tf_listener)) { ROS_WARN("Can't transform point cloud; aborting object detection."); return NULL; } full_cloud = cloud2; // lookup the transform from target frame to sensor tf::StampedTransform tf_transform; Eigen::Affine3f sensor_pose; try { //tf_listener->lookupTransform(msg.header.frame_id, target_frame, msg.header.stamp, tf_transform); tf_listener->lookupTransform(target_frame, msg.header.frame_id, msg.header.stamp, tf_transform); transformTFToEigen(tf_transform, sensor_pose); } catch (tf::TransformException& ex) { ROS_WARN("[point_cloud_callback] TF exception:\n%s", ex.what()); return NULL; } //pcl::RangeImage full_range_image; //pcl::RangeImage::CoordinateFrame frame = pcl::RangeImage::CAMERA_FRAME; //full_range_image.createFromPointCloud(full_cloud, .2*M_PI/180, 2*M_PI, M_PI, sensor_pose, frame, 0, 0, 0); //ROS_INFO("Got PointCloud2 msg with %lu points\n", cloud2.points.size()); //if (!have_table) // return NULL; // find horizontal planes using normals, and sort by height vector<geometry_msgs::Polygon> shelves = find_horizontal_surfaces(surface_polygons); // remove points near vertical planes vector<geometry_msgs::Polygon> walls = find_nonhorizontal_surfaces(surface_polygons); remove_plane_points(walls, full_cloud, cloud2); full_cloud = cloud2; SceneHypothesis *detected_objects = new SceneHypothesis(); // loop over flat surfaces, removing everything above the next shelf for (int i = 0; i < shelves.size(); i++) { // filter out points outside of the attention area, and only keep points above the table //ROS_INFO("Have table, filtering points on table..."); //polygon_filter(table_polygon, cloud2, cloud); ROS_INFO("Found flat surface, filtering points on shelf..."); polygon_filter(shelves[i], full_cloud, cloud); if (cloud.points.size() < 100) { ROS_WARN("Not enough points in table region; aborting object detection."); //return NULL; continue; } float table_height = adjust_table_height(cloud, shelves[i].points[0].z); printf("shelf_height = %.3f, table_height = %.3f\n", shelves[i].points[0].z, table_height); // remove everything above and below current shelf pcl::PassThrough<pcl::PointXYZ> pass; pass.setInputCloud(cloud.makeShared()); pass.setFilterFieldName("z"); double min_z = table_height + table_filter_thresh; double max_z = (i+1 < shelves.size() ? shelves[i+1].points[0].z - 2*table_filter_thresh : 1000.0); pass.setFilterLimits(min_z, max_z); pass.filter(cloud2); ROS_INFO("Removed shelves."); //dbug if (i==0) { sensor_msgs::PointCloud2 dbug_msg; pcl::toROSMsg(cloud2, dbug_msg); dbug_msg.header = msg.header; dbug_msg.header.frame_id = target_frame; debug_pub.publish(dbug_msg); } if (cloud2.points.size() < 100) { ROS_WARN("Not enough points above table; aborting object detection."); //return NULL; continue; } ROS_INFO("Downsampling point cloud with %lu points", cloud2.points.size()); pcl::VoxelGrid<pcl::PointXYZ> grid; //grid.setFilterFieldName ("z"); grid.setLeafSize (0.006, 0.006, 0.006); //grid.setFilterLimits (0.4, 1.1); //assuming there might be very low and very high tables grid.setInputCloud(cloud2.makeShared()); grid.filter(cloud); ROS_INFO("Clustering remaining %lu points", cloud.points.size()); // cluster groups of points (in the XY plane?) //flatten_point_cloud(cloud, cloud2); //dbug pcl::EuclideanClusterExtraction<pcl::PointXYZ> cluster; //KdTreeXYZ::Ptr clusters_tree = boost::make_shared< pcl::KdTreeFLANN<pcl::PointXYZ> > (); pcl::search::KdTree<pcl::PointXYZ>::Ptr clusters_tree (new pcl::search::KdTree<pcl::PointXYZ> ()); clusters_tree->setEpsilon (.0001); cluster.setClusterTolerance (0.02); cluster.setMinClusterSize (100); cluster.setSearchMethod (clusters_tree); vector<pcl::PointIndices> cluster_indices; cluster.setInputCloud (cloud.makeShared()); //cloud2 cluster.extract(cluster_indices); ROS_INFO("Found %lu clusters.", cluster_indices.size()); for (size_t i = 0; i < cluster_indices.size(); i++) { PointCloudXYZ cluster; pcl::copyPointCloud (cloud, cluster_indices[i], cluster); // compute cluster centroid Vector4f centroid; pcl::compute3DCentroid(cluster, centroid); geometry_msgs::Pose init_pose; init_pose.position.x = centroid(0); init_pose.position.y = centroid(1); init_pose.position.z = centroid(2); ROS_INFO("Cluster has %lu points with centroid (%.2f, %.2f, %.2f)\n", cluster.points.size(), centroid(0), centroid(1), centroid(2)); // create range image for point cluster pcl::RangeImage range_image0; pcl::RangeImage::CoordinateFrame frame = pcl::RangeImage::CAMERA_FRAME; range_image0.createFromPointCloud(cluster, .2*M_PI/180, 2*M_PI, M_PI, sensor_pose, frame, 0, 0, 0); //range_image0.createFromPointCloud(cluster, .3*M_PI/180, 2*M_PI, M_PI, sensor_pose, frame, 0, 0, 0); // dilate range image pcl::RangeImage range_image; cardboard::dilate_range_image(range_image0, range_image); // add background points from full point cloud to cluster range image for (size_t j = 0; j < cloud.points.size(); j++) { Vector3f p(cloud.points[j].x, cloud.points[j].y, cloud.points[j].z); int xi, yi; float r; range_image.getImagePoint(p, xi, yi, r); if (range_image.isInImage(xi, yi) && isinf(r)) range_image.getPoint(xi,yi).range = INFINITY; } // compute cluster normals // PointCloudXYZN cluster_normals; // cardboard::compute_normals(cluster, cluster_normals, .03); // compute range image with normals // pcl::RangeImage range_image_normals; // cardboard::compute_range_image_normals(range_image, cluster_normals, range_image_normals); // fit an object model to the cluster cardboard::RangeImageTester T1(range_image); cardboard::PointCloudDistanceTester T2(cluster); // cardboard::RangeImageNormalTester T3(range_image_normals); cardboard::CompositeTester model_tester(&T1,&T2);//,&T3); cardboard::ObjectHypothesis obj = fit_object(*model_manager, &model_tester, init_pose, table_height, tf_listener, models); T1.testHypothesis(model_manager->get_model(obj.name), cardboard::pose_to_affine_matrix(obj.pose), true); //if (obj.fitness_score < 1.6) // 1.6 sigma (less that 5% false negative) detected_objects->objects.push_back(obj); //else { //ROS_INFO("Current object is unidentifiable"); // compute PolygonMesh from cluster, add it to junk // Normal estimation* // Normal estimation* // pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (cluster); // pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> n; // pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal>); // pcl::KdTreeFLANN<pcl::PointXYZ>::Ptr tree (new pcl::KdTreeFLANN<pcl::PointXYZ>); // tree->setInputCloud (cloud); // n.setInputCloud (cloud); // n.setSearchMethod (tree); // n.setKSearch (20); // n.compute (*normals); //* normals should not contain the point normals + surface curvatures // Concatenate the XYZ and normal fields* // pcl::PointCloud<pcl::PointNormal>::Ptr cloud_with_normals (new pcl::PointCloud<pcl::PointNormal>); // pcl::concatenateFields (*cloud, *normals, *cloud_with_normals); // //* cloud_with_normals = cloud + normals // // Create search tree* // pcl::KdTreeFLANN<pcl::PointNormal>::Ptr tree2 (new pcl::KdTreeFLANN<pcl::PointNormal>); // tree2->setInputCloud (cloud_with_normals); // Initialize objects // pcl::GreedyProjectionTriangulation<pcl::PointNormal> gp3; // pcl::PolygonMesh triangles; // // Set the maximum distance between connected points (maximum edge length) // gp3.setSearchRadius (0.025); // // Set typical values for the parameters // gp3.setMu (2.5); // gp3.setMaximumNearestNeighbors (100); // gp3.setMaximumSurfaceAngle(M_PI/4); // 45 degrees // gp3.setMinimumAngle(M_PI/18); // 10 degrees // gp3.setMaximumAngle(2*M_PI/3); // 120 degrees // gp3.setNormalConsistency(false); // Get result // gp3.setInputCloud (cloud_with_normals); // gp3.setSearchMethod (tree2); // gp3.reconstruct (triangles); // cardboard::Unidentifiable junk; // junk.mesh = triangles; // detected_objects->junk.push_back(junk); // } } } detected_objects->header.stamp = msg.header.stamp; detected_objects->header.frame_id = target_frame; //publish_scene_hypothesis(detected_objects, target_frame, msg.header.stamp); return detected_objects; } //-----------------------------------------------------------------------------------------------// ObjectHypothesis fit_object(const ModelManager &model_manager, ModelTester *model_tester, geometry_msgs::Pose init_pose, float table_height, tf::TransformListener *tf_listener, std::vector<string> models) { Matrix4f A0 = pose_to_affine_matrix(init_pose); ObjectHypothesis fit_model; // try fitting each model to the point cloud at several orientations fit_model.fitness_score = std::numeric_limits<float>::max(); //--- Create vector housing orientation rotations ----// std::vector<Quaternionf> orientations; orientations.push_back(Quaternionf(1,0,0,0)); orientations.push_back(Quaternionf(sqrt(2)/2,sqrt(2)/2,0,0)); orientations.push_back(Quaternionf(sqrt(2)/2, -1*sqrt(2)/2,0,0)); orientations.push_back(Quaternionf(0,1,0,0)); orientations.push_back(Quaternionf(sqrt(2)/2,0,sqrt(2)/2,0)); orientations.push_back(Quaternionf(sqrt(2)/2,0,-1*sqrt(2)/2,0)); for (uint i = 0; i < model_manager.models.size(); i++) { bool include_model = false; if (models.size() == 0) include_model = true; else { for (uint j = 0; j < models.size(); j++) { if (models[j].compare(model_manager.models[i].name) == 0) { include_model = true; break; } } } if (!include_model) continue; float min_score = std::numeric_limits<float>::max(); double t1, t2; t1 = get_time_ms(); // change to loop through 6 orientation Quaternions # pragma omp parallel for for (uint j = 0; j < orientations.size(); j++) { //dbug // rotate model onto a face of its convex hull Quaternionf q1 = orientations[j]; Vector3f t = Vector3f::Zero(); Matrix4f A_face = pose_to_affine_matrix(t, q1); # pragma omp parallel for for (uint k = 0 /*cnt*/; k < 5; k++) { //dbug // rotate model incrementally about the z-axis double a = 2*M_PI*(k/5.0); //dbug Quaternionf q2 = Quaternionf(cos(a/2), 0, 0, sin(a/2)); Matrix4f A_zrot = pose_to_affine_matrix(t, q2); Matrix4f A = A0 * A_zrot * A_face; pcl::PointCloud<pcl::PointXYZ> obj; pcl::transformPointCloud(model_manager.models[i].cloud, obj, A); // make sure bottom of model is touching table Vector4f pmin, pmax; pcl::getMinMax3D(obj, pmin, pmax); Matrix4f A_gravity = Matrix4f::Identity(); A_gravity(2,3) = table_height - pmin(2); pcl::transformPointCloud(obj, obj, A_gravity); A = A_gravity * A; // fit rotated model to range image ModelPoseOptimizer opt(model_tester, model_manager.models[i]); opt.setMaxIterations(200); Matrix4f A2 = opt.optimizeAffine(A); float score = opt.getFinalCost(); printf("."); fflush(0); # pragma omp critical { if (score < fit_model.fitness_score) { fit_model.fitness_score = score; fit_model.name = model_manager.models[i].name; fit_model.pose = affine_matrix_to_pose(A2); // * A } if (score < min_score) min_score = score; } } } t2 = get_time_ms(); printf("finished j loop in %.2f ms (min_score = %.4f)\n", t2-t1, min_score); } cout << "Best fit: obj = " << fit_model.name << ", score = " << fit_model.fitness_score << endl; //cout << fit_model.pose << endl; // print component scores const Model &best_model = model_manager.get_model(fit_model.name); if (best_model.name.size() != 0) { printf("component scores: [ "); CompositeTester *CT = (CompositeTester *)model_tester; for (uint i = 0; i < CT->testers.size(); i++) { float score = CT->testers[i]->testHypothesis(best_model, pose_to_affine_matrix(fit_model.pose)); printf("%.4f ", CT->weights[i] * score); } printf("]\n"); } return fit_model; } //----------------------- Alignment ----------------------// SceneHypothesis *align_models(sensor_msgs::PointCloud2 &msg, string target_frame, vector<geometry_msgs::Polygon> surface_polygons, std::vector<geometry_msgs::Pose> initial_poses, std::vector<string> models, tf::TransformListener *tf_listener, double table_filter_thresh, ModelManager *model_manager) { // get the cloud in PCL format in the right coordinate frame PointCloudXYZ cloud, cloud2, full_cloud; pcl::fromROSMsg(msg, cloud); if (!pcl_ros::transformPointCloud(target_frame, cloud, cloud2, *tf_listener)) { ROS_WARN("Can't transform point cloud; aborting object detection."); return NULL; } full_cloud = cloud2; // lookup the transform from target frame to sensor tf::StampedTransform tf_transform; Eigen::Affine3f sensor_pose; try { //tf_listener->lookupTransform(msg.header.frame_id, target_frame, msg.header.stamp, tf_transform); tf_listener->lookupTransform(target_frame, msg.header.frame_id, msg.header.stamp, tf_transform); transformTFToEigen(tf_transform, sensor_pose); } catch (tf::TransformException& ex) { ROS_WARN("[point_cloud_callback] TF exception:\n%s", ex.what()); return NULL; } //pcl::RangeImage full_range_image; //pcl::RangeImage::CoordinateFrame frame = pcl::RangeImage::CAMERA_FRAME; //full_range_image.createFromPointCloud(full_cloud, .2*M_PI/180, 2*M_PI, M_PI, sensor_pose, frame, 0, 0, 0); //ROS_INFO("Got PointCloud2 msg with %lu points\n", cloud2.points.size()); //if (!have_table) // return NULL; // filter out points outside of the attention area, and only keep points above the tabl e ROS_INFO("Have table, filtering points on table..."); polygon_filter(surface_polygons[0], cloud2, cloud); if (cloud.points.size() < 100) { ROS_WARN("Not enough points in table region; aborting object detection."); return NULL; } pcl::PassThrough<pcl::PointXYZ> pass; pass.setInputCloud(cloud.makeShared()); pass.setFilterFieldName("z"); //float table_height = table_polygon.points[0].z; float table_height = adjust_table_height(cloud, surface_polygons[0].points[0].z); pass.setFilterLimits(table_height + table_filter_thresh, 1000.); pass.filter(cloud2); ROS_INFO("Done filtering table."); if (cloud2.points.size() < 100) { ROS_WARN("Not enough points above table; aborting object detection."); return NULL; } ROS_INFO("Downsampling point cloud with %lu points", cloud2.points.size()); pcl::VoxelGrid<pcl::PointXYZ> grid; //grid.setFilterFieldName ("z"); grid.setLeafSize (0.006, 0.006, 0.006); //grid.setFilterLimits (0.4, 1.1); //assuming there might be very low and very high tables grid.setInputCloud(cloud2.makeShared()); grid.filter(cloud); ROS_INFO("Clustering remaining %lu points", cloud.points.size()); // cluster groups of points (in the XY plane?) //flatten_point_cloud(cloud, cloud2); //dbug pcl::EuclideanClusterExtraction<pcl::PointXYZ> cluster; //KdTreeXYZ::Ptr clusters_tree = boost::make_shared< pcl::KdTreeFLANN<pcl::PointXYZ> > (); pcl::search::KdTree<pcl::PointXYZ>::Ptr clusters_tree (new pcl::search::KdTree<pcl::PointXYZ> ()); clusters_tree->setEpsilon (.0001); cluster.setClusterTolerance (0.02); cluster.setMinClusterSize (100); cluster.setSearchMethod (clusters_tree); vector<pcl::PointIndices> cluster_indices; cluster.setInputCloud (cloud.makeShared()); //cloud2 cluster.extract(cluster_indices); ROS_INFO("Found %lu clusters.", cluster_indices.size()); // for each cluster, try to fit an object model SceneHypothesis *detected_objects = new SceneHypothesis(); // store point-clusters and accompanying clouds vector<geometry_msgs::Pose> clusterPoses; vector<PointCloudXYZ> clusterClouds; for (size_t i = 0; i < cluster_indices.size(); i++) { PointCloudXYZ cluster; pcl::copyPointCloud (cloud, cluster_indices[i], cluster); // compute cluster centroid Vector4f centroid; pcl::compute3DCentroid(cluster, centroid); geometry_msgs::Pose init_pose; init_pose.position.x = centroid(0); init_pose.position.y = centroid(1); init_pose.position.z = centroid(2); clusterPoses.push_back(init_pose); clusterClouds.push_back(cluster); } // for each initial pose, find closest point-cluster for (uint i = 0; i < initial_poses.size(); i++){ int poseIndex = findClosestPoseIndex(initial_poses[i], clusterPoses); geometry_msgs::Pose clusterPose = clusterPoses[poseIndex]; PointCloudXYZ cluster = clusterClouds[poseIndex]; // create range image for point cluster pcl::RangeImage range_image0; pcl::RangeImage::CoordinateFrame frame = pcl::RangeImage::CAMERA_FRAME; range_image0.createFromPointCloud(cluster, .2*M_PI/180, 2*M_PI, M_PI, sensor_pose, frame, 0, 0, 0); // dilate range image pcl::RangeImage range_image; cardboard::dilate_range_image(range_image0, range_image); // add background points from full point cloud to cluster range image for (size_t j = 0; j < cloud.points.size(); j++) { Vector3f p(cloud.points[j].x, cloud.points[j].y, cloud.points[j].z); int xi, yi; float r; range_image.getImagePoint(p, xi, yi, r); if (range_image.isInImage(xi, yi) && isinf(r)) range_image.getPoint(xi,yi).range = INFINITY; } // do one alignment for each cluster cardboard::RangeImageTester T1(range_image); cardboard::PointCloudDistanceTester T2(cluster); //cardboard::RangeImageNormalTester T3(range_image_normals); cardboard::CompositeTester model_tester(&T1,&T2); //,&T3); cardboard::ObjectHypothesis obj = align_object(*model_manager, &model_tester, initial_poses[i], table_height, models[i]); T1.testHypothesis(model_manager->get_model(models[i]), cardboard::pose_to_affine_matrix(initial_poses[i]), true); //if (obj.fitness_score < 1.6) // 1.6 sigma (less that 5% false negative) detected_objects->objects.push_back(obj); } detected_objects->header.stamp = msg.header.stamp; detected_objects->header.frame_id = target_frame; //publish_scene_hypothesis(detected_objects, target_frame, msg.header.stamp); return detected_objects; } //-----------------------------------------------------------------------------------------------// ObjectHypothesis align_object(const ModelManager &model_manager, ModelTester *model_tester, geometry_msgs::Pose init_pose, float table_height, string modelName) { Matrix4f A0 = pose_to_affine_matrix(init_pose); ObjectHypothesis fit_model; fit_model.fitness_score = std::numeric_limits<float>::max(); float min_score = std::numeric_limits<float>::max(); double t1, t2; Vector3f t = Vector3f::Zero(); t1 = get_time_ms(); for (uint k = 0 /*cnt*/; k < 5; k++) { //dbug // rotate model incrementally about the z-axis double a = 2*M_PI*(k/5.0); //dbug Quaternionf q2 = Quaternionf(cos(a/2), 0, 0, sin(a/2)); Matrix4f A_zrot = pose_to_affine_matrix(t, q2); Matrix4f A = A0 * A_zrot; pcl::PointCloud<pcl::PointXYZ> obj; pcl::transformPointCloud(model_manager.get_model(modelName).cloud, obj, A); // make sure bottom of model is touching table Vector4f pmin, pmax; pcl::getMinMax3D(obj, pmin, pmax); Matrix4f A_gravity = Matrix4f::Identity(); A_gravity(2,3) = table_height - pmin(2); pcl::transformPointCloud(obj, obj, A_gravity); A = A_gravity * A; // Do one aligment at the detected pose with the detected model ModelPoseOptimizer opt(model_tester, model_manager.get_model(modelName)); opt.setMaxIterations(200); Matrix4f A2 = opt.optimizeAffine(A); float score = opt.getFinalCost(); printf("."); fflush(0); { if (score < fit_model.fitness_score) { fit_model.fitness_score = score; fit_model.name = modelName; fit_model.pose = affine_matrix_to_pose(A2); // * A } if (score < min_score) min_score = score; } } t2 = get_time_ms(); printf("finished Alignment loop in %.2f ms (min_score = %.4f)\n", t2-t1, min_score); // print component scores const Model &best_model = model_manager.get_model(modelName); if (best_model.name.size() != 0) { printf("component scores: [ "); CompositeTester *CT = (CompositeTester *)model_tester; for (uint i = 0; i < CT->testers.size(); i++) { float score = CT->testers[i]->testHypothesis(best_model, pose_to_affine_matrix(fit_model.pose)); printf("%.4f ", CT->weights[i] * score); } printf("]\n"); } return fit_model; } //--------------------------- DEPRECATED ---------------------------// /* RangeImageOptimizer class (deprecated) * - Optimizes the placement of a point cloud with respect to a range image via gradient descent * class RangeImageOptimizer : public GradientFreeRandomizedGradientOptimizer { private: //MatrixXf eigen_cloud_; //MatrixXf eigen_range_image_; const pcl::RangeImage &range_image_; const pcl::PointCloud<pcl::PointXYZ> &cloud_; const DistanceTransform3D &distance_transform_; // distance transform of the point cloud Matrix4f initial_pose_; //pcl::KdTreeANN<pcl::PointXYZ> kdtree_; Vector3f cloud_centroid_; public: RangeImageOptimizer(const pcl::RangeImage &range_image, const pcl::PointCloud<pcl::PointXYZ> &cloud, const DistanceTransform3D &distance_transform); float evaluate(VectorXf x); VectorXf gradient(VectorXf x); Matrix4f optimizeAffine(const Matrix4f &initial_pose); void setInitialPose(const Matrix4f &initial_pose); Matrix4f x2affine(VectorXf x); }; *****************/ /* RangeImageGridOptimizer class (deprecated) * - Optimizes the placement of a point cloud with respect to a range image via grid search * class RangeImageGridOptimizer : public GridOptimizer { private: RangeImageOptimizer opt_; public: RangeImageGridOptimizer(RangeImageOptimizer opt); ~RangeImageGridOptimizer(); float evaluate(VectorXf x); Matrix4f optimizeAffine(const Matrix4f &initial_pose); }; //dbug //static int grid_cnt = 0; //static int eval_cnt = 0; //static FILE *grid_f = NULL; *****************/ //--------------------- RangeImageOptimizer class deprecated) --------------------// /************************* RangeImageOptimizer::RangeImageOptimizer(const pcl::RangeImage &range_image, const pcl::PointCloud<pcl::PointXYZ> &cloud, const DistanceTransform3D &distance_transform) : GradientFreeRandomizedGradientOptimizer(.07, Vector4f(.004, .004, 0, .03), 3.0), range_image_(range_image), cloud_(cloud), distance_transform_(distance_transform) { } Matrix4f RangeImageOptimizer::x2affine(VectorXf x) { Matrix4f A_shift = Matrix4f::Identity(); // shift to origin A_shift.col(3) << -cloud_centroid_, 1; Vector3f t = cloud_centroid_ + x.topRows(3); float theta = x(3); Quaternionf q(cos(theta/2.0), 0, 0, sin(theta/2.0)); Matrix4f A = pose_to_affine_matrix(t, q); // rotate, then unshift and translate by x(0:2) return A * A_shift * initial_pose_; } float RangeImageOptimizer::evaluate(VectorXf x) { Matrix4f A = x2affine(x); Matrix4f A_inv = A.inverse(); pcl::PointCloud<pcl::PointXYZ> cloud2; pcl::transformPointCloud(cloud_, cloud2, A); pcl::RangeImage range_image2; pcl::transformPointCloud(range_image_, range_image2, A_inv); float f_neg = 1500*range_image_fitness(range_image_, cloud2); // negative information float f_pos = 5000*range_cloud_fitness(distance_transform_, range_image2); // positive information return f_pos + f_neg; } VectorXf RangeImageOptimizer::gradient(VectorXf x) { VectorXf dfdx = VectorXf::Zero(4); float dt = .005; float da = .05; float f = evaluate(x); for (int i = 0; i < 2; i++) { VectorXf x2 = x; x2(i) += dt; dfdx(i) = (evaluate(x2) - f) / dt; } VectorXf x2 = x; x2(3) += da; dfdx(3) = (evaluate(x2) - f) / dt; return dfdx; } Matrix4f RangeImageOptimizer::optimizeAffine(const Matrix4f &initial_pose) { setInitialPose(initial_pose); VectorXf x0 = VectorXf::Zero(4); VectorXf x = optimize(x0); return x2affine(x); } void RangeImageOptimizer::setInitialPose(const Matrix4f &initial_pose) { initial_pose_ = initial_pose; pcl::PointCloud<pcl::PointXYZ> cloud2; pcl::transformPointCloud(cloud_, cloud2, initial_pose); Vector4f centroid; pcl::compute3DCentroid(cloud2, centroid); cloud_centroid_ = centroid.topRows(3); } ***********************/ //--------------------- RangeImageGridOptimizer class (deprecated) --------------------// /********************** RangeImageGridOptimizer::RangeImageGridOptimizer(RangeImageOptimizer opt) : opt_(opt) { } RangeImageGridOptimizer::~RangeImageGridOptimizer() { } float RangeImageGridOptimizer::evaluate(VectorXf x) { float score = opt_.evaluate(x); fprintf(grid_f, "%.6f ", score); //dbug return score; } Matrix4f RangeImageGridOptimizer::optimizeAffine(const Matrix4f &initial_pose) { opt_.setInitialPose(initial_pose); //dbug char fname[100]; sprintf(fname, "out%d.m", grid_cnt); grid_f = fopen(fname, "w"); grid_cnt++; //eval_cnt = 0; fprintf(grid_f, "F = ["); VectorXf x = GridOptimizer::optimize(); //dbug fprintf(grid_f, "];\n"); fprintf(grid_f, "F = F(1:end-1);\n"); fprintf(grid_f, "F_dims = ["); for (int i = 0; i < x.size(); i++) fprintf(grid_f, "%d ", 1 + (int)round((xmax_(i) - xmin_(i)) / resolution_(i))); fprintf(grid_f, "];\n"); fclose(grid_f); return opt_.x2affine(x); } ************************/ /***** deprecated ***** TrackedObject fit_object_to_range_image(const pcl::RangeImage &range_image_in, geometry_msgs::Pose init_pose, float table_height) { // dilate range image pcl::RangeImage range_image = range_image_in; //dilate_range_image(range_image_in, range_image); //static uint cnt = 9; Matrix4f A0 = pose_to_affine_matrix(init_pose); ROS_INFO("fit_object_to_range_image()"); //ROS_INFO("Initial Pose:"); //cout << A0 << endl; if (!modelManager.loaded_models) modelManager.load_models(); TrackedObject fit_model; // try fitting each model to the point cloud at several orientations double min_score = std::numeric_limits<double>::max(); for (uint i = 0; i < modelManager.model_clouds.size(); i++) { //dbug double t1, t2; t1 = get_time_ms(); # pragma omp parallel for for (uint j = 0; j < modelManager.model_orientations[i].size(); j++) { //dbug //printf("[i = %u, j = %u]\n", i, j); // rotate model onto a face of its convex hull Quaternionf q1 = modelManager.model_orientations[i][j]; Vector3f t = Vector3f::Zero(); Matrix4f A_face = pose_to_affine_matrix(t, q1); # pragma omp parallel for for (uint k = 0 ; k < 5; k++) { //dbug // rotate model incrementally about the z-axis double a = 2*M_PI*(k/5.0); //dbug Quaternionf q2 = Quaternionf(cos(a/2), 0, 0, sin(a/2)); Matrix4f A_zrot = pose_to_affine_matrix(t, q2); Matrix4f A = A0 * A_zrot * A_face; pcl::PointCloud<pcl::PointXYZ> obj; pcl::transformPointCloud(modelManager.model_clouds[i], obj, A); // make sure bottom of model is touching table Vector4f pmin, pmax; pcl::getMinMax3D(obj, pmin, pmax); Matrix4f A_gravity = Matrix4f::Identity(); A_gravity(2,3) = table_height - pmin(2); pcl::transformPointCloud(obj, obj, A_gravity); A = A_gravity * A; // fit rotated model to range image double score = range_image_fitness(range_image, obj); RangeImageOptimizer opt(range_image, modelManager.model_clouds[i], modelManager.model_distance_transforms[i]); opt.setMaxIterations(200); //50 //RangeImageGridOptimizer optimizer(opt); //VectorXf res(4), xmin(4), xmax(4); //res << .004, .004, 1, (M_PI/100.0); //xmin << -.04, -.04, 0, -M_PI/10.0; //xmax << .0401, .0401, 0, (M_PI/10.0 + .0001); //optimizer.setResolution(res); //optimizer.setBounds(xmin, xmax); Matrix4f A2 = opt.optimizeAffine(A); //optimizer.optimizeAffine(A); score = opt.getFinalCost(); //optimizer.getFinalCost(); printf("."); fflush(0); # pragma omp critical { if (score < min_score) { //printf("min_score = %.6f\n", score); min_score = score; fit_model.name = modelManager.object_names[i]; fit_model.pose = affine_matrix_to_pose(A2); // * A } //else // printf("score = %.6f\n", score); } } } t2 = get_time_ms(); printf("finished j loop in %.2f ms\n", t2-t1); } cout << "Best fit: obj = " << fit_model.name << ", score = " << min_score << endl; cout << fit_model.pose << endl; return fit_model; } ****************/ } // end of namespace cardboard
[ "aanders@mit.edu" ]
aanders@mit.edu
4a312195b81e4816da41cfe7c123815c4f5cef91
92572e01e7728aeed7d5d11cbbb2c1a7039cd0cc
/worker.h
675570eaf8674da06bb82cd78f97eb121f1de40f
[]
no_license
Dongzhixiao/C-_study_onQT
21a9084768f1b55454f64ba5fede048be9e98d28
c7eeabe52e6bb89e0759ff607185479d9c50ee65
refs/heads/master
2020-04-15T14:04:33.251665
2019-03-07T13:20:28
2019-03-07T13:20:28
56,897,477
17
26
null
null
null
null
UTF-8
C++
false
false
1,824
h
//目录遍历工作线程:采用“线程+工人+事件”模式! #ifndef WORKER_H #define WORKER_H #include <QThread> #include <QEvent> #include <QPointer> #include <QList> /* NOTES: * 1. the caller MUST maintain Runnable's life cycle * 2. the derived class MUST offer a QObject instance * to receive RunnableExcutedEvent */ class Runnable { public: Runnable(QObject *observer) : m_observer(observer) {} virtual ~Runnable(){} virtual void run() = 0; virtual bool notifyAfterRun(){ return true; } QPointer<QObject> m_observer; }; /*为什么我需要使用事件,而不是使用信号槽呢?主要原因是,事件的分发既可以是同步的,又可以是异步的,而函数的调用或者说是槽的回调总是同步的。 * 事件的另外一个好处是,它可以使用过滤器。 */ class RunnableExcutedEvent : public QEvent { public: RunnableExcutedEvent(Runnable *r); Runnable *m_runnable; static QEvent::Type evType(); private: static QEvent::Type s_evType; }; class WorkerThread : public QThread //工作线程接受具有Runnable接口的对象,执行完后反馈RunnableExcutedEvent给Runnable携带的观察者 { public: WorkerThread(QObject *parent = 0); ~WorkerThread(); void postRunnable(Runnable *r); //用于提交待执行任务,具体任务由Worker类负责执行 protected: void run(); private: QPointer<QObject> m_worker; QList<Runnable*> *m_runnables; //temp queue }; class Worker : public QObject { friend class WorkerThread; public: Worker() : m_runnables(0) {} ~Worker(); bool event(QEvent *e); private: void excuteQueuedRunnables(); void excuteRunnable(Runnable *runnable); private: QList<Runnable*> *m_runnables; }; #endif // WORKER_H
[ "dongzhixiaodong@gmail.com" ]
dongzhixiaodong@gmail.com
20e21710044ce3a9b34c3043af476ff70554c460
fedfd83c0762e084235bf5562d46f0959b318b6f
/L4 信息学奥赛一本通/0. 程序部分/ch05/第01节 一维数组/1114.cpp
827c23bb3564d1eb1395a985fbf9a3fbd3034f49
[]
no_license
mac8088/noip
7843b68b6eeee6b45ccfb777c3e389e56b188549
61ee051d3aff55b3767d0f2f7d5cc1e1c8d3cf20
refs/heads/master
2021-08-17T21:25:37.951477
2020-08-14T02:03:50
2020-08-14T02:03:50
214,208,724
6
0
null
null
null
null
UTF-8
C++
false
false
613
cpp
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { double a[1001], b[1001] = {0.0}, max = -1000000.0, min = -max, sum=0.0, avg = 0.0, wc = max; int n; cin >> n; for(int i=0; i<n; ++i) { scanf("%lf", &a[i]); sum+=a[i]; if(a[i] > max) max = a[i]; if(a[i] < min) min = a[i]; } sum -= (max + min); avg = sum/((n-2)*1.0); //cacl each of tolerance for(int i=0; i<n; ++i) if(a[i] != max && a[i] != min) b[i] = abs(avg - a[i]); //compare and get the max differ for(int i=0; i<n; ++i) if(b[i] > wc) wc = b[i]; printf("%.2lf %.2lf", avg, wc); return 0; }
[ "chun.ma@atos.net" ]
chun.ma@atos.net
67e861897260c5abe68bd75fcab2208919cefdb7
7763ebabad16e792d41ba2753a9746bf7496a26e
/cocos2D/Game_LockPuzzle/Source/Game/GamePlay/UnitManager.h
4d41f24672ff63900c589d0943fdbad4702aeebc
[]
no_license
flowerfx/ColorLockPuzzle
a4dc1ebf4ccfce74da5bb1f4472c71d2182351bc
2e17e6305a437a1e1c76093d82f63703ecfa3def
refs/heads/master
2021-01-10T23:31:44.419176
2020-05-06T14:04:09
2020-05-06T14:04:09
69,724,573
1
1
null
null
null
null
UTF-8
C++
false
false
7,573
h
#ifndef __UINIT_MANAGER_H__ #define __UINIT_MANAGER_H__ #include "ControllableUnit.h" #include "cocos2d.h" using namespace cocos2d; using namespace RKUtils; //#define USE_RANDOM_LEVEL //#define RECORRECT_HINT enum STATE_GAME { STATE_NONE = 0, STATE_MOVE, STATE_NEXT_STEP, STATE_FINISH, STATE_FAILED, STATE_COUNT }; struct UIDecVisible { RKString name_ui; RKString name_resource; bool IsVisible; public: UIDecVisible() { name_ui = ""; name_resource = ""; IsVisible = true; } }; struct DecGameMode { std::vector<UIDecVisible*> ui_dec; std::map<RKString,xml::BasicDec *> p_GamePlay_Item_; int time_init_each_mode; public: DecGameMode() { ui_dec.clear(); p_GamePlay_Item_.clear(); time_init_each_mode = 0; } virtual ~DecGameMode() { ui_dec.clear(); p_GamePlay_Item_.clear(); } xml::BasicDec * GetGamePlayItemByName(RKString name) { if (p_GamePlay_Item_.size() > 0 && p_GamePlay_Item_.find(name) != p_GamePlay_Item_.end()) return p_GamePlay_Item_.at(name); return 0; } int GetTimeInit() { return time_init_each_mode; } }; struct HLLink : public BasicUnit { Vec2 IdxObjectContain; int number_count; public: HLLink() { IdxObjectContain = Vec2(0, 0); number_count = 0; } virtual ~HLLink() { IdxObjectContain = Vec2(0, 0); number_count = 0; } }; struct GameLevelDec { bool move_diagonally; std::vector<std::vector<int>> value; std::vector<int> hint; std::map<int, int> index_have_lock; int number_move_diagonnally; int number_start_random; Vec2 range_random_number; bool Is_level_for_creation; int getValueAt(int i, int j) { if ((unsigned int)j >= value.size()) { PASSERT2(false, "out of stack !"); return 0; } auto line = value.at(j); if ((unsigned int)i >= line.size()) { PASSERT2(false, "out of stack !"); return 0; } return line.at(i); } void SetValueAt(int i, int j, int value_i) { if ((unsigned int)j >= value.size()) { PASSERT2(false, "out of stack !"); return ; } auto line = value.at(j); if ((unsigned int)i >= line.size()) { PASSERT2(false, "out of stack !"); return ; } line.erase(line.begin() + i); line.insert(line.begin() + i, value_i); } GameLevelDec() { move_diagonally = false; value.clear(); hint.clear(); index_have_lock.clear(); number_move_diagonnally = -2; number_start_random = 0; Is_level_for_creation = false; } virtual ~GameLevelDec() { move_diagonally = false; value.clear(); hint.clear(); index_have_lock.clear(); number_move_diagonnally = -2; number_start_random = 0; Is_level_for_creation = false; } }; class UnitManager { private: //for the hint BasicUnit * p_hand_hint; BasicUnit * p_mini_circle_hint; //vari contain the control unit of game Vector<ControllableUnit* > p_ListControllableObject; //vari contain line object link unit of game Vector<HLLink* > p_listObjectLinkHL; //vari of the text notice of AP Vector<BasicUnit* > p_listFlyTextNotice; //list color object highlight as stack std::vector<Color4B> p_color_hight_light; //list of index of controlled object under hightlight std::vector<int> p_List_current_idx_link; //check the index of object as same as the given result int * p_currentStateIdxLink; //nothing int p_current_index_object_controll; //size width and height of object ex: 4x4 or 5x5 Vec2 p_size_list_controllable_object; //list of index of controlled object have lock inside RKList<int> p_current_number_object_have_lock; //nothing std::map<RKString, xml::BasicDec *> p_gameplay_dec; //use to show hint bool p_IsUseHintShow; //state move/finish/failed of game STATE_GAME p_current_state_game; //use diagonally move bool p_diagonally_move; int p_current_move_diagonally_remain; int p_number_move_dia; unsigned int p_number_failed; int InsertIdxLink(int idx); bool IsTheIdxNearThePreviousIdx(int idx); // use the 8 square void RemoveTheAfterIdxLink(int idx); Vec2 CotainIdx(int idx); // Vec2(x,y) x is idx , y number of idx bool p_IsLevelCreation; int p_count_move_diagonally; //for the effect zoom to pause btn int p_current_node_have_effect; bool is_zoom_effect; protected: //control function void PerformLinkObjectTogether(); HLLink* GenerateObjectLink(ControllableUnit* a, ControllableUnit* b); void OnProcessNextLevel(int current_number); int InitStepLock(int& chance_each); //return number_lock void GenStepLock(int& chance_each , int& number_ins,Vec2 step_range, xml::BasicDec* _basic_dec); #if defined USE_RANDOM_LEVEL public: static void GenRandomLevel(GameLevelDec * level); static Vec2 GetDirectMove(int t); #else Vec2 GetDirectMove(int t); void GenRandomLevel(GameLevelDec * level); #endif public: UnitManager(); ~UnitManager(); bool InitAllObjectWithParam(GameLevelDec * game_mode_level); void DrawAllObject(Renderer *renderer, const Mat4& transform, uint32_t flags); void VisitAllObject(Renderer *renderer, const Mat4& transform, uint32_t flags); void UpdateAllObject(float dt); Vec2 GetSizeListObject() { return p_size_list_controllable_object; } void SetSizeListObject(Vec2 val){ p_size_list_controllable_object = val; } Vec2 GetNumberCotainOfObjectAtlocation(int x, int y); //x is number contain, y is the index contain void SetActionForControlObject(RKString name_action); void SetColorHL(Color4B val , int idx) { if (idx >= 0 && p_color_hight_light.size() > 0 && (unsigned int)idx < p_color_hight_light.size()) { p_color_hight_light.erase(p_color_hight_light.begin() + (unsigned int)idx); p_color_hight_light.insert(p_color_hight_light.begin() + (unsigned int)idx, val); } } void InsertColorHL(Color4B val) { p_color_hight_light.push_back(val); } Color4B GetColorHLAtIdx(int idx) { if ((unsigned int)idx >= 0 && p_color_hight_light.size() >0 && (unsigned int)idx < p_color_hight_light.size()) { return p_color_hight_light.at((unsigned int)idx); } return p_color_hight_light.at(0); } void InsertGamePlayDec(RKString str, xml::BasicDec * dec) { p_gameplay_dec.insert(std::pair<RKString, xml::BasicDec*>(str, dec)); } xml::BasicDec * GetGamePlayDec(RKString name) { if (p_gameplay_dec.size() > 0 && p_gameplay_dec.find(name) != p_gameplay_dec.end()) return p_gameplay_dec.at(name); return 0; } ControllableUnit* GetUnitAtIdx(int idx) { if (idx < 0 || idx >= p_ListControllableObject.size()) { return 0; } return p_ListControllableObject.at(idx); } bool IsUseHintShow() { return p_IsUseHintShow; } void IsUseHintShow(bool b) { p_IsUseHintShow = b; } void SetObjectFlyTo(RKString resource, Vec2 pos_from, Vec2 pos_to, int number ,float size = 0.f, Color4B color = Color4B::WHITE, float delay_first = 0.f); void SetTextFlyTime(int addition_time, Vec2 pos_from, float size = 0.f, Color4B color = Color4B::WHITE, float delay_first = 0.f); void SetTextFlyScore(int number, Vec2 pos_from, float size = 0.f, Color4B color = Color4B::WHITE, float delay_first = 0.f); void SetObjFlyFromPos(RKString resource , RKString text, Vec2 pos_from , Vec2 pos_to, RKString tag_name,int number, float size = 0.f, Color4B color = Color4B::WHITE, float delay_first = 0.f); int IsFinishLevel(); STATE_GAME GetCurrentGameState() { return p_current_state_game; } void ResetCurrentGameState() { p_current_state_game = STATE_GAME::STATE_NONE; } void ShowHintWithListIdx(std::vector<int> list); }; #endif //__UINIT_MANAGER_H__
[ "qchien.gl@hotmail.com" ]
qchien.gl@hotmail.com
2e4be86844707b49cab07110da3bafbec98b7f8f
9e1e374a6a497563eaad4e7e8947885c61ecb0b2
/src/scenes/simple_scene.hpp
81863ca0c63500303b756e63e3261bd53f7cc57b
[]
no_license
matthieubulte/georges
2ca92e8d3f8fb10dc59a94d4da6c028dd9e49458
c1a107a8d4853dd346d7147a81f4bf51fd089bcb
refs/heads/master
2023-02-07T23:43:29.291976
2020-12-31T16:22:11
2020-12-31T16:22:11
325,816,680
0
1
null
2020-12-31T16:07:09
2020-12-31T14:31:36
C++
UTF-8
C++
false
false
1,899
hpp
#ifndef SIMPLE_SCENE_HPP #define SIMPLE_SCENE_HPP #include "../transformations.hpp" #include "../distances.hpp" #include "scene.hpp" class SimpleScene : public Scene { public: vec2 dist_field(const float t, const vec3& p) const; vecpack<8, 2> dist_field_simd(const float t, const vecpack<8, 3>& p) const; vec3 texture(int texture_id, const vec3& pos) const; vecpack<8, 3> texture_simd(const vec<8>& hit_time, const vec<8>& hit_texture) const; }; vec2 SimpleScene::dist_field(const float t, const vec3& p) const { vec3 q; float d = 10000.0f; // floor d = dist_plane(vec3(0,1,0), 0, p); // sphere q = p - vec3(0.0f, 1.0f, 3.0f); float d2 = dist_sphere(0.5f, q); float ds = smin(d, d2, 0.32); return vec2(ds, 1.0); } vecpack<8, 2> SimpleScene::dist_field_simd(const float t, const vecpack<8, 3>& p) const { vecpack<8, 3> q; vec<8> d, d2, ds; // floor d = dist_plane(vec3(0,1,0), 0, p); // sphere q = p - vec3(0.0f, 1.0f, 3.0f); d2 = dist_sphere(0.5f, q); ds = smin(d, d2, 0.32); vecpack<8, 2> res; res[0] = ds; res[1] = 1.0f; return res; } vec3 SimpleScene::texture(int texture_id, const vec3& pos) const { if (texture_id == 2) { // floor float x = pos[0] >= 0 ? pos[0] : -pos[0] + 0.5; float z = pos[2] >= 0 ? pos[2] : -pos[2] + 0.5; return (fmod(x, 1) < 0.5) == (fmod(z, 1) < 0.5) ? vec3(1,1,1) : vec3(0,0,0); } else if (texture_id == 3) { // block return vec3(51, 255, 189)/255.0f/5.0; } else if (texture_id == 1) { // sphere return vec3(255, 189, 51)/255.0f/2.0; } return vec3(0,1,0); } vecpack<8, 3> SimpleScene::texture_simd(const vec<8>& hit_time, const vec<8>& hit_texture) const { vecpack<8, 3> col(vec3(0.5, 0.37, 0.1)); vec<8> col_mask = hit_time >= 0; return col_mask * col; } #endif
[ "matthieu.bulte.06@gmail.com" ]
matthieu.bulte.06@gmail.com
ef71d5da8d5ec09037011191d2b6ac7023424cb3
fbbc663c607c9687452fa3192b02933b9eb3656d
/branches/OpenMPT-1.24/soundlib/Mmcmp.cpp
751833f59f94523a34137322a48f2418749c669f
[ "BSD-3-Clause" ]
permissive
svn2github/OpenMPT
594837f3adcb28ba92a324e51c6172a8c1e8ea9c
a2943f028d334a8751b9f16b0512a5e0b905596a
refs/heads/master
2021-07-10T05:07:18.298407
2019-01-19T10:27:21
2019-01-19T10:27:21
106,434,952
2
1
null
null
null
null
UTF-8
C++
false
false
19,175
cpp
/* * mmcmp.cpp * --------- * Purpose: Handling of compressed modules (MMCMP, XPK, PowerPack PP20) * Notes : (currently none) * Authors: Olivier Lapicque * OpenMPT Devs * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ #include "stdafx.h" #include "Sndfile.h" #include "../common/FileReader.h" #include <stdexcept> OPENMPT_NAMESPACE_BEGIN //#define MMCMP_LOG #ifdef NEEDS_PRAGMA_PACK #pragma pack(push, 1) #endif struct PACKED MMCMPFILEHEADER { char id[8]; // "ziRCONia" uint16 hdrsize; void ConvertEndianness(); }; STATIC_ASSERT(sizeof(MMCMPFILEHEADER) == 10); struct PACKED MMCMPHEADER { uint16 version; uint16 nblocks; uint32 filesize; uint32 blktable; uint8 glb_comp; uint8 fmt_comp; void ConvertEndianness(); }; STATIC_ASSERT(sizeof(MMCMPHEADER) == 14); struct PACKED MMCMPBLOCK { uint32 unpk_size; uint32 pk_size; uint32 xor_chk; uint16 sub_blk; uint16 flags; uint16 tt_entries; uint16 num_bits; void ConvertEndianness(); }; STATIC_ASSERT(sizeof(MMCMPBLOCK) == 20); struct PACKED MMCMPSUBBLOCK { uint32 unpk_pos; uint32 unpk_size; void ConvertEndianness(); }; STATIC_ASSERT(sizeof(MMCMPSUBBLOCK) == 8); #ifdef NEEDS_PRAGMA_PACK #pragma pack(pop) #endif void MMCMPFILEHEADER::ConvertEndianness() //--------------------------------------- { SwapBytesLE(hdrsize); } void MMCMPHEADER::ConvertEndianness() //----------------------------------- { SwapBytesLE(version); SwapBytesLE(nblocks); SwapBytesLE(filesize); SwapBytesLE(blktable); SwapBytesLE(glb_comp); SwapBytesLE(fmt_comp); } void MMCMPBLOCK::ConvertEndianness() //---------------------------------- { SwapBytesLE(unpk_size); SwapBytesLE(pk_size); SwapBytesLE(xor_chk); SwapBytesLE(sub_blk); SwapBytesLE(flags); SwapBytesLE(tt_entries); SwapBytesLE(num_bits); } void MMCMPSUBBLOCK::ConvertEndianness() //------------------------------------- { SwapBytesLE(unpk_pos); SwapBytesLE(unpk_size); } #define MMCMP_COMP 0x0001 #define MMCMP_DELTA 0x0002 #define MMCMP_16BIT 0x0004 #define MMCMP_STEREO 0x0100 #define MMCMP_ABS16 0x0200 #define MMCMP_ENDIAN 0x0400 struct MMCMPBITBUFFER { uint32 bitcount; uint32 bitbuffer; const uint8 *pSrc; const uint8 *pEnd; uint32 GetBits(uint32 nBits); }; uint32 MMCMPBITBUFFER::GetBits(uint32 nBits) //------------------------------------------ { uint32 d; if (!nBits) return 0; while (bitcount < 24) { bitbuffer |= ((pSrc < pEnd) ? *pSrc++ : 0) << bitcount; bitcount += 8; } d = bitbuffer & ((1 << nBits) - 1); bitbuffer >>= nBits; bitcount -= nBits; return d; } static const uint32 MMCMP8BitCommands[8] = { 0x01, 0x03, 0x07, 0x0F, 0x1E, 0x3C, 0x78, 0xF8 }; static const uint32 MMCMP8BitFetch[8] = { 3, 3, 3, 3, 2, 1, 0, 0 }; static const uint32 MMCMP16BitCommands[16] = { 0x01, 0x03, 0x07, 0x0F, 0x1E, 0x3C, 0x78, 0xF0, 0x1F0, 0x3F0, 0x7F0, 0xFF0, 0x1FF0, 0x3FF0, 0x7FF0, 0xFFF0 }; static const uint32 MMCMP16BitFetch[16] = { 4, 4, 4, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static bool MMCMP_IsDstBlockValid(const std::vector<char> &unpackedData, uint32 pos, uint32 len) //---------------------------------------------------------------------------------------------- { if(pos >= unpackedData.size()) return false; if(len > unpackedData.size()) return false; if(len > unpackedData.size() - pos) return false; return true; } static bool MMCMP_IsDstBlockValid(const std::vector<char> &unpackedData, const MMCMPSUBBLOCK &subblk) //--------------------------------------------------------------------------------------------------- { return MMCMP_IsDstBlockValid(unpackedData, subblk.unpk_pos, subblk.unpk_size); } bool UnpackMMCMP(std::vector<char> &unpackedData, FileReader &file) //----------------------------------------------------------------- { file.Rewind(); unpackedData.clear(); MMCMPFILEHEADER mfh; if(!file.ReadConvertEndianness(mfh)) return false; if(std::memcmp(mfh.id, "ziRCONia", 8) != 0) return false; if(mfh.hdrsize != sizeof(MMCMPHEADER)) return false; MMCMPHEADER mmh; if(!file.ReadConvertEndianness(mmh)) return false; if(mmh.nblocks == 0) return false; if(mmh.filesize == 0) return false; if(mmh.filesize > 0x80000000) return false; if(mmh.blktable > file.GetLength()) return false; if(mmh.blktable + 4 * mmh.nblocks > file.GetLength()) return false; unpackedData.resize(mmh.filesize); for (uint32 nBlock=0; nBlock<mmh.nblocks; nBlock++) { if(!file.Seek(mmh.blktable + 4*nBlock)) return false; if(!file.CanRead(4)) return false; uint32 blkPos = file.ReadUint32LE(); if(!file.Seek(blkPos)) return false; MMCMPBLOCK blk; if(!file.ReadConvertEndianness(blk)) return false; std::vector<MMCMPSUBBLOCK> subblks(blk.sub_blk); for(uint32 i=0; i<blk.sub_blk; ++i) { if(!file.ReadConvertEndianness(subblks[i])) return false; } MMCMPSUBBLOCK *psubblk = blk.sub_blk > 0 ? &(subblks[0]) : nullptr; if(blkPos + sizeof(MMCMPBLOCK) + blk.sub_blk * sizeof(MMCMPSUBBLOCK) >= file.GetLength()) return false; uint32 memPos = blkPos + sizeof(MMCMPBLOCK) + blk.sub_blk * sizeof(MMCMPSUBBLOCK); #ifdef MMCMP_LOG Log("block %d: flags=%04X sub_blocks=%d", nBlock, (uint32)pblk->flags, (uint32)pblk->sub_blk); Log(" pksize=%d unpksize=%d", pblk->pk_size, pblk->unpk_size); Log(" tt_entries=%d num_bits=%d\n", pblk->tt_entries, pblk->num_bits); #endif // Data is not packed if (!(blk.flags & MMCMP_COMP)) { for (uint32 i=0; i<blk.sub_blk; i++) { if(!MMCMP_IsDstBlockValid(unpackedData, *psubblk)) return false; #ifdef MMCMP_LOG Log(" Unpacked sub-block %d: offset %d, size=%d\n", i, psubblk->unpk_pos, psubblk->unpk_size); #endif if(!file.Seek(memPos)) return false; if(file.ReadRaw(&(unpackedData[psubblk->unpk_pos]), psubblk->unpk_size) != psubblk->unpk_size) return false; psubblk++; } } else // Data is 16-bit packed if (blk.flags & MMCMP_16BIT) { MMCMPBITBUFFER bb; uint32 subblk = 0; if(!MMCMP_IsDstBlockValid(unpackedData, psubblk[subblk])) return false; char *pDest = &(unpackedData[psubblk[subblk].unpk_pos]); uint32 dwSize = psubblk[subblk].unpk_size >> 1; uint32 dwPos = 0; uint32 numbits = blk.num_bits; uint32 oldval = 0; #ifdef MMCMP_LOG Log(" 16-bit block: pos=%d size=%d ", psubblk->unpk_pos, psubblk->unpk_size); if (pblk->flags & MMCMP_DELTA) Log("DELTA "); if (pblk->flags & MMCMP_ABS16) Log("ABS16 "); Log("\n"); #endif bb.bitcount = 0; bb.bitbuffer = 0; if(!file.Seek(memPos + blk.tt_entries)) return false; if(!file.CanRead(blk.pk_size - blk.tt_entries)) return false; bb.pSrc = reinterpret_cast<const uint8 *>(file.GetRawData()); bb.pEnd = reinterpret_cast<const uint8 *>(file.GetRawData() - blk.tt_entries + blk.pk_size); while (subblk < blk.sub_blk) { uint32 newval = 0x10000; uint32 d = bb.GetBits(numbits+1); if (d >= MMCMP16BitCommands[numbits]) { uint32 nFetch = MMCMP16BitFetch[numbits]; uint32 newbits = bb.GetBits(nFetch) + ((d - MMCMP16BitCommands[numbits]) << nFetch); if (newbits != numbits) { numbits = newbits & 0x0F; } else { if ((d = bb.GetBits(4)) == 0x0F) { if (bb.GetBits(1)) break; newval = 0xFFFF; } else { newval = 0xFFF0 + d; } } } else { newval = d; } if (newval < 0x10000) { newval = (newval & 1) ? (uint32)(-(int32)((newval+1) >> 1)) : (uint32)(newval >> 1); if (blk.flags & MMCMP_DELTA) { newval += oldval; oldval = newval; } else if (!(blk.flags & MMCMP_ABS16)) { newval ^= 0x8000; } pDest[dwPos*2 + 0] = (uint8)(((uint16)newval) & 0xff); pDest[dwPos*2 + 1] = (uint8)(((uint16)newval) >> 8); dwPos++; } if (dwPos >= dwSize) { subblk++; dwPos = 0; if(!(subblk < blk.sub_blk)) break; if(!MMCMP_IsDstBlockValid(unpackedData, psubblk[subblk])) return false; dwSize = psubblk[subblk].unpk_size >> 1; pDest = &(unpackedData[psubblk[subblk].unpk_pos]); } } } else // Data is 8-bit packed { MMCMPBITBUFFER bb; uint32 subblk = 0; if(!MMCMP_IsDstBlockValid(unpackedData, psubblk[subblk])) return false; char *pDest = &(unpackedData[psubblk[subblk].unpk_pos]); uint32 dwSize = psubblk[subblk].unpk_size; uint32 dwPos = 0; uint32 numbits = blk.num_bits; uint32 oldval = 0; if(!file.Seek(memPos)) return false; const uint8 *ptable = reinterpret_cast<const uint8 *>(file.GetRawData()); bb.bitcount = 0; bb.bitbuffer = 0; if(!file.Seek(memPos + blk.tt_entries)) return false; if(!file.CanRead(blk.pk_size - blk.tt_entries)) return false; bb.pSrc = reinterpret_cast<const uint8 *>(file.GetRawData()); bb.pEnd = reinterpret_cast<const uint8 *>(file.GetRawData() - blk.tt_entries + blk.pk_size); while (subblk < blk.sub_blk) { uint32 newval = 0x100; uint32 d = bb.GetBits(numbits+1); if (d >= MMCMP8BitCommands[numbits]) { uint32 nFetch = MMCMP8BitFetch[numbits]; uint32 newbits = bb.GetBits(nFetch) + ((d - MMCMP8BitCommands[numbits]) << nFetch); if (newbits != numbits) { numbits = newbits & 0x07; } else { if ((d = bb.GetBits(3)) == 7) { if (bb.GetBits(1)) break; newval = 0xFF; } else { newval = 0xF8 + d; } } } else { newval = d; } if (newval < 0x100) { int n = ptable[newval]; if (blk.flags & MMCMP_DELTA) { n += oldval; oldval = n; } pDest[dwPos++] = (uint8)n; } if (dwPos >= dwSize) { subblk++; dwPos = 0; if(!(subblk < blk.sub_blk)) break; if(!MMCMP_IsDstBlockValid(unpackedData, psubblk[subblk])) return false; dwSize = psubblk[subblk].unpk_size; pDest = &(unpackedData[psubblk[subblk].unpk_pos]); } } } } return true; } ///////////////////////////////////////////////////////////////////////////// // // XPK unpacker // #ifdef NEEDS_PRAGMA_PACK #pragma pack(push, 1) #endif struct PACKED XPKFILEHEADER { char XPKF[4]; uint32 SrcLen; char SQSH[4]; uint32 DstLen; char Name[16]; uint32 Reserved; void ConvertEndianness(); }; STATIC_ASSERT(sizeof(XPKFILEHEADER) == 36); #ifdef NEEDS_PRAGMA_PACK #pragma pack(pop) #endif void XPKFILEHEADER::ConvertEndianness() //------------------------------------- { SwapBytesBE(SrcLen); SwapBytesBE(DstLen); SwapBytesBE(Reserved); } struct XPK_BufferBounds { const uint8 *pSrcBeg; const uint8 *pSrcEnd; uint8 *pDstBeg; uint8 *pDstEnd; }; struct XPK_error : public std::range_error { XPK_error() : std::range_error("invalid XPK data") { } }; static int32 bfextu(const uint8 *p, int32 bo, int32 bc, XPK_BufferBounds &bufs) //----------------------------------------------------------------------------- { int32 r; p += bo / 8; if(p < bufs.pSrcBeg || p >= bufs.pSrcEnd) throw XPK_error(); r = *(p++); r <<= 8; if(p < bufs.pSrcBeg || p >= bufs.pSrcEnd) throw XPK_error(); r |= *(p++); r <<= 8; r |= *p; r <<= bo % 8; r &= 0xffffff; r >>= 24 - bc; return r; } static int32 bfexts(const uint8 *p, int32 bo, int32 bc, XPK_BufferBounds &bufs) //----------------------------------------------------------------------------- { int32 r; p += bo / 8; if(p < bufs.pSrcBeg || p >= bufs.pSrcEnd) throw XPK_error(); r = *(p++); r <<= 8; if(p < bufs.pSrcBeg || p >= bufs.pSrcEnd) throw XPK_error(); r |= *(p++); r <<= 8; r |= *p; r <<= (bo % 8) + 8; r >>= 32 - bc; return r; } static bool XPK_DoUnpack(const uint8 *src, uint32 srcLen, uint8 *dst, int32 len) //------------------------------------------------------------------------------ { if(len <= 0) return false; static const uint8 xpk_table[] = { 2,3,4,5,6,7,8,0,3,2,4,5,6,7,8,0,4,3,5,2,6,7,8,0,5,4,6,2,3,7,8,0,6,5,7,2,3,4,8,0,7,6,8,2,3,4,5,0,8,7,6,2,3,4,5,0 }; int32 d0,d1,d2,d3,d4,d5,d6,a2,a5; int32 cp, cup1, type; const uint8 *c; uint8 *phist = nullptr; uint8 *dstmax = dst + len; XPK_BufferBounds bufs; bufs.pSrcBeg = src; bufs.pSrcEnd = src + srcLen; bufs.pDstBeg = dst; bufs.pDstEnd = dst + len; c = src; while (len > 0) { if(&(c[0]) < bufs.pSrcBeg || &(c[0]) >= bufs.pSrcEnd) throw XPK_error(); if(&(c[7]) < bufs.pSrcBeg || &(c[7]) >= bufs.pSrcEnd) throw XPK_error(); type = c[0]; cp = (c[4]<<8) | (c[5]); // packed cup1 = (c[6]<<8) | (c[7]); // unpacked //Log(" packed=%6d unpacked=%6d bytes left=%d dst=%08X(%d)\n", cp, cup1, len, dst, dst); c += 8; src = c+2; if (type == 0) { // RAW chunk if(c < bufs.pSrcBeg || c >= bufs.pSrcEnd) throw XPK_error(); if(c + cp > bufs.pSrcEnd) throw XPK_error(); if(dst < bufs.pDstBeg || dst >= bufs.pDstEnd) throw XPK_error(); if(dst + cp > bufs.pDstEnd) throw XPK_error(); memcpy(dst,c,cp); dst+=cp; c+=cp; len -= cp; continue; } if (type != 1) { #ifdef MMCMP_LOG Log("Invalid XPK type! (%d bytes left)\n", len); #endif break; } len -= cup1; cp = (cp + 3) & 0xfffc; c += cp; d0 = d1 = d2 = a2 = 0; d3 = *(src++); if(dst < bufs.pDstBeg || dst >= bufs.pDstEnd) throw XPK_error(); *dst = (uint8)d3; if (dst < dstmax) dst++; cup1--; while (cup1 > 0) { if (d1 >= 8) goto l6dc; if (bfextu(src,d0,1,bufs)) goto l75a; d0 += 1; d5 = 0; d6 = 8; goto l734; l6dc: if (bfextu(src,d0,1,bufs)) goto l726; d0 += 1; if (! bfextu(src,d0,1,bufs)) goto l75a; d0 += 1; if (bfextu(src,d0,1,bufs)) goto l6f6; d6 = 2; goto l708; l6f6: d0 += 1; if (!bfextu(src,d0,1,bufs)) goto l706; d6 = bfextu(src,d0,3,bufs); d0 += 3; goto l70a; l706: d6 = 3; l708: d0 += 1; l70a: d6 = xpk_table[(8*a2) + d6 -17]; if (d6 != 8) goto l730; l718: if (d2 >= 20) { d5 = 1; goto l732; } d5 = 0; goto l734; l726: d0 += 1; d6 = 8; if (d6 == a2) goto l718; d6 = a2; l730: d5 = 4; l732: d2 += 8; l734: while ((d5 >= 0) && (cup1 > 0)) { d4 = bfexts(src,d0,d6,bufs); d0 += d6; d3 -= d4; if(dst < bufs.pDstBeg || dst >= bufs.pDstEnd) throw XPK_error(); *dst = (uint8)d3; if (dst < dstmax) dst++; cup1--; d5--; } if (d1 != 31) d1++; a2 = d6; l74c: d6 = d2; d6 >>= 3; d2 -= d6; } } return true; l75a: d0 += 1; if (bfextu(src,d0,1,bufs)) goto l766; d4 = 2; goto l79e; l766: d0 += 1; if (bfextu(src,d0,1,bufs)) goto l772; d4 = 4; goto l79e; l772: d0 += 1; if (bfextu(src,d0,1,bufs)) goto l77e; d4 = 6; goto l79e; l77e: d0 += 1; if (bfextu(src,d0,1,bufs)) goto l792; d0 += 1; d6 = bfextu(src,d0,3,bufs); d0 += 3; d6 += 8; goto l7a8; l792: d0 += 1; d6 = bfextu(src,d0,5,bufs); d0 += 5; d4 = 16; goto l7a6; l79e: d0 += 1; d6 = bfextu(src,d0,1,bufs); d0 += 1; l7a6: d6 += d4; l7a8: if (bfextu(src,d0,1,bufs)) goto l7c4; d0 += 1; if (bfextu(src,d0,1,bufs)) goto l7bc; d5 = 8; a5 = 0; goto l7ca; l7bc: d5 = 14; a5 = -0x1100; goto l7ca; l7c4: d5 = 12; a5 = -0x100; l7ca: d0 += 1; d4 = bfextu(src,d0,d5,bufs); d0 += d5; d6 -= 3; if (d6 >= 0) { if (d6 > 0) d1 -= 1; d1 -= 1; if (d1 < 0) d1 = 0; } d6 += 2; phist = dst + a5 - d4 - 1; while ((d6 >= 0) && (cup1 > 0)) { if(phist < bufs.pDstBeg || phist >= bufs.pDstEnd) throw XPK_error(); d3 = *phist++; if(dst < bufs.pDstBeg || dst >= bufs.pDstEnd) throw XPK_error(); *dst = (uint8)d3; if (dst < dstmax) dst++; cup1--; d6--; } goto l74c; } bool UnpackXPK(std::vector<char> &unpackedData, FileReader &file) //--------------------------------------------------------------- { file.Rewind(); unpackedData.clear(); XPKFILEHEADER header; if(!file.ReadConvertEndianness(header)) return false; if(std::memcmp(header.XPKF, "XPKF", 4) != 0) return false; if(std::memcmp(header.SQSH, "SQSH", 4) != 0) return false; if(header.SrcLen == 0) return false; if(header.DstLen == 0) return false; if(!file.CanRead(header.SrcLen + 8 - sizeof(XPKFILEHEADER))) return false; #ifdef MMCMP_LOG Log("XPK detected (SrcLen=%d DstLen=%d) filesize=%d\n", header.SrcLen, header.DstLen, file.GetLength()); #endif unpackedData.resize(header.DstLen); bool result = false; try { result = XPK_DoUnpack(reinterpret_cast<const uint8 *>(file.GetRawData()), header.SrcLen + 8 - sizeof(XPKFILEHEADER), reinterpret_cast<uint8 *>(&(unpackedData[0])), header.DstLen); } catch(XPK_error&) { return false; } return result; } ////////////////////////////////////////////////////////////////////////////// // // PowerPack PP20 Unpacker // static const uint32 PP20_PACKED_SIZE_MIN = 8; struct PPBITBUFFER { uint32 bitcount; uint32 bitbuffer; const uint8 *pStart; const uint8 *pSrc; uint32 GetBits(uint32 n); }; uint32 PPBITBUFFER::GetBits(uint32 n) //----------------------------------- { uint32 result = 0; for (uint32 i=0; i<n; i++) { if (!bitcount) { bitcount = 8; if (pSrc != pStart) pSrc--; bitbuffer = *pSrc; } result = (result<<1) | (bitbuffer&1); bitbuffer >>= 1; bitcount--; } return result; } static bool PP20_DoUnpack(const uint8 *pSrc, uint32 nSrcLen, uint8 *pDst, uint32 nDstLen) //--------------------------------------------------------------------------------------- { PPBITBUFFER BitBuffer; uint32 nBytesLeft; BitBuffer.pStart = pSrc; BitBuffer.pSrc = pSrc + nSrcLen - 4; BitBuffer.bitbuffer = 0; BitBuffer.bitcount = 0; BitBuffer.GetBits(pSrc[nSrcLen-1]); nBytesLeft = nDstLen; while (nBytesLeft > 0) { if (!BitBuffer.GetBits(1)) { uint32 n = 1; while (n < nBytesLeft) { uint32 code = BitBuffer.GetBits(2); n += code; if (code != 3) break; } for (uint32 i=0; i<n; i++) { pDst[--nBytesLeft] = (uint8)BitBuffer.GetBits(8); } if (!nBytesLeft) break; } { uint32 n = BitBuffer.GetBits(2)+1; if(n < 1 || n-1 >= nSrcLen) return false; uint32 nbits = pSrc[n-1]; uint32 nofs; if (n==4) { nofs = BitBuffer.GetBits( (BitBuffer.GetBits(1)) ? nbits : 7 ); while (n < nBytesLeft) { uint32 code = BitBuffer.GetBits(3); n += code; if (code != 7) break; } } else { nofs = BitBuffer.GetBits(nbits); } for (uint32 i=0; i<=n; i++) { pDst[nBytesLeft-1] = (nBytesLeft+nofs < nDstLen) ? pDst[nBytesLeft+nofs] : 0; if (!--nBytesLeft) break; } } } return true; } bool UnpackPP20(std::vector<char> &unpackedData, FileReader &file) //---------------------------------------------------------------- { file.Rewind(); unpackedData.clear(); if(!Util::TypeCanHoldValue<uint32>(file.GetLength())) return false; if(!file.CanRead(PP20_PACKED_SIZE_MIN)) return false; if(!file.ReadMagic("PP20")) return false; file.Seek(file.GetLength() - 4); uint32 dstLen = 0; dstLen |= file.ReadUint8() << 16; dstLen |= file.ReadUint8() << 8; dstLen |= file.ReadUint8() << 0; if(dstLen == 0) return false; unpackedData.resize(dstLen); file.Seek(4); bool result = PP20_DoUnpack(reinterpret_cast<const uint8 *>(file.GetRawData()), static_cast<uint32>(file.GetLength() - 4), reinterpret_cast<uint8 *>(&(unpackedData[0])), dstLen); return result; } OPENMPT_NAMESPACE_END
[ "manxorist@56274372-70c3-4bfc-bfc3-4c3a0b034d27" ]
manxorist@56274372-70c3-4bfc-bfc3-4c3a0b034d27
e0dac87779c1f9f76438f164f54895d5b156bd48
fea945b64253bb62e3512536f85b44eadd5a0186
/utils/testgen.hxx
e4ecd93a05f223f637c85f78f9978ccd403f3a6c
[ "MIT" ]
permissive
moskupols/image-labeling-benchmark
ec56e17f5d34cd0a0b1dc0ff21e69ea7310ddcb8
8babc97969ea7e557dd07acf98a6e2bcf7a7ee4a
refs/heads/master
2021-01-19T03:53:52.061757
2016-07-31T22:10:43
2016-07-31T22:10:43
49,582,180
1
0
null
null
null
null
UTF-8
C++
false
false
1,518
hxx
#ifndef TESTGEN_HXX #define TESTGEN_HXX #include <random> #include <vector> #include <algorithm> #include <cstring> #include <cassert> using std::vector; using std::begin; using std::end; using std::shuffle; template<class Matrix> class RandomMatrixGenerator { public: explicit RandomMatrixGenerator(int seed): rng(seed) {} void setSeed(int newSeed) { rng = std::mt19937(newSeed); } Matrix next(size_t rows, size_t cols) { return nextWithOnes(rows, cols, rng() % (rows * cols + 1)); } Matrix nextWithOnes(size_t rows, size_t cols, size_t ones) { size_t size = rows * cols; assert(ones <= size); char perm[size]; memset(perm, 0, size); memset(perm, 1, ones); shuffle(perm, perm + size, rng); return Matrix(rows, cols, perm, perm + size); } Matrix nextWithDensity(size_t rows, size_t cols, double density) { return nextWithOnes(rows, cols, rows * cols * density); } Matrix nextNotLargerThan(size_t n) { size_t rows = unsigned(rng()) % n + 1; size_t cols = unsigned(rng()) % n + 1; return next(rows, cols); } private: std::mt19937 rng; }; template<class Matrix, size_t ROWS, size_t COLS, int SEED=1, int DENSITY=50> struct RandomMatrixGeneratorFunctor { public: Matrix operator()() const { RandomMatrixGenerator<Matrix> g(SEED); return g.nextWithDensity(ROWS, COLS, DENSITY / 100.); } }; #endif
[ "feodor.alexeev@gmail.com" ]
feodor.alexeev@gmail.com
9bb16000058a7fd5380e41e362778cca91d87ffa
87eccce05e29d7dda3532fefb0049c95226aef09
/数据结构/实验/ex4_1SqStack/ex4_1_Test.h
1cb2f53b333ff4e40706e8ab0dcd8a8408f7db7d
[]
no_license
guodongxiaren/ShiYan
ee993d35bafe7f8c1c2d96293fd04d944dc04871
fd73caa7a49228de985045e33a00da1492cf4354
refs/heads/master
2020-05-16T08:00:30.376449
2016-01-10T09:24:50
2016-01-10T09:24:50
22,560,353
11
6
null
null
null
null
GB18030
C++
false
false
4,040
h
#ifndef EX4_1_TEST_H #define EX4_1_TEST_H #endif #include "MySqStack.h" //////////////////////////////////////// template <class T> void displayCurrentObject(MySqStack<T> ms) { cout<<"当前顺序栈中的元素为:"<<endl; cout<<ms; } /////////////////////////////////////// template <class T> void ex4_1_1(MySqStack<T>& ss,char& continueYesNo) { cout<<" ***************在栈顶压入元素e*************"<<endl<<endl; T e; cout<<"请输入你要在栈顶压入的元素:"; cin>>e; ss.push(e); cout<<"压入元素"<<e<<"后,新顺序栈如下所示:"<<endl; cout<<ss; cout<<" ***************************************"<<endl<<endl; cout<<" 还继续吗(Y.继续\tN.结束)?"; cin>>continueYesNo; } template <class T> void ex4_1_2(MySqStack<T>& ss,char& continueYesNo) { cout<<" ***************弹出栈顶元素到e*************"<<endl<<endl; T e; if(ss.pop(e)==ERROR) { cout<<"!栈空,不能出栈"<<endl; return; } cout<<"弹出的栈顶元素为:"<<e<<endl; cout<<"弹出后顺序栈中的元素为:"<<endl; cout<<ss; cout<<" ***************************************"<<endl<<endl; cout<<" 还继续吗(Y.继续\tN.结束)?"; cin>>continueYesNo; } template <class T> void ex4_1_3(MySqStack<T>& ss,char& continueYesNo) { cout<<" ***************读栈顶元素*************"<<endl<<endl; T e; if(ss.getTop(e)==ERROR) { cout<<"!栈空,无栈顶元素"<<endl; return; } cout<<"读栈顶元素为:"<<e<<endl; cout<<"读栈顶元素后,顺序栈中的元素为:"<<endl; cout<<ss; cout<<" ***************************************"<<endl<<endl; cout<<" 还继续吗(Y.继续\tN.结束)?"; cin>>continueYesNo; } template <class T> void ex4_1_4(MySqStack<T>& ss,char& continueYesNo) { cout<<" ***************判断顺序栈是否为空*************"<<endl<<endl; if(ss.isEmpty()) cout<<"当前栈为空"<<endl; else cout<<"当前栈不为空"<<endl; cout<<" ***************************************"<<endl<<endl; cout<<" 还继续吗(Y.继续\tN.结束)?"; cin>>continueYesNo; } template <class T> void ex4_1_5(MySqStack<T>& ss,char& continueYesNo) { cout<<" ***************求顺序栈中元素的个数*************"<<endl<<endl; cout<<"当前顺序栈中元素的个数为"<<ss.getLength()<<endl; cout<<" ***************************************"<<endl<<endl; cout<<" 还继续吗(Y.继续\tN.结束)?"; cin>>continueYesNo; } template <class T> void ex4_1_6(MySqStack<T>& ss,char& continueYesNo) { cout<<" ***************把一个顺序栈赋值给另一个顺序栈*************"<<endl<<endl; MySqStack<int> t; t.randomCreate(); ss=t; cout<<"另一个顺序栈赋值给当前顺序栈为:"<<endl; cout<<ss; cout<<" ***************************************"<<endl<<endl; cout<<" 还继续吗(Y.继续\tN.结束)?"; cin>>continueYesNo; } template <class T> void ex4_1_7(MySqStack<T>& ss,char& continueYesNo) { cout<<" ***************把顺序栈置空*************"<<endl<<endl; ss.clear(); cout<<"当前顺序栈置空后,元素的个数为"<<ss.getLength()<<endl; cout<<" ***************************************"<<endl<<endl; cout<<" 还继续吗(Y.继续\tN.结束)?"; cin>>continueYesNo; } template <class T> void ex4_1_8(MySqStack<T>& ss,char& continueYesNo) { cout<<" ***************随机生成顺序栈*************"<<endl<<endl; cout<<"随机生成的顺序站中的一些元素如下:"<<endl; ss.randomCreate(); cout<<endl<<"随机生成的顺序栈(采用顺序存储)如下:"<<endl; cout<<ss; cout<<" ***************************************"<<endl<<endl; cout<<" 还继续吗(Y.继续\tN.结束)?"; cin>>continueYesNo; } template <class T> void ex4_1_9(MySqStack<T>& ss,char& continueYesNo) { cout<<" ************用已有顺序栈初始化另一个新顺序栈************"<<endl<<endl; MySqStack<T> t(ss); cout<<"当前顺序栈初始化另一顺序栈为:"<<endl; cout<<t; cout<<" ***************************************"<<endl<<endl; cout<<" 还继续吗(Y.继续\tN.结束)?"; cin>>continueYesNo; }
[ "879231132@qq.com" ]
879231132@qq.com
dea314bbd55ae40139ed71c88aa983f580f23907
c0caed81b5b3e1498cbca4c1627513c456908e38
/src/protocols/stepwise/sampler/StepWiseSamplerSizedComb.cc
3225741b290f5479a62a65c40043a66339638f1e
[]
no_license
malaifa/source
5b34ac0a4e7777265b291fc824da8837ecc3ee84
fc0af245885de0fb82e0a1144422796a6674aeae
refs/heads/master
2021-01-19T22:10:22.942155
2017-04-19T14:13:07
2017-04-19T14:13:07
88,761,668
0
2
null
null
null
null
UTF-8
C++
false
false
6,154
cc
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*- // vi: set ts=2 noet: // // (c) Copyright Rosetta Commons Member Institutions. // (c) This file is part of the Rosetta software suite and is made available under license. // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons. // (c) For more information, see http://www.rosettacommons.org. Questions about this can be // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu. /// @file protocols/stepwise/sampler/StepWiseSamplerSizedComb.cc /// @brief Aggregate of multiple rotamer samplers for modeler combinatorially. /// @author Fang-Chieh Chou // Unit headers #include <protocols/stepwise/sampler/StepWiseSamplerSizedComb.hh> // Project headers #include <core/pose/Pose.hh> #include <utility/stream_util.hh> #include <basic/Tracer.hh> // Numeric Headers #include <numeric/random/random.hh> static THREAD_LOCAL basic::Tracer TR( "protocols.sampler.StepWiseSamplerSizedComb" ); using namespace core; /////////////////////////////////////////////////////////////////////////// // StepWiseSampler Combination is a lot like nesting loops, or like // writing numbers in decimal format. // // Due to a historical choice, however, rotamer samplers that are // later in the list are 'external' to rotamer samplers earlier in the list. // // This order seems counter-intuitive (cf. writing numbers -- incrementing changes // the *last* decimal place first), and may be worth fixing. // /////////////////////////////////////////////////////////////////////////// namespace protocols { namespace stepwise { namespace sampler { /////////////////////////////////////////////////////////////////////////// StepWiseSamplerSizedComb::StepWiseSamplerSizedComb(): StepWiseSamplerSized(), size_( 0 ) {} StepWiseSamplerSizedComb::StepWiseSamplerSizedComb( StepWiseSamplerSizedOP outer_loop_rotamer, StepWiseSamplerSizedOP inner_loop_rotamer ): size_( 0 ) //will be fixed on init() { rotamer_list_.push_back( inner_loop_rotamer ); rotamer_list_.push_back( outer_loop_rotamer ); init(); } StepWiseSamplerSizedComb::~StepWiseSamplerSizedComb(){} /////////////////////////////////////////////////////////////////////////// void StepWiseSamplerSizedComb::init() { runtime_assert( !rotamer_list_.empty() ); for ( Size i = 1; i <= rotamer_list_.size(); ++i ) { rotamer_list_[i]->init(); } size_list_.clear(); id_list_.clear(); size_ = 1; for ( Size i = 1; i <= rotamer_list_.size(); ++i ) { Real const curr_size = rotamer_list_[i]->size(); id_list_.push_back( 0 ); size_list_.push_back( (Size)curr_size ); size_ = (Size)(size_ * curr_size); if ( curr_size == 0 ) TR << "Got a null rotamer sampler!" << std::endl; } set_init( true ); } /////////////////////////////////////////////////////////////////////////// void StepWiseSamplerSizedComb::reset() { runtime_assert( is_init() ); if ( random() ) { ++( *this ); } else { for ( Size i = 1; i <= id_list_.size(); ++i ) { id_list_[i] = 1; } id_ = 1; } update_rotamer_ids(); } /////////////////////////////////////////////////////////////////////////// void StepWiseSamplerSizedComb::operator++() { runtime_assert( not_end() ); if ( random() ) { id_ = numeric::random::rg().random_range( 1, size() ); } else { ++id_; } id_list_ = id2list( id_ ); update_rotamer_ids(); } /////////////////////////////////////////////////////////////////////////// void StepWiseSamplerSizedComb::update_rotamer_ids() { for ( Size i = 1; i <= id_list_.size(); ++i ) { rotamer_list_[i]->set_id( id_list_[i] ); } } /////////////////////////////////////////////////////////////////////////// void StepWiseSamplerSizedComb::apply( Pose & pose ) { apply( pose, id_ ); } /////////////////////////////////////////////////////////////////////////// void StepWiseSamplerSizedComb::apply( core::pose::Pose & pose, Size const id ) { runtime_assert( is_init() ); utility::vector1<Size> new_id_list = id2list( id ); for ( Size i = 1; i <= rotamer_list_.size(); ++i ) { rotamer_list_[i]->apply( pose, new_id_list[i] ); } } /////////////////////////////////////////////////////////////////////////// utility::vector1<Size> StepWiseSamplerSizedComb::id2list( core::Size const id ) const { runtime_assert( is_init() ); utility::vector1<Size> new_id_list ( id_list_.size(), 1 ); new_id_list[1] = id; for ( Size i = 1; i < new_id_list.size(); ++i ) { if ( new_id_list[i] > size_list_[i] ) { Size quot = new_id_list[i] / size_list_[i]; Size const rem = new_id_list[i] % size_list_[i]; if ( rem == 0 ) { new_id_list[i] = size_list_[i]; --quot; } else { new_id_list[i] = rem; } new_id_list[i+1] += quot; } else { break; } } return new_id_list; } /////////////////////////////////////////////////////////////////////////// core::Size StepWiseSamplerSizedComb::list2id( utility::vector1<core::Size> const & id_list ) const { runtime_assert( is_init() ); Size id( 1 ); Size block_size_( 1 ); for ( Size i = 1; i <= id_list.size(); ++i ) { id += block_size_ * ( id_list[ i ] - 1); block_size_ *= size_list_[ i ]; } return id; } /// @brief Move sampler to end. void StepWiseSamplerSizedComb::fast_forward( Size const sampler_number ){ runtime_assert( sampler_number <= rotamer_list_.size() ); for ( Size n = 1; n <= sampler_number; n++ ) { id_list_[ n ] = rotamer_list_[ n ]->size(); } id_ = list2id( id_list_ ); } /// @brief Set the random modeler state void StepWiseSamplerSizedComb::set_random( bool const setting ){ StepWiseSamplerBase::set_random( setting ); for ( Size n = 1; n <= rotamer_list_.size(); n++ ) rotamer_list_[ n ]->set_random( setting ); } /////////////////////////////////////////////////////////////////////////// void StepWiseSamplerSizedComb::show( std::ostream & out, Size const indent ) const { StepWiseSamplerSized::show( out, indent ); // reverse direction so that 'inner loop' is last. for ( Size k = rotamer_list_.size(); k >= 1; k-- ) rotamer_list_[k]->show( out, indent + 1 ); } } //sampler } //stepwise } //protocols
[ "malaifa@yahoo.com" ]
malaifa@yahoo.com
0b46c49dafd552f8cb5e5ba4bc5cf248401fb2ef
3ac6a7af9e1c58bb3e2ae6bc33dee47b21269f87
/OpenS4/Renderer/Batch/PointBatch.hpp
790354d89c2842086b73a18a9b4b281cfad9321c
[ "MIT" ]
permissive
MadShadow-/OpenS4
eabefdd744160e48735be078f9e510ae7f4e6db2
1b2f69d617406a2a49ed0511d93771d978b6bfc3
refs/heads/master
2022-12-01T09:36:10.402171
2020-08-10T21:34:39
2020-08-10T21:34:39
273,549,066
3
4
null
null
null
null
UTF-8
C++
false
false
2,920
hpp
#pragma once #include "../OpenGL.hpp" namespace OpenS4::Renderer { class PointBatch { public: GLuint m_vertexArrayObject = 0; GLuint m_attributes[3] = {0}; u64 m_attributeSize[3] = {0}; u64 m_numberOfVertices; void setAttribute(u64 attrID, const std::vector<float>& attribute, u64 valuesPerAttribute) { if (m_attributes[attrID] == 0) { glGenBuffers(1, &m_attributes[attrID]); } glBindBuffer(GL_ARRAY_BUFFER, m_attributes[attrID]); if (m_attributeSize[attrID] < attribute.size()) { glBufferData(GL_ARRAY_BUFFER, sizeof(float) * attribute.size(), attribute.data(), GL_DYNAMIC_DRAW); m_attributeSize[attrID] = attribute.size(); } else { glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float) * attribute.size(), attribute.data()); } glVertexAttribPointer(attrID, valuesPerAttribute, GL_FLOAT, GL_FALSE, 0, 0); } void setAttribute(u64 attrID, float* attribute, u64 attributeLength, u64 valuesPerAttribute) { if (m_attributes[attrID] == 0) { glGenBuffers(1, &m_attributes[attrID]); } glBindBuffer(GL_ARRAY_BUFFER, m_attributes[attrID]); if (m_attributeSize[attrID] < attributeLength) { glBufferData(GL_ARRAY_BUFFER, sizeof(float) * attributeLength, attribute, GL_DYNAMIC_DRAW); m_attributeSize[attrID] = attributeLength; } else { glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float) * attributeLength, attribute); } glVertexAttribPointer(attrID, valuesPerAttribute, GL_FLOAT, GL_FALSE, 0, 0); } void bindVAO() { if (m_vertexArrayObject == 0) { glGenVertexArrays(1, &m_vertexArrayObject); } glBindVertexArray(m_vertexArrayObject); } public: PointBatch() {} ~PointBatch() { for (int i = 0; i < 3; i++) { if (m_attributes[i]) glDeleteBuffers(1, &m_attributes[i]); } if (m_vertexArrayObject != 0) glDeleteVertexArrays(1, &m_vertexArrayObject); } void draw() { glBindVertexArray(m_vertexArrayObject); glDrawArrays(GL_POINTS, 0, m_numberOfVertices); glBindVertexArray(0); } void updateData(const std::vector<float>& xy, u64 nXY, const std::vector<float>& color, u64 nColor) { bindVAO(); setAttribute(0, xy, nXY); setAttribute(2, color, nColor); glEnableVertexAttribArray(0); glEnableVertexAttribArray(2); glBindVertexArray(0); glBindBuffer(GL_ARRAY_BUFFER, 0); m_numberOfVertices = xy.size() / nXY; } }; } // namespace OpenS4::Renderer
[ "40365952+Kimichura@users.noreply.github.com" ]
40365952+Kimichura@users.noreply.github.com
2cd037e06f282730209163c6bc4ef72bc5efcf01
ae05c57c352bd420eeb2f11ef10fb3407a7797d2
/Practica3/TestAlumno.cpp
f59ee53959fd12e643d10aa4b40c933114c67c94
[]
no_license
ernesto-na/repasoc-
ab0898bd8f1f5b630755f52ac9021bcb6614c117
3872e82deede3d1265aff7852dfdf82d214ca640
refs/heads/master
2023-07-03T18:38:05.870351
2021-08-10T08:14:03
2021-08-10T08:14:03
393,239,120
0
0
null
null
null
null
ISO-8859-1
C++
false
false
9,834
cpp
#include"Alumno.h" #include"Profesor.h" #include"Materia.h" #include<iostream> #include <stdio.h> #include <stdlib.h> #include <conio.h> using namespace std; Alumno arregloAlumnos[100]; Materia arregloMaterias[100]; Profesor arregloProfesores[100]; int elementos = 1; int indiceAlumnos = 0, indiceProfesores = 0, indiceMaterias = 0; void leerAlumnos() { //cout << "---iA->" << indiceAlumnos << "..elementos.." << elementos; //for(int i=indiceAlumnos; i<elementos;i++){ string auxNombre, auxAPaterno, auxSexo; int auxEdad, auxNumCtrlEscolar, auxSemestre, auxIdMateria; //Materia auxMateria;//("mate","ernes",10); fflush (stdin); //system("cls"); cout << "\n\n\tBienvenido al sistema escolar" << endl; cout << "\tEscribe el nombre del alumno "; getline(cin, auxNombre); cout << "\tEscribe el apellido paterno "; getline(cin, auxAPaterno); cout << "\tEscribe el sexo "; getline(cin, auxSexo); cout << "\tEscribe la edad "; cin >> auxEdad; cout << "\tEscribe el numero de Boleta "; cin >> auxNumCtrlEscolar; cout << "\tEscribe el numero de semestre "; cin >> auxSemestre; Alumno alumno(auxNombre, auxAPaterno, auxSexo, auxEdad, auxNumCtrlEscolar, auxSemestre, auxIdMateria); for (int i = 0; i < 2; i++) { cout << "\tEscriba el ID de la materias "; cin >> auxIdMateria; alumno.setIdArregloIdMaterias(i, auxIdMateria); } arregloAlumnos[indiceAlumnos] = alumno; indiceAlumnos++; } void validarAlumnos() { string auxNombre; fflush (stdin); cout << "\n\tEscribe el nombre del cliente a buscar: "; getline(cin, auxNombre); cout << "\n\tEscribe el nombre del cliente a buscar: " << auxNombre; for (int i = 0; i < indiceAlumnos; i++) { //if(arregloAlumnos[i].getNombre()==auxNombre){ if (arregloAlumnos[i].getNombre() == auxNombre) { cout << "\n\n\n----------------------BD--ALUMNOS------------------------------------\n"; cout << "\tEl nombre es: " << arregloAlumnos[i].getNombre() << endl; cout << "\tEl apellido paterno: " << arregloAlumnos[i].getApellidoP() << endl; cout << "\tEl sexo es: " << arregloAlumnos[i].getSexo() << endl; cout << "\tSu edad es: " << arregloAlumnos[i].getEdad() << endl; cout << "\tSu Boleta es: " << arregloAlumnos[i].getNumeroCtrlEscolar() << endl; cout << "\tSu Semestre es: " << arregloAlumnos[i].getSemestre() << endl; //cout<<"\tSu id de materia es: "<<arregloAlumnos[i].getIdMateria()<<endl; cout << "\t-----------Sus materias son-------------: " << endl; /*for(int j=0; j<2; j++){ cout<<"\t\tSu materia es: "<<arregloAlumnos[i].getIdArregloIdMaterias(j)<<endl; }*/ for (int j = 0; j < 2; j++) { cout << "idMAteria " << arregloMaterias[j].getIdMateria()<< " Alumno y su idmateria "<< arregloAlumnos[i].getIdArregloIdMaterias(j)<<endl; if (arregloMaterias[j].getIdMateria() == arregloAlumnos[i].getIdArregloIdMaterias(j) ||arregloMaterias[j].getIdMateria() == arregloAlumnos[i].getIdArregloIdMaterias(j+1) ) { cout<<"valor de i: "<<i<<"valor de j: "<<j<<"numAlumnos"<<indiceAlumnos; cout<< "\n\n\n************************************************\n"; cout<< "\t*La materia es: "<< arregloMaterias[j].getNombre()<< "\t*" << endl; cout << "\t*El profesor es: "<< arregloMaterias[j].getProfesor()<< "\t*" << endl; cout << "\t*Los creditos son: "<< arregloMaterias[j].getNumeroCreditos()<< "\t*"<< endl; cout << "\t*Su id es: " << arregloMaterias[j].getIdMateria()<< "\t\t*" << endl; cout<< "\n*****************************************************"; } cout<<"j: "<<j<<endl; } cout<< "\n-------------------------------------------------------------------------"; //} } } } void leerMaterias() { //for(int i=0; i<indiceMaterias;i++){ string auxNombre, auxProfesor; int auxCreditos, auxId; //Materia auxMateria;//("mate","ernes",10); fflush (stdin); system("cls"); cout << "\n\n\tBienvenido al sistema escolar" << endl; cout << "\tEscribe La materia "; getline(cin, auxNombre); cout << "\tEscribe el profesor "; getline(cin, auxProfesor); cout << "\tEscribe los creditos "; cin >> auxCreditos; cout << "\tEscribe el id "; cin >> auxId; Materia materia(auxNombre, auxProfesor, auxCreditos, auxId); arregloMaterias[indiceMaterias] = materia; indiceMaterias++; // } } void mostrarMaterias() { for (int i = 0; i < indiceMaterias; i++) { cout << "\n\n\n----------------------------------------------------------\n"; cout << "\tLa materia es: " << arregloMaterias[i].getNombre() << endl; cout << "\tEl profesor es: " << arregloMaterias[i].getProfesor() << endl; cout << "\tLos creditos son: " << arregloMaterias[i].getNumeroCreditos() << endl; cout << "\tSu id es: " << arregloMaterias[i].getIdMateria() << endl; cout << "\n----------------------------------------------------------"; } } void leerProfesor() { string auxNombre, auxAPaterno, auxAMaterno, auxSexo, auxProfesion; int auxEdad, auxNumCedulaProfesional; float auxMontoCuenta; fflush (stdin); system("cls"); cout << "\n\n\tBienvenido al sistema para guardar profesores" << endl; cout << "\tEscribe el nombre "; getline(cin, auxNombre); cout << "\tEscribe el apellido paterno "; getline(cin, auxAPaterno); cout << "\tEscribe el apellido materno "; getline(cin, auxAMaterno); cout << "\tEscribe el sexo "; getline(cin, auxSexo); cout << "\tEscribe la edad "; cin >> auxEdad; Profesor profesor(auxNombre, auxAPaterno, auxAMaterno, auxSexo, auxEdad, auxProfesion, auxNumCedulaProfesional); arregloProfesores[indiceProfesores] = profesor; indiceProfesores++; } void validarProfesor() { string auxNombre; for (int i = 0; i < indiceProfesores; i++) { // if (arregloProfesores[i].getNombre() == auxNombre) //{ cout << "\n\n\n----------------------------------------------------------\n"; cout << "\tEl nombre del profesor es: " << arregloProfesores[i].getNombre() << endl; cout << "\tEl apellido paterno: " << arregloProfesores[i].getApellidoP() << endl; cout << "\tEl apellido materno: " << arregloProfesores[i].getApellidoM() << endl; cout << "\tSu sexo es: " << arregloProfesores[i].getSexo() << endl; cout << "\tSu edad es: " << arregloProfesores[i].getEdad() << endl; cout << "\tSu titulo o profesion es: " << arregloProfesores[i].getProfesion() << endl; cout << "\tSu No. de cedula profesional es: " << arregloProfesores[i].getNumCedulaProfesional() << endl; cout << "\n----------------------------------------------------------"; //} } } void eliminarAlumno() { string auxNombre; fflush (stdin); cout << "\n\tEscribe el nombre del alumno a eliminar: "; getline(cin, auxNombre); for (int i = 0; i <= elementos; i++) { if (arregloAlumnos[i].getNombre() == auxNombre) { arregloAlumnos[i].setNombre(""); arregloAlumnos[i].setApellidoP(""); arregloAlumnos[i].setSexo(""); arregloAlumnos[i].setEdad(0); arregloAlumnos[i].setNumeroCtrlEscolar(0); arregloAlumnos[i].setSemestre(0); arregloAlumnos[i].setIdMateria(0); } } } void eliminarProfesor() { string auxNombre; fflush (stdin); cout << "\n\tEscribe el nombre del profesor a eliminar: "; getline(cin, auxNombre); for (int i = 0; i <= elementos; i++) { if (arregloProfesores[i].getNombre() == auxNombre) { arregloProfesores[i].setNombre(""); arregloProfesores[i].setApellidoP(""); arregloProfesores[i].setApellidoM(""); arregloProfesores[i].setSexo(""); arregloProfesores[i].setEdad(0); arregloProfesores[i].setProfesion(""); arregloProfesores[i].setNumCedulaProfesional(0); } } } void eliminarMaterias() { string auxNombre; fflush (stdin); cout << "\n\tEscribe el nombre de la materia a eliminar: "; getline(cin, auxNombre); for (int i = 0; i <= elementos; i++) { if (arregloMaterias[i].getNombre() == auxNombre) { arregloMaterias[i].setNombre(""); arregloMaterias[i].setProfesor(""); arregloMaterias[i].setNumeroCreditos(0); arregloMaterias[i].setIdMateria(0); } } } int main() { // leerMaterias(); // mostrarMaterias(); // eliminarMaterias(); int opcion; bool repetir = true; do { //system("cls"); // Texto del menú que se verá cada vez cout << "\n\nMenu de Opciones" << endl; cout << "1. Agregar alumno 1" << endl; cout << "2. Mostrar alumnos 2" << endl; cout << "3. Borrar Alumnos" << endl; cout << "4. Agregar Profesor" << endl; cout << "5. Mostrar Profesores" << endl; cout << "6. Borrar Profesores" << endl; cout << "7. Agregar Materia" << endl; cout << "8. Mostrar Materias" << endl; cout << "9. Borrar Materia" << endl; cout << "0. SALIR" << endl; cout << "\nIngrese una opcion: "; cin >> opcion; switch (opcion) { case 1: // Lista de instrucciones de la opción 1 system("cls"); leerAlumnos(); //eliminarAlumno(); //validarAlumnos(); //system("1"); // Pausa break; case 2: // Lista de instrucciones de la opción 2 system("cls"); validarAlumnos(); // system("2"); // Pausa break; case 3: // Lista de instrucciones de la opción 3 eliminarAlumno(); break; case 4: // Lista de instrucciones de la opción 4 leerProfesor(); // system("4"); // Pausa break; case 5: // Lista de instrucciones de la opción 4 validarProfesor(); //system("5"); // Pausa break; case 6: // Lista de instrucciones de la opción 4 eliminarProfesor(); //system("6"); // Pausa break; case 7: // Lista de instrucciones de la opción 4 leerMaterias(); //system("6"); // Pausa break; case 8: // Lista de instrucciones de la opción 4 mostrarMaterias(); //system("6"); // Pausa break; case 9: // Lista de instrucciones de la opción 4 eliminarMaterias(); //system("6"); // Pausa break; case 0: repetir = false; break; } } while (repetir); }
[ "ernesto-na@outlook.com" ]
ernesto-na@outlook.com
52b6b95c7ba7ef229e25681ca2c28049ffe757bb
4503b4ec29e9a30d26c433bac376f2bddaefd9e5
/PCL 1.7.2_vs2013/x64/3rdParty/VTK-6.1.0/include/vtk-6.1/vtkInformationDoubleVectorKey.h
8f5f63636104ea575ad91f8cd98d559aaa43b157
[]
no_license
SwunZH/ecocommlibs
0a872e0bbecbb843a0584fb787cf0c5e8a2a270b
4cff09ff1e479f5f519f207262a61ee85f543b3a
refs/heads/master
2021-01-25T12:02:39.067444
2018-02-23T07:04:43
2018-02-23T07:04:43
123,447,012
1
0
null
2018-03-01T14:37:53
2018-03-01T14:37:53
null
UTF-8
C++
false
false
2,594
h
/*========================================================================= Program: Visualization Toolkit Module: vtkInformationDoubleVectorKey.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkInformationDoubleVectorKey - Key for double vector values. // .SECTION Description // vtkInformationDoubleVectorKey is used to represent keys for double // vector values in vtkInformation.h #ifndef __vtkInformationDoubleVectorKey_h #define __vtkInformationDoubleVectorKey_h #include "vtkCommonCoreModule.h" // For export macro #include "vtkInformationKey.h" #include "vtkCommonInformationKeyManager.h" // Manage instances of this type. class VTKCOMMONCORE_EXPORT vtkInformationDoubleVectorKey : public vtkInformationKey { public: vtkTypeMacro(vtkInformationDoubleVectorKey,vtkInformationKey); void PrintSelf(ostream& os, vtkIndent indent); vtkInformationDoubleVectorKey(const char* name, const char* location, int length=-1); ~vtkInformationDoubleVectorKey(); // Description: // Get/Set the value associated with this key in the given // information object. void Append(vtkInformation* info, double value); void Set(vtkInformation* info, double* value, int length); double* Get(vtkInformation* info); double Get(vtkInformation* info, int idx); void Get(vtkInformation* info, double* value); int Length(vtkInformation* info); // Description: // Copy the entry associated with this key from one information // object to another. If there is no entry in the first information // object for this key, the value is removed from the second. virtual void ShallowCopy(vtkInformation* from, vtkInformation* to); // Description: // Print the key's value in an information object to a stream. virtual void Print(ostream& os, vtkInformation* info); protected: // The required length of the vector value (-1 is no restriction). int RequiredLength; private: vtkInformationDoubleVectorKey(const vtkInformationDoubleVectorKey&); // Not implemented. void operator=(const vtkInformationDoubleVectorKey&); // Not implemented. }; #endif
[ "hnk0313@3e9e098e-e079-49b3-9d2b-ee27db7392fb" ]
hnk0313@3e9e098e-e079-49b3-9d2b-ee27db7392fb
b221df32b6d79ba610b8e85e7186a85bfc06f94f
6394edab31c0504d1e237e15570b78f23d9145a1
/assign42.cpp
bccbd3c03cfa0f67dc3c903c756979d69bb83515
[]
no_license
phuclevinh2000/C-course
83fa136a0cd46cc4b2406b47984371e42605b3e0
db4cdd2296aea8341661494142a52dd2a55dcfa3
refs/heads/master
2020-09-24T21:03:07.738285
2019-12-04T12:21:55
2019-12-04T12:21:55
225,843,593
0
0
null
null
null
null
UTF-8
C++
false
false
1,225
cpp
#include <iostream> #include <string.h> using namespace std; const int MAX = 30; void swap(char arr[][MAX], int j); void sort(char arr[][MAX], int n); void print(char arr[][MAX], int n); void read(char arr[][MAX], int n); int main(void){ //description cout << "** This program asks for n and takes in n names" << endl; cout << "** And prints out the names in ascending order\n" << endl; //input n int n; cout << "How many names you want to take in: "; cin >> n; char arr[n][MAX]; //read and print out read(arr, n); sort(arr, n); print(arr, n); return 0; } void read(char arr[][MAX], int n){ int i; for(i = 0; i < n; i++){ cout << "Input name " << i+1 << ": "; cin >> arr[i]; } } void sort(char arr[][MAX], int n){ int i, j; for(i = 0; i < n; i++) for(j = 0; j < n-1; j++) if(arr[j][0] > arr[j+1][0]) swap(arr, j); } void swap(char arr[][MAX], int j){ char temp[MAX]; strcpy(temp, arr[j]); strcpy(arr[j], arr[j+1]); strcpy(arr[j+1], temp); } void print(char arr[][MAX], int n){ int i; for(i = 0; i < n; i++) cout << "Name " << i+1 << ": " << arr[i] << endl; }
[ "noreply@github.com" ]
phuclevinh2000.noreply@github.com
3c8d1de667c583c101385703921f715a63dd0ce5
d57f48b9dbfb3c1c3bcdb11f1e0503c1f6c9750a
/CreateSkybox.cpp
941aa8cc140b87ed69bf7c0ab4ad3b75172d39ab
[ "MIT" ]
permissive
zhangxiaomu01/Skycube_Demo
348767d14b8f4880d871edd208fcba4e8be77ca8
98bfa0144fe115bd77ca9f0e2916cecca6832287
refs/heads/master
2021-04-09T16:09:49.616195
2018-03-18T04:00:59
2018-03-18T04:00:59
125,687,884
0
0
null
null
null
null
UTF-8
C++
false
false
2,446
cpp
#include "CreateSkybox.h" GLuint createSkyBox() { //according to different texture resolutions, these values may need to change //these numbers correspod to the UV boundaries of particular points /* ---- | T | ----------------- | F | L | B | R | ----------------- | D | ---- Look like this. D- Bottom, B- Back */ GLuint vao, vbo; const float cube_verts[] = { -1.0f,-1.0f,-1.0f, -1.0f,-1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f,-1.0f, -1.0f,-1.0f,-1.0f, -1.0f, 1.0f,-1.0f, 1.0f,-1.0f, 1.0f, -1.0f,-1.0f,-1.0f, 1.0f,-1.0f,-1.0f, 1.0f, 1.0f,-1.0f, 1.0f,-1.0f,-1.0f, -1.0f,-1.0f,-1.0f, -1.0f,-1.0f,-1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f,-1.0f, 1.0f,-1.0f, 1.0f, -1.0f,-1.0f, 1.0f, -1.0f,-1.0f,-1.0f, -1.0f, 1.0f, 1.0f, -1.0f,-1.0f, 1.0f, 1.0f,-1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,-1.0f,-1.0f, 1.0f, 1.0f,-1.0f, 1.0f,-1.0f,-1.0f, 1.0f, 1.0f, 1.0f, 1.0f,-1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,-1.0f, -1.0f, 1.0f,-1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f,-1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f,-1.0f, 1.0f }; //generate vao id to hold the mapping from attrib variables in shader to memory locations in vbo glGenVertexArrays(1, &vao); glGenBuffers(1, &vbo); // Generate vbo to hold vertex attributes for triangle //binding vao means that bindbuffer, enablevertexattribarray and vertexattribpointer // state will be remembered by vao glBindVertexArray(vao); glBindBuffer(GL_ARRAY_BUFFER, vbo); //specify the buffer where vertex attribute data is stored //upload from main memory to gpu memory glBufferData(GL_ARRAY_BUFFER, sizeof(cube_verts), &cube_verts[0], GL_STATIC_DRAW); //get the current shader program GLint shader_program = -1; glGetIntegerv(GL_CURRENT_PROGRAM, &shader_program); //get a reference to an attrib variable name in a shader GLint pos_loc = glGetAttribLocation(shader_program, "pos_attrib"); glEnableVertexAttribArray(pos_loc); //enable this attribute //tell opengl how to get the attribute values out of the vbo (stride and offset) glVertexAttribPointer(pos_loc, 3, GL_FLOAT, false, 0, 0); glBindVertexArray(0); //unbind the vao return vao; } void DrawSkybox(GLuint vao) { glBindVertexArray(vao); glDrawArrays(GL_TRIANGLES, 0, 36); glBindVertexArray(0); }
[ "noreply@github.com" ]
zhangxiaomu01.noreply@github.com
d5230a230750c88dfe1108ddedcf020df9980172
af1223d95655dc6e23ffa51402755a9b9c47271f
/376_WiggleSubsequence.cpp
5171ce9040aa3e658bb86e958a3d1d34e700da8e
[]
no_license
royyjzhang/leetcode_cpp
85352fbd2374a03298f0e8bace354d1408354f96
183c82dabb05f1090cc6855b7f6e18bcd9d4f2b9
refs/heads/master
2021-01-21T22:44:14.147933
2017-09-04T05:05:26
2017-09-04T05:05:26
102,170,232
0
0
null
null
null
null
UTF-8
C++
false
false
911
cpp
#include<iostream> #include<vector> #include<queue> #include<stdlib.h> #include<string> #include<algorithm> #include<map> #include<math.h> #include<stdint.h> #include<stack> #include<sstream> #include<unordered_map> using namespace std; class Solution { public: int wiggleMaxLength(vector<int>& nums) { int n, i, flag = 0, result = 0; n = nums.size(); if (n == 0) { return 0; } if (n == 1) { return 1; } for (i = 1; i < n; i++) { if (nums[i] < nums[i - 1]) { if ((flag == 0) || (flag == 1)) { result++; flag = -1; } } else if (nums[i] > nums[i - 1]) { if ((flag == 0) || (flag == -1)) { result++; flag = 1; } } } return result + 1; } }; int main() { Solution solution; vector<int> nums = { 1,7,4,9,2,5 }; cout << solution.wiggleMaxLength(nums) << endl; system("PAUSE"); return 0; }
[ "royyjzhang@outlook.com" ]
royyjzhang@outlook.com
b1dc43b2c5fc0b228bb05f364fafd68b9882d14a
5b22d68f9c01682fa96d7ca4e796ad5a7b72d9ab
/code/routingkit2/src/osm_decoder.cpp
681d4600fcca91c9d7a648e771923b7c024451d6
[ "BSD-3-Clause" ]
permissive
kit-algo/ch_potentials
54d1b0b28712d7a4f794a5decedce98fa1c36c52
f833a2153635961b01c2d68e2da6d1ae213117a5
refs/heads/master
2022-11-12T17:41:01.667707
2022-11-08T12:01:09
2022-11-08T12:01:09
347,034,552
5
0
null
null
null
null
UTF-8
C++
false
false
24,892
cpp
#include "osm_decoder.h" #include "protobuf_var_int.h" #include "buffered_async_reader.h" #include "data_source.h" #include "protobuf.h" #include <zlib.h> #include <stdexcept> #include <thread> #include <iomanip> #include <sstream> #include <algorithm> #include <atomic> #include <string.h> #include <assert.h> static uint32_t ntohl(uint32_t netlong){ return (netlong << 24) | ((netlong << 16) >> 8) | ((netlong << 8) >> 16) | (netlong >> 24); } // link with -lz namespace RoutingKit2{ namespace{ // formally // // uint8_t*p = ...; // uint32_t x = *((uint32_t*)p); // // is undefined behavior. We therefore use memcpy. template<class T> void unaligned_store(uint8_t*dest, const T&val){ memcpy(dest, (const uint8_t*)&val, sizeof(T)); } template<class T> T unaligned_load(const uint8_t*src){ T ret; memcpy((uint8_t*)&ret, src, sizeof(T)); return ret; } constexpr uint64_t is_header_info_available_bit = 1; constexpr uint64_t is_ordered_bit = 2; constexpr uint64_t was_blob_read_bit = 4; constexpr uint64_t was_header_read_bit = 8; constexpr uint32_t pbf_decompressor_read_size = 64 << 20; class OsmPBFDecompressor { public: OsmPBFDecompressor():status(0){} OsmPBFDecompressor(RefDataSource data_source): status(0), reader(data_source, pbf_decompressor_read_size){ } uint64_t get_status() const { return status; } RefDataSource as_ref(){ return [&](uint8_t*buffer, size_t how_much_to_read) -> size_t{ assert(how_much_to_read == pbf_decompressor_read_size); const uint8_t*blob_begin, *blob_end; for(;;){ uint8_t*p = reader.read(4); if(p == nullptr) return 0; uint32_t header_size = ntohl(unaligned_load<uint32_t>(p)); uint32_t data_size = (uint32_t)-1; char block_type[16] = ""; const uint8_t*buffer = reader.read_or_throw(header_size); decode_protobuf_message_with_callbacks( buffer, buffer+header_size, [&](uint64_t key_id, uint64_t num){ if(key_id == 3) data_size = num; }, [&](uint64_t key_id, double num){}, [&](uint64_t key_id, const uint8_t*str_begin, const uint8_t*str_end){ if(key_id == 1){ size_t len = str_end - str_begin; if(len > sizeof(block_type)-1) len = sizeof(block_type)-1; memcpy(block_type, str_begin, len); block_type[len] = '\0'; } } ); if(data_size == (uint32_t)-1) throw std::runtime_error("Cannot parse OSM blob header because it is missing the data size"); if(!strcmp(block_type, "OSMData")){ status |= is_header_info_available_bit | was_blob_read_bit; blob_begin = reader.read_or_throw(data_size); blob_end = blob_begin + data_size; break; } else if(!strcmp(block_type, "OSMHeader")) { if((status & is_header_info_available_bit) != 0 && (status & was_blob_read_bit) != 0) throw std::runtime_error("OSM PBF file header block must preceed all blob blocks"); if((status & is_header_info_available_bit) != 0 && (status & was_header_read_bit) != 0) throw std::runtime_error("OSM PBF file contains two header blocks"); bool is_ordered = false; const uint8_t*buffer = reader.read_or_throw(data_size); decode_protobuf_message_with_callbacks( buffer, buffer+data_size, [&](uint64_t key_id, uint64_t num){}, [&](uint64_t key_id, double num){}, [&](uint64_t key_id, const uint8_t*blob_begin, const uint8_t*blob_end){ const char*str_begin = (const char*)blob_begin; const char*str_end = (const char*)blob_end; if(key_id == 4){ // must support if(!std::equal(str_begin, str_end, "DenseNodes")) throw std::runtime_error("Required OSM PBF feature \""+std::string(str_begin, str_end)+"\" is unknown"); }else if(key_id == 5){ // may exploit if(std::equal(str_begin, str_end, "Sort.Type_then_ID")) is_ordered = true; } } ); if(is_ordered) status = is_header_info_available_bit | is_ordered_bit | was_header_read_bit; else status = is_header_info_available_bit | was_header_read_bit; } else { reader.read(data_size); continue; } } const uint8_t *uncompressed_begin = nullptr, *uncompressed_end = nullptr, *compressed_begin = nullptr, *compressed_end = nullptr; uint64_t uncompressed_data_size = (uint64_t)-1; decode_protobuf_message_with_callbacks( blob_begin, blob_end, [&](uint64_t key_id, uint64_t num){ if(key_id == 2) uncompressed_data_size = num; }, [&](uint64_t key_id, double num){}, [&](uint64_t key_id, const uint8_t*str_begin, const uint8_t*str_end){ if(key_id == 1){ uncompressed_begin = str_begin; uncompressed_end = str_end; }else if(key_id == 3){ compressed_begin = str_begin; compressed_end = str_end; } } ); if(uncompressed_begin != nullptr && compressed_begin != nullptr) throw std::runtime_error("PBF error: Blob must not contain both compressed and uncompressed data"); if(uncompressed_begin == nullptr && compressed_begin == nullptr) throw std::runtime_error("PBF error: Blob contains neither compressed nor uncompressed data"); if(uncompressed_data_size == (uint64_t)-1) throw std::runtime_error("PBF error: Blob does not contain the size of the uncompressed data"); if(uncompressed_begin){ if(uncompressed_data_size > how_much_to_read-4) throw std::runtime_error("PBF error: Blob is too large. It is "+std::to_string(uncompressed_data_size) + " but may be at most "+std::to_string(how_much_to_read-4)); if(uncompressed_data_size != (std::uint64_t)(uncompressed_end - uncompressed_begin)) throw std::runtime_error("PBF error: claimed uncompressed blob size does not correspond to actual blob size"); unaligned_store<uint32_t>(buffer, uncompressed_data_size); buffer += 4; memcpy(buffer, uncompressed_begin, uncompressed_data_size); return uncompressed_data_size + 4; }else{ uint64_t compressed_data_size = compressed_end - compressed_begin; if(uncompressed_data_size > how_much_to_read-4) throw std::runtime_error("PBF error: Blob is too large. It is "+std::to_string(uncompressed_data_size) + " but may be at most "+std::to_string(how_much_to_read-4)); unaligned_store<uint32_t>(buffer, uncompressed_data_size); buffer += 4; z_stream z; z.next_in = (unsigned char*) compressed_begin; z.avail_in = compressed_data_size; z.next_out = (unsigned char*) buffer; z.avail_out = how_much_to_read-4; z.zalloc = Z_NULL; z.zfree = Z_NULL; z.opaque = Z_NULL; if(inflateInit(&z) != Z_OK) { throw std::runtime_error("PBF error: Failed to initialize zlib stream."); } if(inflate(&z, Z_FINISH) != Z_STREAM_END) { throw std::runtime_error("PBF error: Failed to completely inflate zlib stream. Probably the OSM blob decompresses to something larger than reported in the header."); } if(inflateEnd(&z) != Z_OK) { throw std::runtime_error("PBF error: Failed to cleanup zlib stream."); } if(z.total_out != uncompressed_data_size) { throw std::runtime_error("PBF error: OSM blob decompresses to fewer bytes than reported in the header."); } return uncompressed_data_size + 4; } }; } private: uint64_t status; BufferedAsyncReader reader; }; } namespace { void internal_read_osm_pbf( BufferedAsyncReader&reader, std::function<void(uint64_t osm_node_id, LatLon p, const TagMap&tags)>node_callback, std::function<void(uint64_t osm_way_id, const std::vector<std::uint64_t>&osm_node_id_list, const TagMap&tags)>way_callback, std::function<void(uint64_t osm_relation_id, const std::vector<OSMRelationMember>&member_list, const TagMap&tags)>relation_callback, std::function<void(std::string msg)>log_message ){ TagMap tag_map; std::vector<OSMRelationMember>member_list; std::vector<uint64_t>node_list; std::vector<const char*>string_table; std::vector<uint32_t>key_list; std::vector<uint32_t>value_list; std::vector<std::pair<const uint8_t*, const uint8_t*>>group_list; for(;;){ uint8_t*primblock_begin, *primblock_end; { uint8_t*s_ptr = reader.read(4); if(s_ptr == nullptr) break; uint32_t s = unaligned_load<uint32_t>(s_ptr); primblock_begin = reader.read_or_throw(s); primblock_end = primblock_begin + s; } string_table.clear(); group_list.clear(); uint64_t latlon_granularity = 100; int64_t offset_of_latitude = 0; int64_t offset_of_longitude = 0; decode_protobuf_message_with_callbacks( primblock_begin, primblock_end, [&](uint64_t key_id, uint64_t num){ if(key_id == 17) latlon_granularity = num; else if(key_id == 19) offset_of_latitude = zigzag_convert_uint64_to_int64(num); else if(key_id == 20) offset_of_longitude = zigzag_convert_uint64_to_int64(num); }, [&](uint64_t key_id, double num){}, [&](uint64_t key_id, uint8_t*outter_blob_begin, uint8_t*outter_blob_end){ if(key_id == 1){ decode_protobuf_message_with_callbacks( outter_blob_begin, outter_blob_end, [&](uint64_t key_id, uint64_t num){}, [&](uint64_t key_id, double num){}, [&](uint64_t key_id, uint8_t*inner_blob_begin, uint8_t*inner_blob_end){ // This is safe, see description of decode_protobuf_message_with_callbacks // for why. char*str_begin = (char*)inner_blob_begin-1; size_t len = inner_blob_end - inner_blob_begin; memmove(str_begin, inner_blob_begin, len); str_begin[len] = '\0'; string_table.push_back(str_begin); } ); }else if(key_id == 2){ group_list.push_back({outter_blob_begin, outter_blob_end}); } } ); if(latlon_granularity == 0) throw std::runtime_error("PBF error: latlon_granularity of a block must not be zero."); double primblock_lon_offset = 0.000000001 * offset_of_latitude; double primblock_lat_offset = 0.000000001 * offset_of_longitude; double primblock_granularity = 0.000000001 * latlon_granularity; auto decode_sparse_node = [&](const uint8_t*begin, const uint8_t*end){ uint64_t osm_node_id = (uint64_t)-1; double latitude = 0.0, longitude = 0.0; const uint8_t *key_begin = nullptr, *key_end = nullptr, *value_begin = nullptr, *value_end = nullptr; decode_protobuf_message_with_callbacks( begin, end, [&](uint64_t key_id, uint64_t num){ if(key_id == 1) osm_node_id = num; else if(key_id == 19) latitude = primblock_lon_offset + primblock_granularity * zigzag_convert_uint64_to_int64(num); else if(key_id == 20) longitude = primblock_lat_offset + primblock_granularity * zigzag_convert_uint64_to_int64(num); }, [&](uint64_t key_id, double num){}, [&](uint64_t key_id, const uint8_t*begin, const uint8_t*end){ if(key_id == 2){ key_begin = begin; key_end = end; }else if(key_id == 3){ value_begin = begin; value_end = end; } } ); if(osm_node_id == (uint64_t)-1) throw std::runtime_error("PBF error: way is missing its OSM ID."); key_list.clear(); value_list.clear(); while(key_begin != key_end && value_begin != value_end){ key_list.push_back(decode_var_uint_from_front_and_advance(key_begin, key_end)); value_list.push_back(decode_var_uint_from_front_and_advance(value_begin, value_end)); } if(key_begin != key_end || value_begin != value_end) throw std::runtime_error("PBF error: key and value arrays do not decode to equal length."); tag_map.build( key_list.size(), [&](uint64_t i){ i = key_list[i]; if(i > string_table.size()) throw std::runtime_error("PBF error: key string ID is out of bounds."); return string_table[i]; }, [&](uint64_t i){ i = value_list[i]; if(i > string_table.size()) throw std::runtime_error("PBF error: value string ID is out of bounds."); return string_table[i]; } ); // FIXME: eliminate doubles node_callback(osm_node_id, LatLon::from_lat_lon(latitude, longitude), tag_map); }; auto decode_dense_node = [&](const uint8_t*begin, const uint8_t*end){ const uint8_t *osm_node_id_begin = nullptr, *osm_node_id_end = nullptr, *key_value_pairs_begin = nullptr, *key_value_pairs_end = nullptr, *latitude_begin = nullptr, *latitude_end = nullptr, *longitude_begin = nullptr, *longitude_end = nullptr; decode_protobuf_message_with_callbacks( begin, end, [&](uint64_t key_id, uint64_t num){}, [&](uint64_t key_id, double num){}, [&](uint64_t key_id, const uint8_t*begin, const uint8_t*end){ if(key_id == 1){ osm_node_id_begin = begin; osm_node_id_end = end; }else if(key_id == 8){ latitude_begin = begin; latitude_end = end; }else if(key_id == 9){ longitude_begin = begin; longitude_end = end; }else if(key_id == 10){ key_value_pairs_begin = begin; key_value_pairs_end = end; } } ); if(osm_node_id_begin == nullptr) throw std::runtime_error("PBF error: dense node must contain node IDs."); if(latitude_begin == nullptr) throw std::runtime_error("PBF error: dense node must contain latitudes."); if(longitude_begin == nullptr) throw std::runtime_error("PBF error: dense node must contain longitudes."); tag_map.clear(); uint64_t osm_node_id = 0; double latitude = 0.0, longitude = 0.0; while(osm_node_id_begin != osm_node_id_end){ osm_node_id += zigzag_convert_uint64_to_int64(decode_var_uint_from_front_and_advance(osm_node_id_begin, osm_node_id_end)); latitude += primblock_lon_offset + primblock_granularity * zigzag_convert_uint64_to_int64(decode_var_uint_from_front_and_advance(latitude_begin, latitude_end)); longitude += primblock_lon_offset + primblock_granularity * zigzag_convert_uint64_to_int64(decode_var_uint_from_front_and_advance(longitude_begin, longitude_end)); if(key_value_pairs_begin != nullptr){ key_list.clear(); value_list.clear(); for(;;){ uint64_t x = decode_var_uint_from_front_and_advance(key_value_pairs_begin, key_value_pairs_end); if(x == 0) break; uint64_t y = decode_var_uint_from_front_and_advance(key_value_pairs_begin, key_value_pairs_end); key_list.push_back(x); value_list.push_back(y); } tag_map.build( key_list.size(), [&](uint64_t i){ i = key_list[i]; if(i > string_table.size()) throw std::runtime_error("PBF error: key string ID is out of bounds."); return string_table[i]; }, [&](uint64_t i){ i = value_list[i]; if(i > string_table.size()) throw std::runtime_error("PBF error: value string ID is out of bounds."); return string_table[i]; } ); } // FIXME: eliminate doubles node_callback(osm_node_id, LatLon::from_lat_lon(latitude, longitude), tag_map); } if(latitude_begin != latitude_end) throw std::runtime_error("PBF error: dense node latitude array has a different length than the node ID array."); if(longitude_begin != longitude_end) throw std::runtime_error("PBF error: dense node longitude array has a different length than the node ID array."); if(key_value_pairs_begin != key_value_pairs_end) throw std::runtime_error("PBF error: dense node key-value array is too long."); }; auto decode_way = [&](const uint8_t*begin, const uint8_t*end){ uint64_t osm_way_id = (uint64_t)-1; const uint8_t *key_begin = nullptr, *key_end = nullptr, *value_begin = nullptr, *value_end = nullptr, *node_list_begin = nullptr, *node_list_end = nullptr; decode_protobuf_message_with_callbacks( begin, end, [&](uint64_t key_id, uint64_t num){ if(key_id == 1){ osm_way_id = num; } }, [&](uint64_t key_id, double num){}, [&](uint64_t key_id, const uint8_t*begin, const uint8_t*end){ if(key_id == 2){ key_begin = begin; key_end = end; }else if(key_id == 3){ value_begin = begin; value_end = end; }else if(key_id == 8){ node_list_begin = begin; node_list_end = end; } } ); if(osm_way_id == (uint64_t)-1) throw std::runtime_error("PBF error: way is missing its OSM ID."); key_list.clear(); value_list.clear(); while(key_begin != key_end && value_begin != value_end){ key_list.push_back(decode_var_uint_from_front_and_advance(key_begin, key_end)); value_list.push_back(decode_var_uint_from_front_and_advance(value_begin, value_end)); } if(key_begin != key_end || value_begin != value_end) throw std::runtime_error("PBF error: key and value arrays do not decode to equal length."); tag_map.build( key_list.size(), [&](uint64_t i){ i = key_list[i]; if(i > string_table.size()) throw std::runtime_error("PBF error: key string ID is out of bounds."); return string_table[i]; }, [&](uint64_t i){ i = value_list[i]; if(i > string_table.size()) throw std::runtime_error("PBF error: value string ID is out of bounds."); return string_table[i]; } ); node_list.clear(); uint64_t id = 0; while(node_list_begin != node_list_end){ id += zigzag_convert_uint64_to_int64(decode_var_uint_from_front_and_advance(node_list_begin, node_list_end)); node_list.push_back(id); } if(node_list.size() == 0) log_message("Warning: OSM way "+std::to_string(osm_way_id)+" has no nodes; ignoring way"); else if(node_list.size() == 1) log_message("Warning: OSM way "+std::to_string(osm_way_id)+" has only one node; ignoring way"); else way_callback(osm_way_id, node_list, tag_map); }; auto decode_relation = [&](const uint8_t*begin, const uint8_t*end){ uint64_t osm_relation_id = (uint64_t)-1; const uint8_t *key_begin = nullptr, *key_end = nullptr, *value_begin = nullptr, *value_end = nullptr, *member_role_begin = nullptr, *member_role_end = nullptr, *member_id_begin = nullptr, *member_id_end = nullptr, *member_type_begin = nullptr, *member_type_end = nullptr; decode_protobuf_message_with_callbacks( begin, end, [&](uint64_t key_id, uint64_t num){ if(key_id == 1){ osm_relation_id = num; } }, [&](uint64_t key_id, double num){}, [&](uint64_t key_id, const uint8_t*begin, const uint8_t*end){ if(key_id == 2){ key_begin = begin; key_end = end; }else if(key_id == 3){ value_begin = begin; value_end = end; }else if(key_id == 8){ member_role_begin = begin; member_role_end = end; }else if(key_id == 9){ member_id_begin = begin; member_id_end = end; }else if(key_id == 10){ member_type_begin = begin; member_type_end = end; } } ); if(osm_relation_id == (uint64_t)-1) throw std::runtime_error("PBF error: way is missing its OSM ID."); key_list.clear(); value_list.clear(); while(key_begin != key_end && value_begin != value_end){ key_list.push_back(decode_var_uint_from_front_and_advance(key_begin, key_end)); value_list.push_back(decode_var_uint_from_front_and_advance(value_begin, value_end)); } if(key_begin != key_end || value_begin != value_end) throw std::runtime_error("PBF error: key and value arrays do not decode to equal length."); tag_map.build( key_list.size(), [&](uint64_t i){ i = key_list[i]; if(i > string_table.size()) throw std::runtime_error("PBF error: key string ID is out of bounds."); return string_table[i]; }, [&](uint64_t i){ i = value_list[i]; if(i > string_table.size()) throw std::runtime_error("PBF error: value string ID is out of bounds."); return string_table[i]; } ); member_list.clear(); uint64_t member_id = 0; while(member_id_begin != member_id_end){ member_id += zigzag_convert_uint64_to_int64(decode_var_uint_from_front_and_advance(member_id_begin, member_id_end)); auto x = decode_var_uint_from_front_and_advance(member_role_begin, member_role_end); if(x >= string_table.size()) throw std::runtime_error("PBF error: relation member role string ID is out of bounds."); const char*role = string_table[x]; uint64_t type_id = decode_var_uint_from_front_and_advance(member_type_begin, member_type_end); OSMIDType member_type; if(type_id == 0) member_type = OSMIDType::node; else if(type_id == 1) member_type = OSMIDType::way; else if(type_id == 2) member_type = OSMIDType::relation; else throw std::runtime_error("PBF error: Unknown relation type."); member_list.push_back({member_type, member_id, role}); } relation_callback(osm_relation_id, member_list, tag_map); }; for(auto g:group_list){ decode_protobuf_message_with_callbacks( g.first, g.second, [&](uint64_t key_id, uint64_t num){}, [&](uint64_t key_id, double num){}, [&](uint64_t key_id, const uint8_t*blob_begin, const uint8_t*blob_end){ if(key_id == 1 && node_callback) { decode_sparse_node(blob_begin, blob_end); } else if(key_id == 2 && node_callback) { decode_dense_node(blob_begin, blob_end); } else if(key_id == 3 && way_callback) { decode_way(blob_begin, blob_end); } else if(key_id == 4 && relation_callback) { decode_relation(blob_begin, blob_end); } } ); } } } } void unordered_read_osm_pbf( const std::string&file_name, std::function<void(uint64_t osm_node_id, LatLon p, const TagMap&tags)>node_callback, std::function<void(uint64_t osm_way_id, Span<const uint64_t>osm_node_id_list, const TagMap&tags)>way_callback, std::function<void(uint64_t osm_relation_id, Span<const OSMRelationMember>member_list, const TagMap&tags)>relation_callback, std::function<void(std::string msg)>log_message ){ assert(node_callback || way_callback || relation_callback); FileDataSource data_source(file_name); OsmPBFDecompressor decompressor(data_source.as_ref()); BufferedAsyncReader reader(decompressor.as_ref(), pbf_decompressor_read_size); internal_read_osm_pbf(reader, node_callback, way_callback, relation_callback, log_message); } void ordered_read_osm_pbf( const std::string&file_name, std::function<void(uint64_t osm_node_id, LatLon p, const TagMap&tags)>node_callback, std::function<void(uint64_t osm_way_id, Span<const uint64_t>osm_node_id_list, const TagMap&tags)>way_callback, std::function<void(uint64_t osm_relation_id, Span<const OSMRelationMember>member_list, const TagMap&tags)>relation_callback, std::function<void(std::string msg)>log_message, bool file_is_ordered_even_though_file_header_says_that_it_is_unordered ){ assert(node_callback || way_callback || relation_callback); FileDataSource data_source(file_name); OsmPBFDecompressor decompressor(data_source.as_ref()); BufferedAsyncReader reader(decompressor.as_ref(), pbf_decompressor_read_size); if(!file_is_ordered_even_though_file_header_says_that_it_is_unordered){ while((decompressor.get_status() & is_header_info_available_bit) == 0){ std::atomic_thread_fence(std::memory_order::memory_order_seq_cst); std::this_thread::yield(); } } if(file_is_ordered_even_though_file_header_says_that_it_is_unordered || (decompressor.get_status() & is_ordered_bit) != 0){ internal_read_osm_pbf(reader, node_callback, way_callback, relation_callback, log_message); } else { if(node_callback){ internal_read_osm_pbf(reader, node_callback, nullptr, nullptr, log_message); if(relation_callback || way_callback){ reader = BufferedAsyncReader(); decompressor = OsmPBFDecompressor(); data_source.rewind(); decompressor = OsmPBFDecompressor(data_source.as_ref()); reader = BufferedAsyncReader(decompressor.as_ref(), pbf_decompressor_read_size); } } if(way_callback){ internal_read_osm_pbf(reader, nullptr, way_callback, nullptr, log_message); if(relation_callback){ reader = BufferedAsyncReader(); decompressor = OsmPBFDecompressor(); data_source.rewind(); decompressor = OsmPBFDecompressor(data_source.as_ref()); reader = BufferedAsyncReader(decompressor.as_ref(), pbf_decompressor_read_size); } } if(relation_callback){ internal_read_osm_pbf(reader, nullptr, nullptr, relation_callback, log_message); } } } } // RoutingKit2
[ "github@ben-strasser.net" ]
github@ben-strasser.net
4845247a17fe6f981c7739667eb353b23c7e1f5e
afc255608753ab472bb0c8d953fb0361bc4ab635
/BLUE_ENGINE/Object.cpp
6b3187495c23c34c04b2e1ee19675251cb8e5973
[]
no_license
Nero-TheThrill/-Game-waybackhome_built-with-customengine
23e8e9866c5e822ed6c507232a9ca25e4a7746ad
70beab0fb81c203701a143244d65aff89b08d104
refs/heads/master
2023-08-21T03:02:28.904343
2021-11-02T11:01:50
2021-11-02T11:01:50
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,114
cpp
/* * File Name : Object.cpp * Primary Author : Choi Jinwoo * Secondary Author : Park Jinwon, Hyun Jina * Brief: Components will be add in this class. * * Copyright (C) 2019 DigiPen Institute of Technology. */ #include"Object.h" #include <cassert> #include "ObjectFactory.h" #include <iostream> #include "Graphics.h" namespace BLUE { Object::Object() { objectID = 0; objType = ObjectType_NULL; shapeType = ShapeType_NULL; transform = nullptr; sprite = nullptr; collision = nullptr; line = nullptr; circle = nullptr; rectangle = nullptr; rigidbody = nullptr; spritetext = nullptr; obb = nullptr; allocatedchart.clear(); allocatedchart[SPRITE] = false; allocatedchart[COLLISION] = false; allocatedchart[RIGIDBODY] = false; allocatedchart[TRANSFORM] = false; allocatedchart[LINE] = false; allocatedchart[CIRCLE] = false; allocatedchart[RECTANGLE] = false; allocatedchart[SPRITETEXT] = false; allocatedchart[OBB] = false; } Object::~Object() { //delete the pointer of components that allocated /* delete particle; particle = nullptr; delete transform; transform = nullptr; delete sprite; sprite = nullptr; delete collision; collision = nullptr; delete line; line = nullptr; delete circle; circle = nullptr; delete rectangle; rectangle = nullptr;*/ } void Object::Init() { //call Init() function for all existing pointer if (transform != nullptr) transform->Init(); if (sprite != nullptr) sprite->Init(); if (collision != nullptr) collision->Init(); if (line != nullptr) line->Init(); if (circle != nullptr) circle->Init(); if (rectangle != nullptr) rectangle->Init(); if (rigidbody != nullptr) rigidbody->Init(); if (spritetext != nullptr) spritetext->Init(); if (obb != nullptr) obb->Init(); } void Object::Destroy(Object* obj) { //std::cout << "Destroy called" << std::endl; OBJECT_FACTORY->Destroy(obj); } bool Object::AddComponent(Component* component) { //<example of using this function> //component_transform=dynamic_cast<Transform*>(component); component->SetOwner(this); switch (component->GetComponentType()) { case ComponentType_SPRITE: sprite = dynamic_cast<Sprite*>(component); GRAPHICS->AddSprite(sprite); allocatedchart[SPRITE]= true; return true; case ComponentType_COLLISION: collision = dynamic_cast<Collision*>(component); allocatedchart[COLLISION] = true; return true; case ComponentType_RIGIDBODY: rigidbody = dynamic_cast<Rigidbody*>(component); allocatedchart[RIGIDBODY] = true; return true; case ComponentType_TRANSFORM: transform = dynamic_cast<Transform*>(component); allocatedchart[TRANSFORM] = true; return true; case ComponentType_LINE: line = dynamic_cast<Line2D*>(component); allocatedchart[LINE] = true; return true; case ComponentType_CIRCLE: circle = dynamic_cast<Circle*>(component); allocatedchart[CIRCLE] = true; return true; case ComponentType_RECTANGLE: rectangle = dynamic_cast<Rectangle*>(component); allocatedchart[RECTANGLE] = true; return true; case ComponentType_SPRITETEXT: spritetext = dynamic_cast<SpriteText*>(component); allocatedchart[SPRITETEXT] = true; return true; case ComponentType_OBB: obb = dynamic_cast<OBB_Collision*>(component); allocatedchart[OBB] = true; return true; default: assert(!"Can't add an unknown component"); break; } return false; } Component* Object::GetComponent(ComponentType ctype) {//<example of using this function> switch (ctype) { case ComponentType_TRANSFORM: return transform; case ComponentType_SPRITE: return sprite; case ComponentType_COLLISION: return collision; case ComponentType_LINE: return line; case ComponentType_CIRCLE: return circle; case ComponentType_RECTANGLE: return rectangle; case ComponentType_RIGIDBODY: return rigidbody; case ComponentType_SPRITETEXT: return spritetext; case ComponentType_OBB: return obb; default: assert(!"Can't get an unknown component"); } return nullptr; } }
[ "imjinwoo98@gmail.com" ]
imjinwoo98@gmail.com
2064e495a303c97258b26928402ee7e732ec827e
37f93566e9f86c197dd2aeb735c59e2d5ebe0f15
/library_gui/CActiveZoneItem.cpp
c239323910460da6b16c9966bed92cfbca3f7eeb
[]
no_license
ProvisionLab/Tracker
7485471a0b4a37fda3245e0db4a48d3d27a49e52
6bf331e364f106d3ea59732355c014c760ff34d8
refs/heads/master
2021-03-24T09:14:05.224024
2020-12-14T15:22:23
2020-12-14T15:22:23
56,514,020
2
0
null
null
null
null
UTF-8
C++
false
false
2,989
cpp
#include "CActiveZoneItem.h" #include <QDebug> #include <QFile> #include <QPainter> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/highgui/highgui.hpp> CActiveZoneItem::CActiveZoneItem(QFileInfo const & f_etalon) { const int tag_len = sizeof("YY_MM_DD_HH_mm_ss")-1; QString fn = f_etalon.fileName(); if ( fn.size() <= tag_len ) return; if( QStringRef(&fn, tag_len, fn.size()-tag_len) != "__etalon.png" ) return; path = f_etalon.absolutePath(); tag = fn.left(tag_len); } bool CActiveZoneItem::exists() const { if (isEmpty()) return false; QDir dir(path); if ( !dir.exists() ) return false; if (!exist_file(get_path_etalon())) return false; if (!exist_file(get_path_left())) return false; if (!exist_file(get_path_right())) return false; if (!exist_file(get_path_left_txt())) return false; if (!exist_file(get_path_right_txt())) return false; return true; } void CActiveZoneItem::deleteFiles() { qDebug() << __FUNCTION__ << path << tag; QFile::remove(get_path_etalon()); QFile::remove(get_path_left()); QFile::remove(get_path_left_txt()); QFile::remove(get_path_right()); QFile::remove(get_path_right_txt()); } QPixmap CActiveZoneItem::getImageCV(QSize iconSize, bool bFixedSize) const { qDebug() << __FUNCTION__ << iconSize << bFixedSize; cv::Mat ref = cv::imread( get_path_etalon().toStdString() ); if (ref.empty()) { return {}; } float scale = std::min(iconSize.height() / (float)ref.rows, iconSize.width() / (float)ref.cols); cv::Mat resized; cv::resize(ref, resized, cv::Size(ref.cols * scale, ref.rows * scale)); cv::Mat resizedRgb; if ( bFixedSize ) { cv::Mat m3(iconSize.width(), iconSize.height(), resized.type()); m3.setTo(0); resized.copyTo(m3(cv::Rect( (m3.cols-resized.cols)/2, (m3.rows-resized.rows)/2, resized.cols, resized.rows)) ); cvtColor(m3, resizedRgb, CV_BGR2RGB); } else { cvtColor(resized, resizedRgb, CV_BGR2RGB); } QImage img((unsigned char*)resizedRgb.data, resizedRgb.cols, resizedRgb.rows, resizedRgb.step, QImage::Format_RGB888); return QPixmap::fromImage(img); } QPixmap CActiveZoneItem::getImageQt(QSize iconSize, bool bFixedSize, QColor bgColor) const { if ( !bFixedSize ) return QPixmap::fromImage( QImage(get_path_etalon()) .scaled(iconSize) ); auto img = QImage(get_path_etalon()) .scaled(iconSize, Qt::KeepAspectRatio); QImage img2(iconSize, img.format()); img2.fill(bgColor); QPainter paint; paint.begin(&img2); paint.drawImage( (iconSize.width()-img.width())/2, (iconSize.height()-img.height())/2, img); paint.end(); return QPixmap::fromImage(img2); }
[ "bondarets.ivan@gmail.com" ]
bondarets.ivan@gmail.com
1cd94061cea2fe4d1daa82d6d860335105ba20f0
855ca9e93e9bf15fde74fe66c1991920605011e4
/video/GLX11Screen.cpp
c44d81e58bafcf7b2c4c6952b9e1a04ec62b4c4e
[ "SGI-B-1.1", "BSD-2-Clause" ]
permissive
szk/reprize
0526959a4affa87ec926c31b7f71c3f925c9a470
a827aa0247f7954f9f36ae573f97db1397645bf5
refs/heads/master
2016-09-06T01:53:33.862334
2016-01-28T15:09:33
2016-01-28T15:09:33
11,900,571
0
1
null
null
null
null
UTF-8
C++
false
false
15,166
cpp
#include "Common.hpp" #include "misc/X11DepInfo.hpp" #include "GLX11Screen.hpp" using namespace reprize; using namespace vid; Int32 sb_config[] = { GLX_DOUBLEBUFFER, GLX_RGBA, GLX_DEPTH_SIZE, 16, GLX_RED_SIZE, 0, GLX_BLUE_SIZE, 0, GLX_GREEN_SIZE, 0, None }; Int32 db_config[] = { GLX_DOUBLEBUFFER, GLX_RGBA, GLX_DEPTH_SIZE, 16, GLX_RED_SIZE, 0, GLX_BLUE_SIZE, 0, GLX_GREEN_SIZE, 0, GLX_DOUBLEBUFFER, None }; PFNGLATTACHSHADERPROC glAttachShader; PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation; PFNGLBLENDEQUATIONSEPARATEPROC glBlendEquationSeparate; PFNGLCOMPILESHADERPROC glCompileShader; PFNGLCREATEPROGRAMPROC glCreateProgram; PFNGLCREATESHADERPROC glCreateShader; PFNGLDELETEPROGRAMPROC glDeleteProgram; PFNGLDELETESHADERPROC glDeleteShader; PFNGLDETACHSHADERPROC glDetachShader; PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray; PFNGLDRAWBUFFERSPROC glDrawBuffers; PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray; PFNGLGETACTIVEATTRIBPROC glGetActiveAttrib; PFNGLGETACTIVEUNIFORMPROC glGetActiveUniform; PFNGLGETATTACHEDSHADERSPROC glGetAttachedShaders; PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation; PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog; PFNGLGETPROGRAMIVPROC glGetProgramiv; PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog; PFNGLGETSHADERIVPROC glGetShaderiv; PFNGLGETSHADERSOURCEPROC glGetShaderSource; PFNGLGETUNIFORMFVPROC glGetUniformfv; PFNGLGETUNIFORMIVPROC glGetUniformiv; PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation; PFNGLGETVERTEXATTRIBDVPROC glGetVertexAttribdv; PFNGLGETVERTEXATTRIBFVPROC glGetVertexAttribfv; PFNGLGETVERTEXATTRIBIVPROC glGetVertexAttribiv; PFNGLGETVERTEXATTRIBPOINTERVPROC glGetVertexAttribPointerv; PFNGLISPROGRAMPROC glIsProgram; PFNGLISSHADERPROC glIsShader; PFNGLLINKPROGRAMPROC glLinkProgram; PFNGLSHADERSOURCEPROC glShaderSource; PFNGLSTENCILFUNCSEPARATEPROC glStencilFuncSeparate; PFNGLSTENCILMASKSEPARATEPROC glStencilMaskSeparate; PFNGLSTENCILOPSEPARATEPROC glStencilOpSeparate; PFNGLUNIFORM1FPROC glUniform1f; PFNGLUNIFORM1FVPROC glUniform1fv; PFNGLUNIFORM1IPROC glUniform1i; PFNGLUNIFORM1IVPROC glUniform1iv; PFNGLUNIFORM2FPROC glUniform2f; PFNGLUNIFORM2FVPROC glUniform2fv; PFNGLUNIFORM2IPROC glUniform2i; PFNGLUNIFORM2IVPROC glUniform2iv; PFNGLUNIFORM3FPROC glUniform3f; PFNGLUNIFORM3FVPROC glUniform3fv; PFNGLUNIFORM3IPROC glUniform3i; PFNGLUNIFORM3IVPROC glUniform3iv; PFNGLUNIFORM4FPROC glUniform4f; PFNGLUNIFORM4FVPROC glUniform4fv; PFNGLUNIFORM4IPROC glUniform4i; PFNGLUNIFORM4IVPROC glUniform4iv; PFNGLUNIFORMMATRIX2FVPROC glUniformMatrix2fv; PFNGLUNIFORMMATRIX3FVPROC glUniformMatrix3fv; PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv; PFNGLUSEPROGRAMPROC glUseProgram; PFNGLVALIDATEPROGRAMPROC glValidateProgram; PFNGLVERTEXATTRIB1DPROC glVertexAttrib1d; PFNGLVERTEXATTRIB1DVPROC glVertexAttrib1dv; PFNGLVERTEXATTRIB1FPROC glVertexAttrib1f; PFNGLVERTEXATTRIB1FVPROC glVertexAttrib1fv; PFNGLVERTEXATTRIB1SPROC glVertexAttrib1s; PFNGLVERTEXATTRIB1SVPROC glVertexAttrib1sv; PFNGLVERTEXATTRIB2DPROC glVertexAttrib2d; PFNGLVERTEXATTRIB2DVPROC glVertexAttrib2dv; PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f; PFNGLVERTEXATTRIB2FVPROC glVertexAttrib2fv; PFNGLVERTEXATTRIB2SPROC glVertexAttrib2s; PFNGLVERTEXATTRIB2SVPROC glVertexAttrib2sv; PFNGLVERTEXATTRIB3DPROC glVertexAttrib3d; PFNGLVERTEXATTRIB3DVPROC glVertexAttrib3dv; PFNGLVERTEXATTRIB3FPROC glVertexAttrib3f; PFNGLVERTEXATTRIB3FVPROC glVertexAttrib3fv; PFNGLVERTEXATTRIB3SPROC glVertexAttrib3s; PFNGLVERTEXATTRIB3SVPROC glVertexAttrib3sv; PFNGLVERTEXATTRIB4BVPROC glVertexAttrib4bv; PFNGLVERTEXATTRIB4DPROC glVertexAttrib4d; PFNGLVERTEXATTRIB4DVPROC glVertexAttrib4dv; PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f; PFNGLVERTEXATTRIB4FVPROC glVertexAttrib4fv; PFNGLVERTEXATTRIB4IVPROC glVertexAttrib4iv; PFNGLVERTEXATTRIB4NBVPROC glVertexAttrib4Nbv; PFNGLVERTEXATTRIB4NIVPROC glVertexAttrib4Niv; PFNGLVERTEXATTRIB4NSVPROC glVertexAttrib4Nsv; PFNGLVERTEXATTRIB4NUBPROC glVertexAttrib4Nub; PFNGLVERTEXATTRIB4NUBVPROC glVertexAttrib4Nubv; PFNGLVERTEXATTRIB4NUIVPROC glVertexAttrib4Nuiv; PFNGLVERTEXATTRIB4NUSVPROC glVertexAttrib4Nusv; PFNGLVERTEXATTRIB4SPROC glVertexAttrib4s; PFNGLVERTEXATTRIB4SVPROC glVertexAttrib4sv; PFNGLVERTEXATTRIB4UBVPROC glVertexAttrib4ubv; PFNGLVERTEXATTRIB4UIVPROC glVertexAttrib4uiv; PFNGLVERTEXATTRIB4USVPROC glVertexAttrib4usv; PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer; GLX11Screen::GLX11Screen(X11DepInfo* depinfo_) : Screen(depinfo_), x11_info(depinfo_), vi(NULL), sz_hints(NULL), wm_hints(NULL), doublebuffer(false) { if (!(sz_hints = XAllocSizeHints())) { g_log->printf("Could not alloc XSizeHints"); } if (!(wm_hints = XAllocWMHints())) { g_log->printf("Could not alloc XWMHints"); } } GLX11Screen::~GLX11Screen(void) { XFree(vi); XFree(sz_hints); XFree(wm_hints); } void GLX11Screen::init(void) { Int32 dummy; if (!glXQueryExtension(x11_info->get_dpy(), &dummy, &dummy)) { g_log->printf("Can't get query extension"); g_log->printf("X server doesn't have glx extension"); return; } if ((vi = glXChooseVisual(x11_info->get_dpy(), x11_info->get_scr(), db_config))) { doublebuffer = true; } else if ((vi = glXChooseVisual(x11_info->get_dpy(), x11_info->get_scr(), sb_config))) { doublebuffer = false; } else { g_log->printf("No RGB visual with depth buffer"); return; } GLXContext cx; // if (!(cx = glXCreateContext(x11_info->get_dpy(), vi, None, GL_FALSE))) // { g_log->printf("Could not create rendering context"); } if (!(cx = glXCreateContext(x11_info->get_dpy(), vi, None, GL_TRUE))) { g_log->printf("Could not create rendering context"); } Colormap cmap; cmap = XCreateColormap(x11_info->get_dpy(), RootWindow(x11_info->get_dpy(), vi->screen), vi->visual, AllocNone); XSetWindowAttributes win_att; win_att.colormap = cmap; win_att.border_pixel = 0; win_att.event_mask = ExposureMask | ButtonPressMask | StructureNotifyMask; sz_hints->flags = USSize | USPosition | PMaxSize | PMinSize | PBaseSize; sz_hints->base_width = SCREEN_WIDTH; sz_hints->base_height = SCREEN_HEIGHT; sz_hints->min_width = SCREEN_WIDTH; sz_hints->min_height = SCREEN_HEIGHT; sz_hints->max_width = SCREEN_WIDTH; sz_hints->max_height = SCREEN_HEIGHT; x11_info->set_win(XCreateWindow(x11_info->get_dpy(), RootWindow(x11_info->get_dpy(), vi->screen), 0, 0, sz_hints->base_width, sz_hints->base_height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel | CWColormap | CWEventMask, &win_att)); XSetStandardProperties(x11_info->get_dpy(), x11_info->get_win(), TITLE, TITLE, None, x11_info->get_argv(), x11_info->get_argc(), sz_hints); wm_hints->initial_state = NormalState; wm_hints->flags = StateHint; XSetWMHints(x11_info->get_dpy(), x11_info->get_win(), wm_hints); XSelectInput(x11_info->get_dpy(), x11_info->get_win(), (ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask | PointerMotionMask | KeyPressMask | KeyReleaseMask | FocusChangeMask | VisibilityChangeMask | StructureNotifyMask)); x11_info->set_del_atom(XInternAtom(x11_info->get_dpy(), "WM_DELETE_WINDOW", False)); XSetWMProtocols(x11_info->get_dpy(), x11_info->get_win(), x11_info->get_del_atom(), 1); glXMakeCurrent(x11_info->get_dpy(), x11_info->get_win(), cx); kill_cursor(); alloc_extension(); Screen::init(); } void GLX11Screen::appear(void) { //show the window XMapWindow(x11_info->get_dpy(), x11_info->get_win()); } void GLX11Screen::begin_paint(void) { } void GLX11Screen::finish_paint(void) { } const bool GLX11Screen::flip(void) { if (doublebuffer) { glXSwapBuffers(x11_info->get_dpy(), x11_info->get_win()); } else { glFlush(); } return true; } void GLX11Screen::release(void) { } #define PADDR(functype, funcname) \ ((funcname = (functype) glXGetProcAddress( #funcname )) == 0) const bool GLX11Screen::alloc_extension(void) { // XXX Str ext_str(reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS))); // we need pbo or fbo or vbo, and shaders // std::cerr << ext_str << std::endl; int err = 0; // glXGetProcAddressARB #ifdef UNDEF err |= PADDR(PFNGLATTACHSHADERPROC, glAttachShader); err |= PADDR(PFNGLBINDATTRIBLOCATIONPROC, glBindAttribLocation); err |= PADDR(PFNGLBLENDEQUATIONSEPARATEPROC, glBlendEquationSeparate); err |= PADDR(PFNGLCOMPILESHADERPROC, glCompileShader); err |= PADDR(PFNGLCREATEPROGRAMPROC, glCreateProgram); err |= PADDR(PFNGLCREATESHADERPROC, glCreateShader); err |= PADDR(PFNGLDELETEPROGRAMPROC, glDeleteProgram); err |= PADDR(PFNGLDELETESHADERPROC, glDeleteShader); err |= PADDR(PFNGLDETACHSHADERPROC, glDetachShader); err |= PADDR(PFNGLDISABLEVERTEXATTRIBARRAYPROC, glDisableVertexAttribArray); err |= PADDR(PFNGLDRAWBUFFERSPROC, glDrawBuffers); err |= PADDR(PFNGLENABLEVERTEXATTRIBARRAYPROC, glEnableVertexAttribArray); err |= PADDR(PFNGLGETACTIVEATTRIBPROC, glGetActiveAttrib); err |= PADDR(PFNGLGETACTIVEUNIFORMPROC, glGetActiveUniform); err |= PADDR(PFNGLGETATTACHEDSHADERSPROC, glGetAttachedShaders); err |= PADDR(PFNGLGETATTRIBLOCATIONPROC, glGetAttribLocation); err |= PADDR(PFNGLGETPROGRAMINFOLOGPROC, glGetProgramInfoLog); err |= PADDR(PFNGLGETPROGRAMIVPROC, glGetProgramiv); err |= PADDR(PFNGLGETSHADERINFOLOGPROC, glGetShaderInfoLog); err |= PADDR(PFNGLGETSHADERIVPROC, glGetShaderiv); err |= PADDR(PFNGLGETSHADERSOURCEPROC, glGetShaderSource); err |= PADDR(PFNGLGETUNIFORMFVPROC, glGetUniformfv); err |= PADDR(PFNGLGETUNIFORMIVPROC, glGetUniformiv); err |= PADDR(PFNGLGETUNIFORMLOCATIONPROC, glGetUniformLocation); err |= PADDR(PFNGLGETVERTEXATTRIBDVPROC, glGetVertexAttribdv); err |= PADDR(PFNGLGETVERTEXATTRIBFVPROC, glGetVertexAttribfv); err |= PADDR(PFNGLGETVERTEXATTRIBIVPROC, glGetVertexAttribiv); err |= PADDR(PFNGLGETVERTEXATTRIBPOINTERVPROC, glGetVertexAttribPointerv); err |= PADDR(PFNGLISPROGRAMPROC, glIsProgram); err |= PADDR(PFNGLISSHADERPROC, glIsShader); err |= PADDR(PFNGLLINKPROGRAMPROC, glLinkProgram); err |= PADDR(PFNGLSHADERSOURCEPROC, glShaderSource); err |= PADDR(PFNGLSTENCILFUNCSEPARATEPROC, glStencilFuncSeparate); err |= PADDR(PFNGLSTENCILMASKSEPARATEPROC, glStencilMaskSeparate); err |= PADDR(PFNGLSTENCILOPSEPARATEPROC, glStencilOpSeparate); err |= PADDR(PFNGLUNIFORM1FPROC, glUniform1f); err |= PADDR(PFNGLUNIFORM1FVPROC, glUniform1fv); err |= PADDR(PFNGLUNIFORM1IPROC, glUniform1i); err |= PADDR(PFNGLUNIFORM1IVPROC, glUniform1iv); err |= PADDR(PFNGLUNIFORM2FPROC, glUniform2f); err |= PADDR(PFNGLUNIFORM2FVPROC, glUniform2fv); err |= PADDR(PFNGLUNIFORM2IPROC, glUniform2i); err |= PADDR(PFNGLUNIFORM2IVPROC, glUniform2iv); err |= PADDR(PFNGLUNIFORM3FPROC, glUniform3f); err |= PADDR(PFNGLUNIFORM3FVPROC, glUniform3fv); err |= PADDR(PFNGLUNIFORM3IPROC, glUniform3i); err |= PADDR(PFNGLUNIFORM3IVPROC, glUniform3iv); err |= PADDR(PFNGLUNIFORM4FPROC, glUniform4f); err |= PADDR(PFNGLUNIFORM4FVPROC, glUniform4fv); err |= PADDR(PFNGLUNIFORM4IPROC, glUniform4i); err |= PADDR(PFNGLUNIFORM4IVPROC, glUniform4iv); err |= PADDR(PFNGLUNIFORMMATRIX2FVPROC, glUniformMatrix2fv); err |= PADDR(PFNGLUNIFORMMATRIX3FVPROC, glUniformMatrix3fv); err |= PADDR(PFNGLUNIFORMMATRIX4FVPROC, glUniformMatrix4fv); err |= PADDR(PFNGLUSEPROGRAMPROC, glUseProgram); err |= PADDR(PFNGLVALIDATEPROGRAMPROC, glValidateProgram); err |= PADDR(PFNGLVERTEXATTRIB1DPROC, glVertexAttrib1d); err |= PADDR(PFNGLVERTEXATTRIB1DVPROC, glVertexAttrib1dv); err |= PADDR(PFNGLVERTEXATTRIB1FPROC, glVertexAttrib1f); err |= PADDR(PFNGLVERTEXATTRIB1FVPROC, glVertexAttrib1fv); err |= PADDR(PFNGLVERTEXATTRIB1SPROC, glVertexAttrib1s); err |= PADDR(PFNGLVERTEXATTRIB1SVPROC, glVertexAttrib1sv); err |= PADDR(PFNGLVERTEXATTRIB2DPROC, glVertexAttrib2d); err |= PADDR(PFNGLVERTEXATTRIB2DVPROC, glVertexAttrib2dv); err |= PADDR(PFNGLVERTEXATTRIB2FPROC, glVertexAttrib2f); err |= PADDR(PFNGLVERTEXATTRIB2FVPROC, glVertexAttrib2fv); err |= PADDR(PFNGLVERTEXATTRIB2SPROC, glVertexAttrib2s); err |= PADDR(PFNGLVERTEXATTRIB2SVPROC, glVertexAttrib2sv); err |= PADDR(PFNGLVERTEXATTRIB3DPROC, glVertexAttrib3d); err |= PADDR(PFNGLVERTEXATTRIB3DVPROC, glVertexAttrib3dv); err |= PADDR(PFNGLVERTEXATTRIB3FPROC, glVertexAttrib3f); err |= PADDR(PFNGLVERTEXATTRIB3FVPROC, glVertexAttrib3fv); err |= PADDR(PFNGLVERTEXATTRIB3SPROC, glVertexAttrib3s); err |= PADDR(PFNGLVERTEXATTRIB3SVPROC, glVertexAttrib3sv); err |= PADDR(PFNGLVERTEXATTRIB4BVPROC, glVertexAttrib4bv); err |= PADDR(PFNGLVERTEXATTRIB4DPROC, glVertexAttrib4d); err |= PADDR(PFNGLVERTEXATTRIB4DVPROC, glVertexAttrib4dv); err |= PADDR(PFNGLVERTEXATTRIB4FPROC, glVertexAttrib4f); err |= PADDR(PFNGLVERTEXATTRIB4FVPROC, glVertexAttrib4fv); err |= PADDR(PFNGLVERTEXATTRIB4IVPROC, glVertexAttrib4iv); err |= PADDR(PFNGLVERTEXATTRIB4NBVPROC, glVertexAttrib4Nbv); err |= PADDR(PFNGLVERTEXATTRIB4NIVPROC, glVertexAttrib4Niv); err |= PADDR(PFNGLVERTEXATTRIB4NSVPROC, glVertexAttrib4Nsv); err |= PADDR(PFNGLVERTEXATTRIB4NUBPROC, glVertexAttrib4Nub); err |= PADDR(PFNGLVERTEXATTRIB4NUBVPROC, glVertexAttrib4Nubv); err |= PADDR(PFNGLVERTEXATTRIB4NUIVPROC, glVertexAttrib4Nuiv); err |= PADDR(PFNGLVERTEXATTRIB4NUSVPROC, glVertexAttrib4Nusv); err |= PADDR(PFNGLVERTEXATTRIB4SPROC, glVertexAttrib4s); err |= PADDR(PFNGLVERTEXATTRIB4SVPROC, glVertexAttrib4sv); err |= PADDR(PFNGLVERTEXATTRIB4UBVPROC, glVertexAttrib4ubv); err |= PADDR(PFNGLVERTEXATTRIB4UIVPROC, glVertexAttrib4uiv); err |= PADDR(PFNGLVERTEXATTRIB4USVPROC, glVertexAttrib4usv); err |= PADDR(PFNGLVERTEXATTRIBPOINTERPROC, glVertexAttribPointer); #endif return false; } void GLX11Screen::kill_cursor(void) { static Cursor empty_cursor = static_cast<Cursor>(NULL); if (empty_cursor == static_cast<Cursor>(NULL)) { static char bits[] = { 0, 0, 0, 0, 0, 0, 0, 0, }; Pixmap pm = XCreateBitmapFromData(x11_info->get_dpy(), x11_info->get_win(), bits, 8, 8); XColor color; color.pixel = color.red = color.green = color.blue = 0; color.flags = DoGreen | DoRed | DoBlue; empty_cursor = XCreatePixmapCursor(x11_info->get_dpy(), pm, pm, &color, &color, 0, 0); } XDefineCursor(x11_info->get_dpy(), x11_info->get_win(), empty_cursor); }
[ "s@vram.org" ]
s@vram.org
0ff1aea4371eed1604a0fe97e9ed70c543644723
f4d62879bd6cc2d6c15eb21ea3d14101ed4eed2b
/plugins/win-mf/mf-h264-encoder.hpp
0d79050fd2c4b008e8520d0161ba6ec84a3b597a
[]
no_license
LiuKeHua/MyObsStudio
ccc9befec01458d126970868c70413dd4755463c
3fbb813550572d417355b40039bc0e3c1f030a2e
refs/heads/master
2020-04-03T14:41:58.413711
2018-12-10T03:43:46
2018-12-10T03:43:46
155,331,426
2
0
null
null
null
null
UTF-8
C++
false
false
4,452
hpp
#pragma once #include <obs-module.h> #define WIN32_MEAN_AND_LEAN #include <Windows.h> #undef WIN32_MEAN_AND_LEAN #include <mfapi.h> #include <mfidl.h> #include <wmcodecdsp.h> #include <vector> #include <queue> #include <memory> #include <atomic> #include <util/windows/ComPtr.hpp> #include "mf-encoder-descriptor.hpp" #include "mf-common.hpp" namespace MF { enum H264Profile { H264ProfileBaseline, H264ProfileMain, H264ProfileHigh }; enum H264RateControl { H264RateControlCBR, H264RateControlConstrainedVBR, H264RateControlVBR, H264RateControlCQP }; struct H264QP { UINT16 defaultQp; UINT16 i; UINT16 p; UINT16 b; UINT64 Pack(bool packDefault) { int shift = packDefault ? 0 : 16; UINT64 packedQp; if (packDefault) packedQp = defaultQp; packedQp |= i << shift; shift += 16; packedQp |= p << shift; shift += 16; packedQp |= b << shift; return packedQp; } }; enum H264EntropyEncoding { H264EntropyEncodingCABLC, H264EntropyEncodingCABAC }; struct H264Frame { public: H264Frame(bool keyframe, UINT64 pts, UINT64 dts, std::unique_ptr<std::vector<uint8_t>> data) : keyframe(keyframe), pts(pts), dts(dts), data(std::move(data)) {} bool Keyframe() { return keyframe; } BYTE *Data() { return data.get()->data(); } DWORD DataLength() { return (DWORD)data.get()->size(); } INT64 Pts() { return pts; } INT64 Dts() { return dts; } private: H264Frame(H264Frame const&) = delete; H264Frame& operator=(H264Frame const&) = delete; private: bool keyframe; INT64 pts; INT64 dts; std::unique_ptr<std::vector<uint8_t>> data; }; class H264Encoder { public: H264Encoder(const obs_encoder_t *encoder, std::shared_ptr<EncoderDescriptor> descriptor, UINT32 width, UINT32 height, UINT32 framerateNum, UINT32 framerateDen, H264Profile profile, UINT32 bitrate); ~H264Encoder(); bool Initialize(std::function<bool(void)> func); bool ProcessInput(UINT8 **data, UINT32 *linesize, UINT64 pts, Status *status); bool ProcessOutput(UINT8 **data, UINT32 *dataLength, UINT64 *pts, UINT64 *dts, bool *keyframe, Status *status); bool ExtraData(UINT8 **data, UINT32 *dataLength); const obs_encoder_t *ObsEncoder() { return encoder; } public: bool SetBitrate(UINT32 bitrate); bool SetQP(H264QP &qp); bool SetMaxBitrate(UINT32 maxBitrate); bool SetRateControl(H264RateControl rateControl); bool SetKeyframeInterval(UINT32 seconds); bool SetLowLatency(bool lowLatency); bool SetBufferSize(UINT32 bufferSize); bool SetBFrameCount(UINT32 bFrames); bool SetEntropyEncoding(H264EntropyEncoding entropyEncoding); bool SetMinQP(UINT32 minQp); bool SetMaxQP(UINT32 maxQp); private: H264Encoder(H264Encoder const&) = delete; H264Encoder& operator=(H264Encoder const&) = delete; private: HRESULT InitializeEventGenerator(); HRESULT InitializeExtraData(); HRESULT CreateMediaTypes(ComPtr<IMFMediaType> &inputType, ComPtr<IMFMediaType> &outputType); HRESULT EnsureCapacity(ComPtr<IMFSample> &sample, DWORD length); HRESULT CreateEmptySample(ComPtr<IMFSample> &sample, ComPtr<IMFMediaBuffer> &buffer, DWORD length); HRESULT ProcessInput(ComPtr<IMFSample> &sample); HRESULT ProcessOutput(); HRESULT DrainEvent(bool block); HRESULT DrainEvents(); private: const obs_encoder_t *encoder; std::shared_ptr<EncoderDescriptor> descriptor; const UINT32 width; const UINT32 height; const UINT32 framerateNum; const UINT32 framerateDen; const UINT32 initialBitrate; const H264Profile profile; bool createOutputSample; ComPtr<IMFTransform> transform; ComPtr<ICodecAPI> codecApi; std::vector<BYTE> extraData; // The frame returned by ProcessOutput // Valid until the next call to ProcessOutput std::unique_ptr<H264Frame> activeFrame; // Queued input samples that the encoder was not ready // to process std::queue<ComPtr<IMFSample>> inputSamples; // Queued output samples that have not been returned from // ProcessOutput yet std::queue<std::unique_ptr<H264Frame>> encodedFrames; ComPtr<IMFMediaEventGenerator> eventGenerator; std::atomic<UINT32> inputRequests = 0; std::atomic<UINT32> outputRequests = 0; std::atomic<UINT32> pendingRequests = 0; }; }
[ "liukehua880123@163.com" ]
liukehua880123@163.com
4ef0382f74b46b74a3b6e5b901a012e27e88f736
c816f5db557bf7cd9e1b4f694947079e7932b249
/Arduino_package/hardware/libraries/WiFi/examples/SimpleWebServerWiFi/SimpleWebServerWiFi.ino
8b2b993933ba217bb32f45afd598e829d48bb13a
[]
no_license
happyme531/ambd_arduino
ff9eb67f228f7c4c54442038978baeaa4fbef893
8b4d7b100d9632a1772aa92d36f0525a38709d8b
refs/heads/master
2023-05-12T12:17:11.519167
2021-06-05T14:00:47
2021-06-05T14:00:47
349,416,367
0
1
null
2021-05-02T08:57:32
2021-03-19T12:32:01
C
UTF-8
C++
false
false
4,561
ino
#include <WiFi.h> char ssid[] = "yourNetwork"; // your network SSID (name) char pass[] = "Password"; // your network password int keyIndex = 0; // your network key Index number (needed only for WEP) int status = WL_IDLE_STATUS; WiFiServer server(80); void setup() { Serial.begin(115200); // initialize serial communication pinMode(13, OUTPUT); // set the LED pin mode // check for the presence of the shield: if (WiFi.status() == WL_NO_SHIELD) { Serial.println("WiFi shield not present"); while (true); // don't continue } // attempt to connect to Wifi network: while (status != WL_CONNECTED) { Serial.print("Attempting to connect to Network named: "); Serial.println(ssid); // print the network name (SSID); // Connect to WPA/WPA2 network. Change this line if using open or WEP network: status = WiFi.begin(ssid, pass); // wait 10 seconds for connection: delay(10000); } server.begin(); // start the web server on port 80 printWifiStatus(); // you're connected now, so print out the status } void loop() { WiFiClient client = server.available(); // listen for incoming clients if (client) { // if you get a client, Serial.println("new client"); // print a message out the serial port String currentLine = ""; // make a String to hold incoming data from the client while (client.connected()) { // loop while the client's connected if (client.available()) { // if there's bytes to read from the client, char c = client.read(); // read a byte, then Serial.write(c); // print it out the serial monitor if (c == '\n') { // if the byte is a newline character // if the current line is blank, you got two newline characters in a row. // that's the end of the client HTTP request, so send a response: if (currentLine.length() == 0) { // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK) // and a content-type so the client knows what's coming, then a blank line: client.println("HTTP/1.1 200 OK"); client.println("Content-type:text/html"); client.println(); // the content of the HTTP response follows the header: client.print("Click <a href=\"/H\">here</a> turn the LED on pin 13 on<br>"); client.print("Click <a href=\"/L\">here</a> turn the LED on pin 13 off<br>"); // The HTTP response ends with another blank line: client.println(); // break out of the while loop: break; } else { // if you got a newline, then clear currentLine: currentLine = ""; } } else if (c != '\r') { // if you got anything else but a carriage return character, currentLine += c; // add it to the end of the currentLine } // Check to see if the client request was "GET /H" or "GET /L": if (currentLine.endsWith("GET /H")) { digitalWrite(13, HIGH); // GET /H turns the LED on } if (currentLine.endsWith("GET /L")) { digitalWrite(13, LOW); // GET /L turns the LED off } } } // close the connection: client.stop(); Serial.println("client disonnected"); } } void printWifiStatus() { // print the SSID of the network you're attached to: Serial.print("SSID: "); Serial.println(WiFi.SSID()); // print your WiFi shield's IP address: IPAddress ip = WiFi.localIP(); Serial.print("IP Address: "); Serial.println(ip); // print the received signal strength: long rssi = WiFi.RSSI(); Serial.print("signal strength (RSSI):"); Serial.print(rssi); Serial.println(" dBm"); // print where to go in a browser: Serial.print("To see this page in action, open a browser to http://"); Serial.println(ip); }
[ "zhangzhenwu@realtek-sg.com" ]
zhangzhenwu@realtek-sg.com
f87341d2c63779f9f1750b9cf6ad176adffbadae
ca249ca9733de013d6c5e317551897fa56479d15
/3120.cpp
574ac0a443f3ca05b6ae055e10bf348b54b5ffbd
[]
no_license
fjl1005/BSOJ-answers
6d2055a6e3229e06bf81be45996d20a0b587e349
7773b1c588d3f17eef470dfba2daa59be3fce7fa
refs/heads/master
2020-06-28T22:55:52.475735
2019-08-03T11:42:37
2019-08-03T11:42:37
200,363,773
0
0
null
null
null
null
UTF-8
C++
false
false
640
cpp
#include<cstdio> #include<algorithm> using namespace std; int l,t,n; struct q { int x; char ch; } a[70005]; int cmp(q a,q b) { return a.x<=b.x; } int main() { scanf("%d%d%d",&l,&t,&n); for(int i=1; i<=n; i++) { scanf("%d %c",&a[i].x,&a[i].ch); if(a[i].ch=='D') { a[i].x+=t; a[i].x%=2*l; if(a[i].x>=l) { a[i].x=2*l-a[i].x; } } else { if(t>=a[i].x) { a[i].x=t-a[i].x; a[i].x%=2*l; if(a[i].x>=l) { a[i].x=2*l-a[i].x; } } else { a[i].x=a[i].x-t; } } } sort(a+1,a+n+1,cmp); for(int i=1; i<=n; i++) { printf("%d ",a[i].x); } return 0; }
[ "noreply@github.com" ]
fjl1005.noreply@github.com
76593f5604a80c025231badd951dae9454b7b022
a62342d6359a88b0aee911e549a4973fa38de9ea
/0.6.0.3/Internal/SDK/BP_Chroma_classes.h
071ff38108ac68335ab834eb39e1d21a32f725fb
[]
no_license
zanzo420/Medieval-Dynasty-SDK
d020ad634328ee8ee612ba4bd7e36b36dab740ce
d720e49ae1505e087790b2743506921afb28fc18
refs/heads/main
2023-06-20T03:00:17.986041
2021-07-15T04:51:34
2021-07-15T04:51:34
386,165,085
0
0
null
null
null
null
UTF-8
C++
false
false
8,905
h
#pragma once // Name: Medieval Dynasty, Version: 0.6.0.3 /*!!DEFINE!!*/ /*!!HELPER_DEF!!*/ /*!!HELPER_INC!!*/ #ifdef _MSC_VER #pragma pack(push, 0x01) #endif namespace CG { //--------------------------------------------------------------------------- // Classes //--------------------------------------------------------------------------- // BlueprintGeneratedClass BP_Chroma.BP_Chroma_C // 0x00E0 (FullSize[0x0300] - InheritedSize[0x0220]) class ABP_Chroma_C : public AActor { public: struct FPointerToUberGraphFrame UberGraphFrame; // 0x0220(0x0008) (ZeroConstructor, Transient, DuplicateTransient, UObjectWrapper) class USceneComponent* DefaultSceneRoot; // 0x0228(0x0008) (BlueprintVisible, ZeroConstructor, InstancedReference, IsPlainOldData, NonTransactional, NoDestructor, UObjectWrapper, HasGetValueTypeHash) int MainID; // 0x0230(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) int HealthBarID; // 0x0234(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) int FoodBarID; // 0x0238(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) int WaterBarID; // 0x023C(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) int QuickslotBarID; // 0x0240(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) int HealthAnimChoicer; // 0x0244(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) int FoodAnimChoicer; // 0x0248(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) int WaterAnimChoicer; // 0x024C(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) int HealthThreshold; // 0x0250(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) int FoodThreshold; // 0x0254(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) int WaterThreshold; // 0x0258(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) unsigned char UnknownData_SK4S[0x4]; // 0x025C(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TArray<TEnumAsByte<ChromaSDKPlugin_EChromaSDKKeyboardKey>> HealthBarKeys; // 0x0260(0x0010) (Edit, BlueprintVisible, DisableEditOnInstance) TArray<TEnumAsByte<ChromaSDKPlugin_EChromaSDKKeyboardKey>> FoodBarKeys; // 0x0270(0x0010) (Edit, BlueprintVisible, DisableEditOnInstance) TArray<TEnumAsByte<ChromaSDKPlugin_EChromaSDKKeyboardKey>> WaterBarKeys; // 0x0280(0x0010) (Edit, BlueprintVisible, DisableEditOnInstance) TArray<TEnumAsByte<ChromaSDKPlugin_EChromaSDKKeyboardKey>> QuickslotBarKeys; // 0x0290(0x0010) (Edit, BlueprintVisible, DisableEditOnInstance) struct FLinearColor InactiveKeyColor; // 0x02A0(0x0010) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) struct FLinearColor BackgroundColor; // 0x02B0(0x0010) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) struct FLinearColor EquippedColor; // 0x02C0(0x0010) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) struct FLinearColor SelectedColor; // 0x02D0(0x0010) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) bool HealthUpdate; // 0x02E0(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor) bool FoodUpdate; // 0x02E1(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor) bool WaterUpdate; // 0x02E2(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor) bool ShowBars; // 0x02E3(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor) float AnimEffectTimer; // 0x02E4(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) float AnimTickTimer; // 0x02E8(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) unsigned char UnknownData_Q67K[0x4]; // 0x02EC(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class APC_Player_C* PCPlayerReference; // 0x02F0(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnTemplate, DisableEditOnInstance, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash) struct FName CurrentEffectRow; // 0x02F8(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) static UClass* StaticClass() { static auto ptr = UObject::FindClass("BlueprintGeneratedClass BP_Chroma.BP_Chroma_C"); return ptr; } void PrepareHealthFrames(); void PrepareFoodFrames(); void PrepareWaterFrames(); void UpdateQuickslots(); void CheckIfWaterUpdateNeeded(float water); void CheckIfFoodUpdateNeeded(float Food); void CheckIfHealthUpdateNeeded(float Health); void HandleInactiveKeys(int Animation_ID, TArray<TEnumAsByte<ChromaSDKPlugin_EChromaSDKKeyboardKey>>* Keys, int Threshold); void UpdateChromaAnimationEffect(); void UpdateChromaAnimation(); void InitChromaHealthBar(float Health_Percentage); void InitChromaFoodBar(float Food_Percentage); void InitChromaWaterBar(float Water_Percentage); void ReceiveBeginPlay(); void UpdateChromaWaterBar(float Water_Percentage); void UpdateQuickslotBar(); void BindChromaQuickslotEvent(class APC_Player_C* PCPlayerReference); void UpdateChromaFoodBar(float Food_Percentage); void ChromaHitEffect(TEnumAsByte<E_DamageType_E_DamageType> Damage_Type); void ReceiveTick(float DeltaSeconds); void UpdateChromaHealthBar(float Health_Percentage); void InitChromaBars(); void ExecuteUbergraph_BP_Chroma(int EntryPoint); }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "zp2kshield@gmail.com" ]
zp2kshield@gmail.com
f75c00dd2e5446790232244127e9edec0e9741ef
d4cdc06cdef352add4c6bcd9b300e419d03b7568
/BGPsource/OpenGL 3.0/chapter_3/lines/src/glwindow.cpp
2e7c8fdcf6477e44c3ec69d2b488b93941c08e21
[]
no_license
QtOpenGL/Animation-Retargeter-Qt-2
f2ce024c6895a9640b92057bb2ae2f7d253f123a
1619072d0aed8073fa5311a33ac9523aa0d95e20
refs/heads/master
2021-04-15T10:59:36.433919
2018-01-26T01:06:10
2018-01-26T01:06:10
null
0
0
null
null
null
null
UTF-8
C++
false
false
9,761
cpp
#include <ctime> #include <iostream> #include <windows.h> #include <GL/gl.h> #include "wglext.h" #include "glwindow.h" #include "example.h" typedef HGLRC (APIENTRYP PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC, HGLRC, const int*); PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = NULL; GLWindow::GLWindow(HINSTANCE hInstance): m_isRunning(false), m_example(NULL), m_hinstance(hInstance), m_lastTime(0) { } bool GLWindow::create(int width, int height, int bpp, bool fullscreen) { DWORD dwExStyle; // Window Extended Style DWORD dwStyle; // Window Style m_isFullscreen = fullscreen; //Store the fullscreen flag m_windowRect.left = (long)0; // Set Left Value To 0 m_windowRect.right = (long)width; // Set Right Value To Requested Width m_windowRect.top = (long)0; // Set Top Value To 0 m_windowRect.bottom = (long)height; // Set Bottom Value To Requested Height // fill out the window class structure m_windowClass.cbSize = sizeof(WNDCLASSEX); m_windowClass.style = CS_HREDRAW | CS_VREDRAW; m_windowClass.lpfnWndProc = GLWindow::StaticWndProc; //We set our static method as the event handler m_windowClass.cbClsExtra = 0; m_windowClass.cbWndExtra = 0; m_windowClass.hInstance = m_hinstance; m_windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); // default icon m_windowClass.hCursor = LoadCursor(NULL, IDC_ARROW); // default arrow m_windowClass.hbrBackground = NULL; // don't need background m_windowClass.lpszMenuName = NULL; // no menu m_windowClass.lpszClassName = "GLClass"; m_windowClass.hIconSm = LoadIcon(NULL, IDI_WINLOGO); // windows logo small icon // register the windows class if (!RegisterClassEx(&m_windowClass)) { return false; } if (m_isFullscreen) //If we are fullscreen, we need to change the display mode { DEVMODE dmScreenSettings; // device mode memset(&dmScreenSettings, 0, sizeof(dmScreenSettings)); dmScreenSettings.dmSize = sizeof(dmScreenSettings); dmScreenSettings.dmPelsWidth = width; // screen width dmScreenSettings.dmPelsHeight = height; // screen height dmScreenSettings.dmBitsPerPel = bpp; // bits per pixel dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT; if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) { // setting display mode failed, switch to windowed MessageBox(NULL, "Display mode failed", NULL, MB_OK); m_isFullscreen = false; } } if (m_isFullscreen) // Are We Still In Fullscreen Mode? { dwExStyle = WS_EX_APPWINDOW; // Window Extended Style dwStyle = WS_POPUP; // Windows Style ShowCursor(false); // Hide Mouse Pointer } else { dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; // Window Extended Style dwStyle = WS_OVERLAPPEDWINDOW; // Windows Style } AdjustWindowRectEx(&m_windowRect, dwStyle, false, dwExStyle); // Adjust Window To True Requested Size // class registered, so now create our window m_hwnd = CreateWindowEx(NULL, // extended style "GLClass", // class name "BOGLGP - Chapter 3 - Lines", // app name dwStyle | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0, // x,y coordinate m_windowRect.right - m_windowRect.left, m_windowRect.bottom - m_windowRect.top, // width, height NULL, // handle to parent NULL, // handle to menu m_hinstance, // application instance this); // we pass a pointer to the GLWindow here // check if window creation failed (hwnd would equal NULL) if (!m_hwnd) return 0; m_hdc = GetDC(m_hwnd); ShowWindow(m_hwnd, SW_SHOW); // display the window UpdateWindow(m_hwnd); // update the window m_lastTime = GetTickCount() / 1000.0f; //Initialize the time return true; } void GLWindow::destroy() { if (m_isFullscreen) { ChangeDisplaySettings(NULL, 0); // If So Switch Back To The Desktop ShowCursor(true); // Show Mouse Pointer } } void GLWindow::attachExample(Example* example) { m_example = example; } bool GLWindow::isRunning() { return m_isRunning; } void GLWindow::processEvents() { MSG msg; //While there are messages in the queue, store them in msg while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { //Process the messages one-by-one TranslateMessage(&msg); DispatchMessage(&msg); } } void GLWindow::setupPixelFormat(void) { int pixelFormat; PIXELFORMATDESCRIPTOR pfd = { sizeof(PIXELFORMATDESCRIPTOR), // size 1, // version PFD_SUPPORT_OPENGL | // OpenGL window PFD_DRAW_TO_WINDOW | // render to window PFD_DOUBLEBUFFER, // support double-buffering PFD_TYPE_RGBA, // color type 32, // prefered color depth 0, 0, 0, 0, 0, 0, // color bits (ignored) 0, // no alpha buffer 0, // alpha bits (ignored) 0, // no accumulation buffer 0, 0, 0, 0, // accum bits (ignored) 16, // depth buffer 0, // no stencil buffer 0, // no auxiliary buffers PFD_MAIN_PLANE, // main layer 0, // reserved 0, 0, 0, // no layer, visible, damage masks }; pixelFormat = ChoosePixelFormat(m_hdc, &pfd); SetPixelFormat(m_hdc, pixelFormat, &pfd); } LRESULT GLWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { case WM_CREATE: // window creation { m_hdc = GetDC(hWnd); setupPixelFormat(); //Set the version that we want, in this case 3.0 int attribs[] = { WGL_CONTEXT_MAJOR_VERSION_ARB, 3, WGL_CONTEXT_MINOR_VERSION_ARB, 0, 0}; //zero indicates the end of the array //Create temporary context so we can get a pointer to the function HGLRC tmpContext = wglCreateContext(m_hdc); //Make it current wglMakeCurrent(m_hdc, tmpContext); //Get the function pointer wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC) wglGetProcAddress("wglCreateContextAttribsARB"); //If this is NULL then OpenGL 3.0 is not supported if (!wglCreateContextAttribsARB) { std::cerr << "OpenGL 3.0 is not supported, falling back to GL 2.1" << std::endl; m_hglrc = tmpContext; } else { // Create an OpenGL 3.0 context using the new function m_hglrc = wglCreateContextAttribsARB(m_hdc, 0, attribs); //Delete the temporary context wglDeleteContext(tmpContext); } //Make the GL3 context current wglMakeCurrent(m_hdc, m_hglrc); m_isRunning = true; //Mark our window as running } break; case WM_DESTROY: // window destroy case WM_CLOSE: // windows is closing wglMakeCurrent(m_hdc, NULL); wglDeleteContext(m_hglrc); m_isRunning = false; //Stop the main loop PostQuitMessage(0); //Send a WM_QUIT message return 0; break; case WM_SIZE: { int height = HIWORD(lParam); // retrieve width and height int width = LOWORD(lParam); getAttachedExample()->onResize(width, height); //Call the example's resize method } break; case WM_KEYDOWN: if (wParam == VK_ESCAPE) //If the escape key was pressed { DestroyWindow(m_hwnd); //Send a WM_DESTROY message } break; default: break; } return DefWindowProc(hWnd, uMsg, wParam, lParam); } LRESULT CALLBACK GLWindow::StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { GLWindow* window = NULL; //If this is the create message if(uMsg == WM_CREATE) { //Get the pointer we stored during create window = (GLWindow*)((LPCREATESTRUCT)lParam)->lpCreateParams; //Associate the window pointer with the hwnd for the other events to access SetWindowLongPtr(hWnd, GWL_USERDATA, (LONG_PTR)window); } else { //If this is not a creation event, then we should have stored a pointer to the window window = (GLWindow*)GetWindowLongPtr(hWnd, GWL_USERDATA); if(!window) { return DefWindowProc(hWnd, uMsg, wParam, lParam); } } //Call our window's member WndProc (allows us to access member variables) return window->WndProc(hWnd, uMsg, wParam, lParam); } float GLWindow::getElapsedSeconds() { float currentTime = float(GetTickCount()) / 1000.0f; float seconds = float(currentTime - m_lastTime); m_lastTime = currentTime; return seconds; }
[ "alex.handby@gmail.com" ]
alex.handby@gmail.com
885227d9dfe79eb8fe0939368e449331bb901851
25180581aafc40eb66a79ebd6f7b5212ab188627
/library/src/conversion/csx2dense_device.h
4c1f905e18b43b1a28095a7f50d26fc6177e0152
[ "MIT" ]
permissive
ntrost57/rocSPARSE
0d62a9d98a62cf362789db30fdd1402c5095a7f1
3372f7abbe8eac082104c96a5f134c79c32e4eac
refs/heads/master
2023-07-07T15:28:49.850685
2021-03-25T08:59:11
2021-03-25T08:59:11
150,391,643
0
1
MIT
2018-09-26T08:11:59
2018-09-26T08:11:58
null
UTF-8
C++
false
false
4,641
h
/*! \file */ /* ************************************************************************ * Copyright (c) 2018-2021 Advanced Micro Devices, Inc. * * 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. * * ************************************************************************ */ #pragma once #ifndef CSX2DENSE2_DEVICE_H #define CSX2DENSE2_DEVICE_H #include "handle.h" #include <hip/hip_runtime.h> template <rocsparse_int NUMROWS_PER_BLOCK, rocsparse_int WF_SIZE, typename I, typename J, typename T> __launch_bounds__(WF_SIZE* NUMROWS_PER_BLOCK) __global__ void csr2dense_kernel(rocsparse_int base, J m, J n, const T* __restrict__ csr_val, const I* __restrict__ csr_row_ptr, const J* __restrict__ csr_col_ind, T* __restrict__ dense_val, I ld, rocsparse_order order) { const rocsparse_int wavefront_index = hipThreadIdx_x / WF_SIZE, lane_index = hipThreadIdx_x % WF_SIZE; const J row_index = NUMROWS_PER_BLOCK * hipBlockIdx_x + wavefront_index; if(row_index < m) { const I shift = csr_row_ptr[row_index] - base; const I size_row = csr_row_ptr[row_index + 1] - base - shift; // // One wavefront executes one sparse row. // for(I index = lane_index; index < size_row; index += WF_SIZE) { __syncthreads(); const J column_index = csr_col_ind[shift + index] - base; if(order == rocsparse_order_column) { dense_val[column_index * ld + row_index] = csr_val[shift + index]; } else { dense_val[row_index * ld + column_index] = csr_val[shift + index]; } } } } template <rocsparse_int NUMCOLUMNS_PER_BLOCK, rocsparse_int WF_SIZE, typename I, typename J, typename T> __launch_bounds__(WF_SIZE* NUMCOLUMNS_PER_BLOCK) __global__ void csc2dense_kernel(rocsparse_int base, J m, J n, const T* __restrict__ csc_val, const I* __restrict__ csc_col_ptr, const J* __restrict__ csc_row_ind, T* __restrict__ dense_val, I ld, rocsparse_order order) { const rocsparse_int wavefront_index = hipThreadIdx_x / WF_SIZE, lane_index = hipThreadIdx_x % WF_SIZE; const J column_index = NUMCOLUMNS_PER_BLOCK * hipBlockIdx_x + wavefront_index; if(column_index < n) { const I shift = csc_col_ptr[column_index] - base; const I size_column = csc_col_ptr[column_index + 1] - base - shift; // // One wavefront executes one sparse column. // for(I index = lane_index; index < size_column; index += WF_SIZE) { const J row_index = csc_row_ind[shift + index] - base; if(order == rocsparse_order_column) { dense_val[column_index * ld + row_index] = csc_val[shift + index]; } else { dense_val[row_index * ld + column_index] = csc_val[shift + index]; } } } } #endif
[ "noreply@github.com" ]
ntrost57.noreply@github.com
762462b8a047abc58df44efb5634eef124dfd7d4
4186169f4f19eedc54ea9552ad04a07462370b3d
/CSVReader.cpp
1af2569db26b6c3758e280a81a928261d5c4b954
[]
no_license
SamanthaChia/OOPCoursework_1
22f484893fb83b55c16ae2199105a68c333ecfe0
e4b4773cd400333203df23eb34d3d7007e18d187
refs/heads/master
2023-02-19T09:29:22.106444
2021-01-10T10:48:43
2021-01-10T10:48:43
325,569,559
0
0
null
null
null
null
UTF-8
C++
false
false
3,050
cpp
#include "CSVReader.h" #include <iostream> #include <fstream> CSVReader::CSVReader(){ } std::vector<OrderBookEntry> CSVReader::readCSV(std::string csvFilename){ std::vector<OrderBookEntry> entries; std::ifstream csvFile{csvFilename}; std::string line; if(csvFile.is_open()) { while(std::getline(csvFile, line)) { try{ OrderBookEntry obe = stringsToOBE(tokenise(line, ',')); entries.push_back(obe); } catch(const std::exception& e){ std::cout << "CSVReader::readCSV bad data " << std::endl; } } } std::cout << "CSVReader::readCSV read " << entries.size() << " entries" << std::endl; return entries; } std::vector<std::string> CSVReader::tokenise(std::string csvLine, char separator){ std::vector<std::string> tokens; signed int start, end; std::string token; start = csvLine.find_first_not_of(separator, 0); do { end = csvLine.find_first_of(separator, start); if (start == csvLine.length() || start == end) { break; } if( end>=0 ) { token = csvLine.substr( start, end - start); } else { token = csvLine.substr(start, csvLine.length() - start); } tokens.push_back(token); start = end + 1; } while(end > 0); return tokens; } OrderBookEntry CSVReader::stringsToOBE(std::vector<std::string> tokens){ double price, amount; if(tokens.size() != 5) { std::cout << "Bad line" << std::endl; throw std::exception{}; } try{ // stod = string to double. price = std::stod(tokens[3]); amount = std::stod(tokens[4]); }catch(const std::exception& e) { std::cout << "CSVReader::stringsToOBE Bad float! " << tokens[3] << std::endl; std::cout << "CSVReader::stringsToOBE Bad float! " << tokens[4] << std::endl; throw; } OrderBookEntry obe{ price, amount, tokens[0], tokens[1], OrderBookEntry::stringToOrderBookType(tokens[2]) }; return obe; } OrderBookEntry CSVReader::stringsToOBE(std::string priceString, std::string amountString, std::string timestamp, std::string product, OrderBookType OrderType) { double price,amount; try{ // stod = string to double. price = std::stod(priceString); amount = std::stod(amountString); }catch(const std::exception& e) { std::cout << "CSVReader::stringsToOBE Bad float! " << priceString << std::endl; std::cout << "CSVReader::stringsToOBE Bad float! " << amountString << std::endl; throw; } OrderBookEntry obe{ price, amount, timestamp, product, OrderType}; return obe; }
[ "samantha1999@live.com.sg" ]
samantha1999@live.com.sg
e0480424ffe82ab3b5b0b01f62d3967d3dbcdb7b
0ef24b53f443f951f3d9b911cd560090d05dd004
/10432 Polygon Inside A Circle.cpp
c6b1a6fcc7207d42e648b08c539230a0275b3397
[]
no_license
Ruman-Hossain/UVA-Problems
3eed911d899a2a733cd5a7ee8c0852257174aaa2
b36646efb1bdfb0c55967d97cd211094eb56f9f9
refs/heads/master
2021-01-10T23:20:08.931525
2017-02-08T18:03:27
2017-02-08T18:03:27
70,599,574
1
0
null
null
null
null
UTF-8
C++
false
false
1,021
cpp
//RUMAN CSE (6th Intake) BRUR #include<iostream> #include<cstdio> #include<cmath> #include <algorithm> #include <iterator> #include <numeric> #include <sstream> #include <fstream> #include <cassert> #include <climits> #include <cstdlib> #include<cstring> #include<strstream> #include<cstdlib> #include<map> #include<stack> #include<queue> #include<set> #include<vector> #include<iomanip> #include<algorithm> #define MAX(a,b)a>b?a:b #define MIN(a,b)a<b?a:b #define PI acos(-1) using namespace std; int main() { //freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); double r; int n; while(cin>>r>>n){ double phi=(double)360/n; double theta=(double)90-(phi/2.0); double angl=(theta*PI)/180.0; double land=2*r*cos(angl); double height=r*sin(angl); double triangle=(land*height)/2; double area=triangle*n; cout<<setprecision(3)<<fixed<<area<<endl; } return 0; }
[ "noreply@github.com" ]
Ruman-Hossain.noreply@github.com
fd35890cf265a31c0b05328307ccf8c8a82d61c3
2dc3bbb7b51dce3e10332f25672516eff3ad1347
/Benh_Vien/Benh_Nhan_CV.cpp
06f6b2d2a0071f4b4b7cddb2d3939c6ff2412a38
[]
no_license
lam267/BenhVien
20e57219554773ea3d4fe14b9b72eaeab2b870b2
08e84394caedceb6f3ad2c2a4ab43c73774b5b88
refs/heads/master
2022-07-23T12:25:03.116011
2020-05-18T08:11:59
2020-05-18T08:11:59
262,305,018
0
0
null
null
null
null
UTF-8
C++
false
false
407
cpp
#include "Benh_Nhan_CV.h" void Benh_Nhan_CV::Nhap() { BenhNhan::Nhap(); cout << "Ma benh nhan:"; BenhNhan::Mahs; cout << "Ngay chuyen:";CNgay::Nhap(); fflush(stdin); cout << "Noi Chuyen:";getline(cin, Noichuyen); } void Benh_Nhan_CV::Hienthi(ostream & os) { BenhNhan::Hienthi(os);cout << "Ma benh nhan:" << BenhNhan::Mahs << "Ngay chuyen:";CNgay::Hienthi(os); cout << "Noi chuyen:" << Noichuyen ; }
[ "lamnguyen9964@gmail.com" ]
lamnguyen9964@gmail.com
cab7c242fe920af9118ad8897f65c41de3cf8620
088deb3c9b0f6365a813b0c6a87d33e67ffb916c
/base/hyperneat/HyperNEAT/Hypercube_NEAT/include/Experiments/HCUBE_CheckersExperimentOriginalFogel.h
dcae029b543a06d5d94c27498e8ee9cdef86af9e
[]
no_license
CreativeMachinesLab/softbotEscape
d47b0cb416bfb489af2f73e31ddb9b7d126249b9
e552c8dff2a95ab9b9b64065deda2102ff9f2388
refs/heads/master
2021-01-01T15:37:01.484182
2015-04-27T10:25:32
2015-04-27T10:25:32
34,642,315
3
1
null
null
null
null
UTF-8
C++
false
false
1,100
h
#ifndef HCUBE_CHECKERSEXPERIMENTORIGINALFOGEL_H_INCLUDED #define HCUBE_CHECKERSEXPERIMENTORIGINALFOGEL_H_INCLUDED #include "Experiments/HCUBE_Experiment.h" #include "Experiments/HCUBE_CheckersCommon.h" #include "Experiments/HCUBE_CheckersExperiment.h" namespace HCUBE { class CheckersExperimentOriginalFogel : public CheckersExperiment { public: protected: public: CheckersExperimentOriginalFogel(string _experimentName); virtual ~CheckersExperimentOriginalFogel() {} virtual NEAT::GeneticPopulation* createInitialPopulation(int populationSize); virtual void generateSubstrate(int substrateNum=0); virtual void populateSubstrate( shared_ptr<const NEAT::GeneticIndividual> individual, int substrateNum=0 ); virtual CheckersNEATDatatype evaluateLeafHyperNEAT(uchar b[8][8]); virtual CheckersNEATDatatype getSpatialInput(uchar b[8][8],int x,int y,int sizex,int sizey); virtual Experiment* clone(); }; } #endif // HCUBE_CHECKERSEXPERIMENTORIGINALFOGEL_H_INCLUDED
[ "nac93@cornell.edu" ]
nac93@cornell.edu
45833cb3e01f31f9e91b595ab1564736f6cf41b7
e899c52221c02627c4e8cefac3cef99bdb097944
/UtilsTest/src/FileTest.h
7ad75ba84095b172d3f8707918cbd2a986ddca58
[]
no_license
SegevHaviv/Client-Server-TicTacToe-Game
3ff1e40da47732bc204aa628f403c0ec192840c8
0dcd3685717ce19df0e1f5822720668d21efc648
refs/heads/master
2021-04-15T15:01:49.942808
2019-02-27T06:30:02
2019-02-27T06:30:02
126,868,223
0
0
null
null
null
null
UTF-8
C++
false
false
260
h
/* * FileTest.h * * Created on: Oct 12, 2017 * Author: user */ #ifndef FILETEST_H_ #define FILETEST_H_ #include "File.h" class FileTest { private: File* file; public: FileTest(); virtual ~FileTest(); bool test(); }; #endif /* FILETEST_H_ */
[ "noreply@github.com" ]
SegevHaviv.noreply@github.com
2dc35ab6111d52feb4bbcdddb3ac38a2521d7f2b
523efb3280f92ac83e2c6247798690e6ce343c18
/StellarTrace/src/Math/Color.h
abcec525e26ce53376b5314732e4dc309b6be746
[ "Apache-2.0" ]
permissive
sarkararpan710/StellarTrace
8ec93aaa0b6dca9352fd797bd56aeb89b795673f
208ee5b53ff22e309dffb93418a2cad86d6bf971
refs/heads/master
2020-04-22T11:21:49.978859
2019-02-11T11:18:51
2019-02-11T11:18:51
null
0
0
null
null
null
null
UTF-8
C++
false
false
354
h
#pragma once #include "Vector3f.h" #include "../Core.h" namespace StellarTrace { class Color { public: Color(const vec3& color, float alpha) :data(color), alpha(alpha) { }; inline float operator[](uint32 index)const; private: vec3 data; float alpha; }; inline float Color::operator[](uint32 index)const { return data[index]; } }
[ "alimilhim5@gmail.com" ]
alimilhim5@gmail.com
047df4c19d42475a2f2ca7e9e5608c567ada632c
d4386cdd1bf16a903b8e4dfc3484eb19eef80b5c
/VEXU2020-2021/AsyncBot/.vscode/cquery_cached_index/c@@users@7429165@desktop@robot stuff@matt's github stuff@vex-robotics-sdsmt@vexu2020-2021@asyncbot/src@twinrun.cpp
659b92dee7747dab9014f4d6eaadf8bb906c1821
[]
no_license
TheRevilo2018/VEX-Robotics-SDSMT
1535b21b77ba35493ee7b9c1d22ae23ae173b150
b80a2ef00a2c4cf76301b81ce3ee3b3ec48db54f
refs/heads/master
2023-08-15T07:34:05.839114
2021-09-27T04:18:15
2021-09-27T04:18:15
109,911,898
1
0
null
2021-05-24T19:59:30
2017-11-08T01:30:23
C++
UTF-8
C++
false
false
3,325
cpp
#include "../include/twinRun.h" namespace twin { void opcontrolTask(void* param) { int pairIndex = (int)param; // Screen posting might break async, check it pros::lcd::set_text(5, "Calling op_control: " + std::to_string(pros::millis())); const int inserterConst = 110; const int inserterRestingConst = -40; const int intakeConst = 85; int turnThreshold = 10; int driveThreshold = 10; int leftMotorPercent = 0; int rightMotorPercent = 0; int intakePercent = 0; int inserterPercent = inserterRestingConst; std::uint32_t debounceButtonA = 0; std::uint32_t debounceButtonB = 0; std::uint32_t debounceButtonX = 0; std::uint32_t debounceButtonY = 0; std::uint32_t debounceButtonDOWN = 0; std::uint32_t debounceButtonUP = 0; std::uint32_t debounceButtonLEFT = 0; std::uint32_t debounceButtonRIGHT = 0; std::uint32_t debounceButtonR1 = 0; std::uint32_t debounceButtonR2 = 0; std::uint32_t debounceButtonL1 = 0; int loopDelay = 20; while (true) { //ball controls // Outakes for bottom if(alpha.get_digital(pros::E_CONTROLLER_DIGITAL_R1)) { if(pressButton(debounceButtonR1)) { if (intakePercent <= 0) { intakePercent = intakeConst; } else { intakePercent = 0; } } } else if (alpha.get_digital(pros::E_CONTROLLER_DIGITAL_R2)) { if(pressButton(debounceButtonR2)) { if ( intakePercent >= 0) { intakePercent = -intakeConst; } else { intakePercent = 0; } } } if(alpha.get_digital(pros::E_CONTROLLER_DIGITAL_L1)) { if(pressButton(debounceButtonL1)) { if (inserterPercent <= 0) { inserterPercent = inserterConst; } else { inserterPercent = inserterRestingConst; } } } //drive controls if(abs(alpha.get_analog(ANALOG_LEFT_Y)) > driveThreshold || abs(alpha.get_analog(ANALOG_RIGHT_X)) > turnThreshold) { leftMotorPercent = alpha.get_analog(ANALOG_LEFT_Y); rightMotorPercent = alpha.get_analog(ANALOG_LEFT_Y); if(alpha.get_analog(ANALOG_RIGHT_X) > turnThreshold) { leftMotorPercent += abs(alpha.get_analog(ANALOG_RIGHT_X)); rightMotorPercent -= abs(alpha.get_analog(ANALOG_RIGHT_X)); } else { leftMotorPercent -= abs(alpha.get_analog(ANALOG_RIGHT_X)); rightMotorPercent += abs(alpha.get_analog(ANALOG_RIGHT_X)); } } else { leftMotorPercent = 0; rightMotorPercent = 0; } setMotors(leftWheelMotorVector, leftMotorPercent); setMotors(rightWheelMotorVector, rightMotorPercent); setMotors(intakeMotorVector, intakePercent); bottomRoller = intakePercent; inserter = inserterPercent; pros::delay(loopDelay); } } }
[ "7429165@T-SMD1030026" ]
7429165@T-SMD1030026
eb9b97bfa78f4e29d5ae7c391b9a474ff708ed2c
e41d3561f1dc7b1c71f03e5c407cc359e23e59c8
/ch-3/ex-3.9-random-triangles-areas.cpp
614b771211e65104ec5c12469dec6cd07b95a582
[]
no_license
tischsoic/algorithms-in-Cpp-EN
d660545cae758724ff3e3ff00150b328a19bbd6f
0e4af0a497ac79be532bd34a5bcc0e649d04787b
refs/heads/master
2021-05-05T16:59:19.434769
2018-02-08T18:14:03
2018-02-08T18:14:03
117,374,816
1
0
null
null
null
null
UTF-8
C++
false
false
479
cpp
#include <iostream> #include <cstdlib> #include "Point.h" #include "Triangle.h" float randomFromUnitSquare() { return (float)std::rand() / RAND_MAX; } Point randomPoint() { return Point {randomFromUnitSquare(), randomFromUnitSquare()}; } int main() { for (int i = 3; i > 0; --i) { Triangle randTriangle{randomPoint(), randomPoint(), randomPoint()}; std::cout << "Random triangle area: " << area(randTriangle) << std::endl; } return 0; }
[ "symfiz@gmail.com" ]
symfiz@gmail.com
cb61bcb0a618c6ac2858817bdbf212cc051b03c6
decefb13f8a603c1f5cc7eb00634b4649915204f
/packages/electron/shell/browser/ui/accelerator_util.cc
c9c5fb511e82412cb9fe73563dcedd1fce09b412
[ "Apache-2.0", "LicenseRef-scancode-free-unknown", "MIT" ]
permissive
open-pwa/open-pwa
f092b377dc6cb04123a16ef96811ad09a9956c26
4c88c8520b4f6e7af8701393fd2cedbe1b209e8f
refs/heads/master
2022-05-28T22:05:19.514921
2022-05-20T07:27:10
2022-05-20T07:27:10
247,925,596
24
1
Apache-2.0
2021-08-10T07:38:42
2020-03-17T09:13:00
C++
UTF-8
C++
false
false
3,262
cc
// Copyright (c) 2013 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #include "shell/browser/ui/accelerator_util.h" #include <stdio.h> #include <string> #include <vector> #include "base/logging.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "shell/common/keyboard_util.h" namespace accelerator_util { bool StringToAccelerator(const std::string& shortcut, ui::Accelerator* accelerator) { if (!base::IsStringASCII(shortcut)) { LOG(ERROR) << "The accelerator string can only contain ASCII characters"; return false; } std::vector<std::string> tokens = base::SplitString( shortcut, "+", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); // Now, parse it into an accelerator. int modifiers = ui::EF_NONE; ui::KeyboardCode key = ui::VKEY_UNKNOWN; absl::optional<char16_t> shifted_char; for (const auto& token : tokens) { ui::KeyboardCode code = electron::KeyboardCodeFromStr(token, &shifted_char); if (shifted_char) modifiers |= ui::EF_SHIFT_DOWN; switch (code) { // The token can be a modifier. case ui::VKEY_SHIFT: modifiers |= ui::EF_SHIFT_DOWN; break; case ui::VKEY_CONTROL: modifiers |= ui::EF_CONTROL_DOWN; break; case ui::VKEY_MENU: modifiers |= ui::EF_ALT_DOWN; break; case ui::VKEY_COMMAND: modifiers |= ui::EF_COMMAND_DOWN; break; case ui::VKEY_ALTGR: modifiers |= ui::EF_ALTGR_DOWN; break; // Or it is a normal key. default: key = code; } } if (key == ui::VKEY_UNKNOWN) { LOG(WARNING) << shortcut << " doesn't contain a valid key"; return false; } *accelerator = ui::Accelerator(key, modifiers); accelerator->shifted_char = shifted_char; return true; } void GenerateAcceleratorTable(AcceleratorTable* table, electron::ElectronMenuModel* model) { int count = model->GetItemCount(); for (int i = 0; i < count; ++i) { electron::ElectronMenuModel::ItemType type = model->GetTypeAt(i); if (type == electron::ElectronMenuModel::TYPE_SUBMENU) { auto* submodel = model->GetSubmenuModelAt(i); GenerateAcceleratorTable(table, submodel); } else { ui::Accelerator accelerator; if (model->ShouldRegisterAcceleratorAt(i)) { if (model->GetAcceleratorAtWithParams(i, true, &accelerator)) { MenuItem item = {i, model}; (*table)[accelerator] = item; } } } } } bool TriggerAcceleratorTableCommand(AcceleratorTable* table, const ui::Accelerator& accelerator) { const auto iter = table->find(accelerator); if (iter != std::end(*table)) { const accelerator_util::MenuItem& item = iter->second; if (item.model->IsEnabledAt(item.position)) { const auto event_flags = accelerator.MaskOutKeyEventFlags(accelerator.modifiers()); item.model->ActivatedAt(item.position, event_flags); return true; } } return false; } } // namespace accelerator_util
[ "frank@lemanschik.com" ]
frank@lemanschik.com
554e3368db5bc1bcdf5856b7e3265d5c6f200ca3
af0ecafb5428bd556d49575da2a72f6f80d3d14b
/CodeJamCrawler/dataset/09_8288_23.cpp
86e4a2462f60089969af7c310c2c730a4a2378ad
[]
no_license
gbrlas/AVSP
0a2a08be5661c1b4a2238e875b6cdc88b4ee0997
e259090bf282694676b2568023745f9ffb6d73fd
refs/heads/master
2021-06-16T22:25:41.585830
2017-06-09T06:32:01
2017-06-09T06:32:01
null
0
0
null
null
null
null
UTF-8
C++
false
false
917
cpp
#include <fstream> #include <cstdio> #include <cstdlib> #include <cmath> #include <vector> #include <iostream> #include <string> #include <queue> #include <map> #include <sstream> #include <set> using namespace std; int m[25600]; int main() { freopen("A.in", "rt", stdin); freopen("A.out", "wt", stdout); string x; int test; cin >> test; for(int T = 1; T <= test; T++) { cin >> x; memset(m, -1, sizeof(m)); m[x[0]] = 1; int b = 2; bool ok = true; int i = 1; while(i < x.length() && x[i] == x[0]) i++; for(; i < x.length(); i++) { if(m[x[i]] == -1 && ok) { m[x[i]] = 0; ok = false; } else { if(m[x[i]] == -1) m[x[i]] = b++; } } long long res = 0; long long j = 1; for(int i = x.length() - 1; i >= 0; i--, j *= b) { int mm = m[x[i]]; res += j * mm; } cout << "Case #" << T << ": " << res << endl; } return 0; }
[ "nikola.mrzljak@fer.hr" ]
nikola.mrzljak@fer.hr
252da1bfc8fe23506da9eb340d07d7982a4f27ec
8f421001634923dbfb032389ecd094d4880e958a
/modules/cudastereo/src/stereocsbp.cpp
bc5a230f63e41e27be94243af301f23026cfd8a3
[ "Apache-2.0" ]
permissive
opencv/opencv_contrib
ccf47a2a97022e20d936eb556aa9bc63bc9bdb90
9e134699310c81ea470445b4888fce5c9de6abc7
refs/heads/4.x
2023-08-22T05:58:21.266673
2023-08-11T16:28:20
2023-08-11T16:28:20
12,756,992
8,611
6,099
Apache-2.0
2023-09-14T17:35:22
2013-09-11T13:28:04
C++
UTF-8
C++
false
false
15,906
cpp
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, install, // copy or use the software. // // // License Agreement // For Open Source Computer Vision Library // // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights reserved. // Third party copyrights are property of their respective owners. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistribution's of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * Redistribution's 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. // // * The name of the copyright holders may not 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 Intel Corporation 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. // //M*/ #include "precomp.hpp" using namespace cv; using namespace cv::cuda; #if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::cuda::StereoConstantSpaceBP::estimateRecommendedParams(int, int, int&, int&, int&, int&) { throw_no_cuda(); } Ptr<cuda::StereoConstantSpaceBP> cv::cuda::createStereoConstantSpaceBP(int, int, int, int, int) { throw_no_cuda(); return Ptr<cuda::StereoConstantSpaceBP>(); } #else /* !defined (HAVE_CUDA) */ #include "cuda/stereocsbp.hpp" namespace { class StereoCSBPImpl : public cuda::StereoConstantSpaceBP { public: StereoCSBPImpl(int ndisp, int iters, int levels, int nr_plane, int msg_type); void compute(InputArray left, InputArray right, OutputArray disparity); void compute(InputArray left, InputArray right, OutputArray disparity, Stream& stream); void compute(InputArray data, OutputArray disparity, Stream& stream); int getMinDisparity() const { return min_disp_th_; } void setMinDisparity(int minDisparity) { min_disp_th_ = minDisparity; } int getNumDisparities() const { return ndisp_; } void setNumDisparities(int numDisparities) { ndisp_ = numDisparities; } int getBlockSize() const { return 0; } void setBlockSize(int /*blockSize*/) {} int getSpeckleWindowSize() const { return 0; } void setSpeckleWindowSize(int /*speckleWindowSize*/) {} int getSpeckleRange() const { return 0; } void setSpeckleRange(int /*speckleRange*/) {} int getDisp12MaxDiff() const { return 0; } void setDisp12MaxDiff(int /*disp12MaxDiff*/) {} int getNumIters() const { return iters_; } void setNumIters(int iters) { iters_ = iters; } int getNumLevels() const { return levels_; } void setNumLevels(int levels) { levels_ = levels; } double getMaxDataTerm() const { return max_data_term_; } void setMaxDataTerm(double max_data_term) { max_data_term_ = (float) max_data_term; } double getDataWeight() const { return data_weight_; } void setDataWeight(double data_weight) { data_weight_ = (float) data_weight; } double getMaxDiscTerm() const { return max_disc_term_; } void setMaxDiscTerm(double max_disc_term) { max_disc_term_ = (float) max_disc_term; } double getDiscSingleJump() const { return disc_single_jump_; } void setDiscSingleJump(double disc_single_jump) { disc_single_jump_ = (float) disc_single_jump; } int getMsgType() const { return msg_type_; } void setMsgType(int msg_type) { msg_type_ = msg_type; } int getNrPlane() const { return nr_plane_; } void setNrPlane(int nr_plane) { nr_plane_ = nr_plane; } bool getUseLocalInitDataCost() const { return use_local_init_data_cost_; } void setUseLocalInitDataCost(bool use_local_init_data_cost) { use_local_init_data_cost_ = use_local_init_data_cost; } private: int min_disp_th_; int ndisp_; int iters_; int levels_; float max_data_term_; float data_weight_; float max_disc_term_; float disc_single_jump_; int msg_type_; int nr_plane_; bool use_local_init_data_cost_; GpuMat mbuf_; GpuMat temp_; GpuMat outBuf_; }; const float DEFAULT_MAX_DATA_TERM = 30.0f; const float DEFAULT_DATA_WEIGHT = 1.0f; const float DEFAULT_MAX_DISC_TERM = 160.0f; const float DEFAULT_DISC_SINGLE_JUMP = 10.0f; StereoCSBPImpl::StereoCSBPImpl(int ndisp, int iters, int levels, int nr_plane, int msg_type) : min_disp_th_(0), ndisp_(ndisp), iters_(iters), levels_(levels), max_data_term_(DEFAULT_MAX_DATA_TERM), data_weight_(DEFAULT_DATA_WEIGHT), max_disc_term_(DEFAULT_MAX_DISC_TERM), disc_single_jump_(DEFAULT_DISC_SINGLE_JUMP), msg_type_(msg_type), nr_plane_(nr_plane), use_local_init_data_cost_(true) { } void StereoCSBPImpl::compute(InputArray left, InputArray right, OutputArray disparity) { compute(left, right, disparity, Stream::Null()); } void StereoCSBPImpl::compute(InputArray _left, InputArray _right, OutputArray disp, Stream& _stream) { using namespace cv::cuda::device::stereocsbp; CV_Assert( msg_type_ == CV_32F || msg_type_ == CV_16S ); CV_Assert( 0 < ndisp_ && 0 < iters_ && 0 < levels_ && 0 < nr_plane_ && levels_ <= 8 ); GpuMat left = _left.getGpuMat(); GpuMat right = _right.getGpuMat(); CV_Assert( left.type() == CV_8UC1 || left.type() == CV_8UC3 || left.type() == CV_8UC4 ); CV_Assert( left.size() == right.size() && left.type() == right.type() ); cudaStream_t stream = StreamAccessor::getStream(_stream); //////////////////////////////////////////////////////////////////////////////////////////// // Init int rows = left.rows; int cols = left.cols; levels_ = std::min(levels_, int(log((double)ndisp_) / log(2.0))); // compute sizes AutoBuffer<int> buf(levels_ * 3); int* cols_pyr = buf.data(); int* rows_pyr = cols_pyr + levels_; int* nr_plane_pyr = rows_pyr + levels_; cols_pyr[0] = cols; rows_pyr[0] = rows; nr_plane_pyr[0] = nr_plane_; for (int i = 1; i < levels_; i++) { cols_pyr[i] = cols_pyr[i-1] / 2; rows_pyr[i] = rows_pyr[i-1] / 2; nr_plane_pyr[i] = nr_plane_pyr[i-1] * 2; } GpuMat u[2], d[2], l[2], r[2], disp_selected_pyr[2], data_cost, data_cost_selected; //allocate buffers int buffers_count = 10; // (up + down + left + right + disp_selected_pyr) * 2 buffers_count += 2; // data_cost has twice more rows than other buffers, what's why +2, not +1; buffers_count += 1; // data_cost_selected mbuf_.create(rows * nr_plane_ * buffers_count, cols, msg_type_); data_cost = mbuf_.rowRange(0, rows * nr_plane_ * 2); data_cost_selected = mbuf_.rowRange(data_cost.rows, data_cost.rows + rows * nr_plane_); for(int k = 0; k < 2; ++k) // in/out { GpuMat sub1 = mbuf_.rowRange(data_cost.rows + data_cost_selected.rows, mbuf_.rows); GpuMat sub2 = sub1.rowRange((k+0)*sub1.rows/2, (k+1)*sub1.rows/2); GpuMat *buf_ptrs[] = { &u[k], &d[k], &l[k], &r[k], &disp_selected_pyr[k] }; for(int _r = 0; _r < 5; ++_r) { *buf_ptrs[_r] = sub2.rowRange(_r * sub2.rows/5, (_r+1) * sub2.rows/5); CV_DbgAssert( buf_ptrs[_r]->cols == cols && buf_ptrs[_r]->rows == rows * nr_plane_ ); } }; size_t elem_step = mbuf_.step / mbuf_.elemSize(); Size temp_size = data_cost.size(); if ((size_t)temp_size.area() < elem_step * rows_pyr[levels_ - 1] * ndisp_) temp_size = Size(static_cast<int>(elem_step), rows_pyr[levels_ - 1] * ndisp_); temp_.create(temp_size, msg_type_); //////////////////////////////////////////////////////////////////////////// // Compute l[0].setTo(0, _stream); d[0].setTo(0, _stream); r[0].setTo(0, _stream); u[0].setTo(0, _stream); l[1].setTo(0, _stream); d[1].setTo(0, _stream); r[1].setTo(0, _stream); u[1].setTo(0, _stream); data_cost.setTo(0, _stream); data_cost_selected.setTo(0, _stream); int cur_idx = 0; if (msg_type_ == CV_32F) { for (int i = levels_ - 1; i >= 0; i--) { if (i == levels_ - 1) { init_data_cost(left.ptr<uchar>(), right.ptr<uchar>(), temp_.ptr<uchar>(), left.step, left.rows, left.cols, disp_selected_pyr[cur_idx].ptr<float>(), data_cost_selected.ptr<float>(), elem_step, rows_pyr[i], cols_pyr[i], i, nr_plane_pyr[i], ndisp_, left.channels(), data_weight_, max_data_term_, min_disp_th_, use_local_init_data_cost_, stream); } else { compute_data_cost(left.ptr<uchar>(), right.ptr<uchar>(), left.step, disp_selected_pyr[cur_idx].ptr<float>(), data_cost.ptr<float>(), elem_step, left.rows, left.cols, rows_pyr[i], cols_pyr[i], rows_pyr[i+1], i, nr_plane_pyr[i+1], left.channels(), data_weight_, max_data_term_, min_disp_th_, stream); int new_idx = (cur_idx + 1) & 1; init_message(temp_.ptr<uchar>(), u[new_idx].ptr<float>(), d[new_idx].ptr<float>(), l[new_idx].ptr<float>(), r[new_idx].ptr<float>(), u[cur_idx].ptr<float>(), d[cur_idx].ptr<float>(), l[cur_idx].ptr<float>(), r[cur_idx].ptr<float>(), disp_selected_pyr[new_idx].ptr<float>(), disp_selected_pyr[cur_idx].ptr<float>(), data_cost_selected.ptr<float>(), data_cost.ptr<float>(), elem_step, rows_pyr[i], cols_pyr[i], nr_plane_pyr[i], rows_pyr[i+1], cols_pyr[i+1], nr_plane_pyr[i+1], stream); cur_idx = new_idx; } calc_all_iterations(temp_.ptr<uchar>(), u[cur_idx].ptr<float>(), d[cur_idx].ptr<float>(), l[cur_idx].ptr<float>(), r[cur_idx].ptr<float>(), data_cost_selected.ptr<float>(), disp_selected_pyr[cur_idx].ptr<float>(), elem_step, rows_pyr[i], cols_pyr[i], nr_plane_pyr[i], iters_, max_disc_term_, disc_single_jump_, stream); } } else { for (int i = levels_ - 1; i >= 0; i--) { if (i == levels_ - 1) { init_data_cost(left.ptr<uchar>(), right.ptr<uchar>(), temp_.ptr<uchar>(), left.step, left.rows, left.cols, disp_selected_pyr[cur_idx].ptr<short>(), data_cost_selected.ptr<short>(), elem_step, rows_pyr[i], cols_pyr[i], i, nr_plane_pyr[i], ndisp_, left.channels(), data_weight_, max_data_term_, min_disp_th_, use_local_init_data_cost_, stream); } else { compute_data_cost(left.ptr<uchar>(), right.ptr<uchar>(), left.step, disp_selected_pyr[cur_idx].ptr<short>(), data_cost.ptr<short>(), elem_step, left.rows, left.cols, rows_pyr[i], cols_pyr[i], rows_pyr[i+1], i, nr_plane_pyr[i+1], left.channels(), data_weight_, max_data_term_, min_disp_th_, stream); int new_idx = (cur_idx + 1) & 1; init_message(temp_.ptr<uchar>(), u[new_idx].ptr<short>(), d[new_idx].ptr<short>(), l[new_idx].ptr<short>(), r[new_idx].ptr<short>(), u[cur_idx].ptr<short>(), d[cur_idx].ptr<short>(), l[cur_idx].ptr<short>(), r[cur_idx].ptr<short>(), disp_selected_pyr[new_idx].ptr<short>(), disp_selected_pyr[cur_idx].ptr<short>(), data_cost_selected.ptr<short>(), data_cost.ptr<short>(), elem_step, rows_pyr[i], cols_pyr[i], nr_plane_pyr[i], rows_pyr[i+1], cols_pyr[i+1], nr_plane_pyr[i+1], stream); cur_idx = new_idx; } calc_all_iterations(temp_.ptr<uchar>(), u[cur_idx].ptr<short>(), d[cur_idx].ptr<short>(), l[cur_idx].ptr<short>(), r[cur_idx].ptr<short>(), data_cost_selected.ptr<short>(), disp_selected_pyr[cur_idx].ptr<short>(), elem_step, rows_pyr[i], cols_pyr[i], nr_plane_pyr[i], iters_, max_disc_term_, disc_single_jump_, stream); } } const int dtype = disp.fixedType() ? disp.type() : CV_16SC1; disp.create(rows, cols, dtype); GpuMat out = disp.getGpuMat(); if (dtype != CV_16SC1) { outBuf_.create(rows, cols, CV_16SC1); out = outBuf_; } out.setTo(0, _stream); if (msg_type_ == CV_32F) { compute_disp(u[cur_idx].ptr<float>(), d[cur_idx].ptr<float>(), l[cur_idx].ptr<float>(), r[cur_idx].ptr<float>(), data_cost_selected.ptr<float>(), disp_selected_pyr[cur_idx].ptr<float>(), elem_step, out, nr_plane_pyr[0], stream); } else { compute_disp(u[cur_idx].ptr<short>(), d[cur_idx].ptr<short>(), l[cur_idx].ptr<short>(), r[cur_idx].ptr<short>(), data_cost_selected.ptr<short>(), disp_selected_pyr[cur_idx].ptr<short>(), elem_step, out, nr_plane_pyr[0], stream); } if (dtype != CV_16SC1) out.convertTo(disp, dtype, _stream); } void StereoCSBPImpl::compute(InputArray /*data*/, OutputArray /*disparity*/, Stream& /*stream*/) { CV_Error(Error::StsNotImplemented, "Not implemented"); } } Ptr<cuda::StereoConstantSpaceBP> cv::cuda::createStereoConstantSpaceBP(int ndisp, int iters, int levels, int nr_plane, int msg_type) { return makePtr<StereoCSBPImpl>(ndisp, iters, levels, nr_plane, msg_type); } void cv::cuda::StereoConstantSpaceBP::estimateRecommendedParams(int width, int height, int& ndisp, int& iters, int& levels, int& nr_plane) { ndisp = (int) ((float) width / 3.14f); if ((ndisp & 1) != 0) ndisp++; int mm = std::max(width, height); iters = mm / 100 + ((mm > 1200)? - 4 : 4); levels = (int)::log(static_cast<double>(mm)) * 2 / 3; if (levels == 0) levels++; nr_plane = (int) ((float) ndisp / std::pow(2.0, levels + 1)); } #endif /* !defined (HAVE_CUDA) */
[ "alexander.alekhin@intel.com" ]
alexander.alekhin@intel.com
619dc17f6ca288433234f2d3e1350f0d52810353
b1543608e8c21a9cb841b3aebcc16ff6e0e84dda
/1002-487-329/487-329.cpp
0b2be86cc56e9200d9cf669602da8c2ceffc7f28
[]
no_license
StupidTAO/ACM---PKU-Online-Judge
74835099d5bbb281f7abd5678256d68af04577b7
ec807b9db719a03bf62e2f5c1f4786adee9117ae
refs/heads/master
2021-04-27T22:18:08.121672
2020-11-08T03:49:40
2020-11-08T03:49:40
122,415,976
7
5
null
null
null
null
UTF-8
C++
false
false
1,596
cpp
#include<iostream> #include<string> #include<map> using namespace std; void strStd(string& str); void leaveSampleTel(); void printBook(); map<string, int> telBook; int main() { map<string, int>::iterator it; string str; int num = 0; cin >> num; while(num--) { cin >> str; strStd(str); it = telBook.find(str); if (it != telBook.end()) { (it->second)++; } else { telBook.insert(make_pair<string, int>(str, 1)); } } leaveSampleTel(); printBook(); return 0; } //格式化输入 void strStd(string& str) { for (int i = 0; i < str.length(); i++) { if (str[i] == '-') { str.erase(i, 1); i--; continue; } if (str[i] >= 'A' && str[i] <= 'C') str[i] = '2'; if (str[i] >= 'D' && str[i] <= 'F') str[i] = '3'; if (str[i] >= 'G' && str[i] <= 'I') str[i] = '4'; if (str[i] >= 'J' && str[i] <= 'L') str[i] = '5'; if (str[i] >= 'M' && str[i] <= 'O') str[i] = '6'; if (str[i] >= 'P' && str[i] <= 'S') str[i] = '7'; if (str[i] >= 'T' && str[i] <= 'V') str[i] = '8'; if (str[i] >= 'W' && str[i] <= 'Y') str[i] = '9'; } str.insert(3, "-"); } //留下相同的电话记录并排序 void leaveSampleTel() { map<string, int>::iterator it = telBook.begin(); while (it != telBook.end()) { if (it->second == 1) { telBook.erase(it++); //map中erase的用法 continue; } it++; } } //格式输出 void printBook() { map<string, int>::iterator it = telBook.begin(); if (it == telBook.end()) cout << "No duplicates." << endl; for ( ; it != telBook.end(); it++) { cout << it->first << " " << it->second << endl; } }
[ "noreply@github.com" ]
StupidTAO.noreply@github.com
853c84e50b9ca47a0ab0bbb95313ee4b2649b374
c15ca123b29e1b57e18a0126dfca13d5f03770ec
/Codeforces/cf_new/easy/892A.cpp
70e0e2ead06141846feacd52e3635061f09aaba4
[]
no_license
iamnidheesh/MyCodes
738547efaf7d36705db921eb644596bc4686d847
13e6878573cd478020f860e431dc1310257583a2
refs/heads/master
2021-09-06T08:05:59.325369
2018-02-04T05:22:00
2018-02-04T05:22:00
94,070,404
2
2
null
2017-09-16T15:39:49
2017-06-12T07:58:25
C++
UTF-8
C++
false
false
377
cpp
#include <iostream> #include <algorithm> #include <cstdio> using namespace std; int main() { long int a[100001],b[100001],n; cin>>n; long long int x = 0; for(int i = 0;i < n;i++) { scanf("%ld",&a[i]); x += (long long int)a[i]; } for(int i = 0;i < n;i++) scanf("%ld",&b[i]); sort(b,b+n); if(x <= (long long int)(b[n-1]+b[n-2])) cout<<"YES"; else cout<<"NO"; }
[ "nidheeshpandey@gmail.com" ]
nidheeshpandey@gmail.com
2398050f3ecd3914dc7f779b061cd6fcbbc03ef8
5207348f2e7bf486ab942969a61293bb6f603aef
/MaxFactor.cpp
e59ed6bc67ff9c462f3b96aa5a48c620a5ed1fcb
[]
no_license
butorin75/maxfactor
48d7f0beed3618459b43fc1f8c3b317906f2ccfb
bbfbf7a43f157ce246693ca545c5258dd8f5dde6
refs/heads/master
2023-08-10T21:17:45.494011
2021-09-29T12:09:17
2021-09-29T12:09:17
411,658,399
0
0
null
null
null
null
UTF-8
C++
false
false
1,309
cpp
// MaxFactor.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. // #include <iostream> std::uint64_t sqrt64(uint64_t a) { uint64_t min = 0; uint64_t max = ((uint64_t)1) << 32; while (1) { if (max <= 1 + min) return min; uint64_t sqt = min + (max - min) / 2; uint64_t sq = sqt * sqt; if (sq == a) return sqt; if (sq > a) max = sqt; else min = sqt; } return 1ULL; } bool is_prime(std::uint64_t x) { std::uint64_t max = sqrt64(x); for (std::uint64_t i = 2; i <= max; i++) { if (x % i == 0) { return false; } } return true; } std::uint64_t max_factor(std::uint64_t n) { std::uint64_t max_val = n/2 + 1; if ((max_val % 2) == 0) ++max_val; for (std::uint64_t i = max_val; i >= 2; i -= 2) { if (is_prime(i) && (n % i) == 0) return i; } return 1; } int main() { std::cout << "MaxFactor 1.0\nPlease enter the number:"; std::uint64_t n; std::cin >> n; std::cout << "Maximum simple divider: " << max_factor(n); }
[ "mvc94104@gmail.com" ]
mvc94104@gmail.com
d97977fd0ec8ac543e6accb48a09c1998fe9427d
dc6335308a793b7ac35a80a761f9c87c6cef8d07
/include/OperatingSystems/Processor/ErrorCounter.h
046d055d4ef0a1e64578eb2033c8944065f8dddc
[]
no_license
Dzordzu/OperatingSystemsV2
bf149c1ce697d2608833e014e0e2c4d1e11de20b
e5a19dd216089dd09b3fb5c38b6a78891b79896c
refs/heads/master
2020-05-24T13:16:35.461293
2019-05-22T19:08:43
2019-05-22T19:08:43
187,285,942
0
0
null
null
null
null
UTF-8
C++
false
false
791
h
// // Created by dzordzu on 5/18/19. // #ifndef OPERATINGSYSTEMSS_PROCESSOR_ERRORSCOUNTER_H #define OPERATINGSYSTEMSS_PROCESSOR_ERRORSCOUNTER_H #include <cstdint> #include <string> namespace OperatingSystems { namespace Processor { class ErrorCounter { std::string counterName; uint_fast64_t errors = 0; public: explicit ErrorCounter(const std::string &counterName) : counterName(counterName) {} void add(int amount = 1) { errors+=amount; } uint_fast64_t getErrors() const {return errors;} void reset() {errors = 0;} const std::string &getCounterName() const { return counterName; } }; } } #endif //OPERATINGSYSTEMSS_PROCESSOR_ERRORSCOUNTER_H
[ "tomekdur@wp.pl" ]
tomekdur@wp.pl
c325d557028485636c36466912db15eb71f0e22c
7b4878e9d41c29696323222200964ddbfa726dda
/Khrysalis.Engine/Source/Khrysalis/Debug/Assert.h
00c0a24f6bc9aaa68b7df94766f5f18036e05233
[]
no_license
Kukuun/Khrysalis
649a945d1cbff2291dbe03fcca8c16716c352fa2
e2c623281d2b6c794e81635f69b5cf96e73963c0
refs/heads/master
2023-03-11T22:24:45.366202
2020-12-18T17:00:00
2020-12-18T17:00:39
319,071,145
0
0
null
null
null
null
UTF-8
C++
false
false
1,148
h
#pragma once #include "Khrysalis/Core/Base.h" #include "Khrysalis/Debug/Log.h" #include <filesystem> #ifdef KAL_ENABLE_ASSERTS #define KAL_INTERNAL_ASSERT_IMPL(type, check, msg, ...) { if(!(check)) { KAL##type##ERROR(msg, __VA_ARGS__); KAL_DEBUGBREAK(); } } #define KAL_INTERNAL_ASSERT_WITH_MSG(type, check, ...) KAL_INTERNAL_ASSERT_IMPL(type, check, "Assertion failed: {0}", __VA_ARGS__) #define KAL_INTERNAL_ASSERT_NO_MSG(type, check) KAL_INTERNAL_ASSERT_IMPL(type, check, "Assertion '{0}' failed at {1}:{2}", KAL_STRINGIFY_MACRO(check), std::filesystem::path(__FILE__).filename().string(), __LINE__) #define KAL_INTERNAL_ASSERT_GET_MACRO_NAME(arg1, arg2, macro, ...) macro #define KAL_INTERNAL_ASSERT_GET_MACRO(...) KAL_EXPAND_MACRO( KAL_INTERNAL_ASSERT_GET_MACRO_NAME(__VA_ARGS__, KAL_INTERNAL_ASSERT_WITH_MSG, KAL_INTERNAL_ASSERT_NO_MSG) ) #define KAL_ENGINE_ASSERT(...) KAL_EXPAND_MACRO( KAL_INTERNAL_ASSERT_GET_MACRO(__VA_ARGS__)(_ENGINE_, __VA_ARGS__) ) #define KAL_ASSERT(...) KAL_EXPAND_MACRO( KAL_INTERNAL_ASSERT_GET_MACRO(__VA_ARGS__)(_, __VA_ARGS__) ) #else #define KAL_ENGINE_ASSERT(...) #define KAL_ASSERT(...) #endif
[ "pmunk87@gmail.com" ]
pmunk87@gmail.com
13041cc246ceb23a710d1a8e041f96eb0e204e43
085e03878f982a59185cc91581d1c61b0eba7ecc
/BattleTank/Source/BattleTank/TankBattle_UserWidget.h
0c08b0f857441f3881903493326c6ffd2061a2de
[]
no_license
fogeZombie/BattleTankTutorial
c1a0dcf1ef34cb09c2c0ebb81085f19d0a391bde
71b1967c86953c927adeff5329cc0b169c55b219
refs/heads/master
2020-03-23T10:42:53.596795
2018-08-31T19:52:54
2018-08-31T19:52:54
141,458,046
0
0
null
null
null
null
UTF-8
C++
false
false
316
h
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "Blueprint/UserWidget.h" #include "TankBattle_UserWidget.generated.h" /** * */ UCLASS() class BATTLETANK_API UTankBattle_UserWidget : public UUserWidget { GENERATED_BODY() };
[ "fogezombie@gmail.com" ]
fogezombie@gmail.com
57d8200f790b3735c8cd228c52c4b48081a8b708
9d1e48f5746830082fec687a120f93ee182d59bb
/Vid_4.0/Vid_4.0.ino
95f7622a4c8be265c72f3e591687342b8f87054c
[]
no_license
Ankit-Sidana/Arduino
8d259d94256a3f10a3b867218716b10e5a89ce3f
010aacc024a81867556448788dc38ed1ee5ea164
refs/heads/master
2023-05-10T20:33:19.503863
2021-05-27T17:03:59
2021-05-27T17:03:59
371,437,625
2
0
null
null
null
null
UTF-8
C++
false
false
174
ino
// C++ code // int sensepin = 0; void setup() { analogReference(DEFAULT); Serial.begin(9600); } void loop() { Serial.println(analogRead(sensepin)); delay(500); }
[ "ankitsidana27@gmail.com" ]
ankitsidana27@gmail.com
6d10ff953b873c6efc9a27a700a8f566b6ad3844
757f949fd92e6986d287e54257e65b6a05506d10
/src/hwcomponents/caros_universalrobot/src/ursafe_main.cpp
809b19d8872b96fdb1eaeec67913a336785c4fb9
[ "Apache-2.0" ]
permissive
tlund80/MARVIN
5a5d7da37aaa1e901a6e493589c4d7b3cb9802ae
9fddfd4c8e298850fc8ce49c02ff437f139309d0
refs/heads/master
2021-05-01T02:57:47.572095
2015-03-27T13:51:07
2015-03-27T13:51:07
23,161,076
0
1
null
null
null
null
UTF-8
C++
false
false
2,288
cpp
#include "UniversalRobots.hpp" #include <rw/common/PropertyMap.hpp> #include <rw/loaders/xml/XMLPropertyLoader.hpp> #include <rw/loaders/WorkCellLoader.hpp> #include <boost/bind.hpp> using namespace rwhw; using namespace rw::common; using namespace rw::loaders; using namespace rw::models; using namespace rw::kinematics; int main(int argc, char **argv) { if (argc <= 2) { std::cout<<"Usage: ursafe <workcell> <propertyfile.prop.xml>"<<std::endl; return 0; } WorkCell::Ptr workcell = WorkCellLoader::load(argv[1]); if (workcell == NULL) { std::cout<<"Unable to load workcell: "<<argv[1]<<std::endl; return 0; } PropertyMap properties = XMLPropertyLoader::load(argv[2]); if (!properties.has("Name")) { std::cout<<"No property named 'Name' found in property file"<<std::endl; return 0; } std::string deviceName = properties.get<std::string>("Name"); Device::Ptr dev = workcell->findDevice(deviceName); if (dev == NULL) { std::cout<<"Unable to find device "<<deviceName<<" in work cell"<<std::endl; return 0; } ros::init(argc, argv, properties.get<std::string>("Name").c_str()); std::string host = properties.get<std::string>("NetFTHost"); int updateRate = properties.get<int>("NetFTUpdateRate"); std::string calibfile = properties.get<std::string>("NetFTCalibrationFile"); std::cout<<"Calibration File = "<<calibfile<<std::endl; NetFTLogging netft(host); FTCompensation ftCompensation(dev, workcell->getDefaultState(), calibfile); UniversalRobots ur(workcell, properties, updateRate, &netft, &ftCompensation); ur.run(); // while (ros::ok()) // { // /** // * This is a message object. You stuff it with data, and then publish it. // */ // sensor_data msg; // // std::stringstream ss; // ss << "hello";// << count; // msg.name = ss.str(); // // ROS_INFO("%s", msg.name.c_str()); // // /** // * The publish() function is how you send messages. The parameter // * is the message object. The type of this object must agree with the type // * given as a template parameter to the advertise<>() call, as was done // * in the constructor above. // */ // chatter_pub.publish(msg); // // ros::spinOnce(); // // loop_rate.sleep(); // ++count; // } return 0; }
[ "soelund@mail.dk" ]
soelund@mail.dk
65361a258ddec04eb07cb9e94ea902dca30352b8
bebd4f4ed50b0fa55ed1a867bf41ab45ff96c6fa
/src/semantics/drawing_helpers.cpp
41f7f8aff25d845b7652d41db8df5cb0f168ef9f
[ "MIT" ]
permissive
tomaszmj/lturtle
a9b91859fa278735c8c02e45afd08b6f2701bbd3
e8fff3c0393697b69f4985cdccf74491eb7c88c9
refs/heads/master
2022-04-16T06:46:40.475997
2020-04-11T11:42:21
2020-04-11T11:42:21
254,855,507
0
0
null
null
null
null
UTF-8
C++
false
false
2,621
cpp
#include "drawing_helpers.h" #include "exception.h" #ifdef DEBUG #include <iostream> #endif using namespace semantics_namespace; TurtleState::TurtleState() : pencolour(0, 0, 0), pendown(true), position(0.0f, 0.0f), rotation(90.0f), pensize(1.0f), scale(1.0f) {} UtmostTurtleCoordinates::UtmostTurtleCoordinates(const std::pair<float, float> &starting_pos) : maxX(starting_pos.first), minX(starting_pos.first), maxY(starting_pos.second), minY(starting_pos.second), margin(1.0) {} void UtmostTurtleCoordinates::update(const std::pair<float, float> &position) { if(position.first < minX) minX = position.first; if(position.first > maxX) maxX = position.first; if(position.second < minY) minY = position.second; if(position.second > maxY) maxY = position.second; } void UtmostTurtleCoordinates::update(float pensize) { if(pensize > margin) margin = pensize; } const sf::Color DrawingContext::defaultColour(255, 255, 255); DrawingContext::DrawingContext(const UtmostTurtleCoordinates &coord) : xNegativeOffset(coord.getMinX() - coord.getMargin()), yPositiveOffset(coord.getMaxY() + coord.getMargin()) { unsigned width = static_cast<unsigned>(coord.getMaxX() - coord.getMinX() + 2*coord.getMargin()); unsigned height = static_cast<unsigned>(coord.getMaxY() - coord.getMinY() + 2*coord.getMargin()); target.create(width, height); target.clear(defaultColour); target.setSmooth(true); } void DrawingContext::save(const std::string &filename) { target.getTexture().copyToImage().saveToFile(filename); // SFML "witout asking" itself prints error message } void DrawingContext::drawLine(const TurtleState &state, float length) { if(!state.pendown) return; sf::RectangleShape line(sf::Vector2f(state.scale * length, state.scale * state.pensize)); line.setRotation(-state.rotation); // setRotation(number of DEGREES), clockwise (state.rotation is counter-clockwise) line.setFillColor(state.pencolour); std::pair<float, float> point = transfromTurtleCoordinatesToImageCoordinates(state.position); line.setPosition(point.first, point.second); target.draw(line); } std::pair<float, float> DrawingContext::transfromTurtleCoordinatesToImageCoordinates(const std::pair<float, float> &point) const { #ifdef DEBUG std::cerr << "transfrom coordinates (" << point.first << ", " << point.second << ") -> (" << point.first - xNegativeOffset << ", " << yPositiveOffset - point.second << ")\n"; #endif return std::pair<float, float>(point.first - xNegativeOffset, yPositiveOffset - point.second); }
[ "tomasz.m.j.nowak@gmail.com" ]
tomasz.m.j.nowak@gmail.com
a35a1977bc4b166fc0f5776b7e2773706e9ab930
7c9facd0904153b1a2d1052f424529c1669a0562
/PSUC Lab/week 6/interchange.cpp
947adc36fbb257610b10e44f795273aa3cde0ff4
[]
no_license
JevDsouza/Labs
f57c89ff6a79b45bbe90ebee64e6708735e7bcdd
15e738faa0cf579ccc224bdd5353cce9f0f05103
refs/heads/master
2021-08-07T18:43:05.267214
2020-08-14T00:41:48
2020-08-14T00:41:48
210,691,580
3
0
null
null
null
null
UTF-8
C++
false
false
656
cpp
#include<iostream> using namespace std; int main() { int a[3][3],b[3][3]; int k=1;int temp=0; cout<<"Enter the array elements"<<endl; for(int i=0;i<3;i++) { for(int j=0;j<3;j++) cin>>a[i][j]; } for(int j=0;j<3;j++) { temp=a[0][j]; a[0][j]=a[1][j]; a[1][j]=temp; } cout<<"Row exchange"<<endl; for(int i=0;i<3;i++) { for(int j=0;j<3;j++) cout<<a[i][j]<<" "; cout<<endl; } cout<<"Column exchange"<<endl; for(int i=0;i<3;i++) { temp=a[i][1-1]; a[i][1-1]=a[i][2-1]; a[i][2-1]=temp; } for(int i=0;i<3;i++) { for(int j=0;j<3;j++) cout<<a[i][j]<<" "; cout<<endl; } }
[ "noreply@github.com" ]
JevDsouza.noreply@github.com
7d8a879029340804e89c995bc4f7e0b78a227286
6ae3ac751afd23568725edddc0b02938ce80a0c6
/catkin_ws/devel/include/beginner_tutorials/valueMatrix.h
886911715760b33153e14e33a6eff15079eb16ee
[ "MIT" ]
permissive
lies98/ROS_chasing_ball
ee0514b62605eea8c68dc17ef1355b2165a1bfed
6e1f08ed51a5b5f0c7b0bdebfb1bef2d3fe61949
refs/heads/main
2023-04-05T18:28:55.579984
2021-04-18T18:46:21
2021-04-18T18:46:21
359,225,462
0
0
null
null
null
null
UTF-8
C++
false
false
6,784
h
// Generated by gencpp from file beginner_tutorials/valueMatrix.msg // DO NOT EDIT! #ifndef BEGINNER_TUTORIALS_MESSAGE_VALUEMATRIX_H #define BEGINNER_TUTORIALS_MESSAGE_VALUEMATRIX_H #include <string> #include <vector> #include <map> #include <ros/types.h> #include <ros/serialization.h> #include <ros/builtin_message_traits.h> #include <ros/message_operations.h> #include <std_msgs/Header.h> namespace beginner_tutorials { template <class ContainerAllocator> struct valueMatrix_ { typedef valueMatrix_<ContainerAllocator> Type; valueMatrix_() : header() , value(0.0) , tick(false) , option() { } valueMatrix_(const ContainerAllocator& _alloc) : header(_alloc) , value(0.0) , tick(false) , option(_alloc) { (void)_alloc; } typedef ::std_msgs::Header_<ContainerAllocator> _header_type; _header_type header; typedef float _value_type; _value_type value; typedef uint8_t _tick_type; _tick_type tick; typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _option_type; _option_type option; typedef boost::shared_ptr< ::beginner_tutorials::valueMatrix_<ContainerAllocator> > Ptr; typedef boost::shared_ptr< ::beginner_tutorials::valueMatrix_<ContainerAllocator> const> ConstPtr; }; // struct valueMatrix_ typedef ::beginner_tutorials::valueMatrix_<std::allocator<void> > valueMatrix; typedef boost::shared_ptr< ::beginner_tutorials::valueMatrix > valueMatrixPtr; typedef boost::shared_ptr< ::beginner_tutorials::valueMatrix const> valueMatrixConstPtr; // constants requiring out of line definition template<typename ContainerAllocator> std::ostream& operator<<(std::ostream& s, const ::beginner_tutorials::valueMatrix_<ContainerAllocator> & v) { ros::message_operations::Printer< ::beginner_tutorials::valueMatrix_<ContainerAllocator> >::stream(s, "", v); return s; } } // namespace beginner_tutorials namespace ros { namespace message_traits { // BOOLTRAITS {'IsFixedSize': False, 'IsMessage': True, 'HasHeader': True} // {'beginner_tutorials': ['/root/catkin_ws/src/beginner_tutorials/msg'], 'std_msgs': ['/opt/ros/kinetic/share/std_msgs/cmake/../msg']} // !!!!!!!!!!! ['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_parsed_fields', 'constants', 'fields', 'full_name', 'has_header', 'header_present', 'names', 'package', 'parsed_fields', 'short_name', 'text', 'types'] template <class ContainerAllocator> struct IsFixedSize< ::beginner_tutorials::valueMatrix_<ContainerAllocator> > : FalseType { }; template <class ContainerAllocator> struct IsFixedSize< ::beginner_tutorials::valueMatrix_<ContainerAllocator> const> : FalseType { }; template <class ContainerAllocator> struct IsMessage< ::beginner_tutorials::valueMatrix_<ContainerAllocator> > : TrueType { }; template <class ContainerAllocator> struct IsMessage< ::beginner_tutorials::valueMatrix_<ContainerAllocator> const> : TrueType { }; template <class ContainerAllocator> struct HasHeader< ::beginner_tutorials::valueMatrix_<ContainerAllocator> > : TrueType { }; template <class ContainerAllocator> struct HasHeader< ::beginner_tutorials::valueMatrix_<ContainerAllocator> const> : TrueType { }; template<class ContainerAllocator> struct MD5Sum< ::beginner_tutorials::valueMatrix_<ContainerAllocator> > { static const char* value() { return "bc1cd923f6f816fbd3a3ec5219a648ae"; } static const char* value(const ::beginner_tutorials::valueMatrix_<ContainerAllocator>&) { return value(); } static const uint64_t static_value1 = 0xbc1cd923f6f816fbULL; static const uint64_t static_value2 = 0xd3a3ec5219a648aeULL; }; template<class ContainerAllocator> struct DataType< ::beginner_tutorials::valueMatrix_<ContainerAllocator> > { static const char* value() { return "beginner_tutorials/valueMatrix"; } static const char* value(const ::beginner_tutorials::valueMatrix_<ContainerAllocator>&) { return value(); } }; template<class ContainerAllocator> struct Definition< ::beginner_tutorials::valueMatrix_<ContainerAllocator> > { static const char* value() { return "Header header\n\ \n\ float32 value\n\ \n\ bool tick\n\ \n\ string option\n\ ================================================================================\n\ MSG: std_msgs/Header\n\ # Standard metadata for higher-level stamped data types.\n\ # This is generally used to communicate timestamped data \n\ # in a particular coordinate frame.\n\ # \n\ # sequence ID: consecutively increasing ID \n\ uint32 seq\n\ #Two-integer timestamp that is expressed as:\n\ # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n\ # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n\ # time-handling sugar is provided by the client library\n\ time stamp\n\ #Frame this data is associated with\n\ # 0: no frame\n\ # 1: global frame\n\ string frame_id\n\ "; } static const char* value(const ::beginner_tutorials::valueMatrix_<ContainerAllocator>&) { return value(); } }; } // namespace message_traits } // namespace ros namespace ros { namespace serialization { template<class ContainerAllocator> struct Serializer< ::beginner_tutorials::valueMatrix_<ContainerAllocator> > { template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m) { stream.next(m.header); stream.next(m.value); stream.next(m.tick); stream.next(m.option); } ROS_DECLARE_ALLINONE_SERIALIZER }; // struct valueMatrix_ } // namespace serialization } // namespace ros namespace ros { namespace message_operations { template<class ContainerAllocator> struct Printer< ::beginner_tutorials::valueMatrix_<ContainerAllocator> > { template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::beginner_tutorials::valueMatrix_<ContainerAllocator>& v) { s << indent << "header: "; s << std::endl; Printer< ::std_msgs::Header_<ContainerAllocator> >::stream(s, indent + " ", v.header); s << indent << "value: "; Printer<float>::stream(s, indent + " ", v.value); s << indent << "tick: "; Printer<uint8_t>::stream(s, indent + " ", v.tick); s << indent << "option: "; Printer<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::stream(s, indent + " ", v.option); } }; } // namespace message_operations } // namespace ros #endif // BEGINNER_TUTORIALS_MESSAGE_VALUEMATRIX_H
[ "liesamarouche@MacBook-Pro-de-Lies.local" ]
liesamarouche@MacBook-Pro-de-Lies.local
0460f336abdb7c1cbb2c7f2a2d2338d1a93a2e16
e2a4ddb143bfc57b08c6062f88ff9271923001ad
/55.JumpGame.cpp
4e631ce837afce6c7524fbcf9ff60609827e69cb
[]
no_license
jo-qzy/LeetCode
d99bdf6f73c3e081059f4bcb0c781580f1c7b644
47081a328481c14074173cd481f3b8241f45b9e3
refs/heads/master
2021-06-27T18:28:55.779325
2019-03-12T16:15:19
2019-03-12T16:15:19
134,131,932
0
1
null
null
null
null
UTF-8
C++
false
false
934
cpp
// 评论提供的,从后往前遍历,n为到前一个记录的点的需要的步长 class Solution { public: bool canJump(vector<int>& nums) { int n = 1; for (int i = nums.size() - 2; i >= 0; i--) { if (nums[i] >= n) n = 1; else n++; if (i == 0 && n > 1) return false; } return true; } }; // 递归超时,但是我认为可行,因为我是差不多类似贪心写的 // 虽然他超时了。。。 class Solution { public: bool canJump(vector<int>& nums) { return canJump(nums, 0); } private: bool canJump(vector<int>& nums, size_t index) { if (index + nums[index] >= nums.size() - 1) return true; for (size_t i = nums[index]; i > 0; i--) { if (canJump(nums, index + i)) return true; } return false; } };
[ "2651933495@qq.com" ]
2651933495@qq.com
65244b996c7e0e02d14e8b52ef2025840a480750
9a6a3ed03bddce848dbeb0a983ca058695025620
/projects/biogears/libBiogears/src/cdm/properties/SEScalarPowerPerAreaTemperatureToTheFourth.cpp
b885cd8a37fdf80b615887ed2a18dbbd7d23bf94
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
amodhs619/core
0da9a123c283eb63be17b3bb4ad921986fe9283e
149bef063d364a7fb19e74f5907abdc7dda2e4e9
refs/heads/master
2023-08-18T05:45:29.197416
2021-01-29T08:17:42
2021-04-28T18:20:08
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,820
cpp
/************************************************************************************** Copyright 2015 Applied Research Associates, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ #include <biogears/cdm/properties/SEScalarPowerPerAreaTemperatureToTheFourth.h> namespace biogears { const PowerPerAreaTemperatureToTheFourthUnit PowerPerAreaTemperatureToTheFourthUnit::W_Per_m2_K4("W/ m^2 K^4"); PowerPerAreaTemperatureToTheFourthUnit::PowerPerAreaTemperatureToTheFourthUnit(const char* u) : PowerPerAreaTemperatureToTheFourthUnit(std::string{ u }) { } //------------------------------------------------------------------------------- PowerPerAreaTemperatureToTheFourthUnit::PowerPerAreaTemperatureToTheFourthUnit(const std::string& u) : CCompoundUnit(u) { } //------------------------------------------------------------------------------- CDM::ScalarPowerPerAreaTemperatureToTheFourthData* SEScalarPowerPerAreaTemperatureToTheFourth::Unload() const { if (!IsValid()) return nullptr; CDM::ScalarPowerPerAreaTemperatureToTheFourthData* data(new CDM::ScalarPowerPerAreaTemperatureToTheFourthData()); SEScalarQuantity::Unload(*data); return data; } //------------------------------------------------------------------------------- bool PowerPerAreaTemperatureToTheFourthUnit::IsValidUnit(const char* unit) { if (strcmp(W_Per_m2_K4.GetString(),unit) == 0) return true; return false; } //------------------------------------------------------------------------------- bool PowerPerAreaTemperatureToTheFourthUnit::IsValidUnit(const std::string& unit) { return IsValidUnit(unit.c_str()); } //------------------------------------------------------------------------------- const PowerPerAreaTemperatureToTheFourthUnit& PowerPerAreaTemperatureToTheFourthUnit::GetCompoundUnit(const char* unit) { if (strcmp(W_Per_m2_K4.GetString(),unit) == 0) return W_Per_m2_K4; std::stringstream err; err << unit << " is not a valid PowerPerAreaTemperatureToTheFourth unit"; throw CommonDataModelException(err.str()); } //------------------------------------------------------------------------------- const PowerPerAreaTemperatureToTheFourthUnit& PowerPerAreaTemperatureToTheFourthUnit::GetCompoundUnit(const std::string& unit) { return GetCompoundUnit(unit.c_str()); } //------------------------------------------------------------------------------- bool PowerPerAreaTemperatureToTheFourthUnit::operator==(const PowerPerAreaTemperatureToTheFourthUnit& obj) const { return GetString() == obj.GetString(); } //------------------------------------------------------------------------------- bool PowerPerAreaTemperatureToTheFourthUnit::operator!=(const PowerPerAreaTemperatureToTheFourthUnit& obj) const { return !(*this == obj); } //------------------------------------------------------------------------------- bool SEScalarPowerPerAreaTemperatureToTheFourth::operator==(const SEScalarPowerPerAreaTemperatureToTheFourth& obj) const { return m_unit == obj.m_unit && m_value == obj.m_value; } //------------------------------------------------------------------------------- bool SEScalarPowerPerAreaTemperatureToTheFourth::operator!=(const SEScalarPowerPerAreaTemperatureToTheFourth& obj) const { return !(*this == obj); } }
[ "sawhite@ara.com" ]
sawhite@ara.com
ede47cfe9ff4c0885b07f33ff32ab74df43fb304
07cbe159795612509c2e7e59eb9c8ff6c6ed6b0d
/partitioned/RayleighBenard/3D/Ra_1e+05_multiFluidBoussinesqFoam_resX20_Y10_lowB_sigma_0_5_divTransfer_laplacianTransfer_gamma_1e-2/init_118/b.stable
f53126c44eaad2dd91765b1b1b2107f860b876ce
[]
no_license
AtmosFOAM/danRun
aacaaf8a22e47d1eb6390190cb98fbe846001e7a
94d19c4992053d7bd860923e9605c0cbb77ca8a2
refs/heads/master
2021-03-22T04:32:10.679600
2020-12-03T21:09:40
2020-12-03T21:09:40
118,792,506
0
0
null
null
null
null
UTF-8
C++
false
false
69,885
stable
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object b.stable; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -2 0 0 0 0]; internalField nonuniform List<scalar> 4000 ( -0.00137882171868 0.0103941238049 0.0156116732701 0.00477034491101 0.0140187481075 0.028264409045 0.0165069501869 0.00967904261138 0.000535972895072 0.00406737321052 0.027533698543 0.0156207886228 0.0128699685467 0.0205713319817 0.00466961335479 0.00959059662264 0.0267684921704 0.0107324932883 0.00517670875542 -0.00297438585463 -0.0141171184845 -0.000136677887698 0.00474950824591 -0.00387821562679 0.00196258799121 0.0198710697696 0.00591956901827 0.00252495449512 -0.00477098597868 -0.00598986188041 0.0173790874252 0.00477146001545 0.00107819595082 0.00650441016393 -0.00514835029058 -0.000306194057672 0.0188219532228 -0.000691402803008 -0.00380208481614 -0.0122864782201 -0.013425762575 -0.00243193823364 0.00258270874324 -0.00273306227699 0.00109632471989 0.0143770578119 0.00198210926914 0.00214553437221 -0.00198986347606 -0.00537617325843 0.0121156364437 0.00223807167178 -0.0012148101716 -0.00152368908431 -0.00565468393461 -0.000754768941917 0.0139173642628 -0.00279564843223 -0.00492773710168 -0.0124253816025 -0.00792733294193 -0.00399938685452 5.79237849167e-05 7.53677667539e-05 0.00187097502042 0.0109456708386 0.00115575966895 0.00263140109721 -0.000750822817699 -0.00382448538202 0.0127725338622 0.00363750750533 -0.00132843312211 -0.00393097236003 -0.00555273414783 -0.000105981152763 0.0100214371127 -0.0030876525879 -0.00553649062531 -0.0114784582088 -0.00430423347784 -0.00452661867784 -0.00193093530203 0.000583823682184 0.00302203987384 0.00819073091736 0.00133382930573 0.00379799442878 -0.000175508629183 -0.00251815148168 0.0141767771272 0.00578375537025 -0.000851412815383 -0.00557453120215 -0.00585233326558 0.000268935473392 0.00620232580768 -0.00307586101594 -0.00632468296584 -0.0125563113885 -0.00296277532331 -0.00597543237048 -0.00200673336509 -0.00249114063561 0.00449037927496 0.00584618631983 0.00202909073269 0.00515748626844 -0.000464971012232 -0.000612576206107 0.0152873761018 0.00724379903055 0.000163484115775 -0.00735018865541 -0.00637098449057 0.000674757115257 0.00358397863452 -0.0026959282468 -0.00674087709911 -0.0154497385093 -0.00246640356769 -0.0059903405303 -0.00150032447985 -0.00729606981621 0.0043907166687 0.0040706392195 0.00333369323366 0.00564037953367 -0.00153795160519 0.00163458809501 0.0152734120911 0.0089325077066 0.00174975969186 -0.00979825169326 -0.00720152346056 0.000959460122865 0.003689909614 -0.00186489226017 -0.00652567200839 -0.0173933885051 -0.00225921127449 -0.00778958166732 -0.00114004003066 -0.0132902430662 0.00372494480251 0.00310119916254 0.00520791042745 0.00581106969951 -0.00327019883537 0.00266955084321 0.0147646324065 0.01153105662 0.00418494902183 -0.0131984469565 -0.00912013258342 0.00109193610241 0.00520766214303 0.000574939388283 -0.00655720569911 -0.0188148531427 -0.00136515252278 -0.0136895202333 -0.00493061608841 -0.0209508993779 0.0026526425863 -0.00162174786644 0.00464556529557 0.0039752047656 -0.00846018554433 0.00138767415458 0.0127144702466 0.0110822941097 0.00412694064489 -0.0182565165191 -0.0136473571851 -0.00138070036762 0.00649750164059 0.00320081808382 -0.0108369877537 -0.0200069024989 -0.00728677718703 -0.0228582333163 -0.0193128168069 -0.0293397125261 -0.00528642184936 -0.016464483181 -0.00615719966576 -0.00955671588422 -0.0210188054169 -0.00937316515247 0.000127654837359 -0.00252614460822 -0.00658647971378 -0.0268071525479 -0.0237460086079 -0.0150043752913 -0.00173226733611 -0.00529948436544 -0.0219441483066 -0.0267591265498 0.0172567589347 0.00786720771903 -0.00247090844028 0.00491018901429 0.0175507713288 0.0270339329306 0.0257978581241 0.020636114563 0.0242498314482 0.0270416536643 0.0215454833578 0.0198039902153 0.0219836427966 0.0114424741389 0.0067463800177 0.00699770400274 0.0288303186059 0.0216917898006 0.0119225060994 0.00648169166481 0.00030161254192 -0.00520566379176 -0.0138070395305 -0.00161288409927 0.00474733412455 0.0199163154535 0.018813102622 0.0118463280946 0.015151047697 0.0189382325774 0.00906536924913 0.00981985783329 0.00641395488662 0.00295850492493 -0.00169818198463 0.000199094825949 0.0218413265849 0.00565670588511 -0.00259260054299 -0.0101479062538 -0.00655220848345 -0.00779836771443 -0.0152624759481 0.00392351729476 0.00356965343262 0.0185361142976 0.0193455033455 0.00894971953363 0.0107068247121 0.0145349514137 0.00426387329539 0.0101710796825 0.00261220533999 -0.000345489893167 -3.51474234808e-05 -0.000250713709759 0.0156787236285 -0.00106564832928 -0.0047206392108 -0.0111562650151 -0.00764192698182 -0.00749560953577 -0.0160491683961 0.00632000837066 0.00493107378673 0.0174061468251 0.0197105915894 0.00597759127127 0.00767773158986 0.0114737931005 0.00185422844829 0.0114505175529 0.00300531628447 -0.000162242501637 0.00267298730416 -0.000346846532235 0.0104467773428 -0.00363785597242 -0.00574956091914 -0.00773210033446 -0.00706985982349 -0.00660426079108 -0.016910858787 0.00683857769733 0.00620726442703 0.0156942495182 0.0193582570054 0.000385308896483 0.00506879299984 0.0092431432767 0.00185362644744 0.0125607801816 0.00213373829948 0.00090145231229 0.00449535785135 -0.000585363912748 0.00832493133322 -0.00580786114922 -0.00799701615557 -0.00516601341078 -0.00585778227292 -0.00555856412367 -0.0179414439161 0.00549645373116 0.00720233790578 0.013933215198 0.0183610160635 -0.00074109703342 0.00304268133241 0.00805961416619 0.00302128798984 0.0129229937864 -0.00219148812035 0.00171812141498 0.00530734196623 -0.00185479838729 0.00885774651966 -0.00825571631121 -0.011492797866 -0.00438614585106 -0.00402186821935 -0.00450098738241 -0.0197929573923 0.00263220267499 0.00831542020195 0.0133871165067 0.0163976472716 0.00193234452747 0.00198633510851 0.00732602532623 0.00540984665905 0.0127192807383 -0.0067296992183 0.0022527643769 0.005384940281 -0.00358790666898 0.00889771141666 -0.0104110123606 -0.0150463654122 -0.00499449779084 -0.0011017834789 -0.00220672142314 -0.0224765934745 -0.000722041546581 0.00909724913207 0.0138391456847 0.0146962650825 0.00320845683925 0.00139222386425 0.0063898598772 0.00740063457678 0.0118026041895 -0.00935433915858 0.00241416904583 0.00242288422704 -0.00514914906461 0.0071660706009 -0.0121048557056 -0.0186992520237 -0.00772084990691 0.00184522937433 0.00080481489548 -0.0257792440676 -0.00679644673775 0.00665046109755 0.0132703819075 0.0143260237804 0.00229278271436 -0.000899639907657 0.00435246345191 0.00628120602793 0.0103370364774 -0.013340810013 0.000676943267775 -0.00507411873887 -0.00715188140267 -0.00246229689291 -0.013951084855 -0.0229255976408 -0.0140231060858 -0.00511396631671 -0.00597336862729 -0.0300943808264 -0.0210329360141 -0.00670970429084 0.00283354834989 0.00415751509709 -0.0109436055237 -0.0146960967491 -0.00678029539833 -0.00564892567159 0.000190165503792 -0.022978131681 -0.0120178700956 -0.0194745581105 -0.0163568669337 -0.0165766339954 -0.0232207647217 -0.0286083770121 -0.0260872349394 0.01332715703 0.00525548114421 -0.00145700283302 0.0203460311125 0.0250066973697 0.024957977605 0.0120856574435 0.00555445454286 0.008838139078 -0.00182658905078 0.00462836575491 0.0197570442086 0.0188299487468 0.0216498896311 0.0150751080454 0.0195609345439 0.0222955445502 0.0202730975323 0.00146431514968 0.00682587144448 -0.000803636811273 -0.00673862835056 -0.0103199578211 0.00516680612808 0.0134722266422 0.0159786854994 0.00605452325111 -0.00122728417232 -0.000700233344946 -0.0077510758386 -0.00420413231699 0.0044533750799 0.00746975893622 0.0115479533444 0.00552030231868 0.0103684960233 0.0154719735954 0.0104364704471 -0.00517467085127 -0.00545403095244 -0.00385366849789 -0.00782848107303 -0.00981430723124 -0.000138068141701 0.00769340766608 0.0129349105045 0.00592927744369 -0.00146942736112 -0.00282447661883 -0.00752501103996 -0.00382249581685 -0.000151362293319 0.00429128055644 0.0114430010428 0.00421578677676 0.0111762688753 0.0160605917077 0.00949964798953 -0.00441374470135 -0.00433819437892 -0.00352695431877 -0.0078501603784 -0.00559909107189 0.00187624017621 0.00597404614869 0.0129453647681 0.00665717423405 -0.000593289945278 -0.00406054433777 -0.00710579473452 -0.00170691483976 0.00190063521473 0.00225218824269 0.0125533747557 0.00529020245289 0.0148261892103 0.0178193494614 0.0117148844867 -0.00528601252169 -0.00188698673129 -0.00265554704438 -0.00809124098885 -0.00246873390374 0.00423058181015 0.00601376145365 0.0132620398812 0.00661570824501 -0.000365645773447 -0.00447726271456 -0.00674355772323 -0.000302861938065 0.00358152818643 0.00146565795737 0.0135850711193 0.00775113245769 0.0180478569741 0.0191187461531 0.0120352331932 -0.00780056493951 -0.00022364562149 -0.00130688508722 -0.00794680869596 -0.000980335867464 0.00533325407093 0.00625183636798 0.0136958622132 0.0071061951756 0.00110709530922 -0.00467819569686 -0.00619741208095 0.000569174040632 0.00178997353093 0.0020860195303 0.0135651667527 0.009354445176 0.0186513224758 0.0190323725516 0.0113380268363 -0.010213215585 0.0017134195234 0.000387181981575 -0.00648751445021 -0.000894466163006 0.00592743854541 0.00703224511711 0.0141396593217 0.00815032295969 0.00225662754216 -0.0045087748382 -0.00571224244212 0.000963412323713 -0.00178123183485 0.00415317478813 0.0131216825443 0.0105523547002 0.0180822745207 0.0180772063044 0.0105186304823 -0.0128479156872 0.00392345446428 0.00194583005187 -0.00434319840844 -0.00508476335122 0.00638086899136 0.00859442356495 0.0140518614772 0.0103266083929 0.0023361359235 -0.00378339921045 -0.00603564973035 0.00103129634272 -0.00227017415483 0.00702726337311 0.012315469624 0.0110977079066 0.0168648366557 0.0129588245159 0.00954808871967 -0.0162863614857 0.00599704809007 0.00157764406509 -0.00513695783096 -0.0138243917391 0.0053641477514 0.0105995248902 0.0111736870187 0.00957149836362 -0.00253214737428 -0.00593525015202 -0.0100063857794 -0.0020196417273 -0.00374917541523 0.00681138903188 0.0113776502173 0.00423293253102 0.0127075398087 0.00110397488026 0.00720688476678 -0.0209156378787 0.00597030814441 -0.00819479849635 -0.014926869945 -0.0268436075512 -0.00596989490522 0.00149885308517 -0.00474722197855 -0.00314451195239 -0.0192053323365 -0.0183038214046 -0.0218817137862 -0.0169188983573 -0.016889248629 -0.00442516516188 0.00267103289036 -0.0116248915396 -0.00614340176954 -0.0109444699248 -0.00589571224444 -0.0279361698553 -0.00259256711358 0.0215198101074 0.0165790163914 0.0175584273034 0.0174459775018 0.0251837902844 0.0195677213637 0.0194559756825 0.00198865207771 0.0184453121882 0.00613129850937 0.0091019513231 0.00416775241918 0.0189358707982 0.010798042998 0.014187508052 0.0251111520918 0.0241112264552 0.0226934554812 0.0173112061199 0.0212024494796 0.0096842501445 -0.0028061651504 0.00100550664703 0.00542212307481 0.0141062285658 0.00810201336782 0.00816905970974 -0.00833937718125 0.0103270071531 -0.00330910795696 -0.000270431508681 -0.00659119245033 0.00226504862234 0.000478923409118 0.00918149244315 0.0127328377555 0.0136944244062 0.0134572152634 0.00596849044092 0.0138762627587 0.00436627337029 -0.0133772971548 -0.00066557748824 0.000761110447139 0.00885628925779 0.00488081378133 0.000437315615037 -0.0092262687333 0.00571414245558 -0.00278661129856 0.000465145515169 -0.00799918420008 -0.00715687810064 -0.000675474608668 0.0107888357532 0.00661794222973 0.01068334871 0.00963829078196 0.00510333296135 0.014042799605 0.00127626402924 -0.0148633706323 0.000938828172911 0.000502599759268 0.0073517542234 0.00486413365602 -7.24849585532e-05 -0.0074663141114 -0.00335722747473 -0.00180668382059 0.000867196551467 -0.00859948512579 -0.00989295756075 -0.000539327261492 0.0124599378994 0.00507584443283 0.0103382648844 0.00897597493404 0.00581398628002 0.0149595922446 -0.00093293874602 -0.0151282532164 0.00177874155795 0.00124241926723 0.00730684609754 0.00521577612424 0.00332563023571 -0.00520668335996 -0.0102195070035 -0.00106449817942 0.000850904276506 -0.00926513714038 -0.0104314278717 -0.000203865321846 0.0126948235748 0.00547544462579 0.0108518840669 0.00947012806942 0.0058353525527 0.015901822277 -0.00155534681476 -0.0145068124187 0.000757146690986 0.00266755446065 0.00767893611163 0.00592566815377 0.00583683876712 -0.00419928460129 -0.0124170383148 -0.000653740449076 0.000968130578108 -0.0102885919959 -0.0129985126806 0.000452742430598 0.0112742724353 0.00622055722293 0.0122937560614 0.0103016011025 0.00536600162272 0.0158411872632 -0.00157004500495 -0.0125319480218 -0.00291918729063 0.00439031886677 0.00859882221165 0.0072322744273 0.00666088283381 -0.00478619371481 -0.0142700253548 -0.000503010030685 0.000739781330874 -0.0120638364623 -0.0132288313959 0.00146738426239 0.0106356989173 0.0066001231262 0.0142909705921 0.0100457249777 0.00473023408129 0.0155523637056 -0.00180428360681 -0.0104545017853 -0.0079778067589 0.00635476556472 0.0104021349559 0.0099255871755 0.00413292445038 -0.0082265552157 -0.0160288310064 -0.000870585497027 -0.000870611800157 -0.014872081702 -0.0103881530504 0.00184485697416 0.0122155965006 0.00701672588609 0.0162073436497 0.00884492631271 0.00485079801019 0.0150340730117 -0.00348790327645 -0.00980050495682 -0.0133489433654 0.00595981499046 0.0107745657596 0.0118263665018 -0.00521700261681 -0.0128672651644 -0.0182604530606 -0.00312395705412 -0.00531171147223 -0.0193826989621 -0.0073719370219 -0.00196654867077 0.0100106922288 0.00529670562127 0.0159457032122 0.00475846215327 0.00154457144239 0.0134802639961 -0.0133236229522 -0.018779568607 -0.0206623570835 -0.00575325588271 -0.000912430535247 0.00284545384453 -0.0238193785085 -0.0220480962773 -0.0253087489738 -0.0144923773219 -0.0186575025563 -0.0269455293125 -0.0134104518635 -0.0164666550661 -0.0073651742011 -0.00674842859347 0.0070226803379 -0.0111887698584 -0.0136627822607 0.00172991072685 0.0130480127337 0.00694636655694 0.00279740368458 0.0171021008896 0.00912636593331 0.00885325805956 0.0020803993074 0.00455319705665 0.00867995831199 0.0201536056119 0.025065759783 0.0079545450574 0.00145483722286 0.00493836329458 0.00738492902903 0.0175834415974 0.00573888695905 0.0159282444855 0.0067326381773 0.0048830431637 0.00435106784792 -0.00807476105557 -0.00462913925515 0.00367926296234 -0.00164985262852 -0.00532865035796 -0.00643358150122 -0.00678215380706 -0.00402416355322 0.00612772518513 0.0142952195548 -0.0070977747174 -0.0105095511219 -0.00303331365902 -0.00130615002684 0.00179381078645 -0.00321033615215 0.00341814678732 -0.00188403124682 -0.0030478229621 0.00510486464547 -0.00876684881958 -0.000829241137603 -0.000727425391066 -0.000111165495585 -0.00415592066812 -0.00438293073204 -0.00886102203017 -0.00727433536589 0.0032222517375 0.00796662947247 -0.00872153909588 -0.0117696093934 -0.00194966456091 -0.000152616562135 -0.0030704377383 -0.00361505789162 0.00316473820884 -0.000893680388895 -0.00105934634482 0.00561324870911 -0.00538299559706 0.00139763075502 -0.00186204417082 0.00338600630731 -0.0002602608663 -0.00267310694024 -0.0107229812143 -0.0082775024731 0.00376642685962 0.00406819593264 -0.00719037498279 -0.0111284311601 -0.00141209704597 0.00328586686944 0.000730849927818 -0.0017057600211 0.00394800911075 0.000951850120296 0.000736088980345 0.00380983171066 -0.00108139990562 0.00254297027807 -0.00167601984565 0.00508592402064 0.00276953155981 -0.00362064197808 -0.0129692591211 -0.00844630788744 0.00442484203373 0.00142383029697 -0.00586030780767 -0.00924929915082 -0.0031393575038 0.00712542706729 0.00602835717056 0.000130549137239 0.00430484631071 0.00259229478863 0.00147532248209 0.000702903723352 0.00159003564035 0.00343530299088 -0.000860817432112 0.00559637483481 0.00530316166075 -0.00634767660489 -0.0150558119553 -0.00775804066815 0.00430549118299 0.000310390579405 -0.00495277217948 -0.00723699301753 -0.00653230386719 0.0112796168228 0.00904256972578 0.00181887082663 0.00449073244968 0.00418916598663 0.00170562157833 -0.00145363426734 0.00217822762194 0.00424374956154 0.000691214854009 0.00594314288955 0.00667225794788 -0.00738130986238 -0.0175514568905 -0.00487899431945 0.00374433564741 0.000417722637741 -0.00462651643717 -0.00604832053337 -0.00994573839883 0.0136880517885 0.00817718288461 0.00346376324485 0.00472116376522 0.00485634430429 0.00151534588362 -0.00393046508779 0.000590676357974 0.00489140496164 0.00351430681327 0.00630524425589 0.00706519677199 -0.00818588790876 -0.0203857629585 -9.23114770666e-05 0.00347586936121 -0.000162924656877 -0.00408892906823 -0.0059404226994 -0.0133413483722 0.0116724194172 0.00235123251732 0.00588114904511 0.00538438480421 0.00304802057363 0.00115400038316 -0.00922178266917 -0.00402589777145 0.00493508666208 0.00486589664178 0.00435789008373 0.00676415947072 -0.0144108351724 -0.0236923491664 0.00228367863597 0.00259365666097 -0.00624128132119 -0.00370242485116 -0.0106153696167 -0.0178930042987 0.00142350857 -0.00653046974151 0.00641024070059 0.0049582999597 -0.00144366093641 -0.0018407355301 -0.0214183218031 -0.0172527624506 -0.00531269250295 -0.00563068839294 -0.0101150583612 -0.00315264866029 -0.0267471655992 -0.0284100359464 -0.00521590161825 -0.00784988374332 -0.014453904599 -0.0101756734994 -0.0224350700956 -0.0255781085313 -0.0181395678433 -0.0216639563083 -0.0032307833523 -0.00757106392547 -0.0151600019751 -0.0151308589844 0.0220705397264 0.00586480092095 0.0210632387084 0.0198809175184 0.00587614093434 0.00328502074066 -0.00128045609569 0.00911966551114 0.0179277284428 0.013818161212 0.0219861953229 0.0157537412645 -0.000675525511422 -0.00833311521378 0.000740687223766 0.0161879590623 0.0158291812957 0.0208231018894 0.00318693576957 0.00199028023006 0.0152924162149 -0.00340335516232 0.00566583251819 0.00341009966033 -0.00266917609984 -0.00928431855717 -0.0136133246853 0.000237930354636 0.00303499428658 -0.000853047127509 0.00933365775582 -0.000496581334453 -0.00714893763682 -0.0170888174786 -0.00722781512065 -0.00258126759899 0.00396903784791 0.00885704660504 -0.00377385342268 -0.00697104886861 0.0106667850989 -0.00248975472017 -2.76206265986e-05 -0.00141264977589 -0.000522381849736 -0.0107467759323 -0.0120557385455 -0.00237677129369 -0.00169290758648 -0.00238890500575 0.0096090871084 -0.00450591873995 -0.00329287923482 -0.0172542041509 -0.00604706809548 -0.00685423886448 -0.00236652384928 0.0033030882903 -0.00408513760674 -0.00743617015302 -0.00140650540508 0.000585732001367 9.23664549621e-05 -0.00181797686761 0.000886060301643 -0.01031088745 -0.00775739214922 -0.00338756762413 -0.00176789568262 -0.0015540824256 0.0101410917912 -0.00539207546723 -0.00133085610715 -0.0167041051344 -0.00285349203688 -0.00495158652174 -0.00322121029486 0.00077710652416 -0.00406185931155 -0.00739116576571 -0.00568588444119 0.00383958150378 0.00108299067955 -0.00133916018971 0.000396794344145 -0.00851432817048 -0.00525509052444 -0.00349870227185 -0.000978580809426 0.000936070202265 0.00951924061674 -0.00568703187107 -0.000591038814942 -0.016172782451 -0.0015094591865 -0.00283450940561 -0.00393486512526 -0.00254210859259 -0.0043832529348 -0.00876007608597 -0.00398021268626 0.00529252759577 0.0022162805335 -0.000522348850872 -0.000654563537833 -0.00599681995453 -0.00468522075765 -0.00262028026367 0.000488813753236 0.00548191974938 0.00824983001612 -0.00517558302403 -0.000334745539588 -0.0159773031188 -0.00144562726206 -0.00138190875912 -0.00529697411528 -0.00521569550096 -0.00787609120759 -0.0104895303859 -0.00194708502041 0.0049146839368 0.00303660282043 0.000392390285802 -0.000967127292666 -0.0049064941694 -0.00618893021676 -0.00105913281009 0.00227197299998 0.00964529661667 0.007353706894 -0.0034563913442 -0.000279721113501 -0.0172044859868 -0.00321321633696 -0.000175426437622 -0.00549075587243 -0.00794515416817 -0.0131457435903 -0.0122173319648 -0.00108508495171 0.0040591030151 0.00379307826993 0.00157678719104 -0.000414280929915 -0.00526202150738 -0.0104508485444 0.00104608661943 0.00471784060391 0.0109490151816 0.00712076094495 -0.00117918207575 -0.000419395083096 -0.0200992036784 -0.00690715861689 0.000657549173056 -0.00130430955622 -0.0100475021817 -0.0185451997959 -0.0138177868043 8.01650830128e-05 0.00378402345221 0.00365287064461 0.00147516631005 -0.000541901863577 -0.0116630055946 -0.0168151938891 0.00125766880293 0.00483591741367 0.00959193724231 0.00283802646169 0.00131326184024 -0.00389356769536 -0.0249775661321 -0.0147412871728 -0.000507020461179 0.00249916386752 -0.0141788732147 -0.0240072971495 -0.0144109354278 -0.00720286086586 -0.00185257743464 -0.00141644449634 -0.00791872987639 -0.00844919568461 -0.0243910572026 -0.0262480159377 -0.00864415096124 -0.00451089722838 -0.00377768100284 -0.0151917296379 -0.00565559969622 -0.0185586322236 -0.0306784294193 -0.027133087993 -0.0116794210302 -0.00656888538288 -0.0247163762339 -0.0297580409103 -0.0206126992805 0.023714317238 0.0181337348679 0.0075373581895 0.0028511879457 0.0122105343126 0.00699355826369 0.0078617788237 0.0277472624838 0.00218156004044 0.000918557748196 0.00711568232134 0.025095904698 0.00760105025249 0.00388758752028 0.0068371228431 0.0155956222372 0.0287149102602 0.00590566466549 -0.0015506470973 0.023669840984 0.0124840378544 0.00319649402976 -0.00276898065971 -0.0105255535614 -0.000500436813365 4.38775346491e-05 -0.00608910940627 0.0191469480728 -0.00630058279342 -0.00807428505275 -0.00205403204813 0.0161716890328 0.000538414277801 0.000161102633875 -0.00425327879596 0.00117418908549 0.019675876431 -0.00485351066461 -0.00947479291207 0.0123457758358 0.00838129899982 -0.0015964825455 -0.00164243834384 -0.00636509780137 -0.000990510628477 -0.00898833484628 -0.00686802493436 0.0138896398827 -0.00337292617726 -0.0046338424467 -0.000985750171378 0.0133537517247 0.00151467709541 0.00342216403718 -0.0021267865396 -0.00459786633141 0.0125297153884 -0.0059047981105 -0.0107816157849 0.0074268116731 0.00767377538594 -0.00305113353346 -0.000350435770885 -0.00210681968281 -0.00476354510892 -0.00868716928548 -0.00583553683538 0.0105073699812 -0.0015142804008 0.0021994609338 -0.000541205604566 0.0122891660037 0.00271449558619 0.00474211277298 -0.000782459398881 -0.00489836528619 0.00753911575846 -0.00596724568711 -0.0130538380408 0.00624986407929 0.00671029387002 -0.00381664384593 6.58690959341e-05 -0.000366030252704 -0.00738225158172 -0.00425933298677 -0.00449208931911 0.00831558942105 -0.00061198477995 0.006188302585 -0.00230793842961 0.0113102998621 0.00438076337218 0.00601471172972 -0.000893820517334 -0.0043943647898 0.00405255551876 -0.00598796189436 -0.0128129392185 0.00490047439758 0.00510621099489 -0.0039949016528 -0.000723376138005 0.000397489430192 -0.00654166330404 -0.00190400447299 -0.00297978375893 0.00707347559912 -8.97585328264e-05 0.00803247367536 -0.00508928503685 0.0098340252183 0.00547447502237 0.00766179627737 -0.000985357656364 -0.00352709547562 0.00138966350387 -0.00507976292144 -0.0101783367718 0.00077980262014 0.00318303391199 -0.00349446826515 -0.00392097323521 0.000628013738836 -0.00587560792534 -0.000894466743038 -0.00128572564563 0.00635575946946 9.4503657139e-05 0.0090318294546 -0.00903500264639 0.0080252718442 0.00551126315701 0.00751976914342 -4.14082116373e-05 -0.00176767585981 -0.000436159925018 -0.00302951211119 -0.00882846770617 -0.00379783543682 0.000785510436807 -0.00163129482859 -0.00774892718702 0.000337691015238 -0.00676852264451 -0.000742318936007 -0.00121979965512 0.00584165768806 -0.00131753544395 0.00935456656437 -0.0142926446369 0.00676698051355 0.00365467778371 0.00417811990293 0.00122065153471 0.00188508901598 -0.000271895584146 -0.001438878161 -0.0103938920527 -0.00912736142012 -0.00237314177627 0.000293655237902 -0.0114843319785 -0.00237048580017 -0.0109230088699 -0.00454242324787 -0.00603094549657 0.00452852544244 -0.00737479954868 0.00616002296754 -0.0205240092617 0.00533323729536 0.000290028167959 0.0035224532601 0.00167579445193 0.00358343211385 0.00178973756993 -0.001667287679 -0.0153731961662 -0.0156477765997 -0.00944890061828 -0.00661990931854 -0.0189007530267 -0.0140923848038 -0.0212448041494 -0.0176657696646 -0.0156933129354 -0.00577767086557 -0.0213616509925 -0.00949935801951 -0.0282270938956 -0.00452944283575 -0.0135741380112 -0.00493776368637 -0.00861991490633 -0.0096966317633 -0.0036314598576 -0.0120979053786 -0.0250595746401 -0.0249539827149 0.0299627668802 0.0132841332718 0.00651454289096 -0.00514688973065 0.00276817703355 0.00329251023586 0.0182492156853 0.028218451667 0.000973908045348 -0.00197270754696 0.00167294005008 0.0204838561506 0.0163342421052 0.0276060894263 0.0284884888954 0.0242492338335 0.0211812365973 0.00737297809532 0.0137169957805 0.011931600061 0.0252914856944 -0.000295271586392 -0.00493120790888 -0.0172515433251 -0.0111831720485 -0.00815075218999 0.00384913901036 0.0165360945627 -0.0104479530841 -0.00990913435029 -0.00434230550554 0.0106573593887 0.00163227577599 0.0168153636748 0.0207058500357 0.0106059652876 0.00595223863291 -0.00693340899041 -0.00467007827504 -0.00544732747238 0.022075036162 -0.00240599238065 -0.00347769087611 -0.0186435959621 -0.0115479563566 -0.00887584305667 0.000651250261112 0.00819709629447 -0.0111819179248 -0.00846545230981 -0.00417342372792 0.00766235487421 -0.00161518116587 0.0104079231465 0.0161172212589 0.00369563361474 -0.0013655247685 -0.00905511183336 -0.0105844821916 -0.00903082132318 0.0194520770576 -0.00196589528724 -0.00205909376466 -0.0193158082542 -0.00972906165795 -0.00444784194866 0.00119369278627 0.00443556363401 -0.00951616215196 -0.00785027200794 -0.00398711070508 0.00710793375993 -0.000411062384476 0.00747744615056 0.0132694758046 0.00250579578685 -0.00422582944009 -0.00723199651268 -0.0104417816721 -0.00878446195503 0.0170720972447 -0.00162091344218 -0.00169577299657 -0.0201542319058 -0.00951657360727 -0.00111692898793 0.00208896418852 0.00330109254987 -0.00747467928673 -0.00786742521002 -0.003050187914 0.00731890881435 0.00193665333493 0.00593338901013 0.0106731780264 0.00321406321638 -0.00489376973265 -0.00500481115714 -0.00984578245775 -0.00802626621828 0.0144434897482 -0.00170400863052 -0.00163462722356 -0.0210456271136 -0.0118598259285 0.000388625871618 0.00298698588619 0.00354760387704 -0.00584801922949 -0.00857725139857 -0.000931501199828 0.00791526649543 0.0050093956264 0.00456326651019 0.00812133241024 0.00485533207263 -0.00464979255596 -0.00369667012668 -0.00977884426862 -0.00707607400538 0.0109582148725 -0.0013034030581 -0.00208182218305 -0.0220129551963 -0.0150069633775 0.000583862855174 0.00422597299054 0.00418306042553 -0.00490693333992 -0.0096259135376 0.00162976549204 0.00876972866919 0.0082761828904 0.00451865359064 0.00714194765897 0.00725751983531 -0.0037044926455 -0.00334258250493 -0.0100539558208 -0.00637269139927 0.00631001325606 0.00155606908107 -0.00465099561524 -0.023212659913 -0.0186484325319 0.00109546288648 0.00623894504947 0.00519240989251 -0.00476533983063 -0.0113776432002 0.00361082450211 0.0100824951428 0.0107010014064 0.00458801365821 0.00754490281149 0.0101008590328 -0.00145708052742 -0.00355917908244 -0.0103919295979 -0.0062509958669 0.0016763317904 0.000726435017945 -0.0124893660929 -0.0249991181872 -0.023444860014 0.00252813252568 0.00685877815158 0.00429466510351 -0.00870656664709 -0.0152375874154 0.00312516854755 0.0110951566366 0.0106526205949 0.00464302192785 0.00802965539109 0.0119092053104 0.00246941576238 -0.00889870502674 -0.01286147369 -0.00657610977399 -0.00656333166475 -0.0116373096084 -0.025338266577 -0.0297239826366 -0.0294485971656 -0.0060484434818 -0.00284042384687 -0.00608043905669 -0.0202428515939 -0.0241290208743 -0.00938029406849 0.0029806419578 0.00244115888283 -0.00265521814372 -0.00024730904704 0.0034157021927 -0.00378817713863 -0.0238642639339 -0.0202571338463 -0.0108719386942 0.0086111716964 0.00598222072015 0.00134241513481 0.000437007489012 0.0179171161259 0.00893526767527 0.0299659665217 0.0101103443414 0.0114903959302 0.01471302558 0.00999680950393 0.0107314218262 -9.83953336988e-05 0.00270831158991 0.024574823403 0.0117932504416 0.0132321129643 -0.0034835834105 0.00886805619017 0.0231740873169 -0.000726036402688 -0.0018070938104 -0.00795134256743 -0.00919754962125 0.000385113728589 -0.00556456501182 0.0246086949489 0.00013000362387 -0.00510060768199 0.00267847524733 0.00215710151405 0.00426432194104 -0.00953600940585 -0.00637779426739 0.014644832949 0.000259086991499 -0.000259983955147 -0.0123839903524 0.000637885778881 0.0128361553808 -0.00230972204509 -0.00249081829918 -0.00827695815768 -0.00746773070592 -0.0053030093165 -0.00669098794222 0.0218042442729 -0.00140894408511 -0.00659989365714 -0.000766381337493 0.00144508013788 0.0069279434471 -0.0100618248419 -0.00423962055995 0.00615020463743 -0.00172964770145 -0.00144485372083 -0.0128222776216 0.00310707519239 0.00616286680663 -0.00237461350384 -0.00255571699987 -0.00806340069593 -0.00442250714392 -0.00123081407447 -0.00433562418784 0.0210407689772 -0.00074020615806 -0.00366849001645 -0.00217040160809 0.00136262490872 0.00858832377535 -0.00993404515771 -0.0016348567193 -0.000383234494025 -0.00156791215133 -0.00087437419008 -0.0123399292407 0.00250651935969 0.00331933398393 -0.00187222122446 -0.00142944672432 -0.00872223755782 -0.00290941578162 0.00217812688171 -0.00098809523557 0.0205678716358 0.000510411796538 -0.00116842041849 -0.00260049607731 0.00149727123723 0.00806230559891 -0.00946097347784 0.000124918764349 -0.00293611843909 -0.00128544007006 -0.000309885460214 -0.0112448556258 0.000511726201452 0.00275410219916 -0.00115439879928 -0.000138083264776 -0.0104403042927 -0.00258979148452 0.00329160555989 0.00282814624893 0.0199909780982 0.00221774486526 -0.00037296825354 -0.00267897712698 0.00199203320852 0.00245158008616 -0.00794765537642 0.00144182836553 -0.00258922956026 -0.0010667141482 0.000445735882518 -0.00955499604931 -0.000716625969317 0.00188634284879 -0.000423477462473 0.000724960857871 -0.0129896566196 -0.00321117760312 0.00478403271255 0.00499164127104 0.0192213489805 0.00467784078024 -0.000375320425644 -0.00254553458353 0.00274128553731 -0.00269939226955 -0.00532449581821 0.00266715089559 -0.00125546623477 -0.000779777822988 0.00134103088261 -0.00800214403286 -0.00144652260988 0.00144389904376 0.00116703390791 0.00168875498717 -0.0166389629357 -0.00332634868734 0.00638372328483 0.00534149519315 0.0181358438717 0.00642433491665 -0.00323433589902 -0.0045016325547 0.00379510484472 -0.00309409026133 -0.00255627122393 0.00341775354084 0.000308113888415 0.000364988985891 0.00267906149887 -0.00747850184439 -0.00243681236848 0.000349209191497 0.00506510636972 0.00206187318492 -0.0220724876692 -0.00430301995038 0.00444369922556 0.00565241504524 0.016041596779 0.00399891910062 -0.0107948801186 -0.0100784030943 0.00295064946854 -0.00514326691171 -0.00122941832267 0.00155835699019 0.00100636104822 0.0040277655899 0.00425819879544 -0.0124311794449 -0.00572454522624 -0.00144651931198 -0.00083559069452 -0.0105825862535 -0.0293549365694 -0.0149252076432 -0.00917397297212 -0.00501785049139 0.00440401650898 -0.00762737609967 -0.0238450366286 -0.0210360666525 -0.00859281215348 -0.0183487046291 -0.0114452327054 -0.0112878447026 -0.00908647419916 -0.00153842211951 -0.00377640069632 -0.024299543666 -0.0164184262561 -0.00828233595608 0.00124320434348 0.0218030700594 0.0120857832251 0.011922023349 0.017853150795 0.029347845708 0.0279565341564 0.0203016299028 0.0141745114261 0.0259742043887 0.0289312952979 0.0237502593747 0.0122068181686 0.00291414799609 0.00869925951972 0.00909562061199 0.0183698126456 -0.00121576522553 0.0233520664951 0.00861173100812 -0.00384894258124 0.0139179573952 -0.00029012987543 -0.00133529741412 0.00389951648521 0.0200459964343 0.0193543093444 0.00643657174682 0.00176230674405 0.017951071698 0.0227267518889 0.0105131117875 0.000215834671441 -0.00629215067068 -0.00379622989089 0.00308731678444 0.00767604985777 -0.00685850402606 0.017339204945 0.00189116325702 -0.00345271151186 0.00989446242191 -0.0022798015549 -0.00195728323191 -0.000150498179837 0.0118985603295 0.0139488141753 0.00107968433678 -0.00590455892761 0.0124854484892 0.0182827942043 0.00316382644384 0.000379115033024 -0.00676503766058 -0.00534649323686 0.00368509203166 0.0064832575955 -0.004276379515 0.0127751794264 0.0015078475658 -0.00238263637038 0.00632338969358 -0.00123879140822 6.30392999874e-05 0.000870672202742 0.00697378297877 0.0125207962643 0.000409630298427 -0.00825784582549 0.00859133577681 0.0145641154332 -0.000644648331977 0.00181800000313 -0.00680963646714 -0.00574828030078 0.00236258312765 0.00683324197454 -0.00211562672621 0.00545241003943 0.00157798955322 -0.00106636894259 0.0039929645062 -0.00032582182056 0.00213685965646 0.00287002745599 0.00608994853788 0.011837602703 0.0011236349752 -0.00824292843565 0.00511983605519 0.0113261409665 -0.00131097696006 0.00299095006439 -0.00757562809814 -0.00594217411009 -0.00202840278761 0.00668441575991 -0.000680612291912 0.00186955383352 0.00134561242735 0.000197367819607 0.0030994274034 4.14152156218e-05 0.00308713830115 0.00469040316169 0.00699065438552 0.0108830170409 0.00272630239636 -0.00919219035454 0.00299516184163 0.00891156380523 -0.000169136870186 0.00350094622255 -0.00870574927443 -0.00524356459747 -0.00607196399578 0.00622758135998 -3.32467380678e-05 0.00159572163995 0.000328554137324 0.00111828421949 0.00303234103469 0.000147236729416 0.00320687513579 0.00633609378002 0.00948290875611 0.0110078212206 0.0043995626825 -0.0113216250743 0.00252269747709 0.00775129394587 0.00160616475702 0.00370415143539 -0.0102582149403 -0.00449417636533 -0.00842333030531 0.00479520298461 -0.00026416755211 0.00241063718839 0.000275743304472 0.00131961262412 0.00318580469968 0.000160249966722 0.000502796817864 0.00768238939865 0.0132565982906 0.0118210753501 0.00651806305092 -0.0140169826769 0.00200010844844 0.00796332689391 0.00357466541742 0.00371989967515 -0.0131819471664 -0.00530360539626 -0.00952605292124 0.00174596481638 -0.00409097766412 0.00414412125991 0.00175283562653 -0.00203030418091 0.00217012567382 -0.00176886542496 -0.00508350689158 0.00838583923328 0.0140112473414 0.00838433414513 0.00699641073632 -0.017705839556 -5.88437579668e-05 0.00812319807544 0.00441596393709 0.00123024556038 -0.0189319482186 -0.0121733860723 -0.0116723575936 -0.00406483955353 -0.0121091743907 0.00533287699489 0.0011754490067 -0.0146357316282 -0.00790354702668 -0.013024333414 -0.0144871426529 -0.000307209117285 0.00331316625107 -0.0111945398024 -0.00458979317967 -0.0246342314865 -0.00844829591999 0.000257833074982 -0.00614453277676 -0.0134796650626 -0.0279922086378 -0.0250483593112 -0.0239631095841 -0.0167608877804 -0.0239538658101 -0.004756195534 -0.00982158848947 0.0259985377264 0.029128540357 0.0291366450274 0.0158210499226 0.011871917226 0.0286958627519 0.0090528538709 -0.00136956135256 0.00766912585456 0.0124405693114 0.0230351552612 0.0247776536975 0.00941805487851 0.0061273439349 0.00199202840883 0.0173104439219 0.028600934148 0.025179113665 0.0292245193935 0.0240053712982 0.0210229588395 0.0227654344082 0.0215225551784 0.00500976681198 0.00319845244362 0.0205190763572 -0.000653817431133 -0.00569069886727 -0.00076789981043 0.000915861190165 0.011259622564 0.0159691035432 -0.00325682481085 -0.00660790256136 -0.0116239863984 0.00364544804638 0.020976335365 0.0155873487067 0.02366448502 0.0152068882141 0.0178501585893 0.0183280619181 0.0160074850482 0.0030239171533 0.00301612050299 0.0156984129204 0.00116068089623 0.00176487132634 -0.00094207783128 -0.00226721583628 0.0071496803673 0.0107344203345 -0.00360724791371 -0.00470303015974 -0.0141167674377 0.00177651071595 0.0157492485284 0.0101535113171 0.0215687849433 0.0102437173451 0.0145515587183 0.0148487712325 0.0121735223424 0.00315049237161 0.00459376655194 0.0143033462106 0.0022384254549 0.00488203485544 0.00053523129925 -0.00341779816623 0.00633497705348 0.00577932224767 -0.00290122260161 0.00168844741805 -0.0152274273525 0.0043776069231 0.0126847070163 0.0071779657303 0.0204220348243 0.0063359912801 0.0113926287398 0.0122520905751 0.00858696227372 0.00352668837476 0.00568194920612 0.0133384175157 0.00259949878986 0.0065220946335 0.00112858962218 -0.00369159996711 0.00602477819252 0.000200454416034 -0.00192219736671 0.00558234709394 -0.0158608844362 0.00726135817656 0.0120959928115 0.00578345850497 0.0194894680128 0.00298978778913 0.00895630659799 0.0103499709284 0.00571337615493 0.00427312319007 0.00612642889553 0.0119690126362 0.00466077075481 0.00775568647036 0.000365226539317 -0.0036941185243 0.00579608064942 -0.00319487091348 -0.00010635262105 0.00709743845544 -0.0160634325725 0.0096005120768 0.0124680372476 0.0056290574449 0.0185510887906 0.00022899677382 0.00908157382248 0.00997394022664 0.00502356051399 0.0051653611078 0.00627752653841 0.0106500652792 0.00805368440201 0.00906646421276 -0.0022232318225 -0.00315406537924 0.00549980839245 -0.00277745596066 0.00063164922131 0.00699076214883 -0.0157547195432 0.00971102608663 0.0135774009073 0.00615676824253 0.0174347540315 -0.000364019685792 0.0105599337628 0.0104953831779 0.00496204530994 0.00598425011975 0.00672373686912 0.00983781105798 0.00998081806304 0.0103666081458 -0.00750084427057 -0.00190246794719 0.00502789043613 0.00109534689355 0.00128475202526 0.00347472710105 -0.0150043407244 0.00745743125789 0.0102402070943 0.00685149368541 0.0159371528293 0.000104566201502 0.0123413668065 0.0109126820253 0.00431773780467 0.00569628772743 0.00513918029534 0.00707615101746 0.00948621869835 0.00799771479391 -0.0158641006101 -0.0030974295108 0.00238750119838 0.00560894751431 0.0018636277925 -0.00527167472643 -0.0144716237461 0.00099677246278 0.00233202241369 0.00417817179153 0.0129670583926 -0.00478544331146 0.00350018238766 0.00200848483625 -0.00484481034196 -0.00123437342702 -0.00597384989261 -0.00922796821478 -3.99224009113e-05 -0.00904012952466 -0.0271772735508 -0.0145634587157 -0.0132851503664 -0.00363554294403 -0.0103005121853 -0.0226366096953 -0.0230359210367 -0.015623090253 -0.00436924953665 -0.00866738761169 0.000219038734334 -0.0196574921915 0.0112001408285 0.00910575362136 0.00429122396901 0.00212124498805 0.00589431754343 0.0178142247033 0.00657920259496 -0.00839418699205 -0.00124902838809 0.00652777588918 0.0292274731073 0.0233812805946 0.0046849652883 0.0161984512503 -0.000864767324222 0.0104564156887 0.0290409138337 0.0211252369566 0.00438813048304 0.0259080318483 0.00430004501623 -0.0037268368499 -0.0069505978017 -0.00663208949394 -0.00101059850253 0.00229206671011 -0.00433878378405 -0.0191462428569 -0.0104151624288 -0.00457721329912 0.0220127184219 0.0137606213748 -0.00731756098358 0.00863621400912 -0.0125430084067 -0.0048032533973 0.0239549432509 0.00741182102125 -0.00564087462739 0.0166956609027 0.00432236880958 -0.0067716771225 -0.00734568828502 -0.00578515562914 0.000835192217807 -0.00290997479889 -0.00100242482363 -0.0197740255825 -0.00951357395938 -0.0050188518769 0.0164887608473 0.00592834198313 -0.009550843755 0.00506612690339 -0.0109243117587 -0.00642348818806 0.0209326866137 0.00689233180392 -0.00673341777361 0.0113259504178 0.00415982964118 -0.0095339987995 -0.00634555451795 -0.00302233814262 0.00307615765581 -0.00226107745471 0.00347325163985 -0.0197356920882 -0.00840221755092 -0.00316727080834 0.0133491581071 -0.000381366344021 -0.00578916790536 -0.00159900479884 -0.00843315913916 -0.00437114933011 0.0188456473493 0.00938403395748 -0.00772822076673 0.00919682885044 0.00270140780971 -0.0108222203282 -0.0057251792866 -0.000639616677557 0.00438067810854 0.000994388031213 0.00364266638735 -0.0196849520968 -0.00744570380343 -0.000465239363354 0.0120764647387 -0.00237105285649 -0.0018237388704 -0.00624364399829 -0.00789986985532 -0.00224375488474 0.0181988277626 0.0103616093989 -0.00972761634014 0.00902703335691 0.00201819893149 -0.00968692725189 -0.00398227672608 0.00150427911123 0.00467377850251 0.00279157154665 -0.000641404861494 -0.0204956603249 -0.00671206439941 0.00342674688121 0.0112729411814 -0.0019195446281 0.000296403245174 -0.0065719434534 -0.00735049526884 -0.000371357309525 0.0184190210457 0.0102577342346 -0.0114806097054 0.00761869004837 0.00224458254218 -0.00758048848924 -0.000526065714958 0.00301712485942 0.0043758822133 0.00335696921573 -0.00489545384675 -0.0225111804075 -0.00645833052761 0.00469422304682 0.0109379766352 -0.0010205258753 0.000836211009881 -0.0075125801395 -0.00538607495716 0.00142291568909 0.0185619917612 0.00931289280398 -0.0126825167728 0.00371527881332 0.00324844402962 -0.00373814422265 0.00178404193708 0.00338646292694 0.00360506172632 0.00430488415017 -0.00928620872328 -0.0249774812342 -0.00672847177097 0.00343076557078 0.0114947246135 0.00110926498923 0.00109458204016 -0.0127529874275 -0.00254428516276 0.00358559337558 0.0181344900813 0.00739753761361 -0.0142671608662 0.00190360896311 0.00287716015673 -0.000146798782313 0.00165252660823 -0.00187103224262 0.000250535006926 0.00398698922671 -0.0152793576459 -0.0277848843613 -0.00721707390542 -0.00503246982033 0.0113123850977 0.00617981655898 0.0018389716816 -0.0177606164828 -0.000509368652292 0.00516409691012 0.0155270965821 0.002126104742 -0.0195571363259 0.000898382056598 -0.00724810629075 -0.00818077580893 -0.011422555724 -0.0180243023687 -0.0125792905219 -0.00535016456291 -0.0248461690798 -0.031110776927 -0.0181498150191 -0.0228999460466 0.000429251398312 -0.000237315820996 -0.00981493813922 -0.0207041297989 -0.00750175291992 -0.00454104975039 -0.00135753648955 -0.0130319013653 -0.028037981452 -0.00998956672237 0.0283300627821 0.000515459573678 0.00756502174992 0.0110522707044 0.0232358148827 0.00920417237202 -0.000407719199848 0.00201796186445 0.00624725457642 0.0239693634559 0.0128811603281 0.000701068675287 0.000406828568425 0.0140643443199 0.0289871813166 0.0309923942753 0.0202487392508 0.0122642418406 -0.00478710070899 -0.0021336491363 0.0202684527712 -0.00927769314736 -0.002294316306 0.00173507865079 0.0136709969345 -0.0057597688525 -0.0138558544468 -0.00818631658031 -0.00224211459205 0.0128709207824 -0.00484741625334 -0.0113922009089 -0.0150589958763 0.000660219022245 0.022332379175 0.0277739292805 0.00789307400123 0.000781508053145 -0.0122804513699 -0.00798609197828 0.0149936103556 -0.0112483322742 -0.00539885523369 0.00151320710368 0.0111876051118 -0.00822405610949 -0.0149878110121 -0.00770618447421 -0.000979968924148 0.00715520927359 -0.00852624045154 -0.00793842798164 -0.017876044905 -0.00596875772736 0.0177928284378 0.0250903345786 0.00482516534049 0.00206807452268 -0.00812410948126 -0.00383975038328 0.0117052245522 -0.0113230982051 -0.00879205359934 0.0025316866908 0.00933784824295 -0.00746934758883 -0.0141322137486 -0.00747893455222 0.000458291163306 0.00660995417425 -0.00738589184943 -0.0043119407587 -0.0184132471779 -0.0076765422465 0.0145130368241 0.0229748907837 0.00678270672123 0.00648015279845 -0.00276028848415 -0.00138305955845 0.010208701574 -0.00767120818094 -0.0130415336909 0.00280832455609 0.00727263938155 -0.00545968015896 -0.0119305252371 -0.00936132644173 0.000905534534078 0.0069134462877 -0.0049005776597 -0.00304324865592 -0.0180354172584 -0.00678235880441 0.0118987365455 0.0209500342641 0.0111840023219 0.00844983674057 0.000580426626275 -0.000618311414883 0.00898401534956 -0.00374641804673 -0.0154402906719 0.0021598853055 0.00484155870781 -0.0031804892727 -0.00955441966152 -0.0122427796691 -7.50692691286e-05 0.00711122650199 -0.00255241211986 -0.00262670059634 -0.0170925184505 -0.00295196850637 0.00963630144739 0.0187920366083 0.0146308845663 0.00870054356787 0.00194899080703 -0.00124065177913 0.00855535860148 -0.00102194700047 -0.0168934011383 0.000749269227594 0.00256257208763 -0.00198626343074 -0.00858151389663 -0.0152445203007 -0.00202787593866 0.00694597049868 -0.00161229094253 -0.00235556843024 -0.0167481797853 0.000724076691077 0.00777596888254 0.0165162880379 0.0164408797563 0.00975969481297 0.00197384227765 -0.00258633117826 0.00769148048413 -0.00128992121747 -0.019078070016 -0.000547652327443 -0.000491985812782 -0.00209963956865 -0.00864677968087 -0.0184827750266 -0.00349546574788 0.00665366313914 -0.00369631873212 -0.00213719789108 -0.0188536325682 -0.000374912691981 0.00686314413645 0.0138488551708 0.0161034883751 0.0125809316293 -0.00169748134683 -0.00578112321561 -0.000614810588643 -0.0016626558545 -0.0237804555618 -0.00277558473962 -0.00401682754995 -0.00580009279097 -0.0122740254716 -0.0230752482816 -0.00488028801041 0.00564427181104 -0.00982515364547 -0.00217153577673 -0.0241462537785 -0.00632528119232 0.00547164080994 0.00978510001595 0.00905547919563 0.0117071115625 -0.0104556251692 -0.0129041603454 -0.0147774832188 -0.00825019184196 -0.0298148605444 -0.014475779876 -0.0148353069203 -0.0167813508439 -0.0211614249484 -0.0297311059114 -0.0152207996798 -0.00354882805278 -0.0215089737056 -0.0117710362163 -0.0301962093202 -0.0181439740101 -0.00485428902217 -0.00149543540483 -0.0144578954531 -0.00433450515644 -0.0253715095575 -0.0249781401125 0.0207739609004 0.000134421556893 -0.00205367236211 0.0178012993303 0.0284105390347 0.0136591524493 0.0055139729605 0.00782514034414 0.0182527835743 0.028073980213 0.00740309995706 0.00126827773832 0.00466121164631 0.0146786993845 0.0192230352677 0.0305636751085 0.0244652290166 0.0179839353468 0.00529631806336 -0.000505893654695 0.00908885026925 -0.00908462061764 -0.0075790936709 0.00665976431754 0.0219400585988 6.23807205418e-05 -0.00486862848187 -0.0029201023323 0.0040203546221 0.0194405025116 -0.0086990904129 -0.0141908894725 -0.00653635198862 0.00252258837535 0.00678234749407 0.0262634583051 0.0125893576053 0.00574614082376 -0.00531618359462 -0.0118471135919 0.0029312609989 -0.0102022457667 -0.00617557400934 0.00375282960106 0.0166985866849 -0.000808214365356 -0.00910150992008 -0.00358264244707 0.000105391012072 0.0129190116807 -0.0118569069913 -0.0145467346367 -0.00527992864845 -0.000585891013794 0.00360473146146 0.0223166236864 0.00329677279776 0.00374529413372 -0.00347411110494 -0.0124442137544 0.000374690424728 -0.0105248535461 -0.00769978269927 0.0070135691496 0.0114476569904 -4.95720452152e-05 -0.0124115055319 -0.00289576343759 0.00077106520038 0.0094696275798 -0.0102461967605 -0.0102207791488 -0.00325303593803 0.000336489845401 0.00518986380775 0.018787048976 0.0019575945837 0.00240364937597 -0.000326599690128 -0.0123051191366 -0.000561057031285 -0.00980307937514 -0.0104837960927 0.00844414407444 0.00631483204079 -0.0010539769313 -0.0123431120626 -0.00232437871689 0.00184788963556 0.00723085613953 -0.00723917371749 -0.00631988439833 -0.00206655143471 0.00340085975675 0.00721903350795 0.0163994431529 0.00263917087247 0.00029041674596 0.00170314924413 -0.0124077784435 -0.000861659022044 -0.00858379412822 -0.0117354071048 0.00765985693815 0.00335544104965 -0.00204918971513 -0.0104633023729 -0.00122144038135 0.00283801241397 0.00558168604601 -0.00434348826328 -0.00460108655763 -0.00203439396055 0.0054055728445 0.0080380969545 0.0149856231025 0.00317164834421 0.000386141576942 0.0027544431044 -0.0122663548965 -0.0010691706655 -0.00764887205985 -0.0124800308561 0.00708586659965 0.00392797585425 -0.00108344241394 -0.00939569798731 0.000117272275142 0.00402993981864 0.00446614157784 -0.00231537499851 -0.004233798899 -0.00295628539095 0.00716614372809 0.00958974440026 0.0139390200347 0.00372299484951 0.00316509931395 0.00315543729372 -0.0109428789814 -0.00129076071317 -0.00731686390807 -0.0135676353612 0.00589147885987 0.0068740240617 0.00154607402946 -0.0104491588946 0.000642828080673 0.00613667536469 0.0031638503873 -0.00110570353701 -0.00434270193872 -0.00464298038934 0.00738675820014 0.00930895787783 0.0128550262413 0.00308769091566 0.00686809417187 0.0016347400858 -0.0083710876639 -0.00203654282445 -0.00817966689583 -0.0167730571336 0.000975229466899 0.0112253381753 0.00662775630154 -0.0160228002809 -0.00448638424503 0.00570008984625 0.000734113773063 -0.00181926868589 -0.008560844773 -0.0101073395045 0.00194949818039 0.00586611540147 0.0121494872161 -0.000674938670781 0.0061136346878 -0.00677471862887 -0.00698883137322 -0.00925854765671 -0.0160540215647 -0.0258652990149 -0.00990719033967 0.00436500728316 0.00334048851641 -0.0255693970069 -0.0201394167197 -0.00754145404252 -0.0097575718379 -0.0120876637924 -0.0217887537093 -0.0227678901096 -0.0150035721601 -0.00409838817766 0.00385546968688 -0.0143311642624 -0.00851539753368 -0.0246374665956 -0.0150588881661 0.0241719973442 0.00785542006784 0.0174488325238 0.0127181230019 0.0267036066766 0.018960549038 -0.00247681868974 0.00467160112064 0.0250090626428 0.0286528325374 0.0127045556577 0.00192553522528 0.00249138549473 0.0121561182385 0.0195595218001 0.02936806124 0.0222565024644 0.0255117276833 -0.000442526744523 0.00605604039068 0.0102123174124 -0.00191538467474 0.00481343254004 0.00137091281209 0.0198895829618 0.0087003305974 -0.00939623818759 -0.00156519076902 0.0153926371814 0.0221629733338 0.00250273455588 -0.00910762302536 -0.00711608691436 0.00111207651392 0.0097691110193 0.0219466288455 0.00763082415623 0.0159180228093 -0.0129690880087 -0.0098848104314 6.18068237105e-05 -0.00292543045527 0.00148736766625 -0.000377287042987 0.0162540095817 0.00933876900743 -0.00815507847421 0.000504712924767 0.00994669502688 0.0184779495954 0.000817203020264 -0.0100236908832 -0.00385396330543 0.00135605191201 0.00654901914588 0.014288423875 0.00181066946111 0.00899882228378 -0.0136022794731 -0.0117525196358 -0.00481144813078 -0.0025998791042 0.000981930133862 -0.000461821915358 0.013345124716 0.0110316496173 -0.00564370797877 0.00152404982056 0.0072946588342 0.0176328698134 0.000163863311925 -0.00902467113933 -0.00106342605559 0.00239955559162 0.00610462166492 0.00740494681864 0.00161087501434 0.00383839943767 -0.012402614059 -0.0115422159491 -0.00464427599045 -0.00204714373352 0.000444654831752 -0.000347239793405 0.0105819662422 0.0129955782966 -0.003003242867 0.00248859322005 0.00625568948289 0.0172752556808 0.000341957637208 -0.00811020945691 -0.000969267251824 0.00198271274422 0.00628760229079 0.002561234808 0.000129731517394 -0.00037858132936 -0.011082674726 -0.0105992890117 -0.00363371464198 -0.00211504910612 -0.000152315873774 1.45279097764e-05 0.00782050686202 0.0144059306766 -0.000528611621973 0.00317768368186 0.00630542443603 0.0167699326682 0.00161883964752 -0.00813878794288 -0.00436025806756 0.00234901396573 0.00558850617134 -0.000165528024033 -0.0024977157313 -0.00547473817215 -0.00969664965129 -0.00891958157778 -0.00318857277533 -0.00454386603367 -0.000488910749292 0.000772095684028 0.00535333777887 0.0149214081642 0.00176551918134 0.00329076137723 0.00701141878847 0.0158586955609 0.00405296488171 -0.0100791590435 -0.00858052155278 0.00208603202271 0.00460467023977 -0.000810835800798 -0.0037558079016 -0.0088858277917 -0.0081788341894 -0.00685546967216 -0.00360298573806 -0.00841906488967 -0.000737363138877 0.000863538737527 0.00400343095442 0.0146269953649 0.00424815362121 0.00320637999474 0.00928265154122 0.0153683240423 0.0069940532738 -0.0124487675616 -0.0119123454848 -0.000196273927148 0.00406667236894 0.00058691723151 -0.00459134161477 -0.0143846988851 -0.00733229813721 -0.00622867442931 -0.0058263539489 -0.0135415942055 -0.00273402957116 -0.00313897725948 0.00231879104366 0.0135878461903 0.00527657744754 0.00159066019317 0.0106116278278 0.0136938840172 0.00446313748135 -0.0158646772734 -0.0167683045694 -0.00623623097813 0.00320319037448 0.00477111558245 -0.00675540859776 -0.019597109403 -0.00974417112323 -0.00994980180321 -0.0169650956221 -0.0225173182482 -0.011881490016 -0.0148266308276 -0.00562090046171 0.00339732799788 -0.00695925446212 -0.00996411213446 0.000274643651542 -0.00186141599695 -0.0146572400952 -0.0232862579911 -0.0262090898669 -0.018788067821 -0.0056074707406 0.000633214163561 -0.0132241895644 -0.0267527068871 -0.0204283429952 -0.021081261575 0.0268189727938 0.0187053759436 0.0197140302479 0.0148105130354 0.0256191810485 0.0276349863438 0.00705491627749 0.00846384594426 0.0221563499816 0.0305915248831 0.0188519402069 0.0123280916801 0.00345802264261 0.0110570462014 0.0275807853853 0.0233362976477 0.00343135631971 0.0121836718619 -0.000627755051769 0.00899668470129 0.0123387277147 0.00576863506366 0.0087947623567 0.00918567588015 0.0110189249306 0.0182029523485 -0.00186964497303 0.000572322581717 0.00929571067901 0.0265867621039 0.00628209482098 -0.00117317102405 -0.00751650910528 0.00156659324499 0.0192626248372 0.0144358982693 -0.00851181970962 -0.00714259325467 -0.00866501886815 -0.0030204163499 0.00123690137949 0.00274146299518 0.00172957823718 0.0114442587762 0.00287836445412 0.0162645550525 -0.000446875604879 0.000600215352457 0.00551866813578 0.0230631231351 0.00333806661595 -0.00287084379785 -0.0084664841781 0.00195668729518 0.0120055342032 0.00983407474404 -0.0100488699398 -0.010330737366 -0.00617471630089 -0.00383913312543 -0.00290758260607 0.00337751039014 0.0011761267905 0.0134770326325 -0.000375545606634 0.0152687358423 0.00110875803524 0.00196992885346 0.00602303624791 0.0200374616889 0.00413877256021 -0.00280780533713 -0.00802509421591 0.00355378942523 0.00627229404707 0.0071025195502 -0.0100819649886 -0.00845996740554 -0.00351934347964 -0.00241367861674 -0.00318215002952 0.00450232979002 0.00319710696663 0.0125777522534 -0.00216105519931 0.0133926519195 0.00177490807132 0.00310885709291 0.00730504102237 0.0175615934125 0.00528172274882 -0.00259127568142 -0.00711050504421 0.00662064511211 0.00181835964301 0.00462981631083 -0.00831282097879 -0.00713742538153 -0.0014126804698 -0.000711461959552 -0.00286930116508 0.00520540926755 0.00375724428366 0.0102006041432 -0.00277201903207 0.010953948501 0.00215994521081 0.00380745993832 0.00865336676758 0.0160117316895 0.00598496673704 -0.00255352709401 -0.00614685933204 0.00689506382664 -0.000810443629648 0.00204316513129 -0.00561782312854 -0.0108967446793 -0.000252581994799 0.00073227574619 -0.00247966364248 0.00488184616455 0.00225577495376 0.0103974199909 -0.00204343659908 0.0089449723197 0.00256922104353 0.00401170788257 0.00949946688308 0.0148514351901 0.00666556852719 -0.00300642753585 -0.00459443023082 -0.00370436984725 -0.00159196791138 -0.000154055314513 -0.00511665028606 -0.0154625969836 4.00300794809e-05 0.00172152239414 -0.00191634330287 0.00390644575431 -0.00299691008534 0.0113012579546 0.000261348122009 0.00678734962222 0.0028633242581 0.00340889217423 0.0098870270084 0.0147190348816 0.00731178501348 -0.00502997854242 -0.00259499231383 -0.0123768451415 -0.00134285187289 -0.00140584429981 -0.00623533727063 -0.0180225415845 -0.00148640809309 0.0020594111655 -0.00138648810306 0.00200478929325 -0.0122407345832 0.0109336838637 0.00133852564094 0.00417777017424 -0.000194194664991 0.000179626930358 0.00898124107314 0.0143629663588 0.0073963963543 -0.0120195522321 -0.00320636306317 -0.0150883613215 -0.00221339862293 -0.00308464604278 -0.010178110282 -0.0205394093279 -0.00760047054327 -0.00295209507644 -0.0096031601798 -0.0105174367626 -0.0240730786876 0.001447837329 -0.00830526925588 -0.00636084355241 -0.015136859225 -0.0104765373984 -0.00179789692187 0.00525279272397 -0.00291507416882 -0.0260523867806 -0.0140237249977 -0.0167616351679 -0.0117702880826 -0.0121965821666 -0.0187354179048 -0.0254129292804 -0.0214180523375 -0.0183983972025 0.0280764204803 0.01838202275 0.0118095079561 0.00562408307263 0.0190628065968 0.0214293546685 0.00330421885015 0.0163143032848 0.028579753712 0.0204963796121 0.00905978292516 0.0102074274643 0.0170654559534 0.0265295046005 0.0129925398791 0.00308537660474 0.00924564198561 -0.0050970185394 0.0122120219176 0.0150621684956 0.0187364193314 0.0111682064648 0.00559619752625 -0.00116485912681 0.00300457243319 0.010744438611 -0.00573814516124 0.00334446183671 0.0206177588989 0.00799674204026 0.000581718585168 -0.00140569212022 0.00114285100496 0.0176401860865 -0.00105188395625 -0.00488144604687 -0.00148947768192 -0.013972355904 -0.00400454161094 0.000103805645215 0.0135717139799 0.0113763603331 0.00712586131389 -0.000665065152195 -0.00326598121744 0.00538275401561 -0.00712068612419 -0.00104441293657 0.0154229708405 0.00213307443323 -0.000599122699922 -0.00301246687744 -0.00536883292756 0.0119327680492 -0.00259161253281 -0.00693526070274 -0.0029481065894 -0.0142587120488 -0.00543632281113 -0.00396737951667 0.0125240686822 0.0128475497915 0.00921493559097 -0.00120147799413 -0.0047214850138 0.0020036448358 -0.00812867990091 -0.00216710329079 0.012104269992 -0.000179171349615 -0.0012290277659 -0.0033261958987 -0.00600426173646 0.00801484128287 -0.00136644007532 -0.00898758785246 -0.00403947947805 -0.0143806451885 -0.00340952410213 -0.00439928258158 0.0129304632643 0.0144308152317 0.0103138609178 -0.00297655843616 -0.00440090872881 -0.000663295137178 -0.00920146051392 -0.00217165836716 0.00956945397367 -0.000366389346445 -0.00188029969325 -0.00342746069854 -0.00430398420912 0.00538058651726 -0.00063962032679 -0.00966230992014 -0.00499845746323 -0.0152818482607 -0.00195635133593 -0.00368507048608 0.0139319893925 0.0153094000339 0.0103055826316 -0.00358725428739 -0.00373813995315 -0.00243753344745 -0.010581330539 -0.00215781242409 0.00736979254515 0.000372399621117 -0.002643661439 -0.00359352339998 -0.00273406845814 0.00381279951529 -0.00365027652713 -0.00957329708939 -0.00572671052009 -0.015994397941 -0.000579473023571 -0.000730238756533 0.015306952837 0.0149566404144 0.00968566313951 -0.0031848404788 -0.00339432098048 -0.00267823982247 -0.0127440993205 -0.0024046741434 0.00537528155565 0.00144204292211 -0.00396126329938 -0.00385141450073 -0.0030077784057 0.00304565110178 -0.00735969997068 -0.00912598651994 -0.00642066483439 -0.0168819985874 0.000601836338622 0.00470230812421 0.0166721240503 0.01417056778 0.00878841198715 -0.00288618312062 -0.00310227088277 -0.00211526145237 -0.0163985677531 -0.00275931297485 0.00420701675315 0.00266506187979 -0.00659807495258 -0.00387232266956 -0.00298514972453 0.00311044559231 -0.00987826452049 -0.00895714144221 -0.00751416175628 -0.0186004696081 0.00135450259363 0.00878321546219 0.0163160208446 0.0130751439468 0.00649760503864 -0.00673139066647 -0.00476305768624 -0.00422093103507 -0.0217582313216 -0.00407626326474 0.00291415973272 0.00237191739369 -0.011997974309 -0.00422023788405 -0.00200645155602 0.00295197734246 -0.0115995689686 -0.0114908632767 -0.012768097985 -0.0222733779409 -0.000245192075794 0.00679172256968 0.00566740003157 0.00254981935501 -0.00588195889455 -0.0199348444333 -0.0155500399488 -0.0180308449094 -0.0287635462069 -0.0135184721769 -0.00760524543602 -0.00702411995534 -0.0236949529822 -0.016617839332 -0.00976641774169 -0.00459548858987 -0.0186116858639 -0.0208237387135 -0.025872254181 -0.0288475200501 -0.0134533773703 -0.00953110378506 0.0291010400706 0.0261188167953 0.013984795671 0.000989281957095 0.0123092671137 0.000672191441755 0.00341268308004 0.0182154374325 0.0137250862958 0.0164963557646 0.0194613320932 0.0295281288448 0.0107425576256 0.0227729024256 0.00333633270186 0.0153533145488 0.0221640180718 0.0152660843774 0.020279557665 0.0265967268828 0.0218352208167 0.0183125696791 0.00378332639012 -0.00376195985379 0.00263131219281 -0.00490039904411 -0.00952504325139 0.000248129765976 -0.000886917459201 0.00495474372073 0.00754213882674 0.0229279889251 -0.00172051960333 0.0131119643428 -0.00653966476549 -0.00341268126488 0.0133679150765 0.00464409634831 0.00662373402142 0.0182235176995 0.0170669731976 0.0168527643235 0.00429275715645 -0.00102936553888 0.00198711261507 -0.000371510117403 -0.0113198829297 -0.00713436266086 -0.00514018290114 0.00109376159705 0.00365551429252 0.0173132345478 -0.000490202457062 0.00727858823791 -0.00722466678297 -0.0103253311669 0.0108172528991 0.00425178823175 0.00142895748986 0.0133027931059 0.0138802199049 0.0153932259291 0.00577821009816 -0.000268267435463 0.00142058153903 -0.00814080471004 -0.0118228528349 -0.00877024412202 -0.00711441598074 -1.97948288849e-05 0.00248849707904 0.0127687867967 0.00231819999237 0.00113153851043 -0.0068459523008 -0.011304934578 0.00788866382858 0.00542137825286 0.00107535908486 0.0108293802129 0.0128547813354 0.0124848222892 0.00772893042653 -0.000446749221978 0.000473265378504 -0.0122426552443 -0.00991528649693 -0.00802813354315 -0.00864360301836 -0.000864358237739 0.00253788077389 0.00946319407044 0.00409207008646 -0.00464994364118 -0.00635731192244 -0.00856504284319 0.00479334272551 0.00614958104544 0.00160900622564 0.0103076370853 0.0138720039807 0.0104468496645 0.00966376319942 -0.00186449553161 -0.000868258301048 -0.011545395829 -0.00706548072898 -0.00705066848571 -0.00941846472699 -0.00190921512421 0.0028905193933 0.00776146857131 0.00381197384489 -0.00637778070364 -0.0053193039745 -0.00313227916493 0.00433221823512 0.00280052831591 0.00201147519204 0.0103562803858 0.0154727660417 0.0095975670234 0.0102208955137 -0.00379460993605 -0.0019678735775 -0.0118809761728 -0.0049730785154 -0.00655388969739 -0.00966871029735 -0.00307027375961 0.00367908516986 0.0073247608907 0.00293078102377 -0.00657532423826 -0.00449999241953 0.00110733736021 0.00510024542937 -0.00264119071036 0.00197571178879 0.0108536625798 0.0169971860195 0.00633664066461 0.00716972725847 -0.00756391885589 -0.00345504302489 -0.0139308817716 -0.00579537449896 -0.00635413546633 -0.0103097086653 -0.00509429450228 0.00570529069375 0.00744922106473 0.00279917576155 -0.00583950940778 -0.00448068518446 0.00266335370246 0.00646032402595 -0.000908791881316 0.00261685383194 0.0110966626041 0.0167237522564 0.00586431084754 -0.000487863529683 -0.0143283032005 -0.00884846103962 -0.0160073805331 -0.0134803557565 -0.00721256415381 -0.0134527536766 -0.0104344077597 0.00848907073652 0.00666366502209 0.0027920646411 -0.00393475526262 -0.00766705764336 0.000650526337265 0.00718356652407 0.0037401620043 0.00333325377619 0.00935537586633 0.00669374470775 -0.004435257044 -0.0154066349305 -0.025842039568 -0.021658521225 -0.0211183728603 -0.0232184774558 -0.0156430902527 -0.023126392989 -0.0230590662315 -0.00057983480377 -0.00374451110063 -0.00486381984207 -0.00835275218294 -0.0194583399992 -0.0146098971102 -0.00167594064659 -0.00262513231265 -0.00457129613372 -0.00517266863218 0.0199191013032 0.0182375672789 0.0274504871853 0.0125929644314 0.00292162222364 0.000467379755365 0.01982700421 0.00108845000423 0.00687655472558 0.0081171009409 0.0222994202517 0.0229196509588 -0.00187151874419 0.00195605953065 0.0189617077212 6.28198165501e-05 0.0228007906991 0.00934297980161 0.0187416593852 0.0172904440014 0.0124344411156 0.00452397541081 0.0184432412753 -0.00922394747335 -0.0079589823357 -0.0116230952973 0.00364257012255 -0.0115858211049 -0.00527698414439 -0.00286858946644 0.0125694782644 0.0103973334685 -0.0122400273008 -0.00754751947485 0.00718547190672 -0.00972212122855 0.00876129858563 -0.00090815673809 0.00846972177481 0.00674707757305 0.00798755223648 0.000245647323593 0.00888000722569 -0.0175083823992 -0.00965652374194 -0.0121631269119 -0.0022871864563 -0.0123323620379 -0.00926648876923 -0.00481001269761 0.00820387012178 0.00264014451653 -0.0122123610802 -0.00662267388282 -0.00834959461968 -0.0101669425406 0.00229379394935 -0.00254104407412 0.00459309857754 0.00348189545983 0.00311858835527 -0.00212351125633 0.00308544751906 -0.0191774108823 -0.00963984398093 -0.0114623004782 -0.00276058942137 -0.0101899578042 -0.0123078386367 -0.00506581930802 0.00665815717462 -0.000933403855151 -0.00985961763162 -0.0070817956459 -0.0110673342237 -0.00699026910907 0.00106757965365 -0.00272280282599 0.00327601539052 0.00277601294526 0.00149805358147 -0.00234164783119 0.00222321032838 -0.0200375119625 -0.00515884185808 -0.0114100958842 -0.00212626462059 -0.00887738841878 -0.0144885010692 -0.00456554873795 0.00618268202754 3.81219552561e-05 -0.00789860654403 -0.00879984995911 -0.00740497745364 -0.00234687653237 0.0015808621428 -0.00131794679924 0.00210163467817 0.00335800420505 0.00399276868823 -0.00155718527787 0.0034063117852 -0.0206360960909 -0.00131101401993 -0.00969288976523 -0.00110547324665 -0.00885921445041 -0.0163026401514 -0.00333103401625 0.0063437282138 0.00365033019987 -0.00593051066758 -0.0120857198888 -0.0045110986145 0.000412572572019 0.00338222775236 0.000793959870294 0.000717484103778 0.00448866708575 0.00464392401467 -0.000217639908002 0.00599923567836 -0.0209468640627 0.000865617928878 -0.00780979442007 1.65557311844e-05 -0.0103993078178 -0.0181012611941 -0.00160636631427 0.00686305858026 0.00758409717776 -0.00456884752669 -0.0153849056032 -0.00328929875008 0.00117284139868 0.00634191595539 0.00261563419766 -0.001922929153 0.00569029676753 0.00348709549415 0.00166731848945 0.00869784379394 -0.0210194079999 0.00157192862626 -0.00528820226004 0.00129220762574 -0.0122241602473 -0.0204945433177 0.000554861035218 0.00778769445736 0.0109363142168 -0.0052248183438 -0.018063772462 -0.00383309454741 0.00109682196126 0.00999879408819 0.00431084189892 -0.00684204231756 0.00645120854308 -0.00373367503188 0.00410030379316 0.00832679048915 -0.0233386590876 -0.00170220400691 -0.000299346057016 0.00206363294573 -0.0152833366204 -0.0244318362244 0.000427672998801 0.00862289271213 0.0107742609259 -0.0115601113667 -0.0211666457986 -0.00989523598837 0.0011596819742 0.0120283780822 0.00506283305778 -0.0149464327986 0.00480393225024 -0.0160069762543 -0.00318114578743 -0.0023108258589 -0.0296482633559 -0.0161715334356 -0.00419527769177 -0.00266672562973 -0.023560587411 -0.0300281289056 -0.0107367214984 -0.000230802185573 0.000743177039758 -0.0237538182467 -0.0278954211404 -0.0222826441409 -0.0077819343332 0.00283978348327 -0.00666648112939 -0.0268370570416 -0.00717841106663 0.00192852912067 0.0238869277502 0.00906800387689 0.010549085739 0.0116134324131 0.0202612519771 0.00935022643039 -0.000450368920461 -0.00713584909242 0.00232220880832 0.0186157980624 0.0137316886148 0.0102585548332 7.14995699867e-05 0.0200691870152 0.0159920135755 0.0275606869111 0.0186751304421 0.00887998879082 0.00511536912281 -0.00573205712576 0.0102414711237 0.00258485276402 0.00550497614857 -0.00216537415559 0.00322262100613 -0.00169933315056 -0.00648391311379 -0.0189754572643 -0.00786229005217 0.0067992164959 0.00482965101203 -0.0016410065001 -0.0108807783764 0.00348564235824 0.000903737553827 0.0180030982099 0.00632039547749 0.000295263953923 -0.00246995522886 -0.00462624321201 0.00236832766489 0.00408496649665 2.08610826995e-05 -0.00150676787104 -0.00386206342997 -0.00106541517584 -0.00103124478005 -0.0203129129517 -0.00833646547165 0.00322158536772 0.00473252987914 -0.00426962380895 -0.0117569436529 -0.00399130623187 -0.00323319385324 0.0119206915778 0.00311885400607 0.000954208730685 -0.000120273804349 -0.00373425357274 -0.0010743005309 0.00521973265516 -0.0106473088362 0.000139501747282 -0.00576347832369 0.000743708704177 0.0015916076881 -0.020845395206 -0.00761985599295 0.00474716161569 0.00562468447476 -0.00396388811935 -0.0122445702542 -0.00503292360709 -0.00421804336612 0.00882113357259 0.0013763498866 0.00237734517838 0.000976681027996 -0.00365471095984 -0.0026747513811 0.00519325488443 -0.0128877265612 -0.00152243633167 -0.00577150497297 0.00135964432682 0.00203227155639 -0.0214301146132 -0.00677029713447 0.00806915976117 0.00428856626752 -0.00416964586722 -0.0132805232597 -0.00465410381784 -0.00486172166253 0.00731369290852 -0.00122379159003 0.00240246088831 0.00162944198283 -0.00390608022428 -0.00288098077391 0.00473488782714 -0.0134453258814 -0.00240313847629 -0.00466439623647 0.00141566104015 0.000185007656024 -0.021978339951 -0.0064877131828 0.0105996949511 -0.00041258843054 -0.00495546430439 -0.0144195075915 -0.00438613087059 -0.00482056005296 0.00634054721394 -0.00214486802839 -0.00120508564566 0.00106157452435 -0.00549064963269 -0.00185326728175 0.00352172155157 -0.014074635657 -0.00135050865656 -0.00242504385304 0.00123245219042 -0.00420667133563 -0.0228708109473 -0.00849428434397 0.00973415964114 -0.00590560258332 -0.00583302556133 -0.0161099163086 -0.00306964318371 -0.00412064414515 0.0061003359086 -0.00191638774545 -0.00688918002576 0.001497542755 -0.00714731298304 0.000872024967285 0.00270796436433 -0.0164619393856 0.000803165010154 -0.00125857154293 0.000392224266389 -0.0103661328634 -0.0243998858482 -0.0129104415789 0.00590241947186 -0.0100752680155 -0.00797952510079 -0.0191093411388 -0.00198801834581 -0.00252449976145 0.00684460560781 -0.000680103959818 -0.0130094304271 0.00306054986642 -0.0050932632292 0.000600172783699 0.00211565217313 -0.0191101972111 -0.000472859605543 -0.00175473171646 -0.00305028422192 -0.0184283004894 -0.0272056151531 -0.0198766979057 -0.004106744338 -0.0125396506421 -0.0131502692853 -0.0238628227737 -0.00513918331836 -0.00225861275429 0.00895325519433 0.00289794085191 -0.0196146315206 0.000641642049146 -0.0157638589735 -0.0101149551408 -0.00673911697265 -0.0236443504918 -0.01032605981 -0.0128732746177 -0.0156313512053 -0.0277332804818 -0.0308769284732 -0.0287092251559 -0.0192983921652 -0.0206085468357 -0.0225317285455 -0.0295671513922 -0.0176733036714 -0.0098351298871 0.00264143531349 -0.00341103945052 -0.0280766421977 -0.0145448703259 ) ; boundaryField { ground { type fixedValue; value uniform 0.0327; } top { type fixedValue; value uniform -0.0327; } left { type cyclic; } right { type cyclic; } front { type cyclic; } back { type cyclic; } } // ************************************************************************* //
[ "d.shipley.1341@gmail.com" ]
d.shipley.1341@gmail.com
31eb10b3721863b1faa18e9e00c76b1024de6447
0c012fdfe2aca4da7bb99587c22f1d0323316157
/notebook_app.hpp
279b40dcd22edbfb55051c4f4ae78abda3777c86
[]
no_license
sjocher/plotscript
c059f455e6892b8aeed4342a899e44d7764ea5b8
48c50e10727098a14d16bb85bd7e0b6d9ed08185
refs/heads/master
2020-04-11T17:19:01.255861
2018-12-03T23:01:48
2018-12-03T23:01:48
161,956,219
0
0
null
null
null
null
UTF-8
C++
false
false
1,011
hpp
#ifndef NOTEBOOK_APP_HPP #define NOTEBOOK_APP_HPP #include <QWidget> #include <atomic> #include "input_widget.hpp" #include "output_widget.hpp" #include "cpanel.hpp" #include "interpreter.hpp" #include "semantic_error.hpp" #include "startup_config.hpp" #include "guiParseInterp.hpp" class NotebookApp: public QWidget { Q_OBJECT public: NotebookApp(); ~NotebookApp(); void repl(QString data); private: QString m_parseData; void loadStartup(); InputWidget * input; OutputWidget * output; cPanel * controlpanel; bool kernalRunning = true; Interpreter interp; parseQueue pQ; resultQueue rQ; messageQueue mQ; guiParseInterp pI; std::atomic_bool solved; void closeEvent(QCloseEvent *event); public slots: void setData(QString data); void handleStart(); void handleStop(); void handleReset(); void handleinterrupt(); signals: void plotscriptResult(Expression result); void plotscriptError(std::string error); }; #endif
[ "sjocher@vt.edu" ]
sjocher@vt.edu
3d6b0ee3920a41ff050c1970c776ecb8fb751182
3ab03690aeccc359a472234d7bd55d4c9157f367
/spline.cpp
4ddfa487d06a494c7985da22e108beb3261289d6
[]
no_license
kerinin/arduino-splines
29cdd2dfbebabf3440148eb10def962715c9c710
c97ea41a7cd8f231a40cc438c227842d383cb619
refs/heads/master
2021-01-19T20:15:29.422885
2015-01-22T22:28:01
2015-01-22T22:28:01
705,205
16
12
null
2019-05-23T06:47:05
2010-06-05T20:12:05
C++
UTF-8
C++
false
false
2,825
cpp
#include "WProgram.h" #include "spline.h" #include <math.h> Spline::Spline(void) { _prev_point = 0; } Spline::Spline( float x[], float y[], int numPoints, int degree ) { setPoints(x,y,numPoints); setDegree(degree); _prev_point = 0; } Spline::Spline( float x[], float y[], float m[], int numPoints ) { setPoints(x,y,m,numPoints); setDegree(Hermite); _prev_point = 0; } void Spline::setPoints( float x[], float y[], int numPoints ) { _x = x; _y = y; _length = numPoints; } void Spline::setPoints( float x[], float y[], float m[], int numPoints ) { _x = x; _y = y; _m = m; _length = numPoints; } void Spline::setDegree( int degree ){ _degree = degree; } float Spline::value( float x ) { if( _x[0] > x ) { return _y[0]; } else if ( _x[_length-1] < x ) { return _y[_length-1]; } else { for(int i = 0; i < _length; i++ ) { int index = ( i + _prev_point ) % _length; if( _x[index] == x ) { _prev_point = index; return _y[index]; } else if( (_x[index] < x) && (x < _x[index+1]) ) { _prev_point = index; return calc( x, index ); } } } } float Spline::calc( float x, int i ) { switch( _degree ) { case 0: return _y[i]; case 1: if( _x[i] == _x[i+1] ) { // Avoids division by 0 return _y[i]; } else { return _y[i] + (_y[i+1] - _y[i]) * ( x - _x[i]) / ( _x[i+1] - _x[i] ); } case Hermite: return hermite( ((x-_x[i]) / (_x[i+1]-_x[i])), _y[i], _y[i+1], _m[i], _m[i+1], _x[i], _x[i+1] ); case Catmull: if( i == 0 ) { // x prior to spline start - first point used to determine tangent return _y[1]; } else if( i == _length-2 ) { // x after spline end - last point used to determine tangent return _y[_length-2]; } else { float t = (x-_x[i]) / (_x[i+1]-_x[i]); float m0 = (i==0 ? 0 : catmull_tangent(i) ); float m1 = (i==_length-1 ? 0 : catmull_tangent(i+1) ); return hermite( t, _y[i], _y[i+1], m0, m1, _x[i], _x[i+1]); } } } float Spline::hermite( float t, float p0, float p1, float m0, float m1, float x0, float x1 ) { return (hermite_00(t)*p0) + (hermite_10(t)*(x1-x0)*m0) + (hermite_01(t)*p1) + (hermite_11(t)*(x1-x0)*m1); } float Spline::hermite_00( float t ) { return (2*pow(t,3)) - (3*pow(t,2)) + 1;} float Spline::hermite_10( float t ) { return pow(t,3) - (2*pow(t,2)) + t; } float Spline::hermite_01( float t ) { return (3*pow(t,2)) - (2*pow(t,3)); } float Spline::hermite_11( float t ) { return pow(t,3) - pow(t,2); } float Spline::catmull_tangent( int i ) { if( _x[i+1] == _x[i-1] ) { // Avoids division by 0 return 0; } else { return (_y[i+1] - _y[i-1]) / (_x[i+1] - _x[i-1]); } }
[ "kerinin@gmail.com" ]
kerinin@gmail.com
7ab0c99f5cae422414c72daf12dcbc7f9e78faa3
3b411b513f5d43aa3094cd5ae406c7ebd63a079c
/src/tlb2h/std.h
9dfda5c4d35961ccee9749be08fec511b8afa7dd
[]
no_license
dbremner/comet
17752230ec5998ab962a3f6631bd645d146a5328
434e893426dbbfca000a53e342226e17ad223ddf
refs/heads/master
2021-01-22T20:55:26.139527
2015-10-05T04:21:31
2015-10-05T04:21:31
42,421,800
0
0
null
null
null
null
WINDOWS-1252
C++
false
false
1,719
h
#pragma once /* * Copyright © 2000, 2001 Sofus Mortensen, Michael Geddes * * This material is provided "as is", with absolutely no warranty * expressed or implied. Any use is at your own risk. Permission to * use or copy this software for any purpose is hereby granted without * fee, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is * granted, provided the above notices are retained, and a notice that * the code was modified is included with the above copyright notice. */ //#define _STLP_NO_OWN_IOSTREAMS // Make sure there is no stlport .dll dependence - either use the provide // iostreams or use stlport's staticx library. #if !defined(_STLP_NO_OWN_IOSTREAMS) && !defined(_STLP_USE_STATIC_LIB) #define _STLP_USE_STATIC_LIB #endif #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include <windows.h> #pragma warning( disable : 4786 ) #include <comdef.h> #include <comutil.h> #include <crtdbg.h> #undef IMPLTYPEFLAG_FDEFAULT #undef IMPLTYPEFLAG_FSOURCE #undef IMPLTYPEFLAG_FRESTRICTED #undef IMPLTYPEFLAG_FDEFAULTVTABLE #undef IDLFLAG_NONE #undef IDLFLAG_FIN #undef IDLFLAG_FOUT #undef IDLFLAG_FLCID #undef IDLFLAG_FRETVAL #undef PARAMFLAG_NONE #undef PARAMFLAG_FIN #undef PARAMFLAG_FOUT #undef PARAMFLAG_FLCID #undef PARAMFLAG_FRETVAL #undef PARAMFLAG_FOPT #undef PARAMFLAG_FHASDEFAULT #undef PARAMFLAG_FHASCUSTDATA #import <tlbinf32.dll> exclude("_DirectCalls") #include <iostream> #include <fstream> #include <map> #include <vector> #include <list> #include <sstream> #include <stack> #include <set> #include <string>
[ "sofusmortensen@localhost" ]
sofusmortensen@localhost
a656a25a4886bd4d01432b35069c967472035d44
0e89641c4b79034acbac26db1855ed71105abb47
/cpp/fcs/examples/vgroup/c_inl.hpp
46a567b9dec8bb6783d07542435035970d1baf79
[]
no_license
patefacio/codegen
25f9af2e8fc21ae6df492110f12ca9e9e9b58f41
17fc8829804c4a4bb7e1efd653e6e20c1e585bfc
refs/heads/master
2016-09-06T10:33:42.599798
2013-05-29T13:58:44
2013-05-29T13:58:44
7,753,270
1
0
null
null
null
null
UTF-8
C++
false
false
1,111
hpp
/****************************************************************************** * c_inl.hpp * * Copyright (c) Daniel Davidson * * Distributed under the Boost Software License * (http://www.boost.org/LICENSE_1_0.txt) *******************************************************************************/ /*! * \file c_inl.hpp * * \brief * */ #ifndef _FCS_EXAMPLES_VGROUP_C_INL_H_ #define _FCS_EXAMPLES_VGROUP_C_INL_H_ #include <pantheios/pantheios.hpp> #include "fcs/examples/vgroup/c.hpp" namespace fcs { namespace examples { namespace vgroup { inline void C::observe(int i, char const * s) { // custom <observe impl> // end <observe impl> pantheios::log(PANTHEIOS_SEV_DEBUG, "C::observe"); } inline void C::do_good(int i) { // custom <do_good impl> // end <do_good impl> pantheios::log(PANTHEIOS_SEV_DEBUG, "C::do_good"); } inline void C::do_bad(int i) { // custom <do_bad impl> // end <do_bad impl> pantheios::log(PANTHEIOS_SEV_DEBUG, "C::do_bad"); } } // namespace vgroup } // namespace examples } // namespace fcs #endif // _FCS_EXAMPLES_VGROUP_C_INL_H_
[ "dbdavidson@yahoo.com" ]
dbdavidson@yahoo.com
5c4709c46c9c7d64671b3a040879a796b8416f5e
1235c262c1d0c872d8ea76b9298aa21f297557ad
/src/checkpoints.cpp
930180194cf3774d5ea8539624622b8b0266eb0b
[ "MIT" ]
permissive
kyonetca/potcoin
b100d45faf29eea5bf6d304b2fb502b544d0e77d
99fe734668ae3af37ff810467cc5b012dabc5dc3
refs/heads/master
2021-01-22T02:08:33.479357
2014-04-05T05:46:51
2014-04-05T05:46:51
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,626
cpp
// Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <boost/assign/list_of.hpp> // for 'map_list_of()' #include <boost/foreach.hpp> #include "checkpoints.h" #include "main.h" #include "uint256.h" namespace Checkpoints { typedef std::map<int, uint256> MapCheckpoints; // How many times we expect transactions after the last checkpoint to // be slower. This number is a compromise, as it can't be accurate for // every system. When reindexing from a fast disk with a slow CPU, it // can be up to 20, while when downloading from a slow network with a // fast multicore CPU, it won't be much higher than 1. static const double fSigcheckVerificationFactor = 5.0; struct CCheckpointData { const MapCheckpoints *mapCheckpoints; int64 nTimeLastCheckpoint; int64 nTransactionsLastCheckpoint; double fTransactionsPerDay; }; // What makes a good checkpoint block? // + Is surrounded by blocks with reasonable timestamps // (no blocks before with a timestamp after, none after with // timestamp before) // + Contains no strange transactions static MapCheckpoints mapCheckpoints = boost::assign::map_list_of ( 10, uint256("0xc2818dc9bf6fd7fb692cc0886d39a724bb4e86fad095a62266bd015b9fbae04f")) ( 17, uint256("0x6c8818dd77bcaee6c3c775a34c0a84f349cc4db99e2c8b40ed7adb83b0184606")) ( 22, uint256("0x592cc1502043365de34d8c806fa2355e8f2ca47bfd568812c77547b4b72df744")) ( 27, uint256("0x49fc54fa7fe3939e57b83a468cb40333177b8e1ae1648a641ccc79d47ca68834")) ( 35, uint256("0x697905a9b6822eb09a6e3eecb82133cde24f15e5c400368b65bdc9b2cc7943c7")) ( 50, uint256("0x6a5411cbcbe8d69dd3cc85af05ad7439fc2c02acd8d5861471ea32a1b59ce271")) //( 80000, uint256("0x4fcb7c02f676a300503f49c764a89955a8f920b46a8cbecb4867182ecdb2e90a")) //(120000, uint256("0xbd9d26924f05f6daa7f0155f32828ec89e8e29cee9e7121b026a7a3552ac6131")) //(161500, uint256("0xdbe89880474f4bb4f75c227c77ba1cdc024991123b28b8418dbbf7798471ff43")) //(179620, uint256("0x2ad9c65c990ac00426d18e446e0fd7be2ffa69e9a7dcb28358a50b2b78b9f709")) //(240000, uint256("0x7140d1c4b4c2157ca217ee7636f24c9c73db39c4590c4e6eab2e3ea1555088aa")) //(383640, uint256("0x2b6809f094a9215bafc65eb3f110a35127a34be94b7d0590a096c3f126c6f364")) //(409004, uint256("0x487518d663d9f1fa08611d9395ad74d982b667fbdc0e77e9cf39b4f1355908a3")) //(456000, uint256("0xbf34f71cc6366cd487930d06be22f897e34ca6a40501ac7d401be32456372004")) ; static const CCheckpointData data = { &mapCheckpoints, 1389838908, // * UNIX timestamp of last checkpoint block 50, // * total number of transactions between genesis and last checkpoint // (the tx=... number in the SetBestChain debug.log lines) 8000.0 // * estimated number of transactions per day after checkpoint }; static MapCheckpoints mapCheckpointsTestnet = boost::assign::map_list_of ( 546, uint256("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70")) ( 35000, uint256("2af959ab4f12111ce947479bfcef16702485f04afd95210aa90fde7d1e4a64ad")) ; static const CCheckpointData dataTestnet = { &mapCheckpointsTestnet, 1369685559, 37581, 300 }; const CCheckpointData &Checkpoints() { if (fTestNet) return dataTestnet; else return data; } bool CheckBlock(int nHeight, const uint256& hash) { if (fTestNet) return true; // Testnet has no checkpoints if (!GetBoolArg("-checkpoints", true)) return true; const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints; MapCheckpoints::const_iterator i = checkpoints.find(nHeight); if (i == checkpoints.end()) return true; return hash == i->second; //return true; } // Guess how far we are in the verification process at the given block index double GuessVerificationProgress(CBlockIndex *pindex) { if (pindex==NULL) return 0.0; int64 nNow = time(NULL); double fWorkBefore = 0.0; // Amount of work done before pindex double fWorkAfter = 0.0; // Amount of work left after pindex (estimated) // Work is defined as: 1.0 per transaction before the last checkoint, and // fSigcheckVerificationFactor per transaction after. const CCheckpointData &data = Checkpoints(); if (pindex->nChainTx <= data.nTransactionsLastCheckpoint) { double nCheapBefore = pindex->nChainTx; double nCheapAfter = data.nTransactionsLastCheckpoint - pindex->nChainTx; double nExpensiveAfter = (nNow - data.nTimeLastCheckpoint)/86400.0*data.fTransactionsPerDay; fWorkBefore = nCheapBefore; fWorkAfter = nCheapAfter + nExpensiveAfter*fSigcheckVerificationFactor; } else { double nCheapBefore = data.nTransactionsLastCheckpoint; double nExpensiveBefore = pindex->nChainTx - data.nTransactionsLastCheckpoint; double nExpensiveAfter = (nNow - pindex->nTime)/86400.0*data.fTransactionsPerDay; fWorkBefore = nCheapBefore + nExpensiveBefore*fSigcheckVerificationFactor; fWorkAfter = nExpensiveAfter*fSigcheckVerificationFactor; } return fWorkBefore / (fWorkBefore + fWorkAfter); } int GetTotalBlocksEstimate() { if (fTestNet) return 0; // Testnet has no checkpoints if (!GetBoolArg("-checkpoints", true)) return 0; const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints; return checkpoints.rbegin()->first; //return 0; } CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex) { if (fTestNet) return NULL; // Testnet has no checkpoints if (!GetBoolArg("-checkpoints", true)) return NULL; const MapCheckpoints& checkpoints = *Checkpoints().mapCheckpoints; BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints) { const uint256& hash = i.second; std::map<uint256, CBlockIndex*>::const_iterator t = mapBlockIndex.find(hash); if (t != mapBlockIndex.end()) return t->second; //return NULL; } return NULL; } }
[ "dev@potcoin.info" ]
dev@potcoin.info
08856ff1985867b58eb05fc178401e2d9b14e364
88ed9abde9b457e5f2b3f59143705e93294c0f74
/l5/stack/count/lock_free (копия).h
976572303760b4b7876b466e678ed139884882bf
[]
no_license
ZonDBeer/_PCT
f41ad2a1033aa128385fb02769d137b95e15a585
c83d5ac6eeb1206a8fb7359662bdf6919d286ddf
refs/heads/master
2020-03-19T03:03:21.371622
2018-06-01T08:26:08
2018-06-01T08:26:08
135,689,780
0
0
null
null
null
null
UTF-8
C++
false
false
4,898
h
template <typename T> class lock_free_queue { private: struct node; struct counted_node_ptr { int external_count; node* ptr; }; std::atomic<counted_node_ptr> head; std::atomic<counted_node_ptr> tail; struct node_counter { unsigned internal_count:30; unsigned external_counters:2; }; struct node { std::atomic<T*> data; std::atomic<node_counter> count; std::atomic<counted_node_ptr> next; node() : data(0) { node_counter new_count; new_count.internal_count = 0; new_count.external_counters = 2; count.store(new_count); counted_node_ptr next_counted_node = { 0, 0 }; next.store(next_counted_node); } void release_ref(){ node_counter old_counter = count.load(); node_counter new_counter; do { new_counter = old_counter; --new_counter.internal_count; } while (!count.compare_exchange_strong(old_counter, new_counter)); if(!new_counter.internal_count && !new_counter.external_counters) { delete this; } } }; void set_new_tail(counted_node_ptr &old_tail, counted_node_ptr const &new_tail) { node* const current_tail_ptr = old_tail.ptr; while(!tail.compare_exchange_weak(old_tail, new_tail) && old_tail.ptr == current_tail_ptr); if(old_tail.ptr == current_tail_ptr) free_external_counter(old_tail); else current_tail_ptr -> release_ref(); } static void free_external_counter(counted_node_ptr &old_node_ptr) { node* const ptr = old_node_ptr.ptr; int const count_increase = old_node_ptr.external_count - 2; node_counter old_counter = ptr -> count.load(); node_counter new_counter; do { new_counter = old_counter; --new_counter.external_counters; new_counter.internal_count += count_increase; } while(!ptr -> count.compare_exchange_strong(old_counter, new_counter)); if(!new_counter.internal_count && !new_counter.external_counters){ delete ptr; } } static void increase_external_count(std::atomic<counted_node_ptr>& counter, counted_node_ptr& old_counter) { counted_node_ptr new_counter; do { new_counter = old_counter; ++new_counter.external_count; } while (!counter.compare_exchange_strong(old_counter, new_counter)); old_counter.external_count = new_counter.external_count; } public: lock_free_queue() { counted_node_ptr new_counted_node; new_counted_node.external_count = 1; new_counted_node.ptr = new node; head.store(new_counted_node); tail.store(new_counted_node); } lock_free_queue(const lock_free_queue& other) = delete; ~lock_free_queue(){ T val; while (pop()); } std::unique_ptr<T> pop() { counted_node_ptr old_head = head.load(); for(;;) { increase_external_count(head, old_head); node* const ptr = old_head.ptr; if(ptr == tail.load().ptr) { return std::unique_ptr<T>(); } counted_node_ptr next = ptr -> next.load(); if(head.compare_exchange_strong(old_head, next)) { T* const res = ptr -> data.exchange(nullptr); free_external_counter(old_head); return std::unique_ptr<T>(res); } ptr -> release_ref(); } } void push(T new_value) { std::unique_ptr<T> new_data(new T(new_value)); counted_node_ptr new_next; new_next.ptr = new node; new_next.external_count = 1; counted_node_ptr old_tail = tail.load(); for(;;) { increase_external_count(tail, old_tail); T* old_data = nullptr; if(old_tail.ptr -> data.compare_exchange_strong(old_data, new_data.get())) { counted_node_ptr old_next = {0}; if(!old_tail.ptr -> next.compare_exchange_strong(old_next, new_next)) { delete new_next.ptr; new_next = old_next; } set_new_tail(old_tail, new_next); new_data.release(); break; } else { counted_node_ptr old_next = {0}; if(old_tail.ptr -> next.compare_exchange_strong(old_next, new_next)) { old_next = new_next; new_next.ptr = new node; } set_new_tail(old_tail, old_next); } } } };
[ "vlad-z7x@mail.ru" ]
vlad-z7x@mail.ru
1c263b51b7fb0c3fcd561008c88a47925f5cc7b6
ea4c64185ef9c5bd32fa0beb6c6e12edd442622f
/MineEngine/Include/fontshaderclass.h
f6fd74e20f227be0c39238adf9ece0bf55907dec
[]
no_license
RumbleJack/DirectXDemo
0571a5d40c29224a834bdfc4c75a76593a365de5
1e5c6db3923ee70b59814ff7288c4a7ce26b2fee
refs/heads/master
2020-03-14T23:25:00.545381
2018-05-04T18:27:23
2018-05-04T18:27:23
131,844,514
0
0
null
null
null
null
GB18030
C++
false
false
1,343
h
// 文件名: fontshaderclass.h #ifndef _FONTSHADERCLASS_H_ #define _FONTSHADERCLASS_H_ // 类名: FontShaderClass class DllExport FontShaderClass { private: struct ConstantVertexBufferType { XMMATRIX world; XMMATRIX view; XMMATRIX projection; }; struct ConstPSBufferType { XMFLOAT4 pixelColor; }; public: FontShaderClass(); FontShaderClass(const FontShaderClass&); ~FontShaderClass(); bool Initialize(ID3D11Device*, HWND); void Shutdown(); bool Render(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix,XMMATRIX projectionMatrix, ID3D11ShaderResourceView* texture, XMFLOAT4 pixelColor); private: bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*); void ShutdownShader(); void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*); bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4); void RenderShader(ID3D11DeviceContext*, int); private: // 着色器 ID3D11VertexShader* m_vertexShader; ID3D11PixelShader* m_pixelShader; // 着色器输入参数布局 ID3D11InputLayout* m_layout; // 着色器常量缓冲 ID3D11Buffer* m_constantVertexBuffer; ID3D11Buffer* m_pixelColorBuffer; // 采样器状态,传递像素着色器采样状态 ID3D11SamplerState* m_sampleState; }; #endif
[ "renjiewen1995@163.com" ]
renjiewen1995@163.com
02cb389ca81f38509d526905d3c30e92cc66b689
1a20961af3b03b46c109b09812143a7ef95c6caa
/ZGame/DX11/hieroglyph3/trunk/Hieroglyph3/Extensions/GlyphRift/ViewRift.cpp
103e6fdd186676c9b37f5715aafdc01f6ca561bc
[ "MIT" ]
permissive
JetAr/ZNginx
eff4ae2457b7b28115787d6af7a3098c121e8368
698b40085585d4190cf983f61b803ad23468cdef
refs/heads/master
2021-07-16T13:29:57.438175
2017-10-23T02:05:43
2017-10-23T02:05:43
26,522,265
3
1
null
null
null
null
UTF-8
C++
false
false
8,305
cpp
//-------------------------------------------------------------------------------- // This file is a portion of the Hieroglyph 3 Rendering Engine. It is distributed // under the MIT License, available in the root of this distribution and // at the following URL: // // http://www.opensource.org/licenses/mit-license.php // // Copyright (c) Jason Zink //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- #include "GlyphRift/ViewRift.h" #include "Entity3D.h" #include "Scene.h" #include "Texture2dConfigDX11.h" #include "Log.h" #include "IParameterManager.h" #include "PipelineManagerDX11.h" #include "Texture2dDX11.h" #include "BoundsVisualizerActor.h" #include "SceneGraph.h" //-------------------------------------------------------------------------------- using namespace Glyph3; //-------------------------------------------------------------------------------- ViewRift::ViewRift( RiftHMDPtr hmd, ResourcePtr RenderTarget, int SwapChain ) : m_pHmd( hmd ) { // Get the desired texture sizes for the eye render targets. Note that these // are typically larger than the resolution of the HMD's display panel itself. unsigned int width = m_pHmd->DesiredEyeTextureWidth(); unsigned int height = m_pHmd->DesiredEyeTextureHeight(); // Create a single depth buffer, which will be used in rendering the scene // into each eye. Texture2dConfigDX11 depthConfig; depthConfig.SetDepthBuffer( width, height ); m_DepthTarget = RendererDX11::Get()->CreateTexture2D( &depthConfig, 0 ); // Read back the actual size of the texture created for use in the other // setup functions below. D3D11_TEXTURE2D_DESC desc = RendererDX11::Get()->GetTexture2DByIndex( m_DepthTarget->m_iResource )->GetActualDescription(); // Create a view port to use on the scene. Since they are the exact same // for both eyes, we can just use one viewport. D3D11_VIEWPORT viewport; viewport.Width = static_cast< float >( desc.Width ); viewport.Height = static_cast< float >( desc.Height ); viewport.MinDepth = 0.0f; viewport.MaxDepth = 1.0f; viewport.TopLeftX = 0.0f; viewport.TopLeftY = 0.0f; m_iViewports[0] = RendererDX11::Get()->CreateViewPort( viewport ); // Configure the rendering for the rift's eye textures. This is not dependent // on the swap chain size, but we provide the option to limit the resolution // for the eye textures here. Default values are 2048 x 2048, essentially // allowing whatever the rift requests. m_pHmd->ConfigureRendering( ); // Set up the projection matrices according to the FOV for each eye. These // can be calculated once and then reused as long as the FOV is not changed // during runtime. m_proj[0] = m_pHmd->GetPerspectiveFov( 0, 0.01f, 10000.0f ); m_proj[1] = m_pHmd->GetPerspectiveFov( 1, 0.01f, 10000.0f ); } //-------------------------------------------------------------------------------- ViewRift::~ViewRift() { } //-------------------------------------------------------------------------------- void ViewRift::Update( float fTime ) { } //-------------------------------------------------------------------------------- void ViewRift::QueuePreTasks( RendererDX11* pRenderer ) { if ( m_pEntity != NULL ) { Matrix4f view = m_pEntity->Transform.GetView(); SetViewMatrix( view ); } // Queue this view into the renderer for processing. pRenderer->QueueTask( this ); if ( m_pScene ) { // Run through the graph and pre-render the entities m_pScene->PreRender( pRenderer, VT_PERSPECTIVE ); } } //-------------------------------------------------------------------------------- void ViewRift::ExecuteTask( PipelineManagerDX11* pPipelineManager, IParameterManager* pParamManager ) { // Here we assume that the ovrHmd_BeginFrame function has already been called // by the application at the beginning of the rendering phase. The // application will also call the ovrHmd_EndFrame function after all rendering // is completed. if ( m_pScene ) { // Configure the desired viewports in this pipeline. This state is the // same for both eyes, so we pull it out of the loop. ConfigureViewports( pPipelineManager ); for ( unsigned int eye = 0; eye < 2; ++eye ) { // Set up the view matrices for this eye. This starts by getting the // view matrix from the node that this view's entity is attached to. // That represents the camera's node (instead of its body). We then apply // the eye's spatial state (including position and orientation) to that // parent location. // // NOTE: This view's entity location and orientation is updated according // to the Rift's *head* location. That provides an approximate location // for using to visualize the location of the rift in world space. // This is why we need to grab the parent's view - the eye matrices are // in relation to the whole rift, as opposed to relative to the head. Matrix4f centerView = m_pEntity->GetParent()->Transform.GetView(); m_view[eye] = centerView * m_pHmd->GetEyeSpatialState( eye ); // Set the parameters for rendering this view pPipelineManager->ClearRenderTargets(); pPipelineManager->OutputMergerStage.DesiredState.RenderTargetViews.SetState( 0, m_pHmd->GetEyeTexture(eye)->m_iResourceRTV ); pPipelineManager->OutputMergerStage.DesiredState.DepthTargetViews.SetState( m_DepthTarget->m_iResourceDSV ); pPipelineManager->ApplyRenderTargets(); pPipelineManager->ClearBuffers( m_vColor, 1.0f ); // Set this view's render parameters SetViewMatrix( m_view[eye] ); SetProjMatrix( m_proj[eye] ); SetRenderParams( pParamManager ); // Set the light parameters (currently only supporting the first light...) if ( m_pScene->GetLightCount() > 0 ) { m_pScene->GetLight( 0 )->Parameters.SetRenderParams( pParamManager ); } // Run through the graph and render each of the entities. This will sort the entities // based on whether or not they are transparent. std::vector<Entity3D*> entity_list; GetAllEntities( m_pScene->GetRoot(), entity_list ); auto const transparent_check = []( Entity3D* entity) { return entity->Visual.iPass != Renderable::ALPHA; }; // We use stable partition to sort, and return the first transparent entity. auto const iter_first_alpha = std::stable_partition(begin(entity_list), end(entity_list), transparent_check); // Now we can render all entities in the sorted order. for ( auto& entity : entity_list ) { entity->Render( pPipelineManager, pParamManager, VT_PERSPECTIVE ); } // If the debug view is enabled, then we can render some additional scene // related information as an overlay on this view. Note that this is // accomplished without the actor being attached to the scene! if ( m_bDebugViewEnabled ) { std::vector<Entity3D*> list; GetAllEntities( m_pScene->GetRoot(), list ); m_pDebugVisualizer->UpdateBoundsData( list ); m_pDebugVisualizer->GetBody()->Render( pPipelineManager, pParamManager, VT_PERSPECTIVE ); } } } } //-------------------------------------------------------------------------------- void ViewRift::Resize( UINT width, UINT height ) { // These sizes are determined by the Rift Headset, and should not change // with window size changes. } //-------------------------------------------------------------------------------- std::wstring ViewRift::GetName() { return( L"ViewRift" ); } //--------------------------------------------------------------------------------
[ "126.org@gmail.com" ]
126.org@gmail.com
cba5929c832ea545e1b0cbac6e947f020b8a5054
ff0df31236e1402e073a22f46aa739e8f88c35bb
/LastAlive/OldECS/Component.h
4dde7e5f13a6dc454afb7fd169cd554a1aa9bb39
[]
no_license
redtoorange/lastalive
11e71cd16db64f5f8978f1748f89826bae0325cd
5edef2322f5a2870e463acba1d99064753be8c1e
refs/heads/master
2020-03-28T13:24:59.548372
2018-06-23T13:18:09
2018-06-23T13:18:09
148,393,714
0
0
null
null
null
null
UTF-8
C++
false
false
597
h
#pragma once #include "BatchRenderer.h" namespace sf { class RenderWindow; class Event; } namespace Engine { class Component { public: Component() = default; virtual ~Component() = default; virtual void Update(float p_delta); virtual void Render(sf::RenderWindow& p_window); virtual void Render(BatchRenderer& p_window); virtual void HandleInput(sf::Event& p_event); bool GetsInput() const; bool GetsUpdate() const; bool GetsRender() const; protected: bool m_getsInput = true; bool m_getsUpdate = true; bool m_getsRender = true; }; } // namespace Engine
[ "redtoorange@gmail.com" ]
redtoorange@gmail.com
2edde90e7603df05a4a1afc7ff730a97d1bb4294
54bbee5e1f7de6f2f4ad242b8161577caf453b20
/flareirc/talkwindowtab.h
6eb90be026d6f2ffa9b2c485663cd57128debda2
[]
no_license
jr551/FlareIRC
2c960691023fe35aaaf40420cb024079a1116829
85fcf7929ff1974bae8df98dc6e4fe864db91abb
refs/heads/main
2023-07-05T21:55:39.215356
2021-08-18T20:40:24
2021-08-18T20:40:24
397,378,506
0
0
null
null
null
null
UTF-8
C++
false
false
604
h
#ifndef TALKWINDOWTAB_H #define TALKWINDOWTAB_H #include <QWidget> class TalkWindowTab : public QWidget { Q_OBJECT public: explicit TalkWindowTab(QWidget *parent = 0); enum TalkWindowTabType_t { SERVER_TAB = 0, CHANNEL_TAB, PRIVMSG_TAB }; virtual TalkWindowTabType_t GetTabType() = 0; virtual QString GetTabContext() = 0; virtual void AddChatLine( QString line ) = 0; virtual bool UpdateNick( QString oldNick, QString newNick ) = 0; virtual void LocalNickUpdated( QString nick ) = 0; signals: public slots: }; #endif // TALKWINDOWTAB_H
[ "johnrowe551@gmail.com" ]
johnrowe551@gmail.com
8778db54174f0a49064c0b97b58275fe7e13a3b8
6ccdb5faae5e4fc3d1be490790566ecb87ee0f03
/controlCar_46_/controlCar_46_.ino
d8877c6d96da4f318ecec772767c9dfd115bf327
[]
no_license
EmbeddedProjectInDonggukUniv/Smart-Traffic-System
76ccdb9a237b18c11375152badbe9d54c92cfcab
ae975f14ba59af216b3b044665352829bd237ea5
refs/heads/master
2021-01-13T03:42:33.110648
2016-12-24T06:36:28
2016-12-24T06:36:28
77,269,764
0
0
null
null
null
null
UTF-8
C++
false
false
6,882
ino
#include <EEPROM.h> #include <MsTimer2.h> #define Node_ID 46// 아두이노 ID 강성지(42) 고성욱(19) 진대한(46) 윤지현(72) 이준희 (91) #define Server_ID 248 // SM5 ID #define Port_Num 7777 // 통신하기 위한 포트 넘버 int touchSensor = 12; // 터치센서 핀 설정 int ledPin = 13; // LED 핀 설정 int ledLightPin = 11; // LIght LED 핀 설정 int turn_light = 0; int crashed = 0; int nearby_crashed = 0; uint16_t output; uint8_t ID = 0; uint32_t timer_check = 0; uint8_t RX_flag = 0, TX_flag = 0, Timer_flag = 0; // RX_flag 데이터를 받을 수 있는지 여부 // TX는 데이터를 보낼 수 있는지 여부 uint8_t EEPROM_buf[2] = {0xAA, 0}; char RX_buf[17]; uint8_t TX_buf[17] = {0xA0, 0x0A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0A, 0xA0}; int RX_count = 0; void setup() { int i; static int RX_count = 0; static char Check_buf[3] = {0, 0, 0}; Serial.begin(115200); Serial1.begin(9600); delay(50); timer_check = millis(); Serial.println("Start Wifi Setting"); Serial1.print("AT\r\n"); delay(10); Serial1.print("AT+WAUTO=0,Jin\r\n"); delay(10); Serial1.print("AT+NDHCP=0\r\n"); delay(10); Serial1.print("AT+NAUTO=0,1,192.168.43."); Serial1.print(Server_ID); Serial1.print(","); Serial1.print(Port_Num); Serial1.print("\r\n"); delay(10); Serial1.print("AT+NSET=192.168.43."); Serial1.print(Node_ID); Serial1.print(",255.255.255.0,192.168.43.1\r\n"); delay(10); Serial1.print("AT&W0\r\n"); delay(10); Serial1.print("ATC0\r\n"); delay(10); Serial1.print("ATA\r\n"); delay(10); Serial.println("Wifi Setting Finish"); MsTimer2::set(200, TIMER_ISR); MsTimer2::start(); } void loop() { uint16_t i; long duration, cm; pinMode(ledPin, OUTPUT); pinMode(ledLightPin, OUTPUT); pinMode(touchSensor, INPUT); int touchValue = digitalRead(touchSensor); if (touchValue == LOW || crashed == 1 || nearby_crashed == 1){ // 충돌 발생 시 crashed = 1; digitalWrite(ledPin, HIGH);// LED 켜짐 } else { // 터치 안됨 digitalWrite(ledPin,LOW); // LED 꺼짐 } if (turn_light == 0){ // 밤인 경우 digitalWrite(ledLightPin, HIGH); } else { // 낮인 경우 digitalWrite(ledLightPin, LOW); } if(((timer_check+4000) < millis()) && (RX_flag == 0)) { if(RX_count < 1) { if(EEPROM.read(0) == 0xAA) { ID = EEPROM.read(1); RX_flag = 1; Serial.print("\n\rID : "); Serial.println(ID); TX_buf[3] = ID; } else { RX_flag = 2; Serial.println("\n\rWifi Connected Error"); Serial.print("\n\rPlease reset the ADK-2560"); } } } if(Timer_flag && TX_flag) { TX_buf[4] = 1; // data[4] TX_buf[6] = crashed; // data[6] TX_buf[7] = 0; // data[7] TX_buf[8] = 8; // data[8] TX_buf[14] = TX_buf[2]; for(i = 3; i < 14; i++) { TX_buf[14] += TX_buf[i]; } Serial.println("\n\rTX Packet data"); for(i = 0; i < 17; i++) { Serial.write(' '); Serial.print(TX_buf[i], HEX); Serial1.write(TX_buf[i]); } Timer_flag = 0; } } void serialEvent1(void) { static char Check_buf[4] = {0, 0, 0, }; uint8_t i,check_sum = 0, RX_cnt = 0; if(RX_flag == 0) { char da = Serial1.read(); Serial.write(da); Check_buf[0] = Check_buf[1]; Check_buf[1] = Check_buf[2]; Check_buf[2] = da; if((Check_buf[0] == 'A') && (Check_buf[1] == 'T') && (Check_buf[2] == 'A') && (RX_count == 0)) { RX_count = 1; } else if(RX_count == 4) { if(Check_buf[2] != ':') { ID = ID*10 + (Check_buf[2]-'0'); } else { RX_count++; } } else if(RX_count == 5) { if(Check_buf[2] == ']') { if((Check_buf[0] == 'O') && (Check_buf[1] == 'K')) { RX_flag = 1; delay(1000); RX_cnt = Serial1.available(); Serial.println(RX_cnt); while(1) { Serial.write(Serial1.read()); RX_cnt--; if(RX_cnt == 0) break; } Serial.print("\n\rID : "); Serial.print(ID); EEPROM_buf[1] = ID; if(EEPROM.read(1) != ID) { for(i=0; i<2; i++) { EEPROM.write(i,EEPROM_buf[i]); } } TX_buf[3] = ID; } else { RX_flag = 2; Serial.print("\n\rWifi Connected Error"); Serial.print("\n\rPlease reset the ADK-2560"); } } } else if((Check_buf[2] == '.') && ((RX_count == 1) || (RX_count == 2) || (RX_count == 3))) { RX_count++; } else if(RX_count == 1) { if(Check_buf[2] == ']') { if((Check_buf[0] == 'O') && (Check_buf[1] == 'R')) { RX_flag = 2; Serial.print("\n\rWifi Connected fail"); Serial.print("\n\rPlease reset the ADK-2560"); } } } } else if(RX_flag == 1) { if(Serial1.available() > 16) { Serial1.readBytes(RX_buf, 17); if(((uint8_t)RX_buf[0] == 0xA0) && ((uint8_t)RX_buf[1] == 0x0A)) { for(i=2; i<14; i++) { check_sum += (uint8_t)RX_buf[i]; } if(check_sum == (uint8_t)RX_buf[14]) { Serial.println("\n\rRX Packet data"); for(i=0; i<17; i++) { Serial.write(' '); Serial.print((uint8_t)RX_buf[i],HEX); } if((int)RX_buf[10] != 0) {// When car crash occurred nearby_crashed=1; }else{ nearby_crashed=0; } if((int)RX_buf[12] == 1) {// 밝기에 따라 전조등 작동 turn_light=1; }else{ turn_light=0; } TX_flag = RX_buf[4]; if(!TX_flag) { for(i=4; i<14; i++) { TX_buf[i] = 0; } TX_buf[14] = TX_buf[2]; TX_buf[4] = 1; // data[4] TX_buf[6] = crashed; // data[6] TX_buf[7] = 0; // data[7] TX_buf[8] = 8; // data[8] TX_buf[14] = TX_buf[2]; for(i=3; i<14; i++) { TX_buf[14] += TX_buf[i]; } Serial.println("\n\rTX Packet data"); for(i=0; i<17; i++) { Serial.write(' '); Serial.print(TX_buf[i],HEX); Serial1.write(TX_buf[i]); } } } } } } } void serialEvent(void) { Serial1.write(Serial.read()); } void TIMER_ISR(void) { Timer_flag = 1; }
[ "hanguk46@naver.com" ]
hanguk46@naver.com
9207a95556b75b897e630d1c5422b4a4a3919904
e373db953fa904225c94da4d99368a8d246290c4
/code/kepler_main - Copy.cpp
370ff819d1b2572f0164223c6505c2fd3681fdea
[]
no_license
kepler425b/lab64
dded28d970c824f158cb2b2c0a99ed10d9b84c6e
34ca6c1cbd09c318d963946c8e5fdf929163a3f5
refs/heads/master
2020-04-13T11:28:09.393416
2018-12-31T11:05:12
2018-12-31T11:05:12
158,926,088
0
0
null
null
null
null
UTF-8
C++
false
false
10,458
cpp
#define _CRT_SECURE_NO_WARNINGS #define GLEW_STATIC #include <Windows.h> #include <SDL.h> #include <SDL_image.h> #include <SDL_ttf.h> #include <glm.hpp> #include <GL\glew.h> #include <gl/GL.h> #include "Model.h" #include "Camera.h" #include <iostream> #include <vector> #include <string> #include <sstream> #include <cassert> #include <math.h> SDL_Event Event; SDL_Renderer *Renderer = NULL; SDL_Window *Window = NULL; SDL_Surface *Screen = NULL; float dt = 1.0 / 60; __int64 FPS = 0; const UINT8 *keyState; bool quit = false; int SCW = 1024; int SCH = 768; GLuint model_list; Model model_object; Camera camera_object; static int isWire = 0; static int isFog = 1; int isOrtho = 0; using namespace std; using namespace glm; #define right SDL_SCANCODE_RIGHT #define left SDL_SCANCODE_LEFT #define up SDL_SCANCODE_UP #define down SDL_SCANCODE_DOWN std::vector<vec3> s_data; void sdldie(const char *msg) { printf("%s: %s\n", msg, SDL_GetError()); SDL_Quit(); exit(1); } void checkSDLError(int line = -1) { #ifndef NDEBUG const char *error = SDL_GetError(); if (*error != '\0') { printf("SDL Error: %s\n", error); if (line != -1) printf(" + line: %i\n", line); SDL_ClearError(); } #endif } void close() { SDL_DestroyWindow(Window); SDL_DestroyRenderer(Renderer); Window = NULL; Renderer = NULL; SDL_Quit(); IMG_Quit(); } void Model::loadFile(int argc, char **argv) { string fileObjectLine; ifstream fileObject; assert(argc == 2); fileObject = ifstream(argv[1]); if (fileObject.is_open()) { while (!fileObject.eof()) { getline(fileObject, fileObjectLine); if (fileObjectLine.c_str()[0] == 'v') { // if the line starts with 'v', it's declaring a vertice //cout << fileObjectLine << endl; float x, y, z; fileObjectLine[0] = ' '; // get rid of 'v' sscanf(fileObjectLine.c_str(), "%f %f %f ", &x, &y, &z); // assign the vertice's values to x,y,z model_object.vertex_list.push_back(x); // save the values into the vector vertex_list of model_object.vertex_list.push_back(y); // object model_object model_object.vertex_list.push_back(z); //cout << "line is " << fileObjectLine << endl; //cout << model_object.vertex_list.size() << endl; continue; // skip to next iteration } } model_list = glGenLists(1); // init one display list glNewList(model_list, GL_COMPILE); // start of display list // NOTE: this will only run once, after all the vertices have been added and right before polygons/faces are added //applyTransfToMatrix(); //model_object.applyTransfToMatrix(); // go back to beginning of the file fileObject.clear(); fileObject.seekg(0, ios::beg); #if 1 glBegin(GL_POINTS); while (!fileObject.eof()) { getline(fileObject, fileObjectLine); // scanning for 'f' and adding polygons to display list if (fileObjectLine.c_str()[0] == 'f') { // if the line starts with 'f', it's declaring a face/polygon s_list.push_back(fileObjectLine); fileObjectLine[0] = ' '; uint vertexIndex[3], uvIndex[3], normalIndex[3]; uint matches = sscanf(fileObjectLine.c_str(), "%d/%d/%d %d/%d/%d %d/%d/%d", &vertexIndex[0], &uvIndex[0], &normalIndex[0], &vertexIndex[1], &uvIndex[1], &normalIndex[1], &vertexIndex[2], &uvIndex[2], &normalIndex[2]); if (matches != 9) { } vec3 temp; temp.x = model_object.vertex_list.at(vertexIndex[0] - 1); temp.y = model_object.vertex_list.at(vertexIndex[1] - 1); temp.z = model_object.vertex_list.at(vertexIndex[2] - 1); s_data.push_back(temp); glVertex3f(temp.x, temp.y, temp.z); continue; } } glEnd(); glEndList(); } } #endif #if 0 // read file again and process the lines starting with 's' int num = 0; while (!fileObject.eof()) { getline(fileObject, fileObjectLine); // scanning for 'f' and adding polygons to display list if (fileObjectLine.c_str()[0] == 'f') { // if the line starts with 'f', it's declaring a face/polygon s_list.push_back(fileObjectLine); fileObjectLine[0] = ' '; // get rid of 'f' from the line string istringstream iss(fileObjectLine); int x, y, z; //cout << "line is : " << fileObjectLine << endl; x = 0; y = 1; z = 2; int stride = 0; int v_size = model_object.vertex_list.size(); for (int index = 3; index < model_object.vertex_list.size(); index += 3) { if (x >= v_size) { x = v_size; }; if (y >= v_size) { y = v_size; }; if (z >= v_size) { z = v_size; }; if (num == 0) { glBegin(GL_LINES); } glVertex3f(model_object.vertex_list[x], model_object.vertex_list[y], model_object.vertex_list[z]); stride += 3; x += 3; y += 3; z += 3; num++; if (num >= 3) { glEnd(); num = 0; } } glEnd(); } } glEndList(); } } #endif void drawModelTransf() { // model // apply model translations glTranslatef(model_object.model_x, model_object.model_y, model_object.model_z); // translate to z = -2 so model can rotate about its axis glTranslatef(0, 0, -2); // apply rotation transformations glRotatef(model_object.model_rotx, 1, 0, 0); glRotatef(model_object.model_roty, 0, 1, 0); glRotatef(model_object.model_rotz, 0, 0, 1); // translate back to z = 0 where the camera is glTranslatef(0, 0, 2); } void drawCameraTransf() { // camera glTranslatef(camera_object.camera_x, camera_object.camera_y, camera_object.camera_z); glRotatef(camera_object.camera_rotx, 1, 0, 0); glRotatef(camera_object.camera_roty, 0, 1, 0); glRotatef(camera_object.camera_rotz, 0, 0, 1); //gluLookAt(0.0, 0.0, 0.0, model_object.model_x, model_object.model_y, model_object.model_z, 0.0, 1.0, 0.0); } // Drawing (display) routine. void drawScene(void) { // Clear screen to background color. glClearColor(0.0f, 0.0f, 0.0f, 0.0f); static int fogMode = GL_LINEAR; // Fog mode static float fogStart = 1.0; // Fog start z value. static float fogEnd = 5.0; // Fog end z value. float fogColor[4] = { 1.0, 1.0, 1.0, 0.0 }; // Fog controls. if (isFog) glEnable(GL_FOG); else glDisable(GL_FOG); glHint(GL_FOG_HINT, GL_NICEST); glFogfv(GL_FOG_COLOR, fogColor); glFogi(GL_FOG_MODE, fogMode); glFogf(GL_FOG_START, fogStart); glFogf(GL_FOG_END, fogEnd); // reset transformation matrix glMatrixMode(GL_MODELVIEW); glLoadIdentity(); // Set foreground (or drawing) color. glColor3f(1.0f, 0.0f, 0.0f); // wireframe or not? if (isWire) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); else glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); // apply translations and rotations to model and camera drawCameraTransf(); drawModelTransf(); // draw display list glCallList(model_list); } // Initialization routine. void setup(void) { // Set background (or clearing) color. glClearColor(0.0, 0.0, 0.0, 0.0); } // OpenGL window reshape routine. void resize(int w, int h) { glViewport(0, 0, (GLsizei)w, (GLsizei)h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); if (isOrtho) { glOrtho(-1.0, 1.0, -1.0, 1.0, 1, 100.0); } else { glFrustum(-1.0, 1.0, -1.0, 1.0, 1, 100.0); } glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } int main(int argc, char* argv[]) { SDL_Window *mainWindow; SDL_GLContext glContext; SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 5); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); if (SDL_Init(SDL_INIT_VIDEO) < 0) { } mainWindow = SDL_CreateWindow("Beaminster", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 512, 512, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN); if (!mainWindow) /* Die if creation failed */ sdldie("Unable to create window"); checkSDLError(__LINE__); glContext = SDL_GL_CreateContext(mainWindow); SDL_SetWindowResizable(mainWindow, SDL_TRUE); glDisable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE); if (!glewInit() == GLEW_OK) { printf("error"); } unsigned int buffer; glGenBuffers(1, &buffer); glBindBuffer(GL_ARRAY_BUFFER, buffer); //glBufferData(GL_ARRAY_BUFFER, 3, &) checkSDLError(__LINE__); SDL_GL_SetSwapInterval(1); int w, h; SDL_GetWindowSize(mainWindow, &w, &h); glViewport(0, 0, w, h); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); /*char *asd = (char *)malloc(256); strcpy_s(asd, 256, "asd"); TTF_Font *font = TTF_OpenFont("font/ProggyClean.ttf", 24);*/ LARGE_INTEGER Frequency; QueryPerformanceFrequency(&Frequency); double SecondPerTick = 1.0 / (double)Frequency.LowPart; LARGE_INTEGER tick_beforloop; QueryPerformanceCounter(&tick_beforloop); model_object.loadFile(argc, argv); GLuint VertexArrayID; glGenVertexArrays(1, &VertexArrayID); glBindVertexArray(VertexArrayID); while (!quit){ LARGE_INTEGER last_tick; QueryPerformanceCounter(&last_tick); while (SDL_PollEvent(&Event)){ if (Event.type == SDL_QUIT){ quit = true; } switch (Event.type) if (Event.type == SDL_WINDOWEVENT) { switch (Event.window.event) { case SDL_WINDOWEVENT_RESIZED: { resize(Event.window.data1, Event.window.data2); break; default: break; } } case SDL_KEYDOWN: { switch (Event.key.keysym.sym) { case SDLK_UP: model_object.model_rotx += 10; break; case SDLK_DOWN: model_object.model_rotx -= 10; break; case SDLK_RIGHT: model_object.model_roty += 10; break; case SDLK_LEFT: model_object.model_roty -= 10; break; default: break; } } if(Event.type == SDL_KEYUP) { switch (Event.key.keysym.sym) { case SDLK_UP: break; case SDLK_DOWN: break; case SDLK_RIGHT: break; default: break; case SDLK_LEFT: break; } } } if (Event.type == SDL_MOUSEBUTTONDOWN){ if (Event.button.button == SDL_BUTTON_LEFT){ } } else if (Event.type == SDL_MOUSEBUTTONUP){ } } const UINT8* Key = SDL_GetKeyboardState(NULL); if (Key[right]){ } if (Key[left]){ } if (Key[up]){ } if (Key[down]){ } drawScene(); LARGE_INTEGER now_tick; QueryPerformanceCounter(&now_tick); __int64 Interval = now_tick.QuadPart - tick_beforloop.QuadPart; double SecondsGoneBy = (double)Interval * SecondPerTick; } SDL_GL_DeleteContext(glContext); SDL_DestroyWindow(mainWindow); SDL_Quit(); return 0; }
[ "bra3as@gmail.com" ]
bra3as@gmail.com
f16b0a8edf8e9ca8a5d87a7278714f99ac2991ec
72335f4c1c11da288d488c95e77e57e80a84ed00
/Parametre.h
e0e2b8ecddcaf80fea585e9dfbbcdd68922e0276
[]
no_license
antoinepay/comp
8f8e732558b125270ea05cb8c45609b995e48f7b
c0a02ca6db8d8f7efdd9de258d5598012971f898
refs/heads/master
2020-04-01T20:25:21.732562
2018-10-18T10:00:43
2018-10-18T10:00:43
153,602,889
0
0
null
null
null
null
UTF-8
C++
false
false
381
h
#ifndef PARAMETRE_H_ #define PARAMETRE_H_ #include <stdio.h> #include "Variable.h" class Parametre { public: Parametre(int type2, Variable* v); virtual ~Parametre(); void print(); int getType(); char* getNomVal(); string buildIR_param(CFG* cfg, int indice, int taille); protected: int type; Variable* nom; }; #endif /* PARAMETRE_H_ */
[ "antoine.payan@hotmail.fr" ]
antoine.payan@hotmail.fr
c06ccb1f43b98fabe5820c8cda59ece9c80c402e
9989ec29859d067f0ec4c7b82e6255e227bd4b54
/atcoder.jp/abc_129/abc129_b.cpp
6338f04541dd4cc59d006f4d2adbaf0b31076a8e
[]
no_license
hikko624/prog_contest
8fa8b0e36e4272b6ad56d6506577c13f9a11c9de
34350e2d298deb52c99680d72345ca44ab6f8849
refs/heads/master
2022-09-10T20:43:28.046873
2022-08-26T13:59:29
2022-08-26T13:59:29
217,740,540
0
0
null
null
null
null
UTF-8
C++
false
false
1,871
cpp
// abc129_b #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #if __cplusplus >= 201103L #include <array> #include <atomic> #include <chrono> #include <condition_variable> #include <forward_list> #include <future> #include <initializer_list> #include <mutex> #include <random> #include <ratio> #include <regex> #include <scoped_allocator> #include <system_error> #include <thread> #include <tuple> #include <type_traits> #include <typeindex> #include <unordered_map> #include <unordered_set> #endif template <typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; } template <typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; } const double PI = acos(-1); const double EPS = 1e-9; int inf = sizeof(int) == sizeof(long long) ? 2e18 : 1e9 + 10; int dx[] = {0, 1, 0, -1}; int dy[] = {1, 0, -1, 0}; #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; ll sum = 0, right, left, ans = inf, now; cin>>n; vector<int> w(n); rep(i, n) { cin >> w.at(i); sum += w.at(i); } right = sum, left = 0; rep(i, n) { now = abs(right - left); ans = min(ans, now); right -= w.at(i); left += w.at(i); } cout << ans << endl; return 0; }
[ "hikko624@gmail.com" ]
hikko624@gmail.com