blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
5
140
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
905 values
visit_date
timestamp[us]date
2015-08-09 11:21:18
2023-09-06 10:45:07
revision_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-17 19:19:19
committer_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-06 06:22:19
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]date
2012-06-07 00:51:45
2023-09-14 21:58:39
gha_created_at
timestamp[us]date
2008-03-27 23:40:48
2023-08-21 23:17:38
gha_language
stringclasses
141 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
10.4M
extension
stringclasses
115 values
content
stringlengths
3
10.4M
authors
sequencelengths
1
1
author_id
stringlengths
0
158
250b349783336b3f2190a130220195dfd14e6704
e459c9b6f58340ee3b75d2e135c26de2e85ed361
/src/ParallelFor/Matrix.cpp
f71cbf40f80ac1066c1705b58ee7abc1760eaff1
[ "MIT" ]
permissive
rajko-z/matrix_multiplication_TBB
119d65fe634ce5738a9c42fb7d9656746c93ff26
777b76cd2fa5cc030548d259e21d2c1db48fdbec
refs/heads/main
2023-06-06T20:57:43.873828
2021-07-12T23:53:02
2021-07-12T23:53:02
385,338,480
0
0
null
null
null
null
UTF-8
C++
false
false
1,723
cpp
#include "Matrix.h" #include "exceptions.h" #include <string> #include <sstream> #include <iostream> using namespace std; Matrix::Matrix(int _n, int _m) : n(_n), m(_m), data(nullptr) { data = (int*)calloc(n * m, sizeof(int)); } Matrix::Matrix(int _n, int _m, std::istream& is) : n(_n), m(_m), data(nullptr) { data = (int*)calloc(n * m, sizeof(int)); is >> *this; } Matrix::~Matrix() { delete[] data; } bool Matrix::operator==(Matrix& other) { if (n != other.getN() || m != other.getM()) return false; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { if (data[i * m + j] != other(i, j)) return false; } } return true; } int& Matrix::operator()(int i, int j) { return data[i * m + j]; } const int& Matrix::operator()(int i, int j) const { return data[i * m + j]; } std::istream& operator>>(std::istream& is, Matrix& matrix) { if (!is) throw InvalidStream("Trying to read from invalid stream"); int a, b; is >> a >> b; if (a != matrix.getN() || b != matrix.getM()) { ostringstream ss; ss << "Dimensions of stream and matrix are incompatible:" << endl << "Stream dimensions (" << a << "," << b << ")" << endl << "Matrix dimensions (" << matrix.getN() << "," << matrix.getM() << ")"; throw InvalidDimensions(ss.str()); } int br = 0; while (is >> matrix.data[br]) { ++br; } if (is.eof()) { return is; } else { throw BadFileFormat("Error happend while trying to read data from file to matrix"); } } std::ostream& operator<<(std::ostream& os, const Matrix& matrix) { os << matrix.n << " " << matrix.m << '\n'; for (int i = 0; i < matrix.n; ++i) { for (int j = 0; j < matrix.m; ++j) { os << matrix(i, j) << " "; } os << '\n'; } return os; }
9e6b2749bc6706cb999e4323974afe72644614a1
6cd2b3604a095b137cba5b72d8fbabbe891edaab
/src/TREngine/reshapePlugin.cpp
196bd9d9fb717bd6d329e3103d7e118605200801
[]
no_license
Orangels/ATM
7d5c54a5d3e7c5bf2aa47f9a7f09b1a504ccf9a4
0e038f2566c618f2fae95295e142be0de6595350
refs/heads/master
2021-05-16T21:34:06.717980
2020-04-10T08:49:19
2020-04-10T08:49:19
250,477,908
1
0
null
null
null
null
UTF-8
C++
false
false
1,206
cpp
#include "reshapePlugin.h" #include "Common.h" CFactory<CReshapePlugin> g_reshapeCreater("Reshape"); CReshapePlugin::CReshapePlugin() { } CReshapePlugin::~CReshapePlugin() { } void CReshapePlugin::_createByModelAndWeightV(const std::string& vLayerName, CCaffePrototxtReader* vpReader, const nvinfer1::Weights* vpWeightOrBias, int vNumWeightOrBias) { std::vector<int> dims; int ilayer = vpReader->getLayerLocation(vLayerName); vpReader->getSequence(dims, "dim", ilayer); dims.resize(4, 0); memcpy(m_outputDim.d, dims.data() + 1, sizeof(m_outputDim.d[0] * (dims.size() - 1))); } nvinfer1::IPlugin* CReshapePlugin::getPlugin() { return this; } nvinfer1::Dims CReshapePlugin::getOutputDimensions(int index, const Dims* inputs, int vNumInputArrary) { size_t n = 1; int nOut = -1; assert(0 == index && 1==vNumInputArrary); for (int i = 0; i < m_outputDim.nbDims; ++i) { n *= inputs[0].d[i]; if (0 == m_outputDim.d[i]) m_outputDim.d[i] = inputs[0].d[i]; nOut *= m_outputDim.d[i]; } for (int i = 0; i < m_outputDim.nbDims; ++i) { if (-1 == m_outputDim.d[i]) { m_outputDim.d[i] = n / nOut; break; } } return m_outputDim; }
3c55fef5c152ad232c29ce97beb99f6011a058e2
093d2e689823e5716c46b09511d8adebb2320573
/InterviewBit/Dynamic Programming/Yet another string operation problem.cpp
83870f888ce1da24d9d6948afe12216fee2ea808
[]
no_license
gauravk268/Competitive_Coding
02813a908e4cd023e4a7039997e750d1fdae6d92
783c246dbaf36425a5b7cb76b4e79e2b7ba1a10c
refs/heads/master
2022-10-15T02:25:41.598723
2022-10-03T06:09:17
2022-10-03T06:09:17
235,630,000
20
22
null
2022-10-03T06:09:18
2020-01-22T17:45:32
C++
UTF-8
C++
false
false
656
cpp
int dp[1005][1005][2]; int fun(string &A, string &B, int &C, int l, int r, bool rot = false) { if (l > r) return 0; if (l == r) return (A[l] != B[r]); int &ans = dp[l][r][rot]; if (ans != -1) return ans; if (rot) { ans = (A[l] != B[r]) + (A[r] != B[l]) + fun(A, B, C, l + 1, r - 1, true); } else { ans = (A[l] != B[l]) + fun(A, B, C, l + 1, r); ans = min(ans, (A[r] != B[r]) + fun(A, B, C, l, r - 1)); ans = min(ans, C + fun(A, B, C, l, r, true)); } return ans; } int Solution::solve(string A, string B, int C) { int n = A.size(); memset(dp, -1, sizeof(dp)); return fun(A, B, C, 0, n - 1, 0); }
fe5f58fa69d61b4590f8b0339e39c88409514338
e68c1f9134b44ddea144f7efa7523076f3f12d3a
/FinalCode/CharacterEmptyMessage.h
4b0f58a36cb49856ad21e356639e10ec4443bdeb
[]
no_license
iso5930/Direct-3D-Team-Portfolio
4ac710ede0c9176702595cba5579af42887611cf
84e64eb4e91c7e5b4aed77212cd08cfee038fcd3
refs/heads/master
2021-08-23T08:15:00.128591
2017-12-04T06:14:39
2017-12-04T06:14:39
112,998,717
0
0
null
null
null
null
UTF-8
C++
false
false
318
h
#pragma once #include "MessageUI.h" class CCharacterEmptyMessage : public CMessageUI { public: virtual void Initialize(); virtual int Update(); virtual void Render(); virtual void Release(); public: explicit CCharacterEmptyMessage(TCHAR* _tszObjKey, OBJ_TYPE _eObjType); virtual ~CCharacterEmptyMessage(); };
88dbf62761ed9fe21da8e703892e96c4ebc12577
a03080e77811226a9220a19afa83b892bf8b3b12
/myMagazine/mymagazinecontroller.cpp
af7747eb812c4a810aef19669c21a31fe1a01cd0
[]
no_license
cfontola/MyMag
d5c03aead590dcb1b977d2631cd89b0e0e1078a9
b3c62a5863f98606e0512cab38a710b8cbc0cf95
refs/heads/master
2020-05-24T02:15:54.052868
2019-05-18T12:28:40
2019-05-18T12:28:40
187,050,620
0
0
null
null
null
null
UTF-8
C++
false
false
1,954
cpp
#include "mymagazinecontroller.h" myMagazineController::myMagazineController(Database* db, loginView* lv, adminController* aC,userController* uC,QObject* parent) : QObject(parent), DB(db), startUI(lv), aController(aC),uController(uC) { startUI->show(); connect(startUI,SIGNAL(signaluserLogin(const QString& ,const QString& )),this,SLOT(verifyuserLogin(const QString& ,const QString& ))); DB->loadUserDb(); } myMagazineController::~myMagazineController(){DB->emptyUserDb();} void myMagazineController::openLoginView(){ if(uController){ delete uController; uController=0; } if(aController){ delete aController; aController=0; } startUI->getUsn()->clear(); startUI->getPass()->clear(); startUI->show(); } //--------VERIFY void myMagazineController::verifyuserLogin(const QString& usn, const QString& psw){ DB->loadUserDb(); if(DB->verifyUser(usn,psw)){ if(dynamic_cast<const Admin*>(DB->getUser(usn,psw))){ aController=new adminController(dynamic_cast<Admin*>(const_cast<User*>(DB->getUser(usn,psw)))); if(aController){ startUI->hide(); aController->openAdminView(); connect(aController,SIGNAL(signalLogout()),this,SLOT(openLoginView())); } } else{ uController = new userController(const_cast<User*>(DB->getUser(usn,psw))); if(uController){ startUI->hide(); uController->openUserView(); connect(uController,SIGNAL(signalLogout()),this,SLOT(openLoginView())); } } } else{ QMessageBox* msg = new QMessageBox(); msg->setText("Username o Password errati."); msg->addButton("OK",QMessageBox::AcceptRole); msg->setAttribute(Qt::WA_DeleteOnClose); msg->show(); } }
3f411f85601275f94cac0c8281d11d0d323ccc0b
376852b732c8e3244b4ab229b9c6c531d3c669cf
/03_Curves/MyApp.h
7286346e10d24e6634b3b1dd16ad4a107487c55c
[]
no_license
NemesLaszlo/OpenGL-Graphics-ManAndGates
d9a0e02f81cd6a073d481ed27b76c5249f9358e1
62e2624a6cb9b0d4b8ab630c3463d1be2e17d194
refs/heads/master
2020-07-21T21:54:19.268590
2019-09-07T15:05:11
2019-09-07T15:05:11
206,982,407
2
0
null
null
null
null
ISO-8859-2
C++
false
false
3,685
h
#pragma once // C++ includes #include <memory> // GLEW #include <GL/glew.h> // SDL #include <SDL.h> #include <SDL_opengl.h> // GLM #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtx/transform2.hpp> #include "ProgramObject.h" #include "BufferObject.h" #include "VertexArrayObject.h" #include "TextureObject.h" #include "Mesh_OGL3.h" #include "gCamera.h" #include <vector> class CMyApp { public: CMyApp(void); ~CMyApp(void); glm::vec3 GetPos(float u, float v); glm::vec3 GetUV_henger(float u, float v); glm::vec3 GetNorm(float u, float v); glm::vec2 GetTex(float u, float v); bool Init(); void Clean(); void Update(); void Render(); void KeyboardDown(SDL_KeyboardEvent&); void KeyboardUp(SDL_KeyboardEvent&); void MouseMove(SDL_MouseMotionEvent&); void MouseDown(SDL_MouseButtonEvent&); void MouseUp(SDL_MouseButtonEvent&); void MouseWheel(SDL_MouseWheelEvent&); void Resize(int, int); protected: // görbénk kiértékelése glm::vec3 Eval(float); float m_currentParam{ 0 }; // shaderekhez szükséges változók ProgramObject m_program; // shaderek programja ProgramObject m_axesProgram; ProgramObject m_pointProgram; ProgramObject m_hengerProgram; ProgramObject m_gombProgram; Texture2D m_textureMetal; Texture2D m_textureTest; VertexArrayObject m_vao; // VAO objektum IndexBuffer m_gpuBufferIndices; // indexek ArrayBuffer m_gpuBufferPos; // pozíciók tömbje ArrayBuffer m_gpuBufferNormal; // normálisok tömbje ArrayBuffer m_gpuBufferTex; // textúrakoordináták tömbje VertexArrayObject m_vaoHenger; // VAO objektum IndexBuffer m_gpuBufferIndicesHenger; // indexek ArrayBuffer m_gpuBufferPosHenger; // pozíciók tömbje ArrayBuffer m_gpuBufferNormalHenger; // normálisok tömbje ArrayBuffer m_gpuBufferTexHenger; // textúrakoordináták tömbje VertexArrayObject m_vaoFelsolap; // VAO objektum IndexBuffer m_gpuBufferIndicesFelsolap; // indexek ArrayBuffer m_gpuBufferPosFelsolap; // pozíciók tömbje ArrayBuffer m_gpuBufferNormalFelsolap; // normálisok tömbje ArrayBuffer m_gpuBufferTexFelsolap; // textúrakoordináták tömbje VertexArrayObject m_vaoAlsolap; // VAO objektum IndexBuffer m_gpuBufferIndicesAlsolap; // indexek ArrayBuffer m_gpuBufferPosAlsolap; // pozíciók tömbje ArrayBuffer m_gpuBufferNormalAlsolap; // normálisok tömbje ArrayBuffer m_gpuBufferTexAlsolap; // textúrakoordináták tömbje VertexArrayObject m_vaoOldalegy; // VAO objektum IndexBuffer m_gpuBufferIndicesOldalegy; // indexek ArrayBuffer m_gpuBufferPosOldalegy; // pozíciók tömbje ArrayBuffer m_gpuBufferNormalOldalegy; // normálisok tömbje ArrayBuffer m_gpuBufferTexOldalegy; // textúrakoordináták tömbje VertexArrayObject m_vaoOldalketto; // VAO objektum IndexBuffer m_gpuBufferIndicesOldalketto; // indexek ArrayBuffer m_gpuBufferPosOldalketto; // pozíciók tömbje ArrayBuffer m_gpuBufferNormalOldalketto; // normálisok tömbje ArrayBuffer m_gpuBufferTexOldalketto; // textúrakoordináták tömbje VertexArrayObject m_vaoGomb; // VAO objektum IndexBuffer m_gpuBufferIndicesGomb; // indexek ArrayBuffer m_gpuBufferPosGomb; // pozíciók tömbje ArrayBuffer m_gpuBufferNormalGomb; // normálisok tömbje ArrayBuffer m_gpuBufferTexGomb; // textúrakoordináták tömbje std::unique_ptr<Mesh> m_mesh; gCamera m_camera; const int kMaxPointCount = 10; static const int N = 20; static const int M = 20; int num = 10; std::vector<glm::vec3> m_controlPoints{ {-10,0,-10}, {10,0,-10} }; std::vector<std::string> m_pointName{ "Point 1", "Point 2" }; };
0552e3760a56044c46c1e1ca40a1e5a952e1d61d
b3bd6333068cbe9820565359adc33bbbfec22b99
/project_a_headers/include/project_a/project_a.hpp
c7a5ca3d935b8f3c3da79af6916cbf355ee025d3
[ "Apache-2.0" ]
permissive
Karsten1987/modern_cmake_example
cbc6726ce53aeddbf02ca861f85e6f41ee11e944
6e48b3b4ae3309846986649d216b327fae062237
refs/heads/master
2020-06-16T12:19:20.841367
2019-09-15T19:16:38
2019-09-15T19:16:38
195,571,508
0
0
null
null
null
null
UTF-8
C++
false
false
173
hpp
#ifndef PROJECT_A_HEADERS_HPP_ #define PROJECT_A_HEADERS_HPP_ class ProjectA { public: ProjectA() = default; void print() const; }; #endif // PROJECT_A_HEADERS_HPP_
6ba3d3f103a4cc3861245f1aad8af0cddc1f3398
78c37c14b3bac58a20f694cc54ae9d0404607e2d
/include/metalang/compiler/parser_rules/expression.hpp
0bf47af2be15ba9162d16538780b7cd3daa43630
[]
no_license
MatthewI123/MetaLang
99be935643912809a0903ae28242370dd4769813
3b1444c5d4f04e30be72ae384775495f2998d96e
refs/heads/master
2020-12-14T08:22:48.747211
2020-02-03T10:03:49
2020-02-03T10:03:49
234,685,611
0
1
null
null
null
null
UTF-8
C++
false
false
7,513
hpp
#pragma once #include <type_traits> #include "../../types.hpp" #include "../node.hpp" #include "../token.hpp" namespace compiler::parser_rules { template<typename Parser> struct make_additive_expression_dispatch; template<typename Parser> using make_expression_t = typename make_additive_expression_dispatch<Parser>::type; template<typename Parser, typename Node> struct make_primary_expression { using next_state = Parser; using node = Node; }; template<typename Parser, typename = void> struct make_primary_expression_helper { using type = typename Parser::template unexpected<>; }; template<typename Parser> struct make_primary_expression_helper<Parser, std::enable_if_t<Parser::current::kind == token::decorator::token_kind::integer>> { using node = typename node::template integer<typename Parser::current>; using next_state_0 = typename Parser::next; using type = make_primary_expression<next_state_0, node>; }; template<typename Parser> struct make_primary_expression_helper<Parser, std::enable_if_t<Parser::current::kind == token::decorator::token_kind::identifier>> { using node = typename node::template identifier<typename Parser::current>; using next_state_0 = typename Parser::next; using type = make_primary_expression<next_state_0, node>; }; template<typename Parser> struct make_primary_expression_helper<Parser, std::enable_if_t<Parser::current::kind == token::decorator::token_kind::symbol_left_parenthesis>> { using next_state_0 = typename Parser::next; using expression = make_expression_t<next_state_0>; using next_state_1 = typename expression::next_state; using node = typename expression::node; using next_state_2 = typename next_state_1::template expect< token::decorator::token_kind::symbol_right_parenthesis>; using type = make_primary_expression<next_state_2, node>; }; template<typename Parser> using make_primary_expression_t = typename make_primary_expression_helper<Parser>::type; } namespace compiler::parser_rules { template<typename Parser, typename Node> struct make_unary_expression { using next_state = Parser; using node = Node; }; template<typename Parser, typename = void> struct make_unary_expression_helper { using operand = make_primary_expression_t<Parser>; using type = make_unary_expression<typename operand::next_state, typename operand::node>; }; template<typename Parser> struct make_unary_expression_helper<Parser, std::enable_if_t<Parser::current::kind == token::decorator::token_kind::operator_subtract>> { using next_state_0 = typename Parser::next; using operand = make_primary_expression_t<next_state_0>; using type = make_unary_expression<typename operand::next_state, typename node::template unary_expression<node::decorator::unary_mode::negation, typename operand::node>>; }; template<typename Parser> using make_unary_expression_t = typename make_unary_expression_helper<Parser>::type; } namespace compiler::parser_rules { template<token::decorator::token_kind Kind> constexpr bool is_multiplicative = Kind == token::decorator::token_kind::operator_multiply || Kind == token::decorator::token_kind::operator_divide || Kind == token::decorator::token_kind::operator_modulo; template<typename Parser, typename Left> struct make_multiplicative_expression { using next_state = Parser; using node = Left; }; template<typename Parser, typename Left, typename = void> struct make_multiplicative_expression_helper { using type = make_multiplicative_expression<Parser, Left>; }; template<typename Parser, typename Left> struct make_multiplicative_expression_helper<Parser, Left, std::enable_if_t<Parser::current::kind == token::decorator::token_kind::operator_multiply>> { using next_state_0 = typename Parser::next; using operand = make_unary_expression_t<next_state_0>; using type = typename make_multiplicative_expression_helper<typename operand::next_state, typename node::template multiplicative_expression<node::decorator::multiplicative_mode::multiply, Left, typename operand::node>>::type; }; template<typename Parser, typename Left> struct make_multiplicative_expression_helper<Parser, Left, std::enable_if_t<Parser::current::kind == token::decorator::token_kind::operator_divide>> { using next_state_0 = typename Parser::next; using operand = make_unary_expression_t<next_state_0>; using type = typename make_multiplicative_expression_helper<typename operand::next_state, typename node::template multiplicative_expression<node::decorator::multiplicative_mode::divide, Left, typename operand::node>>::type; }; template<typename Parser, typename Left> struct make_multiplicative_expression_helper<Parser, Left, std::enable_if_t<Parser::current::kind == token::decorator::token_kind::operator_modulo>> { using next_state_0 = typename Parser::next; using operand = make_unary_expression_t<next_state_0>; using type = typename make_multiplicative_expression_helper<typename operand::next_state, typename node::template multiplicative_expression<node::decorator::multiplicative_mode::modulo, Left, typename operand::node>>::type; }; template<typename Parser> struct make_multiplicative_expression_dispatch { using left = make_unary_expression_t<Parser>; using type = typename make_multiplicative_expression_helper<typename left::next_state, typename left::node>::type; }; template<typename Parser> using make_multiplicative_expression_t = typename make_multiplicative_expression_dispatch<Parser>::type; } namespace compiler::parser_rules { template<token::decorator::token_kind Kind> constexpr bool is_additive = Kind == token::decorator::token_kind::operator_add || Kind == token::decorator::token_kind::operator_subtract; template<typename Parser, typename Left> struct make_additive_expression { using next_state = Parser; using node = Left; }; template<typename Parser, typename Left, typename = void> struct make_additive_expression_helper { using type = make_additive_expression<Parser, Left>; }; template<typename Parser, typename Left> struct make_additive_expression_helper<Parser, Left, std::enable_if_t<Parser::current::kind == token::decorator::token_kind::operator_add>> { using next_state_0 = typename Parser::next; using operand = make_multiplicative_expression_t<next_state_0>; using type = typename make_additive_expression_helper<typename operand::next_state, typename node::template additive_expression<node::decorator::additive_mode::addition, Left, typename operand::node>>::type; }; template<typename Parser, typename Left> struct make_additive_expression_helper<Parser, Left, std::enable_if_t<Parser::current::kind == token::decorator::token_kind::operator_subtract>> { using next_state_0 = typename Parser::next; using operand = make_multiplicative_expression_t<next_state_0>; using type = typename make_additive_expression_helper<typename operand::next_state, typename node::template additive_expression<node::decorator::additive_mode::subtraction, Left, typename operand::node>>::type; }; template<typename Parser> struct make_additive_expression_dispatch { using left = make_multiplicative_expression_t<Parser>; using type = typename make_additive_expression_helper<typename left::next_state, typename left::node>::type; }; template<typename Parser> using make_additive_expression_t = typename make_additive_expression_dispatch<Parser>::type; }
c2ac2657df5f3143b67a30c7be5e51e2da3d67ca
230b7714d61bbbc9a75dd9adc487706dffbf301e
/net/spdy/bidirectional_stream_spdy_impl.cc
f428a759d5a413e0da9084cf33cf1442a098009a
[ "BSD-3-Clause" ]
permissive
byte4byte/cloudretro
efe4f8275f267e553ba82068c91ed801d02637a7
4d6e047d4726c1d3d1d119dfb55c8b0f29f6b39a
refs/heads/master
2023-02-22T02:59:29.357795
2021-01-25T02:32:24
2021-01-25T02:32:24
197,294,750
1
2
BSD-3-Clause
2019-09-11T19:35:45
2019-07-17T01:48:48
null
UTF-8
C++
false
false
12,686
cc
// Copyright 2015 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 "net/spdy/bidirectional_stream_spdy_impl.h" #include <utility> #include "base/bind.h" #include "base/location.h" #include "base/logging.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" #include "base/timer/timer.h" #include "net/http/bidirectional_stream_request_info.h" #include "net/spdy/spdy_buffer.h" #include "net/spdy/spdy_http_utils.h" #include "net/spdy/spdy_stream.h" #include "net/third_party/quiche/src/spdy/core/spdy_header_block.h" namespace net { namespace { // Time to wait in millisecond to notify |delegate_| of data received. // Handing small chunks of data to the caller creates measurable overhead. // So buffer data in short time-spans and send a single read notification. const int kBufferTimeMs = 1; } // namespace BidirectionalStreamSpdyImpl::BidirectionalStreamSpdyImpl( const base::WeakPtr<SpdySession>& spdy_session, NetLogSource source_dependency) : spdy_session_(spdy_session), request_info_(nullptr), delegate_(nullptr), source_dependency_(source_dependency), negotiated_protocol_(kProtoUnknown), more_read_data_pending_(false), read_buffer_len_(0), written_end_of_stream_(false), write_pending_(false), stream_closed_(false), closed_stream_status_(ERR_FAILED), closed_stream_received_bytes_(0), closed_stream_sent_bytes_(0), closed_has_load_timing_info_(false) {} BidirectionalStreamSpdyImpl::~BidirectionalStreamSpdyImpl() { // Sends a RST to the remote if the stream is destroyed before it completes. ResetStream(); } void BidirectionalStreamSpdyImpl::Start( const BidirectionalStreamRequestInfo* request_info, const NetLogWithSource& net_log, bool /*send_request_headers_automatically*/, BidirectionalStreamImpl::Delegate* delegate, std::unique_ptr<base::OneShotTimer> timer, const NetworkTrafficAnnotationTag& traffic_annotation) { DCHECK(!stream_); DCHECK(timer); delegate_ = delegate; timer_ = std::move(timer); if (!spdy_session_) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&BidirectionalStreamSpdyImpl::NotifyError, weak_factory_.GetWeakPtr(), ERR_CONNECTION_CLOSED)); return; } request_info_ = request_info; int rv = stream_request_.StartRequest( SPDY_BIDIRECTIONAL_STREAM, spdy_session_, request_info_->url, false /* no early data */, request_info_->priority, request_info_->socket_tag, net_log, base::Bind(&BidirectionalStreamSpdyImpl::OnStreamInitialized, weak_factory_.GetWeakPtr()), traffic_annotation); if (rv != ERR_IO_PENDING) OnStreamInitialized(rv); } void BidirectionalStreamSpdyImpl::SendRequestHeaders() { // Request headers will be sent automatically. NOTREACHED(); } int BidirectionalStreamSpdyImpl::ReadData(IOBuffer* buf, int buf_len) { if (stream_) DCHECK(!stream_->IsIdle()); DCHECK(buf); DCHECK(buf_len); DCHECK(!timer_->IsRunning()) << "There should be only one ReadData in flight"; // If there is data buffered, complete the IO immediately. if (!read_data_queue_.IsEmpty()) { return read_data_queue_.Dequeue(buf->data(), buf_len); } else if (stream_closed_) { return closed_stream_status_; } // Read will complete asynchronously and Delegate::OnReadCompleted will be // called upon completion. read_buffer_ = buf; read_buffer_len_ = buf_len; return ERR_IO_PENDING; } void BidirectionalStreamSpdyImpl::SendvData( const std::vector<scoped_refptr<IOBuffer>>& buffers, const std::vector<int>& lengths, bool end_stream) { DCHECK_EQ(buffers.size(), lengths.size()); DCHECK(!write_pending_); if (written_end_of_stream_) { LOG(ERROR) << "Writing after end of stream is written."; base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&BidirectionalStreamSpdyImpl::NotifyError, weak_factory_.GetWeakPtr(), ERR_UNEXPECTED)); return; } write_pending_ = true; written_end_of_stream_ = end_stream; if (MaybeHandleStreamClosedInSendData()) return; DCHECK(!stream_closed_); int total_len = 0; for (int len : lengths) { total_len += len; } if (buffers.size() == 1) { pending_combined_buffer_ = buffers[0]; } else { pending_combined_buffer_ = base::MakeRefCounted<net::IOBuffer>(total_len); int len = 0; // TODO(xunjieli): Get rid of extra copy. Coalesce headers and data frames. for (size_t i = 0; i < buffers.size(); ++i) { memcpy(pending_combined_buffer_->data() + len, buffers[i]->data(), lengths[i]); len += lengths[i]; } } stream_->SendData(pending_combined_buffer_.get(), total_len, end_stream ? NO_MORE_DATA_TO_SEND : MORE_DATA_TO_SEND); } NextProto BidirectionalStreamSpdyImpl::GetProtocol() const { return negotiated_protocol_; } int64_t BidirectionalStreamSpdyImpl::GetTotalReceivedBytes() const { if (stream_closed_) return closed_stream_received_bytes_; if (!stream_) return 0; return stream_->raw_received_bytes(); } int64_t BidirectionalStreamSpdyImpl::GetTotalSentBytes() const { if (stream_closed_) return closed_stream_sent_bytes_; if (!stream_) return 0; return stream_->raw_sent_bytes(); } bool BidirectionalStreamSpdyImpl::GetLoadTimingInfo( LoadTimingInfo* load_timing_info) const { if (stream_closed_) { if (!closed_has_load_timing_info_) return false; *load_timing_info = closed_load_timing_info_; return true; } // If |stream_| isn't created or has ID 0, return false. This is to match // the implementation in SpdyHttpStream. if (!stream_ || stream_->stream_id() == 0) return false; return stream_->GetLoadTimingInfo(load_timing_info); } void BidirectionalStreamSpdyImpl::PopulateNetErrorDetails( NetErrorDetails* details) {} void BidirectionalStreamSpdyImpl::OnHeadersSent() { DCHECK(stream_); negotiated_protocol_ = kProtoHTTP2; if (delegate_) delegate_->OnStreamReady(/*request_headers_sent=*/true); } void BidirectionalStreamSpdyImpl::OnHeadersReceived( const spdy::SpdyHeaderBlock& response_headers, const spdy::SpdyHeaderBlock* pushed_request_headers) { DCHECK(stream_); if (delegate_) delegate_->OnHeadersReceived(response_headers); } void BidirectionalStreamSpdyImpl::OnDataReceived( std::unique_ptr<SpdyBuffer> buffer) { DCHECK(stream_); DCHECK(!stream_closed_); // If |buffer| is null, BidirectionalStreamSpdyImpl::OnClose will be invoked // by SpdyStream to indicate the end of stream. if (!buffer) return; // When buffer is consumed, SpdyStream::OnReadBufferConsumed will adjust // recv window size accordingly. read_data_queue_.Enqueue(std::move(buffer)); if (read_buffer_) { // Handing small chunks of data to the caller creates measurable overhead. // So buffer data in short time-spans and send a single read notification. ScheduleBufferedRead(); } } void BidirectionalStreamSpdyImpl::OnDataSent() { DCHECK(write_pending_); pending_combined_buffer_ = nullptr; write_pending_ = false; if (delegate_) delegate_->OnDataSent(); } void BidirectionalStreamSpdyImpl::OnTrailers( const spdy::SpdyHeaderBlock& trailers) { DCHECK(stream_); DCHECK(!stream_closed_); if (delegate_) delegate_->OnTrailersReceived(trailers); } void BidirectionalStreamSpdyImpl::OnClose(int status) { DCHECK(stream_); stream_closed_ = true; closed_stream_status_ = status; closed_stream_received_bytes_ = stream_->raw_received_bytes(); closed_stream_sent_bytes_ = stream_->raw_sent_bytes(); closed_has_load_timing_info_ = stream_->GetLoadTimingInfo(&closed_load_timing_info_); if (status != OK) { NotifyError(status); return; } ResetStream(); // Complete any remaining read, as all data has been buffered. // If user has not called ReadData (i.e |read_buffer_| is nullptr), this will // do nothing. timer_->Stop(); // |this| might get destroyed after calling into |delegate_| in // DoBufferedRead(). auto weak_this = weak_factory_.GetWeakPtr(); DoBufferedRead(); if (weak_this.get() && write_pending_) OnDataSent(); } NetLogSource BidirectionalStreamSpdyImpl::source_dependency() const { return source_dependency_; } int BidirectionalStreamSpdyImpl::SendRequestHeadersHelper() { spdy::SpdyHeaderBlock headers; HttpRequestInfo http_request_info; http_request_info.url = request_info_->url; http_request_info.method = request_info_->method; http_request_info.extra_headers = request_info_->extra_headers; CreateSpdyHeadersFromHttpRequest(http_request_info, http_request_info.extra_headers, &headers); written_end_of_stream_ = request_info_->end_stream_on_headers; return stream_->SendRequestHeaders(std::move(headers), request_info_->end_stream_on_headers ? NO_MORE_DATA_TO_SEND : MORE_DATA_TO_SEND); } void BidirectionalStreamSpdyImpl::OnStreamInitialized(int rv) { DCHECK_NE(ERR_IO_PENDING, rv); if (rv == OK) { stream_ = stream_request_.ReleaseStream(); stream_->SetDelegate(this); rv = SendRequestHeadersHelper(); if (rv == OK) { OnHeadersSent(); return; } else if (rv == ERR_IO_PENDING) { return; } } NotifyError(rv); } void BidirectionalStreamSpdyImpl::NotifyError(int rv) { ResetStream(); write_pending_ = false; if (delegate_) { BidirectionalStreamImpl::Delegate* delegate = delegate_; delegate_ = nullptr; // Cancel any pending callback. weak_factory_.InvalidateWeakPtrs(); delegate->OnFailed(rv); // |this| can be null when returned from delegate. } } void BidirectionalStreamSpdyImpl::ResetStream() { if (!stream_) return; if (!stream_->IsClosed()) { // This sends a RST to the remote. stream_->DetachDelegate(); DCHECK(!stream_); } else { // Stream is already closed, so it is not legal to call DetachDelegate. stream_.reset(); } } void BidirectionalStreamSpdyImpl::ScheduleBufferedRead() { // If there is already a scheduled DoBufferedRead, don't issue // another one. Mark that we have received more data and return. if (timer_->IsRunning()) { more_read_data_pending_ = true; return; } more_read_data_pending_ = false; timer_->Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kBufferTimeMs), base::Bind(&BidirectionalStreamSpdyImpl::DoBufferedRead, weak_factory_.GetWeakPtr())); } void BidirectionalStreamSpdyImpl::DoBufferedRead() { DCHECK(!timer_->IsRunning()); // Check to see that the stream has not errored out. DCHECK(stream_ || stream_closed_); DCHECK(!stream_closed_ || closed_stream_status_ == OK); // When |more_read_data_pending_| is true, it means that more data has arrived // since started waiting. Wait a little longer and continue to buffer. if (more_read_data_pending_ && ShouldWaitForMoreBufferedData()) { ScheduleBufferedRead(); return; } int rv = 0; if (read_buffer_) { rv = ReadData(read_buffer_.get(), read_buffer_len_); DCHECK_NE(ERR_IO_PENDING, rv); read_buffer_ = nullptr; read_buffer_len_ = 0; if (delegate_) delegate_->OnDataRead(rv); } } bool BidirectionalStreamSpdyImpl::ShouldWaitForMoreBufferedData() const { if (stream_closed_) return false; DCHECK_GT(read_buffer_len_, 0); return read_data_queue_.GetTotalSize() < static_cast<size_t>(read_buffer_len_); } bool BidirectionalStreamSpdyImpl::MaybeHandleStreamClosedInSendData() { if (stream_) return false; // If |stream_| is closed without an error before client half closes, // blackhole any pending write data. crbug.com/650438. if (stream_closed_ && closed_stream_status_ == OK) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&BidirectionalStreamSpdyImpl::OnDataSent, weak_factory_.GetWeakPtr())); return true; } LOG(ERROR) << "Trying to send data after stream has been destroyed."; base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&BidirectionalStreamSpdyImpl::NotifyError, weak_factory_.GetWeakPtr(), ERR_UNEXPECTED)); return true; } } // namespace net
6d0e1914ef9003f3e56e2583e3f952693bc2f438
4d429a275d6a09e44476782baee13da8dd2473d0
/include/db/DBManager.h
5a74dbc08c10ef9a83bbf53aeabc81c55c537582
[ "MIT", "BSD-3-Clause", "LicenseRef-scancode-generic-cla", "MPL-2.0", "CC-BY-4.0", "LicenseRef-scancode-protobuf", "Apache-2.0", "BSD-2-Clause", "OFL-1.1", "LicenseRef-scancode-hidapi" ]
permissive
brindosch/hyperion.ngBeta
314e3ded5885e99ff81bac2bd2654c60814fd5c3
08de6b78318f0a701e7e1e26828284b6ad8d0c2b
refs/heads/master
2021-01-24T03:19:21.620437
2020-05-29T19:19:29
2020-05-29T19:19:29
66,153,294
3
7
MIT
2019-08-31T10:05:07
2016-08-20T15:18:44
C++
UTF-8
C++
false
false
4,832
h
#pragma once #include <utils/Logger.h> #include <QMap> #include <QVariant> #include <QPair> #include <QVector> class QSqlDatabase; class QSqlQuery; typedef QPair<QString,QVariant> CPair; typedef QVector<CPair> VectorPair; /// /// @brief Database interface for SQLite3. /// Inherit this class to create component specific methods based on this interface /// Usage: setTable(name) once before you use read/write actions /// To use another database use setDb(newDB) (defaults to "hyperion") /// /// Incompatible functions with SQlite3: /// QSqlQuery::size() returns always -1 /// class DBManager : public QObject { Q_OBJECT public: DBManager(QObject* parent = nullptr); ~DBManager(); /// set root path void setRootPath(const QString& rootPath); /// define the database to work with void setDatabaseName(const QString& dbn) { _dbn = dbn; }; /// set a table to work with void setTable(const QString& table); /// get current database object set with setDB() QSqlDatabase getDB() const; /// /// @brief Create a table (if required) with the given columns. Older tables will be updated accordingly with missing columns /// Does not delete or migrate old columns /// @param[in] columns The columns of the table. Requires at least one entry! /// @return True on success else false /// bool createTable(QStringList& columns) const; /// /// @brief Create a column if the column already exists returns false and logs error /// @param[in] column The column of the table /// @return True on success else false /// bool createColumn(const QString& column) const; /// /// @brief Check if at least one record exists in table with the conditions /// @param[in] conditions The search conditions (WHERE) /// @return True on success else false /// bool recordExists(const VectorPair& conditions) const; /// /// @brief Create a new record in table when the conditions find no existing entry. Add additional key:value pairs in columns /// DO NOT repeat column keys between 'conditions' and 'columns' as they will be merged on creation /// @param[in] conditions conditions to search for, as a record may exist and should be updated instead (WHERE) /// @param[in] columns columns to create or update (optional) /// @return True on success else false /// bool createRecord(const VectorPair& conditions, const QVariantMap& columns = QVariantMap()) const; /// /// @brief Update a record with conditions and additional key:value pairs in columns /// @param[in] conditions conditions which rows should be updated (WHERE) /// @param[in] columns columns to update /// @return True on success else false /// bool updateRecord(const VectorPair& conditions, const QVariantMap& columns) const; /// /// @brief Get data of a single record, multiple records are not supported /// @param[in] conditions condition to search for (WHERE) /// @param[out] results results of query /// @param[in] tColumns target columns to search in (optional) if not provided returns all columns /// @return True on success else false /// bool getRecord(const VectorPair& conditions, QVariantMap& results, const QStringList& tColumns = QStringList()) const; /// /// @brief Get data of multiple records, you need to specify the columns. This search is without conditions. Good to grab all data from db /// @param[in] conditions condition to search for (WHERE) /// @param[out] results results of query /// @param[in] tColumns target columns to search in (optional) if not provided returns all columns /// @return True on success else false /// bool getRecords(QVector<QVariantMap>& results, const QStringList& tColumns = QStringList()) const; /// /// @brief Delete a record determined by conditions /// @param[in] conditions conditions of the row to delete it (WHERE) /// @return True on success; on error or not found false /// bool deleteRecord(const VectorPair& conditions) const; /// /// @brief Check if table exists in current database /// @param[in] table The name of the table /// @return True on success else false /// bool tableExists(const QString& table) const; /// /// @brief Delete a table, fails silent (return true) if table is not found /// @param[in] table The name of the table /// @return True on success else false /// bool deleteTable(const QString& table) const; private: Logger* _log; /// databse connection & file name, defaults to hyperion QString _dbn = "hyperion"; /// table in database QString _table; /// addBindValue to query given by QVariantList void doAddBindValue(QSqlQuery& query, const QVariantList& variants) const; };
27dd327a0f9ddda9ab444ad27ecbbdcc7dfe2297
72a43a4f137f310cf2eb1f8f13074dfcba5a4101
/UnionFind.cpp
f3f700a512b15f10f16823097818144319fef96e
[]
no_license
manzanoivan/2doCampamentoVerano
e90fe16b8bdb59ec4c53c321fa6167b53daa621f
949801cb84782fb6e3b71fb3c1d632ee93f8926d
refs/heads/master
2020-12-06T17:15:32.853436
2017-07-08T02:24:51
2017-07-08T02:24:51
95,580,725
1
0
null
null
null
null
UTF-8
C++
false
false
585
cpp
#include <iostream> #include <vector> using namespace std; // Conjuntos disjuntos con Union-Find. struct UnionFind { int n; vector<int> padre, tam; UnionFind(int N) : n(N), tam(N, 1), padre(N) { while (--N) padre[N] = N; } int Raiz(int u) { if (padre[u] == u) return u; return padre[u] = Raiz(padre[u]); } bool SonConexos(int u, int v) { return Raiz(u) == Raiz(v); } void Unir(int u, int v) { int Ru = Raiz(u); int Rv = Raiz(v); if (Ru == Rv) return; --n, padre[Ru] = Rv; tam[Rv] += tam[Ru]; } int Tamano(int u) { return tam[Raiz(u)]; } }; int main(){ }
a74fc5cc1f388083cb4d1cef5a40af991b9e4fdf
e60d99adda082eeea7a40f2b54cea06b57484adb
/APIFramework/APIFramework/Include/Core/InputManager.cpp
7edc296f822f704fdbf497865a0539767af02cff
[]
no_license
BaeMinCheon/BCSD
ed2ec1fc8874804bed19e131d2832e37d7948d11
6c93bc9fdf2c40a2a68fe9c7c90e3ba2f1ee3e0e
refs/heads/master
2020-05-06T15:30:24.211448
2019-04-08T14:51:33
2019-04-08T14:51:33
null
0
0
null
null
null
null
UHC
C++
false
false
1,954
cpp
#include "InputManager.h" DEFINE_SINGLE(InputManager); InputManager::InputManager() : m_pCreateKey(nullptr) { } InputManager::~InputManager() { SafeDeleteMap(m_mapKey); } KEYINFO * InputManager::FindKey(const string & key) const { unordered_map<string, KEYINFO *>::const_iterator iter = m_mapKey.find(key); if (iter == m_mapKey.end()) return nullptr; return iter->second; } bool InputManager::KeyDown(const string & key) const { KEYINFO * pInfo = FindKey(key); if (!pInfo) return false; return pInfo->isDown; } bool InputManager::KeyPress(const string & key) const { KEYINFO * pInfo = FindKey(key); if (!pInfo) return false; return pInfo->isPressed; } bool InputManager::KeyUp(const string & key) const { KEYINFO * pInfo = FindKey(key); if (!pInfo) return false; return pInfo->isUp; } bool InputManager::Init(HWND hWnd) { m_hWnd = hWnd; AddKey('W', "MoveUp"); AddKey('S', "MoveDown"); AddKey('A', "MoveLeft"); AddKey('D', "MoveRight"); AddKey(VK_SPACE, "Fire"); AddKey(VK_SHIFT, "Slow"); return true; } void InputManager::Update(float deltaTime) { unordered_map<string, KEYINFO *>::iterator iter; for (iter = m_mapKey.begin(); iter != m_mapKey.end(); ++iter) { int pushCount = 0; for (size_t i = 0; i < iter->second->keys.size(); ++i) { if (GetAsyncKeyState(iter->second->keys[i]) & 0x8000) ++pushCount; } // 입력 상태 변경 (down press up) if (pushCount == iter->second->keys.size()) // Press { if (!iter->second->isDown && !iter->second->isPressed) { iter->second->isDown = true; iter->second->isPressed = true; iter->second->isUp = false; } else if (iter->second->isDown) iter->second->isDown = false; } else // Up { if (iter->second->isPressed) { iter->second->isDown = false; iter->second->isPressed = false; iter->second->isUp = true; } else if (iter->second->isUp) iter->second->isUp = false; } } }
7a7e44e60482e77327056ead0f0c07a1ce16a6e1
8c98dd568c47e79cbf51bf52863676e395f48fb5
/ch04/BSTree.h
dc23b450f2b69b725796a127f9c1df2b595a1600
[]
no_license
MonstarCoder/MyAlgorithms
56652f692a11b9134e53c2ed9cdea9ed78780085
f367b7546971a2b551fc79bcd88f5f9a135386ea
refs/heads/master
2021-09-09T19:58:30.730633
2018-03-19T10:55:45
2018-03-19T10:55:45
91,231,324
0
0
null
null
null
null
UTF-8
C++
false
false
8,714
h
//二叉查找树的实现。 //注意:“声明”和“实现”都位于本头文件中,应为在二叉查找树的实现使用了模板,而 //c++编译器不支持对模板的分离式编译 #ifndef _BINARY_SEARCH_TREE_H #define _BINARY_SEARCH_TREE_H #include <iostream> #include <iomanip> template <class T> class BSTNode { public: T key; //关键字 BSTNode *left; //左儿子 BSTNode *right; //右儿子 BSTNode *parent; //父节点 BSTNode( T value, BSTNode *p, BSTNode *l, BSTNode *r ) : key( value ), parent( p ), left( l ), right( r ) {} }; template <class T> class BSTree { private: BSTNode<T> *mRoot; //根节点 public: BSTree(); ~BSTree(); //前序遍历 void preOrder(); //中序遍历 void inOrder(); //后序遍历 void postOrder(); //速归实现查找 BSTNode<T>* search( T key ); //非递归实现查找 BSTNode<T>* iterativeSearch( T key ); //查找最小节点,返回最小节点的键值 T minimum(); //查找最大节点 T maximum(); //找节点x的后继节点,即查找二叉树中大于该节点的最小节点 BSTNode<T>* successor(BSTNode<T>* x); //找节点x的前驱节点,即查找二叉树中小于该节点的最大节点 BSTNode<T>* predecessor(BSTNode<T>* x); //插入节点 void insert( T key ); //删除节点 void remove( T key ); //销毁二叉树 void destroy(); //打印二叉树 void print(); private: //前序遍历二叉树 void preOrder( BSTNode<T>* tree ) const; //中序遍历二叉树 void inOrder( BSTNode<T>* tree ) const; //后序遍历二叉树 void postOrder( BSTNode<T>* tree ) const; //递归实现查找 BSTNode<T>* search( BSTNode<T>* x, T key ) const; //非递归实现查找 BSTNode<T>* iterativeSearch( BSTNode<T>* x, T key ) const; //查找最小节点,返回tree为根节点的二叉树的最小节点 BSTNode<T>* minimum( BSTNode<T>* tree ); //查找最大节点,返回tree为根节点的二叉树的最大节点 BSTNode<T>* maximum( BSTNode<T>* tree ); //将节点插入到二叉树 void insert( BSTNode<T>* &tree, BSTNode<T>* z ); //删除二叉树中的节点,并返回被删除的节点 BSTNode<T>* remove( BSTNode<T>* &tree, BSTNode<T>* z ); //销毁二叉树 void destroy( BSTNode<T>* &tree ); //打印二叉树 void print( BSTNode<T>* tree, T key, int direction ); }; //构造函数 template < class T > BSTree<T>::BSTree() : mRoot( nullptr ) {} //析构函数 template < class T > BSTree<T>::~BSTree() { destroy(); } //前序遍历 template < class T > void BSTree<T>::preOrder(BSTNode<T>* tree) const { if (tree != nullptr) { std::cout << tree->left << " "; preOrder(tree->left); preOrder(tree->right); } } template <class T> void BSTree<T>::preOrder() { preOrder(mRoot); } //中序遍历二叉树 template <class T> void BSTree<T>::inOrder(BSTNode<T>* tree) const { if (tree != nullptr) { inOrder(tree->left); std::cout << tree->key << " "; inOrder(tree->right); } } template <class T> void BSTree<T>::inOrder() { inOrder(mRoot); } //后序遍历二叉树 template <class T> void BSTree<T>::postOrder(BSTNode<T>* tree) const { if (tree != nullptr) { postOrder(tree->left); postOrder(tree->right); std::cout << tree->key << " "; } } template <class T> void BSTree<T>::postOrder() { postOrder(mRoot); } //递归实现查找 template <class T> BSTNode<T>* BSTree<T>::search(BSTNode<T>* x, T key) const { if (x == nullptr || x->key == key) return x; if (key < x->key) return search(x->right, key); else return search(x->right, key); } template <class T> BSTNode<T>* BSTree<T>::search(T key) { return(mRoot, key); } //非递归实现查找 template <class T> BSTNode<T>* BSTree<T>::iterativeSearch(BSTNode<T>* x, T key) const { while ((x != nullptr) && (x->key != key)) { if (key < x->key) x = x->left; else x = x->right; } return x; } template <class T> BSTNode<T>* BSTree<T>::iterativeSearch(T key) { iterativeSearch(mRoot, key); } //查找最下节点,返回tree为根节点的二叉树的最小节点 template <class T> BSTNode<T>* BSTree<T>::minimum(BSTNode<T>* tree) { if (tree == nullptr) return nullptr; while (tree->left != nullptr) tree = tree->left; return tree; } template <class T> T BSTree<T>::minimum() { BSTNode<T> *p = minimum(mRoot); if (p != nullptr) return p->key; return (T)nullptr; } //查找最大节点,返回tree为根节点的二叉树的最大节点 template <class T> BSTNode<T>* BSTree<T>::maximum(BSTNode<T>* tree) { if (tree == nullptr) return nullptr; while (tree->right != nullptr) tree = tree->right; return tree; } template <class T> T BSTree<T>::maximum() { BSTNode<T>* p = maximum(mRoot); if (p != nullptr) return p->key; return (T)nullptr; } //找节点x的后继节点 template <class T> BSTNode<T>* BSTree<T>::successor(BSTNode<T>* x) { if (x->right != nullptr) return minimum(x->right); BSTNode<T>* y = x->parent; while ((y!=nullptr) && (x == y->right)) { x = y; y = y->parent; } return y; } //找节点x的前驱节点 template <class T> BSTNode<T>* BSTree<T>::predecessor(BSTNode<T>* x) { if (x->left != nullptr) return maximum(x->left); BSTNode<T>* y = x->parent; while ((y != nullptr) && (x == y->left)) { x = y; y = y->parent; } return y; } //节点插入 //说明:tree为二叉树的根节点,z为插入的节点 template <class T> void BSTree<T>::insert(BSTNode<T>* &tree, BSTNode<T>* z) { BSTNode<T>* y = nullptr; BSTNode<T>* x = tree; //查找z的插入位置 while (x != nullptr) { y = x; if (z->key < x->key) x = x->left; else x = x->right; } z->parent = y; if (y == nullptr) tree = z; else if (z->key < y->key) y->left = z; else y->right = z; } //将节点插入到二叉树中 template <class T> void BSTree<T>:: insert(T key) { BSTNode<T>* z = nullptr; //如果新建节点失败,则返回 if ((z = new BSTNode<T>(key, nullptr, nullptr, nullptr)) == nullptr) return; insert(mRoot, z); } //删除节点z,并返回被删除的节点 template <class T> BSTNode<T>* BSTree<T>::remove(BSTNode<T>* &tree, BSTNode<T>* z) { BSTNode<T>* x = nullptr; BSTNode<T>* y = nullptr; if ((z->left == nullptr) || (z->right == nullptr)) y = z; else y = successor(z); if (y->left != nullptr) x = y->left; else x = y->right; if (x != nullptr) x->parent = y->parent; if (y->parent == nullptr) tree = x; else if (y == y->parent->left) y->parent->left = x; else y->parent->right = x; if (y != z) z->key = y->key; return y; } //删除节点 template <class T> void BSTree<T>::remove(T key) { BSTNode<T>* z, *node; if ((z = search(mRoot, key)) != nullptr) if ((node = remove(mRoot, z)) != nullptr) delete node; } //销毁二叉树 template <class T> void BSTree<T>::destroy(BSTNode<T>* &tree) { if (tree == nullptr) return; if (tree->left != nullptr) return destroy(tree->left); if (tree->right != nullptr) return destroy(tree->right); delete tree; tree = nullptr; } template <class T> void BSTree<T>::destroy() { destroy(mRoot); } //打印二叉树 template <class T> void BSTree<T>::print(BSTNode<T>* tree, T key, int direction) { if (tree != nullptr) { if (direction == 0) std::cout << std::setw(2) << tree->key << " is root" << std::endl; else std::cout << std::setw(2) << tree->key << " is " << std::setw(2) << key << " 's" << std::setw(12) << (direction == 1 ? "right child" : "left child") << std::endl; print(tree->left, tree->key, -1); print(tree->right, tree->key, 1); } } template <class T> void BSTree<T>::print() { if (mRoot != nullptr) print(mRoot, mRoot->key, 0); } #endif
2da44070316524a51b7f30df2f5d8dbe1ef88781
b007b067677ad3f97949d8fe342af8603ed19aa8
/PATB1051/PATB1051/stdafx.cpp
de3606cf180655e0e02652a90838c42a66dc47c5
[]
no_license
SouthStreet/AlgTrain
9f3248ae95e5680526d8f0beb73fdd4efc656b70
4dc850cf7e5fe736aeb2ff8b4dc408a5a3ca0e8d
refs/heads/master
2021-05-14T09:42:39.037464
2018-03-18T09:35:46
2018-03-18T09:35:46
116,333,027
0
0
null
null
null
null
GB18030
C++
false
false
260
cpp
// stdafx.cpp : 只包括标准包含文件的源文件 // PATB1051.pch 将作为预编译头 // stdafx.obj 将包含预编译类型信息 #include "stdafx.h" // TODO: 在 STDAFX.H 中 // 引用任何所需的附加头文件,而不是在此文件中引用
e282837a505769994f28e73433e54bc0f6a4befa
592aa065ad0bb870f8210e1492b3764404e0c372
/src/c++/Papyrus/Papyrus.cpp
b3cd09a506438425a3a6931b989f89ac72ee5e90
[ "MIT" ]
permissive
clayne/ConsoleUtilF4
777fd00d58d9b4ca0b1a073ad8444e9e034fbc11
0939e09bbb7ff6b06f2e076d1cf12f97f24dcb44
refs/heads/main
2023-07-06T11:36:48.957086
2021-08-08T03:58:01
2021-08-08T03:58:01
366,190,499
1
1
null
null
null
null
UTF-8
C++
false
false
282
cpp
#include "Papyrus/Papyrus.h" #include "Papyrus/ConsoleUtil.h" #undef BIND namespace Papyrus { bool F4SEAPI Bind(RE::BSScript::IVirtualMachine* a_vm) { if (!a_vm) { return false; } ConsoleUtil::Bind(*a_vm); logger::debug("bound all scripts"sv); return true; } }
b8ffbc84cb974ce0d699224cd06bfaebafa79db1
7491ba12660d496f391560d10d82f5c11341ac1e
/Room-Classes/Nest.cpp
892dacd5b865a351695d87e0b05965e3a455d7dd
[]
no_license
bdcarter/BetrayalOnTheAlquacir-CPP-text-based-game
3b1148151cd49c7eff48b374b7f345bd93d240f6
181002d16798842ecc7225d8f6dd0a9a9f502038
refs/heads/master
2020-04-12T22:39:54.461554
2015-09-11T14:23:24
2015-09-11T14:23:24
41,985,951
0
0
null
null
null
null
UTF-8
C++
false
false
6,270
cpp
/******************************************************** * PROGRAM FILENAME: NEST.CPP * AUTHOR: BRIANNA CARTER * DATE: 6/5/15 * DESCRIPTION: THIS FILE IS THE IMPLEMENTATION FILE FOR THE NEST * CHILD CLASS FOR THE GAME "BETRAYAL ON THE ALQUACIR" * THIS CLASS ADDS POINTERS TO THE NAVIGATION LIST, DISPLAYS * THE LIST, DISPLAYS ROOM INFORMATION, HAS THE USER MAKE * AN OPTION FOR WHERE TO GO. * INPUT: USER'S CHOICE TO NAVIGATION * OUTPUT: ROOM DESCRIPTION, NAV OPTIONS ***********************************************************/ #include "Nest.hpp" #include <vector> #include <iostream> #include <string> #include <iomanip> /********************************************************************* ** Function: ADD ** Description: ADDS LINKS TO THE NAVIGATION STRUCT ** Parameters: 4 ROOM POINTERS ** Pre-Conditions: THE ROOM OBJECTS AND POINTERS MUST BE CREATED ** Post-Conditions: THE NAVIGATION LIST WILL BE COMPLETED *********************************************************************/ void Nest::add(Room *nn, Room *ns, Room *ne, Room *nw) { roomName = "Crow's Nest"; arrow = false; north = new linkedRoom(nn, 1); linkedRoom *ptr = north; ptr->next = new linkedRoom(ns, 2); ptr = ptr->next; ptr->next = new linkedRoom(ne, 3); ptr = ptr->next; ptr->next = new linkedRoom(nw, 4); } /********************************************************************* ** Function: DISPLAY LINKS ** Description: DISPLAYS THE NAMES OFF ALL OF THE NAV LINKS AND ** THIER DIRECTIONS ** Parameters: NONE ** Pre-Conditions: THE LINKS HAVE TO BE ADDED TO THE LIST ** Post-Conditions: NONE *********************************************************************/ void Nest::displayLinks() { linkedRoom *ptr = north; while(ptr) { if(ptr->value == 1) {std::cout << std::setw(40) << " 1. North: Nothing but endless sky" << std::endl;} else if(ptr->value == 2) {std::cout << std::setw(35) << " 2. South: " << ptr->link->getRoomName() << std::endl;} else if(ptr->value == 3) {std::cout << std::setw(40) << " 3. East: There is something over there." << std::endl;} else if(ptr ->value == 4) {std::cout << std::setw(40) << " 4. West: Not a cloud in the sky" << std::endl << std::endl;} ptr = ptr->next; } } /********************************************************************* ** Function: GET ROOM INFO ** Description: DISPLAYS THE ROOM DESCRIPTION. REPEATS WHILE THE USER ** CHOOSES TO NAVIGATE TO A LINK WITH A NULL POINTER ** Parameters: NONE ** Pre-Conditions: USER MUST NAVIGATE TO THIS ROOM ** Post-Conditions: USER MUST CHOOSE TO MOVE IN A DIRECTION IS NOT NULL *********************************************************************/ Room* Nest::getRoomInfo() { for(int x=0; x<8; x++) {std::cout << std:: endl;} std::cout<< std::setw(55) << "Crow's Nest" << std::endl << std::endl; std::cout << " It is very quiet and peaceful in the crow's nest. You can see for miles in every direction." << std::endl; std::cout << " To your left there is a piece of something that shouldn't be there." << std::endl << std::endl; std::cout << std::endl << std::endl; // HAVE THE USER CHOOSE A DIRECTION, REPEAT IF CHANGE IS NULL do{ this->chooseDirection(); }while(change == NULL); return change; } /********************************************************************* ** Function: CHOOSE DIRECTION ** Description: DISPLAY THE NAV OPTIONS, HAVE THE USER CHOOSE A DIRECTION ** POINT CHANGE TO THE USER'S CHOICE AND INDICATE MOVEMENT TO THAT ROOM ** Parameters: NONE ** Pre-Conditions: MUST BE IN THE NEST ** Post-Conditions: MUST CHOOSE A DIRECTION AND MOVE ROOMS *********************************************************************/ void Nest::chooseDirection() { std::cout << std::setw(50) << "Your choices are " << std::endl; //DISPLAY THE NAV OPTIONS displayLinks(); std::cout << std::setw(50) << "Please make a choice" << std::endl; std::cin >> move; while(move < 1 || move > 4) { std::cout << std::setw(50) << "Invalid choice. Please choose again." << std::endl; std::cin >> move; } //LOOP THROUGH THE LIST TO FIND THE USER'S CHOICE, SET THE POINTER TO THAT ELEMENT linkedRoom *ptr = north; while(ptr->next != NULL) { if(ptr->value != move) {ptr = ptr->next;} else {break;} } //INDICATE MOVEMENT TO THE NEW ROOM, SET CHANGE TO THE NEW ROOM. USER CAN ONLY // PHYSICALLY CHANGE ROOMS FROM THE CROWS NEST BY GOING SOUTH. THE OTHER THREE // DIRECTIONS ARE INTERACTIONS. if(move == 1) { std::cout << "----------------------------------------------------------------------------------------------------" << std::endl; std::cout << " The sky is cloudless and the sun is hot." << std::endl; std::cout << "----------------------------------------------------------------------------------------------------" << std::endl; std::cout << std::endl << std::endl; change = ptr-> link; } else if(move == 2) { std::cout << " Climbing down to the " << ptr->link->getRoomName() << std::endl; std::cout << std::endl << std::endl; change = ptr->link; } else if(move == 3) { std::cout << "----------------------------------------------------------------------------------------------" << std::endl; std::cout << " There is a broken arrow. What is that doing here?" << std::endl; std::cout << " I will take this and examine it. " << std::endl; std::cout << "----------------------------------------------------------------------------------------------" << std::endl << std::endl; arrow = true; change = ptr-> link; } else if(move == 4) { std::cout << "---------------------------------------------------------------------------------------------" << std::endl; std::cout << " The view is beautiful but I should keep searching." << std::endl; std::cout << "---------------------------------------------------------------------------------------------" << std::endl; std::cout << std::endl << std::endl; change = ptr-> link; } ptr = ptr->next; for(int x=0; x<8; x++) {std::cout << std:: endl;} }
d3b2ef5bc29434016ae0746ec4b39101beb0ca24
24a38beedf1f36ce49cb7615114007159e7fb1db
/unrookit/UnRootkit/UnRootkit/DriverInfoDlg.h
5ce0d451cbd598474c78ff46a39b17ee607d1491
[]
no_license
lanzheng1113/win_tools_lite
27c6a57e820b66061b3822d186fd3031e85a867d
75e5e32ada845cc7b5452880e2222bce7b63122c
refs/heads/master
2020-07-11T22:29:21.579754
2019-08-28T07:39:51
2019-08-28T07:39:51
204,657,392
0
0
null
null
null
null
UTF-8
C++
false
false
497
h
#pragma once #include "afxcmn.h" // CDriverInfoDlg dialog class CDriverInfoDlg : public CDialog { DECLARE_DYNAMIC(CDriverInfoDlg) public: CDriverInfoDlg(CWnd* pParent = NULL); // standard constructor virtual ~CDriverInfoDlg(); // Dialog Data enum { IDD = IDD_DIALOG_DRIVER_INFO }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support public: virtual BOOL OnInitDialog(); CListCtrl m_DriverListCtrl; void InitialListCtrl(); DECLARE_MESSAGE_MAP() };
6a016fa668dad356358b4a99cf949e26946ebd1e
65025edce8120ec0c601bd5e6485553697c5c132
/Engine/addons/input/win32/win32inputserver.cc
d37914fca7113778c4626d2757197029fdae5957
[ "MIT" ]
permissive
stonejiang/genesis-3d
babfc99cfc9085527dff35c7c8662d931fbb1780
df5741e7003ba8e21d21557d42f637cfe0f6133c
refs/heads/master
2020-12-25T18:22:32.752912
2013-12-13T07:45:17
2013-12-13T07:45:17
15,157,071
4
4
null
null
null
null
UTF-8
C++
false
false
2,814
cc
/**************************************************************************** Copyright (c) 2007,Radon Labs GmbH Copyright (c) 2011-2013,WebJet Business Division,CYOU http://www.genesis-3d.com.cn Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #if WIN32 #include "input/input_stdneb.h" #include "input/win32/win32inputserver.h" #include "input/inputkeyboard.h" #include "input/inputmouse.h" #include "input/inputgamepad.h" namespace Win32Input { __ImplementClass(Win32Input::Win32InputServer, 'W3IS', Input::InputServerBase); using namespace Input; //------------------------------------------------------------------------------ /** */ Win32InputServer::Win32InputServer() { } //------------------------------------------------------------------------------ /** */ Win32InputServer::~Win32InputServer() { if (this->IsOpen()) { this->Close(); } } //------------------------------------------------------------------------------ /** */ void Win32InputServer::Open() { n_assert(!this->IsOpen()); InputServerBase::Open(); this->defaultKeyboard = InputKeyboard::Create(); this->AttachInputHandler(InputPriority::Game, this->defaultKeyboard.upcast<InputHandler>()); this->defaultMouse = InputMouse::Create(); this->AttachInputHandler(InputPriority::Game, this->defaultMouse.upcast<InputHandler>()); } //------------------------------------------------------------------------------ /** */ void Win32InputServer::Close() { n_assert(this->IsOpen()); // call parent class InputServerBase::Close(); } //------------------------------------------------------------------------------ /** */ void Win32InputServer::OnFrame() { InputServerBase::OnFrame(); } } // namespace Win32Input #endif
24a110b12f5da4154c5ec34e7df7f89014b0ef5c
2f50ee4a8f8bbe7cc5328ec2349b20b20a5675f0
/solitaire/data/sound/music.inc
f377a81c4a879b71d22fd16503694ee01b5825ab
[]
no_license
ianka/uzebox-weber
016510b71f3b2ff7bb75d1bd831e4f94bf655a7d
7d80e9b6d4e7a79bbf50337942df10a98823f2df
refs/heads/master
2020-03-07T18:08:37.899009
2017-10-25T05:39:29
2017-10-25T05:39:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
189
inc
#include "stage2song.inc" #include "stage3song.inc" #include "stage4song.inc" #include "stage5song.inc" #include "stage6song.inc" //#include "stage1song.inc" #include "stage7song.inc"
1e05861d287b807ec8d65399324ea885e46c3a3c
d47788f3cdd8874728c2f6c08ecef62ab8e27670
/tools/qrestbuilder/classbuilder.h
314148534daa6c866b6c0e1864cc6ce861e8bdd6
[ "BSD-3-Clause" ]
permissive
jacky181818/QtRestClient
11ced23c72cc10d2224752b53aad321ab2def3ce
15fa04c2d7d314228c9cafa1aad54276978a00f1
refs/heads/master
2021-01-22T22:28:07.391865
2017-03-14T17:25:09
2017-03-14T17:25:09
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,348
h
#ifndef CLASSBUILDER_H #define CLASSBUILDER_H #include "restbuilder.h" class ClassBuilder : public RestBuilder { public: ClassBuilder(); private: struct MethodInfo { QString path; QString url; QString verb; QList<QPair<QString, QString>> pathParams; QList<QPair<QString, QString>> parameters; QHash<QString, QString> headers; QString body; QString returns; QString except; MethodInfo(); }; QHash<QString, QString> classes; QHash<QString, MethodInfo> methods; void build() override; QString specialPrefix() override; void generateClass(); void generateApi(); void writeClassBeginDeclaration(const QString &parent); void writeClassMainDeclaration(); void writeClassBeginDefinition(); void writeClassMainDefinition(const QString &parent); void readClasses(); void readMethods(); void generateFactoryDeclaration(); void writeFactoryDeclarations(); void writeClassDeclarations(); void writeMethodDeclarations(); void writeMemberDeclarations(); void generateFactoryDefinition(); void writeFactoryDefinitions(); void writeClassDefinitions(); void writeMethodDefinitions(); void writeMemberDefinitions(); void writeLocalApiGeneration(); void writeGlobalApiGeneration(const QString &globalName); void writeApiCreation(); bool writeMethodPath(const MethodInfo &info); }; #endif // CLASSBUILDER_H
cc938c4405331d37e6a3a10d3cb5c6cc9b63ade4
65379405e4e04178daf75ca7069061c5c603e3c1
/PAT (Basic Level) Practise/1074.cpp
9d16043e2e5a33443cf740f155d3ca941ced75bb
[]
no_license
jinxw/PAT
3ad32d414959e4c643e635dea6760ef4010af74d
03b8b910e59b99b54e662488e08b73324078b5e8
refs/heads/master
2021-01-01T16:24:21.246679
2018-02-28T06:27:45
2018-02-28T06:27:45
97,828,263
1
0
null
null
null
null
UTF-8
C++
false
false
1,500
cpp
#include <iostream> #include <string> #include <vector> #include <cmath> #include <cstdlib> std::vector<int> s2v(std::string &s); int main(){ std::string s,s1,s2; std::cin>>s>>s1>>s2; auto jinzhi = s2v(s); auto a = s2v(s1); auto b = s2v(s2); std::string result; int t1,t2; int jinwei = 0; for(std::size_t pos=0;pos<jinzhi.size();++pos){ if(pos<a.size()){ t1 = a[pos]; }else{ t1 = 0; } if(pos<b.size()){ t2 = b[pos]; }else{ t2 = 0; } int recent_jinzhi = jinzhi[pos]==0 ? 10 : jinzhi[pos]; int sum = t1+t2+jinwei; if(sum>=recent_jinzhi){ jinwei = 1; sum -= recent_jinzhi; }else{ jinwei = 0; } result.insert(result.begin(),'0'+sum); } if(jinwei == 1){ result.insert(result.begin(),'1'); } //std::cout<<atoi(result.c_str())<<std::endl; for(auto it=result.begin();it!=result.end();){ if(*it == '0'){ it = result.erase(it); }else{ break; } } if(result.size() == 0){ std::cout<<"0"<<std::endl; //#5 }else{ std::cout<<result<<std::endl; } return 0; } std::vector<int> s2v(std::string &s){ std::vector<int> v; for(auto it=s.crbegin();it!=s.crend();++it){ v.push_back(*it-'0'); } return v; }
c69f18840a28d538fa4658c7e9e9a2e8158ec296
5d60c1a4a769b4911791c07297ab4e60b1fb9f04
/Algos/Algos/Utils.h
c043b1dbf6f906e34df391d2ce49502f431ed9d1
[]
no_license
alernerdev/CPlusPlus
ec39a1d02c04b6b4347bb43a9f66a75f763b80d8
27d184ffbb966ae6f276a26b4586e07a55bb3153
refs/heads/master
2020-03-27T06:27:16.717179
2018-09-22T16:10:27
2018-09-22T16:10:27
146,107,197
0
0
null
null
null
null
UTF-8
C++
false
false
133
h
#pragma once class Utils { public: static void Swap(int arr[], int i1, int i2); static void PrintArray(int arr[], int length); };
6d3f8aee4b4fc8c20dba018aa56968ceebe8e275
17a3c43f58a7ce220dcfae7f6929a8f6f3f3312e
/Week 7/Solutions/task0-1.cpp
5bb3ee5efd69f12fa6b9b92ca3cd58f30251581d
[]
no_license
natigeorgieva/SDP-2020
c609f1e67d94dc371a8b794467dd5494a6f8f9e5
8773b94d3b2cd5e607ea4f7228b1ef5e4d44160a
refs/heads/master
2021-01-13T19:56:09.137443
2020-08-26T13:00:39
2020-08-26T13:00:39
242,477,788
2
3
null
null
null
null
UTF-8
C++
false
false
2,607
cpp
#include <iostream> #include <stack> /** Функция, която по подадена РЕФЕРЕНЦИЯ към стек от цели числа въвежда в нея числа от клавиатурата докато не достигне 0 @param[in] st референция към стек от цели числа */ void inputStack(std::stack<int>& st) { int input; ///Променливата, в която ще помним текущото въведено число от клавиатурата ///Правим безкраен цикъл. Логиката, която ще го прекъсне, ще е в цикъла! while (1) { std::cin >> input; if (input == 0) { break; } st.push(input); /// "Слагаме" текущата стойност на върха на стака } } /** Функция, която по подадено КОПИЕ на стек от цели числа изписва елементите на стека от най-горен към най-долен @param[in] st стека от цели числа, който принтираме */ void printStack(std::stack<int>& st) { ///Докато стека не е празен while (st.size() != 0) { std::cout << st.top() << " "; ///Изписваме най-горната стойност st.pop(); ///И след това я трием } std::cout << '\n'; } /** Функция, която изпълнява изискваната логика от задачата @param[in] st стека, който ще сортираме в другите два @paramp[in] odd, even референции към два стека, в които съответно ще сортираме */ void sortMod2(std::stack<int> st, std::stack<int>& odd, std::stack<int>& even) { ///Докато в подадения стек за сортирана има елементи while (st.size() != 0) { ///Определяме в кой от двата стека ще слагаме най-горния елемент на st if (st.top() % 2) { odd.push(st.top()); ///Слагаме най-горната стойност от стека st в стека odd } else { even.push(st.top()); ///Аналогично } st.pop(); ///Премахваме най-горния елемент на st } } int main() { std::stack<int> input_stack, odd_stack, even_stack; inputStack(input_stack); sortMod2(input_stack, odd_stack, even_stack); std::cout << "Odd: "; printStack(odd_stack); std::cout << "Even: "; printStack(even_stack); }
01ad3f77bf457710b7ffd98d67a51c96d4194793
2a97edfe46531937f6856d3d8441851c89d4f7d9
/code/emulator/vm_lambdaman.cc
3a58db2c12c8fed4c021d15b791e93c5f1cf43b0
[]
no_license
tzik/icfpc-2014-public
66cd66600701abf8d152a08455f6b948777585e9
de95fb770b72219c1a38a31fd6808b7417835383
refs/heads/master
2021-01-19T13:46:28.970766
2014-07-30T05:42:02
2014-07-30T05:42:02
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,925
cc
#include "vm_lambdaman.h" #include <iostream> #include <cassert> #include <map> #include "game.h" #include "ghost.h" namespace game { namespace { const int kInstructionPerSecond = 3072000; } // namespace VMLambdaMan::VMLambdaMan(std::istream& src) { program = gcc::LoadProgram(src); } VMLambdaMan::~VMLambdaMan() { } void VMLambdaMan::Initialize(game::Game* game, const Pos& pos) { LambdaMan::Initialize(game, pos); int time_limit = 60 * kInstructionPerSecond; vm.environment = std::make_shared<gcc::Frame>(2, nullptr); vm.environment->values[0] = EncodeWorld(); vm.environment->values[1] = gcc::WrapToValue(0); try { for (int i = 0; i < time_limit && vm.is_running; ++i) vm.Step(program); } catch (...) { vm.Dump(std::cerr); std::cerr << std::dec << vm.program_counter << "\n"; throw; } if (vm.is_running) throw TimeLimitExceeded(); gcc::ValueRef res = vm.PopFromDataStack(); gcc::ConsValue* cons = res->AsCons(); ai_state = std::move(cons->car); step = std::move(cons->cdr); } int VMLambdaMan::Think() { vm.PushToDataStack(std::move(ai_state)); vm.PushToDataStack(EncodeWorld()); vm.PushToDataStack(step); vm.is_running = true; vm.AP(2); int time_limit = 1 * kInstructionPerSecond; std::cerr << "HERE\n"; try { for (int i = 0; i < time_limit && vm.is_running; ++i) vm.Step(program); } catch (...) { vm.Dump(std::cerr); std::cerr << std::dec << vm.program_counter << "\n"; throw; } gcc::ValueRef res = vm.PopFromDataStack(); gcc::ConsValue* cons = res->AsCons(); ai_state = std::move(cons->car); int decision = cons->cdr->AsInteger()->value; ResetVM(); return decision; } void VMLambdaMan::ResetVM() { std::vector<gcc::ValueRef> extra_root_set; extra_root_set.push_back(ai_state); extra_root_set.push_back(step); vm.data_stack.clear(); vm.control_stack.clear(); vm.environment = nullptr; vm.program_counter = 0; vm.GC(&extra_root_set); } gcc::ValueRef VMLambdaMan::EncodeWorld() const { return gcc::MakeTuple(EncodeMap(), EncodeLambdaManState(), EncodeGhostState(), EncodeFruitState()); } gcc::ValueRef VMLambdaMan::EncodeMap() const { gcc::ValueRef result = gcc::MakeList(); std::map<Pos, int> pt_override; for (auto&& fruits : game->map->fruits) pt_override[fruits] = 4; pt_override[game->map->initial_lambda_man] = 5; for (auto&& initial_ghost : game->map->initial_ghosts) pt_override[initial_ghost] = 6; for (int y = game->map->GetHeight() - 1; y >= 0; --y) { gcc::ValueRef row = gcc::MakeList(); for (int x = game->map->GetWidth() - 1; x >= 0; --x) { gcc::integer cell_value = 1; // empty. switch (game->map->map[y][x]) { case Map::INVALID: case Map::LAMBDA_MAN: case Map::GHOST: // Lambda-Man and Ghost should not be on the map. // Handle them separately. assert(false); // fall through case Map::EMPTY: cell_value = 1; break; case Map::WALL: cell_value = 0; break; case Map::PILL: cell_value = 2; break; case Map::POWER_PILL: cell_value = 3; break; case Map::FRUIT: cell_value = 4; break; } auto found = pt_override.find(Pos(x, y)); if (found != pt_override.end()) cell_value = found->second; row = gcc::MakePair(cell_value, std::move(row)); } result = gcc::MakePair(std::move(row), std::move(result)); } return result; } gcc::ValueRef VMLambdaMan::EncodeLambdaManState() const { gcc::integer vitality = 0; if (IsFrightMode()) vitality = game->GetRemainingFrightModeTick(); return gcc::MakeTuple(vitality, gcc::MakePair(pos.x, pos.y), direction, num_lives, score); } gcc::ValueRef VMLambdaMan::EncodeGhostState() const { gcc::ValueRef result = gcc::MakeList(); for (auto iter = game->ghosts.rbegin(); iter != game->ghosts.rend(); ++iter) { auto&& ghost = *iter; gcc::integer vitality = 0; // standard if (ghost->IsInvisibleMode()) vitality = 2; else if (game->IsFrightMode()) vitality = 1; result = gcc::MakePair( gcc::MakeTuple(vitality, gcc::MakePair(ghost->pos.x, ghost->pos.y), ghost->direction), std::move(result)); } return result; } gcc::ValueRef VMLambdaMan::EncodeFruitState() const { gcc::integer result_value = 0; if (game->map->has_fruit) { if (game->utc <= 127 * 280) result_value = 127 * 280 - game->utc; else if (game->utc <= 127 * 480) result_value = 127 * 280 - game->utc; } return gcc::WrapToValue(result_value); } } // namespace game
05031ec07d2d6d314cc5e3eee936a4dcb431633f
be4f963636336cb75d5399ca8b22b6bab77b8c99
/src/client/tank_rf433.ino
559b8efab7d4018ced30272d3854b456d42d82a7
[ "MIT" ]
permissive
ahmadtantowi/RCSyot
1652837549af38cbe473553f6efdfbdb3d4c85d0
9d87e32cf168f8abb12593ad4ac3f5abaca70f98
refs/heads/master
2023-07-04T07:37:38.864928
2021-08-09T02:35:19
2021-08-09T02:35:19
389,246,328
0
0
null
null
null
null
UTF-8
C++
false
false
5,513
ino
#include <RH_ASK.h> #include <SPI.h> #include <MX1508.h> #include <melody.h> // uncomment to enable print out debug to uart // #define COM_DEBUG // RF433 pin #define RF_SPEED 2000 #define RF_RX 4 #define RF_TX 7 #define RF_PTT 8 // MX1508 pin #define MOTOR_A1 11 #define MOTOR_A2 6 #define MOTOR_B1 3 #define MOTOR_B2 5 // buzzer pin #define BUZZER 2 // PS 2 controller button #define PSB_SELECT 0x0001 #define PSB_L3 0x0002 #define PSB_R3 0x0004 #define PSB_START 0x0008 #define PSB_PAD_UP 0x0010 #define PSB_PAD_RIGHT 0x0020 #define PSB_PAD_DOWN 0x0040 #define PSB_PAD_LEFT 0x0080 #define PSB_L2 0x0100 #define PSB_R2 0x0200 #define PSB_L1 0x0400 #define PSB_R1 0x0800 #define PSB_GREEN 0x1000 #define PSB_RED 0x2000 #define PSB_BLUE 0x4000 #define PSB_PINK 0x8000 #define PSB_TRIANGLE 0x1000 #define PSB_CIRCLE 0x2000 #define PSB_CROSS 0x4000 #define PSB_SQUARE 0x8000 // data type to hold PS 2 value struct PS2_DATA { unsigned int Button; byte Left_X; byte Left_Y; byte Right_Y; byte Right_X; }; const int _min_pwm = 40; const int _max_pwm = 1023; const int _press_fx_duration = 25; const int _freq_fx_up = 500; const int _freq_fx_down = 250; RH_ASK _rf_driver(RF_SPEED, RF_RX, RF_TX, RF_PTT); MX1508 _motor_a(MOTOR_A1, MOTOR_A2, FAST_DECAY, PWM_2PIN); MX1508 _motor_b(MOTOR_B1, MOTOR_B2, FAST_DECAY, PWM_2PIN); melody _melody(BUZZER); PS2_DATA *_ps2_data; int _current_pwm = 100; boolean _en_turn_rotate = false; void setup() { #ifdef COM_DEBUG Serial.begin(57600); #endif if (_rf_driver.init()) { tone(BUZZER, 500, 100); } } void loop() { uint8_t buf[RH_ASK_MAX_MESSAGE_LEN]; uint8_t buflen = sizeof(buf); if (_rf_driver.recv(buf, &buflen)) { _ps2_data = (PS2_DATA *)buf; #ifdef COM_DEBUG Serial.print(_ps2_data->Button, HEX); Serial.print(" : "); Serial.print(_ps2_data->Left_X, HEX); Serial.print(" : "); Serial.print(_ps2_data->Left_Y, HEX); Serial.print(" : "); Serial.print(_ps2_data->Right_X, HEX); Serial.print(" : "); Serial.print(_ps2_data->Right_Y, HEX); Serial.println(); #endif // drive left motor with left analog if (_ps2_data->Left_Y != 0x7B) { int left_analog = map(_ps2_data->Left_Y, 0, 255, _current_pwm, -_current_pwm); _motor_a.motorGo(left_analog); } else { _motor_a.stopMotor(); } // drive right motor with right analog if (_ps2_data->Right_Y != 0x7B) { int right_analog = map(_ps2_data->Right_Y, 0, 255, _current_pwm, -_current_pwm); _motor_b.motorGo(right_analog); } else { _motor_b.stopMotor(); } // do something based on pressed button if (_ps2_data->Button != 0x00) { // drive with dpad if (IsPressed(PSB_PAD_UP)) { _motor_a.motorGo(_current_pwm); _motor_b.motorGo(_current_pwm); } else if (IsPressed(PSB_PAD_DOWN)) { _motor_a.motorGo(-_current_pwm); _motor_b.motorGo(-_current_pwm); } else if (IsPressed(PSB_PAD_LEFT)) { _motor_b.motorGo(_current_pwm); if (_en_turn_rotate) { _motor_a.motorGo(-_current_pwm); } } else if (IsPressed(PSB_PAD_RIGHT)) { _motor_a.motorGo(_current_pwm); if (_en_turn_rotate) { _motor_b.motorGo(-_current_pwm); } } // stop when square pressed if (IsPressed(PSB_SQUARE)) { _motor_a.stopMotor(); _motor_b.stopMotor(); } // enable/disable turn with rotatation (both motor turn opposite) else if (IsPressed(PSB_CIRCLE)) { _en_turn_rotate = !_en_turn_rotate; tone(BUZZER, _en_turn_rotate ? _freq_fx_up : _freq_fx_down, _press_fx_duration); delay(_press_fx_duration * 2); } // decrease pwm speed with L1 else if (IsPressed(PSB_L1) && _current_pwm > _min_pwm) { _current_pwm -= 5; tone(BUZZER, _freq_fx_down, _press_fx_duration); } // increase pwm speed with R1 else if (IsPressed(PSB_R1) && _current_pwm < _max_pwm) { _current_pwm += 5; tone(BUZZER, _freq_fx_up, _press_fx_duration); } // play melody when start button pressed if (IsPressed(PSB_START)) { _motor_a.stopMotor(); _motor_b.stopMotor(); _melody.play(); } // change melody playlist when select button pressed else if (IsPressed(PSB_SELECT)) { int playlist = _melody.next(); for (size_t i = 0; i < playlist; i++) { tone(BUZZER, _freq_fx_up, _press_fx_duration * 2); delay(_press_fx_duration * 4); } tone(BUZZER, _freq_fx_down, _press_fx_duration); delay(_press_fx_duration * 20); } } } } boolean IsPressed(uint16_t ps2_button) { return ((_ps2_data->Button & ps2_button) > 0); }
aa32040a629bee1276330d98338f7dc2294f3e01
1ff1dc403b7ed9897dc0421718ea79ee7d2fcb48
/2018.10/强制类型转换.cpp
e78cd6cecaa8058e7120a99b303e596f35a26030
[]
no_license
mowangblog/C-Demo
46d184e942ec26c6066ef04d3378c0bb441ed32f
e58a1808d55c7022fc97f5f48be96eec9bb3e37b
refs/heads/main
2023-07-25T12:05:53.301735
2021-09-03T04:13:03
2021-09-03T04:13:03
null
0
0
null
null
null
null
GB18030
C++
false
false
304
cpp
# include <stdio.h> int main(void) { int i; float sum = 0; for(i=1;i<=100;++i) sum=sum+1.0/i; //推荐的写法 //sum=sum+(float)(1/i); 这是不对的 //sum=sum+1/(float)(i); 不推荐 printf("sum=%f",sum); return 0; } /* 该程序求1+1/2+1/3+1/4.....+1/100的值 */
6bd6200e90a3da4076cb0e645568fc3fde8082b7
b1c2c497805c89f97dc945eeb8e132bfb610ca75
/c.cpp
c3c39805a583dd9b91086bd74aa03c3fc854a88d
[]
no_license
rosen1997/USP
4b5c72e128f07c92f4e48e48b39ab0abb74a7ec9
ebeb6def9ee53ba89ec762856a3107721acb88c5
refs/heads/master
2020-04-21T08:52:33.986339
2019-04-03T10:41:31
2019-04-03T10:41:31
169,431,967
0
0
null
2019-03-28T20:13:16
2019-02-06T15:54:52
C#
UTF-8
C++
false
false
10
cpp
class c {}
cd5a08a0b6715d9755d3a0b03fe11742e5d9b390
b0496980a13ad8253c3588ae2a0df9282531d927
/media/libstagefright/wifi-display/sink/LinearRegression.cpp
ef499b7d0197b9cae85c5d80fa7bf1b22f7951ca
[]
no_license
weimingtom/TL51Code.
e6a0c2e5af1dd2e38cd781bba53c87c850143734
6999ee79883e952c3bed951e5b456a9fbfc5214c
refs/heads/master
2020-03-30T21:49:01.542675
2018-09-11T08:42:38
2018-09-11T08:42:38
151,643,127
0
1
null
null
null
null
UTF-8
C++
false
false
2,812
cpp
/* * Copyright 2012, The Android Open Source Project * * 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. */ //#define LOG_NDEBUG 0 #define LOG_TAG "LinearRegression" #include <utils/Log.h> #include "LinearRegression.h" #include <math.h> #include <string.h> namespace android { LinearRegression::LinearRegression(size_t historySize) : mHistorySize(historySize), mCount(0), mHistory(new Point[mHistorySize]), mSumX(0.0), mSumY(0.0) { } LinearRegression::~LinearRegression() { delete[] mHistory; mHistory = NULL; } void LinearRegression::addPoint(float x, float y) { if (mCount == mHistorySize) { const Point &oldest = mHistory[0]; mSumX -= oldest.mX; mSumY -= oldest.mY; memmove(&mHistory[0], &mHistory[1], (mHistorySize - 1) * sizeof(Point)); --mCount; } Point *newest = &mHistory[mCount++]; newest->mX = x; newest->mY = y; mSumX += x; mSumY += y; } bool LinearRegression::approxLine(float *n1, float *n2, float *b) const { static const float kEpsilon = 1.0E-4; if (mCount < 2) { return false; } float sumX2 = 0.0f; float sumY2 = 0.0f; float sumXY = 0.0f; float meanX = mSumX / (float)mCount; float meanY = mSumY / (float)mCount; for (size_t i = 0; i < mCount; ++i) { const Point &p = mHistory[i]; float x = p.mX - meanX; float y = p.mY - meanY; sumX2 += x * x; sumY2 += y * y; sumXY += x * y; } float T = sumX2 + sumY2; float D = sumX2 * sumY2 - sumXY * sumXY; float root = sqrt(T * T * 0.25 - D); float L1 = T * 0.5 - root; if (fabs(sumXY) > kEpsilon) { *n1 = 1.0; *n2 = (2.0 * L1 - sumX2) / sumXY; float mag = sqrt((*n1) * (*n1) + (*n2) * (*n2)); *n1 /= mag; *n2 /= mag; } else { *n1 = 0.0; *n2 = 1.0; } *b = (*n1) * meanX + (*n2) * meanY; return true; } } // namespace android
c52b6717c846185e11171a000cd39896487281db
13e11e1019914694d202b4acc20ea1ff14345159
/Back-end/ParseLogFramework/src/mongo/client/dbclient_rs.h
9c6d191b12f15c72c71efb5c707d31691c0e6556
[ "Apache-2.0" ]
permissive
lee-novobi/Frameworks
e5ef6afdf866bb119e41f5a627e695a89c561703
016efe98a42e0b6a8ee09feea08aa52343bb90e4
refs/heads/master
2021-05-28T19:03:02.806782
2014-07-19T09:14:48
2014-07-19T09:14:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
27,073
h
/** @file dbclient_rs.h Connect to a Replica Set, from C++ */ /* Copyright 2009 10gen Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include "mongo/pch.h" #include <boost/function.hpp> #include <boost/shared_ptr.hpp> #include <set> #include <utility> #include "mongo/client/dbclientinterface.h" #include "mongo/util/net/hostandport.h" namespace mongo { class ReplicaSetMonitor; class TagSet; struct ReadPreferenceSetting; typedef shared_ptr<ReplicaSetMonitor> ReplicaSetMonitorPtr; typedef pair<set<string>,set<int> > NodeDiff; /** * manages state about a replica set for client * keeps tabs on whose master and what slaves are up * can hand a slave to someone for SLAVE_OK * one instance per process per replica set * TODO: we might be able to use a regular Node * to avoid _lock */ class ReplicaSetMonitor { public: typedef boost::function1<void,const ReplicaSetMonitor*> ConfigChangeHook; /** * Data structure for keeping track of the states of individual replica * members. This class is not thread-safe so proper measures should be taken * when sharing this object across multiple threads. * * Note: these get copied around in the nodes vector so be sure to maintain * copyable semantics here */ struct Node { Node( const HostAndPort& a , DBClientConnection* c ) : addr( a ), conn(c), ok( c != NULL ), ismaster(false), secondary( false ), hidden( false ), pingTimeMillis( 0 ) { } bool okForSecondaryQueries() const { return ok && secondary && ! hidden; } /** * Checks if the given tag matches the tag attached to this node. * * Example: * * Tag of this node: { "dc": "nyc", "region": "na", "rack": "4" } * * match: {} * match: { "dc": "nyc", "rack": 4 } * match: { "region": "na", "dc": "nyc" } * not match: { "dc: "nyc", "rack": 2 } * not match: { "dc": "sf" } * * @param tag the tag to use to compare. Should not contain any * embedded documents. * * @return true if the given tag matches the this node's tag * specification */ bool matchesTag(const BSONObj& tag) const; /** * @param threshold max ping time (in ms) to be considered local * @return true if node is a local secondary, and can handle queries **/ bool isLocalSecondary( const int threshold ) const { return pingTimeMillis < threshold; } /** * Checks whether this nodes is compatible with the given readPreference and * tag. Compatibility check is strict in the sense that secondary preferred * is treated like secondary only and primary preferred is treated like * primary only. * * @return true if this node is compatible with the read preference and tags. */ bool isCompatible(ReadPreference readPreference, const TagSet* tag) const; BSONObj toBSON() const; string toString() const { return toBSON().toString(); } HostAndPort addr; boost::shared_ptr<DBClientConnection> conn; // if this node is in a failure state // used for slave routing // this is too simple, should make it better bool ok; // as reported by ismaster BSONObj lastIsMaster; bool ismaster; bool secondary; bool hidden; int pingTimeMillis; }; static const double SOCKET_TIMEOUT_SECS; /** * Selects the right node given the nodes to pick from and the preference. * * @param nodes the nodes to select from * @param preference the read mode to use * @param tags the tags used for filtering nodes * @param localThresholdMillis the exclusive upper bound of ping time to be * considered as a local node. Local nodes are favored over non-local * nodes if multiple nodes matches the other criteria. * @param lastHost the host used in the last successful request. This is used for * selecting a different node as much as possible, by doing a simple round * robin, starting from the node next to this lastHost. This will be overwritten * with the newly chosen host if not empty, not primary and when preference * is not Nearest. * @param isPrimarySelected out parameter that is set to true if the returned host * is a primary. Cannot be NULL and valid only if returned host is not empty. * * @return the host object of the node selected. If none of the nodes are * eligible, returns an empty host. */ static HostAndPort selectNode(const std::vector<Node>& nodes, ReadPreference preference, TagSet* tags, int localThresholdMillis, HostAndPort* lastHost, bool* isPrimarySelected); /** * Selects the right node given the nodes to pick from and the preference. This * will also attempt to refresh the local view of the replica set configuration * if the primary node needs to be returned but is not currently available (except * for ReadPrefrence_Nearest). * * @param preference the read mode to use. * @param tags the tags used for filtering nodes. * @param isPrimarySelected out parameter that is set to true if the returned host * is a primary. Cannot be NULL and valid only if returned host is not empty. * * @return the host object of the node selected. If none of the nodes are * eligible, returns an empty host. */ HostAndPort selectAndCheckNode(ReadPreference preference, TagSet* tags, bool* isPrimarySelected); /** * Creates a new ReplicaSetMonitor, if it doesn't already exist. */ static void createIfNeeded( const string& name , const vector<HostAndPort>& servers ); /** * gets a cached Monitor per name. If the monitor is not found and createFromSeed is false, * it will return none. If createFromSeed is true, it will try to look up the last known * servers list for this set and will create a new monitor using that as the seed list. */ static ReplicaSetMonitorPtr get( const string& name, const bool createFromSeed = false ); /** * Populates activeSets with all the currently tracked replica set names. */ static void getAllTrackedSets(set<string>* activeSets); /** * checks all sets for current master and new secondaries * usually only called from a BackgroundJob */ static void checkAll(); /** * Removes the ReplicaSetMonitor for the given set name from _sets, which will delete it. * If clearSeedCache is true, then the cached seed string for this Replica Set will be removed * from _seedServers. */ static void remove( const string& name, bool clearSeedCache = false ); static int getMaxFailedChecks() { return _maxFailedChecks; }; static void setMaxFailedChecks(int numChecks) { _maxFailedChecks = numChecks; }; /** * this is called whenever the config of any replica set changes * currently only 1 globally * asserts if one already exists * ownership passes to ReplicaSetMonitor and the hook will actually never be deleted */ static void setConfigChangeHook( ConfigChangeHook hook ); ~ReplicaSetMonitor(); /** @return HostAndPort or throws an exception */ HostAndPort getMaster(); /** * notify the monitor that server has faild */ void notifyFailure( const HostAndPort& server ); /** * @deprecated use #getCandidateNode instead * @return prev if its still ok, and if not returns a random slave that is ok for reads */ HostAndPort getSlave( const HostAndPort& prev ); /** * @param preferLocal Prefer a local secondary, otherwise pick any * secondary, or fall back to primary * @return a random slave that is ok for reads */ HostAndPort getSlave( bool preferLocal = true ); /** * notify the monitor that server has faild */ void notifySlaveFailure( const HostAndPort& server ); /** * checks for current master and new secondaries */ void check(); string getName() const { return _name; } string getServerAddress() const; bool contains( const string& server ) const; void appendInfo( BSONObjBuilder& b ) const; /** * Set the threshold value (in ms) for a node to be considered local. * NOTE: This function acquires the _lock mutex. **/ void setLocalThresholdMillis( const int millis ); /** * @return true if the host is compatible with the given readPreference and tag set. */ bool isHostCompatible(const HostAndPort& host, ReadPreference readPreference, const TagSet* tagSet) const; /** * Performs a quick check if at least one node is up based on the cached * view of the set. * * @return true if any node is ok */ bool isAnyNodeOk() const; private: /** * This populates a list of hosts from the list of seeds (discarding the * seed list). Should only be called from within _setsLock. * @param name set name * @param servers seeds */ ReplicaSetMonitor( const string& name , const vector<HostAndPort>& servers ); static void _remove_inlock( const string& name, bool clearSeedCache = false ); /** * Checks all connections from the host list and sets the current * master. */ void _check(); /** * Add array of hosts to host list. Doesn't do anything if hosts are * already in host list. * @param hostList the list of hosts to add * @param changed if new hosts were added */ void _checkHosts(const BSONObj& hostList, bool& changed); /** * Updates host list. * Invariant: if nodesOffset is >= 0, _nodes[nodesOffset].conn should be * equal to conn. * * @param conn the connection to check * @param maybePrimary OUT * @param verbose * @param nodesOffset - offset into _nodes array, -1 for not in it * * @return true if the connection is good or false if invariant * is broken */ bool _checkConnection( DBClientConnection* conn, string& maybePrimary, bool verbose, int nodesOffset ); /** * Save the seed list for the current set into the _seedServers map * Should only be called if you're already holding _setsLock and this * monitor's _lock. */ void _cacheServerAddresses_inlock(); string _getServerAddress_inlock() const; NodeDiff _getHostDiff_inlock( const BSONObj& hostList ); bool _shouldChangeHosts( const BSONObj& hostList, bool inlock ); /** * @return the index to _nodes corresponding to the server address. */ int _find( const string& server ) const ; int _find_inlock( const string& server ) const ; /** * Checks whether the given connection matches the connection stored in _nodes. * Mainly used for sanity checking to confirm that nodeOffset still * refers to the right connection after releasing and reacquiring * a mutex. */ bool _checkConnMatch_inlock( DBClientConnection* conn, size_t nodeOffset ) const; /** * Populates the local view of the set using the list of servers. * * Invariants: * 1. Should be called while holding _setsLock and while not holding _lock since * this calls #_checkConnection, which locks _checkConnectionLock * 2. _nodes should be empty before this is called */ void _populateHosts_inSetsLock(const std::vector<HostAndPort>& seedList); // protects _localThresholdMillis, _nodes and refs to _nodes // (eg. _master & _lastReadPrefHost) mutable mongo::mutex _lock; /** * "Synchronizes" the _checkConnection method. Should ideally be one mutex per * connection object being used. The purpose of this lock is to make sure that * the reply from the connection the lock holder got is the actual response * to what it sent. * * Deadlock WARNING: never acquire this while holding _lock */ mutable mongo::mutex _checkConnectionLock; string _name; /** * Host list. */ std::vector<Node> _nodes; int _master; // which node is the current master. -1 means no master is known int _nextSlave; // which node is the current slave, only used by the deprecated getSlave // last host returned by _selectNode, used for round robin selection HostAndPort _lastReadPrefHost; // The number of consecutive times the set has been checked and every member in the set was down. int _failedChecks; static mongo::mutex _setsLock; // protects _seedServers and _sets // set name to seed list. // Used to rebuild the monitor if it is cleaned up but then the set is accessed again. static map<string, vector<HostAndPort> > _seedServers; static map<string, ReplicaSetMonitorPtr> _sets; // set name to Monitor static ConfigChangeHook _hook; int _localThresholdMillis; // local ping latency threshold (protected by _lock) static int _maxFailedChecks; }; /** Use this class to connect to a replica set of servers. The class will manage checking for which server in a replica set is master, and do failover automatically. This can also be used to connect to replica pairs since pairs are a subset of sets On a failover situation, expect at least one operation to return an error (throw an exception) before the failover is complete. Operations are not retried. */ class DBClientReplicaSet : public DBClientBase { public: using DBClientBase::query; using DBClientBase::update; using DBClientBase::remove; /** Call connect() after constructing. autoReconnect is always on for DBClientReplicaSet connections. */ DBClientReplicaSet( const string& name , const vector<HostAndPort>& servers, double so_timeout=0 ); virtual ~DBClientReplicaSet(); /** * Returns false if no member of the set were reachable. This object * can still be used even when false was returned as it will try to * reconnect when you use it later. */ bool connect(); /** * Logs out the connection for the given database. * * @param dbname the database to logout from. * @param info the result object for the logout command (provided for backwards * compatibility with mongo shell) */ virtual void logout(const string& dbname, BSONObj& info); // ----------- simple functions -------------- /** throws userassertion "no master found" */ virtual auto_ptr<DBClientCursor> query(const string &ns, Query query, int nToReturn = 0, int nToSkip = 0, const BSONObj *fieldsToReturn = 0, int queryOptions = 0 , int batchSize = 0 ); /** throws userassertion "no master found" */ virtual BSONObj findOne(const string &ns, const Query& query, const BSONObj *fieldsToReturn = 0, int queryOptions = 0); virtual void insert( const string &ns , BSONObj obj , int flags=0); /** insert multiple objects. Note that single object insert is asynchronous, so this version is only nominally faster and not worth a special effort to try to use. */ virtual void insert( const string &ns, const vector< BSONObj >& v , int flags=0); virtual void remove( const string &ns , Query obj , int flags ); virtual void update( const string &ns , Query query , BSONObj obj , int flags ); virtual void killCursor( long long cursorID ); // ---- access raw connections ---- /** * WARNING: this method is very dangerous - this object can decide to free the * returned master connection any time. * * @return the reference to the address that points to the master connection. */ DBClientConnection& masterConn(); /** * WARNING: this method is very dangerous - this object can decide to free the * returned master connection any time. This can also unpin the cached * slaveOk/read preference connection. * * @return the reference to the address that points to a secondary connection. */ DBClientConnection& slaveConn(); // ---- callback pieces ------- virtual void say( Message &toSend, bool isRetry = false , string* actualServer = 0); virtual bool recv( Message &toRecv ); virtual void checkResponse( const char* data, int nReturned, bool* retry = NULL, string* targetHost = NULL ); /* this is the callback from our underlying connections to notify us that we got a "not master" error. */ void isntMaster(); /* this is used to indicate we got a "not master or secondary" error from a secondary. */ void isntSecondary(); // ----- status ------ virtual bool isFailed() const { return ! _master || _master->isFailed(); } bool isStillConnected(); // ----- informational ---- double getSoTimeout() const { return _so_timeout; } string toString() { return getServerAddress(); } string getServerAddress() const; virtual ConnectionString::ConnectionType type() const { return ConnectionString::SET; } virtual bool lazySupported() const { return true; } // ---- low level ------ virtual bool call( Message &toSend, Message &response, bool assertOk=true , string * actualServer = 0 ); virtual bool callRead( Message& toSend , Message& response ) { return checkMaster()->callRead( toSend , response ); } protected: /** Authorize. Authorizes all nodes as needed */ virtual void _auth(const BSONObj& params); virtual void sayPiggyBack( Message &toSend ) { checkMaster()->say( toSend ); } private: /** * Used to simplify slave-handling logic on errors * * @return back the passed cursor * @throws DBException if the directed node cannot accept the query because it * is not a master */ auto_ptr<DBClientCursor> checkSlaveQueryResult( auto_ptr<DBClientCursor> result ); DBClientConnection * checkMaster(); /** * Helper method for selecting a node based on the read preference. Will advance * the tag tags object if it cannot find a node that matches the current tag. * * @param readPref the preference to use for selecting a node. * * @return a pointer to the new connection object if it can find a good connection. * Otherwise it returns NULL. * * @throws DBException when an error occurred either when trying to connect to * a node that was thought to be ok or when an assertion happened. */ DBClientConnection* selectNodeUsingTags(shared_ptr<ReadPreferenceSetting> readPref); /** * @return true if the last host used in the last slaveOk query is still in the * set and can be used for the given read preference. */ bool checkLastHost(const ReadPreferenceSetting* readPref); /** * Destroys all cached information about the last slaveOk operation. */ void invalidateLastSlaveOkCache(); void _auth( DBClientConnection * conn ); /** * Maximum number of retries to make for auto-retry logic when performing a slave ok * operation. */ static const size_t MAX_RETRY; // Throws a DBException if the monitor doesn't exist and there isn't a cached seed to use. ReplicaSetMonitorPtr _getMonitor() const; string _setName; HostAndPort _masterHost; // Note: reason why this is a shared_ptr is because we want _lastSlaveOkConn to // keep a reference of the _master connection when it selected a primary node. // This is because the primary connection is special in mongos - it is the only // connection that is versioned. // WARNING: do not assign this variable (which will increment the internal ref // counter) to any other variable other than _lastSlaveOkConn. boost::shared_ptr<DBClientConnection> _master; // Last used host in a slaveOk query (can be a primary) HostAndPort _lastSlaveOkHost; // Last used connection in a slaveOk query (can be a primary) boost::shared_ptr<DBClientConnection> _lastSlaveOkConn; boost::shared_ptr<ReadPreferenceSetting> _lastReadPref; double _so_timeout; // we need to store so that when we connect to a new node on failure // we can re-auth // this could be a security issue, as the password is stored in memory // not sure if/how we should handle std::map<string, BSONObj> _auths; // dbName -> auth parameters protected: /** * for storing (non-threadsafe) information between lazy calls */ class LazyState { public: LazyState() : _lastClient( NULL ), _lastOp( -1 ), _slaveOk( false ), _retries( 0 ) {} DBClientConnection* _lastClient; int _lastOp; bool _slaveOk; int _retries; } _lazyState; }; /** * A simple object for representing the list of tags. The initial state will * have a valid current tag as long as the list is not empty. */ class TagSet { public: /** * Creates an empty tag list that is initially exhausted. */ TagSet(); /** * Creates a copy of the given TagSet. The new copy will have the * iterator pointing at the initial position. */ explicit TagSet(const TagSet& other); /** * Creates a tag set object that lazily iterates over the tag list. * * @param tags the list of tags associated with this option. This object * will get a shared copy of the list. Therefore, it is important * for the the given tag to live longer than the created tag set. */ explicit TagSet(const BSONArray& tags); /** * Advance to the next tag. * * @throws AssertionException if iterator is exhausted before this is called. */ void next(); /** * Rests the iterator to point to the first element (if there is a tag). */ void reset(); // // Getters // /** * @return the current tag. Returned tag is invalid if isExhausted is true. */ const BSONObj& getCurrentTag() const; /** * @return true if the iterator has been exhausted. */ bool isExhausted() const; /** * @return an unordered iterator to the tag list. The caller is responsible for * destroying the returned iterator. */ BSONObjIterator* getIterator() const; /** * @returns true if the other TagSet has the same tag set specification with * this tag set, disregarding where the current iterator is pointing to. */ bool equals(const TagSet& other) const; const BSONArray& getTagBSON() const; private: /** * This is purposely undefined as the semantics for assignment can be * confusing. This is because BSONArrayIteratorSorted shouldn't be * copied (because of how it manages internal buffer). */ TagSet& operator=(const TagSet& other); BSONObj _currentTag; bool _isExhausted; // Important: do not re-order _tags & _tagIterator BSONArray _tags; scoped_ptr<BSONArrayIteratorSorted> _tagIterator; }; struct ReadPreferenceSetting { /** * @parm pref the read preference mode. * @param tag the tag set. Note that this object will have the * tag set will have this in a reset state (meaning, this * object's copy of tag will have the iterator in the initial * position). */ ReadPreferenceSetting(ReadPreference pref, const TagSet& tag): pref(pref), tags(tag) { } inline bool equals(const ReadPreferenceSetting& other) const { return pref == other.pref && tags.equals(other.tags); } BSONObj toBSON() const; const ReadPreference pref; TagSet tags; }; }
4e60ccd234a5153a079b9a42178cf8c326d41892
40de3c7facfe74caf581656762a61baf08fd2418
/testing/processing/testBluetooth/HC05_keypad_lcd/HC05_keypad_lcd.ino
c63767cfdcbc89a7a91e836c45e2112305880515
[]
no_license
Zeriel/login-rfid
1d81c5f7db459474ae9c45da80c16ab7cb50cc65
2dcb7c62396009ddd5377bedccb5f5cc4644a58b
refs/heads/master
2020-07-16T03:51:18.132117
2019-11-30T23:26:35
2019-11-30T23:26:35
205,712,562
0
0
null
2019-11-30T23:26:36
2019-09-01T17:53:37
C++
UTF-8
C++
false
false
3,853
ino
//Ejemplo casi completo del Sistema. Espera a que el Server establezca la conexion, y comienza la comunicacion arduino-server mediante keypad y bluetooth, //y la comunicacion sistema-usuario mediante la pantalla LCD //LIBRERIAS BLUETOOTH #include <SoftwareSerial.h> //LIBRERIAS KEYPAD #include <Keypad.h> //LIBRERIAS LCD #include <Wire.h> #include <LiquidCrystal_I2C.h> // DEFINICIONES PARA BLUETOOTH //Define the pins used for receiving //and transmitting information via Bluetooth //const int rxpin = 50; //const int txpin = 51; const int rxpin = 62; // NINGUNO de los RX del MEGA funcionaba, encontre en StackOverflow que este puerto podria servir como RX, y funciono const int txpin = 14; //Variable to store input value char rec= 'A'; char serialInput; char conectado = 'n'; //Connect the Bluetooth module SoftwareSerial bluetooth(rxpin, txpin); //DEFINICIONES PARA KEYPAD //Se definen variables para las ROWS y las COLUMNS const byte ROWS = 4; const byte COLS = 4; //Matriz de acceso, para saber que tecla fue presionada char hexaKeys[ROWS][COLS] = { {'1', '2', '3', 'A'}, {'4', '5', '6', 'B'}, {'7', '8', '9', 'C'}, {'*', '0', '#', 'D'} }; /* Se asignan los pines digitales del arduino para las filas y columnas */ byte rowPins[ROWS] = {47, 45, 43, 41}; byte colPins[COLS] = {39, 37, 35, 33}; // Se genera el objeto keypad con lo anterior declarado Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); //DEFINICIONES PARA LCD LiquidCrystal_I2C lcd(0x3F, 16, 2); char limpiar = 's'; void setup(){ //Initialize Serial for debugging purposes Serial.begin(9600); Serial.println("Serial ready"); //Initialize the bluetooth bluetooth.begin(9600); bluetooth.println("Bluetooth ready"); lcd.backlight(); //Da color de fondo a la pantalla lcd.init(); //Inicia la pantalla lcd.clear(); lcd.setCursor(0, 0); lcd.print("ESPERANDO"); lcd.setCursor(0, 1); lcd.print("CONEXION"); } void loop(){ if (limpiar == 's' && conectado == 's'){ lcd.clear(); lcd.setCursor(0, 0); lcd.print("Ingrese caracter"); limpiar = 'n'; } //Valido si no ingreso algo por Monitor Serie char customKey = customKeypad.getKey(); if (customKey == 'C'){ customKey= 'S'; lcd.clear(); lcd.setCursor(0, 0); lcd.print("Enviando C"); bluetooth.println('c'); delay(10); } else if (customKey == '0'){ lcd.clear(); lcd.setCursor(0, 0); lcd.print("Enviando 0"); bluetooth.println('e'); delay(10); } if(bluetooth.available()){ rec = bluetooth.read(); // read 1 char Serial.println(rec); // Printout throught Serial the Char just read. } if(rec == 'y'){ // If rec char is Z lcd.clear(); lcd.setCursor(0, 0); lcd.print("Conectado"); rec = 'A'; // reset rec to A to avoid inf loop delay(2000); limpiar = 's'; conectado = 's'; } if(rec == 'g'){ // If rec char is Z lcd.clear(); lcd.setCursor(0, 0); lcd.print("Acceso"); lcd.setCursor(0, 1); lcd.print("Autorizado"); rec = 'A'; // reset rec to A to avoid inf loop delay(2000); limpiar = 's'; } //Wait ten milliseconds to decrease unnecessary hardware strain delay(10); }
97139499c65ab91575c03730885a864c3d70833f
9d1062d5d7d43e34e13284a3fdec3aa9bc4616b1
/BasicFaceTracking/SharedContent/cpp/GameContent/Level2.cpp
727acad06d59b4aa13009f2ae1e24c0926da3a8d
[ "MIT" ]
permissive
corbanvilla/COV-Face-Tracking
6b85ea04a508319a09f1d2a134ac009694d750b5
e27f66eeb884509354c194c0f20d2adfb3ec41c9
refs/heads/main
2023-09-04T17:34:12.802818
2021-10-31T20:56:31
2021-10-31T20:56:31
423,257,552
0
0
null
null
null
null
UTF-8
C++
false
false
2,554
cpp
//********************************************************* // // Copyright (c) Microsoft. All rights reserved. // This code is licensed under the MIT License (MIT). // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. // //********************************************************* #include "pch.h" #include "Level2.h" #include "Face.h" //---------------------------------------------------------------------- Level2::Level2() { m_timeLimit = 30.0f; m_objective = "Hit each of the targets in ORDER before time runs out."; } //---------------------------------------------------------------------- void Level2::Initialize(std::vector<GameObject^> objects) { Level1::Initialize(objects); int targetCount = 0; for (auto object = objects.begin(); object != objects.end(); object++) { if (Face^ target = dynamic_cast<Face^>(*object)) { if (targetCount < 9) { target->Target(targetCount == 0 ? true : false); targetCount++; } } } m_nextId = 1; } //---------------------------------------------------------------------- bool Level2::Update( float /* time */, float /* elapsedTime */, float /* timeRemaining */, std::vector<GameObject^> objects ) { int left = 0; for (auto object = objects.begin(); object != objects.end(); object++) { if ((*object)->Active() && ((*object)->TargetId() > 0)) { if ((*object)->Hit() && ((*object)->TargetId() == m_nextId)) { (*object)->Active(false); m_nextId++; } else { left++; } } if ((*object)->Active() && ((*object)->TargetId() == m_nextId)) { (*object)->Target(true); } } return (left == 0); } //---------------------------------------------------------------------- void Level2::SaveState(PersistentState^ state) { state->SaveInt32(":NextTarget", m_nextId); } //---------------------------------------------------------------------- void Level2::LoadState(PersistentState^ state) { m_nextId = state->LoadInt32(":NextTarget", 1); } //----------------------------------------------------------------------
9c7dd6e38dddfca5903ecd5be58302abd4937448
f7ef7dabcc31ce5e2684a028f25f059302040392
/src/gs2/ez/friend/Client.cpp
e42a987daf56daaa210735b765fccb1863c75c3f
[]
no_license
gs2io/gs2-cpp-sdk
68bb09c0979588b850913feb07406698f661b012
8dc862e247e4cc2924a060701be783096d307a44
refs/heads/develop
2021-08-16T17:11:59.557099
2020-08-03T09:26:00
2020-08-03T09:26:10
148,787,757
0
0
null
2020-11-15T08:08:06
2018-09-14T12:50:30
C++
UTF-8
C++
false
false
26,189
cpp
/* * Copyright 2016 Game Server Services, 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://www.apache.org/licenses/LICENSE-2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include "Client.hpp" #include "../Profile.hpp" #include "../GameSession.hpp" #include <gs2/friend/Gs2FriendWebSocketClient.hpp> namespace gs2 { namespace ez { namespace friend_ { Client::Client(gs2::ez::Profile& profile) : m_Profile(profile), m_pClient(new gs2::friend_::Gs2FriendWebSocketClient(profile.getGs2Session())) { } Client::~Client() { delete m_pClient; } void Client::getProfile( std::function<void(AsyncEzGetProfileResult)> callback, GameSession& session, StringHolder namespaceName ) { gs2::friend_::GetProfileRequest request; request.setNamespaceName(namespaceName); request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->getProfile( request, [callback](gs2::friend_::AsyncGetProfileResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzGetProfileResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzGetProfileResult::isConvertible(*r.getResult())) { EzGetProfileResult ezResult(*r.getResult()); AsyncEzGetProfileResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzGetProfileResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::updateProfile( std::function<void(AsyncEzUpdateProfileResult)> callback, GameSession& session, StringHolder namespaceName, gs2::optional<StringHolder> publicProfile, gs2::optional<StringHolder> followerProfile, gs2::optional<StringHolder> friendProfile ) { gs2::friend_::UpdateProfileRequest request; request.setNamespaceName(namespaceName); if (publicProfile) { request.setPublicProfile(std::move(*publicProfile)); } if (followerProfile) { request.setFollowerProfile(std::move(*followerProfile)); } if (friendProfile) { request.setFriendProfile(std::move(*friendProfile)); } request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->updateProfile( request, [callback](gs2::friend_::AsyncUpdateProfileResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzUpdateProfileResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzUpdateProfileResult::isConvertible(*r.getResult())) { EzUpdateProfileResult ezResult(*r.getResult()); AsyncEzUpdateProfileResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzUpdateProfileResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::getPublicProfile( std::function<void(AsyncEzGetPublicProfileResult)> callback, StringHolder namespaceName, StringHolder userId ) { gs2::friend_::GetPublicProfileRequest request; request.setNamespaceName(namespaceName); request.setUserId(userId); m_pClient->getPublicProfile( request, [callback](gs2::friend_::AsyncGetPublicProfileResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzGetPublicProfileResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzGetPublicProfileResult::isConvertible(*r.getResult())) { EzGetPublicProfileResult ezResult(*r.getResult()); AsyncEzGetPublicProfileResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzGetPublicProfileResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::describeFollowUsers( std::function<void(AsyncEzDescribeFollowUsersResult)> callback, GameSession& session, StringHolder namespaceName, Bool withProfile, gs2::optional<StringHolder> pageToken, gs2::optional<Int64> limit ) { gs2::friend_::DescribeFollowsRequest request; request.setNamespaceName(namespaceName); request.setWithProfile(withProfile); if (pageToken) { request.setPageToken(std::move(*pageToken)); } if (limit) { request.setLimit(std::move(*limit)); } request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->describeFollows( request, [callback](gs2::friend_::AsyncDescribeFollowsResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzDescribeFollowUsersResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzDescribeFollowUsersResult::isConvertible(*r.getResult())) { EzDescribeFollowUsersResult ezResult(*r.getResult()); AsyncEzDescribeFollowUsersResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzDescribeFollowUsersResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::follow( std::function<void(AsyncEzFollowResult)> callback, GameSession& session, StringHolder namespaceName, StringHolder targetUserId ) { gs2::friend_::FollowRequest request; request.setNamespaceName(namespaceName); request.setTargetUserId(targetUserId); request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->follow( request, [callback](gs2::friend_::AsyncFollowResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzFollowResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzFollowResult::isConvertible(*r.getResult())) { EzFollowResult ezResult(*r.getResult()); AsyncEzFollowResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzFollowResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::unfollow( std::function<void(AsyncEzUnfollowResult)> callback, GameSession& session, StringHolder namespaceName, StringHolder targetUserId ) { gs2::friend_::UnfollowRequest request; request.setNamespaceName(namespaceName); request.setTargetUserId(targetUserId); request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->unfollow( request, [callback](gs2::friend_::AsyncUnfollowResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzUnfollowResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzUnfollowResult::isConvertible(*r.getResult())) { EzUnfollowResult ezResult(*r.getResult()); AsyncEzUnfollowResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzUnfollowResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::describeFriends( std::function<void(AsyncEzDescribeFriendsResult)> callback, GameSession& session, StringHolder namespaceName, Bool withProfile, gs2::optional<StringHolder> pageToken, gs2::optional<Int64> limit ) { gs2::friend_::DescribeFriendsRequest request; request.setNamespaceName(namespaceName); request.setWithProfile(withProfile); if (pageToken) { request.setPageToken(std::move(*pageToken)); } if (limit) { request.setLimit(std::move(*limit)); } request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->describeFriends( request, [callback](gs2::friend_::AsyncDescribeFriendsResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzDescribeFriendsResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzDescribeFriendsResult::isConvertible(*r.getResult())) { EzDescribeFriendsResult ezResult(*r.getResult()); AsyncEzDescribeFriendsResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzDescribeFriendsResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::getFriend( std::function<void(AsyncEzGetFriendResult)> callback, GameSession& session, StringHolder namespaceName, StringHolder targetUserId, Bool withProfile ) { gs2::friend_::GetFriendRequest request; request.setNamespaceName(namespaceName); request.setTargetUserId(targetUserId); request.setWithProfile(withProfile); request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->getFriend( request, [callback](gs2::friend_::AsyncGetFriendResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzGetFriendResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzGetFriendResult::isConvertible(*r.getResult())) { EzGetFriendResult ezResult(*r.getResult()); AsyncEzGetFriendResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzGetFriendResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::deleteFriend( std::function<void(AsyncEzDeleteFriendResult)> callback, GameSession& session, StringHolder namespaceName, StringHolder targetUserId ) { gs2::friend_::DeleteFriendRequest request; request.setNamespaceName(namespaceName); request.setTargetUserId(targetUserId); request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->deleteFriend( request, [callback](gs2::friend_::AsyncDeleteFriendResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzDeleteFriendResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzDeleteFriendResult::isConvertible(*r.getResult())) { EzDeleteFriendResult ezResult(*r.getResult()); AsyncEzDeleteFriendResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzDeleteFriendResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::describeSendRequests( std::function<void(AsyncEzDescribeSendRequestsResult)> callback, GameSession& session, StringHolder namespaceName ) { gs2::friend_::DescribeSendRequestsRequest request; request.setNamespaceName(namespaceName); request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->describeSendRequests( request, [callback](gs2::friend_::AsyncDescribeSendRequestsResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzDescribeSendRequestsResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzDescribeSendRequestsResult::isConvertible(*r.getResult())) { EzDescribeSendRequestsResult ezResult(*r.getResult()); AsyncEzDescribeSendRequestsResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzDescribeSendRequestsResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::sendRequest( std::function<void(AsyncEzSendRequestResult)> callback, GameSession& session, StringHolder namespaceName, StringHolder targetUserId ) { gs2::friend_::SendRequestRequest request; request.setNamespaceName(namespaceName); request.setTargetUserId(targetUserId); request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->sendRequest( request, [callback](gs2::friend_::AsyncSendRequestResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzSendRequestResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzSendRequestResult::isConvertible(*r.getResult())) { EzSendRequestResult ezResult(*r.getResult()); AsyncEzSendRequestResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzSendRequestResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::deleteRequest( std::function<void(AsyncEzDeleteRequestResult)> callback, GameSession& session, StringHolder namespaceName, StringHolder targetUserId ) { gs2::friend_::DeleteRequestRequest request; request.setNamespaceName(namespaceName); request.setTargetUserId(targetUserId); request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->deleteRequest( request, [callback](gs2::friend_::AsyncDeleteRequestResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzDeleteRequestResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzDeleteRequestResult::isConvertible(*r.getResult())) { EzDeleteRequestResult ezResult(*r.getResult()); AsyncEzDeleteRequestResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzDeleteRequestResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::describeReceiveRequests( std::function<void(AsyncEzDescribeReceiveRequestsResult)> callback, GameSession& session, StringHolder namespaceName ) { gs2::friend_::DescribeReceiveRequestsRequest request; request.setNamespaceName(namespaceName); request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->describeReceiveRequests( request, [callback](gs2::friend_::AsyncDescribeReceiveRequestsResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzDescribeReceiveRequestsResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzDescribeReceiveRequestsResult::isConvertible(*r.getResult())) { EzDescribeReceiveRequestsResult ezResult(*r.getResult()); AsyncEzDescribeReceiveRequestsResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzDescribeReceiveRequestsResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::accept( std::function<void(AsyncEzAcceptResult)> callback, GameSession& session, StringHolder namespaceName, StringHolder fromUserId ) { gs2::friend_::AcceptRequestRequest request; request.setNamespaceName(namespaceName); request.setFromUserId(fromUserId); request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->acceptRequest( request, [callback](gs2::friend_::AsyncAcceptRequestResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzAcceptResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzAcceptResult::isConvertible(*r.getResult())) { EzAcceptResult ezResult(*r.getResult()); AsyncEzAcceptResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzAcceptResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::reject( std::function<void(AsyncEzRejectResult)> callback, GameSession& session, StringHolder namespaceName, StringHolder fromUserId ) { gs2::friend_::RejectRequestRequest request; request.setNamespaceName(namespaceName); request.setFromUserId(fromUserId); request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->rejectRequest( request, [callback](gs2::friend_::AsyncRejectRequestResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzRejectResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzRejectResult::isConvertible(*r.getResult())) { EzRejectResult ezResult(*r.getResult()); AsyncEzRejectResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzRejectResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::getBlackList( std::function<void(AsyncEzGetBlackListResult)> callback, GameSession& session, StringHolder namespaceName ) { gs2::friend_::DescribeBlackListRequest request; request.setNamespaceName(namespaceName); request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->describeBlackList( request, [callback](gs2::friend_::AsyncDescribeBlackListResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzGetBlackListResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzGetBlackListResult::isConvertible(*r.getResult())) { EzGetBlackListResult ezResult(*r.getResult()); AsyncEzGetBlackListResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzGetBlackListResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::registerBlackList( std::function<void(AsyncEzRegisterBlackListResult)> callback, GameSession& session, StringHolder namespaceName, StringHolder targetUserId ) { gs2::friend_::RegisterBlackListRequest request; request.setNamespaceName(namespaceName); request.setTargetUserId(targetUserId); request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->registerBlackList( request, [callback](gs2::friend_::AsyncRegisterBlackListResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzRegisterBlackListResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzRegisterBlackListResult::isConvertible(*r.getResult())) { EzRegisterBlackListResult ezResult(*r.getResult()); AsyncEzRegisterBlackListResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzRegisterBlackListResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } void Client::unregisterBlackList( std::function<void(AsyncEzUnregisterBlackListResult)> callback, GameSession& session, StringHolder namespaceName, StringHolder targetUserId ) { gs2::friend_::UnregisterBlackListRequest request; request.setNamespaceName(namespaceName); request.setTargetUserId(targetUserId); request.setAccessToken(*session.getAccessToken()->getToken()); m_pClient->unregisterBlackList( request, [callback](gs2::friend_::AsyncUnregisterBlackListResult r) { if (r.getError()) { auto gs2ClientException = *r.getError(); AsyncEzUnregisterBlackListResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } else if (r.getResult() && EzUnregisterBlackListResult::isConvertible(*r.getResult())) { EzUnregisterBlackListResult ezResult(*r.getResult()); AsyncEzUnregisterBlackListResult asyncResult(std::move(ezResult)); callback(asyncResult); } else { Gs2ClientException gs2ClientException; gs2ClientException.setType(Gs2ClientException::UnknownException); AsyncEzUnregisterBlackListResult asyncResult(std::move(gs2ClientException)); callback(asyncResult); } } ); } }}}
d3330947e331f9726157244bb35a331d90bdced4
8d32836a6c2e7e458a2a6d6f4d89f2e5c659673e
/dependencies/SRC/threading/ThreadManagement.h
708a5506e91da48e5be8c3b7a45f083a565e4ee5
[]
no_license
Sandshroud/Ronin
e92e53c81fdab4cefc0de964d2fb8cebc34ee41e
94986c95e88abe6cedd240e0ce95f6f213b05d90
refs/heads/master
2023-05-10T21:58:29.115832
2023-04-29T04:26:34
2023-04-29T04:26:34
74,101,915
12
7
null
null
null
null
UTF-8
C++
false
false
5,557
h
/* * Sandshroud Project Ronin * Copyright (C) 2015-2017 Sandshroud <https://github.com/Sandshroud> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ #pragma once typedef struct tagTHREADNAME_INFO { DWORD dwType; // must be 0x1000 LPCSTR szName; // pointer to name (in user addr space) DWORD dwThreadID; // thread ID (-1=caller thread) DWORD dwFlags; // reserved for future use, must be zero } THREADNAME_INFO; struct SERVER_DECL Thread { char* name; uint32 ThreadId; Thread(char* tname) { name = tname; } ThreadContext * ExecutionTarget; }; class SERVER_DECL ThreadManager { Mutex _mutex; typedef std::map<uint32, Thread*> ThreadMap; ThreadMap m_activeThreads; #ifdef WIN32 std::map<uint32, HANDLE> m_securityHandles; #endif public: ThreadManager(); // shutdown all threads void Shutdown(); // return true - suspend ourselves, and wait for a future task. // return false - exit, we're shutting down or no longer needed. void ThreadExit(Thread * t); // creates a thread, returns a handle to it. Thread * StartThread(ThreadContext * ExecutionTarget); #ifdef WIN32 HANDLE GetSecurityHandle(uint32 threadId) { std::map<uint32, HANDLE>::iterator itr; if((itr = m_securityHandles.find(threadId)) == m_securityHandles.end()) return NULL; return itr->second; } #endif // grabs/spawns a thread, and tells it to execute a task. void ExecuteTask(const char* ThreadName, ThreadContext * ExecutionTarget); // gets active thread count RONIN_INLINE uint32 GetActiveThreadCount() { return (uint32)m_activeThreads.size(); } // Creates exception which sets the thread name, do not call inside try block static void SetThreadName(const char* format); static void Suicide(); public: class PoolTask { public: virtual int call() { return 0; } }; class TaskPool { public: TaskPool(ThreadManager *manager, uint32 poolId, uint32 thread_count, uint64 coreAffinity) : _manager(manager), _dead(false), taskCount(0), _poolId(poolId), _threadCount(thread_count), _affinityMask(coreAffinity) { #if PLATFORM == PLATFORM_WIN inputEvent = CreateEvent(NULL, FALSE, FALSE, NULL); endEvent = CreateEvent(NULL, FALSE, FALSE, NULL); #endif } ~TaskPool() {} void attach() { ++_threadCount; } // Increment thread counter since this thread is waiting inside the pointer void AddTask(PoolTask* task) { Guard guard(_processLock); if(_dead == true) { delete task; return; } ++taskCount; _processQueue.push_back(task); #if PLATFORM == PLATFORM_WIN SetEvent(inputEvent); #else pthread_cond_signal(&cond); #endif } void wait() { while(!_IsTasksEmpty()) { #if PLATFORM == PLATFORM_WIN WaitForSingleObject(endEvent, 100); #else timeval now; timespec tv; gettimeofday(&now, NULL); tv.tv_sec = now.tv_sec; tv.tv_nsec = (now.tv_usec * 1000) + 100; pthread_mutex_lock(&mutex); pthread_cond_timedwait(&cond, &mutex, &tv); pthread_mutex_unlock(&mutex); #endif } #if PLATFORM == PLATFORM_WIN ResetEvent(inputEvent); ResetEvent(endEvent); #endif } void shutdown() { _dead = true; } void kill() { _dead = true; if(--_threadCount == 0) delete this; } uint32 getPoolId() { return _poolId; } uint32 getThreadCount() { return _threadCount; } private: friend class ThreadManager; class TaskPoolSlave : public ThreadContext { public: TaskPoolSlave(TaskPool *pool) : ThreadContext(), _pool(pool) {} virtual bool run() { _pool->slave_run(); return true; } private: TaskPool *_pool; }; friend class TaskPoolSlave; void slave_run(); void spawn(); uint32 _poolId; std::atomic<bool> _dead; std::atomic<int> _threadCount; std::atomic<long> taskCount; unsigned long long _affinityMask; Mutex _processLock; std::vector<PoolTask*> _processQueue; bool _IsTasksEmpty() { return taskCount == 0; } ThreadManager *_manager; #if PLATFORM == PLATFORM_WIN HANDLE inputEvent, endEvent; #else pthread_cond_t cond; pthread_mutex_t mutex; #endif }; TaskPool *SpawnPool(uint32 thread_count, uint64 coreAffinity); void CleanPool(uint32 poolId); private: uint32 taskCounter; std::map<uint32, TaskPool*> m_taskPools; }; extern SERVER_DECL ThreadManager sThreadManager;
26ce077de2c35a707aff5eb1027bc16c2a9e931b
f81124e4a52878ceeb3e4b85afca44431ce68af2
/re20_1/processor32/35/U
525fbd6246d7186a19c9d8742f10549d2adf4e1d
[]
no_license
chaseguy15/coe-of2
7f47a72987638e60fd7491ee1310ee6a153a5c10
dc09e8d5f172489eaa32610e08e1ee7fc665068c
refs/heads/master
2023-03-29T16:59:14.421456
2021-04-06T23:26:52
2021-04-06T23:26:52
355,040,336
0
1
null
null
null
null
UTF-8
C++
false
false
6,364
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "35"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField nonuniform List<vector> 36 ( (-0.025616 0.00613771 8.88395e-20) (-0.0117966 0.00766706 -5.47439e-20) (0.0101474 0.00577878 -2.38965e-19) (0.0416319 -2.86793e-05 -7.64582e-20) (0.146573 -0.024793 -3.47969e-20) (0.225535 -0.0344516 -3.71854e-19) (0.440682 -0.0469676 -2.4872e-19) (0.710913 -0.0327446 2.30332e-20) (0.982876 0.0105605 -1.86308e-19) (1.24495 0.0716703 1.88573e-19) (1.24495 -0.0716703 -1.88573e-19) (0.982876 -0.0105605 1.86308e-19) (0.710913 0.0327446 -2.30332e-20) (0.440682 0.0469676 2.48719e-19) (0.225535 0.0344516 1.90415e-19) (0.146573 0.024793 2.16259e-19) (0.0416319 2.86791e-05 9.92996e-20) (0.0101474 -0.00577878 3.96293e-19) (-0.0117966 -0.00766706 -1.19484e-19) (1.25348 0.0852292 2.00076e-21) (1.23469 0.0741773 -4.33777e-20) (1.21864 0.0632009 2.29854e-20) (1.20528 0.0525653 6.60548e-21) (1.19443 0.0423828 -7.13022e-21) (1.18589 0.032586 1.5096e-21) (1.17954 0.0230856 -6.39394e-22) (1.17529 0.0138143 7.13109e-23) (1.1731 0.00468989 9.73784e-22) (1.23469 -0.0741773 2.59149e-22) (1.21864 -0.0632009 -2.29854e-20) (1.20528 -0.0525653 -6.60548e-21) (1.19443 -0.0423828 7.13022e-21) (1.18589 -0.032586 -1.5096e-21) (1.17954 -0.0230856 -1.32539e-21) (1.17529 -0.0138143 1.88432e-21) (1.1731 -0.00468989 -9.73782e-22) ) ; boundaryField { inlet { type uniformFixedValue; uniformValue constant (1 0 0); value nonuniform 0(); } outlet { type pressureInletOutletVelocity; value nonuniform 0(); } cylinder { type fixedValue; value nonuniform 0(); } top { type symmetryPlane; } bottom { type symmetryPlane; } defaultFaces { type empty; } procBoundary32to30 { type processor; value nonuniform List<vector> 14 ( (1.09983 0.0505165 4.08055e-19) (1.28641 0.108491 -1.74855e-19) (1.28641 -0.108491 1.74855e-19) (1.09983 -0.0505165 -4.08055e-19) (1.19763 0.0550988 6.53388e-21) (1.18753 0.0442555 3.83427e-21) (1.1796 0.0339349 -4.8484e-22) (1.17369 0.0239992 -1.43116e-21) (1.16972 0.0143497 2.46275e-23) (1.16767 0.00486472 4.27498e-22) (1.1796 -0.0339349 -5.25999e-21) (1.17369 -0.0239992 1.43115e-21) (1.16972 -0.0143497 -2.46277e-23) (1.16767 -0.00486472 -4.27497e-22) ) ; } procBoundary32to31 { type processor; value nonuniform List<vector> 34 ( (-0.0222287 0.0112828 3.08943e-20) (-0.0160045 0.0159369 1.2049e-19) (-0.00534445 0.0167263 -5.76421e-20) (0.0112631 0.0129511 -2.74205e-20) (0.0843799 -0.00940944 -1.4879e-19) (0.0843799 -0.00940944 -1.4879e-19) (0.14014 -0.0210124 -1.71568e-19) (0.320449 -0.041624 7.44272e-20) (0.320449 -0.041624 7.44272e-20) (0.571015 -0.0400732 -9.31982e-19) (0.571015 -0.0400732 -9.31982e-19) (0.853435 -0.00660024 2.50756e-19) (0.853435 -0.00660024 2.50756e-19) (1.18731 0.0664724 1.8272e-19) (1.18731 -0.0664724 -1.8272e-19) (0.853435 0.00660024 -2.50756e-19) (0.853435 0.00660024 -2.50756e-19) (0.571015 0.0400732 9.31982e-19) (0.571015 0.0400732 9.31982e-19) (0.320449 0.041624 -7.44272e-20) (0.320449 0.041624 -7.44272e-20) (0.14014 0.0210124 1.10535e-19) (0.0843799 0.00940944 2.09828e-19) (0.0843799 0.00940944 2.09828e-19) (0.0112631 -0.0129511 -2.88969e-19) (-0.00534445 -0.0167263 2.31192e-19) (-0.0160045 -0.0159369 6.58992e-20) (1.24382 0.0919224 2.87531e-20) (1.22528 0.0788413 -2.45654e-20) (1.2101 0.0666039 2.27782e-20) (1.22528 -0.0788413 2.45654e-20) (1.2101 -0.0666039 -2.27782e-20) (1.19763 -0.0550988 7.54867e-21) (1.18753 -0.0442555 -3.83427e-21) ) ; } procBoundary32to33 { type processor; value nonuniform List<vector> 35 ( (-0.0322774 0.00231365 2.45518e-20) (-0.0229004 -0.0006405 7.4509e-20) (-0.00017698 -0.00299611 1.17479e-19) (0.0348788 -0.00784719 -4.33275e-19) (0.0833714 -0.0153462 -2.08555e-20) (0.0833714 -0.0153462 -2.08555e-20) (0.219893 -0.0396264 4.56853e-20) (0.322303 -0.0458212 3.95485e-19) (0.322303 -0.0458212 3.95485e-19) (0.565367 -0.0483402 -5.64253e-19) (0.565367 -0.0483402 -5.64253e-19) (0.842632 -0.0219854 -1.79888e-19) (0.842632 -0.0219854 -1.79888e-19) (1.09055 0.0275626 -2.68554e-19) (1.17006 0.0334203 1.96519e-19) (1.28696 0.0946676 -9.96235e-21) (1.17006 -0.0334203 4.68661e-20) (1.28696 -0.0946676 9.96235e-21) (1.09055 -0.0275626 2.68554e-19) (0.842632 0.0219854 1.79888e-19) (0.842632 0.0219854 1.79888e-19) (0.565367 0.0483402 2.2552e-19) (0.565367 0.0483402 2.2552e-19) (0.322303 0.0458212 -8.56342e-20) (0.322303 0.0458212 -8.56342e-20) (0.219893 0.0396264 -3.55585e-19) (0.0833714 0.0153462 1.45612e-20) (0.0833714 0.0153462 1.45612e-20) (0.0348788 0.00784719 1.64876e-19) (-0.00017698 0.00299611 1.88243e-19) (-0.025616 -0.00613771 -3.43944e-20) (1.18044 0.013223 2.28681e-21) (1.17815 0.00448342 -3.20641e-22) (1.27435 0.0959112 5.79746e-20) (1.25348 -0.0852292 -2.93123e-20) ) ; } procBoundary32to34 { type processor; value nonuniform List<vector> 15 ( (1.26427 0.0791014 -2.43189e-22) (1.24408 0.0697357 2.80566e-20) (1.2267 0.0597589 -4.88873e-21) (1.21237 0.0499119 -1.20545e-20) (1.2008 0.0403846 2.59075e-21) (1.19171 0.0311294 -4.95781e-21) (1.18495 0.0220897 2.55615e-21) (1.24408 -0.0697357 -2.80566e-20) (1.2267 -0.0597589 4.88873e-21) (1.21237 -0.0499119 1.20545e-20) (1.2008 -0.0403846 -2.59074e-21) (1.19171 -0.0311294 4.9578e-21) (1.18495 -0.0220897 -2.55615e-21) (1.18044 -0.013223 2.96733e-22) (1.17815 -0.00448342 3.20641e-22) ) ; } } // ************************************************************************* //
[ "chaseguy15" ]
chaseguy15
f64076326d3efa8b3045de1bb8dcc1288e1012c7
d4cadc2d29825bc4dd64ca13ab2361a027f8f35b
/src/unistdx/base/types
85f35f1c69e979510d53a8ce426ef3d2d3939054
[ "Unlicense" ]
permissive
staring/unistdx
f3430cced14f4ad4d3b8e5e16f75fa4e69679420
b73a614b3554d5cd06594cffa5b36f1a5887f684
refs/heads/master
2020-03-17T14:26:00.607927
2018-04-27T15:27:13
2018-04-27T15:27:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
945
#ifndef UNISTDX_BASE_TYPES #define UNISTDX_BASE_TYPES #include <cstddef> #include <cstdint> #include <unistdx/config> #define MAKE_ASSERT(bits, bytes) \ static_assert(sizeof(u ## bits) == bytes, "bad u" #bits " type"); \ static_assert(sizeof(i ## bits) == bytes, "bad i" #bits " type") namespace sys { typedef ::std::uint8_t u8; typedef ::std::uint16_t u16; typedef ::std::uint32_t u32; typedef ::std::uint64_t u64; typedef ::std::int8_t i8; typedef ::std::int16_t i16; typedef ::std::int32_t i32; typedef ::std::int64_t i64; typedef float f32; typedef double f64; #if defined(UNISTDX_HAVE_LONG_DOUBLE) typedef long double f128; static_assert(sizeof(f128) == 16, "bad f128 type"); #endif MAKE_ASSERT(8, 1); MAKE_ASSERT(16, 2); MAKE_ASSERT(32, 4); MAKE_ASSERT(64, 8); static_assert(sizeof(f32) == 4, "bad f32 type"); static_assert(sizeof(f64) == 8, "bad f64 type"); } #undef MAKE_ASSERT #endif // vim:filetype=cpp
3d42ad04481e03593e3e10f22173b3607b55db2f
98b1e51f55fe389379b0db00365402359309186a
/homework_6/problem_2/100x100/0.222/phi
d6f818cefda2ec6c894d9fbadb48dd42e40baec2
[]
no_license
taddyb/597-009
f14c0e75a03ae2fd741905c4c0bc92440d10adda
5f67e7d3910e3ec115fb3f3dc89a21dcc9a1b927
refs/heads/main
2023-01-23T08:14:47.028429
2020-12-03T13:24:27
2020-12-03T13:24:27
311,713,551
1
0
null
null
null
null
UTF-8
C++
false
false
142,976
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 8 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class surfaceScalarField; location "0.222"; object phi; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 3 -1 0 0 0 0]; internalField nonuniform List<scalar> 19800 ( 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 ) ; boundaryField { left { type calculated; value nonuniform List<scalar> 100 ( -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 ) ; } right { type calculated; value nonuniform List<scalar> 100 ( 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 ) ; } up { type calculated; value nonuniform List<scalar> 100 ( 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 ) ; } down { type calculated; value nonuniform List<scalar> 100 ( -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 -0.0002 ) ; } frontAndBack { type empty; value nonuniform List<scalar> 0(); } } // ************************************************************************* //
998cd6e1dd0fb4e36cf1c1094fe6d47369afb0cc
5740e41c77ddaa68dce3f39dbf0899a1eab9c6fd
/src/rpc/misc.cpp
966410f1751de1fc9a62e287bb108d8bafb371ff
[ "MIT" ]
permissive
dutchpatriot/FlorijnCoin14
04322982aae59691c245927dce443976ec12b7a7
3b18390acd5de6aedd5d5b45101f31395f8f6d98
refs/heads/master
2021-01-18T22:45:09.188658
2017-04-03T11:43:51
2017-04-03T11:43:51
87,067,620
0
0
null
null
null
null
UTF-8
C++
false
false
19,968
cpp
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" #include "clientversion.h" #include "init.h" #include "main.h" #include "net.h" #include "netbase.h" #include "rpc/server.h" #include "timedata.h" #include "util.h" #include "utilstrencodings.h" #ifdef ENABLE_WALLET #include "wallet/wallet.h" #include "wallet/walletdb.h" #endif #include <stdint.h> #include <boost/assign/list_of.hpp> #include <univalue.h> using namespace std; /** * @note Do not add or change anything in the information returned by this * method. `getinfo` exists for backwards-compatibility only. It combines * information from wildly different sources in the program, which is a mess, * and is thus planned to be deprecated eventually. * * Based on the source of the information, new information should be added to: * - `getblockchaininfo`, * - `getnetworkinfo` or * - `getwalletinfo` * * Or alternatively, create a specific query method for the information. **/ UniValue getinfo(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 0) throw runtime_error( "getinfo\n" "Returns an object containing various state info.\n" "\nResult:\n" "{\n" " \"version\": xxxxx, (numeric) the server version\n" " \"protocolversion\": xxxxx, (numeric) the protocol version\n" " \"walletversion\": xxxxx, (numeric) the wallet version\n" " \"balance\": xxxxxxx, (numeric) the total florijncoin balance of the wallet\n" " \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n" " \"timeoffset\": xxxxx, (numeric) the time offset\n" " \"connections\": xxxxx, (numeric) the number of connections\n" " \"proxy\": \"host:port\", (string, optional) the proxy used by the server\n" " \"difficulty\": xxxxxx, (numeric) the current difficulty\n" " \"testnet\": true|false, (boolean) if the server is using testnet or not\n" " \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since Unix epoch) of the oldest pre-generated key in the key pool\n" " \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated\n" " \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n" " \"paytxfee\": x.xxxx, (numeric) the transaction fee set in " + CURRENCY_UNIT + "/kB\n" " \"relayfee\": x.xxxx, (numeric) minimum relay fee for non-free transactions in " + CURRENCY_UNIT + "/kB\n" " \"errors\": \"...\" (string) any error messages\n" "}\n" "\nExamples:\n" + HelpExampleCli("getinfo", "") + HelpExampleRpc("getinfo", "") ); #ifdef ENABLE_WALLET LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL); #else LOCK(cs_main); #endif proxyType proxy; GetProxy(NET_IPV4, proxy); UniValue obj(UniValue::VOBJ); obj.push_back(Pair("version", CLIENT_VERSION)); obj.push_back(Pair("protocolversion", PROTOCOL_VERSION)); #ifdef ENABLE_WALLET if (pwalletMain) { obj.push_back(Pair("walletversion", pwalletMain->GetVersion())); obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance()))); } #endif obj.push_back(Pair("blocks", (int)chainActive.Height())); obj.push_back(Pair("timeoffset", GetTimeOffset())); obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("proxy", (proxy.IsValid() ? proxy.proxy.ToStringIPPort() : string()))); obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("testnet", Params().TestnetToBeDeprecatedFieldRPC())); #ifdef ENABLE_WALLET if (pwalletMain) { obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime())); obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize())); } if (pwalletMain && pwalletMain->IsCrypted()) obj.push_back(Pair("unlocked_until", nWalletUnlockTime)); obj.push_back(Pair("paytxfee", ValueFromAmount(payTxFee.GetFeePerK()))); #endif obj.push_back(Pair("relayfee", ValueFromAmount(::minRelayTxFee.GetFeePerK()))); obj.push_back(Pair("errors", GetWarnings("statusbar"))); return obj; } #ifdef ENABLE_WALLET class DescribeAddressVisitor : public boost::static_visitor<UniValue> { public: UniValue operator()(const CNoDestination &dest) const { return UniValue(UniValue::VOBJ); } UniValue operator()(const CKeyID &keyID) const { UniValue obj(UniValue::VOBJ); CPubKey vchPubKey; obj.push_back(Pair("isscript", false)); if (pwalletMain && pwalletMain->GetPubKey(keyID, vchPubKey)) { obj.push_back(Pair("pubkey", HexStr(vchPubKey))); obj.push_back(Pair("iscompressed", vchPubKey.IsCompressed())); } return obj; } UniValue operator()(const CScriptID &scriptID) const { UniValue obj(UniValue::VOBJ); CScript subscript; obj.push_back(Pair("isscript", true)); if (pwalletMain && pwalletMain->GetCScript(scriptID, subscript)) { std::vector<CTxDestination> addresses; txnouttype whichType; int nRequired; ExtractDestinations(subscript, whichType, addresses, nRequired); obj.push_back(Pair("script", GetTxnOutputType(whichType))); obj.push_back(Pair("hex", HexStr(subscript.begin(), subscript.end()))); UniValue a(UniValue::VARR); BOOST_FOREACH(const CTxDestination& addr, addresses) a.push_back(CBitcoinAddress(addr).ToString()); obj.push_back(Pair("addresses", a)); if (whichType == TX_MULTISIG) obj.push_back(Pair("sigsrequired", nRequired)); } return obj; } }; #endif UniValue validateaddress(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( "validateaddress \"florijncoinaddress\"\n" "\nReturn information about the given florijncoin address.\n" "\nArguments:\n" "1. \"florijncoinaddress\" (string, required) The florijncoin address to validate\n" "\nResult:\n" "{\n" " \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n" " \"address\" : \"florijncoinaddress\", (string) The florijncoin address validated\n" " \"scriptPubKey\" : \"hex\", (string) The hex encoded scriptPubKey generated by the address\n" " \"ismine\" : true|false, (boolean) If the address is yours or not\n" " \"iswatchonly\" : true|false, (boolean) If the address is watchonly\n" " \"isscript\" : true|false, (boolean) If the key is a script\n" " \"pubkey\" : \"publickeyhex\", (string) The hex value of the raw public key\n" " \"iscompressed\" : true|false, (boolean) If the address is compressed\n" " \"account\" : \"account\" (string) DEPRECATED. The account associated with the address, \"\" is the default account\n" " \"hdkeypath\" : \"keypath\" (string, optional) The HD keypath if the key is HD and available\n" " \"hdmasterkeyid\" : \"<hash160>\" (string, optional) The Hash160 of the HD master pubkey\n" "}\n" "\nExamples:\n" + HelpExampleCli("validateaddress", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\"") + HelpExampleRpc("validateaddress", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\"") ); #ifdef ENABLE_WALLET LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL); #else LOCK(cs_main); #endif CBitcoinAddress address(params[0].get_str()); bool isValid = address.IsValid(); UniValue ret(UniValue::VOBJ); ret.push_back(Pair("isvalid", isValid)); if (isValid) { CTxDestination dest = address.Get(); string currentAddress = address.ToString(); ret.push_back(Pair("address", currentAddress)); CScript scriptPubKey = GetScriptForDestination(dest); ret.push_back(Pair("scriptPubKey", HexStr(scriptPubKey.begin(), scriptPubKey.end()))); #ifdef ENABLE_WALLET isminetype mine = pwalletMain ? IsMine(*pwalletMain, dest) : ISMINE_NO; ret.push_back(Pair("ismine", (mine & ISMINE_SPENDABLE) ? true : false)); ret.push_back(Pair("iswatchonly", (mine & ISMINE_WATCH_ONLY) ? true: false)); UniValue detail = boost::apply_visitor(DescribeAddressVisitor(), dest); ret.pushKVs(detail); if (pwalletMain && pwalletMain->mapAddressBook.count(dest)) ret.push_back(Pair("account", pwalletMain->mapAddressBook[dest].name)); CKeyID keyID; if (pwalletMain && address.GetKeyID(keyID) && pwalletMain->mapKeyMetadata.count(keyID) && !pwalletMain->mapKeyMetadata[keyID].hdKeypath.empty()) { ret.push_back(Pair("hdkeypath", pwalletMain->mapKeyMetadata[keyID].hdKeypath)); ret.push_back(Pair("hdmasterkeyid", pwalletMain->mapKeyMetadata[keyID].hdMasterKeyID.GetHex())); } #endif } return ret; } /** * Used by addmultisigaddress / createmultisig: */ CScript _createmultisig_redeemScript(const UniValue& params) { int nRequired = params[0].get_int(); const UniValue& keys = params[1].get_array(); // Gather public keys if (nRequired < 1) throw runtime_error("a multisignature address must require at least one key to redeem"); if ((int)keys.size() < nRequired) throw runtime_error( strprintf("not enough keys supplied " "(got %u keys, but need at least %d to redeem)", keys.size(), nRequired)); if (keys.size() > 16) throw runtime_error("Number of addresses involved in the multisignature address creation > 16\nReduce the number"); std::vector<CPubKey> pubkeys; pubkeys.resize(keys.size()); for (unsigned int i = 0; i < keys.size(); i++) { const std::string& ks = keys[i].get_str(); #ifdef ENABLE_WALLET // Case 1: Bitcoin address and we have full public key: CBitcoinAddress address(ks); if (pwalletMain && address.IsValid()) { CKeyID keyID; if (!address.GetKeyID(keyID)) throw runtime_error( strprintf("%s does not refer to a key",ks)); CPubKey vchPubKey; if (!pwalletMain->GetPubKey(keyID, vchPubKey)) throw runtime_error( strprintf("no full public key for address %s",ks)); if (!vchPubKey.IsFullyValid()) throw runtime_error(" Invalid public key: "+ks); pubkeys[i] = vchPubKey; } // Case 2: hex public key else #endif if (IsHex(ks)) { CPubKey vchPubKey(ParseHex(ks)); if (!vchPubKey.IsFullyValid()) throw runtime_error(" Invalid public key: "+ks); pubkeys[i] = vchPubKey; } else { throw runtime_error(" Invalid public key: "+ks); } } CScript result = GetScriptForMultisig(nRequired, pubkeys); if (result.size() > MAX_SCRIPT_ELEMENT_SIZE) throw runtime_error( strprintf("redeemScript exceeds size limit: %d > %d", result.size(), MAX_SCRIPT_ELEMENT_SIZE)); return result; } UniValue createmultisig(const UniValue& params, bool fHelp) { if (fHelp || params.size() < 2 || params.size() > 2) { string msg = "createmultisig nrequired [\"key\",...]\n" "\nCreates a multi-signature address with n signature of m keys required.\n" "It returns a json object with the address and redeemScript.\n" "\nArguments:\n" "1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.\n" "2. \"keys\" (string, required) A json array of keys which are florijncoin addresses or hex-encoded public keys\n" " [\n" " \"key\" (string) florijncoin address or hex-encoded public key\n" " ,...\n" " ]\n" "\nResult:\n" "{\n" " \"address\":\"multisigaddress\", (string) The value of the new multisig address.\n" " \"redeemScript\":\"script\" (string) The string value of the hex-encoded redemption script.\n" "}\n" "\nExamples:\n" "\nCreate a multisig address from 2 addresses\n" + HelpExampleCli("createmultisig", "2 \"[\\\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\\\",\\\"LbhhnRHHVfP1eUJp1tDNiyeeVsNhFN9Fcw\\\"]\"") + "\nAs a json rpc call\n" + HelpExampleRpc("createmultisig", "2, \"[\\\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\\\",\\\"LbhhnRHHVfP1eUJp1tDNiyeeVsNhFN9Fcw\\\"]\"") ; throw runtime_error(msg); } // Construct using pay-to-script-hash: CScript inner = _createmultisig_redeemScript(params); CScriptID innerID(inner); CBitcoinAddress address(innerID); UniValue result(UniValue::VOBJ); result.push_back(Pair("address", address.ToString())); result.push_back(Pair("redeemScript", HexStr(inner.begin(), inner.end()))); return result; } UniValue verifymessage(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 3) throw runtime_error( "verifymessage \"florijncoinaddress\" \"signature\" \"message\"\n" "\nVerify a signed message\n" "\nArguments:\n" "1. \"florijncoinaddress\" (string, required) The florijncoin address to use for the signature.\n" "2. \"signature\" (string, required) The signature provided by the signer in base 64 encoding (see signmessage).\n" "3. \"message\" (string, required) The message that was signed.\n" "\nResult:\n" "true|false (boolean) If the signature is verified or not.\n" "\nExamples:\n" "\nUnlock the wallet for 30 seconds\n" + HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") + "\nCreate the signature\n" + HelpExampleCli("signmessage", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\" \"my message\"") + "\nVerify the signature\n" + HelpExampleCli("verifymessage", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\" \"signature\" \"my message\"") + "\nAs json rpc\n" + HelpExampleRpc("verifymessage", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\", \"signature\", \"my message\"") ); LOCK(cs_main); string strAddress = params[0].get_str(); string strSign = params[1].get_str(); string strMessage = params[2].get_str(); CBitcoinAddress addr(strAddress); if (!addr.IsValid()) throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address"); CKeyID keyID; if (!addr.GetKeyID(keyID)) throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key"); bool fInvalid = false; vector<unsigned char> vchSig = DecodeBase64(strSign.c_str(), &fInvalid); if (fInvalid) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Malformed base64 encoding"); CHashWriter ss(SER_GETHASH, 0); ss << strMessageMagic; ss << strMessage; CPubKey pubkey; if (!pubkey.RecoverCompact(ss.GetHash(), vchSig)) return false; return (pubkey.GetID() == keyID); } UniValue signmessagewithprivkey(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 2) throw runtime_error( "signmessagewithprivkey \"privkey\" \"message\"\n" "\nSign a message with the private key of an address\n" "\nArguments:\n" "1. \"privkey\" (string, required) The private key to sign the message with.\n" "2. \"message\" (string, required) The message to create a signature of.\n" "\nResult:\n" "\"signature\" (string) The signature of the message encoded in base 64\n" "\nExamples:\n" "\nCreate the signature\n" + HelpExampleCli("signmessagewithprivkey", "\"privkey\" \"my message\"") + "\nVerify the signature\n" + HelpExampleCli("verifymessage", "\"LEr4hNAefWYhBMgxCFP2Po1NPrUeiK8kM2\" \"signature\" \"my message\"") + "\nAs json rpc\n" + HelpExampleRpc("signmessagewithprivkey", "\"privkey\", \"my message\"") ); string strPrivkey = params[0].get_str(); string strMessage = params[1].get_str(); CBitcoinSecret vchSecret; bool fGood = vchSecret.SetString(strPrivkey); if (!fGood) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key"); CKey key = vchSecret.GetKey(); if (!key.IsValid()) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Private key outside allowed range"); CHashWriter ss(SER_GETHASH, 0); ss << strMessageMagic; ss << strMessage; vector<unsigned char> vchSig; if (!key.SignCompact(ss.GetHash(), vchSig)) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Sign failed"); return EncodeBase64(&vchSig[0], vchSig.size()); } UniValue setmocktime(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( "setmocktime timestamp\n" "\nSet the local time to given timestamp (-regtest only)\n" "\nArguments:\n" "1. timestamp (integer, required) Unix seconds-since-epoch timestamp\n" " Pass 0 to go back to using the system time." ); if (!Params().MineBlocksOnDemand()) throw runtime_error("setmocktime for regression testing (-regtest mode) only"); // cs_vNodes is locked and node send/receive times are updated // atomically with the time change to prevent peers from being // disconnected because we think we haven't communicated with them // in a long time. LOCK2(cs_main, cs_vNodes); RPCTypeCheck(params, boost::assign::list_of(UniValue::VNUM)); SetMockTime(params[0].get_int64()); uint64_t t = GetTime(); BOOST_FOREACH(CNode* pnode, vNodes) { pnode->nLastSend = pnode->nLastRecv = t; } return NullUniValue; } static const CRPCCommand commands[] = { // category name actor (function) okSafeMode // --------------------- ------------------------ ----------------------- ---------- { "control", "getinfo", &getinfo, true }, /* uses wallet if enabled */ { "util", "validateaddress", &validateaddress, true }, /* uses wallet if enabled */ { "util", "createmultisig", &createmultisig, true }, { "util", "verifymessage", &verifymessage, true }, { "util", "signmessagewithprivkey", &signmessagewithprivkey, true }, /* Not shown in help */ { "hidden", "setmocktime", &setmocktime, true }, }; void RegisterMiscRPCCommands(CRPCTable &tableRPC) { for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) tableRPC.appendCommand(commands[vcidx].name, &commands[vcidx]); }
e8093b76fb32a3e0ad8bc65fb152d251d2b70393
dd5639d2b206d5a38ecff6056a26cf185ceaf18e
/IA/QuickSort/main.cpp
bfaa5c0aeb3d1e53ec7018cb977b6d37b409e8ef
[]
no_license
LeulShiferaw/resume
7a84f0cb78528011b70d01796d5fda86922ca43c
812539fe4a12329472391980b6f37d4bb440c0d1
refs/heads/master
2021-04-09T10:50:36.063786
2018-03-16T12:34:00
2018-03-16T12:34:00
125,513,147
0
0
null
null
null
null
UTF-8
C++
false
false
1,671
cpp
#include <ctime> #include <cstdlib> #include <iostream> using namespace std; //Partition' pair<int,int> partition(int *A, const int &p, const int &r) { int j=p-1; for(int i=p; i<r-1; ++i) { if(A[i]<A[r-1]) { ++j; swap(A[i],A[j]); } } ++j; int t=j-1; swap(A[j],A[r-1]); for(int i=j; i<r-1; ++i) { if(A[i]==A[j]) { ++t; swap(A[i],A[t]); } } t=max(j,t); return pair<int,int>(j,t); } int randnum(const int &l, const int &h) { return rand()%(h-l+1)+l; } //Random Partitiion' pair<int,int> randomized_partition(int *A, const int &p, const int &r) { int piv=randnum(p,r-1); swap(A[piv],A[r-1]); int j=p-1; for(int i=p; i<r-1; ++i) { if(A[i]<A[r-1]) { ++j; swap(A[i],A[j]); } } ++j; int t=j-1; swap(A[j],A[r-1]); for(int i=j; i<r-1; ++i) { if(A[i]==A[j]) { ++t; swap(A[i],A[t]); } } t=max(j,t); return pair<int,int>(j,t); } int hoare_partition(int *A, const int p, const int r) { int x=A[p]; int i=p-1,j=r+1; while(1) { do { --j; }while(A[j]>x); do { ++i; }while(A[i]<x); if(i<j) swap(A[i],A[j]); else return j; } } void quickSort(int *A, const int &p, const int &r) { if(p<r) { pair<int,int> piv=randomized_partition(A,p,r); quickSort(A,p,piv.first); quickSort(A,piv.second+1,r); } } void quickSort_(int *A, const int &p, const int &r) { if(p<r) { int piv=hoare_partition(A,p,r); quickSort_(A,p,piv); quickSort_(A,piv+1,r); } } int main() { srand(time(0)); int n; cin >> n; int *A=new int[n]; for(int i=0; i<n; ++i) cin >> A[i]; quickSort(A,0,n); cout << "A: "; for(int i=0; i<n; ++i) cout << A[i] << " "; cout << endl; return 0; }
776f3620eb8e09c17280ef8c95a14293caef7bb9
6542725373a5191cef81ff9cbde9861515a4cfbb
/examples/better webserver/src/main.cpp
f77e98e58d5561ec93707678b1e21c05c2ac8c08
[]
no_license
IEEE-LMU/Ambient-Led-Project
07ae722d866f96329193ad9a3494097a277f774d
b9a05038a0053f4b6a3d3afc558b6d29a024c056
refs/heads/master
2020-04-19T02:04:40.563272
2020-02-19T05:26:36
2020-02-19T05:26:36
167,891,578
3
0
null
2019-11-13T05:12:21
2019-01-28T03:15:35
C++
UTF-8
C++
false
false
4,466
cpp
#include <Arduino.h> /* Copyright (c) 2015, Majenko Technologies 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 Majenko Technologies nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <WiFi.h> #include <WiFiClient.h> #include <WebServer.h> #include <ESPmDNS.h> const char *ssid = "LMU-Legacy"; const char *password = "IggyLion1"; WebServer server(80); void handleRoot() { char temp[400]; int sec = millis() / 1000; int min = sec / 60; int hr = min / 60; snprintf(temp, 400, "<html>\ <head>\ <meta http-equiv='refresh' content='5'/>\ <title>ESP32 Demo</title>\ <style>\ body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\ </style>\ </head>\ <body>\ <h1>Hello from ESP32!</h1>\ <p>Uptime: %02d:%02d:%02d</p>\ <img src=\"/test.svg\" />\ </body>\ </html>", hr, min % 60, sec % 60 ); server.send(200, "text/html", temp); } void handleNotFound() { String message = "File Not Found\n\n"; message += "URI: "; message += server.uri(); message += "\nMethod: "; message += (server.method() == HTTP_GET) ? "GET" : "POST"; message += "\nArguments: "; message += server.args(); message += "\n"; for (uint8_t i = 0; i < server.args(); i++) { message += " " + server.argName(i) + ": " + server.arg(i) + "\n"; } server.send(404, "text/plain", message); } void drawGraph() { String out = ""; char temp[100]; out += "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"400\" height=\"150\">\n"; out += "<rect width=\"400\" height=\"150\" fill=\"rgb(250, 230, 210)\" stroke-width=\"1\" stroke=\"rgb(0, 0, 0)\" />\n"; out += "<g stroke=\"black\">\n"; int y = rand() % 130; for (int x = 10; x < 390; x += 10) { int y2 = rand() % 130; sprintf(temp, "<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" stroke-width=\"1\" />\n", x, 140 - y, x + 10, 140 - y2); out += temp; y = y2; } out += "</g>\n</svg>\n"; server.send(200, "image/svg+xml", out); } void setup(void) { Serial.begin(115200); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); //Connect to WiFi Network Serial.println(""); // Wait for connection while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.print("Connected to "); Serial.println(ssid); Serial.print("IP address: "); Serial.println(WiFi.localIP()); if (MDNS.begin("esp32")) { //Begin mDNS protocol Serial.println("MDNS responder started"); } server.on("/", handleRoot); //Define functions to be called when //server.on("/test.svg", drawGraph); server.on("/lmu",[]() { server.send(200, "text/html", "<img src=\"https://marcomm.lmu.edu/wp-content/uploads/2017/01/university-logo.png\"/>\ "); }); server.on("/inline", []() { server.send(200, "text/plain", "this works as well"); }); server.onNotFound(handleNotFound); server.begin(); Serial.println("HTTP server started"); } void loop(void) { server.handleClient(); }
86c5741078bbead9a55897146e66e0f8150a6716
c8a3f2f6f7eda6369a5c13f637a333be865a838c
/fsm_share/fsm_cpp_in_practice/jump_cpp/network/protobuf/FriendHelpList_Ack.pb.h
aaae4a3c8304eff506738ac45d3e185bb03e575b
[]
no_license
PenpenLi/tools_script
e3a73775bb2b19fb13b7d15dce5d47c38566c6ca
8f0fce77799e4598ff00d408083597a306f8e22e
refs/heads/master
2021-06-07T22:38:17.214344
2016-11-21T02:10:50
2016-11-21T02:10:50
null
0
0
null
null
null
null
UTF-8
C++
false
true
19,385
h
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: FriendHelpList_Ack.proto #ifndef PROTOBUF_FriendHelpList_5fAck_2eproto__INCLUDED #define PROTOBUF_FriendHelpList_5fAck_2eproto__INCLUDED #include <string> #include <google/protobuf/stubs/common.h> #if GOOGLE_PROTOBUF_VERSION < 2005000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif #if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif #include <google/protobuf/generated_message_util.h> #include <google/protobuf/message.h> #include <google/protobuf/repeated_field.h> #include <google/protobuf/extension_set.h> #include <google/protobuf/unknown_field_set.h> // @@protoc_insertion_point(includes) namespace protobuf { // Internal implementation detail -- do not call these. void protobuf_AddDesc_FriendHelpList_5fAck_2eproto(); void protobuf_AssignDesc_FriendHelpList_5fAck_2eproto(); void protobuf_ShutdownFile_FriendHelpList_5fAck_2eproto(); class FriendHelpList_Ack; class FriendHelpList_Ack_FriendList; // =================================================================== class FriendHelpList_Ack_FriendList : public ::google::protobuf::Message { public: FriendHelpList_Ack_FriendList(); virtual ~FriendHelpList_Ack_FriendList(); FriendHelpList_Ack_FriendList(const FriendHelpList_Ack_FriendList& from); inline FriendHelpList_Ack_FriendList& operator=(const FriendHelpList_Ack_FriendList& from) { CopyFrom(from); return *this; } inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { return _unknown_fields_; } inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { return &_unknown_fields_; } static const ::google::protobuf::Descriptor* descriptor(); static const FriendHelpList_Ack_FriendList& default_instance(); void Swap(FriendHelpList_Ack_FriendList* other); // implements Message ---------------------------------------------- FriendHelpList_Ack_FriendList* New() const; void CopyFrom(const ::google::protobuf::Message& from); void MergeFrom(const ::google::protobuf::Message& from); void CopyFrom(const FriendHelpList_Ack_FriendList& from); void MergeFrom(const FriendHelpList_Ack_FriendList& from); void Clear(); bool IsInitialized() const; int ByteSize() const; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input); void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; int GetCachedSize() const { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; public: ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional string nickname = 1; inline bool has_nickname() const; inline void clear_nickname(); static const int kNicknameFieldNumber = 1; inline const ::std::string& nickname() const; inline void set_nickname(const ::std::string& value); inline void set_nickname(const char* value); inline void set_nickname(const char* value, size_t size); inline ::std::string* mutable_nickname(); inline ::std::string* release_nickname(); inline void set_allocated_nickname(::std::string* nickname); // optional int32 roleType = 2; inline bool has_roletype() const; inline void clear_roletype(); static const int kRoleTypeFieldNumber = 2; inline ::google::protobuf::int32 roletype() const; inline void set_roletype(::google::protobuf::int32 value); // optional int32 roleLevel = 3; inline bool has_rolelevel() const; inline void clear_rolelevel(); static const int kRoleLevelFieldNumber = 3; inline ::google::protobuf::int32 rolelevel() const; inline void set_rolelevel(::google::protobuf::int32 value); // optional int32 roleHeart = 4; inline bool has_roleheart() const; inline void clear_roleheart(); static const int kRoleHeartFieldNumber = 4; inline ::google::protobuf::int32 roleheart() const; inline void set_roleheart(::google::protobuf::int32 value); // optional int32 roleHelp = 5; inline bool has_rolehelp() const; inline void clear_rolehelp(); static const int kRoleHelpFieldNumber = 5; inline ::google::protobuf::int32 rolehelp() const; inline void set_rolehelp(::google::protobuf::int32 value); // @@protoc_insertion_point(class_scope:protobuf.FriendHelpList_Ack.FriendList) private: inline void set_has_nickname(); inline void clear_has_nickname(); inline void set_has_roletype(); inline void clear_has_roletype(); inline void set_has_rolelevel(); inline void clear_has_rolelevel(); inline void set_has_roleheart(); inline void clear_has_roleheart(); inline void set_has_rolehelp(); inline void clear_has_rolehelp(); ::google::protobuf::UnknownFieldSet _unknown_fields_; ::std::string* nickname_; ::google::protobuf::int32 roletype_; ::google::protobuf::int32 rolelevel_; ::google::protobuf::int32 roleheart_; ::google::protobuf::int32 rolehelp_; mutable int _cached_size_; ::google::protobuf::uint32 _has_bits_[(5 + 31) / 32]; friend void protobuf_AddDesc_FriendHelpList_5fAck_2eproto(); friend void protobuf_AssignDesc_FriendHelpList_5fAck_2eproto(); friend void protobuf_ShutdownFile_FriendHelpList_5fAck_2eproto(); void InitAsDefaultInstance(); static FriendHelpList_Ack_FriendList* default_instance_; }; // ------------------------------------------------------------------- class FriendHelpList_Ack : public ::google::protobuf::Message { public: FriendHelpList_Ack(); virtual ~FriendHelpList_Ack(); FriendHelpList_Ack(const FriendHelpList_Ack& from); inline FriendHelpList_Ack& operator=(const FriendHelpList_Ack& from) { CopyFrom(from); return *this; } inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { return _unknown_fields_; } inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { return &_unknown_fields_; } static const ::google::protobuf::Descriptor* descriptor(); static const FriendHelpList_Ack& default_instance(); void Swap(FriendHelpList_Ack* other); // implements Message ---------------------------------------------- FriendHelpList_Ack* New() const; void CopyFrom(const ::google::protobuf::Message& from); void MergeFrom(const ::google::protobuf::Message& from); void CopyFrom(const FriendHelpList_Ack& from); void MergeFrom(const FriendHelpList_Ack& from); void Clear(); bool IsInitialized() const; int ByteSize() const; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input); void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; int GetCachedSize() const { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; public: ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- typedef FriendHelpList_Ack_FriendList FriendList; // accessors ------------------------------------------------------- // optional string msgInfo = 1; inline bool has_msginfo() const; inline void clear_msginfo(); static const int kMsgInfoFieldNumber = 1; inline const ::std::string& msginfo() const; inline void set_msginfo(const ::std::string& value); inline void set_msginfo(const char* value); inline void set_msginfo(const char* value, size_t size); inline ::std::string* mutable_msginfo(); inline ::std::string* release_msginfo(); inline void set_allocated_msginfo(::std::string* msginfo); // repeated .protobuf.FriendHelpList_Ack.FriendList friendList = 2; inline int friendlist_size() const; inline void clear_friendlist(); static const int kFriendListFieldNumber = 2; inline const ::protobuf::FriendHelpList_Ack_FriendList& friendlist(int index) const; inline ::protobuf::FriendHelpList_Ack_FriendList* mutable_friendlist(int index); inline ::protobuf::FriendHelpList_Ack_FriendList* add_friendlist(); inline const ::google::protobuf::RepeatedPtrField< ::protobuf::FriendHelpList_Ack_FriendList >& friendlist() const; inline ::google::protobuf::RepeatedPtrField< ::protobuf::FriendHelpList_Ack_FriendList >* mutable_friendlist(); // optional int32 acktime = 3; inline bool has_acktime() const; inline void clear_acktime(); static const int kAcktimeFieldNumber = 3; inline ::google::protobuf::int32 acktime() const; inline void set_acktime(::google::protobuf::int32 value); // @@protoc_insertion_point(class_scope:protobuf.FriendHelpList_Ack) private: inline void set_has_msginfo(); inline void clear_has_msginfo(); inline void set_has_acktime(); inline void clear_has_acktime(); ::google::protobuf::UnknownFieldSet _unknown_fields_; ::std::string* msginfo_; ::google::protobuf::RepeatedPtrField< ::protobuf::FriendHelpList_Ack_FriendList > friendlist_; ::google::protobuf::int32 acktime_; mutable int _cached_size_; ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; friend void protobuf_AddDesc_FriendHelpList_5fAck_2eproto(); friend void protobuf_AssignDesc_FriendHelpList_5fAck_2eproto(); friend void protobuf_ShutdownFile_FriendHelpList_5fAck_2eproto(); void InitAsDefaultInstance(); static FriendHelpList_Ack* default_instance_; }; // =================================================================== // =================================================================== // FriendHelpList_Ack_FriendList // optional string nickname = 1; inline bool FriendHelpList_Ack_FriendList::has_nickname() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void FriendHelpList_Ack_FriendList::set_has_nickname() { _has_bits_[0] |= 0x00000001u; } inline void FriendHelpList_Ack_FriendList::clear_has_nickname() { _has_bits_[0] &= ~0x00000001u; } inline void FriendHelpList_Ack_FriendList::clear_nickname() { if (nickname_ != &::google::protobuf::internal::kEmptyString) { nickname_->clear(); } clear_has_nickname(); } inline const ::std::string& FriendHelpList_Ack_FriendList::nickname() const { return *nickname_; } inline void FriendHelpList_Ack_FriendList::set_nickname(const ::std::string& value) { set_has_nickname(); if (nickname_ == &::google::protobuf::internal::kEmptyString) { nickname_ = new ::std::string; } nickname_->assign(value); } inline void FriendHelpList_Ack_FriendList::set_nickname(const char* value) { set_has_nickname(); if (nickname_ == &::google::protobuf::internal::kEmptyString) { nickname_ = new ::std::string; } nickname_->assign(value); } inline void FriendHelpList_Ack_FriendList::set_nickname(const char* value, size_t size) { set_has_nickname(); if (nickname_ == &::google::protobuf::internal::kEmptyString) { nickname_ = new ::std::string; } nickname_->assign(reinterpret_cast<const char*>(value), size); } inline ::std::string* FriendHelpList_Ack_FriendList::mutable_nickname() { set_has_nickname(); if (nickname_ == &::google::protobuf::internal::kEmptyString) { nickname_ = new ::std::string; } return nickname_; } inline ::std::string* FriendHelpList_Ack_FriendList::release_nickname() { clear_has_nickname(); if (nickname_ == &::google::protobuf::internal::kEmptyString) { return NULL; } else { ::std::string* temp = nickname_; nickname_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); return temp; } } inline void FriendHelpList_Ack_FriendList::set_allocated_nickname(::std::string* nickname) { if (nickname_ != &::google::protobuf::internal::kEmptyString) { delete nickname_; } if (nickname) { set_has_nickname(); nickname_ = nickname; } else { clear_has_nickname(); nickname_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); } } // optional int32 roleType = 2; inline bool FriendHelpList_Ack_FriendList::has_roletype() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void FriendHelpList_Ack_FriendList::set_has_roletype() { _has_bits_[0] |= 0x00000002u; } inline void FriendHelpList_Ack_FriendList::clear_has_roletype() { _has_bits_[0] &= ~0x00000002u; } inline void FriendHelpList_Ack_FriendList::clear_roletype() { roletype_ = 0; clear_has_roletype(); } inline ::google::protobuf::int32 FriendHelpList_Ack_FriendList::roletype() const { return roletype_; } inline void FriendHelpList_Ack_FriendList::set_roletype(::google::protobuf::int32 value) { set_has_roletype(); roletype_ = value; } // optional int32 roleLevel = 3; inline bool FriendHelpList_Ack_FriendList::has_rolelevel() const { return (_has_bits_[0] & 0x00000004u) != 0; } inline void FriendHelpList_Ack_FriendList::set_has_rolelevel() { _has_bits_[0] |= 0x00000004u; } inline void FriendHelpList_Ack_FriendList::clear_has_rolelevel() { _has_bits_[0] &= ~0x00000004u; } inline void FriendHelpList_Ack_FriendList::clear_rolelevel() { rolelevel_ = 0; clear_has_rolelevel(); } inline ::google::protobuf::int32 FriendHelpList_Ack_FriendList::rolelevel() const { return rolelevel_; } inline void FriendHelpList_Ack_FriendList::set_rolelevel(::google::protobuf::int32 value) { set_has_rolelevel(); rolelevel_ = value; } // optional int32 roleHeart = 4; inline bool FriendHelpList_Ack_FriendList::has_roleheart() const { return (_has_bits_[0] & 0x00000008u) != 0; } inline void FriendHelpList_Ack_FriendList::set_has_roleheart() { _has_bits_[0] |= 0x00000008u; } inline void FriendHelpList_Ack_FriendList::clear_has_roleheart() { _has_bits_[0] &= ~0x00000008u; } inline void FriendHelpList_Ack_FriendList::clear_roleheart() { roleheart_ = 0; clear_has_roleheart(); } inline ::google::protobuf::int32 FriendHelpList_Ack_FriendList::roleheart() const { return roleheart_; } inline void FriendHelpList_Ack_FriendList::set_roleheart(::google::protobuf::int32 value) { set_has_roleheart(); roleheart_ = value; } // optional int32 roleHelp = 5; inline bool FriendHelpList_Ack_FriendList::has_rolehelp() const { return (_has_bits_[0] & 0x00000010u) != 0; } inline void FriendHelpList_Ack_FriendList::set_has_rolehelp() { _has_bits_[0] |= 0x00000010u; } inline void FriendHelpList_Ack_FriendList::clear_has_rolehelp() { _has_bits_[0] &= ~0x00000010u; } inline void FriendHelpList_Ack_FriendList::clear_rolehelp() { rolehelp_ = 0; clear_has_rolehelp(); } inline ::google::protobuf::int32 FriendHelpList_Ack_FriendList::rolehelp() const { return rolehelp_; } inline void FriendHelpList_Ack_FriendList::set_rolehelp(::google::protobuf::int32 value) { set_has_rolehelp(); rolehelp_ = value; } // ------------------------------------------------------------------- // FriendHelpList_Ack // optional string msgInfo = 1; inline bool FriendHelpList_Ack::has_msginfo() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void FriendHelpList_Ack::set_has_msginfo() { _has_bits_[0] |= 0x00000001u; } inline void FriendHelpList_Ack::clear_has_msginfo() { _has_bits_[0] &= ~0x00000001u; } inline void FriendHelpList_Ack::clear_msginfo() { if (msginfo_ != &::google::protobuf::internal::kEmptyString) { msginfo_->clear(); } clear_has_msginfo(); } inline const ::std::string& FriendHelpList_Ack::msginfo() const { return *msginfo_; } inline void FriendHelpList_Ack::set_msginfo(const ::std::string& value) { set_has_msginfo(); if (msginfo_ == &::google::protobuf::internal::kEmptyString) { msginfo_ = new ::std::string; } msginfo_->assign(value); } inline void FriendHelpList_Ack::set_msginfo(const char* value) { set_has_msginfo(); if (msginfo_ == &::google::protobuf::internal::kEmptyString) { msginfo_ = new ::std::string; } msginfo_->assign(value); } inline void FriendHelpList_Ack::set_msginfo(const char* value, size_t size) { set_has_msginfo(); if (msginfo_ == &::google::protobuf::internal::kEmptyString) { msginfo_ = new ::std::string; } msginfo_->assign(reinterpret_cast<const char*>(value), size); } inline ::std::string* FriendHelpList_Ack::mutable_msginfo() { set_has_msginfo(); if (msginfo_ == &::google::protobuf::internal::kEmptyString) { msginfo_ = new ::std::string; } return msginfo_; } inline ::std::string* FriendHelpList_Ack::release_msginfo() { clear_has_msginfo(); if (msginfo_ == &::google::protobuf::internal::kEmptyString) { return NULL; } else { ::std::string* temp = msginfo_; msginfo_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); return temp; } } inline void FriendHelpList_Ack::set_allocated_msginfo(::std::string* msginfo) { if (msginfo_ != &::google::protobuf::internal::kEmptyString) { delete msginfo_; } if (msginfo) { set_has_msginfo(); msginfo_ = msginfo; } else { clear_has_msginfo(); msginfo_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); } } // repeated .protobuf.FriendHelpList_Ack.FriendList friendList = 2; inline int FriendHelpList_Ack::friendlist_size() const { return friendlist_.size(); } inline void FriendHelpList_Ack::clear_friendlist() { friendlist_.Clear(); } inline const ::protobuf::FriendHelpList_Ack_FriendList& FriendHelpList_Ack::friendlist(int index) const { return friendlist_.Get(index); } inline ::protobuf::FriendHelpList_Ack_FriendList* FriendHelpList_Ack::mutable_friendlist(int index) { return friendlist_.Mutable(index); } inline ::protobuf::FriendHelpList_Ack_FriendList* FriendHelpList_Ack::add_friendlist() { return friendlist_.Add(); } inline const ::google::protobuf::RepeatedPtrField< ::protobuf::FriendHelpList_Ack_FriendList >& FriendHelpList_Ack::friendlist() const { return friendlist_; } inline ::google::protobuf::RepeatedPtrField< ::protobuf::FriendHelpList_Ack_FriendList >* FriendHelpList_Ack::mutable_friendlist() { return &friendlist_; } // optional int32 acktime = 3; inline bool FriendHelpList_Ack::has_acktime() const { return (_has_bits_[0] & 0x00000004u) != 0; } inline void FriendHelpList_Ack::set_has_acktime() { _has_bits_[0] |= 0x00000004u; } inline void FriendHelpList_Ack::clear_has_acktime() { _has_bits_[0] &= ~0x00000004u; } inline void FriendHelpList_Ack::clear_acktime() { acktime_ = 0; clear_has_acktime(); } inline ::google::protobuf::int32 FriendHelpList_Ack::acktime() const { return acktime_; } inline void FriendHelpList_Ack::set_acktime(::google::protobuf::int32 value) { set_has_acktime(); acktime_ = value; } // @@protoc_insertion_point(namespace_scope) } // namespace protobuf #ifndef SWIG namespace google { namespace protobuf { } // namespace google } // namespace protobuf #endif // SWIG // @@protoc_insertion_point(global_scope) #endif // PROTOBUF_FriendHelpList_5fAck_2eproto__INCLUDED
82e204ee155492d86c6e1e913b2616c23486b879
ff21c9c79c6f85c1f06f6026f581dd8307df86a6
/14923/14923.cpp
0260615169c285ceebf35169b32e3c998e329b82
[]
no_license
dahyelucy/BOJ
68ab88e2d6c03420f5e1468caf0a72a140646ee2
58c44ecfe5d3fd46b366ad810b98642cc75e7892
refs/heads/master
2020-04-02T09:58:10.741210
2018-10-23T11:54:33
2018-10-23T11:54:33
154,318,865
0
0
null
null
null
null
UTF-8
C++
false
false
1,357
cpp
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; typedef struct Node{ int x; int y; bool isbreak; }Node; int map[1001][1001]; int dist[1001][1001][2]; int N, M, hx, hy, ex, ey; queue<Node> q; int dx[4] = { -1,0,1,0 }; int dy[4] = { 0,1,0,-1 }; void solve() { Node start = { hx, hy, false }; q.push(start); dist[hx][hy][0] = 0; while (!q.empty()) { Node temp = q.front(); q.pop(); int x = temp.x; int y = temp.y; bool isbreak = temp.isbreak; if (x == ex && y == ey) { printf("%d", dist[x][y][isbreak]); return; } for (int k = 0; k < 4; k++) { int nx = temp.x + dx[k]; int ny = temp.y + dy[k]; if (nx <= 0 || ny <= 0 || nx > N || ny > M) { continue; } if (map[nx][ny] == 0 && dist[nx][ny][isbreak]==0) { dist[nx][ny][isbreak] = dist[x][y][isbreak] + 1; Node temp2 = { nx, ny, isbreak }; q.push(temp2); } else { if (isbreak == 0) { dist[nx][ny][1] = dist[x][y][isbreak] + 1; Node temp2 = { nx, ny, 1 }; q.push(temp2); } } } } printf("-1"); } int main() { freopen("input.txt", "r", stdin); scanf("%d %d", &N, &M); scanf("%d %d", &hx, &hy); scanf("%d %d", &ex, &ey); for (int i = 1; i <= N; i++) { for (int j = 1; j <=M; j++) { scanf("%d", &map[i][j]); } } solve(); return 0; }
9deeada6020c3709947a9d541672d86961022b9a
be5f4d79910e4a93201664270916dcea51d3b9ee
/fastdownward/src/search/search_engine.h
2213222fac41f53b3bca54f285314138ef9dab40
[ "MIT", "GPL-1.0-or-later", "GPL-3.0-or-later" ]
permissive
mehrdadzakershahrak/Online-Explanation-Generation
17c3ab727c2a4a60381402ff44e95c0d5fd0e283
e41ad9b5a390abdaf271562a56105c191e33b74d
refs/heads/master
2022-12-09T15:49:45.709080
2019-12-04T10:23:23
2019-12-04T10:23:23
184,834,004
0
0
MIT
2022-12-08T17:42:50
2019-05-04T00:04:59
Python
UTF-8
C++
false
false
2,396
h
#ifndef SEARCH_ENGINE_H #define SEARCH_ENGINE_H #include "operator_cost.h" #include "operator_id.h" #include "search_progress.h" #include "search_space.h" #include "search_statistics.h" #include "state_registry.h" #include "task_proxy.h" #include <vector> class Heuristic; namespace options { class OptionParser; class Options; } namespace ordered_set { template<typename T> class OrderedSet; } enum SearchStatus {IN_PROGRESS, TIMEOUT, FAILED, SOLVED}; class SearchEngine { public: using Plan = std::vector<OperatorID>; private: SearchStatus status; bool solution_found; Plan plan; protected: // Hold a reference to the task implementation and pass it to objects that need it. const std::shared_ptr<AbstractTask> task; // Use task_proxy to access task information. TaskProxy task_proxy; StateRegistry state_registry; SearchSpace search_space; SearchProgress search_progress; SearchStatistics statistics; int bound; OperatorCost cost_type; double max_time; virtual void initialize() {} virtual SearchStatus step() = 0; void set_plan(const Plan &plan); bool check_goal_and_set_plan(const GlobalState &state); int get_adjusted_cost(const OperatorProxy &op) const; public: SearchEngine(const options::Options &opts); virtual ~SearchEngine(); virtual void print_statistics() const; virtual void save_plan_if_necessary() const; bool found_solution() const; SearchStatus get_status() const; const Plan &get_plan() const; void search(); const SearchStatistics &get_statistics() const {return statistics; } void set_bound(int b) {bound = b; } int get_bound() {return bound; } /* The following three methods should become functions as they do not require access to private/protected class members. */ static void add_pruning_option(options::OptionParser &parser); static void add_options_to_parser(options::OptionParser &parser); static void add_succ_order_options(options::OptionParser &parser); }; /* Print heuristic values of all heuristics evaluated in the evaluation context. */ extern void print_initial_h_values(const EvaluationContext &eval_context); extern ordered_set::OrderedSet<OperatorID> collect_preferred_operators( EvaluationContext &eval_context, const std::vector<Heuristic *> &preferred_operator_heuristics); #endif
6dfd43c0eee7399f4c4a4ccf94eca713cbed7701
669435f6743e62fb35f6e2f33456490b2b59a2d5
/Graphics/CLIPP.CPP
0c4124f6aedb142c5be11f1580c12a2fd3951152
[]
no_license
sunil15563/prolog
b06c76d77cd06950f91513f27f6697071ec5aa05
e8fd6518155b6921cf9fbc95a7dbaa2ec56bbbd4
refs/heads/master
2020-03-12T14:08:39.116846
2018-04-05T09:04:45
2018-04-05T09:04:45
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,566
cpp
//toclip a polygon #include<iostream.h> #include<conio.h> #include"gfunc.cpp" #include"list.cpp" #include<graphics.h> #include<process.h> #include<new.h> #include<math.h> int n; float x_array[40],y_array[40],final_x[40],final_y[40]; void input() { cout<<"Enter the no. of vertices of ur polygon "; cin>>n; for(int i=0;i<n;i++) { cout<<"Enter the abscissa of vertex "<<(char)(65+i)<<" "; cin>>x_array[i]; cout<<"Enter the ordinate of vertex "<<(char)(65+i)<<" "; cin>>y_array[i]; cout<<endl; } } void clippoly(float xmin,float ymax,float xmax,float ymin) { int j=0; int x=getmaxx()/2; int y=getmaxy()/2; float m; // ************* CLIPPING ABOUT X_MIN**************** for(int i=0;i<n;i++) { if(x_array[i]>=xmin) { final_x[j]=x_array[i]; final_y[j]=y_array[i]; cout<<"Inside vertex is "<<final_x[j]<<","<<final_y[j]<<endl; j++; } if((x_array[i%n]<xmin && x_array[(i+1)%n]>xmin) || (x_array[i%n]>xmin && x_array[(i+1)%n]<xmin)) { m=(y_array[(i+1)%n]-y_array[i%n])/(x_array[(i+1)%n]-x_array[i%n]); final_y[j]=m*(xmin-x_array[i%n])+y_array[i%n]; // here point satisfying the line has abscissa as xmin final_x[j]=xmin;// i%n and (i+1)%n is used to make circular array. cout<<"Calculated is vertex is "<<final_x[j]<<","<<final_y[j]<<endl; j++; } } // *****************CLIPPING ABOUT Y_MAX **************** n=j; for(i=0;i<n;i++) { x_array[i]=final_x[i]; // using the clipped polygon y_array[i]=final_y[i]; // output as input for next clip line } j=0; for(i=0;i<n;i++) { if(y_array[i]<=ymax) { final_x[j]=x_array[i]; final_y[j]=y_array[i]; cout<<"Inside vertex is "<<final_x[j]<<","<<final_y[j]<<endl; j++; } if((y_array[i%n]<ymax && y_array[(i+1)%n]>ymax) || (y_array[i%n]>ymax && y_array[(i+1)%n]<ymax)) { m=(y_array[(i+1)%n]-y_array[i%n])/(x_array[(i+1)%n]-x_array[i%n]); final_x[j]=((1.0/m)*(ymax-y_array[i%n]))+x_array[i%n]; // here point satisfying the line has ordinate as ymax final_y[j]=ymax;// i%n and (i+1)%n is used to make circular array cout<<"Calculated final vertex is "<<final_x[j]<<","<<final_y[j]<<endl; j++; } } // *****************CLIPPING ABOUT X_MAX **************** n=j; for(i=0;i<n;i++) { x_array[i]=final_x[i]; // using the clipped polygon y_array[i]=final_y[i]; // output as input for next clip line } j=0; for(i=0;i<n;i++) { if(x_array[i]<=xmax) { final_x[j]=x_array[i]; final_y[j]=y_array[i]; cout<<"Inside vertex is "<<final_x[j]<<","<<final_y[j]<<endl; j++; } if((x_array[i%n]<xmax && x_array[(i+1)%n]>xmax) || (x_array[i%n]>xmax && x_array[(i+1)%n]<xmax)) { m=(y_array[(i+1)%n]-y_array[i%n])/(x_array[(i+1)%n]-x_array[i%n]); final_y[j]=m*(xmax-x_array[i%n])+y_array[i%n]; // here point satisfying the line has abscissa as xmax final_x[j]=xmax;// i%n and (i+1)%n is used to make circular array cout<<"Calculated vertex is "<<final_x[j]<<","<<final_y[j]<<endl; j++; } } // ************* CLIPPING ABOUT Y_MIN**************** n=j; for(i=0;i<n;i++) { x_array[i]=final_x[i]; // using the clipped polygon y_array[i]=final_y[i]; // output as input for next clip line } j=0; for(i=0;i<n;i++) { if(y_array[i]>=ymin) { final_x[j]=x_array[i]; final_y[j]=y_array[i]; cout<<"Inside vertex is "<<final_x[j]<<","<<final_y[j]<<endl; j++; } if((y_array[i%n]<ymin && y_array[(i+1)%n]>ymin) || (y_array[i%n]>ymin && y_array[(i+1)%n]<ymin)) { m=(y_array[(i+1)%n]-y_array[i%n])/(x_array[(i+1)%n]-x_array[i%n]); final_x[j]=((1.0/m)*(ymin-y_array[i%n]))+x_array[i%n]; // here point satisfying the line has ordinate as ymin final_y[j]=ymin;// i%n and (i+1)%n is used to make circular array. cout<<"Calculated final vertex is "<<final_x[j]<<","<<final_y[j]<<endl; j++; } } //************ DRAWING THE CLIPPED POLYGON ALONG THE WINDOW************ rectangle(xmin+x,y-ymax,xmax+x,y-ymin); for(i=0;i<j;i++) { line(x+final_x[i%j],y-final_y[i%j],x+final_x[(i+1)%j],y-final_y[(i+1)%j]); } } void main() { int gd=DETECT,gm,op; initgraph(&gd,&gm,"C:\\TURBOC3\\BGI"); while(1) { clrscr(); cout<<"********** MENU ***********"; cout<<"\n\t1.INPUT CLIP WINDOW AND LINE DETAILS"; cout<<"\n\t2.GET CLIPPED POLYGON"; cout<<"\n\t3.EXIT"; cout<<" \n\tGIVE UR CHOICE"; cin>>op; switch(op) { case 1: input(); break; case 2: drawaxis(); clippoly(30,150,90,100); break; case 3: break; default:cout<<"INVALID CHOICE"; } if(op==3) break; getch(); } closegraph(); }
8f1408949823ec101143fb2910d0792fc71bce46
c20c4812ac0164c8ec2434e1126c1fdb1a2cc09e
/Source/Source/KGUI/driver/khotkeymgr.h
f093bc9288edc3db60490618633875e22d974aea
[ "MIT" ]
permissive
uvbs/FullSource
f8673b02e10c8c749b9b88bf18018a69158e8cb9
07601c5f18d243fb478735b7bdcb8955598b9a90
refs/heads/master
2020-03-24T03:11:13.148940
2018-07-25T18:30:25
2018-07-25T18:30:25
142,408,505
2
2
null
2018-07-26T07:58:12
2018-07-26T07:58:12
null
GB18030
C++
false
false
3,992
h
//////////////////////////////////////////////////////////////////////////////// // // FileName : khotkeymgr.h // Version : 1.0 // Creator : Hu Changyin // Create Date : 2006-8-2 14:19:00 // Comment : // //////////////////////////////////////////////////////////////////////////////// #ifndef _INCLUDE_KHOTKEYMGR_H_ #define _INCLUDE_KHOTKEYMGR_H_ //////////////////////////////////////////////////////////////////////////////// namespace UI { #define VK_MOUSEWHEELUP 0x0100 #define VK_MOUSEWHEELDOWN 0x0101 #define VK_MOUSEHOVER 0x0102 #define UI_HOTKEY_MODIFY_CTRL 0x0001 #define UI_HOTKEY_MODIFY_SHIFT 0x0002 #define UI_HOTKEY_MODIFY_ALT 0x0004 #define KHOTKEY_TO_DWORD(HotKey) ((DWORD)HotKey.uKey | ((DWORD)HotKey.uModify << 16)) #define DWORD_TO_KHOTKEY(nKey) (KHotkeyMgr::KHOTKEY(nKey & 0x0000FFFF, (nKey & 0xFFFF0000) >> 16)) class KHotkeyMgr { public: struct KHOTKEY { unsigned short uModify; //需要的辅助键 unsigned short uKey; //虚拟键值 KHOTKEY() { uKey = 0; uModify = 0; } KHOTKEY(unsigned short uInKey, unsigned short uInModify) { uKey = uInKey; uModify = uInModify; } bool operator<(const KHOTKEY& rhs) const { if (uKey < rhs.uKey) return true; if (uKey == rhs.uKey) return uModify < rhs.uModify; return false; } bool operator==(const KHOTKEY& rhs) const { return rhs.uKey == uKey && rhs.uModify == uModify; } }; struct KHOTKEYBINDING { char szName[32]; unsigned int uNameHash; char szDesc[64]; char szHeader[64]; char szTip[128]; int nUnchangeable; int nScriptDown; int nScriptUp; KHOTKEY Hotkey[2]; KHOTKEYBINDING() { szName[0] = '\0'; uNameHash = g_StringHash(szName); szDesc[0] = '\0'; szHeader[0] = '\0'; szTip[0] = '\0'; nUnchangeable = false; nScriptDown = LUA_NOREF; nScriptUp = LUA_NOREF; } bool operator==(const KHOTKEYBINDING& rhs) const { if (strcmp(szName, rhs.szName) == 0) return true; return false; } bool operator==(const LPCSTR& pcszCommand) const { if (strcmp(szName, pcszCommand) == 0) return true; return false; } bool operator==(const unsigned int & ruNameHash) const { return uNameHash == ruNameHash; } }; typedef std::vector<KHOTKEYBINDING> KHotKeyBindingArray; struct KHOTKEYINFO { int nCommand; //在KHotKeyBindingArray中的索引 int nDown; //已经被按下 KHOTKEYINFO() { nCommand = -1; nDown = false; } }; typedef std::map<KHOTKEY, KHOTKEYINFO> KHotkeyMap; public: KHotkeyMgr(); ~KHotkeyMgr(); bool Init(); void Exit(); bool ReInit(); int HandleHotkey(UINT uMsg, WPARAM wParam, LPARAM lParam); int FlipAllDownHotkey(); //下面是提供给设置快捷键和载入玩家自定义的快捷键的接口。 //捕获所有快捷键,用于快捷键设置 int SetCaptureAllHotkey(int nCapture); int CaptureAllHotkey(UINT uMsg, WPARAM wParam, LPARAM lParam); //载入默认快捷键设置 int LoadDefault(); int Load(LPCSTR pcszFileName); int Save(LPCSTR pcszFileName); int LoadAsAdd(LPCSTR pcszFileName); int SaveAsAdd(LPCSTR pcszFileName); int LoadAsAdd(Lua_State* L); int SaveAsAdd(Lua_State* L); int Clear(); int Set(KHOTKEY Hotkey, LPCSTR pcszCommand, int nIndex); int Set(KHOTKEY Hotkey, unsigned int uCommand, int nIndex); KHOTKEY Get(LPCSTR pcszCommand, int nIndex); int IsUsed(KHOTKEY Hotkey); int Remove(KHOTKEY Hotkey); int IsKeyDown(KHOTKEY Hotkey); int GetBindingCount(); const KHOTKEYBINDING *GetBinding(int nIndex); int AddBinding(const KHOTKEYBINDING &Binding); int Enable(int nEnable); int IsEnable(); int GetCaptureKey(int &nKey, int &nShift, int &nCtrl, int &nAlt); private: int LoadBinding(); int UnLoadBinding(); private: KHotKeyBindingArray m_aHotKeyBinding; KHotkeyMap m_Hotkey; int m_nHandleAllHotKey; int m_nEnable; int m_nCaptureKey; int m_nCaptureKeyShift; int m_nCaptureKeyCtrl; int m_nCaptureKeyAlt; }; } #endif //_INCLUDE_KHOTKEYMGR_H_
01719b60ad23deffa92b5e0a70a4c032aebc061b
741a44ec9bbc4afd235e7ad6acf39315f6fb941e
/VisionSource/Engine/ThirdParty/pal-code-r685/branches/CMake_build_system/paldemo/test_motor.cpp
3d7b4d62fc0c22ee37aa9dcbcb85846c0fe21e52
[ "Apache-2.0" ]
permissive
TheophilusE/VisionEngine
423d5f184e190317de82ac3b563264484834930c
241b4203323361e2026346a185875bed1bb4133d
refs/heads/master
2023-07-29T09:37:02.979203
2021-09-10T04:46:33
2021-09-10T04:46:33
397,366,356
0
0
null
null
null
null
UTF-8
C++
false
false
5,272
cpp
#include "test_motor.h" FACTORY_CLASS_IMPLEMENTATION(Test_Motor); bool g_drive = false; void Test_Motor::CreateChain(int xyz) { m_BodyType1="palStaticBox"; m_BodyType2="palBox"; palBodyBase *pb_last = 0; palBodyBase *pb = 0; pb_last = CreateBody(m_BodyType1.c_str(),0,2,0,1,1,1,0); for (int i=1;i<5;i++) { switch (xyz) { case 0: pb = CreateBody(m_BodyType2.c_str(),i*1.5f,2,0,0.5,0.5,0.5,1); break; case 1: pb = CreateBody(m_BodyType2.c_str(),0,2+i*1.5f,0,0.5,0.5,0.5,1); break; case 2: pb = CreateBody(m_BodyType2.c_str(),0,2,i*1.5f,0.5,0.5,0.5,1); break; } palRevoluteLink *prl; prl = dynamic_cast<palRevoluteLink *>(PF->CreateObject("palRevoluteLink")); if (prl == NULL) { printf("Error: Could not create a Revolute link\n"); return; } switch (xyz) { case 0: prl->Init(pb_last,pb,i*1.5f - 1,2,0,0,0,1); break; case 1: prl->Init(pb_last,pb,0,i*1.5f - 1 + 2,0,0,0,1); break; case 2: prl->Init(pb_last,pb,0,2,i*1.5f - 1,1,0,0); break; } #if 1 palAngularMotor *pam = dynamic_cast<palAngularMotor *>(PF->CreateObject("palAngularMotor")); if (!pam) { printf("Error: Could not create a Angular Motor\n"); return; } motors.push_back(pam); desired.push_back(0); PID *pid; pid = new PID; pid->Init(50,0.1,0); pids.push_back(pid); pam->Init(prl,500.0f); #endif pb_last = pb; } } void Test_Motor::CreateSet() { m_BodyType1="palBox"; m_BodyType2="palBox"; palBodyBase *pb1; palBodyBase *pb2; float pos[3]; float dim1[3]; float dim2[3]; int i; for (i=0;i<3;i++) pos[i]=sfrand()*3; for (i=0;i<3;i++) dim1[i]=ufrand()+0.1f; for (i=0;i<3;i++) dim2[i]=ufrand()+0.1f; //ensure box 1 bigger than 2 dim1[1] += dim2[1]; //set correct pos pos[1]=dim1[1]*0.5f; pb1 = CreateBody(m_BodyType1.c_str(), pos[0], pos[1], pos[2], dim1[0], dim1[1], dim1[2], ufrand()+1); pb2 = CreateBody(m_BodyType2.c_str(), pos[0]+dim1[0]*0.5f+dim2[0]*0.5f, pos[1], pos[2], dim2[0], dim2[1], dim2[2], ufrand()+0.1); palRevoluteLink *prl; prl = dynamic_cast<palRevoluteLink *>(PF->CreateObject("palRevoluteLink")); if (prl == NULL) { printf("Error: Could not create a Revolute link\n"); return; } prl->Init(pb1,pb2,pos[0]+dim1[0]*0.5f,pos[1],pos[2],0,0,1); #if 1 palAngularMotor *pam = dynamic_cast<palAngularMotor *>(PF->CreateObject("palAngularMotor")); if (!pam) { printf("Error: Could not create a Angular Motor\n"); return; } motors.push_back(pam); desired.push_back(0); PID *pid; pid = new PID; pid->Init(1,0,0); pids.push_back(pid); pam->Init(prl,7.5f); #endif } void Test_Motor::CreateRobot() { g_drive = true; palBodyBase *pb_last = 0; palBody *pb = 0; pb_last = CreateBody("palStaticBox",0,0.5,0,1,1,1,0); pb_last->SetGroup(1); for (int i=0;i<3;i++) { if (i == 0) //base pb = dynamic_cast<palBody *>(CreateBody("palBox",0,1.25,0,0.75,0.5,0.75,0.3)); else pb = dynamic_cast<palBody *>(CreateBody("palBox",i,1.5,0,1,0.5,0.25,0.1)); pb->SetGroup(1); palRevoluteLink *prl; prl = dynamic_cast<palRevoluteLink *>(PF->CreateObject("palRevoluteLink")); if (prl == NULL) { printf("Error: Could not create a Revolute link\n"); return; } if (i==0) prl->Init(pb_last,pb,0,1,0,0,1,0); else prl->Init(pb_last,pb,i-0.5f,1.5,0,0,0,1); #if 1 palAngularMotor *pam = dynamic_cast<palAngularMotor *>(PF->CreateObject("palAngularMotor")); if (!pam) { printf("Error: Could not create a Angular Motor\n"); return; } motors.push_back(pam); desired.push_back(0); PID *pid; pid = new PID; pid->Init(2,0.1,0); pids.push_back(pid); pam->Init(prl,50.0f); #endif pb_last = pb; } PF->GetActivePhysics()->SetGroupCollision(1,1,false); } void Test_Motor::Init(int terrain_type) { CreateTerrain(terrain_type); } void Test_Motor::Update() { int i; for (i=0;i<bodies.size();i++) { bodies[i]->SetActive(true); } for (i=0;i<motors.size();i++) { printf("motor[%d]: desired: [%+6.4f] actual:[%+6.4f] diff:[%+4.2f]\n",i,desired[i],motors[i]->GetLink()->GetAngle(),diff_angle(desired[i],motors[i]->GetLink()->GetAngle())); float pid_out = pids[i]->Update(diff_angle(desired[i],motors[i]->GetLink()->GetAngle()),0.01); motors[i]->Update(pid_out); motors[i]->Apply(); } if (g_drive) if (desired.size()>0) if (fmodf(PF->GetActivePhysics()->GetTime(),40)>20) { desired[0] = 0.25f; if (desired.size()>2) { desired[1] = -0.75f; desired[2] = 1.5f;} } else { desired[0] =-0.25f; if (desired.size()>2) { desired[1] = 0.0f; desired[2] = 0.0f; } } }; void Test_Motor::Input(SDL_Event E) { switch(E.type) { case SDL_KEYDOWN: switch (E.key.keysym.sym) { case SDLK_1: CreateSet(); break; case SDLK_2: CreateChain(0); break; case SDLK_3: CreateChain(1); break; case SDLK_4: CreateChain(2); break; case SDLK_9: CreateRobot(); break; case SDLK_SPACE: palBox *pb; pb = dynamic_cast<palBox *>(CreateBody("palBox",sfrand()*3,ufrand()*3+1.5f,4,0.25f,0.25f,0.25f,5)); if (pb == NULL) { printf("Error: Could not create a box\n"); return; } pb->ApplyImpulse(0,0,-35); BuildGraphics(pb); break; } break; } }
1a00b167eef58b72189abad65a4e8501c48a3a6a
c0b2abf06ea0daebf3cd29c58b0f999255dc200a
/algorithm_toolbox/wk2/2/covering_segments/covering_segments.cpp
e554a2b74ab9be445405503a5b26389946953081
[]
no_license
moyuanhuang/coursera_algorithm_design_cse202
9c599eb3b058c6cf2daf7b402dfa0d4596deaf55
240b12c0ee21eafb6c9f738a31f81ce1837fc88d
refs/heads/master
2021-01-20T06:52:29.335001
2017-03-19T04:34:43
2017-03-19T04:34:43
82,598,418
0
0
null
null
null
null
UTF-8
C++
false
false
1,190
cpp
#include <algorithm> #include <iostream> #include <climits> #include <vector> using namespace std; struct Segment { int start, end; }; bool cmp(Segment a, Segment b){ return a.start < b.start; } vector<int> optimal_points(vector<Segment> &segments) { vector<int> points; //write your code here sort(segments.begin(), segments.end(), cmp); // for(auto s : segments){ // cout << s.start << " " << s.end << endl; // } for (size_t i = 0; i < segments.size(); ++i) { points.push_back(segments[i].end); while(i + 1 < segments.size() and segments[i+1].start <= segments[i].end){ if(segments[i+1].end < segments[i].end){ ++i; // cout << i << endl; *(points.end()-1) = segments[i].end; } else segments.erase(segments.begin() + i + 1); } } return points; } int main() { int n; std::cin >> n; vector<Segment> segments(n); for (size_t i = 0; i < segments.size(); ++i) { std::cin >> segments[i].start >> segments[i].end; } vector<int> points = optimal_points(segments); std::cout << points.size() << "\n"; for (size_t i = 0; i < points.size(); ++i) { std::cout << points[i] << " "; } }
faf84a534c568f87efb572a4c92bc76423d5e927
5446eda51198e422cc36960c7806d62e69a1bd89
/src/rpcprotocol.cpp
6ba7a14d9c68b7bf3ac138e786d68a71da68b822
[ "MIT" ]
permissive
finalprojectone/rubika
60261d7259eefdf89a5e4ea2e82d6bfcd4974afa
fbaf8d1b82e7f84e27cdfc1f9c1ef2d2fc7b441c
refs/heads/master
2020-03-29T21:52:23.356343
2018-09-28T13:06:40
2018-10-16T06:24:22
150,391,864
0
0
null
null
null
null
UTF-8
C++
false
false
9,163
cpp
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2017 The PIVX developers // Copyright (c) 2018 The LightPayCoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "rpcprotocol.h" #include "clientversion.h" #include "tinyformat.h" #include "util.h" #include "utilstrencodings.h" #include "utiltime.h" #include "version.h" #include <stdint.h> #include "json/json_spirit_writer_template.h" #include <boost/algorithm/string.hpp> #include <boost/asio.hpp> #include <boost/asio/ssl.hpp> #include <boost/bind.hpp> #include <boost/filesystem.hpp> #include <boost/foreach.hpp> #include <boost/iostreams/concepts.hpp> #include <boost/iostreams/stream.hpp> #include <boost/shared_ptr.hpp> using namespace std; using namespace boost; using namespace boost::asio; using namespace json_spirit; //! Number of bytes to allocate and read at most at once in post data const size_t POST_READ_SIZE = 256 * 1024; /** * HTTP protocol * * This ain't Apache. We're just using HTTP header for the length field * and to be compatible with other JSON-RPC implementations. */ string HTTPPost(const string& strMsg, const map<string, string>& mapRequestHeaders) { ostringstream s; s << "POST / HTTP/1.1\r\n" << "User-Agent: rubika-json-rpc/" << FormatFullVersion() << "\r\n" << "Host: 127.0.0.1\r\n" << "Content-Type: application/json\r\n" << "Content-Length: " << strMsg.size() << "\r\n" << "Connection: close\r\n" << "Accept: application/json\r\n"; BOOST_FOREACH (const PAIRTYPE(string, string) & item, mapRequestHeaders) s << item.first << ": " << item.second << "\r\n"; s << "\r\n" << strMsg; return s.str(); } static string rfc1123Time() { return DateTimeStrFormat("%a, %d %b %Y %H:%M:%S +0000", GetTime()); } static const char* httpStatusDescription(int nStatus) { switch (nStatus) { case HTTP_OK: return "OK"; case HTTP_BAD_REQUEST: return "Bad Request"; case HTTP_FORBIDDEN: return "Forbidden"; case HTTP_NOT_FOUND: return "Not Found"; case HTTP_INTERNAL_SERVER_ERROR: return "Internal Server Error"; default: return ""; } } string HTTPError(int nStatus, bool keepalive, bool headersOnly) { if (nStatus == HTTP_UNAUTHORIZED) return strprintf("HTTP/1.0 401 Authorization Required\r\n" "Date: %s\r\n" "Server: rubika-json-rpc/%s\r\n" "WWW-Authenticate: Basic realm=\"jsonrpc\"\r\n" "Content-Type: text/html\r\n" "Content-Length: 296\r\n" "\r\n" "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n" "\"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\">\r\n" "<HTML>\r\n" "<HEAD>\r\n" "<TITLE>Error</TITLE>\r\n" "<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>\r\n" "</HEAD>\r\n" "<BODY><H1>401 Unauthorized.</H1></BODY>\r\n" "</HTML>\r\n", rfc1123Time(), FormatFullVersion()); return HTTPReply(nStatus, httpStatusDescription(nStatus), keepalive, headersOnly, "text/plain"); } string HTTPReplyHeader(int nStatus, bool keepalive, size_t contentLength, const char* contentType) { return strprintf( "HTTP/1.1 %d %s\r\n" "Date: %s\r\n" "Connection: %s\r\n" "Content-Length: %u\r\n" "Content-Type: %s\r\n" "Server: rubika-json-rpc/%s\r\n" "\r\n", nStatus, httpStatusDescription(nStatus), rfc1123Time(), keepalive ? "keep-alive" : "close", contentLength, contentType, FormatFullVersion()); } string HTTPReply(int nStatus, const string& strMsg, bool keepalive, bool headersOnly, const char* contentType) { if (headersOnly) { return HTTPReplyHeader(nStatus, keepalive, 0, contentType); } else { return HTTPReplyHeader(nStatus, keepalive, strMsg.size(), contentType) + strMsg; } } bool ReadHTTPRequestLine(std::basic_istream<char>& stream, int& proto, string& http_method, string& http_uri) { string str; getline(stream, str); // HTTP request line is space-delimited vector<string> vWords; boost::split(vWords, str, boost::is_any_of(" ")); if (vWords.size() < 2) return false; // HTTP methods permitted: GET, POST http_method = vWords[0]; if (http_method != "GET" && http_method != "POST") return false; // HTTP URI must be an absolute path, relative to current host http_uri = vWords[1]; if (http_uri.size() == 0 || http_uri[0] != '/') return false; // parse proto, if present string strProto = ""; if (vWords.size() > 2) strProto = vWords[2]; proto = 0; const char* ver = strstr(strProto.c_str(), "HTTP/1."); if (ver != NULL) proto = atoi(ver + 7); return true; } int ReadHTTPStatus(std::basic_istream<char>& stream, int& proto) { string str; getline(stream, str); //LogPrintf("ReadHTTPStatus - getline string: %s\n",str.c_str()); vector<string> vWords; boost::split(vWords, str, boost::is_any_of(" ")); if (vWords.size() < 2) return HTTP_INTERNAL_SERVER_ERROR; proto = 0; const char* ver = strstr(str.c_str(), "HTTP/1."); if (ver != NULL) proto = atoi(ver + 7); return atoi(vWords[1].c_str()); } int ReadHTTPHeaders(std::basic_istream<char>& stream, map<string, string>& mapHeadersRet) { int nLen = 0; while (true) { string str; std::getline(stream, str); if (str.empty() || str == "\r") break; string::size_type nColon = str.find(":"); if (nColon != string::npos) { string strHeader = str.substr(0, nColon); boost::trim(strHeader); boost::to_lower(strHeader); string strValue = str.substr(nColon + 1); boost::trim(strValue); mapHeadersRet[strHeader] = strValue; if (strHeader == "content-length") nLen = atoi(strValue.c_str()); } } return nLen; } int ReadHTTPMessage(std::basic_istream<char>& stream, map<string, string>& mapHeadersRet, string& strMessageRet, int nProto, size_t max_size) { mapHeadersRet.clear(); strMessageRet = ""; // Read header int nLen = ReadHTTPHeaders(stream, mapHeadersRet); if (nLen < 0 || (size_t)nLen > max_size) return HTTP_INTERNAL_SERVER_ERROR; // Read message if (nLen > 0) { vector<char> vch; size_t ptr = 0; while (ptr < (size_t)nLen) { size_t bytes_to_read = std::min((size_t)nLen - ptr, POST_READ_SIZE); vch.resize(ptr + bytes_to_read); stream.read(&vch[ptr], bytes_to_read); if (!stream) // Connection lost while reading return HTTP_INTERNAL_SERVER_ERROR; ptr += bytes_to_read; } strMessageRet = string(vch.begin(), vch.end()); } string sConHdr = mapHeadersRet["connection"]; if ((sConHdr != "close") && (sConHdr != "keep-alive")) { if (nProto >= 1) mapHeadersRet["connection"] = "keep-alive"; else mapHeadersRet["connection"] = "close"; } return HTTP_OK; } /** * JSON-RPC protocol. Rubika speaks version 1.0 for maximum compatibility, * but uses JSON-RPC 1.1/2.0 standards for parts of the 1.0 standard that were * unspecified (HTTP errors and contents of 'error'). * * 1.0 spec: http://json-rpc.org/wiki/specification * 1.2 spec: http://jsonrpc.org/historical/json-rpc-over-http.html * http://www.codeproject.com/KB/recipes/JSON_Spirit.aspx */ string JSONRPCRequest(const string& strMethod, const Array& params, const Value& id) { Object request; request.push_back(Pair("method", strMethod)); request.push_back(Pair("params", params)); request.push_back(Pair("id", id)); return write_string(Value(request), false) + "\n"; } Object JSONRPCReplyObj(const Value& result, const Value& error, const Value& id) { Object reply; if (error.type() != null_type) reply.push_back(Pair("result", Value::null)); else reply.push_back(Pair("result", result)); reply.push_back(Pair("error", error)); reply.push_back(Pair("id", id)); return reply; } string JSONRPCReply(const Value& result, const Value& error, const Value& id) { Object reply = JSONRPCReplyObj(result, error, id); return write_string(Value(reply), false) + "\n"; } Object JSONRPCError(int code, const string& message) { Object error; error.push_back(Pair("code", code)); error.push_back(Pair("message", message)); return error; }
6b5287d6963a782b6d377f04f340a18758b3125f
8dc01f304229ca676cd41bfa33d6d93c48ec1737
/Robotics/Robo car/colourtrack_v5.2/colourtrack_v5.2.ino
25f5617e2fb8930f188d430dd6f8317482e18b90
[]
no_license
WaniAnuj/Development
fade9881966446b1f36a95622c78ad0beb69d2d4
9ddfd9af3c9ebe6b8a5f51ea4ce0d936a6477b84
refs/heads/master
2023-05-03T22:06:33.638023
2021-05-26T08:44:25
2021-05-26T08:44:25
270,703,507
0
0
null
null
null
null
UTF-8
C++
false
false
5,249
ino
// most reliable out of others #include <Servo.h> Servo myservo; int pos = 90; const int s0 = 7; const int s1 = 8; const int s2 = 4; const int s3 = 3; const int out = 2; // Variables int red = 0; int green = 0; int blue = 0; //Motor A const int left_motor_1 = 12; // when 1 > 2, forward const int left_motor_2 = 13; // when 2 > 1, reverse //Motor B const int right_motor_1 = 9; // when 1 > 2, forward const int right_motor_2 = 10; // when 2 > 1, reverse const int en1 = 5; // extra supply const int en2 = 6; // extra supply int colorid = 0; // stores checked color inside local variable int linecolor = 0; // stores line following color int tempcolor = 0; // stores temporary checked color int dir = 0; // 1 for left, 2 for right void setup() { Serial.begin(9600); myservo.attach(11); myservo.write(90); pinMode(s0, OUTPUT); pinMode(s1, OUTPUT); pinMode(s2, OUTPUT); pinMode(s3, OUTPUT); pinMode(out, INPUT); digitalWrite(s0, HIGH); digitalWrite(s1, HIGH); pinMode(left_motor_1, OUTPUT); pinMode(left_motor_2, OUTPUT); pinMode(right_motor_1, OUTPUT); pinMode(right_motor_2, OUTPUT); pinMode(en1, OUTPUT); pinMode(en2, OUTPUT); delay(2000); Serial.println("Started"); delay(1000); tempcolor = colorCheck(); Serial.println(tempcolor); while (tempcolor == 4) { Serial.println("No RGB line detected!"); stopRobot(); tempcolor = colorCheck(); } Serial.println("Line detected"); linecolor = tempcolor; Serial.println(linecolor); } void loop() { while(tempcolor == linecolor) { Serial.println("Following line"); switch(linecolor){ case 1: Serial.println("Following RED color"); break; case 2: Serial.println("Following BLUE color"); break; case 3: Serial.println("Following GREEN color"); break; default: Serial.println("Unknown colour"); break; } if(88<=pos<=95){ moveForward(); } else{ Serial.println(pos); stopRobot(); } tempcolor = colorCheck(); } stopRobot(); Serial.println("Checking color"); dir = servoCheck(); Serial.println(dir); switch(dir){ case 0: stopRobot(); break; case 1: moveLeft(); break; case 2: moveRight(); break; case 3: moveForward();break; default: break; } tempcolor = colorCheck(); } void color() { digitalWrite(s2, LOW); digitalWrite(s3, LOW); //count OUT, pRed, RED red = pulseIn(out, digitalRead(out) == HIGH ? LOW : HIGH); digitalWrite(s3, HIGH); //count OUT, pBLUE, BLUE blue = pulseIn(out, digitalRead(out) == HIGH ? LOW : HIGH); digitalWrite(s2, HIGH); //count OUT, pGreen, GREEN green = pulseIn(out, digitalRead(out) == HIGH ? LOW : HIGH); // Serial.print(" R Intensity:"); // Serial.print(red, DEC); // Serial.print(" G Intensity: "); // Serial.print(green, DEC); // Serial.print(" B Intensity : "); // Serial.print(blue, DEC); // Serial.println(); } int colorCheck() { color(); if (red < 12 && green < 12 && blue < 12) { Serial.println(" - (White Color)"); colorid = 4; } else if (red < blue && red < green && red < 20) { Serial.println(" - (Red Color)"); colorid = 1; } else if (blue < red && blue < green) { Serial.println(" - (Blue Color)"); colorid = 2; } else if (green < red && green < blue) { Serial.println(" - (Green Color)"); colorid = 3; } else { Serial.println(); colorid = 0; } return colorid; delay(100); } int servoCheck() { dir = 0; for (pos = 90; pos >= 10; pos -= 1) { myservo.write(pos); delay(10); } tempcolor = colorCheck(); if(linecolor == tempcolor) { dir = 2; return(dir); } else{ for (pos = 0; pos <= 170; pos += 1) { myservo.write(pos); delay(10); } tempcolor = colorCheck(); if(linecolor == tempcolor) { dir = 1; return(dir); } else{ for (pos = 170; pos >= 90; pos -= 1) { myservo.write(pos); delay(10); } tempcolor = colorCheck(); if(linecolor == tempcolor) { dir = 3; return(dir); } } delay(10); } } void moveForward() { Serial.println("Moving forward"); analogWrite(en1, 50); analogWrite(en2, 50); digitalWrite(left_motor_1, HIGH); digitalWrite(left_motor_2, LOW); digitalWrite(right_motor_1, HIGH); digitalWrite(right_motor_2, LOW); delay(50); } void stopRobot() { Serial.println("Stopping"); analogWrite(en1, 0); analogWrite(en2, 0); digitalWrite(left_motor_1, LOW); digitalWrite(left_motor_2, LOW); digitalWrite(right_motor_1, LOW); digitalWrite(right_motor_2, LOW); delay(30); } void moveLeft() { Serial.println("Moving left"); analogWrite(en1, 100); analogWrite(en2, 150); digitalWrite(left_motor_1, HIGH); digitalWrite(left_motor_2, LOW); digitalWrite(right_motor_1, LOW); digitalWrite(right_motor_2, HIGH); delay(50); } void moveRight() { Serial.println("Moving right"); analogWrite(en1, 200); analogWrite(en2, 100); digitalWrite(left_motor_1, LOW); digitalWrite(left_motor_2, HIGH); digitalWrite(right_motor_1, HIGH); digitalWrite(right_motor_2, LOW); delay(50); }
e2251f582b772f75383dbdc7f2fa9ecc10fd70d3
4bc71c372535554f9a9c9b612796213770204a0a
/Embarcadero/XE6/CPP/Settings Project/SettingsProjectForm.cpp
bc617617ee5fd449754d85a877c67abfa1df27f4
[]
no_license
jimmyat2023/Firemonkey
e843cea2a4475138ec281ae712455d9240a062c4
fe8a78893c6df92fe6a6aa472d8698d3fe1f52e0
refs/heads/master
2023-03-22T10:44:55.203200
2020-02-19T14:09:36
2020-02-19T14:09:36
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,134
cpp
//--------------------------------------------------------------------------- // This software is Copyright (c) 2013 Embarcadero Technologies, Inc. // You may only use this software if you are an authorized licensee // of Delphi, C++Builder or RAD Studio (Embarcadero Products). // This software is considered a Redistributable as defined under // the software license agreement that comes with the Embarcadero Products // and is subject to that software license agreement. //--------------------------------------------------------------------------- #include <fmx.h> #pragma hdrstop #include "SettingsProjectForm.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.fmx" TSettingsForm *SettingsForm; //--------------------------------------------------------------------------- __fastcall TSettingsForm::TSettingsForm(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TSettingsForm::ListBoxItemTab1Click(TObject * Sender) { ChangeTabAction2->ExecuteTarget(this); }
d0a5c86a1d79018444a6c8dd5a8976eec35e4619
986c21d401983789d9b3e5255bcf9d76070f65ec
/src/plugins/newlife/importers/akregator/akregatorimportpage.h
b1836fde5555342a4d2ad913068967abf90e61f6
[ "BSL-1.0" ]
permissive
0xd34df00d/leechcraft
613454669be3a0cecddd11504950372c8614c4c8
15c091d15262abb0a011db03a98322248b96b46f
refs/heads/master
2023-07-21T05:08:21.348281
2023-06-04T16:50:17
2023-06-04T16:50:17
119,854
149
71
null
2017-09-03T14:16:15
2009-02-02T13:52:45
C++
UTF-8
C++
false
false
1,035
h
/********************************************************************** * LeechCraft - modular cross-platform feature rich internet client. * Copyright (C) 2006-2014 Georg Rudoy * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt) **********************************************************************/ #pragma once #include "entitygeneratingpage.h" #include "ui_feedssettingsimportpage.h" namespace LC { struct Entity; namespace NewLife { namespace Importers { class AkregatorImportPage : public EntityGeneratingPage { Q_OBJECT Ui::FeedsSettingsImportPage Ui_; public: AkregatorImportPage (const ICoreProxy_ptr&, QWidget* = nullptr); bool CheckValidity (const QString&) const; bool isComplete () const override; int nextId () const override; void initializePage () override; private slots: void on_Browse__released (); void on_FileLocation__textEdited (const QString&); void handleAccepted (); }; } } }
abe0bd2dd008c29faaccf23af40934f3a8c51630
2cb806aa54883eb67c4ef48a7ada3b46b44a4b6f
/tfmiss/ops/cc/ops/preprocessing/spaces_after.cc
ffdc334cab8f634920a91f80164b9c0c61786689
[ "MIT" ]
permissive
templeblock/tfmiss
4eb83acd98c04448d76d265c79d82a21985c22a2
e24ab83e7a6baf991c37b9307f4d607569780e3a
refs/heads/master
2023-08-30T11:50:09.061116
2021-11-11T12:56:05
2021-11-11T12:56:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
985
cc
#include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/shape_inference.h" namespace tensorflow { namespace miss { REGISTER_OP("Miss>SpacesAfter") .Input("source_values: string") .Input("source_splits: T") .Attr("T: {int32, int64} = DT_INT64") .Output("token_values: string") .Output("space_values: string") .Output("common_splits: T") .SetShapeFn([](shape_inference::InferenceContext *c) { shape_inference::ShapeHandle unused; TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &unused)); // source_values TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 1, &unused)); // source_splits c->set_output(0, c->Vector(shape_inference::InferenceContext::kUnknownDim)); c->set_output(1, c->Vector(shape_inference::InferenceContext::kUnknownDim)); c->set_output(2, c->Vector(shape_inference::InferenceContext::kUnknownDim)); return Status::OK(); }); } // end namespace miss } // namespace tensorflow
6451e897fd7b579c548b2da404b1ad9b397ae2da
3585ef6a8bfe01aaba5a74d6ffa18137fd8ad846
/User-Level Thread Library/threadlibrary.h
76fd7254f6039435422426a490935f430b118fbd
[]
no_license
gabrielfoo/userlevel_thread_library
7f3433f683d6225d4d92ac7ce31f108996ec4fb9
0c3aaa723ce45371c36dba50ba0be8523d7854eb
refs/heads/master
2022-11-05T11:56:47.945763
2020-06-06T15:00:16
2020-06-06T15:00:16
269,970,754
0
0
null
null
null
null
UTF-8
C++
false
false
1,473
h
#ifndef THREAD_LIB_H #define THREAD_LIB_H #include <list> #include <ctime> enum THREAD_STATUS { NOT_STARTED, RUNNING, FINISH }; typedef unsigned int thread_id_; struct TCBlock { //thread control block : info about current threads here thread_id_ PID; void *(*func_ptr)(void *) = nullptr; void* func_param = nullptr; THREAD_STATUS status; unsigned* _ESP = nullptr; unsigned* Stack = nullptr; TCBlock* next = nullptr; void* returnValue; //graph for deadlock checking bool visited = false; std::list<TCBlock*> adjacent_list; }; enum THREAD_ERRORS { NO_THREAD_FOUND, WAIT_SUCCESSFUL, THREAD_DEADLOCK, }; //the "constructor" for the thread library "object". basically estatablishes the linked-list TCB for "main" void thread_library_init(); //the backbone of the thread library: pauses the current thread context switches to the next thread void thread_yield(); //adds thread. accepts function pointer with a parameter. thread_id_ add_new_thread(void *(*thd_function_t)(void *), void* parameter); //thread exit is guaranteed to stop the thread when called. if called in main, will exit void thread_exit(void *ret_value); //its like the sleep function you usually use. this will put the current thread to sleep for X seconds and yields to other threads. void thread_sleep(int seconds); //guaranteed to not allow the caller thread to proceed until the thread identified by the ID is done. THREAD_ERRORS wait_thread(thread_id_ id, void **value); #endif
edfd89b6ae8fb0878688c4957b67a5c44fe806c5
2ea91f4b2d4a44f36f9b8cea1b0d1a3c8da0b27f
/engine/src/Component/MeshComponents/AssimpMesh.h
ac5215ca6db55f8a67aa2b3822db3c332c0082a8
[]
no_license
knut0815/MoonEngine
4ed46ab414efef7ac4b499d6da2b0a3b86b7401a
243cce7988ee089d0fc51d817e2736501e019702
refs/heads/master
2021-06-12T19:51:46.802997
2017-03-24T23:58:20
2017-03-24T23:58:20
null
0
0
null
null
null
null
UTF-8
C++
false
false
883
h
#pragma once /** * Virtual mesh interface for any * renderable meshes */ #include "Component/Component.h" #include "Loaders/AssimpModelInfo.h" #include "Component/MaterialComponents/AssimpMaterial.h" #include "Mesh.h" namespace MoonEngine { class AssimpMesh: public Mesh { public: AssimpMesh(AssimpModelInfo * info): _modelInfo(info) {} void start(); virtual void bind(); //Get bounding box in world space. virtual const BoundingBox & getBoundingBox(); //Get bounding box in model space. virtual const BoundingBox & getExtents(); std::shared_ptr<Component> clone() const; //Submits an OpenGL call (Don't handle binding/unbinding); virtual void draw() const; virtual void drawShadow() const; private: AssimpModelInfo * _modelInfo; AssimpMaterial * _material; BoundingBox _transformedBox; }; }
ecaf7b8e283405323e0911c4a41e254cf95b4f3e
00e9b8471bd2e81ceb667fc82e49240babbb113e
/main/common/CL_Http_thread.cpp
83009a5072afce0d8df90a8205e5e0b24b9bbe6b
[]
no_license
Xershoo/BM-Client
4a6df1e4465d806bca6718391fc2f5c46ab1d2b4
2d1b8d26d63bb54b1ac296341353a6e07809b2d6
refs/heads/master
2020-03-29T05:01:00.564762
2019-03-06T01:46:35
2019-03-06T01:46:35
149,561,359
5
1
null
null
null
null
UTF-8
C++
false
false
1,203
cpp
#include "CL_Http_thread.h" #include <QDebug> CL_Http_Head_Thread::CL_Http_Head_Thread() { m_pFunc = NULL; m_pUser = NULL; } CL_Http_Head_Thread::~CL_Http_Head_Thread() { } bool CL_Http_Head_Thread::startthread(cbHttpHeadThreadFunc pFunc, void *pUser) { if (pFunc && pUser) { m_pFunc = pFunc; m_pUser = pUser; } start(); return true; } bool CL_Http_Head_Thread::stopthread() { exit(); wait(); return true; } void CL_Http_Head_Thread::run() { exec(); } void CL_Http_Head_Thread::customEvent(QEvent * e) { if (NULL == e) { return; } if (m_pFunc && m_pUser) { m_pFunc(m_pUser, e); } } CL_Http_Thread::CL_Http_Thread() { m_pFunc = NULL; m_pUser = NULL; } bool CL_Http_Thread::startthread(cbHttpThreadFunc pFunc, void *pUser) { if (pFunc && pUser) { m_pFunc = pFunc; m_pUser = pUser; start(); return true; } return false; } bool CL_Http_Thread::stopthread() { m_pFunc = NULL; m_pUser = NULL; exit(); return true; } void CL_Http_Thread::run() { if (m_pFunc && m_pUser) { m_pFunc(m_pUser); } }
48d14f7dfa5e9bec0df61afa4a639da6a94e150e
0966bd9089e176a53a876d2cf36c251840508d1f
/cpp/gen/KeyLink.hpp
cb19bf55a53f6445b85fc803aee56e7dbe95c4f8
[ "CC-BY-4.0", "LicenseRef-scancode-unknown-license-reference", "Unlicense" ]
permissive
TipeSoft/DiCoTAE
ee8113cc6e7eb15de4c8ab73a85857c948378781
fc900e131ab80411152ce5cd9511bfbf6b05dd6c
refs/heads/master
2021-09-06T04:17:58.807847
2018-02-02T09:07:58
2018-02-02T09:07:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,136
hpp
#ifndef KEYLINK_HPP_ #define KEYLINK_HPP_ #include <QObject> #include <qvariant.h> class KeyLink: public QObject { Q_OBJECT Q_PROPERTY(QString uuid READ uuid WRITE setUuid NOTIFY uuidChanged FINAL) Q_PROPERTY(QString url READ url WRITE setUrl NOTIFY urlChanged FINAL) Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL) public: KeyLink(QObject *parent = 0); void fillFromMap(const QVariantMap& keyLinkMap); void fillFromForeignMap(const QVariantMap& keyLinkMap); void fillFromCacheMap(const QVariantMap& keyLinkMap); void prepareNew(); bool isValid(); Q_INVOKABLE QVariantMap toMap(); QVariantMap toForeignMap(); QVariantMap toCacheMap(); QString uuid() const; void setUuid(QString uuid); QString url() const; void setUrl(QString url); QString title() const; void setTitle(QString title); virtual ~KeyLink(); Q_SIGNALS: void uuidChanged(QString uuid); void urlChanged(QString url); void titleChanged(QString title); private: QString mUuid; QString mUrl; QString mTitle; Q_DISABLE_COPY (KeyLink) }; Q_DECLARE_METATYPE(KeyLink*) #endif /* KEYLINK_HPP_ */
4ed0fd6219519a91f9f63aa4371447dc995ee0e0
dfce829880966af4344c611e103d06252228cde9
/stl/squeue.h
bf67afc779de17e33ec4c02594f41ff9b6427ffe
[]
no_license
KKRainbow/LalrLib
dc6ebbd605b607dc98979b1dde1bbb4c3c0fd904
ea4c96fdac03a8666b4a04219b33c5b58dff7941
refs/heads/master
2021-01-22T21:13:39.974926
2015-08-30T19:26:06
2015-08-30T19:26:06
36,546,524
0
0
null
null
null
null
UTF-8
C++
false
false
1,600
h
#ifndef SSTL_QUEUE_H #define SSTL_QUEUE_H #include"sstl/sstl_deque.h" #include"sstl/sstl_heap.h" SSTL_BEGIN_NAMESPACE template<class T, class Sequence = Deque<T>> class Queue :public Object { __LLIB_CLASS_DECLARE(Queue, Object); public: typedef T value_type; typedef Sequence container_type; typedef size_t size_type; protected: Sequence container; public: void Pop(){ container.PopFront(); } void Push(const value_type& x){ container.PushBack(x); } const value_type& Top(){ return container.Front(); } size_type Size(){ return container.Size(); } bool Empty(){ return container.Empty(); } Queue(container_type container = container_type()) :container(container) {} }; template <class T, class Sequence = Vector<T>, class Compare = Greater<typename Sequence::value_type> > class PriorityQueue :public Object { __LLIB_CLASS_DECLARE(PriorityQueue, Object); public: typedef T value_type; typedef Sequence container_type; typedef size_t size_type; typedef _Heap<typename container_type::iterator, Compare> algo; protected: Sequence container; public: void Pop() { algo::ExtractTop(container.Begin(), container.End()); container.PopBack(); } void Push(const value_type& x) { container.PushBack(x); algo::ModifyKey(container.Begin(), container.End(), container.End() - 1, x, AlwaysTrue<value_type>()); } const value_type& Top() { return container.Front(); } size_type Size(){ return container.Size(); } bool Empty(){ return container.Empty(); } PriorityQueue(container_type container = container_type()) :container(container) {} }; SSTL_END_NAMESPACE #endif
7235e11385571ce681b49e67e06fa4c0abd5ec45
d0f4db57f321ae2b88d193775421172a848bfecb
/CD/SW/Controller/Hovedprogram/E4PRJ4/src/TWTTLsocket.h
80fdd1e0eae369a02f69400118a289e8f4464c93
[]
no_license
mickkn/E4PRJ4
01393c0c8e81c1b338c5cad5d5bb35b96af566d3
05dc49d5c278d8c58731d1b06d6bf332c49e9c56
refs/heads/master
2020-05-27T23:26:46.197000
2015-05-27T17:04:34
2015-05-27T17:04:34
30,015,772
0
0
null
null
null
null
UTF-8
C++
false
false
391
h
/* * TWTTLsocket.h * * Created on: 26/03/2015 * Author: Overgaard */ #ifndef TWTTLSOCKET_H_ #define TWTTLSOCKET_H_ #include "GPIOsocket.h" class TWTTLsocket { public: TWTTLsocket(int msbPin, int lsbPin); ~TWTTLsocket(); int getPinValue(int pin) const; int getBabyconLevel(void); int msbPin_; int lsbPin_; private: }; #endif /* 2WTTLSOCKET_H_ */
72e23e3adc8f0625c272b5e56280310447f8d91d
82762ba9622e6112c0fe59739912cf44553850f5
/src/gallium/drivers/r600/sfn/sfn_shader_tess.cpp
e492e108a3483d92be3837bf8a41a05af8541cf8
[]
no_license
FireBurn/mesa
1fcc1ba4f27f6bfd7cb6e7cd86c7628bf64cc1b8
ce25668d020fc29a5815d1f2bedee44a796ea234
refs/heads/main
2023-08-17T20:58:46.465785
2023-07-17T16:28:43
2023-07-17T19:00:39
7,839,366
0
0
null
2023-09-05T20:11:23
2013-01-26T15:22:21
C
UTF-8
C++
false
false
7,925
cpp
/* -*- mesa-c++ -*- * * Copyright (c) 2022 Collabora LTD * * Author: Gert Wollny <[email protected]> * * 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 * on the rights to use, copy, modify, merge, publish, distribute, sub * license, 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 (including the next * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "sfn_shader_tess.h" #include "sfn_instr_export.h" #include "sfn_shader_vs.h" #include <sstream> namespace r600 { using std::string; TCSShader::TCSShader(const r600_shader_key& key): Shader("TCS", key.tcs.first_atomic_counter), m_tcs_prim_mode(key.tcs.prim_mode) { } bool TCSShader::do_scan_instruction(nir_instr *instr) { if (instr->type != nir_instr_type_intrinsic) return false; nir_intrinsic_instr *ii = nir_instr_as_intrinsic(instr); switch (ii->intrinsic) { case nir_intrinsic_load_primitive_id: m_sv_values.set(es_primitive_id); break; case nir_intrinsic_load_invocation_id: m_sv_values.set(es_invocation_id); break; case nir_intrinsic_load_tcs_rel_patch_id_r600: m_sv_values.set(es_rel_patch_id); break; case nir_intrinsic_load_tcs_tess_factor_base_r600: m_sv_values.set(es_tess_factor_base); break; default: return false; ; } return true; } int TCSShader::do_allocate_reserved_registers() { if (m_sv_values.test(es_primitive_id)) { m_primitive_id = value_factory().allocate_pinned_register(0, 0); } if (m_sv_values.test(es_invocation_id)) { m_invocation_id = value_factory().allocate_pinned_register(0, 2); } if (m_sv_values.test(es_rel_patch_id)) { m_rel_patch_id = value_factory().allocate_pinned_register(0, 1); } if (m_sv_values.test(es_tess_factor_base)) { m_tess_factor_base = value_factory().allocate_pinned_register(0, 3); } return value_factory().next_register_index(); ; } bool TCSShader::process_stage_intrinsic(nir_intrinsic_instr *instr) { switch (instr->intrinsic) { case nir_intrinsic_load_tcs_rel_patch_id_r600: return emit_simple_mov(instr->dest, 0, m_rel_patch_id); case nir_intrinsic_load_invocation_id: return emit_simple_mov(instr->dest, 0, m_invocation_id); case nir_intrinsic_load_primitive_id: return emit_simple_mov(instr->dest, 0, m_primitive_id); case nir_intrinsic_load_tcs_tess_factor_base_r600: return emit_simple_mov(instr->dest, 0, m_tess_factor_base); case nir_intrinsic_store_tf_r600: return store_tess_factor(instr); default: return false; } } bool TCSShader::store_tess_factor(nir_intrinsic_instr *instr) { auto value0 = value_factory().src_vec4(instr->src[0], pin_group, {0, 1, 7, 7}); emit_instruction(new WriteTFInstr(value0)); return true; } void TCSShader::do_get_shader_info(r600_shader *sh_info) { sh_info->processor_type = PIPE_SHADER_TESS_CTRL; sh_info->tcs_prim_mode = m_tcs_prim_mode; } bool TCSShader::read_prop(std::istream& is) { string value; is >> value; ASSERTED auto splitpos = value.find(':'); assert(splitpos != string::npos); std::istringstream ival(value); string name; string val; std::getline(ival, name, ':'); if (name == "TCS_PRIM_MODE") ival >> m_tcs_prim_mode; else return false; return true; } void TCSShader::do_print_properties(std::ostream& os) const { os << "PROP TCS_PRIM_MODE:" << m_tcs_prim_mode << "\n"; } TESShader::TESShader(const pipe_stream_output_info *so_info, const r600_shader *gs_shader, const r600_shader_key& key): VertexStageShader("TES", key.tes.first_atomic_counter), m_vs_as_gs_a(key.vs.as_gs_a), m_tes_as_es(key.tes.as_es) { if (key.tes.as_es) m_export_processor = new VertexExportForGS(this, gs_shader); else m_export_processor = new VertexExportForFs(this, so_info, key); } bool TESShader::do_scan_instruction(nir_instr *instr) { if (instr->type != nir_instr_type_intrinsic) return false; auto intr = nir_instr_as_intrinsic(instr); switch (intr->intrinsic) { case nir_intrinsic_load_tess_coord_xy: m_sv_values.set(es_tess_coord); break; case nir_intrinsic_load_primitive_id: m_sv_values.set(es_primitive_id); break; case nir_intrinsic_load_tcs_rel_patch_id_r600: m_sv_values.set(es_rel_patch_id); break; case nir_intrinsic_store_output: { int driver_location = nir_intrinsic_base(intr); int location = nir_intrinsic_io_semantics(intr).location; auto semantic = r600_get_varying_semantic(location); tgsi_semantic name = (tgsi_semantic)semantic.first; unsigned sid = semantic.second; auto write_mask = nir_intrinsic_write_mask(intr); if (location == VARYING_SLOT_LAYER) write_mask = 4; ShaderOutput output(driver_location, name, write_mask); output.set_sid(sid); switch (location) { case VARYING_SLOT_PSIZ: case VARYING_SLOT_POS: case VARYING_SLOT_CLIP_VERTEX: case VARYING_SLOT_EDGE: { break; } case VARYING_SLOT_CLIP_DIST0: case VARYING_SLOT_CLIP_DIST1: case VARYING_SLOT_VIEWPORT: case VARYING_SLOT_LAYER: case VARYING_SLOT_VIEW_INDEX: default: output.set_is_param(true); } add_output(output); break; } default: return false; } return true; } int TESShader::do_allocate_reserved_registers() { if (m_sv_values.test(es_tess_coord)) { m_tess_coord[0] = value_factory().allocate_pinned_register(0, 0); m_tess_coord[1] = value_factory().allocate_pinned_register(0, 1); } if (m_sv_values.test(es_rel_patch_id)) { m_rel_patch_id = value_factory().allocate_pinned_register(0, 2); } if (m_sv_values.test(es_primitive_id) || m_vs_as_gs_a) { m_primitive_id = value_factory().allocate_pinned_register(0, 3); } return value_factory().next_register_index(); } bool TESShader::process_stage_intrinsic(nir_intrinsic_instr *intr) { switch (intr->intrinsic) { case nir_intrinsic_load_tess_coord_xy: return emit_simple_mov(intr->dest, 0, m_tess_coord[0], pin_none) && emit_simple_mov(intr->dest, 1, m_tess_coord[1], pin_none); case nir_intrinsic_load_primitive_id: return emit_simple_mov(intr->dest, 0, m_primitive_id); case nir_intrinsic_load_tcs_rel_patch_id_r600: return emit_simple_mov(intr->dest, 0, m_rel_patch_id); case nir_intrinsic_store_output: return m_export_processor->store_output(*intr); default: return false; } } void TESShader::do_get_shader_info(r600_shader *sh_info) { sh_info->processor_type = PIPE_SHADER_TESS_EVAL; m_export_processor->get_shader_info(sh_info); } void TESShader::do_finalize() { m_export_processor->finalize(); } bool TESShader::TESShader::read_prop(std::istream& is) { (void)is; return true; } void TESShader::do_print_properties(std::ostream& os) const { (void)os; } } // namespace r600
354a906ca860b2be8fa6e72675f84ee576f9565a
c60afc4b67cf08e04579cc4bc117730ad13a8a2f
/observador/observador.ino
92162e971e0d14f5557e2949dccbb77e85331c9a
[]
no_license
lluissalord/Control-DC-Motor
9327d24391624f347881eb4df3038dbdecee6ddd
9ca4c7d3d2797a2d5a02f5a9bbe59ab19cad7c1d
refs/heads/master
2021-01-10T08:14:49.948263
2016-01-19T22:46:45
2016-01-19T22:46:45
49,986,928
0
0
null
null
null
null
UTF-8
C++
false
false
3,654
ino
//#include <avr/io.h> //#include <avr/interrupt.h> int ENB=11;//as before int encoderA=2; //connected to Arduino?s ports 2 and 3 int pulseAlength=0;//encoder Chanel B pulse length in microseconds unsigned long time_bef; unsigned long time_now_loop; volatile double v=0; volatile double v_sum=0; volatile double v_mean=0; volatile char count=0; int count_loop=0; double u=0; double pwm=0; const double K_poly[4]={0.0004087630826036687, -0.141361790772926, 17.097698790218242, -620.9671400241792}; int v_d=0; int h=8; //Sampling rate double Nx[2]={1,2.88329060337114}; double Nu=1.00280248926455; double K[2]={3.324547450664602, -0.774925825115605}; #define SIZE 3 //Estat de l'observador double estat[SIZE]={0, 0, 0}; //Per guardar la variable en aquest mateix instant, sino es modifica i no calcula be x2 double estat_bef[SIZE]={0, 0, 0}; double gam[SIZE]={ 0.209498836038743, 0.674398104977198, 0}; double phi[SIZE][SIZE]={ {-0.025032383058131, 0.282644568614630, 0.209498836038743}, {-0.070573033383841, 0.789922297691954, 0.674398104977198}, { 0, 0, 1.000000000000000}}; double L[SIZE]={ 0.864889914633823, 2.454431859332966, 0.426210231983564}; void setup() { pinMode(ENB,OUTPUT); //outputs pinMode(encoderA,INPUT); //inputs pinMode(encoderA,INPUT_PULLUP);//Enable pull up resistor //digitalWrite(IN1,HIGH); digitalWrite(IN2,LOW);//setting motorA?s direction-- //analogWrite(ENA,150);//start driving motorA digitalWrite(encoderA,HIGH);//start driving motorA Serial.begin(115200); Serial.println("Starting data acquisition..."); while(!Serial){}; attachInterrupt(digitalPinToInterrupt(encoderA),updateStadistic,RISING); time_bef=micros(); Serial.println("v_mean;pwm"); time_now_loop = micros(); /*//Arrancada v_d = 150; pwm=K_poly[0]*v_d*v_d*v_d+K_poly[1]*v_d*v_d+K_poly[2]*v_d+K_poly[3]; //Rang de PWM if(pwm>255){ pwm=255; }else if (pwm<0){ pwm=0; } analogWrite(ENA,pwm); delay(3000); */ } void loop() { Serial.print(estat[0]); Serial.print(";"); Serial.print(estat[1]); Serial.print(";"); Serial.print(estat[2]); Serial.print(";"); if(count_loop==80){ v_d=120; }else if (count_loop==160){ v_d=160; count_loop=0; } //Velocitat maxima del motor if(v_d>180){ v_d=180; } u=K[0]*(Nx[0]*v_d-estat[0]) + K[1]*(Nx[1]*v_d-estat[1]) - estat[2]; u=u+Nu*v_d; //Actualitzacio estats char i=0; while(i<SIZE){ estat_bef[i]=estat[i]; i++; } estat[0]=gam[0]*u + L[0]*(v_mean-estat_bef[0]) + estat_bef[0]*phi[0][0] + estat_bef[1]*phi[0][1] + estat_bef[2]*phi[0][2]; estat[1]=gam[1]*u + L[1]*(v_mean-estat_bef[0]) + estat_bef[0]*phi[1][0] + estat_bef[1]*phi[1][1] + estat_bef[2]*phi[1][2]; estat[2]= L[2]*(v_mean-estat_bef[0]) + estat_bef[2]; pwm=K_poly[0]*u*u*u+K_poly[1]*u*u+K_poly[2]*u+K_poly[3]; //Rang de PWM if(pwm>255){ pwm=255; }else if (pwm<0){ pwm=0; } analogWrite(ENB,pwm); unsigned long time_bef_loop = time_now_loop; time_now_loop = micros(); Serial.print(v_mean); Serial.print(";"); Serial.print(v_d); Serial.print(";"); Serial.print(u); Serial.print(";"); Serial.print(pwm); Serial.print(";"); Serial.println(time_now_loop-time_bef_loop); count_loop++; delay(h); } //360 pulses total/revolution i per tant 180 pulses per encoder/revolution void updateStadistic(){ if (count==2){ unsigned long time_now = micros(); v=2*1000000/((time_now-time_bef)); time_bef=time_now; v_mean=(v_sum+v)/3; v_sum=0; count=0; } v_sum=v_sum+v; count++; }
45324d1fdbbb1963f08ef8cba80c470da9bcb36f
24146e5b09a792692d9acb9e82ba4fbd12af20ad
/src/filters/parser/AudioSplitter/stdafx.h
d6123097e9228d557f9d250df43c3858c33fc2c8
[]
no_license
RocherKong/MPCBE
846a0bdeaa92d37f93526b0be4d5325e0f360312
3a3a879aa4d71cfd23cab36d2e30b67f82e7b04e
refs/heads/master
2020-06-10T07:39:51.502548
2017-11-29T05:35:40
2017-11-29T05:35:40
75,987,960
0
0
null
null
null
null
UTF-8
C++
false
false
1,050
h
/* * (C) 2003-2006 Gabest * (C) 2006-2017 see Authors.txt * * This file is part of MPC-BE. * * MPC-BE 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. * * MPC-BE 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, see <http://www.gnu.org/licenses/>. * */ #pragma once #include "../../../DSUtil/SharedInclude.h" #include "../../../../include/stdafx_common.h" #include <afxwin.h> // MFC core and standard components #include "../../../../include/stdafx_common_dshow.h" #include "../../../DSUtil/DSUtil.h" #include <algorithm> #include <map>
b9f123ae3a235342cba3fb034eb2cd92d1678ba5
d69fced8e9e8f0bea1777bb170865729c910008d
/samples/Juliet-1.3/C/testcases/CWE134_Uncontrolled_Format_String/s06/testcases.h
96ae5bc245efe9c2fcb34d457be2258d27d1391e
[]
no_license
maurer/marduk
efe7ba04ecc84263441a2167e4bc8b3d6d4d017a
2c47519a96e331f403fd7a9a058d0b51309a613f
refs/heads/master
2021-06-03T19:59:15.786320
2020-04-21T05:00:03
2020-04-21T05:01:45
110,798,164
3
1
null
null
null
null
UTF-8
C++
false
false
44,588
h
// NOTE - eventually this file will be automatically updated using a Perl script that understand // the naming of test case files, functions, and namespaces. #ifndef _TESTCASES_H #define _TESTCASES_H #ifdef __cplusplus extern "C" { #endif // declare C good and bad functions #ifndef OMITGOOD /* BEGIN-AUTOGENERATED-C-GOOD-FUNCTION-DECLARATIONS */ void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_44_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_04_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_14_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_15_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_06_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_51_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_15_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_34_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_34_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_16_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_05_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_05_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_54_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_63_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_68_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_63_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_04_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_14_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_05_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_15_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_34_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_61_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_61_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_04_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_22_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_04_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_17_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_52_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_53_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_14_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_07_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_14_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_54_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_34_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_05_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_15_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_45_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_07_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_17_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_53_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_05_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_16_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_16_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_45_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_68_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_64_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_64_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_65_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_34_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_65_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_22_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_06_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_15_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_52_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_06_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_45_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_44_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_51_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_07_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_44_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_17_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_54_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_06_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_45_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_16_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_45_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_68_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_53_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_07_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_44_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_67_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_14_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_67_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_07_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_51_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_66_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_17_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_44_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_17_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_66_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_04_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_52_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_06_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_16_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_22_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_02_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_09_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_12_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_63_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_42_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_09_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_64_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_13_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_18_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_08_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_13_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_32_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_32_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_21_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_31_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_18_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_08_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_03_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_10_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_03_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_61_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_65_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_41_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_02_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_12_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_41_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_18_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_03_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_13_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_18_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_67_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_32_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_02_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_11_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_54_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_54_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_41_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_02_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_09_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_63_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_01_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_12_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_12_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_41_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_09_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_61_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_32_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_08_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_08_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_03_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_66_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_13_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_51_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_01_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_11_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_41_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_51_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_66_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_10_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_03_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_10_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_31_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_65_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_31_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_21_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_21_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_32_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_64_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_63_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_68_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_13_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_68_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_67_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_42_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_01_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_11_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_09_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_42_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_65_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_22_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_08_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_10_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_22_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_52_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_52_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_31_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_21_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_66_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_12_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_01_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_42_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_01_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_61_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_11_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_67_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_02_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_11_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_42_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_53_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_31_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_21_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_53_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_18_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_64_good(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_10_good(); /* END-AUTOGENERATED-C-GOOD-FUNCTION-DECLARATIONS */ #endif // OMITGOOD #ifndef OMITBAD /* BEGIN-AUTOGENERATED-C-BAD-FUNCTION-DECLARATIONS */ void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_44_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_04_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_14_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_15_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_06_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_51_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_15_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_34_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_34_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_16_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_05_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_05_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_54_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_63_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_68_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_63_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_04_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_14_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_05_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_15_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_34_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_61_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_61_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_04_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_22_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_04_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_17_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_52_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_53_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_14_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_07_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_14_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_54_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_34_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_05_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_15_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_45_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_07_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_17_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_53_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_05_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_16_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_16_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_45_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_68_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_64_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_64_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_65_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_34_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_65_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_22_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_06_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_15_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_52_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_06_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_45_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_44_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_51_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_07_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_44_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_17_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_54_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_06_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_45_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_16_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_45_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_68_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_53_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_07_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_44_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_67_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_14_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_67_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_07_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_51_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_66_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_17_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_44_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_17_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_66_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_04_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_52_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_06_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_16_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_22_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_02_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_09_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_12_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_63_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_42_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_09_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_64_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_13_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_18_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_08_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_13_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_32_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_32_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_21_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_31_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_18_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_08_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_03_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_10_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_03_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_61_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_65_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_41_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_02_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_12_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_41_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_18_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_03_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_13_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_18_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_67_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_32_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_02_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_11_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_54_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_54_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_41_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_02_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_09_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_63_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_01_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_12_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_12_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_41_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_09_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_61_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_32_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_08_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_08_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_03_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_66_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_13_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_51_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_01_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_11_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_41_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_51_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_66_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_10_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_03_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_10_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_31_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_65_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_31_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_21_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_21_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_32_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_64_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_63_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_68_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_13_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_68_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_67_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_42_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_01_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_11_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_09_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_42_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_65_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_22_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_08_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_10_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_22_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_52_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_52_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_31_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_21_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_66_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_12_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_01_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_42_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_01_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_61_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_11_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_67_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_02_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_11_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_42_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_53_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_31_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_21_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_53_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_18_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_64_bad(); void CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_10_bad(); /* END-AUTOGENERATED-C-BAD-FUNCTION-DECLARATIONS */ #endif // OMITBAD #ifdef __cplusplus } // end extern "C" #endif #ifdef __cplusplus // declare C++ namespaces and good and bad functions #ifndef OMITGOOD /* BEGIN-AUTOGENERATED-CPP-GOOD-FUNCTION-DECLARATIONS */ namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_83 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_62 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_84 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_72 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_83 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_74 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_81 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_72 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_83 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_84 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_43 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_62 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_82 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_43 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_81 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_73 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_74 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_73 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_43 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_84 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_82 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_83 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_84 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_72 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_33 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_83 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_73 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_84 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_82 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_33 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_62 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_82 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_33 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_33 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_73 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_74 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_73 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_81 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_84 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_82 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_83 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_83 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_84 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_84 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_74 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_62 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_43 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_62 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_83 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_43 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_81 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_84 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_83 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_84 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_72 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_81 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_74 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_72 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_33 { void good();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_83 { void good();} /* END-AUTOGENERATED-CPP-GOOD-FUNCTION-DECLARATIONS */ #endif // OMITGOOD #ifndef OMITBAD /* BEGIN-AUTOGENERATED-CPP-BAD-FUNCTION-DECLARATIONS */ namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_83 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_62 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_84 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_72 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_83 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_74 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_81 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_72 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_83 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_84 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_43 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_62 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_82 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_43 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_81 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_73 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_74 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_73 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_43 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_84 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_82 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_83 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_84 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_72 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_33 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_83 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_73 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_84 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_82 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_33 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_62 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_82 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_33 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_33 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_73 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_74 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_73 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_81 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_84 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_82 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_83 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_83 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_84 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_84 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_74 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_62 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_43 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_62 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_83 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_43 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_printf_81 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_84 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_83 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_w32_vsnprintf_84 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_72 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_81 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vprintf_74 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_72 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_snprintf_33 { void bad();} namespace CWE134_Uncontrolled_Format_String__wchar_t_listen_socket_vfprintf_83 { void bad();} /* END-AUTOGENERATED-CPP-BAD-FUNCTION-DECLARATIONS */ #endif // OMITBAD #endif // __cplusplus #endif // _TESTCASES_H
aaf9b78ba954d535c0f3b7c8bc60bc7c3b70a8c8
bf4c7063613e2828949ddb332ce5996574b11d3d
/src/compiler/translator/tree_ops/spirv/EmulateFramebufferFetch.cpp
23791298743dea835f4ea42a55b666816266fb01
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
google/angle
86e1915dcedbb5c79c1de742aa17996a43380670
2ed7d887bad338a357abcc7506f564ba7e98b77f
refs/heads/main
2023-08-31T14:36:59.914898
2023-08-31T13:42:55
2023-08-31T14:15:02
23,355,681
3,159
654
NOASSERTION
2023-07-12T02:03:11
2014-08-26T14:59:07
C++
UTF-8
C++
false
false
20,208
cpp
// // Copyright 2023 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // EmulateFramebufferFetch.h: Replace input, gl_LastFragData and gl_LastFragColorARM with usages of // input attachments. // #include "compiler/translator/tree_ops/spirv/EmulateFramebufferFetch.h" #include "common/bitset_utils.h" #include "compiler/translator/Compiler.h" #include "compiler/translator/ImmutableStringBuilder.h" #include "compiler/translator/SymbolTable.h" #include "compiler/translator/tree_util/BuiltIn.h" #include "compiler/translator/tree_util/IntermNode_util.h" #include "compiler/translator/tree_util/IntermTraverse.h" #include "compiler/translator/tree_util/ReplaceVariable.h" #include "compiler/translator/tree_util/RunAtTheBeginningOfShader.h" #include "compiler/translator/util.h" namespace sh { namespace { using InputAttachmentIndexUsage = angle::BitSet<32>; // A traverser that looks at which inout variables exist, which gl_LastFragData indices have been // used and whether gl_LastFragColorARM is referenced. It builds a set of indices correspondingly; // these are input attachment indices the shader may read from. class InputAttachmentUsageTraverser : public TIntermTraverser { public: InputAttachmentUsageTraverser(uint32_t maxDrawBuffers, TVector<const TType *> *attachmentTypes) : TIntermTraverser(true, false, false), mMaxDrawBuffers(maxDrawBuffers), mAttachmentTypes(attachmentTypes), mUsesLastFragColorARM(false) { mAttachmentTypes->resize(maxDrawBuffers, nullptr); } bool visitDeclaration(Visit visit, TIntermDeclaration *node) override; bool visitBinary(Visit visit, TIntermBinary *node) override; void visitSymbol(TIntermSymbol *node) override; InputAttachmentIndexUsage getIndexUsage() const { return mIndexUsage; } bool usesLastFragColorARM() const { return mUsesLastFragColorARM; } private: void setInputAttachmentIndex(uint32_t index, const TType *type); uint32_t mMaxDrawBuffers; InputAttachmentIndexUsage mIndexUsage; TVector<const TType *> *mAttachmentTypes; bool mUsesLastFragColorARM; }; void InputAttachmentUsageTraverser::setInputAttachmentIndex(uint32_t index, const TType *type) { ASSERT(index < mMaxDrawBuffers); mIndexUsage.set(index); (*mAttachmentTypes)[index] = type; } bool InputAttachmentUsageTraverser::visitDeclaration(Visit visit, TIntermDeclaration *node) { const TIntermSequence &sequence = *node->getSequence(); ASSERT(sequence.size() == 1); TIntermSymbol *symbol = sequence.front()->getAsSymbolNode(); if (symbol == nullptr) { return true; } if (symbol->getQualifier() == EvqFragmentInOut) { ASSERT(symbol->getType().getLayoutQualifier().index <= 0); // The input attachment index is identical to the location qualifier. If there's only one // output, GLSL is allowed to not specify the location qualifier, in which case it would // implicitly be at location 0. const TType &type = symbol->getType(); const unsigned int baseInputAttachmentIndex = std::max(0, type.getLayoutQualifier().location); uint32_t arraySize = type.isArray() ? type.getOutermostArraySize() : 1; for (unsigned int index = 0; index < arraySize; index++) { setInputAttachmentIndex(baseInputAttachmentIndex + index, &type); } } return false; } bool InputAttachmentUsageTraverser::visitBinary(Visit visit, TIntermBinary *node) { TOperator op = node->getOp(); if (op != EOpIndexDirect && op != EOpIndexIndirect) { return true; } TIntermSymbol *left = node->getLeft()->getAsSymbolNode(); if (left == nullptr || left->getQualifier() != EvqLastFragData) { return true; } ASSERT(left->getName() == "gl_LastFragData"); const TType &type = left->getType(); const TConstantUnion *constIndex = node->getRight()->getConstantValue(); // Non-const indices on gl_LastFragData are not allowed. ASSERT(constIndex != nullptr); uint32_t index = 0; switch (constIndex->getType()) { case EbtInt: index = constIndex->getIConst(); break; case EbtUInt: index = constIndex->getUConst(); break; case EbtFloat: index = static_cast<uint32_t>(constIndex->getFConst()); break; case EbtBool: index = constIndex->getBConst() ? 1 : 0; break; default: UNREACHABLE(); break; } setInputAttachmentIndex(index, &type); return true; } void InputAttachmentUsageTraverser::visitSymbol(TIntermSymbol *symbol) { if (symbol->getQualifier() != EvqLastFragColor) { return; } ASSERT(symbol->getName() == "gl_LastFragColorARM"); // gl_LastFragColorARM always reads back from location 0. setInputAttachmentIndex(0, &symbol->getType()); mUsesLastFragColorARM = true; } ImmutableString GetInputAttachmentName(size_t index) { std::stringstream nameStream = sh::InitializeStream<std::stringstream>(); nameStream << "ANGLEInputAttachment" << index; return ImmutableString(nameStream.str()); } TBasicType GetBasicTypeForSubpassInput(TBasicType inputType) { switch (inputType) { case EbtFloat: return EbtSubpassInput; case EbtInt: return EbtISubpassInput; case EbtUInt: return EbtUSubpassInput; default: UNREACHABLE(); return EbtVoid; } } // Declare an input attachment variable at a given index. void DeclareInputAttachmentVariable(TSymbolTable *symbolTable, const TType &outputType, size_t index, TVector<const TVariable *> *inputAttachmentVarsOut, TIntermSequence *declarationsOut) { const TBasicType subpassInputType = GetBasicTypeForSubpassInput(outputType.getBasicType()); TType *inputAttachmentType = new TType(subpassInputType, outputType.getPrecision(), EvqUniform, 1); TLayoutQualifier inputAttachmentQualifier = inputAttachmentType->getLayoutQualifier(); inputAttachmentQualifier.inputAttachmentIndex = static_cast<int>(index); inputAttachmentType->setLayoutQualifier(inputAttachmentQualifier); (*inputAttachmentVarsOut)[index] = new TVariable( symbolTable, GetInputAttachmentName(index), inputAttachmentType, SymbolType::AngleInternal); TIntermDeclaration *decl = new TIntermDeclaration; decl->appendDeclarator(new TIntermSymbol((*inputAttachmentVarsOut)[index])); declarationsOut->push_back(decl); } // Declare a global variable to hold gl_LastFragData/gl_LastFragColorARM const TVariable *DeclareLastFragDataGlobalVariable(TCompiler *compiler, TIntermBlock *root, const TVector<const TType *> &attachmentTypes, TIntermSequence *declarationsOut) { // Find the first input attachment that is used. If gl_LastFragColorARM was used, this will be // index 0. Otherwise if this is ES100, any index of gl_LastFragData may be used. Either way, // the global variable is declared the same as gl_LastFragData would have been if used. const TType *attachmentType = nullptr; for (const TType *type : attachmentTypes) { if (type != nullptr) { attachmentType = type; break; } } ASSERT(attachmentType != nullptr); TType *globalType = new TType(*attachmentType); globalType->setQualifier(EvqGlobal); // If the type of gl_LastFragColorARM is found, convert it to an array to match gl_LastFragData. // This is necessary if the shader uses both gl_LastFragData and gl_LastFragColorARM // simultaneously. if (!globalType->isArray()) { globalType->makeArray(compiler->getBuiltInResources().MaxDrawBuffers); } // Declare the global const TVariable *global = new TVariable(&compiler->getSymbolTable(), ImmutableString("ANGLELastFragData"), globalType, SymbolType::AngleInternal); TIntermDeclaration *decl = new TIntermDeclaration; decl->appendDeclarator(new TIntermSymbol(global)); declarationsOut->push_back(decl); return global; } // Declare an input attachment for each used index. Additionally, create a global variable for // gl_LastFragData and gl_LastFragColorARM if needed. [[nodiscard]] bool DeclareVariables(TCompiler *compiler, TIntermBlock *root, InputAttachmentIndexUsage indexUsage, bool usesLastFragData, const TVector<const TType *> &attachmentTypes, TVector<const TVariable *> *inputAttachmentVarsOut, const TVariable **lastFragDataOut) { TSymbolTable *symbolTable = &compiler->getSymbolTable(); TIntermSequence declarations; inputAttachmentVarsOut->resize(indexUsage.last() + 1, nullptr); // For every detected index, declare an input attachment variable. for (size_t index : indexUsage) { ASSERT(attachmentTypes[index] != nullptr); DeclareInputAttachmentVariable(symbolTable, *attachmentTypes[index], index, inputAttachmentVarsOut, &declarations); } // If gl_LastFragData or gl_LastFragColorARM is used, declare a global variable to retain that. // The difference between ES300+ inout variables and gl_LastFrag* is that if the inout variable // is read back after being written to, it should contain the latest value written to it, while // gl_LastFrag* should contain the value before the fragment shader's invocation. // // As such, it is enough to initialize inout variables with the values from input attachments, // but gl_LastFrag* needs to be stored in a global variable to retain its value even after // gl_Frag* has been overwritten. *lastFragDataOut = nullptr; if (usesLastFragData) { *lastFragDataOut = DeclareLastFragDataGlobalVariable(compiler, root, attachmentTypes, &declarations); } // Add the declarations to the beginning of the shader. TIntermSequence &topLevel = *root->getSequence(); declarations.insert(declarations.end(), topLevel.begin(), topLevel.end()); topLevel = std::move(declarations); return compiler->validateAST(root); } TIntermTyped *CreateSubpassLoadFuncCall(TSymbolTable *symbolTable, const TVariable *inputVariable) { TIntermSequence args = {new TIntermSymbol(inputVariable)}; return CreateBuiltInFunctionCallNode("subpassLoad", &args, *symbolTable, kESSLInternalBackendBuiltIns); } void GatherInoutVariables(TIntermBlock *root, TVector<const TVariable *> *inoutVariablesOut) { TIntermSequence &topLevel = *root->getSequence(); for (TIntermNode *node : topLevel) { TIntermDeclaration *decl = node->getAsDeclarationNode(); if (decl != nullptr) { ASSERT(decl->getSequence()->size() == 1); TIntermSymbol *symbol = decl->getSequence()->front()->getAsSymbolNode(); if (symbol != nullptr && symbol->getQualifier() == EvqFragmentInOut) { ASSERT(symbol->getType().getLayoutQualifier().index <= 0); inoutVariablesOut->push_back(&symbol->variable()); } } } } void InitializeFromInputAttachmentIfPresent(TSymbolTable *symbolTable, TIntermBlock *block, const TVariable *inputVariable, const TVariable *assignVariable, uint32_t assignVariableArrayIndex) { if (inputVariable == nullptr) { // No input variable usage for this index return; } TIntermTyped *var = new TIntermSymbol(assignVariable); if (var->getType().isArray()) { var = new TIntermBinary(EOpIndexDirect, var, CreateIndexNode(assignVariableArrayIndex)); } TIntermTyped *input = CreateSubpassLoadFuncCall(symbolTable, inputVariable); const int vecSize = assignVariable->getType().getNominalSize(); if (vecSize < 4) { TVector<int> swizzle = {0, 1, 2, 3}; swizzle.resize(vecSize); input = new TIntermSwizzle(input, swizzle); } TIntermTyped *assignment = new TIntermBinary(EOpAssign, var, input); block->appendStatement(assignment); } [[nodiscard]] bool InitializeFromInputAttachments( TCompiler *compiler, TIntermBlock *root, const TVector<const TVariable *> &inputAttachmentVars, const TVector<const TVariable *> &inoutVariables, const TVariable *lastFragData) { TSymbolTable *symbolTable = &compiler->getSymbolTable(); TIntermBlock *init = new TIntermBlock; // Initialize inout variables for (const TVariable *inoutVar : inoutVariables) { const TType &type = inoutVar->getType(); const unsigned int baseInputAttachmentIndex = std::max(0, type.getLayoutQualifier().location); uint32_t arraySize = type.isArray() ? type.getOutermostArraySize() : 1; for (unsigned int index = 0; index < arraySize; index++) { InitializeFromInputAttachmentIfPresent( symbolTable, init, inputAttachmentVars[baseInputAttachmentIndex + index], inoutVar, index); } } // Initialize lastFragData, if present if (lastFragData != nullptr) { for (uint32_t index = 0; index < inputAttachmentVars.size(); ++index) { InitializeFromInputAttachmentIfPresent(symbolTable, init, inputAttachmentVars[index], lastFragData, index); } } return RunAtTheBeginningOfShader(compiler, root, init); } [[nodiscard]] bool ReplaceVariables(TCompiler *compiler, TIntermBlock *root, const TVector<const TVariable *> &inputAttachmentVars, const TVariable *lastFragData) { TSymbolTable *symbolTable = &compiler->getSymbolTable(); TVector<const TVariable *> inoutVariables; GatherInoutVariables(root, &inoutVariables); // Generate code that initializes the global variable and the inout variables with corresponding // input attachments. if (!InitializeFromInputAttachments(compiler, root, inputAttachmentVars, inoutVariables, lastFragData)) { return false; } // Build a map from: // // - inout to out variables // - gl_LastFragData to lastFragData // - gl_LastFragColorARM to lastFragData[0] VariableReplacementMap replacementMap; for (const TVariable *var : inoutVariables) { TType *outType = new TType(var->getType()); outType->setQualifier(EvqFragmentOut); const TVariable *replacement = new TVariable(symbolTable, var->name(), outType, var->symbolType()); replacementMap[var] = new TIntermSymbol(replacement); } if (lastFragData != nullptr) { // Use the user-defined variables if found (and remove their declaration), or the built-in // otherwise. TIntermSequence &topLevel = *root->getSequence(); TIntermSequence newTopLevel; const TVariable *glLastFragData = nullptr; const TVariable *glLastFragColor = nullptr; for (TIntermNode *node : topLevel) { TIntermDeclaration *decl = node->getAsDeclarationNode(); if (decl != nullptr) { ASSERT(decl->getSequence()->size() == 1); TIntermSymbol *symbol = decl->getSequence()->front()->getAsSymbolNode(); if (symbol != nullptr) { if (symbol->getQualifier() == EvqLastFragData) { glLastFragData = &symbol->variable(); continue; } if (symbol->getQualifier() == EvqLastFragColor) { glLastFragColor = &symbol->variable(); continue; } } } newTopLevel.push_back(node); } topLevel = std::move(newTopLevel); if (glLastFragData == nullptr) { glLastFragData = static_cast<const TVariable *>( symbolTable->findBuiltIn(ImmutableString("gl_LastFragData"), 100)); } if (glLastFragColor == nullptr) { glLastFragColor = static_cast<const TVariable *>(symbolTable->findBuiltIn( ImmutableString("gl_LastFragColorARM"), compiler->getShaderVersion())); } replacementMap[glLastFragData] = new TIntermSymbol(lastFragData); replacementMap[glLastFragColor] = new TIntermBinary(EOpIndexDirect, new TIntermSymbol(lastFragData), CreateIndexNode(0)); } // Replace the variables accordingly. return ReplaceVariables(compiler, root, replacementMap); } void AddInputAttachmentsToUniforms(const TVector<const TVariable *> &inputAttachmentVars, std::vector<ShaderVariable> *uniforms) { for (const TVariable *inputVar : inputAttachmentVars) { if (inputVar == nullptr) { continue; } ShaderVariable uniform; uniform.active = true; uniform.staticUse = true; uniform.name.assign(inputVar->name().data(), inputVar->name().length()); uniform.mappedName.assign(uniform.name); uniform.isFragmentInOut = true; uniform.location = inputVar->getType().getLayoutQualifier().inputAttachmentIndex; uniforms->push_back(uniform); } } } // anonymous namespace [[nodiscard]] bool EmulateFramebufferFetch(TCompiler *compiler, TIntermBlock *root, std::vector<ShaderVariable> *uniforms) { // First, check if input attachments are necessary at all. TVector<const TType *> attachmentTypes; InputAttachmentUsageTraverser usageTraverser(compiler->getBuiltInResources().MaxDrawBuffers, &attachmentTypes); root->traverse(&usageTraverser); InputAttachmentIndexUsage indexUsage = usageTraverser.getIndexUsage(); if (!indexUsage.any()) { return true; } const bool usesLastFragData = compiler->getShaderVersion() == 100 || usageTraverser.usesLastFragColorARM(); // Declare the necessary variables for emulation; input attachments to read from and global // variables to hold last frag data. TVector<const TVariable *> inputAttachmentVars; const TVariable *lastFragData = nullptr; if (!DeclareVariables(compiler, root, indexUsage, usesLastFragData, attachmentTypes, &inputAttachmentVars, &lastFragData)) { return false; } // Then replace references to gl_LastFragData with the global, gl_LastFragColorARM with // global[0], replace inout variables with out equivalents and make sure input attachments // initialize the appropriate variables at the beginning of the shader. if (!ReplaceVariables(compiler, root, inputAttachmentVars, lastFragData)) { return false; } // Add the newly declared variables to the list of uniforms. AddInputAttachmentsToUniforms(inputAttachmentVars, uniforms); return true; } } // namespace sh
c0372a4fb1066b844f122636eeb984fcd79ec742
f362b9c8571f6ffbe0d05382e3159efc46810b1f
/Snake811/ui_mainwidget.h
14e84e5c9ae647bde7a8ae8b6378393a50b670eb
[]
no_license
Jerry211GitHub/ssm-1911
3f537666664b5626029e101504f9a42a2d6214aa
1b7c20318ec0618c80fc17b9836491cb4d2505f9
refs/heads/master
2023-07-07T11:57:16.247235
2021-08-13T08:03:52
2021-08-13T08:03:52
395,562,436
0
0
null
null
null
null
UTF-8
C++
false
false
1,389
h
/******************************************************************************** ** Form generated from reading UI file 'mainwidget.ui' ** ** Created by: Qt User Interface Compiler version 5.12.11 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef UI_MAINWIDGET_H #define UI_MAINWIDGET_H #include <QtCore/QVariant> #include <QtWidgets/QApplication> #include <QtWidgets/QWidget> QT_BEGIN_NAMESPACE class Ui_MainWidget { public: void setupUi(QWidget *MainWidget) { if (MainWidget->objectName().isEmpty()) MainWidget->setObjectName(QString::fromUtf8("MainWidget")); MainWidget->resize(800, 600); QFont font; font.setFamily(QString::fromUtf8("\345\256\213\344\275\223")); font.setPointSize(28); MainWidget->setFont(font); retranslateUi(MainWidget); QMetaObject::connectSlotsByName(MainWidget); } // setupUi void retranslateUi(QWidget *MainWidget) { MainWidget->setWindowTitle(QApplication::translate("MainWidget", "Jerry-\350\264\252\345\220\203\350\233\207\357\274\2102021.0811\357\274\211", nullptr)); } // retranslateUi }; namespace Ui { class MainWidget: public Ui_MainWidget {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_MAINWIDGET_H
0ee8043f518f91e4a7c4f2ca14f694272f1035d9
eb0998a100f382a239ea43bab97ec42979e0e598
/GrayHamiltonian.h
5fd03cd2df196bd5e37519aab41864d9a8c9ea90
[]
no_license
jfancode/GrayHamiltonianCycles
68916b82061e877d0ebd883ff15830d5763ec8a6
fdb26d7e6dd4d33f6da3eda4c19985ce1ebe668e
refs/heads/master
2021-01-22T02:17:59.149627
2017-05-25T01:54:54
2017-05-25T01:54:54
92,351,000
0
0
null
null
null
null
UTF-8
C++
false
false
2,785
h
/* GrayHamiltonianSearch.h Types and macros for GrayHamiltonianSearch. Created by jfan for CS49 Parallel Algorithms. */ #ifndef GRAY_HAMILTONIAN #define GRAY_HAMILTONIAN #include <math.h> #include <map> /* ===================== STRUCTS AND MACROS ======================= */ /* A set of LUTs that allows lookup from integer value to digit representation and vice versa typedef struct LUTs { int** valueToRep; // array of int* representations. Index v into // valueToRep to get the representation of v std::map<int*, int> repToValue; // map of int* representations // to their int values } LUTs; */ /* A Gray adjacency graph on which to perform our modified DFS for a Hamiltonian cycle */ typedef int** graph_t; typedef struct search_s { int found; // 1 means a cycle has been found, 0 means none int* cycle; // if a cycle is found, we return the solution } search_t; /* ========================= FUNCTIONS ============================ */ /* Creates the conversion tables of type LUTs, which map each integer value between 0 and nHigh-1 to their digit representations in the given radices, and vice versa. */ void populateConversionTable(int** valueToRep, int nHigh, int k, int* radices); /* Frees the conversion table */ void freeConversionTable(int** valueToRep, int nHigh) { for (int v = 0; v < nHigh; v++) free(valueToRep[v]); free(valueToRep); //free(conversionTable); } /* Creates the Gray adjacency graph, a 2D integer array where graph[v] lists the integers that share the Gray code property with v. */ void populateGraph(graph_t graph, int** valueToRep, int n_, int k, int* radices); /* Frees the Gray adjaceny graph */ void freeGraph(graph_t graph, int n_) { for (int v = 0; v < n_; v++) free(graph[v]); free(graph); } /* Frees the processor responsibility array */ void freeProcN(int** procN, int P) { for (int p = 0; p < P; p++) free(procN[p]); free(procN); } /* Increments the digit representation given the radices */ int* increment(int* rep, int k, int* radices); /* Checks whether two digit representations hold the modular Gray code property with the given radices */ int checkGray(int* rep1, int* rep2, int k, int* radices); /* Main algorithm: perform recursive backtracking Hamiltonian search on the given graph. Meanwhile, check off vertices in visited and build the cycle in solution */ search_t* HamiltonianSearch(graph_t graph, int** valueToRep, int* visited, int* solution, int endIndex, int n_, int k, int* radices); /* Part of main that can be executed in parallel void mainParallel(int P, int** valueToRep, int nLow, int nHigh, int k, int* radices); */ #endif
cfe5f7a363f886673f21daa02b1ca665faf292d9
d1cead6b83197392aa87d5b6a23f6277a8d4bddd
/LeetCode/1100.find-k-length-substrings-with-no-repeated-characters.239504720.ac.cpp
9fd64a26bd99073becf10c5dd9cd4e0eaee6c9e5
[]
no_license
shahidul-brur/OnlineJudge-Solution
628cee3c9d744dedc16783a058131571d473f0ec
21400822796d679b74b6f77df2fc8117113a86fd
refs/heads/master
2022-09-22T00:42:21.963138
2022-09-21T14:01:09
2022-09-21T14:01:09
192,035,325
0
0
null
null
null
null
UTF-8
C++
false
false
586
cpp
class Solution { public: int numKLenSubstrNoRepeats(string S, int K) { int cnt[26]; memset(cnt, 0, sizeof(cnt)); int n = S.length(); int lft = 0, ans = 0; cnt[S[0]-'a']++; if(K==1) ans = 1; for(int i = 1;i<n;i++){ cnt[S[i]-'a']++; while(cnt[S[i]-'a']>1){ cnt[S[lft] - 'a']--; lft++; } if(i-lft+1>=K){ ans+=1;//i-lft+1 - (K-1); //cout << i << ": " << i-lft+1 - (K-1) << "\n"; } } return ans; } };
aa0377544088f0769334de707002e6298b600d42
1eb894c9842bbae917f5a8c35784e34abfa35331
/Assignment-2(Recursion and backtracking)/generateParentheses.cpp
a822498fe15eef1cb9da4e6c3113767bc21bb152
[]
no_license
witcher-shailesh/CP_CipherSchools
b4dc6b6dd2d1e93d3bddd64779af09dc93ae86bb
96242b60b90d642fff306dedbc5d69b5ec739c14
refs/heads/main
2023-03-08T12:15:29.549532
2021-02-22T15:01:44
2021-02-22T15:01:44
338,615,327
0
0
null
null
null
null
UTF-8
C++
false
false
908
cpp
#include<bits/stdc++.h> using namespace std; void generateParenthesisHelper(int open, int close, int n, string soFar, vector<string>& result){ if(open>n || close > n){ return; } if(close>open){ return; } if(open == n && close == n){ result.push_back(soFar); return; } generateParenthesisHelper(open+1,close,n,soFar+'(',result); generateParenthesisHelper(open,close+1,n,soFar+')',result); } vector<string> generateParenthesis(int n) { vector<string> result; int open =0, close=0; generateParenthesisHelper(open,close,n,"",result); return result; } int main(){ int number = 5; vector<string> result = generateParenthesis(number); for(string str : result){ cout<<str<<endl; } return 0; }
554d7ddb07864e0cd67fcfa6c873b3c00f7c94a3
157fd7fe5e541c8ef7559b212078eb7a6dbf51c6
/Tools/Support/PerfMon/RegPerfMon/RegisterPerfMon.cpp
eccf104e78e3fe8047fa832064f7914a7f5c3d76
[]
no_license
15831944/TRiAS
d2bab6fd129a86fc2f06f2103d8bcd08237c49af
840946b85dcefb34efc219446240e21f51d2c60d
refs/heads/master
2020-09-05T05:56:39.624150
2012-11-11T02:24:49
2012-11-11T02:24:49
null
0
0
null
null
null
null
IBM852
C++
false
false
5,925
cpp
// $Header: $ // Copyrightę 1999 TRiAS GmbH Potsdam, All rights reserved // Created: 08.09.99 15:58:03 // // @doc // @module RegisterPerfMon.cpp | Implementation of the <c CRegisterPerfMon> class #include <StdAfx.h> #include "RegisterPerfMon.h" #define LOADLIBRARY_FAILED(x) (x == 0) using namespace std; extern const char g_cbRegPerfMon[]; typedef HRESULT (STDAPICALLTYPE *PERFMONREGPROC)(void); CRegisterPerfMon::CRegisterPerfMon (LPCSTR pcPathName) : m_strPathName(pcPathName) { } CRegisterPerfMon::~CRegisterPerfMon (void) { } bool CRegisterPerfMon::Register (bool bSilent) { bool bResult = false; if (SupportsSelfRegister()) { HINSTANCE hModule = ::LoadLibrary (m_strPathName.c_str()); if (LOADLIBRARY_FAILED(hModule)) { if (!bSilent) { DWORD dwError = GetLastError(); char cbBuffer[_MAX_PATH]; strstream str; FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwError, 0, cbBuffer, _MAX_PATH, NULL); str << "An error occurred! " << cbBuffer << "\n" "Win32 Error = " << GetLastError() << "\n\0"; MessageBox (NULL, str.str(), g_cbRegPerfMon, MB_OK); } return false; } PERFMONREGPROC DLLRegisterServer = (PERFMONREGPROC)::GetProcAddress (hModule, TEXT("DllRegisterPerfMon")); if (DLLRegisterServer == NULL) DLLRegisterServer = (PERFMONREGPROC)::GetProcAddress (hModule, TEXT("DLLREGISTERPERFMON")); HRESULT regResult = E_FAIL; if (DLLRegisterServer != NULL) { try { regResult = DLLRegisterServer(); bResult = (regResult == S_OK); } catch (...) { // GP oń regResult = DISP_E_EXCEPTION; // Exception occured bResult = FALSE; } if (!bSilent && !bResult) { char cbBuffer[_MAX_PATH]; strstream str; FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, NULL, regResult, 0, cbBuffer, _MAX_PATH, NULL); str << "An error occurred! " << cbBuffer << "\n" "Win32 Error = " << GetLastError() << "\n" << ends; MessageBox (NULL, str.str(), g_cbRegPerfMon, MB_OK); } } else if (!bSilent) { strstream str; str << "An error occurred! Entrypoint not found (DllRegisterPerfMon).\n" << ends; MessageBox (NULL, str.str(), g_cbRegPerfMon, MB_OK); } ::FreeLibrary (hModule); } else if (!bSilent) { strstream str; str << "An error occurred! Module does not support selfregistering performance counters.\n" << ends; MessageBox (NULL, str.str(), g_cbRegPerfMon, MB_OK); } return bResult; } bool CRegisterPerfMon::Unregister (bool bSilent) { bool bResult = false; if (SupportsSelfRegister()) { HINSTANCE hModule = ::LoadLibrary (m_strPathName.c_str()); if (LOADLIBRARY_FAILED(hModule)) { if (!bSilent) { DWORD dwError = GetLastError(); char cbBuffer[_MAX_PATH]; strstream str; FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwError, 0, cbBuffer, _MAX_PATH, NULL); str << "An error occurred! " << cbBuffer << "\n" "Win32 Error = " << GetLastError() << "\n\0"; MessageBox (NULL, str.str(), g_cbRegPerfMon, MB_OK); } return false; } PERFMONREGPROC DllUnregisterServer = (PERFMONREGPROC)::GetProcAddress (hModule, TEXT("DllUnregisterPerfMon")); if (DllUnregisterServer == NULL) DllUnregisterServer = (PERFMONREGPROC)::GetProcAddress (hModule, TEXT("DLLUNREGISTERPERFMON")); if (DllUnregisterServer != NULL) { HRESULT regResult = S_OK; try { regResult = DllUnregisterServer(); bResult = (regResult == S_OK); } catch (...) { bResult = FALSE; } if (!bSilent && !bResult) { char cbBuffer[_MAX_PATH]; strstream str; FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, NULL, regResult, 0, cbBuffer, _MAX_PATH, NULL); str << "An error occurred! " << cbBuffer << "\n" "Win32 Error = " << GetLastError() << "\n" << ends; MessageBox (NULL, str.str(), g_cbRegPerfMon, MB_OK); } } else if (!bSilent) { strstream str; str << "An error occurred! Entrypoint not found (DllUnregisterPerfMon).\n" << ends; MessageBox (NULL, str.str(), g_cbRegPerfMon, MB_OK); } ::FreeLibrary (hModule); } else if (!bSilent) { strstream str; str << "An error occurred! Module does not support selfregistering performance counters.\n" << ends; MessageBox (NULL, str.str(), g_cbRegPerfMon, MB_OK); } return bResult; } bool CRegisterPerfMon::SupportsSelfRegister (void) { int bResult = false; DWORD handle; DWORD uiInfoSize; UINT uiVerSize; UINT uiSize; DWORD *lpBuffer; char szName[128]; // Get the size of the version information. uiInfoSize = GetFileVersionInfoSize ((LPSTR)m_strPathName.c_str(), &handle); if (uiInfoSize == 0) return false; // Allocate a buffer for the version information. char *pbData = NULL; ATLTRY(pbData = new char[uiInfoSize]); if (NULL == pbData) return false; // Fill the buffer with the version information. bResult = GetFileVersionInfo ((LPSTR)m_strPathName.c_str(), handle, uiInfoSize, pbData); if (!bResult) goto NastyGoto; // Get the translation information. strcpy (szName, TEXT("\\VarFileInfo\\Translation")); bResult = VerQueryValue (pbData, szName, (void **)&lpBuffer, &uiVerSize); if (!bResult || uiVerSize == 0) goto NastyGoto; // Build the path to the key OLESelfRegister using the translation information. wsprintf (szName, TEXT("\\StringFileInfo\\%04hX%04hX\\PerfMonSelfRegister"), LOWORD(*lpBuffer), HIWORD(*lpBuffer)); // Search for the key. DWORD *lpSelfReg; bResult = VerQueryValue (pbData, szName, (void **)&lpSelfReg, &uiSize); NastyGoto: delete [] pbData; return bResult ? true : false; }
[ "Windows Live ID\\[email protected]" ]
Windows Live ID\[email protected]
bf24087df45b05902921829ebb6a1aa6c122a9b0
d23d36fd5b4e6851fef68940b15ed625677a576b
/作业8-练习1/作业8-练习1/作业8-练习1View.cpp
1f995682d4698d7530b79cccd226fc4f0e2e0fb6
[]
no_license
DJQ0926/test
0d5fd731edef513e08b1169578e70fe9139d7d05
e9a755ac66750e14bbb870d211531d91a92fc2ee
refs/heads/master
2021-02-15T23:03:21.681207
2020-07-05T09:51:20
2020-07-05T09:51:20
244,942,227
0
0
null
null
null
null
GB18030
C++
false
false
2,572
cpp
// 作业8-练习1View.cpp : C作业8练习1View 类的实现 // #include "stdafx.h" // SHARED_HANDLERS 可以在实现预览、缩略图和搜索筛选器句柄的 // ATL 项目中进行定义,并允许与该项目共享文档代码。 #ifndef SHARED_HANDLERS #include "作业8-练习1.h" #endif #include "作业8-练习1Doc.h" #include "作业8-练习1View.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // C作业8练习1View IMPLEMENT_DYNCREATE(C作业8练习1View, CView) BEGIN_MESSAGE_MAP(C作业8练习1View, CView) ON_COMMAND(ID_CFILEDIALOG, &C作业8练习1View::OnCfiledialog) ON_COMMAND(ID_FILE_OPEN, &C作业8练习1View::OnFileOpen) END_MESSAGE_MAP() // C作业8练习1View 构造/析构 C作业8练习1View::C作业8练习1View() { // TODO: 在此处添加构造代码 } C作业8练习1View::~C作业8练习1View() { } BOOL C作业8练习1View::PreCreateWindow(CREATESTRUCT& cs) { // TODO: 在此处通过修改 // CREATESTRUCT cs 来修改窗口类或样式 return CView::PreCreateWindow(cs); } // C作业8练习1View 绘制 void C作业8练习1View::OnDraw(CDC* /*pDC*/) { C作业8练习1Doc* pDoc = GetDocument(); ASSERT_VALID(pDoc); if (!pDoc) return; // TODO: 在此处为本机数据添加绘制代码 } // C作业8练习1View 诊断 #ifdef _DEBUG void C作业8练习1View::AssertValid() const { CView::AssertValid(); } void C作业8练习1View::Dump(CDumpContext& dc) const { CView::Dump(dc); } C作业8练习1Doc* C作业8练习1View::GetDocument() const // 非调试版本是内联的 { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(C作业8练习1Doc))); return (C作业8练习1Doc*)m_pDocument; } #endif //_DEBUG // C作业8练习1View 消息处理程序 void C作业8练习1View::OnCfiledialog() { // TODO: 在此添加命令处理程序代码 C作业8练习1Doc* pDoc = GetDocument(); CFileDialog cfd(true); //建立对象 int r = cfd.DoModal(); //弹出对话框 CClientDC dc(this); if (r == IDOK) //如果退出对话框时选项为OK的话 { CString filename = cfd.GetPathName(); dc.TextOutW(300, 200, filename); pDoc->A = filename; } } void C作业8练习1View::OnFileOpen() { // TODO: 在此添加命令处理程序代码 C作业8练习1Doc* pDoc = GetDocument(); CFileDialog cfd(true); //建立对象 int r = cfd.DoModal(); //弹出对话框 CClientDC dc(this); if (r == IDOK) //如果退出对话框时选项为OK的话 { CString filename = cfd.GetPathName(); dc.TextOutW(300, 200, filename); pDoc->A = filename; } }
8b6c4831ffdf0c83bdfc3cdb97425d5e1480b966
6112e4d427cc743dd5935e0d1aae5e175eb29345
/Tree_and_Graph/bfs.cpp
ad06c3260db7f4fdb6ad8bf562ac16d408439a38
[]
no_license
Pankajcoder1/Algorithm
022a805a8a6ac4b7affe8f99c87f9f607f585ad1
e74977f96b90af28443695abaabced7352498b8a
refs/heads/master
2021-09-20T08:53:27.386668
2021-08-10T09:08:57
2021-08-10T09:08:57
239,831,361
1
1
null
null
null
null
UTF-8
C++
false
false
2,682
cpp
/* written by Pankaj Kumar. country:-INDIA */ #include <bits/stdc++.h> using namespace std; typedef long long ll ; typedef set<pair<int,int>> spi; typedef set<pair<ll,ll>> spl; typedef vector<pair<int,int>> vpi; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<bool> vb; typedef vector<char> vc; typedef vector<pair<ll,ll>> vpl; typedef vector<string> vs; typedef map<int,int>mi; typedef map<ll,ll> ml; typedef set<string> ss; typedef set<char>sc; typedef set<int> si; typedef set<ll> sl; #define pan cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0); // define values. #define mod 1e9+7LL #define phi 1.618 /* Bit-Stuff */ #define get_set_bits(a) (__builtin_popcount(a)) #define get_set_bitsll(a) ( __builtin_popcountll(a)) #define get_trail_zero(a) (__builtin_ctz(a)) #define get_lead_zero(a) (__builtin_clz(a)) #define get_parity(a) (__builtin_parity(a)) /* Abbrevations */ #define ff first #define ss second #define mp make_pair #define line cout<<endl; #define pb push_back #define Endl "\n" // loops #define loop(i,start,end) for(ll i=ll(start);i<ll(end);i++) #define loop0(num) for(ll i=0;i<ll(num);i++) #define forin(arr,n) for(ll i=0;i<n;i++) cin>>arr[i]; // Some print #define no cout<<"NO"<<endl; #define yes cout<<"YES"<<endl; #define cc ll test;cin>>test;while(test--) // sort #define all(V) (V).begin(),(V).end() #define srt(V) sort(all(V)) #define srtGreat(V) sort(all(V),greater<ll>()) // function ll power(ll x, ll y, ll p) { ll res = 1; x = x % p; while (y > 0) { if (y & 1) res = (res*x) % p; y = y>>1; x = (x*x) % p; } return res; } /* ascii value A=65,Z=90,a=97,z=122 1=49 */ /* -----------------------------------------------------------------------------------*/ // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); int main() { ll n; cin>>n; ll temp=n-1; vector<bool> check(n+1,false); vector<vector<ll>>v(n+1,vector<ll>()); while(temp--) { ll a ,b; cin>>a>>b; v[a].pb(b); v[b].pb(a); } for(ll u=1;u<=n;u++) { if(!check[u]) { queue<ll> q; q.push(u); check[u]=true; while(!q.empty()) { ll f=q.front(); q.pop(); cout<<f<<" "; for(auto i=v[f].begin();i!=v[f].end();i++) { if(!check[*i]) { q.push(*i); check[*i]=true; } } } } } }
18430e221619604d75a82fa4df31dce57ba32046
ec5ca910930c7dcad8f99ad0b5de2afca727ec61
/Source/S05_TestingGrounds/Character/Mannequin.cpp
dc9bdb77eac6e10fdabf81b0053c0d7c6003495c
[]
no_license
Boostedblue24/05_TestingGrounds
e2580cf11f82921aa8be1ad3eb06a8dc90283272
d0378759b6f7fb85af59aeab0b88161487c60be4
refs/heads/master
2020-04-21T19:11:56.608554
2019-03-06T03:47:12
2019-03-06T03:47:12
169,798,358
0
0
null
null
null
null
UTF-8
C++
false
false
3,259
cpp
// Fill out your copyright notice in the Description page of Project Settings. #include "Mannequin.h" #include "Camera/CameraComponent.h" #include "Components/CapsuleComponent.h" #include "Kismet/GameplayStatics.h" #include "Animation/AnimInstance.h" #include "../Public/Weapons/Gun.h" // Sets default values AMannequin::AMannequin() { // Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; // Set size for collision capsule GetCapsuleComponent()->InitCapsuleSize(55.f, 96.0f); // set our turn rates for input BaseTurnRate = 45.f; BaseLookUpRate = 45.f; FirstPersonCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera")); FirstPersonCameraComponent->SetupAttachment(GetCapsuleComponent()); FirstPersonCameraComponent->RelativeLocation = FVector(-39.56f, 1.75f, 64.0f); ///Position the camera FirstPersonCameraComponent->bUsePawnControlRotation = true; Mesh1P = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("CharacterMesh1P")); Mesh1P->SetupAttachment(FirstPersonCameraComponent); Mesh1P->SetOnlyOwnerSee(true); Mesh1P->bCastDynamicShadow = false; Mesh1P->CastShadow = false; Mesh1P->RelativeRotation = FRotator(1.9f, -19.19f, 5.2f); Mesh1P->RelativeLocation = FVector(-0.5f, -4.4f, -155.7f); } // Called when the game starts or when spawned void AMannequin::BeginPlay() { Super::BeginPlay(); if (GunBlueprint == nullptr) { return; } Gun = GetWorld()->SpawnActor<AGun>(GunBlueprint); //Attach gun mesh component to either the FP or TP mesh/skeleton depending on if Mannequin is possessed by a PlayerController or not. //doing it here because the skeleton is not yet created in the constructor if (IsPlayerControlled()) { Gun->AttachToComponent(Mesh1P, FAttachmentTransformRules(EAttachmentRule::SnapToTarget, true), TEXT("GripPoint")); } else { Gun->AttachToComponent(GetMesh(), FAttachmentTransformRules(EAttachmentRule::SnapToTarget, true), TEXT("GripPoint")); } //Get the anim instance of the meshes that Gun is attached to Gun->AnimInstance1P = Mesh1P->GetAnimInstance(); Gun->AnimInstance3P = GetMesh()->GetAnimInstance(); if (InputComponent != nullptr) { // Bind fire event InputComponent->BindAction("Fire", IE_Pressed, this, &AMannequin::PullTrigger); } } // Called every frame void AMannequin::Tick(float DeltaTime) { Super::Tick(DeltaTime); } // Called to bind functionality to input void AMannequin::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) { Super::SetupPlayerInputComponent(PlayerInputComponent); // set up gameplay key bindings check(PlayerInputComponent); // Bind jump events PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump); PlayerInputComponent->BindAction("Jump", IE_Released, this, &ACharacter::StopJumping); } void AMannequin::UnPossessed() { Super::UnPossessed(); if (!Gun) { UE_LOG(LogTemp, Warning, TEXT("Gun not found")); return; } Gun->AttachToComponent(GetMesh(), FAttachmentTransformRules(EAttachmentRule::SnapToTarget, true), TEXT("GripPoint")); } void AMannequin::PullTrigger() { Gun->OnFire(); } void AMannequin::DestroyGun() { Gun->Destroy(); }
7779b3727690fe413b9c8d44ed70494d801b117a
2de8a6c7ae3dcd1111b10d462bfe05ab7e24181f
/src/force/framework/force_test.cpp
674b3b445625ab828e7b8af450647a8457648ba2
[ "BSD-3-Clause" ]
permissive
HSRobot/hiropV3
c57e441b09cd06cfba239eab8f6e7656da261f1e
3f094035229708302aec976cfb252f7bcdb7cd3f
refs/heads/master
2022-12-11T13:38:26.622098
2020-09-02T01:52:20
2020-09-02T01:52:20
282,765,977
0
0
null
null
null
null
UTF-8
C++
false
false
821
cpp
#include <iostream> //#include <hirop/force/forcePluginAggre.h> using namespace std; int emain(int args, char** argv){ // forcePluginAggre plugin; // plugin.setForcePlugin("hsImpenderrForce","1", "/home/fshs/work/hirop/src/force/config/parmtemplate.yaml"); // std::vector<std::string> forceList; // plugin.getForcePluginList(forceList); // vector<double> force{1,0,0,0,0,0}; // plugin.setInputForceBias(force); // vector<double> pose{0,-1.57,3.14,0,1.57,0}; // plugin.setInputRobotPose(pose); // for(;;) // { // plugin.compute(); // vector<double> resPose(6); // plugin.getResult(resPose); // for(auto it :resPose) // std::cout << it <<" "; // std::cout <<std::endl; // } // std::cout << plugin.getName() <<std::endl; return 0; }
9ce4aae826d74fabcfbff06f8846e445e3473739
dc8225fba020b18b51746984994bb0d2d6d932a3
/src/analysis.cxx
752a73cb93ebf887e11f6a032f72dc19aac98144
[]
no_license
berghaus/qci_analysis
a364be7e35f09438c59407e94594d93a036c84fd
c8f295223256da4a6860941df122acf44937c687
refs/heads/master
2021-01-19T15:33:00.176902
2012-11-15T00:42:50
2012-11-15T00:42:50
null
0
0
null
null
null
null
UTF-8
C++
false
false
16,120
cxx
#include <algorithm> #include <fstream> #include <iostream> #include <vector> #include <cmath> #include <cfloat> #include <cstdlib> #include <stdexcept> #include <ctime> #include <limits> #include <boost/foreach.hpp> #define foreach BOOST_FOREACH #include <boost/checked_delete.hpp> #include <boost/assign/list_of.hpp> #include <boost/lexical_cast.hpp> #include <boost/program_options/cmdline.hpp> #include <boost/program_options/config.hpp> #include <boost/program_options/environment_iterator.hpp> #include <boost/program_options/eof_iterator.hpp> #include <boost/program_options/errors.hpp> #include <boost/program_options/option.hpp> #include <boost/program_options/options_description.hpp> #include <boost/program_options/parsers.hpp> #include <boost/program_options/positional_options.hpp> #include <boost/program_options/value_semantic.hpp> #include <boost/program_options/variables_map.hpp> #include <boost/program_options/version.hpp> #include <boost/format.hpp> #include <TApplication.h> #include <TCanvas.h> #include <TH1.h> #include <TProfile.h> #include <TH2.h> #include <TFile.h> #include <TKey.h> #include <TDirectoryFile.h> #include <TClass.h> #include <TGraphErrors.h> #include <TLatex.h> #include "Likelihood.hpp" #include "Prediction.hpp" #include "PseudoExperiment.hpp" #include "PValueTest.hpp" #include "AtlasStyle.hpp" #include "ControlFrame.hpp" #include "CertaintyLevel.hpp" #include "Effect.hpp" #include "PredictionMonitor.hpp" #include "TestStatMonitor.hpp" #define ERROR_NO_SCALE_VALUE 1 #define ERROR_NO_PDF 3 #define ERROR_NO_DATA 4 using boost::lexical_cast; using namespace std; using namespace boost::assign; namespace po = boost::program_options; map< double, TDirectoryFile* > GetDirs( const TFile* ); map< double, TH1* > GetHists( const TFile* ); template< class T > bool compByName( const T* x, const T* y ) { return string( x->GetName() ) < string( y->GetName() ); } void PlotPredictionError( Experiment&, Prediction *, Statitical_Effect * ); int main( int argc, char* argv[] ) { //--------------------------------------------------------------------------- // process cmd opts // Declare the supported options. po::options_description desc( "Allowed options" ); desc.add_options()( "help,h", "print this help message" )( "nPE,n", po::value< int >(), "number of pseudo-experiments to run on each alpha" )( "scales,s", po::value< vector< double > >()->multitoken(), "list of contact interaction scale values (in TeV)" )( "mjjs,m", po::value< vector< double > >()->multitoken(), "mjj bins to consider (use mjj max)" )( "jobID,j", po::value< int >(), "PBS job ID for output naming" )( "outDir,o", po::value< string >(), "output directory for likelihood disctributions" )( "prediction,p", po::value< string >(), "ROOT file containing expected event distributions" )( "data,d", po::value< string >(), "ROOT file containing data event distribution" )( "stochastic", "include error due to limited statistics in QCD and QCI MC" )( "jes", po::value< string >(), "include error due to jet energy scale uncertainty described in given root file" )( "jer", po::value< string >(), "include error due to jet p_T resolution described in given root file" )( "pdf", po::value< string >(), "include error due to PDF sets as described in given root file" )( "appl", po::value< vector< string > >()->multitoken(), "include error due to scale choices as described in given grid files" )( "figures,f", po::value< string >(), "directory for output figures" ); po::variables_map vm; po::store( po::parse_command_line( argc, argv, desc ), vm ); po::notify( vm ); if ( vm.count( "help" ) ) { cout << desc << "\n"; return 0; } int nPE = 1000; if ( vm.count( "nPE" ) ) { cout << "Running " << vm["nPE"].as< int >() << " pseudo-experiments for each alpha.\n"; nPE = vm["nPE"].as< int >(); } else { cout << "Defaulting to using " << nPE << " pseudo-experiments for each alpha.\n"; } vector< double > scales; if ( vm.count( "scales" ) ) { scales = vm["scales"].as< vector< double > >(); sort( scales.begin(), scales.end() ); cout << "Running over " << scales.size() << " scale values:\n"; foreach( double scale, scales ) cout << " - " << scale << '\n'; } else { cout << "No scale to run on given ... aborting." << endl; return ERROR_NO_SCALE_VALUE; } vector< double > mjjs( 1, 7000. ); if ( vm.count( "mjjs" ) ) { mjjs = vm["mjjs"].as< vector< double > >(); sort( mjjs.begin(), mjjs.end() ); cout << "Running over " << mjjs.size() << " scale values:\n"; foreach( double mjj, mjjs ) cout << " - " << mjj << '\n'; } else { cout << "No scale to run on given, defaulting to top mjj bin." << endl; } string jobID = ""; if ( vm.count( "jobID" ) ) { int j = vm["jobID"].as< int >(); cout << "PBS job ID: " << j << "\n"; jobID = lexical_cast< string >( j ); } string outDir; if ( vm.count( "outDir" ) ) { outDir = vm["outDir"].as< string >(); cout << "directing output to: " << outDir << "\n"; } string dataFileName; if ( vm.count( "data" ) ) { dataFileName = vm["data"].as< string >(); } else { cout << "No data event distribution supplied. Aborting.\n"; return ERROR_NO_DATA; } // read in data file TFile * dataFile = TFile::Open( dataFileName.c_str(), "READ" ); typedef map< double, TH1* > th1Map_t; th1Map_t dataHists = GetHists( dataFile ); th1Map_t::iterator dataIt = dataHists.begin(); while ( dataIt != dataHists.end() ) { if ( find( mjjs.begin(), mjjs.end(), dataIt->first ) == mjjs.end() ) dataHists.erase( dataIt++ ); else ++dataIt; } Experiment data( dataHists ); //data.plot(); string predictionFileName; if ( vm.count( "prediction" ) ) { predictionFileName = vm["prediction"].as< string >(); } else { cout << "No predicted event distributions supplied. Aborting.\n"; return ERROR_NO_PDF; } // read in our PDF from file TFile * pdfFile = TFile::Open( predictionFileName.c_str(), "READ" ); typedef map< double, TDirectoryFile* > tDirFileMap_t; tDirFileMap_t pdfDirs = GetDirs( pdfFile ); tDirFileMap_t::iterator predIt = pdfDirs.begin(); while ( predIt != pdfDirs.end() ) { if ( find( mjjs.begin(), mjjs.end(), predIt->first ) == mjjs.end() ) pdfDirs.erase( predIt++ ); else ++predIt; } // Set up PDF to run Prediction * pdf = new Prediction( pdfDirs, data ); if ( vm.count( "stochastic" ) ) { cout << "including errors arising from limited statistics in QCD and QCI MC\n"; Statitical_Effect * statEff = new Statitical_Effect( pdf->pdfFit( "PredictionFunctionForError" ), pdf->covarianceMaticies() ); Effect * eff = dynamic_cast< Effect* >( statEff ); if ( eff ) pdf->addEffect( eff ); else cout << "failed to downcast Statitical_Effect to Effect\n"; PlotPredictionError( data, pdf, statEff ); } if ( vm.count( "jes" ) ) { cout << "including errors arising from jet energy scale uncertainty\n"; string jesErrorFileName = vm["jes"].as< string >(); JES_Effect * sysEff = new JES_Effect( jesErrorFileName ); Effect * eff = dynamic_cast< Effect* >( sysEff ); if ( eff ) pdf->addEffect( eff ); else cout << "failed to downcast JES_Effect to Effect\n"; } if ( vm.count( "jer" ) ) { cout << "including errors arising from jet p_T Resolution\n"; string jerErrorFileName = vm["jer"].as< string >(); JER_Effect * sysEff = new JER_Effect( jerErrorFileName ); Effect * eff = dynamic_cast< Effect* >( sysEff ); if ( eff ) pdf->addEffect( eff ); else cout << "failed to downcast JER_Effect to Effect\n"; } if( vm.count( "pdf" ) ) { cout << "including errors arising from PDF fit\n"; string pdfErrorFileName = vm["pdf"].as< string > (); PDF_Effect * sysEff = new PDF_Effect( pdfErrorFileName ); Effect * eff = dynamic_cast< Effect* > ( sysEff ); if( eff ) pdf->addEffect( eff ); else cout << "failed to downcast PDF_Effect to Effect\n"; } if( vm.count( "appl" ) ) { cout << "including errors arising from scale choice\n"; vector< string > gridNames = vm["appl"].as< vector< string > > (); Scale_Effect * sysEff = new Scale_Effect( gridNames ); Effect * eff = dynamic_cast< Effect* > ( sysEff ); if( eff ) pdf->addEffect( eff ); else cout << "failed to downcast Scale_Effect to Effect\n"; } string figureDir = "./"; if ( vm.count( "figures" ) ) { figureDir = vm["figures"].as< string >(); } cout << "directing figures to " << figureDir << "\n"; //--------------------------------------------------------------------------- SetAtlasStyle(); try { //Neg2LogMaximumLikelihoodRatio dataLikelihoodRatio( &data, pdf, 0. ); Neg2LogSimpleLikelihoodRatio dataLikelihoodRatio( &data, pdf, 0. ); // --- make sure we get something reasonable across interesting scale values // for( double scale = 0.5; scale < 10.; scale += 0.1 ) // dataLikelihoodRatio( vector< double >( 1, scale ) ); TestStatMonitor tm( -1., figureDir + "/Likelihood/", ".pdf" ); for( int i = 0; i < 10; ++i ) { dataLikelihoodRatio.accept( tm ); dataLikelihoodRatio.denominator().accept( tm ); } tm.finalize(); // Monitor data PDF PredictionMonitor pdfMon( figureDir + "/PDF/", ".pdf" ); pdf->accept( pdfMon ); PseudoExperimentFactory peFactory( pdf, data ); // create PEs for background likelihood distribution vector< PseudoExperiment > bgPEs = peFactory.build( 0., nPE ); // vector< Neg2LogMaximumLikelihoodRatio* > bgLikelihoodRatios; vector< Neg2LogSimpleLikelihoodRatio* > bgLikelihoodRatios; bgLikelihoodRatios.reserve( bgPEs.size() ); foreach( const PseudoExperiment& pe, bgPEs ) { Prediction * pePDF = new Prediction( *pdf ); pePDF->nData( dynamic_cast< const Experiment& >( pe ) ); // Neg2LogMaximumLikelihoodRatio * l = new Neg2LogMaximumLikelihoodRatio( &pe, pePDF, 0. ); Neg2LogSimpleLikelihoodRatio * l = new Neg2LogSimpleLikelihoodRatio( &pe, pePDF, 0. ); for( double scale = 0.5; scale < 10.; scale += 0.1 ) ( *l )( vector< double >( 1, scale ) ); bgLikelihoodRatios.push_back( l ); } // --- open output files for likelihood distributions ofstream signalOutFile, bkgrndOutFile; signalOutFile.open( ( outDir + "/signalOutput-" + jobID + ".bin" ).c_str(), ios::binary ); bkgrndOutFile.open( ( outDir + "/bkgrndOutput-" + jobID + ".bin" ).c_str(), ios::binary ); int scaleBin = 0; foreach( double scale, scales ) { double alpha = pow( scale, -4 ); // create signal PEs vector< PseudoExperiment > sigPEs = peFactory.build( alpha, nPE ); // vector< Neg2LogMaximumLikelihoodRatio* > sigLikelihoodRatios; vector< Neg2LogSimpleLikelihoodRatio* > sigLikelihoodRatios; sigLikelihoodRatios.reserve( sigPEs.size() ); foreach( const PseudoExperiment& pe, sigPEs ) { Prediction * pePDF = new Prediction( *pdf ); pePDF->nData( dynamic_cast< const Experiment& >( pe ) ); // Neg2LogMaximumLikelihoodRatio * l = new Neg2LogMaximumLikelihoodRatio( &pe, pePDF, alpha ); Neg2LogSimpleLikelihoodRatio * l = new Neg2LogSimpleLikelihoodRatio( &pe, pePDF, alpha ); for( double s = 0.5; s < 10.; s += 0.1 ) ( *l )( vector< double >( 1, s ) ); sigLikelihoodRatios.push_back( l ); } // ------- // CL_s+b //PValueTest<Neg2LogMaximumLikelihoodRatio> signalPlusBackgroundPValue( alpha, sigLikelihoodRatios ); PValueTest<Neg2LogSimpleLikelihoodRatio> signalPlusBackgroundPValue( alpha, sigLikelihoodRatios ); signalOutFile << signalPlusBackgroundPValue << endl; // ----------- // CL_s //PValueTest<Neg2LogMaximumLikelihoodRatio> backgroundPValue( alpha, bgLikelihoodRatios ); // = *pValueTest; PValueTest<Neg2LogSimpleLikelihoodRatio> backgroundPValue( alpha, bgLikelihoodRatios ); // = *pValueTest; bkgrndOutFile << backgroundPValue << endl; // ---------- // monitoring if ( !( scaleBin % 1000 ) ) { signalPlusBackgroundPValue.finalize( figureDir + "/Likelihood/signal/" ); backgroundPValue.finalize( figureDir + "/Likelihood/bkgrnd/" ); } ++scaleBin; } // clean up background Likelihoods // for_each( bgLikelihoodRatios.begin(), bgLikelihoodRatios.end(), // boost::checked_deleter< Neg2LogMaximumLikelihoodRatio >() ); for_each( bgLikelihoodRatios.begin(), bgLikelihoodRatios.end(), boost::checked_deleter< Neg2LogSimpleLikelihoodRatio >() ); // close output files signalOutFile.close(); bkgrndOutFile.close(); // close data and PDF input files pdfFile->Close(); dataFile->Close(); } catch ( exception& e ) { // print exception to console cout << "caught exception:\n" << e.what() << endl; } return 0; } map< double, TDirectoryFile* > GetDirs( const TFile* file ) { map< double, TDirectoryFile* > result; TIter nextKey( file->GetListOfKeys() ); TKey * key = (TKey*) nextKey(); do { if ( !key ) break; string name = key->GetName(); if ( name.find( "0" ) == 0 ) continue; TObject * obj = key->ReadObj(); if ( obj && obj->IsA()->InheritsFrom( "TDirectory" ) ) { cout << "found: " << name << endl; double mjjMax = lexical_cast< double >( name.substr( name.find( "-mjj-" ) + 5, name.size() - name.find( "-mjj-" ) - 8 ) ); result.insert( make_pair( mjjMax, (TDirectoryFile*) obj ) ); } } while ( key = (TKey*) nextKey() ); return result; } map< double, TH1* > GetHists( const TFile* file ) { map< double, TH1* > result; TIter nextKey( file->GetListOfKeys() ); TKey * key = (TKey*) nextKey(); do { if ( !key ) break; string name = key->GetName(); if ( name.find( "Chi_" ) != 0 ) continue; TObject * obj = key->ReadObj(); if ( obj && obj->IsA()->InheritsFrom( "TH1" ) ) { cout << "found: " << name << endl; double mjjMax = lexical_cast< double >( name.substr( name.find( "-to-" ) + 4, name.size() - name.find( "-to-" ) - 7 ) ); result.insert( make_pair( mjjMax, (TH1*) obj ) ); } } while ( key = (TKey*) nextKey() ); return result; } void PlotPredictionError( Experiment& d, Prediction * p, Statitical_Effect * e ) { SetAtlasStyle(); p->setMjj( 7000. ); int nBins = 1000; double chiMin = 2.; double chiMax = 8.; vector<double> scales; vector<double> y; vector<double> ex; vector<double> ey; TCanvas canvas( "fitErrorCan", "", 850, 1100 ); canvas.Divide( 3, 4, 0, 0 ); for ( int i = 0; i <= nBins; ++i ) { scales.push_back( chiMin + double(i) * ( chiMax - chiMin ) / double( nBins ) ); } TH1D dummy("dummy","",2, chiMin, chiMax + 0.5 ); dummy.SetMinimum( 1. ); dummy.SetMaximum( 85. ); dummy.SetXTitle( "#Lambda [TeV]" ); dummy.SetYTitle( "#mu_{j}(#Lambda)" ); TLatex latex; double textx = 60; for( int bin = 0; bin < d[7000.].chi().size(); ++bin ) { y.clear(); ex.clear(); ey.clear(); double chi = Prediction::labelChi( d[7000.].chi( bin ) ); foreach( double l, scales ) { double alpha = pow( l, -4 ); double expectedN = p->interpolate( chi, alpha); y.push_back( expectedN ); ex.push_back( ( chiMax - chiMin ) / double( nBins ) / 2. ); ey.push_back( e->error(expectedN, l, chi, 7000.) ); } canvas.cd( bin+1 ); dummy.Draw("AXIS"); TGraphErrors * g = new TGraphErrors( nBins, &scales[0], &y[0], &ex[0], &ey[0]); if ( bin == 10 ) textx = 20; latex.DrawLatex( 4, textx, str( boost::format( "#chi = %2.1f" ) % chi ).c_str() ); g->SetLineColor( kBlue ); g->SetFillColor( kBlue ); g->Draw("3"); dummy.Draw("SAMEAXIS"); } canvas.Print( "fitErrors.pdf" ); }
fbd6ee967e1884cde9043619c8eb8ddc0e080d08
cf27690ffff5f09eadf7bcb0fe870d3c1f4e5bab
/LegendOfMir2_Server/Def/EnDecode.cpp
dfe61f20ac882cb5fa17b432fcddf5481af818d0
[]
no_license
louisnorthmore/LegendOfMir2_VC
b6ae195398a7a866b98d8e524ac5911d476ca44c
d3d7ba0ec2076805805a93ebedcf442ba23173e5
refs/heads/master
2020-08-12T09:18:37.330228
2017-08-02T04:51:04
2017-08-02T04:51:04
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,527
cpp
// EnDecode.cpp : Defines the entry point for the DLL application. // #include "stdafx.h" static unsigned char Decode6BitMask[5] = { 0xfc, 0xf8, 0xf0, 0xe0, 0xc0 }; /* ************************************************************************************** Encode/Decode Routine for UNICODE character ************************************************************************************** */ #ifdef _UNICODE int WINAPI fnEncode6BitBufW(unsigned char *pszSrc, TCHAR *pszDest, int nSrcLen, int nDestLen) { int nDestPos = 0; int nRestCount = 0; unsigned char chMade = 0, chRest = 0; for (int i = 0; i < nSrcLen; i++) { if (nDestPos >= nDestLen) break; chMade = ((chRest | (pszSrc[i] >> (2 + nRestCount))) & 0x3f); chRest = (((pszSrc[i] << (8 - (2 + nRestCount))) >> 2) & 0x3f); nRestCount += 2; if (nRestCount < 6) pszDest[nDestPos++] = chMade + 0x3c; else { if (nDestPos < nDestLen - 1) { pszDest[nDestPos++] = chMade + 0x3c; pszDest[nDestPos++] = chRest + 0x3c; } else pszDest[nDestPos++] = chMade + 0x3c; nRestCount = 0; chRest = 0; } } if (nRestCount > 0) pszDest[nDestPos++] = chRest + 0x3c; pszDest[nDestPos] = L'\0'; return nDestPos; } int WINAPI fnDecode6BitBufW(TCHAR *pwszSrc, char *pszDest, int nDestLen) { int nLen = lstrlen(pwszSrc); int nDestPos = 0, nBitPos = 2; int nMadeBit = 0; unsigned char ch, chCode, tmp; char *pszSrc = new char[nLen + 1]; WideCharToMultiByte(CP_ACP, 0, pwszSrc, -1, pszSrc, sizeof(pszSrc), NULL, NULL); for (int i = 0; i < nLen; i++) { if ((pszSrc[i] - 0x3c) >= 0) ch = pszSrc[i] - 0x3c; else { nDestPos = 0; break; } if (nDestPos >= nDestLen) break; if ((nMadeBit + 6) >= 8) { chCode = (tmp | ((ch & 0x3f) >> (6 - nBitPos))); pszDest[nDestPos++] = chCode; nMadeBit = 0; if (nBitPos < 6) nBitPos += 2; else { nBitPos = 2; continue; } } tmp = ((ch << nBitPos) & Decode6BitMask[nBitPos - 2]); nMadeBit += (8 - nBitPos); } pszDest[nDestPos] = '\0'; delete [] pszSrc; return i; } int WINAPI fnEncodeMessageW(_LPTDEFAULTMESSAGE lptdm, TCHAR *pszBuf, int nLen) { unsigned char btBuffer[32]; memcpy(btBuffer, (void *)lptdm, sizeof(_TDEFAULTMESSAGE)); return fnEncode6BitBuf(btBuffer, pszBuf, sizeof(_TDEFAULTMESSAGE), nLen); } #endif /* ************************************************************************************** Encode/Decode Routine for ANSI character ************************************************************************************** */ int WINAPI fnEncode6BitBufA(unsigned char *pszSrc, char *pszDest, int nSrcLen, int nDestLen) { int nDestPos = 0; int nRestCount = 0; unsigned char chMade = 0, chRest = 0; for (int i = 0; i < nSrcLen; i++) { if (nDestPos >= nDestLen) break; chMade = ((chRest | (pszSrc[i] >> (2 + nRestCount))) & 0x3f); chRest = (((pszSrc[i] << (8 - (2 + nRestCount))) >> 2) & 0x3f); nRestCount += 2; if (nRestCount < 6) pszDest[nDestPos++] = chMade + 0x3c; else { if (nDestPos < nDestLen - 1) { pszDest[nDestPos++] = chMade + 0x3c; pszDest[nDestPos++] = chRest + 0x3c; } else pszDest[nDestPos++] = chMade + 0x3c; nRestCount = 0; chRest = 0; } } if (nRestCount > 0) pszDest[nDestPos++] = chRest + 0x3c; // pszDest[nDestPos] = '\0'; return nDestPos; } int WINAPI fnDecode6BitBufA(char *pszSrc, char *pszDest, int nDestLen) { int nLen = memlen((const char *)pszSrc) - 1; int nDestPos = 0, nBitPos = 2; int nMadeBit = 0; unsigned char ch, chCode, tmp; for (int i = 0; i < nLen; i++) { if ((pszSrc[i] - 0x3c) >= 0) ch = pszSrc[i] - 0x3c; else { nDestPos = 0; break; } if (nDestPos >= nDestLen) break; if ((nMadeBit + 6) >= 8) { chCode = (tmp | ((ch & 0x3f) >> (6 - nBitPos))); pszDest[nDestPos++] = chCode; nMadeBit = 0; if (nBitPos < 6) nBitPos += 2; else { nBitPos = 2; continue; } } tmp = ((ch << nBitPos) & Decode6BitMask[nBitPos - 2]); nMadeBit += (8 - nBitPos); } // pszDest[nDestPos] = '\0'; return nDestPos; } int WINAPI fnEncodeMessageA(_LPTDEFAULTMESSAGE lptdm, char *pszBuf, int nLen) { return fnEncode6BitBufA((unsigned char *)lptdm, pszBuf, sizeof(_TDEFAULTMESSAGE), nLen); }
efbc412e3b2c0412771c877f6d0d617c843f7ec1
52507f7928ba44b7266eddf0f1a9bf6fae7322a4
/SDK/BP_MetalDetailColor2_classes.h
50d1a8fdce728782d09a78d01129ff509c1bb056
[]
no_license
LuaFan2/mordhau-sdk
7268c9c65745b7af511429cfd3bf16aa109bc20c
ab10ad70bc80512e51a0319c2f9b5effddd47249
refs/heads/master
2022-11-30T08:14:30.825803
2020-08-13T16:31:27
2020-08-13T16:31:27
287,329,560
1
0
null
null
null
null
UTF-8
C++
false
false
656
h
#pragma once // Name: Mordhau, Version: 1.0.0 #ifdef _MSC_VER #pragma pack(push, 0x8) #endif namespace SDK { //--------------------------------------------------------------------------- // Classes //--------------------------------------------------------------------------- // BlueprintGeneratedClass BP_MetalDetailColor2.BP_MetalDetailColor2_C // 0x0000 (0x0068 - 0x0068) class UBP_MetalDetailColor2_C : public UMordhauColor { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("BlueprintGeneratedClass BP_MetalDetailColor2.BP_MetalDetailColor2_C"); return ptr; } }; } #ifdef _MSC_VER #pragma pack(pop) #endif
497b237af09a2246cc15510b84eaf6795cb161f5
a8f2b90b92ec5c38b0607a2b7e8e96eb86800be1
/include/pyfbsdk/pyfbrenderoptions.h
1b51761b15a190d5c672b43e17a0e8739651ca33
[]
no_license
VRTRIX/VRTRIXGlove_MotionBuilder_Plugin
27703a15bd68460095034c7b50d6078c8dad2ad8
8acee1c8d6786e9d580f55d8e2e2d41283274257
refs/heads/master
2023-05-01T03:00:17.419854
2021-11-25T08:05:13
2021-11-25T08:05:13
204,840,760
6
0
null
null
null
null
UTF-8
C++
false
false
1,956
h
#ifndef pyfbrenderoptions_h__ #define pyfbrenderoptions_h__ /************************************************************************** Copyright 2010 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 in either electronic or hard copy form. **************************************************************************/ #include <kaydaradef.h> #ifndef PYSDK_DLL /** \def PYSDK_DLL * Be sure that PYSDK_DLL is defined only once... */ #define PYSDK_DLL K_DLLIMPORT #endif #include "pyfbviewingoptions.h" // ======================================================================================= // FBRenderOptions // ======================================================================================= void FBRenderOptions_Init(); class PYSDK_DLL FBRenderOptions_Wrapper { public: FBRenderOptions* mFBRenderOptions; public: FBRenderOptions_Wrapper( const FBRenderOptions& pRenderOptions ) { mFBRenderOptions = new FBRenderOptions( pRenderOptions ); } virtual ~FBRenderOptions_Wrapper( ) { delete mFBRenderOptions; } object GetRenderingCamera() { return FBWrapperFactory::TheOne().WrapFBObject( mFBRenderOptions->GetRenderingCamera()); } int GetRenderFrameId() { return mFBRenderOptions->GetRenderFrameId( ); } bool IsIDBufferPicking() const { return mFBRenderOptions->IsIDBufferRendering(); } bool IsIDBufferRendering() const { return mFBRenderOptions->IsIDBufferRendering(); } float GetIDBufferPickingAlphaThreshold() const { return mFBRenderOptions->GetIDBufferPickingAlphaThreshold(); } bool IsOfflineRendering() const { return mFBRenderOptions->IsOfflineRendering(); } FBViewingOptions_Wrapper* GetViewerOptions() const { return FBViewingOptions_Wrapper_Factory( mFBRenderOptions->GetViewerOptions() ); } }; #endif // pyfbrenderoptions_h__
20314c85286dfc6aff93cc6b54631ba93194d135
bf1f8194a886ee4a22124a105cb0e24e385d4b82
/Contests/JULY16/CHEFTET/CHEFTET_0.cpp
616ef6cf26a89819b13bb4095d80364b8b264f2e
[]
no_license
subramaniam97/Competitive-Programming
622450b0278eb137b078043676ffb0c132211821
fcdf154d63480eb992a01ef5f1c7e971a19f97cb
refs/heads/master
2021-01-12T08:41:40.780513
2016-12-16T15:42:52
2016-12-16T15:42:52
76,664,024
0
0
null
null
null
null
UTF-8
C++
false
false
2,642
cpp
#include<bits/stdc++.h> using namespace std; long long int a[10005], b[10005]; bool used[10005]; int n; bool ok(long long int s) { for(int i = 1; i <= n; i++) { int req = s - a[i]; bool flag = 0; if(req < 0) return 0; if(req == 0) continue; vector<pair<int,int> > tmp; for(int j = i - 1; j <= i + 1; j++) { if(used[j]) continue; tmp.push_back(make_pair(b[j], j)); } while(tmp.size() != 3) tmp.push_back(make_pair(0, -1)); if(tmp[0].first + tmp[1].first + tmp[2].first == req) { if(tmp[0].second != -1) used[tmp[0].second] = 1; if(tmp[1].second != -1) used[tmp[1].second] = 1; if(tmp[2].second != -1) used[tmp[2].second] = 1; } else if(tmp[0].first + tmp[1].first == req) { if(tmp[0].second != -1) used[tmp[0].second] = 1; if(tmp[1].second != -1) used[tmp[1].second] = 1; } else if(tmp[0].first + tmp[2].first == req) { if(tmp[0].second != -1) used[tmp[0].second] = 1; if(tmp[2].second != -1) used[tmp[2].second] = 1; } else if(tmp[2].first + tmp[1].first == req) { if(tmp[2].second != -1) used[tmp[2].second] = 1; if(tmp[1].second != -1) used[tmp[1].second] = 1; } else if(tmp[0].first == req) { if(tmp[0].second != -1) used[tmp[0].second] = 1; } else if(tmp[1].first == req) { if(tmp[1].second != -1) used[tmp[1].second] = 1; } else if(tmp[2].first == req) { if(tmp[2].second != -1) used[tmp[2].second] = 1; } else { return 0; } } for(int i = 1; i <= n; i++) if(used[i] == 0) return 0; return 1; } int main() { int t; cin>>t; while(t--) { cin>>n; long long int x = 0, y = 0; memset(a, 0, sizeof(a)); memset(b, 0 ,sizeof(b)); for(int i = 1; i <= n; i++) scanf("%lld", b + i), x += b[i]; for(int i = 1; i <= n; i++) scanf("%lld", a + i), y += a[i]; memset(used, 0, sizeof(used)); if(ok((x + y) / n)) cout<<(x + y) / n<<endl; else cout<<-1<<endl; } return 0; }
4d8937ac5fead928cb4648ed2648d716a7e2543c
eaffa873454f17cd51e19fac86bfb7af7d7551bc
/net/include/net/icmp.hpp
8ea3d74e499029006786da409ee79b07fbbc1957
[]
no_license
RostakaGmfun/otrix
01d691687588227c5b0316c9b8470f741247c404
1fe2e8c6363ca8e76fea39481f9341bd095002b8
refs/heads/master
2023-04-06T13:42:08.441197
2021-04-18T19:36:12
2021-04-18T19:36:12
333,126,089
0
0
null
null
null
null
UTF-8
C++
false
false
500
hpp
#pragma once #include "kernel/semaphore.hpp" #include "net/ipv4.hpp" namespace otrix::net { // forward declaration class sockbuf; class icmp { public: icmp(ipv4 *ip); bool ping(ipv4_t addr, uint64_t timeout); private: void process_packet(sockbuf *data); void process_echo_request(sockbuf *data); void process_echo_reply(sockbuf *data); ipv4 *ip_; semaphore ping_req_semaphore_; bool ping_req_pending_; uint16_t ping_req_id_; }; } // namespace otrix::net
456389bed6e86269abebaff25ff685d3bb02e7d8
f3784e0b001fbbcbcee51a8b565319a50bacd7c5
/cses/dt/ch1/summa.cpp
bf813a0d7c74930044713a7d839f6b45499be28f
[]
no_license
mrannanj/contest
935d0c6ae9af6c5032baed9355fa89d152e82bb2
2410b9868cd9279a3c1364d3e8eaf70ceaf12436
refs/heads/master
2020-12-25T17:15:21.017679
2017-02-12T17:30:38
2017-02-12T17:30:38
18,183,287
0
0
null
null
null
null
UTF-8
C++
false
false
96
cpp
#include <cstdio> int main() { long a,b; scanf("%ld %ld", &a, &b); printf("%ld\n", a+b); }
d424459f329b176448c5e2f65be02834a4d6d29f
fcc88521f63a3c22c81a9242ae3b203f2ea888fd
/C++/0054-Spiral-Matrix/soln.cpp
d98f1f07adec950e1a9731aa0b42d45001a1aac6
[ "MIT" ]
permissive
wyaadarsh/LeetCode-Solutions
b5963e3427aa547d485d3a2cb24e6cedc72804fd
3719f5cb059eefd66b83eb8ae990652f4b7fd124
refs/heads/master
2022-12-06T15:50:37.930987
2020-08-30T15:49:27
2020-08-30T15:49:27
291,811,790
0
1
MIT
2020-08-31T19:57:35
2020-08-31T19:57:34
null
UTF-8
C++
false
false
793
cpp
class Solution { public: vector<int> spiralOrder(vector<vector<int>>& matrix) { vector<int> ans; if (matrix.size() == 0 || matrix[0].size() == 0) return ans; int r = 0, c = 0; int dr = 0, dc = 1; int m = matrix.size(); int n = matrix[0].size(); set<pair<int, int>> seen; for(int i = 0; i < m * n; i++) { ans.push_back(matrix[r][c]); seen.insert(make_pair(r, c)); if (r + dr < 0 || r + dr >= m || c + dc < 0 || c + dc >= n || seen.find(make_pair(r + dr, c + dc)) != seen.end()) { int temp = dr; dr = dc; dc = -temp; } r += dr; c += dc; } return ans; } };
eb91ef25959079fcf403a31de876d0a8ee03c608
05bb58762bb1fe9e393111917f0efc41f2cc6373
/BlasterMasterNES/Game.cpp
cd7bba00d30c454be432d5e9cdcdf71d3698e5da
[]
no_license
luong210978/gamelast
346e9a0a16ea0f7fb6a82d69e55f9c3fb7207bf7
9f426cdf1f32683a18d2942af5be138e3b825bed
refs/heads/main
2023-06-29T10:27:48.692762
2021-07-28T08:55:56
2021-07-28T08:55:56
390,282,491
0
0
null
null
null
null
UTF-8
C++
false
false
13,247
cpp
#include <iostream> #include <fstream> #include "Game.h" #include "Utils.h" #include "PlayScence.h" #include "OpeningScene.h" #include "EndingScene.h" #include "RollOutScene.h" #include "Sound.h" CGame * CGame::__instance = NULL; /* Initialize DirectX, create a Direct3D device for rendering within the window, initial Sprite library for rendering 2D images - hInst: Application instance handle - hWnd: Application window handle */ void CGame::Init(HWND hWnd) { LPDIRECT3D9 d3d = Direct3DCreate9(D3D_SDK_VERSION); this->hWnd = hWnd; D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8; d3dpp.BackBufferCount = 1; RECT r; GetClientRect(hWnd, &r); // retrieve Window width & height d3dpp.BackBufferHeight = r.bottom; d3dpp.BackBufferWidth = r.right; screen_height = r.bottom; screen_width = r.right; d3d->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddv); if (d3ddv == NULL) { OutputDebugString(L"[ERROR] CreateDevice failed\n"); return; } d3ddv->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &backBuffer); // Initialize sprite helper from Direct3DX helper library D3DXCreateSprite(d3ddv, &spriteHandler); OutputDebugString(L"[INFO] InitGame done;\n"); } /* Utility function to wrap LPD3DXSPRITE::Draw */ void CGame::Draw(float x, float y, LPDIRECT3DTEXTURE9 texture, int left, int top, int right, int bottom, int alpha) { D3DXVECTOR3 p(x - cam_x, y - cam_y, 0); RECT r; r.left = left; r.top = top; r.right = right; r.bottom = bottom; spriteHandler->Draw(texture, &r, NULL, &p, D3DCOLOR_ARGB(alpha, 255, 255, 255)); } int CGame::IsKeyDown(int KeyCode) { return (keyStates[KeyCode] & 0x80) > 0; } void CGame::InitKeyboard() { HRESULT hr = DirectInput8Create ( (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE), DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID**)&di, NULL ); if (hr != DI_OK) { DebugOut(L"[ERROR] DirectInput8Create failed!\n"); return; } hr = di->CreateDevice(GUID_SysKeyboard, &didv, NULL); // TO-DO: put in exception handling if (hr != DI_OK) { DebugOut(L"[ERROR] CreateDevice failed!\n"); return; } // Set the data format to "keyboard format" - a predefined data format // // A data format specifies which controls on a device we // are interested in, and how they should be reported. // // This tells DirectInput that we will be passing an array // of 256 bytes to IDirectInputDevice::GetDeviceState. hr = didv->SetDataFormat(&c_dfDIKeyboard); hr = didv->SetCooperativeLevel(hWnd, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE); // IMPORTANT STEP TO USE BUFFERED DEVICE DATA! // // DirectInput uses unbuffered I/O (buffer size = 0) by default. // If you want to read buffered data, you need to set a nonzero // buffer size. // // Set the buffer size to DINPUT_BUFFERSIZE (defined above) elements. // // The buffer size is a DWORD property associated with the device. DIPROPDWORD dipdw; dipdw.diph.dwSize = sizeof(DIPROPDWORD); dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); dipdw.diph.dwObj = 0; dipdw.diph.dwHow = DIPH_DEVICE; dipdw.dwData = KEYBOARD_BUFFER_SIZE; // Arbitary buffer size hr = didv->SetProperty(DIPROP_BUFFERSIZE, &dipdw.diph); hr = didv->Acquire(); if (hr != DI_OK) { DebugOut(L"[ERROR] DINPUT8::Acquire failed!\n"); return; } DebugOut(L"[INFO] Keyboard has been initialized successfully\n"); } void CGame::ProcessKeyboard() { HRESULT hr; // Collect all key states first hr = didv->GetDeviceState(sizeof(keyStates), keyStates); if (FAILED(hr)) { // If the keyboard lost focus or was not acquired then try to get control back. if ((hr == DIERR_INPUTLOST) || (hr == DIERR_NOTACQUIRED)) { HRESULT h = didv->Acquire(); if (h == DI_OK) { DebugOut(L"[INFO] Keyboard re-acquired!\n"); } else return; } else { //DebugOut(L"[ERROR] DINPUT::GetDeviceState failed. Error: %d\n", hr); return; } } keyHandler->KeyState((BYTE *)&keyStates); // Collect all buffered events DWORD dwElements = KEYBOARD_BUFFER_SIZE; hr = didv->GetDeviceData(sizeof(DIDEVICEOBJECTDATA), keyEvents, &dwElements, 0); if (FAILED(hr)) { //DebugOut(L"[ERROR] DINPUT::GetDeviceData failed. Error: %d\n", hr); return; } // Scan through all buffered events, check if the key is pressed or released for (DWORD i = 0; i < dwElements; i++) { int KeyCode = keyEvents[i].dwOfs; int KeyState = keyEvents[i].dwData; if ((KeyState & 0x80) > 0) keyHandler->OnKeyDown(KeyCode); else keyHandler->OnKeyUp(KeyCode); } } CGame::~CGame() { if (spriteHandler != NULL) spriteHandler->Release(); if (backBuffer != NULL) backBuffer->Release(); if (d3ddv != NULL) d3ddv->Release(); if (d3d != NULL) d3d->Release(); } /* Standard sweptAABB implementation Source: GameDev.net */ void CGame::SweptAABB( float ml, float mt, float mr, float mb, float dx, float dy, float sl, float st, float sr, float sb, float &t, float &nx, float &ny) { float dx_entry, dx_exit, tx_entry, tx_exit; float dy_entry, dy_exit, ty_entry, ty_exit; float t_entry; float t_exit; t = -1.0f; // no collision nx = ny = 0; // // Broad-phase test // float bl = dx > 0 ? ml : ml + dx; float bt = dy > 0 ? mt : mt + dy; float br = dx > 0 ? mr + dx : mr; float bb = dy > 0 ? mb + dy : mb; if (br < sl || bl > sr || bb < st || bt > sb) return; if (dx == 0 && dy == 0) return; // moving object is not moving > obvious no collision if (dx > 0) { dx_entry = sl - mr; dx_exit = sr - ml; } else if (dx < 0) { dx_entry = sr - ml; dx_exit = sl - mr; } if (dy > 0) { dy_entry = st - mb; dy_exit = sb - mt; } else if (dy < 0) { dy_entry = sb - mt; dy_exit = st - mb; } if (dx == 0) { tx_entry = -999999.0f; tx_exit = 999999.0f; } else { tx_entry = dx_entry / dx; tx_exit = dx_exit / dx; } if (dy == 0) { ty_entry = -99999.0f; ty_exit = 99999.0f; } else { ty_entry = dy_entry / dy; ty_exit = dy_exit / dy; } if ((tx_entry < 0.0f && ty_entry < 0.0f) || tx_entry > 1.0f || ty_entry > 1.0f) return; t_entry = max(tx_entry, ty_entry); t_exit = min(tx_exit, ty_exit); if (t_entry > t_exit) return; t = t_entry; if (tx_entry > ty_entry) { ny = 0.0f; dx > 0 ? nx = -1.0f : nx = 1.0f; } else { nx = 0.0f; dy > 0 ? ny = -1.0f : ny = 1.0f; } } CGame *CGame::GetInstance() { if (__instance == NULL) __instance = new CGame(); return __instance; } bool CGame::IsScope(float l1, float t1, float r1, float b1, float l2, float t2, float r2, float b2) { if (l1 <= l2 && l2 <= r1) { if (t1 >= t2 && t2 >= b1) return true; if (t1 >= b2 && b2 >= b1) return true; } else if (l1 <= r2 && r2 <= r1) { if (t1 >= t2 && t2 >= b1) return true; if (t1 >= b2 && b2 >= b1) return true; } else return false; } #define MAX_GAME_LINE 1024 #define GAME_FILE_SECTION_UNKNOWN -1 #define GAME_FILE_SECTION_SETTINGS 1 #define GAME_FILE_SECTION_SCENES 2 void CGame::_ParseSection_SETTINGS(string line) { vector<string> tokens = split(line); if (tokens.size() < 2) return; if (tokens[0] == "start") current_scene = atoi(tokens[1].c_str()); else DebugOut(L"[ERROR] Unknown game setting %s\n", ToWSTR(tokens[0]).c_str()); } void CGame::_ParseSection_SCENES(string line) { vector<string> tokens = split(line); if (tokens.size() < 2) return; int id = atoi(tokens[0].c_str()); LPCWSTR path = ToLPCWSTR(tokens[1]); int typeScene = atoi(tokens[2].c_str()); int nextScene = atoi(tokens[3].c_str()); if (typeScene == TypeScene_Play) { LPSCENE scene = new CPlayScene(id, path); scene->SetNextScene(nextScene); scenes[id] = scene; } else if (typeScene == TypeScene_Opening) { LPSCENE scene = new COpeningScene(id, path); scene->SetNextScene(nextScene); scenes[id] = scene; } else if (typeScene == TypeScene_Ending) { LPSCENE scene = new CEndingScene(id, path); scene->SetNextScene(nextScene); scenes[id] = scene; } else if (typeScene == TypeScene_RollOut) { LPSCENE scene = new CRollOutScene(id, path); scene->SetNextScene(nextScene); scenes[id] = scene; } } /* Load game campaign file and load/initiate first scene */ void CGame::Load(LPCWSTR gameFile) { DebugOut(L"[INFO] Start loading game file : %s\n", gameFile); ifstream f; f.open(gameFile); char str[MAX_GAME_LINE]; // current resource section flag int section = GAME_FILE_SECTION_UNKNOWN; while (f.getline(str, MAX_GAME_LINE)) { string line(str); if (line[0] == '#') continue; // skip comment lines if (line == "[SETTINGS]") { section = GAME_FILE_SECTION_SETTINGS; continue; } if (line == "[SCENES]") { section = GAME_FILE_SECTION_SCENES; continue; } switch (section) { case GAME_FILE_SECTION_SETTINGS: _ParseSection_SETTINGS(line); break; case GAME_FILE_SECTION_SCENES: _ParseSection_SCENES(line); break; } } f.close(); DebugOut(L"[INFO] Loading game file : %s has been loaded successfully\n", gameFile); DebugOut(L"[INFO] Loading game file : %s has been loaded successfully\n", gameFile); Sound::GetInstance()->LoadSoundResource(SOUND_RESOURCE_UNDERWORLD); Sound::GetInstance()->LoadSoundResource(SOUND_RESOURCE_OVERWORLD); Sound::GetInstance()->LoadSoundResource(SOUND_RESOURCE_ENDING); Sound::GetInstance()->LoadSoundResource(SOUND_RESOURCE_INTRO); Sound::GetInstance()->LoadSoundResource(SOUND_RESOURCE_BOSS); LoadSound(); SwitchScene(current_scene); } void CGame::SwitchScene(int scene_id) { DebugOut(L"[INFO] Switching to scene %d\n", scene_id); scenes[current_scene]->Unload();; CTextures::GetInstance()->Clear(); CSprites::GetInstance()->Clear(); CAnimations::GetInstance()->Clear(); current_scene = scene_id; LPSCENE s = scenes[scene_id]; CGame::GetInstance()->SetKeyHandler(s->GetKeyEventHandler()); /*if (scene_id>=3) Sound::GetInstance()->Play("Area2", 1, 1);*/ s->Load(); } void CGame::LoadSound() { Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (13).wav", "PlayerBulletHitBrick"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (7).wav", "PlayerFireUnderWorld"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (8).wav", "PlayerFireOverWorld"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (9).wav", "BossFire"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (10).wav", "PlayerJump"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (16).wav", "EnemyBulletBang"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (19).wav", "PlayerInjured"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (21).wav", "PickingItems"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (22).wav", "TeleporterTransform"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (27).wav", "Enemydie"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (36).wav", "BossIntro"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/GameOver.wav", "GameOver"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/LifeLost.wav", "LifeLost"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (15).wav", "MineBip"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (16).wav", "EnemyBulletBang"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (19).wav", "PlayerInjured"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (23).wav", "FireRocket"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (24).wav", "TransingWeaponScene"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (25).wav", "FireHomingMissles"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (30).wav", "SkullFire"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (35).wav", "BossDie"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (29).wav", "TankDie"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (22).wav", "Blink"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound/Blaster Master SFX (26).wav", "SwitchScene"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound//Blaster Master SFX (17).wav", "Thunder"); Sound::GetInstance()->LoadSound("Sources/Sound/rawSound//Blaster Master SFX (4).wav", "BulletTouchBoss"); Sound::GetInstance()->LoadSound("Sources/Sound/Intro/Opening.wav", "Opening"); Sound::GetInstance()->LoadSound("Sources/Sound/Intro/CarSplash.wav", "CarSplash"); Sound::GetInstance()->LoadSound("Sources/Sound/Intro/CarBackground.wav", "CarBackground"); Sound::GetInstance()->LoadSound("Sources/Sound/Ending.wav", "Ending"); Sound::GetInstance()->LoadSound("Sources/Sound/Boss.wav", "Boss"); Sound::GetInstance()->LoadSound("Sources/Sound/Area2.wav", "Area2"); Sound::GetInstance()->LoadSound("Sources/Sound/Ending/Mountain.wav", "Mountain"); }
5562896665fa2a2729584fa8214864158bb4b3f9
b28305dab0be0e03765c62b97bcd7f49a4f8073d
/chrome/browser/ui/views/web_dialog_view_browsertest.cc
64b2bf55266f01e83f1cb99f65e690e889c9a3e0
[ "BSD-3-Clause" ]
permissive
svarvel/browser-android-tabs
9e5e27e0a6e302a12fe784ca06123e5ce090ced5
bd198b4c7a1aca2f3e91f33005d881f42a8d0c3f
refs/heads/base-72.0.3626.105
2020-04-24T12:16:31.442851
2019-08-02T19:15:36
2019-08-02T19:15:36
171,950,555
1
2
NOASSERTION
2019-08-02T19:15:37
2019-02-21T21:47:44
null
UTF-8
C++
false
false
9,294
cc
// 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. #include "base/bind.h" #include "base/bind_helpers.h" #include "base/location.h" #include "base/macros.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" #include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" #include "chrome/common/url_constants.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" #include "content/public/test/test_utils.h" #include "ui/views/controls/webview/web_dialog_view.h" #include "ui/views/widget/widget.h" #include "ui/web_dialogs/test/test_web_dialog_delegate.h" namespace { // Initial size of WebDialog for SizeWindow test case. Note the height must be // at least 59 on Windows. const int kInitialWidth = 60; const int kInitialHeight = 60; class TestWebDialogView : public views::WebDialogView { public: TestWebDialogView(content::BrowserContext* context, ui::WebDialogDelegate* delegate, bool* observed_destroy) : views::WebDialogView(context, delegate, new ChromeWebContentsHandler), should_quit_on_size_change_(false), observed_destroy_(observed_destroy) { EXPECT_FALSE(*observed_destroy_); delegate->GetDialogSize(&last_size_); } ~TestWebDialogView() override { *observed_destroy_ = true; } void set_should_quit_on_size_change(bool should_quit) { should_quit_on_size_change_ = should_quit; } private: // TODO(xiyuan): Update this when WidgetDelegate has bounds change hook. void SaveWindowPlacement(const gfx::Rect& bounds, ui::WindowShowState show_state) override { if (should_quit_on_size_change_ && last_size_ != bounds.size()) { // Schedule message loop quit because we could be called while // the bounds change call is on the stack and not in the nested message // loop. base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&base::RunLoop::QuitCurrentWhenIdleDeprecated)); } last_size_ = bounds.size(); } void OnDialogClosed(const std::string& json_retval) override { should_quit_on_size_change_ = false; // No quit when we are closing. views::WebDialogView::OnDialogClosed(json_retval); // Deletes this. } // Whether we should quit message loop when size change is detected. bool should_quit_on_size_change_; gfx::Size last_size_; bool* observed_destroy_; DISALLOW_COPY_AND_ASSIGN(TestWebDialogView); }; class WebDialogBrowserTest : public InProcessBrowserTest { public: WebDialogBrowserTest() {} // content::BrowserTestBase: void SetUpOnMainThread() override; protected: TestWebDialogView* view_ = nullptr; bool web_dialog_delegate_destroyed_ = false; bool web_dialog_view_destroyed_ = false; private: DISALLOW_COPY_AND_ASSIGN(WebDialogBrowserTest); }; void WebDialogBrowserTest::SetUpOnMainThread() { ui::test::TestWebDialogDelegate* delegate = new ui::test::TestWebDialogDelegate(GURL(chrome::kChromeUIChromeURLsURL)); delegate->set_size(kInitialWidth, kInitialHeight); delegate->SetDeleteOnClosedAndObserve(&web_dialog_delegate_destroyed_); view_ = new TestWebDialogView(browser()->profile(), delegate, &web_dialog_view_destroyed_); gfx::NativeView parent_view = browser()->tab_strip_model()->GetActiveWebContents()->GetNativeView(); views::Widget::CreateWindowWithParent(view_, parent_view); view_->GetWidget()->Show(); } } // namespace // Windows has some issues resizing windows. An off by one problem, and a // minimum size that seems too big. See http://crbug.com/52602. #if defined(OS_WIN) #define MAYBE_SizeWindow DISABLED_SizeWindow #else #define MAYBE_SizeWindow SizeWindow #endif IN_PROC_BROWSER_TEST_F(WebDialogBrowserTest, MAYBE_SizeWindow) { // TestWebDialogView should quit current message loop on size change. view_->set_should_quit_on_size_change(true); gfx::Rect set_bounds = view_->GetWidget()->GetClientAreaBoundsInScreen(); gfx::Rect actual_bounds, rwhv_bounds; // Bigger than the default in both dimensions. set_bounds.set_width(400); set_bounds.set_height(300); // WebDialogView ignores the WebContents* |source| argument to // SetContentsBounds. We could pass view_->web_contents(), but it's not // relevant for the test. view_->SetContentsBounds(nullptr, set_bounds); content::RunMessageLoop(); // TestWebDialogView will quit. actual_bounds = view_->GetWidget()->GetClientAreaBoundsInScreen(); EXPECT_EQ(set_bounds, actual_bounds); rwhv_bounds = view_->web_contents()->GetRenderWidgetHostView()->GetViewBounds(); EXPECT_LT(0, rwhv_bounds.width()); EXPECT_LT(0, rwhv_bounds.height()); EXPECT_GE(set_bounds.width(), rwhv_bounds.width()); EXPECT_GE(set_bounds.height(), rwhv_bounds.height()); // Larger in one dimension and smaller in the other. set_bounds.set_width(550); set_bounds.set_height(250); view_->SetContentsBounds(nullptr, set_bounds); content::RunMessageLoop(); // TestWebDialogView will quit. actual_bounds = view_->GetWidget()->GetClientAreaBoundsInScreen(); EXPECT_EQ(set_bounds, actual_bounds); rwhv_bounds = view_->web_contents()->GetRenderWidgetHostView()->GetViewBounds(); EXPECT_LT(0, rwhv_bounds.width()); EXPECT_LT(0, rwhv_bounds.height()); EXPECT_GE(set_bounds.width(), rwhv_bounds.width()); EXPECT_GE(set_bounds.height(), rwhv_bounds.height()); // Get very small. const gfx::Size min_size = view_->GetWidget()->GetMinimumSize(); EXPECT_LT(0, min_size.width()); EXPECT_LT(0, min_size.height()); set_bounds.set_size(min_size); view_->SetContentsBounds(nullptr, set_bounds); content::RunMessageLoop(); // TestWebDialogView will quit. actual_bounds = view_->GetWidget()->GetClientAreaBoundsInScreen(); EXPECT_EQ(set_bounds, actual_bounds); rwhv_bounds = view_->web_contents()->GetRenderWidgetHostView()->GetViewBounds(); EXPECT_LT(0, rwhv_bounds.width()); EXPECT_LT(0, rwhv_bounds.height()); EXPECT_GE(set_bounds.width(), rwhv_bounds.width()); EXPECT_GE(set_bounds.height(), rwhv_bounds.height()); // Check to make sure we can't get to 0x0. First expand beyond the minimum // size that was set above so that TestWebDialogView has a change to pick up. set_bounds.set_height(250); view_->SetContentsBounds(nullptr, set_bounds); content::RunMessageLoop(); // TestWebDialogView will quit. actual_bounds = view_->GetWidget()->GetClientAreaBoundsInScreen(); EXPECT_EQ(set_bounds, actual_bounds); // Now verify that attempts to re-size to 0x0 enforces the minimum size. set_bounds.set_width(0); set_bounds.set_height(0); view_->SetContentsBounds(nullptr, set_bounds); content::RunMessageLoop(); // TestWebDialogView will quit. actual_bounds = view_->GetWidget()->GetClientAreaBoundsInScreen(); EXPECT_EQ(min_size, actual_bounds.size()); // And that the render view is also non-zero. rwhv_bounds = view_->web_contents()->GetRenderWidgetHostView()->GetViewBounds(); EXPECT_LT(0, rwhv_bounds.width()); EXPECT_LT(0, rwhv_bounds.height()); // WebDialogView::CanClose() returns true only after before-unload handlers // have run (or the dialog has none and gets fast-closed via // RenderViewHostImpl::ClosePageIgnoringUnloadEvents which is the case here). // Close via WebContents for more authentic coverage (vs Widget::CloseNow()). EXPECT_FALSE(web_dialog_delegate_destroyed_); view_->web_contents()->Close(); EXPECT_TRUE(web_dialog_delegate_destroyed_); // The close of the actual widget should happen asynchronously. EXPECT_FALSE(web_dialog_view_destroyed_); content::RunAllPendingInMessageLoop(); EXPECT_TRUE(web_dialog_view_destroyed_); } // Test that closing the parent of a window-modal web dialog properly destroys // the dialog and delegate. IN_PROC_BROWSER_TEST_F(WebDialogBrowserTest, CloseParentWindow) { // Open a second browser window so we don't trigger shutdown. ui_test_utils::NavigateToURLWithDisposition( browser(), GURL(url::kAboutBlankURL), WindowOpenDisposition::NEW_WINDOW, ui_test_utils::BROWSER_TEST_NONE); // TestWebDialogDelegate defaults to window-modal, so closing the browser // Window (as opposed to closing merely the tab) should close the dialog. EXPECT_EQ(ui::MODAL_TYPE_WINDOW, view_->GetWidget()->widget_delegate()->GetModalType()); // Close the parent window. Tear down may happen asynchronously. EXPECT_FALSE(web_dialog_delegate_destroyed_); EXPECT_FALSE(web_dialog_view_destroyed_); browser()->window()->Close(); content::RunAllPendingInMessageLoop(); EXPECT_TRUE(web_dialog_delegate_destroyed_); EXPECT_TRUE(web_dialog_view_destroyed_); }
4ced96fd6b9d9787c77e4333b629ba4cdd79fa1d
a32d337a33000593579069873d157a90ba5ca774
/Day1/PracticeA1/no13.cpp
39890514179d73eb541c003a201bff3f20302f9a
[]
no_license
jillions242/My-Practice
9c030656a2503df10b4c155c11baaa05e30ad3a0
14b28546b43f2f7e91bec811b434aca123395099
refs/heads/master
2020-06-09T06:19:42.822715
2019-07-13T21:25:08
2019-07-13T21:25:08
193,389,468
0
0
null
null
null
null
UTF-8
C++
false
false
124
cpp
#include<iostream> #include<cmath> using namespace std; int main(){ cout<< (5/9)*(212-32)<< endl; return 0; }
1f430574ca769123c47c4208b274fd8fe9e9d1aa
60fb849761837643d7399d5b0ce2b62461924918
/TD5/utilisateurPremium.cpp
f6b6e75fc219c8e7236823ae2a2050c3f88d87e7
[]
no_license
NanorJ/INF1010
7d92214b53de91397e7cde4b8beb458f96623d11
f0f84ede756c978a2bd9c0bfd5b558a39112cbca
refs/heads/master
2020-03-29T08:15:52.591417
2018-12-03T00:27:46
2018-12-03T00:27:46
149,701,925
0
2
null
2018-11-18T01:21:04
2018-09-21T02:59:54
C++
UTF-8
C++
false
false
1,034
cpp
/******************************************** * Titre: Travail pratique #4 - utilisateurPremium.cpp * Date: 19 octobre 2018 * Auteur: Wassim Khene & Ryan Hardie *******************************************/ #include "utilisateurPremium.h" UtilisateurPremium::UtilisateurPremium(const string& nom, MethodePaiement methodePaiement, unsigned int joursRestants, const string& courriel, const string& idPaypal) : Utilisateur(nom, methodePaiement, courriel, idPaypal), joursRestants_(joursRestants) {} unsigned int UtilisateurPremium::getJoursRestants() const { return joursRestants_; } void UtilisateurPremium::setJoursRestants(unsigned int joursRestants) { joursRestants_ = joursRestants; } void UtilisateurPremium::print(ostream & os) const { os << setprecision(2) << fixed<< "Utilisateur (premium) " << nom_ << " :" << "\n\t\tTotal a payer: " << balanceTransferts_ << "$ (" << -balanceFrais_ << "$ economises)"<< endl << "\t\tJours restants: " << joursRestants_ << endl << "\t\tDepenses :\n"; Utilisateur::print(os); }
d744a42cc5be058fc73ff03e67a48f581890a030
cca5a965d2a67a4f2b364743a984502484ed10e6
/pepper_imitation/src/PepperImitationNode.cpp
31678b401d22bfe3dfe26acf42ec82feaf7ae252
[]
no_license
TelecomAnin/pepper-imitation-pkg
039c01f13be96497bc7f09117db4c01de6d927b8
020a20ab8217d0f86d22823fc3ecefecbef92544
refs/heads/master
2020-03-21T03:36:28.996873
2018-06-19T04:17:54
2018-06-19T04:17:54
null
0
0
null
null
null
null
UTF-8
C++
false
false
8,369
cpp
#include <algorithm> #include <tf/transform_datatypes.h> #include <pepper_imitation/ImitationResult.h> #include "PepperImitationNode.hpp" namespace Pepper { ImitationNode::ImitationNode() : async_spinner_ { 1 } { node_handle_.param("skeleton_tracker_base_frame", skeleton_tracker_base_frame_, skeleton_tracker_base_frame_); node_handle_.param("velocity_scaling_factor", velocity_scaling_factor_, velocity_scaling_factor_); node_handle_.param("acceleration_scaling_factor", acceleration_scaling_factor_, acceleration_scaling_factor_); node_handle_.param("goal_joint_tolerance", goal_joint_tolerance_, goal_joint_tolerance_); node_handle_.param("goal_position_tolerance", goal_pos_tolerance_, goal_pos_tolerance_); node_handle_.param("goal_orientation_tolerance", goal_orientation_tolerance_, goal_orientation_tolerance_); node_handle_.param("max_planning_time_", max_planning_time_, max_planning_time_); node_handle_.param("max_planning_attempts_", max_planning_attempts_, max_planning_attempts_); node_handle_.param("motion_planner_", motion_planner_, motion_planner_); pose_subscriber_ = node_handle_.subscribe("pepper_imitation/cmd_set_pose", 1, &ImitationNode::PoseCallback, this); imitation_result_publisher_ = node_handle_.advertise<pepper_imitation::ImitationResult>("pepper_imitation/imitation_result", 1); async_spinner_.start(); SetUpInterface(both_arms_interface_); ResetInterface(both_arms_interface_); const auto& named_targets = both_arms_interface_.getNamedTargets(); for(const auto& target : named_targets) { ROS_ERROR("Named target: %s", target.c_str()); } } ImitationNode::~ImitationNode() { StopCheckingCurrentPose(); ResetInterface(both_arms_interface_); } //Private void ImitationNode::PoseCallback(const pepper_imitation::ImitationPose& _imitation_msg) { StopCheckingCurrentPose(); try { both_arms_interface_.setNamedTarget(pose_name_map_.at(_imitation_msg.pose)); PlanTrajectory(both_arms_interface_); ExecuteTrajectory(both_arms_interface_); ROS_INFO("Checking pose %s for %d seconds", pose_name_map_.at(_imitation_msg.pose).c_str(), _imitation_msg.timeout); check_pose_ = true; check_pose_task_ = std::async( std::launch::async, &ImitationNode::CheckPose, this, check_poses_functions_.at(_imitation_msg.pose), std::chrono::seconds{ _imitation_msg.timeout }); } catch(const std::runtime_error& ex) { ROS_ERROR("Error on pose imitation: %s", ex.what()); SendResult(pepper_imitation::ImitationResult::ERROR); } catch(const std::out_of_range&) { ROS_ERROR("Error on pose imitation: unrecognized pose"); SendResult(pepper_imitation::ImitationResult::ERROR); } } void ImitationNode::CheckPose(std::function<bool(void)> _check_pose, const std::chrono::seconds& _timeout) { const auto& start_check_time = std::chrono::system_clock::now(); while(check_pose_) { if(std::chrono::system_clock::now() - start_check_time >= _timeout) { ROS_ERROR("Pose detection timeout"); SendResult(pepper_imitation::ImitationResult::TIMEOUT); break; } try { if(_check_pose()) { ROS_ERROR("Pose correctly detected!"); SendResult(pepper_imitation::ImitationResult::SUCCESS); break; } } catch(const tf::TransformException&) { ROS_ERROR("No skeleton available!"); SendResult(pepper_imitation::ImitationResult::NO_SKELETON); break; } using namespace std::literals::chrono_literals; std::this_thread::sleep_for(100ms); } } void ImitationNode::StopCheckingCurrentPose() { check_pose_ = false; try { check_pose_task_.wait(); } catch(const std::future_error&) {} } void ImitationNode::SendResult(uint8_t _result) { pepper_imitation::ImitationResult result_msg; result_msg.result = _result; imitation_result_publisher_.publish(result_msg); } void ImitationNode::SetUpInterface(PlannerInterface& _interface) { _interface.startStateMonitor(); _interface.setPlannerId(motion_planner_); _interface.setMaxVelocityScalingFactor(velocity_scaling_factor_); _interface.setMaxAccelerationScalingFactor(acceleration_scaling_factor_); _interface.setGoalJointTolerance(goal_joint_tolerance_); _interface.setGoalOrientationTolerance(goal_orientation_tolerance_); _interface.setGoalPositionTolerance(goal_pos_tolerance_); _interface.setPlanningTime(max_planning_time_); _interface.setNumPlanningAttempts(max_planning_attempts_); _interface.setPoseReferenceFrame(pose_reference_frame_); } void ImitationNode::PlanTrajectory(PlannerInterface& _interface) { Plan movement_plan; const auto& result = _interface.plan(movement_plan); if(result != moveit::planning_interface::MoveItErrorCode::SUCCESS) { throw std::runtime_error { std::string{ "Error planning trajectory on " } + _interface.getName() }; } } void ImitationNode::ExecuteTrajectory(PlannerInterface& _interface) { const auto& result = _interface.asyncMove(); if(result != moveit::planning_interface::MoveItErrorCode::SUCCESS) { throw std::runtime_error { std::string{ "Error executing trajectory on " } + _interface.getName() }; } } void ImitationNode::ResetInterface(PlannerInterface& _interface) { _interface.setNamedTarget("home"); PlanTrajectory(_interface); ExecuteTrajectory(_interface); } bool ImitationNode::CheckHandsUpPose() { const auto& head_to_left_hand_ = GetTransform("/head", "/left_hand"); const auto& head_to_right_hand_ = GetTransform("/head", "/right_hand"); return head_to_left_hand_.getOrigin().y() > 0.0 && head_to_right_hand_.getOrigin().y() > 0.0; } bool ImitationNode::CheckHandsOnHeadPose() { const auto& head_to_left_hand_ = GetTransform("/head", "/left_hand"); const auto& head_to_right_hand_ = GetTransform("/head", "/right_hand"); return head_to_left_hand_.getOrigin().y() > 0.0 && head_to_right_hand_.getOrigin().y() > 0.0 && head_to_left_hand_.getOrigin().distance(head_to_right_hand_.getOrigin()) <= 0.2; } bool ImitationNode::CheckHandsOnFrontPose() { const auto& head_to_left_hand_ = GetTransform("/head", "/left_hand"); const auto& head_to_right_hand_ = GetTransform("/head", "/right_hand"); return head_to_left_hand_.getOrigin().y() > 0.0 && head_to_right_hand_.getOrigin().y() > 0.0 && head_to_left_hand_.getOrigin().distance(head_to_right_hand_.getOrigin()) <= 0.2; } tf::StampedTransform ImitationNode::GetTransform(const std::string& _origin_frame, const std::string& _end_frame) { std::string person_id {"_"}; std::vector<std::string> frames {}; tf_listener_.getFrameStrings(frames); const auto& skeleton_part_it = std::find_if(frames.cbegin(), frames.cend(), [](const auto& frame_name){ return frame_name.rfind("torso_", 0) == 0; }); if(skeleton_part_it != frames.cend()) { person_id += skeleton_part_it->back(); } tf::StampedTransform transform; tf_listener_.lookupTransform(_origin_frame + person_id, _end_frame + person_id, ros::Time(0), transform); return transform; } tf::Vector3 ImitationNode::ToROSAxis(const tf::Vector3& _vector) { return { -1.0 * _vector.z(), _vector.x(), _vector.y() }; } }
bccc0c971a49c9893e3108c91a925311def9498d
96dae00de134c84e58ca7c3a5420313fc484da10
/ICPC_AlgorithmTemplete/数据结构/字符串与各种自动机/回文串的马拉车算法/回文子串以及o(n)算法(求具体是哪个).cpp
9c28beee97b56831877129a1bbe18e528ce1793d
[]
no_license
meiyoumingzile/ICPC_AlgorithmTemplete
62758cde771667bf8602b6e625456a36c8525ab7
2bcabeadd94e83acaffa0b90365c93468a8f0004
refs/heads/master
2023-08-16T23:06:22.774993
2023-08-13T08:47:01
2023-08-13T08:47:01
159,670,934
7
2
null
null
null
null
GB18030
C++
false
false
1,517
cpp
#include<bits/stdc++.h> //#include<windows.h> using namespace std; #define ll long long #define inf 1e-5 const int inv2=500000004; const int INF=2147483647; const int MAX=11000001; const int mod=1e9+7; char str[MAX],s[MAX*2+1],res[MAX]; int p[MAX*2+1]; int Manacher(const char *str){ int i,j,k,len,ls,maxRight,pos,ans=2; len=strlen(str); ls=len*2+1; memset(s,'#',sizeof(char)*ls); for(i=0;i<len;i++) s[i*2+1]=str[i]; maxRight=2; pos=1; p[0]=1; p[1]=2; for(i=2;i<ls;i++){ p[i]=i<maxRight?min(p[2*pos-i],maxRight-i):1; while(i-p[i]>=0&&i+p[i]<ls&&s[i-p[i]]==s[i+p[i]]) p[i]++; if(maxRight<i+p[i]){ maxRight=i+p[i]; pos=i; } ans=max(ans,p[i]); } /*for(i=0;i<ls;i++){ printf("%c ",s[i]); }printf("\n"); for(i=0;i<ls;i++){ printf("%d ",p[i]); }printf("\n");*/ ans--; memset(res,0,sizeof(res)); for(i=0;i<ls;i++){ if(ans+1==p[i]){ k=0; for(j=i-ans+1;j<i+ans;j+=2){ res[k++]=s[j]; } break;//只找一个 } } return ans; } int main(int argc,char *argv[]){ //freopen("in.txt","r",stdin); //输入重定向,输入数据将从in.txt文件中读取 //freopen("out.txt","w",stdout); //输出重定向,输出数据将保存在out.txt文件中 //srand(time(NULL));//有的OJ不能加这句话 cin>>str; printf("%d\n",Manacher(str)); return 0; }
f67bb37139c8779f7deebe28f5bdfaa324edf859
f28654bca317d7b872672cae201fc54ee6fc7783
/ExampleCode/StepperMotorSequence/StepperMotorSequence.ino
d287d8730ad9d4f23db29e3b13ec614c3b25e4a5
[]
no_license
zebbarry/Robocup
17f8abdf0e771a5d76fe03f78fd2bc903f138de5
face0529206d34be933dc96368d60bccf325bfc1
refs/heads/master
2022-12-27T23:32:17.863407
2019-10-16T03:09:50
2019-10-16T03:09:50
304,485,643
0
0
null
null
null
null
UTF-8
C++
false
false
2,294
ino
/* This sample code is for testing the 4 stepper motors Each motor will iturn rotate forward then backward */ int M1dirpin = 39; int M1steppin = 38; int M2dirpin = 41; int M2steppin = 40; int M3dirpin = 45; int M3steppin = 44; int M4dirpin = 43; int M4steppin = 42; void setup() { pinMode(49, OUTPUT); //Pin 49 is used to enable IO power digitalWrite(49, 1); //Enable IO power on main CPU board //Setup step and direction pins for output pinMode(M1dirpin,OUTPUT); pinMode(M1steppin,OUTPUT); pinMode(M2dirpin,OUTPUT); pinMode(M2steppin,OUTPUT); pinMode(M3dirpin,OUTPUT); pinMode(M3steppin,OUTPUT); pinMode(M4dirpin,OUTPUT); pinMode(M4steppin,OUTPUT); } void loop() { int j; //Set direction for all channels digitalWrite(M1dirpin,LOW); digitalWrite(M2dirpin,LOW); digitalWrite(M3dirpin,LOW); digitalWrite(M4dirpin,LOW); //Channel 1 for(j=0;j<=1000;j++) //Move 1000 steps { digitalWrite(M1steppin,LOW); delayMicroseconds(2); digitalWrite(M1steppin,HIGH); delay(1); } digitalWrite(M1dirpin,HIGH); //Change direction for(j=0;j<=1000;j++) //Move another 1000 steps { digitalWrite(M1steppin,LOW); delayMicroseconds(2); digitalWrite(M1steppin,HIGH); delay(1); } //Channel 2 for(j=0;j<=1000;j++) { digitalWrite(M2steppin,LOW); delayMicroseconds(2); digitalWrite(M2steppin,HIGH); delay(1); } digitalWrite(M2dirpin,HIGH); for(j=0;j<=1000;j++) { digitalWrite(M2steppin,LOW); delayMicroseconds(2); digitalWrite(M2steppin,HIGH); delay(1); } //Channel 3 for(j=0;j<=1000;j++) { digitalWrite(M3steppin,LOW); delayMicroseconds(2); digitalWrite(M3steppin,HIGH); delay(1); } digitalWrite(M3dirpin,HIGH); for(j=0;j<=1000;j++) { digitalWrite(M3steppin,LOW); delayMicroseconds(2); digitalWrite(M3steppin,HIGH); delay(1); } //Channel 4 for(j=0;j<=1000;j++) { digitalWrite(M4steppin,LOW); delayMicroseconds(2); digitalWrite(M4steppin,HIGH); delay(1); } digitalWrite(M4dirpin,HIGH); for(j=0;j<=1000;j++) { digitalWrite(M4steppin,LOW); delayMicroseconds(2); digitalWrite(M4steppin,HIGH); delay(1); } }
c80329ad0682863436aeb719b35971250aa9bd0b
1054d39cb25d92cd62eb1dc0c4b04bd5359fbea7
/PA122/PA6JeanCho/PA6JeanCho/BST.cpp
b9f40d8988d885a48bb442e5dd059b6c66f95c96
[]
no_license
JeanCho/CPTS122
1c92d3a7770812fda6f112abb10a78a41155a407
79f02e0f1d29bb0638b22c70314fb82c7d27f1fb
refs/heads/master
2020-03-19T07:56:27.922311
2018-06-05T10:44:15
2018-06-05T10:44:15
136,162,123
1
0
null
null
null
null
UTF-8
C++
false
false
3,381
cpp
#include "BST.h" BST::BST(Node *pNewRoot) { this->pRoot = pNewRoot; this->mInput.open("MorseTable.txt", ios::in); this->mInput2.open("Convert.txt", ios::in); this->loadMorseTable(); mInput.close(); } BST::~BST() { cout << "Inside BST destructor, closing files..." << endl; if (mInput.is_open()) { mInput.close(); } if (mInput2.is_open()) { mInput2.close(); } cout << "File closed" << endl; } // public void BST::loadMorseTable()//load morse table as a nodes of BST, insert in order { Node *n = nullptr; char alphabet; string line; while (!mInput.eof()) { mInput >> line; alphabet = line[0]; mInput >> line; this->insert(this->pRoot,alphabet, line); } } void BST::convert() { string line=""; string converted=""; cout << "This is a test of the cpts 122 Morse code conversion tool." << endl; while (!mInput2.eof()) { mInput2 >> line; for (int i = 0; line[i] != NULL; i++) { if (line[i] == '\n') { converted += "\n"; } else { converted += search(line[i]); converted += " ";//space for each character } } converted += " ";//double space, eventually 1+2 =3 space for each Morse string } cout << converted << endl; cout << "Conversion Complete" << endl << endl; } //ifstream& operator >> (ifstream& lhs, Node &rhs) //{ // string input, morse;// sAlpha = "", copyline; // char alphabet; // // lhs >> input; // alphabet = input[0]; // rhs.setAlpha(alphabet); // lhs >> input; // rhs.setData(input); // //lhs >> input;//flush the empty line // return lhs; //} bool BST::insert(char alpha, const string &newData) { bool success = false; success = insert((this->pRoot),alpha,newData); // private return success; } //based on the size of aplphabet bool BST::insert(Node *&pTree, char alpha, const string &newData) { bool success = false; if (pTree == nullptr) // base case? { Node *pMem = nullptr; pMem = new Node(alpha, newData); if (pMem != nullptr) { success = true; pTree = pMem; } } else if (alpha > (pTree)->getAlpha())// recursive step { // go down right subtree success = insert(((pTree)->getRight()), alpha, newData); } else if (alpha < (pTree)->getAlpha())// left subtree { success = insert(((pTree)->getLeft()), alpha, newData); } else // duplicate { cout << "dup" << endl; } return success; } void BST::print() { print(this->pRoot); } void BST::print(Node *pTree) { // algorithm: 1. go as far left as possible // 2. process the node (print) // 3. go as far right as possible if (pTree != nullptr) { print(pTree->getLeft()); cout <<pTree->getAlpha()<<" : " << pTree->getData() << endl; print(pTree->getRight()); } } string BST::search(char alpha) { string morse; morse = search(this->pRoot, alpha); return morse; } string BST::search(Node *pTree,char alpha)//recursive function that returns data { char ss = pTree->getAlpha(); string target = ""; if (pTree != nullptr) { if (pTree->getAlpha() == alpha)//return if found { target = pTree->getData(); } else if (alpha > (pTree)->getAlpha())// recursive step { // go down right subtree target = search(pTree->getRight(), alpha); } else if (alpha < (pTree)->getAlpha())// left subtree { target = search(pTree->getLeft(), alpha); } } /*else { cout << "Failed to find target" << endl; return "/failtofind/"; }*/ return target; }
adfbfed4256f2282158997d550eaa2f1c3403195
9d364070c646239b2efad7abbab58f4ad602ef7b
/platform/external/chromium_org/ui/app_list/views/search_result_view.h
8a9820dd2be057454276b780f11accf7af299471
[ "BSD-3-Clause" ]
permissive
denix123/a32_ul
4ffe304b13c1266b6c7409d790979eb8e3b0379c
b2fd25640704f37d5248da9cc147ed267d4771c2
refs/heads/master
2021-01-17T20:21:17.196296
2016-08-16T04:30:53
2016-08-16T04:30:53
65,786,970
0
2
null
2020-03-06T22:00:52
2016-08-16T04:15:54
null
UTF-8
C++
false
false
3,082
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 UI_APP_LIST_VIEWS_SEARCH_RESULT_VIEW_H_ #define UI_APP_LIST_VIEWS_SEARCH_RESULT_VIEW_H_ #include <string> #include <vector> #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "ui/app_list/search_result_observer.h" #include "ui/app_list/views/search_result_actions_view_delegate.h" #include "ui/views/context_menu_controller.h" #include "ui/views/controls/button/custom_button.h" namespace gfx { class RenderText; } namespace views { class ImageButton; class ImageView; class MenuRunner; } namespace app_list { namespace test { class SearchResultListViewTest; } class ProgressBarView; class SearchResult; class SearchResultListView; class SearchResultViewDelegate; class SearchResultActionsView; class SearchResultView : public views::CustomButton, public views::ButtonListener, public views::ContextMenuController, public SearchResultObserver, public SearchResultActionsViewDelegate { public: static const char kViewClassName[]; explicit SearchResultView(SearchResultListView* list_view); virtual ~SearchResultView(); void SetResult(SearchResult* result); SearchResult* result() { return result_; } void ClearResultNoRepaint(); void ClearSelectedAction(); private: friend class app_list::test::SearchResultListViewTest; void UpdateTitleText(); void UpdateDetailsText(); virtual const char* GetClassName() const OVERRIDE; virtual gfx::Size GetPreferredSize() const OVERRIDE; virtual void Layout() OVERRIDE; virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; virtual void ButtonPressed(views::Button* sender, const ui::Event& event) OVERRIDE; virtual void ShowContextMenuForView(views::View* source, const gfx::Point& point, ui::MenuSourceType source_type) OVERRIDE; virtual void OnIconChanged() OVERRIDE; virtual void OnActionsChanged() OVERRIDE; virtual void OnIsInstallingChanged() OVERRIDE; virtual void OnPercentDownloadedChanged() OVERRIDE; virtual void OnItemInstalled() OVERRIDE; virtual void OnItemUninstalled() OVERRIDE; virtual void OnSearchResultActionActivated(size_t index, int event_flags) OVERRIDE; SearchResult* result_; SearchResultListView* list_view_; views::ImageView* icon_; scoped_ptr<gfx::RenderText> title_text_; scoped_ptr<gfx::RenderText> details_text_; SearchResultActionsView* actions_view_; ProgressBarView* progress_bar_; scoped_ptr<views::MenuRunner> context_menu_runner_; DISALLOW_COPY_AND_ASSIGN(SearchResultView); }; } #endif
37993ca7f75d1bd2cd31a85c07ced2b88dfdee1c
9b0f950465bd8b4e82e7d337947accf87a7928bc
/线段树.cpp
555e3cfbe34224afed03986e3967f1e4d4ec96a5
[]
no_license
Haut-Stone/data-structure
f9046ef23d2262aaf84abc1f24d330eaa0553619
04c3e1ad4be2bc129747652a738d42f23864b386
refs/heads/master
2020-12-24T06:47:11.529701
2017-07-13T10:36:00
2017-07-13T10:36:00
73,399,104
2
0
null
null
null
null
UTF-8
C++
false
false
548
cpp
/* * Created by ShiJiahuan(li) in haut. * for more please visit www.shallweitalk.com * * Copyright 2017 SJH. All rights reserved. * * @Author: Haut-Stone * @Date: 2017-04-09 11:43:24 * @Last Modified by: Haut-Stone * @Last Modified time: 2017-04-09 11:43:24 */ #include <algorithm> #include <iostream> #include <cstring> #include <vector> #include <cstdio> #include <queue> #include <stack> #include <cmath> #include <map> #include <set> using namespace std; #define INPUT_TEST freopen("in.txt", "r", stdin) int main(void) { return 0; }
dc07392584aaedb7e25ac794e50aa92633eb890e
69bb1569d7c1a309af58b757a2dec3b5f475249a
/include/argsmap.h
9cdf0f637f7361267f8bb60fb2774d9a43cf978a
[]
no_license
sMaxym/myshell
17c900f4566f19a50dfb3b163af87309854c3fc7
ff95cdb466e545a28a722d0f684dc1e2f04433b3
refs/heads/master
2023-01-02T09:40:38.201602
2020-10-31T21:16:23
2020-10-31T21:16:23
300,282,070
0
0
null
null
null
null
UTF-8
C++
false
false
1,564
h
#ifndef ARGSMAP_H #define ARGSMAP_H #include "syntax_analysis.h" #include <algorithm> template <typename T, typename U> class ArgsMap { typedef std::map<T, U> tree_map_t; tree_map_t tree_map; public: ArgsMap(const tree_map_t& tree_map) : tree_map(tree_map){}; ~ArgsMap() = default; std::pair<std::vector<const char*>, std::string> map2vector(); inline tree_map_t& get_tree_map() { return tree_map; }; }; template <typename T, typename U> std::pair<std::vector<const char*>, std::string> ArgsMap<T, U>::map2vector() { std::vector<const char*> args_for_c; std::string prog; std::string prog_name = tree_map[PROG][tree_map[PROG].size() - 1]; size_t ind = prog_name.find('.'); for (const auto& x: tree_map[PROG]) { prog += x + '/'; } prog.pop_back(); if (ind != std::string::npos && prog_name.substr(ind) == ".msh") { tree_map[ARGS].insert(tree_map[ARGS].begin(), prog); prog = "myshell"; } args_for_c.push_back(prog.c_str()); for (const auto& x: tree_map[ARGS]) { args_for_c.push_back(x.c_str()); } for (const auto& x: tree_map[NT_FLAG]) { args_for_c.push_back(x.c_str()); } for (size_t i = 0; i < tree_map[KEY].size(); ++i) { prog = tree_map[KEY][i] + '=' + tree_map[VALUE][i]; args_for_c.push_back(prog.c_str()); } args_for_c.push_back(nullptr); return std::pair(args_for_c, args_for_c[0]); } #endif // ARGSMAP_H
964cd3a41ecbdfd7f2dc77092a67dec76659605e
3ded37602d6d303e61bff401b2682f5c2b52928c
/ml/1061/Classes/Depends/widget/KDGridView.cpp
4a037f5d8ae340ffb22bc7aeea7feb72bbe6e47c
[ "MIT" ]
permissive
CristinaBaby/Demo_CC
8ce532dcf016f21b442d8b05173a7d20c03d337e
6f6a7ff132e93271b8952b8da6884c3634f5cb59
refs/heads/master
2021-05-02T14:58:52.900119
2018-02-09T11:48:02
2018-02-09T11:48:02
120,727,659
0
0
null
null
null
null
UTF-8
C++
false
false
21,883
cpp
// // STGridView.cpp // SweetDiscovery // // Created by zhangguangzong1 on 8/21/13. // // #include "KDGridView.h" //#include "CSVParse.h" KDGridView::KDGridView(): m_fHSpace(0),m_fVSpace(0), m_iCol(0),m_iRow(0), m_fMarginTop(0),m_fMarginLeft(0), m_fMarginRight(0),m_fMarginBottom(0), m_fAdjustStep(0),m_ScrollCallback(NULL), m_bAutoGetAdjust(true),m_bTouchedMenu(false), m_bNeedAdjust(true),m_bScroll(true),m_bIsScroll(true), m_bScrollNeedAdjust(false),m_bLock(false), isInTouchLoop(false),m_Adapter(NULL),m_fnClickCall(nullptr),m_bIsEnable(true) { } KDGridView:: ~KDGridView() { CC_SAFE_RELEASE_NULL(m_Adapter); } KDGridView* KDGridView::create(const Size &contentSize) { KDGridView* grid = new KDGridView(); if(grid && grid->initWithSize(contentSize)) { grid->autorelease(); return grid; } CC_SAFE_DELETE(grid); return nullptr; } void KDGridView::setScrollEnable(bool enable) { this->m_bScroll = enable; } void KDGridView::setIsScroll(bool enable) { m_bIsScroll = enable; } bool KDGridView::initWithSize(const cocos2d::Size &contentSize) { bool bRet = false; do { CC_BREAK_IF(!Layer::init()); this->setContentSize(contentSize); this->ignoreAnchorPointForPosition(false); this->setAnchorPoint(Vec2(0.5f,0.5f)); m_pMenu = Menu::create(); m_pMenu->setPosition(Vec2::ZERO); _eventDispatcher->removeEventListenersForTarget(m_pMenu); m_Container = Layer::create(); m_pScrollView = ScrollView::create(contentSize,m_Container); m_pScrollView->setPosition(Vec2::ZERO); m_pScrollView->setTouchEnabled(true); m_pScrollView->setDelegate(this); m_pScrollView->setDirection(ScrollView::Direction::VERTICAL); this->addChild(m_pScrollView,1); _eventDispatcher->removeEventListenersForTarget(m_pScrollView); m_pScrollView->setBounceable(true); m_pMask = Layer::create(); m_pMask->setContentSize(contentSize); m_pMask->setPosition(Vec2::ZERO); this->addChild(m_pMask,0); EventListenerTouchOneByOne* listener = EventListenerTouchOneByOne::create(); listener->setSwallowTouches(true); listener->onTouchBegan = CC_CALLBACK_2(KDGridView::TouchBegan, this); listener->onTouchMoved = CC_CALLBACK_2(KDGridView::TouchMoved, this); listener->onTouchEnded = CC_CALLBACK_2(KDGridView::TouchEnded, this); listener->onTouchCancelled = CC_CALLBACK_2(KDGridView::TouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // _eventDispatcher->addEventListenerWithFixedPriority(listener, -1); m_Container->addChild(m_pMenu); bRet = true; } while (0); return bRet; } void KDGridView::setScrollCallback(KDGridViewScrollCallback *callback) { if(NULL == callback) return; this->m_ScrollCallback = callback; } KDGridViewScrollCallback* KDGridView::getScrollCallback() { return m_ScrollCallback; } void KDGridView::setBackground(Node* bg) { bg->ignoreAnchorPointForPosition(false); bg->setAnchorPoint(Vec2(0.5f,0.5f)); bg->setPosition(Vec2(this->getContentSize().width/2, this->getContentSize().height/2)); this->addChild(bg,-1); } void KDGridView::setAdapter(KDAdapter* adapter) { if(NULL == adapter) return; if (m_Adapter) { m_Adapter->release(); m_Adapter = NULL; } this->m_Adapter = adapter; this->m_Adapter->retain(); this->layoutView(); } KDAdapter* KDGridView::getAdapter() { return m_Adapter; } void KDGridView::setAdjustStep(float f) { if(f>=0) { this->m_fAdjustStep = f; this->m_bAutoGetAdjust = false; }else { this->m_bAutoGetAdjust = true; } } void KDGridView::layoutView() { m_pMenu->removeAllChildrenWithCleanup(true); m_pMenuItemsVector.clear(); if(!m_Container) return; int totalCount = m_Adapter->getCount(); if (totalCount <= 0) return; if (m_pScrollView) { float itemWidth = m_Adapter->getItemWidth(); float itemHeight = m_Adapter->getItemHeight(); if(m_pScrollView->getDirection() == ScrollView::Direction::HORIZONTAL) { int col = totalCount%m_iRow == 0 ? totalCount/m_iRow : totalCount/m_iRow + 1; log("col:%d",col); //计算宽度 float containerWidth= m_fMarginLeft + itemWidth * col + m_fHSpace*(col -1) + m_fMarginRight; if(m_bAutoGetAdjust) m_fAdjustStep = itemWidth + m_fHSpace; m_Container->setContentSize(Size(containerWidth, this->getContentSize().height)); //待修改 m_fLowLevelOffsetX = this->getContentSize().width - containerWidth; m_bScrollNeedAdjust = m_fLowLevelOffsetX>=0 ? false : true ; m_pScrollView->setContentOffset(Vec2(0,0)); m_pScrollView->setContentSize(m_Container->getContentSize()); }else { //计算行数 int row = totalCount%m_iCol == 0 ? totalCount/m_iCol : totalCount/m_iCol + 1; //计算高度 float containerHeight = m_fMarginTop + itemHeight * row + m_fVSpace*(row -1)+m_fMarginBottom; if(m_bAutoGetAdjust) m_fAdjustStep = itemHeight + m_fVSpace; m_Container->setContentSize(Size(this->getContentSize().width, containerHeight)); m_fLowLevelOffsetY = this->getContentSize().height -containerHeight; m_bScrollNeedAdjust = m_fLowLevelOffsetY>=0 ? false : true ; m_pScrollView->setContentOffset(Vec2(0,m_fLowLevelOffsetY)); m_pScrollView->setContentSize(m_Container->getContentSize()); } float startX = m_fMarginLeft; float startY = m_Container->getContentSize().height - m_fMarginTop; log("startY = %f",startY); for (int i = 0; i < totalCount; i++) { MenuItem* obj = m_Adapter->getView(i,NULL,m_pMenu); m_pMenuItemsVector.pushBack(obj); if (obj) { // obj->setTarget(this, menu_selector(KDGridView::menuCallback)); obj->setCallback(CC_CALLBACK_1(KDGridView::menuCallback,this)); obj->setUserObject(__String::createWithFormat("%d",i)); obj->setAnchorPoint(Vec2(0.5, 0.5)); int curRow = this->calculateRow(i); int curCol = this->calculateColumn(i); Rect rect = obj->boundingBox(); float nodeX = startX + curCol*rect.size.width + m_fHSpace*curCol + rect.size.width * obj->getAnchorPoint().x; float nodeY = startY - curRow*rect.size.height - m_fVSpace*curRow - rect.size.height * obj->getAnchorPoint().y; obj->setPosition(Vec2(nodeX, nodeY)); log("nodeX = %f, nodeY = %f",nodeX,nodeY); m_pMenu->addChild(obj); } } } if (m_ScrollCallback) { m_ScrollCallback->onScrollEnd(m_pScrollView->getContentOffset().x, m_pScrollView->getContentOffset().y); } } void KDGridView::loadLayoutConfig(const char* csv,int row) { // CSVParse* layoutConfigs = CSVParse::create(csv); // if (!layoutConfigs) // { // logERROR("Can't load CSV file: %s", csv); // return; // } // // const unsigned rows = layoutConfigs->getRows(); // if(row <=0 || row >= rows) // { // logERROR("row is not a available value!"); // return; // } // // String* direction = String::create(layoutConfigs->getDatas(row, DIRECTION)); // if (direction->m_sString == HORIZONTAL) // { // this->setDirection(kScrollViewDirectionHorizontal); // }else if (direction->m_sString == VERTICAL) // { // this->setDirection(kScrollViewDirectionVertical); // } // m_Row = String::create(layoutConfigs->getDatas(row, ROW))->intValue(); // m_Col = String::create(layoutConfigs->getDatas(row, COL))->intValue(); // m_MarginTop = String::create(layoutConfigs->getDatas(row, TOP))->floatValue(); // m_MarginLeft = String::create(layoutConfigs->getDatas(row, LEFT))->floatValue(); // m_MarginBottom = String::create(layoutConfigs->getDatas(row, BOTTOM))->floatValue(); // m_MarginRight = String::create(layoutConfigs->getDatas(row, RIGHT))->floatValue(); // m_fHSpace = String::create(layoutConfigs->getDatas(row, HSPACE))->floatValue(); // m_fVSpace= String::create(layoutConfigs->getDatas(row, VSPACE))->floatValue(); } void KDGridView::refresh() { this->layoutView(); } bool KDGridView::isNearToLeftTopSide() { if(m_pScrollView->getDirection() == ScrollView::Direction::HORIZONTAL) { return m_pScrollView->getContentOffset().x>=0; }else { return m_pScrollView->getContentOffset().y>=0; } } bool KDGridView::isNearToRightBottomSide() { if(m_pScrollView->getDirection() == ScrollView::Direction::HORIZONTAL) { return m_pScrollView->getContentOffset().x<=m_fLowLevelOffsetX; }else { return m_pScrollView->getContentOffset().y<=m_fLowLevelOffsetY; } } void KDGridView::moveNextStep() { if (!m_bLock) { m_bLock = true; Point adjustPos; if(m_pScrollView->getDirection() == ScrollView::Direction::HORIZONTAL) { if(m_pScrollView->getContentOffset().x<=m_fLowLevelOffsetX) { m_bLock = false; return; } adjustPos = Vec2(m_pScrollView->getContentOffset().x - m_fAdjustStep, 0); }else { if(m_pScrollView->getContentOffset().y<=m_fLowLevelOffsetY) { m_bLock = false; return; } adjustPos = Vec2(0,m_pScrollView->getContentOffset().y - m_fAdjustStep); } m_pScrollView->setContentOffsetInDuration(adjustPos, 0.5f); FiniteTimeAction* action = Sequence::create(DelayTime::create(0.5f), CallFunc::create(CC_CALLBACK_0(KDGridView::unlock,this)), NULL); runAction(action); } } void KDGridView::movePreStep() { if(!m_bLock) { m_bLock = true; Point adjustPos; if(m_pScrollView->getDirection() == ScrollView::Direction::HORIZONTAL) { if(m_pScrollView->getContentOffset().x>=0) { m_bLock = false; return; } adjustPos = Vec2(m_pScrollView->getContentOffset().x + m_fAdjustStep, 0); }else { if(m_pScrollView->getContentOffset().y>=0) { m_bLock = false; return; } adjustPos = Vec2(0,m_pScrollView->getContentOffset().y + m_fAdjustStep); } m_pScrollView->setContentOffsetInDuration(adjustPos, 0.5f); FiniteTimeAction* action = Sequence::create(DelayTime::create(0.5f), CallFunc::create(CC_CALLBACK_0(KDGridView::unlock,this)), NULL); runAction(action); } } int KDGridView::calculateRow(int index) { int arg = 0; switch (m_pScrollView->getDirection()) { case ScrollView::Direction::VERTICAL: arg = (int) index / m_iCol; break; case ScrollView::Direction::HORIZONTAL: arg = (int) index % m_iRow; break; default: arg = (int) index / m_iCol; break; } return arg; } int KDGridView::calculateColumn(int index) { int arg = 0; switch (m_pScrollView->getDirection()) { case ScrollView::Direction::VERTICAL: arg = index % m_iCol; break; case ScrollView::Direction::HORIZONTAL: arg = index / m_iRow; break; default: arg = index % m_iCol; break; } return arg; } void KDGridView::menuCallback(Ref* pSender) { MenuItem* obj = dynamic_cast<MenuItem*>(pSender); if(obj && m_fnClickCall) { __String* indexStr = (__String*)obj->getUserObject(); if(index >=0 && 0 < m_Adapter->getCount()) { m_fnClickCall(this->getTag(),obj,indexStr->intValue()); } } } void KDGridView::setDirection(ScrollView::Direction eDirection) { if(m_pScrollView) { m_pScrollView->setDirection(eDirection); } } //scrollview滚动的时候会调用 void KDGridView::scrollViewDidScroll(ScrollView* view) { if (m_ScrollCallback) { m_ScrollCallback->onScrolling(view->getContentOffset().x, view->getContentOffset().y); } } //scrollview缩放的时候会调用 void KDGridView::scrollViewDidZoom(cocos2d::extension::ScrollView* view) { if (m_ScrollCallback) { m_ScrollCallback->onScrollDidZoom(view); } } void KDGridView::onEnter() { Layer::onEnter(); } void KDGridView::onExit() { Layer::onExit(); } bool KDGridView::TouchBegan(Touch *pTouch, Event *pEvent) { if (!this->isVisible()) { return false; } // if (!m_bIsEnable) { // return false; // } Vec2 touchPoint = pTouch->getLocation(); Vec2 realPoint = m_pMask->convertToNodeSpace(touchPoint); Rect rect = Rect(0,0,m_pMask->getContentSize().width,m_pMask->getContentSize().height); if(rect.containsPoint(realPoint)) { m_touchPoint = Director::getInstance()->convertToGL(pTouch->getLocationInView()); switch (m_pScrollView->getDirection()) { case ScrollView::Direction::VERTICAL: m_fBeginOffset = m_pScrollView->getContentOffset().y; break; case ScrollView::Direction::HORIZONTAL: m_fBeginOffset= m_pScrollView->getContentOffset().x; break; default: m_fBeginOffset = 0; break; } if(!m_bLock) { if(this->m_bScroll) { m_bTouchedMenu = m_pMenu->onTouchBegan(pTouch,pEvent); m_pScrollView->onTouchBegan(pTouch, pEvent); } } return true; } return false; } void KDGridView::TouchMoved(Touch *pTouch, Event *pEvent) { Vec2 delta = pTouch->getDelta(); // log("delta:---->x:%f--------y:%f",delta.x,delta.y); if (fabs(delta.x) < 1||fabs(delta.y) < 1) { return; } if (!m_bIsScroll) { return; } if(!m_bLock) { if (this->m_bScroll) { m_pScrollView->onTouchMoved(pTouch, pEvent); if (m_bTouchedMenu) { m_pMenu->onTouchCancelled(pTouch,pEvent); m_bTouchedMenu = false; } }else { m_pMenu->onTouchMoved(pTouch, pEvent); } } } void KDGridView::TouchEnded(Touch *pTouch, Event *pEvent) { if(!m_bLock) { if (this->m_bScroll) m_pScrollView->onTouchEnded(pTouch, pEvent); Vec2 endPoint = Director::getInstance()->convertToGL(pTouch->getLocationInView()); float distance = 0; if (m_pScrollView->getDirection() == ScrollView::Direction::HORIZONTAL) { distance = endPoint.x - m_touchPoint.x; }else { distance = endPoint.y - m_touchPoint.y; } log("distance:%f",distance); if (this->m_bScroll) { if(fabs(distance) < 5 ) { if(m_bTouchedMenu) { m_pMenu->onTouchEnded(pTouch,pEvent); m_bTouchedMenu = false; log("excute menu click!"); } }else { if (m_bTouchedMenu) { m_pMenu->onTouchCancelled(pTouch,pEvent); m_bTouchedMenu = false; log("cancel menu click!"); } float m_EndOffset = 0; switch (m_pScrollView->getDirection()) { case ScrollView::Direction::VERTICAL: m_EndOffset = m_pScrollView->getContentOffset().y; if (m_bScrollNeedAdjust && m_EndOffset >= m_fLowLevelOffsetY && m_EndOffset<=0) { adjustScrollView(m_EndOffset - m_fBeginOffset); } break; case ScrollView::Direction::HORIZONTAL: m_EndOffset= m_pScrollView->getContentOffset().x; if (m_bScrollNeedAdjust && m_EndOffset <= 0 && m_EndOffset>=m_fLowLevelOffsetX) { adjustScrollView(m_EndOffset - m_fBeginOffset); } break; default: break; } // log("m_EndOffset:%f",m_EndOffset); // log("ContentOffset:%f",m_pScrollView->getContentOffset().x); if(!m_bNeedAdjust){ distance = distance>0 ? m_fAdjustStep - distance : -(m_fAdjustStep - fabs(distance)); float adjustAnimDelay = fabs(distance / m_fAdjustStep); this->setEnable(false); auto func = CallFunc::create([=](){ this->setEnable(true); }); FiniteTimeAction* action = Sequence::create(DelayTime::create(adjustAnimDelay + 0.5f), CallFunc::create(CC_CALLBACK_0(KDGridView::unlock, this)), NULL); runAction(Sequence::create(action,func, NULL)); } // if (m_ScrollCallback) // { // m_ScrollCallback->onScrollEnd(m_pScrollView->getContentOffset().x, m_pScrollView->getContentOffset().y); // } } }else { if (m_bTouchedMenu) { m_pMenu->onTouchEnded(pTouch,pEvent); m_bTouchedMenu = false; log("excute menu click!"); } } } } void KDGridView::setEnable(bool enable) { m_bIsEnable = enable; } void KDGridView::TouchCancelled(Touch *pTouch, Event *pEvent) { if (m_bScroll) { m_pScrollView->onTouchCancelled(pTouch, pEvent); float m_EndOffset = 0; switch (m_pScrollView->getDirection()) { case ScrollView::Direction::VERTICAL: m_EndOffset = m_pScrollView->getContentOffset().y; if (m_bScrollNeedAdjust && m_EndOffset >= m_fLowLevelOffsetY && m_EndOffset<=0) { adjustScrollView(m_EndOffset - m_fBeginOffset); }else { float adjustY = 0; if (m_EndOffset<0) { adjustY = m_fLowLevelOffsetY; } m_pScrollView->setContentOffset(Vec2(m_pScrollView->getContentOffset().x, adjustY)); } break; case ScrollView::Direction::HORIZONTAL: m_EndOffset= m_pScrollView->getContentOffset().x; if (m_bScrollNeedAdjust && m_EndOffset <= 0 && m_EndOffset>=m_fLowLevelOffsetX) { adjustScrollView(m_EndOffset - m_fBeginOffset); }else { float adjustX = 0; if (m_EndOffset<0) { adjustX = m_fLowLevelOffsetX; } m_pScrollView->setContentOffset(Vec2(adjustX, m_pScrollView->getContentOffset().y)); } break; default: break; } } if (m_bTouchedMenu) { m_pMenu->onTouchCancelled(pTouch, pEvent); m_bTouchedMenu = false; } } //根据手势滑动的距离和方向滚动图层 void KDGridView::adjustScrollView(float offset) { if(!m_bNeedAdjust) return; if (!m_fAdjustStep) return; m_bLock=true; float m_Offset = 0; Point adjustPos; float adjustAnimDelay = 0.3f; float x = offset - (int)(offset/m_fAdjustStep)*m_fAdjustStep; switch (m_pScrollView->getDirection()) { case ScrollView::Direction::VERTICAL: m_Offset = m_pScrollView->getContentOffset().y; break; case ScrollView::Direction::HORIZONTAL: m_Offset= m_pScrollView->getContentOffset().x; break; default: break; } if((int)((fabs(x)/m_fAdjustStep)+0.5)) { //over half x = x>0 ? m_fAdjustStep - x : -(m_fAdjustStep - fabs(x)); m_Offset = m_Offset + x; }else { m_Offset = m_Offset - x; } adjustAnimDelay = fabs(x / m_fAdjustStep); switch (m_pScrollView->getDirection()) { case ScrollView::Direction::VERTICAL: adjustPos = Vec2(0,m_Offset); break; case ScrollView::Direction::HORIZONTAL: adjustPos = Vec2(m_Offset,0); break; default: adjustPos = Vec2(0,m_Offset); break; } m_pScrollView->unscheduleAllSelectors(); m_pScrollView->setContentOffsetInDuration(adjustPos, adjustAnimDelay); FiniteTimeAction* action = Sequence::create(DelayTime::create(adjustAnimDelay), CallFunc::create(CC_CALLBACK_0(KDGridView::unlock, this)), NULL); runAction(action); } void KDGridView::unlock() { m_bLock=false; if (m_ScrollCallback) { m_ScrollCallback->onScrollEnd(m_pScrollView->getContentOffset().x, m_pScrollView->getContentOffset().y); } }
7f5a42b774cc7b42cba3c9479542d546906ea338
b9e8d33a26e13bc5b919150574f03d47a082055a
/library/graphics/RenderTexture.cc
3846b5f24150808cf710372151491a9a9e3d4f31
[ "Zlib", "BSL-1.0" ]
permissive
magestik/gf
9215fb1e25c8a092bad4aa5875f030fd63d891ac
60d9bbe084828fff88f1a511bd1191c774ccef4a
refs/heads/master
2020-12-26T19:54:45.888737
2020-01-14T15:31:28
2020-01-14T15:31:28
237,623,167
0
0
NOASSERTION
2020-02-01T14:02:32
2020-02-01T14:02:31
null
UTF-8
C++
false
false
2,141
cc
/* * Gamedev Framework (gf) * Copyright (C) 2016-2019 Julien Bernard * * 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. * * Part of this file comes from SFML, with the same license: * Copyright (C) 2007-2015 Laurent Gomila ([email protected]) */ #include <gf/RenderTexture.h> #include <cassert> #include "priv/Debug.h" #include "priv/OpenGLFwd.h" namespace gf { #ifndef DOXYGEN_SHOULD_SKIP_THIS inline namespace v1 { #endif RenderTexture::RenderTexture(Vector2i size) : RenderTarget(size) , m_texture(size) { m_texture.setSmooth(); Texture::bind(nullptr); glCheck(glBindFramebuffer(GL_FRAMEBUFFER, m_framebuffer)); glCheck(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_texture.getName(), 0)); assert(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); glCheck(glBindFramebuffer(GL_FRAMEBUFFER, 0)); } Vector2i RenderTexture::getSize() const { return m_texture.getSize(); } void RenderTexture::setActive() { if (m_framebuffer.isValid()) { glCheck(glBindFramebuffer(GL_FRAMEBUFFER, m_framebuffer)); } } void RenderTexture::display() { glCheck(glFlush()); } Image RenderTexture::capture() const { return captureFramebuffer(m_framebuffer); } #ifndef DOXYGEN_SHOULD_SKIP_THIS } #endif }
07180b1544ada6504f78e764b14475f333f7aa9b
8ec1987551283f3851c507d8b87c37cd073a9e92
/Super/src/Super/Basic/Math.h
af18bd387d670966090819eb1083a61a83604edc
[]
no_license
Edlward/public
5bab05e745b62087dc60b0979ce71be853f98b73
370bf770d92c1f7b4970b2aa3fb18408e567d275
refs/heads/master
2022-11-17T12:14:55.414823
2020-07-17T19:03:24
2020-07-17T19:03:24
null
0
0
null
null
null
null
UTF-8
C++
false
false
42,220
h
#ifndef MATH_Header #define MATH_Header #include "../Basic/global.h" #include <cmath> #include <stdint.h> #include <type_traits> //TODO:more math const value #ifndef M_2PI #define M_2PI 6.28318530717958647692528676655900576 #endif #ifndef M_E #define M_E (2.7182818284590452354) #endif #ifndef M_LOG2E #define M_LOG2E (1.4426950408889634074) #endif #ifndef M_LOG10E #define M_LOG10E (0.43429448190325182765) #endif #ifndef M_LN2 #define M_LN2 (0.69314718055994530942) #endif #ifndef M_LN10 #define M_LN10 (2.30258509299404568402) #endif #ifndef M_PI #define M_PI (3.14159265358979323846) #endif #ifndef M_PI_2 #define M_PI_2 (1.57079632679489661923) #endif #ifndef M_PI_4 #define M_PI_4 (0.78539816339744830962) #endif #ifndef M_1_PI #define M_1_PI (0.31830988618379067154) #endif #ifndef M_2_PI #define M_2_PI (0.63661977236758134308) #endif #ifndef M_2_SQRTPI #define M_2_SQRTPI (1.12837916709551257390) #endif #ifndef M_SQRT2 #define M_SQRT2 (1.41421356237309504880) #endif #ifndef M_SQRT1_2 #define M_SQRT1_2 (0.70710678118654752440) #endif //c语言实现sin,cos,sqrt,pow函数 float MySin(float x); float MyCos(float x); float MyPow(float a,int b); typedef double qreal; #define SINE_TABLE_SIZE 256 extern const double table_sin256[SINE_TABLE_SIZE]; inline int qCeil(qreal v) { using std::ceil; return int(ceil(v)); } inline int qFloor(qreal v) { using std::floor; return int(floor(v)); } inline qreal qFabs(qreal v) { using std::fabs; return fabs(v); } inline qreal qSin(qreal v) { using std::sin; return sin(v); } inline qreal qCos(qreal v) { using std::cos; return cos(v); } inline qreal qTan(qreal v) { using std::tan; return tan(v); } inline qreal qAcos(qreal v) { using std::acos; return acos(v); } inline qreal qAsin(qreal v) { using std::asin; return asin(v); } inline qreal qAtan(qreal v) { using std::atan; return atan(v); } inline qreal qAtan2(qreal y, qreal x) { using std::atan2; return atan2(y, x); } inline qreal qSqrt(qreal v) { using std::sqrt; return sqrt(v); } inline qreal qLn(qreal v) { using std::log; return log(v); } inline qreal qExp(qreal v) { using std::exp; return exp(v); } inline qreal qPow(qreal x, qreal y) { using std::pow; return pow(x, y); } // //inline bool qt_is_inf(double d) //{ // uchar *ch = (uchar *)&d; // if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { // return (ch[0] & 0x7f) == 0x7f && ch[1] == 0xf0; // } else { // return (ch[7] & 0x7f) == 0x7f && ch[6] == 0xf0; // } //} // //inline bool qt_is_nan(double d) //{ // uchar *ch = (uchar *)&d; // if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { // return (ch[0] & 0x7f) == 0x7f && ch[1] > 0xf0; // } else { // return (ch[7] & 0x7f) == 0x7f && ch[6] > 0xf0; // } //} // //inline bool qt_is_finite(double d) //{ // uchar *ch = (uchar *)&d; // if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { // return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0xf0) != 0xf0; // } else { // return (ch[7] & 0x7f) != 0x7f || (ch[6] & 0xf0) != 0xf0; // } //} // //inline bool qt_is_inf(float d) //{ // uchar *ch = (uchar *)&d; // if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { // return (ch[0] & 0x7f) == 0x7f && ch[1] == 0x80; // } else { // return (ch[3] & 0x7f) == 0x7f && ch[2] == 0x80; // } //} // //inline bool qt_is_nan(float d) //{ // uchar *ch = (uchar *)&d; // if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { // return (ch[0] & 0x7f) == 0x7f && ch[1] > 0x80; // } else { // return (ch[3] & 0x7f) == 0x7f && ch[2] > 0x80; // } //} //inline bool qt_is_finite(float d) //{ // uchar *ch = (uchar *)&d; // if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { // return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0x80) != 0x80; // } else { // return (ch[3] & 0x7f) != 0x7f || (ch[2] & 0x80) != 0x80; // } //} inline bool qt_is_finite(float d) { uchar *ch = (uchar *)&d; //if (QSysInfo::ByteOrder == QSysInfo::BigEndian) if(0) { return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0x80) != 0x80; } else { return (ch[3] & 0x7f) != 0x7f || (ch[2] & 0x80) != 0x80; } } inline uint32_t f2i(float f) { uint32_t i; //memcpy(&i, &f, sizeof(f)); i=*((uint32_t*)&f); return i; } inline uint64_t d2i(double d) { uint64_t i; //memcpy(&i, &d, sizeof(d)); i=*((uint64_t*)&d); return i; } inline uint32 qFloatDistance(float a, float b) { static const uint32 smallestPositiveFloatAsBits = 0x00000001; // denormalized, (SMALLEST), (1.4E-45) /* Assumes: * IEE754 format. * Integers and floats have the same endian */ //暂时屏蔽 //Q_STATIC_ASSERT(sizeof(quint32) == sizeof(float)); //S_ASSERT(qIsFinite(a) && qIsFinite(b)); if (a == b) return 0; if ((a < 0) != (b < 0)) { // if they have different signs if (a < 0) a = -a; else /*if (b < 0)*/ b = -b; return qFloatDistance(0.0F, a) + qFloatDistance(0.0F, b); } if (a < 0) { a = -a; b = -b; } // at this point a and b should not be negative // 0 is special if (!a) return f2i(b) - smallestPositiveFloatAsBits + 1; if (!b) return f2i(a) - smallestPositiveFloatAsBits + 1; // finally do the common integer subtraction return a > b ? f2i(a) - f2i(b) : f2i(b) - f2i(a); } inline uint64 qFloatDistance(double a, double b) { static const uint64 smallestPositiveFloatAsBits = 0x1; // denormalized, (SMALLEST) /* Assumes: * IEE754 format double precision * Integers and floats have the same endian */ //暂时屏蔽 //Q_STATIC_ASSERT(sizeof(uint64) == sizeof(double)); //S_ASSERT(qIsFinite(a) && qIsFinite(b)); if (a == b) return 0; if ((a < 0) != (b < 0)) { // if they have different signs if (a < 0) a = -a; else /*if (b < 0)*/ b = -b; return qFloatDistance(0.0, a) + qFloatDistance(0.0, b); } if (a < 0) { a = -a; b = -b; } // at this point a and b should not be negative // 0 is special if (!a) return d2i(b) - smallestPositiveFloatAsBits + 1; if (!b) return d2i(a) - smallestPositiveFloatAsBits + 1; // finally do the common integer subtraction return a > b ? d2i(a) - d2i(b) : d2i(b) - d2i(a); } inline double FastSin(double x) { int si = int(x * (0.5 * SINE_TABLE_SIZE / M_PI)); // Would be more accurate with qRound, but slower. double d = x - si * (2.0 * M_PI / SINE_TABLE_SIZE); int ci = si + SINE_TABLE_SIZE / 4; si &= SINE_TABLE_SIZE - 1; ci &= SINE_TABLE_SIZE - 1; return table_sin256[si] + (table_sin256[ci] - 0.5 * table_sin256[si] * d) * d; } inline double FastCos(double x) { int ci = int(x * (0.5 * SINE_TABLE_SIZE / M_PI)); // Would be more accurate with qRound, but slower. double d = x - ci * (2.0 * M_PI / SINE_TABLE_SIZE); int si = ci + SINE_TABLE_SIZE / 4; si &= SINE_TABLE_SIZE - 1; ci &= SINE_TABLE_SIZE - 1; return table_sin256[si] - (table_sin256[ci] + 0.5 * table_sin256[si] * d) * d; } inline float DegreesToRadians(float degrees) { return degrees * float(M_PI/180); } inline double DegreesToRadians(double degrees) { return degrees * (M_PI / 180); } inline float RadiansToDegrees(float radians) { return radians * float(180/M_PI); } inline double RadiansToDegrees(double radians) { return radians * (180 / M_PI); } inline uint32_t NextPowerOfTwo(uint32_t v) { v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; ++v; return v; } inline uint64_t NextPowerOfTwo(uint64_t v) { v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v |= v >> 32; ++v; return v; } inline uint32_t qNextPowerOfTwo(int32_t v) { return NextPowerOfTwo(uint32_t(v)); } inline uint64_t qNextPowerOfTwo(int64_t v) { return NextPowerOfTwo(uint64_t(v)); } /** Returns true if the specified integer is a power-of-two. */ template <typename IntegerType> bool isPowerOfTwo (IntegerType value) { static_assert(std::is_integral<IntegerType>::value,"not IntegerType"); return (value&(value-1)) == 0; } //是否二次幂 inline bool is_pow_of_2(unsigned int x) { return (x&(x-1))==0; } inline bool is_pow_of_2(uint64_t x) { return (x&(x-1))==0; } //上一个接近二次幂的数 //greatest power of 2 less than or equal to inline unsigned int prev_pow_of_2(unsigned int n) { n|=(n>>1); n|=(n>>2); n|=(n>>4); n|=(n>>8); n|=(n>>16); return n-(n>>1); } //greatest power of 2 less than or equal to inline uint64_t prev_pow_of_2(uint64_t n) { n|=(n>>1); n|=(n>>2); n|=(n>>4); n|=(n>>8); n|=(n>>16); n|=(n>>32); return n-(n>>1); } //下一个接近二次幂的数 或者使用汇编位扫描指令BSF 和 BSR可以一次得到 //least power of 2 greater than or equal to inline unsigned int next_pow_of_2(unsigned int v) { //if (is_pow_of_2(v)) //{ // return v; //} --v; v|=v>>1; v|=v>>2; v|=v>>4; v|=v>>8; v|=v>>16; return v+1; } inline uint64_t next_pow_of_2(uint64_t v) { //if (is_pow_of_2(v)) //{ // return v; //} --v; v |= v>>1; v |= v>>2; v |= v>>4; v |= v>>8; v |= v>>16; v |= v>>32; //x |= x>>64; return v+1; } inline unsigned nextPowerOf2(unsigned int n) { // decrement n (to handle the case when n itself // is a power of 2) n = n - 1; // do till only one bit is left while (n&(n-1)) { n=n&(n-1); // unset rightmost bit } // n is now a power of two (less than n) // return next power of 2 return n << 1; } // compute power of two greater than or equal to n inline unsigned nextPowerOf2_222(unsigned int n) { // decrement n (to handle the case when n itself // is a power of 2) n = n - 1; // initialize result by 2 int k = 2; // double k and divide n in half till it becomes 0 while (n >>=1) { k = k << 1; // double k } return k; } //求一个整数数的以2为低的对数 自定义 by //inline unsigned int FastLog2(unsigned int x) //{ // for (unsigned int n=0;n<7;n++) // { // // } //} ////32bit版本,思路是二分法 //unsigned int Hight(unsigned x) //{ // int n=1; // if(x==0) return -1; // if ((x>>16) == 0){n=n+16;x = x<<16;} // if ((x>>24) == 0){n=n+8;x = x<<8;} // if ((x>>28) == 0){n=n+4; x = x<<4;} // if ((x>>30) == 0){n=n+2; x = x<<2;} // n = n-(x>>31); // return 31-n; //} //看了好一会才看明白,容我做个注解给后来人。。。如有不对还请大大们纠正 // if ((x>>16) == 0) {n = n+16; x = x<<16;} cout<<n<<", "; printf("%x\n", x); //if ((x>>24) == 0) {n = n+8; x = x<<8;} cout<<n<<", "; printf("%x\n", x); //if ((x>>28) == 0) {n = n+4; x = x<<4;} cout<<n<<", "; printf("%x\n", x); //if ((x>>30) == 0) {n = n+2; x = x<<2;} cout<<n<<", "; printf("%x\n", x); //这几行是二分,依次判断最高位是在高16位还是低16位,是在16位中的高8位还是低8位... // n = n-(x>>31); //这行是针对当x高位为31时的情况,此时n原本应该是0, 这样最后31-n=31,但如果n赋初值0,位移就没法做了,所以此处做一判断修正n的值。如果写的更直白一点可以直接在一开始就判断: // if(x>>31) return 31; //纠正一下,n = n-(x>>31); 是二分的最后一步用来判断最高位1是在高1位还是低1位。所以不能简单的用 //if(x>>31) return 31;来代替。 ////获得32位数二进制位的第一个1的位置 inline unsigned int getHightBit1PosTest1(unsigned int x) { //unsigned int tmp=ByteOrderSwap32(x); //print_bin(&tmp,sizeof(tmp)); //print_bin(&x,sizeof(x)); //print_bin(x); int n=1; //printf("n:%02u x:%08x Bin:",n,x); //print_bin(x); //if(x==0) return 1; if(x==0) return 0; if ((x>>16) == 0) { n=n+16;x = x<<16; //printf("n:%02u x:%08x Bin:",n,x); //print_bin(x); } if ((x>>24) == 0) { n=n+8;x = x<<8; //printf("n:%02u x:%08x Bin:",n,x); //print_bin(x); } if ((x>>28) == 0) { n=n+4; x = x<<4; //printf("n:%02u x:%08x Bin:",n,x); //print_bin(x); } if ((x>>30) == 0) { n=n+2; x = x<<2; //printf("n:%02u x:%08x Bin:",n,x); //print_bin(x); } n = n-(x>>31); //printf("n:%02u x:%08x Bin:",n,x); //print_bin(x); return 31-n; } //int GetLeftFirstone(unsigned int v) //{ // v ^= v - 1; // v = (v & 0x55555555) + ((v >> 1) & 0x55555555); // v = (v & 0x33333333) + ((v >> 2) & 0x33333333); // v = (v + (v >> 4)) & 0x0F0F0F0F; // v += v >> 8; // v += v >> 16; // return (v & 0x3F) - 1; //} // //int GetLeftFirstOne(unsigned int v) //{ // int pos=0; // if (!(v & 0xFFFF)) // { // v >>= 16; // pos += 16; // } // if (!(v & 0xFF)) // { // v >>= 8; // pos += 8; // } // if (!(v & 0xF)) // { // v >>= 4; // pos += 4; // } // if (!(v & 0x3)) // { // v >>= 2; // pos += 2; // } // if (!(v & 0x1)) // { // pos += 1; // } // // return pos; //} // // // //int GetRightFirstOne(unsigned int v) //{ // int pos=0; // // if (!(v & 0xFFFF0000)) // { // v <<= 16; // pos += 16; // } // if (!(v & 0xFF000000)) // { // v <<= 8; // pos += 8; // } // if (!(v & 0xF0000000)) // { // v <<= 4; // pos += 4; // } // if (!(v & 0xC0000000)) // { // v <<= 2; // pos += 2; // } // if (!(v & 0x80000000)) // { // pos += 1; // } // return pos; //} // //int f1(unsigned x) //{ // int n=1; // if(x==0) return -1; // if ((x>>16) == 0) {n = n+16; x = x<<16;} // if ((x>>24) == 0) {n = n+8; x = x<<8;} // if ((x>>28) == 0) {n = n+4; x = x<<4;} // if ((x>>30) == 0) {n = n+2; x = x<<2;} // n = n-(x>>31); // return 31-n; //} #ifdef _MSC_VER #include <intrin.h> //逆向扫描指令BSR(Bit Scan Reverse),从左向右扫描,即从高位向低位扫描。//即第一个出现1的位置。 //Search the mask data from most significant bit (MSB) to least significant bit (LSB) for a set bit (1). //原型:unsigned char _BitScanReverse(unsigned long * Index, unsigned long Mask); //返回值:Nonzero if Index was set,or 0 if no set bits were found. //msc编译时使用内建函数(Compiler Intrinsics) inline unsigned long BSR_uint32(unsigned __int32 n) { unsigned long index; _BitScanReverse(&index,n); return index; //return _BitScanReverse(&index,n)?index:-1; //old } inline unsigned long BSR_uint64(unsigned __int64 num) { unsigned long index; _BitScanReverse64(&index,num); return index; //return _BitScanReverse64(&index,num)?index:-1; //old } inline unsigned long BSF_uint32(unsigned __int32 n) { unsigned long index; _BitScanForward(&index,n); return index; } inline unsigned long BSF_uint64(unsigned __int64 num) { unsigned long index; _BitScanForward64(&index,num); return index; } #elif __GNUC__ //gcc 编译时使用内建函数(Built-in Functions) //高效位运算 __builtin_系列函数 //•int __builtin_ffs (unsigned int x)返回x的最后一位1的是从后向前第几位,比如7368(1110011001000)返回4。 //•int __builtin_clz (unsigned int x) 返回前导的0的个数。 如果x=0 的话,结果未知 //•int __builtin_ctz (unsigned int x)返回后面的0个个数,和__builtin_clz相对。 //•int __builtin_popcount (unsigned int x)返回二进制表示中1的个数。 //•int __builtin_parity (unsigned int x)返回x的奇偶校验位,也就是x的1的个数模2的结果。 //这些函数都有相应的usigned long和usigned long long版本,只需要在函数名后面加上l或ll就可以了 //— Built-in Function: int __builtin_ffs (unsigned int x) // Returns one plus the index of the least significant 1-bit of x, or if x is zero, returns zero. // // — Built-in Function: int __builtin_clz (unsigned int x) // Returns the number of leading 0-bits in x, starting at the most significant bit position. If x is 0, the result is undefined. // // — Built-in Function: int __builtin_ctz (unsigned int x) // Returns the number of trailing 0-bits in x, starting at the least significant bit position. If x is 0, the result is undefined. // // — Built-in Function: int __builtin_popcount (unsigned int x) // Returns the number of 1-bits in x. // // — Built-in Function: int __builtin_parity (unsigned int x) // Returns the parity of x, i.e. the number of 1-bits in x modulo 2. inline uint8_t BSR_uint32(uint32_t n) //n!=0 { if (n==0) return 0; return 31-__builtin_clz(n); // //return num==0?-1:(sizeof(num)<<3)-1-__builtin_clz(num); //clz返回32位数前导为0的个数,比如2返回30(前面有30个0) } inline uint8_t BSR_uint64(uint64_t n) //n!=0 { if (n==0) return 0; return 63-__builtin_clzll(n); //return num==0?-1:(sizeof(num)<<3)-1-__builtin_clzll(num); //clzll返回64位数前导为0的个数,比如1返回63(前面有63个0) } inline uint8_t BSF_uint32(uint32_t n) //n!=0 { if (n==0) return 0; return __builtin_ctz(n); // } inline uint8_t BSF_uint64(uint64_t n) //n!=0 { if (n==0) return 0; return __builtin_ctzll(n); } #endif ///* We use the De-Bruijn method outlined in: http://supertech.csail.mit.edu/papers/debruijn.pdf. //两个最快版本居然比_BitScanReverse 快,什么原理 //static const unsigned char MultiplyDeBruijnBitPosition32[32]={0,9,1,10,13,21,2,29,11,14,16,18,22,25,3,30, 8,12,20,28,15,17,24,7,19,27,23,6,26,5,4,31}; inline uint32_t MSB_DeBruijn32(uint32_t v) { v|=v>>1; v|=v>>2; v|=v>>4; v|=v>>8; v|=v>>16; return MultiplyDeBruijnBitPosition32[(uint32_t)(v*0x07C4ACDDU)>>27]; } const unsigned char MultiplyDeBruijnBitPosition64[64]={ 0, 47, 1, 56, 48, 27, 2, 60, 57, 49, 41, 37, 28, 16, 3, 61, 54, 58, 35, 52, 50, 42, 21, 44, 38, 32, 29, 23, 17, 11, 4, 62, 46, 55, 26, 59, 40, 36, 15, 53, 34, 51, 20, 43, 31, 22, 10, 45, 25, 39, 14, 33, 19, 30, 9, 24, 13, 18, 8, 12, 7, 6, 5, 63, }; inline uint32_t MSB_DeBruijn64(uint64_t v ) { v|=(v>>1); v|=(v>>2); v|=(v>>4); v|=(v>>8); v|=(v>>16); v|=(v>>32); return MultiplyDeBruijnBitPosition64[(uint64_t)(v*0x03F79D71B4CB0A89ULL)>>58]; } const unsigned char debruijn_ctz32[32] = { 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 }; inline uint32_t ff_ctz_c(int32_t v) //uint32_t warning { return debruijn_ctz32[(uint32_t)((v&-v)*0x077CB531U)>>27]; } //static const unsigned char debruijn_ctz64[64]={ 0,1,2,53,3,7,54,27,4,38,41,8,34,55,48,28, 62,5,39,46,44,42,22,9,24,35,59,56,49,18,29,11, 63,52,6,26,37,40,33,47,61,45,43,21,23,58,17,10, 51,25,36,32,60,20,57,16,50,31,19,15,30,14,13,12 }; inline uint32_t ff_ctzll_c(int64_t v) //uint warning { return debruijn_ctz64[(uint64_t)((v&-v)*0x022FDD63CC95386DU)>>58]; } //from https://blog.csdn.net/xueyan0096/article/details/83785384 inline uint32_t lsbDeBruijn32(uint32_t n ) //to test { n &= (~n + 1); return debruijn_ctz32[(n*0x077CB531U)>>27]; } const unsigned char DeBruijnLSB64Lookup[64] = { 0,1,56,2,57,49,28,3,61,58,42,50,38,29,17,4, 62,47,59,36,45,43,51,22,53,39,33,30,24,18,12,5, 63,55,48,27,60,41,37,16,46,35,44,21,52,32,23,11, 54,26,40,15,34,20,31,10,25,14,19,9,13,8,7,6 }; inline uint32_t lsbDeBruijn64(uint64_t n) { n &= (~n + 1); return DeBruijnLSB64Lookup[(n*0x03F79D71B4CA8B09ULL)>>58]; } inline unsigned int msb32_v11(unsigned int x) { if(x==0) return 0; static const unsigned int bval[]={0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4}; int r =-1; //old 0 if(x&0xFFFF0000){r+=16;x>>=16;} if(x&0x0000FF00){r+=8;x>>=8;} if(x&0x000000F0){r+=4;x>>=4;} return r + bval[x]; //old //return r + bval[x]-1; } inline unsigned int msb32_v22(unsigned int x) //linux fls { int r=31; //old 32 if(!x) return 0; if(!(x&0xffff0000u)){ x<<=16; r-=16; } if(!(x&0xff000000u)){ x<<=8; r-=8; } if(!(x&0xf0000000UL)){ x<<=4; r-=4; } if(!(x&0xc0000000UL)){ x<<=2; r-=2; } if(!(x&0x80000000UL)){ x<<=1; r-=1; } return r; } //求一个二进制数最高位1的索引位置——最高效的算法 汇编指令BSF找值为1的最专低bit //BSR找值为1的最高bit //二进制数最高位为1的索引位置查找表,从0开始,若为0,虽然没有为1的bit值也返回0。 inline unsigned int getHightBit1PosV0(unsigned int n) //正确低效的方法 { if (n==0) return 0; int c=-1; while(n) { n>>=1; c++; } return c; } //基于查找表方法的各种版本 //各种不同大小的表根据需要选择 const unsigned char table_Hight1BitPos16[16]={0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3}; extern const unsigned char table_Hight1BitPos256[256]; extern const unsigned char table_Hight1BitPos64k[65536]; //极限优化,避免一次加法实现更多情况的表,暂无必要 //extern const unsigned char table_Hight1BitPos256add8[256]; // inline unsigned int getHightBit1PosFastV1(unsigned int n) //fast 4200kXhz { unsigned short hTmp16=(unsigned short)(n>>16); //比用unsigned int 更快 if (hTmp16==0) //高16位为零 { return table_Hight1BitPos64k[n]; } else { return table_Hight1BitPos64k[hTmp16]+16; } } inline unsigned int getHightBit1PosFastV2(unsigned int n) //fast 3000kXhz { unsigned short hTmp16=(unsigned short)(n>>16); //比unsigned int 更快 unsigned char htmp8; if (hTmp16!=0) //高16位非零 { htmp8=(unsigned char)(hTmp16>>8); // if (htmp8) //高16位中的高8位非零 { return table_Hight1BitPos256[htmp8]+24; } else { return table_Hight1BitPos256[hTmp16]+16; } } else { htmp8=(unsigned char)(n>>8); if (htmp8) { return table_Hight1BitPos256[htmp8]+8; } else { return table_Hight1BitPos256[n]; } } } inline unsigned int getHightBit1PosFastV3(unsigned int n) //fast 2500kXhz { unsigned short hTmp16=(unsigned short)(n>>16); //比unsigned int 更快 unsigned char htmp8; unsigned char htmp4; if (hTmp16!=0) //高16位非零 { htmp8=(unsigned char)(hTmp16>>8); // htmp4=(htmp8>>4); if (htmp8) { if (htmp4) { return table_Hight1BitPos16[htmp4]+28; } else { return table_Hight1BitPos16[htmp8]+24; } } else { if (htmp4) { return table_Hight1BitPos16[htmp4]+20; } else { return table_Hight1BitPos16[htmp8]+16; } } } else { htmp8=(unsigned char)(n>>8); htmp4=(htmp8>>4); if (htmp8) { if (htmp4) { return table_Hight1BitPos16[htmp4]+12; } else { return table_Hight1BitPos16[htmp8]+8; } } else { if (htmp4) { return table_Hight1BitPos16[htmp4]+4; } else { return table_Hight1BitPos16[htmp8]; } } } } inline unsigned int getHightBit1PosFastV1(uint64_t n) //fast { unsigned int h32bit=(unsigned int)(n>>32); if (h32bit!=0) { return getHightBit1PosFastV1(h32bit)+32; } else { return getHightBit1PosFastV1((uint32_t)n); } } //二进制数最高位为1的索引位置,从0开始,若为0,虽然没有为1的bit值也返回0。经测试,用汇编实现是最快的版本, inline unsigned int getHightBit1Pos(uint32_t n) { //if(n==0) return 0; //=0 特殊情况,放到使用处考虑 TODO: return BSR_uint32(n); //fastest 8300kXhz //return getHightBit1PosFastV1(n); } inline unsigned int getHightBit1Pos(uint64_t n) { //if(n==0) return 0; //=0 特殊情况,放到使用处考虑 TODO: return BSR_uint64(n); //return getHightBit1PosFastV1(n); } //二进制数从右侧最低为到左侧最高位,第一个出现bit1的位置,若为0,虽然没有为1的bit值也返回0 inline unsigned int getLowBit1Pos(uint32_t n) { return BSF_uint32(n); } inline unsigned int getLowBit1Pos(uint64_t n) { return BSF_uint64(n); } extern const unsigned int tablepow2_uint32[32]; inline unsigned int get_NextLogof2(unsigned int block_size) { //uint64_t sizeTmp=1; //for(unsigned int n=0;n<31;n++) //{ // if(sizeTmp>=block_size) // { // return n; // } // sizeTmp*=2; // sizeTmp+=1; //} //return 31; for(int n=0;n<31;n++) { if(tablepow2_uint32[n]>=block_size) { return n; } } return 31; } extern const uint64_t tablepow2_uint64[64]; inline unsigned int get_NextLogof2(uint64_t block_size) { #if 1 uint64_t sizeTmp=1; for(unsigned int n=0;n<63;n++) { if(sizeTmp>=block_size) { return n; } sizeTmp*=2; sizeTmp+=1; } return 63; //1<<0, 从2开始 //for(int n=0;n<63;n++) //{ // if(tablepow2_uint64[n]>=block_size) // { // return n; // } //} //return 63; #else // ////平均二分法 //if (block_size<tablepow2_uint64[32]) //{ // if (block_size<tablepow2_uint64[16]) // { // if (block_size<tablepow2_uint64[8]) // { // for(int n=0;n<8;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // else // { // for(int n=8;n<16;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // } // else // { // if (block_size<tablepow2_uint64[24]) // { // for(int n=16;n<24;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // else // { // for(int n=24;n<32;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // } //} //else //{ // if (block_size<tablepow2_uint64[48]) // { // if (block_size<tablepow2_uint64[40]) // { // for(int n=32;n<40;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // else // { // for(int n=40;n<48;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // } // else // { // if (block_size<tablepow2_uint64[48]) // { // for(int n=48;n<56;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // else // { // for(int n=56;n<63;n++) //for(int n=56;n<64;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // } //} //return 63; // // //小数优先二分法 //if (block_size<tablepow2_uint64[16]) //{ // if (block_size<tablepow2_uint64[8]) // { // if (block_size<tablepow2_uint64[4]) // { // for(int n=0;n<4;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // else // { // for(int n=4;n<8;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // } // else // { // if (block_size<tablepow2_uint64[12]) // { // for(int n=8;n<12;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // else // { // for(int n=12;n<16;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // } //} //else //{ // if (block_size<tablepow2_uint64[32]) // { // if (block_size<tablepow2_uint64[24]) // { // for(int n=16;n<24;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // else // { // for(int n=24;n<32;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // } // else // { // if (block_size<tablepow2_uint64[48]) // { // for(int n=48;n<56;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // else // { // for(int n=56;n<63;n++) //for(int n=56;n<64;n++) // { // if(tablepow2_uint64[n]>=block_size) // { // return n; // } // } // } // } //} //return 63; #endif } //improve by lizulin 2018-2020 //获一个数某bitpos位置取后N个bit的值,不包含bitpos本身 template <const unsigned int N> //N=1,2,3,4,5 inline unsigned int getRightNBit(uint32_t x,unsigned int bitPos) //bitPos>N+1 { static_assert(N<sizeof(x)*8,"out of range"); x=x>>(bitPos-N); const uint32_t Mask=((1<<N)-1); //TODO:极大值越界? x&=Mask; return x; }; //获一个数某bitpos位置取后N个bit的值,不包含bitpos本身 template <const unsigned int N> //N=1,2,3,4,5 inline uint64_t getRightNBit(uint64_t x,unsigned int bitPos) //bitPos>N+1 { static_assert(N<sizeof(x)*8,"out of range"); x=x>>(bitPos-N); const uint64_t Mask=((1ULL<<N)-1); //TODO:极大值越界? x&=Mask; return x; }; ////获一个数某bitpos位置取后N个bit的值,连同bitpos本身 //template <const unsigned int N> //N=1,2,3,4,5 //inline unsigned int getRightNBit(uint32_t x,unsigned int bitPos) //bitPos>N+1 //{ // x=x>>(bitPos+1-N); // const uint32_t Mask=((1<<(N+1))-1); //TODO:极大值越界? // x&=Mask; // return x; //}; ////获一个数某bitpos位置取后N个bit的值,连同bitpos本身 //template <const unsigned int N> //N=1,2,3,4,5 //inline uint64_t getRightNBit(uint64_t x,unsigned int bitPos) //bitPos>N+1 //{ // x=x>>(bitPos+1-N); // const uint64_t Mask=((1ULL<<(N+1))-1); //TODO:极大值越界? // x&=Mask; // return x; //}; //分块号与其管理的大小来回转换策略--高效实现 //根据数据大小,快速找到分块号,快速方法 //1-2-4-8-16-32-64-128-256-512-1024..... //直接2次幂倍增 //1-2-3-4--6-8-12-16-24-32-48-64-96-128 //2次幂之间插入2个中间值的递增 //1-2-3-4-5-6-7-8-10-12-14-16-20-24-28-32-40-48-56-64-96-128 //2次幂之间插入4个中间值的递增 //template <const size_t N> //N=1,2,3,4,5 //inline uint32_t SizeToBlockNumStrategy(uint32_t nSize) //{ // unsigned int h1pos=getHightBit1Pos(nSize); // if (N==1) // { // return h1pos; // } // uint32_t subIndex=getRightNBit<N>(nSize,h1pos); // return (h1pos<<N)+subIndex; //} template <const size_t N> //N=1,2,3,4,5 inline uint32_t SizeToBlockNumStrategy(uint64_t nSize) { unsigned int h1pos=getHightBit1Pos(nSize); if (N==1) { return h1pos; } uint64_t subIndex=getRightNBit<N-1>(nSize,h1pos); uint64_t index=(h1pos<<(N-1))+subIndex; return (uint32_t)index; //blocknum不会太大 } template <const size_t N> //N=1,2,3,4,5 inline uint64_t BlockNumToSizeStrategy(uint32_t nBlock) { const uint64_t BlockL=1<<(N+1); if(nBlock<BlockL) //分块号比较小时 特别处理,策略完善与描述待续 { //return BlockL<<N-1; if(N<=5) { return 16; //16 //N=3,4,5 } return BlockL*2; //to be confirn } const uint64_t BMax=64*(1<<(N-1))-1; if (nBlock>=BMax) //极限情况考虑,以下移位运算会溢出 { return UINT64_MAX; //UINT32_MAX or UINT64_MAX } if (N==1) { uint64_t nSize=(1ull<<(nBlock+1))-1; return nSize; } const uint64_t P=1<<(N-1); nBlock+=1; uint64_t oBlock=nBlock/P; uint64_t oldSubBlock=(nBlock%P); uint64_t oSize=(1ull<<(oBlock)); uint64_t mSize=oSize-1; uint64_t nSize=mSize+(oldSubBlock)*(oSize/P); return nSize; } //C语言快速取以2为底的对数的方法 inline int FastLog2(int x) { float fx; unsigned long ix, exp; fx = (float)x; ix = *(unsigned long*)&fx; exp = (ix>>23)&0xFF; return exp-127; } //C语言,快速求以2为底的整数对数(int_log2函数) //在做AI版2048时,没必要用c库求对数的函数(浮点数),整数对数的算法速度要快很多。 //static int int_log2 (unsigned int x) //{ // static const unsigned char log_2[256] = { // 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, // 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, // 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, // 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, // 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, // 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, // 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, // 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 // }; // int l = -1; // while (x >= 256) { l += 8; x >>= 8; } // return l + log_2[x]; //} //正整数的 二进制表示 中 从低位向高位 第1个 0 出现位置 的计算方法 inline int find_first_0_occur_binary_expression(int n) { int zeroPosition = 0; while ((n&1)!=0) { zeroPosition++; n = n >> 1; } return zeroPosition; } //正整数的 二进制表示 中 从低位向高位 第1个 1 出现位置 的计算方法 inline int find_first_1_occur_binary_expression(int n) { int first_one_Position = 0; while ((n&1)!=1) { first_one_Position++; n = n >> 1; } return first_one_Position; } //_ftol 是什么? 当你写 C 程序的时候,(int)float_v 就会被编译器产生一个对 _ftol 这个 CRT 函数的调用。 inline int my_ftol(float f) { int a = *(int*)(&f); int sign = (a>>31); int mantissa = (a&((1<<23)-1))|(1<<23); int exponent = ((a&0x7fffffff)>>23)-127; int r = ((unsigned int)(mantissa)<<8)>>(31-exponent); return ((r ^ (sign)) - sign ) &~ (exponent>>31); } //位运算--统计一个数的二进制序列中1的个数 inline int count_one(int num) { int count = 0; int i = 0; for (i = 0;i < 32;i++) { if (((num>>i)&1)==1) { count++; } } return count; } // https://blog.csdn.net/peiyao456/article/details/51724099 inline int count_onesV2(int num) { int m_2 = 0x55555555; int m_4 = 0x33333333; int m_8 = 0x0f0f0f0f; int m_16 = 0x00ff00ff; int b = (m_2&num) + ((num >> 1)&m_2); int c = (m_4&b) + ((b >> 2)&m_4); int d = (m_8&c) + ((c >> 4)&m_8); int g = (m_16&d) + ((d >> 8)&m_16); return g; } //////////////////////////////////////////////////////////////////////////////// /** Returns the number of bits in a 32-bit integer. */ inline int countNumberOfBits (uint32 n) { n -= ((n >> 1) & 0x55555555); n = (((n >> 2) & 0x33333333) + (n & 0x33333333)); n = (((n >> 4) + n) & 0x0f0f0f0f); n += (n >> 8); n += (n >> 16); return (int) (n & 0x3f); } /** Returns the number of bits in a 64-bit integer. */ inline int countNumberOfBits (uint64 n) { return countNumberOfBits ((uint32) n) + countNumberOfBits ((uint32) (n >> 32)); } //查表法,分段查表然后累加,待续 //inline int count_onesV3(int num) //{ // //} /** Scans an array of values, returning the minimum value that it contains. */ template <typename T> inline T findMinimum (const T* data,size_t numValues) { if (numValues==0) return; T result = *data++; while (--numValues > 0) { T v = *data++; if (v < result) { result = v; } } return result; } /** Scans an array of values, returning the maximum value that it contains. */ template <typename T> inline T findMaximum (const T* values,size_t numValues) { if (numValues==0) return; T result = *values++; while (--numValues > 0) // (> 0 rather than >= 0 because we've already taken the first sample) { T v = *values++; if (result < v) { result = v; } } return result; } /** Scans an array of values, returning the minimum and maximum values that it contains. */ template <typename T> inline void findMinAndMax (const T* values,size_t numValues, T& lowest, T& highest) { if (numValues==0) return; T minV = *values++; T maxV = minV; while (--numValues > 0) { auto v = *values++; if (maxV < v) maxV = v; if (v < minV) minV = v; } lowest = minV; highest = maxV; } ////是否素数 ////math.h required //bool is_prime(int x) //{ // int val=sqrt(x); // for (int k = 1; k <= val; k++) // { // if (!(x%k)) // { // return false; // } // } // return true; //} // ////打印小于N的素数 //void getPrimeTable(int x,int* result,int& cnt) //{ // cnt=0; // for (int i = 2; i <= x; i++) // { // if (is_prime(i)) // { // result[cnt++] = i; // } // } //} //求最大公约数(GCD)和最小公倍数(LCM) //最小公倍数与最大公约数的关系: //假设存在两个数A和B,那他们的最大公倍数就是A和B的积除以的A和B最大公约数即A*B/gcd(A,B) //GCD欧几里德辗转相除法 递归实现 //https://blog.csdn.net/zxh1592000/java/article/details/78846229 inline uint64_t getGCD(uint64_t a,uint64_t b) { if(b == 0) return a; else return getGCD(b,a%b); } inline uint64_t getLCM(uint64_t a,uint64_t b) { return a*b/getGCD(a,b); } template<typename T> inline const T& Max4(const T& v1,const T& v2,const T& v3,const T& v4) { const T& max=Max3(v1,v2,v3); if(v4>max) { return v4; } return max; } template<typename T> inline const T& Max5(const T& v1,const T& v2,const T& v3,const T& v4,const T& v5) { const T& max=Max4(v1,v2,v3,v4); if(v5>max) { return v5; } return max; } //可变参数支持待续C++11 //template<typename T,size_t N> //inline size_t ArrayMin(T (&arry)[N]) //{ // //} //template<typename T,size_t N> //inline size_t ArrayMax(T (&arry)[N]) //{ // //} template<typename T> inline const T& Min4(const T& v1,const T& v2,const T& v3,const T& v4) { const T& min=Min3(v1,v2,v3); if(v4<min) { return v4; } return min; } template<typename T> inline const T& Min5(const T& v1,const T& v2,const T& v3,const T& v4,const T& v5) { const T& min=Min4(v1,v2,v3,v4); if(v5<min) { return v5; } return min; } template <typename T> T limitRange(const T& min,const T& max,const T& value) { //assert (max<= min); // if these are in the wrong order, results are unpredictable.. return value<min?min:(max<value?max:value); } #ifdef UNIT_TEST int Test_Math(); #endif #endif
541ab2b5b620b8cfd69caafdb360135ebecf6753
4dbb45758447dcfa13c0be21e4749d62588aab70
/iOS/Classes/Native/UnityEngine_UnityEngine_Events_UnityEventCallState3502354656.h
532bffebbbd98aef3170da593149d2fc58916a61
[ "MIT" ]
permissive
mopsicus/unity-share-plugin-ios-android
6dd6ccd2fa05c73f0bf5e480a6f2baecb7e7a710
3ee99aef36034a1e4d7b156172953f9b4dfa696f
refs/heads/master
2020-12-25T14:38:03.861759
2016-07-19T10:06:04
2016-07-19T10:06:04
63,676,983
12
0
null
null
null
null
UTF-8
C++
false
false
1,012
h
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include "mscorlib_System_Enum2862688501.h" #include "UnityEngine_UnityEngine_Events_UnityEventCallState3502354656.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.Events.UnityEventCallState struct UnityEventCallState_t3502354656 { public: // System.Int32 UnityEngine.Events.UnityEventCallState::value__ int32_t ___value___1; public: inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(UnityEventCallState_t3502354656, ___value___1)); } inline int32_t get_value___1() const { return ___value___1; } inline int32_t* get_address_of_value___1() { return &___value___1; } inline void set_value___1(int32_t value) { ___value___1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
6424678a502623ee8889d11b653b915a0381f2ce
27193ac605fb28b9db1840d8430250a3cc851f0a
/src/engine/Color.cpp
73c493626aad234825a5e165925b1d5f998aee89
[]
no_license
escape9179/ogl-game-engine
5fca0fe0f9caf27eafad37b3bfcd42a5cab11493
bc2cf5575e94c384cf62373920ea31eaf1af52fa
refs/heads/master
2022-11-26T15:10:07.607405
2020-07-27T12:30:46
2020-07-27T12:30:46
265,688,825
0
0
null
2020-07-11T06:01:38
2020-05-20T21:22:10
C++
UTF-8
C++
false
false
321
cpp
// // Created by Tre on 7/6/2020. // #include "Color.h" Color::Color() : Triple<float>(1.0f, 1.0f, 1.0f) { } Color::Color(float r, float g, float b) : Triple<float>(r, g, b) { } float Color::getRed() { return first; } float Color::getGreen() { return second; } float Color::getBlue() { return third; }
e548859ae542eaa40fcbc7118ad74c91bd5b82f1
fcff6938f2624d4f9d94f9557fb3ccffa6334d5c
/Common/ClassDescription.cxx
d7b3766af6cb148b28705f4f21cba3e1ba566e2a
[]
no_license
CISMM/ITKPlugins
b50c89b790f2a9f19e29e6c5cebbebcb1539a28b
55095fd43a10122fec357d56205934a36ab02822
refs/heads/master
2020-05-19T21:48:49.775732
2013-04-03T15:28:17
2013-04-03T15:28:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,773
cxx
#include "ClassDescription.h" #include "Enumeration.h" #include "MemberDescription.h" ClassDescription ::ClassDescription() : m_NumberOfInputs( 0 ), m_CustomSetInput( "<undefined>" ) { } ClassDescription ::~ClassDescription() { for ( size_t i = 0; i < m_Enumerations.size(); ++i ) { delete m_Enumerations[i]; } for ( size_t i = 0; i < m_Members.size(); ++i ) { delete m_Members[i]; } } void ClassDescription ::AddIncludeFile( const std::string & includeFile ) { m_IncludeFiles.push_back( includeFile ); } const std::string & ClassDescription ::GetIncludeFile( int index ) const { return m_IncludeFiles[ index ]; } int ClassDescription ::GetNumberOfIncludeFiles() const { return static_cast< int >( m_IncludeFiles.size() ); } void ClassDescription ::AddMember( MemberDescription * memberDescription ) { m_Members.push_back( memberDescription ); } const MemberDescription * ClassDescription ::GetMemberDescription( int index ) const { // No bounds checking return m_Members[ index ]; } int ClassDescription ::GetNumberOfMemberDescriptions() const { return static_cast< int >( m_Members.size() ); } void ClassDescription ::AddEnumeration( Enumeration * enumeration ) { m_Enumerations.push_back( enumeration ); } const Enumeration * ClassDescription ::GetEnumeration( int index ) const { // No bounds checking return m_Enumerations[index]; } const Enumeration * ClassDescription ::GetEnumeration( const std::string & name ) const { for ( int i = 0; i < this->GetNumberOfEnumerations(); ++i ) { if ( m_Enumerations[i]->GetName() == name ) { return m_Enumerations[i]; } } return NULL; } int ClassDescription ::GetNumberOfEnumerations() const { return static_cast< int >( m_Enumerations.size() ); } bool ClassDescription ::IsEnumerationType( const std::string & name ) const { for ( int i = 0; i < this->GetNumberOfEnumerations(); ++i ) { if ( this->GetEnumeration( i )->GetName() == name ) { return true; } } return false; } void ClassDescription ::PrintSelf( std::ostream & os ) { os << "PluginName: " << m_PluginName << std::endl; os << "ITKClassName: " << m_ITKClassName << std::endl; os << "NumberOfInputs: " << m_NumberOfInputs << std::endl; os << "BriefDescription: " << m_BriefDescription << std::endl; os << "DetailedDescription: " << m_DetailedDescription << std::endl; os << "PublicDeclarations: " << m_PublicDeclarations << std::endl; os << "Enumerations: " << std::endl; for ( size_t i = 0; i < m_Enumerations.size(); ++i) { m_Enumerations[i]->PrintSelf( os ); } os << "Members: " << std::endl; for ( size_t i = 0; i < m_Members.size(); ++i) { m_Members[i]->PrintSelf( os ); } }
f9eb7d9c61d1d3d5e1c018e1fb91a1fa844aa54a
afd787d5c5f905d22ee0bc141614a03879a5f722
/C++/ECS/ComponentId.hpp
abf4a59a09a28bb6f29aee8c15d3800d449c46d8
[]
no_license
jinyukyo/ResetCore
163a19991ef85b530354c61d7e5d20f6a067cb88
e216836e19d5dfd8c7f357b90c0a8358295c6574
refs/heads/master
2022-06-02T08:51:03.179964
2020-05-03T17:26:53
2020-05-03T17:26:53
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,106
hpp
// // Created by 董宸 on 19/01/2018. // #ifndef RESETCORE_COMPONENTID_HPP #define RESETCORE_COMPONENTID_HPP #include <TypeDefine.hpp> #include <vector> #include "IComponent.hpp" namespace ResetCore{ typedef Ruint ComponentId; typedef std::vector<ComponentId> ComponentIdList; class ComponentTypeId { public: /** * 获取ComponentID * @tparam T * @return */ template <typename T> static const ComponentId Get(){ //判断为IComponent的子类并且不是IComponent static_assert(std::is_base_of<IComponent, T>::value && !std::is_same<IComponent, T>::value, "Class type must be derived from IComponent"); static ComponentId id = mCounter++; return id; } /** * 获取当前组件数量 * @return */ static const Ruint Count(){ return mCounter; } private: static Ruint mCounter; }; Ruint ComponentTypeId::mCounter = 0; } #endif //RESETCORE_COMPONENTID_HPP
c4bcf7403f9d3e91e131cfbac8b459f007b498cb
7336bcbc0344996592a0580ccf75685f5bfcd90b
/分区分配算法(双链表)/分区分配算法(双链表)/分区分配算法(双链表)/test.cpp
7ed9c2536e051fc882937e3d5cc9cbc605b91ec5
[]
no_license
Jamesuhao/C-
18c82319c8df5c2894a17edbe4aa1dccd8e769d1
30e1434f4d477c25361cbcfd6086c83acc5542e5
refs/heads/master
2020-08-25T08:51:08.155105
2020-04-16T05:11:53
2020-04-16T05:11:53
205,066,942
0
0
null
null
null
null
UTF-8
C++
false
false
207
cpp
#include<stdio.h> #include<stdlib.h> #include"All.h" #include<iostream> using namespace std; int main() { My_Node mylist; My_Job myjob; Al_Size al; Init_List(&mylist); Choose_Alg(&mylist, myjob, al); }
f08371522b4c3a4c4896db3c343ae79ecf2d8b8d
5cc38217766f8a49a8a339395d3ca4b4b8161a36
/Servaival/Serval.cpp
ebd01f3acb78c3f1c22ff89da9c8b3ad0a7f9b39
[]
no_license
NeuroWhAI/Servaival
e74c5ea28fed5fc5fb85c88103f5ffc93a8827e4
58a143843c1d394b4e165da0c81c764c79983202
refs/heads/master
2021-01-19T08:24:03.617338
2017-04-08T10:20:00
2017-04-08T10:20:00
87,625,009
3
0
null
null
null
null
UTF-8
C++
false
false
1,767
cpp
#include "Serval.h" Serval::Serval() : m_vibratingValue(0.5f) , m_vibrationGage(0) , m_beforeJump(0) , m_canJump(true) , m_speed(0, 0) { } //######################################################################################################## void Serval::load(const caDraw::TexturePtr& texBody) { m_texBody = texBody; } void Serval::update() { transform.position.move(m_speed.x, m_speed.y); m_speed.x *= 0.9f; if (std::abs(m_speed.x) < 0.1f) { m_speed.x = 0.0f; } if (m_canJump == false) { m_speed.y += 2.0f; if (transform.position.y >= m_beforeJump) { transform.position.y = m_beforeJump; m_speed.y = 0.0f; m_canJump = true; } } else { m_beforeJump = transform.position.y; if (caKeyboard->isKeyDown(caSys::Keys::Right) || caKeyboard->isKeyPressed(caSys::Keys::Right)) { transform.scale = { -1, 1 }; if (m_vibrationGage <= 0) { m_vibrationGage = 7; if (m_vibratingValue > 0.0f) { m_vibratingValue = -0.5f; } else { m_vibratingValue = 0.5f; } } else { --m_vibrationGage; } } } } void Serval::onDraw(Graphics& g, const Transform& parentTransform) { auto& texArt = g.textureArtist; texArt->beginDrawTexture(); texArt->drawTexture(*m_texBody, caDraw::PointF(0, m_vibratingValue)); texArt->endDrawTexture(); } //######################################################################################################## bool Serval::canJump() const { return m_canJump; } void Serval::jump() { if (m_canJump) { m_canJump = false; m_beforeJump = transform.position.y; m_speed.y = -16.0f; } } void Serval::restoreYToBeforeJump() { transform.position.y = m_beforeJump; } void Serval::hit() { m_speed.x = -8.0f; }
1c15f5cecd90499bd0f62d91d4fe2bed1b632a33
c0fd0b920d938704e5cb214ad95296c381281bc4
/main.cpp
31301e1899c75bcf5f03dd0d46e3e1311e480be5
[]
no_license
navarrovitor/cpp-Text-Editor
11f31a05b9667ccc4aacf721638f08fc84d135c0
77f483878a6e8389f08208b31309749c0d9976d8
refs/heads/main
2023-05-11T11:29:17.602236
2021-06-01T23:56:46
2021-06-01T23:56:46
369,298,111
0
0
null
null
null
null
UTF-8
C++
false
false
2,825
cpp
#include "LinkedList.h" int main() { LinkedList linkedList; string file = "inteligenciaEmocional.txt", word, oldWord, newWord; int run = 0, opt; linkedList.loadText(file); cout << endl << "Bem vindo ao editor de texto C++!" << endl << endl << "Com o arquivo " << file << " de base, você pode:" << endl << "- Descobrir o número de vezes que uma palavra aparece no mesmo" << endl << "- Mudar as palavras que você desejar" << endl << "- Imprimir seu texto no formato de lista ligada no terminal" << endl << "- Salvar seu arquivo alterado" << endl; while (run != 1) { cout << endl << "---------------------------------------------" << endl << "Escolha uma opção:" << endl << "1 - Contar número de ocorrências de uma palavra" << endl << "2 - Trocar palavra" << endl << "3 - Imprimir lista" << endl << "4 - Salvar suas alterações no arquivo .txt (sai do programa automaticamente)" << endl << "5 - Sair do programa" << endl << "---------------------------------------------" << endl << endl << "Informe sua escolha:" << endl; cin >> opt; switch (opt) { case 1: cout << "Qual palavra você quer contar?" << endl; cin >> word; if (linkedList.countWord(oldWord) == 1) cout << "A palavra " << word << " aparece uma vez." << endl; else cout << "A palavra " << word << " aparece " << linkedList.countWord(word) << " vezes." << endl; break; case 2: cout << "Qual palavra você quer trocar?" << endl; cin >> oldWord; cout << "Você quer troca-lá por qual palavra?" << endl; cin >> newWord; if (linkedList.countWord(oldWord) < 1) { cout << "Essa palavra não aparece no texto." << endl; break; } if (linkedList.countWord(oldWord) == 1) cout << "A palavra " << oldWord << " aparece uma vez." << endl; else cout << "A palavra " << oldWord << " aparece " << linkedList.countWord(oldWord) << " vezes." << endl; linkedList.changeWord(oldWord, newWord); cout << "Todas as ocorrências da mesma foram trocadas por " << newWord << '.' << endl << "Aqui está a lista:" << endl; linkedList.printList(); break; case 3: cout << "A lista se encontra assim:" << endl; linkedList.printList(); break; case 4: cout << "Salvando a lista no arquivo " << file << "..." << endl; linkedList.saveText(file); cout << "Obrigado pela visita! Saindo do programa..." << endl; run++; break; case 5: cout << "Obrigado pela visita! Saindo do programa..." << endl; run++; break; default: break; } } return 0; }