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
905 values
visit_date
timestamp[us]date
2015-08-09 11:21:18
2023-09-06 10:45:07
revision_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-17 19:19:19
committer_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-06 06:22:19
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]date
2012-06-07 00:51:45
2023-09-14 21:58:39
gha_created_at
timestamp[us]date
2008-03-27 23:40:48
2023-08-21 23:17:38
gha_language
stringclasses
141 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
10.4M
extension
stringclasses
115 values
content
stringlengths
3
10.4M
authors
listlengths
1
1
author_id
stringlengths
0
158
fca3991d02a186ddb475852573ec4eec7f7a40fb
001eef3e7d1f5a240fde31ca4818524ab67288dc
/inst/include/libshogun/shogun/kernel/WeightedDegreePositionStringKernel.h
a41492c1b462804e56b0d1a801344d2544f5ca26
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
JMR-b/shikken
76ff3e30e52100df8ed019e9158057249437e717
99999cf7c90d27773ae9d7ea000cd509a7e09666
refs/heads/master
2021-01-16T19:22:11.200229
2011-09-23T04:48:07
2011-09-23T04:48:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
20,425
h
/* * 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 3 of the License, or * (at your option) any later version. * * Written (W) 1999-2009 Soeren Sonnenburg * Written (W) 1999-2008 Gunnar Raetsch * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society */ #ifndef _WEIGHTEDDEGREEPOSITIONSTRINGKERNEL_H___ #define _WEIGHTEDDEGREEPOSITIONSTRINGKERNEL_H___ #include <shogun/lib/common.h> #include <shogun/kernel/StringKernel.h> #include <shogun/kernel/WeightedDegreeStringKernel.h> #include <shogun/lib/Trie.h> namespace shogun { class CSVM; /** @brief The Weighted Degree Position String kernel (Weighted Degree kernel * with shifts). * * The WD-shift kernel of order d compares two sequences \f${\bf x}\f$ and * \f${\bf x'}\f$ of length L by summing all contributions of k-mer matches of * lengths \f$k\in\{1,\dots,d\}\f$, weighted by coefficients \f$\beta_k\f$ * allowing for a positional tolerance of up to shift s. * * It is formally defined as * \f{eqnarray*} * &&\!\!\!\!\!\!\!k({\bf x}_i,{\bf x}_j)=\sum_{k=1}^d\beta_k\sum_{l=1}^{\!\!\!\!L-k+1\!\!\!\!}\gamma_l\sum_{\begin{array}{c}s=0\\ * \!\!\!\!s+l\leq L\!\!\!\!\end{array}}^{S(l)} * \delta_s\;\mu_{k,l,s,{{\bf x}_i},{{\bf x}_j}},\\ * &&\!\!\!\!\!\!\!\!\!\! {\footnotesize \mu_{k,l,s,{{\bf x}_i},{{\bf x}_j}}\!\!\! =\!\! * I({\bf u}_{k,l+s}({\bf x}_i)\! =\!{\bf u}_{k,l}({\bf x}_j))\! +\!I({\bf u}_{k,l}({\bf x}_i)\! * =\!{\bf u}_{k,l+s}({\bf x}_j))},\nonumber * \f} * where \f$\beta_j\f$ are the weighting coefficients of the j-mers, * \f$\gamma_l\f$ is a weighting over the * position in the sequence, \f$\delta_s=1/(2(s+1))\f$ is the weight assigned * to shifts (in either direction) of extent s, and S(l) determines * the shift range at position l. */ class CWeightedDegreePositionStringKernel: public CStringKernel<char> { public: /** default constructor */ CWeightedDegreePositionStringKernel(void); /** constructor * * @param size cache size * @param degree degree * @param max_mismatch maximum mismatch * @param mkl_stepsize MKL stepsize */ CWeightedDegreePositionStringKernel( int32_t size, int32_t degree, int32_t max_mismatch=0, int32_t mkl_stepsize=1); /** constructor * * @param size cache size * @param weights weights * @param degree degree * @param max_mismatch maximum mismatch * @param shift position shifts * @param shift_len number of shifts * @param mkl_stepsize MKL stepsize */ CWeightedDegreePositionStringKernel( int32_t size, float64_t* weights, int32_t degree, int32_t max_mismatch, int32_t* shift, int32_t shift_len, int32_t mkl_stepsize=1); /** constructor * * @param l features of left-hand side * @param r features of right-hand side * @param degree degree */ CWeightedDegreePositionStringKernel( CStringFeatures<char>* l, CStringFeatures<char>* r, int32_t degree); virtual ~CWeightedDegreePositionStringKernel(); /** initialize kernel * * @param l features of left-hand side * @param r features of right-hand side * @return if initializing was successful */ virtual bool init(CFeatures* l, CFeatures* r); /** clean up kernel */ virtual void cleanup(); /** return what type of kernel we are * * @return kernel type WEIGHTEDDEGREEPOS */ virtual EKernelType get_kernel_type() { return K_WEIGHTEDDEGREEPOS; } /** return the kernel's name * * @return name WeightedDegreePos */ virtual const char* get_name() const { return "WeightedDegreePositionStringKernel"; } /** initialize optimization * * @param p_count count * @param IDX index * @param alphas alphas * @return if initializing was successful */ inline virtual bool init_optimization( int32_t p_count, int32_t *IDX, float64_t * alphas) { return init_optimization(p_count, IDX, alphas, -1); } /** initialize optimization * do initialization for tree_num up to upto_tree, use * tree_num=-1 to construct all trees * * @param count count * @param IDX IDX * @param alphas alphas * @param tree_num which tree * @param upto_tree up to this tree * @return if initializing was successful */ virtual bool init_optimization( int32_t count, int32_t *IDX, float64_t * alphas, int32_t tree_num, int32_t upto_tree=-1); /** delete optimization * * @return if deleting was successful */ virtual bool delete_optimization(); /** compute optimized * * @param idx index to compute * @return optimized value at given index */ inline virtual float64_t compute_optimized(int32_t idx) { ASSERT(get_is_initialized()); ASSERT(alphabet); ASSERT(alphabet->get_alphabet()==DNA || alphabet->get_alphabet()==RNA); return compute_by_tree(idx); } /** helper for compute batch * * @param p thread parameter */ static void* compute_batch_helper(void* p); /** compute batch * * @param num_vec number of vectors * @param vec_idx vector index * @param target target * @param num_suppvec number of support vectors * @param IDX IDX * @param alphas alphas * @param factor factor */ virtual void compute_batch( int32_t num_vec, int32_t* vec_idx, float64_t* target, int32_t num_suppvec, int32_t* IDX, float64_t* alphas, float64_t factor=1.0); /** clear normal * subkernel functionality */ inline virtual void clear_normal() { if ((opt_type==FASTBUTMEMHUNGRY) && (tries.get_use_compact_terminal_nodes())) { tries.set_use_compact_terminal_nodes(false) ; SG_DEBUG( "disabling compact trie nodes with FASTBUTMEMHUNGRY\n") ; } if (get_is_initialized()) { if (opt_type==SLOWBUTMEMEFFICIENT) tries.delete_trees(true); else if (opt_type==FASTBUTMEMHUNGRY) tries.delete_trees(false); // still buggy else SG_ERROR( "unknown optimization type\n"); set_is_initialized(false); } } /** add to normal * * @param idx where to add * @param weight what to add */ inline virtual void add_to_normal(int32_t idx, float64_t weight) { add_example_to_tree(idx, weight); set_is_initialized(true); } /** get number of subkernels * * @return number of subkernels */ inline virtual int32_t get_num_subkernels() { if (position_weights!=NULL) return (int32_t) ceil(1.0*seq_length/mkl_stepsize) ; if (length==0) return (int32_t) ceil(1.0*get_degree()/mkl_stepsize); return (int32_t) ceil(1.0*get_degree()*length/mkl_stepsize) ; } /** compute by subkernel * * @param idx index * @param subkernel_contrib subkernel contribution */ inline void compute_by_subkernel( int32_t idx, float64_t * subkernel_contrib) { if (get_is_initialized()) { compute_by_tree(idx, subkernel_contrib); return ; } SG_ERROR( "CWeightedDegreePositionStringKernel optimization not initialized\n") ; } /** get subkernel weights * * @param num_weights number of weights will be stored here * @return subkernel weights */ inline const float64_t* get_subkernel_weights(int32_t& num_weights) { num_weights = get_num_subkernels() ; delete[] weights_buffer ; weights_buffer = new float64_t[num_weights] ; if (position_weights!=NULL) for (int32_t i=0; i<num_weights; i++) weights_buffer[i] = position_weights[i*mkl_stepsize] ; else for (int32_t i=0; i<num_weights; i++) weights_buffer[i] = weights[i*mkl_stepsize] ; return weights_buffer ; } /** set subkernel weights * * @param weights2 weights * @param num_weights2 number of weights */ inline void set_subkernel_weights( float64_t* weights2, int32_t num_weights2) { int32_t num_weights = get_num_subkernels() ; if (num_weights!=num_weights2) SG_ERROR( "number of weights do not match\n") ; if (position_weights!=NULL) for (int32_t i=0; i<num_weights; i++) for (int32_t j=0; j<mkl_stepsize; j++) { if (i*mkl_stepsize+j<seq_length) position_weights[i*mkl_stepsize+j] = weights2[i] ; } else if (length==0) { for (int32_t i=0; i<num_weights; i++) for (int32_t j=0; j<mkl_stepsize; j++) if (i*mkl_stepsize+j<get_degree()) weights[i*mkl_stepsize+j] = weights2[i] ; } else { for (int32_t i=0; i<num_weights; i++) for (int32_t j=0; j<mkl_stepsize; j++) if (i*mkl_stepsize+j<get_degree()*length) weights[i*mkl_stepsize+j] = weights2[i] ; } } // other kernel tree operations /** compute abs weights * * @param len len * @return computed abs weights */ float64_t* compute_abs_weights(int32_t & len); /** check if tree is initialized * * @return if tree is initialized */ bool is_tree_initialized() { return tree_initialized; } /** get maximum mismatch * * @return maximum mismatch */ inline int32_t get_max_mismatch() { return max_mismatch; } /** get degree * * @return the degree */ inline int32_t get_degree() { return degree; } /** get degree weights * * @param d degree weights will be stored here * @param len number of degree weights will be stored here */ inline float64_t *get_degree_weights(int32_t& d, int32_t& len) { d=degree; len=length; return weights; } /** get weights * * @param num_weights number of weights will be stored here * @return weights */ inline float64_t *get_weights(int32_t& num_weights) { if (position_weights!=NULL) { num_weights = seq_length ; return position_weights ; } if (length==0) num_weights = degree ; else num_weights = degree*length ; return weights; } /** get position weights * * @param len number of position weights will be stored here * @return position weights */ inline float64_t *get_position_weights(int32_t& len) { len=seq_length; return position_weights; } /** set shifts * * @param shifts new shifts * @param len number of shifts */ bool set_shifts(int32_t* shifts, int32_t len); /** set weights * * @param new_weights new weights */ bool set_weights(SGMatrix<float64_t> new_weights); /** set wd weights * * @return if setting was successful */ virtual bool set_wd_weights(); /** set position weights * * @param pws new position weights * @param len number of position weights * @return if setting was successful */ virtual bool set_position_weights(float64_t* pws, int32_t len); /** set position weights for left-hand side * * @param pws new position weights * @param len len * @param num num * @return if setting was successful */ bool set_position_weights_lhs(float64_t* pws, int32_t len, int32_t num); /** set position weights for right-hand side * * @param pws new position weights * @param len len * @param num num * @return if setting was successful */ bool set_position_weights_rhs(float64_t* pws, int32_t len, int32_t num); /** initialize block weights * * @return if initialization was successful */ bool init_block_weights(); /** initialize block weights from weighted degree * * @return if initialization was successful */ bool init_block_weights_from_wd(); /** initialize block weights from external weighted degree * * @return if initialization was successful */ bool init_block_weights_from_wd_external(); /** initialize block weights constant * * @return if initialization was successful */ bool init_block_weights_const(); /** initialize block weights linear * * @return if initialization was successful */ bool init_block_weights_linear(); /** initialize block weights squared polynomial * * @return if initialization was successful */ bool init_block_weights_sqpoly(); /** initialize block weights cubic polynomial * * @return if initialization was successful */ bool init_block_weights_cubicpoly(); /** initialize block weights exponential * * @return if initialization was successful */ bool init_block_weights_exp(); /** initialize block weights logarithmic * * @return if initialization was successful */ bool init_block_weights_log(); /** delete position weights * * @return if deleting was successful */ bool delete_position_weights() { delete[] position_weights; position_weights=NULL; return true; } /** delete position weights left-hand side * * @return if deleting was successful */ bool delete_position_weights_lhs() { delete[] position_weights_lhs; position_weights_lhs=NULL; return true; } /** delete position weights right-hand side * * @return if deleting was successful */ bool delete_position_weights_rhs() { delete[] position_weights_rhs; position_weights_rhs=NULL; return true; } /** compute by tree * * @param idx index * @return computed value */ virtual float64_t compute_by_tree(int32_t idx); /** compute by tree * * @param idx index * @param LevelContrib level contribution */ virtual void compute_by_tree(int32_t idx, float64_t* LevelContrib); /** compute positional scoring function, which assigns a * weight per position, per symbol in the sequence * * @param max_degree maximum degree * @param num_feat number of features * @param num_sym number of symbols * @param target target * @param num_suppvec number of support vectors * @param IDX IDX * @param weights weights * @return computed scores */ float64_t* compute_scoring( int32_t max_degree, int32_t& num_feat, int32_t& num_sym, float64_t* target, int32_t num_suppvec, int32_t* IDX, float64_t* weights); /** compute consensus string * * @param num_feat number of features * @param num_suppvec number of support vectors * @param IDX IDX * @param alphas alphas * @return consensus string */ char* compute_consensus( int32_t &num_feat, int32_t num_suppvec, int32_t* IDX, float64_t* alphas); /** extract w * * @param max_degree maximum degree * @param num_feat number of features * @param num_sym number of symbols * @param w_result w * @param num_suppvec number of support vectors * @param IDX IDX * @param alphas alphas * @return w */ float64_t* extract_w( int32_t max_degree, int32_t& num_feat, int32_t& num_sym, float64_t* w_result, int32_t num_suppvec, int32_t* IDX, float64_t* alphas); /** compute POIM * * @param max_degree maximum degree * @param num_feat number of features * @param num_sym number of symbols * @param poim_result poim * @param num_suppvec number of support vectors * @param IDX IDX * @param alphas alphas * @param distrib distribution * @return computed POIMs */ float64_t* compute_POIM( int32_t max_degree, int32_t& num_feat, int32_t& num_sym, float64_t* poim_result, int32_t num_suppvec, int32_t* IDX, float64_t* alphas, float64_t* distrib); /** prepare POIM2 * * @param num_feat number of features * @param num_sym number of symbols * @param distrib distribution */ void prepare_POIM2( float64_t* distrib, int32_t num_sym, int32_t num_feat); /** compute POIM2 * * @param max_degree maximum degree * @param svm SVM */ void compute_POIM2(int32_t max_degree, CSVM* svm); /** get POIM2 * * @param poim POIMs (returned) * @param result_len (returned) */ void get_POIM2(float64_t** poim, int32_t* result_len); /// cleanup POIM2 void cleanup_POIM2(); protected: /** create emtpy tries */ void create_empty_tries(); /** add example to tree * * @param idx index * @param weight weight */ virtual void add_example_to_tree( int32_t idx, float64_t weight); /** add example to single tree * * @param idx index * @param weight weight * @param tree_num which tree */ void add_example_to_single_tree( int32_t idx, float64_t weight, int32_t tree_num); /** compute kernel function for features a and b * idx_{a,b} denote the index of the feature vectors * in the corresponding feature object * * @param idx_a index a * @param idx_b index b * @return computed kernel function at indices a,b */ virtual float64_t compute(int32_t idx_a, int32_t idx_b); /** compute with mismatch * * @param avec vector a * @param alen length of vector a * @param bvec vector b * @param blen length of vector b * @return computed value */ float64_t compute_with_mismatch( char* avec, int32_t alen, char* bvec, int32_t blen); /** compute without mismatch * * @param avec vector a * @param alen length of vector a * @param bvec vector b * @param blen length of vector b * @return computed value */ float64_t compute_without_mismatch( char* avec, int32_t alen, char* bvec, int32_t blen); /** compute without mismatch matrix * * @param avec vector a * @param alen length of vector a * @param bvec vector b * @param blen length of vector b * @return computed value */ float64_t compute_without_mismatch_matrix( char* avec, int32_t alen, char* bvec, int32_t blen); /** compute without mismatch position weights * * @param avec vector a * @param posweights_lhs position weights left-hand side * @param alen length of vector a * @param bvec vector b * @param posweights_rhs position weights right-hand side * @param blen length of vector b * @return computed value */ float64_t compute_without_mismatch_position_weights( char* avec, float64_t *posweights_lhs, int32_t alen, char* bvec, float64_t *posweights_rhs, int32_t blen); /** remove lhs from kernel */ virtual void remove_lhs(); /** Can (optionally) be overridden to post-initialize some * member variables which are not PARAMETER::ADD'ed. Make * sure that at first the overridden method * BASE_CLASS::LOAD_SERIALIZABLE_POST is called. * * @exception ShogunException Will be thrown if an error * occurres. */ virtual void load_serializable_post(void) throw (ShogunException); private: /** Do basic initialisations like default settings * and registering parameters */ void init(); protected: /** weights */ float64_t* weights; /** degree */ int32_t weights_degree; /** length */ int32_t weights_length; /** position weights */ float64_t* position_weights; /** position weights len */ int32_t position_weights_len; /** position weights left-hand side */ float64_t* position_weights_lhs; /** position weights len */ int32_t position_weights_lhs_len; /** position weights right-hand side */ float64_t* position_weights_rhs; /** position weights len */ int32_t position_weights_rhs_len; /** position mask */ bool* position_mask; /** weights buffer */ float64_t* weights_buffer; /** MKL stepsize */ int32_t mkl_stepsize; /** degree */ int32_t degree; /** length */ int32_t length; /** maximum mismatch */ int32_t max_mismatch; /** length of sequence */ int32_t seq_length; /** shifts */ int32_t *shift; /** length of shifts */ int32_t shift_len; /** maximum shift */ int32_t max_shift; /** if block computation is used */ bool block_computation; /** (internal) block weights */ float64_t* block_weights; /** WeightedDegree kernel type */ EWDKernType type; /** which degree */ int32_t which_degree; /** tries */ CTrie<DNATrie> tries; /** POIM tries */ CTrie<POIMTrie> poim_tries; /** if tree is initialized */ bool tree_initialized; /** makes add_example_to_tree (ONLY!) use POIMTrie */ bool use_poim_tries; /** temporary memory for the interface to the poim functions */ float64_t* m_poim_distrib; /** temporary memory for the interface to the poim functions */ float64_t* m_poim; /** number of symbols */ int32_t m_poim_num_sym; /** length of string (==num_feat) */ int32_t m_poim_num_feat; /** total size of poim array */ int32_t m_poim_result_len; /** alphabet of features */ CAlphabet* alphabet; }; } #endif /* _WEIGHTEDDEGREEPOSITIONSTRINGKERNEL_H__ */
[ "slianoglou@gmail.com" ]
slianoglou@gmail.com
92ab8d874e2651117c4676691d2142d0f9b8430f
0b49c35daabd069e966d97e647794508b09535bd
/1-3.cpp
ff278d1701664fe029cd7c1cd02a1e9b004bb836
[]
no_license
willbw/ctci
48d182104c69e49b69ad42a57728ad6292f35a19
a8dc256a6d3a6ed05004f0917d50aedbfeb78319
refs/heads/master
2020-03-27T06:52:02.642000
2018-08-26T11:51:42
2018-08-26T11:51:42
146,141,033
0
0
null
null
null
null
UTF-8
C++
false
false
1,527
cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; void urlify(string& s) { for (auto it = s.begin(); it != s.end(); it++) { // If we encounter a space, we know that in the problem definition there are // enough spaces at the end of the string for a urlified string // // So, we can reverse the remainder of the string, change three characters to be "%20" // and then reverse the string back after that. if (*it == ' ') { auto it_2 = it; reverse(next(it), s.end()); *it_2 = '%'; advance(it_2, 1); *it_2 = '2'; advance(it_2, 1); *it_2 = '0'; reverse(next(it_2), s.end()); } } } // Textbook implementation void urlify_alt(string& s) { int space_count = 0; string::iterator last_non_space; for (auto it = s.begin(); it != s.end(); it++) { if (*it == ' ') space_count++; else last_non_space = it; } string::iterator back = s.end(); for (auto it = last_non_space; it != prev(s.begin()); it--) { if (*it == ' ') { advance(back, -1); *back = '0'; advance(back, -1); *back = '2'; advance(back, -1); *back = '%'; } else { advance(back, -1); *back = *it; } } } int main() { string s; cout << "Enter a string: "; getline(cin, s); string s_copy = s; // My implementation urlify(s); cout << s << endl; // Test textbook implementation cout << s_copy << endl;; urlify_alt(s_copy); cout << s_copy << endl; }
[ "willwright90@gmail.com" ]
willwright90@gmail.com
917d178bd1b75fba030e0e29445db1989c3f1f23
85c0bb984fed23cdfde5b0fe5b7b2ae04a50b173
/code/背包.cc
2df0aca23d26cfbd34eb1c445e006b80c7b2414c
[]
no_license
NTU-ACM/ntu_acm
c4d8acf1692af7c44bb24652d5207c65d4d7a15c
cf0ec9617153d9054cb9c29c83737de605a25c27
refs/heads/master
2021-06-07T20:07:19.616468
2021-04-26T01:51:42
2021-04-26T01:51:42
134,153,463
1
2
null
2018-05-20T13:34:01
2018-05-20T13:34:01
null
UTF-8
C++
false
false
532
cc
const int maxn = 100005; int w[maxn], v[maxn], num[maxn]; int W, n; int dp[maxn]; void ZOP(int weight, int value) { for(int i = W; i >= weight; i--) { dp[i]=std::max(dp[i],dp[i-weight]+value); } } void CP(int weight, int value){ for(int i = weight; i <= W; i++) { dp[i] = std::max(dp[i], dp[i-weight]+value); } } void MP(int weight, int value, int cnt){ if(weight*cnt >= W) { CP(weight, value); } else { for(int k = 1; k < cnt; k <<= 1) { ZOP(k*weight, k*value), cnt -= k; } ZOP(cnt*weight, cnt*value); } }
[ "ntlihy@gmail.com" ]
ntlihy@gmail.com
340c751ce78c148fba8a4d99eb12c671b28a426d
ea8b796e86e07749e6a5569de760314bef28d6c8
/src/PolynomialMultiplier.h
98da24500465c16cd8b8177b9cf14fc84c5aac85
[]
no_license
hilder-vitor/FHEZ
b6c2feb68330ce7fe599c100e7879b52df1ac306
881e026554fc18e5ac2c1631309e2f2c802cb018
refs/heads/main
2023-03-02T01:38:59.121737
2021-02-07T22:05:30
2021-02-07T22:05:30
336,878,540
1
1
null
null
null
null
UTF-8
C++
false
false
2,572
h
#ifndef __PolynomialMultiplier__ #define __PolynomialMultiplier__ #include <NTL/ZZ.h> #include <NTL/ZZX.h> #include <NTL/vec_ZZ.h> #include "NTT.h" #include "utils.h" #include <vector> #define PrecomputedVecNTT std::vector< NTL::vec_ZZ > /** * Let R := Z[x] / <x^N+1>, with N being a power of two. * This class is used to perform efficient inner products of vectors * over R. * * It uses the class NTT two perform efficient negacyclic convolutions, * which are equivalent to multiplication of polynomials of R. **/ class PolynomialMultiplier { public: NTT* ntt; long int d; // dimension of vectors that will be multiplied NTL::ZZ psi; // primitive 2N-th root of unity on Z/pZ (order(psi) = 2N in Z/pZ) NTL::ZZ inv_psi; // psi^-1 in Z/pZ NTL::vec_ZZ powers_psi; // precomputed psi^i % p for 0 <= i < N NTL::vec_ZZ powers_inv_psi; // precomputed psi^-i % p for 0 <= i < N // auxiliary vectors used to store a polynomial with the result and one // of the operands during the computation of the inner products. NTL::vec_ZZ vres; NTL::vec_ZZ vai; /** * logN is the logarithm of N in base 2 * d is the dimension of the vectors that will be multiplied * b0 is a bound to the log infinity norm of one of the vectors * b1 is a bound to the log infinity norm of the other vector */ PolynomialMultiplier(int logN, int d, int b0, int b1); ~PolynomialMultiplier(); /** * Let N be the dimension of the NTT, sigma the bit reverse order * permutaion precomputed in NTT, and o be the entrywise vector product modulo p. * This function copies a to an N-dimensional vector u, and returns * sigma(u o powers). */ NTL::vec_ZZ apply_bit_reverse_and_powers_to_poly( const NTL::ZZX& a, const NTL::vec_ZZ& powers); /** Precompute the weighted NTT of a (multiplied by powers of psi) to speedup * future products by a. */ NTL::vec_ZZ precompute_NTT(const NTL::ZZX& a); /** Precompute the weighted NTT of all entries of v to speedup future * products by v. */ PrecomputedVecNTT precompute_NTT(const std::vector<NTL::ZZX >& v); /** * Receives a polynomial a and a precomputed NTT of a polynomial b * and returns a polynomial equal to a*b mod x^N+1. */ NTL::ZZX multiply(const NTL::ZZX& a, const NTL::vec_ZZ& vb); /** * Receives a vector of polynomials va and * vector of precomputed NTTs and returns a polynomial equal * to inner product modulo x^N+1. */ NTL::ZZX multiply(const std::vector<NTL::ZZX>& va, const PrecomputedVecNTT& vb); }; #endif
[ "hilder.vitor@gmail.com" ]
hilder.vitor@gmail.com
ccbcb3b48b027c6ed4981f9831bfafcf55b39273
de0afb62b57bc0034face95d4d25b090e6696206
/Temp/il2cppOutput/il2cppOutput/Bulk_UnityEngine.UnityWebRequestWWWModule_0.cpp
c8e4eebd8bece6111ef7cbbf8fe64fb5dec3557b
[]
no_license
Danoishere/Roost-XEE-Locate
daf8d7c13c656e323cb44b2a51202ce9fabf89f1
f665fc82f24915ad5a01b30cec789e3e773159b3
refs/heads/master
2020-03-28T19:25:08.524692
2018-10-18T18:21:31
2018-10-18T18:21:31
148,974,452
0
0
null
null
null
null
UTF-8
C++
false
false
22,044
cpp
#include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <cstring> #include <string.h> #include <stdio.h> #include <cmath> #include <limits> #include <assert.h> #include <stdint.h> #include "il2cpp-class-internals.h" #include "codegen/il2cpp-codegen.h" #include "il2cpp-object-internals.h" // System.String struct String_t; // System.Uri struct Uri_t100236324; // System.Void struct Void_t1185182177; // UnityEngine.Networking.CertificateHandler struct CertificateHandler_t2739891000; // UnityEngine.Networking.DownloadHandler struct DownloadHandler_t2937767557; // UnityEngine.Networking.UnityWebRequest struct UnityWebRequest_t463507806; // UnityEngine.Networking.UploadHandler struct UploadHandler_t2993558019; // UnityEngine.WWW struct WWW_t3688466362; struct CertificateHandler_t2739891000_marshaled_com; struct DownloadHandler_t2937767557_marshaled_com; struct UploadHandler_t2993558019_marshaled_com; #ifndef U3CMODULEU3E_T692745544_H #define U3CMODULEU3E_T692745544_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // <Module> struct U3CModuleU3E_t692745544 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // U3CMODULEU3E_T692745544_H #ifndef RUNTIMEOBJECT_H #define RUNTIMEOBJECT_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Object #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // RUNTIMEOBJECT_H struct Il2CppArrayBounds; #ifndef RUNTIMEARRAY_H #define RUNTIMEARRAY_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Array #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // RUNTIMEARRAY_H #ifndef VALUETYPE_T3640485471_H #define VALUETYPE_T3640485471_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.ValueType struct ValueType_t3640485471 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of System.ValueType struct ValueType_t3640485471_marshaled_pinvoke { }; // Native definition for COM marshalling of System.ValueType struct ValueType_t3640485471_marshaled_com { }; #endif // VALUETYPE_T3640485471_H #ifndef CUSTOMYIELDINSTRUCTION_T1895667560_H #define CUSTOMYIELDINSTRUCTION_T1895667560_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.CustomYieldInstruction struct CustomYieldInstruction_t1895667560 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CUSTOMYIELDINSTRUCTION_T1895667560_H #ifndef BOOLEAN_T97287965_H #define BOOLEAN_T97287965_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Boolean struct Boolean_t97287965 { public: // System.Boolean System.Boolean::m_value bool ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Boolean_t97287965, ___m_value_0)); } inline bool get_m_value_0() const { return ___m_value_0; } inline bool* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(bool value) { ___m_value_0 = value; } }; struct Boolean_t97287965_StaticFields { public: // System.String System.Boolean::TrueString String_t* ___TrueString_5; // System.String System.Boolean::FalseString String_t* ___FalseString_6; public: inline static int32_t get_offset_of_TrueString_5() { return static_cast<int32_t>(offsetof(Boolean_t97287965_StaticFields, ___TrueString_5)); } inline String_t* get_TrueString_5() const { return ___TrueString_5; } inline String_t** get_address_of_TrueString_5() { return &___TrueString_5; } inline void set_TrueString_5(String_t* value) { ___TrueString_5 = value; Il2CppCodeGenWriteBarrier((&___TrueString_5), value); } inline static int32_t get_offset_of_FalseString_6() { return static_cast<int32_t>(offsetof(Boolean_t97287965_StaticFields, ___FalseString_6)); } inline String_t* get_FalseString_6() const { return ___FalseString_6; } inline String_t** get_address_of_FalseString_6() { return &___FalseString_6; } inline void set_FalseString_6(String_t* value) { ___FalseString_6 = value; Il2CppCodeGenWriteBarrier((&___FalseString_6), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // BOOLEAN_T97287965_H #ifndef INTPTR_T_H #define INTPTR_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.IntPtr struct IntPtr_t { public: // System.Void* System.IntPtr::m_value void* ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(IntPtr_t, ___m_value_0)); } inline void* get_m_value_0() const { return ___m_value_0; } inline void** get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(void* value) { ___m_value_0 = value; } }; struct IntPtr_t_StaticFields { public: // System.IntPtr System.IntPtr::Zero intptr_t ___Zero_1; public: inline static int32_t get_offset_of_Zero_1() { return static_cast<int32_t>(offsetof(IntPtr_t_StaticFields, ___Zero_1)); } inline intptr_t get_Zero_1() const { return ___Zero_1; } inline intptr_t* get_address_of_Zero_1() { return &___Zero_1; } inline void set_Zero_1(intptr_t value) { ___Zero_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INTPTR_T_H #ifndef SINGLE_T1397266774_H #define SINGLE_T1397266774_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Single struct Single_t1397266774 { public: // System.Single System.Single::m_value float ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Single_t1397266774, ___m_value_0)); } inline float get_m_value_0() const { return ___m_value_0; } inline float* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(float value) { ___m_value_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SINGLE_T1397266774_H #ifndef VOID_T1185182177_H #define VOID_T1185182177_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void struct Void_t1185182177 { public: union { struct { }; uint8_t Void_t1185182177__padding[1]; }; public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VOID_T1185182177_H #ifndef WWW_T3688466362_H #define WWW_T3688466362_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.WWW struct WWW_t3688466362 : public CustomYieldInstruction_t1895667560 { public: // UnityEngine.Networking.UnityWebRequest UnityEngine.WWW::_uwr UnityWebRequest_t463507806 * ____uwr_0; public: inline static int32_t get_offset_of__uwr_0() { return static_cast<int32_t>(offsetof(WWW_t3688466362, ____uwr_0)); } inline UnityWebRequest_t463507806 * get__uwr_0() const { return ____uwr_0; } inline UnityWebRequest_t463507806 ** get_address_of__uwr_0() { return &____uwr_0; } inline void set__uwr_0(UnityWebRequest_t463507806 * value) { ____uwr_0 = value; Il2CppCodeGenWriteBarrier((&____uwr_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // WWW_T3688466362_H #ifndef CERTIFICATEHANDLER_T2739891000_H #define CERTIFICATEHANDLER_T2739891000_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.Networking.CertificateHandler struct CertificateHandler_t2739891000 : public RuntimeObject { public: // System.IntPtr UnityEngine.Networking.CertificateHandler::m_Ptr intptr_t ___m_Ptr_0; public: inline static int32_t get_offset_of_m_Ptr_0() { return static_cast<int32_t>(offsetof(CertificateHandler_t2739891000, ___m_Ptr_0)); } inline intptr_t get_m_Ptr_0() const { return ___m_Ptr_0; } inline intptr_t* get_address_of_m_Ptr_0() { return &___m_Ptr_0; } inline void set_m_Ptr_0(intptr_t value) { ___m_Ptr_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of UnityEngine.Networking.CertificateHandler struct CertificateHandler_t2739891000_marshaled_pinvoke { intptr_t ___m_Ptr_0; }; // Native definition for COM marshalling of UnityEngine.Networking.CertificateHandler struct CertificateHandler_t2739891000_marshaled_com { intptr_t ___m_Ptr_0; }; #endif // CERTIFICATEHANDLER_T2739891000_H #ifndef DOWNLOADHANDLER_T2937767557_H #define DOWNLOADHANDLER_T2937767557_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.Networking.DownloadHandler struct DownloadHandler_t2937767557 : public RuntimeObject { public: // System.IntPtr UnityEngine.Networking.DownloadHandler::m_Ptr intptr_t ___m_Ptr_0; public: inline static int32_t get_offset_of_m_Ptr_0() { return static_cast<int32_t>(offsetof(DownloadHandler_t2937767557, ___m_Ptr_0)); } inline intptr_t get_m_Ptr_0() const { return ___m_Ptr_0; } inline intptr_t* get_address_of_m_Ptr_0() { return &___m_Ptr_0; } inline void set_m_Ptr_0(intptr_t value) { ___m_Ptr_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of UnityEngine.Networking.DownloadHandler struct DownloadHandler_t2937767557_marshaled_pinvoke { intptr_t ___m_Ptr_0; }; // Native definition for COM marshalling of UnityEngine.Networking.DownloadHandler struct DownloadHandler_t2937767557_marshaled_com { intptr_t ___m_Ptr_0; }; #endif // DOWNLOADHANDLER_T2937767557_H #ifndef UPLOADHANDLER_T2993558019_H #define UPLOADHANDLER_T2993558019_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.Networking.UploadHandler struct UploadHandler_t2993558019 : public RuntimeObject { public: // System.IntPtr UnityEngine.Networking.UploadHandler::m_Ptr intptr_t ___m_Ptr_0; public: inline static int32_t get_offset_of_m_Ptr_0() { return static_cast<int32_t>(offsetof(UploadHandler_t2993558019, ___m_Ptr_0)); } inline intptr_t get_m_Ptr_0() const { return ___m_Ptr_0; } inline intptr_t* get_address_of_m_Ptr_0() { return &___m_Ptr_0; } inline void set_m_Ptr_0(intptr_t value) { ___m_Ptr_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of UnityEngine.Networking.UploadHandler struct UploadHandler_t2993558019_marshaled_pinvoke { intptr_t ___m_Ptr_0; }; // Native definition for COM marshalling of UnityEngine.Networking.UploadHandler struct UploadHandler_t2993558019_marshaled_com { intptr_t ___m_Ptr_0; }; #endif // UPLOADHANDLER_T2993558019_H #ifndef UNITYWEBREQUEST_T463507806_H #define UNITYWEBREQUEST_T463507806_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.Networking.UnityWebRequest struct UnityWebRequest_t463507806 : public RuntimeObject { public: // System.IntPtr UnityEngine.Networking.UnityWebRequest::m_Ptr intptr_t ___m_Ptr_0; // UnityEngine.Networking.DownloadHandler UnityEngine.Networking.UnityWebRequest::m_DownloadHandler DownloadHandler_t2937767557 * ___m_DownloadHandler_1; // UnityEngine.Networking.UploadHandler UnityEngine.Networking.UnityWebRequest::m_UploadHandler UploadHandler_t2993558019 * ___m_UploadHandler_2; // UnityEngine.Networking.CertificateHandler UnityEngine.Networking.UnityWebRequest::m_CertificateHandler CertificateHandler_t2739891000 * ___m_CertificateHandler_3; // System.Uri UnityEngine.Networking.UnityWebRequest::m_Uri Uri_t100236324 * ___m_Uri_4; // System.Boolean UnityEngine.Networking.UnityWebRequest::<disposeCertificateHandlerOnDispose>k__BackingField bool ___U3CdisposeCertificateHandlerOnDisposeU3Ek__BackingField_5; // System.Boolean UnityEngine.Networking.UnityWebRequest::<disposeDownloadHandlerOnDispose>k__BackingField bool ___U3CdisposeDownloadHandlerOnDisposeU3Ek__BackingField_6; // System.Boolean UnityEngine.Networking.UnityWebRequest::<disposeUploadHandlerOnDispose>k__BackingField bool ___U3CdisposeUploadHandlerOnDisposeU3Ek__BackingField_7; public: inline static int32_t get_offset_of_m_Ptr_0() { return static_cast<int32_t>(offsetof(UnityWebRequest_t463507806, ___m_Ptr_0)); } inline intptr_t get_m_Ptr_0() const { return ___m_Ptr_0; } inline intptr_t* get_address_of_m_Ptr_0() { return &___m_Ptr_0; } inline void set_m_Ptr_0(intptr_t value) { ___m_Ptr_0 = value; } inline static int32_t get_offset_of_m_DownloadHandler_1() { return static_cast<int32_t>(offsetof(UnityWebRequest_t463507806, ___m_DownloadHandler_1)); } inline DownloadHandler_t2937767557 * get_m_DownloadHandler_1() const { return ___m_DownloadHandler_1; } inline DownloadHandler_t2937767557 ** get_address_of_m_DownloadHandler_1() { return &___m_DownloadHandler_1; } inline void set_m_DownloadHandler_1(DownloadHandler_t2937767557 * value) { ___m_DownloadHandler_1 = value; Il2CppCodeGenWriteBarrier((&___m_DownloadHandler_1), value); } inline static int32_t get_offset_of_m_UploadHandler_2() { return static_cast<int32_t>(offsetof(UnityWebRequest_t463507806, ___m_UploadHandler_2)); } inline UploadHandler_t2993558019 * get_m_UploadHandler_2() const { return ___m_UploadHandler_2; } inline UploadHandler_t2993558019 ** get_address_of_m_UploadHandler_2() { return &___m_UploadHandler_2; } inline void set_m_UploadHandler_2(UploadHandler_t2993558019 * value) { ___m_UploadHandler_2 = value; Il2CppCodeGenWriteBarrier((&___m_UploadHandler_2), value); } inline static int32_t get_offset_of_m_CertificateHandler_3() { return static_cast<int32_t>(offsetof(UnityWebRequest_t463507806, ___m_CertificateHandler_3)); } inline CertificateHandler_t2739891000 * get_m_CertificateHandler_3() const { return ___m_CertificateHandler_3; } inline CertificateHandler_t2739891000 ** get_address_of_m_CertificateHandler_3() { return &___m_CertificateHandler_3; } inline void set_m_CertificateHandler_3(CertificateHandler_t2739891000 * value) { ___m_CertificateHandler_3 = value; Il2CppCodeGenWriteBarrier((&___m_CertificateHandler_3), value); } inline static int32_t get_offset_of_m_Uri_4() { return static_cast<int32_t>(offsetof(UnityWebRequest_t463507806, ___m_Uri_4)); } inline Uri_t100236324 * get_m_Uri_4() const { return ___m_Uri_4; } inline Uri_t100236324 ** get_address_of_m_Uri_4() { return &___m_Uri_4; } inline void set_m_Uri_4(Uri_t100236324 * value) { ___m_Uri_4 = value; Il2CppCodeGenWriteBarrier((&___m_Uri_4), value); } inline static int32_t get_offset_of_U3CdisposeCertificateHandlerOnDisposeU3Ek__BackingField_5() { return static_cast<int32_t>(offsetof(UnityWebRequest_t463507806, ___U3CdisposeCertificateHandlerOnDisposeU3Ek__BackingField_5)); } inline bool get_U3CdisposeCertificateHandlerOnDisposeU3Ek__BackingField_5() const { return ___U3CdisposeCertificateHandlerOnDisposeU3Ek__BackingField_5; } inline bool* get_address_of_U3CdisposeCertificateHandlerOnDisposeU3Ek__BackingField_5() { return &___U3CdisposeCertificateHandlerOnDisposeU3Ek__BackingField_5; } inline void set_U3CdisposeCertificateHandlerOnDisposeU3Ek__BackingField_5(bool value) { ___U3CdisposeCertificateHandlerOnDisposeU3Ek__BackingField_5 = value; } inline static int32_t get_offset_of_U3CdisposeDownloadHandlerOnDisposeU3Ek__BackingField_6() { return static_cast<int32_t>(offsetof(UnityWebRequest_t463507806, ___U3CdisposeDownloadHandlerOnDisposeU3Ek__BackingField_6)); } inline bool get_U3CdisposeDownloadHandlerOnDisposeU3Ek__BackingField_6() const { return ___U3CdisposeDownloadHandlerOnDisposeU3Ek__BackingField_6; } inline bool* get_address_of_U3CdisposeDownloadHandlerOnDisposeU3Ek__BackingField_6() { return &___U3CdisposeDownloadHandlerOnDisposeU3Ek__BackingField_6; } inline void set_U3CdisposeDownloadHandlerOnDisposeU3Ek__BackingField_6(bool value) { ___U3CdisposeDownloadHandlerOnDisposeU3Ek__BackingField_6 = value; } inline static int32_t get_offset_of_U3CdisposeUploadHandlerOnDisposeU3Ek__BackingField_7() { return static_cast<int32_t>(offsetof(UnityWebRequest_t463507806, ___U3CdisposeUploadHandlerOnDisposeU3Ek__BackingField_7)); } inline bool get_U3CdisposeUploadHandlerOnDisposeU3Ek__BackingField_7() const { return ___U3CdisposeUploadHandlerOnDisposeU3Ek__BackingField_7; } inline bool* get_address_of_U3CdisposeUploadHandlerOnDisposeU3Ek__BackingField_7() { return &___U3CdisposeUploadHandlerOnDisposeU3Ek__BackingField_7; } inline void set_U3CdisposeUploadHandlerOnDisposeU3Ek__BackingField_7(bool value) { ___U3CdisposeUploadHandlerOnDisposeU3Ek__BackingField_7 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of UnityEngine.Networking.UnityWebRequest struct UnityWebRequest_t463507806_marshaled_pinvoke { intptr_t ___m_Ptr_0; DownloadHandler_t2937767557_marshaled_pinvoke ___m_DownloadHandler_1; UploadHandler_t2993558019_marshaled_pinvoke ___m_UploadHandler_2; CertificateHandler_t2739891000_marshaled_pinvoke ___m_CertificateHandler_3; Uri_t100236324 * ___m_Uri_4; int32_t ___U3CdisposeCertificateHandlerOnDisposeU3Ek__BackingField_5; int32_t ___U3CdisposeDownloadHandlerOnDisposeU3Ek__BackingField_6; int32_t ___U3CdisposeUploadHandlerOnDisposeU3Ek__BackingField_7; }; // Native definition for COM marshalling of UnityEngine.Networking.UnityWebRequest struct UnityWebRequest_t463507806_marshaled_com { intptr_t ___m_Ptr_0; DownloadHandler_t2937767557_marshaled_com* ___m_DownloadHandler_1; UploadHandler_t2993558019_marshaled_com* ___m_UploadHandler_2; CertificateHandler_t2739891000_marshaled_com* ___m_CertificateHandler_3; Uri_t100236324 * ___m_Uri_4; int32_t ___U3CdisposeCertificateHandlerOnDisposeU3Ek__BackingField_5; int32_t ___U3CdisposeDownloadHandlerOnDisposeU3Ek__BackingField_6; int32_t ___U3CdisposeUploadHandlerOnDisposeU3Ek__BackingField_7; }; #endif // UNITYWEBREQUEST_T463507806_H // System.Boolean UnityEngine.Networking.UnityWebRequest::get_isDone() extern "C" IL2CPP_METHOD_ATTR bool UnityWebRequest_get_isDone_m1752128881 (UnityWebRequest_t463507806 * __this, const RuntimeMethod* method); // System.Single UnityEngine.Networking.UnityWebRequest::get_downloadProgress() extern "C" IL2CPP_METHOD_ATTR float UnityWebRequest_get_downloadProgress_m338301737 (UnityWebRequest_t463507806 * __this, const RuntimeMethod* method); // System.Void UnityEngine.Networking.UnityWebRequest::Dispose() extern "C" IL2CPP_METHOD_ATTR void UnityWebRequest_Dispose_m3261105905 (UnityWebRequest_t463507806 * __this, const RuntimeMethod* method); #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Boolean UnityEngine.WWW::get_isDone() extern "C" IL2CPP_METHOD_ATTR bool WWW_get_isDone_m3426350689 (WWW_t3688466362 * __this, const RuntimeMethod* method) { bool V_0 = false; { UnityWebRequest_t463507806 * L_0 = __this->get__uwr_0(); NullCheck(L_0); bool L_1 = UnityWebRequest_get_isDone_m1752128881(L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_0012; } IL_0012: { bool L_2 = V_0; return L_2; } } // System.Single UnityEngine.WWW::get_progress() extern "C" IL2CPP_METHOD_ATTR float WWW_get_progress_m841454562 (WWW_t3688466362 * __this, const RuntimeMethod* method) { float V_0 = 0.0f; float V_1 = 0.0f; { UnityWebRequest_t463507806 * L_0 = __this->get__uwr_0(); NullCheck(L_0); float L_1 = UnityWebRequest_get_downloadProgress_m338301737(L_0, /*hidden argument*/NULL); V_0 = L_1; float L_2 = V_0; if ((!(((float)L_2) < ((float)(0.0f))))) { goto IL_001e; } } { V_0 = (0.0f); } IL_001e: { float L_3 = V_0; V_1 = L_3; goto IL_0025; } IL_0025: { float L_4 = V_1; return L_4; } } // System.Boolean UnityEngine.WWW::get_keepWaiting() extern "C" IL2CPP_METHOD_ATTR bool WWW_get_keepWaiting_m1438015190 (WWW_t3688466362 * __this, const RuntimeMethod* method) { bool V_0 = false; { UnityWebRequest_t463507806 * L_0 = __this->get__uwr_0(); NullCheck(L_0); bool L_1 = UnityWebRequest_get_isDone_m1752128881(L_0, /*hidden argument*/NULL); V_0 = (bool)((((int32_t)L_1) == ((int32_t)0))? 1 : 0); goto IL_0015; } IL_0015: { bool L_2 = V_0; return L_2; } } // System.Void UnityEngine.WWW::Dispose() extern "C" IL2CPP_METHOD_ATTR void WWW_Dispose_m2256148703 (WWW_t3688466362 * __this, const RuntimeMethod* method) { { UnityWebRequest_t463507806 * L_0 = __this->get__uwr_0(); NullCheck(L_0); UnityWebRequest_Dispose_m3261105905(L_0, /*hidden argument*/NULL); return; } } #ifdef __clang__ #pragma clang diagnostic pop #endif
[ "dano.roesti@gmail.com" ]
dano.roesti@gmail.com
ae442991b9df58f1a741e5c4b7cc2c1f7e89c357
a118050acadc63f18271fe3fa6d235a380b65c48
/TemplateMakers/interface/GenericVariable.h
a18f8c4225d255299a2e8a6085a36978fca236af
[]
no_license
cms-ttH/ttHMultileptonAnalysis
2c84207f690fca534feb1c1de71ae28d72b2d21f
4633cea1d9ebe51c8c1bbb637f0488745c10ce85
refs/heads/master
2020-04-08T19:14:58.230679
2015-07-31T17:36:15
2015-07-31T17:36:15
11,932,480
1
1
null
null
null
null
UTF-8
C++
false
false
1,464
h
#ifndef _GenericVariable_h #define _GenericVariable_h #include <functional> #include "ttHMultileptonAnalysis/TemplateMakers/interface/KinematicVariable.h" #include "ttHMultileptonAnalysis/TemplateMakers/interface/BranchInfo.h" template <class branchDataType, class collectionType, typename functionType> class GenericVariable: public KinematicVariable<branchDataType> { public: GenericVariable(collectionType **_collection, string&& branchName, branchDataType&& resVal, functionType _function); void evaluate(); collectionType ** collection; string branchName; branchDataType branchValue; functionType valueFunction; }; template<class branchDataType, class collectionType, typename functionType> GenericVariable<branchDataType, collectionType, functionType>::GenericVariable(collectionType **_collection, string&& _branchName, branchDataType&& resVal, functionType _function): collection(_collection), branchName(_branchName), valueFunction(_function) { this->resetVal = resVal; this->branches[branchName] = BranchInfo<branchDataType>(branchName); this->branches[branchName].branchVal = this->resetVal; this->reset(); } template<class branchDataType, class collectionType, typename functionType> void GenericVariable<branchDataType, collectionType, functionType>::evaluate() { if (this->evaluatedThisEvent) return; this->evaluatedThisEvent = true; this->branches[branchName].branchVal = valueFunction(collection); } #endif
[ "awoodard@nd.edu" ]
awoodard@nd.edu
aa24f8c9a60bd98f597b25353d3dab537f57b90f
28e4dc9a08c62e20ffd9d71e3c6ecaa5f1a4e785
/libraries/udp.cpp
fda237b4a4682f7af7c850e58f1359e690f647cf
[]
no_license
wangbo121/BitCopter
93dd693cab2315c85b4b7b099464f2ba27d237b5
b675348eb59074fde98d400c7ee9e8bbf664dc04
refs/heads/master
2021-09-09T16:50:35.415186
2018-03-18T09:46:18
2018-03-18T09:46:18
124,907,121
0
0
null
null
null
null
UTF-8
C++
false
false
16,359
cpp
/* * udp.c * * Created on: 2017-8-9 * Author: wangbo */ //#include "global.h" #if 1 #include<stdio.h> #include <stdint.h> #include<sys/types.h> #include<sys/stat.h> #include<sys/select.h> #include<sys/ioctl.h> #include<sys/socket.h> #include<netinet/in.h> #include<arpa/inet.h> #include<fcntl.h> #include<unistd.h> #include<signal.h> #include<pthread.h> #include<unistd.h> #include<stdio.h> #include<stdlib.h> #include<errno.h> #include<netdb.h> #include<stdarg.h> #include<string.h> #include<math.h> /*转换int或者short的字节顺序,该程序arm平台为大端模式,地面站x86架构为小端模式*/ #include <byteswap.h> #include "udp.h" //#include "global.h" uint64_t htonll(uint64_t n) { return (((uint64_t)htonl(n)) << 32) | htonl(n >> 32); } uint64_t ntohll(uint64_t n) { return (((uint64_t)ntohl(n)) << 32) | ntohl(n >> 32); } double ntoh_double(double net_double) { uint64_t host_int64; host_int64 = ntohll(*((uint64_t *) &net_double)); return *((double *) &host_int64); } double hton_double(double host_double) { uint64_t net_int64; net_int64 = htonll(*((uint64_t *) &host_double)); return *((double *) &net_int64); } float ntoh_float(float net_float) { uint32_t host_int32; host_int32 = ntohl(*((uint32_t *) &net_float)); return *((double *) &host_int32); } float hton_float(float host_float) { uint32_t net_int32; net_int32 = htonl(*((uint32_t *) &host_float)); return *((double *) &net_int32); } double htond (double x) { int * p = (int*)&x; int tmp = p[0]; p[0] = htonl(p[1]); p[1] = htonl(tmp); return x; } float htonf (float x) { int * p = (int *)&x; *p = htonl(*p); return x; } int open_socket_udp_dev(int *ptr_fd_socket, char* ip, unsigned int port) { /* * 指定了发送目标的端口为port_sendto,也就是如果要发送给服务器,必须知道服务器哪个端口是会处理我的数据 * 指定了我这个程序的接收端口,既然服务器的端口是比如6789,那么我就也把我的接收端口设置为6789呗,从而统一个数据接收和发送 * 整体来说,发送时指定对方ip地址,接收来自任意ip的数据 * 发送时不需要绑定端口,系统会自动分配,当然了其实客户端也可以固定端口发送的 * 接收时绑定端口,作为服务器肯定是固定端口接收 */ int fd_socket; struct sockaddr_in socket_udp_addr;//服务器用于发送的socket int sockaddr_size; /*设置发送目标的ip地址和发送目标的端口*/ sockaddr_size = sizeof(struct sockaddr_in); bzero((char*)&socket_udp_addr, sockaddr_size); socket_udp_addr.sin_family = AF_INET; //socket_udp_addr.sin_addr.s_addr = inet_addr(ip);//这个ip地址肯定是创建socket本机的某个ip地址,比如我的电脑就有2个网卡,2个ip地址,再加上127.0.0.1就是3个地址 inet_pton(AF_INET, ip, &socket_udp_addr.sin_addr); //udp_sendto_addr.sin_addr.s_addr = INADDR_ANY;//INADDR_ANY是任意地址 socket_udp_addr.sin_port = htons(port); // printf("port_sendto=%d\n",port); /*建立“发送”套接字*/ fd_socket = socket(AF_INET, SOCK_DGRAM, 0); if (fd_sock_send == -1) { printf("udp %s create socket failed",ip); close(fd_socket ); return 0; } else { printf("udp %s ini ok!\n",ip); } /* * 绑定端口 */ if(-1 == (bind(fd_socket,(struct sockaddr*)&socket_udp_addr,sizeof(struct sockaddr_in)))) { perror("Server Bind Failed:"); //exit(1); } else { printf("bind success\n"); *ptr_fd_socket = fd_socket; } return 0; } int send_socket_udp_data(int fd_socket, unsigned char *buf, unsigned int len, char *target_ip, unsigned int target_port) { struct sockaddr_in udp_sendto_addr;//服务器用于发送的socket int sockaddr_size; sockaddr_size = sizeof(struct sockaddr_in); bzero((char*)&udp_sendto_addr, sockaddr_size); udp_sendto_addr.sin_family = AF_INET;//这个socket的协议类型 //udp_sendto_addr.sin_addr.s_addr = inet_addr(ip_sendto); //inet_pton(AF_INET, "10.108.16.163", &udp_sendto_addr.sin_addr); inet_pton(AF_INET, target_ip, &udp_sendto_addr.sin_addr); udp_sendto_addr.sin_port = htons(target_port); // printf("port_sendto=%d\n",target_port); int send_len; unsigned char send_buf[2000]; memcpy(send_buf, buf, len); send_len=len; //printf("send len=%d\n",send_len); //sendto(fd_sock_send, send_buf, send_len, 0, (struct sockaddr *)&udp_sendto_addr, sizeof(struct sockaddr_in)); sendto(fd_socket, send_buf, send_len, 0, (struct sockaddr *)&udp_sendto_addr, sizeof(struct sockaddr_in)); return 0; } int read_socket_udp_data(int fd_socket, unsigned char *buf, unsigned int len) { return 0; } int fd_sock_send; int fd_sock_recv; struct T_UDP_DEVICE udp_device; static struct sockaddr_in udp_mysendto_addr;//服务器用于接收的socket static struct sockaddr_in udp_myrecv_addr;//服务器用于接收的socket //static struct sockaddr_in udp_sendto_addr;//服务器用于发送的socket struct sockaddr_in udp_sendto_addr;//服务器用于发送的socket static struct sockaddr_in client_addr;//服务器用来保存客户端的发送socket,把客户端的socket属性保存在client_addr int open_udp_dev(char* ip_sendto, unsigned int port_sendto, unsigned int port_myrecv) { /* * 指定了发送目标的端口为port_sendto,也就是如果要发送给服务器,必须知道服务器哪个端口是会处理我的数据 * 指定了我这个程序的接收端口,既然服务器的端口是比如6789,那么我就也把我的接收端口设置为6789呗,从而统一个数据接收和发送 * 整体来说,发送时指定对方ip地址,接收来自任意ip的数据 * 发送时不需要绑定端口,系统会自动分配,当然了其实客户端也可以固定端口发送的 * 接收时绑定端口,作为服务器肯定是固定端口接收 */ int sockaddr_size; /*设置发送目标的ip地址和发送目标的端口*/ sockaddr_size = sizeof(struct sockaddr_in); bzero((char*)&udp_sendto_addr, sockaddr_size); udp_sendto_addr.sin_family = AF_INET; //udp_sendto_addr.sin_addr.s_addr = inet_addr(ip_sendto); //inet_pton(AF_INET, "10.108.16.163", &udp_sendto_addr.sin_addr); inet_pton(AF_INET, ip_sendto, &udp_sendto_addr.sin_addr); //udp_sendto_addr.sin_addr.s_addr = inet_addr("10.108.16.163"); //udp_sendto_addr.sin_addr.s_addr = INADDR_ANY; udp_sendto_addr.sin_port = htons(port_sendto); printf("port_sendto=%d\n",port_sendto); printf("udp_sendto_addr.sin_port=%d\n",udp_sendto_addr.sin_port); /*建立“发送”套接字*/ fd_sock_send = socket(AF_INET, SOCK_DGRAM, 0); if (fd_sock_send == -1) { perror("udp send create socket failed"); close(fd_sock_send); return 0; } else { printf("udp send ini ok!\n"); } /* * 绑定发送的端口 */ #if 1 sockaddr_size = sizeof(struct sockaddr_in); bzero((char*)&udp_mysendto_addr, sockaddr_size); udp_mysendto_addr.sin_family = AF_INET; udp_mysendto_addr.sin_addr.s_addr = inet_addr("10.108.16.163"); //udp_mysendto_addr.sin_addr.s_addr = inet_addr("127.0.0.1"); //udp_mysendto_addr.sin_port = htons(49000); udp_mysendto_addr.sin_port = htons(49000);//发送的端口跟目标ip地址的端口一致,我从49000发送,另一边也从49000接收 #else /* 绑定套接口 */ //if(-1 == (bind(fd_sock_send,(struct sockaddr*)&udp_sendto_addr,sizeof(struct sockaddr_in)))) if(-1 == (bind(fd_sock_send,(struct sockaddr*)&udp_mysendto_addr,sizeof(struct sockaddr_in)))) { perror("Server Bind Failed:"); //exit(1); } else { printf("bind success\n"); } #endif /*设置本机的接收ip地址和端口,但是接收的ip不指定,因为任何的ip都有可能给我发数据呀*/ sockaddr_size = sizeof(struct sockaddr_in); bzero((char*)&udp_myrecv_addr, sockaddr_size); udp_myrecv_addr.sin_family = AF_INET; udp_myrecv_addr.sin_addr.s_addr = INADDR_ANY;//任意地址 //udp_myrecv_addr.sin_addr.s_addr = inet_addr("10.108.16.163");;//任意地址 //udp_myrecv_addr.sin_port = htons(port_myrecv); udp_myrecv_addr.sin_port = htons(49005); /*建立“接收”套接字*/ fd_sock_recv = socket(AF_INET, SOCK_DGRAM, 0); if (fd_sock_recv == -1) { perror("udp recv create socket failed"); close(fd_sock_recv); return 0; } else { } /* * 建立socket获取fd_sock文件描述符后,需要把这个文件描述符与某一个soucket绑定 * 因为socket函数只是建立了一个通用的针对某一地址族的文件描述符,但是该socket的属性还需要设置并且绑定 */ if (bind(fd_sock_recv, (struct sockaddr *)&udp_myrecv_addr, sizeof(struct sockaddr_in)) == -1) { perror("udp recv bind err"); close(fd_sock_recv); return 0; } else { printf("udp recv ini ok!\n"); } int ret=0; udp_device.ptr_fun=read_udp_data; /*udp_recvbuf_and_process函数中调用了fd_sock_recv来确定从哪个socket获取数据*/ ret = pthread_create (&udp_device.fd, //线程标识符指针 NULL, //默认属性 udp_recvbuf_and_process,//运行函数 &udp_device); //运行函数的参数 if (0 != ret) { perror ("pthread create error\n"); } return 0; } #define UDP_RCV_BUF_SIZE 2000 #define UDP_PACKET_HEAD 0xa55a5aa5 #define UDP_PACKET_END 0x12345678 int send_udp_data(unsigned char *buf, unsigned int len) { int m_tail; int m_len; unsigned char m_sendbuf[UDP_RCV_BUF_SIZE]; static unsigned int m_packcnt = 0; /* * 帧尾0x12345678 4个字节 * 没有帧尾 */ memcpy(m_sendbuf, buf, len); m_len=len; #if 0 m_tail = htonl(UDP_PACKET_END); memcpy(&m_sendbuf[len], &m_tail, 4); m_len = 4 + len; #endif #if 0 int i=0; for(i=0;i<m_len;i++) { printf("%02x ",m_sendbuf[i]); } printf("\n"); #endif printf("send len=%d\n",m_len); sendto(fd_sock_send, m_sendbuf, m_len, 0, (struct sockaddr *)&udp_sendto_addr, sizeof(struct sockaddr_in)); return 0; } //#define UDP_PACKET_HEAD 0xa55a5aa5 #define UDP_RECV_HEAD1 0 #define UDP_RECV_HEAD2 1 #define UDP_RECV_HEAD3 2 #define UDP_RECV_HEAD4 3 #define UDP_RECV_CNT 4 #define UDP_RECV_LEN 5 #define UDP_RECV_DATA 6 #define UDP_RECV_CHECKSUM 7 static int udp_recv_state=0; int read_udp_data(unsigned char *buf, unsigned int len) { static unsigned char _buffer[UDP_RCV_BUF_SIZE]; static unsigned char _pack_recv_cnt[4] = {0}; static int _pack_recv_real_cnt=0; static unsigned char _pack_recv_len[4] = {0}; static int _pack_recv_real_len = 0; static unsigned char _pack_recv_buf[UDP_RCV_BUF_SIZE]; static int _pack_buf_len = 0; int _length; unsigned char c; int i=0; static int i_cnt=0; static int i_len=0; #if 0 printf("wangbo 20170809 udp len=%d,udp data buf=\n",len); for(i=0;i<len;i++) { printf("%x",buf[i]); } printf("\n"); printf("sizeof(fg2ap)=%d\n",sizeof(fg2ap)); printf("sizeof(uint64_t)=%d\n",sizeof(uint64_t)); #endif #if 1 /* memcpy(&fg2ap,buf,sizeof(fg2ap)); fg2ap.pitch_deg= ntoh_double(fg2ap.pitch_deg); fg2ap.heading_deg= ntoh_double(fg2ap.heading_deg); fg2ap.longitude_deg= ntoh_double(fg2ap.longitude_deg); fg2ap.latitude_deg= ntoh_double(fg2ap.latitude_deg); */ //fg2ap.pitch_deg=(double)(*((uint64_t*)(&fg2ap.pitch_deg))); //fg2ap.heading_deg=(double)(*((uint64_t*)(&fg2ap.heading_deg))); //fg2ap.longitude_deg=(double)(*(uint64_t*)&fg2ap.longitude_deg); //fg2ap.latitude_deg=(double)(*(uint64_t*)&fg2ap.latitude_deg); //fg2ap.pitch_deg=(double)__bswap_64(*(uint64_t*)&fg2ap.pitch_deg); //fg2ap.heading_deg=(double)__bswap_64(*(uint64_t*)&fg2ap.heading_deg); //fg2ap.longitude_deg=(double)__bswap_64(*(uint64_t*)&fg2ap.longitude_deg); //fg2ap.latitude_deg=(double)__bswap_64(*(uint64_t*)&fg2ap.latitude_deg); //printf("俯仰=%f,航向=%f\n",fg2ap.pitch_deg,fg2ap.heading_deg); // printf("纬度=%f,经度=%f\n",fg2ap.latitude_deg,fg2ap.longitude_deg); #else memcpy(&ap2fg_recv,buf,sizeof(ap2fg_recv)); ap2fg_recv.throttle0= ntoh_double(ap2fg_recv.throttle0); printf("ap2fg_recv.throttle0=%f\n",ap2fg_recv.throttle0); #endif return 0; memcpy(_buffer, buf, len); _length=len; for (i = 0; i<_length; i++) { c = _buffer[i]; switch (udp_recv_state) { case UDP_RECV_HEAD1: if (c == 0xa5) { udp_recv_state = UDP_RECV_HEAD2; } break; case UDP_RECV_HEAD2: if (c == 0x5a) { udp_recv_state = UDP_RECV_HEAD3; } else { udp_recv_state = UDP_RECV_HEAD1; } break; case UDP_RECV_HEAD3: if (c == 0x5a) { udp_recv_state = UDP_RECV_HEAD4; } else { udp_recv_state = UDP_RECV_HEAD1; } break; case UDP_RECV_HEAD4: if (c == 0xa5) { udp_recv_state = UDP_RECV_CNT; } else { udp_recv_state = UDP_RECV_HEAD1; } break; case UDP_RECV_CNT: _pack_recv_cnt[i_cnt] = c; i_cnt++; if ( i_cnt>= 4) { //低位在前 _pack_recv_real_cnt=_pack_recv_cnt[3]*pow(2,16)+_pack_recv_cnt[2]*pow(2,8)+_pack_recv_cnt[1]*pow(2,4)+_pack_recv_cnt[0]; udp_recv_state = UDP_RECV_LEN; i_cnt=0; } else { udp_recv_state = UDP_RECV_CNT; } _pack_buf_len = 0; break; case UDP_RECV_LEN: _pack_recv_len[i_len] = c; i_len++; if ( i_len>= 4) { _pack_recv_real_len=_pack_recv_len[3]*pow(2,16)+_pack_recv_len[2]*pow(2,8)+_pack_recv_len[1]*pow(2,4)+_pack_recv_len[0]; //printf("udp收到的有效数据长度为=%d\n",_pack_recv_real_len); udp_recv_state = UDP_RECV_DATA; i_len=0; } else { udp_recv_state = UDP_RECV_LEN; } _pack_buf_len = 0; break; case UDP_RECV_DATA: _pack_recv_buf[_pack_buf_len] = c; _pack_buf_len++; if (_pack_buf_len >= _pack_recv_real_len) { udp_recv_state = UDP_RECV_CHECKSUM; } break; case UDP_RECV_CHECKSUM: //if (_checksum == c) if (1) { udp_recv_state = 0; /* * 收到udp传来的副控数据后,根据ack来决定,m2s的数据 * 先放在这里测试,最后放在boatpilot.c文件中,接收线程中不要太多的判断 */ } else { udp_recv_state = 0; } break; } } return 0; } void *udp_recvbuf_and_process(void * ptr_udp_device) { char buf[UDP_RCV_BUF_SIZE] = { 0 }; unsigned int read_len; struct T_UDP_DEVICE *ptr_udp; ptr_udp=(struct T_UDP_DEVICE *)ptr_udp_device; unsigned int client_addr_len=0; client_addr_len=sizeof(struct sockaddr); while(1) { if(-1!=(read_len=recvfrom(fd_sock_recv, buf, 2000, 0, (struct sockaddr *)&client_addr, &client_addr_len))) { #if 0 printf("read_len=%d\n",read_len); buf[read_len]='\0'; printf("%s\n",buf); #endif if(read_len>0) { ptr_udp->ptr_fun((unsigned char*)buf,read_len); } } } pthread_exit(NULL); } #endif
[ "wangbo121@189.cn" ]
wangbo121@189.cn
ec431938691486715886c8debfdfd3d297807301
78cb99556fbe30f6d6c81dfb45562e06d203a54f
/tests/Zcash/TWZcashTransactionTests.cpp
944749361d7de9d9d89126dd366dba2d8ade679e
[ "MIT" ]
permissive
Khaos-Labs/khaos-wallet-core
2b00f37a7f6546f38f4421671f08954745de9a3d
2c06d49fddf978e0815b208dddef50ee2011c551
refs/heads/main
2023-01-09T10:43:59.424174
2020-11-15T06:55:13
2020-11-15T06:55:13
311,566,879
2
2
null
null
null
null
UTF-8
C++
false
false
9,080
cpp
// Copyright © 2017-2020 Khaos Wallet. // // This file is part of Trust. The full Trust copyright notice, including // terms governing use, modification, and redistribution, is contained in the // file LICENSE at the root of the source code distribution tree. #include "../interface/TWTestUtilities.h" #include "Bitcoin/OutPoint.h" #include "Bitcoin/Script.h" #include "Zcash/TransactionBuilder.h" #include "Bitcoin/TransactionSigner.h" #include "HexCoding.h" #include "PublicKey.h" #include "Data.h" #include "Coin.h" #include "Zcash/Transaction.h" #include <KhaosWalletCore/TWBitcoinScript.h> #include <gtest/gtest.h> using namespace TW; TEST(TWZcashTransaction, Encode) { // Test vector 3 https://github.com/zcash/zips/blob/master/zip-0243.rst auto transaction = Zcash::Transaction(); transaction.lockTime = 0x0004b029; transaction.expiryHeight = 0x0004b048; transaction.branchId = Zcash::SaplingBranchID; auto outpoint0 = Bitcoin::OutPoint(parse_hex("a8c685478265f4c14dada651969c45a65e1aeb8cd6791f2f5bb6a1d9952104d9"), 1); transaction.inputs.emplace_back(outpoint0, Bitcoin::Script(parse_hex("483045022100a61e5d557568c2ddc1d9b03a7173c6ce7c996c4daecab007ac8f34bee01e6b9702204d38fdc0bcf2728a69fde78462a10fb45a9baa27873e6a5fc45fb5c76764202a01210365ffea3efa3908918a8b8627724af852fc9b86d7375b103ab0543cf418bcaa7f")), 0xfffffffe); auto script0 = Bitcoin::Script(parse_hex("76a9148132712c3ff19f3a151234616777420a6d7ef22688ac")); transaction.outputs.emplace_back(0x02625a00, script0); auto script1 = Bitcoin::Script(parse_hex("76a9145453e4698f02a38abdaa521cd1ff2dee6fac187188ac")); transaction.outputs.emplace_back(0x0098958b, script1); auto unsignedData = Data{}; transaction.encode(unsignedData); ASSERT_EQ(hex(unsignedData.begin(), unsignedData.end()), /* header */ "04000080" /* versionGroupId */ "85202f89" /* vin */ "01""a8c685478265f4c14dada651969c45a65e1aeb8cd6791f2f5bb6a1d9952104d9""01000000""6b483045022100a61e5d557568c2ddc1d9b03a7173c6ce7c996c4daecab007ac8f34bee01e6b9702204d38fdc0bcf2728a69fde78462a10fb45a9baa27873e6a5fc45fb5c76764202a01210365ffea3efa3908918a8b8627724af852fc9b86d7375b103ab0543cf418bcaa7f""feffffff" /* vout */ "02""005a620200000000""1976a9148132712c3ff19f3a151234616777420a6d7ef22688ac" "8b95980000000000""1976a9145453e4698f02a38abdaa521cd1ff2dee6fac187188ac" /* lockTime */ "29b00400" /* expiryHeight */ "48b00400" /* valueBalance */ "0000000000000000" /* vShieldedSpend */ "00" /* vShieldedOutput */ "00" /* vJoinSplit */ "00" ); auto scriptCode = Bitcoin::Script(parse_hex("76a914507173527b4c3318a2aecd793bf1cfed705950cf88ac")); auto preImage = transaction.getPreImage(scriptCode, 0, TWBitcoinSigHashTypeAll, 0x02faf080); ASSERT_EQ(hex(preImage.begin(), preImage.end()), /* header */ "04000080" /* versionGroupId */ "85202f89" /* hashPrevouts */ "fae31b8dec7b0b77e2c8d6b6eb0e7e4e55abc6574c26dd44464d9408a8e33f11" /* hashSequence */ "6c80d37f12d89b6f17ff198723e7db1247c4811d1a695d74d930f99e98418790" /* hashOutputs */ "d2b04118469b7810a0d1cc59568320aad25a84f407ecac40b4f605a4e6868454" /* hashJoinSplits */ "0000000000000000000000000000000000000000000000000000000000000000" /* hashShieldedSpends */ "0000000000000000000000000000000000000000000000000000000000000000" /* hashShieldedOutputs */ "0000000000000000000000000000000000000000000000000000000000000000" /* lockTime */ "29b00400" /* expiryHeight */ "48b00400" /* valueBalance */ "0000000000000000" /* hashType */ "01000000" /* prevout */ "a8c685478265f4c14dada651969c45a65e1aeb8cd6791f2f5bb6a1d9952104d9""01000000" /* scriptCode */ "1976a914507173527b4c3318a2aecd793bf1cfed705950cf88ac" /* amount */ "80f0fa0200000000" /* sequence */ "feffffff" ); auto sighash = transaction.getSignatureHash(scriptCode, 0, TWBitcoinSigHashTypeAll, 0x02faf080, Bitcoin::BASE); ASSERT_EQ(hex(sighash.begin(), sighash.end()), "f3148f80dfab5e573d5edfe7a850f5fd39234f80b5429d3a57edcc11e34c585b"); } TEST(TWZcashTransaction, SaplingSigning) { // tx on mainnet // https://explorer.zcha.in/transactions/ec9033381c1cc53ada837ef9981c03ead1c7c41700ff3a954389cfaddc949256 const int64_t amount = 488000; const int64_t fee = 6000; auto input = Bitcoin::Proto::SigningInput(); input.set_hash_type(TWBitcoinSigHashTypeAll); input.set_amount(amount); input.set_byte_fee(1); input.set_to_address("t1QahNjDdibyE4EdYkawUSKBBcVTSqv64CS"); auto hash0 = DATA("53685b8809efc50dd7d5cb0906b307a1b8aa5157baa5fc1bd6fe2d0344dd193a"); auto utxo0 = input.add_utxo(); utxo0->mutable_out_point()->set_hash(TWDataBytes(hash0.get()), TWDataSize(hash0.get())); utxo0->mutable_out_point()->set_index(0); utxo0->mutable_out_point()->set_sequence(UINT32_MAX); utxo0->set_amount(494000); auto script0 = parse_hex("76a914f84c7f4dd3c3dc311676444fdead6e6d290d50e388ac"); utxo0->set_script(script0.data(), script0.size()); auto utxoKey0 = DATA("a9684f5bebd0e1208aae2e02bc9e9163bd1965ad23d8538644e1df8b99b99559"); input.add_private_key(TWDataBytes(utxoKey0.get()), TWDataSize(utxoKey0.get())); auto plan = Zcash::TransactionBuilder::plan(input); plan.amount = amount; plan.fee = fee; plan.change = 0; plan.branchId = Data(Zcash::SaplingBranchID.begin(), Zcash::SaplingBranchID.end()); auto &protoPlan = *input.mutable_plan(); protoPlan = plan.proto(); // Sign auto result = Bitcoin::TransactionSigner<Zcash::Transaction, Zcash::TransactionBuilder>(std::move(input)).sign(); ASSERT_TRUE(result) << result.error(); auto signedTx = result.payload(); // txid = "ec9033381c1cc53ada837ef9981c03ead1c7c41700ff3a954389cfaddc949256" Data serialized; signedTx.encode(serialized); ASSERT_EQ(hex(serialized), "04000080" "85202f89" "01" "53685b8809efc50dd7d5cb0906b307a1b8aa5157baa5fc1bd6fe2d0344dd193a""00000000""6b483045022100ca0be9f37a4975432a52bb65b25e483f6f93d577955290bb7fb0060a93bfc92002203e0627dff004d3c72a957dc9f8e4e0e696e69d125e4d8e275d119001924d3b48012103b243171fae5516d1dc15f9178cfcc5fdc67b0a883055c117b01ba8af29b953f6""ffffffff" "01" "4072070000000000""1976a91449964a736f3713d64283fd0018626ba50091c7e988ac" "00000000" "00000000" "0000000000000000" "00" "00" "00" ); } TEST(TWZcashTransaction, BlossomSigning) { // tx on mainnet // https://explorer.zcha.in/transactions/387939ff8eb07dd264376eeef2e126394ab139802b1d80e92b21c1a2ae54fe92 const int64_t amount = 17615; const int64_t fee = 10000; const std::string toAddress = "t1biXYN8wJahR76SqZTe1LBzTLf3JAsmT93"; auto input = Bitcoin::Proto::SigningInput(); input.set_hash_type(TWBitcoinSigHashTypeAll); input.set_amount(amount); input.set_byte_fee(1); input.set_to_address(toAddress); input.set_coin_type(TWCoinTypeZcash); auto txHash0 = parse_hex("2381825cd9069a200944996257e25b9403ba3e296bbc1dd98b01019cc7028cde"); std::reverse(txHash0.begin(), txHash0.end()); auto utxo0 = input.add_utxo(); utxo0->mutable_out_point()->set_hash(txHash0.data(), txHash0.size()); utxo0->mutable_out_point()->set_index(0); utxo0->mutable_out_point()->set_sequence(UINT32_MAX); utxo0->set_amount(27615); // real key 1p "m/44'/133'/0'/0/14" auto utxoKey0 = PrivateKey(parse_hex("0x4646464646464646464646464646464646464646464646464646464646464646")); auto utxoAddr0 = TW::deriveAddress(TWCoinTypeZcash, utxoKey0); auto script0 = Bitcoin::Script::lockScriptForAddress(utxoAddr0, TWCoinTypeZcash); utxo0->set_script(script0.bytes.data(), script0.bytes.size()); input.add_private_key(utxoKey0.bytes.data(), utxoKey0.bytes.size()); auto plan = Zcash::TransactionBuilder::plan(input); plan.amount = amount; plan.fee = fee; plan.change = 0; auto &protoPlan = *input.mutable_plan(); protoPlan = plan.proto(); // Sign auto result = Bitcoin::TransactionSigner<Zcash::Transaction, Zcash::TransactionBuilder>(std::move(input)).sign(); ASSERT_TRUE(result) << result.error(); auto signedTx = result.payload(); Data serialized; signedTx.encode(serialized); ASSERT_EQ(hex(serialized), "0400008085202f8901de8c02c79c01018bd91dbc6b293eba03945be25762994409209a06d95c828123000000006b483045022100e6e5071811c08d0c2e81cb8682ee36a8c6b645f5c08747acd3e828de2a4d8a9602200b13b36a838c7e8af81f2d6e7e694ede28833a480cfbaaa68a47187655298a7f0121024bc2a31265153f07e70e0bab08724e6b85e217f8cd628ceb62974247bb493382ffffffff01cf440000000000001976a914c3bacb129d85288a3deb5890ca9b711f7f71392688ac00000000000000000000000000000000000000"); }
[ "admin@example.com" ]
admin@example.com
a20089a7cd8eb06af422c0411d3342b999b89636
051278b17f1c377bb001723e4850bb7366a2ce58
/cs488/A4_backup/scene_lua.hpp
aaf0914f39b9a735e5331099f2b03616f0645bfc
[]
no_license
sherlockwxl/cs488-spring2019
ff5ca4c3a1ca189df28d24b9702a713457c67561
5a7b8c4f9122464a34131d1ef74c4dac176b7d57
refs/heads/master
2020-05-22T12:45:56.718880
2019-07-03T10:57:42
2019-07-03T10:57:42
186,347,029
1
0
null
null
null
null
UTF-8
C++
false
false
94
hpp
// Spring 2019 #pragma once #include <string> bool run_lua( const std::string& filename );
[ "wuxiling@outlook.com" ]
wuxiling@outlook.com
999c587aae622c324cbc15ce24cb78b70abc881f
b20ea4c96b2bda646e638b0098f73e0246a502d9
/expr14/matrix_vector_darcy_RT_1.cc
4fda32277a13405fec49b6c29cf1d10bb9bff817
[]
no_license
njase/dealii_experiments
730b4a1bd6ecd00b885fca90a2e8658574f468d9
421f9873edbb0a29f2b3d66c8e946530ea78956a
refs/heads/master
2021-05-15T12:07:56.614527
2018-03-04T13:58:41
2018-03-04T13:58:41
108,398,051
0
0
null
null
null
null
UTF-8
C++
false
false
18,896
cc
/* * this case tests the correctness of the implementation of matrix free * operators used with Raviart Thomas Elements. The operators chosen are * from Darcy porous media flow problem with unit permeability tensor. * The results of matrix-vector products are compared with the result of * deal.II sparse matrix. No hanging nodes and no other constraints. */ //This test should be added to dealii tests #include "tests.h" std::ofstream logfile("output"); #include <deal.II/base/quadrature_lib.h> #include <deal.II/base/logstream.h> #include <deal.II/base/function.h> #include <deal.II/base/timer.h> #include <deal.II/lac/block_vector.h> #include <deal.II/lac/full_matrix.h> #include <deal.II/lac/block_sparse_matrix.h> #include <deal.II/lac/solver_cg.h> #include <deal.II/lac/solver_minres.h> #include <deal.II/lac/precondition.h> #include <deal.II/grid/tria.h> #include <deal.II/grid/grid_generator.h> #include <deal.II/grid/tria_accessor.h> #include <deal.II/grid/tria_iterator.h> #include <deal.II/dofs/dof_handler.h> #include <deal.II/dofs/dof_renumbering.h> #include <deal.II/dofs/dof_accessor.h> #include <deal.II/dofs/dof_tools.h> #include <deal.II/fe/fe_dgq.h> #include <deal.II/fe/fe_system.h> #include <deal.II/fe/fe_values.h> #include <deal.II/numerics/vector_tools.h> #include <deal.II/numerics/matrix_tools.h> #include <deal.II/numerics/data_out.h> #include <fstream> #include <iostream> #include <deal.II/fe/fe_raviart_thomas.h> #include <deal.II/base/tensor_function.h> #include <deal.II/matrix_free/matrix_free.h> #include <deal.II/matrix_free/fe_evaluation.h> using namespace dealii; template <int dim, int degree_p, typename VectorType> class MF_MixedLaplace { public: typedef typename DoFHandler<dim>::active_cell_iterator CellIterator; typedef double Number; static constexpr unsigned int n_q_points_1d = degree_p+2; MF_MixedLaplace(const MatrixFree<dim,Number> &data_in): data (data_in) {}; //We use unit permeability tensor in these tests void local_apply_opA (const MatrixFree<dim,Number> &data, VectorType &dst, const VectorType &src, const std::pair<unsigned int,unsigned int> &cell_range) const { typedef VectorizedArray<Number> vector_t; FEEvaluationAni<FE_RaviartThomas<dim>,dim,degree_p,n_q_points_1d,Number> velocity (data, 0); for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell) { velocity.reinit (cell); velocity.read_dof_values (src.block(0)); velocity.evaluate (true,false,false); //Evaluate values for (unsigned int q=0; q<velocity.n_q_points; ++q) { Tensor<1,dim,vector_t> u = velocity.get_value(q); velocity.submit_value (u, q); } velocity.integrate (true,false); velocity.distribute_local_to_global (dst.block(0)); } } void local_apply_opB_tr (const MatrixFree<dim,Number> &data, VectorType &dst, const VectorType &src, const std::pair<unsigned int,unsigned int> &cell_range) const { typedef VectorizedArray<Number> vector_t; FEEvaluationAni<FE_RaviartThomas<dim>,dim,degree_p,n_q_points_1d,Number> velocity (data, 0); FEEvaluation<dim,degree_p,n_q_points_1d,1,Number> pressure (data, 1); //For scalar elements, use orig FEEvaluation for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell) { velocity.reinit (cell); velocity.read_dof_values (src.block(0)); velocity.evaluate (true,true,false); //Evaluate values and gradients pressure.reinit (cell); pressure.read_dof_values (src.block(1)); pressure.evaluate (true,false,false); for (unsigned int q=0; q<velocity.n_q_points; ++q) { Tensor<1,dim,vector_t> u = velocity.get_value(q); velocity.submit_value (u, q); Tensor<2,dim,vector_t> grad_u = velocity.get_gradient (q); vector_t pres = pressure.get_value(q); grad_u.clear(); for (unsigned int d=0; d<dim; ++d) grad_u[d][d] = -pres; velocity.submit_gradient(grad_u, q); } velocity.integrate (true,true); velocity.distribute_local_to_global (dst.block(0)); } } void local_apply_opB (const MatrixFree<dim,Number> &data, VectorType &dst, const VectorType &src, const std::pair<unsigned int,unsigned int> &cell_range) const { typedef VectorizedArray<Number> vector_t; FEEvaluationAni<FE_RaviartThomas<dim>,dim,degree_p,n_q_points_1d,Number> velocity (data, 0); FEEvaluation<dim,degree_p,n_q_points_1d,1,Number> pressure (data, 1); //For scalar elements, use orig FEEvaluation for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell) { velocity.reinit (cell); velocity.read_dof_values (src.block(0)); velocity.evaluate (false,true,false); //Evaluate gradients pressure.reinit (cell); pressure.read_dof_values (src.block(1)); pressure.evaluate (true,false,false); for (unsigned int q=0; q<velocity.n_q_points; ++q) { Tensor<2,dim,vector_t> grad_u = velocity.get_gradient (q); vector_t pres = pressure.get_value(q); vector_t div = -trace(grad_u); pressure.submit_value (div, q); } pressure.integrate (true,false); pressure.distribute_local_to_global (dst.block(1)); } } void Avmult (VectorType &dst, const VectorType &src) const { dst.block(0) = 0; dst.block(1) = 0; data.cell_loop (&MF_MixedLaplace<dim,degree_p,VectorType>::local_apply_opA, this, dst, src); }; void Bvmult (VectorType &dst, const VectorType &src) const { dst.block(0) = 0; dst.block(1) = 0; data.cell_loop (&MF_MixedLaplace<dim,degree_p,VectorType>::local_apply_opB, this, dst, src); }; void B_tra_vmult (VectorType &dst, const VectorType &src) const { dst.block(0) = 0; dst.block(1) = 0; data.cell_loop (&MF_MixedLaplace<dim,degree_p,VectorType>::local_apply_opB_tr, this, dst, src); }; private: const MatrixFree<dim,Number> &data; }; template <int dim, int degree> class TestMixedLaplace { public: TestMixedLaplace (); void run (); private: enum op_id {OP_A, OP_B, OP_B_tra}; //operator IDs void make_grid_and_dofs (); void assemble_sparse_system (); void test_mf_operator (enum op_id, Timer &time, BlockSparseMatrix<double> &tmp_system_matrix); void compute_errors (int block_no) const; const unsigned int n_q_points_1d; FESystem<dim> fe; Triangulation<dim> triangulation; DoFHandler<dim> dof_handler; BlockSparsityPattern sparsity_pattern; BlockSparseMatrix<double> system_matrix; BlockVector<double> solution; BlockVector<double> system_rhs; //data structures For MF MatrixFree<dim,double> mf_data; FE_RaviartThomas<dim> fe_u; FE_DGQ<dim> fe_p; DoFHandler<dim> dof_handler_u; DoFHandler<dim> dof_handler_p; BlockVector<double> mf_solution; }; template <int dim, int degree> TestMixedLaplace<dim, degree>::TestMixedLaplace () : n_q_points_1d(degree+2), fe (FE_RaviartThomas<dim>(degree),1,FE_DGQ<dim>(degree),1), dof_handler (triangulation), //For MF fe_u(FE_RaviartThomas<dim>(degree)), fe_p(FE_DGQ<dim>(degree)), dof_handler_u (triangulation), dof_handler_p (triangulation) { std::cout << "dim = "<<dim <<std::endl <<"RT_degree = "<<degree <<std::endl <<"FE_DGQ_degree = "<<degree; } template <int dim, int degree> void TestMixedLaplace<dim,degree>::make_grid_and_dofs () { //We can only work on cartesian mesh cells in MF version - so let it be as-it-is GridGenerator::hyper_cube (triangulation, -1, 1); //First, lets test on one cell only //#if 0 triangulation.refine_global (3); //#endif dof_handler.distribute_dofs (fe); DoFRenumbering::component_wise (dof_handler); std::vector<types::global_dof_index> dofs_per_component (dim+1); DoFTools::count_dofs_per_component (dof_handler, dofs_per_component); const unsigned int n_u = dofs_per_component[0], n_p = dofs_per_component[dim]; std::cout << "Number of active cells = " << triangulation.n_active_cells() << std::endl << "Total number of cells = " << triangulation.n_cells() << std::endl << "Number of Velocity degrees of freedom = " << n_u << std::endl << "Number of Pressure degrees of freedom = " << n_p << std::endl << "Total Number of degrees of freedom = " << dof_handler.n_dofs() << std::endl; BlockDynamicSparsityPattern dsp(2, 2); dsp.block(0, 0).reinit (n_u, n_u); dsp.block(1, 0).reinit (n_p, n_u); dsp.block(0, 1).reinit (n_u, n_p); dsp.block(1, 1).reinit (n_p, n_p); dsp.collect_sizes (); DoFTools::make_sparsity_pattern (dof_handler, dsp); sparsity_pattern.copy_from(dsp); system_matrix.reinit (sparsity_pattern); solution.reinit (2); solution.block(0).reinit (n_u); solution.block(1).reinit (n_p); solution.collect_sizes (); system_rhs.reinit (2); system_rhs.block(0).reinit (n_u); system_rhs.block(1).reinit (n_p); system_rhs.collect_sizes (); // setup matrix-free structure { dof_handler_u.distribute_dofs (fe_u); dof_handler_p.distribute_dofs (fe_p); mf_solution.reinit(solution); std::vector<const DoFHandler<dim>*> dofs; dofs.push_back(&dof_handler_u); dofs.push_back(&dof_handler_p); ConstraintMatrix dummy_constraints; dummy_constraints.close(); std::vector<const ConstraintMatrix *> constraints; constraints.push_back (&dummy_constraints); constraints.push_back (&dummy_constraints); QGauss<1> quad(n_q_points_1d); typename MatrixFree<dim,double>::AdditionalData additional_data; additional_data.mapping_update_flags = update_quadrature_points; mf_data.reinit (dofs, constraints, quad, additional_data); } } template <int dim, int degree> void TestMixedLaplace<dim,degree>::assemble_sparse_system () { QGauss<dim> quadrature_formula(n_q_points_1d); FEValues<dim> fe_values (fe, quadrature_formula, update_values | update_gradients | update_quadrature_points | update_JxW_values); const unsigned int dofs_per_cell = fe.dofs_per_cell; const unsigned int n_q_points = quadrature_formula.size(); FullMatrix<double> local_matrix (dofs_per_cell, dofs_per_cell); Vector<double> local_rhs (dofs_per_cell); std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell); const FEValuesExtractors::Vector velocities (0); const FEValuesExtractors::Scalar pressure (dim); typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(), endc = dof_handler.end(); for (; cell!=endc; ++cell) { fe_values.reinit (cell); local_matrix = 0; for (unsigned int q=0; q<n_q_points; ++q) for (unsigned int i=0; i<dofs_per_cell; ++i) { const Tensor<1,dim> phi_i_u = fe_values[velocities].value (i, q); const double div_phi_i_u = fe_values[velocities].divergence (i, q); const double phi_i_p = fe_values[pressure].value (i, q); for (unsigned int j=0; j<dofs_per_cell; ++j) { const Tensor<1,dim> phi_j_u = fe_values[velocities].value (j, q); const double div_phi_j_u = fe_values[velocities].divergence (j, q); const double phi_j_p = fe_values[pressure].value (j, q); local_matrix(i,j) += (phi_i_u * phi_j_u //assume unit K tensor - div_phi_i_u * phi_j_p - phi_i_p * div_phi_j_u) * fe_values.JxW(q); } } cell->get_dof_indices (local_dof_indices); for (unsigned int i=0; i<dofs_per_cell; ++i) for (unsigned int j=0; j<dofs_per_cell; ++j) { system_matrix.add (local_dof_indices[i], local_dof_indices[j], local_matrix(i,j)); } } // fill system_rhs with random numbers for (unsigned int i=0; i<2; ++i) for (unsigned int j=0; j<system_rhs.block(i).size(); ++j) { const double val = -1. + 2.*random_value<double>(); system_rhs.block(i)(j) = val; } } template <int dim, int degree> void TestMixedLaplace<dim,degree>::compute_errors (int block_no) const { // Verification double error = 0.; for (unsigned int i=0; i<2; ++i) for (unsigned int j=0; j<solution.block(i).size(); ++j) error += std::fabs (solution.block(i)(j)-mf_solution.block(i)(j)); double relative = solution.block(block_no).l1_norm(); std::cout<<"solution L1 norm = "<<relative<<std::endl; std::cout<<"Error = "<<error<<" Relative error = "<<error/relative<<std::endl; deallog << " Verification fe degree " << degree << ": " << error/relative << std::endl << std::endl; if (error > 10e-6) { std::cout<<"Solution vector using dealii is "<<std::endl; for (unsigned int i=0; i<2; ++i) { for (unsigned int j=0; j<solution.block(i).size(); ++j) { if (fabs(solution.block(i)(j)) < 10e-6) std::cout<<std::setw(10)<<0; else std::cout<<std::setw(10)<<solution.block(i)(j); } std::cout<<std::endl; } std::cout<<"Solution vector using MF is "<<std::endl; for (unsigned int i=0; i<2; ++i) { for (unsigned int j=0; j<mf_solution.block(i).size(); ++j) { if (fabs(mf_solution.block(i)(j)) < 10e-6) std::cout<<std::setw(10)<<0; else std::cout<<std::setw(10)<<mf_solution.block(i)(j); } std::cout<<std::endl; } } } template <int dim, int degree> void TestMixedLaplace<dim,degree>::test_mf_operator ( enum op_id id,Timer &time, BlockSparseMatrix<double> &tmp_system_matrix) { //vmult using MF typedef BlockVector<double> VectorType; MF_MixedLaplace<dim,degree,VectorType> mf (mf_data); if (OP_A == id) { tmp_system_matrix.block(0,1) = 0; tmp_system_matrix.block(1,0) = 0; time.restart(); mf.Avmult(mf_solution, system_rhs); } if (OP_B == id) { tmp_system_matrix.block(0,0) = 0; tmp_system_matrix.block(0,1) = 0; time.restart(); mf.Bvmult(mf_solution, system_rhs); } if (OP_B_tra == id) //We test Au + B_tr.p { tmp_system_matrix.block(1,0) = 0; time.restart(); mf.B_tra_vmult(mf_solution, system_rhs); } std::cout<<"MF operator evaluation, Time taken CPU/WALL = "<<time.cpu_time() << "s/" << time.wall_time() << "s" << std::endl; time.restart(); //Solve using dealii sparse Matrix-vector multiplication tmp_system_matrix.vmult (solution, system_rhs); std::cout<<"Sparse Matrix vmult, Time taken CPU/WALL = "<<time.cpu_time() << "s/" << time.wall_time() << "s" << std::endl; } template <int dim, int degree> void TestMixedLaplace<dim,degree>::run () { Timer time; std::cout<<std::endl<<"Making grid and distributing DoFs "<<std::endl; time.restart(); make_grid_and_dofs(); std::cout<<"Time taken CPU/WALL = "<<time.cpu_time() << "s/" << time.wall_time() << "s" << std::endl; std::cout<<std::endl<<"Assembling the Sparse System Matrix and RHS"<<std::endl; time.restart(); assemble_sparse_system (); std::cout<<"Time taken CPU/WALL = "<<time.cpu_time() << "s/" << time.wall_time() << "s" << std::endl; std::cout<<std::endl<<"Testing the operator evaluation with Sparse matrix and MatrixFree"<< std::endl; BlockSparseMatrix<double> tmp_system_matrix; tmp_system_matrix.reinit (sparsity_pattern); std::cout<<std::endl<<"Test for operator A.."<< std::endl; tmp_system_matrix.copy_from(system_matrix); test_mf_operator(OP_A,time,tmp_system_matrix); compute_errors (0); std::cout<<std::endl<<"Test for operator B_tr.."<< std::endl; tmp_system_matrix.copy_from(system_matrix); test_mf_operator(OP_B_tra,time,tmp_system_matrix); compute_errors (0); std::cout<<std::endl<<"Test for operator B.."<< std::endl; tmp_system_matrix.copy_from(system_matrix); test_mf_operator(OP_B,time,tmp_system_matrix); compute_errors (1); } int main () { deallog.attach(logfile); deallog << std::setprecision (3); try { deallog << std::endl << "Test with doubles" << std::endl << std::endl; deallog.push("2d"); TestMixedLaplace<2, 0> test1; test1.run(); //ok TestMixedLaplace<2, 1> test2; test2.run(); //ok TestMixedLaplace<2, 2> test3; test3.run(); //ok deallog.pop(); } catch (std::exception &exc) { std::cerr << std::endl << std::endl << "----------------------------------------------------" << std::endl; std::cerr << "Exception on processing: " << std::endl << exc.what() << std::endl << "Aborting!" << std::endl << "----------------------------------------------------" << std::endl; return 1; } catch (...) { std::cerr << std::endl << std::endl << "----------------------------------------------------" << std::endl; std::cerr << "Unknown exception!" << std::endl << "Aborting!" << std::endl << "----------------------------------------------------" << std::endl; return 1; } return 0; }
[ "e.samehta@gmail.com" ]
e.samehta@gmail.com
48ee00d6869f52f02739d29f0749074ca183ca08
86f4954a851fb24da6b1b40cae2f0d049a7efd0d
/server/visualizationslider.cpp
802ceecc8bd932dc81c373a5e698ac5c2266448e
[ "MIT" ]
permissive
manpat/netsynth
245d9708b60790ed8785161acdcfda9387794baf
17b46aa373ed778a1e991aab10d221c8d2828b5b
refs/heads/master
2020-05-20T06:05:13.428442
2015-12-15T04:26:16
2015-12-15T04:26:16
40,160,843
2
0
null
null
null
null
UTF-8
C++
false
false
1,025
cpp
#include "visualizationslider.h" #include <QtGui/QPainter> #include <QtGui/QStyleOptionSlider> VisualizationSlider::VisualizationSlider(QWidget* p) : QSlider(p), color("#fff") {} void VisualizationSlider::DrawText(QPainter* p, const QRect& r) { auto color = QColor("#222"); auto font = p->font(); p->setPen(color); font.setWeight(QFont::Bold); p->setFont(font); if (r.width() > 2) { p->drawText(r, Qt::AlignCenter, text); } } void VisualizationSlider::paintEvent(QPaintEvent*) { QPainter p(this); p.setPen(Qt::NoPen); QStyleOptionSlider style; style.init(this); auto r = style.rect; auto sectHeight = height();// * 100 / 100; Using this for scaling eventually p.setBrush(QColor("#333")); r.setY(height() - sectHeight); r.setHeight(sectHeight); p.drawRect(r); p.setBrush(color); auto nh = 15 + ((sectHeight - 15) * value() / 100); r.setY(height() - sectHeight / 2 - nh / 2); r.setHeight(nh); p.drawRect(r); r = QRect(0, height() - sectHeight / 2 - 75, width(), 150); DrawText(&p, r); }
[ "jared_ford94@hotmail.com" ]
jared_ford94@hotmail.com
80cfa407c5405d145ac353216a6823067bccbb17
85abd9dd369c807816552379be8ac5eac39695ba
/cbc2_manual/cpp/cbc2cxx.h
c8545023ccb7997ca256c72223df0fed0ec5125f
[]
no_license
kipr/kiss-docs
ef0b69eee440387a2438f9a34d79001879e27395
efe5b9aa27f55a37a2d80eeb81a04e5ed9c49309
refs/heads/master
2016-09-06T00:24:49.654930
2012-01-05T20:49:07
2012-01-05T20:49:07
3,112,630
0
0
null
null
null
null
UTF-8
C++
false
false
17,023
h
/************************************************************************** * Copyright 2007-2012 KISS Institute for Practical Robotics * * * * This file is part of KISS (Kipr's Instructional Software System). * * * * KISS 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. * * * * KISS 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 KISS. Check the LICENSE file in the project root. * * If not, see <http://www.gnu.org/licenses/>. * **************************************************************************/ /* * C++ Wrapper for libcbc, by Braden McDorman <bmcdorman@kipr.org> */ /** * \mainpage cbc2cxx.h * \section intro_sec Introduction * This document covers usage of the cbc2cxx.h header, which is a lightweight c++ wrapper for libcbc. * To get started, click the "Data Structures" tab. */ #ifndef __CBC2_CXX_H__ #define __CBC2_CXX_H__ #ifdef __cplusplus typedef unsigned char port_t; /** * \class Sound * \brief Holds static methods for making the CBC produce simple sounds */ struct Sound { static void tone(int frequency, int duration) { tone(frequency, duration); } static void beep() { ::beep(); } }; /** * \class Port * \brief Base class for all classes that need a port */ struct Port { Port(port_t port) : m_port(port) {} /// Update the port void setPort(port_t port) { m_port = port; } /// Get the currently set port port_t getPort() const { return m_port; } protected: port_t m_port; }; /** * \class Motor * \brief Holds all methods that deal with motor movement */ struct Motor : Port { Motor(port_t port) : Port(port) {} void moveAtVelocity(int velocity) { move_at_velocity(m_port, velocity); } void mav(int velocity) { moveAtVelocity(velocity); } void moveToPosition(int speed, long goalPos) { move_to_position(m_port, speed, goalPos); } void mtp(int speed, long goalPos) { moveToPosition(speed, goalPos); } void moveRelativePosition(int speed, long goalPos) { move_relative_position(m_port, speed, goalPos); } void mrp(int speed, long goalPos) { moveRelativePosition(speed, goalPos); } int freeze() { ::freeze(m_port); } bool isMotorDone() { get_motor_done(m_port); } bool isDone() { return isMotorDone(); } void blockMotorDone() { block_motor_done(m_port); } void blockDone() { blockMotorDone(); } void bmd() { blockDone(); } int setPWM(int pwm) { setpwm(m_port, pwm); } void fd() { ::fd(m_port); } void forward() { fd(); } void bk() { ::bk(m_port); } void backward() { bk(); } void motor(int speed) { ::motor(m_port, speed); } void off() { ::off(m_port); } void setPIDGains(int p, int i, int d, int pd, int id, int dd) { set_pid_gains(m_port, p, i, d, pd, id, dd); } static void allOff() { ao(); } }; /** * \class Servo * \brief Holds all methods that deal with servo movement */ struct Servo : Port { Servo(port_t port) : Port(port) {} void setPosition(int pos) { set_servo_position(m_port, pos); } int getPosition() { return get_servo_position(m_port); } static void enable() { enable_servos(); } static void disable() { disable_servos(); } static void setEnabled(bool enabled) { if(enabled) enable(); else disable(); } }; /** * \class IntegerSensor * \brief Base class for all classes returning a 8 or 10 bit value as their primary function */ struct IntegerSensor { virtual int getValue() const = 0; }; /** * \class Analog * \brief Holds all methods that deal with analog sensors */ struct Analog : IntegerSensor, Port { Analog(port_t port) : Port(port) {} int getValue10() const { return analog10(m_port); } int getValue8() const { return analog(m_port); } int getValue() const { return getValue8(); } static void setEachAnalogState(bool a0, bool a1, bool a2, bool a3, bool a4, bool a5, bool a6, bool a7) { set_each_analog_state(a0 ? 1 : 0, a1 ? 1 : 0, a2 ? 1 : 0, a3 ? 1 : 0, a4 ? 1 : 0, a5 ? 1 : 0, a6 ? 1 : 0, a7 ? 1 : 0); } static void setAnalogFloats(int mask) { set_analog_floats(mask); } }; /** * \class BooleanSensor * \brief Base class for all class returning a true or false value as their primary function */ struct BooleanSensor { virtual bool getValue() const = 0; }; /** * \class Digital * \brief Implements BooleanSensor for digital sensors */ struct Digital : BooleanSensor, Port { Digital(port_t port) : Port(port) {} bool getValue() const { return digital(m_port); } void setOutputValue(bool value) { set_digital_output_value(m_port, value ? 1 : 0); } }; namespace Button { struct A : BooleanSensor { bool getValue() const { return a_button() == 1; } }; struct B : BooleanSensor { bool getValue() const { return b_button() == 1; } }; struct Up : BooleanSensor { bool getValue() const { return up_button() == 1; } }; struct Down : BooleanSensor { bool getValue() const { return down_button() == 1; } }; struct Left : BooleanSensor { bool getValue() const { return left_button() == 1; } }; struct Right : BooleanSensor { bool getValue() const { return right_button() == 1; } }; struct Black : BooleanSensor { bool getValue() const { return black_button() == 1; } }; } namespace Accelerometer { struct X : IntegerSensor { int getValue() const { return accel_x(); } }; struct Y : IntegerSensor { int getValue() const { return accel_y(); } }; struct Z : IntegerSensor { int getValue() const { return accel_z(); } }; }; namespace Vision { struct Blob { Blob(int ch, int i) : m_ch(ch), m_i(i) {} int getSize() { track_size(m_ch, m_i); } int getX() { track_x(m_ch, m_i); } int getY() { track_y(m_ch, m_i); } int getConfidence() { return track_confidence(m_ch, m_i); } int getBBoxLeft() { return track_bbox_left(m_ch, m_i); } int getBBoxRight() { return track_bbox_right(m_ch, m_i); } int getBBoxTop() { return track_bbox_top(m_ch, m_i); } int getBBoxBottom() { return track_bbox_bottom(m_ch, m_i); } int getBBoxWidth() { return track_bbox_width(m_ch, m_i); } int getBBoxHeight() { return track_bbox_height(m_ch, m_i); } float getAngle() { return track_angle(m_ch, m_i); } int getMajorAxis() { return track_major_axis(m_ch, m_i); } int getMinorAxis() { return track_minor_axis(m_ch, m_i); } private: int m_ch; int m_i; }; struct Channel { Channel(int ch) : m_ch(ch) {} Blob getBlob(int i) { return Blob(m_ch, i); } int getBlobCount() { track_count(m_ch); } void setModelHSV(int hMin, int hMax, int sMin, int vMin) { track_set_model_hsv(m_ch, hMin, hMax, sMin, vMin); } void getModelHSV(int* hMin, int* hMax, int* sMin, int* vMin) { track_get_model_hsv(m_ch, hMin, hMax, sMin, vMin); } private: int m_ch; }; struct Camera { Camera() : m_channels((Channel[4]) { Channel(0), Channel(1), Channel(2), Channel(3) }) {} void update() { track_update(); } int getFrame() { return track_get_frame(); } int getTimeSinceCapture() { return track_capture_time(); } Channel& getChannel(int ch) { return m_channels[ch]; } private: Channel m_channels[4]; }; } namespace CreateSensor { struct Lagged { Lagged(float lag) : m_lag(lag) {} protected: float m_lag; }; struct LeftBump : Lagged, BooleanSensor { LeftBump(float lag = 0.1) : Lagged(lag) {} bool getValue() const { return get_create_lbump(m_lag) == 1; } }; struct RightBump : Lagged, BooleanSensor { RightBump(float lag = 0.1) : Lagged(lag) {} bool getValue() const { return get_create_rbump(m_lag) == 1; } }; struct LeftWheelDrop : Lagged, BooleanSensor { LeftWheelDrop(float lag = 0.1) : Lagged(lag) {} bool getValue() const { return get_create_lwdrop(m_lag) == 1; } }; struct CasterWheelDrop : Lagged, BooleanSensor { CasterWheelDrop(float lag = 0.1) : Lagged(lag) {} bool getValue() const { return get_create_cwdrop(m_lag) == 1; } }; struct RightWheelDrop : Lagged, BooleanSensor { RightWheelDrop(float lag = 0.1) : Lagged(lag) {} bool getValue() const { return get_create_rwdrop(m_lag) == 1; } }; struct Wall : Lagged, BooleanSensor { Wall(float lag = 0.1) : Lagged(lag) {} bool getValue() const { return get_create_wall(m_lag) == 1; } }; struct LeftCliff : Lagged, BooleanSensor { LeftCliff(float lag = 0.1) : Lagged(lag) {} bool getValue() const { return get_create_lcliff(m_lag) == 1; } }; struct RightCliff : Lagged, BooleanSensor { RightCliff(float lag = 0.1) : Lagged(lag) {} bool getValue() const { return get_create_rcliff(m_lag) == 1; } }; struct LeftFrontCliff : Lagged, BooleanSensor { LeftFrontCliff(float lag = 0.1) : Lagged(lag) {} bool getValue() const { return get_create_lfcliff(m_lag) == 1; } }; struct RightFrontCliff : Lagged, BooleanSensor { RightFrontCliff(float lag = 0.1) : Lagged(lag) {} bool getValue() const { return get_create_rfcliff(m_lag) == 1; } }; struct VirtualWall : Lagged, BooleanSensor { VirtualWall(float lag = 0.1) : Lagged(lag) {} bool getValue() const { return get_create_vwall(m_lag) == 1; } }; struct Overcurrents : Lagged, IntegerSensor { Overcurrents(float lag = 0.1) : Lagged(lag) {} int getValue() const { return get_create_overcurrents(m_lag); } }; struct Infrared : Lagged, IntegerSensor { Infrared(float lag = 0.1) : Lagged(lag) {} int getValue() const { return get_create_infrared(m_lag); } }; struct AdvanceButton : Lagged, BooleanSensor { AdvanceButton(float lag = 0.1) : Lagged(lag) {} bool getValue() const { return get_create_advance_button(m_lag) == 1; } }; struct PlayButton : Lagged, BooleanSensor { PlayButton(float lag = 0.1) : Lagged(lag) {} bool getValue() const { return get_create_play_button(m_lag) == 1; } }; struct BayDigital : Lagged, BooleanSensor { BayDigital(port_t port, float lag = 0.1) : Lagged(lag), m_port(port) {} bool getValue() const { return get_create_bay_DI(m_lag) & ((m_port >= 3) ? 4 : m_port); } private: port_t m_port; }; struct BayAnalog : Lagged, IntegerSensor { BayAnalog(float lag = 0.1) : Lagged(lag) {} int getValue() const { return get_create_bay_AI(m_lag); } }; struct WallAmount : Lagged, IntegerSensor { WallAmount(float lag = 0.1) : Lagged(lag) {} int getValue() const { return get_create_wall_amt(m_lag); } }; struct LeftCliffAmount : Lagged, IntegerSensor { LeftCliffAmount(float lag = 0.1) : Lagged(lag) {} int getValue() const { return get_create_lcliff_amt(m_lag); } }; struct RightCliffAmount : Lagged, IntegerSensor { RightCliffAmount(float lag = 0.1) : Lagged(lag) {} int getValue() const { return get_create_rcliff_amt(m_lag); } }; struct LeftFrontCliffAmount : Lagged, IntegerSensor { LeftFrontCliffAmount(float lag = 0.1) : Lagged(lag) {} int getValue() const { return get_create_lfcliff_amt(m_lag); } }; struct RightFrontCliffAmount : Lagged, IntegerSensor { RightFrontCliffAmount(float lag = 0.1) : Lagged(lag) {} int getValue() const { return get_create_rfcliff_amt(m_lag); } }; } enum CreateMode { Passive, Safe, Full }; struct Create { int connect() { return create_connect(); } void disconnect() { create_disconnect(); } void start() { create_start(); } void passive() { create_passive(); } void safe() { create_safe(); } void full() { create_full(); } void spot() { create_spot(); } void cover() { create_cover(); } void demo(int d) { create_demo(d); } void coverDock() { create_cover_dock(); } void setMode(CreateMode mode) { switch(mode) { case Safe: safe(); return; case Full: full(); return; } passive(); } CreateMode getMode(float lag = 0.1) const { switch(get_create_mode(lag)) { case 1: return Passive; case 2: return Safe; } return Full; } CreateSensor::LeftBump getLeftBump(float lag = 0.1) const {return CreateSensor::LeftBump(lag); } CreateSensor::RightBump getRightBump(float lag = 0.1) const { return CreateSensor::RightBump(lag); } CreateSensor::LeftWheelDrop getLeftWheelDrop(float lag = 0.1) const { return CreateSensor::LeftWheelDrop(lag); } CreateSensor::CasterWheelDrop getCasterWheelDrop(float lag = 0.1) const { return CreateSensor::CasterWheelDrop(lag); } CreateSensor::RightWheelDrop getRightWheelDrop(float lag = 0.1) const { return CreateSensor::RightWheelDrop(lag); } CreateSensor::Wall getWall(float lag = 0.1) const { return CreateSensor::Wall(lag); } CreateSensor::LeftCliff getLeftCliff(float lag = 0.1) const { return CreateSensor::LeftCliff(lag); } CreateSensor::RightCliff getRightCliff(float lag = 0.1) const { return CreateSensor::RightCliff(lag); } CreateSensor::LeftFrontCliff getLeftFrontCliff(float lag = 0.1) const { return CreateSensor::LeftFrontCliff(lag); } CreateSensor::RightFrontCliff getRightFrontCliff(float lag = 0.1) const { return CreateSensor::RightFrontCliff(lag); } CreateSensor::VirtualWall getVirtualWall(float lag = 0.1) const { return CreateSensor::VirtualWall(lag); } CreateSensor::Overcurrents getOvercurrents(float lag = 0.1) const { return CreateSensor::Overcurrents(lag); } CreateSensor::Infrared getInfrared(float lag = 0.1) const { return CreateSensor::Infrared(lag); } CreateSensor::AdvanceButton getAdvanceButton(float lag = 0.1) const { return CreateSensor::AdvanceButton(lag); } CreateSensor::PlayButton getPlayButton(float lag = 0.1) const { return CreateSensor::PlayButton(lag); } int getDistance(float lag = 0.1) { return get_create_distance(lag); } void setDistance(int dist) { set_create_distance(dist); } int getNormalizedAngle(float lag = 0.1) { return get_create_normalized_angle(lag); } int getTotalAngle(float lag = 0.1) { return get_create_total_angle(lag); } void setNormalizedAngle(int a) { set_create_normalized_angle(a); } void setTotalAngle(int a) { set_create_total_angle(a); } CreateSensor::WallAmount getWallAmount(float lag = 0.1) const { return CreateSensor::WallAmount(lag); } CreateSensor::LeftCliffAmount getLeftCliffAmount(float lag = 0.1) const { return CreateSensor::LeftCliffAmount(lag); } CreateSensor::LeftFrontCliffAmount getLeftFrontCliffAmount(float lag = 0.1) const { return CreateSensor::LeftFrontCliffAmount(lag); } CreateSensor::RightFrontCliffAmount getRightFrontcliffAmount(float lag = 0.1) const { return CreateSensor::RightFrontCliffAmount(lag); } CreateSensor::RightCliffAmount getRightCliffAmount(float lag = 0.1) const { return CreateSensor::RightCliffAmount(lag); } CreateSensor::BayDigital getBayDI(port_t port, float lag = 0.1) const { return CreateSensor::BayDigital(port, lag); } CreateSensor::BayAnalog getBayAI(float lag = 0.1) const { return CreateSensor::BayAnalog(lag); } int getSongNumber(float lag = 0.1) const { get_create_song_number(lag); } int getSongPlaying(float lag = 0.1) const { get_create_song_playing(lag); } int getNumberOfStreamPackets(float lag = 0.1) const { get_create_number_of_stream_packets(lag); } int getRequestedVelocity(float lag = 0.1) const { get_create_requested_velocity(lag); } int getRequestedRadius(float lag = 0.1) const { get_create_requested_radius(lag); } int getRequestedRightVelocity(float lag = 0.1) const { get_create_requested_right_velocity(lag); } int getRequestedLeftVelocity(float lag = 0.1) const { get_create_requested_left_velocity(lag); } void stop() { create_stop(); } void drive(int speed, int radius) { create_drive(speed, radius); } void driveStraight(int speed) { create_drive_straight(speed); } void spinCW(int speed) { create_spin_CW(speed); } void spinCCW(int speed) { create_spin_CCW(speed); } void driveDirect(int rSpeed, int lSpeed) { create_drive_direct(rSpeed, lSpeed); } int spinBlock(int speed, int angle) { create_spin_block(speed, angle); } void setAdvanceLed(bool state) { create_advance_led(state ? 1 : 0); } void setPlayLed(bool state) { create_play_led(state ? 1 : 0); } void setPowerLed(int color, int brightness) { create_power_led(color, brightness); } void setDigitalOutput(int bits) { create_digital_output(bits); } void setPWMLowSideDrivers(int pwm24, int pwm22, int pwm23) { create_pwm_low_side_drivers(pwm24, pwm22, pwm23); } void setLowSideDrivers(int pin24, int pin22, int pin23) { create_low_side_drivers(pin24, pin22, pin23); } void loadSong(int num) { create_load_song(num); } void playSong(int num) { create_play_song(num); } }; #endif #endif
[ "bmcdorman@gmail.com" ]
bmcdorman@gmail.com
2fef021fba604d10cee84519080594c118b7ab7b
008c5f264a5e1d5b1a7135db128108e6cf85a415
/sample/linux/logging/main.cpp
b7e27c9dbb3559fe8fa8ef88bd14d6aa2665ecd8
[]
no_license
dxywing1314/Onboard-SDK
12c36d2284f5b8cd638350b65cedd70a3dce547c
955c1eb5b10010a8d64ae7edd6a0f4076721b909
refs/heads/3.4
2021-09-04T00:52:48.509543
2017-11-29T18:29:00
2017-11-29T18:29:00
109,131,211
0
0
null
null
null
null
UTF-8
C++
false
false
927
cpp
/*! @file logging/main.cpp * @version 3.4 * @date Sep 15 2017 * * @brief * Logging API usage in a Linux environment. * Shows example usage of various logging APIs and controls. * * @copyright * 2017 DJI. All rights reserved. * */ #include "logging_sample.hpp" using namespace DJI::OSDK; int main(int argc, char** argv) { DSTATUS("Logging is completely independent of DJI::OSDK::Vehicle."); DSTATUS("In this example, we don't instantiate a Vehicle at all.\n"); // Display interactive prompt std::cout << "| Available commands: |" << std::endl; std::cout << "| [a] Logging Example |" << std::endl; char inputChar; std::cin >> inputChar; switch (inputChar) { case 'a': // Waypoint call dynamicLoggingControlExample(); break; default: break; } return 0; }
[ "samuel.wang@dji.com" ]
samuel.wang@dji.com
77cef29aa4fccc3039c2522adc59199ddb4ab469
23662559b7f193ad89d19453ab95c9963a8db8b0
/mOCCT/mOCCT/MainFrm.cpp
b700b5141d7fbd002a69d817e9bbced055da3245
[]
no_license
Joyce-li-huan/mOCCT
dedba4b34e8e3a60164d9d00c8a82d8d0fcd3a72
863520f9fe2a41e7346835b2f4526a1f4021f4c4
refs/heads/master
2020-11-28T18:18:15.530750
2020-06-15T02:41:17
2020-06-15T02:41:17
229,856,099
0
0
null
null
null
null
UTF-8
C++
false
false
1,825
cpp
 // MainFrm.cpp: CMainFrame 类的实现 // #include "stdafx.h" #include "mOCCT.h" #include "MainFrm.h" #include"htmlhelp.h" //#include"mOCCTView.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CMainFrame IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd) BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) ON_WM_CREATE() END_MESSAGE_MAP() static UINT indicators[] = { ID_SEPARATOR, // 状态行指示器 ID_INDICATOR_CAPS, ID_INDICATOR_NUM, ID_INDICATOR_SCRL, }; // CMainFrame 构造/析构 CMainFrame::CMainFrame() noexcept { // TODO: 在此添加成员初始化代码 } CMainFrame::~CMainFrame() { } int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) { TRACE0("未能创建工具栏\n"); return -1; // 未能创建 } if (!m_wndStatusBar.Create(this)) { TRACE0("未能创建状态栏\n"); return -1; // 未能创建 } m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT)); // TODO: 如果不需要可停靠工具栏,则删除这三行 m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndToolBar); return 0; } BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: 在此处通过修改 // CREATESTRUCT cs 来修改窗口类或样式 return TRUE; } // CMainFrame 诊断 #ifdef _DEBUG void CMainFrame::AssertValid() const { CFrameWnd::AssertValid(); } void CMainFrame::Dump(CDumpContext& dc) const { CFrameWnd::Dump(dc); } #endif //_DEBUG // CMainFrame 消息处理程序
[ "1215345464@qq.com" ]
1215345464@qq.com
9e493d0f0f8dbc7ec48da114b78a3260d35ef746
b969ef7c2e6dbc7ec223ee8a87054a9c2f736658
/sources/Renderer/StaticModuleInterface.h
8c895239209b65410da481d9e9d70245d843731d
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
LukasBanana/LLGL
186241fadbd0a3a77f3e008ca385950cce40273c
3d3b4d708704a6b430f9240003a09faa45f8e8b8
refs/heads/master
2023-08-23T10:29:33.190198
2023-08-23T03:14:48
2023-08-23T03:35:03
62,965,106
1,848
171
BSD-3-Clause
2023-08-28T22:36:19
2016-07-09T19:10:46
C++
UTF-8
C++
false
false
1,141
h
/* * StaticModuleInterface.h * * Copyright (c) 2015 Lukas Hermanns. All rights reserved. * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). */ #ifndef LLGL_STATIC_MODULE_INTERFACE_H #define LLGL_STATIC_MODULE_INTERFACE_H #ifdef LLGL_BUILD_STATIC_LIB #include <LLGL/RenderSystemFlags.h> #include <string> namespace LLGL { class RenderSystem; namespace StaticModule { // Returns the list of staticly compiled modules. std::vector<std::string> GetStaticModules(); // Returns the renderer name of the specified module (module name "Direct3D11" may result in "Direct3D 11" for instance). const char* GetRendererName(const std::string& moduleName); // Returns the renderer ID of the specified module. int GetRendererID(const std::string& moduleName); // Allocates a new renderer system of the specified module. This is an owning raw pointer! RenderSystem* AllocRenderSystem(const RenderSystemDescriptor& renderSystemDesc); } // /namespace StaticModule } // /namespace LLGL #endif // /LLGL_BUILD_STATIC_LIB #endif // ================================================================================
[ "lukas.hermanns90@gmail.com" ]
lukas.hermanns90@gmail.com
f1a1d94cd788b0f4343e39e9edf9f29b5719dbb3
2353608d73bea4912978ffe9902e741bafc6b51c
/BtnActiveXUse/BtnActiveXUseDlg.cpp
ebd495854c0c2d5ce8cc0f28981b1f96243609a4
[]
no_license
fafi09/MFCBase
adeef74231bebd832f9a7097d89d987f838291b3
03d1b65ea932f28ff446e344d42c8397c8ec8a63
refs/heads/master
2020-03-07T18:15:42.719339
2018-05-19T08:03:16
2018-05-19T08:03:16
127,632,476
0
1
null
null
null
null
GB18030
C++
false
false
4,144
cpp
// BtnActiveXUseDlg.cpp : 实现文件 // #include "stdafx.h" #include "BtnActiveXUse.h" #include "BtnActiveXUseDlg.h" #include "afxdialogex.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // 用于应用程序“关于”菜单项的 CAboutDlg 对话框 class CAboutDlg : public CDialogEx { public: CAboutDlg(); // 对话框数据 enum { IDD = IDD_ABOUTBOX }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 // 实现 protected: DECLARE_MESSAGE_MAP() }; CAboutDlg::CAboutDlg() : CDialogEx(CAboutDlg::IDD) { } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx) END_MESSAGE_MAP() // CBtnActiveXUseDlg 对话框 CBtnActiveXUseDlg::CBtnActiveXUseDlg(CWnd* pParent /*=NULL*/) : CDialogEx(CBtnActiveXUseDlg::IDD, pParent) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CBtnActiveXUseDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); DDX_Control(pDX, IDC_BTNACTIVEXCTRL1, m_wndButton); } BEGIN_MESSAGE_MAP(CBtnActiveXUseDlg, CDialogEx) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON_WM_QUERYDRAGICON() ON_COMMAND(IDC_BTNACTIVEXCTRL1, &CBtnActiveXUseDlg::OnBtnactivexctrl1) END_MESSAGE_MAP() // CBtnActiveXUseDlg 消息处理程序 BOOL CBtnActiveXUseDlg::OnInitDialog() { CDialogEx::OnInitDialog(); // 将“关于...”菜单项添加到系统菜单中。 // IDM_ABOUTBOX 必须在系统命令范围内。 ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { BOOL bNameValid; CString strAboutMenu; bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); ASSERT(bNameValid); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动 // 执行此操作 SetIcon(m_hIcon, TRUE); // 设置大图标 SetIcon(m_hIcon, FALSE); // 设置小图标 // TODO: 在此添加额外的初始化代码 return TRUE; // 除非将焦点设置到控件,否则返回 TRUE } void CBtnActiveXUseDlg::OnSysCommand(UINT nID, LPARAM lParam) { if ((nID & 0xFFF0) == IDM_ABOUTBOX) { CAboutDlg dlgAbout; dlgAbout.DoModal(); } else { CDialogEx::OnSysCommand(nID, lParam); } } // 如果向对话框添加最小化按钮,则需要下面的代码 // 来绘制该图标。对于使用文档/视图模型的 MFC 应用程序, // 这将由框架自动完成。 void CBtnActiveXUseDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // 用于绘制的设备上下文 SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0); // 使图标在工作区矩形中居中 int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // 绘制图标 dc.DrawIcon(x, y, m_hIcon); } else { CDialogEx::OnPaint(); } } //当用户拖动最小化窗口时系统调用此函数取得光标 //显示。 HCURSOR CBtnActiveXUseDlg::OnQueryDragIcon() { return static_cast<HCURSOR>(m_hIcon); } void CBtnActiveXUseDlg::OnBtnactivexctrl1() { AfxMessageBox(TEXT("onclick")); } BEGIN_EVENTSINK_MAP(CBtnActiveXUseDlg, CDialogEx) ON_EVENT(CBtnActiveXUseDlg, IDC_BTNACTIVEXCTRL1, DISPID_CLICK, CBtnActiveXUseDlg::ClickBtnactivexctrl1, VTS_NONE) ON_EVENT(CBtnActiveXUseDlg, IDC_BTNACTIVEXCTRL1, 1, CBtnActiveXUseDlg::MyClickBtnactivexctrl1, VTS_NONE) ON_EVENT(CBtnActiveXUseDlg, IDC_BTNACTIVEXCTRL1, 3, CBtnActiveXUseDlg::MyClick2Btnactivexctrl1, VTS_NONE) END_EVENTSINK_MAP() void CBtnActiveXUseDlg::ClickBtnactivexctrl1() { AfxMessageBox(TEXT("在资源管理器中添加click")); } void CBtnActiveXUseDlg::MyClickBtnactivexctrl1() { AfxMessageBox(TEXT("在资源管理器中添加myclick")); } void CBtnActiveXUseDlg::MyClick2Btnactivexctrl1() { //AfxMessageBox(TEXT("在资源管理器中添加myclick2")); }
[ "fafi09@126.com" ]
fafi09@126.com
d495908795c406e10502b1cad0f2735bf98855b5
2029bee0e6f6299a88992a18137f13a54365e714
/Src/FM79979Engine/Core/Image/PuzzleImage.h
962335cda0c8aa8f55cc900b535cd823c9da265d
[]
no_license
fatmingwang/FM79979-
822813ff82230477bf79b3f630569956e46f293b
912e4f89d34445e5e8ca41be2e592cb2665ef028
refs/heads/master
2020-03-29T21:23:29.726794
2018-10-02T09:01:52
2018-10-02T09:01:52
150,364,084
0
0
null
null
null
null
UTF-8
C++
false
false
9,612
h
#ifndef PuzleImage_H #define PuzleImage_H namespace FATMING_CORE { class cPuzzleImage; class cStaticAnimation; class cNumeralImage; class cBaseImage; //======================= //for puzzleimage unit //======================= struct sUVData { float fUV[4]; //texture uv. POINT OffsetPos; //offset position,via this we coul add alpha part to the detination texture while create texture. POINT Size; //the width and height we draw on screen. POINT OriginalSize; //orginal image size,animation image have same size for each image. POINT ShowPosInPI; //the left top pixel position in the pi image,this is for accurate to the position show on the pi,because UV it is possible to lost 1 pixel. inline sUVData() { memset(this,0,sizeof(sUVData)); } //the render position is center of image,but it's possible alpha pixels were strip,so we have to adjust the center. //it will like this: half render size( strip size ) + GetCenterOffsetx //so it's final center offset size. //it has a serious problem...if the offset pixel is not same //it might occur visual error inline Vector2 GetCenterOffsetxWithRenderSize( Vector2 e_vRenderSize ) { Vector2 l_vScalr( ((float)e_vRenderSize.x/Size.x),((float)e_vRenderSize.y/Size.y) ); Vector2 l_vCenterOffset( OriginalSize.x/2.f-OffsetPos.x,OriginalSize.y/2.f-OffsetPos.y ); l_vCenterOffset.x*=l_vScalr.x; l_vCenterOffset.y*=l_vScalr.y; return l_vCenterOffset; } }; //derive from UV data with name struct sPuzzleData:public sUVData { std::wstring strFileName; sPuzzleData(){} inline sPuzzleData(const wchar_t*e_strName,float*e_pfUV,POINT e_OffsetPos,POINT e_Size,POINT e_OriginalSize,POINT e_ShowPosInPI) { ShowPosInPI = e_ShowPosInPI; OriginalSize = e_OriginalSize; strFileName = e_strName; memcpy(fUV,e_pfUV,sizeof(float)*4); OffsetPos = e_OffsetPos; Size = e_Size; } }; //======================= //here is quite painful,because the machine is not good enough so we have to test any possible let image //be mip at one image,or just an image that stretch to pow of two, //basicly we just need puzzle image,but sometimes we still need to using stretch image to save loaduing time,and saving some memory. //======================= class cPuzzleImageUnit:public cBaseImage { GET_SET_DEC(cPuzzleImageUnit*,m_pNext,GetNext,SetNext); GET_SET_DEC(cPuzzleImageUnit*,m_pPrior,GetPrior,SetPrior); sPuzzleData* m_pPuzzleData; std::vector<Vector2>* m_pImageShapePointVector; public: DEFINE_TYPE_INFO() cPuzzleImageUnit(sPuzzleData*e_pPuzzleData,cPuzzleImage*e_pPuzzleImageParent); cPuzzleImageUnit(cPuzzleImageUnit*e_pPuzzleImageUnit); cPuzzleImageUnit(cBaseImage*e_pBaseImage); CLONE_MYSELF(cPuzzleImageUnit); virtual ~cPuzzleImageUnit(); sPuzzleData* GetPuzzleData(){return m_pPuzzleData;} static cPuzzleImageUnit* GetMe(TiXmlElement*e_pElement,bool e_bClone = true); }; //================ //this one for gather animation image data, //if we have those data we could simply assign data wjen we are editting the animation // //while calling remover object..... //ensure the parameter is index not name,or it's possible to kill wrong object // //================ class cImageIndexOfAnimation:public NamedTypedObject { float* m_pfEndTime; public: struct sImageIndexAndTimeGap { int iIndex; float fTimeGap; sImageIndexAndTimeGap(){ iIndex = -1;fTimeGap = -1.f;} sImageIndexAndTimeGap(int e_iIndex,float e_fTimeGap) { iIndex = e_iIndex; fTimeGap = e_fTimeGap; } }; //while it is editor using this,in the game this one should delete or debug std::vector<wstring> *m_pNameList; //while it's in the game using this std::vector<sImageIndexAndTimeGap> m_ImageAnimationDataList; cImageIndexOfAnimation(bool e_bNewNameList) { m_pNameList = 0; if(e_bNewNameList) m_pNameList = new std::vector<std::wstring>; m_pfEndTime = 0; } //not a pointer reference it will new the data,but it's very rare to be called(ex:in the editor) cImageIndexOfAnimation(cImageIndexOfAnimation*e_pImageIndexOfAnimation); cImageIndexOfAnimation(cStaticAnimation*e_pStaticAnimation); CLONE_MYSELF(cImageIndexOfAnimation); virtual ~cImageIndexOfAnimation() { SAFE_DELETE(m_pNameList); SAFE_DELETE(m_pfEndTime); } void GenerateImageIndexByPI(cPuzzleImage*e_pPI,std::vector<std::wstring> *e_pNameList); int GetImageIndex(int e_iIndex,cPuzzleImage*e_pPI); void Clear() { if( m_pNameList ) m_pNameList->clear(); m_ImageAnimationDataList.clear(); } void AddNameObject(const wchar_t*e_strName,int e_iIndex,float e_fTimeGap) { std::wstring l_strName = e_strName; m_pNameList->push_back(l_strName); m_ImageAnimationDataList.push_back(sImageIndexAndTimeGap(e_iIndex,e_fTimeGap)); } void RemoveNameObject(int e_iIndex) { m_pNameList->erase(m_pNameList->begin()+e_iIndex); m_ImageAnimationDataList.erase(m_ImageAnimationDataList.begin()+e_iIndex); } int Count() { return (int)m_ImageAnimationDataList.size(); } inline float GetEndTime() { if( !m_pfEndTime ) { m_pfEndTime = new float; *m_pfEndTime = 0.f; size_t l_iSize = m_ImageAnimationDataList.size(); for( size_t i = 0;i<l_iSize;++i ) { *m_pfEndTime += m_ImageAnimationDataList[i].fTimeGap; } } return *m_pfEndTime; } int GetImageIndexByCurrentTime( float e_fTime ); }; //if GeneratePuzzleimageUnit is 1,we will generate puzzleimageUnit,but it cost a tiny loading time. //!!but currently I do not make this actived!!! //<PuzzleImage Name="79979" Count="6" GeneratePuzzleimageUnit="0"> // <PuzzleUnit Name="ST2StonePart" UV="0,0,0.32875,0.1275," OffsetPos="9,9," Size="263,102" /> // <PuzzleUnit Name="ST3StonePart" UV="0.33,0,0.81875,0.11625," OffsetPos="4,4," Size="391,93" /> // <PuzzleUnit Name="ST4StonePart" UV="0,0.12875,0.3575,0.2525," OffsetPos="11,11," Size="286,99" /> // <PuzzleUnit Name="ST5StonePart" UV="0.35875,0.12875,0.885,0.25375," OffsetPos="52,52," Size="421,100" /> // <PuzzleUnit Name="ST6StonePart" UV="0,0.255,0.33375,0.39125," OffsetPos="30,30," Size="267,109" /> // <PuzzleUnit Name="ST7StonePart" UV="0.335,0.255,0.665,0.38375," OffsetPos="5,5," Size="264,103" /> //</PuzzleImage> //========================== //uv is not store base image,it's in m_PuzzleDataList //do not add any object into list,or it could be occur error, //we have just GenerateAllPuzzleImageUnit while parse data //========================== class cPuzzleImage:virtual public cBaseImage,virtual public cNamedTypedObjectVector<cPuzzleImageUnit>,public cNodeISAX { virtual bool MyParse(TiXmlElement*e_pRoot); void ProcessAnimationData(TiXmlElement*e_pElement); void ProcessPuzzleUnit(TiXmlElement*e_pElement,int e_iIndex); void ProcessDataCheck(TiXmlElement*e_pElement); // //for animation in the pi image GET_SET_DEC(cNamedTypedObjectVector<cImageIndexOfAnimation>*,m_pImageIndexOfAnimation,GetImageIndexOfAnimationList,SetImageIndexOfAnimationList); //for particle //for quickly to share all children's UV data,if only works while call GenerateAllUVToTriangleStrip float* m_pfAllChildrenTriangleStripUV; //for quickly to share all children's UV data,if only works while call GenerateAllfUVToTwoTriangle float* m_pfAllChildrenTwoTriangleUV; //as how manay m_pPuzzleData int m_iNumImage; //image data uv offset pos and name.... sPuzzleData*m_pAllPuzzleData; std::vector<std::vector<Vector2>*>* m_pImageShapePointVectorVector; std::vector<int>* m_pImageShapePointLODVector; //internal using,generate all image unit while parse data is done void GenerateAllPuzzleImageUnit(); public: DEFINE_TYPE_INFO() cPuzzleImage(); cPuzzleImage(cPuzzleImage*e_pPuzzleImage); //cPuzzleImage(char*e_strName,std::vector<sPuzzleData> *e_pPuzzleDataList,bool e_bGenerateAllUnit = false,bool e_bFetchPixels = false); CLONE_MYSELF(cPuzzleImage); virtual ~cPuzzleImage(); //for editor static bool m_sbSortPIFileAsOriginal; virtual void Render()override { cBaseImage::Render(); } void Render(int e_iIndex); //dump data into destination,so we could delete the source puzzleImage. //void DumpIntoPuzzleImage(cPuzzleImage*e_pPuzzleImage); //the count as many as GetNum,or instead call (*GetPuzzleDataList())[iIndex] sPuzzleData* GetAllPuzzleData() { return m_pAllPuzzleData; } sPuzzleData* GetPuzzleData(int e_iIndex){ return &m_pAllPuzzleData[e_iIndex]; } int GetNumImage() { return m_iNumImage; } std::vector<std::vector<Vector2>*>* GetImageShapePointVectorVector(); std::vector<Vector2>* GetImageShapePointVector(int e_iIndex); int GetImageShapePointLOD(int e_iIndex); //make sure the Numeral image all have same size, //and it's sequence,and remember delete it after use it, //ensure u have no release puzzle image before delete Numeral image cNumeralImage* GetNumeralImageByName(const wchar_t*e_strNumerImageName); cNumeralImage* GetNumeralImageByName(const wchar_t*e_str0ImaneName,const wchar_t*e_str9ImaneName); //for particle float* GetAllChildrenTriangleStripUV(); float* GetAllChildrenTwoTriangleUV(); // static std::string GetFileName(const wchar_t*e_strObjectName); static std::string GetFileName(const char*e_strObjectName); //static cPuzzleImage* GetMe(TiXmlElement*e_pElement); }; } #endif//end PuzleImage_H
[ "osimejp@yahoo.co.jp" ]
osimejp@yahoo.co.jp
5312afe409c8c8749a8e8d3fa1e5881bf75950c4
3392e27b71ed4c99050b27484ec1d7df62eb1667
/src-reading/muduo-cpp11/examples/protobuf/resolver/server.cc
bf9693f5bf2d672cf69062993c3d4e58d622f75e
[ "BSD-3-Clause", "MIT" ]
permissive
cheukw/sample
6d2e5217f64774bbde5dc470e172e5693f855eac
602d5d055c3e11e1e0ba385128e64b9c0aa81305
refs/heads/master
2021-01-19T11:45:55.011758
2017-08-11T09:17:46
2017-08-11T09:17:46
82,263,122
0
0
null
null
null
null
UTF-8
C++
false
false
2,128
cc
#include <examples/protobuf/resolver/resolver.pb.h> #include <muduo/base/Logging.h> #include <muduo/net/EventLoop.h> #include <muduo/net/protorpc/RpcServer.h> #include <examples/cdns/Resolver.h> using namespace muduo; using namespace muduo::net; namespace resolver { class ResolverServiceImpl : public ResolverService { public: ResolverServiceImpl(EventLoop* loop) : resolver_(loop, cdns::Resolver::kDNSonly) { } virtual void Resolve(::google::protobuf::RpcController* controller, const ::resolver::ResolveRequest* request, ::resolver::ResolveResponse* response, ::google::protobuf::Closure* done) { LOG_INFO << "ResolverServiceImpl::Resolve " << request->address(); bool succeed = resolver_.resolve(request->address(), std::bind(&ResolverServiceImpl::doneCallback, this, request->address(), _1, response, done)); if (!succeed) { response->set_resolved(false); done->Run(); } } private: void doneCallback(const std::string& host, const muduo::net::InetAddress& address, ::resolver::ResolveResponse* response, ::google::protobuf::Closure* done) { LOG_INFO << "ResolverServiceImpl::doneCallback " << host; int32_t ip = address.ipNetEndian(); if (ip) { response->set_resolved(true); response->add_ip(ip); response->add_port(address.portNetEndian()); } else { response->set_resolved(false); } done->Run(); } cdns::Resolver resolver_; }; } int main() { LOG_INFO << "pid = " << getpid(); EventLoop loop; InetAddress listenAddr(2053); resolver::ResolverServiceImpl impl(&loop); RpcServer server(&loop, listenAddr); server.registerService(&impl); server.start(); loop.loop(); }
[ "zhuorongtan@qq.com" ]
zhuorongtan@qq.com
87c3811d2c3311737b17ae7564cdfd628e855aa8
eaf159b781e4ef0c7aa5312bf2e840baecc4e8f8
/tactodeArduino/tactodeArduino.ino
631ffa855273931797dc360dbfd19b8070bb239b
[]
no_license
manuelmaria101/Tactode_arduino
6597afd06c63d99b8768e54261261fbb9c6e1e6c
9ffd7bd32d4b54f3737c6cd90e0905b9885e50a1
refs/heads/master
2022-04-09T16:49:02.766600
2020-02-12T14:39:55
2020-02-12T14:39:55
198,189,562
0
0
null
null
null
null
UTF-8
C++
false
false
3,091
ino
#define TIMEOUT 2000 typedef struct CmdMove { int t; int vel; } cmdMove; typedef struct CmdRotate { int angle; int vel; } cmdRotate; typedef struct Tile { char type; union Data { cmdMove Move; cmdRotate Rotate; } data; } tile; /*-----------------------------------------------------DECLARE VARIABLES---------------------------------------------*/ tile my_tile; char program[] = "M 2000 50\nW 90 50\nM 2000 50\nW 90 50\nM 2000 50\nW 90 50\nM 2000 50\nW 90 50\nS"; int i = 0; float my_angle = 0; byte next = 0; /*-----------------------------------------------------END OF VARIABLE DECLARATION---------------------------------------------*/ void setup() { Serial.begin(115200); } void loop() { if (next == 0) { readNewTile(); next = 1; } else if (next != 0 && robot.state == 1 && tis >= my_tile.data.Move.t) { next = 0; } else if (next != 0 && robot.state == 2 && (robot.dtheta > my_angle)) { next = 0; } if (robot.state == 1) //MOVE TILE { moveRobot(my_tile.data.Move.vel, 0); } else if (robot.state == 2) //ROTATE TILE { moveRobot(0, my_tile.data.Rotate.vel); } else if (robot.state == 0) //STOP TILE { moveRobot(0, 0); } /*------------------DEBUG----------------*/ Serial.print(F("Robot State: ")); Serial.print(robot.state); Serial.print(F(" tis: ")); Serial.print(tis); Serial.print(F(" theta: ")); Serial.print(robot.dtheta); Serial.print(F(" TYPE: ")); Serial.print(my_tile.type); Serial.print(F(" t: ")); Serial.print(my_tile.data.Move.t); Serial.print(F(" vel: ")); Serial.print(my_tile.data.Move.vel); Serial.print(F(" angle: ")); Serial.print(my_tile.data.Rotate.angle); Serial.print(F(" Rotate vel: ")); Serial.print(my_tile.data.Rotate.vel); Serial.println(); } /*-----------------------------------------------------FUNCTIONS---------------------------------------------*/ void readNewTile(void) { char trash; char line[strlen(program)]; int j; j = 0; for ( ; program[i] != '\0'; i++) { if (program[i] == '\n') { i++; break; } else { line[j] = program[i]; j++; } } sscanf(line, "%c", &my_tile.type); Serial.println(line); if (my_tile.type == 'M') { sscanf(line, "%c %d %d", &trash, &my_tile.data.Move.t, &my_tile.data.Move.vel); } else if (my_tile.type == 'W') { sscanf(line, "%c %d %d", &trash, &my_tile.data.Rotate.angle, &my_tile.data.Rotate.vel); my_angle = refresh_angle(my_tile.data.Rotate.angle); } else if (my_tile.type == 'S') { my_tile.data.Move.t = 0; my_tile.data.Move.vel = 0; my_tile.data.Rotate.angle = 0; my_tile.data.Rotate.vel = 0; } chooseState(); } void chooseState(void) { if (my_tile.type == 'M') { setState(1); } else if (my_tile.type == 'W') { setState(2); } else if (my_tile.type == 'S') { setState(0); } } float refresh_angle(int my_angle) { float new_angle = my_angle * PI / 180; return new_angle; }
[ "manuelmaria101@gmail.com" ]
manuelmaria101@gmail.com
a4bca2a7d7d358244c68a132cef6ccfdf5601246
c53eb8bca022c20dbdf4194c9c4eccfbf3e6ae89
/firmware/libraries/lava_patterns/PatternSpiral.cpp
abb1bb11147769874230650e292a3383bcdd5c8e
[ "MIT" ]
permissive
lavallc/ion
d0fca39f602356e942377106eb06a21eaaee4724
c9292e832309a14f0725ab8794be75c0a9f10cef
refs/heads/master
2020-04-06T03:32:28.861124
2015-07-22T01:11:32
2015-07-22T01:11:32
39,477,562
5
1
null
null
null
null
UTF-8
C++
false
false
4,946
cpp
/* * PatternSpiral.cpp * * Created on: Jan 24, 2014 * Author: Salemancer * Pattern Creator: Salemancer */ #include "PatternSpiral.h" #include "PatternHelpers.h" CPatternSpiral PatternSpiral; void CPatternSpiral::start(LumenMoodConfig * configs, bool restore_to_defaults) { for (int i = 0; i < kSunBoardNumberOfLedsPerRay; i++) { pattern_next[i] = 0; } for (int i = 9; i >= 0; i-=4) { pattern_next[i] = 255; pattern_next[i-1] = 255; } PatternHelpers.progress = 255; index = 8; changes_ready = 0; if (configs == NULL) { PatternHelpers.hue[0][0] = 0; PatternHelpers.saturation[0][0] = 255; PatternHelpers.speed = 26; value = 190; } else if(configs->mood_id == (uint8_t)get_pattern_id()) { PatternHelpers.hue[0][0] = configs->config_data[0].data; PatternHelpers.saturation[0][0] = configs->config_data[1].data; PatternHelpers.speed = configs->config_data[2].data; value = configs->config_data[3].data; } else { //We were sent the wrong configs! //This will indicate a restart; } } void CPatternSpiral::get_pattern_config(LumenMoodConfig * configs){ configs->config_data[0].config_id = kPatternSpiralConfigSetHue; configs->config_data[0].data = PatternHelpers.hue[0][0]; configs->config_data[1].config_id = kPatternSpiralConfigSetSaturation; configs->config_data[1].data = PatternHelpers.saturation[0][0]; configs->config_data[2].config_id = kPatternSpiralConfigSetSpeed; configs->config_data[2].data = PatternHelpers.speed; configs->config_data[3].config_id = kPatternSpiralConfigSetBrightness; configs->config_data[3].data = value; } void CPatternSpiral::step() { if (changes_ready == 3) { PatternHelpers.hue[0][0] = PatternHelpers.hue[0][1]; PatternHelpers.saturation[0][0] =PatternHelpers.saturation[0][1]; changes_ready = 0; } if(PatternHelpers.progress >= 255) { //reset moving index and tween PatternHelpers.progress PatternHelpers.progress = 0; index--; if(index == 5)index = 9; //lets copy pattern_next into pattern for(int i=0; i<kSunBoardNumberOfLedsPerRay; i++) { pattern[i] = pattern_next[i]; } //then calculate pattern next for(int i=0; i<kSunBoardNumberOfLedsPerRay - 1; i++) { pattern_next[i] = pattern_next[i+1]; } if (index == 9 || index == 8) pattern_next[9] = PatternHelpers.saturation[0][0]; else pattern_next[9] = 0; } int s; int v; //lerp from pattern to pattern_next for(int i = 0; i<kSunBoardNumberOfLedsPerRay; i++) { //Brightness lerping for red lines. /* if (pattern_next[i] > pattern[i]) v = PatternHelpers.lerp(50, value, PatternHelpers.progress); else if (pattern_next[i] < pattern[i]) v = PatternHelpers.lerp(value, 50, PatternHelpers.progress); else if (pattern_next[i] == 255) v = value; else v = 50; */ //Lerp hue from bottom up, diagonally. s = PatternHelpers.lerp(pattern[i], pattern_next[i], PatternHelpers.progress); Lumen.leds->set_pixel_hsv(0,i, PatternHelpers.hue[0][0], s, value); Lumen.leds->set_pixel_hsv(1,i-3, PatternHelpers.hue[0][0], s, value); Lumen.leds->set_pixel_hsv(2,i-2, PatternHelpers.hue[0][0], s, value); Lumen.leds->set_pixel_hsv(3,i-1, PatternHelpers.hue[0][0], s, value); } for(int i = 6; i<kSunBoardNumberOfLedsPerRay; i++) { //Brightness lerping for red lines. /* if (pattern_next[i] > pattern[i]) v = PatternHelpers.lerp(50, value, PatternHelpers.progress); else if (pattern_next[i] < pattern[i]) v = PatternHelpers.lerp(value, 50, PatternHelpers.progress); else if (pattern_next[i] == 255) v = value; else v = 50; */ //Lerp hue from mid down diagonally. s = PatternHelpers.lerp(pattern[i], pattern_next[i], PatternHelpers.progress); Lumen.leds->set_pixel_hsv(1,i+1, PatternHelpers.hue[0][0], s, value); Lumen.leds->set_pixel_hsv(2,i+2, PatternHelpers.hue[0][0], s, value); Lumen.leds->set_pixel_hsv(3,i+3, PatternHelpers.hue[0][0], s, value); } PatternHelpers.progress += PatternHelpers.speed; } void CPatternSpiral::set_pattern_hue(int new_hue) { PatternHelpers.hue[0][1] = new_hue; changes_ready = changes_ready | 0x01; } void CPatternSpiral::set_pattern_saturation(int new_saturation) { PatternHelpers.saturation[0][1] = new_saturation; changes_ready = changes_ready | 0x02; } void CPatternSpiral::set_pattern_brightness(int new_brightness) { value = new_brightness; } void CPatternSpiral::set_pattern_speed(int new_speed) { PatternHelpers.speed = new_speed; } uint32_t CPatternSpiral::get_pattern_id() { return 0x00000006; } void CPatternSpiral::handle_config_data(uint8_t config_id, uint32_t data) { switch(config_id) { case kPatternSpiralConfigSetHue: this->set_pattern_hue((int)data); break; case kPatternSpiralConfigSetSaturation: this->set_pattern_saturation((int)data); break; case kPatternSpiralConfigSetSpeed: this->set_pattern_speed((int)data); break; case kPatternSpiralConfigSetBrightness: this->set_pattern_brightness((int)data); break; } }
[ "ericb@ericbarch.com" ]
ericb@ericbarch.com
d6d00b41177694fef97e05e7f4b9fd743f3639c6
0c4a89fa120971fd336ab70a25008e2d9e592292
/code_notes/工作中笔记/公司基础库/jcdisplaymonitor.h
bbe3f3b82cedd21888218671be285b155b614d4b
[]
no_license
ralex1975/private_notes
39d0769f563c25dcc85e48d3c9c46b5facbff20c
5126e4c5607eecbb3dad03b3af44792323b1528d
refs/heads/master
2020-05-22T01:51:05.740075
2019-04-22T14:11:12
2019-04-22T14:11:12
null
0
0
null
null
null
null
GB18030
C++
false
false
2,491
h
/****************************************************************************** * 文件名: jcdisplaymonitor.h * 描述: PC显示器操作 * Copyright(c)2014-2016 JCDZ Co.,Ltd. * * 修改记录: * -------------------- * v1.0 2014/07/10 9:38:52, lys 创建文件 * ******************************************************************************/ #ifndef _JCDISPLAYMONITOR_H_ #define _JCDISPLAYMONITOR_H_ #if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__) #else /*end linux*/ #include <windows.h> #include <vector> #include "jcbase.h" using namespace std; struct DLL_EXPORT JCMonitorInfo { MONITORINFOEX m_nMonitorRawInfo; HMONITOR m_hMonitorHandle; HDC m_hMonitorHdc; }; typedef vector<JCMonitorInfo> JCMonitorInfoSet; typedef vector<DISPLAY_DEVICE> JCDispDevInfoSet; class DLL_EXPORT JCDisplayMonitor { public: enum DisplayMode { DISPLAY_TYPE_SINGLE, DISPLAY_TYPE_CLONE, DISPLAY_TYPE_EXTEND }; enum ErrorCode { SUCCESS, NO_MONITOR, ONLYONE_MONITOR, DEVINFO_ERROR, SET_FAILED }; JCDisplayMonitor(); virtual ~JCDisplayMonitor(); static BOOL MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData); static unsigned int EnumMonitors(); static unsigned int EnumDispDevices(); static JCMonitorInfoSet &MonitorsInfo(); static JCDispDevInfoSet &DispDevInfo(); static ErrorCode SetDisplayMode(DisplayMode eMode, unsigned int nX, unsigned int nY, bool bExChange = false); private: static JCMonitorInfoSet m_tMonitorInfo; static JCDispDevInfoSet m_tDispDevInfo; }; class DLL_EXPORT JCScreenPaint { public: JCScreenPaint(); virtual ~JCScreenPaint(); bool InitDC(); void DrawBmp(const string &strBmpPath); void DrawLine(POINT tStartPoint, POINT tEndPoint, unsigned int nLineType , unsigned int nWidth, COLORREF tPenColor); void DrawPoint(POINT pt, unsigned int nLineWidth, unsigned int nWidth, COLORREF tPenColor); void DrawPolygon(POINT pt[], unsigned int nPtNum, unsigned int nFillMode, COLORREF tFillColor , unsigned int nLineType, COLORREF tLineColor); void DrawCircle(unsigned int nCenterX, unsigned int nCenterY , unsigned int nRadius, unsigned int nLineType, int nWidth, COLORREF tPenColor); void RePaint(); private: HDC m_hDestDC ; HDC m_hSrcDC ; // source DC - memory device context unsigned int m_nDestWidth; unsigned int m_nDestHeight; unsigned int m_nSrcWidth; unsigned int m_nSrcHeight; }; #endif /*end win32*/ #endif /* _JCDISPLAYMONITOR_H_ */
[ "liumingjie.blog@gmail.com" ]
liumingjie.blog@gmail.com
e0ba947377dfa86a77e37d6e7dbb019270b282b3
146d134168c9e348e66e52e34c1296e5023d0df3
/src/OSDWindow.hh
4a070a2adbf5ee38be32eadfd6e45328894afb3d
[ "MIT" ]
permissive
ystk/debian-fluxbox
1e5810e63baf250b1665b6d6736754be4627f8ea
973f6b0a10e45221ae31e1f6e3a5b0b24b640b5a
refs/heads/master
2016-09-06T09:00:28.608741
2010-07-12T11:23:08
2010-07-12T11:23:08
35,472,683
1
0
null
null
null
null
UTF-8
C++
false
false
2,248
hh
// OSDWindow.hh // Copyright (c) 2008 Fluxbox Team (fluxgen at fluxbox dot org) // // 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. #ifndef OSDWINDOW_HH #define OSDWINDOW_HH #include "FbTk/FbWindow.hh" #include <string> class BScreen; class FbWinFrameTheme; namespace FbTk { template <class T> class ThemeProxy; } class OSDWindow: public FbTk::FbWindow { public: OSDWindow(const FbTk::FbWindow &parent, BScreen &screen, FbTk::ThemeProxy<FbWinFrameTheme> &theme): FbTk::FbWindow(parent, 0, 0, 10, 10, 0, false, true), m_screen(screen), m_theme(theme), m_pixmap(None), m_visible(false) { } void reconfigTheme(); void resize(const std::string &text); void showText(const std::string &text); void hide(); bool isVisible() const { return m_visible; } BScreen &screen() const { return m_screen; } FbTk::ThemeProxy<FbWinFrameTheme> &theme() { return m_theme; } protected: /// Force visible status, use with care. void setVisible(bool visible) { m_visible = visible; } private: void show(); BScreen &m_screen; FbTk::ThemeProxy<FbWinFrameTheme> &m_theme; Pixmap m_pixmap; bool m_visible; }; #endif // OSDWINDOW_HH
[ "skerlet@swc.toshiba.co.jp" ]
skerlet@swc.toshiba.co.jp
5976f8b248eff1986808b58d539d4d5f9e0fe953
c409fea2ee76de52a234e35cf3bd1a6d243897ab
/iLiveRPL/ipv6-olsr/model/rpl-private.h
61e9c59ddb1967de6295e372a1a406e66e4bb7b0
[]
no_license
elgholami/iLive-CLAS
6a992fc81a0d4fed8f4f373b56f674bd8d1eca73
9899d34c3642f2a67b946c4093ac7f1ab0561ba5
refs/heads/master
2021-01-17T10:16:32.255500
2013-07-02T17:55:56
2013-07-02T17:55:56
null
0
0
null
null
null
null
UTF-8
C++
false
false
10,185
h
/* * Private declarations for ContikiRPL. */ #ifndef RPL_PRIVATE_H #define RPL_PRIVATE_H #include "rpl.h" #include "list.h" #include "ns3/ipv6-address.h" #include "ns3/ipv6.h" #include "ns3/timer.h" namespace ns3 { namespace rpl { /*---------------------------------------------------------------------------*/ /** \brief Is IPv6 address addr the link-local, all-RPL-nodes multicast address? */ #define uip_is_addr_linklocal_rplnodes_mcast(addr) \ ((addr)->u8[0] == 0xff) && \ ((addr)->u8[1] == 0x02) && \ ((addr)->u16[1] == 0) && \ ((addr)->u16[2] == 0) && \ ((addr)->u16[3] == 0) && \ ((addr)->u16[4] == 0) && \ ((addr)->u16[5] == 0) && \ ((addr)->u16[6] == 0) && \ ((addr)->u8[14] == 0) && \ ((addr)->u8[15] == 0x1a)) /** \brief Set IP address addr to the link-local, all-rpl-nodes multicast address. */ #define uip_create_linklocal_rplnodes_mcast(addr) Ipv6Address((addr), 0xff02, 0, 0, 0, 0, 0, 0, 0x001a) /*---------------------------------------------------------------------------*/ /* RPL message types */ #define RPL_CODE_DIS 0x00 /* DAG Information Solicitation */ #define RPL_CODE_DIO 0x01 /* DAG Information Option */ #define RPL_CODE_DAO 0x02 /* Destination Advertisement Option */ #define RPL_CODE_DAO_ACK 0x03 /* DAO acknowledgment */ #define RPL_CODE_SEC_DIS 0x80 /* Secure DIS */ #define RPL_CODE_SEC_DIO 0x81 /* Secure DIO */ #define RPL_CODE_SEC_DAO 0x82 /* Secure DAO */ #define RPL_CODE_SEC_DAO_ACK 0x83 /* Secure DAO ACK */ /* RPL control message options. */ #define RPL_OPTION_PAD1 0 #define RPL_OPTION_PADN 1 #define RPL_OPTION_DAG_METRIC_CONTAINER 2 #define RPL_OPTION_ROUTE_INFO 3 #define RPL_OPTION_DAG_CONF 4 #define RPL_OPTION_TARGET 5 #define RPL_OPTION_TRANSIT 6 #define RPL_OPTION_SOLICITED_INFO 7 #define RPL_OPTION_PREFIX_INFO 8 #define RPL_OPTION_TARGET_DESC 9 #define RPL_DAO_K_FLAG 0x80 /* DAO ACK requested */ #define RPL_DAO_D_FLAG 0x40 /* DODAG ID present */ /*---------------------------------------------------------------------------*/ /* RPL IPv6 extension header option. */ #define RPL_HDR_OPT_LEN 4 #define RPL_HOP_BY_HOP_LEN (RPL_HDR_OPT_LEN + 2 + 2) #define RPL_HDR_OPT_DOWN 0x80 #define RPL_HDR_OPT_DOWN_SHIFT 7 #define RPL_HDR_OPT_RANK_ERR 0x40 #define RPL_HDR_OPT_RANK_ERR_SHIFT 6 #define RPL_HDR_OPT_FWD_ERR 0x20 #define RPL_HDR_OPT_FWD_ERR_SHIFT 5 /*---------------------------------------------------------------------------*/ /* Default values for RPL constants and variables. */ /* The default value for the DAO timer. */ #ifdef RPL_CONF_DAO_LATENCY #define RPL_DAO_LATENCY RPL_CONF_DAO_LATENCY #else /* RPL_CONF_DAO_LATENCY */ #define RPL_DAO_LATENCY (CLOCK_SECOND * 4) #endif /* RPL_DAO_LATENCY */ /* Special value indicating immediate removal. */ #define RPL_ZERO_LIFETIME 0 #define RPL_LIFETIME(instance, lifetime) \ ((unsigned long)(instance)->lifetime_unit * (lifetime)) #ifndef RPL_CONF_MIN_HOPRANKINC #define RPL_MIN_HOPRANKINC 256 #else #define RPL_MIN_HOPRANKINC RPL_CONF_MIN_HOPRANKINC #endif #define RPL_MAX_RANKINC (7 * RPL_MIN_HOPRANKINC) #define DAG_RANK(fixpt_rank, instance) \ ((fixpt_rank) / (instance)->min_hoprankinc) /* Rank of a virtual root node that coordinates DAG root nodes. */ #define BASE_RANK 0 /* Rank of a root node. */ #define ROOT_RANK(instance) (instance)->min_hoprankinc #define INFINITE_RANK 0xffff /* Represents 2^n ms. */ /* Default value according to the specification is 3 which means 8 milliseconds, but that is an unreasonable value if using power-saving / duty-cycling */ #ifdef RPL_CONF_DIO_INTERVAL_MIN #define RPL_DIO_INTERVAL_MIN RPL_CONF_DIO_INTERVAL_MIN #else #define RPL_DIO_INTERVAL_MIN 12 #endif /* Maximum amount of timer doublings. */ #ifdef RPL_CONF_DIO_INTERVAL_DOUBLINGS #define RPL_DIO_INTERVAL_DOUBLINGS RPL_CONF_DIO_INTERVAL_DOUBLINGS #else #define RPL_DIO_INTERVAL_DOUBLINGS 8 #endif /* Default DIO redundancy. */ #ifdef RPL_CONF_DIO_REDUNDANCY #define RPL_DIO_REDUNDANCY RPL_CONF_DIO_REDUNDANCY #else #define RPL_DIO_REDUNDANCY 10 #endif /* Expire DAOs from neighbors that do not respond in this time. (seconds) */ #define DAO_EXPIRATION_TIMEOUT 60 /*---------------------------------------------------------------------------*/ #define RPL_INSTANCE_LOCAL_FLAG 0x80 #define RPL_INSTANCE_D_FLAG 0x40 /* Values that tell where a route came from. */ #define RPL_ROUTE_FROM_INTERNAL 0 #define RPL_ROUTE_FROM_UNICAST_DAO 1 #define RPL_ROUTE_FROM_MULTICAST_DAO 2 #define RPL_ROUTE_FROM_DIO 3 /* DAG Mode of Operation */ #define RPL_MOP_NO_DOWNWARD_ROUTES 0 #define RPL_MOP_NON_STORING 1 #define RPL_MOP_STORING_NO_MULTICAST 2 #define RPL_MOP_STORING_MULTICAST 3 #ifdef RPL_CONF_MOP #define RPL_MOP_DEFAULT RPL_CONF_MOP #else #define RPL_MOP_DEFAULT RPL_MOP_STORING_NO_MULTICAST #endif /* * The ETX in the metric container is expressed as a fixed-point value * whose integer part can be obtained by dividing the value by * RPL_DAG_MC_ETX_DIVISOR. */ #define RPL_DAG_MC_ETX_DIVISOR 128 /* DIS related */ #define RPL_DIS_SEND 1 #ifdef RPL_DIS_INTERVAL_CONF #define RPL_DIS_INTERVAL RPL_DIS_INTERVAL_CONF #else #define RPL_DIS_INTERVAL 60 #endif #define RPL_DIS_START_DELAY 5 /*---------------------------------------------------------------------------*/ /* Lollipop counters */ #define RPL_LOLLIPOP_MAX_VALUE 255 #define RPL_LOLLIPOP_CIRCULAR_REGION 127 #define RPL_LOLLIPOP_SEQUENCE_WINDOWS 16 #define RPL_LOLLIPOP_INIT (RPL_LOLLIPOP_MAX_VALUE - RPL_LOLLIPOP_SEQUENCE_WINDOWS + 1) #define RPL_LOLLIPOP_INCREMENT(counter) \ do { \ if((counter) > RPL_LOLLIPOP_CIRCULAR_REGION) { \ (counter) = ((counter) + 1) & RPL_LOLLIPOP_MAX_VALUE; \ } else { \ (counter) = ((counter) + 1) & RPL_LOLLIPOP_CIRCULAR_REGION; \ } \ } while(0) #define RPL_LOLLIPOP_IS_INIT(counter) \ ((counter) > RPL_LOLLIPOP_CIRCULAR_REGION) /*---------------------------------------------------------------------------*/ /* Logical representation of a DAG Information Object (DIO.) */ struct rpl_dio { Ipv6Address dag_id; rpl_ocp_t ocp; rpl_rank_t rank; uint8_t grounded; uint8_t mop; uint8_t preference; uint8_t version; uint8_t instance_id; uint8_t dtsn; uint8_t dag_intdoubl; uint8_t dag_intmin; uint8_t dag_redund; uint8_t default_lifetime; uint16_t lifetime_unit; rpl_rank_t dag_max_rankinc; rpl_rank_t dag_min_hoprankinc; rpl_prefix_t destination_prefix; rpl_prefix_t prefix_info; struct rpl_metric_container mc; }; typedef struct rpl_dio rpl_dio_t; #if RPL_CONF_STATS /* Statistics for fault management. */ struct rpl_stats { uint16_t mem_overflows; uint16_t local_repairs; uint16_t global_repairs; uint16_t malformed_msgs; uint16_t resets; uint16_t parent_switch; }; typedef struct rpl_stats rpl_stats_t; extern rpl_stats_t rpl_stats; #endif /*---------------------------------------------------------------------------*/ /* RPL macros. */ #if RPL_CONF_STATS #define RPL_STAT(code) (code) #else #define RPL_STAT(code) #endif /* RPL_CONF_STATS */ /*---------------------------------------------------------------------------*/ /* Instances */ extern rpl_instance_t instance_table[]; extern rpl_instance_t *default_instance; /* ICMPv6 functions for RPL. */ void dis_output(Ipv6Address *addr); void dio_output(rpl_instance_t *, Ipv6Address *uc_addr); void dao_output(rpl_parent_t *, uint8_t lifetime); void dao_ack_output(rpl_instance_t *, Ipv6Address *, uint8_t); /* RPL logic functions. */ void rpl_join_dag(Ipv6Address *from, rpl_dio_t *dio); void rpl_join_instance(Ipv6Address *from, rpl_dio_t *dio); void rpl_local_repair(rpl_instance_t *instance); void rpl_process_dio(Ipv6Address *, rpl_dio_t *); int rpl_process_parent_event(rpl_instance_t *, rpl_parent_t *); /* DAG object management. */ rpl_dag_t *rpl_alloc_dag(uint8_t, Ipv6Address *); rpl_instance_t *rpl_alloc_instance(uint8_t); void rpl_free_dag(rpl_dag_t *); void rpl_free_instance(rpl_instance_t *); /* DAG parent management function. */ rpl_parent_t *rpl_add_parent(rpl_dag_t *, rpl_dio_t *dio, Ipv6Address *); rpl_parent_t *rpl_find_parent(rpl_dag_t *, Ipv6Address *); rpl_parent_t *rpl_find_parent_any_dag(rpl_instance_t *instance, Ipv6Address *addr); void rpl_nullify_parent(rpl_dag_t *, rpl_parent_t *); void rpl_remove_parent(rpl_dag_t *, rpl_parent_t *); void rpl_move_parent(rpl_dag_t *dag_src, rpl_dag_t *dag_dst, rpl_parent_t *parent); rpl_parent_t *rpl_select_parent(rpl_dag_t *dag); rpl_dag_t *rpl_select_dag(rpl_instance_t *instance,rpl_parent_t *parent); void rpl_recalculate_ranks(void); /* RPL routing table functions. */ void rpl_remove_routes(rpl_dag_t *dag); void rpl_remove_routes_by_nexthop(Ipv6Address *nexthop, rpl_dag_t *dag); Ipv6RoutingTableEntry *rpl_add_route(rpl_dag_t *dag, Ipv6Prefix *prefix, int prefix_len, Ipv6Address *next_hop); void rpl_purge_routes(void); /* Objective function. */ rpl_of_t *rpl_find_of(rpl_ocp_t); /* Timer functions. */ void rpl_schedule_dao(rpl_instance_t *); void rpl_reset_dio_timer(rpl_instance_t *); void rpl_reset_periodic_timer(void); /* Route poisoning. */ void rpl_poison_routes(rpl_dag_t *, rpl_parent_t *); } } // namespace ns3 #endif /* RPL_PRIVATE_H */
[ "yibochen@ubuntu.ubuntu-domain" ]
yibochen@ubuntu.ubuntu-domain
ae706fbece411b5b45b60caaae9d2b206c92685a
c2153dcfa8bcf5b6d7f187e5a337b904ad9f91ac
/depends/ClanLib/src/Core/IOData/iodevice_provider_pipe_connection.cpp
a20818a0c30e015c9acd37fe8c568255e8fcd230
[]
no_license
ptrefall/smn6200fluidmechanics
841541a26023f72aa53d214fe4787ed7f5db88e1
77e5f919982116a6cdee59f58ca929313dfbb3f7
refs/heads/master
2020-08-09T17:03:59.726027
2011-01-13T22:39:03
2011-01-13T22:39:03
32,448,422
1
0
null
null
null
null
UTF-8
C++
false
false
7,914
cpp
/* ** ClanLib SDK ** Copyright (c) 1997-2010 The ClanLib Team ** ** This software is provided 'as-is', without any express or implied ** warranty. In no event will the authors be held liable for any damages ** arising from the use of this software. ** ** Permission is granted to anyone to use this software for any purpose, ** including commercial applications, and to alter it and redistribute it ** freely, subject to the following restrictions: ** ** 1. The origin of this software must not be misrepresented; you must not ** claim that you wrote the original software. If you use this software ** in a product, an acknowledgment in the product documentation would be ** appreciated but is not required. ** 2. Altered source versions must be plainly marked as such, and must not be ** misrepresented as being the original software. ** 3. This notice may not be removed or altered from any source distribution. ** ** Note: Some of the libraries ClanLib may link to may have additional ** requirements or restrictions. ** ** File Author(s): ** ** Magnus Norddahl */ #include "precomp.h" #include "iodevice_provider_pipe_connection.h" #include "API/Core/System/exception.h" #include "API/Core/System/event.h" #include "API/Core/Text/string_help.h" #include "API/Core/Text/string_format.h" #ifndef WIN32 #include <sys/socket.h> #include <sys/un.h> #ifndef UNIX_PATH_MAX #define UNIX_PATH_MAX 108 #endif #endif ///////////////////////////////////////////////////////////////////////////// // CL_IODeviceProvider_PipeConnection Construction: #ifdef WIN32 CL_IODeviceProvider_PipeConnection::CL_IODeviceProvider_PipeConnection( const CL_StringRef &pipe_name) : handle(INVALID_HANDLE_VALUE), peeked_data(0) { handle = CreateFile( CL_StringHelp::utf8_to_ucs2("\\\\.\\pipe\\" + pipe_name).c_str(), GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (handle == INVALID_HANDLE_VALUE) throw CL_Exception(cl_format("Unable to open pipe %1", pipe_name)); DWORD pipe_mode = PIPE_READMODE_BYTE|PIPE_WAIT; BOOL result = SetNamedPipeHandleState(handle, &pipe_mode, 0, 0); if (result == FALSE) { CloseHandle(handle); throw CL_Exception(cl_format("Unable to set named pipe handle state on %1", pipe_name)); } } #else CL_IODeviceProvider_PipeConnection::CL_IODeviceProvider_PipeConnection( const CL_StringRef &pipe_name) : handle(-1), peeked_data(0) { CL_String8 pipe_name_local8 = CL_StringHelp::text_to_local8(pipe_name); if (pipe_name_local8.length() >= UNIX_PATH_MAX) throw CL_Exception("Pipe name too long"); handle = socket(PF_UNIX, SOCK_STREAM, 0); if (handle == -1) throw CL_Exception("Socket create failed"); sockaddr_un name; memset(&name, 0, sizeof(sockaddr_un)); name.sun_family = AF_UNIX; memcpy(name.sun_path+1, pipe_name_local8.data(), pipe_name_local8.length()); int res = ::connect(handle, (sockaddr *) &name, sizeof(sockaddr_un)); if (res == -1) { ::close(handle); throw CL_Exception("Could not connect to server"); } } #endif #ifdef WIN32 CL_IODeviceProvider_PipeConnection::CL_IODeviceProvider_PipeConnection( HANDLE pipe_handle) : handle(pipe_handle), peeked_data(0) { if (handle == INVALID_HANDLE_VALUE) throw CL_Exception("Invalid handle value"); } #else CL_IODeviceProvider_PipeConnection::CL_IODeviceProvider_PipeConnection( int pipe_handle) : handle(pipe_handle), peeked_data(0) { if (handle == -1) throw CL_Exception("Invalid socket value"); } #endif CL_IODeviceProvider_PipeConnection::~CL_IODeviceProvider_PipeConnection() { disconnect(); } ///////////////////////////////////////////////////////////////////////////// // CL_IODeviceProvider_PipeConnection Attributes: ///////////////////////////////////////////////////////////////////////////// // CL_IODeviceProvider_PipeConnection Operations: int CL_IODeviceProvider_PipeConnection::send(const void *_data, int length, bool send_all) { #ifdef WIN32 const char *data = (const char *) _data; int pos = 0; while (pos < length) { OVERLAPPED overlapped; memset(&overlapped, 0, sizeof(OVERLAPPED)); BOOL result = WriteFile(handle, data+pos, length-pos, 0, &overlapped); DWORD error = (result == FALSE) ? GetLastError() : ERROR_SUCCESS; if (result == FALSE && error != ERROR_IO_PENDING) throw CL_Exception("Write failed to pipe!"); DWORD written = 0; result = GetOverlappedResult(handle, &overlapped, &written, TRUE); if (result == FALSE) throw CL_Exception("Write failed to pipe!"); pos += written; if (!send_all) break; } return pos; #else const char *data = (const char *) _data; int pos = 0; while (pos < length) { int res = ::send(handle, data+pos, length-pos, 0); if (res == -1) throw CL_Exception("Write failed to socket!"); pos += res; if (!send_all) break; } return pos; #endif } int CL_IODeviceProvider_PipeConnection::receive(void *buffer, int size, bool receive_all) { if (size == 0) return 0; if (peeked_data.get_size() > 0) { #define cl_min(a,b) ((a)<(b)?(a):(b)) int peek_amount = cl_min(size, peeked_data.get_size()); memcpy(buffer, peeked_data.get_data(), peek_amount); memmove(peeked_data.get_data(), peeked_data.get_data()+peek_amount, peeked_data.get_size()-peek_amount); peeked_data.set_size(peeked_data.get_size()-peek_amount); if (peek_amount <= size) return peek_amount + receive((char*) buffer+peek_amount, size-peek_amount, receive_all); } return lowlevel_read(buffer, size, receive_all); } int CL_IODeviceProvider_PipeConnection::peek(void *data, int len) { if (peeked_data.get_size() >= len) { memcpy(data, peeked_data.get_data(), len); return len; } else { int old_size = peeked_data.get_size(); try { peeked_data.set_size(len); int bytes_read = lowlevel_read(peeked_data.get_data()+old_size, len-old_size, false); peeked_data.set_size(old_size+bytes_read); memcpy(data, peeked_data.get_data(), peeked_data.get_size()); return peeked_data.get_size(); } catch (CL_Exception e) { peeked_data.set_size(old_size); throw e; } } } void CL_IODeviceProvider_PipeConnection::disconnect() { #ifdef WIN32 if (handle != INVALID_HANDLE_VALUE) CloseHandle(handle); handle = INVALID_HANDLE_VALUE; #else if (handle != -1) ::close(handle); handle = -1; #endif } CL_IODeviceProvider *CL_IODeviceProvider_PipeConnection::duplicate() { throw CL_Exception("CL_IODeviceProvider_PipeConnection::duplicate() - Not Implemented"); } ///////////////////////////////////////////////////////////////////////////// // CL_IODeviceProvider_PipeConnection Implementation: int CL_IODeviceProvider_PipeConnection::lowlevel_read(void *buffer, int length, bool receive_all) { #ifdef WIN32 char *data = (char *) buffer; int received = 0; while (received < length) { OVERLAPPED overlapped; memset(&overlapped, 0, sizeof(OVERLAPPED)); BOOL result = ReadFile(handle, data+received, length-received, 0, &overlapped); DWORD error = (result == FALSE) ? GetLastError() : ERROR_SUCCESS; if (result == FALSE && error != ERROR_IO_PENDING) throw CL_Exception("Read failed from pipe!"); DWORD bytes_read = 0; result = GetOverlappedResult(handle, &overlapped, &bytes_read, TRUE); if (result == FALSE) throw CL_Exception("Read failed from pipe!"); received += bytes_read; if (!receive_all) break; } return received; #else char *data = (char *) buffer; int received = 0; while (received < length) { int res = ::recv(handle, data+received, length-received, 0); if (res == -1) throw CL_Exception("Read failed on socket!"); received += res; if (!receive_all) break; } return received; #endif }
[ "PTrefall@gmail.com@c628178a-a759-096a-d0f3-7c7507b30227" ]
PTrefall@gmail.com@c628178a-a759-096a-d0f3-7c7507b30227
789d6f795bfc3006994536a00925266a8b28a85f
fa10bfa50866b3bca8bf691ffc530a26656061ed
/examples/realtime_example/main.cpp
b7fbb2913aea6a4aa301f883b4bf40d3bf1aedb3
[ "MIT" ]
permissive
mrcodechef/Ichor
e47c40a48117dbab36b2616e90f6ed9834ae2cbd
b2571085c7ef1c9d88633b044e34054bb153458d
refs/heads/master
2023-08-24T13:16:01.027674
2021-10-19T21:20:20
2021-10-19T21:51:23
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,397
cpp
#include "TestService.h" #include "OptionalService.h" #include <ichor/optional_bundles/logging_bundle/LoggerAdmin.h> #include "MemoryResources.h" #include "GlobalRealtimeSettings.h" #if defined(NDEBUG) #include <ichor/optional_bundles/logging_bundle/NullFrameworkLogger.h> #include <ichor/optional_bundles/logging_bundle/NullLogger.h> #define FRAMEWORK_LOGGER_TYPE NullFrameworkLogger #define LOGGER_TYPE NullLogger #else #include <ichor/optional_bundles/logging_bundle/CoutFrameworkLogger.h> #include <ichor/optional_bundles/logging_bundle/CoutLogger.h> #define FRAMEWORK_LOGGER_TYPE CoutFrameworkLogger #define LOGGER_TYPE CoutLogger #endif #include <chrono> #include <stdexcept> using namespace std::string_literals; std::atomic<uint64_t> idCounter = 0; void* run_example(void*) { #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) //TODO realtime settings #else cpu_set_t lock_to_core_set; CPU_ZERO(&lock_to_core_set); CPU_SET(1, &lock_to_core_set); sched_setaffinity(0, sizeof(cpu_set_t), &lock_to_core_set); #endif auto start = std::chrono::steady_clock::now(); // disable usage of default std::pmr resource, as that would allocate. terminating_resource terminatingResource{}; std::pmr::set_default_resource(&terminatingResource); { buffer_resource<1024 * 192> resourceOne{}; // need about 160 kb for the 20'000 iteration array in TestService buffer_resource<1024 * 32> resourceTwo{}; DependencyManager dm{&resourceOne, &resourceTwo}; dm.createServiceManager<FRAMEWORK_LOGGER_TYPE, IFrameworkLogger>({}, 10); dm.createServiceManager<LoggerAdmin<LOGGER_TYPE>, ILoggerAdmin>(); dm.createServiceManager<OptionalService, IOptionalService>(); dm.createServiceManager<OptionalService, IOptionalService>(); dm.createServiceManager<TestService>(); dm.start(); } auto end = std::chrono::steady_clock::now(); #ifndef NDEBUG fmt::print("Program ran for {:L} µs\n", std::chrono::duration_cast<std::chrono::microseconds>(end-start).count()); #endif return nullptr; } int main() { std::locale::global(std::locale("en_US.UTF-8")); #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) //TODO check for elevated permissions #else uid_t uid = getuid(); uid_t euid = geteuid(); if (uid !=0 || uid!=euid) { throw std::runtime_error("No permissions to set realtime scheduling. Consider running under sudo/root."); } #endif GlobalRealtimeSettings settings{}; #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) //TODO realtime settings run_example(); #else // create a thread with realtime priority to run the program on pthread_t thread{}; sched_param param{}; pthread_attr_t attr{}; pthread_attr_init (&attr); pthread_attr_setinheritsched (&attr, PTHREAD_EXPLICIT_SCHED); pthread_attr_setschedpolicy (&attr, SCHED_FIFO); param.sched_priority = 20; pthread_attr_setschedparam (&attr, &param); auto ret = pthread_create (&thread, &attr, run_example, nullptr); if(ret == EPERM) { throw std::runtime_error("No permissions to set realtime scheduling. Consider running under sudo/root."); } if(ret == 0) { pthread_join(thread, nullptr); } #endif return 0; }
[ "kingoipo@gmail.com" ]
kingoipo@gmail.com
ae5a57733ddb651adf1e902100d9806d2fb02c2e
634120df190b6262fccf699ac02538360fd9012d
/Develop/Server/MasterServer/unittest/TestPartyCommand.cpp
be575265f1db76fd6e208d217d93c65a86234fa7
[]
no_license
ktj007/Raiderz_Public
c906830cca5c644be384e68da205ee8abeb31369
a71421614ef5711740d154c961cbb3ba2a03f266
refs/heads/master
2021-06-08T03:37:10.065320
2016-11-28T07:50:57
2016-11-28T07:50:57
74,959,309
6
4
null
2016-11-28T09:53:49
2016-11-28T09:53:49
null
UTF-8
C++
false
false
38,383
cpp
#include "stdafx.h" #include "ZFixtureHelper.h" #include "ZParty.h" #include "ZPartyManager.h" #include "ZPartyLogic.h" #include "STransData_M2G.h" #include "CCommandTable_Master.h" #include "ZPartyCommandRouter.h" #include "CTransData.h" #include "ZPartyMember.h" #include "ZGameServerObject.h" SUITE(PartyCommand) { struct MockPartyLogic: public ZPartyLogic { MUID m_uidSender; MUID m_uidTargetPlayer; MUID m_uidRequestPlayer; MUID m_uidParty; MUID m_uidNewLeader; MUID m_uidLeaveMember; MUID m_uidFieldGroup; MUID m_uidMember; MUID m_uidField; MUID m_uidOffline; CCommandResultTable m_nResult; vector<int> m_vecQuestID; wstring m_strMessage; int m_nFieldGroupID; TD_PARTY_MEMBER m_tdPartyMember; vector<int> m_vecBuff; PARTY_SETTING m_partySetting; virtual void InviteReq(MUID uidSender, MUID uidTargetPlayer, MUID uidRequestPlayer) override { m_uidSender = uidSender; m_uidTargetPlayer = uidTargetPlayer; m_uidRequestPlayer = uidRequestPlayer; } virtual void AcceptRes(MUID uidSender, MUID uidRequestPlayer, MUID uidTargetPlayer, CCommandResultTable nResult) override { m_uidSender = uidSender; m_uidRequestPlayer = uidRequestPlayer; m_uidTargetPlayer = uidTargetPlayer; m_nResult = nResult; } virtual void LeaveReq(MUID uidSender, MUID uidParty, MUID uidLeaveMember) override { m_uidSender = uidSender; m_uidParty = uidParty; m_uidLeaveMember = uidLeaveMember; } virtual void KickReq(MUID uidSender, MUID uidParty, MUID uidRequestPlayer, MUID uidTargetPlayer) override { m_uidSender = uidSender; m_uidParty = uidParty; m_uidRequestPlayer = uidRequestPlayer; m_uidTargetPlayer = uidTargetPlayer; } virtual void UpdateParty(MUID uidParty, const ZPartyMember* pMember) override { m_uidParty = uidParty; pMember->Export(&m_tdPartyMember, &m_vecBuff); } virtual void UpdateMember(MUID uidParty, const ZPartyMember* pMember) override { m_uidParty = uidParty; pMember->Export(&m_tdPartyMember, &m_vecBuff); } virtual void AddQuest(MUID uidParty, MUID uidMember, const vector<int>& vecQuestID) override { m_uidParty = uidParty; m_uidMember = uidMember; m_vecQuestID = vecQuestID; } virtual void AddField(MUID uidParty, MUID uidMember, MUID uidFieldGroup) override { m_uidParty = uidParty; m_uidMember = uidMember; m_uidFieldGroup = uidFieldGroup; } virtual void UpdateQuestRunner(MUID uidParty, MUID uidMember, MUID uidField, const vector<int>& vecQuestID) override { m_uidParty = uidParty; m_uidMember = uidMember; m_uidField = uidField; m_vecQuestID = vecQuestID; } virtual void RemoveQuest(MUID uidParty, MUID uidMember, const vector<int>& vecQuestID) override { m_uidParty = uidParty; m_uidMember = uidMember; m_vecQuestID = vecQuestID; } virtual void RemoveField(MUID uidParty, MUID uidMember, int nFieldGroupID) override { m_uidParty = uidParty; m_uidMember = uidMember; m_nFieldGroupID = nFieldGroupID; } virtual void EraseQuestRunner(MUID uidParty, MUID uidMember) override { m_uidParty = uidParty; m_uidMember = uidMember; } virtual void DoOffline(MUID uidParty, MUID uidMember) override { m_uidParty = uidParty; m_uidMember = uidMember; } virtual bool DoOnline(MUID uidParty, MUID uidMember, MUID uidOffline) override { m_uidParty = uidParty; m_uidMember = uidMember; m_uidOffline = uidOffline; return true; } virtual void JoinInviteReq(MUID uidSender, MUID uidParty, MUID uidRequestPlayer) override { m_uidParty = uidParty; m_uidRequestPlayer = uidRequestPlayer; } virtual void JoinAcceptRes(MUID uidSender, MUID uidParty, MUID uidLeader, MUID uidRequestPlayer, CCommandResultTable nResult) override { m_uidParty = uidParty; m_partySetting.m_uidLeader = uidLeader; m_uidRequestPlayer = uidRequestPlayer; m_nResult = nResult; } virtual void MoveServer(MUID uidParty, MUID uidMember) override { m_uidParty = uidParty; m_uidMember = uidMember; } }; struct Fixture: public FBaseServerField, public FBaseMockLink, FBasePlayer { ZTestSysWrapper2<ZPartyLogic, MockPartyLogic> m_PartyLogicWrapper; MockPartyLogic* m_pPartyLogic; MUID m_uidRequest; MUID m_uidRequestPlayer; int m_nRequestPlayerCID; wstring m_strRequestPlayerName; MockLink* m_pRequestLink; ZPlayer* m_pRequestPlayer; MUID m_uidTarget; MUID m_uidTargetPlayer; wstring m_strTargetPlayerName; MockLink* m_pTargetLink; ZPlayer* m_pTargetPlayer; ZPartyCommandRouter* m_pPartyRouter; int m_nRequestServerID; int m_nTargetServerID; Fixture() { m_nRequestServerID = 2; m_nTargetServerID = 3; m_pPartyLogic = m_PartyLogicWrapper.Get(); m_uidRequest = AddGameServerObject(m_nRequestServerID, 3)->GetUID(); m_pRequestLink = NewLink(m_uidRequest); m_uidTarget = AddGameServerObject(m_nTargetServerID, 107)->GetUID(); m_pTargetLink = NewLink(m_uidTarget); m_pRequestPlayer = AddNewPlayerInWorld(m_nRequestServerID); m_uidRequestPlayer = m_pRequestPlayer->GetUID(); m_nRequestPlayerCID = m_pRequestPlayer->GetCID(); m_strRequestPlayerName = m_pRequestPlayer->GetPlayerName(); m_pTargetPlayer = AddNewPlayerInWorld(m_nTargetServerID); m_uidTargetPlayer = m_pTargetPlayer->GetUID(); m_strTargetPlayerName = m_pTargetPlayer->GetPlayerName(); m_pPartyRouter = new ZPartyCommandRouter(); } ~Fixture() { delete m_pPartyRouter; } MCommandResult RecvInviteReq(MockLink* pLink, MUID uidTargetPlayer, MUID uidRequestPlayer) { return pLink->OnRecv(MMC_PARTY_INVITE_REQ, 2, NEW_UID(uidTargetPlayer), NEW_UID(uidRequestPlayer) ); } MCommandResult RecvAcceptRes(MockLink* pLink, MUID uidRequestPlayer, MUID uidTargetPlayer, CCommandResultTable nResult) { return pLink->OnRecv(MMC_PARTY_ACCEPT_RES, 3, NEW_UID(uidRequestPlayer), NEW_UID(uidTargetPlayer), NEW_INT(nResult) ); } MCommandResult RecvPartyUpdate(MockLink* pLink, MUID uidParty, TD_PARTY_MEMBER& tdPartyMember, vector<int>& vecBuff) { return pLink->OnRecv(MMC_PARTY_UPDATE, 3, NEW_UID(uidParty), NEW_BLOB(&tdPartyMember, sizeof(tdPartyMember), 1), NEW_BLOB(vecBuff) ); } MCommandResult RecvPartyUpdateMember(MockLink* pLink, MUID uidParty, TD_PARTY_MEMBER& tdPartyMember, vector<int>& vecBuff) { return pLink->OnRecv(MMC_PARTY_UPDATE_MEMBER, 3, NEW_UID(uidParty), NEW_BLOB(&tdPartyMember, sizeof(tdPartyMember), 1), NEW_BLOB(vecBuff) ); } MCommandResult RecvPartyAddQuest(MockLink* pLink, MUID uidParty, MUID uidMember, vector<int>& vecQuestID) { return pLink->OnRecv(MMC_PARTY_ADD_QUEST, 3, NEW_UID(uidParty), NEW_UID(uidMember), NEW_BLOB(vecQuestID) ); } MCommandResult RecvPartyAddField(MockLink* pLink, MUID uidParty, MUID uidMember, MUID uidFieldGroup) { return pLink->OnRecv(MMC_PARTY_ADD_FIELD, 3, NEW_UID(uidParty), NEW_UID(uidMember), NEW_UID(uidFieldGroup) ); } MCommandResult RecvPartyUpdateQuestRunner(MockLink* pLink, MUID uidParty, MUID uidMember, MUID uidField, vector<int>& vecQuestID) { return pLink->OnRecv(MMC_PARTY_UPDATE_QUEST_RUNNER, 4, NEW_UID(uidParty), NEW_UID(uidMember), NEW_UID(uidField), NEW_BLOB(vecQuestID) ); } MCommandResult RecvPartyLeaveReq(MockLink* pLink, MUID uidParty, MUID uidLeavePlayer) { return pLink->OnRecv(MMC_PARTY_LEAVE_REQ, 2, NEW_UID(uidParty), NEW_UID(uidLeavePlayer) ); } MCommandResult RecvPartyRemoveQuest(MockLink* pLink, MUID uidParty, MUID uidMember, vector<int>& vecQuestID) { return pLink->OnRecv(MMC_PARTY_REMOVE_QUEST, 3, NEW_UID(uidParty), NEW_UID(uidMember), NEW_BLOB(vecQuestID) ); } MCommandResult RecvPartyRemoveField(MockLink* pLink, MUID uidParty, MUID uidMember, int nFieldGroupID) { return pLink->OnRecv(MMC_PARTY_REMOVE_FIELD, 3, NEW_UID(uidParty), NEW_UID(uidMember), NEW_INT(nFieldGroupID) ); } MCommandResult RecvPartyEraseQuestRunner(MockLink* pLink, MUID uidParty, MUID uidMember) { return pLink->OnRecv(MMC_PARTY_ERASE_QUEST_RUNNER, 2, NEW_UID(uidParty), NEW_UID(uidMember) ); } MCommandResult RecvPartyKickReq(MockLink* pLink, MUID uidParty, MUID uidRequestPlayer, MUID uidTargetPlayer) { return pLink->OnRecv(MMC_PARTY_KICK_REQ, 3, NEW_UID(uidParty), NEW_UID(uidRequestPlayer), NEW_UID(uidTargetPlayer) ); } MCommandResult RecvDoOffline(MockLink* pLink, MUID uidParty, MUID uidMember) { return pLink->OnRecv(MMC_PARTY_DO_OFFLINE, 2, NEW_UID(uidParty), NEW_UID(uidMember) ); } MCommandResult RecvDoOnline(MockLink* pLink, MUID uidParty, MUID uidMember, MUID uidOffline) { return pLink->OnRecv(MMC_PARTY_DO_ONLINE, 3, NEW_UID(uidParty), NEW_UID(uidMember), NEW_UID(uidOffline) ); } MCommandResult RecvJoinInviteReq(MockLink* pLink, MUID uidParty, MUID uidRequestPlayer) { return pLink->OnRecv(MMC_PARTY_JOIN_INVITE_REQ, 2, NEW_UID(uidParty), NEW_UID(uidRequestPlayer) ); } MCommandResult RecvJoinAcceptRes(MockLink* pLink, MUID uidParty, MUID uidLeader, MUID uidRequestPlayer, CCommandResultTable nResult) { return pLink->OnRecv(MMC_PARTY_JOIN_ACCEPT_RES, 4, NEW_UID(uidParty), NEW_UID(uidLeader), NEW_UID(uidRequestPlayer), NEW_INT(nResult) ); } MCommandResult RecvMoveServer(MockLink* pLink, MUID uidParty, MUID uidMember) { return pLink->OnRecv(MMC_PARTY_MOVE_SERVER, 2, NEW_UID(uidParty), NEW_UID(uidMember) ); } }; // Router ////////////////////////////////////////////////////////////////////////////////////////////// TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyInviteRes) { CCommandResultTable nResult = CR_SUCCESS; m_pPartyRouter->InviteRes(m_uidRequest, m_uidRequestPlayer, m_uidTargetPlayer, nResult); ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_INVITE_RES); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), m_uidRequestPlayer); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 1), m_uidTargetPlayer); CHECK_EQUAL(m_pRequestLink->GetParam<int>(0, 2), nResult); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyAcceptReq) { m_pPartyRouter->AcceptReq(m_uidTarget, m_uidTargetPlayer, m_uidRequestPlayer, m_strRequestPlayerName.c_str()); ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_ACCEPT_REQ); CHECK_EQUAL(m_pTargetLink->GetParam<MUID>(0, 0), m_uidTargetPlayer); CHECK_EQUAL(m_pTargetLink->GetParam<MUID>(0, 1), m_uidRequestPlayer); wstring strRequestPlayerName; MCommand& cmd = m_pTargetLink->GetCommand(0); cmd.GetParameter(strRequestPlayerName, 2, MPT_WSTR); CHECK(strRequestPlayerName == m_strRequestPlayerName); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyAcceptCancel) { CCommandResultTable nResult = CR_SUCCESS; m_pPartyRouter->AcceptCancel(m_uidTarget, m_uidTargetPlayer, nResult); ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_ACCEPT_CANCEL); CHECK_EQUAL(m_pTargetLink->GetParam<MUID>(0, 0), m_uidTargetPlayer); CHECK_EQUAL(m_pTargetLink->GetParam<int>(0, 1), nResult); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyAdd) { MUID uidParty = ZTestHelper::NewUID(); MUID uidLeader = ZTestHelper::NewUID(); wstring strLeaderName = L"TestLeaderName"; int nLeaderCID = ZTestHelper::NewCID(); m_pPartyRouter->PartyAdd(uidParty, uidLeader, strLeaderName, nLeaderCID); ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_ADD); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), uidParty); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 1), uidLeader); CHECK_EQUAL(m_pRequestLink->GetParam<int>(0, 3), nLeaderCID); wstring strLeaderNameParam; MCommand& cmdRequest = m_pRequestLink->GetCommand(0); cmdRequest.GetParameter(strLeaderNameParam, 2, MPT_WSTR); CHECK(strLeaderNameParam == strLeaderName); ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_ADD); CHECK_EQUAL(m_pTargetLink->GetParam<MUID>(0, 0), uidParty); CHECK_EQUAL(m_pTargetLink->GetParam<MUID>(0, 1), uidLeader); CHECK_EQUAL(m_pTargetLink->GetParam<int>(0, 3), nLeaderCID); MCommand& cmdTarget = m_pTargetLink->GetCommand(0); cmdRequest.GetParameter(strLeaderNameParam, 2, MPT_WSTR); CHECK(strLeaderNameParam == strLeaderName); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyAddMember) { MUID uidParty = ZTestHelper::NewUID(); MUID uidMember = ZTestHelper::NewUID(); wstring strMemberName = L"TestMemberName"; int nMemberCID = ZTestHelper::NewCID(); m_pPartyRouter->AddMember(uidParty, uidMember, strMemberName, nMemberCID); ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_ADD_MEMBER); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), uidParty); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 1), uidMember); CHECK_EQUAL(m_pRequestLink->GetParam<int>(0, 3), nMemberCID); wstring strMemberNameParam; MCommand& cmdRequest = m_pRequestLink->GetCommand(0); cmdRequest.GetParameter(strMemberNameParam, 2, MPT_WSTR); CHECK(strMemberNameParam == strMemberName); ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_ADD_MEMBER); CHECK_EQUAL(m_pTargetLink->GetParam<MUID>(0, 0), uidParty); CHECK_EQUAL(m_pTargetLink->GetParam<MUID>(0, 1), uidMember); CHECK_EQUAL(m_pTargetLink->GetParam<int>(0, 3), nMemberCID); MCommand& cmdTarget = m_pRequestLink->GetCommand(0); cmdRequest.GetParameter(strMemberNameParam, 2, MPT_WSTR); CHECK(strMemberNameParam == strMemberName); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartySync) { MUID uidParty = ZTestHelper::NewUID(); ZParty* pParty = gmgr.pPartyManager->AddParty(uidParty, m_uidRequestPlayer, m_strRequestPlayerName, m_nRequestServerID, m_pRequestPlayer->GetCID()); gmgr.pPartyManager->AddMember(uidParty, m_uidTargetPlayer, m_strTargetPlayerName, m_nTargetServerID, m_pTargetPlayer->GetCID()); m_pPartyRouter->PartySync(pParty); ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_SYNC); ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_SYNC); ASSERT_EQUAL(m_pRequestLink->GetParam<MBlob*>(0, 0)->GetBlobCount(), 1); TD_PARTY* pPartyInfo = (TD_PARTY*)m_pRequestLink->GetParam<MBlob*>(0, 0)->GetBlobPointer(); CHECK_EQUAL(pPartyInfo->m_uidParty, uidParty); CHECK_EQUAL(pPartyInfo->m_partySetting.m_uidLeader, m_uidRequestPlayer); ASSERT_EQUAL(m_pRequestLink->GetParam<MBlob*>(0, 1)->GetBlobCount(), 2); TD_PARTY_MEMBER* pPartyMember = (TD_PARTY_MEMBER*)m_pRequestLink->GetParam<MBlob*>(0, 1)->GetBlobElement(0); CHECK_EQUAL(pPartyMember->m_uidPlayer, m_uidRequestPlayer); CHECK(pPartyMember->szName == m_strRequestPlayerName); pPartyMember = (TD_PARTY_MEMBER*)m_pRequestLink->GetParam<MBlob*>(0, 1)->GetBlobElement(1); CHECK_EQUAL(pPartyMember->m_uidPlayer, m_uidTargetPlayer); CHECK(pPartyMember->szName == m_strTargetPlayerName); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_MemberSync) { MUID uidParty = ZTestHelper::NewUID(); TD_PARTY_MEMBER tdPartyMember; tdPartyMember.m_uidPlayer = m_uidRequestPlayer; tdPartyMember.nStatusFlag = 0; tdPartyMember.nHP = 100; tdPartyMember.nEN = 100; tdPartyMember.nSTA = 100; wcsncpy_s(tdPartyMember.szName, m_strRequestPlayerName.c_str(), _TRUNCATE); vector<int> vecBuff; vecBuff.push_back(100); vecBuff.push_back(200); vecBuff.push_back(300); ZPartyMember partyMember; partyMember.Assign(tdPartyMember, vecBuff); m_pPartyRouter->MemberSync(uidParty, &partyMember); ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_MEMBER_SYNC); ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_MEMBER_SYNC); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), uidParty); ASSERT_EQUAL(m_pRequestLink->GetParam<MBlob*>(0, 1)->GetBlobCount(), 1); ASSERT_EQUAL(m_pRequestLink->GetParam<MBlob*>(0, 2)->GetBlobCount(), 3); TD_PARTY_MEMBER* pPartyMember = (TD_PARTY_MEMBER*)m_pRequestLink->GetParam<MBlob*>(0, 1)->GetBlobPointer(); CHECK_EQUAL(pPartyMember->m_uidPlayer, tdPartyMember.m_uidPlayer); CHECK_EQUAL(pPartyMember->nHP, tdPartyMember.nHP); CHECK_EQUAL(pPartyMember->nEN, tdPartyMember.nEN); CHECK_EQUAL(pPartyMember->nSTA, tdPartyMember.nSTA); CHECK(0 == wcscmp(pPartyMember->szName, tdPartyMember.szName)); CHECK_EQUAL(*(int*)m_pRequestLink->GetParam<MBlob*>(0, 2)->GetBlobElement(0), 100); CHECK_EQUAL(*(int*)m_pRequestLink->GetParam<MBlob*>(0, 2)->GetBlobElement(1), 200); CHECK_EQUAL(*(int*)m_pRequestLink->GetParam<MBlob*>(0, 2)->GetBlobElement(2), 300); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_QuestSync) { MUID uidParty = ZTestHelper::NewUID(); vector<TD_PARTY_QUEST> vecPartyQuest; TD_PARTY_QUEST tdPartyQuest[3]; tdPartyQuest[0].nQuestID = 100; tdPartyQuest[0].nQuestCount = 1; tdPartyQuest[1].nQuestID = 200; tdPartyQuest[1].nQuestCount = 3; tdPartyQuest[2].nQuestID = 300; tdPartyQuest[2].nQuestCount = 2; vecPartyQuest.push_back(tdPartyQuest[0]); vecPartyQuest.push_back(tdPartyQuest[1]); vecPartyQuest.push_back(tdPartyQuest[2]); m_pPartyRouter->QuestSync(uidParty, vecPartyQuest); ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_QUEST_SYNC); ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_QUEST_SYNC); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), uidParty); ASSERT_EQUAL(m_pRequestLink->GetParam<MBlob*>(0, 1)->GetBlobCount(), 3); TD_PARTY_QUEST* pPartyQuest = (TD_PARTY_QUEST*)m_pRequestLink->GetParam<MBlob*>(0, 1)->GetBlobElement(0); CHECK_EQUAL(pPartyQuest->nQuestID, 100); CHECK_EQUAL(pPartyQuest->nQuestCount, 1); pPartyQuest = (TD_PARTY_QUEST*)m_pRequestLink->GetParam<MBlob*>(0, 1)->GetBlobElement(1); CHECK_EQUAL(pPartyQuest->nQuestID, 200); CHECK_EQUAL(pPartyQuest->nQuestCount, 3); pPartyQuest = (TD_PARTY_QUEST*)m_pRequestLink->GetParam<MBlob*>(0, 1)->GetBlobElement(2); CHECK_EQUAL(pPartyQuest->nQuestID, 300); CHECK_EQUAL(pPartyQuest->nQuestCount, 2); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_FieldSync) { // arrange MUID uidParty = ZTestHelper::NewUID(); vector<TD_PARTY_FIELD> vecPartyField; TD_PARTY_FIELD tdPartyField; tdPartyField.nFieldGroupID = 100; tdPartyField.uidFieldGroup = ZTestHelper::NewUID(); vecPartyField.push_back(tdPartyField); tdPartyField.nFieldGroupID = 200; tdPartyField.uidFieldGroup = ZTestHelper::NewUID(); vecPartyField.push_back(tdPartyField); tdPartyField.nFieldGroupID = 300; tdPartyField.uidFieldGroup = ZTestHelper::NewUID(); vecPartyField.push_back(tdPartyField); // act m_pPartyRouter->FieldSync(uidParty, vecPartyField); // assert ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_FIELD_SYNC); ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_FIELD_SYNC); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), uidParty); MCommand& cmd = m_pRequestLink->GetCommand(0); vector<TD_PARTY_FIELD> vecRecvPartyField; ASSERT_CHECK(cmd.GetBlob(vecRecvPartyField, 1)); ASSERT_EQUAL(vecRecvPartyField.size(), 3); for(int i = 0; i < 3; i++) { CHECK_EQUAL(vecRecvPartyField[i].nFieldGroupID, vecPartyField[i].nFieldGroupID); CHECK_EQUAL(vecRecvPartyField[i].uidFieldGroup, vecPartyField[i].uidFieldGroup); } } TEST_FIXTURE(Fixture, TestPartyCommandRouter_QuestRunnerSync) { // arrange MUID uidParty = ZTestHelper::NewUID(); MUID uidMember = ZTestHelper::NewUID(); MUID uidField = ZTestHelper::NewUID(); vector<int> vecQuestID; vecQuestID.push_back(100); vecQuestID.push_back(200); vecQuestID.push_back(300); // act m_pPartyRouter->QuestRunnerSync(uidParty, uidMember, uidField, vecQuestID); // assert ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_QUEST_RUNNER_SYNC); ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_QUEST_RUNNER_SYNC); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), uidParty); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 1), uidMember); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 2), uidField); CHECK_EQUAL(m_pRequestLink->GetParam<MBlob*>(0, 3)->GetBlobCount(), 3); CHECK_EQUAL(*(int*)m_pRequestLink->GetParam<MBlob*>(0, 3)->GetBlobElement(0), 100); CHECK_EQUAL(*(int*)m_pRequestLink->GetParam<MBlob*>(0, 3)->GetBlobElement(1), 200); CHECK_EQUAL(*(int*)m_pRequestLink->GetParam<MBlob*>(0, 3)->GetBlobElement(2), 300); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyChangeLeader) { // arrange MUID uidParty = ZTestHelper::NewUID(); ZParty* pParty = gmgr.pPartyManager->AddParty(uidParty, m_uidRequestPlayer, m_strRequestPlayerName, m_nRequestServerID, m_pRequestPlayer->GetCID()); gmgr.pPartyManager->AddMember(uidParty, m_uidTargetPlayer, m_strTargetPlayerName, m_nTargetServerID, m_pTargetPlayer->GetCID()); // act m_pPartyRouter->ChangeLeaderRes(uidParty, m_uidTargetPlayer); // assert ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_CHANGE_LEADER); ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_CHANGE_LEADER); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), uidParty); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 1), m_uidTargetPlayer); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyLeaveRes) { // arrange CCommandResultTable nResult = CR_SUCCESS; // act m_pPartyRouter->LeaveRes(m_uidRequest, m_uidRequestPlayer, nResult); // assert ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_LEAVE_RES); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), m_uidRequestPlayer); CHECK_EQUAL(m_pRequestLink->GetParam<int>(0, 1), nResult); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyRemoveMember) { // arrange MUID uidParty = ZTestHelper::NewUID(); // act m_pPartyRouter->RemoveMember(uidParty, m_uidTargetPlayer); // assert ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_REMOVE_MEMBER); ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_REMOVE_MEMBER); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), uidParty); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 1), m_uidTargetPlayer); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyEraseQuestRunnerSync) { // arrange MUID uidParty = ZTestHelper::NewUID(); // act m_pPartyRouter->EraseQuestRunnerSync(uidParty, m_uidTargetPlayer); // assert ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_ERASE_QUEST_RUNNER_SYNC); ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_ERASE_QUEST_RUNNER_SYNC); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), uidParty); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 1), m_uidTargetPlayer); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyKickRes) { // arrange MUID uidParty = ZTestHelper::NewUID(); CCommandResultTable nResult = CR_SUCCESS; // act m_pPartyRouter->KickRes(m_uidRequest, m_uidRequestPlayer, m_uidTargetPlayer, nResult); // assert ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_KICK_RES); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), m_uidRequestPlayer); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 1), m_uidTargetPlayer); CHECK_EQUAL(m_pRequestLink->GetParam<int>(0, 2), nResult); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyAddOfflineMember) { // arrange MUID uidParty = ZTestHelper::NewUID(); // act m_pPartyRouter->AddOfflineMember(uidParty, m_uidRequestPlayer); // assert ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_ADD_OFFLINE_MEMBER); ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_ADD_OFFLINE_MEMBER); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), uidParty); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 1), m_uidRequestPlayer); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyRemoveOfflineMember) { // arrange MUID uidParty = ZTestHelper::NewUID(); MUID uidMember = ZTestHelper::NewUID(); MUID uidOffline = ZTestHelper::NewUID(); // act m_pPartyRouter->RemoveOfflineMember(uidParty, uidMember, uidOffline); // assert ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_REMOVE_OFFLINE_MEMBER); ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_REMOVE_OFFLINE_MEMBER); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), uidParty); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 1), uidMember); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 2), uidOffline); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyJoinInviteRes) { // arrange CCommandResultTable nResult = CR_SUCCESS; // act m_pPartyRouter->JoinInviteRes(m_uidRequest, m_uidRequestPlayer, nResult); // assert ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_JOIN_INVITE_RES); CHECK_EQUAL(m_pRequestLink->GetParam<MUID>(0, 0), m_uidRequestPlayer); CHECK_EQUAL(m_pRequestLink->GetParam<int>(0, 1), nResult); } TEST_FIXTURE(Fixture, TetsPartyCommandRouter_PartyJoinAcceptReq) { // arrange MUID uidParty = ZTestHelper::NewUID(); MUID uidLeader = ZTestHelper::NewUID(); // act m_pPartyRouter->JoinAcceptReq(m_uidTarget, uidParty, uidLeader, m_uidRequestPlayer, m_strRequestPlayerName); // assert ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_JOIN_ACCEPT_REQ); CHECK_EQUAL(m_pTargetLink->GetParam<MUID>(0, 0), uidParty); CHECK_EQUAL(m_pTargetLink->GetParam<MUID>(0, 1), uidLeader); CHECK_EQUAL(m_pTargetLink->GetParam<MUID>(0, 2), m_uidRequestPlayer); wstring strRequestPlayerName; MCommand& cmd = m_pTargetLink->GetCommand(0); cmd.GetParameter(strRequestPlayerName, 3, MPT_WSTR); CHECK(strRequestPlayerName == m_strRequestPlayerName); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyJoinAcceptCancel) { // arrange MUID uidLeader = ZTestHelper::NewUID(); CCommandResultTable nResult = CR_SUCCESS; // act m_pPartyRouter->JoinAcceptCancel(m_uidTarget, uidLeader, nResult); // assert ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_JOIN_ACCEPT_CANCEL); CHECK_EQUAL(m_pTargetLink->GetParam<MUID>(0, 0), uidLeader); CHECK_EQUAL(m_pTargetLink->GetParam<int>(0, 1), nResult); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyMoveServerSync) { // arrange MUID uidParty = ZTestHelper::NewUID(); MUID uidMember = ZTestHelper::NewUID(); MUID uidOffline = ZTestHelper::NewUID(); // act m_pPartyRouter->MoveServerSync(uidParty, uidMember, uidOffline); // assert ASSERT_EQUAL(m_pTargetLink->GetCommandID(0), MMC_PARTY_MOVE_SERVER_SYNC); CHECK_EQUAL(m_pTargetLink->GetParam<MUID>(0, 0), uidParty); CHECK_EQUAL(m_pTargetLink->GetParam<MUID>(0, 1), uidMember); CHECK_EQUAL(m_pTargetLink->GetParam<MUID>(0, 2), uidOffline); } TEST_FIXTURE(Fixture, TestPartyCommandRouter_PartyInfoAllRes) { // arrange vector<TD_PARTY_INFO> vecPartyInfo; TD_PARTY_INFO tdPartyInfo; tdPartyInfo.uidParty = ZTestHelper::NewUID(); tdPartyInfo.nMemberCount = 3; tdPartyInfo.nLeaderIndex = 0; tdPartyInfo.members[0].uidMember = ZTestHelper::NewUID(); tdPartyInfo.members[0].nMemberCID = ZTestHelper::NewCID(); wcscpy_s(tdPartyInfo.members[0].szMemberName, sizeof(tdPartyInfo.members[0].szMemberName), L"TestLeaderName"); tdPartyInfo.members[1].uidMember = ZTestHelper::NewUID(); tdPartyInfo.members[1].nMemberCID = ZTestHelper::NewCID(); wcscpy_s(tdPartyInfo.members[1].szMemberName, sizeof(tdPartyInfo.members[1].szMemberName), L"TestMemberName_1"); tdPartyInfo.members[2].uidMember = ZTestHelper::NewUID(); tdPartyInfo.members[2].nMemberCID = ZTestHelper::NewCID(); wcscpy_s(tdPartyInfo.members[2].szMemberName, sizeof(tdPartyInfo.members[2].szMemberName), L"TestMemberName_2"); vecPartyInfo.push_back(tdPartyInfo); // act m_pPartyRouter->PartyInfoAllRes(m_uidRequest, vecPartyInfo); // assert ASSERT_EQUAL(m_pRequestLink->GetCommandID(0), MMC_PARTY_INFO_ALL_RES); CHECK_EQUAL(m_pRequestLink->GetParam<MBlob*>(0, 0)->GetBlobCount(), 1); TD_PARTY_INFO* pPartyInfo = (TD_PARTY_INFO*)m_pRequestLink->GetParam<MBlob*>(0, 0)->GetBlobPointer(); ASSERT_CHECK(pPartyInfo != NULL); CHECK_EQUAL(pPartyInfo->uidParty, tdPartyInfo.uidParty); CHECK_EQUAL(pPartyInfo->nMemberCount, tdPartyInfo.nMemberCount); CHECK_EQUAL(pPartyInfo->nLeaderIndex, tdPartyInfo.nLeaderIndex); for(int i = 0; i < 3; i++) { CHECK_EQUAL(pPartyInfo->members[i].nMemberCID, tdPartyInfo.members[i].nMemberCID); CHECK_EQUAL(pPartyInfo->members[i].uidMember, tdPartyInfo.members[i].uidMember); CHECK(0 == wcscmp(pPartyInfo->members[i].szMemberName, tdPartyInfo.members[i].szMemberName)); } } // Handler ////////////////////////////////////////////////////////////////////////////////////////////// TEST_FIXTURE(Fixture, TestPartyCommandHandler_PartyInviteReq) { MCommandResult nCommandResult = RecvInviteReq(m_pRequestLink, m_uidTargetPlayer, m_uidRequestPlayer); CHECK_EQUAL(nCommandResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidSender, m_uidRequest); CHECK_EQUAL(m_pPartyLogic->m_uidTargetPlayer, m_uidTargetPlayer); CHECK_EQUAL(m_pPartyLogic->m_uidRequestPlayer, m_uidRequestPlayer); } TEST_FIXTURE(Fixture, TestPartyCommandHandler_PartyAcceptRes) { CCommandResultTable nResult = CR_SUCCESS; MCommandResult nCommadResult = RecvAcceptRes(m_pTargetLink, m_uidRequestPlayer, m_uidTargetPlayer, nResult); CHECK_EQUAL(nCommadResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidSender, m_uidTarget); CHECK_EQUAL(m_pPartyLogic->m_uidRequestPlayer, m_uidRequestPlayer); CHECK_EQUAL(m_pPartyLogic->m_uidTargetPlayer, m_uidTargetPlayer); CHECK_EQUAL(m_pPartyLogic->m_nResult, nResult); } TEST_FIXTURE(Fixture, TestPartyCommandHandler_PartyUpdate) { // arrange MUID uidParty = ZTestHelper::NewUID(); TD_PARTY_MEMBER tdPartyMember; tdPartyMember.m_uidPlayer = m_uidRequestPlayer; tdPartyMember.nStatusFlag = 0; tdPartyMember.nHP = 100; tdPartyMember.nEN = 100; tdPartyMember.nSTA = 100; wcsncpy_s(tdPartyMember.szName, m_strRequestPlayerName.c_str(), _TRUNCATE); vector<int> vecBuff; vecBuff.push_back(100); vecBuff.push_back(200); vecBuff.push_back(300); // act MCommandResult nCommandResult = RecvPartyUpdate(m_pRequestLink, uidParty, tdPartyMember, vecBuff); // assert CHECK_EQUAL(nCommandResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidParty, uidParty); CHECK_EQUAL(m_pPartyLogic->m_tdPartyMember.m_uidPlayer, tdPartyMember.m_uidPlayer); CHECK_EQUAL(m_pPartyLogic->m_tdPartyMember.nStatusFlag, tdPartyMember.nStatusFlag); CHECK_EQUAL(m_pPartyLogic->m_tdPartyMember.nHP, tdPartyMember.nHP); CHECK_EQUAL(m_pPartyLogic->m_tdPartyMember.nEN, tdPartyMember.nEN); CHECK_EQUAL(m_pPartyLogic->m_tdPartyMember.nSTA, tdPartyMember.nSTA); CHECK(0 == wcscmp(m_pPartyLogic->m_tdPartyMember.szName, tdPartyMember.szName)); CHECK(m_pPartyLogic->m_vecBuff == vecBuff); } TEST_FIXTURE(Fixture, TestPartyCommandHandler_PartyUpdateMember) { // arrance MUID uidParty = ZTestHelper::NewUID(); TD_PARTY_MEMBER tdPartyMember; tdPartyMember.m_uidPlayer = m_uidRequestPlayer; tdPartyMember.nStatusFlag = 0; tdPartyMember.nHP = 100; tdPartyMember.nEN = 100; tdPartyMember.nSTA = 100; wcsncpy_s(tdPartyMember.szName, m_strRequestPlayerName.c_str(), _TRUNCATE); vector<int> vecBuff; vecBuff.push_back(100); vecBuff.push_back(200); vecBuff.push_back(300); // act MCommandResult nCommandResult = RecvPartyUpdateMember(m_pRequestLink, uidParty, tdPartyMember, vecBuff); // assert CHECK_EQUAL(nCommandResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidParty, uidParty); CHECK_EQUAL(m_pPartyLogic->m_tdPartyMember.m_uidPlayer, tdPartyMember.m_uidPlayer); CHECK_EQUAL(m_pPartyLogic->m_tdPartyMember.nStatusFlag, tdPartyMember.nStatusFlag); CHECK_EQUAL(m_pPartyLogic->m_tdPartyMember.nHP, tdPartyMember.nHP); CHECK_EQUAL(m_pPartyLogic->m_tdPartyMember.nEN, tdPartyMember.nEN); CHECK_EQUAL(m_pPartyLogic->m_tdPartyMember.nSTA, tdPartyMember.nSTA); CHECK(0 == wcscmp(m_pPartyLogic->m_tdPartyMember.szName, tdPartyMember.szName)); CHECK(m_pPartyLogic->m_vecBuff == vecBuff); } TEST_FIXTURE(Fixture, TestPartyCommandHandler_PartyAddQuest) { // arrange MUID uidParty = ZTestHelper::NewUID(); MUID uidMember = ZTestHelper::NewUID(); vector<int> vecQuestID; vecQuestID.push_back(100); vecQuestID.push_back(200); vecQuestID.push_back(300); // act MCommandResult nCommandResult = RecvPartyAddQuest(m_pRequestLink, uidParty, uidMember, vecQuestID); // assert CHECK_EQUAL(nCommandResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidParty, uidParty); CHECK_EQUAL(m_pPartyLogic->m_uidMember, uidMember); CHECK(m_pPartyLogic->m_vecQuestID == vecQuestID); } TEST_FIXTURE(Fixture, TestPartyCommandHandler_PartyAddField) { // arrange MUID uidParty = ZTestHelper::NewUID(); MUID uidMember = ZTestHelper::NewUID(); MUID uidFieldGroup = ZTestHelper::NewUID(); // act MCommandResult nCommandResult = RecvPartyAddField(m_pRequestLink, uidParty, uidMember, uidFieldGroup); // assert CHECK_EQUAL(nCommandResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidParty, uidParty); CHECK_EQUAL(m_pPartyLogic->m_uidMember, uidMember); CHECK_EQUAL(m_pPartyLogic->m_uidFieldGroup, uidFieldGroup); } TEST_FIXTURE(Fixture, TestPartyCommandHandler_PartyUpdateQuestRunner) { // arrange MUID uidParty = ZTestHelper::NewUID(); MUID uidField = ZTestHelper::NewUID(); vector<int> vecQuestID; vecQuestID.push_back(100); vecQuestID.push_back(200); vecQuestID.push_back(300); // act MCommandResult nCommandResult = RecvPartyUpdateQuestRunner(m_pRequestLink, uidParty, m_uidRequestPlayer, uidField, vecQuestID); // assert CHECK_EQUAL(nCommandResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidParty, uidParty); CHECK_EQUAL(m_pPartyLogic->m_uidMember, m_uidRequestPlayer); CHECK_EQUAL(m_pPartyLogic->m_uidField, uidField); CHECK(m_pPartyLogic->m_vecQuestID == vecQuestID); } TEST_FIXTURE(Fixture, TestPartyCommandHandler_PartyLeaveReq) { // arrange MUID uidParty = ZTestHelper::NewUID(); // act MCommandResult nCommandResult = RecvPartyLeaveReq(m_pTargetLink, uidParty, m_uidTargetPlayer); // assert CHECK_EQUAL(nCommandResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidSender, m_uidTarget); CHECK_EQUAL(m_pPartyLogic->m_uidParty, uidParty); CHECK_EQUAL(m_pPartyLogic->m_uidLeaveMember, m_uidTargetPlayer); } TEST_FIXTURE(Fixture, TestPartyCommandHandler_PartyRemoveQuest) { // arrange MUID uidParty = ZTestHelper::NewUID(); MUID uidMember = ZTestHelper::NewUID(); vector<int> vecQuestID; vecQuestID.push_back(100); vecQuestID.push_back(200); vecQuestID.push_back(300); // act MCommandResult nCommandResult = RecvPartyRemoveQuest(m_pRequestLink, uidParty, uidMember, vecQuestID); // assert CHECK_EQUAL(nCommandResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidParty, uidParty); CHECK_EQUAL(m_pPartyLogic->m_uidMember, uidMember); CHECK(m_pPartyLogic->m_vecQuestID == vecQuestID); } TEST_FIXTURE(Fixture, TestPartyCommandHandler_PartyRemoveField) { // arrange MUID uidParty = ZTestHelper::NewUID(); MUID uidMember = ZTestHelper::NewUID(); int nFieldGroupID = 100; MUID uidFieldGroup = ZTestHelper::NewUID(); // act MCommandResult nCommandResult = RecvPartyRemoveField(m_pRequestLink, uidParty, uidMember, nFieldGroupID); // assert CHECK_EQUAL(nCommandResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidParty, uidParty); CHECK_EQUAL(m_pPartyLogic->m_uidMember, uidMember); CHECK_EQUAL(m_pPartyLogic->m_nFieldGroupID, nFieldGroupID); } TEST_FIXTURE(Fixture, TestPartyCommandHandler_PartyEraseQuestRunner) { // arrange MUID uidParty = ZTestHelper::NewUID(); // act MCommandResult nCommandResult = RecvPartyEraseQuestRunner(m_pRequestLink, uidParty, m_uidRequestPlayer); // assert CHECK_EQUAL(nCommandResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidParty, uidParty); CHECK_EQUAL(m_pPartyLogic->m_uidMember, m_uidRequestPlayer); } TEST_FIXTURE(Fixture, TestPartyCommandHandler_PartyKickReq) { // arrange MUID uidParty = ZTestHelper::NewUID(); // act MCommandResult nCommandResult = RecvPartyKickReq(m_pRequestLink, uidParty, m_uidRequestPlayer, m_uidTargetPlayer); // assert CHECK_EQUAL(nCommandResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidSender, m_uidRequest); CHECK_EQUAL(m_pPartyLogic->m_uidParty, uidParty); CHECK_EQUAL(m_pPartyLogic->m_uidRequestPlayer, m_uidRequestPlayer); CHECK_EQUAL(m_pPartyLogic->m_uidTargetPlayer, m_uidTargetPlayer); } TEST_FIXTURE(Fixture, TestPartyCommandHandler_DoOffline) { // arrange MUID uidParty = ZTestHelper::NewUID(); // act MCommandResult nCommandResult = RecvDoOffline(m_pTargetLink, uidParty, m_uidTargetPlayer); // assert CHECK_EQUAL(nCommandResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidParty, uidParty); CHECK_EQUAL(m_pPartyLogic->m_uidMember, m_uidTargetPlayer); } TEST_FIXTURE(Fixture, TestPartyCommandHandler_DoOnline) { // arrange MUID uidParty = ZTestHelper::NewUID(); MUID uidOffline = ZTestHelper::NewUID(); // act MCommandResult nCommandResult = RecvDoOnline(m_pTargetLink, uidParty, m_uidTargetPlayer, uidOffline); // assert CHECK_EQUAL(nCommandResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidParty, uidParty); CHECK_EQUAL(m_pPartyLogic->m_uidMember, m_uidTargetPlayer); CHECK_EQUAL(m_pPartyLogic->m_uidOffline, uidOffline); } TEST_FIXTURE(Fixture, TestPartyCommandHandler_JoinInviteReq) { // arrange MUID uidParty = ZTestHelper::NewUID(); // act MCommandResult nCommandResult = RecvJoinInviteReq(m_pRequestLink, uidParty, m_uidRequestPlayer); // assert CHECK_EQUAL(nCommandResult, CR_TRUE); CHECK_EQUAL(m_pPartyLogic->m_uidParty, uidParty); CHECK_EQUAL(m_pPartyLogic->m_uidRequestPlayer, m_uidRequestPlayer); } }
[ "espause0703@gmail.com" ]
espause0703@gmail.com
a5a2b3e65b16618c6cec87b83561eec4b42dfcc2
f7ef74939d8fb753ed2ada80f42dae38a8a43da7
/Sort/QuickSort.cpp
d70f04b3f9ea57ce2c62dec329259716a0793625
[]
no_license
switers-wang/exercise-arithmetic
6154c669118de489ecd1ea5ffa6386382525a854
9ecfe08f812be846ed38f15216790faf1ccd07a9
refs/heads/master
2021-06-01T06:25:48.271442
2016-06-14T10:38:51
2016-06-14T10:38:51
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,193
cpp
// // main.cpp // Sort // // Created by 王叙鹏 on 16/5/24. // Copyright (c) 2016年 王叙鹏. All rights reserved. // #include <iostream> using namespace std; int split(int a[],int i,int j){//一次排列算法,算法核心 int pivot=a[i]; while(i<j){ while(i<j&&pivot<=a[j]){//若已排好序则会越界,例如越界到0 j--; } if(i<j)//防止“若已是排序好的,则i会越界加” a[i++]=a[j]; while(i<j&&pivot>=a[i]){ i++; } if(i<j)//同理 a[j--]=a[i]; } a[i]=pivot;//把标准值放入中间位置 return i; } void QuickSort(int a[],int s,int e){//排序算法框架 if(s<e){ int pivotpos=split(a,s,e); QuickSort(a,s, pivotpos-1); QuickSort(a,pivotpos+1,e); } } int main(int argc, const char * argv[]) { int a[16]; int i=1; int start,end; while(cin>>a[i]){ if(a[i]<0){ start=1; end=i-1; break; } i++; }//输入数组 QuickSort(a,start,end); for(int z=start;z<=end;z++){ cout<<a[z]<<" "; } return 0; }
[ "wangxupeng2012@163.com" ]
wangxupeng2012@163.com
34868cacdf7a6bced86c4d3dd2275343f87bdbbe
2cc65d316203bb137ed5269752d437b6f47fdd27
/编程题/练习4.3 堆中的路径 (25 分)/a.cpp
2f78f5521b6384d82913e293cdbcfe5c8ce60361
[]
no_license
fnmain/data-structure-2ed
26441b66319bf7582617d86552510fb6d8c321ee
6b210f984eb50f92a34d4f11961046f7dad17918
refs/heads/main
2023-04-22T10:05:30.067938
2021-05-16T14:47:37
2021-05-16T14:47:37
350,706,115
0
0
null
null
null
null
UTF-8
C++
false
false
708
cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; void showPath(const vector<int>& v, const int& idx) { int p = idx; while (true) { cout << v[p]; if (p - 1 >= 0) { p = (p - 1) / 2; cout << " "; } else { cout << "\n"; break; } } } bool cmp(const int& a, const int& b) { return a > b; } int main() { int idx, N, M; cin >> N >> M; vector<int> v(N); for (int i = 0; i < N; i++) { cin >> v[i]; push_heap(v.begin(), v.begin() + i + 1, cmp); } for (int k = 0; k < M; k++) { cin >> idx; showPath(v, idx-1); } return 0; }
[ "48914816+fnmain@users.noreply.github.com" ]
48914816+fnmain@users.noreply.github.com
d8b70d8b6304fd448b033af4d67f9736aa6148e7
852766b0ac5d73b51b4d7a68cbc5639a36351f45
/2_sem/kursovaya/bmp_image.h
d409258aba59c9c5f9713458a12f77b761da4554
[]
no_license
VeselAbaya/labs
e22e5bb131ff21ca4ffcc06d0c464e33f96ac267
38c4499dfc6e44cf140af4bb808c09ccec6df0a7
refs/heads/master
2021-07-10T21:39:11.752329
2019-03-17T09:59:31
2019-03-17T09:59:31
104,380,930
0
0
null
null
null
null
UTF-8
C++
false
false
5,145
h
#ifndef BMP_IMAGE_H #define BMP_IMAGE_H #include "resize_direction.h" #include "bmp_exceptions.h" #include <QColor> #include <QImage> /*! \def BYTE_SIZE * Byte size in bits */ #define BYTE_SIZE 8 /*! \def BM_BITCOUNT_INDEX * Order of bytes with information * about image bitcount */ #define BM_BITCOUNT_INDEX 28 /*! \struct BitMapFileHeader * \brief Struct for bmp file header */ #pragma pack(push, 1) struct BitMapFileHeader { char bfType1; /*!< char for 'B' */ char bfType2; /*!< char for 'M' */ unsigned bfSize; /*!< size of a file */ unsigned short bfReserved1; /*!< Reserved 2 bytes */ unsigned short bfReserved2; /*!< Reserved 2 bytes */ unsigned bfOffBits; /*!< Order of byte where raster begins */ }; /*! \struct BitMapInfo * \brief Struct for bmp information header */ struct BitMapInfo { unsigned biSize; /*!< This structure size */ int biWidth; /*!< Image width in px */ int biHeight; /*!< Image height in px */ unsigned short biPlanes; /*!< Always value: 1 */ unsigned short biBitCount; /*!< Image bitcount */ unsigned biCompression; /*!< Compression flag */ unsigned biSizeImage; /*!< Image size on bytes */ int biXPelsPerMeter; /*!< Pixel per meter on x-axis */ int biYPelsPerMeter; /*!< Pixel per meter on y-axis */ unsigned biClrUsed; /*!< Palette size in cells */ unsigned biClrImportant; /*!< Amount of cells form begin of palette to the last cell(including) */ }; #pragma pack(pop) /*! \class Bmp_image * \brief Abstract base class for all Bmp_image classes with different bitcounts */ class Bmp_image { public: /*! virtual distuctor */ virtual ~Bmp_image() {} /*! \pure * \brief Method to set color in (x,y) * \param x x-axis pixel coordinate * \param y y-axis pixel coordinate * \param color Setting color */ virtual void set_color(int x, int y, QColor const& color) = 0; /*! \pure * \brief Method to get image size * \return Image size in bytes */ virtual int get_size() const = 0; /*! \pure * \brief Method to get image height * \return Image height in pixels */ virtual int get_height() const = 0; /*! \pure * \brief Method to get image width * \return Image width in pixels */ virtual int get_width() const = 0; /*! \pure * \brief Method to get image bitcount * \return Image bitcount in bits/color */ virtual short get_bitcount() const = 0; /*! \pure * \brief Method to get raster image * \return Image raster byte array like it implements in bmp file */ virtual uint8_t* get_raster() const = 0; /*! \pure * \brief Method to get specific raster image byte * \return Value of byte on (x,y) image position * \param x x-axis byte coordinate * \param y y-axis byte coordinate */ virtual uint8_t get_raster(int x, int y) const = 0; /*! \pure * \brief Method to get color of specific pixel * \return Color from pixel on position (row, column) * \param x x-axis byte coordinate * \param y y-axis byte coordinate */ virtual QColor get_color(int x, int y) const = 0; /*! \pure * \brief Method to get QImage(image) * \return QImage image */ virtual QImage get_qImage() const = 0; /*! \pure * \brief Method to invert whole image */ virtual void invert_color() {} /*! \pure * \brief Method to grayscale whole image */ virtual void grayscale() {} /*! \pure * \brief Method to invert selected rectangle * \param x1 x-axis first ractangle point сoodrdinate * \param y1 y-axis first ractangle point сoodrdinate * \param x2 x-axis opposite ractangle point сoodrdinate * \param y2 y-axis opposite ractangle point сoodrdinate */ virtual void invert_color(int x1, int y1, int x2, int y2) {} /*! \pure * \brief Method to grayscale selected rectangle * \param x1 x-axis first ractangle point сoodrdinate * \param y1 y-axis first ractangle point сoodrdinate * \param x2 x-axis opposite ractangle point сoodrdinate * \param y2 y-axis opposite ractangle point сoodrdinate */ virtual void grayscale(int x1, int y1, int x2, int y2) {} /*! \pure * \brief Method to crop image * \param vertical_crop Vertical crop size in pixels * \param horizontal_crop Horizontal crop size in pixels * \param direction Crop direction */ virtual void crop(int vertical_crop, int horizontal_crop, Bmp::Resize_direction direction) {} /*! \pure * \brief Method to expanse image with some color * \param vertical_exp Vertical expansion size in pixels * \param horizontal_exp Horizontal expansion size in pixels * \param direction Expanse direction * \param color Fill color */ virtual void expanse(int vertical_exp, int horizontal_crop, Bmp::Resize_direction direction, QColor color) {} }; #endif // BMP_IMAGE_H
[ "Vandervise465@gmail.com" ]
Vandervise465@gmail.com
01cc072661c975cdd909ffad48a485483ec1576c
06240c2a4a90fedfc7bbd26b7b8fa6f35e875558
/TelEntry.cpp
28d1792e05fbefddbde2dd6ee10a3a8327910b57
[]
no_license
etnAtker/TelDirectory
a006b0ac49f27a5e33e50b9786c12e330571d18d
0a3e423d6f804a7da4b990994d1158632b86c7d1
refs/heads/master
2021-01-24T08:11:53.444859
2018-04-13T17:35:25
2018-04-13T17:35:25
122,972,223
0
0
null
null
null
null
UTF-8
C++
false
false
846
cpp
#include "TelEntry.h" TelEntry::TelEntry(string &name, string &telNumber) { dt = new Date(); this->name = name; this->telNumber = telNumber; } TelEntry::TelEntry(const vector<string> &list) { dt = new Date(list); name = list[0]; telNumber = list[1]; } TelEntry::~TelEntry() { delete dt; } EntryNode::EntryNode(string &name, string &telNumber): TelEntry(name, telNumber) { prev = nullptr; next = nullptr; } EntryNode::EntryNode(const vector<string> &list): TelEntry(list) { prev = nullptr; next = nullptr; } ostream& operator<<(ostream &out, const EntryNode *entry) { out << setw(30) << entry->name << setw(30) << entry->telNumber << entry->dt; return out; } fstream& operator<<(fstream & out, const EntryNode *entry) { out << entry->name << ";" << entry->telNumber << ";"; out << entry->dt; return out; }
[ "adsonlies@hotmail.com" ]
adsonlies@hotmail.com
a2463e07edaac49f98c39a21f418ba5239fc9679
5afc40f33a52698c07a2db3882346234ba277453
/calcrisco.cpp
5b1e5fe14c792a26649a0650259a184a64ceee8c
[]
no_license
gustavomelo20/cplusplus
0d8a1ea4ed1c26a6165decb3ea94fb913e389dd5
a14b2498ed9da0c47a4bdf38a0eb4b2afd9be9ce
refs/heads/master
2022-07-27T21:19:40.424546
2020-05-13T00:58:16
2020-05-13T00:58:16
255,774,450
2
0
null
null
null
null
UTF-8
C++
false
false
1,298
cpp
#include <stdio.h> #include <stdlib.h> #include <locale.h> main() { float medio=0, acoes=0,risco=0 , con=0, vol=0, principal=0, anterior=0, montante=0, juros=0; int resposta; int meses; int trimestre; do { printf("Digite Quanto voce tem em acoes?: "); scanf("%f", &acoes); printf("Digite Quanto voce tem em acoes?: "); scanf("%d",&meses); printf("Digite Qual a volatilidade do ativo?: "); scanf("%f", &vol); printf("Digite Qual o nivel de confiaça?: "); scanf("%f", &con); printf("Digite taxa de retorno medio?: "); scanf("%f", &medio); medio=(medio/100); vol=(vol/100); con=(con/100); risco=(medio-vol*con)*10;// VaR = Retorno médio – Volatilidade * Nível de confiança. acoes=(acoes/risco); printf("\n\n taxa de risco %f: " ,risco); printf("\n\n montante financeiro %.2f: " ,acoes); for(int i = 1; i <= trimestre; i++){ montante = acoes * pow((1 + risco), i); juros = montante - principal - anterior; anterior += juro printf("\n\nDigite 1-Continuar 2-Sair \n"); scanf("%d", &resposta); printf("Rendimento: %.2f Montante: %.2f\n",juros,montante); } while(resposta==1); system("pause"); return 0; }
[ "infogustavomelo@gmail.com" ]
infogustavomelo@gmail.com
9185a0079e4609d615826e58247c79e32ead1b02
2f874d5907ad0e95a2285ffc3592b8f75ecca7cd
/src/leveldb/port/port_example.h
32c4358ddbcacc636679e3d48d7b770eab05d1b0
[ "MIT-Wu", "MIT", "ISC", "BSL-1.0", "BSD-3-Clause" ]
permissive
dzcoin/DzCoinService
fb93809a37fad0a26bf26189266b44cf4c797865
b0056717d6bcc1741f4fb3f3f166cd8ce78393f9
refs/heads/master
2021-01-20T20:28:41.639585
2016-08-15T06:21:51
2016-08-15T06:21:51
65,678,478
0
0
null
null
null
null
UTF-8
C++
false
false
4,672
h
// copyright (c) 2011 the leveldb authors. all rights reserved. // use of this source code is governed by a bsd-style license that can be // found in the license file. see the authors file for names of contributors. // // this file contains the specification, but not the implementations, // of the types/operations/etc. that should be defined by a platform // specific port_<platform>.h file. use this file as a reference for // how to port this package to a new platform. #ifndef storage_leveldb_port_port_example_h_ #define storage_leveldb_port_port_example_h_ namespace leveldb { namespace port { // todo(jorlow): many of these belong more in the environment class rather than // here. we should try moving them and see if it affects perf. // the following boolean constant must be true on a little-endian machine // and false otherwise. static const bool klittleendian = true /* or some other expression */; // ------------------ threading ------------------- // a mutex represents an exclusive lock. class mutex { public: mutex(); ~mutex(); // lock the mutex. waits until other lockers have exited. // will deadlock if the mutex is already locked by this thread. void lock(); // unlock the mutex. // requires: this mutex was locked by this thread. void unlock(); // optionally crash if this thread does not hold this mutex. // the implementation must be fast, especially if ndebug is // defined. the implementation is allowed to skip all checks. void assertheld(); }; class condvar { public: explicit condvar(mutex* mu); ~condvar(); // atomically release *mu and block on this condition variable until // either a call to signalall(), or a call to signal() that picks // this thread to wakeup. // requires: this thread holds *mu void wait(); // if there are some threads waiting, wake up at least one of them. void signal(); // wake up all waiting threads. void signallall(); }; // thread-safe initialization. // used as follows: // static port::oncetype init_control = leveldb_once_init; // static void initializer() { ... do something ...; } // ... // port::initonce(&init_control, &initializer); typedef intptr_t oncetype; #define leveldb_once_init 0 extern void initonce(port::oncetype*, void (*initializer)()); // a type that holds a pointer that can be read or written atomically // (i.e., without word-tearing.) class atomicpointer { private: intptr_t rep_; public: // initialize to arbitrary value atomicpointer(); // initialize to hold v explicit atomicpointer(void* v) : rep_(v) { } // read and return the stored pointer with the guarantee that no // later memory access (read or write) by this thread can be // reordered ahead of this read. void* acquire_load() const; // set v as the stored pointer with the guarantee that no earlier // memory access (read or write) by this thread can be reordered // after this store. void release_store(void* v); // read the stored pointer with no ordering guarantees. void* nobarrier_load() const; // set va as the stored pointer with no ordering guarantees. void nobarrier_store(void* v); }; // ------------------ compression ------------------- // store the snappy compression of "input[0,input_length-1]" in *output. // returns false if snappy is not supported by this port. extern bool snappy_compress(const char* input, size_t input_length, std::string* output); // if input[0,input_length-1] looks like a valid snappy compressed // buffer, store the size of the uncompressed data in *result and // return true. else return false. extern bool snappy_getuncompressedlength(const char* input, size_t length, size_t* result); // attempt to snappy uncompress input[0,input_length-1] into *output. // returns true if successful, false if the input is invalid lightweight // compressed data. // // requires: at least the first "n" bytes of output[] must be writable // where "n" is the result of a successful call to // snappy_getuncompressedlength. extern bool snappy_uncompress(const char* input_data, size_t input_length, char* output); // ------------------ miscellaneous ------------------- // if heap profiling is not supported, returns false. // else repeatedly calls (*func)(arg, data, n) and then returns true. // the concatenation of all "data[0,n-1]" fragments is the heap profile. extern bool getheapprofile(void (*func)(void*, const char*, int), void* arg); } // namespace port } // namespace leveldb #endif // storage_leveldb_port_port_example_h_
[ "dzgrouphelp@foxmail.com" ]
dzgrouphelp@foxmail.com
2ca489405ac3666fb2266fd29fd1c7f1d534a4c0
73ee941896043f9b3e2ab40028d24ddd202f695f
/external/chromium_org/chrome/browser/android/intent_helper.h
203690309172d9196b2b036e5092e6084ac09620
[ "BSD-3-Clause" ]
permissive
CyFI-Lab-Public/RetroScope
d441ea28b33aceeb9888c330a54b033cd7d48b05
276b5b03d63f49235db74f2c501057abb9e79d89
refs/heads/master
2022-04-08T23:11:44.482107
2016-09-22T20:15:43
2016-09-22T20:15:43
58,890,600
5
3
null
null
null
null
UTF-8
C++
false
false
769
h
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_ANDROID_INTENT_HELPER_H_ #define CHROME_BROWSER_ANDROID_INTENT_HELPER_H_ #include <jni.h> #include "base/strings/string16.h" namespace chrome { namespace android { // Triggers a send email intent. void SendEmail(const string16& data_email, const string16& data_subject, const string16& data_body, const string16& data_chooser_title, const string16& data_file_to_attach); bool RegisterIntentHelper(JNIEnv* env); } // namespace android } // namespace chrome #endif // CHROME_BROWSER_ANDROID_INTENT_HELPER_H_
[ "ProjectRetroScope@gmail.com" ]
ProjectRetroScope@gmail.com
b2e54f529334414e800e57df496f34691b6327d3
25a107f9cab4ddedf457c355299f0078697506ad
/AppData/Local/Autodesk/webdeploy/production/1f559bb8ae333199306b5c4f1fe680c6eb7ab9e0/CPP/include/Fusion/Features/RectangularPatternFeatureInput.h
d6d743195067e9b1debdbc612b2909b4ab668599
[]
no_license
Park-Minjoo/HCI_TeamProject_GroupNo2
1b6cc7887173f717ba76068472174cc3a9109124
5ace0f0a9d81b39d6782300a14847b223d7ed90a
refs/heads/master
2023-01-27T11:59:36.791453
2023-01-13T04:26:18
2023-01-13T04:26:18
273,715,196
1
0
null
2023-01-13T04:26:26
2020-06-20T13:39:33
null
UTF-8
C++
false
false
13,076
h
////////////////////////////////////////////////////////////////////////////// // // Copyright 2016 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software. // ////////////////////////////////////////////////////////////////////////////// #pragma once #include "../../Core/Base.h" #include "../FusionTypeDefs.h" // THIS CLASS WILL BE VISIBLE TO AN API CLIENT. // THIS HEADER FILE WILL BE GENERATED FROM NIDL. #include "../../Core/OSMacros.h" #ifdef FUSIONXINTERFACE_EXPORTS # ifdef __COMPILING_ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_CPP__ # define ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API XI_EXPORT # else # define ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API # endif #else # define ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API XI_IMPORT #endif namespace adsk { namespace fusion { class BaseFeature; }} namespace adsk { namespace core { class ObjectCollection; class ValueInput; class Vector3D; }} namespace adsk { namespace fusion { /// This class defines the methods and properties that pertain to the definition of a rectangular pattern /// feature. class RectangularPatternFeatureInput : public core::Base { public: /// Gets and sets the input entities. The collection can contain faces, features, bodies or occurrences. /// All of the entities must be of a single type. For example, it can't contain features and occurrences /// but only features or occurrences. core::Ptr<core::ObjectCollection> inputEntities() const; bool inputEntities(const core::Ptr<core::ObjectCollection>& value); /// Sets all of the input required to define the pattern in the second direction. /// directionTwoEntity : Specifies the entity used to define the second direction entity. This can be a linear edge, construction axis, sketch line or rectangular pattern feature. /// If a rectangular pattern feature is set, the directionOneEntity and directionTwoEntity properties return the same rectangular pattern feature. /// This argument can be null to indicate that the default second direction is to be used, which is 90 degrees to the first direction. /// quantityTwo : Specifies the number of instances in the second direction. /// distanceTwo : Specifies the distance in the second direction. How this value is used depends on the value of the PatternDistanceType property. /// If the value is ExtentPatternDistanceType then it defines the total distance of the pattern. /// If the value is SpacingPatternDistanceType then it defines the distance between each element. /// Returns true if it was successful. bool setDirectionTwo(const core::Ptr<core::Base>& directionTwoEntity, const core::Ptr<core::ValueInput>& quantityTwo, const core::Ptr<core::ValueInput>& distanceTwo); /// Gets and sets the first direction entity. /// This can be a linear edge, construction axis, sketch line or rectangular pattern feature. /// If a rectangular pattern feature is set, the directionOneEntity and directionTwoEntity properties return the same rectangular pattern feature. core::Ptr<core::Base> directionOneEntity() const; bool directionOneEntity(const core::Ptr<core::Base>& value); /// Gets and sets the second direction entity. /// This can be a linear edge, construction axis, sketch line or rectangular pattern feature. /// If a rectangular pattern feature is set, the directionOneEntity and directionTwoEntity properties return the same rectangular pattern feature. core::Ptr<core::Base> directionTwoEntity() const; bool directionTwoEntity(const core::Ptr<core::Base>& value); /// Gets and sets the number of instances in the first direction. core::Ptr<core::ValueInput> quantityOne() const; bool quantityOne(const core::Ptr<core::ValueInput>& value); /// Gets and sets the number of instances in the second direction. core::Ptr<core::ValueInput> quantityTwo() const; bool quantityTwo(const core::Ptr<core::ValueInput>& value); /// Gets and sets the distance in the first direction. core::Ptr<core::ValueInput> distanceOne() const; bool distanceOne(const core::Ptr<core::ValueInput>& value); /// Gets and sets the distance in the second direction. core::Ptr<core::ValueInput> distanceTwo() const; bool distanceTwo(const core::Ptr<core::ValueInput>& value); /// Returns a Vector3D indicating the positive direction of direction one. core::Ptr<core::Vector3D> directionOne() const; /// Returns a Vector3D indicating the positive direction of direction two. core::Ptr<core::Vector3D> directionTwo() const; /// Gets and sets if the pattern in direction one is in one direction or symmetric. bool isSymmetricInDirectionOne() const; bool isSymmetricInDirectionOne(bool value); /// Gets and sets if the pattern in direction two is in one direction or symmetric. bool isSymmetricInDirectionTwo() const; bool isSymmetricInDirectionTwo(bool value); /// Gets and sets how the distance between elements is computed. PatternDistanceType patternDistanceType() const; bool patternDistanceType(PatternDistanceType value); /// Gets and sets the compute option when patterning features. The default value for this is AdjustPatternCompute. /// This property only applies when patterning features and is ignored in the direct modeling environment. PatternComputeOptions patternComputeOption() const; bool patternComputeOption(PatternComputeOptions value); /// When creating a feature that is owned by a base feature, set this property to the /// base feature you want to associate the new feature with. By default, this is null, /// meaning it will not be associated with a base feature. /// Because of a current limitation, if you want to create a feature associated with a base /// feature, you must set this property AND call the startEdit method of the base feature, /// create the feature, and then call the finishEdit method of the base feature. The base /// feature must be in an "edit" state to be able to add any additional items to it. core::Ptr<BaseFeature> targetBaseFeature() const; bool targetBaseFeature(const core::Ptr<BaseFeature>& value); ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API static const char* classType(); ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API const char* objectType() const override; ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API void* queryInterface(const char* id) const override; ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API static const char* interfaceId() { return classType(); } private: // Raw interface virtual core::ObjectCollection* inputEntities_raw() const = 0; virtual bool inputEntities_raw(core::ObjectCollection* value) = 0; virtual bool setDirectionTwo_raw(core::Base* directionTwoEntity, core::ValueInput* quantityTwo, core::ValueInput* distanceTwo) = 0; virtual core::Base* directionOneEntity_raw() const = 0; virtual bool directionOneEntity_raw(core::Base* value) = 0; virtual core::Base* directionTwoEntity_raw() const = 0; virtual bool directionTwoEntity_raw(core::Base* value) = 0; virtual core::ValueInput* quantityOne_raw() const = 0; virtual bool quantityOne_raw(core::ValueInput* value) = 0; virtual core::ValueInput* quantityTwo_raw() const = 0; virtual bool quantityTwo_raw(core::ValueInput* value) = 0; virtual core::ValueInput* distanceOne_raw() const = 0; virtual bool distanceOne_raw(core::ValueInput* value) = 0; virtual core::ValueInput* distanceTwo_raw() const = 0; virtual bool distanceTwo_raw(core::ValueInput* value) = 0; virtual core::Vector3D* directionOne_raw() const = 0; virtual core::Vector3D* directionTwo_raw() const = 0; virtual bool isSymmetricInDirectionOne_raw() const = 0; virtual bool isSymmetricInDirectionOne_raw(bool value) = 0; virtual bool isSymmetricInDirectionTwo_raw() const = 0; virtual bool isSymmetricInDirectionTwo_raw(bool value) = 0; virtual PatternDistanceType patternDistanceType_raw() const = 0; virtual bool patternDistanceType_raw(PatternDistanceType value) = 0; virtual PatternComputeOptions patternComputeOption_raw() const = 0; virtual bool patternComputeOption_raw(PatternComputeOptions value) = 0; virtual BaseFeature* targetBaseFeature_raw() const = 0; virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; }; // Inline wrappers inline core::Ptr<core::ObjectCollection> RectangularPatternFeatureInput::inputEntities() const { core::Ptr<core::ObjectCollection> res = inputEntities_raw(); return res; } inline bool RectangularPatternFeatureInput::inputEntities(const core::Ptr<core::ObjectCollection>& value) { return inputEntities_raw(value.get()); } inline bool RectangularPatternFeatureInput::setDirectionTwo(const core::Ptr<core::Base>& directionTwoEntity, const core::Ptr<core::ValueInput>& quantityTwo, const core::Ptr<core::ValueInput>& distanceTwo) { bool res = setDirectionTwo_raw(directionTwoEntity.get(), quantityTwo.get(), distanceTwo.get()); return res; } inline core::Ptr<core::Base> RectangularPatternFeatureInput::directionOneEntity() const { core::Ptr<core::Base> res = directionOneEntity_raw(); return res; } inline bool RectangularPatternFeatureInput::directionOneEntity(const core::Ptr<core::Base>& value) { return directionOneEntity_raw(value.get()); } inline core::Ptr<core::Base> RectangularPatternFeatureInput::directionTwoEntity() const { core::Ptr<core::Base> res = directionTwoEntity_raw(); return res; } inline bool RectangularPatternFeatureInput::directionTwoEntity(const core::Ptr<core::Base>& value) { return directionTwoEntity_raw(value.get()); } inline core::Ptr<core::ValueInput> RectangularPatternFeatureInput::quantityOne() const { core::Ptr<core::ValueInput> res = quantityOne_raw(); return res; } inline bool RectangularPatternFeatureInput::quantityOne(const core::Ptr<core::ValueInput>& value) { return quantityOne_raw(value.get()); } inline core::Ptr<core::ValueInput> RectangularPatternFeatureInput::quantityTwo() const { core::Ptr<core::ValueInput> res = quantityTwo_raw(); return res; } inline bool RectangularPatternFeatureInput::quantityTwo(const core::Ptr<core::ValueInput>& value) { return quantityTwo_raw(value.get()); } inline core::Ptr<core::ValueInput> RectangularPatternFeatureInput::distanceOne() const { core::Ptr<core::ValueInput> res = distanceOne_raw(); return res; } inline bool RectangularPatternFeatureInput::distanceOne(const core::Ptr<core::ValueInput>& value) { return distanceOne_raw(value.get()); } inline core::Ptr<core::ValueInput> RectangularPatternFeatureInput::distanceTwo() const { core::Ptr<core::ValueInput> res = distanceTwo_raw(); return res; } inline bool RectangularPatternFeatureInput::distanceTwo(const core::Ptr<core::ValueInput>& value) { return distanceTwo_raw(value.get()); } inline core::Ptr<core::Vector3D> RectangularPatternFeatureInput::directionOne() const { core::Ptr<core::Vector3D> res = directionOne_raw(); return res; } inline core::Ptr<core::Vector3D> RectangularPatternFeatureInput::directionTwo() const { core::Ptr<core::Vector3D> res = directionTwo_raw(); return res; } inline bool RectangularPatternFeatureInput::isSymmetricInDirectionOne() const { bool res = isSymmetricInDirectionOne_raw(); return res; } inline bool RectangularPatternFeatureInput::isSymmetricInDirectionOne(bool value) { return isSymmetricInDirectionOne_raw(value); } inline bool RectangularPatternFeatureInput::isSymmetricInDirectionTwo() const { bool res = isSymmetricInDirectionTwo_raw(); return res; } inline bool RectangularPatternFeatureInput::isSymmetricInDirectionTwo(bool value) { return isSymmetricInDirectionTwo_raw(value); } inline PatternDistanceType RectangularPatternFeatureInput::patternDistanceType() const { PatternDistanceType res = patternDistanceType_raw(); return res; } inline bool RectangularPatternFeatureInput::patternDistanceType(PatternDistanceType value) { return patternDistanceType_raw(value); } inline PatternComputeOptions RectangularPatternFeatureInput::patternComputeOption() const { PatternComputeOptions res = patternComputeOption_raw(); return res; } inline bool RectangularPatternFeatureInput::patternComputeOption(PatternComputeOptions value) { return patternComputeOption_raw(value); } inline core::Ptr<BaseFeature> RectangularPatternFeatureInput::targetBaseFeature() const { core::Ptr<BaseFeature> res = targetBaseFeature_raw(); return res; } inline bool RectangularPatternFeatureInput::targetBaseFeature(const core::Ptr<BaseFeature>& value) { return targetBaseFeature_raw(value.get()); } }// namespace fusion }// namespace adsk #undef ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API
[ "21701015@handong.edu" ]
21701015@handong.edu
94e2d47bdf62c5ebb4b299cb5c70f99dff23954e
695519bebbf33ab9f10b1dc9066cce7addf76c81
/KDTree/src/bplustree/strategies/BalanceStrategy.cpp
11a27414df1051bfd9c06741c542ede00f4c5320
[]
no_license
nhuallpa/tpdatos-trenes
a1b05b2fd73c9d05f6bfd57bf7a800ec0c1f8b40
0dda29099d6e6d7ba3a331684a6dfecdb19a0dd3
refs/heads/master
2021-03-12T22:11:07.490033
2012-06-22T03:46:15
2012-06-22T03:46:15
32,127,961
0
0
null
null
null
null
UTF-8
C++
false
false
189
cpp
/* * BalaceStrategy.cpp * */ #include "BalanceStrategy.h" #include "../Node.h" #include "../LeafNode.h" BalanceStrategy::BalanceStrategy() { } BalanceStrategy::~BalanceStrategy() { }
[ "sorsergios@gmail.com@e61a746a-3c76-0f37-829a-f636c7cc3421" ]
sorsergios@gmail.com@e61a746a-3c76-0f37-829a-f636c7cc3421
5a7e32ae10b17590c4aacbfc13eee68fb69e48b9
f302afecb33cd313e69495a5a2d6cd2e8c9ed051
/Source/Macad.Occt/Generated/TopAbs.h
b4600913bbb604d757d11101fed53076bb6af36f
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
Macad3D/Macad3D
49575df8ed5b4e93708ce10befb8feaee698ef2d
e90039a50385a5a03158ae5b19cb97929c0eba49
refs/heads/main
2023-08-17T03:34:35.983521
2023-08-05T16:01:26
2023-08-05T16:01:26
317,009,127
235
88
MIT
2021-07-04T06:45:27
2020-11-29T17:49:20
C#
UTF-8
C++
false
false
11,078
h
// Generated wrapper code for package TopAbs #pragma once namespace Macad { namespace Occt { //--------------------------------------------------------------------- // Enum TopAbs_Orientation //--------------------------------------------------------------------- /// <summary> /// Identifies the orientation of a topological shape. /// Orientation can represent a relation between two /// entities, or it can apply to a shape in its own right. /// When used to describe a relation between two /// shapes, orientation allows you to use the underlying /// entity in either direction. For example on a curve /// which is oriented FORWARD (say from left to right) /// you can have both a FORWARD and a REVERSED /// edge. The FORWARD edge will be oriented from /// left to right, and the REVERSED edge from right to /// left. In this way, you share the underlying entity. In /// other words, two faces of a cube can share an /// edge, and can also be used to build compound shapes. /// For each case in which an element is used as the /// boundary of a geometric domain of a higher /// dimension, this element defines two local regions of /// which one is arbitrarily considered as the default /// region. A change in orientation implies a switch of /// default region. This allows you to apply changes of /// orientation to the shape as a whole. /// </summary> public enum class TopAbs_Orientation { FORWARD = 0, REVERSED = 1, INTERNAL = 2, EXTERNAL = 3 }; // enum class TopAbs_Orientation //--------------------------------------------------------------------- // Enum TopAbs_ShapeEnum //--------------------------------------------------------------------- /// <summary> /// Identifies various topological shapes. This /// enumeration allows you to use dynamic typing of shapes. /// The values are listed in order of complexity, from the /// most complex to the most simple i.e. /// COMPOUND > COMPSOLID > SOLID > .... > VERTEX > SHAPE. /// Any shape can contain simpler shapes in its definition. /// Abstract topological data structure describes a basic /// entity, the shape (present in this enumeration as the /// SHAPE value), which can be divided into the following /// component topologies: /// - COMPOUND: A group of any of the shapes below. /// - COMPSOLID: A set of solids connected by their /// faces. This expands the notions of WIRE and SHELL to solids. /// - SOLID: A part of 3D space bounded by shells. /// - SHELL: A set of faces connected by some of the /// edges of their wire boundaries. A shell can be open or closed. /// - FACE: Part of a plane (in 2D geometry) or a surface /// (in 3D geometry) bounded by a closed wire. Its /// geometry is constrained (trimmed) by contours. /// - WIRE: A sequence of edges connected by their /// vertices. It can be open or closed depending on /// whether the edges are linked or not. /// - EDGE: A single dimensional shape corresponding /// to a curve, and bound by a vertex at each extremity. /// - VERTEX: A zero-dimensional shape corresponding to a point in geometry. /// </summary> public enum class TopAbs_ShapeEnum { COMPOUND = 0, COMPSOLID = 1, SOLID = 2, SHELL = 3, FACE = 4, WIRE = 5, EDGE = 6, VERTEX = 7, SHAPE = 8 }; // enum class TopAbs_ShapeEnum //--------------------------------------------------------------------- // Enum TopAbs_State //--------------------------------------------------------------------- /// <summary> /// Identifies the position of a vertex or a set of /// vertices relative to a region of a shape. /// The figure shown above illustrates the states of /// vertices found in various parts of the edge relative /// to the face which it intersects. /// </summary> public enum class TopAbs_State { INSIDE = 0, OUTSIDE = 1, ON = 2, UNKNOWN = 3 }; // enum class TopAbs_State //--------------------------------------------------------------------- // Class TopAbs //--------------------------------------------------------------------- /// <summary> /// This package gives resources for Topology oriented /// applications such as : Topological Data Structure, /// Topological Algorithms. /// /// It contains : /// /// * The ShapeEnum enumeration to describe the /// different topological shapes. /// /// * The Orientation enumeration to describe the /// orientation of a topological shape. /// /// * The State enumeration to describes the /// position of a point relative to a Shape. /// /// * Methods to manage the enumerations. /// </summary> public ref class TopAbs sealed : public Macad::Occt::BaseClass<::TopAbs> { #ifdef Include_TopAbs_h public: Include_TopAbs_h #endif public: TopAbs(::TopAbs* nativeInstance) : Macad::Occt::BaseClass<::TopAbs>( nativeInstance, true ) {} TopAbs(::TopAbs& nativeInstance) : Macad::Occt::BaseClass<::TopAbs>( &nativeInstance, false ) {} property ::TopAbs* NativeInstance { ::TopAbs* get() { return static_cast<::TopAbs*>(_NativeInstance); } } public: TopAbs(); TopAbs(Macad::Occt::TopAbs^ parameter1); /// <summary> /// Compose the Orientation <Or1> and <Or2>. This /// composition is not symmetric (if you switch <Or1> and /// <Or2> the result is different). It assumes that <Or1> /// is the Orientation of a Shape S1 containing a Shape S2 /// of Orientation Or2. The result is the cumulated /// orientation of S2 in S1. The composition law is : /// /// \ Or2 FORWARD REVERSED INTERNAL EXTERNAL /// Or1 ------------------------------------- /// FORWARD | FORWARD REVERSED INTERNAL EXTERNAL /// | /// REVERSED | REVERSED FORWARD INTERNAL EXTERNAL /// | /// INTERNAL | INTERNAL INTERNAL INTERNAL INTERNAL /// | /// EXTERNAL | EXTERNAL EXTERNAL EXTERNAL EXTERNAL /// Note: The top corner in the table is the most important /// for the purposes of Open CASCADE topology and shape sharing. /// </summary> static Macad::Occt::TopAbs_Orientation Compose(Macad::Occt::TopAbs_Orientation Or1, Macad::Occt::TopAbs_Orientation Or2); /// <summary> /// xchanges the interior/exterior status of the two /// sides. This is what happens when the sense of /// direction is reversed. The following rules apply: /// /// FORWARD REVERSED /// REVERSED FORWARD /// INTERNAL INTERNAL /// EXTERNAL EXTERNAL /// /// Reverse exchange the material sides. /// </summary> static Macad::Occt::TopAbs_Orientation Reverse(Macad::Occt::TopAbs_Orientation Or); /// <summary> /// Reverses the interior/exterior status of each side of /// the object. So, to take the complement of an object /// means to reverse the interior/exterior status of its /// boundary, i.e. inside becomes outside. /// The method returns the complementary orientation, /// following the rules in the table below: /// FORWARD REVERSED /// REVERSED FORWARD /// INTERNAL EXTERNAL /// EXTERNAL INTERNAL /// /// Complement complements the material side. Inside /// becomes outside. /// </summary> static Macad::Occt::TopAbs_Orientation Complement(Macad::Occt::TopAbs_Orientation Or); /// <summary> /// Prints the name of Shape type as a String on the Stream. /// </summary> static System::IO::TextWriter^ Print(Macad::Occt::TopAbs_ShapeEnum theShapeType, System::IO::TextWriter^ theStream); /// <summary> /// Prints the name of the Orientation as a String on the Stream. /// </summary> static System::IO::TextWriter^ Print(Macad::Occt::TopAbs_Orientation theOrientation, System::IO::TextWriter^ theStream); /// <summary> /// Prints the name of the State <St> as a String on /// the Stream <S> and returns <S>. /// </summary> static System::IO::TextWriter^ Print(Macad::Occt::TopAbs_State St, System::IO::TextWriter^ S); /// <summary> /// Returns the string name for a given shape type. /// </summary> /// <param name="theType"> /// shape type /// </param> /// <returns> /// string identifier from the list COMPOUND, COMPSOLID, SOLID, SHELL, FACE, WIRE, EDGE, VERTEX, SHAPE /// </returns> static System::String^ ShapeTypeToString(Macad::Occt::TopAbs_ShapeEnum theType); /// <summary> /// Returns the shape type from the given string identifier (using case-insensitive comparison). /// </summary> /// <param name="theTypeString"> /// string identifier /// </param> /// <returns> /// shape type or TopAbs_SHAPE if string identifier is invalid /// </returns> static Macad::Occt::TopAbs_ShapeEnum ShapeTypeFromString(System::String^ theTypeString); /// <summary> /// Determines the shape type from the given string identifier (using case-insensitive comparison). /// </summary> /// <param name="theTypeString"> /// string identifier /// </param> /// <param name="theType"> /// detected shape type /// </param> /// <returns> /// TRUE if string identifier is known /// </returns> static bool ShapeTypeFromString(System::String^ theTypeString, Macad::Occt::TopAbs_ShapeEnum% theType); /// <summary> /// Returns the string name for a given shape orientation. /// </summary> /// <param name="theOrientation"> /// shape orientation /// </param> /// <returns> /// string identifier from the list FORWARD, REVERSED, INTERNAL, EXTERNAL /// </returns> static System::String^ ShapeOrientationToString(Macad::Occt::TopAbs_Orientation theOrientation); /// <summary> /// Returns the shape orientation from the given string identifier (using case-insensitive comparison). /// </summary> /// <param name="theOrientationString"> /// string identifier /// </param> /// <returns> /// shape orientation or TopAbs_FORWARD if string identifier is invalid /// </returns> static Macad::Occt::TopAbs_Orientation ShapeOrientationFromString(System::String^ theOrientationString); /// <summary> /// Determines the shape orientation from the given string identifier (using case-insensitive comparison). /// </summary> /// <param name="theOrientationString"> /// string identifier /// </param> /// <param name="theOrientation"> /// detected shape orientation /// </param> /// <returns> /// TRUE if string identifier is known /// </returns> static bool ShapeOrientationFromString(System::String^ theOrientationString, Macad::Occt::TopAbs_Orientation% theOrientation); }; // class TopAbs }; // namespace Occt }; // namespace Macad
[ "dipts@users.noreply.github.com" ]
dipts@users.noreply.github.com
84e84822d0e4fcee4a654e767dcfe3d04b7b08db
1c390cd4fd3605046914767485b49a929198b470
/luogu/P3175.cpp
b07deb8e4017b94d77519d491a1face6bf3bd280
[]
no_license
wwwwodddd/Zukunft
f87fe736b53506f69ab18db674311dd60de04a43
03ffffee9a76e99f6e00bba6dbae91abc6994a34
refs/heads/master
2023-01-24T06:14:35.691292
2023-01-21T15:42:32
2023-01-21T15:42:32
163,685,977
7
8
null
null
null
null
UTF-8
C++
false
false
544
cpp
#include <bits/stdc++.h> using namespace std; int n; double a[1 << 20], z; int main() { scanf("%d", &n); for (int i = 0; i < 1 << n; i++) { scanf("%lf", &a[i]); } for (int j = 0; j < n; j++) { for (int i = 0; i < 1 << n; i++) { if (i >> j & 1) { a[i] += a[i ^ (1 << j)]; } } } for (int i = 0; i < (1 << n) - 1; i++) { if (a[i] > 1 - 1e-9) { printf("INF\n"); return 0; } if ((n - __builtin_popcount(i)) & 1) { z += 1 / (1 - a[i]); } else { z -= 1 / (1 - a[i]); } } printf("%.10F\n", z); return 0; }
[ "wwwwodddd@gmail.com" ]
wwwwodddd@gmail.com
6d98751550b103ba3749ea7c7decfc6eb7a7c3fc
b20e78f18d43591b63553e81905d8c100f63d68c
/src/tstools/tsscan.cpp
d159b8c668fbed605efc0c4ab951e113947d6c44
[ "WTFPL", "LicenseRef-scancode-public-domain", "BSD-2-Clause" ]
permissive
kxp/tsduck
c221f72734c411cdcb8bbad6c385797560dac58f
53063b35be048c2945a206a22bd1c72d1d178fda
refs/heads/master
2020-04-23T12:34:11.657348
2019-02-16T15:02:31
2019-02-16T15:02:31
171,173,582
1
0
null
2019-02-17T21:18:02
2019-02-17T21:18:01
null
UTF-8
C++
false
false
26,774
cpp
//---------------------------------------------------------------------------- // // TSDuck - The MPEG Transport Stream Toolkit // Copyright (c) 2005-2019, Thierry Lelegard // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF // THE POSSIBILITY OF SUCH DAMAGE. // //---------------------------------------------------------------------------- // // DVB network scanning utility // //---------------------------------------------------------------------------- #include "tsMain.h" #include "tsCOM.h" #include "tsTuner.h" #include "tsTunerArgs.h" #include "tsTunerParametersDVBT.h" #include "tsTunerParametersDVBC.h" #include "tsTunerParametersDVBS.h" #include "tsTunerParametersATSC.h" #include "tsModulation.h" #include "tsTSScanner.h" #include "tsChannelFile.h" #include "tsNIT.h" #include "tsTransportStreamId.h" #include "tsDescriptorList.h" #include "tsTime.h" #include "tsSysUtils.h" #include "tsNullReport.h" TSDUCK_SOURCE; #define DEFAULT_PSI_TIMEOUT 10000 // ms #define DEFAULT_MIN_STRENGTH 10 #define DEFAULT_MIN_QUALITY 10 #define DEFAULT_FIRST_OFFSET (-2) #define DEFAULT_LAST_OFFSET (+2) #define OFFSET_EXTEND 3 //---------------------------------------------------------------------------- // Command line options //---------------------------------------------------------------------------- class ScanOptions: public ts::Args { public: ScanOptions(int argc, char *argv[]); virtual ~ScanOptions(); ts::TunerArgs tuner_args; bool uhf_scan; bool nit_scan; bool no_offset; bool use_best_quality; bool use_best_strength; int first_uhf_channel; int last_uhf_channel; int first_uhf_offset; int last_uhf_offset; int min_strength; int min_quality; bool show_modulation; bool list_services; bool global_services; ts::MilliSecond psi_timeout; ts::UString channel_file; bool update_channel_file; bool default_channel_file; }; // Destructor. ScanOptions::~ScanOptions() {} // Constructor. ScanOptions::ScanOptions(int argc, char *argv[]) : Args(u"Scan a DVB network", u"[options]"), tuner_args(false, true), uhf_scan(false), nit_scan(false), no_offset(false), use_best_quality(false), use_best_strength(false), first_uhf_channel(0), last_uhf_channel(0), first_uhf_offset(0), last_uhf_offset(0), min_strength(0), min_quality(0), show_modulation(false), list_services(false), global_services(false), psi_timeout(0), channel_file(), update_channel_file(false), default_channel_file(false) { // Warning, the following short options are already defined in TunerArgs: // 'a', 'c', 'd', 'f', 'm', 's', 'z' tuner_args.defineOptions(*this); option(u"best-quality"); help(u"best-quality", u"With UHF-band scanning, for each channel, use the offset with the " u"best signal quality. By default, use the average of lowest and highest " u"offsets with required minimum quality and strength. Note that some tuners " u"cannot report a correct signal quality, making this option useless."); option(u"best-strength"); help(u"best-strength", u"With UHF-band scanning, for each channel, use the offset with the " u"best signal strength. By default, use the average of lowest and highest " u"offsets with required minimum quality and strength. Note that some tuners " u"cannot report a correct signal strength, making this option useless."); option(u"first-uhf-channel", 0, INTEGER, 0, 1, ts::UHF::FIRST_CHANNEL, ts::UHF::LAST_CHANNEL); help(u"first-uhf-channel", u"For UHF-band scanning, specify the first channel to scan (default: " + ts::UString::Decimal(ts::UHF::FIRST_CHANNEL) + u")."); option(u"first-offset", 0, INTEGER, 0, 1, -40, +40); help(u"first-offset", u"For UHF-band scanning, specify the first offset to scan (default: " + ts::UString::Decimal(DEFAULT_FIRST_OFFSET, 0, true, u",", true) + u") " u"on each channel."); option(u"global-service-list", 'g'); help(u"global-service-list", u"Same as --service-list but display a global list of services at the end " u"of scanning instead of per transport stream."); option(u"last-uhf-channel", 0, INTEGER, 0, 1, ts::UHF::FIRST_CHANNEL, ts::UHF::LAST_CHANNEL); help(u"last-uhf-channel", u"For UHF-band scanning, specify the last channel to scan (default: " + ts::UString::Decimal(ts::UHF::LAST_CHANNEL) + u")."); option(u"last-offset", 0, INTEGER, 0, 1, -40, +40); help(u"last-offset", u"For UHF-band scanning, specify the last offset to scan on each channel (default: " + ts::UString::Decimal(DEFAULT_LAST_OFFSET, 0, true, u",", true) + u"). " u"Note that tsscan may scan higher offsets. As long as some signal is found at a " u"specified offset, tsscan continues to check up to 3 higher offsets above the \"last\" one. " u"This means that if a signal is found at offset +2, offset +3 will be checked anyway, etc. up to offset +5."); option(u"min-quality", 0, INTEGER, 0, 1, 0, 100); help(u"min-quality", u"Minimum signal quality percentage. Frequencies with lower signal " u"quality are ignored (default: " + ts::UString::Decimal(DEFAULT_MIN_QUALITY) + u"%)."); option(u"min-strength", 0, INTEGER, 0, 1, 0, 100); help(u"min-strength", u"Minimum signal strength percentage. Frequencies with lower signal " u"strength are ignored (default: " + ts::UString::Decimal(DEFAULT_MIN_STRENGTH) + u"%)."); option(u"no-offset", 'n'); help(u"no-offset", u"For UHF-band scanning, scan only the central frequency of each channel. " u"Do not scan frequencies with offsets."); option(u"psi-timeout", 0, UNSIGNED); help(u"psi-timeout", u"milliseconds", u"Specifies the timeout, in milli-seconds, for PSI/SI table collection. " u"Useful only with --service-list. The default is " + ts::UString::Decimal(DEFAULT_PSI_TIMEOUT) + u" milli-seconds."); option(u"service-list", 'l'); help(u"service-list", u"Read SDT of each channel and display the list of services."); option(u"show-modulation", 0); help(u"show-modulation", u"Display modulation parameters when possible. Note that some tuners " u"cannot report correct modulation parameters, making this option useless."); option(u"uhf-band", 'u'); help(u"uhf-band", u"Perform a complete DVB-T UHF-band scanning. Do not use the NIT.\n\n" u"If tuning parameters are present (frequency or channel reference), the NIT is " u"read on the specified frequency and a full scan of the corresponding network is " u"performed. By default, without specific frequency, an UHF-band scanning is performed."); option(u"save-channels", 0, STRING); help(u"save-channels", u"filename", u"Save the description of all channels in the specified XML file. " u"If the file name is \"-\", use the default tuning configuration file. " u"See also option --update-channels."); option(u"update-channels", 0, STRING); help(u"update-channels", u"filename", u"Update the description of all channels in the specified XML file. " u"The content of each scanned transport stream is replaced in the file. " u"If the file does not exist, it is created. " u"If the file name is \"-\", use the default tuning configuration file. " u"The location of the default tuning configuration file depends on the system. " #if defined(TS_LINUX) u"On Linux, the default file is $HOME/.tsduck.channels.xml. " #elif defined(TS_WINDOWS) u"On Windows, the default file is %APPDATA%\\tsduck\\channels.xml. " #endif u"See also option --save-channels."); analyze(argc, argv); tuner_args.load(*this); uhf_scan = present(u"uhf-band"); nit_scan = tuner_args.hasTuningInfo(); use_best_quality = present(u"best-quality"); use_best_strength = present(u"best-strength"); first_uhf_channel = intValue(u"first-uhf-channel", ts::UHF::FIRST_CHANNEL); last_uhf_channel = intValue(u"last-uhf-channel", ts::UHF::LAST_CHANNEL); show_modulation = present(u"show-modulation"); no_offset = present(u"no-offset"); first_uhf_offset = no_offset ? 0 : intValue(u"first-offset", DEFAULT_FIRST_OFFSET); last_uhf_offset = no_offset ? 0 : intValue(u"last-offset", DEFAULT_LAST_OFFSET); min_quality = intValue(u"min-quality", DEFAULT_MIN_QUALITY); min_strength = intValue(u"min-strength", DEFAULT_MIN_STRENGTH); list_services = present(u"service-list"); global_services = present(u"global-service-list"); psi_timeout = intValue<ts::MilliSecond>(u"psi-timeout", DEFAULT_PSI_TIMEOUT); const bool save_channel_file = present(u"save-channels"); update_channel_file = present(u"update-channels"); channel_file = update_channel_file ? value(u"update-channels") : value(u"save-channels"); default_channel_file = (save_channel_file || update_channel_file) && (channel_file.empty() || channel_file == u"-"); if (nit_scan && uhf_scan) { error(u"do not specify tuning parameters with --uhf-band"); } if (!uhf_scan && !nit_scan) { // Default is UHF scan. uhf_scan = true; } if (save_channel_file && update_channel_file) { error(u"--save-channels and --update-channels are mutually exclusive"); } else if (default_channel_file) { // Use default channel file. channel_file = ts::ChannelFile::DefaultFileName(); } exitOnError(); } //---------------------------------------------------------------------------- // UHF-band offset scanner: Scan offsets around a specific UHF channel and // determine offset with the best signal. //---------------------------------------------------------------------------- class OffsetScanner { public: // Constructor: Perform scanning. Keep signal tuned on best offset. OffsetScanner(ScanOptions& opt, ts::Tuner& tuner, int channel); // Check if signal found and which offset is the best one. bool signalFound() const {return _signal_found;} int channel() const {return _channel;} int bestOffset() const {return _best_offset;} ts::TunerParametersPtr tunerParameters() const {return _best_params;} private: ScanOptions& _opt; ts::Tuner& _tuner; const int _channel; bool _signal_found; int _best_offset; int _lowest_offset; int _highest_offset; int _best_quality; int _best_quality_offset; int _best_strength; int _best_strength_offset; ts::TunerParametersPtr _best_params; // Build tuning parameters for a channel. ts::TunerParametersPtr tuningParameters(int offset); // Tune to specified offset. Return false on error. bool tune(int offset, ts::TunerParametersPtr& params); // Test the signal at one specific offset. Return true if signal is found. bool tryOffset(int offset); }; //---------------------------------------------------------------------------- // UHF-band offset scanner constructor. // Perform scanning. Keep signal tuned on best offset //---------------------------------------------------------------------------- OffsetScanner::OffsetScanner(ScanOptions& opt, ts::Tuner& tuner, int channel) : _opt(opt), _tuner(tuner), _channel(channel), _signal_found(false), _best_offset(0), _lowest_offset(0), _highest_offset(0), _best_quality(0), _best_quality_offset(0), _best_strength(0), _best_strength_offset(0), _best_params() { _opt.verbose(u"scanning channel %'d, %'d Hz", {_channel, ts::UHF::Frequency(_channel)}); if (_opt.no_offset) { // Only try the central frequency tryOffset(0); } else { // Scan lower offsets in descending order, starting at central frequency if (_opt.first_uhf_offset <= 0) { bool last_ok = false; int offset = _opt.last_uhf_offset > 0 ? 0 : _opt.last_uhf_offset; while (offset >= _opt.first_uhf_offset - (last_ok ? OFFSET_EXTEND : 0)) { last_ok = tryOffset(offset); --offset; } } // Scan higher offsets in ascending order, starting after central frequency if (_opt.last_uhf_offset > 0) { bool last_ok = false; int offset = _opt.first_uhf_offset <= 0 ? 1 : _opt.first_uhf_offset; while (offset <= _opt.last_uhf_offset + (last_ok ? OFFSET_EXTEND : 0)) { last_ok = tryOffset(offset); ++offset; } } } // If signal was found, select best offset if (_signal_found) { if (_opt.use_best_quality && _best_quality > 0) { // Signal quality indicator is valid, use offset with best signal quality _best_offset = _best_quality_offset; } else if (_opt.use_best_strength && _best_strength > 0) { // Signal strength indicator is valid, use offset with best signal strength _best_offset = _best_strength_offset; } else { // Default: use average between lowest and highest offsets _best_offset = (_lowest_offset + _highest_offset) / 2; } // Finally, tune back to best offset _signal_found = tune(_best_offset, _best_params) && _tuner.getCurrentTuning(*_best_params, false, _opt); } } //---------------------------------------------------------------------------- // Build tuning parameters for a channel. //---------------------------------------------------------------------------- ts::TunerParametersPtr OffsetScanner::tuningParameters(int offset) { // Force frequency in tuning parameters. // Other tuning parameters from command line (or default values). _opt.tuner_args.frequency = ts::UHF::Frequency(_channel, offset); return ts::TunerParameters::FromTunerArgs(ts::DVB_T, _opt.tuner_args, _opt); } //---------------------------------------------------------------------------- // UHF-band offset scanner: Tune to specified offset. Return false on error. //---------------------------------------------------------------------------- bool OffsetScanner::tune(int offset, ts::TunerParametersPtr& params) { params = tuningParameters(offset); return !params.isNull() && _tuner.tune(*params, _opt); } //---------------------------------------------------------------------------- // UHF-band offset scanner: Test the signal at one specific offset. //---------------------------------------------------------------------------- bool OffsetScanner::tryOffset(int offset) { _opt.debug(u"trying offset %d", {offset}); // Tune to transponder and start signal acquisition. // Signal locking timeout is applied in start(). ts::TunerParametersPtr params; if (!tune(offset, params) || !_tuner.start(_opt)) { return false; } // Previously, we double-checked that the signal was locked. // However, looking for signal locked fails on Windows, even if the // signal was actually locked. So, we skip this test and we rely on // the fact that the signal timeout is always non-zero with tsscan, // so since _tuner.start() has succeeded we can be sure that at least // one packet was successfully read and there is some signal. bool ok = #if defined(TS_LINUX) _tuner.signalLocked(_opt); #else true; #endif if (ok) { // Get signal quality & strength const int strength = _tuner.signalStrength(_opt); const int quality = _tuner.signalQuality(_opt); _opt.verbose(ts::UHF::Description(_channel, offset, strength, quality)); if (strength >= 0 && strength <= _opt.min_strength) { // Strength is supported but too low ok = false; } else if (strength > _best_strength) { // Best offset so far for signal strength _best_strength = strength; _best_strength_offset = offset; _tuner.getCurrentTuning(*params, false, _opt); } if (quality >= 0 && quality <= _opt.min_quality) { // Quality is supported but too low ok = false; } else if (quality > _best_quality) { // Best offset so far for signal quality _best_quality = quality; _best_quality_offset = offset; _tuner.getCurrentTuning(*params, false, _opt); } } if (ok) { if (!_signal_found) { // First offset with signal on this channel _signal_found = true; _lowest_offset = _highest_offset = offset; } else if (offset < _lowest_offset) { _lowest_offset = offset; } else if (offset > _highest_offset) { _highest_offset = offset; } } // Stop signal acquisition _tuner.stop(_opt); return ok; } //---------------------------------------------------------------------------- // Scanning context. //---------------------------------------------------------------------------- class ScanContext { public: // Contructor. ScanContext(ScanOptions&); // tsscan main code. void main(); private: ScanOptions& _opt; ts::Tuner _tuner; ts::ServiceList _services; ts::ChannelFile _channels; // Analyze a TS and generate relevant info. void scanTS(std::ostream& strm, const ts::UString& margin, ts::TunerParametersPtr tparams); // UHF-band scanning void uhfScan(); // NIT-based scanning void nitScan(); // Inaccessible methods. ScanContext() = delete; ScanContext(const ScanContext&) = delete; ScanContext& operator=(const ScanContext&) = delete; }; // Contructor. ScanContext::ScanContext(ScanOptions& opt) : _opt(opt), _tuner(), _services(), _channels() { } //---------------------------------------------------------------------------- // Analyze a TS and generate relevant info. //---------------------------------------------------------------------------- void ScanContext::scanTS(std::ostream& strm, const ts::UString& margin, ts::TunerParametersPtr tparams) { const bool get_services = _opt.list_services || _opt.global_services; // Collect info from the TS. // Use "PAT only" when we do not need the services or channels file. ts::TSScanner info(_tuner, _opt.psi_timeout, !get_services && _opt.channel_file.empty(), _opt); if (tparams.isNull()) { info.getTunerParameters(tparams); } ts::SafePtr<ts::PAT> pat; ts::SafePtr<ts::SDT> sdt; ts::SafePtr<ts::NIT> nit; info.getPAT(pat); info.getSDT(sdt); info.getNIT(nit); // Get network and TS Id. uint16_t ts_id = 0; uint16_t net_id = 0; if (!pat.isNull()) { ts_id = pat->ts_id; strm << margin << ts::UString::Format(u"Transport stream id: %d, 0x%X", {ts_id, ts_id}) << std::endl; } if (!nit.isNull()) { net_id = nit->network_id; } // Reset TS description in channels file. ts::ChannelFile::TransportStreamPtr ts_info; if (!_opt.channel_file.empty()) { ts::ChannelFile::NetworkPtr net_info(_channels.networkGetOrCreate(net_id, _tuner.tunerType())); ts_info = net_info->tsGetOrCreate(ts_id); ts_info->clear(); // reset all services in TS. ts_info->onid = sdt.isNull() ? 0 : sdt->onetw_id; ts_info->tune = tparams; } // Display modulation parameters if (_opt.show_modulation && !tparams.isNull()) { tparams->displayParameters(strm, margin); } // Display or collect services if (get_services || !ts_info.isNull()) { ts::ServiceList srvlist; if (info.getServices(srvlist)) { if (!ts_info.isNull()) { // Add all services in the channels info. ts_info->addServices(srvlist); } if (_opt.list_services) { // Display services for this TS srvlist.sort(ts::Service::Sort1); strm << std::endl; ts::Service::Display(strm, margin, srvlist); strm << std::endl; } if (_opt.global_services) { // Add collected services in global service list _services.insert(_services.end(), srvlist.begin(), srvlist.end()); } } } } //---------------------------------------------------------------------------- // UHF-band scanning //---------------------------------------------------------------------------- void ScanContext::uhfScan() { // UHF means DVB-T if (_tuner.tunerType() != ts::DVB_T) { _opt.error(u"UHF scanning needs DVB-T, tuner %s is %s", {_tuner.deviceName(), ts::TunerTypeEnum.name(_tuner.tunerType())}); return; } // Loop on all selected UHF channels for (int chan = _opt.first_uhf_channel; chan <= _opt.last_uhf_channel; ++chan) { // Scan all offsets surrounding the channel OffsetScanner offscan(_opt, _tuner, chan); if (offscan.signalFound()) { // Report channel characteristics std::cout << "* UHF " << ts::UHF::Description(chan, offscan.bestOffset(), _tuner.signalStrength(_opt), _tuner.signalQuality(_opt)) << std::endl; // Analyze PSI/SI if required scanTS(std::cout, u" ", offscan.tunerParameters()); } } } //---------------------------------------------------------------------------- // NIT-based scanning //---------------------------------------------------------------------------- void ScanContext::nitScan() { // Tune to the reference transponder. ts::TunerParametersPtr params; if (!_opt.tuner_args.tune(_tuner, params, _opt)) { return; } // Collect info on reference transponder. ts::TSScanner info(_tuner, _opt.psi_timeout, false, _opt); // Get the collected NIT ts::SafePtr<ts::NIT> nit; info.getNIT(nit); if (nit.isNull()) { _opt.error(u"cannot scan network, no NIT found on specified transponder"); return; } // Process each TS descriptor list in the NIT. for (ts::NIT::TransportMap::const_iterator it = nit->transports.begin(); it != nit->transports.end(); ++it) { const ts::DescriptorList& dlist(it->second.descs); // Loop on all descriptors for the current TS. for (size_t i = 0; i < dlist.count(); ++i) { // Try to get delivery system information from current descriptor ts::TunerParametersPtr tp(ts::TunerParameters::FromDeliveryDescriptor(*dlist[i])); if (!tp.isNull()) { // Got a delivery descriptor, this is the description of one transponder. // Tune to this transponder. _opt.debug(u"* tuning to " + tp->toPluginOptions(true)); if (_tuner.tune(*tp, _opt)) { // Report channel characteristics std::cout << "* Frequency: " << tp->shortDescription(_tuner.signalStrength(_opt), _tuner.signalQuality(_opt)) << std::endl; // Analyze PSI/SI if required scanTS(std::cout, u" ", tp); } } } } } //---------------------------------------------------------------------------- // Main code from scan context. //---------------------------------------------------------------------------- void ScanContext::main() { // Initialize tuner. _tuner.setSignalTimeoutSilent(true); if (!_opt.tuner_args.configureTuner(_tuner, _opt)) { return; } // Pre-load the existing channel file. if (_opt.update_channel_file && !_opt.channel_file.empty() && ts::FileExists(_opt.channel_file) && !_channels.load(_opt.channel_file, _opt)) { return; } // Main processing depends on scanning method. if (_opt.uhf_scan) { uhfScan(); } else if (_opt.nit_scan) { nitScan(); } else { _opt.fatal(u"inconsistent options, internal error"); } // Report global list of services if required if (_opt.global_services) { _services.sort(ts::Service::Sort1); std::cout << std::endl; ts::Service::Display(std::cout, u"", _services); } // Save channel file. Create intermediate directories when it is the default file. if (!_opt.channel_file.empty()) { _opt.verbose(u"saving %s", {_opt.channel_file}); _channels.save(_opt.channel_file, _opt.default_channel_file, _opt); } } //---------------------------------------------------------------------------- // Program entry point //---------------------------------------------------------------------------- int MainCode(int argc, char *argv[]) { ScanOptions opt(argc, argv); ts::COM com(opt); if (com.isInitialized()) { ScanContext ctx(opt); ctx.main(); } return opt.valid() ? EXIT_SUCCESS : EXIT_FAILURE; } TS_MAIN(MainCode)
[ "thierry@lelegard.fr" ]
thierry@lelegard.fr
1fef60d91b225c394f7e289995f59a2f2280a58b
bff9ee7f0b96ac71e609a50c4b81375768541aab
/test/generics/gl_string.cxx
f57ef44d5413a6d9572ff4e9594140ede1971dc3
[ "BSD-3-Clause" ]
permissive
rohitativy/turicreate
d7850f848b7ccac80e57e8042dafefc8b949b12b
1c31ee2d008a1e9eba029bafef6036151510f1ec
refs/heads/master
2020-03-10T02:38:23.052555
2018-04-11T02:20:16
2018-04-11T02:20:16
129,141,488
1
0
BSD-3-Clause
2018-04-11T19:06:32
2018-04-11T19:06:31
null
UTF-8
C++
false
false
12,552
cxx
/* * Copyright (c) 2013 Turi Inc. * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an "AS * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language * governing permissions and limitations under the License. * * For more about this software visit: * * http://turicreate.com * */ #define BOOST_TEST_MODULE #include <boost/test/unit_test.hpp> #include <util/test_macros.hpp> #include <iostream> #include <typeinfo> // operator typeid #include <cstddef> #include <functional> #include <iterator> #include <type_traits> #include <iterator> #include <generics/gl_string.hpp> #include <util/testing_utils.hpp> using namespace turi; int random_int() { return random::fast_uniform<int>(0, std::numeric_limits<int>::max()); } void verify_serialization(const gl_string& v) { // into gl_string gl_string v1; save_and_load_object(v1, v); DASSERT_TRUE(v == v1); // Into std std::string v2; save_and_load_object(v2, v); DASSERT_EQ(v2.size(), v.size()); DASSERT_TRUE(std::equal(v2.begin(), v2.end(), v.begin())); // from std into empty std::string v3; v3 = v; gl_string v4; save_and_load_object(v4, v3); DASSERT_TRUE(v4 == v); // from std into non-empty save_and_load_object(v1, v3); DASSERT_TRUE(v1 == v); } void verify_consistency(const gl_string& v) { // Constructor 1 { gl_string v2(v); DASSERT_TRUE(v == v2); } // Constructor 2 { gl_string v2(v.begin(), v.end()); DASSERT_TRUE(v == v2); } // Assignment { gl_string v2; v2 = v; DASSERT_TRUE(v == v2); } // Assignment { gl_string v2; v2.assign(v.begin(), v.end()); DASSERT_TRUE(v == v2); } // Assignment by insert { gl_string v2; v2.insert(v2.end(), v.begin(), v.end()); DASSERT_TRUE(v == v2); } // Assignment by insert into cleared vector { gl_string v2; v2.resize(1); v2.clear(); v2.insert(v2.end(), v.begin(), v.end()); DASSERT_TRUE(v == v2); } // construction by empty, then resize, then index fill { gl_string v2; v2.resize(v.size()); for(size_t i = 0; i < v.size(); ++i) { v2[i] = v[i]; } DASSERT_TRUE(v == v2); } // construction by empty, then resize, then { gl_string v2; v2.reserve(v.size()); for(auto e : v) { v2.push_back(e); } DASSERT_TRUE(v == v2); } // construction by empty, then resize, then iteration { gl_string v2; v2.resize(v.size()); auto it = v2.begin(); for(size_t i = 0; i < v.size(); ++i, ++it) { *it = v[i]; } DASSERT_TRUE(v == v2); } // construction by empty, then resize, then reverse iteration { gl_string v2; v2.resize(v.size()); auto it = v2.rbegin(); for(size_t i = v.size(); (i--) != 0; ++it) { *it = v[i]; } DASSERT_TRUE(v == v2); } // Assignment by insert into cleared vector. { gl_string v2; v2.resize(1); v2.insert(v2.begin(), v.begin(), v.end()); v2.resize(v.size()); DASSERT_TRUE(v == v2); } // Assignment by insert into cleared vector, then erase { gl_string v2; v2.resize(1); v2.insert(v2.end(), v.begin(), v.end()); v2.erase(v2.begin()); DASSERT_TRUE(v == v2); } //////////////////////////////////////////////////////////////////////////////// // test casting. { std::string v_stl; v_stl = v; TS_ASSERT_EQUALS(v_stl.size(), v.size()); TS_ASSERT(std::equal(v.begin(), v.end(), v_stl.begin())); // Assignment gl_string v2(20); v2 = v_stl; TS_ASSERT_EQUALS(v2, v); // Construction gl_string v3(v_stl); TS_ASSERT_EQUALS(v3, v); } } //////////////////////////////////////////////////////////////////////////////// void stress_test(size_t n_tests) { auto gen_element = [](){ return char(random::fast_uniform<int>(32, 127)); }; gl_string v; std::string v_ref; std::vector<std::function<void()> > operations; // Push back operations.push_back([&]() { auto e = gen_element(); v.push_back(e); v_ref.push_back(e); }); // Insert, 1 element. operations.push_back([&]() { auto e = gen_element(); v.insert(v.begin(), e); v_ref.insert(v_ref.begin(), e); }); operations.push_back([&]() { auto e = gen_element(); size_t idx = random::fast_uniform<size_t>(0, v.size()); v.insert(v.begin() + idx, e); v_ref.insert(v_ref.begin() + idx, e); }); operations.push_back([&]() { auto e = gen_element(); v.insert(v.end(), e); v_ref.insert(v_ref.end(), e); }); // Insert, multiple elements. operations.push_back([&]() { auto e = gen_element(); v.insert(v.begin(), 3, e); v_ref.insert(v_ref.begin(), 3, e); }); operations.push_back([&]() { auto e = gen_element(); size_t idx = random::fast_uniform<size_t>(0, v.size()); v.insert(v.begin() + idx, 3, e); v_ref.insert(v_ref.begin() + idx, 3, e); }); operations.push_back([&]() { auto e = gen_element(); v.insert(v.end(), 3, e); v_ref.insert(v_ref.end(), 3, e); }); // Insert, move element operations.push_back([&]() { auto e = gen_element(); auto e2 = e; v.insert(v.begin(), std::move(e)); v_ref.insert(v_ref.begin(), std::move(e2)); }); operations.push_back([&]() { auto e = gen_element(); auto e2 = e; size_t idx = random::fast_uniform<size_t>(0, v.size()); v.insert(v.begin() + idx, std::move(e)); v_ref.insert(v_ref.begin() + idx, std::move(e2)); }); operations.push_back([&]() { auto e = gen_element(); auto e2 = e; v.insert(v.end(), std::move(e)); v_ref.insert(v_ref.end(), std::move(e2)); }); // Insert, 3 elements. operations.push_back([&]() { std::string ev = {gen_element(), gen_element(), gen_element()}; v.insert(v.begin(), ev.begin(), ev.end()); v_ref.insert(v_ref.begin(), ev.begin(), ev.end()); }); operations.push_back([&]() { std::string ev = {gen_element(), gen_element(), gen_element()}; size_t idx = random::fast_uniform<size_t>(0, v.size()); v.insert(v.begin() + idx, ev.begin(), ev.end()); v_ref.insert(v_ref.begin() + idx, ev.begin(), ev.end()); }); operations.push_back([&]() { std::string ev = {gen_element(), gen_element(), gen_element()}; v.insert(v.end(), ev.begin(), ev.end()); v_ref.insert(v_ref.end(), ev.begin(), ev.end()); }); // Erase, single element. operations.push_back([&]() { if(v.empty()) return; size_t idx = random::fast_uniform<size_t>(0, v.size() - 1); v.erase(v.begin() + idx); v_ref.erase(v_ref.begin() + idx); }); // Erase, block operations.push_back([&]() { if(v.empty()) return; size_t idx_1 = random::fast_uniform<size_t>(0, v.size() - 1); size_t idx_2 = random::fast_uniform<size_t>(0, v.size() - 1); v.erase(v.begin() + std::min(idx_1, idx_2), v.begin() + std::max(idx_1, idx_2)); v_ref.erase(v_ref.begin() + std::min(idx_1, idx_2), v_ref.begin() + std::max(idx_1, idx_2)); }); // Erase, to end operations.push_back([&]() { if(v.empty()) return; size_t idx = random::fast_uniform<size_t>(0, v.size() - 1); v.erase(v.begin() + idx, v.end()); v_ref.erase(v_ref.begin() + idx, v_ref.end()); }); // Erase, from beginning operations.push_back([&]() { if(v.empty()) return; size_t idx = random::fast_uniform<size_t>(0, v.size() - 1); v.erase(v.begin(), v.begin() + idx); v_ref.erase(v_ref.begin(), v_ref.begin() + idx); }); // Clear everything. operations.push_back([&]() { v.clear(); v_ref.clear(); }); // Total clear. operations.push_back([&]() { gl_string v_empty; std::string vr_empty; v.swap(v_empty); v_ref.swap(vr_empty); }); // Assignment to init list operations.push_back([&]() { std::string ev = {gen_element(), gen_element(), gen_element()}; v = {ev[0], ev[1], ev[2]}; v_ref = {ev[0], ev[1], ev[2]}; }); // Assignment by iterator operations.push_back([&]() { std::string ev = {gen_element(), gen_element(), gen_element()}; v.assign(ev.begin(), ev.end()); v_ref.assign(ev.begin(), ev.end()); }); // Assignment by move equality operations.push_back([&]() { std::string ev = {gen_element(), gen_element(), gen_element()}; v = std::move(gl_string(ev.begin(), ev.end())); v_ref = std::move(std::string(ev.begin(), ev.end())); }); // pop_back operations.push_back([&]() { if(v.empty()) return; v.pop_back(); v_ref.pop_back(); }); // swap front and back operations.push_back([&]() { if(v.empty()) return; std::swap(v.back(), v.front()); std::swap(v_ref.back(), v_ref.front()); }); // shuffle by index operations.push_back([&]() { for(size_t j = 0; j < v.size(); ++j) { size_t idx = random::fast_uniform<size_t>(0, v.size() - 1); std::swap(v[j], v[idx]); std::swap(v_ref[j], v_ref[idx]); } }); // shuffle by iterator operations.push_back([&]() { for(size_t j = 0; j < v.size(); ++j) { size_t idx = random::fast_uniform<size_t>(0, v.size() - 1); std::swap(*(v.begin() + j), *(v.begin() + idx)); std::swap(*(v_ref.begin() + j), *(v_ref.begin() + idx)); } }); // shuffle by reverse iterator operations.push_back([&]() { for(size_t j = 0; j < v.size(); ++j) { size_t idx = random::fast_uniform<size_t>(0, v.size() - 1); std::swap(*(v.rbegin() + j), *(v.rbegin() + idx)); std::swap(*(v_ref.rbegin() + j), *(v_ref.rbegin() + idx)); } }); // swap and insert. operations.push_back([&]() { std::string ev = {gen_element(), gen_element(), gen_element()}; gl_string v2 = {ev[0], ev[1], ev[2]}; std::string v2_ref = {ev[0], ev[1], ev[2]}; v.swap(v2); v_ref.swap(v2_ref); size_t idx = random::fast_uniform<size_t>(0, v.size()); v.insert(v.begin() + idx, v2.begin(), v2.end()); v_ref.insert(v_ref.begin() + idx, v2_ref.begin(), v2_ref.end()); }); // setting through an std::string. operations.push_back([&]() { std::string v2 = v; v.assign(v2.begin(), v2.end()); gl_string v2_ref(v_ref.begin(), v_ref.end()); v_ref.assign(v2_ref.begin(), v2_ref.end()); }); // string deserialization operations.push_back([&]() { std::string s = serialize_to_string(v); v.clear(); deserialize_from_string(s, v); }); // string deserialization via vector operations.push_back([&]() { std::string v2 = v; std::string s = serialize_to_string(v2); deserialize_from_string(s, v); }); // setting through an std::string. operations.push_back([&]() { std::string v2 = v; v.assign(v2.begin(), v2.end()); gl_string v2_ref(v_ref.begin(), v_ref.end()); v_ref.assign(v2_ref.begin(), v2_ref.end()); }); // substring operations.push_back([&]() { size_t n1 = random::fast_uniform<size_t>(0, v.size()); size_t n2 = random::fast_uniform<size_t>(0, v.size()); if(n1 > n2) std::swap(n1, n2); v = v.substr(n1, n2 - n1); v_ref = v_ref.substr(n1, n2 - n1); }); // self-append operations.push_back([&]() { v+= v; v_ref += v_ref; }); for(size_t i = 0; i < n_tests; ++i) { size_t idx = random::fast_uniform<size_t>(0, operations.size() - 1); operations[idx](); ASSERT_EQ(v.size(), v_ref.size()); for(size_t j = 0; j < v.size(); ++j) { ASSERT_TRUE(v[j] == v_ref[j]); } if((i + 1) % 1000 == 0) { verify_serialization(v); verify_consistency(v); } } } struct gl_string_stress_test { public: void test_stress() { random::seed(0); stress_test(5000000); } }; BOOST_FIXTURE_TEST_SUITE(_gl_string_stress_test, gl_string_stress_test) BOOST_AUTO_TEST_CASE(test_stress) { gl_string_stress_test::test_stress(); } BOOST_AUTO_TEST_SUITE_END()
[ "znation@apple.com" ]
znation@apple.com
404e0eae3e78f7ff2b4ada1d10c18179aca755dc
75596c702f3ac47aab2439b915ad0a118b9ccbb4
/national-competitions/flatSpring2009B2.cpp
5220c8031ecad818092e928d737d145c98a6abc9
[]
no_license
startrunner/informatics-problems-solutions
c0aba4ce5edc6def553e4eb1966bd30122b0ecd0
fbc61a6d510c824d36fbb022395fb03aeb99801e
refs/heads/master
2022-12-23T21:08:15.111684
2020-09-26T13:16:31
2020-09-26T13:16:31
298,817,528
0
0
null
null
null
null
UTF-8
C++
false
false
2,060
cpp
extern "C" { int printf(const char*, ...); int scanf (const char*, ...); void* malloc(int); void free(void*); } const int INF=1000000+10; typedef struct{int first, second;}range_t; //inline int min(int a, int b){if(a<b)return a; return b;} struct node { range_t range; node *children; int minVal=INF; node(const range_t& range) { this->range=range; if(range.first!=range.second) { int split=(range.first+range.second)/2; children=new node[2] {node({range.first, split}), node({split+1, range.second})}; } else children=nullptr; } void set(int index, int value) { if(index<range.first || index>range.second)return; if(value<minVal)minVal=value; if(children!=nullptr) { children[0].set(index, value); children[1].set(index, value); } } int rmq(const range_t &range) { if(range.second<this->range.first || range.first>this->range.second)return INF; if(this->range.first>=range.first && this->range.second<=range.second)return minVal; else { int a=children[0].rmq(range); int b=children[1].rmq(range); if(a<b)return a; return b; } } ~node(){delete children;} }; unsigned long long minPrice=-1; int start; void main1() { int n, k, i, *beach; unsigned long long cSum=0, cPrice; scanf("%d%d", &n, &k); beach=(int*)malloc(sizeof(int)*(n+1)); for(i=0;i<n;i++)scanf("%d", &beach[i]); node tree({0, n-1}); for(i=0;i<n;i++)tree.set(i, beach[i]); for(i=0;i<k;i++)cSum+=beach[i]; for(i=k-1;i<n;i++) { cPrice=cSum-tree.rmq({i-k+1, i})*k; if(cPrice<minPrice) { minPrice=cPrice; start=i-k+2; } cSum-=beach[i-k+1]; cSum+=beach[i+1]; } free(beach); } int main() { main1(); printf("%llu\n%d\n", minPrice, start); } /* 6 4 10 4 5 2 5 7 */
[ "alexander_ivanov@mail.com" ]
alexander_ivanov@mail.com
9047439139149e53ce493bd3ddf4ef3cdb970239
cefd6c17774b5c94240d57adccef57d9bba4a2e9
/WebKit/Source/WebKit/win/WebElementPropertyBag.h
7c2a5658c616db63725a04d7598bcab727d44057
[ "BSL-1.0", "BSD-2-Clause" ]
permissive
adzhou/oragle
9c054c25b24ff0a65cb9639bafd02aac2bcdce8b
5442d418b87d0da161429ffa5cb83777e9b38e4d
refs/heads/master
2022-11-01T05:04:59.368831
2014-03-12T15:50:08
2014-03-12T15:50:08
17,238,063
0
1
BSL-1.0
2022-10-18T04:23:53
2014-02-27T05:39:44
C++
UTF-8
C++
false
false
2,419
h
/* * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef WebElementPropertyBag_H #define WebElementPropertyBag_H #include <ocidl.h> #include <wtf/OwnPtr.h> namespace WebCore { class HitTestResult; } class WebElementPropertyBag : public IPropertyBag { public: static WebElementPropertyBag* createInstance(const WebCore::HitTestResult&); protected: WebElementPropertyBag(const WebCore::HitTestResult&); ~WebElementPropertyBag(); public: // IUnknown virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject); virtual ULONG STDMETHODCALLTYPE AddRef(void); virtual ULONG STDMETHODCALLTYPE Release(void); // IPropertyBag virtual /* [local] */ HRESULT STDMETHODCALLTYPE Read( /* [in] */ LPCOLESTR pszPropName, /* [out][in] */ VARIANT *pVar, /* [in] */ IErrorLog *pErrorLog); virtual HRESULT STDMETHODCALLTYPE Write( /* [in] */ LPCOLESTR pszPropName, /* [in] */ VARIANT *pVar); private: OwnPtr<WebCore::HitTestResult> m_result; ULONG m_refCount; }; #endif // WebElementPropertyBag_H
[ "adzhou@hp.com" ]
adzhou@hp.com
306e27d3b58bb526d3b02ece5f686129dac7515a
82815230eeaf24d53f38f2a3f144dd8e8d4bc6b5
/Airfoil/wingMotion/wingMotion2D_pimpleFoam/0.74/p
02d4a7fe13f6a7c022d6556832006f3e7e63cfb4
[ "MIT" ]
permissive
ishantja/KUHPC
6355c61bf348974a7b81b4c6bf8ce56ac49ce111
74967d1b7e6c84fdadffafd1f7333bf533e7f387
refs/heads/main
2023-01-21T21:57:02.402186
2020-11-19T13:10:42
2020-11-19T13:10:42
312,429,902
0
0
null
null
null
null
UTF-8
C++
false
false
156,332
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1912 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0.74"; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField nonuniform List<scalar> 12556 ( 791.2194485 790.6789024 789.1927694 785.8231243 780.4812253 768.7761424 748.8353511 716.0150199 665.537752 591.1349813 487.1808426 351.3552854 188.0024017 8.66806718 -170.2126544 -332.5031251 -468.64084 -575.7625453 -655.7296202 -712.358312 -760.1780914 -781.953034 -794.5951607 -800.4847553 791.563632 791.3230209 790.437536 788.204393 782.9423141 773.2395622 755.8970807 729.5165241 684.8147576 616.8594734 518.6653947 385.5190739 219.48354 33.47729087 -155.3520242 -326.9974071 -468.9325891 -579.0369285 -668.3184188 -721.6900588 -768.692274 -787.8623086 -799.0523488 -804.2200604 792.3244177 792.7555766 793.2833569 793.3249812 790.3676842 784.969641 773.8346341 752.024131 716.1157283 657.1239463 561.0725828 414.4608066 228.0163583 20.08391472 -182.4280079 -364.2569707 -510.5405551 -616.3247816 -703.2216026 -748.1362753 -788.3329694 -802.013617 -809.9151398 -813.4360638 792.9674294 794.3481835 796.9418504 800.2113319 800.7065705 801.6971078 799.8228244 787.6517748 766.953436 720.1696438 624.6061293 460.6969941 221.3499268 -40.7763304 -271.237687 -451.1406455 -589.5943925 -686.1397654 -758.363827 -788.5447516 -816.9663612 -822.8205995 -825.7715362 -826.8932968 792.5477629 795.009536 799.9491109 807.1970676 811.4166511 820.9088926 830.6192621 833.1213034 833.4734144 812.1981961 736.2264908 546.2674977 212.7490368 -169.7562455 -450.894688 -623.3070398 -725.6779512 -787.4119982 -831.9168772 -840.9344865 -850.3946385 -846.7238467 -843.5957028 -841.819216 789.9947107 793.5301769 800.730324 811.8795442 821.3988117 839.2527724 862.0202283 881.4482185 914.0991544 946.922809 942.2161655 781.1385311 240.1907945 -430.0974613 -773.1307494 -890.5789514 -920.3442383 -922.2588054 -919.5747959 -899.2789088 -884.7778941 -870.2539929 -860.2573377 -855.3510781 784.2856371 788.7544939 797.9133389 812.4679441 827.098792 852.8122266 887.4464098 925.2204691 995.9409356 1104.549856 1258.362872 1391.982818 502.2904474 -1091.352701 -1295.915143 -1241.169115 -1156.82 -1075.66864 -1011.023274 -955.8536601 -915.5467945 -889.2223473 -872.5555315 -864.6845935 774.5425514 779.6848461 790.2528419 807.2175779 826.4787841 857.9007558 901.0969935 954.3858268 1055.400407 1222.800423 1505.864155 2052.714656 -2818.495868 -2006.049011 -1612.902494 -1382.579472 -1218.021873 -1087.284371 -1000.967051 -934.7813217 -899.082506 -877.270062 -866.9646399 760.1038439 765.570791 776.8035643 794.8958015 817.5886054 851.879982 899.0227579 960.9594633 1073.500539 1247.041584 1487.666165 1762.853342 -4209.590453 -2504.820431 -1861.844454 -1530.087057 -1308.429741 -1129.619003 -1022.908665 -937.3613049 -896.2020066 -871.4941881 -859.7512893 740.6116667 746.0187372 757.0986764 774.9029912 799.6152902 833.6860391 879.985301 943.2943712 1049.940791 1198.546757 1363.596755 1499.428432 -3875.594876 -2484.428968 -1876.452926 -1541.61191 -1318.642655 -1125.369528 -1014.724185 -920.3032677 -878.6510761 -853.6301646 -841.6880498 716.0623829 721.0517034 731.2146043 747.3398169 772.7740769 803.8254586 845.3384621 904.3852457 996.3746073 1114.131947 1231.67819 1326.994992 -2902.709453 -2093.644875 -1685.322706 -1435.388562 -1249.716526 -1073.717576 -975.5855352 -883.7504287 -846.312292 -823.5495036 -812.6077304 686.7811359 691.0489338 699.7358856 712.8132591 738.3733773 763.8578714 797.7694645 848.6070934 921.6634453 1010.429591 1099.69477 1195.72674 -1898.47215 -1566.573755 -1379.203048 -1240.230575 -1119.504991 -984.9808257 -910.7741752 -830.5681771 -801.0733719 -782.5311191 -773.5209545 653.3991986 656.736592 663.653288 673.4952058 696.2581206 715.7613853 740.2756226 780.8780884 832.5514518 891.6145546 951.537459 1044.427159 -762.8845742 -983.354502 -1057.546193 -1047.167556 -1012.617856 -960.0630876 -875.6922789 -828.864238 -766.2805501 -746.3113461 -732.9270053 -726.3788319 616.6983617 619.0158104 623.982116 630.755772 649.7935975 662.871205 677.7029419 706.4748377 735.662003 761.5911574 777.880168 824.2701126 243.1162167 -416.6410769 -658.2894821 -756.9203936 -796.8716625 -797.8905515 -761.3201274 -739.2467823 -697.0449742 -685.7705945 -677.5988188 -673.6496181 577.5795697 578.798803 581.5077289 584.9496917 600.3660023 606.3161662 611.7688758 626.8758025 633.6421568 627.5020021 594.1425062 501.4948592 206.155728 -175.7072926 -407.2830715 -539.2872883 -616.9295588 -653.8495324 -651.7899859 -650.660465 -626.2886848 -622.6673608 -619.3876764 -617.8596172 536.9661378 537.1516632 537.6552934 537.9239827 549.7460099 549.4361937 546.7003797 549.6409833 539.0825316 511.244339 451.1502494 331.5089872 156.942253 -77.47451668 -260.2011726 -391.0066828 -480.1728136 -534.6100731 -554.4024477 -567.6704542 -557.3528237 -559.913362 -560.7660822 -561.266887 495.7768414 495.078497 493.6828512 491.2256305 499.6368869 494.11722 484.8753356 478.8800102 456.1214948 417.0773401 351.9289255 254.7420668 125.3646532 -33.04934036 -174.9116404 -290.74543 -379.0237234 -439.188978 -470.463245 -492.483963 -492.6266192 -499.6970536 -503.7555651 -505.7117594 454.8494454 453.435596 450.5041434 445.8711492 451.2460121 441.7558273 427.7141018 415.8166881 386.504033 343.6472087 282.3595159 201.8215759 104.3250543 -14.02964235 -126.7635873 -225.4494218 -304.3483611 -362.7580526 -399.1804909 -425.9663499 -433.3055814 -443.3636062 -449.6223968 -452.5649306 414.8634115 412.9000668 408.7887223 402.5321624 405.4508197 393.1904299 376.0512874 360.4852351 328.4493756 285.3727249 229.7053385 162.7859498 84.68513802 -8.989065758 -99.93315755 -181.343766 -249.1336582 -302.7572543 -340.0570147 -368.2762913 -379.8226618 -391.578725 -399.1472873 -402.74067 376.3407526 373.9914064 369.0485773 361.6906684 362.7389902 348.7773549 329.9226338 312.5458542 280.1041819 238.769022 188.5270028 130.2065135 65.20845522 -9.328235911 -82.46451663 -149.3545164 -207.1673033 -254.9380543 -290.8829041 -318.5405444 -332.2064827 -344.6305007 -352.8074179 -356.6999377 339.6593493 337.075919 331.6244514 323.6222524 323.3458902 308.5490064 288.9804147 271.1887879 239.7655282 201.3196277 156.5316624 105.6755675 51.49738895 -9.645397987 -69.55299482 -125.1311845 -174.3891123 -216.3850772 -249.6281232 -275.7171402 -290.0856191 -302.442488 -310.7102736 -314.6579518 305.066552 302.3777873 296.6953845 288.4279011 287.2836964 272.3208744 252.8792532 235.4782509 205.8993968 170.8139182 131.191847 87.34314308 41.25198773 -9.670881109 -59.47854388 -106.098247 -148.1296897 -184.7746641 -214.809596 -238.7862373 -252.9207312 -264.7379599 -272.7481974 -276.5810132 272.6908294 269.998773 264.308903 256.0842966 254.408656 239.7898997 221.0658795 204.5458016 177.2422788 145.6362444 110.7316374 72.97590208 33.4447529 -9.442331864 -51.29166758 -90.68262184 -126.6167967 -158.4540894 -185.1874253 -206.8289077 -220.1536589 -231.1507808 -238.6836649 -242.2926486 242.5618454 239.9442282 234.4151213 226.4661377 224.5328987 210.6080281 193.0036738 177.6247865 152.7839193 124.5891716 93.93637395 61.39854742 27.37042988 -9.016831958 -44.43152285 -77.88405619 -108.6501272 -136.2276002 -159.7733931 -179.0553205 -191.2498696 -201.278837 -208.2064727 -211.5278002 214.6351206 212.1492344 206.9018156 199.3930559 197.4131841 184.4121429 168.1946745 154.0770809 131.732603 106.7773668 79.9459891 51.87524852 22.55604165 -8.449409863 -38.55001267 -67.04533666 -93.40116045 -117.2261234 -137.7932731 -154.8011676 -165.7103876 -174.7130984 -180.9731545 -183.9752141 188.813431 186.4996686 181.6173627 174.6589653 172.7896812 160.851659 146.1170567 133.3674216 113.4602959 91.52437293 68.13184747 43.91347414 18.67519449 -7.786533502 -33.41928895 -57.71671865 -80.2792762 -100.801857 -118.6339105 -133.5088827 -143.0821492 -151.0585459 -156.6336807 -159.3069846 164.9602383 162.8453763 158.3827298 152.0434919 150.4049415 139.604234 126.3887575 115.0371543 97.46496636 78.31762528 58.02654744 37.16041115 15.49976451 -7.065184437 -28.88389079 -49.58075781 -68.85385365 -86.46498745 -101.8091024 -114.71456 -122.9597103 -129.9442507 -134.8454559 -137.1945988 142.9113216 141.0115923 137.001269 131.3197719 130.0009453 120.3665998 108.6666331 98.6953486 83.33845332 66.76040023 49.27768635 31.36783063 12.86409292 -6.313557431 -24.83169019 -42.40333984 -58.79911209 -73.83338041 -86.92194351 -98.02393526 -104.9820628 -111.0274753 -115.2820082 -117.319695 122.4858743 120.8098799 117.268592 112.2615215 111.3310841 102.8618274 92.6771683 84.01426856 70.75010124 56.5408726 41.61231147 26.34038326 10.64593421 -5.552699425 -21.17877879 -36.00689254 -49.86304419 -62.60420717 -73.64695975 -83.1029749 -88.8287269 -93.99566486 -97.63879561 -99.38173259 103.4948347 102.0457193 98.97901413 94.64799196 94.15893332 86.83372806 78.13164864 70.72457098 59.42785156 47.40669773 34.81178688 21.92279099 8.751757463 -4.797750335 -17.85887575 -30.2508446 -41.84278087 -52.52778665 -61.71220446 -69.66395332 -74.21497273 -78.56477809 -81.63441901 -83.10076972 85.73806617 84.51655992 81.92374223 78.25777437 78.26977938 72.04872682 64.77559338 58.59663932 49.14428678 39.15145566 28.70587323 17.99176796 7.107883187 -4.05934943 -14.81779354 -25.02130189 -34.57212525 -43.38340041 -50.8888408 -57.45669202 -60.88079984 -64.47328493 -67.00606347 -68.2129305 69.0422806 68.04498044 65.92190755 62.90756971 63.44257545 58.29160846 52.32081088 47.43189031 39.70260463 31.60051633 23.15086969 14.44321957 5.654371299 -3.344675102 -12.00975604 -20.22411669 -27.91762213 -35.01671447 -40.95535581 -46.25641502 -48.61222546 -51.49790784 -53.52759868 -54.49228138 53.12575307 52.35876078 50.7081535 48.32130456 49.5233353 45.36393909 40.64068964 37.01502315 30.92351107 24.59958055 18.02077322 11.18713043 4.340856282 -2.657984022 -9.393720737 -15.77647723 -21.76265672 -27.31773052 -31.71962559 -35.86137801 -37.13511969 -39.37376587 -40.92493444 -41.65452703 38.12044834 37.55850069 36.36965688 34.65712682 36.07077238 33.07633873 29.57483576 27.17849087 22.65113434 18.01214215 13.20207392 8.143672447 3.124901683 -2.00085207 -6.931784666 -11.6025591 -15.99232442 -20.08450917 -23.06409662 -26.06415928 -26.51875935 -28.09886574 -29.19706543 -29.72054523 22.67482898 22.41027652 21.70459005 20.6737211 23.20020387 21.27111619 18.94697669 17.76907495 14.74853126 11.71351623 8.588698387 5.238623618 1.970997661 -1.371891239 -4.587613277 -7.632341226 -10.50344114 -13.20521163 -14.82586525 -16.79457902 -15.8152148 -16.7614863 -17.407186 -17.65597028 11.64434468 11.37230957 10.99887459 10.39236744 10.61430135 9.62620408 8.526228114 8.647609082 7.102903537 5.583705087 4.062933585 2.387837348 0.857102463 -0.7643909271 -2.324113832 -3.801028414 -5.201968749 -6.543857769 -6.77093112 -7.673293136 -7.991798292 -8.463376442 -8.771462499 -9.002085467 1809.151896 -4510.82604 -2989.722753 1525.359804 -4222.534743 -4563.01115 1345.123197 -3155.864417 -4111.099735 1212.312492 -2065.2281 -3014.24478 1056.036615 -815.3553461 -856.1665093 -1094.998778 -1936.016407 852.0036234 330.7322774 -768.3112981 193.8328037 -426.415367 -986.7217838 2017.465976 726.9549641 -2632.858909 -901.6851628 -6004.480615 -3854.02265 -4152.014614 -2679.308438 -2157.815374 1396.724037 1511.614127 1730.231596 -6002.233449 -6360.983281 -3969.581218 -2785.650566 -2770.900456 1264.335066 1335.196175 1486.54726 1427.212064 1456.058244 1549.721611 -4384.752261 -5221.892711 -3031.52171 -2379.757108 -2718.544218 1133.441232 1198.999847 1316.772504 1276.586022 1310.778664 1363.142513 -2883.479469 -3517.047671 991.1214582 1050.084646 1182.106797 1135.306992 1191.825001 1251.001011 -1607.407521 -1570.396352 -2127.437827 822.3405549 848.5708931 1028.54832 962.6645664 1021.425853 1107.523328 568.4068576 317.2499955 342.932615 2264.646333 1867.240094 2782.90038 2345.39005 -6373.37975 -6060.742919 -4120.958216 -5794.136047 -6208.654352 1562.268221 1654.01007 1612.325224 1656.547218 1565.277262 1832.039513 1672.04859 -5272.54959 -5966.974357 -4423.347841 -5836.546631 -5183.1014 -6198.986138 -5869.979724 -4457.789695 1371.897801 1443.654872 1405.021845 1449.971561 1373.064109 1558.733337 1456.85567 -3611.214766 -4325.510565 -3579.377803 -4222.067551 -3541.004815 -5133.415028 -4329.317117 -3718.544777 1255.164678 1307.813937 1260.600844 1310.856929 1259.103454 1368.380118 1313.577943 -2209.198914 -2796.460301 1112.937927 1187.653957 1125.47829 -1562.911769 1192.647249 1117.656313 1254.82565 1196.867904 -1603.502936 -1006.580684 -1493.401965 -1557.951178 1019.738759 1015.612771 949.0307171 -42.33461154 1021.423648 919.9185945 1112.281928 1026.374302 -117.3132712 1509.733158 1769.477295 1939.461627 2004.636415 2302.441439 2636.979935 -7555.287803 -4825.964559 1645.324627 1669.988034 1834.382551 -3442.218229 -2019.801813 -1779.851845 -2237.990783 -2007.598697 -1956.136784 -2248.774041 -172.927468 -490.271734 -866.0782083 1869.046943 2233.218113 1959.507551 1959.382881 3665.208719 3121.587252 -3663.931145 -5655.489396 -3900.548782 -2296.823605 -2612.846978 -2463.556719 -2753.837515 -2184.270201 -3450.385469 -2838.109647 -2599.306032 -1161.695273 -298.2749316 -456.9972572 1163.398038 1990.307686 2748.782003 -3379.397664 -1030.393253 858.8240783 -7668.267023 -5421.264656 -7407.922615 -4599.449508 -7250.544175 -5093.811009 -6174.791533 -6201.173664 -4780.440627 -4837.212402 -3042.602542 -3370.811391 -3148.978383 -3350.9889 -3015.74322 -3770.250051 -3401.336932 -3239.611008 1219.445686 1192.218237 1166.174833 -1598.998067 -1867.071851 -1928.825617 1064.166991 1031.215124 993.9798894 1076.14201 1042.827848 1069.274375 2286.632153 1993.845235 2057.769156 2004.279518 2309.815071 1815.362349 1972.34762 2001.859421 2682.089294 3062.22701 3510.653451 2373.050453 2963.016887 2603.13108 3002.228394 2361.218435 -6342.598382 -6329.15441 1612.595844 1663.061845 1606.198615 1748.468443 1720.127449 1803.130614 1666.676714 1711.85123 1726.481674 -5598.556512 -5641.771422 -5543.740696 -4956.015865 -5119.083844 -4684.100359 -4893.201408 -5501.158059 -6071.597904 -5290.0793 -5307.97756 -5163.932086 -5267.979468 -6046.534821 1410.606622 1405.042722 1511.852561 1504.327284 -3905.304493 -3810.569943 -3957.215503 1287.490661 1283.749668 1339.359795 1335.772272 -2965.178405 -2638.315469 -2540.717355 -2657.511261 -2986.369641 1145.220838 1117.698256 1086.679935 1156.993717 1127.903263 1151.433848 -1210.98724 1155.258686 1148.570161 1226.562862 1223.261897 -1936.097517 -1212.896777 -1246.867585 -1510.569841 980.2619555 937.8718251 919.5843065 938.5574126 476.5888216 183.247066 1074.937667 -286.4233971 140.4207755 -201.3397537 1070.480717 -366.5374763 -235.3201351 107.4236675 -6066.491213 -2156.367253 -2309.560977 637.5429842 595.7759926 814.9870453 707.2777055 729.2266861 960.1171774 218.8532892 -126.3202919 -313.6360354 4593.092947 -2342.886631 -2511.070239 -908.8677298 -1160.017637 -1165.040651 -141.2290925 -385.644802 -101.5253849 1837.239868 2713.303001 3625.808016 -4208.16999 -1216.566072 997.3727611 -6086.492697 -6878.139229 -6765.528235 -6302.813617 -4552.488751 -4743.314083 -4544.611827 -5485.295161 -5315.578896 -5063.076882 1333.760665 1316.627127 1293.800768 1349.983402 1324.616548 1337.670494 1225.081522 1200.53741 1223.018329 1039.681834 1025.486287 1005.638923 865.1648083 637.7193623 375.1852883 -6374.303963 -6891.008574 -6921.689454 -6148.169837 -5126.696765 -4842.626189 -5295.16617 -5188.30496 -6156.091361 -5418.696655 -5697.354952 -5543.649103 -5839.776098 1399.778132 1387.350355 1358.925101 1378.471204 1390.212786 1385.917391 -4482.470872 -4300.838635 -4164.082437 -3918.135149 -3676.014659 -3933.334172 -4765.946546 -4364.431671 -4607.727394 -4020.116514 -4279.689678 -4711.530288 1280.525577 1256.448175 1233.103997 1286.40741 1264.075518 1284.221444 1302.132919 1314.880381 1320.003052 1270.651071 1287.959745 1271.06082 1355.622983 1359.854596 1374.067184 1321.345653 1327.415983 1322.20524 -2457.186399 -2593.616342 -2291.015011 -1404.526777 -1411.569221 1179.004061 1123.694837 1241.636495 1248.669927 1266.941712 1226.325303 1208.277727 -1737.417509 796.4108191 924.7934579 889.3413766 998.554444 974.0481972 990.0190216 149.9329397 384.5843738 149.4914128 998.331296 439.9677182 693.0026259 512.8963541 580.0592825 1091.610598 1045.448049 -6913.88043 -5852.840208 -6557.106345 -3580.896121 -3644.409846 -1972.149226 -2109.809404 -2120.33518 1890.533671 1868.123921 3560.500405 4036.329698 4298.755246 3855.944375 3469.755657 -2685.350079 -2516.483585 -2474.309883 -2518.034339 -2703.154969 -1170.289244 -996.7029318 -1011.337296 -999.5327232 -1172.042406 -781.6224246 -951.7089603 -545.1354943 -571.9953892 -733.1072838 -364.4924007 -519.5135566 -445.8569696 -7678.217299 -6697.372785 -6250.730113 -7020.967938 -6803.217867 -6067.605662 -5361.433555 -6447.366099 -6551.127 -6452.987841 -6107.046186 -6279.51024 -6721.25267 -6592.469078 -4994.162175 -4807.541439 -4610.087494 -4864.14892 -5061.089543 -4603.987065 -4804.728588 -5121.112049 -5007.531492 -5260.237146 -5056.976614 -3181.676737 -3242.884571 -3212.4626 -3131.384423 -3270.145642 -3618.978804 -3512.787141 -3661.438796 -3316.547995 -3463.745912 -3564.14608 -1803.202167 -1782.128137 -1922.697255 1049.387612 1031.880328 1042.680278 1082.571232 1071.349079 1055.453335 2138.923343 2099.158894 2111.201256 2141.70519 2034.708786 2321.01397 2182.309272 2153.958022 1874.874335 1900.967143 1841.983017 2003.598114 1923.769232 1897.633661 2594.324321 2549.634436 2377.633043 2690.495076 2593.068966 -6951.371273 -6897.097207 -6369.989719 -7060.980838 -7157.758024 -7025.337975 -7119.527858 -7086.154843 -7197.560124 -7122.725851 -6249.879141 -6894.936357 -6969.052825 1634.131605 1635.416195 1619.566906 1662.183093 1642.041599 1642.440993 1597.553335 1583.622168 1615.720313 1601.951832 1750.462449 1768.911537 1735.27936 1825.547104 1781.724052 1761.412496 1687.086496 1691.430489 1668.887033 1725.438627 1699.552485 1695.551917 -5883.719957 -5746.392297 -5465.327062 -5788.186433 -6084.50005 -5921.869751 1430.53278 1415.074017 1455.226846 1434.94153 1391.186689 1380.538766 1409.132945 1394.561925 1548.019683 1524.108633 1578.007877 1555.947791 1484.079174 1461.268428 1516.125906 1492.243457 -3909.207873 -4071.327667 -3712.513635 -3861.022778 -3954.473137 -4349.705957 -4536.10942 -4123.690617 -4293.47824 1296.676456 1311.192812 1298.764912 1316.426896 1298.888447 1322.703831 1320.616452 1295.570025 1273.886858 1288.689316 1292.87138 1345.361889 1355.278962 1351.075124 1357.968168 1347.660036 1376.039092 1361.809153 1328.061792 1323.205479 1341.139203 1330.513105 1325.357667 1330.079086 1340.964945 -2709.582748 -2800.53697 -2864.499683 -2697.833532 -2915.415262 -2844.64772 -1182.107066 -1365.324117 -1391.902513 -1182.167929 1174.33515 1130.740516 1235.061095 1244.007111 1237.466763 1212.475947 1231.041343 1233.608211 -1820.542187 977.1232325 964.749329 939.3972711 626.6705374 537.4620303 987.5633389 264.6472144 417.3864878 313.9053287 1084.454499 -438.1011022 -9.496083988 210.1557821 -53.71892865 1041.714821 -2525.016336 -1929.996301 -1291.785725 -2294.930787 -2347.933331 -1115.984062 -1183.688837 -1624.995484 -2356.026109 -963.0694919 -949.9376861 -787.876065 -2104.836682 -1596.510003 -1558.772509 2180.414674 3381.193832 4367.774409 -4817.037774 -1422.686703 1209.117807 -1691.5326 -1328.990347 -3267.795297 -5742.266652 -6490.149867 -6730.706823 1495.976307 1477.210578 1441.265615 1527.522166 1489.61943 1509.662107 -1594.546317 -1734.575896 -1743.165256 -2202.385449 -1938.323369 -1884.528859 1093.221987 1077.307758 1088.874048 -6793.00369 -6878.569328 -6224.980654 1429.78655 1397.446428 1409.970741 1432.364047 1435.000785 1454.368573 1460.673129 1482.437735 1476.34978 1123.018714 1113.049637 1098.784285 -1575.42292 -1529.461571 -1519.148109 1122.14919 1128.477064 1122.164257 -1672.941128 -1684.010398 -1587.409138 -1410.886113 -1404.53132 -1547.024603 1015.363223 1107.010832 1113.180835 1117.23645 1028.88616 -7460.387377 -3478.496558 -1989.266525 -2057.336609 -2063.030468 -2292.029423 -2147.470281 -2114.440275 1930.047881 -4709.444916 -4190.893028 -5028.663845 -2430.030727 -2483.19607 -2335.195281 -781.3760837 -795.5584344 -619.1228523 -624.9424594 -724.4653153 -2111.328645 -1579.552875 -4085.998619 -7558.319273 -7167.515368 -7019.180309 -7537.126974 -7525.37243 -3089.158619 -3120.653091 -3071.800225 -3387.117008 -3381.071334 -3353.997729 -2944.744978 -3082.37611 -3157.54622 -3733.614843 -3681.616066 -3732.584914 -1922.822851 -1900.704765 -1932.693309 2228.70777 2293.514181 2028.58965 2037.67672 2050.536177 2017.00001 1828.505746 1841.86294 1825.172018 1985.609242 1956.980027 1943.97524 2809.19893 2615.790494 2681.335711 2890.155076 2895.400402 3041.963256 2353.935129 2417.47505 2430.274145 1622.144769 1621.381512 1623.266682 1662.036283 1656.018937 1657.443031 1599.069595 1596.154538 1621.177547 1615.72806 1731.041802 1735.705598 1725.708098 1810.202824 1795.747557 1789.306645 1670.643195 1672.911563 1667.287928 1716.893648 1709.761909 1706.808227 1414.079287 1429.764379 1426.228088 1390.847476 1394.157362 1408.627913 1521.076807 1544.055757 1532.305679 1538.072799 1529.529879 1592.036045 1584.392779 1468.380946 1521.073841 1512.701202 1483.798685 1490.192493 1513.351788 -4079.267469 -4144.103112 -3783.474985 -3843.108607 -3867.969206 -4206.164523 -4225.688734 -4108.936778 -4245.04726 -4081.318525 1133.890628 1118.481369 1128.117366 1168.975039 1154.831975 1139.647961 1158.788248 1166.979838 1162.214676 1142.380273 1145.476692 1151.543242 -1935.94095 928.4157333 936.8321215 924.5973985 686.4904932 937.0933184 355.2103631 484.1820839 603.2845057 1080.658988 1081.522239 1077.888714 -350.2088171 -193.9974455 -172.2317 -187.7976146 1064.041294 1070.346888 1076.930106 -88.50229439 -168.7103574 -313.0321295 -2191.29623 -2234.618744 -2333.989563 -2287.299895 -2266.066332 4634.94825 4917.582282 4462.463101 -2397.976047 -2423.044523 -2343.630793 -2529.104867 -2474.619828 -2462.978432 -2637.035188 -1854.83582 -4613.099463 -6339.775018 -6346.270796 -6268.183715 -6309.132865 -6838.507111 -6674.540471 -6706.749423 -6610.944215 -6643.445292 -6802.991335 -5432.823799 -5351.257305 -5405.532614 -5234.891826 -5295.650911 -5377.708414 -6938.909659 -6750.190259 -6731.463715 -6735.552102 -6749.948854 -6949.57796 -5643.501571 -5559.384825 -5609.285591 -5459.114854 -5509.609734 -5595.59222 -6198.636306 -6232.881268 -6095.847428 -6150.054088 1317.137167 1312.779503 1310.071263 1274.804721 1271.649629 1267.130432 1280.987833 1276.854878 1281.048112 -1532.016588 -1584.283786 -1399.614842 -1478.809874 1191.68184 1190.041594 1199.217119 1194.089646 1125.510956 1123.215044 1129.54524 1121.376108 1254.723658 1252.425252 1247.13572 1262.908314 1257.994811 1261.497968 1209.005778 1206.362843 1219.394195 1204.020523 1210.648046 -1744.036459 -1737.669645 -1727.491887 -1588.423781 929.3762661 971.8808379 1096.492242 1000.216639 993.0911045 983.0096924 1008.277133 384.5569148 369.8964706 1071.75285 953.1442317 728.2150533 1092.76779 1104.915114 1100.124686 1036.809429 -7237.806687 -7551.461579 -7223.140285 -6634.604214 -6304.967338 -5480.936572 -7078.276831 -6752.593464 -3523.592839 -3668.65817 -2118.428766 -2107.090196 -2114.827536 1909.216063 1841.307328 4177.405529 4013.408582 3885.95687 3347.598297 3204.5224 3719.868242 3515.08382 3643.097067 -2596.464578 -2530.885654 -2647.846876 -1014.889442 -1011.131148 -1000.568536 -1115.35844 -819.4107327 -798.0913088 -785.5107813 -941.0527832 -882.6076393 -881.7044297 -551.6414819 -606.6562186 -603.1652032 -426.9428827 -433.3246583 -480.025956 -7395.304526 -7286.746531 -7619.200624 -6951.939117 -7252.159322 -7304.302758 -7521.149779 -7497.828986 -6508.085687 -6397.415563 -6429.311355 -6357.703164 -6370.559694 -6470.783522 -6674.338171 -6536.461767 -6575.024952 -6463.954507 -6499.218801 -6632.605228 -4934.625599 -4860.755622 -4920.073416 -4927.072583 -4996.999963 -4656.654827 -4684.945306 -4649.740034 -4744.819409 -5187.237496 -5229.522233 -5187.681535 -5104.170719 -5170.477058 -4981.256421 -5043.579631 -5124.717761 -3219.556348 -3136.68432 -3126.284698 -3150.332146 -3085.328548 -3140.530125 -3306.108098 -3331.91019 -3270.733617 -3579.935588 -3624.492657 -3650.654305 2181.982686 2063.033346 1884.558608 1861.209212 1846.925194 1919.761586 1931.337102 1907.667136 2677.126463 2774.129083 2791.232038 3066.5434 2938.095714 2506.301753 2493.351064 2582.469528 -6927.517267 -6730.31668 -6740.12515 -6721.817885 -6723.319857 -6909.217363 -7093.86256 -7121.69564 -7132.872857 -7386.140598 -7341.145874 -7389.743348 -7412.895216 -7123.298701 -7200.236028 -7331.151287 -7338.154486 -7143.655927 1635.137331 1629.535074 1628.29699 1650.412079 1649.323168 1642.276852 1604.409407 1601.652107 1610.885428 1607.388296 1756.365952 1745.848137 1741.054655 1774.506143 1781.454024 1768.151297 1688.104975 1680.006034 1677.752546 1702.018663 1703.177142 1696.056956 -5842.622687 -5750.61092 -5792.886045 -5656.861063 -5704.117189 -5792.819386 -6028.803024 -5943.519522 -6026.395061 -5833.06455 -5880.440199 -5970.476431 1425.957156 1427.23518 1430.836067 1416.179187 1422.354828 1420.78825 1447.572582 1445.52335 1455.269329 1433.662599 1437.901301 1440.394751 1387.975607 1389.588886 1391.925282 1383.017354 1386.700129 1384.485475 1403.51915 1403.224759 1409.415689 1394.36071 1398.039267 1398.614221 1555.378824 1546.781939 1540.10539 1543.69525 1551.916256 1527.055129 1535.36324 1532.118866 1573.874648 1564.017135 1488.237942 1480.822277 1476.023145 1478.364313 1486.124794 1461.909615 1463.757882 1466.853898 1508.166172 1510.638224 1518.818693 1494.465318 1502.533536 1500.218893 1504.546263 1496.473981 -3994.610881 -4029.450357 -3931.928142 -3899.507194 -3930.611355 -4404.067736 -4435.862551 -4387.538835 -4574.858389 -4497.268762 -4465.281452 -4170.990724 -4204.77626 -4171.265527 -4336.207826 -4284.672628 -4232.46597 1300.922548 1297.895028 1293.681692 1306.602749 1302.376156 1306.109158 1309.653553 1303.298534 1322.451155 1321.930384 1293.698703 1284.955013 1280.63717 1281.263227 1281.604935 1289.591026 1286.144502 1290.581755 1346.497133 1350.197787 1360.442151 1350.278893 1371.195984 1372.937258 1378.222849 1364.017843 1368.258719 1366.528502 1325.867613 1324.21064 1336.115457 1333.013902 -2809.706728 -2792.628946 -2852.736333 -2689.234717 -2738.295748 -2772.412062 -2982.154517 -3025.678288 -2898.039653 -2906.478705 -2917.927127 -1328.118207 -1332.881187 -1387.051692 -1197.387903 -1259.969056 -1267.924906 1171.576634 1161.435819 1187.360074 1181.296769 1135.029512 1139.520488 1136.231109 1141.880031 1137.609851 1153.452311 1147.442815 1237.408632 1235.732949 1232.960308 1242.672975 1238.945173 1240.372459 1232.79093 1226.785787 1223.516533 1230.668484 1228.758744 1233.077681 -1878.991478 970.8165156 957.5171186 962.7651161 585.479831 601.8260028 661.7512708 542.6498676 550.0943723 532.8089181 975.5899738 359.9592138 308.3598506 241.9826251 1080.383908 1081.59258 1084.047323 -416.7211869 81.03370118 22.85378328 192.767267 181.4349188 193.7353689 4.830377354 -128.2831472 -108.9899081 -7.415355637 1052.696007 1064.643629 1058.049674 744.9874374 717.949632 698.5353372 706.268015 662.6998092 637.1918813 644.3432538 576.745059 547.2515452 548.4869328 446.9315466 422.8101491 406.6129738 273.078429 263.4309312 225.2823311 78.65024783 79.23662537 27.37046414 -122.5626978 -110.4468826 -171.5962761 -309.2602089 -287.1216323 -351.936271 -464.0623511 -436.3269935 -496.8871446 -580.0767692 -553.7956527 777.6667599 760.5068697 726.9765633 752.6206425 718.4648986 674.7278259 702.3420627 635.2860932 589.625207 605.6765133 492.3704806 456.0846494 445.4705349 283.2090857 276.2277 223.8887178 40.20215429 72.36145696 -20.20179076 -189.9411722 -133.1294606 -241.6638465 -380.9201518 -321.2402591 -422.3775883 -533.1602574 -477.7917454 -565.2188926 -644.6302553 -593.0930405 821.2433898 818.2048706 773.728121 815.3382941 796.6308325 735.5236977 785.5770503 729.9649869 654.3271696 701.4535741 574.3157065 509.5517312 517.033777 299.9163395 285.4934291 213.5743361 -47.64398302 23.56677324 -129.2591076 -338.6379248 -218.3458892 -395.5707718 -532.9130682 -410.5669781 -570.375394 -661.9405873 -558.1562147 -686.1437182 -744.1543046 -666.3150094 869.4809348 887.1799413 834.6954924 893.1492954 907.8354889 820.9197197 909.3743909 894.8086756 763.2024771 879.1801478 767.8244879 608.1395476 699.4448475 368.9216699 310.3367323 225.9658063 -218.6363294 -80.0038254 -344.5743702 -615.4806513 -392.7224614 -675.596641 -793.2544596 -587.2267057 -815.8397818 -858.1774777 -705.0719349 -866.7573943 -882.7395849 -775.0079544 915.2235546 958.9178894 905.3308264 976.6721238 1040.731967 939.7711866 1065.723254 1147.867864 950.7852038 1174.424346 1214.076396 848.7563434 1187.322582 649.5147664 413.2348941 465.8734627 -650.2624289 -287.5766405 -849.3407672 -1119.120121 -714.2993725 -1144.917549 -1153.463931 -873.8134665 -1146.523823 -1110.563577 -916.6702801 -1096.326811 -1052.110564 -923.0330781 949.0631326 1015.736513 975.0531095 1044.159694 1154.089833 1073.338487 1201.022686 1386.124687 1216.25229 1467.877359 1909.589591 1375.948708 1668.632195 1750.074198 1258.580756 643.9164151 -708.6865354 -225.6646148 -1507.739255 -1487.337069 -1207.875759 -1826.440495 -1586.81537 -1260.108864 -1524.893945 -1372.931386 -1178.218781 -1330.343044 -1218.523584 -1095.365948 961.5939097 1039.713891 1025.15756 1072.752334 1197.958688 1172.696947 1249.561593 1437.002074 1419.404391 1523.233095 1623.00106 1606.236701 2058.719859 2186.236224 2187.59025 -3585.617179 -2922.8904 -2423.587332 -2426.738981 -1930.285066 -1689.316323 -1818.83726 -1568.529171 -1431.932688 -1503.258428 -1339.429377 -1255.263458 949.8621312 1027.315021 1040.321645 1058.976836 1172.09725 1197.004792 1215.145934 1351.990686 1422.745614 1460.021973 1518.264975 1555.906519 1720.187444 1740.941709 1789.165406 -4228.342382 -3465.985926 -3390.766293 -2534.089457 -2013.904303 -1979.463377 -1893.008605 -1621.41349 -1598.591789 -1551.245266 -1374.565279 -1357.88625 915.8913719 984.864831 1019.201042 1012.085644 1104.382634 1158.117764 1137.417561 1234.770779 1323.832523 1330.348549 1363.884234 1401.364744 1474.517393 1483.065056 1520.960836 -3536.693763 -3058.514984 -3272.478536 -2211.923842 -1839.864889 -1991.683729 -1748.293557 -1532.119026 -1610.962861 -1473.300642 -1319.71508 -1368.655892 863.9511523 920.3803309 970.4853962 942.0209755 1013.0918 1083.313852 1037.858649 1110.548166 1204.305141 1199.130727 1223.592332 1257.506762 1309.613567 1319.401819 1344.95797 -2517.851522 -2290.090974 -2587.326568 -1701.474919 -1512.237396 -1767.357017 -1461.237888 -1332.189874 -1489.491235 -1294.3988 -1189.341533 -1292.738497 798.7845479 840.4924725 901.4999907 856.0403146 905.6654552 987.5349998 922.7108006 973.9116833 1078.004268 1065.010306 1082.593369 1121.643725 1178.784834 1193.036677 1217.833969 -1543.01816 -1552.991345 -1749.0426 -1176.947615 -1142.113494 -1420.268485 -1128.5981 -1085.381893 -1272.155393 -1069.961144 -1019.29074 -1148.973139 724.9642311 750.6025787 818.5339295 759.5637577 785.7148718 876.636635 793.7793748 816.0923846 936.6292956 910.2623168 919.3650401 984.9564188 1011.533996 1034.53595 1068.044645 -492.8286831 -592.3213535 -827.7026556 -523.6398836 -707.9861365 -1049.849551 -743.7484942 -810.0310546 -1052.95118 -823.2903381 -846.1189824 -1022.949312 -849.2048498 -842.6597228 -974.7385564 646.5851264 656.1211849 728.2916503 658.650207 660.8048599 755.9005895 659.3048319 646.2695949 775.0833026 730.4424221 729.1071588 796.7459505 785.3047781 782.5431353 855.2349389 279.36174 27.72100474 -84.83879222 -216.5541944 -411.2645391 -616.9760617 -457.5133018 -560.8025924 -739.3315174 -586.5263936 -644.2572203 -790.5954553 -657.7612677 -683.4472998 -800.7748065 568.5375457 564.1852525 632.6790803 561.39007 546.443197 630.3881428 538.1318275 500.2129833 606.2378779 482.2687926 412.4538335 534.0574539 361.1698329 226.1915623 300.5932022 167.0963116 -35.00616551 -94.11409154 -95.02588647 -247.8755916 -361.5087238 -290.0977249 -394.4748308 -512.3814103 -422.8078254 -492.1979909 -601.6481922 -510.5492411 -551.9789185 -647.8337677 495.8623668 481.7668015 542.6444108 475.5657316 450.0563223 520.6240979 438.5644873 392.6830303 469.9891187 373.3155927 304.4587683 379.8898944 270.9636516 172.5435987 206.373961 131.5596457 0.5576721329 -23.04482809 -41.15222811 -157.119655 -219.8615366 -191.9765817 -284.8254653 -362.5649013 -311.9710103 -382.1723614 -461.3257291 -401.7143697 -448.6834163 -523.6866518 430.8466025 410.8540704 462.9385907 402.7433531 372.6754374 428.9467971 360.3751582 315.5425945 371.026714 297.792995 237.2485319 284.8654087 213.7543439 136.7307603 162.3298767 109.2520888 14.2493804 5.547585267 -17.11519625 -107.7655193 -141.7589774 -136.2860942 -215.3305325 -264.3278233 -239.2621029 -302.7049392 -359.6319972 -320.8856468 -367.0617276 -426.3924936 373.5928444 350.8738844 394.8955341 341.988722 310.8028379 355.9388289 298.7660452 257.3183179 299.5710572 241.7011918 190.2180965 224.1473147 171.1106344 110.0307256 129.2308632 89.75341433 15.27833081 15.38968696 -9.266051541 -82.04559966 -99.63504161 -105.3702984 -170.9249088 -202.4250439 -191.010956 -245.3770862 -286.6561973 -261.4969812 -303.9623261 -349.7763914 323.8668426 300.3341091 337.4057488 291.3748533 260.8736437 297.2939728 249.4593997 211.5795515 244.8144716 197.8422734 152.7648218 180.0235414 137.7184427 88.17895338 104.6776501 69.55324118 10.49608083 14.4757355 -9.19171645 -67.51707303 -77.83850554 -86.31151656 -139.8012748 -162.178405 -156.4920736 -202.6508777 -233.5480433 -216.6675542 -254.5116376 -290.5015512 280.9519228 257.8152368 289.0096414 249.1878335 220.4681362 249.9748646 209.9563825 175.8998099 201.8322678 163.8205284 124.5075232 145.0025573 111.0645793 70.26307013 83.09017653 54.56707489 6.429528536 9.322104049 -9.593665552 -57.08256497 -64.61726772 -72.46519013 -116.6611363 -133.4032363 -130.6213245 -169.7947929 -193.6526544 -181.8864895 -215.1037957 -243.8499781 243.9137722 221.9088996 248.2702626 213.8326149 187.3988551 211.5860846 177.8858594 147.6163775 168.2234919 137.011312 102.8292396 118.5720043 91.49826437 56.65734498 66.49810088 43.5509098 3.60151473 5.625888786 -9.690504297 -49.01598058 -54.8858031 -61.79161564 -98.71248541 -111.7662953 -110.4679793 -143.7883078 -162.7419215 -154.1918229 -183.1283049 -206.5112274 211.8631125 191.3971616 213.8181899 183.9774699 160.0104567 180.0739796 151.5024982 124.7731245 141.457864 115.4629554 85.76778619 98.18886032 76.26887989 46.19900651 53.78771174 35.21130807 1.631709191 3.039116677 -9.52022559 -42.473003 -47.26049103 -53.19666646 -84.30297921 -94.82645225 -94.25926869 -122.6777295 -138.1112731 -131.6231477 -156.7281734 -176.0778167 184.0048996 165.2759073 184.4899771 158.5512319 137.0598289 153.8978772 129.5167987 106.0019253 119.7415813 97.84322088 72.07599191 82.0686083 64.07705469 38.0056107 43.96592634 28.75536167 0.2894701216 1.24475465 -9.138534051 -36.97626497 -41.01433989 -46.04373815 -72.40974029 -81.12431257 -80.87854111 -105.1689579 -118.0029111 -112.8593272 -134.5831149 -150.8466325 159.6678925 142.7428544 159.3338263 136.7127268 117.6121109 131.9007584 110.9671875 90.34768678 101.8269186 83.21818232 60.8852 69.07101842 54.09317461 31.47931905 36.23628708 23.66134787 -0.59268126 0.03128668915 -8.60186438 -32.23987667 -35.72931976 -39.94261325 -62.37577917 -69.74707627 -69.59858367 -90.38565707 -101.2452636 -96.99406283 -115.7504239 -129.6050378 138.2959236 123.1554878 137.592152 117.7969681 100.9507176 113.2096019 95.12795501 77.11718778 86.83555449 70.90909933 51.59408607 58.40365769 45.778786 26.20484277 30.05672173 19.57164505 -1.138558608 -0.7566158474 -7.959012809 -28.08272994 -31.15179291 -34.64095716 -53.76039293 -60.10275263 -59.92630969 -77.71418757 -87.03948278 -83.38585782 -99.53964437 -111.4834478 119.4109006 105.9946824 118.6559522 101.2740603 86.52470881 97.15329311 81.45082375 65.79550856 74.12492976 60.41355848 43.7666151 49.51469504 38.74974883 21.88148718 25.04432348 16.23743475 -1.439949681 -1.233801415 -7.249325644 -24.38476595 -27.11897856 -29.96862729 -46.25784722 -51.79027828 -51.51686062 -66.71429531 -74.82194629 -71.5703764 -85.43682538 -95.84132268 102.6065634 90.83496759 102.0319933 86.71440194 73.90439887 83.21489577 69.51352409 55.99243744 63.21537303 51.35381642 37.08090852 41.9984655 32.73761852 18.28723709 20.9218721 13.47974101 -1.565587921 -1.485567616 -6.503058021 -21.06138389 -23.52154153 -25.80448135 -39.64624151 -44.52869561 -44.11844715 -57.0580835 -64.18517148 -61.19924403 -73.04706426 -82.19897012 87.53804977 77.32729008 87.31497524 73.76874509 62.75081407 70.98983303 58.98505513 47.40668573 53.74198103 43.43998971 31.29657087 35.55824106 27.53446339 15.25294252 17.48171811 11.16685429 -1.566974521 -1.575876755 -5.742863985 -18.04991855 -20.28128894 -22.05844555 -33.75877509 -38.1119252 -37.54100689 -48.49428579 -54.8230107 -52.00395322 -62.06022815 -70.18520811 73.92491743 65.1864624 74.17402355 62.15276928 52.79205235 60.15857558 49.60040881 39.79765981 45.42114939 36.44064183 26.22810842 29.96859181 22.9772367 12.64977095 14.56608221 9.199229888 -1.482848557 -1.552672154 -4.985281735 -15.30172505 -17.3398752 -18.66075521 -28.46582059 -32.38426482 -31.63642044 -40.82469386 -46.49994054 -43.77159743 -52.22618259 -59.50773572 61.52686145 54.17284477 62.33590959 51.62883728 43.80450804 50.46198265 41.1427664 32.9737165 38.02467748 30.17542433 21.71602035 25.05337041 18.93473215 10.37800265 12.05414146 7.498841934 -1.342443149 -1.452047798 -4.241949075 -12.77671154 -14.65096673 -15.5545142 -23.6624432 -27.22273548 -26.28470295 -33.88737292 -39.02736189 -36.32724186 -43.33263506 -49.92687297 50.14174073 44.08114186 51.57110818 41.99423643 35.60034141 41.68683672 33.43097167 26.77729281 31.37147499 24.49505137 17.63768484 20.65986326 15.29968064 8.358736045 9.85226515 6.002794278 -1.168065081 -1.301281531 -3.520840422 -10.44095835 -12.17626726 -12.69222048 -19.26239259 -22.52769711 -21.38753627 -27.55108951 -32.25153836 -29.52991101 -35.21296468 -41.23899247 39.55526693 34.72124207 41.67965115 33.06499083 28.01398396 33.65188112 26.3059271 21.07018177 25.30969573 19.26982848 13.88946194 16.67345682 11.97825043 6.527153645 7.885529849 4.65854388 -0.9768068153 -1.12126094 -2.82689162 -8.263928617 -9.882959806 -10.03181878 -15.19076632 -18.21645251 -16.85982997 -21.70400858 -26.0476436 -23.26088479 -27.73971109 -33.29129275 29.58890914 25.92659134 32.4755943 24.67953715 20.89959418 26.19648684 19.6272171 15.72936134 19.70518395 14.38342008 10.38028857 12.99303712 8.888728733 4.829135568 6.092064213 3.421805473 -0.7813879949 -0.9279351275 -2.162384906 -6.217173295 -7.741123386 -7.53483372 -11.3798062 -14.21613768 -12.62431635 -16.24050146 -20.30623429 -17.4046563 -20.76033541 -25.95715038 20.08703694 17.55171979 23.79879674 16.69612803 14.12624999 19.17911223 13.26757067 10.64133467 14.43796011 9.728686023 7.029490441 9.530830492 5.955918208 3.218662191 4.419963743 2.255253714 -0.5903745679 -0.7329776195 -1.526671888 -4.272810736 -5.722559572 -5.164516178 -7.766524978 -10.46029718 -8.60933246 -11.0626598 -14.92284499 -11.85448907 -14.1450145 -19.0791364 10.90845227 9.474800853 15.50857063 8.996632691 7.577235269 12.47216043 7.108564365 5.68816436 9.395566194 5.193817774 3.757550551 6.207432659 3.106832979 1.659535402 2.825184097 1.130064274 -0.4088779949 -0.543903288 -0.9168414402 -2.403876468 -3.799521476 -2.886174522 -4.293919184 -6.887270689 -4.750530536 -6.083629985 -9.80241963 -6.515739833 -7.774824433 -12.53531189 2.456694912 2.032321542 7.488517837 1.897270037 1.457167091 5.960022176 1.291379139 0.7136078794 4.452430955 0.506428981 0.5964086955 2.938515797 0.6947761609 0.01073143622 1.278572166 -0.1725430115 -0.4962981896 -0.3616635613 -0.5886050236 -0.8621755689 -1.942206574 -0.9535489938 -1.226908489 -3.43914235 -1.317308141 -1.586043935 -4.858622743 -1.675676774 -1.976800273 -6.204916339 1843.573041 1904.117908 1858.660899 -4422.197299 -4937.18052 -5058.213584 -3181.550644 -3608.827924 -3329.600667 1534.05558 1574.976291 1552.749001 -4322.36257 -4728.403956 -4538.176165 -5073.815203 -5075.754862 -4583.793765 1353.94689 1382.317426 1364.102887 -3297.209083 -3517.073909 -3277.445915 -4467.328135 -4242.849393 -3986.691615 1225.95349 1249.617313 1228.604744 -2196.045053 -2251.458771 -2112.710951 -3132.740002 -2979.621691 -2874.371762 1078.698437 1109.801574 1086.336795 -864.4364733 -856.6619114 -806.9464391 -873.4096572 -963.8716519 -950.9267182 -1438.583777 -1451.243858 -1032.225646 -1975.412253 -1839.335096 -1808.03349 876.0949086 916.0081906 892.4316773 200.8658349 454.3234668 605.1402144 -739.956827 -583.6760167 -646.9138937 68.57281697 -5.754475998 129.9308297 -627.9820281 -459.4104397 -222.9339197 -902.2374532 -557.2407036 -708.0735762 2606.767785 1961.23357 1770.27389 2657.45309 3770.730574 4517.153316 1179.138878 1727.348102 1110.509506 -1323.877755 753.344008 -2288.571837 -2326.943937 -2742.579428 -435.405552 -995.1174688 -1442.477349 -5907.671051 -6133.171321 -6217.773608 -4075.767477 -4635.49515 -4308.458869 -3346.856127 -3045.133554 -3780.61579 -2543.058164 -2833.931978 -3000.266382 -2341.911634 -2611.07387 -2366.28812 1439.903034 1479.226182 1429.187678 1594.220925 1525.813643 1460.882656 1619.743672 1551.526152 1625.047237 -6035.227668 -6179.111825 -6141.308122 -6530.954708 -6506.91501 -6343.521533 -3342.678029 -3442.909787 -4187.559504 -2820.400425 -3143.98885 -3090.147477 -3105.618566 -3151.673903 -2817.08977 1292.037676 1327.451733 1297.224244 1395.175984 1357.370074 1302.956593 1437.778237 1378.202786 1416.78597 1435.460884 1470.687161 1450.429163 1469.009333 1464.269439 1451.818711 1542.233745 1529.354594 1536.70651 -4437.400694 -4495.352598 -4436.406229 -5310.434706 -5257.034779 -5169.968709 -2690.566581 -2964.67509 -3413.598192 -2510.244324 -2732.777301 -2572.685803 -2998.937495 -2877.241101 -2625.017388 1156.122447 1189.946083 1166.480339 1248.559858 1215.046843 1165.126497 1283.89469 1233.210395 1265.082795 1287.891607 1311.272742 1292.862054 1319.949613 1312.130857 1305.313194 1359.19646 1350.579787 1354.527722 -2971.32405 -3020.312762 -2929.370768 -3626.646205 -3480.080994 -3423.65789 1005.547688 1063.586691 1029.1351 1110.41948 1074.367583 1015.6898 1146.732518 1092.931575 1128.950817 1158.044884 1184.561733 1161.393776 1204.08069 1191.517049 1178.495594 1239.680848 1231.563028 1238.353188 -1603.861131 -1654.351343 -1663.242343 -1806.876831 -1851.091952 -1590.270155 -2151.827334 -2067.790382 -2046.146684 823.0498565 895.9667029 866.4713551 932.2351939 903.566107 827.8873398 994.7346427 927.6123932 958.0852241 985.3535047 1022.821986 998.9944049 1026.869154 1022.69879 1016.077691 1102.470982 1096.916426 1101.807148 440.1657454 638.9242127 668.3210733 361.2421174 589.6537951 408.5712803 584.6427227 559.3204194 394.9376663 2189.06964 2182.440753 2314.211142 1847.586502 1907.378075 1907.199561 2782.079413 2946.282521 2956.685493 2378.988069 2481.872599 2430.405847 -6377.780108 -6555.553764 -6549.037895 -6285.784619 -6344.907177 -6132.491076 -4591.002675 -4875.64483 -4293.267804 -5901.36839 -5548.246934 -5435.512588 -5828.041988 -5817.601606 -6204.885931 1598.936871 1580.327845 1540.406176 1641.711017 1594.268833 1611.514439 1581.741246 1589.850431 1625.270362 1642.074123 1641.539685 1662.083506 1578.328592 1593.722678 1582.646985 1800.933667 1786.098752 1830.779746 1669.107613 1692.513933 1688.741168 -5322.186594 -5412.686189 -5362.388612 -6104.592957 -6066.775014 -5929.586415 -4932.671927 -4785.37811 -4347.916975 -5720.153133 -5414.865007 -5486.408739 -4994.352215 -5081.273206 -5325.495535 -6156.849863 -5814.178825 -5826.799296 -5522.663221 -5573.71364 -5952.504401 -4470.044643 -5056.965588 -4970.916008 1380.809244 1377.108895 1368.033248 1439.777484 1428.19973 1431.830151 1384.01647 1392.350396 1424.17135 1444.29067 1445.366348 1451.639521 1374.683439 1378.987321 1377.109012 1539.566291 1551.601227 1572.483018 1458.066814 1464.712085 1462.83971 -3707.034148 -3823.706692 -3676.088463 -4378.581465 -4320.760631 -4272.452384 -3840.32 -3597.044724 -3438.53228 -4118.327928 -4025.833197 -4122.863107 -3341.756895 -3591.797126 -3821.363235 -4980.257605 -4811.675769 -4904.332877 -4221.662815 -4321.79846 -4492.864053 -3854.746202 -4163.83865 -3921.803402 1266.79947 1255.389684 1247.687456 1298.608144 1291.836066 1298.570432 1244.673963 1257.401138 1280.253058 1308.10407 1311.480517 1313.918897 1263.246716 1267.847518 1263.433156 1364.314634 1365.883106 1370.315673 1316.321279 1318.80239 1316.342514 -2291.382913 -2321.206253 -2236.299504 -2839.447298 -2750.820725 -2710.3472 1117.141778 1112.211902 1107.713746 1173.930369 1160.191596 1173.828637 1097.265953 1119.919883 1148.838062 1187.803093 1191.796543 1196.806943 1250.488241 1254.241663 1258.833855 1201.718691 1203.858275 1199.962855 -1152.020909 -1166.291077 -926.2999884 -1504.230728 -1249.686575 -1265.103231 -1512.027003 -1506.555041 -1553.897123 950.1272075 958.3192796 916.3732505 1009.302939 1001.738293 1008.505211 909.2639741 929.9612665 971.9839254 19.45887024 93.67259651 27.33303341 899.8806415 892.7306327 1026.458749 -196.5183478 -142.7642669 -59.38583175 1589.395727 1614.256401 1522.957224 1887.550915 1696.832945 1645.043359 1686.633081 1709.462994 1918.868519 2101.01531 2155.863112 2040.004274 2509.648201 2264.786542 2159.960181 2362.155295 2288.903009 2568.540997 -5109.310248 -5936.039767 -5460.708191 1659.951074 1698.176556 1681.126477 1726.674854 1719.185723 1661.371213 1819.811308 1743.949015 1749.612768 -1955.328643 -2186.417458 -2391.261968 -1935.146361 -2044.892931 -1864.035634 -2402.082045 -2225.084024 -2088.714294 -2046.021091 -2100.119736 -1960.731493 -2261.465316 -2215.904153 -2206.329596 -315.562661 -522.9669032 -407.8935309 -605.771057 -542.8217533 -415.1828012 -850.5496942 -680.9174945 -731.4986077 1997.472776 1952.719014 1851.857094 2115.022401 1993.990301 2049.606953 1909.67611 1969.151251 2036.042293 3663.596339 3856.154664 3843.466391 3181.361824 3321.263068 3244.271408 -4738.602634 -3988.773102 -3252.123286 -5297.472951 -5130.401978 -5479.753334 -3631.721058 -3998.093858 -4464.465807 -2340.217353 -2354.911506 -2307.486782 -2633.416883 -2588.504584 -2567.793036 -2536.553251 -2392.628011 -2329.289756 -2506.444867 -2458.662941 -2633.678111 -2157.812633 -2306.29668 -2425.389731 -3183.026958 -3023.64863 -3261.391526 -2712.792894 -2942.658308 -3095.677902 -2736.350197 -2830.169092 -2682.441535 -1159.754881 -1112.156764 -1113.203325 -320.8891342 -382.7551024 -372.3027647 -551.3665928 -534.7852176 -389.8535904 1751.747473 2401.998951 1597.8264 2338.641641 2444.571137 1833.730207 3366.029108 2691.786891 2461.344811 -2918.207096 -2931.996222 -3488.351644 -420.6988269 -1136.831054 -1759.34586 984.5952893 -778.666298 -182.6270232 -5946.588174 -6387.342563 -5688.872834 -6026.568477 -5094.449774 -4323.766443 -6830.488281 -6599.352222 -7065.96574 -4726.9436 -5134.170888 -5781.223787 -6302.667302 -6275.674983 -6149.788652 -6227.794916 -6363.263387 -6332.489361 -4850.639348 -4792.295674 -4723.823937 -4894.073615 -4969.002414 -4909.773819 -3205.074177 -3112.245426 -3059.779059 -3314.676965 -3282.579451 -3327.137892 -2990.101621 -3037.123788 -3062.590932 -3373.345429 -3422.009421 -3451.838267 -3331.241291 -3432.34644 -3288.965211 1207.765781 1199.777959 1208.192505 1183.778276 1191.68643 1199.947535 1174.347982 1183.157074 1175.110683 -1687.888906 -1699.194275 -1607.532738 -1913.185681 -1775.091968 -1777.124296 1058.908444 1052.826831 1057.760126 1019.180869 1028.082701 1039.956248 1000.955006 1022.088445 1006.72791 1065.301418 1073.621698 1084.41322 1051.377609 1062.5383 1054.167992 1073.507038 1069.181426 1064.293605 2039.874022 2143.573348 2119.948298 2321.980296 2265.480277 2253.621416 1951.851311 1930.041592 2009.810885 2804.760474 2890.395896 2744.787736 3350.838492 3062.515876 2869.963385 3164.846874 3146.049082 3422.370824 2440.438092 2444.184331 2380.975774 2912.611965 2829.702969 2868.336234 2517.492679 2592.192951 2703.803303 -6537.256 -6540.385033 -6355.922066 -6316.387271 -6512.318915 -6528.611763 1618.056655 1635.036902 1628.504076 1588.903612 1598.608622 1613.363246 1738.332357 1773.12623 1773.186411 1706.754478 1700.794788 1728.237422 -5693.520837 -5650.240364 -5555.500613 -5687.473984 -5782.79641 -5736.257165 -5318.69897 -5391.722274 -5675.792361 -5015.050175 -5196.209428 -5131.963075 -5318.340974 -5260.418214 -5069.23961 -4757.610408 -4915.906129 -4835.978222 -5064.390632 -4992.188074 -4827.311902 -5371.59713 -5164.757169 -5244.107484 -5762.1743 -5792.011721 -6136.735721 -5304.584583 -5540.57914 -5518.974486 -5557.943474 -5553.948673 -5310.946816 -5203.632003 -5412.104544 -5370.481556 -5489.899661 -5453.722286 -5238.696055 -5977.476447 -5684.26339 -5725.613386 1411.675278 1416.931046 1415.421902 1400.440694 1401.462117 1406.490574 1514.736659 1521.968956 1518.397873 1497.786539 1500.228369 1507.484053 -4029.24079 -3872.877644 -3764.093366 -4005.680502 -4049.336806 -3997.400253 1290.629651 1294.640474 1291.31013 1280.249637 1283.251146 1286.731532 1341.435583 1344.850692 1343.227488 1332.216948 1334.093372 1337.85687 -2822.710679 -2792.074554 -2897.124608 -2613.384652 -2702.038487 -2777.894166 -2624.826137 -2663.644764 -2577.452283 -2703.523704 -2720.361793 -2675.547869 -3008.752316 -2951.443461 -2933.295291 1141.651321 1135.958234 1139.245703 1107.383201 1115.177195 1125.598491 1094.783725 1104.927035 1097.053512 1147.570907 1155.978563 1165.488901 1136.006398 1146.152587 1137.875591 1157.681063 1153.267211 1147.471476 -1264.029442 -1261.83712 -1206.253742 1229.903043 1233.047041 1229.981005 1219.953638 1224.202397 1227.0059 -1241.290687 -1335.71786 -1362.147228 -1334.037732 -1334.586868 -1243.875682 -1516.72948 -1425.382374 -1422.152704 966.0940929 970.6016741 993.9540637 941.1869655 962.2903891 951.7779433 431.8296034 477.5734676 514.7556941 214.9253378 266.5717561 228.6376105 92.16185698 130.8865798 172.5897384 -324.8140814 -232.3195126 -279.8195054 -197.0365004 -217.6357282 -264.2939991 1.694777263 -125.0062068 -37.84341656 -2210.316777 -2224.989198 -2166.58776 626.4582919 677.0486413 683.199814 671.1635988 670.0134982 613.0726072 799.9353628 715.250097 706.5975534 699.3814284 739.5501229 745.9244285 807.0326292 737.202018 677.6223578 868.8921987 797.1848872 714.1407991 94.70914017 87.08993094 277.0920222 -169.7659988 -52.45476014 -21.82656375 -169.0997579 -103.0657753 -229.5703356 -991.2735103 -977.6820989 -891.2838336 -1153.913305 -1065.192673 -1074.952318 -1046.506833 -1055.265615 -1147.464238 -210.1448716 -115.0854249 -43.44623709 -302.0228579 -201.7121374 -292.1836272 81.85130766 -98.34366141 -206.9795918 2368.427156 3081.582528 1984.144986 3047.8047 3177.343817 2636.018025 4170.946443 3423.14324 3259.863006 -3606.024803 -3632.048505 -4334.678635 -692.7103222 -1333.774398 -1842.145494 1259.041723 -921.2153458 62.28630084 -6224.157072 -6209.278119 -6063.515816 -6323.927289 -6481.732783 -6455.125639 -4615.017982 -4555.288825 -4494.300164 -4675.359209 -4613.956196 -4676.454041 -4490.431067 -4551.186812 -4604.235124 -5117.216436 -5202.655062 -5146.009937 1326.664976 1319.235978 1323.2211 1308.863149 1314.170493 1321.756638 1299.616538 1306.797501 1301.256864 1341.293555 1346.091278 1354.736168 1329.593029 1337.692522 1332.828725 1346.235169 1342.222283 1334.214164 1216.967741 1224.282252 1232.363509 1208.076489 1216.168565 1208.772291 1234.267695 1223.504237 1215.601079 1034.813066 1029.250686 1034.040687 1018.790703 1023.949904 1029.958948 1010.691776 1017.495283 1012.293291 669.8838049 643.2166532 669.3908011 575.4070126 605.2068364 672.0661297 388.0789792 503.152133 474.9679772 -6551.284001 -6556.487155 -6378.151573 -5706.752723 -5637.788305 -5984.35668 -5049.449617 -5329.098533 -5404.036183 -5120.983185 -5235.281911 -4955.690276 -5271.291595 -5533.099681 -5551.100537 -5462.057634 -5503.950884 -5236.369066 -6200.480847 -5796.780087 -5762.642243 -5510.946154 -5462.31736 -5370.941029 -5887.622962 -6020.482631 -5963.847729 1396.304316 1386.515007 1390.056173 1377.585737 1382.231231 1392.021986 1363.628047 1372.770796 1368.105621 1382.577524 1380.771682 1376.548382 1388.982286 1384.881372 1386.444912 1381.823246 1383.257266 1387.558807 -4418.156853 -4370.557197 -4430.754854 -4255.769432 -4312.008135 -4357.50547 -4215.308205 -4264.420304 -4209.080363 -3836.082632 -3930.206938 -4017.11943 -3761.106317 -3845.440894 -3755.834701 -4027.945125 -3936.176924 -3846.824667 -4619.933725 -4716.788871 -4927.229818 -4447.688294 -4579.792839 -4490.101194 -4753.010021 -4667.455009 -4528.733288 -4107.10899 -4213.366317 -4120.491661 -4398.744529 -4306.266384 -4193.636441 -4547.877771 -4421.937599 -4521.465114 1270.196707 1262.81579 1270.125168 1248.766431 1255.757658 1263.306804 1240.341879 1248.125866 1240.984696 1279.037885 1285.408597 1292.517917 1270.804355 1278.179033 1271.597207 1295.173445 1284.839014 1277.583861 1305.920971 1308.86141 1305.222807 1316.977535 1315.000272 1318.716191 1267.58922 1272.429118 1275.848668 1357.017065 1361.434012 1359.625094 1364.73184 1363.080445 1358.470472 1372.169683 1367.653357 1369.432279 1322.972432 1321.04716 1318.936871 1326.027095 1323.406431 1325.003265 1319.21063 1321.439377 1324.2513 -2491.631992 -2406.19245 -2374.055203 -2458.103874 -2437.378893 -2525.188297 -2263.949127 -2350.55848 -2380.562828 -1464.001017 -1465.742123 -1408.111574 1184.648376 1188.008841 1183.284682 1244.64452 1249.390376 1246.040345 1203.594255 1205.449192 1212.620714 909.768154 937.8915555 701.2770961 921.6607189 941.226222 933.858996 899.2088638 925.5163282 908.6255709 990.9672563 995.9427435 1003.597375 977.9820165 987.4565608 982.8151151 271.0652752 164.4954399 85.13609398 301.0387331 236.5077395 316.7029944 91.23835698 161.8991057 223.3425259 720.1393925 835.5403987 781.9507501 644.7329642 869.2775218 653.3623311 758.8621516 699.503227 -6062.56176 -6506.00083 -6905.91424 -2022.376407 -2037.831693 -1980.976963 -2116.160645 -2083.511048 -2067.564748 3704.015533 3803.656561 3626.451712 4054.316579 4073.397094 4319.678172 3362.777408 3454.361977 3583.759696 -2635.334425 -2609.971903 -2655.588973 -2506.225364 -2555.29875 -2570.53443 -2521.152992 -2539.615484 -2491.636653 -1113.901847 -1112.224016 -1160.364483 -1000.851939 -1052.997288 -1040.80501 -1062.967663 -1058.774699 -1005.877003 -620.6479363 -608.5623792 -560.5544377 -728.6019218 -654.6256647 -673.7245705 -415.7293777 -398.197646 -343.4499908 -502.6712852 -449.22013 -466.8336586 -6569.444203 -6921.987951 -7053.325096 -6598.286323 -6770.773623 -6420.52143 -7151.631374 -7215.326165 -6886.316421 -5861.912053 -6186.177964 -6408.622277 -5648.123644 -5934.996904 -5638.25213 -6809.586605 -6316.484269 -5996.212486 -6126.837014 -6253.220266 -6238.991291 -6426.08135 -6394.827597 -6254.253873 -4738.51015 -4800.263067 -4871.455592 -4667.235384 -4733.833222 -4674.619939 -5087.30658 -5028.011903 -4950.914752 -3185.159956 -3236.011837 -3268.578615 -3177.218408 -3205.621844 -3156.760759 -3299.087231 -3252.231666 -3225.469413 -3562.345935 -3595.47309 -3546.2787 -3694.992468 -3645.240525 -3611.748264 -3365.099488 -3394.800472 -3346.34565 -3496.744642 -3445.411022 -3414.365844 -3504.383499 -3474.610662 -3529.83347 -1796.963253 -1855.462323 -1873.302793 -1830.363895 -1841.963003 -1790.746295 -1930.220605 -1887.147935 -1876.354302 1043.967283 1048.243108 1054.151407 1035.99261 1042.174872 1037.517955 1051.052306 1046.569604 1040.246664 1079.322451 1074.021569 1077.590697 1066.284421 1070.142832 1075.560787 1059.685203 1064.92552 1060.44917 2124.942965 2086.269691 2072.550432 2103.641963 2096.511234 2135.378508 2026.804576 2060.434576 2068.102134 2270.860544 2271.208343 2323.64552 2177.322725 2222.540144 2225.404557 2201.466514 2213.729045 2167.135689 1879.595788 1872.084527 1893.679006 1834.479448 1852.147445 1859.882284 1974.780509 1966.614933 1995.469616 1916.252925 1940.356456 1948.305255 2585.894295 2512.531439 2512.899992 2492.100049 2502.729529 2570.057158 2379.817555 2439.3545 2429.713214 -6364.508122 -6541.702997 -6544.944438 -6458.506991 -6490.28995 -6297.668959 -6927.25722 -6702.960461 -6673.827805 -6738.870391 -6726.963929 -6961.052851 1629.334522 1629.321215 1635.607894 1620.661881 1623.27654 1623.951649 1655.501152 1655.866703 1662.177592 1642.374792 1649.19809 1648.769895 1593.157651 1597.511138 1601.173646 1589.541849 1593.738333 1588.581544 1611.333023 1613.687105 1618.056368 1604.884067 1608.974311 1606.561794 1756.992432 1752.264892 1763.617072 1731.362049 1741.562653 1745.828788 1810.108631 1803.7422 1818.620964 1775.9791 1789.44368 1795.493892 1683.488756 1682.252465 1690.104145 1668.363585 1674.926217 1675.945911 1716.334865 1713.562803 1721.951492 1698.029286 1705.776054 1707.811416 -5511.1393 -5604.896943 -5558.19027 -5900.027196 -5837.85122 -5736.674807 1571.423661 1577.510377 1584.426086 1560.213398 1568.963393 1563.893101 -3959.467938 -3997.302472 -3946.66124 -4115.371961 -4052.664233 -4014.056401 -3764.22311 -3802.567048 -3747.324305 -3895.514057 -3853.114047 -3813.495674 1295.123928 1298.704213 1302.535853 1277.699203 1279.856111 1276.881429 1347.478 1346.38087 1343.518819 1354.11812 1349.738207 1349.168547 1347.316446 1348.636013 1352.769502 1327.252023 1330.506709 1328.700949 1332.954962 1332.03293 1328.878567 1339.81396 1335.70839 1336.444258 -2825.131468 -2771.392738 -2752.039825 -2887.093369 -2901.904496 -2868.583874 -1371.882486 -1323.128559 -1317.506631 1168.755234 1174.705324 1180.573559 1233.594638 1236.500645 1240.334005 1217.180474 1221.150725 1216.444548 955.3938128 956.2406787 967.3520828 934.4041065 943.3314141 945.8420666 388.1409795 347.4019833 368.810268 272.8881035 311.7935163 352.964408 6.802726324 60.06068642 36.31016992 -2254.421428 -1814.401999 -1728.550986 -1701.910222 -1761.8013 -2047.178663 -1267.350685 -1497.102811 -1485.795101 -1183.33827 -1364.015899 -1431.613587 -1325.272825 -1347.352189 -1187.086309 -1686.873083 -1514.781248 -1472.96369 -957.4450873 -906.6569847 -913.0964431 -890.7454023 -899.74291 -952.4941392 -797.0748081 -846.5725912 -834.9544262 -1869.186358 -1867.027394 -2011.586465 -1585.335834 -1725.196429 -1745.525501 2833.009982 3265.947718 2453.734584 3713.688373 3600.739571 3202.961189 4513.845065 4065.820281 4045.464554 -3195.259029 -3088.202079 -4430.149371 -757.3914419 -1518.220196 -2156.30726 1103.230846 -339.9025365 165.1270816 -1785.339624 -1893.395579 -1509.819602 -2998.087053 -2350.434986 -2184.866916 -5990.874136 -6063.636332 -5832.416269 -6580.95461 -6306.937934 -6220.677244 -6463.026142 -6387.417599 -6659.56137 1490.052126 1477.050572 1482.375852 1465.007166 1471.188618 1483.764371 1446.743414 1458.817763 1452.99777 1514.782593 1522.060789 1534.833922 1496.490925 1509.261144 1502.112019 1523.290961 1516.304007 1503.172901 -1641.126438 -1646.39097 -1597.908334 -1739.773932 -1692.091256 -1688.461097 -1708.891388 -1699.463716 -1743.653899 -2113.575791 -2091.283138 -2177.59659 -1919.240107 -2005.194324 -2025.758299 1088.306029 1092.42643 1097.813514 1081.204636 1086.880541 1082.452569 1095.614218 1091.164165 1085.180203 -6839.090339 -6580.292443 -6528.180861 -6647.35647 -6618.3133 -6865.173234 -6168.673046 -6387.794353 -6428.044999 1418.652617 1423.643686 1434.995157 1402.175691 1412.698671 1407.859115 1420.620601 1417.109286 1406.496232 1433.305837 1439.199294 1437.733374 1440.900248 1440.312871 1434.373406 1453.075402 1446.651709 1447.602576 1467.361439 1466.281036 1459.50018 1480.650425 1473.409784 1474.886048 1470.076627 1471.613437 1478.624734 1120.352486 1116.087553 1119.770469 1108.552999 1112.227862 1116.918728 1102.960339 1107.70193 1103.294169 -1409.145267 -1458.382001 -1461.866349 -1453.314506 -1455.623744 -1409.10934 -1549.994 -1502.129478 -1499.791127 -2247.71316 -2230.875419 -2276.168687 -2135.120351 -2183.397072 -2197.786845 -2158.002138 -2169.682368 -2123.47218 -4554.58257 -4824.591247 -4984.605026 -5275.127965 -4933.057876 -4704.104939 -2446.195522 -2401.401028 -2388.1797 -2439.481603 -2419.657091 -2463.300825 -2322.236863 -2370.930715 -2384.933039 -2005.21035 -2438.453594 -2498.942291 -2162.915888 -2333.985375 -1832.683365 -3589.126015 -2922.235579 -2904.082926 -2988.921485 -3012.672286 -2965.955992 -3107.917495 -3059.460984 -3037.081694 -3108.203306 -3084.601081 -3133.824162 2747.856665 2786.181157 2858.204472 2640.510277 2713.82503 2678.953845 2774.455553 2746.548092 2664.205199 1419.489846 1418.287732 1412.978368 1428.864732 1423.567743 1424.708809 1421.211637 1422.263515 1427.676074 1391.99302 1396.610831 1395.165584 1398.548416 1397.761684 1393.228879 1407.712499 1402.607029 1403.403738 1528.789547 1525.390685 1517.93699 1540.122718 1532.794451 1536.458601 1525.839138 1529.14648 1536.261906 1485.78228 1492.981448 1490.258201 1497.911846 1495.503953 1488.059549 1510.457598 1502.977282 1505.632025 -4155.275346 -4101.714313 -4059.138642 -4188.881399 -4146.363237 -4200.947767 -4039.213608 -4092.274323 -4133.849131 1128.922923 1132.430754 1137.915227 1121.890339 1127.059239 1123.259436 1133.439239 1130.437588 1125.254077 1164.076029 1158.842185 1163.60889 1150.19518 1154.313444 1159.431944 1143.461474 1148.960363 1144.575112 397.3995535 440.9331488 400.9471378 510.3009011 477.4027696 439.1019772 554.7246998 522.5484158 561.0365174 -118.3334222 -170.2982753 -147.6892317 -217.8814996 -193.3604977 -144.1218159 -289.4928622 -239.5865234 -262.4098042 -2415.280959 -2997.904238 -3086.988647 -2546.807031 -2834.188061 -2184.64925 -4465.876756 -3603.569802 -3428.289913 936.6304764 938.5124149 923.3238825 999.9511612 985.3839167 958.6014719 1341.130149 1090.016194 1042.164716 1023.017979 1019.733621 1125.361574 930.3442083 1040.712348 1017.598269 752.31591 780.6578804 714.5464255 770.0136279 761.6833984 760.1175781 750.8004606 736.4531011 734.2583922 718.5886008 696.3978533 693.3704358 669.0304848 635.6580787 631.7163406 595.4695041 547.7328349 543.117489 491.8881514 427.7001837 423.1677298 355.4198956 275.8536557 272.5317743 190.2956109 100.5398912 99.40207419 8.672070516 -83.17468971 -81.97165575 -172.5440584 -257.403544 -254.1850909 -336.2961212 -408.286549 -404.1701836 -472.8434777 -529.8876396 -525.7799936 -579.7482647 -622.9253071 -619.0393073 -659.1923677 -689.5305212 -686.5614187 785.9339338 782.9159658 778.8484021 778.3552227 772.1218385 765.731041 763.7124303 752.0507934 738.2743296 733.762277 724.7931934 720.7332729 690.7104351 676.5571789 670.9898579 624.308903 603.0732843 596.2355718 526.9170251 496.7079202 489.5435261 392.201294 352.2205582 347.196976 222.1742107 175.3031931 173.2594392 32.95847771 -16.34583081 -16.16385526 -158.9458164 -205.5080529 -201.5283961 -333.0054264 -372.2211782 -365.590177 -475.5446163 -506.1105049 -499.0033117 -603.7754977 -649.5899819 -633.1098234 -683.2118535 -710.5084727 -697.4909989 -732.9402292 -750.4408773 -741.7342914 795.354023 794.4939093 788.2148415 792.8428285 790.1245102 780.3363331 786.0534983 781.6598794 758.4214569 759.8145309 753.2987906 744.7977022 727.1084885 715.8299738 703.998431 671.0392263 651.4548938 637.4047451 574.419599 542.05775 529.5500435 423.0064274 376.9244612 370.4179126 227.4705181 173.5890233 177.0391363 10.05185022 -43.68977757 -31.63674419 -197.5879326 -245.5888374 -230.064745 -379.3906282 -419.99767 -404.5830405 -526.2418729 -556.0009102 -540.3630022 -665.7799313 -700.8354521 -672.2209993 -728.2829156 -749.7221394 -728.0551789 -766.6479847 -779.2169211 -764.2788781 806.2593011 808.6986761 801.3536396 811.193198 813.3002728 801.2319281 814.8807635 821.0473232 790.7383418 798.252361 795.5614038 783.8735275 782.1571991 774.8988021 758.5604278 739.7909526 722.3289013 701.7860753 646.4198763 611.8537683 590.6075157 478.119396 419.5295409 406.7955935 218.4788618 146.9991307 155.7208156 -65.4989762 -131.5377375 -102.8675363 -306.4041492 -356.5142982 -320.8015565 -485.0153393 -521.5562309 -489.0624204 -617.8818791 -645.1429091 -618.1380698 -758.7812391 -776.9682741 -735.8973598 -793.085248 -804.9441827 -775.4157942 -813.5727674 -819.0191398 -798.4292862 817.2972923 823.3880368 816.0627998 830.4433122 838.2832156 825.8224776 846.5026629 863.8660389 831.6481201 845.2100237 847.8112718 834.2323284 852.6274135 852.5378702 831.0216574 841.5161097 832.5274842 800.2192406 776.8871209 744.5894421 702.1866332 585.5801597 507.8229385 475.797531 213.4414278 101.1464857 114.1725963 -217.554229 -307.2783787 -252.2082569 -515.2783047 -566.2742972 -501.8897428 -682.6918227 -709.8569348 -654.876005 -769.0816197 -783.9694933 -743.9989363 -886.227198 -874.2742338 -823.3877863 -874.3324082 -872.8935444 -837.7185295 -870.0157731 -866.9443258 -842.5892626 825.6244236 835.2743173 829.8023516 846.8666292 860.3786907 850.0407525 875.9067499 903.6907776 874.2115013 893.2299637 902.522904 889.0297654 935.2440224 947.4901165 922.872988 985.7813358 997.5480089 952.5429126 1013.048632 1005.367069 924.540226 886.2810844 790.8096148 687.7685672 268.2192161 42.10620219 57.80525204 -535.3624819 -661.1737714 -546.6830116 -884.2587803 -920.9259706 -818.035273 -970.8426606 -976.5893489 -902.7144122 -976.7192877 -973.6777142 -922.5625156 -1037.455459 -986.4756908 -929.2441843 -965.8494846 -945.992777 -909.3794243 -928.4660312 -913.9765165 -890.6714815 828.6120387 841.2903847 839.1384591 856.6250891 874.7035153 868.7768508 896.0465327 932.2438298 912.023454 934.3407199 950.7396143 939.8765617 1013.830098 1040.249691 1019.228879 1140.958563 1182.738985 1138.863474 1338.858283 1403.204743 1301.958905 550.038505 244.2625292 256.4567577 -1462.458925 -1433.581454 -1289.063535 -1337.661441 -1305.693161 -1220.942243 -1216.458111 -1189.141571 -1135.77039 -1185.854016 -1098.601459 -1044.053949 -1052.420573 -1013.189589 -981.1920017 -981.0554723 -955.3953564 -934.0798954 824.0559925 838.6425653 841.0594116 856.3873881 877.334638 877.6769341 902.1807649 941.7254446 936.3724742 958.1295254 979.6470208 974.9754693 1063.574684 1099.36351 1089.685259 1237.65325 1296.252157 1279.735477 -3099.341633 -2907.15887 -2670.173429 -2172.253052 -2017.097522 -1881.545687 -1694.575383 -1616.673968 -1545.761844 -1431.092892 -1380.061979 -1337.12923 -1292.863241 -1179.899405 -1144.80233 -1113.573889 -1059.661908 -1039.911738 -1015.576682 -980.8911043 -968.4393458 810.648066 825.8460179 833.4980239 844.3015523 865.9830987 873.4646623 891.5810584 929.6397694 940.5816298 958.7714601 982.1282499 984.3026469 1070.837621 1107.414809 1110.518548 1240.021575 1291.48673 1301.563974 -4238.054029 -3938.307692 -3903.318439 -2547.750526 -2330.243886 -2291.858001 -1888.454547 -1785.472368 -1761.766518 -1547.097341 -1483.10982 -1467.883492 -1324.222496 -1209.052521 -1202.049885 -1133.691439 -1072.677852 -1070.938419 -1023.115812 -983.760375 -983.130996 788.0602674 802.5893167 815.4720874 820.1286817 840.5487425 854.9606505 864.4659851 897.3307503 923.2272197 935.4160181 957.5994175 965.9766093 1039.008727 1071.157761 1083.44773 1179.858402 1218.509638 1240.249825 -3769.773327 -3569.507903 -3660.500265 -2410.990323 -2231.03659 -2288.983271 -1845.284776 -1751.413296 -1776.890979 -1528.923711 -1467.879574 -1478.93932 -1274.213234 -1176.331505 -1200.239412 -1105.030035 -1046.838611 -1064.54141 -998.9661359 -960.5522807 -973.2277506 757.0824429 769.7182072 787.2923188 784.9716333 802.551572 822.9859425 822.9708678 848.3523596 886.4281797 891.8371419 911.0479703 924.4567602 979.3830627 1005.432632 1024.003336 1089.724223 1118.409712 1144.995954 -2773.850081 -2675.241973 -2793.820919 -1967.414587 -1861.479435 -1968.698192 -1616.233992 -1551.717792 -1612.943299 -1392.141801 -1346.283087 -1385.061365 -1156.138327 -1089.761016 -1138.791729 -1033.019335 -985.7728059 -1020.206471 -945.8992382 -913.2180925 -937.840685 719.7507986 728.669611 750.1985107 740.699591 754.3711335 779.577245 770.0523957 787.0107585 833.942116 832.6061001 847.80471 864.8767942 900.5002555 920.057731 942.875274 982.0856174 1003.103799 1033.308498 -1777.690143 -1757.083512 -1864.085223 -1433.088568 -1395.47927 -1513.304105 -1295.406523 -1265.943254 -1340.860079 -1184.753046 -1158.842129 -1209.276477 -1000.920262 -968.2360879 -1032.018583 -931.7909402 -899.6296819 -945.0580037 -871.3130986 -848.1988405 -881.1417248 674.4409081 680.7756639 705.3050457 689.4343259 698.7252624 727.2727905 708.725642 717.5387992 770.3048303 762.7278019 773.3112098 792.5690972 808.6958498 821.2664976 846.9695944 859.7091363 872.4747842 906.6018879 1034.279042 1041.401705 1052.371439 -671.1971839 -697.0293763 -784.342942 -809.6109606 -859.1309025 -1014.45869 -943.1455693 -955.6453306 -1058.794411 -969.5812262 -969.5097361 -1040.405699 -955.9029818 -948.7368902 -1001.155641 -836.8490269 -835.0986565 -901.3124143 -818.5383053 -800.9298488 -851.1167145 -784.4196486 -771.5158209 -809.3095663 625.7017127 629.7966106 655.9708611 634.8627994 640.0407168 670.1934417 644.9823085 643.3336823 699.951663 686.554729 692.3068301 713.4819606 709.9011147 715.2083953 742.8144389 727.3133124 729.5586966 766.5817495 267.7089671 152.5309711 119.3763675 -332.6542485 -416.0680035 -499.8429796 -582.053285 -618.7217221 -691.2390179 -695.3828081 -712.8141354 -770.8144166 -747.5047813 -754.1287861 -800.8716866 -687.241268 -707.6770612 -770.2654413 -705.3236279 -700.3802948 -750.3206211 -694.1712185 -688.3531486 -728.7057025 575.1365429 576.4015316 603.3589628 577.7429384 578.6784037 609.2717607 578.9315377 569.0415012 624.7814346 607.2935587 608.3382232 629.0467997 608.8663637 607.2772815 633.6290149 596.5298769 589.354992 622.5657056 553.5639737 535.7305971 579.0899768 446.1269543 428.9871998 482.0318042 193.7028998 99.08864122 98.6420364 -142.904819 -208.6925725 -246.9829897 -363.2411199 -402.7811752 -446.9985963 -496.5357083 -521.1625139 -562.9386413 -578.7797779 -592.9071212 -629.6165733 -561.7165415 -594.0640704 -648.7394391 -601.3748394 -605.9554547 -652.0942129 -607.9777515 -608.4287168 -647.8990205 524.4149809 523.2426242 549.9221252 521.4657588 518.8088747 548.469285 515.2941672 499.4391619 551.2408311 531.2632249 528.5847313 547.7703129 517.1428327 511.4909248 534.3850965 485.7722347 473.5186781 499.8750843 422.7026274 400.7599652 429.2172295 309.4408513 279.5929021 307.9596367 146.1900909 89.99117866 92.27363692 -63.0025394 -110.1304058 -128.5789553 -234.2235931 -269.93085 -297.3084299 -362.0026227 -387.9302441 -416.8507205 -452.1137012 -469.1475629 -496.8140545 -460.9411517 -497.8074453 -543.8204902 -510.8075528 -521.2423653 -562.3003087 -528.7328696 -533.8613316 -570.6870413 475.0501925 471.7579782 497.4433362 467.4805439 461.9965212 489.9184504 455.6418865 436.2425399 483.1606699 462.3718118 457.1664273 474.177002 437.5224666 429.2184645 448.2987243 396.9830781 383.3321996 403.5362077 332.3740678 312.5247369 331.4663219 240.0516055 210.3705757 223.0760566 119.6684718 82.10654596 84.34722797 -26.46216328 -61.64043923 -70.70988601 -160.1230176 -190.2413023 -206.4026038 -271.704882 -295.769782 -315.4495106 -358.0599513 -375.4056639 -396.5666627 -379.8677868 -417.120451 -455.6648201 -433.2218683 -446.9940532 -482.8382783 -457.7749057 -466.0172275 -499.3426932 427.8826131 423.0215103 447.2156191 416.9475498 409.488741 435.1581408 401.1761912 379.9734949 421.647695 401.2510658 394.6819985 409.4913557 370.9841279 361.5812181 377.278035 327.8525424 314.539139 330.1726505 267.9451237 250.548491 264.3682344 190.5976065 170.7349899 179.6698984 99.51010247 71.56615096 74.45104325 -11.78429592 -39.2388255 -43.13724151 -118.5595162 -143.5798746 -152.9962222 -212.9373268 -233.8019739 -247.2090658 -289.0078463 -304.9967655 -320.7349459 -316.1571642 -350.7605803 -382.192022 -368.2305639 -383.3751575 -413.8990929 -395.777929 -405.6718698 -435.162408 383.594362 377.6765445 400.1119073 370.4377207 361.7693303 385.0203907 352.3221107 330.671562 367.1308924 347.8230825 340.6318027 353.3832892 315.5201495 305.8722021 318.8017366 272.7220783 260.2114162 272.6498732 218.3844684 203.2344867 213.998037 154.3795736 135.4280932 143.7395798 79.6037248 56.89043031 60.66242469 -8.919123581 -30.95114335 -32.25032804 -94.99793735 -115.3588212 -121.4109756 -172.4205625 -189.9374951 -199.6429057 -237.5887909 -251.8125748 -263.8115962 -265.6003646 -297.0103624 -322.474302 -314.3686574 -329.4239286 -355.3066394 -342.2122919 -352.6830621 -378.5623021 342.5350293 335.999086 356.5717664 328.130003 318.863726 339.7199218 308.8161927 287.7753645 319.5000805 301.6163796 294.2914582 305.2068665 269.3330422 259.9732176 270.6380889 228.6472333 217.1358526 226.9896408 179.7804668 166.5144869 174.8489933 123.2292095 108.964506 115.0086565 61.39004857 43.65379653 46.51025969 -9.437014773 -27.14874547 -27.99100456 -78.89556866 -95.50256893 -99.91353394 -142.6940266 -157.421628 -164.7297703 -198.2346432 -210.6681282 -220.0384373 -225.0181889 -253.1335871 -274.0213443 -269.3690826 -283.6434254 -305.6171627 -296.089 -306.448444 -329.0617903 304.8084423 298.010765 316.7363223 289.934751 280.5757126 299.164147 270.3588884 250.4853764 278.0997515 261.754979 254.6182424 263.9701379 230.745383 221.9562415 230.8166926 193.113211 182.7207447 190.6437138 149.6539273 137.971079 144.4636165 100.6372182 88.67129293 93.24496215 48.65419115 34.11606287 36.25055673 -9.678689384 -24.21769807 -24.89712507 -66.81440819 -80.55854219 -83.94586388 -119.9602188 -132.3933871 -138.0964868 -167.2939008 -178.0795055 -185.5698197 -191.8841329 -216.7115611 -234.0961194 -231.4989241 -244.6795418 -263.4023068 -256.3571278 -266.1957982 -285.9149892 270.345454 263.5701955 280.5377162 255.5983143 246.4914293 263.035896 236.4713662 218.0306326 242.1066352 227.3173519 220.5635223 228.6029553 198.2903375 190.2053798 197.6313143 164.072852 154.8052241 161.2683137 125.6746151 115.4298724 120.6029465 83.433497 73.00312943 76.56558223 39.10383057 26.94296951 28.5545877 -9.635415598 -21.74248375 -22.330791 -57.28162604 -68.78531034 -71.49499131 -101.951842 -112.4955349 -117.0811827 -142.3611911 -151.6853147 -157.8013872 -164.4003726 -186.1727986 -200.7925418 -199.418555 -211.3511025 -227.3916701 -222.0428799 -231.1373574 -248.3460605 238.9899744 232.4402903 247.7747255 224.7881442 216.1546995 230.881373 206.5974786 189.6883633 210.7526734 197.4553969 191.1930032 198.1412191 170.7684379 163.4362334 169.7203471 140.0267342 131.8293375 137.1786633 106.2278115 97.26319801 101.4606021 69.85475096 60.65332716 63.48435807 31.7853119 21.47924501 22.71298761 -9.352156745 -19.53850257 -20.07002899 -49.46860641 -59.17578854 -61.41361289 -87.26793723 -96.24342465 -100.0240236 -121.8301573 -129.8769727 -134.96652 -141.2698772 -160.2770224 -172.7083999 -172.00878 -182.6634584 -196.4936505 -192.2885361 -200.5363344 -215.586719 210.5189645 204.3342204 218.1835217 197.1456003 189.1213562 202.2515428 180.2303392 164.8358021 183.3337785 171.4326054 165.7151925 171.7562835 147.2286678 140.6508706 146.0190264 119.8626401 112.6485227 117.1380675 90.20366279 82.37766652 85.83842657 58.84754138 50.74257434 53.02761988 26.06352992 17.26141392 18.21874696 -8.886301349 -17.51597442 -18.00746012 -42.87989306 -51.11603493 -53.00980149 -75.01105397 -82.67178559 -85.85281852 -104.6094614 -111.5450697 -115.8491183 -121.5540138 -138.0930742 -148.7697522 -148.3972231 -157.8125881 -169.8134754 -166.3692767 -173.7438324 -186.9461645 184.6781677 178.9465815 191.4645289 172.310385 164.9552317 176.7033091 156.8394004 142.9483703 159.2553935 148.6434461 143.4848556 148.7680381 126.9255895 121.0776582 125.7054167 102.746734 96.4232577 100.2395644 76.80911513 69.99332789 72.88870022 49.75403732 42.67008829 44.54207354 21.50866809 13.96471693 14.71642264 -8.291033743 -15.63150074 -16.09109052 -37.20400835 -44.21395718 -45.84697274 -64.58587079 -71.13258384 -73.85413693 -89.94034444 -95.90906161 -99.59924605 -104.5568769 -118.9076127 -128.1631908 -127.8952067 -136.1453321 -146.6269336 -143.6759843 -150.1953578 -161.8214207 161.2065684 155.9785795 167.3123614 149.9468263 143.2931436 153.8313008 135.9823674 123.5559484 138.0174021 128.5695135 123.9627689 128.6144712 109.2653939 104.1090028 108.1350304 88.04806577 82.53047099 85.81270937 65.46081322 59.54469235 62.00012374 42.12278811 35.99721459 37.55402907 17.82261409 11.35779778 11.95491945 -7.610438379 -13.8635803 -14.29533075 -32.23460363 -38.20649494 -39.63549366 -55.58123702 -61.17398391 -63.53478823 -77.27805921 -82.40287959 -85.60459707 -89.75543374 -102.1695038 -110.2616933 -109.957681 -117.1315651 -126.3447427 -123.7005016 -129.4071103 -139.689899 139.8441028 135.1450718 145.4373002 129.7411809 123.8005115 133.2946231 117.2959613 106.2607615 119.1704697 110.7715676 106.6981347 110.8238008 93.77229722 89.26329909 92.79833953 75.28712577 70.50055414 73.35476947 55.72389638 50.61263799 52.72226517 35.63098671 30.39419638 31.70923256 14.79564498 9.272131924 9.752160227 -6.879184768 -12.20100622 -12.60720818 -27.82922272 -32.91030807 -34.17568223 -47.70430062 -52.47182305 -54.54395671 -66.22255658 -70.60736785 -73.41486058 -76.74418539 -87.44422702 -94.57867529 -94.14617481 -100.3356712 -108.4888056 -106.0154497 -110.9633411 -120.1060784 120.3374476 116.1758244 125.5601347 111.4040942 106.1742654 114.7709088 100.4739918 90.72030827 102.33024 94.87374283 91.31106821 94.99930504 80.05870359 76.15249291 79.2856269 64.09089995 59.97011213 62.47880088 47.26916482 42.88281918 44.71687005 30.04573922 25.61574257 26.74375801 12.27448538 7.581902352 7.973020952 -6.123525379 -10.63659335 -11.01878989 -23.8838745 -28.19087444 -29.32263228 -40.73705335 -44.78348827 -46.62141505 -56.46884077 -60.20077106 -62.68688538 -65.20270608 -74.38208421 -80.72423168 -80.1020066 -85.39507628 -92.66116733 -90.25866593 -94.50533026 -102.6832735 102.4445584 98.81714404 107.4196062 94.66902933 90.13008439 97.97059039 85.24056857 76.66333845 87.16728174 80.56555362 77.48851238 80.8117148 67.81036424 64.46429167 67.26784102 54.16429884 50.65230507 52.88161869 39.83830902 36.10978868 37.72533881 25.18424731 21.48088858 22.46251014 10.14517934 6.191850905 6.515553777 -5.362919678 -9.164876172 -9.524411602 -20.31986447 -23.9461944 -24.96759098 -34.51267489 -37.92258843 -39.56893398 -47.77913153 -50.93084034 -53.15369309 -54.87120891 -62.69723696 -68.38318092 -67.52823127 -72.00503358 -78.53027425 -76.12076286 -79.72198956 -87.08892762 85.93763649 82.83094743 90.76934506 79.29081406 75.41266172 82.61930112 71.32091262 63.84671854 73.42092918 67.5870989 64.96970034 67.98941318 56.76740158 53.94177428 56.47562703 45.26753529 42.31481223 44.31835994 33.22603878 30.0972541 31.53768505 20.89863712 17.85058149 18.71745556 8.31982294 5.028594124 5.301524555 -4.611245359 -7.780335701 -8.118633958 -17.07429208 -20.09496629 -21.02479606 -28.8979271 -31.73984852 -33.22910751 -39.96038093 -42.59145516 -44.59909023 -45.52409313 -52.1556302 -57.29552812 -56.17546829 -59.90452361 -65.81471055 -63.33385185 -66.34203363 -73.0317222 70.59811185 67.99454032 75.38084038 65.04582255 61.79362107 68.47900585 58.45429397 52.07450775 60.86157034 55.72016825 53.53466537 56.30205835 46.71225125 44.37090791 46.68503522 37.20403816 34.76853503 36.59019638 27.27062521 24.69507171 25.9960607 17.07257088 14.61242032 15.39056733 6.72876777 4.034992854 4.270154271 -3.878240801 -6.477194917 -6.795696491 -14.09560066 -16.57093183 -17.42450263 -23.78484633 -26.11432484 -27.47428185 -32.85537542 -35.01379327 -36.84456494 -36.99430516 -42.59221942 -47.2644719 -45.82539575 -48.86525962 -54.27179156 -51.66122849 -54.12076785 -60.26032008 56.23238135 54.10442781 61.03762254 51.72878528 49.08663386 55.33355892 46.39043721 41.09996091 49.30600716 44.7610511 42.98163676 45.54841419 37.4522433 35.56395337 37.70360091 29.80435775 27.85101564 29.52954985 21.83319474 19.76947194 20.96261999 13.60510849 11.67456458 12.385297 5.314658767 3.165266054 3.373248613 -3.170267773 -5.248922926 -5.549356561 -11.33927652 -13.31740803 -14.1082654 -19.08251678 -20.94471508 -22.19940818 -26.33658203 -28.06405947 -29.74907768 -29.15878022 -33.76517429 -38.10397647 -36.25988132 -38.68075711 -43.68345599 -40.89634829 -42.86320969 -48.53196952 42.55525512 40.92933912 47.53919925 39.14110851 37.1148647 43.02216355 35.04295648 30.76158756 38.50280423 34.50472236 33.11383883 35.52503751 28.81358703 27.3532789 29.35831186 22.91900015 21.41902289 22.98866758 16.79114075 15.20550176 16.31836502 10.40932438 8.959522504 9.621210277 4.029229992 2.382159274 2.571573047 -2.490927842 -4.088049734 -4.372393541 -8.765233477 -10.28377805 -11.0241575 -14.71018348 -16.14082515 -17.31217377 -20.28827091 -21.61955992 -23.1904864 -21.82190123 -25.44263958 -29.53535317 -27.32941351 -29.16763462 -33.8560755 -30.81138789 -32.28925129 -37.69986273 29.49542202 28.39432939 34.66738045 27.12911584 25.69214854 31.3414382 24.2226357 20.90224371 28.29604234 24.78912414 23.77136955 26.06542875 20.64574535 19.59248864 21.49787951 16.41511335 15.34456989 16.83626708 12.03366454 10.89931116 11.95708308 7.407328043 6.400513111 7.028994812 2.831823003 1.655395207 1.833233487 -1.841084736 -2.985803566 -3.256423255 -6.336085758 -7.42332042 -8.124659683 -10.59350368 -11.61909355 -12.72737915 -14.59753865 -15.55580261 -17.0419563 -14.86975225 -17.59631442 -21.47028468 -18.90776256 -20.18559453 -24.62163733 -21.32498338 -22.30790736 -27.35499336 17.09491318 16.28185662 22.356888 15.54328739 14.70388572 20.12425109 13.82368417 11.3691493 18.52950372 15.46279055 14.80906192 17.02093963 12.81689239 12.15281748 13.98873395 10.17020712 9.507424031 10.95095042 7.45450339 6.751720457 7.77943045 4.525577949 3.937396672 4.547296943 1.688860437 0.9610646739 1.132648438 -1.218642768 -1.931494065 -2.191209718 -4.015895245 -4.691892862 -5.364929685 -6.664104275 -7.303109033 -8.366646763 -9.164102071 -9.765171796 -11.19275744 -8.173198898 -10.09955109 -13.78895732 -10.86304013 -11.59225205 -15.8340242 -12.24098903 -12.93264223 -17.56712567 6.241132881 5.703368935 10.13357417 5.287815493 4.938574664 9.081420541 4.560098016 2.6219622 9.048630433 6.406331971 6.119512207 8.26129266 5.237685343 4.945394581 6.719368186 4.076937618 3.789119814 5.208261874 2.91805511 2.640340164 3.681243537 1.702037448 1.52876426 2.114956335 0.5696868189 0.2716767237 0.4550512027 -0.6305859994 -0.9236241248 -1.16218993 -1.779665127 -2.057415999 -2.700814912 -2.869584049 -3.133633477 -4.158195306 -3.906846212 -4.158560797 -5.540663611 -2.101249949 -3.520204073 -6.291774338 -3.798856564 -4.069906834 -7.238005853 -4.409985068 -4.852203711 -8.053467141 1063.127067 1073.671754 1065.743374 -1207.058282 -1195.839577 -1077.867855 855.7971482 875.0107325 867.3789272 283.1197408 379.3811352 412.9301252 -760.0081736 -714.4890952 -718.9448731 -964.9082437 -858.6671494 -888.717515 2149.130063 2071.671491 1954.575454 916.9073653 1048.619271 825.3400937 -3843.97078 -3757.369256 -4062.80444 1537.786683 1520.728964 1495.823887 1694.998323 1662.863357 1693.001725 -3741.770613 -3812.241314 -4052.381638 1354.404087 1344.087475 1325.145943 1471.846359 1448.721191 1462.446288 -2911.660787 -3028.583417 -3160.031996 1215.635958 1203.936279 1187.028101 1306.779466 1288.952595 1299.040489 1313.750613 1310.949107 1308.094437 1070.8581 1058.141712 1037.463292 1169.904609 1152.521884 1164.894384 1195.644506 1191.482583 1186.992243 1247.071064 1243.299984 1246.809904 -1649.008955 -1655.691252 -1574.167934 876.7843483 866.6000859 839.9111546 1016.040449 993.8017406 1006.124504 969.6323414 982.4205393 974.6104611 -6056.554713 -6047.283285 -6210.25762 1574.490572 1567.559229 1554.936982 1650.185621 1634.7515 1639.055805 1569.18015 1575.051941 1570.905146 -5800.65755 -5678.426801 -5712.264964 -5099.597049 -5141.075291 -5231.26069 -6188.222605 -6043.498963 -6041.637016 -5743.164849 -5771.104439 -5900.139506 1552.779731 1556.745563 1563.112209 -3474.136611 -3562.824589 -3632.849225 -5083.331303 -5003.072456 -5046.470617 1259.277697 1255.160254 1251.492262 1304.643114 1301.814753 1304.845198 1182.724484 1178.349034 1183.066834 1116.863042 1123.756348 1133.025705 -1495.436872 -1415.524207 -1415.146937 936.4913155 943.1332802 956.5990103 1809.953858 1760.471134 1727.779654 1847.078886 1854.432432 1948.385125 2373.679745 2314.493531 2255.495836 2511.197577 2523.953505 2640.956119 1687.207785 1684.941195 1666.850468 1833.238441 1802.846356 1803.103723 -1984.032607 -2090.66793 -2142.206521 -226.3415853 -297.0893423 -248.0445998 1907.501732 1903.059413 1866.518338 2196.63115 2139.753695 2167.772052 -4048.863296 -3840.550581 -3509.406197 -2670.489169 -2631.356314 -2712.927254 -2167.0924 -2239.562849 -2264.198855 -3360.476892 -3299.656177 -3386.257446 -2794.699963 -2877.149575 -2923.24425 1433.378867 1583.539563 1266.36347 2917.257136 2825.257466 2679.29698 898.307902 468.7337836 468.9568523 -5101.387686 -4832.444155 -4415.848888 1215.416612 1212.025958 1215.868187 3164.158287 3088.96602 2998.52611 3341.865461 3352.352577 3501.362477 1614.401329 1620.793132 1617.283654 1600.692383 1602.984487 1608.52626 -5449.747263 -5484.137255 -5586.539512 -5459.642002 -5368.253887 -5402.810788 -5947.382034 -5958.990418 -6093.704961 -6023.826238 -5903.081948 -5916.861963 -3946.89936 -3896.543923 -3858.162374 -2915.155746 -2893.337913 -2941.860767 -2623.13084 -2666.110118 -2684.378817 -1214.403842 -1265.043107 -1263.972752 74.84515518 24.32028656 58.00725174 808.4410029 775.1843696 779.5144632 880.4992898 847.8699487 874.5132155 -1118.857992 -1117.042155 -1167.62946 -33.67180714 -90.82380207 -160.4493901 3781.836697 3664.474318 3518.626835 1331.796685 1328.326694 1330.172254 1342.058113 1338.411344 1335.64938 1226.628398 1222.921167 1219.51237 809.0939032 819.6355054 865.5317274 -5969.545481 -5934.329323 -6140.222702 -6177.41055 -6018.392516 -5985.433525 -4698.643466 -4746.189456 -4819.905565 -4657.130383 -4593.789251 -4642.205262 1277.008562 1273.730271 1276.963381 1287.926258 1284.357286 1281.02038 -2548.734768 -2534.005915 -2576.211007 194.2170314 160.4995096 114.1323829 562.8822761 535.276454 562.6257679 -2425.087907 -2178.024758 -2235.023221 -2025.754353 -2012.601476 -2085.023629 -1682.177353 -1705.150249 -1572.909389 -1622.614035 -1950.362031 -1972.736717 -3168.461459 -2825.720968 -2879.974638 -1965.255754 -1984.210662 -1901.203539 -4427.17078 -4638.275808 -4381.769176 -3974.972811 -3600.153093 -3575.075964 737.1643808 730.4350864 738.7881224 710.0187582 720.6559474 728.0166507 709.6404518 714.7014201 703.359062 693.4792505 684.2753381 697.6532514 652.2166695 668.8375024 678.7490096 654.189617 660.9011165 643.4572373 624.3880969 612.772737 633.1725913 564.7775484 589.5637475 601.5881288 571.9410096 579.9507731 554.4455873 517.9247558 506.8148493 536.6971166 438.0031686 473.3085971 483.5954902 456.5287295 464.4060195 429.2213318 364.5992622 358.6414764 399.0171486 270.6457178 314.9931136 319.5512099 306.105741 310.8278445 266.7565402 178.6644431 176.7878621 223.6866115 81.36677471 128.728869 129.0870456 127.7523791 128.6267915 80.14022614 -22.89798923 -17.73096858 31.17847705 -115.8511003 -67.63219099 -73.48919262 -61.86661275 -63.92930692 -112.6262454 -218.7359968 -210.6833384 -164.4109568 -299.5814587 -256.5634117 -265.2703604 -244.481516 -249.3611641 -292.6626198 -391.532281 -380.5186825 -341.6844711 -452.2889678 -418.0356021 -429.4143073 -401.9822366 -408.4972663 -443.4061024 -526.672232 -514.9890654 -485.2037661 -568.9071272 -543.4155094 -554.7757575 -527.7760505 -534.088083 -560.4071501 772.884992 762.6751905 768.3684389 748.2649656 755.9876212 767.1925105 736.3997012 745.7151185 737.0772615 743.2720552 728.9746852 739.2890039 702.7300953 716.8922052 731.9745595 690.1338937 702.8808465 688.1583613 683.3686203 666.6886233 686.0414915 618.4886875 644.222082 661.0781134 614.7966103 628.9099682 603.4269966 572.2176725 556.1392745 589.0949036 478.1340069 519.2349272 534.6543556 494.2847722 505.9135276 466.2911663 395.0118643 385.1134935 432.9609768 281.3866101 334.843667 340.942752 323.576493 328.8684259 280.0940258 163.2453482 169.0790596 225.5481381 53.9026462 111.678837 101.8133885 124.5116717 119.3848401 64.93471503 -78.94222988 -59.33252744 -3.351844194 -166.5386666 -113.9011277 -135.6777496 -83.03934948 -96.47073491 -147.7192051 -290.6685999 -265.7102053 -217.24382 -356.3055254 -312.1246179 -337.1007978 -276.6269256 -292.0356867 -336.540882 -461.4882491 -438.6214316 -398.531135 -511.8678656 -476.6150147 -498.4821902 -442.6783135 -458.2420706 -493.5508904 -594.3095799 -573.8202247 -544.3172815 -625.1197629 -600.7431295 -620.7841573 -568.0101124 -583.2457584 -607.9396139 820.9004272 807.8904999 809.4324013 802.6200231 805.7133104 819.9532656 779.2698362 792.1429554 787.8091833 811.0266525 792.363958 798.2702769 774.3995709 784.5181365 804.936064 748.190294 765.6579557 754.0952857 771.2474239 745.3759095 761.5058236 701.122526 725.4399854 752.9555489 679.9265677 701.2363011 676.0985211 666.6111341 636.8388292 671.783362 548.3930041 595.6369631 624.4686284 552.283897 572.254294 528.4288433 454.6897545 436.6389303 496.7542466 293.1994659 367.2720562 382.3923966 347.5320623 356.0579699 288.5627574 126.1577205 137.2489234 215.8130677 -20.02512476 57.69466539 38.04265226 89.60727997 74.68349317 3.535954164 -205.3946657 -165.4856533 -94.79499871 -292.0906505 -231.3707733 -275.2947519 -162.1954638 -193.9068536 -252.2164664 -446.4804244 -398.2416962 -347.6532105 -486.1168018 -444.2445842 -491.9842753 -367.2116792 -402.8012963 -445.5162224 -603.959316 -559.3657516 -524.3709189 -622.4982709 -592.1426168 -634.2961581 -524.6667463 -555.6757502 -587.8530554 -707.6085297 -674.8115935 -650.2354741 -715.8441729 -696.6718858 -726.9862841 -643.6134895 -669.0265859 -690.0205067 875.3032686 861.5232396 857.3633325 869.318222 865.5780499 881.2494936 834.8534807 850.0870704 851.8439188 898.7617551 875.493209 872.6512612 876.2948958 876.6944798 903.7166094 827.021301 850.9660047 847.4095645 908.4387319 868.4965694 873.8653888 845.0830328 859.3117288 903.9383573 784.1894251 819.508228 801.3841989 854.697897 794.9734879 824.25281 702.8081965 755.1533946 818.4172569 659.8931514 702.9531634 650.4624007 610.6670871 552.2919348 635.728145 339.613535 452.0504376 499.8059569 399.0000204 419.2974174 323.5348139 72.83709224 87.74989173 219.1745009 -163.3413549 -41.28916557 -77.48892886 15.33775115 -10.88935561 -118.0471111 -452.3648076 -373.2449796 -274.7805236 -530.4161538 -458.2909672 -542.0910601 -326.6284582 -386.9345323 -455.98417 -724.6431519 -640.9047973 -590.3998379 -718.5423824 -683.4224937 -763.5402577 -546.7615942 -610.513945 -649.2350847 -833.4028996 -769.1024275 -746.7072874 -803.169305 -787.6100562 -847.2747364 -681.5832097 -732.4813645 -752.0735403 -873.5217192 -827.2408878 -816.2159897 -844.4120668 -836.5532534 -878.757248 -760.420238 -797.0296444 -808.4755484 928.0921579 915.7189028 904.5595644 941.4766345 927.9552545 942.6505303 896.9665006 912.5764084 923.5457966 996.1320369 972.0933927 956.2002605 1007.028082 989.0901504 1017.507537 931.5646935 960.1878753 973.0427304 1092.209612 1044.509266 1025.68435 1079.526442 1063.003295 1119.930209 953.3395311 1007.207024 1013.321015 1197.513237 1097.171399 1091.496316 1070.093024 1092.044484 1211.992166 894.8229237 985.7826533 948.5938556 1106.002709 927.8575474 1020.024456 565.1466134 777.517301 1054.873643 565.1594076 655.2040234 477.8223612 -147.0627826 18.62090362 305.6182039 -488.4758347 -255.4609911 -377.2766532 -121.9883698 -178.4458297 -374.3969671 -983.6318712 -804.4411146 -670.1695077 -965.9853936 -900.3889855 -1069.577382 -639.9181007 -757.5947753 -830.7183031 -1157.050726 -1033.572157 -1008.101943 -1055.211464 -1047.606462 -1157.748619 -850.5933193 -945.0729972 -961.066677 -1136.003176 -1053.496569 -1055.903047 -1043.328049 -1049.636444 -1123.743221 -911.1808518 -979.0024506 -978.0551163 -1081.613135 -1027.174013 -1035.728331 -1008.591759 -1018.079082 -1066.817104 -923.3337776 -969.861114 -965.3641086 968.4514941 960.3698148 942.3579404 1004.089209 980.9315758 990.6461407 956.4549901 969.381629 990.3094658 1076.35232 1059.693588 1030.203981 1130.67996 1093.027851 1112.821146 1044.945742 1069.940497 1103.47644 1254.502178 1221.661778 1173.272067 1339.139878 1276.536683 1315.574582 1176.174622 1229.268671 1281.274207 1564.018669 1493.363901 1410.490657 1715.358891 1593.951376 1687.157856 1343.400682 1474.66119 1548.34218 1562.587528 1579.271421 1736.953389 129.9575601 210.8018894 601.0325766 -489.1209417 -165.4719093 -334.3015309 4.325676467 -62.93444465 -337.327155 -1735.812365 -1584.886484 -1642.050371 -1479.769845 -1530.59839 -1656.626412 -1276.794794 -1402.35433 -1370.21877 -1469.343656 -1388.784308 -1432.573215 -1310.189776 -1348.130754 -1419.023455 -1199.69295 -1274.767674 -1244.996255 -1290.698757 -1241.053362 -1274.613055 -1179.189024 -1209.295067 -1253.474243 -1115.269491 -1163.003396 -1138.000339 984.4830314 983.1408247 960.757271 1037.338547 1008.558966 1010.404804 998.5062474 1004.16872 1031.992305 1109.90406 1106.619661 1069.883988 1194.559155 1148.005341 1151.487785 1128.582142 1139.902261 1185.77329 1306.671646 1305.127997 1246.789631 1442.917095 1370.448115 1369.017522 1344.715334 1362.645385 1437.763341 -3325.685158 -3126.918047 -3356.617725 -2760.224787 -2931.616436 -3107.662717 -2225.598163 -2133.94454 -2315.232812 -1865.572941 -1987.013722 -2063.460016 -1777.73489 -1890.353226 -1784.521213 -1723.802469 -1675.691858 -1763.360436 -1531.370259 -1599.20795 -1641.333295 -1485.951399 -1548.084432 -1486.740458 -1444.005078 -1414.697919 -1470.304092 -1316.013554 -1363.533933 -1389.685032 -1294.897469 -1332.388189 -1287.972899 972.9067585 978.2936848 955.0318016 1033.531132 1004.384392 998.6699382 1010.689416 1008.430155 1037.918044 1093.715895 1101.718627 1065.927694 1183.540684 1140.965155 1131.491339 1151.57678 1147.799338 1192.032205 1260.073134 1277.385122 1229.161769 1378.56148 1327.469822 1305.992563 1360.242038 1345.919563 1402.611029 -3941.064933 -3950.112074 -4241.203412 -3449.732964 -3687.450036 -3688.027608 -3632.958082 -3672.9237 -3442.008589 -2326.478642 -2341.13508 -2556.509341 -2020.676152 -2165.741389 -2156.079011 -2120.242949 -2154.256233 -2009.494631 -1789.145215 -1795.595124 -1899.16208 -1626.329978 -1705.800326 -1699.737145 -1675.062451 -1696.275389 -1617.578376 -1487.498058 -1490.386992 -1555.096103 -1375.79683 -1430.943505 -1428.943819 -1410.767272 -1424.341236 -1369.883406 936.7588837 947.8383914 926.2625356 997.8605584 971.688028 959.7425585 991.2394451 982.2133131 1009.338821 1041.269134 1057.047428 1026.348682 1124.020884 1089.728174 1072.161889 1119.598634 1105.600858 1142.002716 1170.647574 1195.222977 1159.402797 1264.928763 1230.674197 1203.34458 1282.325366 1257.086038 1294.685157 1495.480369 1489.340789 1478.125846 1514.860218 1503.287158 1508.201445 -3365.786501 -3470.674078 -3655.862854 -3131.360239 -3296.489144 -3205.039432 -3460.035498 -3382.954948 -3214.993357 -2068.088547 -2156.513397 -2318.876984 -1903.215645 -2019.614234 -1945.450929 -2127.345725 -2080.737479 -1953.671797 -1667.840421 -1715.300383 -1803.257894 -1568.26868 -1637.46439 -1596.434091 -1688.862442 -1669.010227 -1595.490652 -1418.844899 -1447.076675 -1505.254815 -1341.730872 -1392.787914 -1367.859565 -1421.618617 -1411.299635 -1358.458649 881.2676162 896.5767279 878.3020093 938.0812015 916.5176053 900.0961484 946.4915161 932.066444 954.8723931 964.853381 985.6284786 961.1737888 1037.537465 1011.193567 988.6427429 1053.108597 1032.759815 1061.006086 1062.582247 1090.9284 1064.261339 1142.323384 1117.090719 1086.916373 1175.26559 1146.518449 1173.521702 1327.697572 1321.969742 1314.262056 1339.332515 1331.209508 1336.227166 -2438.342505 -2556.801958 -2645.535905 -1631.307098 -1748.330537 -1835.930249 -1602.65467 -1671.131697 -1568.534322 -1860.990559 -1769.204751 -1688.154678 -1414.863776 -1486.295522 -1541.489651 -1389.169985 -1436.008173 -1372.153503 -1548.260277 -1494.025986 -1441.110143 -1258.299763 -1303.824229 -1345.011093 -1226.62586 -1264.494828 -1223.365568 -1337.711705 -1302.841161 -1261.326571 811.7555203 829.9255113 815.7293829 861.415944 845.2030573 825.7124475 882.5407177 864.2613484 881.8494184 872.1755826 896.4124557 878.5371743 933.7417223 914.8777561 888.7734857 964.9198482 940.327825 961.083252 939.801559 971.9248883 952.8131365 1009.842043 990.9417917 956.8764351 1055.906188 1023.94327 1044.545673 1201.369621 1193.628574 1185.97128 1210.261628 1202.812365 1209.679582 -1166.827371 -1279.354295 -1302.600264 -1233.63111 -1256.17782 -1154.975006 -1464.710767 -1359.848108 -1326.642006 -1114.507305 -1190.333924 -1211.607052 -1148.703935 -1169.46663 -1100.250497 -1305.537588 -1238.015896 -1211.040548 -1053.865757 -1106.971908 -1127.935553 -1063.667875 -1085.602194 -1036.999642 -1178.936716 -1132.999947 -1106.947511 733.1163302 753.2483971 743.8603602 773.5718529 763.2329378 741.7467583 805.1040445 784.5992517 796.4274108 768.4940097 794.9246745 784.1746953 816.3372167 805.6888956 777.2549928 861.7091305 834.0170644 846.8269524 801.3965239 837.0139009 826.7974539 857.3348398 847.1455555 808.775465 921.5956776 885.1936007 897.9976563 1018.661475 1030.161846 1022.215859 1045.961838 1037.937864 1026.464753 1060.106269 1049.163041 1057.146654 -528.6708779 -611.5382592 -580.8469423 -668.5658404 -640.7211567 -561.3022693 -806.1039614 -722.3979035 -747.3799731 -601.4641729 -720.8290389 -654.5295214 -810.7017994 -773.303796 -662.2978281 -1036.9118 -898.5256134 -924.8319841 -771.5501152 -859.7729255 -838.6636929 -886.6955546 -875.2451042 -793.1844588 -1057.020813 -963.8944986 -969.0746487 -833.3137615 -900.6294838 -894.8089862 -903.3417756 -902.7272885 -840.75091 -1032.347521 -966.092861 -961.4306944 -848.0731725 -897.3497325 -900.9583736 -885.8710281 -892.558124 -846.1905382 -988.5379856 -940.1431642 -930.0359936 649.8972742 670.9379079 666.4612202 679.9208556 675.5064124 653.1548052 720.8528157 698.2834287 704.2043187 660.4042582 687.4630433 683.9750085 692.159762 690.234588 661.2479664 749.6042388 719.973798 724.0605897 656.9403411 692.3958082 693.0130995 688.1431291 691.074376 652.5434827 771.0551731 731.0665264 731.5504561 846.0924923 827.1449492 833.1844157 186.1546454 173.3195132 277.3971977 10.63396983 49.52505578 -42.46928471 -292.8649434 -348.2099834 -267.6577247 -469.1738054 -414.4176457 -357.0810412 -565.6755897 -483.1793499 -537.3485124 -497.0653477 -553.9961981 -515.2538108 -614.8082068 -586.801765 -531.1732816 -717.7925529 -649.0456515 -674.3783301 -608.7484257 -658.7458478 -638.5811312 -689.9309147 -675.8015781 -627.9385795 -781.994651 -727.1485539 -738.6253334 -668.6852416 -710.1514752 -701.2481268 -720.9680475 -716.7498967 -677.2336766 -801.4094803 -758.2998727 -760.1517479 567.6090958 587.7988469 587.7627099 586.4401248 587.4658578 566.2374633 631.1539934 609.2047134 609.3490916 557.893635 581.9615719 584.611313 573.5428852 578.5355652 553.0118392 632.5590972 604.8100555 601.57867 527.8736402 557.7104604 566.6099852 532.9627609 546.6004968 515.3319761 615.4682719 580.0450055 568.3593523 460.9219732 496.4320125 516.3111239 446.9253085 474.7008122 437.0872562 560.9088322 515.3668606 486.0986933 339.881781 377.9333941 400.231447 250.1650292 331.2303954 298.1160915 410.3222788 370.1542017 273.0084198 95.06796648 97.33318419 180.0250535 -50.12445391 21.91209482 29.36188875 -2.146079004 11.74839107 -69.41064691 -150.5696975 -176.9215929 -116.470678 -280.4887152 -231.514482 -201.483743 -308.5589197 -266.9947859 -318.2344209 -328.4422169 -363.4997919 -324.363676 -429.7242951 -398.4388421 -363.1283751 -481.7683794 -437.7637649 -468.8480569 -448.4247917 -483.0777684 -457.8207015 -525.7663762 -505.6890264 -471.4993103 -583.6778975 -542.9965381 -562.1799029 -526.5919919 -558.5826261 -543.3707365 -582.0775495 -571.4160115 -540.3308459 -639.8813778 -604.6002941 -614.0215484 491.7744526 509.9247713 513.3539126 501.3550799 505.9735027 487.1196675 545.528578 525.4386513 521.6875517 468.3497183 489.4260939 495.9038857 472.4751683 481.6993671 459.9177439 528.2822563 504.5216396 496.0282759 425.2610859 448.627654 461.5188342 416.3108382 433.6026649 410.0045774 486.1923389 459.0086142 442.0703739 352.2642697 375.233084 396.8175269 326.4292513 349.3776381 327.0317352 404.0211728 374.8054174 351.2194369 238.0300806 256.4125975 289.2307581 183.5724223 231.8834457 216.3667413 272.9302684 250.2533316 194.638863 86.4698976 88.35472866 138.2667385 -5.676691563 42.01527202 44.00570139 34.81133203 38.82334357 -13.45419784 -81.60254254 -94.62133873 -51.02714379 -175.0012205 -135.9918672 -120.3068923 -176.0507795 -154.4210995 -195.7658992 -224.8645244 -245.9253286 -211.6306302 -307.8492779 -277.9679861 -255.8040082 -331.3727412 -303.0427946 -333.6999477 -337.2506796 -361.3954761 -335.6578742 -406.6150966 -385.0616635 -360.661003 -440.2432532 -411.5424806 -432.9173105 -419.2656682 -443.4040796 -426.052229 -472.1854421 -458.7053396 -434.840663 -511.2477935 -484.0774853 -497.1085634 424.8369376 440.7200132 446.3794235 427.497661 434.4567419 418.1900988 468.9106196 451.3579567 444.8536739 393.7530814 411.0519266 419.7388964 390.3692758 401.3052593 383.7677038 439.2981802 419.7916841 409.0938116 346.7797879 364.4620675 378.1232574 332.6646554 349.317463 331.8364796 388.2147126 368.054637 351.0961777 279.1914073 295.1780661 314.4020161 251.571574 273.0305442 258.1551971 307.1304455 289.2500038 267.3466482 189.0601524 199.1826237 226.4606696 144.6500223 178.9869607 168.7246568 202.5956178 190.201165 153.1047416 77.10898015 79.69417166 114.3471024 12.30366408 46.34511278 45.94054881 45.45298518 46.23575123 9.413735793 -48.05125032 -54.15594423 -21.20127555 -117.3458271 -86.24663582 -78.31066897 -106.9940672 -95.73033987 -128.5948604 -163.772845 -176.1133907 -147.3312029 -229.8098939 -203.6257427 -190.1451018 -236.2121105 -218.9031312 -246.0691351 -261.86173 -277.975859 -254.6124465 -320.1003208 -299.8315832 -283.0329729 -338.4207893 -318.2184758 -339.0029872 -337.6338023 -355.8068647 -338.7396427 -385.541079 -371.3639051 -352.9972093 -412.2852506 -391.1007978 -405.2873388 366.6379152 380.3970049 387.1921004 364.9320694 372.9955879 359.0766545 402.5378984 387.4800797 379.5980427 332.3776172 346.6230335 356.158019 325.0636864 336.2789989 321.9953799 367.1219039 351.3105682 340.0918356 285.8463673 299.7902034 312.9162833 270.559901 285.6622808 272.0220279 315.4766243 300.1191633 284.6142418 225.435642 237.6037545 254.4225719 200.8542822 219.3622469 207.8822014 244.3757071 231.4992586 212.0790975 152.7722564 161.9005587 180.2296402 115.6221017 141.4174644 132.684142 159.1937718 150.1892355 122.1329594 64.41628448 68.0514422 94.77699935 15.69377263 42.44023467 40.42575914 44.90162596 43.72261023 15.94243712 -33.90725819 -36.20766183 -10.27083062 -86.94501668 -61.81199863 -58.18232121 -71.71544566 -66.2717472 -92.75525844 -128.0269916 -135.3371039 -111.4897098 -180.4501789 -158.3638128 -149.9093515 -178.2436231 -167.7233238 -190.881838 -210.1278884 -221.4805909 -201.5073289 -258.1044033 -240.3473637 -228.2537824 -267.6187723 -253.4319374 -271.8280245 -276.6239132 -290.3236483 -274.7577458 -318.303064 -304.8203859 -290.7725028 -335.8486914 -319.8208957 -333.5275587 316.5593348 328.3596148 335.633954 312.1596319 320.5470256 308.7213253 345.7053744 332.8693572 324.5092691 281.822745 293.5569112 303.1712155 272.3661097 283.2942248 271.65982 308.4280194 295.5379552 284.494187 237.4225343 248.4822858 260.7623741 221.9600999 235.5370165 224.7823506 259.1236165 246.9665382 233.0195348 183.7159977 193.1517335 207.7771583 161.0457848 177.5900638 168.8583438 197.0884653 186.9911801 170.2495053 121.33268 127.9301981 145.6966473 93.82825745 111.0697618 105.1817407 124.4927239 117.2846001 99.25481364 49.67701667 53.17973909 74.50844607 11.78596503 32.90408303 30.47536789 38.05838592 35.47981199 13.17129784 -28.88802163 -29.85651345 -9.033908767 -70.65926505 -50.42049553 -48.3457726 -55.23305706 -52.69593081 -74.08116615 -104.6626198 -109.794397 -90.47517819 -146.6885162 -128.5509208 -122.5100344 -142.183452 -135.0880896 -154.1249059 -172.5474199 -180.9292503 -164.1602201 -212.2577971 -196.9679725 -187.94016 -217.0496029 -206.6478817 -222.534199 -229.9846497 -240.5575163 -226.7886297 -265.8305715 -253.5657888 -242.6025747 -277.5902299 -265.2117857 -277.7860904 273.6898685 283.7896572 291.1042281 267.7725336 276.0196166 265.9790241 297.3710146 286.4774883 278.1633406 240.0892131 249.7993602 259.0357917 229.8061504 240.056491 230.5154117 260.5976896 250.0739073 239.6308484 198.9985403 207.8178897 219.0547049 184.0356035 196.1270514 187.6286918 214.6615704 205.1251567 192.6668213 151.3574858 158.6936454 171.5575813 130.8521786 145.3672506 138.4656263 160.5861979 152.7406118 137.6768783 98.11985848 103.3381778 116.875544 74.28683188 89.60491137 84.99761754 99.66720472 94.49360318 78.54214564 38.54864418 41.01507501 57.86796619 7.305185544 24.34098602 22.62650497 28.23591961 26.20016621 8.263275901 -25.60819722 -26.35651031 -9.52430697 -59.42394138 -42.99534897 -41.44206365 -46.43159939 -44.65369329 -61.92831714 -87.54870843 -91.39166453 -75.57157902 -121.8751791 -106.83947 -102.2927281 -116.9091783 -111.6996141 -127.4428434 -144.1454018 -150.5744315 -136.4634137 -177.270742 -164.1833954 -157.2096071 -179.5024184 -171.5998419 -185.2088329 -193.4739436 -201.8274367 -189.8222 -224.1867696 -213.2797194 -204.5508001 -232.2624676 -222.5055517 -233.7353333 236.9503175 245.6156306 252.6836147 230.3357037 238.1701618 229.6137942 256.3358587 247.0716519 239.1161538 205.3853127 213.4867884 222.1082442 195.0767049 204.4736758 196.5709356 221.4221968 212.7492558 203.1304817 168.0595328 175.2020551 185.3109743 154.1120103 164.7894969 157.9593471 179.5949199 171.9915867 160.9710532 126.0676402 131.848586 143.1568388 107.7569454 120.1802634 114.7860904 131.9923692 125.9068694 112.9968754 80.35163325 84.37996051 95.92012223 59.72001165 72.85975754 69.31559107 80.67954032 76.64033455 62.9920531 30.28105606 32.13126321 46.01317663 4.216754264 18.22932225 16.98104655 21.04179341 19.57919993 4.889710351 -22.93772301 -23.5657404 -9.693441515 -50.86501231 -37.29357047 -36.05049997 -39.98097584 -38.60108223 -52.81764288 -74.3506158 -77.36642231 -64.23248548 -102.8167485 -90.23679826 -86.66570268 -98.0278714 -94.0169472 -107.1599892 -121.9113739 -127.0075053 -115.0811487 -149.7682001 -138.5755969 -133.0236417 -150.6395931 -144.4380689 -156.0763138 -164.2229215 -170.9737936 -160.5714432 -190.5509654 -180.965892 -173.8732668 -196.275501 -188.4253959 -198.3173564 205.3455188 212.8140797 219.4653531 198.5779454 205.8536123 198.5204187 221.3857116 213.4707514 206.0464631 176.2663985 183.0894399 190.9884498 166.3989854 174.8885353 168.272591 189.0192507 181.7981251 173.0806305 142.7794925 148.6489128 157.6421168 130.0572955 139.451323 133.8690883 151.4752828 145.3132865 135.6121919 105.8765314 110.5272089 120.4380988 89.67633506 100.3456686 96.04025517 109.6994951 104.8930965 93.81101863 66.47789812 69.6461189 79.74902823 48.5720362 59.92371126 57.15334406 65.98931132 62.86401797 51.0971919 24.03015388 25.43760921 37.09417891 2.05761611 13.76192899 12.84136978 15.82523513 14.75443 2.525636292 -20.61369469 -21.17069989 -9.584899046 -43.99618515 -32.64612726 -31.60302256 -34.86525076 -33.73210585 -45.58977215 -63.75510265 -66.20905561 -55.19067276 -87.6372362 -77.03074821 -74.12952635 -83.28502665 -80.07823835 -91.14016254 -103.983315 -108.1353299 -98.01088155 -127.5757722 -117.9949943 -113.4605777 -127.7574185 -122.7545476 -132.7139755 -140.2865483 -145.8536535 -136.8655755 -162.8973286 -154.5305486 -148.6596157 -167.1167834 -160.6778792 -169.3243665 178.0108102 184.484716 190.6266808 171.4414545 178.0906335 171.7639882 191.4573609 184.6518395 177.8425265 151.5979997 157.3993609 164.5418408 142.4366924 150.0252152 144.4281986 161.9337208 155.8563214 148.0451516 121.8228013 126.7151752 134.6579543 110.3704187 118.6222908 113.9879384 128.5481005 123.4712495 114.9459617 89.46494637 93.26886701 101.9359403 75.23598066 84.41108099 80.91483464 91.95991441 88.08860377 78.5629015 55.43496537 57.97347272 66.89214693 39.87825736 49.73642224 47.5257705 54.53984876 52.07130364 41.86226577 19.23755046 20.32258463 30.22459564 0.5761952668 10.45596925 9.770482967 11.98694688 11.19341145 0.8938218297 -18.50795672 -19.01804898 -9.250589809 -38.27022169 -28.6960704 -27.7918014 -30.599086 -29.6310795 -39.61499337 -54.98042172 -57.03355739 -47.7210214 -75.187544 -66.19346469 -63.77314594 -71.36301784 -68.72084721 -78.08945949 -89.16856238 -92.62846941 -84.00317017 -109.261708 -101.0516905 -97.26885424 -109.1349717 -105.0033016 -113.5357316 -120.3311011 -125.002745 -117.2485146 -139.7876372 -132.5157347 -127.5767096 -143.0429622 -137.6681814 -145.1901122 154.2297132 159.8745666 165.4637046 148.0772049 154.079432 148.5841396 165.6599182 159.7683979 153.6042614 130.5040272 135.482608 141.8749292 122.1879829 128.9140288 124.13095 139.0518074 133.8841603 126.9473023 104.2095946 108.3425865 115.3255702 94.01046251 101.2412034 97.33996218 109.5543 105.3091706 97.83346153 75.91228314 79.07220253 86.63426806 63.48491826 71.39167867 68.50418706 77.58704126 74.41608837 66.21055215 46.50694754 48.57158399 56.41497823 32.97952337 41.55083682 39.75315929 45.43000533 43.44091139 34.56309781 15.51411089 16.36120318 24.82889616 -0.4078784812 7.987235538 7.472818377 9.132888656 8.53958088 -0.2005000833 -16.55816262 -17.03300825 -8.74773067 -33.36387903 -25.24217292 -24.44097222 -26.91597546 -26.0666702 -34.52615963 -47.53904077 -49.29398582 -41.38480062 -64.73683529 -57.0812084 -55.01973559 -61.45206645 -59.22347033 -67.19179945 -76.68000342 -79.61680033 -72.2516203 -93.86303251 -86.82349406 -83.61174286 -93.6431592 -90.16447417 -97.47988554 -103.4295558 -107.4085369 -100.7273387 -120.1987263 -113.8990527 -109.685556 -122.834105 -118.2796195 -124.800748 133.415048 138.3687099 143.3982765 127.8068322 133.1715099 128.3642638 143.2732625 138.1385149 132.6161945 112.3001135 116.6120978 122.2832303 104.8877019 110.8079575 106.6793355 119.5250127 115.0869482 108.9710855 89.21739309 92.75201474 98.86647408 80.22849195 86.54245371 83.21677846 93.59568333 89.99933835 83.46525171 64.55572252 67.21821692 73.79945018 53.76470723 60.57711451 58.15416146 65.7444098 63.10470198 56.03249368 39.1814804 40.88502894 47.72367562 27.42456189 34.85245192 33.36540994 38.0411854 36.40934224 28.70677489 12.58676006 13.25584564 20.51514038 -1.028128151 6.13010914 5.741405161 6.993506608 6.546731554 -0.9012720632 -14.73378083 -15.17914675 -8.127376121 -29.07511961 -22.16428851 -21.44395754 -23.66171298 -22.90318461 -30.09751729 -41.11118897 -42.63648341 -35.90186659 -55.79988699 -49.27153648 -47.48654296 -53.0339757 -51.1193235 -57.91242788 -65.97815546 -68.50922173 -62.21464146 -80.71072187 -74.6768382 -71.90957055 -80.52140009 -77.54530978 -83.8168481 -88.91848411 -92.35139454 -86.60441019 -103.385704 -97.94521835 -94.30648688 -105.6267351 -101.7169221 -107.3529966 115.073545 119.4501833 123.9307397 110.0821557 114.833483 110.5974649 123.7103502 119.2023856 114.3003664 96.44700081 100.2151737 105.2054992 89.94694488 95.124548 91.52640758 102.6942988 98.84499923 93.48764522 76.30746693 79.36411636 84.69233005 68.47013584 73.95946074 71.09172319 80.01576679 76.93213395 71.24466065 54.91097576 57.18343721 62.88991443 45.60566497 51.45768306 49.39726232 55.83072631 53.60039446 47.52018451 33.07884296 34.50681426 40.40285368 22.88640479 29.2836471 28.03635578 31.94432931 30.58505126 23.93953411 10.25852295 10.7930636 17.01093931 -1.383429067 4.723970333 4.428612013 5.378706095 5.040127536 -1.315056065 -13.01963199 -13.4383857 -7.431215489 -25.27129553 -19.38656226 -18.7327019 -20.74147107 -20.0559227 -26.18228151 -35.47881145 -36.82170319 -31.0849793 -48.04242128 -42.47596593 -40.91020786 -45.76120967 -44.09202705 -49.88546401 -56.68257077 -58.8912955 -53.51586451 -69.32705665 -64.16346604 -61.75005216 -69.23852502 -66.65810726 -72.02795879 -76.31330588 -79.30765269 -74.37689863 -88.79553318 -84.11388739 -80.93841615 -90.79198522 -87.39730478 -92.25179672 98.79126947 102.6881148 106.6399725 94.45757034 98.62652507 94.86350787 106.4880694 102.4996737 98.18808689 82.5122544 85.83636317 90.19055662 76.90999463 81.40620628 78.23918805 88.04446643 84.67289229 80.01178069 65.06742028 67.73971784 72.35409021 58.31846411 63.06382957 60.5630556 68.32334419 65.64902957 60.72460839 46.61406733 48.57791357 53.50107661 38.65944305 43.66030815 41.88291619 47.4135979 45.5024628 40.29734149 27.91444166 29.13023744 34.15767866 19.12743548 24.58970011 23.52998752 26.84019673 25.69221285 20.00479988 8.38417384 8.816683141 14.12297434 -1.547591469 3.653160721 3.427308664 4.152584127 3.894519074 -1.521172934 -11.40690294 -11.80093096 -6.691694802 -21.86081745 -16.85803249 -16.26026894 -18.09371523 -17.46900967 -22.68055581 -30.48553195 -31.68083607 -26.80320042 -41.2254686 -36.48960171 -35.1007001 -39.39215874 -37.91937831 -42.85211797 -48.51373324 -50.46280518 -45.88447874 -59.36094954 -54.95636262 -52.82826422 -59.41366501 -57.150332 -61.73537158 -65.24767709 -67.88642818 -63.67242666 -76.00846094 -71.99841668 -69.1995111 -77.86322912 -74.8855422 -79.04880761 84.22144928 87.71888999 91.16482812 80.56576965 84.18493555 80.81427635 91.20495884 87.64717018 83.89352629 70.14776968 73.10795832 76.87023981 65.41745169 69.28792869 66.47286964 75.16657865 72.18443328 68.16241792 55.17531777 57.53691092 61.50045256 49.45297709 53.52380555 51.31858534 58.1420074 55.79702646 51.5635319 39.39049199 41.10841362 45.32442192 32.66937739 36.90431359 35.35182076 40.16648868 38.50817662 34.08891387 23.47746581 24.52779707 28.76872025 15.9666187 20.58437117 19.67320514 22.51060727 21.52951989 16.7088853 6.85438539 7.209446651 11.70922879 -1.575972266 2.832138314 2.658043058 3.215838398 3.017775847 -1.579130228 -9.889482816 -10.26018132 -5.933211823 -18.77636061 -14.54153425 -13.9920692 -15.67517527 -15.10243363 -19.5199045 -26.01467493 -27.08867062 -22.95980775 -35.17029915 -31.15984689 -29.91572381 -33.75053855 -32.43756632 -36.62069729 -41.25967929 -42.99707024 -39.11701638 -50.54432754 -46.8072797 -44.91181117 -50.76254511 -48.7566084 -52.65289423 -55.43752176 -57.78546977 -54.20490783 -64.69546113 -61.28225025 -58.79181712 -66.48219839 -63.84516227 -67.39487479 71.08093141 74.24519527 77.21080956 68.10732472 71.20983232 68.16502726 77.53073156 74.33064453 71.10194625 59.07165094 61.73340286 64.94578714 55.18265947 58.47725828 55.94978247 63.73524585 61.07126131 57.63704174 46.37373684 48.48405092 51.85189581 41.61957129 45.07598354 43.10883279 49.17776906 47.09796881 43.49312029 33.01824387 34.54150514 38.11528864 27.43721819 30.97705656 29.60449312 33.84818252 32.3907979 28.68313179 19.61020642 20.5307517 24.06382827 13.26603891 17.12496979 16.33159514 18.79408285 17.94525809 13.90430316 5.585781684 5.882255017 9.663328644 -1.510159677 2.19688673 2.061117519 2.49464418 2.341169183 -1.53357742 -8.462071466 -8.810787943 -5.173721598 -15.96640061 -12.40848262 -11.90100638 -13.45365351 -12.92591516 -16.64558039 -21.97587271 -22.94931817 -19.4808069 -29.7394144 -26.36961238 -25.24492827 -28.70362473 -27.52206418 -31.04503417 -34.75465227 -36.31849818 -33.0564504 -42.66766005 -39.52309988 -37.81821983 -43.06759045 -41.27214453 -44.55858309 -46.65632867 -48.76600006 -45.74957244 -54.59365465 -51.71389261 -49.47637945 -56.3684874 -54.01085685 -57.01307662 59.12923268 62.01654951 64.52781987 56.83212217 59.45044503 56.67523458 65.19233102 62.28846873 59.55197493 49.0496184 51.46755198 54.16887395 45.97101135 48.73370863 46.440403 53.48551231 51.0809921 48.1891147 38.45345412 40.36080812 43.18056797 34.61506444 37.50822415 35.73297497 41.19366593 39.32753235 36.2978431 27.32865579 28.69498281 31.68139592 22.79918702 25.71070056 24.48070282 28.27065934 26.97326583 23.91092506 16.18867547 17.00819241 19.9031475 10.91944642 14.0977036 13.39723156 15.56355672 14.8193263 11.47773792 4.513678396 4.766247281 7.902525263 -1.381500956 1.698566696 1.590741333 1.933205205 1.812534349 -1.418143211 -7.11898091 -7.447160287 -4.425946235 -13.38895571 -10.43495078 -9.964023868 -11.40315292 -10.91453774 -14.0135053 -18.29577985 -19.18563719 -16.30644429 -24.82232355 -22.02482527 -20.99893838 -24.14673033 -23.0736713 -26.00859713 -28.86415132 -30.28547654 -27.57643225 -35.56065227 -32.94756092 -31.399013 -36.15537032 -34.53233492 -37.27323556 -38.71651034 -40.63142653 -38.1226924 -45.48239682 -43.08444735 -41.05319706 -47.29359607 -45.16425403 -47.67372447 48.16110738 50.82134663 52.90726468 46.52825251 48.69415917 46.13864351 53.95931913 51.30015472 49.02390486 39.88289487 42.10444306 44.32985836 37.58733268 39.85617107 37.75093412 44.19822632 42.00438555 39.61531121 31.2404992 32.98607729 35.29802404 28.27541243 30.64756687 29.02488835 33.99935318 32.30498196 29.80609846 22.1800525 23.42364287 25.86766206 18.62236261 20.96845846 19.85118216 23.28143106 22.11126585 19.62917027 13.11101003 13.8529797 16.17565875 8.843636202 11.4102933 10.78208792 12.71667647 12.05475701 9.34115322 3.587153941 3.807536255 6.360675968 -1.213830779 1.299112376 1.210987352 1.488543244 1.391484369 -1.258318186 -5.854129958 -6.163371876 -3.698713296 -11.00886593 -8.600243497 -8.16099772 -9.501462947 -9.046968955 -11.58714286 -14.91361137 -15.73423585 -13.38728989 -20.3288312 -18.04848771 -17.10403338 -19.99494382 -19.01179722 -21.41688123 -23.47830626 -24.78280984 -22.5740224 -29.08510762 -26.95371843 -25.53333507 -29.88496289 -28.40373543 -30.65135096 -31.46791158 -33.22211296 -31.17524981 -37.18046615 -35.22344375 -33.3631405 -39.06658432 -37.12467565 -39.18431882 37.97226206 40.45620037 42.14040621 37.00211731 38.74235418 36.35845757 43.63007268 41.16572398 39.3209334 31.39354165 33.46123061 35.24035196 29.86087608 31.66768326 29.70955438 35.68612674 33.65925565 31.7395686 24.58252592 26.20256685 28.0400771 22.45798538 24.34392964 22.83926086 27.4348118 25.87523955 23.87063767 17.44885029 18.59865353 20.53999289 14.80065281 16.63563294 15.60400604 18.75774116 17.68643154 15.7282332 10.29356047 10.97762658 12.78379965 6.970562397 8.984082715 8.41015415 10.16905702 9.570079352 7.423106826 2.764917481 2.962645273 4.982918471 -1.025434157 0.9680122795 0.8929320059 1.126688062 1.04582116 -1.073648993 -4.660549583 -4.952670158 -2.997649975 -8.794860362 -6.885269106 -6.473096401 -7.728954656 -7.303825883 -9.334428581 -11.77604888 -12.54018761 -10.68011058 -16.18164361 -14.37429744 -13.49592617 -16.17749124 -15.26792204 -17.18993014 -18.5023669 -19.71271846 -17.96139946 -23.12568757 -21.43455103 -20.11744991 -24.1410578 -22.77535565 -24.57311506 -24.7867649 -26.41039433 -24.78483456 -29.55652878 -28.00027628 -26.27995502 -31.53975938 -29.75360063 -31.40358263 28.38631674 30.73441373 32.0340963 28.08053806 29.41564697 27.16334203 34.01088539 31.69752308 30.26279205 23.42514012 25.37625463 26.73298526 22.64132998 24.01225357 22.16509615 27.78238597 25.88399866 24.40629017 18.34469068 19.87164751 21.26219034 17.03652244 18.46485658 17.04709371 21.35910779 19.90160417 18.36123725 13.0263758 14.10867927 15.5792087 11.23967451 12.60876134 11.63875842 14.58997926 13.59199066 12.11018042 7.664346114 8.307556064 9.643540017 5.243773504 6.750918181 6.215614639 7.847293006 7.294494264 5.664503767 2.013395439 2.196240685 3.723074913 -0.8300952893 0.6807514894 0.6134236569 0.82022849 0.7495984995 -0.8789807274 -3.530216686 -3.807373503 -2.325734763 -6.718182795 -5.27174536 -4.88203245 -6.066980251 -5.66662929 -7.226018433 -8.83472035 -9.554195228 -8.145792579 -12.31164226 -10.94295145 -10.11648469 -12.63182314 -11.78111964 -13.25675989 -13.84963674 -14.98705041 -13.65982768 -17.57598525 -16.29268812 -15.05524667 -18.82240588 -17.54795842 -18.93073724 -18.54689664 -20.07212444 -18.8361195 -22.46841008 -21.28258824 -19.66617664 -24.58803833 -22.92322917 -24.19723597 19.25115533 21.50013674 22.42987196 19.61344527 20.56067618 18.40423761 24.93805142 22.73797685 21.69508175 15.83957119 17.70705448 18.66143321 15.79438219 16.75144352 14.98303697 20.34052471 18.53660904 17.47800415 12.40371788 13.86769886 14.83424658 11.89578611 12.88966836 11.52967157 15.64648196 14.26130852 13.16072226 8.812028814 9.851537132 10.87644453 7.856708976 8.794737853 7.863843624 10.68071711 9.733092121 8.690020791 5.160516081 5.778022206 6.678440473 3.615350534 4.651183468 4.140694088 5.687815923 5.16656747 4.015550491 1.305366291 1.479553866 2.54211468 -0.6374098296 0.4180805393 0.3544994342 0.5473469319 0.4823021823 -0.6849537344 -2.453368595 -2.718192656 -1.683057339 -4.750839172 -3.740995645 -3.368943219 -4.497207822 -4.116963039 -5.233920924 -6.044068546 -6.730034259 -5.747201953 -8.654612924 -7.699206714 -6.91141416 -9.300907658 -8.495414819 -9.552201626 -9.439761302 -10.5236308 -9.596132686 -12.33537832 -11.436839 -10.25762996 -13.83432056 -12.62861221 -13.62159938 -12.63272425 -14.08656914 -13.21880961 -15.77330582 -14.93781073 -13.3968758 -18.07062603 -16.49559149 -17.41473576 10.4327741 12.61248262 13.17928122 11.47104448 12.04264502 9.953941131 16.26687915 14.14695542 13.48218431 8.520708742 10.33021956 10.89968214 9.198864299 9.763358661 8.047619205 13.23004288 11.49073005 10.83033768 6.639603033 8.07071986 8.635489403 6.921517447 7.500322905 6.166777701 10.17955486 8.837306978 8.156482195 4.703183725 5.727437313 6.323913187 4.572452779 5.102824974 4.186857933 6.939379147 6.019314701 5.388941876 2.724650462 3.329485426 3.814276597 2.046048176 2.632752256 2.136381321 3.634618711 3.132114407 2.434282784 0.6203579868 0.7908330388 1.409035812 -0.4526440291 0.1663571841 0.1030975631 0.291420334 0.2286329258 -0.4980757423 -1.418955078 -1.673813297 -1.066616642 -2.865179261 -2.273484788 -1.914753448 -3.000599419 -2.635617402 -3.330509365 -3.361859252 -4.024186009 -3.448684681 -5.151555684 -4.591776039 -3.831061884 -6.131469417 -5.358544405 -6.015924262 -5.200997879 -6.248043872 -5.703616381 -7.313900952 -6.784831764 -5.645365637 -9.090069195 -7.932872361 -8.553259539 -6.941665957 -8.34833423 -7.835132926 -9.350361978 -8.85320394 -7.361571267 -11.86980111 -10.35618251 -10.93475869 2.303539846 3.927203133 4.130988407 3.521930293 3.724141654 2.165858122 7.875148769 5.825646726 5.531271602 1.757882184 3.117644686 3.319753522 2.715058592 2.915883205 1.611910366 6.338395818 4.6545877 4.365219651 1.112425434 2.320801712 2.516146415 1.951617629 2.130855054 0.9185813369 4.831293536 3.500336054 3.211955714 0.3541291322 1.635941225 1.780685763 1.281575981 1.467306177 0.3387491234 3.274369495 2.349443932 2.131027678 0.5863034549 0.8731821341 0.8837609726 0.5441738619 0.6773107367 0.2267710473 1.642997377 1.156818305 0.8909144383 -0.2942315901 0.1526628181 0.3408136139 -0.2393632215 -0.04569514038 -0.401334349 0.04414632623 -0.03390912776 -0.3335303309 -0.6797151211 -0.6216885623 -0.4318104529 -0.9950479695 -0.8094487251 -0.7708684051 -1.55487811 -1.212864886 -1.498211411 -1.044888145 -1.359805145 -1.178461697 -1.716370385 -1.539115721 -1.136064322 -3.072444314 -2.331579966 -2.602262192 -1.407229704 -2.064773938 -1.891578339 -2.405309189 -2.235992116 -1.496743599 -4.510708957 -3.39447439 -3.652176295 -1.767003216 -2.739251044 -2.572918533 -3.071471558 -2.90541552 -1.864205549 -5.874441028 -4.406906063 -4.647372438 -4991.289407 -4769.107209 -4702.216596 -4842.065308 -4797.217618 -5027.581295 -4670.232735 -4526.262718 -4568.419963 -4403.676146 -4458.126131 -4605.236345 -5084.672361 -4877.186227 -4850.828849 -4880.887271 -4870.161485 -5082.400023 1363.136049 1357.554448 1349.076341 1376.667818 1367.824364 1372.625194 -3437.245925 -3368.97937 -3440.905069 -4395.134396 -4271.03657 -4330.954396 -4128.829456 -4193.967835 -4319.710355 1233.90683 1226.516534 1219.239172 1242.458535 1235.323157 1241.838682 1089.180273 1081.356562 1070.825669 1101.966431 1091.742508 1099.543196 1077.004045 1084.074951 1094.264825 -1443.841204 -1318.111282 -1321.498633 -1307.644569 -1313.703862 -1448.110278 -1057.178433 -1183.101535 -1167.759969 895.6778721 884.3871328 865.2204752 908.4092427 900.3313257 910.4206871 882.9115679 891.0625973 900.4598468 279.3039743 325.1723502 245.810058 489.4767975 403.8838931 363.5970241 505.836486 484.2654337 595.3560302 -686.4462887 -697.6001407 -748.5252819 -596.2780104 -644.8672478 -633.534039 171.4752221 115.3764625 63.20995578 -371.0328444 -440.8821565 -524.2794542 -293.7430779 -367.4476264 -292.2429453 -779.1166299 -822.4299756 -936.3221382 -615.7441231 -715.5254319 -664.0322259 2385.010616 2213.275619 2315.341911 1905.035291 2068.513582 2177.048515 1870.136318 1962.699368 1836.575575 1333.007201 1218.72413 1068.936627 1637.26224 1403.953607 1511.946495 949.8118811 1219.36644 1443.71414 -569.2900286 -771.9170589 -634.4937986 -1197.48546 -953.2287917 -752.6909819 -1220.59161 -1107.648519 -1342.515479 -3257.153959 -3491.902765 -3576.714516 -3256.647043 -3389.116313 -3173.549478 -3939.297531 -3642.427809 -3498.125192 1573.700751 1546.631758 1565.257435 1478.545359 1501.96045 1481.016566 1657.921613 1631.848986 1602.131425 -3380.261615 -3588.772236 -3530.794059 -3668.326629 -3637.053006 -3429.116985 -4128.33502 -3869.387621 -3912.9421 1383.85202 1363.649441 1374.402327 1339.724831 1351.817911 1371.428236 1314.164354 1332.736952 1319.858607 1418.546318 1433.80172 1455.784508 1391.631039 1412.391105 1396.646926 1439.205617 1426.37011 1404.759937 1446.886697 1440.870378 1430.601188 1464.563977 1453.837586 1458.704492 -2781.234624 -2903.156985 -2797.074054 -3107.639558 -3006.969093 -2881.098611 -3287.615841 -3143.602311 -3256.503905 1237.55055 1220.757887 1232.132439 1199.25829 1209.844907 1226.786706 1175.802364 1192.887083 1181.11386 1267.600559 1278.331159 1296.046254 1243.78357 1260.935086 1249.117301 1281.850817 1271.532919 1254.453518 1295.544388 1289.33978 1282.224015 1305.357525 1297.994021 1303.358318 1317.456796 1314.444887 1316.807126 -3577.203028 -3544.704617 -3591.610339 -3449.078253 -3495.419586 -3528.846581 1097.466693 1078.117693 1090.957023 1055.628027 1066.703659 1085.858062 1026.2834 1046.844203 1036.024255 1130.425388 1141.051089 1158.573573 1104.622001 1123.172548 1112.089762 1147.191966 1134.716652 1116.339738 1167.178659 1159.631337 1150.021219 1176.576379 1168.85598 1176.036656 1199.676835 1195.850012 1199.764774 1182.901941 1188.194529 1181.448068 1242.56176 1238.834427 1235.053333 -1818.745603 -1736.538109 -1730.433738 -1763.909782 -1749.226809 -1833.648155 -1581.649549 -1665.223799 -1676.961148 921.1274169 893.8063917 904.05658 877.8929534 885.3816861 911.8773178 833.2938442 858.8602776 852.2424456 973.1458997 983.0915437 1005.049579 936.5791725 960.304142 950.7898462 982.6984347 970.6520168 946.4429201 998.2845377 990.1480193 977.3086043 1014.704784 1002.61941 1010.753083 987.711249 994.8125557 1006.906259 627.8921392 586.6253939 569.8176773 629.8898076 620.5698206 660.3932299 448.72862 421.1895354 344.9075318 532.9514345 499.4693555 540.2426523 577.3798066 495.908758 498.1937284 2224.264278 2221.796966 2182.7419 2302.884751 2266.905265 2268.500063 1866.064607 1870.364063 1852.143362 1911.56033 1890.660545 1885.79748 -4704.541014 -4482.070405 -4362.981722 -4650.725129 -4559.313981 -4794.44884 -6210.943322 -6055.483101 -6039.446517 1593.069919 1580.234502 1586.635296 1566.7799 1573.464455 1586.650938 1547.607417 1560.448506 1553.436625 1626.943061 1629.985463 1646.006823 1600.166659 1614.536506 1609.486666 1624.901088 1620.146974 1606.279043 1648.291291 1647.561263 1641.071952 1661.705457 1654.761304 1655.093636 1583.719895 1579.238381 1573.569698 1589.982404 1584.681489 1588.809381 1577.209964 1580.73883 1586.335525 1800.167203 1803.050988 1789.003454 1834.423146 1818.345181 1814.847665 1676.592632 1676.757154 1669.124263 1693.142301 1684.619392 1684.262555 -4888.386335 -4715.957662 -4755.241356 -4620.839625 -4670.66781 -4839.044332 -5602.752311 -5641.982375 -5762.052446 -5428.367625 -5531.492164 -5492.403088 -5596.39999 -5565.922655 -5464.223591 -5279.266013 -5192.878706 -5232.315114 -6019.899182 -6022.893622 -6172.095909 -5541.744278 -5653.076719 -5626.131783 -5706.397628 -5683.483844 -5567.738627 -5926.856531 -5798.16258 -5826.966781 -5032.1242 -4834.481362 -4861.319643 -4786.459494 -4810.46141 -5003.65813 1402.606519 1396.823716 1387.53906 1418.25028 1408.428028 1413.276026 1543.262565 1550.12776 1545.847402 1559.010946 1554.429268 1547.359562 1567.584245 1561.206623 1566.047758 -3774.843429 -3739.259949 -3785.46051 -3641.648944 -3688.940301 -3726.196718 -3758.86649 -3674.712105 -3746.635272 -3521.166144 -3593.416276 -3677.850699 -3425.056712 -3493.735531 -3408.375133 -3667.404623 -3580.054389 -3508.117487 -3726.379738 -3652.502449 -3743.553818 -4903.819793 -4948.794962 -5031.990151 -4437.183119 -4387.03191 -4432.528326 -4083.989521 -3980.387735 -4048.898803 -3828.359477 -3899.074635 -4003.063882 1262.709888 1259.399574 1263.230787 1301.765619 1298.269108 1295.298962 1265.048009 1258.159459 1251.11923 1273.699708 1266.698132 1272.695917 1169.775375 1173.761338 1178.160152 1164.370603 1169.142888 1164.577939 1178.43471 1173.746649 1169.003356 1104.330866 1114.147906 1106.236437 1129.82284 1121.909258 1112.043263 1140.777943 1131.516635 1139.474359 -1084.04936 -1093.858129 -1173.657413 -941.366675 -1017.731666 -1005.594271 -1418.731214 -1416.848823 -1498.885159 -1253.628957 -1335.012464 -1333.635283 -1341.930941 -1338.728347 -1262.055386 974.1243532 1035.043368 908.8174395 942.4114147 967.1964262 977.5140431 914.9862869 929.398446 921.9137001 944.2536443 936.7309514 922.3678241 964.1276681 950.5909537 958.254697 932.7977099 886.6152774 910.5068766 978.3387773 944.5490059 970.2619031 1819.621376 1791.834833 1850.126505 1940.274865 1851.851969 1840.513118 2420.027775 2370.134666 2443.77359 2238.426568 2299.456856 2337.054129 2206.694839 2255.156903 2197.690162 2374.466229 2405.428111 2295.264753 2615.023391 2503.135552 2465.064196 1726.017162 1704.609539 1705.958676 1700.176098 1702.239394 1723.717742 1663.448218 1682.014871 1678.193092 1794.089168 1798.934059 1828.172836 1747.025015 1771.884375 1765.923437 1774.982401 1775.001488 1749.447468 -2266.120887 -2202.770195 -2320.531913 -2054.538393 -2047.24074 -2089.578165 -1953.877517 -1998.364625 -2008.65587 -387.3177331 -343.6328791 -278.6882126 -487.077542 -412.3637475 -450.2566069 -326.4074124 -371.0089927 -448.5003993 -777.6341322 -795.4936131 -867.5657087 1986.874077 1943.071388 1950.161206 1917.869251 1931.585958 1971.877634 1859.970703 1894.461965 1881.905344 2075.33332 2108.029695 2156.921441 2014.945053 2060.328656 2031.387483 2106.465682 2085.493107 2034.392803 -4444.815666 -4154.690199 -4411.182443 -3740.165206 -3933.535449 -4197.852922 -3370.40285 -3660.213397 -3503.055952 -4164.697342 -3964.218929 -3794.482988 -4254.391211 -4103.381603 -4313.511185 -2479.175025 -2553.390916 -2588.053419 -2673.375325 -2593.148538 -2562.999764 -2344.308286 -2321.590405 -2395.862945 -3128.530432 -3213.877402 -3271.359365 -3101.29579 -3158.057577 -3075.131043 -3323.865461 -3240.447897 -3184.750868 -2787.073733 -2832.645691 -2752.411082 -2993.987899 -2912.555034 -2866.78239 -3009.119527 -2960.225791 -3044.039687 -483.8943638 -498.7937451 -547.6463584 -399.5410595 -450.6815875 -435.1862537 1934.632759 1795.009637 1608.267218 2282.53757 2012.721878 2144.414512 1409.303611 1770.088016 2025.848758 2215.660605 2241.930675 2430.261322 3185.020845 2992.813867 3117.070827 2631.947885 2824.518599 2950.620403 2579.997592 2695.498807 2546.772165 -582.9088232 -830.1344483 -678.9224026 -1416.540533 -1076.214189 -809.7874146 -1503.523274 -1292.705761 -1623.758119 294.9075674 422.6205899 941.0162671 -478.0426951 -65.2275017 -314.4979433 152.0865282 80.91732067 -296.0676182 -6116.613275 -5856.111107 -5680.853369 -6123.667444 -5982.88367 -6259.347807 -5634.87564 -5236.902514 -5579.830977 -4784.565736 -4993.9181 -5345.5389 -5517.724373 -5324.633814 -5598.50387 -3384.081385 -3354.711196 -3400.57411 -3263.179748 -3306.958231 -3336.558005 1212.137688 1207.794542 1204.165586 -1866.45528 -1860.743076 -1905.48751 -1767.768732 -1813.498589 -1820.856292 1007.614279 1003.455985 997.1479082 1014.795836 1010.062463 1014.542887 2072.638942 2074.224107 2042.428676 2142.966961 2108.067764 2106.690177 1954.824109 1958.853597 1934.801212 2012.774857 1985.102578 1981.026086 3240.214194 3174.058279 3262.257101 2934.757148 3014.656178 2916.681175 3468.944747 3331.228868 3302.39172 1623.202246 1621.897999 1616.127475 1634.122571 1628.297446 1628.929495 1591.88366 1597.435549 1594.302733 1603.578042 1600.51754 1595.240998 1610.916065 1605.774938 1608.573143 1749.341447 1751.565411 1740.357282 1775.678423 1763.197931 1760.727905 1709.59404 1710.758263 1701.602212 1730.015186 1719.973422 1718.520845 -5631.942521 -5532.23279 -5563.24768 -5282.574998 -5319.833101 -5415.795078 -6117.236087 -5987.00149 -5995.091705 -5857.975779 -5872.068927 -5999.463671 -3975.775423 -3935.850108 -3987.480951 -3834.009854 -3884.582553 -3923.209337 -3807.925779 -3847.033863 -3797.525282 -2804.603344 -2847.532352 -2868.016923 -2919.343458 -2872.516387 -2853.782783 -2731.120631 -2713.734597 -2757.312932 -1313.186132 -1312.354621 -1361.356742 978.7665882 974.9744428 967.6593555 989.6445627 982.8221513 986.5274876 946.2526227 945.0254147 940.4862538 959.6559926 952.3370825 954.0391614 -97.44106468 -55.32784115 -71.586589 8.224066602 -21.94334786 -68.35791048 770.800631 772.6983257 803.6172397 743.1756774 741.7208578 708.1448494 846.3534503 858.7360789 879.0083805 815.9991974 834.7929062 820.0258591 812.1502796 824.9170354 863.7459124 19.93155119 -39.11857945 24.87337965 2880.973153 2608.194047 2809.699324 1875.168585 2330.704932 2544.560542 2926.891473 2977.462152 3186.452233 3953.750161 3815.824461 3967.39987 3400.226154 3618.883868 3687.447698 3414.662583 3526.986701 3357.152015 -1678.362478 -1330.349857 -941.3905294 419.1339162 545.6389803 1286.724517 -596.1543748 -24.52995125 -288.2467913 1326.641259 1324.380119 1321.10402 1230.687529 1227.094098 1230.373189 786.1487487 776.5860437 753.4548448 648.1835532 704.1895595 661.8909881 754.9329114 731.7403754 660.8325276 -6042.707801 -6021.724875 -6190.031034 -4873.857366 -4802.108778 -4848.56282 -4488.433206 -4537.276172 -4602.545118 1273.46608 1269.797165 1266.627737 1291.536154 1288.328006 1291.622063 -2444.834546 -2487.141687 -2503.480997 933.0617081 938.2661436 936.0699368 249.0169378 198.2704036 235.3286538 702.6838846 617.7739396 601.3124146 847.3881315 727.472994 797.1238782 -1971.903483 -1951.572729 -1740.223684 -1860.90845 -1932.269125 -1947.405601 -2522.868701 -2518.673654 -2248.063275 780.8192571 776.2750393 775.3730174 -714.5842145 -734.5449578 -734.6110583 -584.2213391 -605.3122515 -601.3088551 -630.5376163 -650.2206803 -637.8826096 -708.34668 -723.7176065 -703.9294261 -818.3119926 -824.6408697 -797.4972857 -960.3451998 -955.3789076 -921.1473717 -1113.857594 -1091.716667 -1057.83567 -1247.193347 -1210.160865 -1181.265634 -1319.365509 -1273.997593 -1260.8834 -1308.959545 -1263.377773 -1270.051831 -1221.523871 -1184.286926 -1207.563876 -1080.896202 -1055.927619 -1089.643497 -918.6058674 -908.9125563 -944.5152669 -759.4832601 -758.0610742 -793.7808452 -621.2930379 -626.6628404 -657.67399 -508.4454547 -517.5643438 -542.8549336 -418.0415152 -428.6763172 -449.4470061 -346.1185919 -357.0822683 -373.982753 -289.4554307 -299.9927112 -314.2734316 -244.2405572 -253.8671962 -265.6755056 -207.6455314 -216.2555139 -226.040223 -177.5269566 -185.13844 -193.3365394 -152.3567513 -159.0329343 -165.980754 -131.0333343 -136.8561173 -142.803557 -112.7518584 -117.8066136 -122.9436741 -96.90943536 -101.277282 -105.7504881 -83.04768009 -86.80237396 -90.72694215 -70.80693291 -74.0137889 -77.48181428 -59.90027261 -62.61654424 -65.70318211 -50.08802079 -52.36356257 -55.13284833 -41.16488798 -43.02358769 -45.51069104 -32.99733282 -34.46682054 -36.64117256 -25.4345218 -26.57770543 -28.57272811 -18.30534795 -19.13991266 -21.0219502 -11.49146185 -12.03210886 -13.84662974 -4.869376027 -5.12219869 -6.823643244 -764.5337152 -918.730007 -1036.891529 1142.687226 1152.891346 1142.189243 553.7278616 584.0181222 593.6775071 325.9636136 396.2031619 373.7311793 417.9948048 416.7606719 362.1159927 -4584.855666 -4552.381592 -4403.150782 -4464.502543 -4629.363298 -4611.540097 -1127.649215 -1223.575408 -1217.34149 596.2417929 742.5001597 819.5522665 253.1753593 243.2325609 437.8958744 1856.344574 1771.612568 1823.071876 1709.627661 1579.45205 1562.023953 1306.641832 1438.456932 1402.820774 -1543.972887 -1375.672125 -1304.8296 -2540.82537 -2745.175072 -2605.676757 -2387.637171 -2471.89183 -2362.069954 -2689.607855 -2580.687278 -2492.111944 1102.512338 1086.391434 1072.273563 -1531.745304 -1638.818278 -1659.297515 941.9232575 933.6670866 913.6202999 975.5584945 956.5011263 963.8003331 794.1987429 770.2512232 768.703088 808.7443552 802.61681 778.6310847 -9.089800081 77.34619613 93.80322774 1547.251714 1541.381468 1529.302975 1569.79056 1556.723021 1560.970437 -3223.975788 -3290.542178 -3358.253201 -582.0302769 -504.986733 -550.0787687 -794.8484121 -760.7601775 -666.8302743 2548.990121 2435.524465 2490.540916 1505.585582 1526.278473 1551.061892 1598.970159 1630.855042 1658.14839 1577.192263 1603.519989 1572.785121 1025.581675 1015.443605 997.1517558 1053.62954 1036.091877 1044.931936 846.1116613 840.4182252 819.6372294 889.1093071 867.4297275 871.1523957 518.4184397 554.2999294 560.3319016 477.8504793 465.2903626 481.1321101 507.9301465 498.3471704 572.9748218 1605.180821 1597.693119 1585.833235 -4362.142307 -4511.250638 -4461.711913 -4683.452451 -4657.121605 -4480.570938 1685.040902 1736.174886 1756.000176 1685.601496 1711.581429 1663.218911 1702.944546 1776.061273 1772.034015 1769.524215 1773.305855 1706.024095 -2253.105372 -2141.319172 -2092.537618 2394.658225 2233.875006 2202.94343 1890.19659 2064.19511 2017.755918 675.1838265 645.4224163 638.221458 711.4476829 742.0581426 742.6267452 269.4218407 211.0808981 195.5970714 -127.6897796 -189.3096029 -243.7122517 -2082.208635 -2133.19812 -2339.476975 -1321.025826 -1320.736288 -1424.645579 -2762.755199 -2785.17869 -3080.459227 746.4241256 753.0903884 757.8196281 745.3621573 748.2807059 741.631498 -624.0538161 -615.3243088 -593.17699 773.2155802 777.3733051 784.4641732 764.0673603 770.1532983 765.4950938 -683.5917904 -667.9639096 -647.2424878 810.4549501 811.0651753 820.6776615 793.1533363 801.7635881 800.397689 -769.8796159 -746.9185527 -732.3928853 853.1245364 849.3605595 858.7901432 830.2661928 839.8753287 842.4724797 -888.5118539 -856.0778739 -851.1428979 894.3002898 884.5991809 893.6906367 867.3595612 877.1060447 884.7020899 -1024.226068 -989.9062435 -998.575365 926.4840877 911.9282865 917.8576069 899.8435724 907.5904823 919.9563356 -1155.657068 -1121.559305 -1150.072888 941.1903064 923.6301473 925.0483839 920.0555354 923.7679015 939.4986026 -1250.356903 -1228.731849 -1271.443665 934.5351418 916.155669 912.6292841 922.3632526 921.3077826 938.4066137 -1278.240607 -1274.681066 -1324.153683 907.0623526 889.7396554 881.6628134 905.1797718 899.3066421 915.8227328 -1232.048064 -1246.82583 -1293.504226 861.8760907 846.9766753 835.1467098 870.1872254 860.1038578 874.6381508 -1124.60684 -1153.61343 -1189.970205 803.0693602 791.459107 776.9753204 820.5942494 807.176799 818.848981 -983.1605392 -1018.702986 -1041.46309 735.344853 727.5008634 712.2803323 760.6357677 745.4481704 753.1412415 -831.5370466 -868.0096705 -877.3314644 662.2333706 658.4061815 640.8480942 694.1317891 677.1184386 681.100274 -689.5076045 -723.4855501 -723.04264 587.6949016 587.1887822 569.5595374 622.6704379 604.8902528 606.0111324 -569.323136 -597.4553845 -591.0246439 516.4451349 518.7410547 502.51044 552.2806293 535.4383001 533.5018645 -470.9730388 -493.74224 -484.3014758 451.5487767 455.5904323 440.8790048 486.4461872 470.9391806 466.9995431 -390.7889549 -409.3723856 -398.5889742 393.5076119 398.6707069 385.54049 426.3279601 412.3961008 407.2220428 -326.9943605 -342.472693 -331.0002648 342.4818915 348.2184904 336.6760685 372.6403785 360.3038563 354.4716197 -275.7076784 -288.7722941 -277.5267454 298.076201 304.1678224 293.8944024 325.4306146 314.5743839 308.4751666 -234.1394829 -244.8753223 -234.6689577 259.4759047 265.6786142 256.4708273 284.2784179 274.5547962 268.4774002 -199.9889516 -208.9311295 -199.8273749 225.8956535 231.9802475 223.7192938 248.2753818 239.5534904 233.700611 -171.5346955 -179.0718315 -171.0369606 196.5917689 202.387331 194.9816279 216.7104571 208.8883824 203.387829 -147.5086161 -153.9291715 -146.8892882 170.9060821 176.2543175 169.6692492 188.9317452 181.9230515 176.8572284 -126.982277 -132.5038432 -126.3685609 148.3116555 153.1568287 147.3102248 164.3537503 158.1514413 153.553434 -109.2584122 -114.0480903 -108.7256994 128.3203514 132.6608801 127.450992 142.6092729 137.0937911 132.9666133 -93.80801078 -97.99413742 -93.39854346 110.5218505 114.3696886 109.7031759 123.2625679 118.3353869 114.6688597 -80.21734648 -83.90332591 -79.95664384 94.55524416 97.90718519 93.71791541 105.9376776 101.5063901 98.28810093 -68.1576164 -71.42643052 -68.06013801 80.13251683 82.97009504 79.23152418 90.26213374 86.30348924 83.5226496 -57.36138525 -60.28152972 -57.43598183 67.00490187 69.33280707 66.00242263 76.00237437 72.4728703 70.1130497 -47.58879122 -50.22727386 -47.85215157 54.9716832 56.83120417 53.86038518 62.94044732 59.80416079 57.84269443 -38.65342016 -40.98364671 -39.1099014 43.81858407 45.34919249 42.53882186 51.00861075 48.10803241 46.49755552 -30.46405572 -32.48973755 -31.09162168 33.335011 34.53066291 31.86678932 39.86507729 37.13223279 35.86160934 -22.80864789 -24.74126931 -23.64784044 23.36743984 24.23665126 21.69076891 29.32731451 26.72378721 25.78090788 -15.55851222 -17.3924775 -16.60882236 13.75461903 14.29848867 11.82804094 19.25308235 16.71999145 16.094484 -8.562479696 -10.33135402 -9.851049224 4.328492191 4.55231761 2.77919105 9.372834555 6.987671246 6.673683126 -2.21504425 -3.400601713 -3.228846488 950.4991136 850.3451245 956.3881957 -123.962102 73.69446782 50.68583435 1643.536499 1720.04704 1793.970635 2286.518663 2379.935524 2478.84437 1033.356121 1041.641503 1049.735736 1026.160859 1026.790452 1025.217029 1938.050958 1923.926754 1896.1788 -8313.439921 -8374.004451 -8730.124111 -3464.250498 -3474.753326 -3482.232384 1976.714277 1967.330603 1950.487199 -1962.585854 -1975.533515 -1982.39968 -278.5592579 -283.2597105 -286.1571755 983.7684594 911.5656952 904.8984852 -8148.635629 -8420.273007 -8790.771765 -7857.485064 -8258.03091 -10782.31225 1274.66406 1277.178334 1279.237919 1289.906798 1292.762998 1296.411814 1271.686116 1275.94129 1281.211681 1249.666701 1248.724865 1248.387116 1229.01696 1232.271313 1236.414758 -1432.687997 -1449.615842 -1460.66701 1042.919785 1034.577947 1030.133261 630.7414991 633.7156128 1004.785195 1005.680616 1008.443946 464.2821118 463.601656 458.4225318 -7071.696968 -7179.544419 -7260.24669 -7017.42076 -7111.346375 -7177.157922 -6901.75665 -7004.549269 -7081.991568 -5622.657438 -5665.348996 -5702.695584 -5780.548334 -5825.939728 -5865.387916 -5558.665439 -5592.627675 -5618.691556 -5381.625507 -5407.09595 -5429.52512 1854.866637 1849.26999 1836.496766 1878.109012 1879.444774 1874.772754 -1159.622283 -1160.436988 -1167.175549 -534.3494061 -537.2446219 -540.9020969 -3643.551644 -3644.532348 -3651.501848 -3594.469889 -3605.127568 -3613.700797 -2697.333858 -2697.248136 -2702.048039 2112.674581 2106.395746 2077.57689 2074.642633 2069.403757 2042.077608 1345.833181 1344.974702 1344.565061 1324.281185 1324.71312 1324.791775 1328.318372 1328.154942 1327.918088 1340.772103 1340.585894 1340.235946 1330.828608 1330.736564 1330.529863 1291.072246 1292.792032 1294.692817 1295.866286 1295.436548 1294.975428 1324.584586 1325.636839 1326.206652 1327.267554 1335.017087 1343.278696 1299.678816 1299.006532 1298.678943 1321.331617 1324.933306 1329.182797 1236.059002 1235.738739 1235.424289 1244.890835 1244.165705 1243.483234 -1829.104471 -1838.555765 -1844.548903 1235.429974 1235.764838 1235.784695 1237.783546 1247.081113 1257.751167 -1381.491837 -1380.450116 -1384.830538 -1204.579071 -1214.7494 -1220.332338 999.8594477 1014.652738 1042.134308 -7111.630561 -7193.58065 -7237.678197 -7319.238693 -7438.472128 -7514.215665 -7193.536074 -7299.976516 -7375.240238 -7370.397082 -7490.255184 -7572.752916 -6707.37098 -6783.13166 -6839.106476 -6844.882403 -6927.055921 -6990.046388 -6663.201534 -6741.616177 -6802.154445 -5976.346753 -6041.121688 -6095.776545 -5835.870398 -5897.612661 -5951.582192 -6008.976681 -6057.300592 -6090.314069 -5333.762879 -5364.540675 -5391.216843 -5184.81389 -5228.006494 -5258.735897 -4863.555686 -4897.533246 -4926.977852 -5139.29826 -5203.774375 -5257.224183 -4919.033765 -4951.345313 -4977.985193 -2735.918245 -2746.535572 -2753.699795 -1680.128703 -1683.207743 -1687.981465 1125.470168 1127.889147 1129.393356 1128.186231 1128.13973 1128.418086 1123.850454 1130.079095 1134.2711 1122.009396 1132.985635 1146.324872 1031.273061 1036.611596 1040.576417 1022.266104 1029.658023 1037.382198 1907.272899 1894.657837 1861.754383 -640.7915526 -649.5136587 -654.2821936 -8462.672562 -8534.836928 -9017.948489 -3505.792034 -3522.536809 -3535.022573 2330.112093 2324.683577 2293.98693 2386.532827 2379.195248 2339.95591 2259.829584 2254.400718 2219.853735 2193.103276 2191.065419 2155.977925 2012.154969 2009.375989 2004.088681 -1931.7232 -1936.802216 -1947.365069 1086.464245 1093.697633 1099.562303 1085.312126 1088.594031 1089.126563 -334.6691069 -332.5592289 -333.6992603 1082.044911 1087.486334 1093.608067 1073.008413 1073.47804 1074.061344 -148.0541098 -143.4694473 -146.2787653 955.6315308 981.8788288 1017.71559 -4257.720503 -4273.139719 -4282.866446 -3414.68122 -3426.592796 -3432.574674 -3389.217934 -3400.387901 -3409.688614 4826.219558 4903.89152 4939.504854 1278.157701 1279.621112 1280.78132 1283.96801 1285.876669 1287.630335 1264.745838 1265.959865 1267.990443 1256.2956 1255.491534 1255.618169 -1769.399404 -1783.296816 -1791.970482 -1727.733427 -1728.362435 -1734.991801 1213.408776 1213.249548 1213.187277 1129.337294 1128.603877 1128.258569 1128.980397 1130.286438 1130.257138 1091.138361 1083.214773 1076.664736 1109.399772 1111.356481 1116.330093 1029.994888 1017.64403 1001.117488 1015.652515 1021.13807 1028.839934 356.8695612 352.4298701 347.6579931 410.4214381 414.2703293 409.879945 -7108.687807 -7232.981857 -7333.302068 -7104.636287 -7210.087872 -7281.738588 -6976.429596 -7073.461175 -7144.210361 -6939.52726 -7034.383665 -7098.60776 -5681.92386 -5742.396171 -5795.673199 -5722.080261 -5759.439491 -5787.439684 -5513.605251 -5569.227655 -5617.081464 -5450.896851 -5491.9474 -5527.759833 1892.128106 1894.865889 1882.383543 -1108.588473 -1111.979431 -1116.848338 -587.929211 -587.3428889 -592.184112 -8568.998295 -8660.562914 -10439.75886 -8329.473376 -8467.979807 -9368.591276 -8586.856116 -8645.707336 -9362.879096 -3550.171224 -3570.942475 -3585.925909 -2657.137393 -2667.070805 -2675.239536 -2558.645083 -2571.497376 -2579.46629 -2615.877546 -2633.383733 -2646.990262 2551.71536 2535.628298 2481.662192 2458.609143 2443.832404 2378.561 2889.054569 2883.387524 2837.84003 2646.189209 2642.665131 2617.70378 2739.376169 2740.595759 2687.209594 2151.762535 2146.969955 2117.188902 2040.610354 2037.968994 2017.493972 1349.159483 1348.350498 1348.020427 1324.710954 1324.587787 1324.249077 1326.135787 1325.880287 1325.542574 1336.464802 1336.543669 1336.285096 1333.427666 1333.452352 1333.273685 1293.075232 1293.526132 1293.815819 1325.569062 1327.601422 1328.961546 1326.738222 1330.884504 1333.338358 1304.461461 1303.558175 1303.404381 1311.887168 1311.560917 1312.152887 1238.333265 1238.282611 1238.282797 1241.307599 1241.144071 1240.910056 -1883.337547 -1889.479663 -1896.52944 1236.737466 1239.115376 1240.753535 1238.20505 1243.453586 1247.1027 -1273.47049 -1282.431413 -1289.651955 -1328.769053 -1332.1965 -1337.788914 1081.858117 1075.817364 1069.631116 1082.497804 1082.012827 1080.342461 -395.1869334 -390.2104651 -392.9123254 1066.212742 1068.869539 1070.758091 -87.52803643 -85.33381413 -87.06538238 990.2812765 1012.873626 1054.395443 -7284.531779 -7412.799831 -7482.446331 -7260.687549 -7415.918831 -7531.611476 -7427.582459 -7576.332338 -7682.550619 -6750.746233 -6832.246724 -6894.750129 -6790.393472 -6863.423333 -6916.739478 -6609.577631 -6673.123666 -6721.64833 -6568.182083 -6633.826542 -6683.997897 -5931.55926 -5984.95001 -6031.371083 -5876.482362 -5918.203682 -5949.706743 -6053.723253 -6104.476594 -6145.640891 -6096.707676 -6140.732895 -6178.909742 -5231.527843 -5258.251252 -5283.259355 -4802.704655 -4825.745948 -4846.314271 -5059.731611 -5096.318882 -5126.323905 -4977.738344 -4999.505476 -5016.880862 -3244.900568 -3258.751748 -3270.254837 -3304.630938 -3332.276085 -3354.965384 -3358.358258 -3386.707977 -3410.198688 191.0992683 -2384.287442 -2397.912885 -2406.658404 -2343.247473 -2343.030785 -2347.706223 4574.959997 4680.967431 4805.850776 2544.7395 2273.404333 1645.739995 20.45589653 -721.4647706 -2684.029331 1800.497667 1800.456008 1790.374712 1793.708385 1795.407948 1790.597049 1711.368064 1703.295868 1690.477571 -2018.89884 -2029.122793 -2036.04972 -764.0421387 -761.2802964 -764.5167053 -713.0626396 -714.9486065 -718.2722125 -3843.143422 -3864.326258 -3875.771453 -3814.222311 -3847.764911 -3872.19662 1664.717595 1666.27825 1665.023171 1704.392492 1701.262313 1693.454156 1602.751078 1608.239786 1612.723239 1621.011779 1622.372988 1622.956049 1662.568965 1665.298565 1665.986767 1623.464449 1626.337967 1628.316668 1600.627395 1609.724583 1621.189097 1531.62311 1532.297628 1533.450208 1522.848207 1523.115192 1523.652047 681.9460883 653.3075363 651.0565934 -7730.036161 -7906.987997 -8045.154539 -4169.520865 -4190.722289 -4207.972089 -4220.512375 -4239.232076 -4258.580873 4116.020429 4142.759635 4120.254788 4494.205957 4528.793479 4533.047133 -2204.699547 -2216.000613 -2224.575365 -1612.892453 -1621.192715 -1625.796224 1205.803771 1205.037289 1204.58931 -1575.054383 -1573.167462 -1576.823141 1200.761583 1201.462965 1201.741747 1195.871756 1200.290255 1202.959388 236.9569677 242.2434395 238.9672075 696.0068487 695.1698281 287.8962887 288.7874757 285.2472588 -6371.25222 -6427.286758 -6467.522547 -6522.286777 -6586.180432 -6627.063506 -6491.525537 -6576.009404 -6649.42216 -6344.672624 -6415.709132 -6471.322447 -6147.792288 -6198.925133 -6239.910805 -6210.845452 -6271.826836 -6324.685074 -2911.086939 -2911.26141 -2915.696895 3888.385394 3891.470796 3851.353729 3182.987208 3179.701237 3111.295621 1750.094784 1744.819852 1734.456247 1741.863871 1739.092555 1731.195641 -2144.580355 -2152.855023 -2157.577542 -3991.654912 -4021.2696 -4043.142495 3050.350376 3046.427343 3007.850165 1684.270671 1683.161154 1682.548397 1694.25552 1697.34062 1699.462143 1606.406984 1607.336497 1607.971087 1608.957812 1609.882469 1610.389796 1641.023859 1639.584343 1639.212002 1630.234089 1624.834396 1618.818888 1567.322607 1568.271939 1570.203466 1558.560495 1559.542662 1561.066292 1488.522341 1488.390239 1488.583441 1497.505846 1497.710681 1498.290483 1289.340913 1291.769211 1292.80774 1154.685114 1153.649671 1153.288571 1136.12799 1135.867556 1135.522471 1162.92966 1160.952184 1160.24954 1195.498706 1204.191569 1213.076116 -459.9509491 -469.0933139 -475.2479313 47.1859617 51.31479544 47.76244074 -11.06859324 -15.99491487 -19.88609868 -7988.453262 -8228.376349 -8462.202664 -7941.449976 -8142.776724 -8351.356025 -5282.370556 -5321.399428 -5352.608257 -4028.146085 -4045.858887 -4055.321439 -3097.967938 -3111.038063 -3121.260744 -2874.817391 -2885.060612 -2891.901121 -3050.421795 -3070.924374 -3086.812163 5076.021103 5206.937976 5356.871598 -2443.602797 -2463.272522 -2478.860333 -2300.831293 -2309.562287 -2317.597583 1805.59324 1802.407159 1785.912524 1822.160906 1814.969947 1790.855798 1780.084889 1778.156122 1771.820593 1724.414602 1721.402835 1718.69701 -2067.539358 -2074.257689 -2081.650467 -817.5261104 -827.8718799 -833.8431674 -8473.777769 -8784.250195 -9426.067763 -3886.286079 -3896.853684 -3903.994566 -3775.659677 -3806.46847 -3832.394457 -3701.099298 -3715.401654 -3726.327658 1666.343352 1663.224395 1657.008875 1702.376115 1702.586784 1698.826932 1603.531507 1606.284683 1608.787984 1616.093546 1616.708342 1616.598229 1657.725188 1659.751835 1660.297829 1622.477634 1623.692383 1622.299141 1590.671987 1593.765591 1597.819906 1540.361599 1540.984574 1542.017818 1469.208865 1470.145721 1470.921781 1460.181581 1459.085995 1458.828248 1514.270077 1514.559681 1514.978017 1385.244263 1388.083914 1390.757129 1388.698255 1391.225354 1392.711415 1408.816305 1407.859738 1407.348727 1401.981098 1400.22975 1399.258035 1452.057923 1449.782459 1448.553871 1442.672314 1439.418276 1436.404097 1416.743619 1417.273748 1417.915318 1423.996526 1426.687522 1429.28199 1379.538427 1380.37182 1381.137208 1373.527896 1373.390802 1373.346685 -214.0887781 -224.4391095 -231.0395952 619.0764646 611.810578 606.3258527 -8197.742659 -8391.045144 -8703.790222 -7785.451477 -7948.734371 -8098.339267 -7717.999895 -7906.215548 -8057.755558 -7681.074613 -7864.812402 -8004.372996 -4678.595246 -4710.015959 -4741.879851 -4726.333393 -4747.152399 -4761.822128 -4107.424892 -4123.450958 -4134.018282 -4610.979425 -4637.729728 -4660.067324 -4532.733087 -4551.329559 -4565.043768 -5806.400132 -6725.548914 -10239.52608 -2523.507046 -2523.509845 -2528.319725 -2484.08299 -2494.127672 -2501.825551 -2252.244478 -2268.963868 -2282.271865 1208.827528 1206.776361 1205.560721 -1534.368231 -1538.743332 -1543.308464 -1489.222029 -1503.105206 -1511.936977 1196.581119 1197.259528 1197.295524 1195.380392 1196.999823 1197.858343 1060.19114 1071.074464 1083.79315 179.9390874 176.6747116 173.07768 -6408.135716 -6458.17002 -6499.455634 -6452.811923 -6511.769466 -6564.359231 -6316.404555 -6397.470361 -6466.174414 -6259.048372 -6315.075459 -6359.826486 3336.631152 3337.295478 3275.393773 3594.070764 3579.146351 3513.826704 1763.586506 1758.772468 1748.716327 1734.864103 1735.159435 1732.92426 -2111.088028 -2112.297546 -2119.120034 -936.6649275 -939.3676371 -942.8105771 -886.5509388 -896.2035021 -903.2835785 -985.2410642 -981.7372522 -984.4691231 -1033.701264 -1040.44961 -1044.264028 -8664.469387 -8468.425834 -9602.970892 -3940.045093 -3948.891085 -3960.222987 1672.743708 1667.209934 1659.116464 1699.688193 1701.872219 1700.285683 1604.564924 1606.009234 1607.430221 1612.046251 1613.075222 1613.579525 1651.007762 1653.473043 1656.866439 1624.133651 1619.667333 1612.782192 1577.56136 1577.424452 1578.062484 1549.40767 1549.856382 1550.616378 1480.067503 1480.077151 1480.354312 1506.09175 1506.860433 1508.059861 1392.290586 1392.928677 1392.71875 1390.843092 1392.294551 1392.628112 1393.473247 1392.373984 1390.636212 1396.330064 1393.407552 1390.034545 1432.784941 1432.351485 1430.792966 1435.522421 1432.193446 1427.176963 1431.42775 1432.778745 1432.907536 1428.630779 1430.834818 1431.825427 1364.1013 1364.652586 1365.163631 1368.648738 1368.715139 1368.774726 1359.296981 1359.782487 1360.36262 1352.021677 1352.907765 1353.128318 1148.320951 1147.771056 1147.556718 1141.764772 1141.00267 1140.308605 1175.076587 1175.117738 1176.859978 1188.202523 1193.992571 1201.39328 102.7175753 103.6723259 100.5443468 530.1743084 523.9524809 518.2393988 576.7184406 576.5628825 570.7363325 -8126.080985 -8273.09172 -8515.062323 -7860.785878 -8031.97487 -8201.944639 -7539.714799 -7683.27509 -7783.34445 -7611.349851 -7778.716424 -7901.298438 -7504.715324 -7647.297945 -7739.602525 -7481.100984 -7642.923395 -7761.371977 -4060.0069 -4074.004466 -4082.372584 -4427.734506 -4454.638392 -4475.822004 -4471.959867 -4490.604224 -4502.870187 -4374.970985 -4396.670789 -4414.194561 -4321.053734 -4335.642824 -4347.372961 -3138.413903 -3140.409872 -3146.979683 -3175.986872 -3183.285937 -3188.945215 -2795.558413 -2814.814645 -2830.290168 -2835.082092 -2856.621907 -2871.863397 -3001.992408 -3014.81097 -3024.516181 -2942.409359 -2949.951542 -2954.742189 -2799.345218 -3601.653917 -6760.124064 713.0260915 ) ; boundaryField { topAndBottom { type slip; } inlet { type zeroGradient; } outlet { type fixedValue; value uniform 0; } wing { type zeroGradient; } front { type empty; } back { type empty; } } // ************************************************************************* //
[ "ishantamrakat24@gmail.com" ]
ishantamrakat24@gmail.com
6a439cbe4e03f4d9342d1442534c71a34dd81d8b
faa198ca154178228f4e77c06ec3c84bfb63469d
/src/features.cpp
a82691e4556e3807eb1fe98b5a780f194197766e
[]
no_license
Arthmoor/AFKMud
af27f98ec485b11376a62530a003b3706caeb666
98df87b336ce81947c23522b13ddc6a4562ed08e
refs/heads/master
2022-09-24T14:48:23.402666
2022-09-04T23:48:04
2022-09-04T23:48:04
25,799,932
35
38
null
2020-03-01T23:44:53
2014-10-27T02:28:59
C++
UTF-8
C++
false
false
18,130
cpp
/**************************************************************************** * ^ +----- | / ^ ^ | | +-\ * * / \ | | / |\ /| | | | \ * * / \ +--- |< | \ / | | | | | * * /-----\ | | \ | v | | | | / * * / \ | | \ | | +-----+ +-/ * **************************************************************************** * AFKMud Copyright 1997-2020 by Roger Libiez (Samson), * * Levi Beckerson (Whir), Michael Ward (Tarl), Erik Wolfe (Dwip), * * Cameron Carroll (Cam), Cyberfox, Karangi, Rathian, Raine, * * Xorith, and Adjani. * * All Rights Reserved. * * * * * * External contributions from Remcon, Quixadhal, Zarius, and many others. * * * * Original SMAUG 1.8b written by Thoric (Derek Snider) with Altrag, * * Blodkai, Haus, Narn, Scryn, Swordbearer, Tricops, Gorog, Rennard, * * Grishnakh, Fireblade, Edmond, Conran, and Nivek. * * * * Original MERC 2.1 code by Hatchet, Furey, and Kahn. * * * * Original DikuMUD code by: Hans Staerfeldt, Katja Nyboe, Tom Madsen, * * Michael Seifert, and Sebastian Hammer. * **************************************************************************** * Extended Mud Features Module: MCCP V2, MSP * ****************************************************************************/ /* Mud Sound Protocol Functions * Original author unknown. * Smaug port by Chris Coulter (aka Gabriel Androctus) */ /* * mccp.c - support functions for mccp (the Mud Client Compression Protocol) * * see https://smaugmuds.afkmods.com/mccp * * Copyright (c) 1999, Oliver Jowett <oliver@randomly.org>. * * This code may be freely distributed and used if this copyright notice is * retained intact. */ #include <cerrno> #if !defined(WIN32) #include <arpa/telnet.h> #include <sys/socket.h> #else #include <unistd.h> #define TELOPT_ECHO '\x01' #define GA '\xF9' #define SB '\xFA' #define SE '\xF0' #define WILL '\xFB' #define WONT '\xFC' #define DO '\xFD' #define DONT '\xFE' #define IAC '\xFF' const int ENOSR = 63; #endif #include "mud.h" #include "descriptor.h" #include "roomindex.h" #if defined(__OpenBSD__) || defined(__FreeBSD__) const int ENOSR = 63; #endif const unsigned char will_compress2_str[] = { IAC, WILL, TELOPT_COMPRESS2, '\0' }; const unsigned char start_compress2_str[] = { IAC, SB, TELOPT_COMPRESS2, IAC, SE, '\0' }; const unsigned char will_msp_str[] = { IAC, WILL, TELOPT_MSP, '\0' }; const unsigned char start_msp_str[] = { IAC, SB, TELOPT_MSP, IAC, SE, '\0' }; /* Begin MCCP Information */ bool descriptor_data::process_compressed( ) { int iStart = 0, nBlock, nWrite, len; if( !mccp->out_compress ) return true; /* * Try to write out some data.. */ len = mccp->out_compress->next_out - mccp->out_compress_buf; if( len > 0 ) { /* * we have some data to write */ for( iStart = 0; iStart < len; iStart += nWrite ) { nBlock = UMIN( len - iStart, 4096 ); if( ( nWrite = send( descriptor, mccp->out_compress_buf + iStart, nBlock, 0 ) ) < 0 ) { if( errno == EAGAIN || errno == ENOSR ) break; return false; } if( !nWrite ) break; } if( iStart ) { /* * We wrote "iStart" bytes */ if( iStart < len ) memmove( mccp->out_compress_buf, mccp->out_compress_buf + iStart, len - iStart ); mccp->out_compress->next_out = mccp->out_compress_buf + len - iStart; } } return true; } bool descriptor_data::compressStart( ) { z_stream *s; if( mccp->out_compress || is_compressing ) return true; CREATE( s, z_stream, 1 ); CREATE( mccp->out_compress_buf, unsigned char, COMPRESS_BUF_SIZE ); s->next_in = nullptr; s->avail_in = 0; s->next_out = mccp->out_compress_buf; s->avail_out = COMPRESS_BUF_SIZE; s->zalloc = Z_NULL; s->zfree = Z_NULL; s->opaque = nullptr; if( deflateInit( s, 9 ) != Z_OK ) { OLD_DISPOSE( mccp->out_compress_buf ); OLD_DISPOSE( s ); return false; } this->write( (const char*)start_compress2_str ); mccp->out_compress = s; is_compressing = true; return true; } bool descriptor_data::compressEnd( ) { unsigned char dummy[1]; if( !mccp->out_compress || !is_compressing ) return true; mccp->out_compress->avail_in = 0; mccp->out_compress->next_in = dummy; if( deflate( mccp->out_compress, Z_FINISH ) == Z_STREAM_END ) process_compressed(); /* try to send any residual data */ deflateEnd( mccp->out_compress ); OLD_DISPOSE( mccp->out_compress_buf ); OLD_DISPOSE( mccp->out_compress ); is_compressing = false; return true; } CMDF( do_compress ) { if( !ch->desc ) { ch->print( "What descriptor?!\r\n" ); return; } if( !ch->desc->mccp->out_compress ) { if( !ch->desc->compressStart( ) ) { ch->desc->can_compress = false; ch->print( "&RCompression failed to start.\r\n" ); } else { ch->desc->can_compress = true; ch->print( "&GOk, compression enabled.\r\n" ); } } else { ch->desc->compressEnd( ); ch->desc->can_compress = false; ch->print( "&ROk, compression disabled.\r\n" ); } } /* End MCCP Information */ /* Start MSP Information */ void descriptor_data::send_msp_startup( ) { write_to_buffer( (const char*)start_msp_str ); } /* Trigger sound to character * * "fname" is the name of the sound file to be played * "vol" is the volume level to play the sound at * "repeats" is the number of times to play the sound * "priority" is the priority of the sound * "type" is the sound Class * "URL" is the optional download URL for the sound file * "ch" is the character to play the sound for * * More detailed information at http://www.zuggsoft.com/ */ void char_data::sound( const string & fname, int volume, bool toroom ) { const char *type = "mud"; int repeats = 1, priority = 50; char url[MSL]; if( sysdata->http.empty( ) ) return; snprintf( url, MSL, "%s/sounds/", sysdata->http.c_str( ) ); if( !toroom ) { if( !MSP_ON( ) ) return; if( url[0] != '\0' ) printf( "!!SOUND(%s V=%d L=%d P=%d T=%s U=%s)\r\n", fname.c_str( ), volume, repeats, priority, type, url ); else printf( "!!SOUND(%s V=%d L=%d P=%d T=%s)\r\n", fname.c_str( ), volume, repeats, priority, type ); } else { list < char_data * >::iterator ich; for( ich = in_room->people.begin( ); ich != in_room->people.end( ); ++ich ) { char_data *vch = *ich; if( !vch->MSP_ON( ) ) continue; if( url[0] != '\0' ) vch->printf( "!!SOUND(%s V=%d L=%d P=%d T=%s U=%s)\r\n", fname.c_str( ), volume, repeats, priority, type, url ); else vch->printf( "!!SOUND(%s V=%d L=%d P=%d T=%s)\r\n", fname.c_str( ), volume, repeats, priority, type ); } } } /* Trigger music file ... * * "fname" is the name of the music file to be played * "vol" is the volume level to play the music at * "repeats" is the number of times to play the music file * "continu" specifies whether the file should be restarted if requested again * "type" is the sound Class * "URL" is the optional download URL for the sound file * "ch" is the character to play the music for * * more detailed information at: http://www.zuggsoft.com/ */ void char_data::music( const string & fname, int volume, bool toroom ) { const char *type = "mud"; int repeats = 1, continu = 1; char url[MSL]; if( sysdata->http.empty( ) ) return; snprintf( url, MSL, "%s/sounds/%s", sysdata->http.c_str( ), fname.c_str( ) ); if( !toroom ) { if( !MSP_ON( ) ) return; if( url[0] != '\0' ) printf( "!!MUSIC(%s V=%d L=%d C=%d T=%s U=%s)\r\n", fname.c_str( ), volume, repeats, continu, type, url ); else printf( "!!MUSIC(%s V=%d L=%d C=%d T=%s)\r\n", fname.c_str( ), volume, repeats, continu, type ); } else { list < char_data * >::iterator ich; for( ich = in_room->people.begin( ); ich != in_room->people.end( ); ++ich ) { char_data *vch = *ich; if( !vch->MSP_ON( ) ) return; if( url[0] != '\0' ) vch->printf( "!!MUSIC(%s V=%d L=%d C=%d T=%s U=%s)\r\n", fname.c_str( ), volume, repeats, continu, type, url ); else vch->printf( "!!MUSIC(%s V=%d L=%d C=%d T=%s)\r\n", fname.c_str( ), volume, repeats, continu, type ); } } } /* stop playing sound */ void char_data::reset_sound( ) { if( MSP_ON( ) ) print( "!!SOUND(Off)\r\n" ); } /* stop playing music */ void char_data::reset_music( ) { if( MSP_ON( ) ) print( "!!MUSIC(Off)\r\n" ); } /* sound support -haus */ CMDF( do_mpsoundaround ) { string target, vol; int volume; char_data *victim; bitset < MAX_ACT_FLAG > actflags; if( !ch->isnpc( ) || ch->has_aflag( AFF_CHARM ) ) { ch->print( "Huh?\r\n" ); return; } argument = one_argument( argument, target ); if( !( victim = ch->get_char_room( target ) ) ) { progbugf( ch, "%s", "Mpsoundaround - No victim specified" ); return; } argument = one_argument( argument, vol ); if( vol.empty( ) ) { progbugf( ch, "%s", "Mpsoundaround - No volume level specified" ); return; } if( !is_number( vol ) ) { progbugf( ch, "%s", "mpsoundaround - non-numerical volume level specified" ); return; } volume = atoi( vol.c_str( ) ); if( volume < 1 || volume > 100 ) { progbugf( ch, "mpsoundaround - invalid volume %d. range is 1 to 100", volume ); return; } if( argument.empty( ) ) { progbugf( ch, "%s", "mpsoundaround - no sound file specified" ); return; } actflags = ch->get_actflags( ); ch->unset_actflag( ACT_SECRETIVE ); victim->sound( argument, volume, true ); ch->set_actflags( actflags ); } /* prints message only to victim */ CMDF( do_mpsoundat ) { string target, vol; int volume; char_data *victim; bitset < MAX_ACT_FLAG > actflags; if( !ch->isnpc( ) || ch->has_aflag( AFF_CHARM ) ) { ch->print( "Huh?\r\n" ); return; } argument = one_argument( argument, target ); if( !( victim = ch->get_char_room( target ) ) ) { progbugf( ch, "%s", "mpsoundat - No victim specified" ); return; } argument = one_argument( argument, vol ); if( vol.empty( ) ) { progbugf( ch, "%s", "mpsoundat - No volume level specified" ); return; } if( !is_number( vol ) ) { progbugf( ch, "%s", "mpsoundat - non-numerical volume level specified" ); return; } volume = atoi( vol.c_str( ) ); if( volume < 1 || volume > 100 ) { progbugf( ch, "mpsoundat - invalid volume %d. range is 1 to 100", volume ); return; } if( argument.empty( ) ) { progbugf( ch, "%s", "mpsoundat - no sound file specified" ); return; } actflags = ch->get_actflags( ); ch->unset_actflag( ACT_SECRETIVE ); victim->sound( argument, volume, false ); ch->set_actflags( actflags ); } /* prints message to room at large. */ CMDF( do_mpsound ) { string vol; int volume; bitset < MAX_ACT_FLAG > actflags; if( !ch->isnpc( ) || ch->has_aflag( AFF_CHARM ) ) { ch->print( "Huh?\r\n" ); return; } argument = one_argument( argument, vol ); if( vol.empty( ) ) { progbugf( ch, "%s", "mpsound - No volume level specified" ); return; } if( !is_number( vol ) ) { progbugf( ch, "%s", "mpsound - non-numerical volume level specified" ); return; } volume = atoi( vol.c_str( ) ); if( volume < 1 || volume > 100 ) { progbugf( ch, "mpsound - invalid volume %d. range is 1 to 100", volume ); return; } if( argument.empty( ) ) { progbugf( ch, "%s", "mpsound - no sound file specified" ); return; } actflags = ch->get_actflags( ); ch->unset_actflag( ACT_SECRETIVE ); ch->sound( argument, volume, true ); ch->set_actflags( actflags ); } /* prints sound to everyone in the zone - yes, this COULD get rather bad if people go nuts with it */ CMDF( do_mpsoundzone ) { string vol; if( !ch->isnpc( ) || ch->has_aflag( AFF_CHARM ) ) { ch->print( "Huh?\r\n" ); return; } argument = one_argument( argument, vol ); if( vol.empty( ) ) { progbugf( ch, "%s", "mpsoundzone - No volume level specified" ); return; } if( !is_number( vol ) ) { progbugf( ch, "%s", "mpsoundzone - non-numerical volume level specified" ); return; } int volume = atoi( vol.c_str( ) ); if( volume < 1 || volume > 100 ) { progbugf( ch, "mpsoundzone - invalid volume %d. range is 1 to 100", volume ); return; } if( argument.empty( ) ) { progbugf( ch, "%s", "mpsoundzone - no sound file specified" ); return; } bitset < MAX_ACT_FLAG > actflags = ch->get_actflags( ); ch->unset_actflag( ACT_SECRETIVE ); list < char_data * >::iterator ich; for( ich = charlist.begin( ); ich != charlist.end( ); ++ich ) { char_data *vch = *ich; if( vch->in_room && vch->in_room->area == ch->in_room->area ) vch->sound( argument, volume, false ); } ch->set_actflags( actflags ); } /* Music stuff, same as above, at zMUD coders' request -- Blodkai */ CMDF( do_mpmusicaround ) { string target, vol; int volume; char_data *victim; bitset < MAX_ACT_FLAG > actflags; if( !ch->isnpc( ) || ch->has_aflag( AFF_CHARM ) ) { ch->print( "Huh?\r\n" ); return; } argument = one_argument( argument, target ); if( !( victim = ch->get_char_room( target ) ) ) { progbugf( ch, "%s", "mpmusicaround - No victim specified" ); return; } argument = one_argument( argument, vol ); if( vol.empty( ) ) { progbugf( ch, "%s", "mpmusicaround - No volume level specified" ); return; } if( !is_number( vol ) ) { progbugf( ch, "%s", "mpmusicaround - non-numerical volume level specified" ); return; } volume = atoi( vol.c_str( ) ); if( volume < 1 || volume > 100 ) { progbugf( ch, "mpmusicaround - invalid volume %d. range is 1 to 100", volume ); return; } if( argument.empty( ) ) { progbugf( ch, "%s", "mpmusicaround - no sound file specified" ); return; } actflags = ch->get_actflags( ); ch->unset_actflag( ACT_SECRETIVE ); victim->music( argument, volume, true ); ch->set_actflags( actflags ); } CMDF( do_mpmusic ) { string target, vol; int volume; char_data *victim; bitset < MAX_ACT_FLAG > actflags; if( !ch->isnpc( ) || ch->has_aflag( AFF_CHARM ) ) { ch->print( "Huh?\r\n" ); return; } argument = one_argument( argument, target ); if( !( victim = ch->get_char_room( target ) ) ) { progbugf( ch, "%s", "mpmusic - No victim specified" ); return; } argument = one_argument( argument, vol ); if( vol.empty( ) ) { progbugf( ch, "%s", "mpmusic - No volume level specified" ); return; } if( !is_number( vol ) ) { progbugf( ch, "%s", "mpmusic - non-numerical volume level specified" ); return; } volume = atoi( vol.c_str( ) ); if( volume < 1 || volume > 100 ) { progbugf( ch, "mpmusic - invalid volume %d. range is 1 to 100", volume ); return; } if( argument.empty( ) ) { progbugf( ch, "%s", "mpmusic - no sound file specified" ); return; } actflags = ch->get_actflags( ); ch->unset_actflag( ACT_SECRETIVE ); victim->music( argument, volume, true ); ch->set_actflags( actflags ); } CMDF( do_mpmusicat ) { string target, vol; int volume; char_data *victim; bitset < MAX_ACT_FLAG > actflags; if( !ch->isnpc( ) || ch->has_aflag( AFF_CHARM ) ) { ch->print( "Huh?\r\n" ); return; } argument = one_argument( argument, target ); if( !( victim = ch->get_char_room( target ) ) ) { progbugf( ch, "%s", "mpmusicat - No victim specified" ); return; } argument = one_argument( argument, vol ); if( vol.empty( ) ) { progbugf( ch, "%s", "mpmusicat - No volume level specified" ); return; } if( !is_number( vol ) ) { progbugf( ch, "%s", "mpmusicat - non-numerical volume level specified" ); return; } volume = atoi( vol.c_str( ) ); if( volume < 1 || volume > 100 ) { progbugf( ch, "mpmusicat - invalid volume %d. range is 1 to 100", volume ); return; } if( argument.empty( ) ) { progbugf( ch, "%s", "mpmusicat - no sound file specified" ); return; } actflags = ch->get_actflags( ); ch->unset_actflag( ACT_SECRETIVE ); victim->music( argument, volume, false ); ch->set_actflags( actflags ); } /* End MSP Information */
[ "arthmoor@gmail.com" ]
arthmoor@gmail.com
dd28ee4142371679600da21c303fc7d14a2f4e5d
480120c4e946bafae16ca1eb1fb209c963b2f17c
/util/include/crypto/crypto.hpp
8a6ad1d32ac6936afc15a6c823a876efd56bd0f0
[ "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
permissive
yontyon/concord-bft
0f7a80305ce8e2f0f1f3f3ec85ac1cdaf57af90b
01faa1d7d010265f389603da03d712681067fc1b
refs/heads/master
2023-05-01T10:09:18.747846
2023-01-13T18:07:16
2023-01-13T18:07:16
219,316,240
1
0
null
2022-10-25T08:36:41
2019-11-03T14:49:06
C++
UTF-8
C++
false
false
5,220
hpp
// Concord // // Copyright (c) 2022 VMware, Inc. All Rights Reserved. // // This product is licensed to you under the Apache 2.0 license (the "License"). // You may not use this product except in compliance with the Apache 2.0 // License. // // This product may include a number of subcomponents with separate copyright // notices and license terms. Your use of these subcomponents is subject to the // terms and conditions of the sub-component's license, as noted in the LICENSE // file. #pragma once #include <cstdint> #include <string> #include <cstddef> namespace concord::crypto { // Interface for wrapper class for private keys in asymmetric cryptography // schemes. class AsymmetricPrivateKey { public: // As this is an abstract class written with the intention it should be used // only through polymorphic pointers, copying or moving AsymmetricPrivateKey // instances directly is not supported. AsymmetricPrivateKey(const AsymmetricPrivateKey& other) = delete; AsymmetricPrivateKey(const AsymmetricPrivateKey&& other) = delete; AsymmetricPrivateKey& operator=(const AsymmetricPrivateKey& other) = delete; AsymmetricPrivateKey& operator=(const AsymmetricPrivateKey&& other) = delete; virtual ~AsymmetricPrivateKey() {} // Serialize the private key to a printable format, returning the serialized // object as a string. May throw an OpenSSLError if // the underlying OpenSSL Crypto library unexpectedly reports a failure while // attempting this operation. virtual std::string serialize() const = 0; // Produce and return a signature of a given message. Note both the message // and signature are logically byte strings handled via std::strings. May // throw an OpenSSLError if the underlying OpenSSL // Crypto library unexpectedly reports a failure while attempting this // operation. virtual std::string sign(const std::string& message) const = 0; protected: AsymmetricPrivateKey() {} }; // Interface for wrapper classes for public keys in asymmetric cryptography // schemes. class AsymmetricPublicKey { public: // As this is an abstract class written with the intention it should be used // only through polymorphic pointers, copying or moving AsymmetricPublicKey // instances directly is not supported. AsymmetricPublicKey(const AsymmetricPublicKey& other) = delete; AsymmetricPublicKey(const AsymmetricPublicKey&& other) = delete; AsymmetricPublicKey& operator=(const AsymmetricPublicKey& other) = delete; AsymmetricPublicKey& operator=(const AsymmetricPublicKey&& other) = delete; virtual ~AsymmetricPublicKey() {} // Serialize the public key to a printable format, returning the serialized // object as a string. May throw an OpenSSLError if // the underlying OpenSSL Crypto library unexpectedly reports a failure while // attempting this operation. virtual std::string serialize() const = 0; // Verify a signature of a message allegedly signed with the private key // corresponding to this public key. Note both the message and alleged // signature are logically byte strings handled via std::strings. Returns // true if this private key validates the signature as being a valid signature // of the message under the corresponding public key, and false otherwise. May // throw an OpenSSLError if the underlying OpenSSL // Crypto library unexpectedly reports a failure while attempting this // operation. virtual bool verify(const std::string& message, const std::string& signature) const = 0; protected: AsymmetricPublicKey() {} }; enum SignatureAlgorithm : uint32_t { Uninitialized = 0, BLS = 1, EdDSA = 2, RSA = 3 }; enum class KeyFormat : uint16_t { HexaDecimalStrippedFormat, PemFormat }; enum class CurveType : uint16_t { secp256k1, secp384r1 }; static constexpr const size_t Ed25519PrivateKeyByteSize = 32UL; static constexpr const size_t Ed25519PublicKeyByteSize = 32UL; static constexpr const size_t Ed25519SignatureByteSize = 64UL; /** * @brief Generates an EdDSA asymmetric key pair (private-public key pair). * * @param fmt Output key format. * @return pair<string, string> Private-Public key pair. */ std::pair<std::string, std::string> generateEdDSAKeyPair(const KeyFormat fmt = KeyFormat::HexaDecimalStrippedFormat); /** * @brief Generates an EdDSA PEM file from hexadecimal key pair (private-public key pair). * * @param key_pair Key pair in hexa-decimal format. * @return pair<string, string> */ std::pair<std::string, std::string> EdDSAHexToPem(const std::pair<std::string, std::string>& hex_key_pair); /** * @brief If the key string contains 'BEGIN' token, then it is PEM format, else HEX format. * * @param key * @return KeyFormat Returns the key's format. * @todo The check to identify the format is not generic. Need to implement some generic way * identifying the input format. */ KeyFormat getFormat(const std::string& key_str); /** * @brief Validates the key. * * @param keyType Key type to be validated. * @param key Key to be validate. * @param expectedSize Size of the key to be validated. * @return Validation result. */ bool isValidKey(const std::string& keyType, const std::string& key, size_t expectedSize); } // namespace concord::crypto
[ "pkumarthapa@vmware.com" ]
pkumarthapa@vmware.com
9cdb2909038c26b0a713c022a7472f837ea027f6
dae497126da9d95b268b8bc4431f945e3d957e01
/GRPG/spacewar.h
7a2f72e9fc1a3eb89ca245ac8a7c0f0eab5b8b63
[]
no_license
jer-lim/GRPG
c18c6bafed19e5ff0780e463da9c20080c34278c
cdd347652df1c22058c54b74d5e9ce084c66b8a8
refs/heads/master
2021-06-18T23:58:36.969242
2021-02-06T10:07:42
2021-02-06T10:07:42
148,820,910
0
0
null
null
null
null
UTF-8
C++
false
false
1,247
h
// Programming 2D Games // Copyright (c) 2011 by: // Charles Kelly // Chapter 6 spacewar.h v1.0 #ifndef _SPACEWAR_H // Prevent multiple definitions if this #define _SPACEWAR_H // file is included in more than one place #define WIN32_LEAN_AND_MEAN #include "game.h" #include "textureManager.h" #include "image.h" #include "planet.h" #include "ship.h" //============================================================================= // This class is the core of the game //============================================================================= class Spacewar : public Game { private: // game items TextureManager nebulaTexture; // nebula texture TextureManager gameTextures; // game texture Ship ship1, ship2, ship3, ship4; // spaceships Planet planet; // the planet Image nebula; // backdrop image public: // Constructor Spacewar(); // Destructor virtual ~Spacewar(); // Initialize the game void initialize(HWND hwnd); void update(); // must override pure virtual from Game void ai(); // " void collisions(); // " void render(); // " void releaseAll(); void resetAll(); }; #endif
[ "ChooJeremy@Ymail.com" ]
ChooJeremy@Ymail.com
61ba30b208dd79045e1bc2d2facdd6ab2e705ece
33e67303e33744f3f9c32a44fbe37aad878a0bca
/aws-cpp-sdk-ec2/include/aws/ec2/model/ClientVpnEndpoint.h
dd963ac910a7e9fd7223786881a36b8726da8887
[ "Apache-2.0", "MIT", "JSON" ]
permissive
crazecdwn/aws-sdk-cpp
2694bebef950e85af0104d10f8f326d54c057844
e74b9181a56e82ee04cf36a4cb31686047f4be42
refs/heads/master
2022-07-09T05:06:43.395448
2020-06-12T01:38:17
2020-06-12T01:38:17
192,119,343
0
0
Apache-2.0
2022-05-20T22:07:13
2019-06-15T20:03:54
C++
UTF-8
C++
false
false
25,637
h
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/ec2/EC2_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSStreamFwd.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/ec2/model/ClientVpnEndpointStatus.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/ec2/model/VpnProtocol.h> #include <aws/ec2/model/TransportProtocol.h> #include <aws/ec2/model/ConnectionLogResponseOptions.h> #include <aws/ec2/model/ClientVpnAuthentication.h> #include <aws/ec2/model/Tag.h> #include <utility> namespace Aws { namespace Utils { namespace Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace EC2 { namespace Model { /** * <p>Describes a Client VPN endpoint.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ClientVpnEndpoint">AWS * API Reference</a></p> */ class AWS_EC2_API ClientVpnEndpoint { public: ClientVpnEndpoint(); ClientVpnEndpoint(const Aws::Utils::Xml::XmlNode& xmlNode); ClientVpnEndpoint& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; void OutputToStream(Aws::OStream& oStream, const char* location) const; /** * <p>The ID of the Client VPN endpoint.</p> */ inline const Aws::String& GetClientVpnEndpointId() const{ return m_clientVpnEndpointId; } /** * <p>The ID of the Client VPN endpoint.</p> */ inline bool ClientVpnEndpointIdHasBeenSet() const { return m_clientVpnEndpointIdHasBeenSet; } /** * <p>The ID of the Client VPN endpoint.</p> */ inline void SetClientVpnEndpointId(const Aws::String& value) { m_clientVpnEndpointIdHasBeenSet = true; m_clientVpnEndpointId = value; } /** * <p>The ID of the Client VPN endpoint.</p> */ inline void SetClientVpnEndpointId(Aws::String&& value) { m_clientVpnEndpointIdHasBeenSet = true; m_clientVpnEndpointId = std::move(value); } /** * <p>The ID of the Client VPN endpoint.</p> */ inline void SetClientVpnEndpointId(const char* value) { m_clientVpnEndpointIdHasBeenSet = true; m_clientVpnEndpointId.assign(value); } /** * <p>The ID of the Client VPN endpoint.</p> */ inline ClientVpnEndpoint& WithClientVpnEndpointId(const Aws::String& value) { SetClientVpnEndpointId(value); return *this;} /** * <p>The ID of the Client VPN endpoint.</p> */ inline ClientVpnEndpoint& WithClientVpnEndpointId(Aws::String&& value) { SetClientVpnEndpointId(std::move(value)); return *this;} /** * <p>The ID of the Client VPN endpoint.</p> */ inline ClientVpnEndpoint& WithClientVpnEndpointId(const char* value) { SetClientVpnEndpointId(value); return *this;} /** * <p>A brief description of the endpoint.</p> */ inline const Aws::String& GetDescription() const{ return m_description; } /** * <p>A brief description of the endpoint.</p> */ inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; } /** * <p>A brief description of the endpoint.</p> */ inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; } /** * <p>A brief description of the endpoint.</p> */ inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); } /** * <p>A brief description of the endpoint.</p> */ inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); } /** * <p>A brief description of the endpoint.</p> */ inline ClientVpnEndpoint& WithDescription(const Aws::String& value) { SetDescription(value); return *this;} /** * <p>A brief description of the endpoint.</p> */ inline ClientVpnEndpoint& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;} /** * <p>A brief description of the endpoint.</p> */ inline ClientVpnEndpoint& WithDescription(const char* value) { SetDescription(value); return *this;} /** * <p>The current state of the Client VPN endpoint.</p> */ inline const ClientVpnEndpointStatus& GetStatus() const{ return m_status; } /** * <p>The current state of the Client VPN endpoint.</p> */ inline bool StatusHasBeenSet() const { return m_statusHasBeenSet; } /** * <p>The current state of the Client VPN endpoint.</p> */ inline void SetStatus(const ClientVpnEndpointStatus& value) { m_statusHasBeenSet = true; m_status = value; } /** * <p>The current state of the Client VPN endpoint.</p> */ inline void SetStatus(ClientVpnEndpointStatus&& value) { m_statusHasBeenSet = true; m_status = std::move(value); } /** * <p>The current state of the Client VPN endpoint.</p> */ inline ClientVpnEndpoint& WithStatus(const ClientVpnEndpointStatus& value) { SetStatus(value); return *this;} /** * <p>The current state of the Client VPN endpoint.</p> */ inline ClientVpnEndpoint& WithStatus(ClientVpnEndpointStatus&& value) { SetStatus(std::move(value)); return *this;} /** * <p>The date and time the Client VPN endpoint was created.</p> */ inline const Aws::String& GetCreationTime() const{ return m_creationTime; } /** * <p>The date and time the Client VPN endpoint was created.</p> */ inline bool CreationTimeHasBeenSet() const { return m_creationTimeHasBeenSet; } /** * <p>The date and time the Client VPN endpoint was created.</p> */ inline void SetCreationTime(const Aws::String& value) { m_creationTimeHasBeenSet = true; m_creationTime = value; } /** * <p>The date and time the Client VPN endpoint was created.</p> */ inline void SetCreationTime(Aws::String&& value) { m_creationTimeHasBeenSet = true; m_creationTime = std::move(value); } /** * <p>The date and time the Client VPN endpoint was created.</p> */ inline void SetCreationTime(const char* value) { m_creationTimeHasBeenSet = true; m_creationTime.assign(value); } /** * <p>The date and time the Client VPN endpoint was created.</p> */ inline ClientVpnEndpoint& WithCreationTime(const Aws::String& value) { SetCreationTime(value); return *this;} /** * <p>The date and time the Client VPN endpoint was created.</p> */ inline ClientVpnEndpoint& WithCreationTime(Aws::String&& value) { SetCreationTime(std::move(value)); return *this;} /** * <p>The date and time the Client VPN endpoint was created.</p> */ inline ClientVpnEndpoint& WithCreationTime(const char* value) { SetCreationTime(value); return *this;} /** * <p>The date and time the Client VPN endpoint was deleted, if applicable.</p> */ inline const Aws::String& GetDeletionTime() const{ return m_deletionTime; } /** * <p>The date and time the Client VPN endpoint was deleted, if applicable.</p> */ inline bool DeletionTimeHasBeenSet() const { return m_deletionTimeHasBeenSet; } /** * <p>The date and time the Client VPN endpoint was deleted, if applicable.</p> */ inline void SetDeletionTime(const Aws::String& value) { m_deletionTimeHasBeenSet = true; m_deletionTime = value; } /** * <p>The date and time the Client VPN endpoint was deleted, if applicable.</p> */ inline void SetDeletionTime(Aws::String&& value) { m_deletionTimeHasBeenSet = true; m_deletionTime = std::move(value); } /** * <p>The date and time the Client VPN endpoint was deleted, if applicable.</p> */ inline void SetDeletionTime(const char* value) { m_deletionTimeHasBeenSet = true; m_deletionTime.assign(value); } /** * <p>The date and time the Client VPN endpoint was deleted, if applicable.</p> */ inline ClientVpnEndpoint& WithDeletionTime(const Aws::String& value) { SetDeletionTime(value); return *this;} /** * <p>The date and time the Client VPN endpoint was deleted, if applicable.</p> */ inline ClientVpnEndpoint& WithDeletionTime(Aws::String&& value) { SetDeletionTime(std::move(value)); return *this;} /** * <p>The date and time the Client VPN endpoint was deleted, if applicable.</p> */ inline ClientVpnEndpoint& WithDeletionTime(const char* value) { SetDeletionTime(value); return *this;} /** * <p>The DNS name to be used by clients when connecting to the Client VPN * endpoint.</p> */ inline const Aws::String& GetDnsName() const{ return m_dnsName; } /** * <p>The DNS name to be used by clients when connecting to the Client VPN * endpoint.</p> */ inline bool DnsNameHasBeenSet() const { return m_dnsNameHasBeenSet; } /** * <p>The DNS name to be used by clients when connecting to the Client VPN * endpoint.</p> */ inline void SetDnsName(const Aws::String& value) { m_dnsNameHasBeenSet = true; m_dnsName = value; } /** * <p>The DNS name to be used by clients when connecting to the Client VPN * endpoint.</p> */ inline void SetDnsName(Aws::String&& value) { m_dnsNameHasBeenSet = true; m_dnsName = std::move(value); } /** * <p>The DNS name to be used by clients when connecting to the Client VPN * endpoint.</p> */ inline void SetDnsName(const char* value) { m_dnsNameHasBeenSet = true; m_dnsName.assign(value); } /** * <p>The DNS name to be used by clients when connecting to the Client VPN * endpoint.</p> */ inline ClientVpnEndpoint& WithDnsName(const Aws::String& value) { SetDnsName(value); return *this;} /** * <p>The DNS name to be used by clients when connecting to the Client VPN * endpoint.</p> */ inline ClientVpnEndpoint& WithDnsName(Aws::String&& value) { SetDnsName(std::move(value)); return *this;} /** * <p>The DNS name to be used by clients when connecting to the Client VPN * endpoint.</p> */ inline ClientVpnEndpoint& WithDnsName(const char* value) { SetDnsName(value); return *this;} /** * <p>The IPv4 address range, in CIDR notation, from which client IP addresses are * assigned.</p> */ inline const Aws::String& GetClientCidrBlock() const{ return m_clientCidrBlock; } /** * <p>The IPv4 address range, in CIDR notation, from which client IP addresses are * assigned.</p> */ inline bool ClientCidrBlockHasBeenSet() const { return m_clientCidrBlockHasBeenSet; } /** * <p>The IPv4 address range, in CIDR notation, from which client IP addresses are * assigned.</p> */ inline void SetClientCidrBlock(const Aws::String& value) { m_clientCidrBlockHasBeenSet = true; m_clientCidrBlock = value; } /** * <p>The IPv4 address range, in CIDR notation, from which client IP addresses are * assigned.</p> */ inline void SetClientCidrBlock(Aws::String&& value) { m_clientCidrBlockHasBeenSet = true; m_clientCidrBlock = std::move(value); } /** * <p>The IPv4 address range, in CIDR notation, from which client IP addresses are * assigned.</p> */ inline void SetClientCidrBlock(const char* value) { m_clientCidrBlockHasBeenSet = true; m_clientCidrBlock.assign(value); } /** * <p>The IPv4 address range, in CIDR notation, from which client IP addresses are * assigned.</p> */ inline ClientVpnEndpoint& WithClientCidrBlock(const Aws::String& value) { SetClientCidrBlock(value); return *this;} /** * <p>The IPv4 address range, in CIDR notation, from which client IP addresses are * assigned.</p> */ inline ClientVpnEndpoint& WithClientCidrBlock(Aws::String&& value) { SetClientCidrBlock(std::move(value)); return *this;} /** * <p>The IPv4 address range, in CIDR notation, from which client IP addresses are * assigned.</p> */ inline ClientVpnEndpoint& WithClientCidrBlock(const char* value) { SetClientCidrBlock(value); return *this;} /** * <p>Information about the DNS servers to be used for DNS resolution. </p> */ inline const Aws::Vector<Aws::String>& GetDnsServers() const{ return m_dnsServers; } /** * <p>Information about the DNS servers to be used for DNS resolution. </p> */ inline bool DnsServersHasBeenSet() const { return m_dnsServersHasBeenSet; } /** * <p>Information about the DNS servers to be used for DNS resolution. </p> */ inline void SetDnsServers(const Aws::Vector<Aws::String>& value) { m_dnsServersHasBeenSet = true; m_dnsServers = value; } /** * <p>Information about the DNS servers to be used for DNS resolution. </p> */ inline void SetDnsServers(Aws::Vector<Aws::String>&& value) { m_dnsServersHasBeenSet = true; m_dnsServers = std::move(value); } /** * <p>Information about the DNS servers to be used for DNS resolution. </p> */ inline ClientVpnEndpoint& WithDnsServers(const Aws::Vector<Aws::String>& value) { SetDnsServers(value); return *this;} /** * <p>Information about the DNS servers to be used for DNS resolution. </p> */ inline ClientVpnEndpoint& WithDnsServers(Aws::Vector<Aws::String>&& value) { SetDnsServers(std::move(value)); return *this;} /** * <p>Information about the DNS servers to be used for DNS resolution. </p> */ inline ClientVpnEndpoint& AddDnsServers(const Aws::String& value) { m_dnsServersHasBeenSet = true; m_dnsServers.push_back(value); return *this; } /** * <p>Information about the DNS servers to be used for DNS resolution. </p> */ inline ClientVpnEndpoint& AddDnsServers(Aws::String&& value) { m_dnsServersHasBeenSet = true; m_dnsServers.push_back(std::move(value)); return *this; } /** * <p>Information about the DNS servers to be used for DNS resolution. </p> */ inline ClientVpnEndpoint& AddDnsServers(const char* value) { m_dnsServersHasBeenSet = true; m_dnsServers.push_back(value); return *this; } /** * <p>Indicates whether VPN split tunneling is supported.</p> */ inline bool GetSplitTunnel() const{ return m_splitTunnel; } /** * <p>Indicates whether VPN split tunneling is supported.</p> */ inline bool SplitTunnelHasBeenSet() const { return m_splitTunnelHasBeenSet; } /** * <p>Indicates whether VPN split tunneling is supported.</p> */ inline void SetSplitTunnel(bool value) { m_splitTunnelHasBeenSet = true; m_splitTunnel = value; } /** * <p>Indicates whether VPN split tunneling is supported.</p> */ inline ClientVpnEndpoint& WithSplitTunnel(bool value) { SetSplitTunnel(value); return *this;} /** * <p>The protocol used by the VPN session.</p> */ inline const VpnProtocol& GetVpnProtocol() const{ return m_vpnProtocol; } /** * <p>The protocol used by the VPN session.</p> */ inline bool VpnProtocolHasBeenSet() const { return m_vpnProtocolHasBeenSet; } /** * <p>The protocol used by the VPN session.</p> */ inline void SetVpnProtocol(const VpnProtocol& value) { m_vpnProtocolHasBeenSet = true; m_vpnProtocol = value; } /** * <p>The protocol used by the VPN session.</p> */ inline void SetVpnProtocol(VpnProtocol&& value) { m_vpnProtocolHasBeenSet = true; m_vpnProtocol = std::move(value); } /** * <p>The protocol used by the VPN session.</p> */ inline ClientVpnEndpoint& WithVpnProtocol(const VpnProtocol& value) { SetVpnProtocol(value); return *this;} /** * <p>The protocol used by the VPN session.</p> */ inline ClientVpnEndpoint& WithVpnProtocol(VpnProtocol&& value) { SetVpnProtocol(std::move(value)); return *this;} /** * <p>The transport protocol used by the Client VPN endpoint.</p> */ inline const TransportProtocol& GetTransportProtocol() const{ return m_transportProtocol; } /** * <p>The transport protocol used by the Client VPN endpoint.</p> */ inline bool TransportProtocolHasBeenSet() const { return m_transportProtocolHasBeenSet; } /** * <p>The transport protocol used by the Client VPN endpoint.</p> */ inline void SetTransportProtocol(const TransportProtocol& value) { m_transportProtocolHasBeenSet = true; m_transportProtocol = value; } /** * <p>The transport protocol used by the Client VPN endpoint.</p> */ inline void SetTransportProtocol(TransportProtocol&& value) { m_transportProtocolHasBeenSet = true; m_transportProtocol = std::move(value); } /** * <p>The transport protocol used by the Client VPN endpoint.</p> */ inline ClientVpnEndpoint& WithTransportProtocol(const TransportProtocol& value) { SetTransportProtocol(value); return *this;} /** * <p>The transport protocol used by the Client VPN endpoint.</p> */ inline ClientVpnEndpoint& WithTransportProtocol(TransportProtocol&& value) { SetTransportProtocol(std::move(value)); return *this;} /** * <p>The ARN of the server certificate.</p> */ inline const Aws::String& GetServerCertificateArn() const{ return m_serverCertificateArn; } /** * <p>The ARN of the server certificate.</p> */ inline bool ServerCertificateArnHasBeenSet() const { return m_serverCertificateArnHasBeenSet; } /** * <p>The ARN of the server certificate.</p> */ inline void SetServerCertificateArn(const Aws::String& value) { m_serverCertificateArnHasBeenSet = true; m_serverCertificateArn = value; } /** * <p>The ARN of the server certificate.</p> */ inline void SetServerCertificateArn(Aws::String&& value) { m_serverCertificateArnHasBeenSet = true; m_serverCertificateArn = std::move(value); } /** * <p>The ARN of the server certificate.</p> */ inline void SetServerCertificateArn(const char* value) { m_serverCertificateArnHasBeenSet = true; m_serverCertificateArn.assign(value); } /** * <p>The ARN of the server certificate.</p> */ inline ClientVpnEndpoint& WithServerCertificateArn(const Aws::String& value) { SetServerCertificateArn(value); return *this;} /** * <p>The ARN of the server certificate.</p> */ inline ClientVpnEndpoint& WithServerCertificateArn(Aws::String&& value) { SetServerCertificateArn(std::move(value)); return *this;} /** * <p>The ARN of the server certificate.</p> */ inline ClientVpnEndpoint& WithServerCertificateArn(const char* value) { SetServerCertificateArn(value); return *this;} /** * <p>Information about the authentication method used by the Client VPN * endpoint.</p> */ inline const Aws::Vector<ClientVpnAuthentication>& GetAuthenticationOptions() const{ return m_authenticationOptions; } /** * <p>Information about the authentication method used by the Client VPN * endpoint.</p> */ inline bool AuthenticationOptionsHasBeenSet() const { return m_authenticationOptionsHasBeenSet; } /** * <p>Information about the authentication method used by the Client VPN * endpoint.</p> */ inline void SetAuthenticationOptions(const Aws::Vector<ClientVpnAuthentication>& value) { m_authenticationOptionsHasBeenSet = true; m_authenticationOptions = value; } /** * <p>Information about the authentication method used by the Client VPN * endpoint.</p> */ inline void SetAuthenticationOptions(Aws::Vector<ClientVpnAuthentication>&& value) { m_authenticationOptionsHasBeenSet = true; m_authenticationOptions = std::move(value); } /** * <p>Information about the authentication method used by the Client VPN * endpoint.</p> */ inline ClientVpnEndpoint& WithAuthenticationOptions(const Aws::Vector<ClientVpnAuthentication>& value) { SetAuthenticationOptions(value); return *this;} /** * <p>Information about the authentication method used by the Client VPN * endpoint.</p> */ inline ClientVpnEndpoint& WithAuthenticationOptions(Aws::Vector<ClientVpnAuthentication>&& value) { SetAuthenticationOptions(std::move(value)); return *this;} /** * <p>Information about the authentication method used by the Client VPN * endpoint.</p> */ inline ClientVpnEndpoint& AddAuthenticationOptions(const ClientVpnAuthentication& value) { m_authenticationOptionsHasBeenSet = true; m_authenticationOptions.push_back(value); return *this; } /** * <p>Information about the authentication method used by the Client VPN * endpoint.</p> */ inline ClientVpnEndpoint& AddAuthenticationOptions(ClientVpnAuthentication&& value) { m_authenticationOptionsHasBeenSet = true; m_authenticationOptions.push_back(std::move(value)); return *this; } /** * <p>Information about the client connection logging options for the Client VPN * endpoint.</p> */ inline const ConnectionLogResponseOptions& GetConnectionLogOptions() const{ return m_connectionLogOptions; } /** * <p>Information about the client connection logging options for the Client VPN * endpoint.</p> */ inline bool ConnectionLogOptionsHasBeenSet() const { return m_connectionLogOptionsHasBeenSet; } /** * <p>Information about the client connection logging options for the Client VPN * endpoint.</p> */ inline void SetConnectionLogOptions(const ConnectionLogResponseOptions& value) { m_connectionLogOptionsHasBeenSet = true; m_connectionLogOptions = value; } /** * <p>Information about the client connection logging options for the Client VPN * endpoint.</p> */ inline void SetConnectionLogOptions(ConnectionLogResponseOptions&& value) { m_connectionLogOptionsHasBeenSet = true; m_connectionLogOptions = std::move(value); } /** * <p>Information about the client connection logging options for the Client VPN * endpoint.</p> */ inline ClientVpnEndpoint& WithConnectionLogOptions(const ConnectionLogResponseOptions& value) { SetConnectionLogOptions(value); return *this;} /** * <p>Information about the client connection logging options for the Client VPN * endpoint.</p> */ inline ClientVpnEndpoint& WithConnectionLogOptions(ConnectionLogResponseOptions&& value) { SetConnectionLogOptions(std::move(value)); return *this;} /** * <p>Any tags assigned to the Client VPN endpoint.</p> */ inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; } /** * <p>Any tags assigned to the Client VPN endpoint.</p> */ inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; } /** * <p>Any tags assigned to the Client VPN endpoint.</p> */ inline void SetTags(const Aws::Vector<Tag>& value) { m_tagsHasBeenSet = true; m_tags = value; } /** * <p>Any tags assigned to the Client VPN endpoint.</p> */ inline void SetTags(Aws::Vector<Tag>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); } /** * <p>Any tags assigned to the Client VPN endpoint.</p> */ inline ClientVpnEndpoint& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;} /** * <p>Any tags assigned to the Client VPN endpoint.</p> */ inline ClientVpnEndpoint& WithTags(Aws::Vector<Tag>&& value) { SetTags(std::move(value)); return *this;} /** * <p>Any tags assigned to the Client VPN endpoint.</p> */ inline ClientVpnEndpoint& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; } /** * <p>Any tags assigned to the Client VPN endpoint.</p> */ inline ClientVpnEndpoint& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; } private: Aws::String m_clientVpnEndpointId; bool m_clientVpnEndpointIdHasBeenSet; Aws::String m_description; bool m_descriptionHasBeenSet; ClientVpnEndpointStatus m_status; bool m_statusHasBeenSet; Aws::String m_creationTime; bool m_creationTimeHasBeenSet; Aws::String m_deletionTime; bool m_deletionTimeHasBeenSet; Aws::String m_dnsName; bool m_dnsNameHasBeenSet; Aws::String m_clientCidrBlock; bool m_clientCidrBlockHasBeenSet; Aws::Vector<Aws::String> m_dnsServers; bool m_dnsServersHasBeenSet; bool m_splitTunnel; bool m_splitTunnelHasBeenSet; VpnProtocol m_vpnProtocol; bool m_vpnProtocolHasBeenSet; TransportProtocol m_transportProtocol; bool m_transportProtocolHasBeenSet; Aws::String m_serverCertificateArn; bool m_serverCertificateArnHasBeenSet; Aws::Vector<ClientVpnAuthentication> m_authenticationOptions; bool m_authenticationOptionsHasBeenSet; ConnectionLogResponseOptions m_connectionLogOptions; bool m_connectionLogOptionsHasBeenSet; Aws::Vector<Tag> m_tags; bool m_tagsHasBeenSet; }; } // namespace Model } // namespace EC2 } // namespace Aws
[ "aws-sdk-cpp-automation@github.com" ]
aws-sdk-cpp-automation@github.com
1feb1fde505dc3dcf471209cb5799287c4acb341
fa9abaa16838c52af01affa4d5246a812f9cb232
/1001.cpp
d3c6b5dda012fcf006759e56739e792e595068d6
[]
no_license
mcc12357/acm-
fcbfa1d6fc5011d9c8c22f2186d44bcd0f1ceb98
114d386353e6cb31f6ba0d121591005bf42e2bed
refs/heads/master
2020-04-03T17:37:35.742867
2019-01-06T01:32:00
2019-01-06T01:32:00
155,452,881
0
0
null
null
null
null
UTF-8
C++
false
false
2,623
cpp
#include<iostream> using namespace std; #include<stdio.h> int f(int a,int b,int c,int m) { return (a*m*m+b*m+c); } int y1(int p1,int p2,int p3) { int min=p1; if(p2<min) min=p2; if(p3<min) min=p3; return min; } int y2(int p1,int p2,int p3) { int max=p1; if(p2>max) max=p2; if(p3>max) max=p3; return max; } int x1(int p1,int p2,int p3,int p4) { int min=p1; if(p2<min) min=p2; if(p3<min) min=p3; if(p4<min) min=p4; return min; } int x2(int p1,int p2,int p3,int p4) { int max=p1; if(p2>max) max=p2; if(p3>max) max=p3; if(p4>max) max=p4; return max; } int g1(int p1,int p2,int p3,int p4,int p5) { int min=p1; if(p2<min) min=p2; if(p3<min) min=p3; if(p4<min) min=p4; if(p5<min) min=p5; return min; } int g2(int p1,int p2,int p3,int p4,int p5) { int max=p1; if(p2>max) max=p2; if(p3>max) max=p3; if(p4>max) max=p4; if(p5>max) max=p5; return max; } int main() { int t,a,b,c,l,r,max,min,temp; scanf("%d",&t); while(t--) { scanf("%d %d %d %d %d",&a,&b,&c,&l,&r); if(a==0) { if(f(a,b,c,l)>f(a,b,c,r)) {max=f(a,b,c,l);min=f(a,b,c,r);} else {min=f(a,b,c,l);max=f(a,b,c,r);} } if(a>0) { if(f(a,b,c,l)>f(a,b,c,r)) {max=f(a,b,c,l);} else max=f(a,b,c,r); temp = -b/(2*a); if((temp-1)>=r&&(temp+1)<=l) min=g1(f(a,b,c,l),f(a,b,c,r),f(a,b,c,temp),f(a,b,c,temp+1),f(a,b,c,temp-1)); if((temp-1)>=r&&(temp+1)>l) { if(temp<=l) min=x1(f(a,b,c,l),f(a,b,c,r),f(a,b,c,temp),f(a,b,c,temp-1)); else min=y1(f(a,b,c,l),f(a,b,c,r),f(a,b,c,temp-1)); } if((temp-1)<r&&(temp+1)<=l) { if(temp>=r) min=x1(f(a,b,c,l),f(a,b,c,r),f(a,b,c,temp),f(a,b,c,temp+1)); else min=y1(f(a,b,c,l),f(a,b,c,r),f(a,b,c,temp+1)); } if((temp-1)>l||(temp+1)<r) { if(f(a,b,c,l)>f(a,b,c,r)) {max=f(a,b,c,l);min=f(a,b,c,r);} else {min=f(a,b,c,l);max=f(a,b,c,r);} } } if(a<0) { if(f(a,b,c,l)>f(a,b,c,r)) {min=f(a,b,c,r);} else min=f(a,b,c,l); temp = -b/(2*a); if((temp-1)>=r&&(temp+1)<=l) max=g2(f(a,b,c,l),f(a,b,c,r),f(a,b,c,temp),f(a,b,c,temp+1),f(a,b,c,temp-1)); printf("%d\n",max); printf("%d\n",temp); if((temp-1)>=r&&(temp+1)>l) { if(temp<=l) max=x2(f(a,b,c,l),f(a,b,c,r),f(a,b,c,temp),f(a,b,c,temp-1)); else max=y2(f(a,b,c,l),f(a,b,c,r),f(a,b,c,temp-1)); } if((temp-1)<r&&(temp+1)<=l) { if(temp>=r) max=x2(f(a,b,c,l),f(a,b,c,r),f(a,b,c,temp),f(a,b,c,temp+1)); else max=y2(f(a,b,c,l),f(a,b,c,r),f(a,b,c,temp+1)); } if((temp-1)>l||(temp+1)<r) { if(f(a,b,c,l)>f(a,b,c,r)) {max=f(a,b,c,l);min=f(a,b,c,r);} else {min=f(a,b,c,l);max=f(a,b,c,r);} } } printf("%d %d\n",max,min); } }
[ "machaochun1@gmail.com" ]
machaochun1@gmail.com
3cbd0bb6d0dbc1e2e3dce0f45d5c96c784860941
54edb261838ae11e094f3a2651e62786225b78db
/Board.cpp
2865e4ee059884b4edc1f3fe903014e17d81bee9
[]
no_license
amritgre/Chess2720
2b176058b08daa15c640435f5cac658c1b555c1f
ab5d1a90a491976eec4d816650985b856590e292
refs/heads/master
2021-01-10T13:44:14.979192
2015-10-03T05:39:43
2015-10-03T05:39:43
43,412,523
0
0
null
null
null
null
UTF-8
C++
false
false
1,490
cpp
#include "Board.h" Board::Board(int height, int width) { this->width = width; this->height = height; //Loop through and make squares vector of size 36 ie. 6 rows x 6 cols for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { Square* tempSqr = new Square(row, col); squares.push_back(tempSqr); } } } void Board::draw(ostream& o){ o << " "; //the initial empty corner on the top left(check the word file if unclear) //Print just the column line for (int col = 1; col < this->width; col++) { o << " " << col; } o << endl;//end of the column line and move to rows //Prints row 0 to 5 for (int row = 1; row < this->height; row++) { o << " " << row << " ";//Prints the row num //This loop gets all the things on that line for(int col2 = 0; col2 < this->width; col2++){ o << getSquare(row, col2)->symbol() << " "; } } // goto new row. o << endl; } void Board::placePiece(Piece* p, Square* s) { s -> setPiece(p); } void Board::movePiece(Square* s, Square* d) { // TODO: Use assert() to verify that a piece exists on s. d -> setPiece (s -> getPiece()); s -> removePiece(); } Square* Board::getSquare(int r, int c) { Square* toReturn; for(int i = 0; i < squares.size(); i++){ if(squares.at(i)->row == r && squares.at(i)->col == c) toReturn = squares.at(i); } return toReturn; } Board::~Board(){ for(int i = 0; i < squares.size(); i++){ delete squares[i]; } }
[ "amritgre@yahoo.com" ]
amritgre@yahoo.com
01b3ac5b38fc72a810e138480058b77f94953364
9fa5d9ef9f9a4896126f42d2d16e87948a73579d
/xglobal/xprogram_options.hxx
9323f5b9569659053710b28616fd2438c5b557fa
[]
no_license
ReadingCode/xware
6c3272171922014f49216c36f70de31756ccd2b1
6a7edf746822d38c084867a7ce9930cc5a764da9
refs/heads/master
2020-03-26T05:03:53.876231
2013-05-29T06:09:32
2013-05-29T06:09:32
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,651
hxx
/* * **************************************************************************** * * * * * Copyright 2008, xWorkshop Inc. * * * All rights reserved. * * * Redistribution and use in source and binary forms, with or without * * * modification, are permitted provided that the following conditions are * * * met: * * * * Redistributions of source code must retain the above copyright * * * notice, this list of conditions and the following disclaimer. * * * * Redistributions in binary form must reproduce the above * * * copyright notice, this list of conditions and the following disclaimer * * * in the documentation and/or other materials provided with the * * * distribution. * * * * Neither the name of xWorkshop Inc. nor the names of its * * * contributors may be used to endorse or promote products derived from * * * this software without specific prior written permission. * * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * * * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * * * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * * * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * * * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * * * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * * * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * * * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * * * * * Author: stoneyrh@163.com * * * * * **************************************************************************** */ #ifndef _XPROGRAM_OPTIONS_H_ #define _XPROGRAM_OPTIONS_H_ #include <boost/program_options.hpp> namespace xws { namespace xprogram_options = boost::program_options; } // namespace xws #endif
[ "stoneyrh@163.com" ]
stoneyrh@163.com
4ef2cc0babcc717c178ab21239af08d97676648c
ad5798f34346aa79bc31ad44b0fd522cd49344b7
/source/GeometryBuffer3d.cpp
f95602a9564c0ec00c8561b3dc9fafc6c8c9ed05
[ "MIT" ]
permissive
Xaer033/Torque
ab9fb02da5fdd839d115ec1c7224e0ea7b774c9b
55ed32b5269e0058121b38e95be19b67e325db6d
refs/heads/master
2020-05-20T11:06:59.991672
2016-01-04T05:16:10
2016-01-04T05:16:10
34,590,927
0
0
null
null
null
null
UTF-8
C++
false
false
10,834
cpp
/* Module: Geometry Buffer Description: Geometry that we send to the graphics card Author: Julian Williams */ #include "GeometryBuffer3d.h" #include <IVertexBuffer.h> #include <vector> #include <cmath> #include <sstream> #include <IwGL.h> #include "Vertex.h" #include "Vector.h" #include "DebugText.h" #define BUFFER_OFFSET(i) ((void*)(i)) namespace GG { GeometryBuffer3d::GeometryBuffer3d() : IVertexBuffer(), _vertexBufferHandle(0), _indexBufferHandle(0), _arrayBufferHandle(0 ) { _vertexList.clear(); _indexList.clear(); } GeometryBuffer3d::~GeometryBuffer3d() { if( _vertexBufferHandle != 0 ) glDeleteBuffers( 1, &_vertexBufferHandle ); if( _indexBufferHandle != 0 ) glDeleteBuffers( 1, &_indexBufferHandle ); } void GeometryBuffer3d::merge( const GeometryBuffer3d & buffer ) { _vertexList.insert ( _vertexList.end(), buffer._vertexList.begin(), buffer._vertexList.end() ); _indexList.insert ( _indexList.end(), buffer._indexList.begin(), buffer._indexList.end() ); } void GeometryBuffer3d::clearVertices() { _vertexList.clear(); _indexList.clear(); } void GeometryBuffer3d::addPosition( const Vector3 & p ) { Vertex v = { p, _currentTexCoord, _currentNormal, _currentTangent, _currentBitangent, _currentColor }; _vertexList.push_back( v ); } void GeometryBuffer3d::pushTexCoord( const Vector2 & t ) { _currentTexCoord = t; } void GeometryBuffer3d::pushNormal( const Vector3 & n ) { _currentNormal = n; } void GeometryBuffer3d::pushColor( const Vector4 & c ) { _currentColor = c; } void GeometryBuffer3d::pushTangent( const Vector3 & t ) { _currentTangent = t; } void GeometryBuffer3d::pushBitangent( const Vector3 & b ) { _currentBitangent = b; } void GeometryBuffer3d::_generateTangents() { Vertex v[3]; for( uint i = 0; i < _vertexList.size(); i += 3 ) { if( i >= _vertexList.size() - 3 ) break; v[0] = _vertexList[i]; v[1] = _vertexList[i+1]; v[2] = _vertexList[i+2]; Vector3 tangent, biTangent; //Make Tangent/bitangent building Vector3 edge1 = v[1].position - v[0].position; Vector3 edge2 = v[2].position - v[0].position; Vector2 edge1uv = v[1].texCoord - v[0].texCoord; Vector2 edge2uv = v[2].texCoord - v[0].texCoord; //Determ float det = edge1uv.x * edge2uv.y - edge1uv.y * edge2uv.x; if( det != 0.0f) { float mul = 1.0f / det; tangent = (edge1 * -edge2uv.y + edge2 * edge1uv.y) * mul; biTangent = (edge1 * -edge2uv.x + edge2 * edge1uv.x) * mul; /*tangent = Vector3((edge2uv.y * edge1.x - edge1uv.y * edge2.x) * mul, (edge2uv.y * edge1.y - edge1uv.y * edge2.y) * mul, (edge2uv.y * edge1.z - edge1uv.y * edge2.z) * mul);*/ } if( fabs( tangent.x ) < 0.01f && fabs( tangent.y ) < 0.01f && fabs( tangent.z ) ) { //text << "Zero tangent!"; //text.print(); } //v[0].tangent = v[1].tangent = v[2].tangent = tangent; //v[0].biTangent = v[1].biTangent = v[2].biTangent = biTangent; for( uint j = 0; j < 3; ++j ) { _vertexList[i + j].tangent = tangent; _vertexList[i + j].biTangent = biTangent; } } } void GeometryBuffer3d::build( DrawHint drawHint ) { _generateIndices(); if( getVertexProperties() & TANGENTS ) _generateTangents(); if( _vertexBufferHandle == 0 ) glGenBuffers( 1, &_vertexBufferHandle ); if( _indexBufferHandle == 0 ) glGenBuffers( 1, &_indexBufferHandle ); int vCount = getVertexCount(); int iCount = getIndexCount(); glBindBuffer( GL_ARRAY_BUFFER, _vertexBufferHandle ); glBufferData( GL_ARRAY_BUFFER, sizeof( Vertex ) * _vertexList.size(), &_vertexList[ 0 ], drawHint ); //glBufferSubData( GL_ARRAY_BUFFER, 0, sizeof( Vertex ) * _vertexList.size(), &_vertexList[ 0 ] ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, _indexBufferHandle ); glBufferData( GL_ELEMENT_ARRAY_BUFFER, sizeof( GLuint ) * _indexList.size(), &_indexList[ 0 ] , drawHint ); // glBufferSubData( GL_ELEMENT_ARRAY_BUFFER, 0, sizeof( GLuint ) * _indexList.size(), &_indexList[ 0 ] ); } void GeometryBuffer3d::build( Vertex * vertexList, uint vertCount, uint * indexList, uint indexCount, DrawHint drawHint ) { _vertexList.clear(); for( uint i = 0; i < vertCount; ++i ) _vertexList.push_back( vertexList[ i ] ); if( indexList == NULL || indexCount == 0 ) { _generateIndices(); } else { _indexList.clear(); for( uint i = 0; i < indexCount; ++i ) _indexList.push_back( indexList[ i ] ); } if( getVertexProperties() & TANGENTS ) _generateTangents(); if( _vertexBufferHandle == 0 ) glGenBuffers( 1, &_vertexBufferHandle ); if( _indexBufferHandle == 0 ) glGenBuffers( 1, &_indexBufferHandle ); glBindBuffer( GL_ARRAY_BUFFER, _vertexBufferHandle ); glBufferData( GL_ARRAY_BUFFER, sizeof( Vertex ) * _vertexList.size(), NULL, drawHint ); glBufferSubData( GL_ARRAY_BUFFER, 0, sizeof( Vertex ) * _vertexList.size(), &_vertexList[0] ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, _indexBufferHandle ); glBufferData( GL_ELEMENT_ARRAY_BUFFER, sizeof( GLuint ) * _indexList.size(), NULL, drawHint ); glBufferSubData( GL_ELEMENT_ARRAY_BUFFER, 0, sizeof( GLuint ) * _indexList.size(), &_indexList[ 0 ] ); } void GeometryBuffer3d::bind() const { glBindBuffer( GL_ARRAY_BUFFER, _vertexBufferHandle ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, _indexBufferHandle ); glEnableVertexAttribArray( PositionTag ); glVertexAttribPointer( PositionTag, 3, GL_FLOAT, GL_FALSE, sizeof( Vertex ), BUFFER_OFFSET( 0 ) ); int vertexProperties = getVertexProperties(); if( vertexProperties & GG::TEXCOORDS ) { glEnableVertexAttribArray( TexcoordTag ); glVertexAttribPointer( TexcoordTag, 2, GL_FLOAT, GL_FALSE, sizeof( Vertex ), BUFFER_OFFSET( 3 * sizeof( float ) ) ); } else { glDisableVertexAttribArray( TexcoordTag ); } if( vertexProperties & GG::NORMALS ) { glEnableVertexAttribArray( NormalTag ); glVertexAttribPointer( NormalTag, 3, GL_FLOAT, GL_FALSE, sizeof( Vertex ), BUFFER_OFFSET( 5 * sizeof( float ) ) ); } else { glDisableVertexAttribArray( NormalTag ); } if( vertexProperties & GG::TANGENTS ) { glEnableVertexAttribArray( TangentTag ); glVertexAttribPointer( TangentTag, 3, GL_FLOAT, GL_FALSE, sizeof( Vertex ), BUFFER_OFFSET( 8 * sizeof( float ) ) ); } else { glDisableVertexAttribArray( TangentTag ); } if( vertexProperties & GG::BITANGENTS ) { glEnableVertexAttribArray( BitangentTag ); glVertexAttribPointer( BitangentTag, 3, GL_FLOAT, GL_FALSE, sizeof( Vertex ), BUFFER_OFFSET( 11 * sizeof( float ) ) ); } else { glDisableVertexAttribArray( BitangentTag ); } if( vertexProperties & GG::COLORS ) { glEnableVertexAttribArray( ColorTag ); glVertexAttribPointer( ColorTag, 4, GL_FLOAT, GL_FALSE, sizeof( Vertex ), BUFFER_OFFSET( 14 * sizeof( float ) ) ); } else { glDisableVertexAttribArray( ColorTag ); } } void GeometryBuffer3d::render( const DrawMode & drawMode ) const { glDrawElements( ( GLenum )drawMode, _indexList.size(), GL_UNSIGNED_INT, NULL ); } Vertex * GeometryBuffer3d::getVertexArray() { return &_vertexList[ 0 ]; } uint * GeometryBuffer3d::getIndexArray() { return &_indexList[ 0 ]; } uint GeometryBuffer3d::getVertexCount() const { return _vertexList.size(); } uint GeometryBuffer3d::getIndexCount() const { return _indexList.size(); } //---------------------------- Private Implementation ------------------------------------- ///check 2 verticies to see if they're the same bool GeometryBuffer3d::_isSameVertex( const Vertex & v1, const Vertex & v2 ) const { const float limit = 0.001f; Vector3 deltaPos = v1.position - v2.position; bool posResult = ( fabs( deltaPos.x ) < limit && fabs( deltaPos.y ) < limit && fabs( deltaPos.z ) < limit ); int vertexProperties = getVertexProperties(); bool texResult = true; if( vertexProperties & GG::TEXCOORDS ) { Vector2 deltaTex = v1.texCoord - v2.texCoord; texResult = (fabs(deltaTex.x) < limit && fabs(deltaTex.y) < limit); } bool normalResult = true; if( vertexProperties & GG::NORMALS ) { Vector3 deltaNormal = v1.normal - v2.normal; normalResult = (fabs(deltaNormal.x) < limit && fabs(deltaNormal.y) < limit && fabs(deltaNormal.z) < limit); } bool colorResult = true; if( vertexProperties & GG::COLORS ) { Vector4 deltaColor = v1.color - v2.color; colorResult = (fabs(deltaColor.x) < limit && fabs(deltaColor.y) < limit && fabs(deltaColor.z) < limit && fabs(deltaColor.w) < limit); } bool tangentResult = true; if( vertexProperties & GG::TANGENTS ) { Vector3 deltaTangent = v1.tangent - v2.tangent; tangentResult = (fabs(deltaTangent.x) < limit && fabs(deltaTangent.y) < limit && fabs(deltaTangent.z) < limit); } return posResult && texResult && normalResult && colorResult && tangentResult; } void GeometryBuffer3d::_generateIndices() { _indexList.clear(); VertexList newVertList; //DebugText debugText; for( uint i = 0; i < _vertexList.size(); ++i ) { bool repeated = false; ///FLip uv's for openGL // _vertexList[ i ].texCoord.y = 1 - _vertexList[ i ].texCoord.y; for( uint j = 0; j < newVertList.size(); ++j ) { repeated = _isSameVertex( _vertexList[ i ], newVertList[ j ] ); if( repeated ) { _indexList.push_back( j ); break; } } if( !repeated ) { newVertList.push_back( _vertexList[ i ] ); _indexList.push_back( newVertList.size() - 1 ); } } _vertexList = newVertList; } }
[ "jdfrag@gmail.com" ]
jdfrag@gmail.com
ae825340fc557f2adb0df92ab1e141c0a599c3df
bfed41b541d54a90f5156abb56920a7939a80fbc
/source/alob.cpp
05e75051f5a879623a58a07a5e1d4f0fc3f830be
[]
no_license
acceptable-security/csc281-final
6cb1a58091015e41f3c955e03beba956aadb541a
2be9113d9b147443df3032c0182b20151645cccd
refs/heads/master
2022-04-26T09:56:23.679189
2019-12-17T01:04:53
2019-12-17T01:04:53
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,607
cpp
#include "emp-sh2pc/emp-sh2pc.h" #include "websock.hpp" #include <new> #include <stdexcept> #include <cstdlib> using namespace emp; using namespace std; int LEN = 10; #define POS(X, Y) (((Y) * LEN) + (X)) Integer bitToInt(Bit bit, int owner) { Integer x(32, 0, owner); x[0] = bit; return x; } void parse_choices(string input, int party, Integer output[]) { if ( input.size() < LEN ) { throw invalid_argument("invalid input length"); } for ( int i = 0; i < LEN; i++ ) { switch ( input[i] ) { case '0': output[i] = Integer(32, 0, party); break; case '1': output[i] = Integer(32, 1, party); break; default: throw invalid_argument("invalid character in input"); } } } int exec_score(string input_a, string input_b, int _threshold) { Integer a[LEN]; Integer b[LEN]; Integer threshold(32, _threshold, PUBLIC); parse_choices(input_a, ALICE, a); parse_choices(input_b, BOB, b); Integer acc(32, 0, PUBLIC); for ( int i = 0; i < LEN; i++ ) { acc = acc + bitToInt(a[i].equal(b[i]), PUBLIC); } Integer out = bitToInt(acc.geq(threshold), PUBLIC); return out.reveal<int>(); } int do_setup(char* input, int party, int threshold, int port) { NetIO* io = new NetIO(party == ALICE ? nullptr : "127.0.0.1", port); setup_semi_honest(io, party); cout << "Calculating potential match of " << LEN << " options" << endl; // Fake input for other party string inputs_a(input); string inputs_b(input); int out = exec_score(inputs_a, inputs_b, threshold); delete io; return out; } int main(int argc, char** argv) { if ( argc != 4 ) { std::cout << "Usage: " << argv[0] << " <fifoin> <fifoout> <port>" << std::endl; return 1; } WebSocketServer sock(argv[1], argv[2]); int port = atoi(argv[3]); sock.listen([&](uint32_t client_id, uint32_t size, uint8_t* data) -> bool { if ( size != 11 ) { std::cout << "Invalid message: " << data << std::endl; return true; } std::cout << "Received response from " << client_id << std::endl; int party = data[0] == 'A' ? ALICE : BOB; char* raw_data = (char*) &data[1]; // TODO: dynamic threshold int output = do_setup(raw_data, party, 7, port); uint8_t str_output[33]; sprintf((char*) str_output, "%d", output); sock.send(client_id, strlen((const char*) str_output) + 1, str_output); std::cout << "Finished" << std::endl; return true; }); }
[ "block8437@gmail.com" ]
block8437@gmail.com
08e3055d437c1e9b9363d084f861e88f1790d677
696e35ccdf167c3f6b1a7f5458406d3bb81987c9
/chrome/app/shutdown_signal_handlers_posix.cc
4b487d7b38a5e2adec79c2f944f5ba0eb907b3da
[ "BSD-3-Clause" ]
permissive
mgh3326/iridium-browser
064e91a5e37f4e8501ea971483bd1c76297261c3
e7de6a434d2659f02e94917be364a904a442d2d0
refs/heads/master
2023-03-30T16:18:27.391772
2019-04-24T02:14:32
2019-04-24T02:14:32
183,128,065
0
0
BSD-3-Clause
2019-11-30T06:06:02
2019-04-24T02:04:51
null
UTF-8
C++
false
false
7,610
cc
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/app/shutdown_signal_handlers_posix.h" #include <limits.h> #include <signal.h> #include <string.h> #include <unistd.h> #include "base/callback.h" #include "base/debug/leak_annotations.h" #include "base/logging.h" #include "base/macros.h" #include "base/posix/eintr_wrapper.h" #include "base/single_thread_task_runner.h" #include "base/threading/platform_thread.h" #include "base/threading/thread_task_runner_handle.h" namespace { // The OSX fork() implementation can crash in the child process before // fork() returns. In that case, the shutdown pipe will still be // shared with the parent process. To prevent child crashes from // causing parent shutdowns, |g_pipe_pid| is the pid for the process // which registered |g_shutdown_pipe_write_fd|. // See <http://crbug.com/175341>. pid_t g_pipe_pid = -1; int g_shutdown_pipe_write_fd = -1; int g_shutdown_pipe_read_fd = -1; // Common code between SIG{HUP, INT, TERM}Handler. void GracefulShutdownHandler(int signal) { // Reinstall the default handler. We had one shot at graceful shutdown. struct sigaction action; memset(&action, 0, sizeof(action)); action.sa_handler = SIG_DFL; RAW_CHECK(sigaction(signal, &action, NULL) == 0); RAW_CHECK(g_pipe_pid != -1); RAW_CHECK(g_shutdown_pipe_write_fd != -1); RAW_CHECK(g_shutdown_pipe_read_fd != -1); RAW_CHECK(g_pipe_pid == getpid()); size_t bytes_written = 0; do { int rv = HANDLE_EINTR( write(g_shutdown_pipe_write_fd, reinterpret_cast<const char*>(&signal) + bytes_written, sizeof(signal) - bytes_written)); RAW_CHECK(rv >= 0); bytes_written += rv; } while (bytes_written < sizeof(signal)); } void SIGHUPHandler(int signal) { RAW_CHECK(signal == SIGHUP); GracefulShutdownHandler(signal); } void SIGINTHandler(int signal) { RAW_CHECK(signal == SIGINT); GracefulShutdownHandler(signal); } void SIGTERMHandler(int signal) { RAW_CHECK(signal == SIGTERM); GracefulShutdownHandler(signal); } // Runs a thread that invokes a callback when a termination signal handler // is invoked. Uses a pipe to wait for the signal handler to run. class ShutdownDetector : public base::PlatformThread::Delegate { public: ShutdownDetector( int shutdown_fd, const base::Closure& shutdown_callback, const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); ~ShutdownDetector() override; // base::PlatformThread::Delegate: void ThreadMain() override; private: const int shutdown_fd_; const base::Closure shutdown_callback_; const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; DISALLOW_COPY_AND_ASSIGN(ShutdownDetector); }; ShutdownDetector::ShutdownDetector( int shutdown_fd, const base::Closure& shutdown_callback, const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) : shutdown_fd_(shutdown_fd), shutdown_callback_(shutdown_callback), task_runner_(task_runner) { CHECK_NE(shutdown_fd_, -1); CHECK(!shutdown_callback.is_null()); CHECK(task_runner_); } ShutdownDetector::~ShutdownDetector() {} // These functions are used to help us diagnose crash dumps that happen // during the shutdown process. NOINLINE void ShutdownFDReadError() { // Ensure function isn't optimized away. asm(""); sleep(UINT_MAX); } NOINLINE void ShutdownFDClosedError() { // Ensure function isn't optimized away. asm(""); sleep(UINT_MAX); } NOINLINE void ExitPosted() { // Ensure function isn't optimized away. asm(""); sleep(UINT_MAX); } void ShutdownDetector::ThreadMain() { base::PlatformThread::SetName("CrShutdownDetector"); int signal; size_t bytes_read = 0; ssize_t ret; do { ret = HANDLE_EINTR(read(shutdown_fd_, reinterpret_cast<char*>(&signal) + bytes_read, sizeof(signal) - bytes_read)); if (ret < 0) { NOTREACHED() << "Unexpected error: " << strerror(errno); ShutdownFDReadError(); break; } else if (ret == 0) { NOTREACHED() << "Unexpected closure of shutdown pipe."; ShutdownFDClosedError(); break; } bytes_read += ret; } while (bytes_read < sizeof(signal)); VLOG(1) << "Handling shutdown for signal " << signal << "."; if (!task_runner_->PostTask(FROM_HERE, shutdown_callback_)) { // Without a valid task runner to post the exit task to, there aren't many // options. Raise the signal again. The default handler will pick it up // and cause an ungraceful exit. RAW_LOG(WARNING, "No valid task runner, exiting ungracefully."); kill(getpid(), signal); // The signal may be handled on another thread. Give that a chance to // happen. sleep(3); // We really should be dead by now. For whatever reason, we're not. Exit // immediately, with the exit status set to the signal number with bit 8 // set. On the systems that we care about, this exit status is what is // normally used to indicate an exit by this signal's default handler. // This mechanism isn't a de jure standard, but even in the worst case, it // should at least result in an immediate exit. RAW_LOG(WARNING, "Still here, exiting really ungracefully."); _exit(signal | (1 << 7)); } ExitPosted(); } } // namespace void InstallShutdownSignalHandlers( const base::Closure& shutdown_callback, const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { int pipefd[2]; int ret = pipe(pipefd); if (ret < 0) { PLOG(DFATAL) << "Failed to create pipe"; return; } g_pipe_pid = getpid(); g_shutdown_pipe_read_fd = pipefd[0]; g_shutdown_pipe_write_fd = pipefd[1]; #if !defined(ADDRESS_SANITIZER) const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2; #else // ASan instrumentation bloats the stack frames, so we need to increase the // stack size to avoid hitting the guard page. const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4; #endif ShutdownDetector* detector = new ShutdownDetector( g_shutdown_pipe_read_fd, shutdown_callback, task_runner); // PlatformThread does not delete its delegate. ANNOTATE_LEAKING_OBJECT_PTR(detector); if (!base::PlatformThread::CreateNonJoinable(kShutdownDetectorThreadStackSize, detector)) { LOG(DFATAL) << "Failed to create shutdown detector task."; } // Setup signal handlers for shutdown AFTER shutdown pipe is setup because // it may be called right away after handler is set. // If adding to this list of signal handlers, note the new signal probably // needs to be reset in child processes. See // base/process_util_posix.cc:LaunchProcess. // We need to handle SIGTERM, because that is how many POSIX-based distros // ask processes to quit gracefully at shutdown time. struct sigaction action; memset(&action, 0, sizeof(action)); action.sa_handler = SIGTERMHandler; CHECK(sigaction(SIGTERM, &action, nullptr) == 0); // Also handle SIGINT - when the user terminates the browser via Ctrl+C. If // the browser process is being debugged, GDB will catch the SIGINT first. action.sa_handler = SIGINTHandler; CHECK(sigaction(SIGINT, &action, nullptr) == 0); // And SIGHUP, for when the terminal disappears. On shutdown, many Linux // distros send SIGHUP, SIGTERM, and then SIGKILL. action.sa_handler = SIGHUPHandler; CHECK(sigaction(SIGHUP, &action, nullptr) == 0); }
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
24f95de41ef1079739f5abdc61ad48a482d4a0bf
78ef6727092c8ef5ac7900717c602b8c27b8e03b
/src/UAFWinEd/GetMoneySackData.h
3299409918ad9543d03377ffbffa98a02e4343ff
[]
no_license
PubFork/uaf
fef542c983e5a1a25bf1593cb2fc4534523c46fb
98fa9da100fdfccdaa4e9725203fbd0aca9b656d
refs/heads/master
2023-08-12T18:45:44.652484
2021-10-04T22:39:32
2021-10-04T22:39:32
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,697
h
#if !defined(AFX_GETMONEYSACKDATA_H__2473A6A6_3ABE_419C_9683_7C5358E63AF5__INCLUDED_) #define AFX_GETMONEYSACKDATA_H__2473A6A6_3ABE_419C_9683_7C5358E63AF5__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 /****************************************************************************** * Filename: GetMoneySackData.h * Copyright (c) 2000, UAF Development Team (email CocoaSpud@hotmail.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ******************************************************************************/ ///////////////////////////////////////////////////////////////////////////// // CGetMoneySackData dialog #include "Money.h" class CGetMoneySackData : public CDialog { // Construction public: CGetMoneySackData(MONEY_SACK &data, CWnd* pParent = NULL); // standard constructor void GetData(MONEY_SACK &data) { data=m_data; } // Dialog Data //{{AFX_DATA(CGetMoneySackData) enum { IDD = IDD_GETMONEYSACKDATA }; int m_Amount1; int m_Amount10; int m_Amount2; int m_Amount3; int m_Amount4; int m_Amount5; int m_Amount6; int m_Amount7; int m_Amount8; int m_Amount9; CString m_GemName; CString m_JewelryName; int m_AmountGem; int m_AmountJewelry; CString m_Name1; CString m_Name10; CString m_Name2; CString m_Name3; CString m_Name4; CString m_Name5; CString m_Name6; CString m_Name7; CString m_Name8; CString m_Name9; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CGetMoneySackData) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: MONEY_SACK m_data; // Generated message map functions //{{AFX_MSG(CGetMoneySackData) virtual BOOL OnInitDialog(); virtual void OnOK(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_GETMONEYSACKDATA_H__2473A6A6_3ABE_419C_9683_7C5358E63AF5__INCLUDED_)
[ "andrew_steeley@hotmail.com" ]
andrew_steeley@hotmail.com
034967168e76f55ebb225e3331c36ff6f9c65164
30b8561243cff67f758633327004cb378e5c5cef
/source/src/NGE/Geometry/Mesh.cpp
3a24ddb6a57fca237f0416e9cc24cca3a72f9b95
[]
no_license
tkubicz/ngengine
56a7235de0c799f541d47841380da6fd90d3abed
75413c8b77587e5ec8f03164fa9b5dcd7697c0c6
refs/heads/master
2021-01-12T06:02:57.202296
2016-06-15T16:42:43
2016-06-15T16:42:43
77,282,542
2
0
null
null
null
null
UTF-8
C++
false
false
1,479
cpp
#include "NGE/Geometry/Mesh.hpp" using namespace NGE::Geometry; Mesh::Mesh() { vertexArray = vertexBuffer = texCoordBuffer = colorBuffer = normalBuffer = indexBuffer = tangentBuffer = bitangentBuffer = 0; } Mesh::~Mesh() { } GLuint& Mesh::GetVertexArray() { return vertexArray; } GLuint& Mesh::GetVertexBuffer() { return vertexBuffer; } GLuint& Mesh::GetTexCoordBuffer() { return texCoordBuffer; } GLuint& Mesh::GetNormalBuffer() { return normalBuffer; } GLuint& Mesh::GetColorBuffer() { return colorBuffer; } GLuint& Mesh::GetIndexBuffer() { return indexBuffer; } GLuint& Mesh::GetTangentBuffer() { return tangentBuffer; } GLuint& Mesh::GetBitangentBuffer() { return bitangentBuffer; } std::vector<NGE::Math::vec3f>& Mesh::GetVertices() { return vertices; } std::vector<NGE::Math::vec2f>& Mesh::GetTexCoords() { return texCoords; } std::vector<NGE::Math::vec3f>& Mesh::GetNormals() { return normals; } std::vector<NGE::Math::vec4f>& Mesh::GetColors() { return colors; } std::vector<GLuint>& Mesh::GetIndices() { return indices; } std::vector<NGE::Math::vec3f>& Mesh::GetTangents() { return tangents; } std::vector<NGE::Math::vec3f>& Mesh::GetBitangents() { return bitangents; } void Mesh::DeleteBuffers() { } void Mesh::DeleteArrays() { } std::vector<Face> Mesh::GetFaces() const { return faces; } unsigned int Mesh::GetNumFaces() const { return numFaces; } void Mesh::SetNumFaces(unsigned int numFaces) { this->numFaces = numFaces; }
[ "tymoteusz.kubicz@gmail.com" ]
tymoteusz.kubicz@gmail.com
d6ab9ea308bc7ee9d2780aea635b68c08e8333e2
25acc085ba82f786c3f05e43ddc7ceda146d5486
/libraries/shared/src/FileDownloader.h
ad1351a5757f6724e8267f584de8ffc2451e6f31
[]
no_license
ddobrev/hifi
e4ba44a9b50a1098c0f8d71b82f902e18aa524f6
716858e6f69c1487cf6dae3be793a9e8bb4d3412
refs/heads/master
2020-04-06T06:43:45.969951
2014-04-03T16:45:46
2014-04-03T17:09:54
17,596,734
1
0
null
null
null
null
UTF-8
C++
false
false
904
h
// // FileDownloader.h // hifi // // Created by Clement Brisset on 3/14/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. // // #ifndef __hifi__FileDownloader__ #define __hifi__FileDownloader__ #include <QObject> #include <QNetworkAccessManager> #include <QNetworkReply> #include <QThread> class FileDownloader : public QObject { Q_OBJECT public: FileDownloader(QObject* parent = NULL); QByteArray getData() const { return _downloadedData; } signals: void done(QNetworkReply::NetworkError error); public slots: void download(const QUrl& dataURL, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation); private slots: void processReply(QNetworkReply* reply); private: QNetworkAccessManager _networkAccessManager; QByteArray _downloadedData; }; #endif /* defined(__hifi__FileDownloader__) */
[ "clement.brisset@gmail.com" ]
clement.brisset@gmail.com
562cda72c10cbfdf464ecec0459d152caed62407
002f672820569cd0486fa815f7f14ab306d63f3f
/Source/Plugins/Image/ImageModule.cpp
08ceb18ac1579e40305a725e26c20561e4cfa476
[]
no_license
simeks/Flow
e83043c6b0a1ed5e5d64749f9a75cd299599c769
6468c1d26fed9e3dd2629c0dab18a931949213f0
refs/heads/master
2021-09-07T10:58:30.004857
2018-02-21T22:49:19
2018-02-21T22:49:19
65,066,051
0
0
null
null
null
null
UTF-8
C++
false
false
402
cpp
#include <Core/Common.h> #include <Core/Flow/FlowSystem.h> #include "ImageModule.h" #include "ImageToWorld.h" IMPLEMENT_MODULE(ImageModule); ImageModule::ImageModule() { } ImageModule::~ImageModule() { } void ImageModule::install() { install_nodes(); } void ImageModule::uninstall() { } void ImageModule::install_nodes() { FlowSystem::get().install_template(new ImageSliceToWorldNode()); }
[ "simon.ekstrom@surgsci.uu.se" ]
simon.ekstrom@surgsci.uu.se
44e43b5b22889408f4273249a7f4e8ebcb69164f
b86f68c57e656c8b368fa8f19bc7a8cfab91494b
/src/TransApp.cpp
60103617c6f3ed9fb45e68a771e6793493fbab86
[ "MIT" ]
permissive
geovens/TransWinove
612aa893b2014810724714f31b3886dbb9fa7f28
a6bd77e9b7f8aae55f19b5dfda5e88e9119751c3
refs/heads/master
2021-01-11T11:08:10.462608
2015-12-08T00:11:22
2015-12-08T00:11:22
33,405,791
0
0
null
null
null
null
UTF-8
C++
false
false
5,324
cpp
#include "TransApp.h" #include "TaskBarIcon.h" #include "PopUpMenu.h" #include "ThreadSwitch.h" #include "ThreadWaitInactive.h" #include "windows.h" //#include "resource.h" IMPLEMENT_APP(TransApp) TransApp::TransApp() { TransWin = (HWND)0; //IsWaitingMouseClick = false; //ExitMessage = false; IfNoHit = true; } bool TransApp::OnInit() { ForbidWin1 = FindWindowW(L"Shell_TrayWnd", L""); ForbidWin2 = FindWindowW(L"NotifyIconOverflowWindow", L""); aTaskBarIcon = new TaskBarIcon(this); return true; } void TransApp::LeftClick() { if (TransWin == 0) { WaitMouseClick(); } else { if (IfNoHit) { ThreadWaitInactiveIsRuning = true; SetUnTrans(TransWin); //SetHitTrans(TransWin, 0xE0); SetForegroundWindow(TransWin); aThreadWaitInactive = new ThreadWaitInactive(this, TransWin); aThreadWaitInactive->Create(); aThreadWaitInactive->Run(); } } } void TransApp::RightClick() { if (TransWin != 0) { Sleep(100); Cancel(false); } else { PopUpMenu *menu = new PopUpMenu(this); aTaskBarIcon->PopupMenu(menu); } } void TransApp::Quit() { //ExitMessage = true; Sleep(200); aTaskBarIcon->RemoveIcon(); //taskbar->Destroy(); wxExit(); } void TransApp::WaitMouseClick() { aTaskBarIcon->SelectIcon(2); SetSystemCursor((HCURSOR)wxCURSOR(IDC_CURSOR).GetHCURSOR(), 32512); SetSystemCursor((HCURSOR)wxCURSOR(IDC_CURSOR).GetHCURSOR(), 32650); SetSystemCursor((HCURSOR)wxCURSOR(IDC_CURSOR).GetHCURSOR(), 32514); SetSystemCursor((HCURSOR)wxCURSOR(IDC_CURSOR).GetHCURSOR(), 32513); SetSystemCursor((HCURSOR)wxCURSOR(IDC_CURSOR).GetHCURSOR(), 32649); SetSystemCursor((HCURSOR)wxCURSOR(IDC_CURSOR).GetHCURSOR(), 32642); SetSystemCursor((HCURSOR)wxCURSOR(IDC_CURSOR).GetHCURSOR(), 32643); SetSystemCursor((HCURSOR)wxCURSOR(IDC_CURSOR).GetHCURSOR(), 32644); SetSystemCursor((HCURSOR)wxCURSOR(IDC_CURSOR).GetHCURSOR(), 32645); SetSystemCursor((HCURSOR)wxCURSOR(IDC_CURSOR).GetHCURSOR(), 32646); SetSystemCursor((HCURSOR)wxCURSOR(IDC_CURSOR).GetHCURSOR(), 32648); SetSystemCursor((HCURSOR)wxCURSOR(IDC_CURSOR).GetHCURSOR(), 32516); int waittick = 0; HWND hwnd; bool LeftIsClicked = false; bool RightIsClicked = false; while (true) { if (GetAsyncKeyState(VK_LBUTTON) & 0x8000) { LeftIsClicked = true; } if (!(GetAsyncKeyState(VK_LBUTTON) & 0x8000) && LeftIsClicked) { POINT mousepoint; GetCursorPos(&mousepoint); hwnd = WindowFromPoint(mousepoint); hwnd = GetAncestor(hwnd, GA_ROOT); if (hwnd != 0 && hwnd != ForbidWin1 && hwnd != ForbidWin2) { //wchar_t s[200]; //GetClassNameW(hwnd, s, 100); //wxMessageBox(s); if (IfNoHit) { SetNoHitTrans(hwnd, 0x60); aThreadSwitch = new ThreadSwitch(this, hwnd); aThreadSwitch->Create(); aThreadSwitch->Run(); } else { SetHitTrans(hwnd, 0xD0); aThreadSwitch = new ThreadSwitch(this, hwnd); aThreadSwitch->Create(); aThreadSwitch->Run(); } aTaskBarIcon->SelectIcon(3); TransWin = hwnd; waittick = 0; } else aTaskBarIcon->SelectIcon(1); break; } if (GetAsyncKeyState(VK_RBUTTON) & 0x8000) { LeftIsClicked = false; RightIsClicked = true; } if (!(GetAsyncKeyState(VK_RBUTTON) & 0x8000) && RightIsClicked) { aTaskBarIcon->SelectIcon(1); break; } waittick++; if (waittick >= 15) { aTaskBarIcon->SelectIcon(12); waittick = 1; } Sleep(20); } SystemParametersInfo(SPI_SETCURSORS, 0, 0, 0); //IsWaitingMouseClick = false; } void TransApp::Cancel(bool setbottom) { if (TransWin != 0) { aThreadSwitch->MessageExit = true; Sleep(50); if (ThreadWaitInactiveIsRuning) { aThreadWaitInactive->MessageExit = true; } SetUnTrans(TransWin, false); aTaskBarIcon->SelectIcon(1); TransWin = 0; } } void TransApp::SetUnTrans(HWND hwnd, bool setbottom) { DWORD dwExStyle = GetWindowLong(hwnd, GWL_EXSTYLE); SetWindowLong(hwnd, GWL_EXSTYLE, dwExStyle & ~WS_EX_LAYERED & ~WS_EX_TRANSPARENT); if (setbottom) SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_FRAMECHANGED); else SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_FRAMECHANGED); } void TransApp::SetNoHitTrans(HWND hwnd, unsigned char trancoif) { DWORD dwExStyle = GetWindowLong(hwnd, GWL_EXSTYLE); SetWindowLong(hwnd, GWL_EXSTYLE, dwExStyle | WS_EX_LAYERED); SetWindowPos(hwnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED); SetLayeredWindowAttributes(hwnd, RGB(255, 0, 255), trancoif, LWA_ALPHA); SetWindowLong(hwnd, GWL_EXSTYLE, dwExStyle | WS_EX_LAYERED | WS_EX_TRANSPARENT); SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_FRAMECHANGED); } void TransApp::SetHitTrans(HWND hwnd, unsigned char trancoif) { DWORD dwExStyle = GetWindowLong(hwnd, GWL_EXSTYLE); SetWindowLong(hwnd, GWL_EXSTYLE, dwExStyle | WS_EX_LAYERED); SetLayeredWindowAttributes(hwnd, RGB(255, 0, 255), trancoif, LWA_ALPHA); SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); }
[ "hi@geovens.name" ]
hi@geovens.name
98b2d7f8e00a615f586897d60f50e654ebbeb3a5
a4126c8120ace83bd0c681eb5b644bd6ce12c72c
/review/37.cpp
bbae76a8b735937added490d24ebc77af1e3db0c
[]
no_license
liyijiax/ProjectEuler
5da6a7a4741f15424008b9c9f75c2f24fed84bd8
4ddd8b94105803f67c134c191954db7aba2f4a23
refs/heads/master
2022-03-04T16:51:25.377239
2019-09-12T09:55:55
2019-09-12T09:55:55
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,329
cpp
/************************************************************************* > File Name: 37.cpp > Author: > Mail: > Created Time: 2019年08月30日 星期五 19时54分42秒 ************************************************************************/ #include<iostream> #include <cmath> using namespace std; #define max_n 1000000 int prime[max_n + 5] = {0}; int is_prime[max_n + 5] = {0}; void init_prime() { is_prime[0] = 1, is_prime[1] = 1; for (int i = 2; i < max_n; i++) { if (!is_prime[i]) prime[++prime[0]] = i; for (int j = 1; j <= prime[0]; j++) { if (i * prime[j] > max_n) break; is_prime[i * prime[j]] = 1; if (i % prime[j] == 0) break; } } return ; } int is_val(int x) { int tmp = x; while (tmp) { if (is_prime[tmp]) return 0; tmp /= 10; } int h = pow(10, floor(log10(x))); tmp = x; while (tmp) { if (is_prime[tmp]) return 0; tmp -= tmp / h * h; h /= 10; } return 1; } int main() { init_prime(); int flag = 11, sum = 0; for (int i = 1; i <= prime[0]; i++) { if (prime[i] < 10) continue; if (!is_val(prime[i])) continue; sum += prime[i]; flag--; if (!flag) break; } cout << sum << endl; return 0; }
[ "1497333171@qq.com" ]
1497333171@qq.com
ad80786bccacf29dd53f27f79890863e4ab41ca8
ca4fad9cc9ecfb60fbc258d3a8d5238c419850aa
/include/scapes/visual/Shader.h
6128554e2f668a280633aa37afa65920a3068b6b
[ "MIT" ]
permissive
eZii-jester-data/pbr-sandbox
6e52107583d426a9c7afe9f5fb7aa368e485cd70
32d7cdaf66dace181d62f50f1f4abf9eddb4380a
refs/heads/master
2022-06-14T17:48:13.718861
2022-05-25T11:37:34
2022-05-25T11:37:34
219,803,446
0
0
MIT
2022-05-25T22:26:22
2019-11-05T17:27:03
C++
UTF-8
C++
false
false
1,542
h
#pragma once #include <scapes/foundation/TypeTraits.h> #include <scapes/foundation/resources/ResourceManager.h> #include <scapes/visual/hardware/Device.h> #include <scapes/visual/Fwd.h> namespace scapes::visual { /* */ struct Shader { hardware::Shader shader {SCAPES_NULL_HANDLE}; hardware::ShaderType type {hardware::ShaderType::FRAGMENT}; hardware::Device *device {nullptr}; shaders::Compiler *compiler {nullptr}; }; template <> struct ::TypeTraits<Shader> { static constexpr const char *name = "scapes::visual::Shader"; }; template <> struct ::ResourceTraits<Shader> { static SCAPES_API size_t size(); static SCAPES_API void create( foundation::resources::ResourceManager *resource_manager, void *memory, hardware::ShaderType type, hardware::Device *device, shaders::Compiler *compiler ); static SCAPES_API void destroy( foundation::resources::ResourceManager *resource_manager, void *memory ); static SCAPES_API foundation::resources::hash_t fetchHash( foundation::resources::ResourceManager *resource_manager, foundation::io::FileSystem *file_system, void *memory, const foundation::io::URI &uri ); static SCAPES_API bool reload( foundation::resources::ResourceManager *resource_manager, foundation::io::FileSystem *file_system, void *memory, const foundation::io::URI &uri ); static SCAPES_API bool loadFromMemory( foundation::resources::ResourceManager *resource_manager, void *memory, const uint8_t *data, size_t size ); }; }
[ "andrey.viktorov@gmail.com" ]
andrey.viktorov@gmail.com
c11cc0f170b01ef23faa987565528366f90301f8
828fa39ec169954815d5f50d12a265420eb93a99
/src/bsdfs/specular.cc
4863e741c30fbffb7e15b528492a76e05e74a941
[ "MIT" ]
permissive
Billlhw/MiyukiRenderer
33bbad5addeca11744c1c45bd94e5fe3529ea784
7a153b65652763fe1b698245e3d0671a905d2f4a
refs/heads/master
2022-11-28T03:10:02.684094
2019-03-03T15:57:05
2019-03-03T15:57:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
667
cc
// // Created by Shiina Miyuki on 2019/2/10. // #include "specular.h" using namespace Miyuki; Spectrum SpecularTransmissionBSDF::sample(ScatteringEvent &event) const { bool entering = cosTheta(event.wo) > 0; Float etaI = entering ? etaA : etaB; Float etaT = entering ? etaB : etaA; auto n = Vec3f{0,1,0}; if(Vec3f::dot(n,event.wo) < 0){ n *= -1; } Vec3f wi; if(!refract(event.wo,n,etaI/etaT,&wi)){ return {}; } event.setWi(wi); event.pdf = 1; Spectrum ft = Spectrum(evalAlbedo(event) * (Spectrum(1.0f,1.0f,1.0f) - fresnel.eval(cosTheta(event.wi)))); ft /= absCosTheta(event.wi); return ft; }
[ "38184032+xt271828@users.noreply.github.com" ]
38184032+xt271828@users.noreply.github.com
df7424cee5cd735136b79ff811af3e6f12191ae5
2b6263485f7b45d048387744f82198abe3230505
/Sketch/iRobot/iRobot/iRobot.ino
053dd3731f49f757af4d653ceae64d9d014797a6
[]
no_license
unkaMoMo/CNCStepper
b7338ae368ab670b24c69b28c4d3e3f826857bd6
672206dc37b775dcd07a49dc926b39b6900f9a53
refs/heads/master
2020-04-01T00:21:36.099052
2018-09-23T20:41:16
2018-09-23T20:41:16
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,231
ino
/* This file is part of CNCLib - A library for stepper motors. Copyright (c) 2013-2017 Herbert Aitenbichler CNCLib 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 3 of the License, or (at your option) any later version. CNCLib 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. http://www.gnu.org/licenses/ */ #include <SPI.h> #include <SD.h> //#include <Servo.h> #include <Adafruit_TiCoServo.h> #include <U8glib.h> #include <StepperLib.h> #include <CNCLib.h> #include <CNCLibEx.h> #include "StepperServo.h" #include "MyControl.h" #include "GCodeParser.h" //////////////////////////////////////////////////////////// CMyStepper Stepper; //////////////////////////////////////////////////////////// void setup() { StepperSerial.begin(115200); } //////////////////////////////////////////////////////////// void loop() { Control.Run(); } ////////////////////////////////////////////////////////////
[ "h.aitenbichler@eduhi.at" ]
h.aitenbichler@eduhi.at
8f8abb9777e5746f6ad65a79d6424ec42c2944fb
58c4571782c4e255397c24c078970dc146a7ad8f
/source/deps/illa/c_tga_header.h
a5e863d7e1de85e3e395f31e37a21e9fe2591425
[ "IJG" ]
permissive
quatmo/Pictus
3a0e78f7889ca1d5d1c7c22c8ef73c5b98800e9a
cbdbff6dfc8d9817b90fbe873ba8a7c7d243496e
refs/heads/master
2021-01-14T11:32:03.884250
2015-01-01T17:35:31
2015-01-01T17:35:31
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,106
h
#ifndef C_TGA_HEADER_H #define C_TGA_HEADER_H #include "orz/file.h" #include "types.h" namespace Img { class TGAHeader { public: enum TGAImageType { NoData = 0, // No image data present. RawColormap = 1, // RAW color-mapped data. RawTrueColor = 2, // RAW true-color data. RawBW = 3, // RAW gray-scale only data. RLEColormap = 9, // RLE color mapped data. RLETrueColor = 10, // RLE true-color data. RLEBW = 11, // RLE gray-scale only data. }; enum AtributesType { AT_NoAlpha = 0, AT_UndefinedIgnore = 1, AT_UndefinedRetain = 2, AT_Alpha = 3, AT_AlphaPreMultiplied = 4, }; uint8_t IdSize; uint8_t ColorMapType; TGAImageType ImageType; unsigned short ColorMapStart; unsigned short ColorMapLength; uint8_t ColorMapBits; Geom::SizeInt Size; uint8_t ColorDepth; uint8_t AlphaBits; AtributesType AttributesType; bool FlipHorizontal; bool FlipVertical; bool LoadHeader(IO::FileReader::Ptr file); Img::Format SurfaceFormat(); TGAHeader(); private: bool ReadExtensionArea(IO::FileReader::Ptr file); }; } #endif
[ "pontus@mardnas.se" ]
pontus@mardnas.se
22fa222849f510fbfc6ec594ab84f20c9ea8f893
0d7fbf5211390014259c61f89b2431ccd2aea7c6
/cc/xlsx-xlnt.hh
8995f3809739ae5f301cd2a110abb180f31783c5
[ "MIT" ]
permissive
acorg/acmacs-whocc
3b5b96054d57a606d658474ded6abff50dbac2a3
7ad861474fb88e0d49963b3cda2b97ea6833680c
refs/heads/master
2022-11-09T05:55:22.121921
2022-10-22T09:42:37
2022-10-22T09:42:37
90,026,989
0
0
null
null
null
null
UTF-8
C++
false
false
7,905
hh
#pragma once #include "acmacs-base/float.hh" #include "acmacs-base/xlnt.hh" #include "acmacs-whocc/sheet.hh" // ---------------------------------------------------------------------- namespace acmacs::xlsx::inline v1 { namespace xlnt { class Doc; class Sheet : public acmacs::sheet::Sheet { public: Sheet(::xlnt::worksheet&& src) : sheet_{std::move(src)}, number_of_rows_{sheet_.highest_row()}, number_of_columns_{sheet_.highest_column().index} { using namespace acmacs::sheet; if (number_of_columns_ > ncol_t{0} && number_of_rows_ > nrow_t{0}) { // remove last empty columns const auto is_empty_col = [this](ncol_t col) { for (nrow_t row{0}; row < number_of_rows_; ++row) { if (!is_empty(cell(row, col))) return false; } return true; }; for (ncol_t col{number_of_columns_ - ncol_t{1}}; col > ncol_t{0}; --col) { if (!is_empty_col(col)) break; --number_of_columns_; } // remove last empty rows const auto is_empty_row = [this](nrow_t row) { for (ncol_t col{0}; col < number_of_columns_; ++col) { if (!is_empty(cell(row, col))) return false; } return true; }; for (nrow_t row{number_of_rows_ - nrow_t{1}}; row > nrow_t{0}; --row) { if (!is_empty_row(row)) break; --number_of_rows_; } } } std::string name() const override { return sheet_.title(); } sheet::nrow_t number_of_rows() const override { return number_of_rows_; } sheet::ncol_t number_of_columns() const override { return number_of_columns_; } static inline date::year_month_day make_date(const ::xlnt::datetime& dt, sheet::nrow_t /*row*/, sheet::ncol_t /*col*/) { // if (dt.hour || dt.minute || dt.second || dt.microsecond) // AD_WARNING("xlnt datetime at {:c}{} contains time: {}", col + 'A', row + 1, dt.to_string()); return date::year{dt.year} / date::month{static_cast<unsigned>(dt.month)} / dt.day; } static inline bool is_date(const ::xlnt::cell& cell) { try { return cell.is_date(); } catch (...) { return false; // xlnt throws when xlsx format is unsupported in some aspect } } acmacs::sheet::cell_t cell(sheet::nrow_t row, sheet::ncol_t col) const override // row and col are zero based { const ::xlnt::cell_reference ref{static_cast<::xlnt::column_t::index_t>(*col + 1), static_cast<::xlnt::row_t>(*row + 1)}; if (!sheet_.has_cell(ref)) return acmacs::sheet::cell::empty{}; const auto cell = sheet_.cell(ref); switch (cell.data_type()) { // ~/AD/build/acmacs-build/build/xlnt/include/xlnt/cell/cell_type.hpp case ::xlnt::cell_type::empty: return acmacs::sheet::cell::empty{}; case ::xlnt::cell_type::boolean: return cell.value<bool>(); case ::xlnt::cell_type::inline_string: case ::xlnt::cell_type::shared_string: case ::xlnt::cell_type::formula_string: if (const auto val = cell.value<std::string>(); !val.empty()) return val; else return acmacs::sheet::cell::empty{}; case ::xlnt::cell_type::number: if (is_date(cell)) return make_date(cell.value<::xlnt::datetime>(), row, col); else if (const auto vald = cell.value<double>(); !float_equal(vald, std::round(vald))) return vald; else return static_cast<long>(cell.value<long long>()); case ::xlnt::cell_type::date: return make_date(cell.value<::xlnt::datetime>(), row, col); case ::xlnt::cell_type::error: return acmacs::sheet::cell::error{}; } return acmacs::sheet::cell::empty{}; } // acmacs::sheet::cell_spans_t cell_spans(nrow_t row, ncol_t col) const override // { // const ::xlnt::cell_reference ref{static_cast<::xlnt::column_t::index_t>(col + 1), static_cast<::xlnt::row_t>(row + 1)}; // if (!sheet_.has_cell(ref)) // return {}; // acmacs::sheet::cell_spans_t spans; // // const auto cell = sheet_.cell(ref); // // if (const auto fill = cell.fill(); fill.type() == ::xlnt::fill_type::pattern) { // // const auto fill_pattern = fill.pattern_fill(); // // const auto get_color = [](const auto& col) -> std::string { // // if (col.is_set() && col.get().type() == ::xlnt::color_type::rgb) { // // const auto rgb = col.get().rgb(); // // return fmt::format("#{:02x}{:02x}{:02x}", rgb.red(), rgb.green(), rgb.blue()); // // } // // else // // return {}; // // }; // // const std::string foreground = get_color(fill_pattern.foreground()), background = get_color(fill_pattern.background()); // // if (!foreground.empty() || !background.empty()) // // spans.push_back(acmacs::sheet::cell_span_t{0, 1, foreground, background}); // // } // // size_t first{0}; // // for (const auto& run : cell.value<::xlnt::rich_text>().runs()) { // // if (run.second.is_set()) { // // std::string color_value; // // if (run.second.get().has_color()) { // // if (const auto color = run.second.get().color(); color.type() == ::xlnt::color_type::rgb) // // color_value = color.rgb().hex_string(); // // } // // spans.push_back(acmacs::sheet::cell_span_t{first, run.first.size(), color_value}); // // } // // first += run.first.size(); // // } // return spans; // } private: ::xlnt::worksheet sheet_; sheet::nrow_t number_of_rows_; sheet::ncol_t number_of_columns_; }; class Doc { public: Doc(std::string_view filename) : workbook_{::xlnt::path{std::string{filename}}} {} size_t number_of_sheets() const { return workbook_.sheet_count(); } std::shared_ptr<acmacs::sheet::Sheet> sheet(size_t sheet_no) { return std::make_shared<Sheet>(workbook_.sheet_by_index(sheet_no)); } private: ::xlnt::workbook workbook_; }; } // namespace xlnt } // namespace acmacs::xlsx::inline v1 // ----------------------------------------------------------------------
[ "github@skepner.eu" ]
github@skepner.eu
b2921d68b0ad69b81c7ba33d5bc973ef12d24d18
d85b1f3ce9a3c24ba158ca4a51ea902d152ef7b9
/testcases/CWE762_Mismatched_Memory_Management_Routines/s06/CWE762_Mismatched_Memory_Management_Routines__new_free_int64_t_33.cpp
51ed5d5faea766b4f2671dde021044cfd61cfd53
[]
no_license
arichardson/juliet-test-suite-c
cb71a729716c6aa8f4b987752272b66b1916fdaa
e2e8cf80cd7d52f824e9a938bbb3aa658d23d6c9
refs/heads/master
2022-12-10T12:05:51.179384
2022-11-17T15:41:30
2022-12-01T15:25:16
179,281,349
34
34
null
2022-12-01T15:25:18
2019-04-03T12:03:21
null
UTF-8
C++
false
false
3,193
cpp
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE762_Mismatched_Memory_Management_Routines__new_free_int64_t_33.cpp Label Definition File: CWE762_Mismatched_Memory_Management_Routines__new_free.label.xml Template File: sources-sinks-33.tmpl.cpp */ /* * @description * CWE: 762 Mismatched Memory Management Routines * BadSource: Allocate data using new * GoodSource: Allocate data using malloc() * Sinks: * GoodSink: Deallocate data using delete * BadSink : Deallocate data using free() * Flow Variant: 33 Data flow: use of a C++ reference to data within the same function * * */ #include "std_testcase.h" namespace CWE762_Mismatched_Memory_Management_Routines__new_free_int64_t_33 { #ifndef OMITBAD void bad() { int64_t * data; int64_t * &dataRef = data; /* Initialize data*/ data = NULL; /* POTENTIAL FLAW: Allocate memory with a function that requires delete to free the memory */ data = new int64_t; { int64_t * data = dataRef; /* POTENTIAL FLAW: Deallocate memory using free() - the source memory allocation function may * require a call to delete to deallocate the memory */ free(data); } } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B() uses the GoodSource with the BadSink */ static void goodG2B() { int64_t * data; int64_t * &dataRef = data; /* Initialize data*/ data = NULL; /* FIX: Allocate memory from the heap using malloc() */ data = (int64_t *)malloc(100*sizeof(int64_t)); if (data == NULL) {exit(-1);} { int64_t * data = dataRef; /* POTENTIAL FLAW: Deallocate memory using free() - the source memory allocation function may * require a call to delete to deallocate the memory */ free(data); } } /* goodB2G() uses the BadSource with the GoodSink */ static void goodB2G() { int64_t * data; int64_t * &dataRef = data; /* Initialize data*/ data = NULL; /* POTENTIAL FLAW: Allocate memory with a function that requires delete to free the memory */ data = new int64_t; { int64_t * data = dataRef; /* FIX: Deallocate the memory using delete */ delete data; } } void good() { goodG2B(); goodB2G(); } #endif /* OMITGOOD */ } /* close namespace */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN using namespace CWE762_Mismatched_Memory_Management_Routines__new_free_int64_t_33; /* so that we can use good and bad easily */ int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
[ "Alexander.Richardson@cl.cam.ac.uk" ]
Alexander.Richardson@cl.cam.ac.uk
706679da67285d626b32a2a990a075b77c53f93f
13edaf364ca1bcd376a604b994c7dec7782f0964
/lib/encoder.cpp
afbe527681e842d0c39429df099ab69d41ba29c8
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
PolySync/polysync-transcoder
a0ceb7aa815fb762d97096c02aa373c8237696e7
c148883612fbb62fd1caaafbc4636abe41ba2808
refs/heads/devel
2021-05-01T08:14:57.345283
2017-02-23T19:35:02
2017-02-23T19:35:02
75,136,806
7
2
null
2017-08-14T19:01:19
2016-11-30T01:02:02
C++
UTF-8
C++
false
false
9,053
cpp
#include <set> #include <polysync/print_tree.hpp> #include <polysync/byteswap.hpp> #include <polysync/encoder.hpp> namespace polysync { struct branch { Encoder* enc; const polysync::Node& node; const polysync::Tree tree; const descriptor::Field& field; // Terminal types void operator()( std::type_index idx ) const { if ( !descriptor::terminalTypeMap.count(idx) ) { throw polysync::error( "no typemap" ) << exception::field( field.name ) << exception::module( "encoder" ); } if ( idx != node.target_type() ) { throw polysync::error( "mismatched type" ) << exception::field( node.name ) << exception::module( "encoder" ); } BOOST_LOG_SEV( enc->log, severity::debug2 ) << node.name << " = " << node << " (" << descriptor::terminalTypeMap.at(idx).name << ")"; eggs::variants::apply( [this]( auto& val ) { switch ( field.byteorder ) { case descriptor::ByteOrder::BigEndian: enc->encode( byteswap(val) ); break; case descriptor::ByteOrder::LittleEndian: enc->encode(val); break; } }, node); } void operator()(const descriptor::BitField& idx) const { throw polysync::error( "BitField not yet implemented" ); } void operator()(const descriptor::Nested& idx) const { const polysync::Tree* nest = node.target<polysync::Tree>(); if (nest == nullptr) { throw polysync::error("mismatched nested type") << exception::field(node.name) << exception::module("plog::encode"); } std::string type = field.type.target<descriptor::Nested>()->name; if ( !descriptor::catalog.count(type) ) { throw polysync::error( "unknown type" ) << exception::type(type) << exception::field(node.name); } BOOST_LOG_SEV( enc->log, severity::debug2 ) << node.name << " = " << node << " (nested)"; enc->encode( *nest, descriptor::catalog.at(type) ); } void operator()( const descriptor::Skip& skip ) const { const Bytes& raw = *node.target<Bytes>(); enc->stream.write( (char *)raw.data(), raw.size() ); BOOST_LOG_SEV(enc->log, severity::debug2) << "padded " << raw; } template <typename T> static void array( Encoder* enc, const polysync::Node& node, size_t size ) { const std::vector<T>* arr = node.target< std::vector<T> >(); if (arr == nullptr) { throw polysync::error("mismatched type in field \"" + node.name + "\""); } if (arr->size() != size) { throw polysync::error("mismatched size in field \"" + node.name + "\""); } std::for_each( arr->begin(), arr->end(), [enc]( const auto& val ) { enc->encode(val); }); } static std::map<std::type_index, std::function<void ( Encoder*, const polysync::Node&, size_t )> > array_func; void operator()( const descriptor::Array& desc ) const { auto sizefield = desc.size.target<std::string>(); auto fixedsize = desc.size.target<size_t>(); size_t size; if (sizefield) { auto it = std::find_if(tree->begin(), tree->end(), [sizefield](const polysync::Node& n) { return n.name == *sizefield; }); if ( it == tree->end() ) { throw polysync::error( "size indicator field not found" ) << exception::field(*sizefield); } // Figure out the size, irregardless of the integer type std::stringstream os; os << *it; try { size = std::stoll(os.str()); } catch ( std::invalid_argument ) { throw polysync::error( "cannot parse size" ) << exception::type( it->name ); } } else { size = *fixedsize; } BOOST_LOG_SEV( enc->log, severity::debug2 ) << "encoding " << size << " elements"; auto nesttype = desc.type.target<std::string>(); if ( nesttype ) { if ( !descriptor::catalog.count(*nesttype) ) { throw polysync::error("unknown nested type"); } const descriptor::Type& nest = descriptor::catalog.at( *nesttype ); const std::vector<polysync::Tree>* arr = node.target< std::vector<polysync::Tree> >(); // Actual data type is not a vector like the description requires. if ( arr == nullptr ) { throw polysync::error( "mismatched type" ) << exception::field( node.name ); } std::for_each( arr->begin(), arr->end(), [this, nest]( auto& elem ) { enc->encode( elem, nest ); }); } else { std::type_index idx = *desc.type.target<std::type_index>(); if (!array_func.count(idx)) { throw polysync::error( "unknown terminal type" ); } return array_func.at( idx )( enc, node, size ); } } }; std::map< std::type_index, std::function<void (Encoder*, const polysync::Node&, size_t)> > branch::array_func { { typeid(float), branch::array<float> }, { typeid(double), branch::array<double> }, { typeid(std::int8_t), branch::array<std::int8_t> }, { typeid(std::int16_t), branch::array<std::int16_t> }, { typeid(std::int32_t), branch::array<std::int32_t> }, { typeid(std::int64_t), branch::array<std::int64_t> }, { typeid(std::uint8_t), branch::array<std::uint8_t> }, { typeid(std::uint16_t), branch::array<std::uint16_t> }, { typeid(std::uint32_t), branch::array<std::uint32_t> }, { typeid(std::uint64_t), branch::array<std::uint64_t> }, }; void Encoder::encode( const Tree& t, const descriptor::Type& desc ) { std::set<std::string> done; // The serialization must be in the order of the descriptor, not // necessarily the value, so iterate the descriptor at the top level. std::for_each( desc.begin(), desc.end(), [&](const descriptor::Field& field ) { // Search the tree itself to find the field, keyed on their // names; The tree's natural order is irrelevant, given a // descriptor. This is exactly how the type can be re-ordered // during a format change without breaking legacy plogs. auto fi = std::find_if(t->begin(), t->end(), [field]( const Node& n ) { return n.name == field.name; }); // Skip is a special case and will never be in the parse tree, // although it is still a critical part of the description. if ( fi == t->end() && field.name != "skip" ) { throw polysync::error( "field \"" + field.name + "\" not found in tree" ); } eggs::variants::apply( branch { this, *fi, t, field }, field.type ); done.insert( field.name ); }); // What to do with fields not described in desc? For now, the policy is to // omit terminals, but encode any trees or undecoded buffers, in order. This should work when // the type description changes by removing a terminal field, but still // completes the encoding of a list of trees. std::for_each(t->begin(), t->end(), [&]( const Node& n ) { if ( done.count(n.name) ) { return; } if ( n.target_type() == typeid(Tree) ) { Tree subtree = *n.target<Tree>(); if ( !descriptor::catalog.count( subtree.type ) ) { throw polysync::error( "missing type descriptor" ) << exception::type( subtree.type ); } const descriptor::Type& subtype = descriptor::catalog.at( subtree.type ); BOOST_LOG_SEV( log, severity::debug1 ) << "recursing subtree " << subtree.type; return encode( subtree, subtype ); } if ( n.target_type() == typeid(Bytes) ) { const Bytes& raw = *n.target<Bytes>(); BOOST_LOG_SEV( log, severity::debug2 ) << "writing " << raw.size() << " raw bytes to offset " << stream.tellp(); stream.write( (char *)raw.data(), raw.size() ); return; } BOOST_LOG_SEV( log, severity::warn ) << "field \"" << n.name << "\" not serialized due to lack of description"; }); } } // namespace polysync
[ "jgalbraith@polysync.io" ]
jgalbraith@polysync.io
31eb1beca47a0c802ff921ed7f9a3341b2ff257c
540f0aeba561f2df015b359be04904ae0fd06679
/udp/embedMode/framWork/business/business.cpp
25a2c9acc86fd6dd6b4a5d1fb40ab364992e9530
[]
no_license
dongdong-2009/uukit
64ac81a20be1b9ba0b99e3b774cd445d0509b11f
5439bfc88f1a628cacfccb4f06e2073759220900
refs/heads/master
2021-09-12T07:01:46.914691
2018-04-15T07:41:10
2018-04-15T07:41:10
null
0
0
null
null
null
null
UTF-8
C++
false
false
63
cpp
#include "business.h"
[ "gongwenbotarsbot@gmail.com" ]
gongwenbotarsbot@gmail.com
44bc32253ad03add751e10577740f7bb73d3c36d
204d2bdb44cc1dd37818a88649f0c2f6a9f679af
/Spectrum_Display/Spectrum_Display.ino
f22b9df422e8acc008ba051ef33662832285dade
[]
no_license
Redquency/Spectrum-Display
d212b8043492ce0658301e25f3bef3247c6e9bd1
5574724764931013cca416d1821dbc9d330a880c
refs/heads/master
2021-12-14T20:45:27.064526
2017-05-27T08:51:00
2017-05-27T08:51:00
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,276
ino
/* Name: Spectrum_Display.ino Created: 5/25/2017 7:30:13 PM Author: Piotr */ #define SW1 12 #define SW2 11 int del = 1000; int buff3[] = { 0x1,0x24,0x42,0x81,0x81,0x42,0x24,0x18,0x00,0x00,0x18,0x66,0x42,0x81,0x81,0x42,0x66,0x18 }; int buff2[] = { 0x18,0x3c,0x7e,0xff,0xff,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00,0x83,0xc6,0x6c,0x38,0x38,0x6c,0xc6,0x83,0x00,0x00,0x00,0x00,0x00,0x18,0x3c,0x7e,0xff,0xff,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; int buff[] = { 0x00,0x00,0x3c,0x66,0x43,0xd1,0xc5,0x85,0x91,0x81,0xc3,0x66,0x3c,0x00,0x00,0x00,0x00,0x00,0x3e,0x62,0x42,0x46,0x3c,0x00,0x00,0x3c,0x78,0x38,0x2c,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; int buff4[] = { 0x00,0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff,0x7f,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x38,0x7c,0x7e,0x7e,0x3f,0x3f,0x7e,0x7e,0x7c,0x38,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x81,0x99,0x99,0x81,0x42,0x3c,0x00,0x00,0x00 }; int buff5[] = { 0x00,0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff,0x7f,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x38,0x7c,0x7e,0x7e,0x3f,0x3f,0x7e,0x7e,0x7c,0x38,0x00,0x00,0x00,0x00,0x00,0x3c,0x7e,0xff,0xff,0xff,0xff,0x7e,0x3c,0x00,0x00,0x00 }; int* buffers[] = { buff5, buff4, buff3 }; int* bufferPointer = buffers[0]; int selectedBuffer = 0; void pciSetup(byte pin) { *digitalPinToPCMSK(pin) |= bit(digitalPinToPCMSKbit(pin)); // enable pin PCIFR |= bit(digitalPinToPCICRbit(pin)); // clear any outstanding interrupt PCICR |= bit(digitalPinToPCICRbit(pin)); // enable interrupt for the group } int i = 0; ISR(PCINT0_vect) // handle pin change interrupt for D8 to D13 here { //if (!digitalRead(SW1) && !digitalRead(SW2)) //{ selectedBuffer++; if (selectedBuffer > sizeof(buffers)) selectedBuffer = 0; bufferPointer = buffers[selectedBuffer]; digitalWrite(13, !digitalRead(13)); delay(300); //} } void setup() { digitalWrite(13, LOW); pinMode(SW1, INPUT_PULLUP); pinMode(SW2, INPUT_PULLUP); DDRD = B11111111; pciSetup(SW1); pciSetup(SW2); } void loop() { for (size_t i = 0; i < 18; i++) { PORTD = bufferPointer[i]; delayMicroseconds(del); } }
[ "piotr.redmerski@gmail.com" ]
piotr.redmerski@gmail.com
2df6c796a2dfbbe1ab93247852f722a5514c4c79
35ef15922b1f74702998cc77223627faecca5094
/Codechef and Spoj/1-K/BABY_STEP_GIANT_STEP.cpp
66ee14a9ddc37a145766a1cbb3a5b0ecc775ef2c
[]
no_license
neelchoudhury/cp
4409fffc0db05ce1246cc8e537f8aea10dff8980
29eb993fb1931d8608a860ab16e016e16eed1aad
refs/heads/main
2023-01-23T15:03:54.708059
2023-01-21T18:09:55
2023-01-21T18:09:55
293,884,505
0
0
null
null
null
null
UTF-8
C++
false
false
608
cpp
#include <bits/stdc++.h> #define ll long long int #define ld long double #define MOD 1000000007 #define mem(a) memset(a,0,sizeof(a)) #define pb push_back #define ff first #define ss second #define ios ios_base::sync_with_stdio(false); #define V 52 using namespace std; int main() { ios; ll q,a,b,d; cin>>q; while(q--) { cin>>a>>b>>d; ll ans=0; if(d==0) ans=0; else if(d==a or d==b) ans=1; else if(d<2*b) { ans=2; } else { if(d%b==0) ans=d/b; else { if(d%a!=0) ans=d/b+1; else ans=min(d/a, d/b+1); } } cout<<ans<<endl; } return 0; }
[ "neelchoudhury@users.noreply.github.com" ]
neelchoudhury@users.noreply.github.com
f8647c457582c1c8982566777da4702ad39e315a
b61f324bd154c82d0050a3d745c20740b6adae2e
/cavity/plateExt_lowVis/0.7/uniform/functionObjects/functionObjectProperties
d1c74affde9c7a13127fa5b2a6de97e9eb0a4a40
[]
no_license
nnannen/laminar_BL_OpenFoam
4e48e8e723c064408cde0e296a2742d934ea3277
a24eea7c045ef827fcb6d3daebeea69cfd513f23
refs/heads/main
2023-02-26T18:50:32.632126
2021-02-08T09:02:12
2021-02-08T09:02:12
337,002,384
0
0
null
null
null
null
UTF-8
C++
false
false
897
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2006 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "0.7/uniform/functionObjects"; object functionObjectProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // ************************************************************************* //
[ "nnannen@stud.hs-bremen.de" ]
nnannen@stud.hs-bremen.de
1f7d5f4eb81d54efde5c9b9452900984b9af9974
a2e594bd58541f99d0a8f721ca7cd19372b6ba38
/Plutonium/Source/pu/ui/ui_Overlay.cpp
58894f7695729df464a1a8f2c05809d8464e087f
[ "MIT" ]
permissive
3096/Plutonium
713a9b99177767b0edb6eebd96ea852aec7354cf
0b4b1cd2b1e2c5fc9d29b535ef9356d1db537a88
refs/heads/master
2020-07-04T11:26:00.764748
2019-08-16T05:15:36
2019-08-16T05:15:36
202,273,689
0
0
MIT
2019-08-14T04:18:52
2019-08-14T04:18:51
null
UTF-8
C++
false
false
1,942
cpp
#include <pu/ui/ui_Overlay.hpp> #include <pu/ui/ui_Application.hpp> #include <cmath> namespace pu::ui { Overlay::Overlay(s32 X, s32 Y, s32 Width, s32 Height, Color Background, bool Rounded) : Container(X, Y, Width, Height) { this->bg = Background; this->round = Rounded; this->rad = 25; this->fadea = 0; this->end = false; } Overlay::~Overlay() { this->Clear(); } void Overlay::SetRadius(s32 Radius) { this->rad = Radius; } s32 Overlay::GetRadius() { return this->rad; } void Overlay::OnPreRender(render::Renderer *Drawer) { } void Overlay::OnPostRender(render::Renderer *Drawer) { } bool Overlay::Render(render::Renderer *Drawer) { this->OnPreRender(Drawer); Drawer->SetBaseRenderAlpha(this->fadea); if(this->round) Drawer->RenderRoundedRectangleFill(this->bg, this->x, this->y, this->w, this->h, this->rad); else Drawer->RenderRectangleFill(this->bg, this->x, this->y, this->w, this->h); this->PreRender(); if(!this->elms.empty()) for(s32 i = 0; i < this->elms.size(); i++) { elm::Element *elm = this->elms[i]; if(elm->IsVisible()) elm->OnRender(Drawer); } Drawer->UnsetBaseRenderAlpha(); if(this->end) { if(this->fadea > 0) this->fadea -= 25; else this->fadea = 0; } else { if(this->fadea < 200) this->fadea += 25; if(this->fadea > 200) this->fadea = 200; } this->OnPostRender(Drawer); bool fin = (this->end && (this->fadea == 0)); if(fin) { this->end = false; } return !fin; } void Overlay::NotifyEnding(bool End) { this->end = End; } }
[ "xabofdez@outlook.es" ]
xabofdez@outlook.es
b7bb8cea4006caa3a33c973463bed63e5842d58c
fef58dcd0c1434724a0a0a82e4c84ae906200289
/usages/0xA06C969B02A97298.cpp
ebf27ad6fa9f2e9f2d814faa4d7655ce2ae8c7c4
[]
no_license
DottieDot/gta5-additional-nativedb-data
a8945d29a60c04dc202f180e947cbdb3e0842ace
aea92b8b66833f063f391cb86cbcf4d58e1d7da3
refs/heads/main
2023-06-14T08:09:24.230253
2021-07-11T20:43:48
2021-07-11T20:43:48
380,364,689
1
0
null
null
null
null
UTF-8
C++
false
false
176
cpp
// act_cinema.ysc @ L75781 int func_359(int iParam0) { int iVar0; iVar0 = DECORATOR::DECOR_GET_INT(iParam0, "Veh_Modded_By_Player"); return func_360(iVar0, 0, 1, 0); }
[ "tvangroenigen@outlook.com" ]
tvangroenigen@outlook.com
2060bd644c80bcbae4b3eddbe7cbe025bef45f41
10e8995fc9e97266203bfee400d89f1f7e302252
/Client/New_FreezeBomb/Code/GameObject/Surrounding/Surrounding.h
74198979b3cac4911116aff8faf8603b0ab53bd8
[]
no_license
LeeWooSang/Capstone_Design_TeamProject
2e6871a92a7662bb340d5a672d0eef5e8df0c9ec
ed79076f64f41bb66a928a5923166f8277028d5b
refs/heads/master
2022-03-13T07:46:51.219818
2019-11-18T12:52:45
2019-11-18T12:52:45
155,352,121
0
1
null
null
null
null
UHC
C++
false
false
560
h
#pragma once #include "../GameObject.h" // 주변 정적인 오브젝트 class CSurrounding : public CGameObject { public: CSurrounding(ID3D12Device* pd3dDevice, ID3D12GraphicsCommandList* pd3dCommandList, ID3D12RootSignature* pd3dGraphicsRootSignature); ~CSurrounding(); void Initialize_Shadow(CLoadedModelInfo* pLoadedModel, CGameObject* pGameObject); void SetIndex(int num) { objNum = num; } int GetIndex() { return objNum; } void Render(ID3D12GraphicsCommandList *pd3dCommandList, CCamera *pCamera, int nPipelineState); private: int objNum; };
[ "lus0506@gmail.com" ]
lus0506@gmail.com
fa5a4af2c39f5e92ee2e72a1f2449dcdbecec487
8f29bbdbc1b29365eca840b72d61f63abe8f829f
/Semester2/3001/M2/SDLGameEngine/BoxCollider.cpp
bee2d018fb0fbd9ce3487238a9cb9b3fed236def
[]
no_license
CccrizzZ/GBC01
d294f01aab97de37f2b70bcf325ae713e4eed740
c44130872f609e5778992d8a6dad09caed29ff71
refs/heads/master
2022-02-22T11:32:54.720661
2019-10-14T00:07:50
2019-10-14T00:07:50
158,318,882
0
0
null
null
null
null
UTF-8
C++
false
false
1,706
cpp
#include "BoxCollider.h" #include "Game.h" #include "Rigidbody.h" #include "GameObject.h" #include "Transform.h" BoxCollider::BoxCollider() { fixtureDef.shape = &box; } BoxCollider::~BoxCollider() { } void BoxCollider::SetDimension(const Vector2& _dimension) { dimension = _dimension; b2Vec2 physicsDimension = game->physics->GetPhysicsCoordinates(_dimension); box.SetAsBox(physicsDimension.x / 2, physicsDimension.y / 2); fixtureDef.shape = &box; if (rigidbody) { if (fixture) { rigidbody->RemoveCollider(this); } rigidbody->AddCollider(this); } } const Vector2& BoxCollider::GetDimension() { return dimension; } void BoxCollider::FixedUpdate() { Collider::FixedUpdate(); SDL_SetRenderDrawColor(Game::gRenderer, 0x00, 0xFF, 0x00, 0xFF); Vector2 cam = Vector2(Camera::x, Camera::y); Vector2 a = gameObject->transform->GetAbsolutePosition() + gameObject->transform->Up() * dimension.y / 2 - gameObject->transform->Right() * dimension.x / 2 - cam; Vector2 b = gameObject->transform->GetAbsolutePosition() + gameObject->transform->Up() * dimension.y / 2 + gameObject->transform->Right() * dimension.x / 2 - cam; Vector2 c = gameObject->transform->GetAbsolutePosition() - gameObject->transform->Up() * dimension.y / 2 + gameObject->transform->Right() * dimension.x / 2 - cam; Vector2 d = gameObject->transform->GetAbsolutePosition() - gameObject->transform->Up() * dimension.y / 2 - gameObject->transform->Right() * dimension.x / 2 - cam; SDL_RenderDrawLine(Game::gRenderer, a.x, a.y, b.x, b.y); SDL_RenderDrawLine(Game::gRenderer, b.x, b.y, c.x, c.y); SDL_RenderDrawLine(Game::gRenderer, c.x, c.y, d.x, d.y); SDL_RenderDrawLine(Game::gRenderer, d.x, d.y, a.x, a.y); }
[ "ccccrizzzz@gmail.com" ]
ccccrizzzz@gmail.com
2ccb0aa2d43a43ab468dc1e05a8d971c62456bff
704a8690af3f97bc43ac8a49db56ed62cd6c08de
/SDK/DW_DarwinEnvironmentNightProfileBP_09_functions.cpp
88449f59049d1e04c677d8a1473ebdcbfb9d910f
[]
no_license
AeonLucid/SDK-DarwinProject
4d801f0a7ea6c82a7aa466a77fcc1471f5e71942
dd1c97d55e92c2d745bdf1aa36bab0569f2cf76a
refs/heads/master
2021-09-07T14:08:44.996793
2018-02-24T02:25:28
2018-02-24T02:25:28
118,212,468
1
1
null
null
null
null
UTF-8
C++
false
false
381
cpp
// Darwin Project (open_beta_2) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "DW_DarwinEnvironmentNightProfileBP_09_parameters.hpp" namespace SDK { //--------------------------------------------------------------------------- //Functions //--------------------------------------------------------------------------- } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "aeonlucid@outlook.com" ]
aeonlucid@outlook.com
b15512f8a534be3a56ad4144818de3cf56a97da7
88ae8695987ada722184307301e221e1ba3cc2fa
/apps/app_restore_service_factory.cc
a02b005ef8ba7feb170a6ebe17bb4708391468af
[ "BSD-3-Clause" ]
permissive
iridium-browser/iridium-browser
71d9c5ff76e014e6900b825f67389ab0ccd01329
5ee297f53dc7f8e70183031cff62f37b0f19d25f
refs/heads/master
2023-08-03T16:44:16.844552
2023-07-20T15:17:00
2023-07-23T16:09:30
220,016,632
341
40
BSD-3-Clause
2021-08-13T13:54:45
2019-11-06T14:32:31
null
UTF-8
C++
false
false
1,747
cc
// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "apps/app_restore_service_factory.h" #include "apps/app_lifetime_monitor_factory.h" #include "apps/app_restore_service.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "content/public/browser/browser_context.h" #include "extensions/browser/extensions_browser_client.h" namespace apps { // static AppRestoreService* AppRestoreServiceFactory::GetForBrowserContext( content::BrowserContext* context) { return static_cast<AppRestoreService*>( GetInstance()->GetServiceForBrowserContext(context, true)); } AppRestoreServiceFactory* AppRestoreServiceFactory::GetInstance() { return base::Singleton<AppRestoreServiceFactory>::get(); } AppRestoreServiceFactory::AppRestoreServiceFactory() : BrowserContextKeyedServiceFactory( "AppRestoreService", BrowserContextDependencyManager::GetInstance()) { DependsOn(AppLifetimeMonitorFactory::GetInstance()); } AppRestoreServiceFactory::~AppRestoreServiceFactory() = default; KeyedService* AppRestoreServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { return new AppRestoreService(context); } bool AppRestoreServiceFactory::ServiceIsCreatedWithBrowserContext() const { return true; } content::BrowserContext* AppRestoreServiceFactory::GetBrowserContextToUse( content::BrowserContext* context) const { return extensions::ExtensionsBrowserClient::Get() ->GetRedirectedContextInIncognito(context, /*force_guest_profile=*/true, /*force_system_profile=*/false); } } // namespace apps
[ "jengelh@inai.de" ]
jengelh@inai.de
c2fca6993056dd37c1ebcfa127fe7a96ad22eacc
290c3c0c93db33f31fc44c307c58a8a43f7193a4
/source/com/robomsg.cpp
7f919ed959656affb9919b4486c52a0ca4c4c551
[]
no_license
yisea123/megarobostudio
d16364087296eeaa1ae90b1178875379bcdbca34
efb2ae438e2a73635619611232522a012e1921f8
refs/heads/master
2022-12-11T10:14:06.889822
2018-12-04T00:33:47
2018-12-04T00:33:47
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,588
cpp
#include "robomsg.h" #include "../../app/robonetthread.h" bool RoboMsg::checkMsg( RoboMsg &msg, msg_type msgPatterns[], int n ) { for ( int i = 0; i < n; i++ ) { if ( msgPatterns[i].msg == msg.getMsg() ) { return msg.checkType( msgPatterns[i].types ); } } return false; } RoboMsg::RoboMsg() { mMsg = e_robo_none; mTimeStamp = 0; } void RoboMsg::setMsg( eRoboMsg msg ) { mMsg = msg; } eRoboMsg RoboMsg::getMsg() { return mMsg; } eRoboMsg RoboMsg::Msg() { return mMsg; } qint64 RoboMsg::operator- ( const RoboMsg &rMsg ) const { return mTimeStamp - rMsg.timeStamp(); } #define check_tx( x ) if ( t##x != QMetaType::UnknownType && size() > x ) \ {\ if ( t##x != (QMetaType::Type)at( x ).type() )\ { return false; }\ } bool RoboMsg::checkType( QMetaType::Type t0, QMetaType::Type t1, QMetaType::Type t2, QMetaType::Type t3, QMetaType::Type t4, QMetaType::Type t5 ) { check_tx( 0 ); check_tx( 1 ); check_tx( 2 ); check_tx( 3 ); check_tx( 4 ); check_tx( 5 ); return true; } bool RoboMsg::checkType( QMetaType::Type ts[6] ) { return checkType( ts[0], ts[1], ts[2], ts[3], ts[4], ts[5] ); } void RoboMsg::setTimeStamp( quint64 t ) { mTimeStamp = t; } quint64 RoboMsg::timeStamp() const { return mTimeStamp; }
[ "ww4u@qq.com" ]
ww4u@qq.com
1eabca781c9b1f67bab03f6d2b2d35073de3370f
a2206795a05877f83ac561e482e7b41772b22da8
/Source/PV/build/VTK/Wrapping/Python/vtkCameraInterpolatorPython.cxx
3c4143410c75d3ec87259535a120af20ca4224d4
[]
no_license
supreethms1809/mpas-insitu
5578d465602feb4d6b239a22912c33918c7bb1c3
701644bcdae771e6878736cb6f49ccd2eb38b36e
refs/heads/master
2020-03-25T16:47:29.316814
2018-08-08T02:00:13
2018-08-08T02:00:13
143,947,446
0
0
null
null
null
null
UTF-8
C++
false
false
37,653
cxx
// python wrapper for vtkCameraInterpolator // #define VTK_WRAPPING_CXX #define VTK_STREAMS_FWD_ONLY #include "vtkPythonArgs.h" #include "vtkPythonOverload.h" #include "vtkConfigure.h" #include <vtksys/ios/sstream> #include "vtkIndent.h" #include "vtkCameraInterpolator.h" #if defined(VTK_BUILD_SHARED_LIBS) # define VTK_PYTHON_EXPORT VTK_ABI_EXPORT # define VTK_PYTHON_IMPORT VTK_ABI_IMPORT #else # define VTK_PYTHON_EXPORT VTK_ABI_EXPORT # define VTK_PYTHON_IMPORT VTK_ABI_EXPORT #endif extern "C" { VTK_PYTHON_EXPORT void PyVTKAddFile_vtkCameraInterpolator(PyObject *, const char *); } extern "C" { VTK_PYTHON_EXPORT PyObject *PyVTKClass_vtkCameraInterpolatorNew(const char *); } #ifndef DECLARED_PyVTKClass_vtkObjectNew extern "C" { PyObject *PyVTKClass_vtkObjectNew(const char *); } #define DECLARED_PyVTKClass_vtkObjectNew #endif static const char **PyvtkCameraInterpolator_Doc(); static PyObject * PyvtkCameraInterpolator_GetClassName(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetClassName"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { const char *tempr = (ap.IsBound() ? op->GetClassName() : op->vtkCameraInterpolator::GetClassName()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); char *temp0 = NULL; PyObject *result = NULL; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = (ap.IsBound() ? op->IsA(temp0) : op->vtkCameraInterpolator::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { vtkCameraInterpolator *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkCameraInterpolator::NewInstance()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); if (result && PyVTKObject_Check(result)) { PyVTKObject_GetObject(result)->UnRegister(0); PyVTKObject_SetFlag(result, VTK_PYTHON_IGNORE_UNREGISTER, 1); } } } return result; } static PyObject * PyvtkCameraInterpolator_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObject *temp0 = NULL; PyObject *result = NULL; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObject")) { vtkCameraInterpolator *tempr = vtkCameraInterpolator::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_GetNumberOfCameras(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetNumberOfCameras"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { int tempr = (ap.IsBound() ? op->GetNumberOfCameras() : op->vtkCameraInterpolator::GetNumberOfCameras()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_GetMinimumT(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetMinimumT"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { double tempr = (ap.IsBound() ? op->GetMinimumT() : op->vtkCameraInterpolator::GetMinimumT()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_GetMaximumT(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetMaximumT"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { double tempr = (ap.IsBound() ? op->GetMaximumT() : op->vtkCameraInterpolator::GetMaximumT()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_Initialize(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Initialize"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->Initialize(); } else { op->vtkCameraInterpolator::Initialize(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCameraInterpolator_AddCamera(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "AddCamera"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); double temp0; vtkCamera *temp1 = NULL; PyObject *result = NULL; if (op && ap.CheckArgCount(2) && ap.GetValue(temp0) && ap.GetVTKObject(temp1, "vtkCamera")) { if (ap.IsBound()) { op->AddCamera(temp0, temp1); } else { op->vtkCameraInterpolator::AddCamera(temp0, temp1); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCameraInterpolator_RemoveCamera(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "RemoveCamera"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); double temp0; PyObject *result = NULL; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->RemoveCamera(temp0); } else { op->vtkCameraInterpolator::RemoveCamera(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCameraInterpolator_InterpolateCamera(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "InterpolateCamera"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); double temp0; vtkCamera *temp1 = NULL; PyObject *result = NULL; if (op && ap.CheckArgCount(2) && ap.GetValue(temp0) && ap.GetVTKObject(temp1, "vtkCamera")) { if (ap.IsBound()) { op->InterpolateCamera(temp0, temp1); } else { op->vtkCameraInterpolator::InterpolateCamera(temp0, temp1); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCameraInterpolator_SetInterpolationType(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetInterpolationType"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); int temp0; PyObject *result = NULL; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetInterpolationType(temp0); } else { op->vtkCameraInterpolator::SetInterpolationType(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCameraInterpolator_GetInterpolationTypeMinValue(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetInterpolationTypeMinValue"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { int tempr = (ap.IsBound() ? op->GetInterpolationTypeMinValue() : op->vtkCameraInterpolator::GetInterpolationTypeMinValue()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_GetInterpolationTypeMaxValue(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetInterpolationTypeMaxValue"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { int tempr = (ap.IsBound() ? op->GetInterpolationTypeMaxValue() : op->vtkCameraInterpolator::GetInterpolationTypeMaxValue()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_GetInterpolationType(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetInterpolationType"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { int tempr = (ap.IsBound() ? op->GetInterpolationType() : op->vtkCameraInterpolator::GetInterpolationType()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_SetInterpolationTypeToLinear(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetInterpolationTypeToLinear"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->SetInterpolationTypeToLinear(); } else { op->vtkCameraInterpolator::SetInterpolationTypeToLinear(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCameraInterpolator_SetInterpolationTypeToSpline(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetInterpolationTypeToSpline"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->SetInterpolationTypeToSpline(); } else { op->vtkCameraInterpolator::SetInterpolationTypeToSpline(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCameraInterpolator_SetInterpolationTypeToManual(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetInterpolationTypeToManual"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->SetInterpolationTypeToManual(); } else { op->vtkCameraInterpolator::SetInterpolationTypeToManual(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCameraInterpolator_SetPositionInterpolator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetPositionInterpolator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); vtkTupleInterpolator *temp0 = NULL; PyObject *result = NULL; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkTupleInterpolator")) { if (ap.IsBound()) { op->SetPositionInterpolator(temp0); } else { op->vtkCameraInterpolator::SetPositionInterpolator(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCameraInterpolator_GetPositionInterpolator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetPositionInterpolator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { vtkTupleInterpolator *tempr = (ap.IsBound() ? op->GetPositionInterpolator() : op->vtkCameraInterpolator::GetPositionInterpolator()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_SetFocalPointInterpolator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetFocalPointInterpolator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); vtkTupleInterpolator *temp0 = NULL; PyObject *result = NULL; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkTupleInterpolator")) { if (ap.IsBound()) { op->SetFocalPointInterpolator(temp0); } else { op->vtkCameraInterpolator::SetFocalPointInterpolator(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCameraInterpolator_GetFocalPointInterpolator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetFocalPointInterpolator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { vtkTupleInterpolator *tempr = (ap.IsBound() ? op->GetFocalPointInterpolator() : op->vtkCameraInterpolator::GetFocalPointInterpolator()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_SetViewUpInterpolator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetViewUpInterpolator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); vtkTupleInterpolator *temp0 = NULL; PyObject *result = NULL; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkTupleInterpolator")) { if (ap.IsBound()) { op->SetViewUpInterpolator(temp0); } else { op->vtkCameraInterpolator::SetViewUpInterpolator(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCameraInterpolator_GetViewUpInterpolator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetViewUpInterpolator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { vtkTupleInterpolator *tempr = (ap.IsBound() ? op->GetViewUpInterpolator() : op->vtkCameraInterpolator::GetViewUpInterpolator()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_SetViewAngleInterpolator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetViewAngleInterpolator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); vtkTupleInterpolator *temp0 = NULL; PyObject *result = NULL; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkTupleInterpolator")) { if (ap.IsBound()) { op->SetViewAngleInterpolator(temp0); } else { op->vtkCameraInterpolator::SetViewAngleInterpolator(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCameraInterpolator_GetViewAngleInterpolator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetViewAngleInterpolator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { vtkTupleInterpolator *tempr = (ap.IsBound() ? op->GetViewAngleInterpolator() : op->vtkCameraInterpolator::GetViewAngleInterpolator()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_SetParallelScaleInterpolator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetParallelScaleInterpolator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); vtkTupleInterpolator *temp0 = NULL; PyObject *result = NULL; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkTupleInterpolator")) { if (ap.IsBound()) { op->SetParallelScaleInterpolator(temp0); } else { op->vtkCameraInterpolator::SetParallelScaleInterpolator(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCameraInterpolator_GetParallelScaleInterpolator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetParallelScaleInterpolator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { vtkTupleInterpolator *tempr = (ap.IsBound() ? op->GetParallelScaleInterpolator() : op->vtkCameraInterpolator::GetParallelScaleInterpolator()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_SetClippingRangeInterpolator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetClippingRangeInterpolator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); vtkTupleInterpolator *temp0 = NULL; PyObject *result = NULL; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkTupleInterpolator")) { if (ap.IsBound()) { op->SetClippingRangeInterpolator(temp0); } else { op->vtkCameraInterpolator::SetClippingRangeInterpolator(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCameraInterpolator_GetClippingRangeInterpolator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetClippingRangeInterpolator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { vtkTupleInterpolator *tempr = (ap.IsBound() ? op->GetClippingRangeInterpolator() : op->vtkCameraInterpolator::GetClippingRangeInterpolator()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkCameraInterpolator_GetMTime(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetMTime"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCameraInterpolator *op = static_cast<vtkCameraInterpolator *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) { unsigned long tempr = (ap.IsBound() ? op->GetMTime() : op->vtkCameraInterpolator::GetMTime()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyMethodDef PyvtkCameraInterpolator_Methods[] = { {(char*)"GetClassName", PyvtkCameraInterpolator_GetClassName, METH_VARARGS, (char*)"V.GetClassName() -> string\nC++: const char *GetClassName()\n\n"}, {(char*)"IsA", PyvtkCameraInterpolator_IsA, METH_VARARGS, (char*)"V.IsA(string) -> int\nC++: int IsA(const char *name)\n\n"}, {(char*)"NewInstance", PyvtkCameraInterpolator_NewInstance, METH_VARARGS, (char*)"V.NewInstance() -> vtkCameraInterpolator\nC++: vtkCameraInterpolator *NewInstance()\n\n"}, {(char*)"SafeDownCast", PyvtkCameraInterpolator_SafeDownCast, METH_VARARGS | METH_STATIC, (char*)"V.SafeDownCast(vtkObject) -> vtkCameraInterpolator\nC++: vtkCameraInterpolator *SafeDownCast(vtkObject* o)\n\n"}, {(char*)"GetNumberOfCameras", PyvtkCameraInterpolator_GetNumberOfCameras, METH_VARARGS, (char*)"V.GetNumberOfCameras() -> int\nC++: int GetNumberOfCameras()\n\nReturn the number of cameras in the list of cameras.\n"}, {(char*)"GetMinimumT", PyvtkCameraInterpolator_GetMinimumT, METH_VARARGS, (char*)"V.GetMinimumT() -> float\nC++: double GetMinimumT()\n\nObtain some information about the interpolation range. The\nnumbers returned are undefined if the list of cameras is empty.\n"}, {(char*)"GetMaximumT", PyvtkCameraInterpolator_GetMaximumT, METH_VARARGS, (char*)"V.GetMaximumT() -> float\nC++: double GetMaximumT()\n\nObtain some information about the interpolation range. The\nnumbers returned are undefined if the list of cameras is empty.\n"}, {(char*)"Initialize", PyvtkCameraInterpolator_Initialize, METH_VARARGS, (char*)"V.Initialize()\nC++: void Initialize()\n\nClear the list of cameras.\n"}, {(char*)"AddCamera", PyvtkCameraInterpolator_AddCamera, METH_VARARGS, (char*)"V.AddCamera(float, vtkCamera)\nC++: void AddCamera(double t, vtkCamera *camera)\n\nAdd another camera to the list of cameras defining the camera\nfunction. Note that using the same time t value more than once\nreplaces the previous camera value at t. At least one camera must\nbe added to define a function.\n"}, {(char*)"RemoveCamera", PyvtkCameraInterpolator_RemoveCamera, METH_VARARGS, (char*)"V.RemoveCamera(float)\nC++: void RemoveCamera(double t)\n\nDelete the camera at a particular parameter t. If there is no\ncamera defined at location t, then the method does nothing.\n"}, {(char*)"InterpolateCamera", PyvtkCameraInterpolator_InterpolateCamera, METH_VARARGS, (char*)"V.InterpolateCamera(float, vtkCamera)\nC++: void InterpolateCamera(double t, vtkCamera *camera)\n\nInterpolate the list of cameras and determine a new camera (i.e.,\nfill in the camera provided). If t is outside the range of\n(min,max) values, then t is clamped to lie within this range.\n"}, {(char*)"SetInterpolationType", PyvtkCameraInterpolator_SetInterpolationType, METH_VARARGS, (char*)"V.SetInterpolationType(int)\nC++: void SetInterpolationType(int)\n\nThese are convenience methods to switch between linear and spline\ninterpolation. The methods simply forward the request for linear\nor spline interpolation to the instance variable interpolators\n(i.e., position, focal point, clipping range, orientation, etc.)\ninterpolators. Note that if the InterpolationType is set to\n\"Manual\", then the interpolators are expected to be directly\nmanipulated and this class does not forward the request for\ninterpolation type to its interpolators.\n"}, {(char*)"GetInterpolationTypeMinValue", PyvtkCameraInterpolator_GetInterpolationTypeMinValue, METH_VARARGS, (char*)"V.GetInterpolationTypeMinValue() -> int\nC++: int GetInterpolationTypeMinValue()\n\nThese are convenience methods to switch between linear and spline\ninterpolation. The methods simply forward the request for linear\nor spline interpolation to the instance variable interpolators\n(i.e., position, focal point, clipping range, orientation, etc.)\ninterpolators. Note that if the InterpolationType is set to\n\"Manual\", then the interpolators are expected to be directly\nmanipulated and this class does not forward the request for\ninterpolation type to its interpolators.\n"}, {(char*)"GetInterpolationTypeMaxValue", PyvtkCameraInterpolator_GetInterpolationTypeMaxValue, METH_VARARGS, (char*)"V.GetInterpolationTypeMaxValue() -> int\nC++: int GetInterpolationTypeMaxValue()\n\nThese are convenience methods to switch between linear and spline\ninterpolation. The methods simply forward the request for linear\nor spline interpolation to the instance variable interpolators\n(i.e., position, focal point, clipping range, orientation, etc.)\ninterpolators. Note that if the InterpolationType is set to\n\"Manual\", then the interpolators are expected to be directly\nmanipulated and this class does not forward the request for\ninterpolation type to its interpolators.\n"}, {(char*)"GetInterpolationType", PyvtkCameraInterpolator_GetInterpolationType, METH_VARARGS, (char*)"V.GetInterpolationType() -> int\nC++: int GetInterpolationType()\n\nThese are convenience methods to switch between linear and spline\ninterpolation. The methods simply forward the request for linear\nor spline interpolation to the instance variable interpolators\n(i.e., position, focal point, clipping range, orientation, etc.)\ninterpolators. Note that if the InterpolationType is set to\n\"Manual\", then the interpolators are expected to be directly\nmanipulated and this class does not forward the request for\ninterpolation type to its interpolators.\n"}, {(char*)"SetInterpolationTypeToLinear", PyvtkCameraInterpolator_SetInterpolationTypeToLinear, METH_VARARGS, (char*)"V.SetInterpolationTypeToLinear()\nC++: void SetInterpolationTypeToLinear()\n\nThese are convenience methods to switch between linear and spline\ninterpolation. The methods simply forward the request for linear\nor spline interpolation to the instance variable interpolators\n(i.e., position, focal point, clipping range, orientation, etc.)\ninterpolators. Note that if the InterpolationType is set to\n\"Manual\", then the interpolators are expected to be directly\nmanipulated and this class does not forward the request for\ninterpolation type to its interpolators.\n"}, {(char*)"SetInterpolationTypeToSpline", PyvtkCameraInterpolator_SetInterpolationTypeToSpline, METH_VARARGS, (char*)"V.SetInterpolationTypeToSpline()\nC++: void SetInterpolationTypeToSpline()\n\nThese are convenience methods to switch between linear and spline\ninterpolation. The methods simply forward the request for linear\nor spline interpolation to the instance variable interpolators\n(i.e., position, focal point, clipping range, orientation, etc.)\ninterpolators. Note that if the InterpolationType is set to\n\"Manual\", then the interpolators are expected to be directly\nmanipulated and this class does not forward the request for\ninterpolation type to its interpolators.\n"}, {(char*)"SetInterpolationTypeToManual", PyvtkCameraInterpolator_SetInterpolationTypeToManual, METH_VARARGS, (char*)"V.SetInterpolationTypeToManual()\nC++: void SetInterpolationTypeToManual()\n\nThese are convenience methods to switch between linear and spline\ninterpolation. The methods simply forward the request for linear\nor spline interpolation to the instance variable interpolators\n(i.e., position, focal point, clipping range, orientation, etc.)\ninterpolators. Note that if the InterpolationType is set to\n\"Manual\", then the interpolators are expected to be directly\nmanipulated and this class does not forward the request for\ninterpolation type to its interpolators.\n"}, {(char*)"SetPositionInterpolator", PyvtkCameraInterpolator_SetPositionInterpolator, METH_VARARGS, (char*)"V.SetPositionInterpolator(vtkTupleInterpolator)\nC++: virtual void SetPositionInterpolator(vtkTupleInterpolator *)\n\nSet/Get the tuple interpolator used to interpolate the position\nportion of the camera. Note that you can modify the behavior of\nthe interpolator (linear vs spline interpolation; change spline\nbasis) by manipulating the interpolator instances directly.\n"}, {(char*)"GetPositionInterpolator", PyvtkCameraInterpolator_GetPositionInterpolator, METH_VARARGS, (char*)"V.GetPositionInterpolator() -> vtkTupleInterpolator\nC++: vtkTupleInterpolator *GetPositionInterpolator()\n\nSet/Get the tuple interpolator used to interpolate the position\nportion of the camera. Note that you can modify the behavior of\nthe interpolator (linear vs spline interpolation; change spline\nbasis) by manipulating the interpolator instances directly.\n"}, {(char*)"SetFocalPointInterpolator", PyvtkCameraInterpolator_SetFocalPointInterpolator, METH_VARARGS, (char*)"V.SetFocalPointInterpolator(vtkTupleInterpolator)\nC++: virtual void SetFocalPointInterpolator(\n vtkTupleInterpolator *)\n\nSet/Get the tuple interpolator used to interpolate the focal\npoint portion of the camera. Note that you can modify the\nbehavior of the interpolator (linear vs spline interpolation;\nchange spline basis) by manipulating the interpolator instances\ndirectly.\n"}, {(char*)"GetFocalPointInterpolator", PyvtkCameraInterpolator_GetFocalPointInterpolator, METH_VARARGS, (char*)"V.GetFocalPointInterpolator() -> vtkTupleInterpolator\nC++: vtkTupleInterpolator *GetFocalPointInterpolator()\n\nSet/Get the tuple interpolator used to interpolate the focal\npoint portion of the camera. Note that you can modify the\nbehavior of the interpolator (linear vs spline interpolation;\nchange spline basis) by manipulating the interpolator instances\ndirectly.\n"}, {(char*)"SetViewUpInterpolator", PyvtkCameraInterpolator_SetViewUpInterpolator, METH_VARARGS, (char*)"V.SetViewUpInterpolator(vtkTupleInterpolator)\nC++: virtual void SetViewUpInterpolator(vtkTupleInterpolator *)\n\nSet/Get the tuple interpolator used to interpolate the view up\nportion of the camera. Note that you can modify the behavior of\nthe interpolator (linear vs spline interpolation; change spline\nbasis) by manipulating the interpolator instances directly.\n"}, {(char*)"GetViewUpInterpolator", PyvtkCameraInterpolator_GetViewUpInterpolator, METH_VARARGS, (char*)"V.GetViewUpInterpolator() -> vtkTupleInterpolator\nC++: vtkTupleInterpolator *GetViewUpInterpolator()\n\nSet/Get the tuple interpolator used to interpolate the view up\nportion of the camera. Note that you can modify the behavior of\nthe interpolator (linear vs spline interpolation; change spline\nbasis) by manipulating the interpolator instances directly.\n"}, {(char*)"SetViewAngleInterpolator", PyvtkCameraInterpolator_SetViewAngleInterpolator, METH_VARARGS, (char*)"V.SetViewAngleInterpolator(vtkTupleInterpolator)\nC++: virtual void SetViewAngleInterpolator(vtkTupleInterpolator *)\n\nSet/Get the tuple interpolator used to interpolate the view angle\nportion of the camera. Note that you can modify the behavior of\nthe interpolator (linear vs spline interpolation; change spline\nbasis) by manipulating the interpolator instances directly.\n"}, {(char*)"GetViewAngleInterpolator", PyvtkCameraInterpolator_GetViewAngleInterpolator, METH_VARARGS, (char*)"V.GetViewAngleInterpolator() -> vtkTupleInterpolator\nC++: vtkTupleInterpolator *GetViewAngleInterpolator()\n\nSet/Get the tuple interpolator used to interpolate the view angle\nportion of the camera. Note that you can modify the behavior of\nthe interpolator (linear vs spline interpolation; change spline\nbasis) by manipulating the interpolator instances directly.\n"}, {(char*)"SetParallelScaleInterpolator", PyvtkCameraInterpolator_SetParallelScaleInterpolator, METH_VARARGS, (char*)"V.SetParallelScaleInterpolator(vtkTupleInterpolator)\nC++: virtual void SetParallelScaleInterpolator(\n vtkTupleInterpolator *)\n\nSet/Get the tuple interpolator used to interpolate the parallel\nscale portion of the camera. Note that you can modify the\nbehavior of the interpolator (linear vs spline interpolation;\nchange spline basis) by manipulating the interpolator instances\ndirectly.\n"}, {(char*)"GetParallelScaleInterpolator", PyvtkCameraInterpolator_GetParallelScaleInterpolator, METH_VARARGS, (char*)"V.GetParallelScaleInterpolator() -> vtkTupleInterpolator\nC++: vtkTupleInterpolator *GetParallelScaleInterpolator()\n\nSet/Get the tuple interpolator used to interpolate the parallel\nscale portion of the camera. Note that you can modify the\nbehavior of the interpolator (linear vs spline interpolation;\nchange spline basis) by manipulating the interpolator instances\ndirectly.\n"}, {(char*)"SetClippingRangeInterpolator", PyvtkCameraInterpolator_SetClippingRangeInterpolator, METH_VARARGS, (char*)"V.SetClippingRangeInterpolator(vtkTupleInterpolator)\nC++: virtual void SetClippingRangeInterpolator(\n vtkTupleInterpolator *)\n\nSet/Get the tuple interpolator used to interpolate the clipping\nrange portion of the camera. Note that you can modify the\nbehavior of the interpolator (linear vs spline interpolation;\nchange spline basis) by manipulating the interpolator instances\ndirectly.\n"}, {(char*)"GetClippingRangeInterpolator", PyvtkCameraInterpolator_GetClippingRangeInterpolator, METH_VARARGS, (char*)"V.GetClippingRangeInterpolator() -> vtkTupleInterpolator\nC++: vtkTupleInterpolator *GetClippingRangeInterpolator()\n\nSet/Get the tuple interpolator used to interpolate the clipping\nrange portion of the camera. Note that you can modify the\nbehavior of the interpolator (linear vs spline interpolation;\nchange spline basis) by manipulating the interpolator instances\ndirectly.\n"}, {(char*)"GetMTime", PyvtkCameraInterpolator_GetMTime, METH_VARARGS, (char*)"V.GetMTime() -> int\nC++: unsigned long GetMTime()\n\nOverride GetMTime() because we depend on the interpolators which\nmay be modified outside of this class.\n"}, {NULL, NULL, 0, NULL} }; static vtkObjectBase *PyvtkCameraInterpolator_StaticNew() { return vtkCameraInterpolator::New(); } PyObject *PyVTKClass_vtkCameraInterpolatorNew(const char *modulename) { PyObject *cls = PyVTKClass_New(&PyvtkCameraInterpolator_StaticNew, PyvtkCameraInterpolator_Methods, "vtkCameraInterpolator", modulename, NULL, NULL, PyvtkCameraInterpolator_Doc(), PyVTKClass_vtkObjectNew(modulename)); if (cls) { PyObject *d = PyVTKClass_GetDict(cls); PyObject *o; for (int c = 0; c < 3; c++) { static const struct { const char *name; int value; } constants[3] = { { "INTERPOLATION_TYPE_LINEAR", vtkCameraInterpolator::INTERPOLATION_TYPE_LINEAR }, { "INTERPOLATION_TYPE_SPLINE", vtkCameraInterpolator::INTERPOLATION_TYPE_SPLINE }, { "INTERPOLATION_TYPE_MANUAL", vtkCameraInterpolator::INTERPOLATION_TYPE_MANUAL }, }; o = PyInt_FromLong(constants[c].value); if (o) { PyDict_SetItemString(d, (char *)constants[c].name, o); Py_DECREF(o); } } } return cls; } const char **PyvtkCameraInterpolator_Doc() { static const char *docstring[] = { "vtkCameraInterpolator - interpolate a series of cameras to update a\nnew camera\n\n", "Superclass: vtkObject\n\n", "This class is used to interpolate a series of cameras to update a\nspecified camera. Either linear interpolation or spline interpolation\nmay be used. The instance variables currently interpolated include\nposition, focal point, view up, view angle, parallel scale, and\nclipping range.\n\nTo use this class, specify the type of interpolation to use, and add\na series of cameras at various times \"t\" to the", " list of cameras from\nwhich to interpolate. Then to interpolate in between cameras, simply\ninvoke the function InterpolateCamera(t,camera) where \"camera\" is the\ncamera to be updated with interpolated values. Note that \"t\" should\nbe in the range (min,max) times specified with the AddCamera()\nmethod. If outside this range, the interpolation is clamped. This\nclass copies the camera information (as co", "mpared to referencing the\ncameras) so you do not need to keep separate instances of the camera\naround for each camera added to the list of cameras to interpolate.\n\nCaveats:\n\nThe interpolator classes are initialized the first time\nInterpolateCamera() is called. Any later changes to the\ninterpolators, or additions to the list of cameras to be\ninterpolated, causes a reinitialization of the interpolat", "ors the next\ntime InterpolateCamera() is invoked. Thus the best performance is\nobtained by 1) configuring the interpolators, 2) adding all the\ncameras, and 3) finally performing interpolation.\n\nCurrently position, focal point and view up are interpolated to\ndefine the orientation of the camera. Quaternion interpolation may be\nadded in the future as an alternative interpolation method for camera\nor", "ientation.\n\n", NULL }; return docstring; } void PyVTKAddFile_vtkCameraInterpolator( PyObject *dict, const char *modulename) { PyObject *o; o = PyVTKClass_vtkCameraInterpolatorNew(modulename); if (o && PyDict_SetItemString(dict, (char *)"vtkCameraInterpolator", o) != 0) { Py_DECREF(o); } }
[ "mpasVM@localhost.org" ]
mpasVM@localhost.org
e039462023d4e5ab37a6d9e20bf7a945396d0fd4
45c84e64a486a3c48bd41a78e28252acbc0cc1b0
/src/ppapi/proxy/pdf_resource.cc
0dcaeaf32e135cf9c9798d5c5c13206e26b09832
[ "BSD-3-Clause", "LicenseRef-scancode-khronos", "MIT" ]
permissive
stanleywxc/chromium-noupdator
47f9cccc6256b1e5b0cb22c598b7a86f5453eb42
637f32e9bf9079f31430c9aa9c64a75247993a71
refs/heads/master
2022-12-03T22:00:20.940455
2019-10-04T16:29:31
2019-10-04T16:29:31
212,851,250
1
2
MIT
2022-11-17T09:51:04
2019-10-04T15:49:33
null
UTF-8
C++
false
false
9,193
cc
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ppapi/proxy/pdf_resource.h" #include <stddef.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <limits> #include <utility> #include <vector> #include "base/command_line.h" #include "base/debug/crash_logging.h" #include "base/metrics/histogram.h" #include "base/strings/utf_string_conversions.h" #include "gin/v8_initializer.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/private/ppb_pdf.h" #include "ppapi/proxy/plugin_globals.h" #include "ppapi/proxy/ppapi_messages.h" #include "ppapi/shared_impl/pdf_accessibility_shared.h" #include "ppapi/shared_impl/var.h" #include "third_party/icu/source/i18n/unicode/usearch.h" namespace ppapi { namespace proxy { namespace { // TODO(raymes): This is just copied from render_thread_impl.cc. We should have // generic code somewhere to get the locale in the plugin. std::string GetLocale() { // The browser process should have passed the locale to the plugin via the // --lang command line flag. const base::CommandLine& parsed_command_line = *base::CommandLine::ForCurrentProcess(); const std::string& lang = parsed_command_line.GetSwitchValueASCII("lang"); DCHECK(!lang.empty()); return lang; } } // namespace PDFResource::PDFResource(Connection connection, PP_Instance instance) : PluginResource(connection, instance) { SendCreate(RENDERER, PpapiHostMsg_PDF_Create()); } PDFResource::~PDFResource() { } thunk::PPB_PDF_API* PDFResource::AsPPB_PDF_API() { return this; } void PDFResource::SearchString(const unsigned short* input_string, const unsigned short* input_term, bool case_sensitive, PP_PrivateFindResult** results, uint32_t* count) { if (locale_.empty()) locale_ = GetLocale() + "@collation=search"; const base::char16* string = reinterpret_cast<const base::char16*>(input_string); const base::char16* term = reinterpret_cast<const base::char16*>(input_term); UErrorCode status = U_ZERO_ERROR; UStringSearch* searcher = usearch_open(term, -1, string, -1, locale_.c_str(), nullptr, &status); DCHECK(status == U_ZERO_ERROR || status == U_USING_FALLBACK_WARNING || status == U_USING_DEFAULT_WARNING) << status; UCollationStrength strength = case_sensitive ? UCOL_TERTIARY : UCOL_PRIMARY; UCollator* collator = usearch_getCollator(searcher); if (ucol_getStrength(collator) != strength) { ucol_setStrength(collator, strength); usearch_reset(searcher); } status = U_ZERO_ERROR; int match_start = usearch_first(searcher, &status); DCHECK_EQ(U_ZERO_ERROR, status); std::vector<PP_PrivateFindResult> pp_results; while (match_start != USEARCH_DONE) { int32_t matched_length = usearch_getMatchedLength(searcher); PP_PrivateFindResult result; result.start_index = match_start; result.length = matched_length; pp_results.push_back(result); match_start = usearch_next(searcher, &status); DCHECK_EQ(U_ZERO_ERROR, status); } if (pp_results.empty() || pp_results.size() > std::numeric_limits<uint32_t>::max() || pp_results.size() > SIZE_MAX / sizeof(PP_PrivateFindResult)) { *count = 0; *results = nullptr; } else { *count = static_cast<uint32_t>(pp_results.size()); const size_t result_size = pp_results.size() * sizeof(PP_PrivateFindResult); *results = reinterpret_cast<PP_PrivateFindResult*>(malloc(result_size)); memcpy(*results, &pp_results[0], result_size); } usearch_close(searcher); } void PDFResource::DidStartLoading() { Post(RENDERER, PpapiHostMsg_PDF_DidStartLoading()); } void PDFResource::DidStopLoading() { Post(RENDERER, PpapiHostMsg_PDF_DidStopLoading()); } void PDFResource::SetContentRestriction(int restrictions) { Post(RENDERER, PpapiHostMsg_PDF_SetContentRestriction(restrictions)); } void PDFResource::UserMetricsRecordAction(const PP_Var& action) { scoped_refptr<ppapi::StringVar> action_str( ppapi::StringVar::FromPPVar(action)); if (action_str.get()) { Post(RENDERER, PpapiHostMsg_PDF_UserMetricsRecordAction(action_str->value())); } } void PDFResource::HasUnsupportedFeature() { Post(RENDERER, PpapiHostMsg_PDF_HasUnsupportedFeature()); } void PDFResource::Print() { Post(RENDERER, PpapiHostMsg_PDF_Print()); } void PDFResource::ShowAlertDialog(const char* message) { SyncCall<PpapiPluginMsg_PDF_ShowAlertDialogReply>( RENDERER, PpapiHostMsg_PDF_ShowAlertDialog(message)); } bool PDFResource::ShowConfirmDialog(const char* message) { bool bool_result = false; if (SyncCall<PpapiPluginMsg_PDF_ShowConfirmDialogReply>( RENDERER, PpapiHostMsg_PDF_ShowConfirmDialog(message), &bool_result) != PP_OK) { return false; } return bool_result; } PP_Var PDFResource::ShowPromptDialog(const char* message, const char* default_answer) { std::string str_result; if (SyncCall<PpapiPluginMsg_PDF_ShowPromptDialogReply>( RENDERER, PpapiHostMsg_PDF_ShowPromptDialog(message, default_answer), &str_result) != PP_OK) { return PP_MakeUndefined(); } return StringVar::StringToPPVar(str_result); } void PDFResource::SaveAs() { Post(RENDERER, PpapiHostMsg_PDF_SaveAs()); } PP_Bool PDFResource::IsFeatureEnabled(PP_PDFFeature feature) { PP_Bool result = PP_FALSE; switch (feature) { case PP_PDFFEATURE_HIDPI: result = PP_TRUE; break; case PP_PDFFEATURE_PRINTING: // TODO(raymes): Use PrintRenderFrameHelper::IsPrintingEnabled. result = PP_FALSE; break; } return result; } void PDFResource::SetSelectedText(const char* selected_text) { Post(RENDERER, PpapiHostMsg_PDF_SetSelectedText(base::UTF8ToUTF16(selected_text))); } void PDFResource::SetLinkUnderCursor(const char* url) { Post(RENDERER, PpapiHostMsg_PDF_SetLinkUnderCursor(url)); } void PDFResource::GetV8ExternalSnapshotData(const char** natives_data_out, int* natives_size_out, const char** snapshot_data_out, int* snapshot_size_out) { gin::V8Initializer::GetV8ExternalSnapshotData( natives_data_out, natives_size_out, snapshot_data_out, snapshot_size_out); } void PDFResource::SetAccessibilityDocInfo( const PP_PrivateAccessibilityDocInfo* doc_info) { Post(RENDERER, PpapiHostMsg_PDF_SetAccessibilityDocInfo(*doc_info)); } void PDFResource::SetAccessibilityViewportInfo( const PP_PrivateAccessibilityViewportInfo* viewport_info) { Post(RENDERER, PpapiHostMsg_PDF_SetAccessibilityViewportInfo(*viewport_info)); } void PDFResource::SetAccessibilityPageInfo( const PP_PrivateAccessibilityPageInfo* page_info, const PP_PrivateAccessibilityTextRunInfo text_runs[], const PP_PrivateAccessibilityCharInfo chars[], const PP_PrivateAccessibilityLinkInfo links[], const PP_PrivateAccessibilityImageInfo images[]) { std::vector<PP_PrivateAccessibilityTextRunInfo> text_run_vector( text_runs, text_runs + page_info->text_run_count); std::vector<PP_PrivateAccessibilityCharInfo> char_vector( chars, chars + page_info->char_count); // Pepper APIs require us to pass strings as char*, but IPC expects // std::string. Convert information for links and images to meet these // requirements. std::vector<ppapi::PdfAccessibilityLinkInfo> link_vector; link_vector.reserve(page_info->link_count); for (size_t i = 0; i < page_info->link_count; i++) { link_vector.emplace_back(links[i]); } std::vector<ppapi::PdfAccessibilityImageInfo> image_vector; image_vector.reserve(page_info->image_count); for (size_t i = 0; i < page_info->image_count; i++) { image_vector.emplace_back(images[i]); } Post(RENDERER, PpapiHostMsg_PDF_SetAccessibilityPageInfo( *page_info, text_run_vector, char_vector, link_vector, image_vector)); } void PDFResource::SetCrashData(const char* pdf_url, const char* top_level_url) { if (pdf_url) { static base::debug::CrashKeyString* subresource_url = base::debug::AllocateCrashKeyString("subresource_url", base::debug::CrashKeySize::Size256); base::debug::SetCrashKeyString(subresource_url, pdf_url); } if (top_level_url) PluginGlobals::Get()->SetActiveURL(top_level_url); } void PDFResource::SelectionChanged(const PP_FloatPoint& left, int32_t left_height, const PP_FloatPoint& right, int32_t right_height) { Post(RENDERER, PpapiHostMsg_PDF_SelectionChanged(left, left_height, right, right_height)); } void PDFResource::SetPluginCanSave(bool can_save) { Post(RENDERER, PpapiHostMsg_PDF_SetPluginCanSave(can_save)); } } // namespace proxy } // namespace ppapi
[ "stanley@moon.lan" ]
stanley@moon.lan
4d7436458a6f035ae18128e7be39b04cfe407cb8
2e3d9d4b286b7b3d0b367181f5d1c2c154fb9b28
/excise/Service/function.h
e24c0cb0826726319f7ffd7572ff2e4aa386a6f9
[]
no_license
squirrelClare/algorithm_cplusplus
8237baf5cea6f79889eaad6360b2dadd7a1b3624
312a63851182962d014b6b5fba28bdd51decb033
refs/heads/master
2021-01-10T03:38:40.434217
2015-10-22T17:36:57
2015-10-22T17:36:57
44,685,760
0
0
null
null
null
null
UTF-8
C++
false
false
171
h
#ifndef FUNCTION_H #define FUNCTION_H #include<QString> class Function { public: Function(); QString ExtractWebFileName(QString src); }; #endif // FUNCTION_H
[ "zcc136314853@hotmail.com" ]
zcc136314853@hotmail.com
785b3864a7a9097e92591d161cd215992162cd26
833e297fea75634a0f33d877ffc19550c51d270c
/2010/NETB101/sources/ch6/product.h
609cba6dd661cc3967d05979dc0289f2055aba63
[]
no_license
nkirov/nkirov.github.com
8256b9ba7020d6b7227f11a5b5d29896479f56b5
ab517219fa2b8fab65780fb4b09add99f4186e89
refs/heads/master
2023-08-05T10:41:06.382008
2023-07-27T06:03:39
2023-07-27T06:03:39
8,162,726
2
0
null
null
null
null
UTF-8
C++
false
false
582
h
#ifndef PRODUCT_H #define PRODUCT_H #include <string> using namespace std; class Product { public: /** Constructs a product with score 0 and price 1. */ Product(); /** Reads in this product object. */ void read(); /** Compares two product objects. @param b the object to compare with this object @retur true if this object is better than b */ bool is_better_than(Product b) const; /** Print this product object */ void print() const; private: string name; double price; int score; }; #endif
[ "nkkirov@gmail.com" ]
nkkirov@gmail.com
70dd4d9839f280869e58fd5821e693ca9add0663
ea3fc240df69981e9adb93a087c995de77a95773
/src/GameObj.cpp
33b8e7625cb625d0a84409ebe5fb713c57bba8c7
[]
no_license
lansdon/Fortress2D
000b2fb23749cf62ae52a68ed0afe053f96ee224
4548abd7941925780fb788eb653411f207489ff0
refs/heads/master
2021-01-16T19:32:31.220482
2011-12-20T01:09:18
2011-12-20T01:09:18
2,854,766
0
0
null
null
null
null
UTF-8
C++
false
false
17,183
cpp
#include "GameObj.h" GameObj::GameObj(Settings *settings, double x, double y) // : //COLLISION_GROUP_GROUND(1), //COLLISION_GROUP_NPC_BULLET(2), //COLLISION_GROUP_NPC_ATTACKER(4), //COLLISION_GROUP_PC_BULLET(16), //COLLISION_GROUP_PC_DEFENDER(32) { this->settings = settings; text.setSettings(settings); elapsedTime = 0; body = NULL; groundContact = false; contacts = 0; // TEMP? // Load texture // textureID = TextureLoader::LoadGLTextures("test.png"); // Sound ID soundSourceID = 0; } GameObj::~GameObj(void) { settings->getWorld()->DestroyBody(body); // Clean up B2Body Objects } void GameObj::move(SoundManager &sm) { if(!moveSpecial(sm)) { if(body) { // Gradual speed increase for objects with a max velocity set // (Bullets should have max Vel ZERO) // this logic will need updating! if(goSettings.getVelocityMax()) { b2Vec2 vel = body->GetLinearVelocity(); vel.x = b2Min( vel.x + 0.1f, goSettings.getVelocityMax() ); body->SetLinearVelocity( vel ); } t_move.Calculate_Ellapsed_Time(); if(t_move.TotalTime() >= TIMER_SOUND_MOVE) { SoundManager::Sounds soundID; switch(goSettings.getTypeID()) { case Settings::OBJ_ID_ARCHER: soundID = sm.SND_ARCHER_MOVE; break; case Settings::OBJ_ID_STONEWALL: soundID = sm.SND_STONEWALL_MOVE; break; // case settings.OBJ_T_DOG: soundID = sm.SND_DOG_MELEE; break; // case settings.OBJ_T_SPEARMAN: soundID = sm.SND_SPEARMAN_MELEE; break; // case settings.OBJ_ID_ARCHER: soundID = sm.SND_ARCHER_MELEE; break; default: soundID = sm.SND_DOG_MOVE; break; } sm.playSound(soundSourceID, soundID, body->GetPosition()); t_move.Reset(0.0); } } } } void GameObj::addEnemy(GameObj *enemy, bool ranged) { bool found = false; for(std::list<GameObj*>::iterator it = enemies.begin(); it != enemies.end(); ++it) { if((*it) == enemy) found = true; } if(!found) { enemies.push_back(enemy); } } void GameObj::removeEnemy(GameObj *enemy, bool ranged) { if(!enemies.size()) return; std::list<GameObj*>::iterator it = enemies.begin(); while(it != enemies.end()) { if((*it) == enemy) { it = enemies.erase(it); return; } else { ++it; } } } void GameObj::attack(GameObj *enemy, SoundManager &sm) { // if(enemy->isAlive()) { // SFX t_melee.Calculate_Ellapsed_Time(); if(t_melee.TotalTime() >= TIMER_SOUND_MELEE) { SoundManager::Sounds soundID; switch(goSettings.getTypeID()) { case Settings::OBJ_ID_ARCHER: soundID = sm.SND_ARCHER_MELEE; break; case Settings::OBJ_ID_STONEWALL: soundID = sm.SND_STONEWALL_MELEE; break; // case settings.OBJ_T_DOG: soundID = sm.SND_DOG_MELEE; break; // case settings.OBJ_T_SPEARMAN: soundID = sm.SND_SPEARMAN_MELEE; break; // case settings.OBJ_ID_ARCHER: soundID = sm.SND_ARCHER_MELEE; break; default: soundID = sm.SND_ARCHER_DAMAGED; break; } sm.playSound(soundSourceID, soundID, body->GetPosition()); t_melee.Reset(0.0); } // DAMAGE ENEMY enemy->damage(goSettings.getDamage(), sm); // Special Behavior (defined in derived classes) attackSpecial(enemy, sm); // } } // This function will calculate launche parameters and save them in the launch struct to be processed by calling object void GameObj::rangedAttack(b2Vec2 nearest) { // Ranged attack // Check timer t_launch.Calculate_Ellapsed_Time(); if(t_launch.TotalTime() < (1 / goSettings._RoF)) { return; } std::srand( time(NULL)); float accuracy = 75.0; // TEMP - This should be a GoSettings variable if(accuracy > 100) accuracy = 100; // Accuracy from 0-100 (percent) 95 means it will hit approx 95/100 times int randomAdj = (100-accuracy)*2; // double to account for +/- double adjustment = rand() % randomAdj - randomAdj/2; int maxRange = (pow(goSettings._LAUNCH_MAX_VEL, 2) * sin((Util::PI/4)*2))/9.8; // (v_0^2 sin(theta)) / g // Closest enemy is out of range (maybe don't bother shooting?) if(maxRange < abs(getPos().x - nearest.x)) { // launch at max velocity + 45 + (45* (adjustment/100)) // to do // need a way to launch arrows... (preload??) // Don't shoot until in range! //launch.angle = 45.0 + (45.0 * (adjustment/100.0)); //launch.velocity.Set(goSettings._LAUNCH_MAX_VEL * cos(Util::deg2Rad(launch.angle)), goSettings._LAUNCH_MAX_VEL * sin(Util::deg2Rad(launch.angle))); //launch.ammo = goSettings.ammo; //launch.launchTriggered = true; } // ENEMY IN RANGE // Need to add random adjustment to velocity AND angle. else { // ANGLE float angle = 45.0 + (45.0 * (adjustment/100.0)); // Take angle with random adjustment if(angle > goSettings._LAUNCH_MAX_ANGLE) angle = goSettings._LAUNCH_MAX_ANGLE; if(angle < goSettings._LAUNCH_MIN_ANGLE) angle = goSettings._LAUNCH_MIN_ANGLE; launch.angle = angle; // VELOCITY // Use angle to calculate a launch velocity to get "near" the target v = sqrt( (R*g) / sin(2theta)) float range = Util::pixel2Meter(abs(nearest.x - body->GetPosition().x)); // meters to enemy int v0 = sqrt( (range * 9.8) / sin(Util::deg2Rad(2 * launch.angle))); v0 += (v0 * adjustment); if(v0 > goSettings._LAUNCH_MAX_VEL) v0 = goSettings._LAUNCH_MAX_VEL; if(v0 < goSettings._LAUNCH_MIN_VEL) v0 = goSettings._LAUNCH_MIN_VEL; launch.velocity.Set(v0 * cos(Util::deg2Rad(launch.angle)), v0 * sin(Util::deg2Rad(launch.angle))); launch.ammo = goSettings.ammo; // TODO - Need to add ammo selection for objects with more than 1 type of ammo? launch.launchTriggered = true; // FIRE! doLaunch(); } t_launch.Reset(0.0); } // Process calculated launches for individual objects. (currently this is for processing AI launches) void GameObj::doLaunch() { GameObj* newAmmo = nextAmmo(); if(newAmmo != NULL && launch.launchTriggered) { if(!isNPC()) { launch.angle += 90; } //newAmmo->body->SetActive(true); //newAmmo->body->SetAwake(true); //newAmmo->goSettings.setHP(newAmmo->goSettings.getHPMax()); //newAmmo->goSettings.setHP(1); //setGroundContact(false); newAmmo->resetObjectState(); newAmmo->goSettings.setInitVecAngle(launch.angle); newAmmo->goSettings.setCurrentVecAngle(launch.angle); newAmmo->goSettings.setVelocityMax(0); newAmmo->goSettings.setInitLinearVelocity(launch.velocity); newAmmo->body->SetTransform(this->body->GetPosition(), Util::deg2Rad(launch.angle)); newAmmo->body->SetLinearVelocity(launch.velocity); newAmmo->body->SetAngularDamping(.01); newAmmo->goSettings.setTeam(goSettings.isNPC()); newAmmo->body->GetFixtureList()->SetFilterData(newAmmo->getFixtureCollisionFilter()); launch.launchTriggered = false; } } // Find unused ammo object GameObj* GameObj::nextAmmo() { std::vector<GameObj*>::iterator it = ammo.begin(); while(it != ammo.end()) { if((*it)->body->IsActive() == false || this->isAlive() == false || (*it)->body->IsAwake() == false) { return *it; } ++it; } return NULL; } void GameObj::death(SoundManager &sm) { // SFX t_death.Calculate_Ellapsed_Time(); if(t_death.TotalTime() >= TIMER_SOUND_DEATH) { SoundManager::Sounds soundID; switch(goSettings.getTypeID()) { case Settings::OBJ_ID_ARCHER: soundID = sm.SND_ARCHER_DEATH; break; case Settings::OBJ_ID_STONEWALL: soundID = sm.SND_STONEWALL_DEATH; break; // case settings.OBJ_T_DOG: soundID = sm.SND_DOG_MELEE; break; // case settings.OBJ_T_SPEARMAN: soundID = sm.SND_SPEARMAN_MELEE; break; // case settings.OBJ_ID_ARCHER: soundID = sm.SND_ARCHER_MELEE; break; default: soundID = sm.SND_ARCHER_DEATH; break; } sm.playSound(soundSourceID, soundID, body->GetPosition()); t_death.Reset(0.0); } // Special Behavior (defined in derived classes) deathSpecial(sm); } void GameObj::damage(int amount, SoundManager &sm) { // Process incoming damage if(getArmor() > amount) return; // armor negates all damage else amount -= getArmor(); setHP(getHP() - amount); // SFX t_damaged.Calculate_Ellapsed_Time(); if(t_damaged.TotalTime() >= TIMER_SOUND_DAMAGED) { SoundManager::Sounds soundID; switch(goSettings.getTypeID()) { case Settings::OBJ_ID_ARCHER: soundID = sm.SND_ARCHER_DAMAGED; break; case Settings::OBJ_ID_STONEWALL: soundID = sm.SND_STONEWALL_DAMAGED; break; // case settings.OBJ_T_DOG: soundID = sm.SND_DOG_MELEE; break; // case settings.OBJ_T_SPEARMAN: soundID = sm.SND_SPEARMAN_MELEE; break; // case settings.OBJ_ID_ARCHER: soundID = sm.SND_ARCHER_MELEE; break; default: soundID = sm.SND_ARCHER_DAMAGED; break; } sm.playSound(soundSourceID, soundID, body->GetPosition()); t_damaged.Reset(0.0); } // Special Behavior (defined in derived classes) damageSpecial(amount, sm); // Death sequence if(getHP() < 0) { death(sm); } } void GameObj::update(SoundManager &sm, b2Vec2 nearest) { // this->elapsedTime = elapsedTime; if(!body->IsActive()) { return; } bool doRanged = true; if(isAlive()) { move(sm); // Melee Attacks for(std::list<GameObj*>::iterator it = enemies.begin(); it != enemies.end(); ++it) { if((*it)->isAlive()) { attack((*it), sm); doRanged = false; } } // Ranged attacks if(doRanged) { if(goSettings._LAUNCH_MAX_VEL) { rangedAttack(nearest); } } // Proccess ground contact if(groundContact) { // BULLETS - disappear after striking the ground. if(goSettings.getType() == Settings::OBJ_T_BULLET) { goSettings.setHP(0); // body->SetActive(false); } } } else { // body->SetTransform(b2Vec2(-5000, -5000), 0.0); } // Special Behavior (defined in derived classes) updateSpecial(sm); } bool GameObj::isAlive() { if(getHP() > 0) return true; else return false; } // remove dead enemies from the list // THIS IS BEING HANDLED BY GAME OBJ MANAGER! REMOVE~! bool GameObj::cleanEnemiesList() { std::list<GameObj*>::iterator it = enemies.begin(); while(it != enemies.end()) { if(!(*it)->isAlive()) { it = enemies.erase(it); // Change elemnts to be removed to NULL } else { ++it; } } return true; } void GameObj::draw(b2Vec2 mouse) { // draw the object on screen if(!body->IsActive()) { // return; } glLoadIdentity(); if(enemies.size() == 0) glColor3f(goSettings._DEF_DRAW_COLOR.r, goSettings._DEF_DRAW_COLOR.g, goSettings._DEF_DRAW_COLOR.b); else glColor3f(goSettings._CONTACT_DRAW_COLOR.r, goSettings._CONTACT_DRAW_COLOR.g, goSettings._CONTACT_DRAW_COLOR.b); b2Vec2 pos = body->GetPosition(); glTranslatef(body->GetPosition().x, body->GetPosition().y, 0); // center position glRotatef(Util::rad2Deg(body->GetAngle()), 0, 0, 1); if(settings->useTextures()) { glEnable(GL_TEXTURE_2D); //Switch back to using colors instead of textures // Blend the color key into oblivion! (optional) glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); glBindTexture(GL_TEXTURE_2D, goSettings.getTypeID()); glColor4f(1, 1, 1, 0.9); //Use blurry texture mapping (replace GL_LINEAR with GL_NEAREST for blocky) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_DECAL ); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glBegin(GL_QUADS); // Draw A Quad glTexCoord2f(0, 1); // Top Left glVertex2d( -Util::meter2Pixel(goSettings._textWidth)/2, Util::meter2Pixel(goSettings._textHeight)/2); // Top Left glTexCoord2f(1, 1); // Top Right glVertex2d(Util::meter2Pixel(goSettings._textWidth)/2, Util::meter2Pixel(goSettings._textHeight)/2); // Top Right glTexCoord2f(1, 0); // Bottom Right glVertex2d(Util::meter2Pixel(goSettings._textWidth)/2, -Util::meter2Pixel(goSettings._textHeight)/2); // Bottom Right glTexCoord2f(0, 0); // Bottom Left glVertex2d( - Util::meter2Pixel(goSettings._textWidth)/2, -Util::meter2Pixel(goSettings._textHeight)/2); // Bottom Left glEnd(); // Done Drawing The Quad glDisable(GL_TEXTURE_2D); //Switch back to using colors instead of textures } else { // NO TEXTURES // glTranslatef(body->GetPosition().x, body->GetPosition().y, (*settings).depth()); // Move to 0,0 in bottom left corner of coord system glBegin(GL_QUADS); // Draw A Quad glVertex2d(-Util::meter2Pixel(goSettings._textWidth)/2, Util::meter2Pixel(goSettings._textHeight)/2); // Top Left glVertex2d(Util::meter2Pixel(goSettings._textWidth)/2, Util::meter2Pixel(goSettings._textHeight)/2); // Top Right glVertex2d(Util::meter2Pixel(goSettings._textWidth)/2, -Util::meter2Pixel(goSettings._textHeight)/2); // Bottom Right glVertex2d(-Util::meter2Pixel(goSettings._textWidth)/2, -Util::meter2Pixel(goSettings._textHeight)/2); // Bottom Left glEnd(); // Done Drawing The Quad } glDisable( GL_BLEND ); // text.text(name, posX - (name.length()/2), textHeight, settings.depth()); std::stringstream ss; // ss << goSettings._name << " " << "x=" << body->GetPosition().x << " y=" << body->GetPosition().y; std::stringstream ss2; // ss2 << "hp=" << getHP() << " enemies=" << enemies.size(); ss2 << "hp=" << getHP(); // text.text(ss, body->GetPosition().x, body->GetPosition().y+goSettings._textHeight + 20, settings->depth()); text.text(ss2, body->GetPosition().x, body->GetPosition().y+goSettings._textHeight + 10, settings->depth()); } // calculates velocity vectors //void GameObj::recalculate() { // velX = velocity * std::cos(Util::deg2Rad(angle)); // velY = velocity * std::sin(Util::deg2Rad(angle)); // // //} void GameObj::addContact(GameObj *enemy) { if(enemy == NULL) { groundContact = true; } else if(enemy->isNPC() != isNPC()) { // contacts++; if(enemy->getType() != Settings::OBJ_T_BULLET) { addEnemy(enemy); } } } void GameObj::subContact(GameObj *enemy) { // contacts--; removeEnemy(enemy); } /////////////////////////////////////////////////////////////// // Box2D Setup void GameObj::setupB2D(double x, double y) { b2BodyDef bodyDef; b2PolygonShape dynamicBox; b2FixtureDef fixtureDef; // if(objType == STATIC) { // bodyDef.type = b2_staticBody; // } else { bodyDef.type = b2_dynamicBody; // } bodyDef.position.Set(x, y); // bodyDef.linearVelocity(Util::meter2Pixel(5)); bodyDef.userData = this; body = settings->getWorld()->CreateBody(&bodyDef); dynamicBox.SetAsBox(Util::meter2Pixel(getTextWidth())/2,Util::meter2Pixel(getTextHeight())/2); // Define another box shape for our dynamic body. fixtureDef.shape = &dynamicBox; // Define the dynamic body fixture. fixtureDef.density = goSettings._density; // Set the box density to be non-zero, so it will be dynamic. fixtureDef.friction = goSettings._friction; // Override the default friction. fixtureDef.filter = getFixtureCollisionFilter(); // fixtureDef.filter.maskBits = getFixtureCollissionFilter().maskBits; body->SetLinearVelocity(b2Vec2(goSettings.getVelocityMax(), 0.0)); body->CreateFixture(&fixtureDef); // Add the shape to the body. } // Build collision filters based on object types and team b2Filter GameObj::getFixtureCollisionFilter() { b2Filter filter; // ATTACKERS if(this->isNPC()) { if(getType() == Settings::OBJ_T_BULLET) { filter.categoryBits = Settings::COLLISION_CAT_NPC_BULLET; // NPC BULLET GROUP filter.maskBits = Settings::COLLISION_CAT_PC_DEFENDER + Settings::COLLISION_CAT_GROUND; // List of possible targets } else { filter.categoryBits = Settings::COLLISION_CAT_NPC_ATTACKER; // NPC ATTACKER GROUP filter.maskBits = Settings::COLLISION_CAT_PC_DEFENDER + Settings::COLLISION_CAT_GROUND + Settings::COLLISION_CAT_PC_BULLET; // List of possible targets } // DEFENDERS } else { if(getType() == Settings::OBJ_T_BULLET) { filter.categoryBits = Settings::COLLISION_CAT_PC_BULLET; // PC BULLET GROUP filter.maskBits = Settings::COLLISION_CAT_NPC_ATTACKER + Settings::COLLISION_CAT_GROUND; // List of Possible targets } else { filter.categoryBits = Settings::COLLISION_CAT_PC_DEFENDER; // PC ATTACKER GROUP filter.maskBits = Settings::COLLISION_CAT_PC_DEFENDER + Settings::COLLISION_CAT_GROUND + Settings::COLLISION_CAT_NPC_ATTACKER + Settings::COLLISION_CAT_NPC_BULLET; // PC defenders don't collide with defender bullets // this may change! } } return filter; } // Startup / Load / Initialization routine (Use in constructor of derived classes to setup the object!!) void GameObj::loadObject(std::string datFilename, double x, double y) { // Load Settings goSettings.loadFromFile(datFilename); // Setup Physics setupB2D(x, y); // Load Texture // textureID = TextureLoader::LoadGLTextures(goSettings.getTextureFilename()); } void GameObj::resetObjectState() { // reset an object so i can be re-used this->cleanEnemiesList(); this->setHP(getHPMax()); this->body->SetActive(true); this->body->SetAwake(true); this->setGroundContact(false); }
[ "lobotomizer2000@yahoo.com" ]
lobotomizer2000@yahoo.com
582bbc1f3096b6ce9bb0b6836e9d9a9864319660
da2700eb94ae896173d5060b436b4ace5bc4e0d9
/Source/MyProject5/NPCPawn.h
85fa5e8e7afe0a121dcb9abc13c63b697f41d69c
[]
no_license
Tomaszb126/Bomberman
71442ad3abdb86e9abc2f732e30eec42c5b5cf1f
231792307971093884cf080d3c560dab8b1fc3ad
refs/heads/master
2020-03-08T08:58:59.126753
2018-04-08T15:57:07
2018-04-08T15:57:07
128,035,000
0
0
null
null
null
null
UTF-8
C++
false
false
1,190
h
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "GameFramework/Pawn.h" #include "Components/SphereComponent.h" #include "MyPawnMovementComponent.h" #include "NPCPawn.generated.h" UCLASS() class MYPROJECT5_API ANPCPawn : public APawn { GENERATED_BODY() UFUNCTION() void NPCHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit); UFUNCTION() void OnNPCDestroy(const FVector& HitPoint, const FVector& HitDirection); USphereComponent* ColliderSphere; bool Fractured = false; float ElapsedTime = 0.0f; public: // Sets default values for this pawn's properties ANPCPawn(); protected: // Called when the game starts or when spawned virtual void BeginPlay() override; public: // Called every frame virtual void Tick(float DeltaTime) override; // Called to bind functionality to input virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; class UMyPawnMovementComponent* NPCMovementComponent; virtual UPawnMovementComponent* GetMovementComponent() const override; };
[ "tomaszb126@gmail.com" ]
tomaszb126@gmail.com
f60a0382930466c13affbab17ae3cbd341deb4dd
4fa3d1189965ea439684b965e97053dd9718c579
/projekt/projekt/Game.hpp
fd780f457a25650586b7d55ad16a167799482438
[]
no_license
weigelk/ProgramowanieObiektowe
6d8c9b64e82f1832413ced930d5c802d87f44bab
2e0bc570442025ca0d9eb5decef06aef5acf45b8
refs/heads/master
2023-04-27T10:49:43.459139
2020-05-31T12:38:52
2020-05-31T12:38:52
null
0
0
null
null
null
null
UTF-8
C++
false
false
867
hpp
#ifndef Game_hpp #define Game_hpp #include <SFML/Graphics.hpp> #include <cmath> #include <vector> #include <iostream> #include "Ship.hpp" #include "Laser.hpp" #include "Collision.hpp" #include "Enemy.hpp" #include "Score.hpp" #include "Rock.hpp" #include "ResourceManager.hpp" #include "Screens.hpp" class Game { public: Game(ResourceManager& resources); void run(); void initialize(); private: void run_screen(Screens &screen, ScreenId id); void reset(); int game_time_index; ScreenId current_screen; sf::RenderWindow game_window; Ship playerShip; Laser laser; sf::Sprite background; sf::Clock game_clock; sf::Clock game_time; Menu menu; Rock rocks; Enemy enemy; Score score; Collision collisions; EndScreen end_screen; bool game_on; int rocks_unshot; }; #endif /* Game_hpp */
[ "weik@KWs-MacBook-Pro.local" ]
weik@KWs-MacBook-Pro.local
2981fcdde42eb54624038123f9cc504da7efd9fc
b5941753de3cb20017599cae0ef8a29aad37beab
/entrega1/ListaOrdImpArray.cpp
1f8a31f6a87bb8309cb6fbf250c7fc1e17a767f2
[]
no_license
agustinguerra/Algoritmos2Obl1
9c8935ba68b78e2f52067b4c17564190778ddf82
48388460ab18ff42936490c8219b1e42b6922afb
refs/heads/master
2021-03-27T17:01:56.059015
2017-09-03T22:45:43
2017-09-03T22:45:43
102,128,539
0
0
null
null
null
null
ISO-8859-1
C++
false
false
3,817
cpp
#ifndef LISTAORDIMPARRAY_CPP #define LISTAORDIMPARRAY_CPP #include "ListaOrdImpArray.h" #include "IteradorListaOrdArray.h" //PRE: - //POS: Construye la lista ordenada template <class T> ListaOrdImpArray<T>::ListaOrdImpArray(const Comparador<T>& comp) { arrayDeLista = Array<T>(100); this->comparador = comp; this->posicion = -1; this->tamano = 100; } //PRE: - //POS: Construye la lista ordenada template <class T> ListaOrdImpArray<T>::ListaOrdImpArray() { } // PRE: Está ordenada // POS: e pertenece a la lista. La lista está ordenada y contiene todos los elementos que había en la lista antes de la inserción template <class T> void ListaOrdImpArray<T>::InsertarOrdenado(const T& e) { if (this->posicion == this->tamano - 1) { Array<T> nueva(this->tamano * 2); Array<T>::Copiar(this->arrayDeLista, nueva, 0); this->arrayDeLista = nueva; this->tamano = this->tamano * 2; } if (this->posicion == -1) { this->posicion = this->posicion + 1; this->arrayDeLista[0] = e; } else { this->posicion = this->posicion + 1; int posicionActual = this->posicion; if (posicionActual > 0) { while (posicionActual > 0 && this->comparador.Comparar(e, this->arrayDeLista[posicionActual]) == MAYOR) { this->arrayDeLista[posicionActual] = this->arrayDeLista[posicionActual - 1]; posicionActual--; } this->arrayDeLista[posicionActual] = e; } else { this->arrayDeLista[posicionActual] = e; } } } // PRE: La lista no está vacía // POS: Retorna el primer elemento de la lista template <class T> const T& ListaOrdImpArray<T>::Cabeza() const { return arrayDeLista[0]; } // PRE: - // POS: Elimina una ocurrencia del elemento de la lista si existe. De no existir no tiene acción. template <class T> void ListaOrdImpArray<T>::Eliminar(const T& e) { int pos = 0; bool encontre = false; int donde = -1; while (pos <= this->posicion && !encontre) { if (this->comparador.Comparar(this->arrayDeLista[pos], e) == IGUALES) { encontre = true; donde = pos; } pos = pos + 1; } if (encontre) { for (int i = donde; i <= this->posicion; i++) { this->arrayDeLista[i] = this->arrayDeLista[i + 1]; } this->posicion = this->posicion - 1; } } // PRE: - // POS: Retorna el largo de la lista template <class T> nat ListaOrdImpArray<T>::Largo() const { return this->posicion + 1; } // PRE: La lista tiene un elemento en la posición n. // POS: Retorna el elemento que está en esa posición de la lista. El primer elemento empieza en 0. template <class T> const T& ListaOrdImpArray<T>::Obtener(const nat n) const { return arrayDeLista[n]; } // PRE: - // POS: Retorna true si y solo si el elemento e pertenece a la lista. template <class T> bool ListaOrdImpArray<T>::Pertenece(const T& e) const { int largo = this->posicion; for (int i = 0; i < largo + 1; i++) { if (comparador.Comparar(arrayDeLista[i], e) == IGUALES) { return true; } } return false; } // PRE: - // POS: Retorna true si y solo si la lista esta vacia template <class T> bool ListaOrdImpArray<T>::EstaVacia() const { if (this->posicion == -1) { return true; } else { return false; } } // PRE: - // POS: Retorna un clon de la lista que no comparte memoria con ella template <class T> Puntero<ListaOrd<T>> ListaOrdImpArray<T>::Clon() const { Array<T> devolver(tamano); Array<T>::Copiar(arrayDeLista, devolver, 0); Puntero<ListaOrdImpArray<T>> listaDevolver = new ListaOrdImpArray(); listaDevolver->arrayDeLista = devolver; listaDevolver->tamano = tamano; listaDevolver->posicion = posicion; listaDevolver->comparador = comparador; return listaDevolver; } //PRE - //POS: Devuelve el iterador de la lista template <class T> Iterador<T> ListaOrdImpArray<T>::ObtenerIterador() const { return new IteradorListaOrdArray<T>(this->arrayDeLista,this->tamano,this->posicion); } #endif
[ "agustin.guerraguerra8@gmail.com" ]
agustin.guerraguerra8@gmail.com
7bbdc2ab68bc2387abfbccf14dd81655dcc04741
4b74bf216975b69cd829a15873ecc00a22cfa8d0
/ProgrammingExercises/SystemC-From-the-Ground-Up/src/Ch12_More_on_Ports/lfsr_ex/lfsr_ex.cpp
ca8895b39c781bf9bc312f54e5a5dd9f90bdb290
[]
no_license
GbuHti/Reconfigurable-DSP
b33315c14feba483bc62f4dd0879bf07eae559ef
e53194d8cb297630d2ffa70810cdc5c2d29b6c84
refs/heads/master
2021-07-17T11:49:14.829158
2020-06-02T05:56:12
2020-06-02T05:56:12
171,831,775
0
0
null
null
null
null
UTF-8
C++
false
false
1,047
cpp
//BEGIN lfsr_ex.cpp (systemc) //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //See lfsr_ex.h for more information //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include <systemc> using namespace sc_core; using namespace sc_dt; using std::cout; using std::endl; #include "lfsr_ex.h" void lfsr_ex::lfsr_ex_method() { if (reset->read() == true) { LFSR_reg = 0; signature->write(LFSR_reg); } else { bool lsb = LFSR_reg[31] ^ LFSR_reg[25] ^ LFSR_reg[22] ^ LFSR_reg[21] ^ LFSR_reg[15] ^ LFSR_reg[11] ^ LFSR_reg[10] ^ LFSR_reg[ 9] ^ LFSR_reg[ 7] ^ LFSR_reg[ 6] ^ LFSR_reg[ 4] ^ LFSR_reg[ 3] ^ LFSR_reg[ 1] ^ LFSR_reg[ 0] ^ sample->read(); LFSR_reg.range(31,1) = LFSR_reg.range(30,0); LFSR_reg[0] = lsb; signature->write(LFSR_reg); }//endif } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //END $Id: lfsr_ex.cpp,v 1.2 2003/11/14 02:57:26 dcblack Exp $
[ "wdz@localhost.localdomain" ]
wdz@localhost.localdomain
8e5c4ee0a3eeb069fa17e6bb65951ca62d8d8589
3b701dfdd7a231f2c9e2a3d3b489e2d5dc52eb5b
/include/armadillo/armadillo_bits/fn_trans.hpp
a7b17eb33863e27b0dff4995c0329fcbfecf1e92
[]
no_license
FyiurAmron/EngSimCpp
ac8fb785d608944271800c66e2bc42eb4c059cb1
231c2ff846365a1e67c5d8b22eff2c98fcbc79de
refs/heads/master
2021-04-30T23:32:19.727444
2017-06-08T11:50:35
2017-06-08T11:50:35
79,778,355
1
0
null
null
null
null
UTF-8
C++
false
false
1,541
hpp
// Copyright (C) 2008-2012 NICTA (www.nicta.com.au) // Copyright (C) 2008-2012 Conrad Sanderson // // This file is part of the Armadillo C++ library. // It is provided without any warranty of fitness // for any purpose. You can redistribute this file // and/or modify it under the terms of the GNU // Lesser General Public License (LGPL) as published // by the Free Software Foundation, either version 3 // of the License or (at your option) any later version. // (see http://www.opensource.org/licenses for more info) //! \addtogroup fn_trans //! @{ template<typename T1> arma_inline const Op<T1, op_htrans> trans ( const T1& X, const typename enable_if< is_arma_type<T1>::value == true >::result* junk = 0 ) { arma_extra_debug_sigprint(); arma_ignore(junk); return Op<T1, op_htrans>(X); } template<typename T1> arma_inline const Op<T1, op_htrans> htrans ( const T1& X, const typename enable_if< is_arma_type<T1>::value == true >::result* junk = 0 ) { arma_extra_debug_sigprint(); arma_ignore(junk); return Op<T1, op_htrans>(X); } //! two consecutive transpose operations cancel each other template<typename T1> arma_inline const T1& trans(const Op<T1, op_htrans>& X) { arma_extra_debug_sigprint(); arma_extra_debug_print("trans(): removing op_htrans"); return X.m; } template<typename T1> arma_inline const T1& htrans(const Op<T1, op_htrans>& X) { arma_extra_debug_sigprint(); arma_extra_debug_print("htrans(): removing op_htrans"); return X.m; } //! @}
[ "spamove@gmail.com" ]
spamove@gmail.com
ab5b3aa1efcb97b6f61b185907865a9a65bdae52
9f25ac38773b5ccdc0247c9d43948d50e60ab97a
/remoting/host/input_monitor/local_input_monitor_win.cc
edb36e84b2326e7065cdcdb093b29504c6afa602
[ "BSD-3-Clause" ]
permissive
liang0/chromium
e206553170eab7b4ac643ef7edc8cc57d4c74342
7a028876adcc46c7f7079f894a810ea1f511c3a7
refs/heads/main
2023-03-25T05:49:21.688462
2021-04-28T06:07:52
2021-04-28T06:07:52
362,370,889
1
0
BSD-3-Clause
2021-04-28T07:04:42
2021-04-28T07:04:41
null
UTF-8
C++
false
false
6,429
cc
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "remoting/host/input_monitor/local_input_monitor_win.h" #include <cstdint> #include <utility> #include "base/bind.h" #include "base/compiler_specific.h" #include "base/location.h" #include "base/logging.h" #include "base/macros.h" #include "base/sequence_checker.h" #include "base/single_thread_task_runner.h" #include "base/win/message_window.h" namespace remoting { namespace { class LocalInputMonitorWinImpl : public LocalInputMonitorWin { public: LocalInputMonitorWinImpl( scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, std::unique_ptr<RawInputHandler> raw_input_handler); ~LocalInputMonitorWinImpl() override; private: // The actual implementation resides in LocalInputMonitorWinImpl::Core class. class Core : public base::RefCountedThreadSafe<Core> { public: Core(scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, std::unique_ptr<RawInputHandler> raw_input_handler); void Start(); void Stop(); private: friend class base::RefCountedThreadSafe<Core>; virtual ~Core(); void StartOnUiThread(); void StopOnUiThread(); // Handles WM_INPUT messages. LRESULT OnInput(HRAWINPUT input_handle); // Handles messages received by |window_|. bool HandleMessage(UINT message, WPARAM wparam, LPARAM lparam, LRESULT* result); // Task runner on which public methods of this class must be called. scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; // Task runner on which |window_| is created. scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; // Used to receive raw input. std::unique_ptr<base::win::MessageWindow> window_; std::unique_ptr<RawInputHandler> raw_input_handler_; DISALLOW_COPY_AND_ASSIGN(Core); }; scoped_refptr<Core> core_; SEQUENCE_CHECKER(sequence_checker_); DISALLOW_COPY_AND_ASSIGN(LocalInputMonitorWinImpl); }; LocalInputMonitorWinImpl::LocalInputMonitorWinImpl( scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, std::unique_ptr<RawInputHandler> raw_input_handler) : core_(new Core(caller_task_runner, ui_task_runner, std::move(raw_input_handler))) { core_->Start(); } LocalInputMonitorWinImpl::~LocalInputMonitorWinImpl() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); core_->Stop(); } LocalInputMonitorWinImpl::Core::Core( scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, std::unique_ptr<RawInputHandler> raw_input_handler) : caller_task_runner_(caller_task_runner), ui_task_runner_(ui_task_runner), raw_input_handler_(std::move(raw_input_handler)) {} void LocalInputMonitorWinImpl::Core::Start() { DCHECK(caller_task_runner_->BelongsToCurrentThread()); ui_task_runner_->PostTask(FROM_HERE, base::BindOnce(&Core::StartOnUiThread, this)); } void LocalInputMonitorWinImpl::Core::Stop() { DCHECK(caller_task_runner_->BelongsToCurrentThread()); ui_task_runner_->PostTask(FROM_HERE, base::BindOnce(&Core::StopOnUiThread, this)); } LocalInputMonitorWinImpl::Core::~Core() { DCHECK(!window_); } void LocalInputMonitorWinImpl::Core::StartOnUiThread() { DCHECK(ui_task_runner_->BelongsToCurrentThread()); window_.reset(new base::win::MessageWindow()); if (!window_->Create( base::BindRepeating(&Core::HandleMessage, base::Unretained(this)))) { PLOG(ERROR) << "Failed to create the raw input window"; window_.reset(); // If the local input cannot be monitored, then bad things can happen like // the remote user taking over the session. raw_input_handler_->OnError(); } } void LocalInputMonitorWinImpl::Core::StopOnUiThread() { DCHECK(ui_task_runner_->BelongsToCurrentThread()); // Stop receiving raw mouse input. if (window_) { raw_input_handler_->Unregister(); } window_.reset(); } LRESULT LocalInputMonitorWinImpl::Core::OnInput(HRAWINPUT input_handle) { DCHECK(ui_task_runner_->BelongsToCurrentThread()); // Get the size of the input record. UINT size = 0; UINT result = GetRawInputData(input_handle, RID_INPUT, nullptr, &size, sizeof(RAWINPUTHEADER)); if (result == static_cast<UINT>(-1)) { PLOG(ERROR) << "GetRawInputData() failed"; return 0; } // Retrieve the input record itself. std::unique_ptr<uint8_t[]> buffer(new uint8_t[size]); RAWINPUT* input = reinterpret_cast<RAWINPUT*>(buffer.get()); result = GetRawInputData(input_handle, RID_INPUT, buffer.get(), &size, sizeof(RAWINPUTHEADER)); if (result == static_cast<UINT>(-1)) { PLOG(ERROR) << "GetRawInputData() failed"; return 0; } raw_input_handler_->OnInputEvent(input); return DefRawInputProc(&input, 1, sizeof(RAWINPUTHEADER)); } bool LocalInputMonitorWinImpl::Core::HandleMessage(UINT message, WPARAM wparam, LPARAM lparam, LRESULT* result) { switch (message) { case WM_CREATE: { if (raw_input_handler_->Register(window_->hwnd())) { *result = 0; } else { *result = -1; raw_input_handler_->OnError(); } return true; } case WM_INPUT: *result = OnInput(reinterpret_cast<HRAWINPUT>(lparam)); return true; default: return false; } } } // namespace std::unique_ptr<LocalInputMonitorWin> LocalInputMonitorWin::Create( scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, std::unique_ptr<RawInputHandler> raw_input_handler) { return std::make_unique<LocalInputMonitorWinImpl>( caller_task_runner, ui_task_runner, std::move(raw_input_handler)); } } // namespace remoting
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
14e859abfb26c18685cfa27285e066385b35d0bf
d20bb2c33d1a810f1c8b3b235a79d677f7996b41
/OBJtoBinary/Maincpp.cpp
88cd48d5e9de14eac772560568ceda40d02b4922
[]
no_license
TurtleMan64/SAB-Dev-Tools
3f19ccbe01b299b956164bb12f0e34e4f427bef2
c97c6ddd9287ebc47e756a74f8b932e9c74f1f35
refs/heads/master
2022-03-25T23:03:47.400547
2019-12-21T10:46:59
2019-12-21T10:46:59
124,948,771
1
1
null
null
null
null
UTF-8
C++
false
false
10,083
cpp
#include <stdlib.h> #include <stdio.h> #include <iostream> #include <vector> #include "vector.h" #include <fstream> #include <string> #include <cstring> #include <list> /* Parse a line and return an array of the individual tokens. Original line is modified. Make sure to call free() on the returned char** */ char** split(char* line, char delim, int* length); void doFile(std::string ogFilename); int main(int argc, char* argv[]) { std::printf("hi\n"); for (int i = 0; i < argc; i++) { std::fprintf(stdout, "'%s'\n", argv[i]); } if (argc < 2) { std::fprintf(stderr, "Please provide a file path to the .obj\n"); return 1; } for (int i = 1; i < argc; i++) { doFile(argv[i]); } } void doFile(std::string ogFilename) { std::ifstream file(ogFilename); if (!file.is_open()) { std::fprintf(stderr, "Error: Cannot load file '%s'\n", ogFilename.c_str()); file.close(); return; } std::string line; std::string mtlname; std::vector<Vector3f> vertices; std::vector<Vector2f> textures; std::vector<Vector3f> normals; std::vector<std::string> indiceMaterials; std::vector<std::vector<int>> indicesGroups; std::vector<int> currentIndiceGroup; int foundFaces = 0; while (!file.eof()) { getline(file, line); char lineBuf[512]; memcpy(lineBuf, line.c_str(), line.size()+1); int splitLength = 0; char** lineSplit = split(lineBuf, ' ', &splitLength); if (splitLength > 0) { if (foundFaces == 0) { //Find the mtl filename if (strcmp(lineSplit[0], "mtllib") == 0) { mtlname = lineSplit[1]; } else if (strcmp(lineSplit[0], "v") == 0) { std::string p1(lineSplit[1]); std::string p2(lineSplit[2]); std::string p3(lineSplit[3]); Vector3f vertex(std::stof(p1, nullptr), std::stof(p2, nullptr), std::stof(p3, nullptr)); vertices.push_back(vertex); } else if (strcmp(lineSplit[0], "vt") == 0) { std::string t1(lineSplit[1]); std::string t2(lineSplit[2]); Vector2f texCoord(std::stof(t1, nullptr), std::stof(t2, nullptr)); textures.push_back(texCoord); } else if (strcmp(lineSplit[0], "vn") == 0) { std::string n1(lineSplit[1]); std::string n2(lineSplit[2]); std::string n3(lineSplit[3]); Vector3f normal(std::stof(n1, nullptr), std::stof(n2, nullptr), std::stof(n3, nullptr)); normals.push_back(normal); } else if (strcmp(lineSplit[0], "usemtl") == 0) { indiceMaterials.push_back(lineSplit[1]); if (indiceMaterials.size() > 1) //dont add a group of zero the first time you see the usemtl { indicesGroups.push_back(currentIndiceGroup); } currentIndiceGroup.clear(); } else if (strcmp(lineSplit[0], "f") == 0) { int dummy = 0; char** vertex1 = split(lineSplit[1], '/', &dummy); char** vertex2 = split(lineSplit[2], '/', &dummy); char** vertex3 = split(lineSplit[3], '/', &dummy); currentIndiceGroup.push_back(std::stoi(vertex1[0], nullptr)); currentIndiceGroup.push_back(std::stoi(vertex1[1], nullptr)); currentIndiceGroup.push_back(std::stoi(vertex1[2], nullptr)); currentIndiceGroup.push_back(std::stoi(vertex2[0], nullptr)); currentIndiceGroup.push_back(std::stoi(vertex2[1], nullptr)); currentIndiceGroup.push_back(std::stoi(vertex2[2], nullptr)); currentIndiceGroup.push_back(std::stoi(vertex3[0], nullptr)); currentIndiceGroup.push_back(std::stoi(vertex3[1], nullptr)); currentIndiceGroup.push_back(std::stoi(vertex3[2], nullptr)); free(vertex1); free(vertex2); free(vertex3); } } } free(lineSplit); } file.close(); if (currentIndiceGroup.size() > 0) //Add the last group { indicesGroups.push_back(currentIndiceGroup); } //print into binary file char path[1024]; memcpy(path, ogFilename.c_str(), ogFilename.size()+1); int len; char** filePathSplit = split(path, '\\', &len); char** filenameSplit = split(filePathSplit[len-1], '.', &len); std::string fname = filenameSplit[0]; fname = fname+".binobj"; FILE* f = nullptr; int err = fopen_s(&f, fname.c_str(), "wb" ); if (f != nullptr && err == 0) { char obj[4]; obj[0] = 'o'; obj[1] = 'b'; obj[2] = 'j'; obj[3] = 0; fwrite(obj, sizeof(char), 4, f); int mtllibLength = (int)mtlname.size(); fwrite(&mtllibLength, sizeof(int), 1, f); //length of mtllib string fwrite(mtlname.c_str(), sizeof(char), mtlname.size(), f); //mtllib string int verticesLength = (int)vertices.size(); fwrite(&verticesLength, sizeof(int), 1, f); //how many vertices there are for (int i = 0; i < verticesLength; i++) { fwrite(&vertices[i].x, sizeof(float), 1, f); //12 bytes for each vertex fwrite(&vertices[i].y, sizeof(float), 1, f); fwrite(&vertices[i].z, sizeof(float), 1, f); } int texturesLength = (int)textures.size(); fwrite(&texturesLength, sizeof(int), 1, f); //how many textures there are for (int i = 0; i < texturesLength; i++) { fwrite(&textures[i].x, sizeof(float), 1, f); //8 bytes for each vertex fwrite(&textures[i].y, sizeof(float), 1, f); } int normalsLength = (int)normals.size(); fwrite(&normalsLength, sizeof(int), 1, f); //how many normals there are for (int i = 0; i < normalsLength; i++) { fwrite(&normals[i].x, sizeof(float), 1, f); //12 bytes for each normals fwrite(&normals[i].y, sizeof(float), 1, f); fwrite(&normals[i].z, sizeof(float), 1, f); } //the index for each type will use different amounts of bytes, to save space. //int bytesPerIndV = 4; //if (verticesLength < 256) //{ // bytesPerIndV = 1; //} //else if (verticesLength < 65536) //{ // bytesPerIndV = 2; //} //else if (verticesLength < 16777216) //{ // bytesPerIndV = 3; //} //fwrite(&bytesPerIndV, sizeof(int), 1, f); //number of bytes for a vertex index //int bytesPerIndVT = 4; //if (texturesLength < 256) //{ // bytesPerIndVT = 1; //} //else if (texturesLength < 65536) //{ // bytesPerIndVT = 2; //} //else if (texturesLength < 16777216) //{ // bytesPerIndVT = 3; //} //fwrite(&bytesPerIndVT, sizeof(int), 1, f); //number of bytes for a texture index //int bytesPerIndVN = 4; //if (normalsLength < 256) //{ // bytesPerIndVN = 1; //} //else if (normalsLength < 65536) //{ // bytesPerIndVN = 2; //} //else if (normalsLength < 16777216) //{ // bytesPerIndVN = 3; //} //fwrite(&bytesPerIndVN, sizeof(int), 1, f); //number of bytes for a normal index int materialsLength = (int)indiceMaterials.size(); fwrite(&materialsLength, sizeof(int), 1, f); //how many materials there are for (int i = 0; i < materialsLength; i++) { int matnameLength = (int)indiceMaterials[i].size(); fwrite(&matnameLength, sizeof(int), 1, f); //length of mtlname string fwrite(indiceMaterials[i].c_str(), sizeof(char), indiceMaterials[i].size(), f); //mtlname string //now print each materials indices std::vector<int> indices = indicesGroups[i]; int numFaces = ((int)indices.size())/9; fwrite(&numFaces, sizeof(int), 1, f); //length of indices for (int c = 0; c < numFaces; c++) { fwrite(&indices[c*9+0], sizeof(int), 3, f); fwrite(&indices[c*9+3], sizeof(int), 3, f); fwrite(&indices[c*9+6], sizeof(int), 3, f); } //std::vector<int> indices = indicesGroups[i]; //int numFaces = ((int)indices.size())/9; //fwrite(&numFaces, sizeof(int), 1, f); //length of indices // //for (int c = 0; c < numFaces; c++) //{ // int vi1 = indices[c*9+0]; // int vti1 = indices[c*9+1]; // int vni1 = indices[c*9+2]; // int vi2 = indices[c*9+3]; // int vti2 = indices[c*9+4]; // int vni2 = indices[c*9+5]; // int vi3 = indices[c*9+6]; // int vti3 = indices[c*9+7]; // int vni3 = indices[c*9+8]; // // fwrite(&vi1, bytesPerIndV, 1, f); // fwrite(&vti1, bytesPerIndVT, 1, f); // fwrite(&vni1, bytesPerIndVN, 1, f); // fwrite(&vi2, bytesPerIndV, 1, f); // fwrite(&vti2, bytesPerIndVT, 1, f); // fwrite(&vni2, bytesPerIndVN, 1, f); // fwrite(&vi3, bytesPerIndV, 1, f); // fwrite(&vti3, bytesPerIndVT, 1, f); // fwrite(&vni3, bytesPerIndVN, 1, f); //} } fclose(f); } } char** split(char* line, char delim, int* length) { /* Scan through line to find the number of tokens */ int numTokens = 0; int index = 0; int inToken = 0; while (line[index] != 0) { if (line[index] != delim && inToken == 0) { inToken = 1; numTokens += 1; } else if (line[index] == delim) { inToken = 0; } index += 1; } /* Get memory to store the data */ char ** parsedData = (char**)malloc(sizeof(char*)*(numTokens + 1)); /* Scan through line to fill parsedData and set 0 characters after tokens*/ index = 0; inToken = 0; int tokenNum = 0; while (line[index] != 0) { if (line[index] != delim && inToken == 0) { parsedData[tokenNum] = &line[index]; tokenNum += 1; inToken = 1; } else if (line[index] == delim) { if (inToken == 1) { line[index] = 0; } inToken = 0; } index += 1; } parsedData[numTokens] = NULL; *length = numTokens; return parsedData; }
[ "turtleboy1026@aol.com" ]
turtleboy1026@aol.com
214f90a0012ea9aabf599c5211505c55a4223dc0
20530c90527c80a05a4c5ef6428cd298347d5b7a
/cs16/doubleLinkedList.cpp
ea09f0ddb2971782a4ae8392b2640b3329f4b3d2
[]
no_license
ganeshsankaran/cpp-samples
71c91508693f80336215455bda10b2ae438fc55d
45ac34891e87cf51e189706257b5f4970ff40645
refs/heads/master
2020-08-11T08:12:32.737309
2020-02-24T17:30:32
2020-02-24T17:30:32
214,524,614
0
0
null
null
null
null
UTF-8
C++
false
false
2,484
cpp
//not complete #include <iostream> using namespace std; struct Node { Node* prevNode; int data; Node* nextNode; }; struct DLinkedList { Node* head; Node* tail; }; DLinkedList* createSmallLinkedList(int x, int y) { DLinkedList* newList = new DLinkedList; newList->head = NULL; newList->tail = NULL; Node* head = new Node; head->data = x; head->nextNode = new Node; head->nextNode->data = y; head->nextNode->nextNode = NULL; head->nextNode->prevNode = head; newList->head = head; newList->tail = head->nextNode; return newList; } void insertAtHead(DLinkedList* list, int x) { Node* newHead = new Node; newHead->nextNode = list->head; newHead->data = x; newHead->prevNode = NULL; if(!list->head) { list->tail = newHead; } else { list->head->prevNode = newHead; } list->head = newHead; } /* void insertAtTail(DLinkedList* list, int x) { Node* newHead = new Node; newHead->nextNode = NULL; newHead->data = x; if(!list->head) { list->head = newHead; } else { list->tail->nextNode = newHead; } list->tail = newHead; } */ void deleteNode(DLinkedList* list, int value) { if(!list || list->head == NULL) { return; } Node* h = list->head; while(h && h->data != value) { h = h->nextNode; } if(!h) { return; } if(h->prevNode) { h->prevNode->nextNode = h->nextNode; } if(h->nextNode) { h->nextNode->prevNode = h->prevNode; } if(h == list->head) { list->head = h->nextNode; } if(h == list->tail) { list->tail = h->prevNode; } delete h; } void printLinkedList(DLinkedList* list) { Node* h = list->head; //h is a traversal pointer while(h) { //h is not null cout << h->data << " "; h = h->nextNode; } cout << endl; } void freeLinkedList(DLinkedList* list) { Node* h = list->head; while(h) { Node* tmp = h; h = h->nextNode; delete tmp; } //do this only if you are clearing the list list->head = NULL; list->tail = NULL; //otherwise delete list; } int main() { DLinkedList* l1 = createSmallLinkedList(10, 20); printLinkedList(l1); insertAtHead(l1, 30); //insertAtTail(l1, -10); printLinkedList(l1); deleteNode(l1, 30); printLinkedList(l1); freeLinkedList(l1); return 0; }
[ "ganeshsankaran@169-231-91-126.wireless.ucsb.edu" ]
ganeshsankaran@169-231-91-126.wireless.ucsb.edu
0964c36e7402a7b102bcc9af29d4c11396a71fe0
5d7dfa1dc6f8014e6f00d4c014aa8da1afd520ed
/src/Tests_1/area.cpp
90e678d089118b0f54b6eb4cad44210c4c30c771
[]
no_license
hrace009/TERA-Server-v15xx
5371701e6274047c24813733009022818c618fd7
23999d2561f2f7ae298a72abeffc17a5a87ba0a7
refs/heads/master
2021-04-29T09:50:14.866698
2016-12-02T11:55:43
2016-12-02T11:55:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
471
cpp
#include "area.h" area::area() { } area::~area() { } areaFenceData::areaFenceData() { points = nullptr; pointsCount = 0; } areaFenceData::~areaFenceData() { delete[] points; } areaSection::areaSection() { restBonus = maze = ride = vender = pk = pcMoveCylinder = ignoreObstacleShortTel = desTex = true; campId = nameId = priority = floor = worldMapSectionId = id = 0; huntingZoneId = 0; substractMinZ = addMaxZ = 0.0f; } areaSection::~areaSection() { }
[ "Narcis@NARCIS-PC" ]
Narcis@NARCIS-PC
bcfa7b6cf8db66528aa69c8a36574222e08ddbb5
0c7c69b9fe16ec17e0f1a7718be8153be07b0f88
/dev/test/so_5/environment/add_disp_after_start/main.cpp
2a6bf28871d426b3f63ee7e8b83c4fa8f94d52b3
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
gitter-badger/SObjectizer
7cfa6a3d8b81e8d562e3cc5335068d8ba82491a6
aae82d418c7b614c64c014eb13a0eca9333ce168
refs/heads/master
2021-01-18T08:16:32.166384
2016-01-22T17:19:29
2016-01-22T17:19:29
50,293,195
0
0
null
2016-01-24T15:12:04
2016-01-24T15:12:03
null
UTF-8
C++
false
false
2,869
cpp
/* * A test for adding a dispatcher to the running SO Environment. */ #include <iostream> #include <map> #include <exception> #include <stdexcept> #include <cstdlib> #include <thread> #include <chrono> #include <sstream> #include <so_5/all.hpp> #include <various_helpers_1/time_limited_execution.hpp> struct msg_child_info : public so_5::message_t { so_5::current_thread_id_t m_thread_id; msg_child_info( so_5::current_thread_id_t id ) : m_thread_id( std::move( id ) ) {} }; class a_child_t : public so_5::agent_t { public: a_child_t( so_5::environment_t & env, const so_5::mbox_t & parent_mbox ) : so_5::agent_t( env ) , m_parent_mbox( parent_mbox ) {} virtual void so_evt_start() { m_parent_mbox->deliver_message( new msg_child_info( so_5::query_current_thread_id() ) ); so_deregister_agent_coop_normally(); } private : const so_5::mbox_t m_parent_mbox; }; class a_parent_t : public so_5::agent_t { public : a_parent_t( so_5::environment_t & env, const std::string & dispatcher_name ) : so_5::agent_t( env ) , m_dispatcher_name( dispatcher_name ) {} virtual void so_define_agent() override { so_subscribe( so_direct_mbox() ).event( &a_parent_t::evt_child_info ); } virtual void so_evt_start() override { m_thread_id = so_5::query_current_thread_id(); so_environment().add_dispatcher_if_not_exists( m_dispatcher_name, []() { return so_5::disp::one_thread::create_disp(); } ); so_environment().register_agent_as_coop( so_coop_name() + "::child", new a_child_t( so_environment(), so_direct_mbox() ), so_5::disp::one_thread::create_disp_binder( m_dispatcher_name ) ); } void evt_child_info( const msg_child_info & evt ) { if( m_thread_id != evt.m_thread_id ) { std::cerr << so_coop_name() << ": thread_id mismatch! " "expected: " << m_thread_id << ", actual: " << evt.m_thread_id << std::endl; std::abort(); } so_deregister_agent_coop_normally(); } private : const std::string m_dispatcher_name; so_5::current_thread_id_t m_thread_id; }; int main() { try { run_with_time_limit( []() { so_5::launch( []( so_5::environment_t & env ) { for( int i = 0; i < 32; ++i ) { std::ostringstream ss; ss << "coop_" << i; const std::string name = ss.str(); env.add_dispatcher_if_not_exists( name, []() { return so_5::disp::one_thread::create_disp(); } ); env.register_agent_as_coop( name, new a_parent_t( env, name ), so_5::disp::one_thread::create_disp_binder( name ) ); } } ); }, 5, "Adding dispatcher on running SO Environment test" ); } catch( const std::exception & ex ) { std::cerr << "Error: " << ex.what() << std::endl; return 1; } return 0; }
[ "eao197@1d1731ae-3f85-447d-88f8-c72b288064d1" ]
eao197@1d1731ae-3f85-447d-88f8-c72b288064d1
4ca2c96b1fc4a6bd7e90c299e87cfeacc748dc9c
f06630352a79b74d250b1f34b3ea8720571ad58e
/src/petra/dev/testing/romulus/datastructures/TMLinkedListQueue.hpp
3464ee2f3a06ce771c5b4473759e69b459407883
[ "MIT" ]
permissive
CLPeterson/DurableCorrectness
b57f3d28ce4cdb932506964b40b06bdb39ba843a
5e3ae0c09f6ac9415850ae389672c50cb743262d
refs/heads/master
2023-01-28T10:55:23.083481
2020-09-22T13:30:34
2020-09-22T13:30:34
285,900,349
2
0
null
null
null
null
UTF-8
C++
false
false
1,721
hpp
/* * Copyright 2017-2018 * Andreia Correia <andreia.veiga@unine.ch> * Pascal Felber <pascal.felber@unine.ch> * Pedro Ramalhete <pramalhe@gmail.com> * * This work is published under the MIT license. See LICENSE.TXT */ #ifndef _TM_LINKED_LIST_QUEUE_H_ #define _TM_LINKED_LIST_QUEUE_H_ #include <string> #include "../common/tm.h" /** * <h1> A Linked List queue (memory unbounded) for usage with STMs and PTMs </h1> * */ template<typename T> class TMLinkedListQueue { private: struct Node { TM_TYPE<T*> item; TM_TYPE<Node*> next; Node(T* userItem) : item{userItem}, next{nullptr} { } }; alignas(128) TM_TYPE<Node*> head {nullptr}; alignas(128) TM_TYPE<Node*> tail {nullptr}; public: TMLinkedListQueue() { Node* sentinelNode = TM_ALLOC<Node>(nullptr); head = sentinelNode; tail = sentinelNode; } ~TMLinkedListQueue() { while (dequeue() != nullptr); // Drain the queue Node* lhead = head; TM_FREE(lhead); } static std::string className() { return TM_NAME() + "-LinkedListQueue"; } bool enqueue(T* item) { TM_WRITE_TRANSACTION([&] () { Node* newNode = TM_ALLOC<Node>(item); tail->next = newNode; tail = newNode; }); return true; } T* dequeue() { T* item = nullptr; TM_WRITE_TRANSACTION([&] () { Node* lhead = head; if (lhead == tail) return; // item = nullptr; head = lhead->next; TM_FREE(lhead); item = head->item; }); return item; } }; #endif /* _TM_LINKED_LIST_QUEUE_H_ */
[ "r.izadpanah@knights.ucf.edu" ]
r.izadpanah@knights.ucf.edu
d4b81c40831a96bc440d0fee4ad3cff1e68ac963
9cafeb85a35fab7cbdd44d1098a9a3012794986d
/ACGM_RayTracer_lib/include/ACGM_RayTracer_lib/Light.h
aa8a91284c93f5c92a4a2b266488534edf723c33
[]
no_license
regenda/ACGM_RayTracer
4ef161ed9478fe77f22e949ce8a5c8baabb33f5d
ccc40c35bc60e7db5f6bf0078b2135b1d69715de
refs/heads/master
2021-05-16T23:15:51.721070
2020-06-01T12:03:46
2020-06-01T12:03:46
250,511,507
0
0
null
null
null
null
UTF-8
C++
false
false
475
h
#pragma once #include <glm/common.hpp> namespace acgm { //! Light - abstract base class for scene lights class Light { public: explicit Light(const float &intensity); virtual ~Light() = default; virtual glm::vec3 GetDirectionToLight(const glm::vec3 &point) const = 0; virtual float GetIntensityAt(const glm::vec3 &point) const = 0; virtual float GetDistanceToLight(const glm::vec3 &point) const = 0; protected: float intensity_; }; }
[ "hrosroman@gmail.com" ]
hrosroman@gmail.com
3fb198b223bf584c7875f7ce5154f067602985f9
b14c5513513a0656384dce804916dd6d78cf9c7c
/cplusoop/cplusoop/myfunc.cpp
dd60c4dd958ba87dfdacefd4ef7bc263a52046d2
[]
no_license
yjfdl123/cplusprac
f7ceeef597f4c9915ed67b96ad2a5451a42a5518
e405f71ab0326b1c22567c6632cf59734f121a92
refs/heads/master
2020-05-21T13:42:27.598427
2016-09-24T10:29:22
2016-09-24T10:29:22
64,572,446
0
0
null
null
null
null
UTF-8
C++
false
false
229
cpp
#include "stdafx.h" #include "myfunc.h" inline double square(double x) { return x*x; }; myfunc::myfunc() { } myfunc::~myfunc() { } void myfunc::test() { double x = 30; double& y = x; y = 40; cout << square(x) << endl; }
[ "yjfdl123@163.com" ]
yjfdl123@163.com
d39011148feeea132fbcf1b5ffed6ed71461dfbb
78aa6efa0418e1778d9a026ab030fb8d02177140
/test/burst/range/adaptor/to_deque.cpp
900c30fc7236f36bcb2bcc5e823b0ea1741aed88
[ "BSL-1.0" ]
permissive
izvolov/burst
8a5b1e106891b1caf3434157a5646df955ceb2a5
ea38c4a59c8f98f857dafbc468b6e8a1f8bed6ca
refs/heads/master
2022-09-07T13:48:07.094878
2022-08-07T15:52:06
2022-08-07T16:14:48
26,827,690
88
6
BSL-1.0
2022-08-08T03:19:57
2014-11-18T20:07:42
C++
UTF-8
C++
false
false
920
cpp
#include <burst/range/adaptor/to_deque.hpp> #include <doctest/doctest.h> #include <boost/range/irange.hpp> #include <deque> #include <forward_list> #include <initializer_list> TEST_SUITE("to_deque") { TEST_CASE("Может работать с rvalue-диапазоном") { const auto d = boost::irange<int>(0, 10) | burst::to_deque; CHECK(d == std::deque<int>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}); } TEST_CASE("Может работать с lvalue-диапазоном") { const auto fl = std::forward_list<char>{'a', 'b', 'c'}; const auto d = fl | burst::to_deque; CHECK(d == std::deque<char>{'a', 'b', 'c'}); } TEST_CASE("Может работать со списком инициализации") { auto il = {'a', 'b', 'c'}; const auto d = il | burst::to_deque; CHECK(d == std::deque<char>{'a', 'b', 'c'}); } }
[ "dmitriy@izvolov.ru" ]
dmitriy@izvolov.ru
4551f1d7cf83efebfd671cf77a5ed7d765167c70
7c49a52a010e16950c4123db4eb9b126c68b4eba
/test/TestCrypt.hpp
3e37d286f5917800d19acdac0a0785a2c97ac0b5
[]
no_license
AlexFletcher/Embo2017Practical
ce9728932c8f6dff12468b86db491fa7412d1144
b6714861f8783ba41bfe21be21db4824334ee088
refs/heads/master
2021-01-01T16:47:46.957048
2017-07-21T09:17:09
2017-07-21T09:17:09
97,924,392
0
0
null
null
null
null
UTF-8
C++
false
false
19,884
hpp
#ifndef TESTCYLINDRICALCRYPT_HPP_ #define TESTCYLINDRICALCRYPT_HPP_ /* * = Proliferation Example = * * On this wiki page we describe in detail the code that is used to run this example from the paper. * * The easiest way to visualize these simulations is with Paraview. * * [[EmbedYoutube(F04IlE2PyY0)]] * * == Code overview == * * The first thing to do is to include the necessary header files. */ #include <cxxtest/TestSuite.h> // Must be included before any other cell_based headers #include "CellBasedSimulationArchiver.hpp" #include "SmartPointers.hpp" #include "CylindricalHoneycombVertexMeshGenerator.hpp" #include "CylindricalHoneycombMeshGenerator.hpp" #include "PottsMeshGenerator.hpp" #include "Cylindrical2dNodesOnlyMesh.hpp" #include "CellsGenerator.hpp" #include "SimpleWntContactInhibitionCellCycleModel.hpp" #include "WntConcentration.hpp" #include "MeshBasedCellPopulationWithGhostNodes.hpp" #include "NodeBasedCellPopulation.hpp" #include "PottsBasedCellPopulation.hpp" #include "VertexBasedCellPopulation.hpp" #include "CellProliferativeTypesCountWriter.hpp" #include "CellIdWriter.hpp" #include "CellVolumesWriter.hpp" #include "CellAncestorWriter.hpp" #include "OffLatticeSimulation.hpp" #include "OnLatticeSimulation.hpp" #include "NagaiHondaForce.hpp" #include "RepulsionForce.hpp" #include "DiffusionCaUpdateRule.hpp" #include "VolumeConstraintPottsUpdateRule.hpp" #include "AdhesionPottsUpdateRule.hpp" #include "SurfaceAreaConstraintPottsUpdateRule.hpp" #include "SimpleTargetAreaModifier.hpp" #include "VolumeTrackingModifier.hpp" #include "PlaneBasedCellKiller.hpp" #include "PlaneBoundaryCondition.hpp" #include "CryptShovingCaBasedDivisionRule.hpp" #include "AbstractCellBasedWithTimingsTestSuite.hpp" #include "PetscSetupAndFinalize.hpp" #include "Warnings.hpp" /* * This is where you can set parameters toi be used in all the simulations. */ static const double M_END_STEADY_STATE = 100; //100 static const double M_END_TIME = 1100; //1100 static const double M_CRYPT_DIAMETER = 16; static const double M_CRYPT_LENGTH = 12; static const double M_CONTACT_INHIBITION_LEVEL = 0.8; class TestCylindricalCrypt : public AbstractCellBasedWithTimingsTestSuite { private: /* * This is a helper method to generate cells and is used in all simulations. */ void GenerateCells(unsigned num_cells, std::vector<CellPtr>& rCells, double equilibriumVolume, double quiescentVolumeFraction) { double typical_cell_cycle_duration = 12.0; boost::shared_ptr<AbstractCellProperty> p_state(CellPropertyRegistry::Instance()->Get<WildTypeCellMutationState>()); boost::shared_ptr<AbstractCellProperty> p_cell_type(CellPropertyRegistry::Instance()->Get<TransitCellProliferativeType>()); for (unsigned i=0; i<num_cells; i++) { SimpleWntContactInhibitionCellCycleModel* p_model = new SimpleWntContactInhibitionCellCycleModel(); p_model->SetDimension(2); p_model->SetEquilibriumVolume(equilibriumVolume); p_model->SetQuiescentVolumeFraction(quiescentVolumeFraction); p_model->SetWntThreshold(0.5); CellPtr p_cell(new Cell(p_state, p_model)); p_cell->SetCellProliferativeType(p_cell_type); double birth_time = - RandomNumberGenerator::Instance()->ranf() * typical_cell_cycle_duration; p_cell->SetBirthTime(birth_time); // Set Target Area so dont need to use a growth model in vertex simulations p_cell->GetCellData()->SetItem("target area", 1.0); rCells.push_back(p_cell); } } public: /* * == CA == * * Simulate cell proliferation in the colorectal crypt using the * Cellular Automaton model. */ void TestCaBasedCrypt() throw (Exception) { // Create a simple 2D PottsMesh (periodic in x) PottsMeshGenerator<2> generator(M_CRYPT_DIAMETER, 0, 0, M_CRYPT_LENGTH*3, 0, 0, 1, 0, 0, false, true); PottsMesh<2>* p_mesh = generator.GetMesh(); // Specify where cells lie std::vector<unsigned> location_indices; for (unsigned index=0; index<(unsigned)M_CRYPT_DIAMETER*(unsigned)M_CRYPT_LENGTH; index++) { location_indices.push_back(index); } // Create cells std::vector<CellPtr> cells; GenerateCells(location_indices.size(),cells,1.0,M_CONTACT_INHIBITION_LEVEL); //Mature volume = 1 LS // Create cell population CaBasedCellPopulation<2> cell_population(*p_mesh, cells, location_indices); cell_population.AddCellPopulationCountWriter<CellProliferativeTypesCountWriter>(); cell_population.AddCellWriter<CellVolumesWriter>(); cell_population.AddCellWriter<CellIdWriter>(); cell_population.AddCellWriter<CellAncestorWriter>(); // Create an instance of a Wnt concentration WntConcentration<2>::Instance()->SetType(LINEAR); WntConcentration<2>::Instance()->SetCellPopulation(cell_population); WntConcentration<2>::Instance()->SetCryptLength(M_CRYPT_LENGTH); // Set up cell-based simulation OnLatticeSimulation<2> simulator(cell_population); simulator.SetOutputDirectory("CylindricalCrypt/Ca"); simulator.SetDt(0.01); simulator.SetSamplingTimestepMultiple(100); simulator.SetEndTime(M_END_STEADY_STATE); simulator.SetOutputDivisionLocations(true); simulator.SetOutputCellVelocities(true); // Add Volume tracking modifier MAKE_PTR(VolumeTrackingModifier<2>, p_modifier); simulator.AddSimulationModifier(p_modifier); // Add Division Rule boost::shared_ptr<AbstractCaBasedDivisionRule<2> > p_division_rule(new CryptShovingCaBasedDivisionRule()); cell_population.SetCaBasedDivisionRule(p_division_rule); // Sloughing killer MAKE_PTR_ARGS(PlaneBasedCellKiller<2>, p_killer, (&cell_population, M_CRYPT_LENGTH*unit_vector<double>(2,1), unit_vector<double>(2,1))); simulator.AddCellKiller(p_killer); // Run simulation simulator.Solve(); // Mark Ancestors simulator.SetEndTime(M_END_TIME); simulator.rGetCellPopulation().SetCellAncestorsToLocationIndices(); // Run simulation to new end time simulator.Solve(); // Clear singletons WntConcentration<2>::Instance()->Destroy(); } /* * == CP == * * Simulate cell proliferation in the colorectal crypt using the * Cellular Potts model. */ void TestPottsBasedCrypt() throw (Exception) { unsigned cell_width = 4; // Create a simple 2D PottsMesh (periodic in x) PottsMeshGenerator<2> generator( M_CRYPT_DIAMETER*cell_width, M_CRYPT_DIAMETER, cell_width, (M_CRYPT_LENGTH+2)*cell_width, M_CRYPT_LENGTH, cell_width, 1, 1, 1, true, true); //Dtart from bottom left and periodic PottsMesh<2>* p_mesh = generator.GetMesh(); // Create cells std::vector<CellPtr> cells; GenerateCells(p_mesh->GetNumElements(),cells,cell_width*cell_width,M_CONTACT_INHIBITION_LEVEL); // mature volume = 16.0 LSs // Create cell population PottsBasedCellPopulation<2> cell_population(*p_mesh, cells); cell_population.SetTemperature(0.1); cell_population.AddCellPopulationCountWriter<CellProliferativeTypesCountWriter>(); cell_population.AddCellWriter<CellVolumesWriter>(); cell_population.AddCellWriter<CellIdWriter>(); cell_population.AddCellWriter<CellAncestorWriter>(); // Set the Temperature cell_population.SetTemperature(0.1); //Default is 0.1 // Create an instance of a Wnt concentration WntConcentration<2>::Instance()->SetType(LINEAR); WntConcentration<2>::Instance()->SetCellPopulation(cell_population); WntConcentration<2>::Instance()->SetCryptLength(M_CRYPT_LENGTH*cell_width); // Set up cell-based simulation OnLatticeSimulation<2> simulator(cell_population); simulator.SetOutputDirectory("CylindricalCrypt/Potts"); simulator.SetDt(0.01); simulator.SetSamplingTimestepMultiple(100); simulator.SetEndTime(M_END_STEADY_STATE); simulator.SetOutputDivisionLocations(true); simulator.SetOutputCellVelocities(true); // Add volume tracking modifier MAKE_PTR(VolumeTrackingModifier<2>, p_modifier); simulator.AddSimulationModifier(p_modifier); // Sloughing killer MAKE_PTR_ARGS(PlaneBasedCellKiller<2>, p_killer, (&cell_population, cell_width*M_CRYPT_LENGTH*unit_vector<double>(2,1), unit_vector<double>(2,1))); simulator.AddCellKiller(p_killer); // Create update rules and pass to the simulation MAKE_PTR(VolumeConstraintPottsUpdateRule<2>, p_volume_constraint_update_rule); p_volume_constraint_update_rule->SetMatureCellTargetVolume(16); // i.e 4x4 cells p_volume_constraint_update_rule->SetDeformationEnergyParameter(0.1); simulator.AddUpdateRule(p_volume_constraint_update_rule); MAKE_PTR(SurfaceAreaConstraintPottsUpdateRule<2>, p_surface_constraint_update_rule); p_surface_constraint_update_rule->SetMatureCellTargetSurfaceArea(16); // i.e 4x4 cells p_surface_constraint_update_rule->SetDeformationEnergyParameter(0.01); simulator.AddUpdateRule(p_surface_constraint_update_rule); MAKE_PTR(AdhesionPottsUpdateRule<2>, p_adhesion_update_rule); p_adhesion_update_rule->SetCellCellAdhesionEnergyParameter(0.1); p_adhesion_update_rule->SetCellBoundaryAdhesionEnergyParameter(0.2); simulator.AddUpdateRule(p_adhesion_update_rule); // Run simulation simulator.Solve(); // Mark Ancestors simulator.SetEndTime(M_END_TIME); simulator.rGetCellPopulation().SetCellAncestorsToLocationIndices(); // Run simulation to new end time simulator.Solve(); // Clear singletons WntConcentration<2>::Instance()->Destroy(); } /* * == OS == * * Simulate cell proliferation in the colorectal crypt using the * Overlapping Spheres model. */ void TestNodeBasedCrypt() throw (Exception) { // Create a simple mesh HoneycombMeshGenerator generator(M_CRYPT_DIAMETER, M_CRYPT_LENGTH, 0); TetrahedralMesh<2,2>* p_generating_mesh = generator.GetMesh(); double cut_off_length = 1.5; //this is the default // Convert this to a Cylindrical2dNodesOnlyMesh Cylindrical2dNodesOnlyMesh* p_mesh = new Cylindrical2dNodesOnlyMesh(M_CRYPT_DIAMETER); p_mesh->ConstructNodesWithoutMesh(*p_generating_mesh,2.0); // So factor of 16 // Create cells std::vector<CellPtr> cells; GenerateCells(p_mesh->GetNumNodes(), cells, M_PI*0.25,M_CONTACT_INHIBITION_LEVEL); // mature volume: M_PI*0.25 as r=0.5 // Create a node-based cell population NodeBasedCellPopulation<2> cell_population(*p_mesh, cells); cell_population.AddCellPopulationCountWriter<CellProliferativeTypesCountWriter>(); cell_population.AddCellWriter<CellVolumesWriter>(); cell_population.AddCellWriter<CellIdWriter>(); cell_population.AddCellWriter<CellAncestorWriter>(); for (unsigned index = 0; index < cell_population.rGetMesh().GetNumNodes(); index++) { cell_population.rGetMesh().GetNode(index)->SetRadius(0.5); } // Create an instance of a Wnt concentration WntConcentration<2>::Instance()->SetType(LINEAR); WntConcentration<2>::Instance()->SetCellPopulation(cell_population); WntConcentration<2>::Instance()->SetCryptLength(M_CRYPT_LENGTH); // Create simulation from cell population OffLatticeSimulation<2> simulator(cell_population); simulator.SetDt(1.0/200.0); simulator.SetSamplingTimestepMultiple(200); simulator.SetEndTime(M_END_STEADY_STATE); simulator.SetOutputDirectory("CylindricalCrypt/Node"); simulator.SetOutputDivisionLocations(true); simulator.SetOutputCellVelocities(true); // Add volume tracking modifier MAKE_PTR(VolumeTrackingModifier<2>, p_modifier); simulator.AddSimulationModifier(p_modifier); // Create a force law and pass it to the simulation MAKE_PTR(GeneralisedLinearSpringForce<2>, p_linear_force); p_linear_force->SetMeinekeSpringStiffness(50.0); p_linear_force->SetCutOffLength(cut_off_length); simulator.AddForce(p_linear_force); // Solid base boundary condition MAKE_PTR_ARGS(PlaneBoundaryCondition<2>, p_bcs, (&cell_population, zero_vector<double>(2), -unit_vector<double>(2,1))); p_bcs->SetUseJiggledNodesOnPlane(true); simulator.AddCellPopulationBoundaryCondition(p_bcs); // Sloughing killer MAKE_PTR_ARGS(PlaneBasedCellKiller<2>, p_killer, (&cell_population, (M_CRYPT_LENGTH-0.5)*unit_vector<double>(2,1), unit_vector<double>(2,1))); simulator.AddCellKiller(p_killer); // Run simulation simulator.Solve(); // Mark Ancestors simulator.SetEndTime(M_END_TIME); simulator.rGetCellPopulation().SetCellAncestorsToLocationIndices(); // Run simulation to new end time simulator.Solve(); // Clear memory delete p_mesh; // Clear singletons WntConcentration<2>::Instance()->Destroy(); } /* * == VT == * * Simulate cell proliferation in the colorectal crypt using the * Voronoi Tesselation model. */ void TestMeshBasedCrypt() throw (Exception) { // Create mesh unsigned thickness_of_ghost_layer = 2; CylindricalHoneycombMeshGenerator generator(M_CRYPT_DIAMETER, M_CRYPT_LENGTH, thickness_of_ghost_layer); Cylindrical2dMesh* p_mesh = generator.GetCylindricalMesh(); // Get location indices corresponding to real cells std::vector<unsigned> location_indices = generator.GetCellLocationIndices(); // Create cells std::vector<CellPtr> cells; GenerateCells(location_indices.size(),cells,sqrt(3.0)/2.0,M_CONTACT_INHIBITION_LEVEL); //mature_volume = sqrt(3.0)/2.0 // Create tissue MeshBasedCellPopulationWithGhostNodes<2> cell_population(*p_mesh, cells, location_indices); cell_population.AddCellPopulationCountWriter<CellProliferativeTypesCountWriter>(); cell_population.AddCellWriter<CellVolumesWriter>(); cell_population.AddCellWriter<CellIdWriter>(); cell_population.AddCellWriter<CellAncestorWriter>(); // Create an instance of a Wnt concentration WntConcentration<2>::Instance()->SetType(LINEAR); WntConcentration<2>::Instance()->SetCellPopulation(cell_population); WntConcentration<2>::Instance()->SetCryptLength(M_CRYPT_LENGTH); // Create simulation from cell population OffLatticeSimulation<2> simulator(cell_population); simulator.SetDt(1.0/200.0); simulator.SetSamplingTimestepMultiple(200); simulator.SetEndTime(M_END_STEADY_STATE); simulator.SetOutputDirectory("CylindricalCrypt/Mesh"); simulator.SetOutputDivisionLocations(true); simulator.SetOutputCellVelocities(true); // Add volume tracking Modifier MAKE_PTR(VolumeTrackingModifier<2>, p_modifier); simulator.AddSimulationModifier(p_modifier); // Create a force law and pass it to the simulation MAKE_PTR(GeneralisedLinearSpringForce<2>, p_linear_force); p_linear_force->SetMeinekeSpringStiffness(50.0); simulator.AddForce(p_linear_force); // Solid base boundary condition MAKE_PTR_ARGS(PlaneBoundaryCondition<2>, p_bcs, (&cell_population, zero_vector<double>(2), -unit_vector<double>(2,1))); p_bcs->SetUseJiggledNodesOnPlane(true); simulator.AddCellPopulationBoundaryCondition(p_bcs); // Sloughing killer MAKE_PTR_ARGS(PlaneBasedCellKiller<2>, p_killer, (&cell_population, (M_CRYPT_LENGTH-0.5)*unit_vector<double>(2,1), unit_vector<double>(2,1))); simulator.AddCellKiller(p_killer); // Run simulation simulator.Solve(); // Mark Ancestors simulator.SetEndTime(M_END_TIME); simulator.rGetCellPopulation().SetCellAncestorsToLocationIndices(); // Run simulation to new end time simulator.Solve(); // Clear singletons WntConcentration<2>::Instance()->Destroy(); } /* * == VM == * * Simulate cell proliferation in the colorectal crypt using the * Cell Vertex model. */ void TestVertexBasedCrypt() throw (Exception) { // Create mesh CylindricalHoneycombVertexMeshGenerator generator(M_CRYPT_DIAMETER, M_CRYPT_LENGTH, true); Cylindrical2dVertexMesh* p_mesh = generator.GetCylindricalMesh(); p_mesh->SetCellRearrangementThreshold(0.1); // Create cells std::vector<CellPtr> cells; GenerateCells(p_mesh->GetNumElements(),cells,1.0,M_CONTACT_INHIBITION_LEVEL); //mature_volume = 1.0 // Create tissue VertexBasedCellPopulation<2> cell_population(*p_mesh, cells); cell_population.AddCellPopulationCountWriter<CellProliferativeTypesCountWriter>(); cell_population.AddCellWriter<CellVolumesWriter>(); cell_population.AddCellWriter<CellIdWriter>(); // Create an instance of a Wnt concentration WntConcentration<2>::Instance()->SetType(LINEAR); WntConcentration<2>::Instance()->SetCellPopulation(cell_population); WntConcentration<2>::Instance()->SetCryptLength(M_CRYPT_LENGTH); // Create crypt simulation from cell population OffLatticeSimulation<2> simulator(cell_population); simulator.SetDt(1.0/200.0); simulator.SetSamplingTimestepMultiple(200); simulator.SetEndTime(M_END_STEADY_STATE); simulator.SetOutputDirectory("CylindricalCrypt/Vertex"); simulator.SetOutputDivisionLocations(true); simulator.SetOutputCellVelocities(true); cell_population.AddCellWriter<CellAncestorWriter>(); // Add volume tracking modifier MAKE_PTR(VolumeTrackingModifier<2>, p_modifier); simulator.AddSimulationModifier(p_modifier); // Create Forces and pass to simulation NOTE : these are not the default ones and chosen to give a stable growing monolayer MAKE_PTR(NagaiHondaForce<2>, p_force); p_force->SetNagaiHondaDeformationEnergyParameter(50.0); p_force->SetNagaiHondaMembraneSurfaceEnergyParameter(1.0); p_force->SetNagaiHondaCellCellAdhesionEnergyParameter(1.0); p_force->SetNagaiHondaCellBoundaryAdhesionEnergyParameter(10.0); simulator.AddForce(p_force); // Solid base Boundary condition MAKE_PTR_ARGS(PlaneBoundaryCondition<2>, p_bcs, (&cell_population, zero_vector<double>(2), -unit_vector<double>(2,1))); p_bcs->SetUseJiggledNodesOnPlane(true); simulator.AddCellPopulationBoundaryCondition(p_bcs); // Sloughing killer MAKE_PTR_ARGS(PlaneBasedCellKiller<2>, p_killer, (&cell_population, M_CRYPT_LENGTH*unit_vector<double>(2,1), unit_vector<double>(2,1))); simulator.AddCellKiller(p_killer); // Run simulation simulator.Solve(); // Mark Ancestors simulator.SetEndTime(M_END_TIME); simulator.rGetCellPopulation().SetCellAncestorsToLocationIndices(); // Run simulation to new end time simulator.Solve(); // Clear singletons WntConcentration<2>::Instance()->Destroy(); Warnings::Instance()->QuietDestroy(); } }; #endif /* TESTCYLINDRICALCRYPT_HPP_ */
[ "a.g.fletcher@sheffield.ac.uk" ]
a.g.fletcher@sheffield.ac.uk
3f254b80bd433f2b128ad0be2e3eb77c004c9549
3329ff94ba44f5a575b5398985a33aa948b5f944
/0.0007/uniform/functionObjects/functionObjectProperties
9aa2c025220064fdeb56be667e104a0fff619aa2
[]
no_license
zlsherl/SKPS_simple
38cfac333dd65ed752e34c9f00b555d4255d2efc
0de13926915af0c7eaf1904fe57a8149a7741ba1
refs/heads/main
2023-05-26T20:03:42.391527
2021-06-12T10:24:09
2021-06-12T10:24:09
null
0
0
null
null
null
null
UTF-8
C++
false
false
900
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2012 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "0.0007/uniform/functionObjects"; object functionObjectProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // ************************************************************************* //
[ "krystek.pietrzak@gmail.com" ]
krystek.pietrzak@gmail.com
f435ae7a18245c8911f4a7a0499936fbec47fe3d
d08430845cd0f7fda9014e8ba2d8987a2e32de45
/popcornpopper.h
225a1efc731d5e13aea8dd3f89dc0f34800fbb10
[]
no_license
imploCBA/facade
2afa8cb589aa337b0b30aae0d50fb22521fc05f8
bde56f7523478db4f404644c48b2f0bb007863cd
refs/heads/master
2023-01-31T16:41:58.620842
2020-12-10T17:30:51
2020-12-10T17:30:51
320,343,138
0
0
null
null
null
null
UTF-8
C++
false
false
319
h
#ifndef POPCORNPOPPER_H #define POPCORNPOPPER_H #include <QString> #include <iostream> using namespace std; class PopcornPopper{ private: QString description; public: PopcornPopper(QString description); void on(); void off(); void pop(); QString toString(); }; #endif // POPCORNPOPPER_H
[ "60794005+imploCBA@users.noreply.github.com" ]
60794005+imploCBA@users.noreply.github.com
17e021e2e80854b225d4c024505ba17b4fd3f2fa
238e46a903cf7fac4f83fa8681094bf3c417d22d
/VTK/vtk_7.1.1_x64_Release/include/vtk-7.1/vtkGeoGlobeSource.h
e65b314ed4f5d31c48b157e5c6a6d9312c18ba1e
[ "BSD-3-Clause" ]
permissive
baojunli/FastCAE
da1277f90e584084d461590a3699b941d8c4030b
a3f99f6402da564df87fcef30674ce5f44379962
refs/heads/master
2023-02-25T20:25:31.815729
2021-02-01T03:17:33
2021-02-01T03:17:33
268,390,180
1
0
BSD-3-Clause
2020-06-01T00:39:31
2020-06-01T00:39:31
null
UTF-8
C++
false
false
2,059
h
/*========================================================================= Program: Visualization Toolkit Module: vtkGeoGlobeSource.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. =========================================================================*/ /*------------------------------------------------------------------------- Copyright 2008 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------*/ /** * @class vtkGeoGlobeSource * @brief Spherical globe source. * * * vtkGeoGlobeSource is a 3D vtkGeoSource suitable for use in vtkGeoTerrain. * It uses the vtkGlobeSource filter to produce terrain patches. */ #ifndef vtkGeoGlobeSource_h #define vtkGeoGlobeSource_h #include "vtkGeovisCoreModule.h" // For export macro #include "vtkGeoSource.h" class vtkGeoTerrainNode; class VTKGEOVISCORE_EXPORT vtkGeoGlobeSource : public vtkGeoSource { public: static vtkGeoGlobeSource *New(); vtkTypeMacro(vtkGeoGlobeSource,vtkGeoSource); void PrintSelf(ostream& os, vtkIndent indent); /** * Fetches a low-resolution sphere for the entire globe. */ virtual bool FetchRoot(vtkGeoTreeNode* root); /** * Fetches a refined geometry patch, a section of a sphere. */ virtual bool FetchChild(vtkGeoTreeNode* node, int index, vtkGeoTreeNode* child); protected: vtkGeoGlobeSource(); ~vtkGeoGlobeSource(); private: vtkGeoGlobeSource(const vtkGeoGlobeSource&) VTK_DELETE_FUNCTION; void operator=(const vtkGeoGlobeSource&) VTK_DELETE_FUNCTION; }; #endif
[ "l”ibaojunqd@foxmail.com“" ]
l”ibaojunqd@foxmail.com“
2732630c8a86e66ac2cb5e42d62b2d9cdf6f6bdb
b22f9ed8e94bc6ef88c3ca104e9d68505288e164
/WebKit/chromium/public/WebEventListener.h
62ca0def19022294705091a9ef1b58912a48196c
[ "BSD-2-Clause" ]
permissive
SymbianSource/oss.FCL.sf.mw.qtwebkit
07cebaa233d26702b92f7d6c112c268b68353fcc
3aae234071c49f50b6cfc6307fb755568c7bbb05
refs/heads/master
2021-06-07T15:28:10.414392
2010-10-03T22:32:07
2010-10-03T22:32:07
72,667,965
1
0
null
null
null
null
UTF-8
C++
false
false
2,459
h
/* * Copyright (C) 2010 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef WebEventListener_h #define WebEventListener_h #include "WebCommon.h" #if WEBKIT_IMPLEMENTATION namespace WebCore { class Node; } #endif namespace WebKit { class EventListenerWrapper; class WebEvent; class WebEventListenerPrivate; class WebNode; class WebString; class WebEventListener { public: WEBKIT_API WebEventListener(); WEBKIT_API virtual ~WebEventListener(); // Called when an event is received. virtual void handleEvent(const WebEvent&) = 0; #if WEBKIT_IMPLEMENTATION void notifyEventListenerDeleted(EventListenerWrapper*); EventListenerWrapper* createEventListenerWrapper(const WebString& eventType, bool useCapture, WebCore::Node* node); EventListenerWrapper* getEventListenerWrapper(const WebString& eventType, bool useCapture, WebCore::Node* node); #endif private: WebEventListenerPrivate* m_private; }; } // namespace WebKit #endif
[ "kirill.dremov@nokia.com" ]
kirill.dremov@nokia.com