hexsha
stringlengths
40
40
size
int64
7
1.05M
ext
stringclasses
13 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
269
max_stars_repo_name
stringlengths
5
109
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
9
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
269
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
9
max_issues_count
int64
1
48.5k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
269
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
9
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
7
1.05M
avg_line_length
float64
1.21
330k
max_line_length
int64
6
990k
alphanum_fraction
float64
0.01
0.99
author_id
stringlengths
2
40
69cf159f7d5b64cc24ca1479796d1679dc4f0c94
6,136
cpp
C++
Plugins/uPacketDivision/uPacketDivision/Assembler.cpp
hecomi/uPacketDivision
264a9dbe77a03f8534c2e087d7b33143478c6822
[ "MIT" ]
4
2021-11-28T23:54:15.000Z
2022-02-20T10:50:28.000Z
Plugins/uPacketDivision/uPacketDivision/Assembler.cpp
hecomi/uPacketDivision
264a9dbe77a03f8534c2e087d7b33143478c6822
[ "MIT" ]
null
null
null
Plugins/uPacketDivision/uPacketDivision/Assembler.cpp
hecomi/uPacketDivision
264a9dbe77a03f8534c2e087d7b33143478c6822
[ "MIT" ]
null
null
null
#include <chrono> #include <algorithm> #include "Assembler.h" #include "Log.h" namespace uPacketDivision { void Frame::AddChunkData(const void *pData, uint32_t) { const auto &header = *reinterpret_cast<const PacketHeader*>(pData); if (header.version != GetPacketHeaderVersion()) { DebugLog("Packet version (%u) is wrong.", header.version); return; } if (header.type != static_cast<uint32_t>(PacketType::Chunk)) { DebugLog("Packet type (%u) is wrong.", header.type); return; } if (!buf_) { Initialize(header); } if (header.chunkCount != chunkCount_ || header.timestamp != timestamp_ || header.totalSize != totalSize_ || header.chunkIndex > chunkCount_) { DebugLog("Detected a wrong packet (count: %u / %u, time: %u / %u, size: %u / %u, index: %u).", header.chunkCount, chunkCount_, header.timestamp, timestamp_, header.totalSize, totalSize_, header.chunkIndex); return; } bool &flag = receivedChunkIndices_.at(header.chunkIndex); if (flag) { DebugLog("Received a same chunkIndex data."); return; } flag = true; const auto offset = header.offsetSize; if (offset + header.chunkSize > totalSize_) { DebugLog("Received data exceeds the buffer size."); return; } auto *pDst = buf_.get() + offset; const auto *pSrc = reinterpret_cast<const char*>(pData) + sizeof(PacketHeader); memcpy(pDst, pSrc, header.chunkSize); receivedSize_ += header.chunkSize; } bool Frame::IsCompleted() const { if (receivedChunkIndices_.empty()) return false; for (const auto &pair : receivedChunkIndices_) { if (!pair.second) return false; } if (receivedSize_ != totalSize_) { DebugLog("Receive size is wrong."); return false; } return true; } void Frame::Initialize(const PacketHeader &header) { totalSize_ = header.totalSize; timestamp_ = header.timestamp; chunkCount_ = header.chunkCount; for (uint32_t i = 0; i < chunkCount_; ++i) { receivedChunkIndices_.emplace(i, false); } buf_ = std::make_unique<char[]>(totalSize_); } // --- void Assembler::AddChunkData(const void* pData, uint32_t size) { constexpr uint32_t headerSize = sizeof(PacketHeader); if (size < headerSize) { DebugLog("Received data size (%u) is smaller than header (%u).", size, headerSize); return; } const auto &header = *reinterpret_cast<const PacketHeader*>(pData); if (header.version != GetPacketHeaderVersion()) { DebugLog("Packet version is wrong."); return; } if (header.chunkSize + headerSize != size) { DebugLog("Packet size is wrong (size: %u, chunk: %u, header: %u).", size, header.chunkSize, headerSize); return; } if (header.type != static_cast<uint32_t>(PacketType::Chunk)) { DebugLog("Header type is not supported (%u).", header.type); return; } const auto index = header.frameIndex; if (index > latestFrameIndex_ || latestFrameIndex_ == -1) { latestFrameIndex_ = index; latestTimestamp_ = header.timestamp; } if (oldestFrameIndex_ == -1) { oldestFrameIndex_ = index; } auto it = frames_.find(index); if (it == frames_.end()) { auto frame = std::make_unique<Frame>(); frame->AddChunkData(pData, size); frames_.emplace(index, std::move(frame)); } else { const auto &frame = it->second; frame->AddChunkData(pData, size); } CheckAll(); } void Assembler::CheckAll() { using namespace std::chrono; eventType_ = EventType::None; lossType_ = LossType::None; if (frames_.empty()) return; auto it = frames_.find(oldestFrameIndex_); if (it == frames_.end()) { DebugLog("packet loss."); eventType_ = EventType::PacketLoss; lossType_ = LossType::NotReceived; if (latestFrameIndex_ > oldestFrameIndex_) { ++oldestFrameIndex_; } return; } const auto &packet = it->second; if (packet->IsCompleted()) { assembledFrameIndices_.push_back(oldestFrameIndex_); eventType_ = EventType::FrameCompleted; ++oldestFrameIndex_; } else { const auto dt = latestTimestamp_ - packet->GetTimestamp(); if (dt > timeout_) { DebugLog("packet timeout (> %u ms, %u / %u).", timeout_, packet->GetReceivedSize(), packet->GetTotalSize()); eventType_ = EventType::PacketLoss; lossType_ = LossType::Timeout; frames_.erase(oldestFrameIndex_); if (latestFrameIndex_ > oldestFrameIndex_) { ++oldestFrameIndex_; } return; } } } uint64_t Assembler::GetAssembledFrameIndex() const { return !assembledFrameIndices_.empty() ? *assembledFrameIndices_.begin() : -1; } const char * Assembler::GetFrameData(uint64_t index) const { const auto it = frames_.find(index); return (it != frames_.end()) ? it->second->GetData() : nullptr; } uint32_t Assembler::GetFrameSize(uint64_t index) const { const auto it = frames_.find(index); return (it != frames_.end()) ? it->second->GetTotalSize() : 0; } void Assembler::RemoveFrame(uint64_t index) { const auto it = frames_.find(index); if (it != frames_.end()) { frames_.erase(it); } auto &indices = assembledFrameIndices_; indices.erase( std::remove(indices.begin(), indices.end(), index), indices.end()); } }
23.330798
103
0.564211
hecomi
69d86305d9ebc709378d6fa463a2778b4555147f
671
hpp
C++
incs/Borders.hpp
paribro/hydrodynamic-simulator
63f16099a4b60bd6240d2c7a6950009637197382
[ "MIT" ]
2
2020-08-12T11:41:04.000Z
2021-02-20T20:02:44.000Z
incs/Borders.hpp
prdbrg/hydrodynamic-simulator
63f16099a4b60bd6240d2c7a6950009637197382
[ "MIT" ]
null
null
null
incs/Borders.hpp
prdbrg/hydrodynamic-simulator
63f16099a4b60bd6240d2c7a6950009637197382
[ "MIT" ]
null
null
null
#ifndef BORDERS_CLASS_HPP # define BORDERS_CLASS_HPP # include <glm/glm.hpp> # include <Define.hpp> # include <AModule.hpp> class Borders: public AModule { public: Borders(Model & model); ~Borders(void); private: Borders(void); Borders(Borders const & model); Borders & operator=(Borders const & rhs); void assignVertices(GLfloat x, int y, GLfloat z); void assignNormals(GLfloat x, GLfloat y, GLfloat z); void createVertices(void); void createColors(void); void createElements(void); void createNormals(void); GLfloat _bordersTop; GLfloat * _terrainVertices; GLfloat _thickness; }; #endif /* ! BORDERS_CLASS_HPP */
20.96875
56
0.700447
paribro
69d8aab470b3a352c977d76a1eaee5315661a965
2,141
cpp
C++
Code/Client/ClientUI/Source/ZlibUtil.cpp
MarvinGeng/TinyIM
01c1c2e257e85caf8afa5ac5ecc4d5295fb0d710
[ "MIT" ]
null
null
null
Code/Client/ClientUI/Source/ZlibUtil.cpp
MarvinGeng/TinyIM
01c1c2e257e85caf8afa5ac5ecc4d5295fb0d710
[ "MIT" ]
null
null
null
Code/Client/ClientUI/Source/ZlibUtil.cpp
MarvinGeng/TinyIM
01c1c2e257e85caf8afa5ac5ecc4d5295fb0d710
[ "MIT" ]
1
2022-01-15T03:18:26.000Z
2022-01-15T03:18:26.000Z
/* * 压缩工具类,ZlibUtil.cpp * zhangyl 2018.03.09 */ #include "stdafx.h" #include "../zlib1.2.11/zlib.h" #include <string.h> #include "ZlibUtil.h" //最大支持压缩10M #define MAX_COMPRESS_BUF_SIZE 10*1024*1024 bool ZlibUtil::CompressBuf(const char* pSrcBuf, size_t nSrcBufLength, char* pDestBuf, size_t& nDestBufLength) { if (pSrcBuf == NULL || nSrcBufLength == 0 || nSrcBufLength > MAX_COMPRESS_BUF_SIZE || pDestBuf == NULL) return false; //计算缓冲区大小,并为其分配内存 //压缩后的长度是不会超过nDestBufLength的 nDestBufLength = compressBound(nSrcBufLength); //压缩 int ret = compress((Bytef*)pDestBuf, (uLongf*)&nDestBufLength, (const Bytef*)pSrcBuf, nSrcBufLength); if (ret != Z_OK) return false; return true; } bool ZlibUtil::CompressBuf(const std::string& strSrcBuf, std::string& strDestBuf) { if (strSrcBuf.empty()) return false; int nSrcLength = strSrcBuf.length(); if (nSrcLength > MAX_COMPRESS_BUF_SIZE) return false; int nDestBufLength = compressBound(nSrcLength); if (nDestBufLength <= 0) return false; char* pDestBuf = new char[nDestBufLength]; memset(pDestBuf, 0, nDestBufLength * sizeof(char)); //压缩 int ret = compress((Bytef*)pDestBuf, (uLongf*)&nDestBufLength, (const Bytef*)strSrcBuf.c_str(), nSrcLength); if (ret != Z_OK) { delete[] pDestBuf; return false; } strDestBuf.append(pDestBuf, nDestBufLength); delete[] pDestBuf; return true; } bool ZlibUtil::UncompressBuf(const std::string& strSrcBuf, std::string& strDestBuf, size_t nDestBufLength) { char* pDestBuf = new char[nDestBufLength]; memset(pDestBuf, 0, nDestBufLength * sizeof(char)); int nPrevDestBufLength = nDestBufLength; //解压缩 int ret = uncompress((Bytef*)pDestBuf, (uLongf*)&nDestBufLength, (const Bytef*)strSrcBuf.c_str(), strSrcBuf.length()); if (ret != Z_OK) { delete[] pDestBuf; return false; } if (nPrevDestBufLength == nDestBufLength) { int k = 0; k++; } strDestBuf.append(pDestBuf, nDestBufLength); delete[] pDestBuf; return true; }
25.795181
122
0.657637
MarvinGeng
69d8c36761d3a233b51e22bbde23d7dd80b3438d
1,690
cc
C++
benchmarks/svf/svf.cc
wolvre/maple
c856c70e224a1354f40bbc16b43ff31b96141f75
[ "Apache-2.0" ]
5
2015-07-20T09:42:22.000Z
2021-08-30T06:24:17.000Z
benchmarks/svf/svf.cc
wolvre/maple
c856c70e224a1354f40bbc16b43ff31b96141f75
[ "Apache-2.0" ]
null
null
null
benchmarks/svf/svf.cc
wolvre/maple
c856c70e224a1354f40bbc16b43ff31b96141f75
[ "Apache-2.0" ]
2
2017-05-23T11:57:07.000Z
2017-06-30T11:30:44.000Z
#include <pthread.h> #include <iostream> #include <stdlib.h> #include <assert.h> #include "sync01.h" #include "sync02.h" #include "stateful001.h" #include "stateful002.h" int inputX = 0; int inputY = 0; int data1 = -1, data2 = -1, data3 = -1, data4 = -1; pthread_mutex_t m; void add1() { data1++; sync01(); } void add2() { data2++; sync02(); } void add3() { data3++; stateful001(); } void add4() { data4++; stateful002(); } void lock() { pthread_mutex_lock(&m); } void unlock() { pthread_mutex_unlock(&m); } void *thread1(void *arg){ lock(); data1++; data2++; data3++; data4++; unlock(); } void *thread2(void *arg){ if(inputX > 0 && inputY > 0) { add1(); lock(); add3(); unlock(); } else if(inputX > 0 && inputY <= 0) { lock(); add1(); unlock(); lock(); add4(); unlock(); } else if(inputX <= 0 && inputY > 0) { lock(); add2(); unlock(); lock(); add3(); unlock(); } else { lock(); add2(); unlock(); lock(); add4(); unlock(); } } int main(int argc, char ** argv) { inputX = atoi(argv[1]); inputY = atoi(argv[2]); pthread_t t1,t2; pthread_create(&t1, 0, thread1, 0); pthread_create(&t2, 0, thread2, 0); pthread_join(t1, 0); pthread_join(t2, 0); int sum = data1+data2+data3+data4; if(sum != 2){ std::cout << "sum = " << sum << std::endl; } assert(sum==2); return 0; }
14.322034
51
0.457396
wolvre
69d9f8142a17782cacd9ada58f37b6100053badf
1,730
hh
C++
src/interface/MiniMap.hh
zermingore/warevolved
efd0c506658ce6e4ecb6c7eb5bb7d620bc05fd52
[ "MIT" ]
1
2019-09-23T18:16:27.000Z
2019-09-23T18:16:27.000Z
src/interface/MiniMap.hh
zermingore/warevolved
efd0c506658ce6e4ecb6c7eb5bb7d620bc05fd52
[ "MIT" ]
2
2018-11-12T18:48:03.000Z
2018-11-15T21:10:02.000Z
src/interface/MiniMap.hh
zermingore/warevolved
efd0c506658ce6e4ecb6c7eb5bb7d620bc05fd52
[ "MIT" ]
null
null
null
/** * \file * \date August 22, 2017 * \author Zermingore * \namespace interface * \brief Side panel's MiniMap class declaration */ #ifndef INTERFACE_MINIMAP_HH_ # define INTERFACE_MINIMAP_HH_ # include <memory> # include <vector> # include <utility> # include <graphics/graphic_types.hh> # include <interface/InterfaceElement.hh> # include <common/using.hh> class Map; namespace interface { class Cursor; /** * \class MiniMap * \brief In charge of the build / display of the minimap in the side panel */ class MiniMap final: public InterfaceElement { public: /** * \brief Constructor: needs the Map and Cursor to check what is hovered * \param size Minimap's frame size * \param map Game's map * \param cursor Cursor of the player (needed to put a mark on the minimap) */ MiniMap(const graphics::Size2& size, const std::shared_ptr<const Map>& map, const std::shared_ptr<const Cursor>& cursor); /** * \brief Update the minimap content * \todo Don't rebuild the minimap if the map / cursor position didn't change */ void update() override final; /** * \brief Draw the minimap in the side panel */ void draw() override final; /** * \brief Set the MiniMap position * \param pos New position */ void setPosition(const graphics::Pos2& pos); /** * \brief Set the MiniMap frame size * \param size New size */ void setFrameSize(const graphics::Size2& size); private: graphics::Size2 _frameSize; ///< Draw area size const Map& _map; ///< Pointer on the game's map /// The cursor's position is displayed on the minimap const Cursor& _playerCursor; }; } // namespace interface #endif /* !INTERFACE_MINIMAP_HH_ */
20.116279
79
0.678613
zermingore
69db2db1e436f63c84fa746623f66d4ebd6aa610
3,004
cpp
C++
engine/src/app/Window.cpp
Dino97/Kinemo
4aeee2c960961f2e5d453734b9fb1a8e7c717cdf
[ "MIT" ]
2
2019-10-14T02:19:55.000Z
2019-10-15T01:24:53.000Z
engine/src/app/Window.cpp
Dino97/Kinemo
4aeee2c960961f2e5d453734b9fb1a8e7c717cdf
[ "MIT" ]
null
null
null
engine/src/app/Window.cpp
Dino97/Kinemo
4aeee2c960961f2e5d453734b9fb1a8e7c717cdf
[ "MIT" ]
null
null
null
#include "Window.h" #include "glad/glad.h" #include "GLFW/glfw3.h" #include <iostream> namespace Kinemo { void OpenGLDebugCallback(GLenum source​, GLenum type​, GLuint id​, GLenum severity​, GLsizei length​, const GLchar* message​, const void* userParam​); Window::Window(const WindowProperties& properties) { glfwInit(); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); GLFWmonitor* monitor = properties.Mode == WindowMode::Windowed ? nullptr : glfwGetPrimaryMonitor(); m_Window = glfwCreateWindow(properties.Width, properties.Height, properties.Title.c_str(), monitor, nullptr); glfwMakeContextCurrent(m_Window); if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) { } glfwSetWindowUserPointer(m_Window, &m_Data); glfwSetKeyCallback(m_Window, [](GLFWwindow* window, int key, int scancode, int action, int mods) { WindowData& data = *(WindowData*)glfwGetWindowUserPointer(window); switch(action) { case GLFW_PRESS: { Events::KeyPressedEvent event(key, 0); data.EventCallback(event); break; } case GLFW_RELEASE: { Events::KeyReleasedEvent event(key); data.EventCallback(event); break; } case GLFW_REPEAT: { Events::KeyPressedEvent event(key, 1); data.EventCallback(event); break; } } }); glfwSetMouseButtonCallback(m_Window, [](GLFWwindow* window, int button, int action, int mods) { WindowData& data = *(WindowData*)glfwGetWindowUserPointer(window); switch (action) { case GLFW_PRESS: { Events::MouseButtonPressedEvent event(button); data.EventCallback(event); break; } case GLFW_RELEASE: { Events::MouseButtonReleasedEvent event(button); data.EventCallback(event); break; } } }); glEnable(GL_DEPTH_TEST); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_DEBUG_OUTPUT); glDebugMessageCallbackARB(OpenGLDebugCallback, nullptr); } void OpenGLDebugCallback(GLenum source​, GLenum type​, GLuint id​, GLenum severity​, GLsizei length​, const GLchar* message​, const void* userParam​) { std::cerr << "[OpenGL Debug]: " << message​ << std::endl; } Window::~Window() { glfwDestroyWindow(m_Window); } void Window::Clear() const { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClearColor(0.1f, 0.1f, 0.1f, 1.0f); // dark gray } void Window::Update() const { glfwPollEvents(); glfwSwapBuffers(m_Window); } void Window::SetEventCallback(const EventCallbackFn& callback) { m_Data.EventCallback = callback; } void Window::SetVSync(bool vsync) { glfwSwapInterval(vsync ? 1 : 0); } bool Window::IsClosing() const { return glfwWindowShouldClose(m_Window); } void Window::SetTitle(const std::string& title) { m_WindowProperties.Title = title; glfwSetWindowTitle(m_Window, title.c_str()); } }
23.84127
151
0.704394
Dino97
69e19dddbc67b1ad175a8e49a731c6b4c6bf12d0
6,839
hpp
C++
posu/units/system/si/electric_current.hpp
zhu48/posu
4872bd7572485c1c352aaf5db7a99d578a682113
[ "MIT" ]
null
null
null
posu/units/system/si/electric_current.hpp
zhu48/posu
4872bd7572485c1c352aaf5db7a99d578a682113
[ "MIT" ]
33
2020-12-14T02:50:22.000Z
2022-03-08T03:20:15.000Z
posu/units/system/si/electric_current.hpp
zhu48/posu
4872bd7572485c1c352aaf5db7a99d578a682113
[ "MIT" ]
null
null
null
#ifndef POSU_UNITS_SI_ELECTRIC_CURRENT_HPP #define POSU_UNITS_SI_ELECTRIC_CURRENT_HPP #include "posu/units/base_unit.hpp" #include "posu/units/system/electric_current.hpp" namespace posu::units::si { struct electric_current : public posu::units::electric_current { using type = electric_current; using kind_type = posu::units::electric_current; using period = std::ratio<1>; }; } // namespace posu::units::si namespace posu::units { template<> inline constexpr bool enable_as_unit<si::electric_current> = true; } namespace posu::units::si { template<typename Rep, typename Period> using basic_ampere = quantity<Rep, Period, electric_current>; using attoamperes = basic_ampere<int, std::atto>; using femtoamperes = basic_ampere<int, std::femto>; using picoamperes = basic_ampere<int, std::pico>; using nanoamperes = basic_ampere<int, std::nano>; using microamperes = basic_ampere<int, std::micro>; using milliamperes = basic_ampere<int, std::milli>; using centiamperes = basic_ampere<int, std::centi>; using deciamperes = basic_ampere<int, std::deci>; using amperes = basic_ampere<int, std::ratio<1>>; using decaamperes = basic_ampere<int, std::deca>; using hectoamperes = basic_ampere<int, std::hecto>; using kiloamperes = basic_ampere<int, std::kilo>; using megaamperes = basic_ampere<int, std::mega>; using gigaamperes = basic_ampere<int, std::giga>; using teraamperes = basic_ampere<int, std::tera>; using petaamperes = basic_ampere<int, std::peta>; using exaamperes = basic_ampere<int, std::exa>; inline namespace literals { inline namespace electric_current_literals { [[nodiscard]] constexpr auto operator""_aA(unsigned long long value) -> attoamperes; [[nodiscard]] constexpr auto operator""_aA(long double value) -> basic_ampere<double, std::atto>; [[nodiscard]] constexpr auto operator""_fA(unsigned long long value) -> femtoamperes; [[nodiscard]] constexpr auto operator""_fA(long double value) -> basic_ampere<double, std::femto>; [[nodiscard]] constexpr auto operator""_pA(unsigned long long value) -> picoamperes; [[nodiscard]] constexpr auto operator""_pA(long double value) -> basic_ampere<double, std::pico>; [[nodiscard]] constexpr auto operator""_nA(unsigned long long value) -> nanoamperes; [[nodiscard]] constexpr auto operator""_nA(long double value) -> basic_ampere<double, std::nano>; [[nodiscard]] constexpr auto operator""_uA(unsigned long long value) -> microamperes; [[nodiscard]] constexpr auto operator""_uA(long double value) -> basic_ampere<double, std::micro>; [[nodiscard]] constexpr auto operator""_mA(unsigned long long value) -> milliamperes; [[nodiscard]] constexpr auto operator""_mA(long double value) -> basic_ampere<double, std::milli>; [[nodiscard]] constexpr auto operator""_cA(unsigned long long value) -> centiamperes; [[nodiscard]] constexpr auto operator""_cA(long double value) -> basic_ampere<double, std::centi>; [[nodiscard]] constexpr auto operator""_dA(unsigned long long value) -> deciamperes; [[nodiscard]] constexpr auto operator""_dA(long double value) -> basic_ampere<double, std::deci>; [[nodiscard]] constexpr auto operator""_A(unsigned long long value) -> amperes; [[nodiscard]] constexpr auto operator""_A(long double value) -> basic_ampere<double, std::ratio<1>>; [[nodiscard]] constexpr auto operator""_daA(unsigned long long value) -> decaamperes; [[nodiscard]] constexpr auto operator""_daA(long double value) -> basic_ampere<double, std::deca>; [[nodiscard]] constexpr auto operator""_hA(unsigned long long value) -> hectoamperes; [[nodiscard]] constexpr auto operator""_hA(long double value) -> basic_ampere<double, std::hecto>; [[nodiscard]] constexpr auto operator""_kA(unsigned long long value) -> kiloamperes; [[nodiscard]] constexpr auto operator""_kA(long double value) -> basic_ampere<double, std::kilo>; [[nodiscard]] constexpr auto operator""_MA(unsigned long long value) -> megaamperes; [[nodiscard]] constexpr auto operator""_MA(long double value) -> basic_ampere<double, std::mega>; [[nodiscard]] constexpr auto operator""_GA(unsigned long long value) -> gigaamperes; [[nodiscard]] constexpr auto operator""_GA(long double value) -> basic_ampere<double, std::giga>; [[nodiscard]] constexpr auto operator""_TA(unsigned long long value) -> teraamperes; [[nodiscard]] constexpr auto operator""_TA(long double value) -> basic_ampere<double, std::tera>; [[nodiscard]] constexpr auto operator""_PA(unsigned long long value) -> petaamperes; [[nodiscard]] constexpr auto operator""_PA(long double value) -> basic_ampere<double, std::peta>; [[nodiscard]] constexpr auto operator""_EA(unsigned long long value) -> exaamperes; [[nodiscard]] constexpr auto operator""_EA(long double value) -> basic_ampere<double, std::exa>; } // namespace electric_current_literals } // namespace literals using namespace literals::electric_current_literals; } // namespace posu::units::si #include "posu/units/system/si/ipp/electric_current.ipp" namespace posu::units::si { inline namespace references { inline namespace electric_current_references { inline constexpr auto aA = 1_aA; inline constexpr auto fA = 1_fA; inline constexpr auto pA = 1_pA; inline constexpr auto nA = 1_nA; inline constexpr auto uA = 1_uA; inline constexpr auto mA = 1_mA; inline constexpr auto cA = 1_cA; inline constexpr auto dA = 1_dA; inline constexpr auto A = 1_A; inline constexpr auto daA = 1_daA; inline constexpr auto hA = 1_hA; inline constexpr auto kA = 1_kA; inline constexpr auto MA = 1_MA; inline constexpr auto GA = 1_GA; inline constexpr auto TA = 1_TA; inline constexpr auto PA = 1_PA; inline constexpr auto EA = 1_EA; } // namespace electric_current_references } // namespace references } // namespace posu::units::si #endif // #ifndef POSU_UNITS_SI_ELECTRIC_CURRENT_HPP
47.165517
97
0.639421
zhu48
69eeca25028549bfb8a4c1f3122fdd82dded221b
709
cpp
C++
src/utils/common/physdll.cpp
cstom4994/SourceEngineRebuild
edfd7f8ce8af13e9d23586318350319a2e193c08
[ "MIT" ]
6
2022-01-23T09:40:33.000Z
2022-03-20T20:53:25.000Z
src/utils/common/physdll.cpp
cstom4994/SourceEngineRebuild
edfd7f8ce8af13e9d23586318350319a2e193c08
[ "MIT" ]
null
null
null
src/utils/common/physdll.cpp
cstom4994/SourceEngineRebuild
edfd7f8ce8af13e9d23586318350319a2e193c08
[ "MIT" ]
1
2022-02-06T21:05:23.000Z
2022-02-06T21:05:23.000Z
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // // $NoKeywords: $ // //=============================================================================// #include <stdio.h> #include "physdll.h" #include "filesystem_tools.h" static CSysModule *pPhysicsModule = NULL; CreateInterfaceFn GetPhysicsFactory(void) { if (!pPhysicsModule) { pPhysicsModule = g_pFullFileSystem->LoadModule("engine.dll"); if (!pPhysicsModule) return NULL; } return Sys_GetFactory(pPhysicsModule); } void PhysicsDLLPath(const char *pPathname) { if (!pPhysicsModule) { pPhysicsModule = g_pFullFileSystem->LoadModule(pPathname); } }
24.448276
81
0.57969
cstom4994
69f43de5ad9383ee1aba2396742ee1fc7628b0e5
2,067
cpp
C++
jogo/src/utils/classes/menu.cpp
Hyodar/jogo-tecprog
3a8cdf2cae583ad88a9377d0fbf796ba45d9d408
[ "MIT" ]
null
null
null
jogo/src/utils/classes/menu.cpp
Hyodar/jogo-tecprog
3a8cdf2cae583ad88a9377d0fbf796ba45d9d408
[ "MIT" ]
null
null
null
jogo/src/utils/classes/menu.cpp
Hyodar/jogo-tecprog
3a8cdf2cae583ad88a9377d0fbf796ba45d9d408
[ "MIT" ]
null
null
null
// Libraries // --------------------------------------------------------------------------- // Class header // --------------------- #include "menu.hpp" // Internal libraries // --------------------- #include "graphics_manager.hpp" using namespace bardadv::core; using namespace bardadv::menus; // Methods // --------------------------------------------------------------------------- Menu::Menu() : Ent(0, 0) { // noop } // --------------------------------------------------------------------------- Menu::~Menu() { // noop } // --------------------------------------------------------------------------- void Menu::addButton(int left, int top, int width, int height, MenuCommand action) { MenuItem button; button.rect.left = left; button.rect.top = top; button.rect.width = width; button.rect.height = height; button.action = action; menuItems.push_back(button); } // --------------------------------------------------------------------------- void Menu::render(sf::RenderWindow& renderWindow) { renderWindow.draw(sprite); renderWindow.display(); } // --------------------------------------------------------------------------- MenuCommand Menu::handleClick(int x, int y) { std::list<MenuItem>::iterator item; for(item = menuItems.begin(); item != menuItems.end(); item++) { sf::Rect<int> menuItemRect = item->rect; if(menuItemRect.contains(x, y)){ return item->action; } } return MenuCommand::NOOP; } // --------------------------------------------------------------------------- MenuCommand Menu::getMenuResponse(sf::RenderWindow& renderWindow) { sf::Event event; while(true) { while(renderWindow.pollEvent(event)) { switch(event.type) { case sf::Event::MouseButtonPressed: return handleClick(event.mouseButton.x, event.mouseButton.y); case sf::Event::Closed: return MenuCommand::EXIT; default:; } } } }
24.607143
84
0.426222
Hyodar
69fde02f06219de5181fed4b4211e703e0b110ab
1,281
cpp
C++
algorithmic-toolbox/week5_dynamic_programming1/2_primitive_calculator/primitive_calculator.cpp
hsgrewal/algorithms
b7532cc14221490128bb6aa12b06d20656855b8d
[ "MIT" ]
null
null
null
algorithmic-toolbox/week5_dynamic_programming1/2_primitive_calculator/primitive_calculator.cpp
hsgrewal/algorithms
b7532cc14221490128bb6aa12b06d20656855b8d
[ "MIT" ]
null
null
null
algorithmic-toolbox/week5_dynamic_programming1/2_primitive_calculator/primitive_calculator.cpp
hsgrewal/algorithms
b7532cc14221490128bb6aa12b06d20656855b8d
[ "MIT" ]
null
null
null
#include <iostream> #include <vector> #include <algorithm> #include <limits> using std::vector; vector<int> optimal_sequence(int n) { std::vector<int> sequence; vector<int> array(n + 1); int a1, m2, m3; for (int i = 2; i <= n; ++i) { a1 = m2 = m3 = std::numeric_limits<int>::max(); if (i - 1 >= 0) { a1 = 1 + array.at(i - 1); } if (i % 2 == 0 and i / 2 >= 0) { m2 = 1 + array.at(i / 2); } if (i % 3 == 0 and i / 3 >= 0) { m3 = 1 + array.at(i / 3); } array[i] = std::min(a1, std::min(m2, m3)); } while (n > 1) { sequence.push_back(n); if (n % 3 == 0 and array.at(n / 3) + 1 == array.at(n)) { n /= 3; } else if (n % 2 == 0 and array.at(n / 2) + 1 == array.at(n)) { n /= 2; } else if (array.at(n - 1) + 1 == array.at(n)) { n = n - 1; } } sequence.push_back(1); reverse(sequence.begin(), sequence.end()); return sequence; } int main() { int n; std::cin >> n; vector<int> sequence = optimal_sequence(n); std::cout << sequence.size() - 1 << std::endl; for (size_t i = 0; i < sequence.size(); ++i) { std::cout << sequence[i] << " "; } }
26.142857
71
0.442623
hsgrewal
0e032a6fdb93400c1863fd8f936662b9b3d24266
2,893
cpp
C++
tests/util_scoped_timer.cpp
extcpp/base
26b1384cbbd5cb3171e4cd22c8eb5f09ec0c5732
[ "MIT" ]
null
null
null
tests/util_scoped_timer.cpp
extcpp/base
26b1384cbbd5cb3171e4cd22c8eb5f09ec0c5732
[ "MIT" ]
22
2019-10-15T20:47:02.000Z
2020-01-26T20:26:19.000Z
tests/util_scoped_timer.cpp
extcpp/base
26b1384cbbd5cb3171e4cd22c8eb5f09ec0c5732
[ "MIT" ]
1
2020-09-24T08:53:15.000Z
2020-09-24T08:53:15.000Z
// Copyright - 2020 - Jan Christoph Uhde <Jan@UhdeJC.com> // Please see LICENSE.md for license or visit https://github.com/extcpp/basics #include <ext/macros/compiler.hpp> #include <ext/util/scoped_timer.hpp> #include <gtest/gtest.h> #include <iostream> #include <thread> using namespace ext::util; constexpr auto ms = std::chrono::milliseconds(1); void assert_time_eq(std::size_t ms_expected, std::pair<std::uint64_t, std::string> const& in, std::size_t steps = 1) { #ifndef EXT_TESTS_NO_TIME_CRITICAL #ifdef EXT_COMPILER_VC ms_expected += 2 * steps; #else ms_expected += steps; #endif ASSERT_LE(in.first / (1000 * 1000), ms_expected); #else (void) ms_expected; (void) in; (void) steps; std::cerr << "time not asserted\n"; #endif // EXT_TESTS_NO_TIME_CRITICAL } TEST(util_scoped_timer, nostep) { scoped_timer_res result; auto callback = [&result](scoped_timer_res const& in) { result = in; return in; }; { scoped_timer timer(callback); std::this_thread::sleep_for(ms); } assert_time_eq(1, result.front()); } TEST(util_scoped_timer, steps) { scoped_timer_res result; auto callback = [&result](scoped_timer_res const& in) { result = in; return in; }; { scoped_timer timer(callback); std::this_thread::sleep_for(ms); timer.add_step(); std::this_thread::sleep_for(ms); timer.add_step(); std::this_thread::sleep_for(ms); } assert_time_eq(3, result[0], 3); assert_time_eq(1, result[1], 1); assert_time_eq(1, result[2], 2); assert_time_eq(1, result[3], 3); ASSERT_STREQ("destructor", result.back().second.c_str()); } TEST(util_scoped_timer, no_dtor) { scoped_timer_res result; auto callback = [&result](scoped_timer_res const& in) { result = in; return in; }; { scoped_timer timer(callback); timer.disable_dtor_entry(); std::this_thread::sleep_for(ms); timer.add_step(); std::this_thread::sleep_for(ms); timer.add_step(); std::this_thread::sleep_for(ms); } assert_time_eq(2, result[0], 2); assert_time_eq(1, result[1], 1); assert_time_eq(1, result[2], 2); ASSERT_STREQ("", result.back().second.c_str()); } TEST(util_scoped_timer, dismiss) { scoped_timer_res result; auto callback = [&result](scoped_timer_res const& in) { result = in; return in; }; { scoped_timer timer(callback); timer.disable_dtor_entry(); timer.dismiss(); timer.init("", 1); std::this_thread::sleep_for(ms); timer.add_step("fin"); std::this_thread::sleep_for(ms); timer.run(); } assert_time_eq(1, result[0], 1); assert_time_eq(1, result[1], 1); ASSERT_STREQ("fin", result[1].second.c_str()); }
25.830357
118
0.622883
extcpp
0e0a5d6325e483fccf2b291a21ec1f3da9682996
2,042
cpp
C++
src/ParamGen.cpp
Jesusausage/ZKP_Voting
c98658ac533522a146b0be5a976cb215f130a4ec
[ "MIT" ]
1
2019-07-04T18:54:07.000Z
2019-07-04T18:54:07.000Z
src/ParamGen.cpp
Jesusausage/ZKP_Voting
c98658ac533522a146b0be5a976cb215f130a4ec
[ "MIT" ]
null
null
null
src/ParamGen.cpp
Jesusausage/ZKP_Voting
c98658ac533522a146b0be5a976cb215f130a4ec
[ "MIT" ]
1
2019-09-10T00:15:30.000Z
2019-09-10T00:15:30.000Z
#include "ParamGen.hpp" void generateParams() { auto ecg = GenerateECGroup(); auto base = GenerateECBase(); std::ofstream token_out(TOKEN_FILE); std::ofstream id_out(ID_FILE); CryptoPP::Integer token_keys[10][5]; CryptoPP::ECPPoint tokens[10][5]; CryptoPP::ECPPoint token_sums[5]; CryptoPP::Integer id_keys[10]; CryptoPP::ECPPoint ids[10]; CryptoPP::ECPPoint id_sum; for (int i = 0; i < 10; i++) { for (int option = 0; option < 5; option++) { token_keys[i][option] = RandomInteger(1, ecg.order); tokens[i][option] = ecg.curve.Multiply(token_keys[i][option], base); token_sums[option] = ecg.curve.Add(token_sums[option], tokens[i][option]); } WriteTokens(tokens[i], 5, token_out); id_keys[i] = RandomInteger(1, ecg.order); ids[i] = ecg.curve.Multiply(id_keys[i], base); id_sum = ecg.curve.Add(id_sum, ids[i]); WriteID(ids[i], id_out); } token_out.close(); id_out.close(); std::ofstream priv_out("private_keys.txt"); priv_out << id_keys[0] << std::endl; for (int i = 0; i < 5; ++i) priv_out << token_keys[0][i] << std::endl; priv_out.close(); priv_out.open("private_keys1.txt"); priv_out << id_keys[1] << std::endl; for (int i = 0; i < 5; ++i) priv_out << token_keys[1][i] << std::endl; priv_out.close(); PublicData pub(ecg, 10, 5); PrivateData priv(5); VoteData data(ecg, base, pub, priv); for (int i = 1; i < 10; ++i) { Voter voter(ecg, base, id_sum, tokens[i], 5); voter.setTokenKeys(token_keys[i]); voter.castVote(i % 5); Vote vote = voter.getVoteAndProofs(); KeyGen key_gen(ecg, base, token_sums, ids[i], 5); key_gen.setIDKey(id_keys[i]); Key key = key_gen.getKeysAndProofs(); CryptoPP::byte output[2445]; int n; vote.serialise(output, n); key.serialise(output + 1630, n); data.processVKPair(output, i); } }
29.171429
86
0.582272
Jesusausage
0e0bb2f4f3904d3a93316a4ef605060e6fc4bfc1
3,860
cpp
C++
SampleFoundation/Triangulation/Triangulation.cpp
wjezxujian/WildMagic4
249a17f8c447cf57c6283408e01009039810206a
[ "BSL-1.0" ]
3
2021-08-02T04:03:03.000Z
2022-01-04T07:31:20.000Z
SampleFoundation/Triangulation/Triangulation.cpp
wjezxujian/WildMagic4
249a17f8c447cf57c6283408e01009039810206a
[ "BSL-1.0" ]
null
null
null
SampleFoundation/Triangulation/Triangulation.cpp
wjezxujian/WildMagic4
249a17f8c447cf57c6283408e01009039810206a
[ "BSL-1.0" ]
5
2019-10-13T02:44:19.000Z
2021-08-02T04:03:10.000Z
// Geometric Tools, Inc. // http://www.geometrictools.com // Copyright (c) 1998-2006. All Rights Reserved // // The Wild Magic Version 4 Restricted Libraries source code is supplied // under the terms of the license agreement // http://www.geometrictools.com/License/Wm4RestrictedLicense.pdf // and may not be copied or disclosed except in accordance with the terms // of that agreement. #include "Triangulation.h" WM4_WINDOW_APPLICATION(Triangulation); const int g_iSize = 256; //---------------------------------------------------------------------------- Triangulation::Triangulation () : WindowApplication2("Triangulation",0,0,g_iSize,g_iSize, ColorRGBA(1.0f,1.0f,1.0f,1.0f)) { m_akVertex = 0; m_aiIndex = 0; } //---------------------------------------------------------------------------- bool Triangulation::OnInitialize () { if (!WindowApplication2::OnInitialize()) { return false; } // select a polygon m_iVQuantity = 10; m_akVertex = WM4_NEW Vector2f[m_iVQuantity]; m_akVertex[0][0] = 29.0f; m_akVertex[0][1] = 139.0f; m_akVertex[1][0] = 78.0f; m_akVertex[1][1] = 99.0f; m_akVertex[2][0] = 125.0f; m_akVertex[2][1] = 141.0f; m_akVertex[3][0] = 164.0f; m_akVertex[3][1] = 116.0f; m_akVertex[4][0] = 201.0f; m_akVertex[4][1] = 168.0f; m_akVertex[5][0] = 157.0f; m_akVertex[5][1] = 163.0f; m_akVertex[6][0] = 137.0f; m_akVertex[6][1] = 200.0f; m_akVertex[7][0] = 98.0f; m_akVertex[7][1] = 134.0f; m_akVertex[8][0] = 52.0f; m_akVertex[8][1] = 146.0f; m_akVertex[9][0] = 55.0f; m_akVertex[9][1] = 191.0f; // construct the triangulation m_iTQuantity = m_iVQuantity-2; TriangulateEC<float>(m_iVQuantity,m_akVertex,Query::QT_FILTERED, 0.001f,m_aiIndex); OnDisplay(); return true; } //---------------------------------------------------------------------------- void Triangulation::OnTerminate () { WM4_DELETE[] m_akVertex; WM4_DELETE[] m_aiIndex; WindowApplication2::OnTerminate(); } //---------------------------------------------------------------------------- void Triangulation::OnDisplay () { ClearScreen(); Color kBlue(0,0,255), kBlack(0,0,0), kGray(128,128,128); int i, iX0, iY0, iX1, iY1; // draw the triangulation edges const int* piIndex = m_aiIndex; for (i = 0; i < m_iTQuantity; i++) { int iV0 = *piIndex++; int iV1 = *piIndex++; int iV2 = *piIndex++; iX0 = (int)m_akVertex[iV0][0]; iY0 = (int)m_akVertex[iV0][1]; iX1 = (int)m_akVertex[iV1][0]; iY1 = (int)m_akVertex[iV1][1]; DrawLine(iX0,iY0,iX1,iY1,kGray); iX0 = (int)m_akVertex[iV1][0]; iY0 = (int)m_akVertex[iV1][1]; iX1 = (int)m_akVertex[iV2][0]; iY1 = (int)m_akVertex[iV2][1]; DrawLine(iX0,iY0,iX1,iY1,kGray); iX0 = (int)m_akVertex[iV2][0]; iY0 = (int)m_akVertex[iV2][1]; iX1 = (int)m_akVertex[iV0][0]; iY1 = (int)m_akVertex[iV0][1]; DrawLine(iX0,iY0,iX1,iY1,kGray); } // draw the polygon edges for (int i0 = m_iVQuantity-1, i1 = 0; i1 < m_iVQuantity; i0 = i1++) { iX0 = (int)m_akVertex[i0][0]; iY0 = (int)m_akVertex[i0][1]; iX1 = (int)m_akVertex[i1][0]; iY1 = (int)m_akVertex[i1][1]; DrawLine(iX0,iY0,iX1,iY1,kBlue); } // draw the polygon vertices for (i = 0; i < m_iVQuantity; i++) { iX0 = (int)m_akVertex[i][0]; iY0 = (int)m_akVertex[i][1]; for (int iDY = -1; iDY <= 1; iDY++) { for (int iDX = -1; iDX <= 1; iDX++) { SetPixel(iX0+iDX,iY0+iDY,kBlack); } } } WindowApplication2::OnDisplay(); } //----------------------------------------------------------------------------
30.634921
78
0.525907
wjezxujian
0e0c6135bb6004a72f5cf58ea0ed1409e1f9f9be
3,634
cpp
C++
src/elements/cube.cpp
jamillosantos/imu-mock
3d314e8ef37263d72fda412d6d40e522005405f8
[ "MIT" ]
1
2018-01-21T05:38:04.000Z
2018-01-21T05:38:04.000Z
src/elements/cube.cpp
mote-robotics/imu-mock
3d314e8ef37263d72fda412d6d40e522005405f8
[ "MIT" ]
null
null
null
src/elements/cube.cpp
mote-robotics/imu-mock
3d314e8ef37263d72fda412d6d40e522005405f8
[ "MIT" ]
null
null
null
/** * @author J. Santos <jamillo@gmail.com> * @date October 06, 2016 */ #include "cube.h" draw::Colour elements::Cube::lineColour(1.0f, 1.0f, 1.0f, 0.6f); elements::CubeColours::CubeColours() : _top(draw::Colour::RED), _bottom(draw::Colour::ORANGE), _left(draw::Colour::YELLOW), _right(draw::Colour::WHITE), _front(draw::Colour::BLUE), _back(draw::Colour::GREEN) { } draw::Colour &elements::CubeColours::top() { return this->_top; } void elements::CubeColours::top(draw::Colour &top) { this->_top = top; } draw::Colour &elements::CubeColours::bottom() { return this->_bottom; } void elements::CubeColours::bottom(draw::Colour &bottom) { this->_bottom = bottom; } draw::Colour &elements::CubeColours::left() { return this->_left; } void elements::CubeColours::left(draw::Colour &left) { this->_left = left; } draw::Colour &elements::CubeColours::right() { return this->_right; } void elements::CubeColours::right(draw::Colour &right) { this->_right = right; } draw::Colour &elements::CubeColours::front() { return this->_front; } void elements::CubeColours::front(draw::Colour &front) { this->_front = front; } draw::Colour &elements::CubeColours::back() { return this->_back; } void elements::CubeColours::back(draw::Colour &back) { this->_back = back; } void elements::CubeColours::colour(const draw::Colour &colour) { this->_top = colour; this->_bottom = colour; this->_left = colour; this->_right = colour; this->_front = colour; this->_back = colour; } void elements::Cube::draw() { glBegin(GL_QUADS); { // Top this->_colour.top().draw(); glVertex3f(-0.5f, -0.5f, -0.5f); glVertex3f(-0.5f, 0.5f, -0.5f); glVertex3f(0.5f, 0.5f, -0.5f); glVertex3f(0.5f, -0.5f, -0.5f); // Bottom this->_colour.bottom().draw(); glVertex3f(-0.5f, -0.5f, 0.5f); glVertex3f(-0.5f, 0.5f, 0.5f); glVertex3f(0.5f, 0.5f, 0.5f); glVertex3f(0.5f, -0.5f, 0.5f); // Left this->_colour.left().draw(); glVertex3f(-0.5f, -0.5f, -0.5f); glVertex3f(-0.5f, 0.5f, -0.5f); glVertex3f(-0.5f, 0.5f, 0.5f); glVertex3f(-0.5f, -0.5f, 0.5f); // Right this->_colour.right().draw(); glVertex3f(0.5f, -0.5f, -0.5f); glVertex3f(0.5f, 0.5f, -0.5f); glVertex3f(0.5f, 0.5f, 0.5f); glVertex3f(0.5f, -0.5f, 0.5f); // Front this->_colour.front().draw(); glVertex3f(-0.5f, -0.5f, -0.5f); glVertex3f(0.5f, -0.5f, -0.5f); glVertex3f(0.5f, -0.5f, 0.5f); glVertex3f(-0.5f, -0.5f, 0.5f); // Back this->_colour.back().draw(); glVertex3f(-0.5f, 0.5f, -0.5f); glVertex3f(0.5f, 0.5f, -0.5f); glVertex3f(0.5f, 0.5f, 0.5f); glVertex3f(-0.5f, 0.5f, 0.5f); } glEnd(); // Draws the line contour of the cube. glBegin(GL_LINES); { lineColour.draw(); glVertex3f(-0.5f, -0.5f, -0.5f); glVertex3f(-0.5f, 0.5f, -0.5f); glVertex3f( 0.5f, 0.5f, -0.5f); glVertex3f( 0.5f, -0.5f, -0.5f); glVertex3f(-0.5f, -0.5f, 0.5f); glVertex3f(-0.5f, 0.5f, 0.5f); glVertex3f( 0.5f, 0.5f, 0.5f); glVertex3f( 0.5f, -0.5f, 0.5f); glVertex3f(-0.5f, -0.5f, -0.5f); glVertex3f(-0.5f, 0.5f, -0.5f); glVertex3f(-0.5f, 0.5f, 0.5f); glVertex3f(-0.5f, -0.5f, 0.5f); glVertex3f( 0.5f, -0.5f, -0.5f); glVertex3f( 0.5f, 0.5f, -0.5f); glVertex3f( 0.5f, 0.5f, 0.5f); glVertex3f( 0.5f, -0.5f, 0.5f); glVertex3f(-0.5f, -0.5f, -0.5f); glVertex3f( 0.5f, -0.5f, -0.5f); glVertex3f( 0.5f, -0.5f, 0.5f); glVertex3f(-0.5f, -0.5f, 0.5f); glVertex3f(-0.5f, 0.5f, -0.5f); glVertex3f( 0.5f, 0.5f, -0.5f); glVertex3f( 0.5f, 0.5f, 0.5f); glVertex3f(-0.5f, 0.5f, 0.5f); } glEnd(); } elements::CubeColours &elements::Cube::colour() { return this->_colour; }
22.294479
85
0.61585
jamillosantos
97bb897a388326c6e4f0d84a8a136f3b232f9348
10,399
cpp
C++
light_caster/main.cpp
raylib-extras/examples-cpp
1cac8ea52805c03d4fd29e924c854400f8ba72ef
[ "Zlib" ]
10
2021-11-18T06:19:32.000Z
2022-03-08T04:44:19.000Z
light_caster/main.cpp
raylib-extras/examples-cpp
1cac8ea52805c03d4fd29e924c854400f8ba72ef
[ "Zlib" ]
1
2022-01-02T05:27:00.000Z
2022-03-24T04:42:40.000Z
light_caster/main.cpp
raylib-extras/examples-cpp
1cac8ea52805c03d4fd29e924c854400f8ba72ef
[ "Zlib" ]
null
null
null
#include "raylib.h" #include "raymath.h" #include "rlgl.h" // constants from OpenGL #define GL_SRC_ALPHA 0x0302 #define GL_MIN 0x8007 #define GL_MAX 0x8008 #include <vector> // Draw a gradient-filled circle // NOTE: Gradient goes from inner radius (color1) to border (color2) void DrawLightGradient(int centerX, int centerY, float innerRadius, float outterRadius, Color color1, Color color2) { rlCheckRenderBatchLimit(3 * 3 * 36); if (innerRadius == 0) { DrawCircleGradient(centerX, centerY, outterRadius, color1, color2); return; } rlBegin(RL_TRIANGLES); for (int i = 0; i < 360; i += 10) { // inner triangle at color1 rlColor4ub(color1.r, color1.g, color1.b, color1.a); rlVertex2f((float)centerX, (float)centerY); rlVertex2f((float)centerX + sinf(DEG2RAD * i) * innerRadius, (float)centerY + cosf(DEG2RAD * i) * innerRadius); rlVertex2f((float)centerX + sinf(DEG2RAD * (i + 10)) * innerRadius, (float)centerY + cosf(DEG2RAD * (i + 10)) * innerRadius); if (outterRadius > innerRadius) { rlVertex2f((float)centerX + sinf(DEG2RAD * (i + 10)) * innerRadius, (float)centerY + cosf(DEG2RAD * (i + 10)) * innerRadius); rlVertex2f((float)centerX + sinf(DEG2RAD * i) * innerRadius, (float)centerY + cosf(DEG2RAD * i) * innerRadius); rlColor4ub(color2.r, color2.g, color2.b, color2.a); rlVertex2f((float)centerX + sinf(DEG2RAD * i) * outterRadius, (float)centerY + cosf(DEG2RAD * i) * outterRadius); rlColor4ub(color1.r, color1.g, color1.b, color1.a); rlVertex2f((float)centerX + sinf(DEG2RAD * (i + 10)) * innerRadius, (float)centerY + cosf(DEG2RAD * (i + 10)) * innerRadius); rlColor4ub(color2.r, color2.g, color2.b, color2.a); rlVertex2f((float)centerX + sinf(DEG2RAD * i) * outterRadius, (float)centerY + cosf(DEG2RAD * i) * outterRadius); rlVertex2f((float)centerX + sinf(DEG2RAD * (i + 10)) * outterRadius, (float)centerY + cosf(DEG2RAD * (i + 10)) * outterRadius); } } rlEnd(); } class LightInfo { public: Vector2 Position = { 0,0 }; RenderTexture ShadowMask; RenderTexture GlowTexture; bool Valid = false; bool HasColor = false; Color LightColor = WHITE; LightInfo() { ShadowMask = LoadRenderTexture(GetScreenWidth(), GetScreenHeight()); GlowTexture = LoadRenderTexture(GetScreenWidth(), GetScreenHeight()); UpdateLightMask(); } LightInfo(const Vector2& pos) { ShadowMask = LoadRenderTexture(GetScreenWidth(), GetScreenHeight()); GlowTexture = LoadRenderTexture(GetScreenWidth(), GetScreenHeight()); UpdateLightMask(); Position = pos; } void Move(const Vector2& position) { Position = position; Dirty = true; } void SetRadius(float outerRadius) { OuterRadius = outerRadius; Dirty = true; } void SetColor(Color color) { HasColor = true; LightColor = color; } bool BoxInLight(const Rectangle& box) { return CheckCollisionRecs(Bounds, box); } void ShadowEdge(const Vector2& sp, const Vector2& ep) { float extension = OuterRadius*2; Vector2 spVector = Vector2Normalize(Vector2Subtract(sp, Position)); Vector2 spProjection = Vector2Add(sp, Vector2Scale(spVector, extension)); Vector2 epVector = Vector2Normalize(Vector2Subtract(ep, Position)); Vector2 epProjection = Vector2Add(ep, Vector2Scale(epVector, extension)); std::vector<Vector2> polygon; polygon.push_back(sp); polygon.push_back(ep); polygon.push_back(epProjection); polygon.push_back(spProjection); Shadows.push_back(polygon); } void UpdateLightMask() { BeginTextureMode(ShadowMask); ClearBackground(WHITE); // force the blend mode to only set the alpha of the destination rlSetBlendFactors(GL_SRC_ALPHA, GL_SRC_ALPHA, GL_MIN); rlSetBlendMode(BLEND_CUSTOM); if (Valid) DrawLightGradient(Position.x, Position.y, InnerRadius, OuterRadius, ColorAlpha(WHITE,0), WHITE); rlDrawRenderBatchActive(); rlSetBlendMode(BLEND_ALPHA); rlSetBlendFactors(GL_SRC_ALPHA, GL_SRC_ALPHA, GL_MAX); rlSetBlendMode(BLEND_CUSTOM); for (std::vector<Vector2> shadow : Shadows) { DrawTriangleFan(&shadow[0], 4, WHITE); } rlDrawRenderBatchActive(); // go back to normal rlSetBlendMode(BLEND_ALPHA); EndTextureMode(); BeginTextureMode(GlowTexture); ClearBackground(BLANK); if (Valid) DrawLightGradient(Position.x, Position.y, InnerRadius, OuterRadius, ColorAlpha(LightColor, 0.75f), ColorAlpha(LightColor, 0)); rlDrawRenderBatchActive(); rlSetBlendFactors(GL_SRC_ALPHA, GL_SRC_ALPHA, GL_MIN); rlSetBlendMode(BLEND_CUSTOM); for (std::vector<Vector2> shadow : Shadows) { DrawTriangleFan(&shadow[0], 4, BLANK); } rlDrawRenderBatchActive(); // go back to normal rlSetBlendMode(BLEND_ALPHA); EndTextureMode(); } void Update(const std::vector<Rectangle>& boxes) { if (!Dirty) return; Dirty = false; Bounds.x = Position.x - OuterRadius; Bounds.y = Position.y - OuterRadius; Bounds.width = OuterRadius * 2; Bounds.height = OuterRadius * 2; Shadows.clear(); for (const auto& box : boxes) { // are we in a box if (CheckCollisionPointRec(Position, box)) return; if (!CheckCollisionRecs(box, Bounds)) continue; // compute shadow volumes for the faces we are opposite to // top Vector2 sp = { box.x, box.y }; Vector2 ep = { box.x + box.width, box.y }; if (Position.y > ep.y) ShadowEdge(sp, ep); // right sp = ep; ep.y += box.height; if (Position.x < ep.x) ShadowEdge(sp, ep); // bottom sp = ep; ep.x -= box.width; if (Position.y < ep.y) ShadowEdge(sp, ep); // left sp = ep; ep.y -= box.height; if (Position.x > ep.x) ShadowEdge(sp, ep); // add the actual box as a shadow to get the corner of it. // If the map is going to draw the box, then don't do this std::vector<Vector2> polygon; polygon.emplace_back(Vector2{ box.x, box.y }); polygon.emplace_back(Vector2{ box.x, box.y + box.height }); polygon.emplace_back(Vector2{ box.x + box.width, box.y + box.height }); polygon.emplace_back(Vector2{ box.x + box.width, box.y }); Shadows.push_back(polygon); } Valid = true; UpdateLightMask(); } float OuterRadius = 200; float InnerRadius = 50; Rectangle Bounds = { -150,-150,300,300 }; std::vector<std::vector<Vector2>> Shadows; bool Dirty = true; }; std::vector<Rectangle> Boxes; Rectangle RandomBox() { float x = GetRandomValue(0, GetScreenWidth()); float y = GetRandomValue(0, GetScreenHeight()); float w = GetRandomValue(10,100); float h = GetRandomValue(10,100); return Rectangle{ x,y,w,h }; } void SetupBoxes(const Vector2& startPos) { Boxes.emplace_back(Rectangle{ 50,50, 40, 40 }); Boxes.emplace_back(Rectangle{ 1200, 700, 40, 40 }); Boxes.emplace_back(Rectangle{ 200, 600, 40, 40 }); Boxes.emplace_back(Rectangle{ 1000, 50, 40, 40 }); Boxes.emplace_back(Rectangle{ 500, 350, 40, 40 }); for (int i = 0; i < 50; i++) { Rectangle rect = RandomBox(); while (CheckCollisionPointRec(startPos,rect)) rect = RandomBox(); Boxes.emplace_back(rect); } } int main() { SetConfigFlags(/*FLAG_VSYNC_HINT ||*/ FLAG_MSAA_4X_HINT); InitWindow(1280, 800, "LightCaster"); // SetTargetFPS(144); RenderTexture LightMask = LoadRenderTexture(GetScreenWidth(), GetScreenHeight()); std::vector<LightInfo> Lights; Lights.emplace_back(); Lights[0].Move(Vector2{ 600, 400 }); SetupBoxes(Lights[0].Position); Image img = GenImageChecked(64, 64, 32, 32, GRAY, DARKGRAY); Texture2D tile = LoadTextureFromImage(img); UnloadImage(img); bool showLines = false; while (!WindowShouldClose()) { if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) Lights[0].Move(GetMousePosition()); if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT)) { Lights.emplace_back(GetMousePosition()); switch ((Lights.size() - 1) % 3) { default: Lights.rbegin()->SetColor(YELLOW); break; case 1: Lights.rbegin()->SetColor(BLUE); break; case 2: Lights.rbegin()->SetColor(RED); break; case 3: Lights.rbegin()->SetColor(GREEN); break; } } float delta = GetMouseWheelMove(); if (delta != 0) { float newRad = Lights[0].OuterRadius; newRad += delta * 10; if (newRad > Lights[0].InnerRadius) Lights[0].SetRadius(newRad); } if (IsKeyPressed(KEY_F1)) showLines = !showLines; bool dirtyLights = false; for (auto& light : Lights) { if (light.Dirty) dirtyLights = true; light.Update(Boxes); } // update the light mask if (dirtyLights) { // build up the light mask BeginTextureMode(LightMask); ClearBackground(BLACK); // force the blend mode to only set the alpha of the destination rlSetBlendFactors(GL_SRC_ALPHA, GL_SRC_ALPHA, GL_MIN); rlSetBlendMode(BLEND_CUSTOM); for (auto& light : Lights) { // if (light.Valid) DrawTextureRec(light.ShadowMask.texture, Rectangle{ 0, 0, (float)GetScreenWidth(), -(float)GetScreenHeight() }, Vector2Zero(), WHITE); } rlDrawRenderBatchActive(); // go back to normal rlSetBlendMode(BLEND_ALPHA); EndTextureMode(); } BeginDrawing(); ClearBackground(BLACK); DrawTextureRec(tile, Rectangle{ 0,0,(float)GetScreenWidth(),(float)GetScreenHeight() }, Vector2Zero(), WHITE); rlSetBlendMode(BLEND_ADDITIVE); for (auto& light : Lights) { if (light.HasColor) DrawTextureRec(light.GlowTexture.texture, Rectangle{ 0, 0, (float)GetScreenWidth(), -(float)GetScreenHeight() }, Vector2Zero(), WHITE); } rlDrawRenderBatchActive(); rlSetBlendMode(BLEND_ALPHA); DrawTextureRec(LightMask.texture, Rectangle{ 0, 0, (float)GetScreenWidth(), -(float)GetScreenHeight() }, Vector2Zero(), ColorAlpha(WHITE, showLines ? 0.75f : 1.0f)); for (auto& light : Lights) DrawCircle(int(light.Position.x), int(light.Position.y), 10, light.LightColor); if (showLines) { for (std::vector<Vector2> shadow : Lights[0].Shadows) { DrawTriangleFan(&shadow[0], 4, DARKPURPLE); } for (const auto& box : Boxes) { if (Lights[0].BoxInLight(box)) DrawRectangleRec(box, PURPLE); } for (const auto& box : Boxes) { DrawRectangleLines(box.x,box.y, box.width, box.height, DARKBLUE); } DrawText("(F1) Hide Shadow Volumes", 0, 0, 20, GREEN); } else { DrawText("(F1) Show Shadow Volumes", 0, 0, 20, GREEN); } DrawFPS(1200, 0); DrawText(TextFormat("Lights %d", (int)Lights.size()), 1050, 20, 20, GREEN); EndDrawing(); } CloseWindow(); return 0; }
24.64218
167
0.683623
raylib-extras
97bc92512489c19bd54536f23f947fe46fb8292e
591
cpp
C++
src/J/J102.cpp
wlhcode/lscct
7fd112a9d1851ddcf41886d3084381a52e84a3ce
[ "MIT" ]
null
null
null
src/J/J102.cpp
wlhcode/lscct
7fd112a9d1851ddcf41886d3084381a52e84a3ce
[ "MIT" ]
null
null
null
src/J/J102.cpp
wlhcode/lscct
7fd112a9d1851ddcf41886d3084381a52e84a3ce
[ "MIT" ]
null
null
null
#include<bits/stdc++.h> using namespace std; int r[200005][4]; int main(){ int x,y,n,a=0,q=0; bool small=0; cin>>y>>x>>n; for(int i=1;i<=n;i++){ cin>>r[i][0]>>r[i][1]>>r[i][2]; if(r[i][0]>=y&&q==0) q=i-1; if(r[i][0]<y) small=1; } if(q==0&&small) q=n; if(!small) q=0; while(q>0){ y=r[q][0]; bool gone=0; while(r[q][0]==y){ if(!gone&&r[q][1]>r[q][2]&&x<=r[q][1]&&x>=r[q][2]){ x=r[q][2]; a++; gone=1; } else if(!gone&&r[q][1]<r[q][2]&&x>=r[q][1]&&x<=r[q][2]){ x=r[q][2]; a++; gone=1; } q--; if(q<=0) break; } } cout<<a<<endl; }
16.885714
59
0.431472
wlhcode
97c34395c7e4e97ef721670fb96a4cc1f4e2fcac
2,765
cpp
C++
src/installerapplication.cpp
CommitteeOfZero/noidget
1ba0b37f7552c1659a8a7c8dd62893c9eece702a
[ "MIT" ]
null
null
null
src/installerapplication.cpp
CommitteeOfZero/noidget
1ba0b37f7552c1659a8a7c8dd62893c9eece702a
[ "MIT" ]
null
null
null
src/installerapplication.cpp
CommitteeOfZero/noidget
1ba0b37f7552c1659a8a7c8dd62893c9eece702a
[ "MIT" ]
null
null
null
#include "installerapplication.h" #include "installerwindow.h" #include <api/apihost.h> #include "fs.h" #include <tx/transaction.h> #include "receiptwriter.h" #include "win32_registry.h" #include <QFile> #include <QTextStream> #include <QStyleFactory> #include <QResource> #include <QMessageBox> #include <QScriptEngineAgent> #ifdef SCRIPT_DEBUG #include <QScriptEngineDebugger> #include <QAction> #endif class ErrorAgent : public QScriptEngineAgent { public: ErrorAgent(QScriptEngine* engine) : QScriptEngineAgent(engine) {} void exceptionThrow(qint64 scriptId, const QScriptValue& exception, bool hasHandler) override { if (hasHandler) return; QMessageBox mb(ngApp->window()); mb.setText( QString("Script error (please send this to patch developers):\n%1") .arg(exception.toString())); mb.setDetailedText(engine()->currentContext()->backtrace().join('\n')); mb.setWindowTitle("Script error"); mb.exec(); } }; InstallerApplication::InstallerApplication(int& argc, char** argv) : QApplication(argc, argv) { // Despite Q_ENUM this is apparently required for use in signals qRegisterMetaType<InstallerApplication::State>( "InstallerApplication::State"); _currentState = State::Preparation; if (!QResource::registerResource("userdata.rcc")) { QMessageBox::critical(0, "Error", "Could not load userdata.rcc (are you running " "the installer out of its directory?)"); exit(1); return; } w = new InstallerWindow(0); // we do not set these globally so that we can have unthemed dialogs w->setStyle(QStyleFactory::create("windows")); QFile qssFile(":/kofuna/style.qss"); qssFile.open(QFile::ReadOnly | QFile::Text); QTextStream ts(&qssFile); w->setStyleSheet(ts.readAll()); h = new api::ApiHost(0); _fs = new Fs(this); #ifdef Q_OS_WIN32 _registry = new Registry(this); #endif _receipt = new ReceiptWriter(this); _tx = new Transaction(this); QFile scriptFile(":/userdata/script.js"); scriptFile.open(QFile::ReadOnly | QFile::Text); QTextStream ts2(&scriptFile); #ifdef SCRIPT_DEBUG QScriptEngineDebugger* debugger = new QScriptEngineDebugger(this); debugger->attachTo(h->engine()); debugger->action(QScriptEngineDebugger::InterruptAction)->trigger(); #else ErrorAgent* agent = new ErrorAgent(h->engine()); h->engine()->setAgent(agent); #endif h->engine()->evaluate(ts2.readAll(), "script.js"); } InstallerApplication::~InstallerApplication() { if (w) delete w; if (h) delete h; } void InstallerApplication::showWindow() { w->show(); }
29.414894
79
0.662929
CommitteeOfZero
97c48b8a9788a1ab9232e0d8f1621cfa722de560
99
hpp
C++
templates/include/Quote.hpp
mcqueen256/mql4dllft
2b918da25efa8056eca967e4d40d07487f030ee8
[ "MIT" ]
null
null
null
templates/include/Quote.hpp
mcqueen256/mql4dllft
2b918da25efa8056eca967e4d40d07487f030ee8
[ "MIT" ]
11
2017-07-11T22:26:44.000Z
2017-07-20T04:14:54.000Z
templates/include/Quote.hpp
mcqueen256/mql4dllft
2b918da25efa8056eca967e4d40d07487f030ee8
[ "MIT" ]
null
null
null
#ifndef QUOTE_HPP #define QUOTE_HPP class Quote { private: public: Quote(); ~Quote(); }; #endif
9
17
0.686869
mcqueen256
97c5775757ddabd48f6c0aadaef9348ed40d34f0
7,770
cpp
C++
src/protocol/websocket/client.cpp
cysme/pump
d91cfdf3e09ebca1e90f0c1395a3b3fba1158a0c
[ "Apache-2.0" ]
2
2020-07-16T04:57:40.000Z
2020-11-24T10:33:48.000Z
src/protocol/websocket/client.cpp
jimi36/pump
d91cfdf3e09ebca1e90f0c1395a3b3fba1158a0c
[ "Apache-2.0" ]
2
2020-12-23T09:40:16.000Z
2021-03-03T09:49:36.000Z
src/protocol/websocket/client.cpp
cysme/pump
d91cfdf3e09ebca1e90f0c1395a3b3fba1158a0c
[ "Apache-2.0" ]
3
2020-11-24T10:33:35.000Z
2021-04-19T01:53:24.000Z
/* * Copyright (C) 2015-2018 ZhengHaiTao <ming8ren@163.com> * * 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. */ // Import std::find function #include <algorithm> #include "pump/transport/tcp_dialer.h" #include "pump/transport/tls_dialer.h" #include "pump/protocol/websocket/utils.h" #include "pump/protocol/websocket/client.h" namespace pump { namespace protocol { namespace websocket { client::client(const std::string &url, const std::map<std::string, std::string> &headers) noexcept : started_(false), sv_(nullptr), is_upgraded_(false), upgrade_url_(url), upgrade_req_headers_(headers) { } bool client::start(service_ptr sv,const client_callbacks &cbs) { // Check service. if (!sv) { return false; } // Check callbacks. if (!cbs.started_cb ||!cbs.data_cb || !cbs.error_cb) { return false; } // Set and check started state. if (started_.exchange(true)) { return false; } sv_ = sv; cbs_ = cbs; if (!__start()) { return false; } return true; } void client::stop() { // Set and check started state. if (!started_.exchange(false)) { return; } // Stop dialer. if (dialer_ && dialer_->is_started()) { dialer_->stop(); } // Stop connection. if (conn_ && conn_->is_valid()) { conn_->stop(); } } bool client::send(const block_t *b, int32_t size) { // Check started state. if (!started_.load()) { return false; } // Check connection. if (!conn_ || !conn_->is_valid()) { return false; } return conn_->send(b, size); } void client::on_dialed(client_wptr wptr, transport::base_transport_sptr &transp, bool succ) { PUMP_LOCK_WPOINTER(cli, wptr); if (cli) { if (!succ) { cli->cbs_.error_cb("client dial error"); return; } upgrade_callbacks ucbs; ucbs.pocket_cb = pump_bind(&client::on_upgrade_response, wptr, _1); ucbs.error_cb = pump_bind(&client::on_error, wptr, _1); cli->conn_.reset(new connection(cli->sv_, transp, true)); if (cli->conn_->start_upgrade(true, ucbs)) { cli->cbs_.error_cb("client transport start error"); return; } std::string data; PUMP_ASSERT(cli->upgrade_req_); cli->upgrade_req_->serialize(data); if (!cli->conn_->send_buffer(data.c_str(), (int32_t)data.size())) { cli->cbs_.error_cb("client connection send upgrade request error"); } // Check started state if (!cli->started_.load()) { cli->conn_->stop(); } } } void client::on_dial_timeouted(client_wptr wptr) { PUMP_LOCK_WPOINTER(cli, wptr); if (cli) { cli->cbs_.error_cb("client dial timeouted"); } } void client::on_dial_stopped(client_wptr wptr) { PUMP_LOCK_WPOINTER(cli, wptr); if (cli) { cli->cbs_.error_cb("client dial stopped"); } } void client::on_upgrade_response(client_wptr wptr, http::pocket_sptr pk) { PUMP_LOCK_WPOINTER(cli, wptr); if (cli) { auto resp = std::static_pointer_cast<http::response>(pk); if (!cli->__check_upgrade_response(resp)) { cli->cbs_.error_cb("client connection upgrade response invalid"); return; } cli->cbs_.started_cb(); connection_callbacks cbs; cbs.frame_cb = pump_bind(&client::on_frame, wptr, _1, _2, _3); cbs.error_cb = pump_bind(&client::on_error, wptr, _1); if (!cli->conn_->start(cbs)) { cli->cbs_.error_cb("client connection start error"); } } } void client::on_frame(client_wptr wptr, const block_t *b, int32_t size, bool end) { PUMP_LOCK_WPOINTER(cli, wptr); if (cli) { cli->cbs_.data_cb(b, size, end); } } void client::on_error(client_wptr wptr, const std::string &msg) { PUMP_LOCK_WPOINTER(cli, wptr); if (cli) { cli->conn_.reset(); cli->cbs_.error_cb(msg); } } bool client::__start() { // Create upgrade request upgrade_req_.reset(new http::request(upgrade_url_)); upgrade_req_->set_http_version(http::VERSION_11); upgrade_req_->set_method(http::METHOD_GET); for (auto &h : upgrade_req_headers_) { upgrade_req_->set_head(h.first, h.second); } auto u = upgrade_req_->get_uri(); if (!upgrade_req_->has_head("Host")) { upgrade_req_->set_unique_head("Host", u->get_host()); } upgrade_req_->set_unique_head("Connection", "Upgrade"); upgrade_req_->set_unique_head("Upgrade", "websocket"); upgrade_req_->set_unique_head("Sec-WebSocket-Version", "13"); upgrade_req_->set_unique_head("Sec-WebSocket-Key", compute_sec_key()); // Init bind address transport::address bind_address("0.0.0.0", 0); // Create transport dialer if (u->get_type() == http::URI_WSS) { auto peer_address = http::host_to_address(true, u->get_host()); dialer_ = transport::tcp_dialer::create(bind_address, peer_address, 3000); } else if (u->get_type() == http::URI_WS) { auto peer_address = http::host_to_address(false, u->get_host()); dialer_ = transport::tls_dialer::create(bind_address, peer_address, 3000, 3000); } else { return false; } // Start transport dialer transport::dialer_callbacks cbs; cbs.dialed_cb = pump_bind(&client::on_dialed, shared_from_this(), _1, _2); cbs.timeouted_cb = pump_bind(&client::on_dial_timeouted, shared_from_this()); cbs.stopped_cb = pump_bind(&client::on_dial_stopped, shared_from_this()); if (!dialer_->start(sv_, cbs)) { return false; } return true; } bool client::__check_upgrade_response(http::response_sptr &resp) { if (resp->get_status_code() != 101 || resp->get_http_version() != http::VERSION_11) { return false; } std::string upgrade; if (!resp->get_head("Upgrade", upgrade) || upgrade != "websocket") { return false; } std::vector<std::string> connection; if (!resp->get_head("Connection", connection) || std::find(connection.begin(), connection.end(), "Upgrade") == connection.end()) { return false; } std::string sec_accept; if (!resp->get_head("Sec-WebSocket-Accept", sec_accept)) { return false; } return true; } } // namespace websocket } // namespace protocol } // namespace pump
31.714286
92
0.563964
cysme
97c76b6ded2d81f894df6d6bec179d34d02bd5ed
5,538
cpp
C++
packages/monte_carlo/event/estimator/test/tstSurfaceFluxEstimatorDagMC.cpp
bam241/FRENSIE
e1760cd792928699c84f2bdce70ff54228e88094
[ "BSD-3-Clause" ]
10
2019-11-14T19:58:30.000Z
2021-04-04T17:44:09.000Z
packages/monte_carlo/event/estimator/test/tstSurfaceFluxEstimatorDagMC.cpp
bam241/FRENSIE
e1760cd792928699c84f2bdce70ff54228e88094
[ "BSD-3-Clause" ]
43
2020-03-03T19:59:20.000Z
2021-09-08T03:36:08.000Z
packages/monte_carlo/event/estimator/test/tstSurfaceFluxEstimatorDagMC.cpp
bam241/FRENSIE
e1760cd792928699c84f2bdce70ff54228e88094
[ "BSD-3-Clause" ]
6
2020-02-12T17:37:07.000Z
2020-09-08T18:59:51.000Z
//---------------------------------------------------------------------------// //! //! \file tstSurfaceFluxEstimatorDagMC.cpp //! \author Alex Robinson //! \brief Surface flux estimator using DagMC unit tests. //! //---------------------------------------------------------------------------// // Std Lib Includes #include <iostream> // FRENSIE Includes #include "MonteCarlo_SurfaceFluxEstimator.hpp" #include "MonteCarlo_PhotonState.hpp" #include "Geometry_DagMCModel.hpp" #include "Utility_UnitTestHarnessWithMain.hpp" //---------------------------------------------------------------------------// // Testing Variables //---------------------------------------------------------------------------// std::shared_ptr<const Geometry::Model> model; //---------------------------------------------------------------------------// // Tests. //---------------------------------------------------------------------------// // Check that the surface areas can be extracted if a DagMC model is used FRENSIE_UNIT_TEST_TEMPLATE( SurfaceFluxEstimator, constructor, MonteCarlo::WeightMultiplier, MonteCarlo::WeightAndEnergyMultiplier, MonteCarlo::WeightAndChargeMultiplier ) { FETCH_TEMPLATE_PARAM( 0, ContributionMultiplierPolicy ); std::shared_ptr<MonteCarlo::Estimator> estimator; std::vector<MonteCarlo::StandardSurfaceEstimator::SurfaceIdType> surface_ids( {46, 53, 55, 57, 58, 83, 86, 89, 92, 425, 434} ); FRENSIE_REQUIRE_NO_THROW( estimator.reset( new MonteCarlo::SurfaceFluxEstimator<ContributionMultiplierPolicy>( 0u, 10.0, surface_ids, *model ) ) ); FRENSIE_REQUIRE( estimator->isEntityAssigned( 46 ) ); FRENSIE_CHECK_FLOATING_EQUALITY( estimator->getEntityNormConstant( 46 ), 2.848516339523823717e+02, 1e-15 ); FRENSIE_REQUIRE( estimator->isEntityAssigned( 53 ) ); FRENSIE_CHECK_FLOATING_EQUALITY( estimator->getEntityNormConstant( 53 ), 9.773235727898624248e+01, 1e-15 ); FRENSIE_REQUIRE( estimator->isEntityAssigned( 55 ) ); FRENSIE_CHECK_FLOATING_EQUALITY( estimator->getEntityNormConstant( 55 ), 1.666730003051475251e+01, 1e-15 ); FRENSIE_REQUIRE( estimator->isEntityAssigned( 57 ) ); FRENSIE_CHECK_FLOATING_EQUALITY( estimator->getEntityNormConstant( 57 ), 2.594277176251208061e+02, 1e-15 ); FRENSIE_REQUIRE( estimator->isEntityAssigned( 58 ) ); FRENSIE_CHECK_FLOATING_EQUALITY( estimator->getEntityNormConstant( 58 ), 3.715085987553494107e+01, 1e-15 ); FRENSIE_REQUIRE( estimator->isEntityAssigned( 83 ) ); FRENSIE_CHECK_FLOATING_EQUALITY( estimator->getEntityNormConstant( 83 ), 6.714270351030512529e+01, 1e-15 ); FRENSIE_REQUIRE( estimator->isEntityAssigned( 86 ) ); FRENSIE_CHECK_FLOATING_EQUALITY( estimator->getEntityNormConstant( 86 ), 3.165650076907713384e-01, 1e-15 ); FRENSIE_REQUIRE( estimator->isEntityAssigned( 89 ) ); FRENSIE_CHECK_FLOATING_EQUALITY( estimator->getEntityNormConstant( 89 ), 3.165650076907712274e-01, 1e-15 ); FRENSIE_REQUIRE( estimator->isEntityAssigned( 92 ) ); FRENSIE_CHECK_FLOATING_EQUALITY( estimator->getEntityNormConstant( 92 ), 3.165650076907711163e-01, 1e-15 ); FRENSIE_REQUIRE( estimator->isEntityAssigned( 425 ) ); FRENSIE_CHECK_FLOATING_EQUALITY( estimator->getEntityNormConstant( 425 ), 8.970071513450820433, 1e-15 ); FRENSIE_REQUIRE( estimator->isEntityAssigned( 434 ) ); FRENSIE_CHECK_FLOATING_EQUALITY( estimator->getEntityNormConstant( 434 ), 4.002587201643236448, 1e-15 ); } //---------------------------------------------------------------------------// // Custom setup //---------------------------------------------------------------------------// FRENSIE_CUSTOM_UNIT_TEST_SETUP_BEGIN(); std::string test_dagmc_geom_file_name; FRENSIE_CUSTOM_UNIT_TEST_COMMAND_LINE_OPTIONS() { ADD_STANDARD_OPTION_AND_ASSIGN_VALUE( "test_cad_file", test_dagmc_geom_file_name, "", "Test CAD file name" ); } FRENSIE_CUSTOM_UNIT_TEST_INIT() { Geometry::DagMCModelProperties local_properties( test_dagmc_geom_file_name ); local_properties.setTerminationCellPropertyName( "graveyard" ); local_properties.setMaterialPropertyName( "mat" ); local_properties.setDensityPropertyName( "rho" ); local_properties.setEstimatorPropertyName( "tally" ); model.reset( new Geometry::DagMCModel( local_properties ) ); } FRENSIE_CUSTOM_UNIT_TEST_SETUP_END(); //---------------------------------------------------------------------------// // end tstSurfaceFluxEstimatorDagMC.cpp //---------------------------------------------------------------------------//
41.328358
112
0.524016
bam241
97c9998964e85bfb4e70b1f99c3c4b490be2c22a
235
cpp
C++
docs/mfc/reference/codesnippet/CPP/cmfcpopupmenu-class_2.cpp
jmittert/cpp-docs
cea5a8ee2b4764b2bac4afe5d386362ffd64e55a
[ "CC-BY-4.0", "MIT" ]
14
2018-01-28T18:10:55.000Z
2021-11-16T13:21:18.000Z
docs/mfc/reference/codesnippet/CPP/cmfcpopupmenu-class_2.cpp
jmittert/cpp-docs
cea5a8ee2b4764b2bac4afe5d386362ffd64e55a
[ "CC-BY-4.0", "MIT" ]
null
null
null
docs/mfc/reference/codesnippet/CPP/cmfcpopupmenu-class_2.cpp
jmittert/cpp-docs
cea5a8ee2b4764b2bac4afe5d386362ffd64e55a
[ "CC-BY-4.0", "MIT" ]
2
2018-10-10T07:37:30.000Z
2019-06-21T15:18:07.000Z
CMFCPopupMenu* pPopupMenu = new CMFCPopupMenu; // CPoint point // CMenu* pPopup // The this pointer points to CMainFrame class which extends the CFrameWnd class. pPopupMenu->Create (this, point.x, point.y, pPopup->Detach ());
47
83
0.72766
jmittert
97ce52b8c973ca389d67b354274bf9b4de93785e
23,632
cpp
C++
src/clustering/louvain.cpp
zlthinker/STBA
c0034d67018c9b7a72459821e9e9ad46870b6292
[ "MIT" ]
175
2020-08-02T11:48:11.000Z
2022-02-28T04:54:36.000Z
src/clustering/louvain.cpp
zlthinker/STBA
c0034d67018c9b7a72459821e9e9ad46870b6292
[ "MIT" ]
1
2020-10-02T08:42:11.000Z
2020-10-02T08:42:11.000Z
src/clustering/louvain.cpp
zlthinker/STBA
c0034d67018c9b7a72459821e9e9ad46870b6292
[ "MIT" ]
25
2020-08-02T13:04:15.000Z
2022-02-28T04:54:28.000Z
#include "STBA/clustering/louvain.h" #include "STBA/utility.h" #include <queue> #include <chrono> #include <unordered_map> #include <iostream> size_t RandomPick(std::unordered_map<size_t, double> const & prob_map) { assert(!prob_map.empty()); double sum = 0.0; std::unordered_map<size_t, double>::const_iterator it = prob_map.begin(); for (; it != prob_map.end(); it++) { sum += it->second; } double r = ((double) rand() / (RAND_MAX)) * sum; double accu_sum = 0.0; it = prob_map.begin(); size_t index = it->first; for (; it != prob_map.end(); it++) { accu_sum += it->second; if (accu_sum >= r) { index = it->first; break; } } return index; } Louvain::Louvain() : max_community_(std::numeric_limits<size_t>::max()), temperature_(10.0) { } Louvain::Louvain(std::vector<size_t> const & nodes, std::unordered_map<size_t, std::unordered_map<size_t, double> > const & edges) : max_community_(std::numeric_limits<size_t>::max()), temperature_(10.0) { Initialize(nodes, edges); } Louvain::Louvain(std::vector<size_t> const & nodes, std::vector<std::pair<size_t, size_t> > const & edges) : max_community_(std::numeric_limits<size_t>::max()), temperature_(10.0) { Initialize(nodes, edges); } Louvain::~Louvain() { } void Louvain::Initialize(std::vector<size_t> const & nodes, std::vector<std::pair<size_t, size_t> > const & edges) { size_t node_num = nodes.size(); graph_.Resize(node_num); node_graph_.Resize(node_num); node_map_.resize(node_num); community_map_.resize(node_num); community_size_.resize(node_num); community_in_weight_.resize(node_num); community_total_weight_.resize(node_num); std::unordered_map<size_t, size_t> node_index_map; for (size_t i = 0; i < node_num; i++) { node_index_map[nodes[i]] = i; double node_weight = 0.0; graph_.AddSelfEdge(node_weight); node_graph_.AddSelfEdge(node_weight); node_map_[i] = i; community_map_[i] = i; community_size_[i] = 1; community_in_weight_[i] = node_weight * 2; community_total_weight_[i] = node_weight * 2; } sum_edge_weight_ = 0.0; for (size_t i = 0; i < edges.size(); i++) { std::pair<size_t, size_t> const & edge = edges[i]; size_t index1 = edge.first; size_t index2 = edge.second; assert(node_index_map.find(index1) != node_index_map.end()); assert(node_index_map.find(index2) != node_index_map.end()); size_t node_index1 = node_index_map[index1]; size_t node_index2 = node_index_map[index2]; if (node_index1 > node_index2) continue; double weight = 1.0; graph_.AddUndirectedEdge(node_index1, node_index2, weight); node_graph_.AddUndirectedEdge(node_index1, node_index2, weight); sum_edge_weight_ += 2 * weight; community_total_weight_[node_index1] += weight; community_total_weight_[node_index2] += weight; } double avg_weight = sum_edge_weight_ / edges.size(); for (size_t i = 0; i < node_num; i++) { node_graph_.AddSelfEdge(i, avg_weight); graph_.AddSelfEdge(i, avg_weight); } std::cout << "------------------ Build graph --------------------\n" << "# nodes: " << graph_.NodeNum() << ", # edges: " << edges.size() << "\n" << "---------------------------------------------------\n"; } void Louvain::Initialize(std::vector<size_t> const & nodes, std::unordered_map<size_t, std::unordered_map<size_t, double> > const & edges) { size_t node_num = nodes.size(); graph_.Resize(node_num); node_graph_.Resize(node_num); node_map_.resize(node_num); community_map_.resize(node_num); community_size_.resize(node_num); community_in_weight_.resize(node_num); community_total_weight_.resize(node_num); std::unordered_map<size_t, size_t> node_index_map; for (size_t i = 0; i < node_num; i++) { node_index_map[nodes[i]] = i; double node_weight = 0.0; graph_.AddSelfEdge(node_weight); node_graph_.AddSelfEdge(node_weight); node_map_[i] = i; community_map_[i] = i; community_size_[i] = 1; community_in_weight_[i] = node_weight * 2; community_total_weight_[i] = node_weight * 2; } sum_edge_weight_ = 0.0; size_t edge_num = 0; std::unordered_map<size_t, std::unordered_map<size_t, double> >::const_iterator it1 = edges.begin(); for (; it1 != edges.end(); it1++) { size_t index1 = it1->first; assert(node_index_map.find(index1) != node_index_map.end()); size_t node_index1 = node_index_map[index1]; std::unordered_map<size_t, double> const & submap = it1->second; std::unordered_map<size_t, double>::const_iterator it2 = submap.begin(); for (; it2 != submap.end(); it2++) { size_t index2 = it2->first; if (index1 == index2) continue; edge_num++; assert(node_index_map.find(index2) != node_index_map.end()); size_t node_index2 = node_index_map[index2]; if (node_index1 > node_index2) continue; double weight = it2->second; graph_.AddUndirectedEdge(node_index1, node_index2, weight); node_graph_.AddUndirectedEdge(node_index1, node_index2, weight); sum_edge_weight_ += 2 * weight; community_total_weight_[node_index1] += weight; community_total_weight_[node_index2] += weight; } } double avg_weight = sum_edge_weight_ / edge_num; for (size_t i = 0; i < node_num; i++) { node_graph_.AddSelfEdge(i, avg_weight); graph_.AddSelfEdge(i, avg_weight); } std::cout << "------------------ Build graph --------------------\n" << "# nodes: " << nodes.size() << ", # edges: " << edge_num << "\n" << "---------------------------------------------------\n"; } void Louvain::Reinitialize() { graph_ = node_graph_; size_t node_num = node_graph_.NodeNum(); node_map_.resize(node_num); community_map_.resize(node_num); community_size_.resize(node_num); community_in_weight_.resize(node_num); community_total_weight_.resize(node_num); for (size_t i = 0; i < node_num; i++) { double node_weight = 0.0; node_map_[i] = i; community_map_[i] = i; community_size_[i] = 1; community_in_weight_[i] = node_weight * 2; community_total_weight_[i] = node_weight * 2; } } double Louvain::Modularity(size_t const community) const { assert(community < community_in_weight_.size()); double in_weight = community_in_weight_[community]; double total_weight = community_total_weight_[community]; double modularity = in_weight / sum_edge_weight_ - std::pow(total_weight / sum_edge_weight_, 2); return modularity; } double Louvain::Modularity() const { double modularity = 0.0; size_t num_communities = community_in_weight_.size(); for (size_t i = 0; i < num_communities; i++) { double in_weight = community_in_weight_[i]; double total_weight = community_total_weight_[i]; modularity += in_weight / sum_edge_weight_ - std::pow(total_weight / sum_edge_weight_, 2); } return modularity; } double Louvain::EdgeWeight(size_t const index1, size_t const index2) const { return node_graph_.EdgeWeight(index1, index2); } void Louvain::GetClusters(std::vector<std::vector<size_t> > & clusters) const { clusters.clear(); size_t num_communities = community_in_weight_.size(); size_t num_nodes = node_map_.size(); clusters.resize(num_communities, std::vector<size_t>()); for (size_t i = 0; i < num_nodes; i++) { size_t community_index = node_map_[i]; assert(community_index < num_communities && "[GetClusters] Community index out of range"); clusters[community_index].push_back(i); } } void Louvain::GetEdgesAcrossClusters(std::vector<std::pair<size_t, size_t> > & pairs) const { pairs.clear(); size_t node_num = node_graph_.NodeNum(); for (size_t i = 0; i < node_num; i++) { size_t node_index1 = i; size_t community_index1 = node_map_[node_index1]; std::vector<EdgeData> const & edges = node_graph_.GetIncidentEdges(i); for (size_t j = 0; j < edges.size(); j++) { EdgeData const & edge = edges[j]; size_t node_index2 = edge.node; size_t community_index2 = node_map_[node_index2]; if (node_index1 > node_index2) continue; if (community_index1 != community_index2) { pairs.push_back(std::make_pair(node_index1, node_index2)); } } } } void Louvain::Print() { std::cout << "------------------------ Print ------------------------\n"; std::cout << "# communities = " << community_in_weight_.size() << ", modularity = " << Modularity() << "\n"; std::vector<std::vector<size_t> > clusters; GetClusters(clusters); for (size_t i = 0; i < clusters.size(); i++) { std::vector<size_t> const & nodes = clusters[i]; std::cout << "Community " << i << " of size " << nodes.size() << ": "; for (size_t j = 0; j < nodes.size(); j++) { size_t node_index = nodes[j]; std::cout << node_index << " "; } std::cout << "\n"; } std::cout << "-------------------------------------------------------\n"; } void Louvain::Cluster() { size_t pass = 0; while(Merge()) { Rebuild(); pass++; } } /*! * @param initial_pairs - The end points of initial pairs must be in the same cluster. */ void Louvain::Cluster(std::vector<std::pair<size_t, size_t> > const & initial_pairs) { size_t pass = 0; Merge(initial_pairs); Rebuild(); while(Merge()) { Rebuild(); pass++; } } /*! * @brief StochasticCluster introduces stochasticity to clustering by merging clusters with some probability * rather than greedily like louvain's algorithm. */ void Louvain::StochasticCluster() { size_t pass = 0; std::srand(unsigned(std::time(0))); while (StochasticMerge()) { Rebuild(); pass++; } } void Louvain::StochasticCluster(std::vector<std::pair<size_t, size_t> > const & initial_pairs) { size_t pass = 0; Merge(initial_pairs); Rebuild(); std::srand(unsigned(std::time(0))); while (StochasticMerge()) { Rebuild(); pass++; } } bool Louvain::Merge() { bool improved = false; std::queue<size_t> queue; size_t node_num = graph_.NodeNum(); std::unordered_map<size_t, bool> visited; for (size_t i = 0; i < node_num; i++) { size_t community_index = i; if (community_size_[community_index] < max_community_) { queue.push(community_index); visited[community_index] = false; } else { visited[community_index] = true; } } std::vector<size_t> prev_community_size = community_size_; size_t loop_count = 0; while(!queue.empty()) { size_t node_index = queue.front(); queue.pop(); visited[node_index] = true; double self_weight = graph_.GetSelfWeight(node_index); double total_weight = self_weight; std::vector<EdgeData> const & edges = graph_.GetIncidentEdges(node_index); std::unordered_map<size_t, double> neighb_weights; for (size_t i = 0; i < edges.size(); i++) { EdgeData const & edge = edges[i]; size_t neighb_index = edge.node; size_t neighb_community_index = community_map_[neighb_index]; neighb_weights[neighb_community_index] += edge.weight; total_weight += edge.weight; } size_t prev_community = community_map_[node_index]; double prev_neighb_weight = neighb_weights[prev_community]; community_map_[node_index] = -1; community_size_[prev_community] -= prev_community_size[node_index]; community_in_weight_[prev_community] -= 2 * prev_neighb_weight + self_weight; community_total_weight_[prev_community] -= total_weight; double max_inc = 0.0; size_t best_community = prev_community; double best_neighb_weight = prev_neighb_weight; std::unordered_map<size_t, double>::const_iterator it = neighb_weights.begin(); for (; it != neighb_weights.end(); it++) { size_t neighb_community_index = it->first; if (community_size_[neighb_community_index] >= max_community_) continue; double neighb_weight = it->second; double neighb_community_total_weight = community_total_weight_[neighb_community_index]; double inc = (neighb_weight - (neighb_community_total_weight * total_weight) / sum_edge_weight_) / sum_edge_weight_ * 2; if (inc > max_inc) { max_inc = inc; best_community = neighb_community_index; best_neighb_weight = neighb_weight; } } community_map_[node_index] = best_community; community_size_[best_community] += prev_community_size[node_index]; community_in_weight_[best_community] += 2 * best_neighb_weight + self_weight; community_total_weight_[best_community] += total_weight; if (best_community != prev_community) { for (size_t i = 0; i < edges.size(); i++) { EdgeData const & edge = edges[i]; size_t neighb_index = edge.node; size_t neighb_community_index = community_map_[neighb_index]; if (visited[neighb_index] && community_size_[neighb_community_index] < max_community_) { queue.push(neighb_index); visited[neighb_index] = false; } } improved = true; } if (++loop_count > 3 * node_num) break; } return improved; } bool Louvain::Merge(std::vector<std::pair<size_t, size_t> > const & initial_pairs) { size_t node_num = graph_.NodeNum(); std::vector<double> weights; weights.reserve(initial_pairs.size()); for (size_t i = 0; i < initial_pairs.size(); i++) { size_t node_index1 = initial_pairs[i].first; size_t node_index2 = initial_pairs[i].second; double weight = graph_.EdgeWeight(node_index1, node_index2); weights.push_back(weight); } std::vector<size_t> pair_indexes = SortIndexes(weights, false); UnionFind union_find; union_find.InitSets(node_num); std::vector<size_t> node_visit_times; node_visit_times.resize(node_num, 0); for (size_t i = 0; i < pair_indexes.size(); i++) { size_t pair_index = pair_indexes[i]; size_t node_index1 = initial_pairs[pair_index].first; size_t node_index2 = initial_pairs[pair_index].second; if (node_visit_times[node_index1] < 1 && node_visit_times[node_index2] < 1) { union_find.Union(node_index1, node_index2); node_visit_times[node_index1]++; node_visit_times[node_index2]++; } } for (size_t i = 0; i < node_num; i++) { size_t node_index = i; community_in_weight_[node_index] = 0.0; community_total_weight_[node_index] = 0.0; community_size_[node_index] = 0; } for (size_t i = 0; i < node_num; i++) { size_t node_index = i; size_t community_index = union_find.Find(node_index); community_map_[node_index] = community_index; community_in_weight_[community_index] += graph_.GetSelfWeight(node_index); community_total_weight_[community_index] += graph_.GetSelfWeight(node_index); community_size_[community_index] += 1; } for (size_t i = 0; i < node_num; i++) { size_t node_index1 = i; size_t community_index1 = community_map_[node_index1]; std::vector<EdgeData> const & edges = graph_.GetIncidentEdges(node_index1); for (size_t j = 0; j < edges.size(); j++) { EdgeData const & edge = edges[j]; size_t node_index2 = edge.node; if (node_index1 > node_index2) continue; size_t community_index2 = community_map_[node_index2]; double weight = edge.weight; if (community_index1 == community_index2) { community_in_weight_[community_index1] += 2 * weight; community_total_weight_[community_index1] += 2 * weight; } else { community_total_weight_[community_index1] += weight; community_total_weight_[community_index2] += weight; } } } return true; } bool Louvain::StochasticMerge() { bool improve = false; std::queue<size_t> queue; size_t community_num = graph_.NodeNum(); for (size_t i = 0; i < community_num; i++) { size_t community_index = i; if (community_size_[community_index] < max_community_) { queue.push(community_index); } } size_t node_num = node_graph_.NodeNum(); size_t node_edge_num = node_graph_.EdgeNum(); size_t community_edge_num = graph_.EdgeNum(); double factor = (community_num + community_edge_num) / double(node_num + node_edge_num); std::vector<size_t> prev_community_size = community_size_; while(!queue.empty()) { size_t node_index = queue.front(); queue.pop(); double self_weight = graph_.GetSelfWeight(node_index); double total_weight = self_weight; std::unordered_map<size_t, double> neighb_weights; // the weight of edge to neighboring community std::vector<EdgeData> const & edges = graph_.GetIncidentEdges(node_index); for (size_t i = 0; i < edges.size(); i++) { EdgeData const & edge = edges[i]; size_t neighb_index = edge.node; size_t neighb_community_index = community_map_[neighb_index]; neighb_weights[neighb_community_index] += edge.weight; total_weight += edge.weight; } size_t prev_community = community_map_[node_index]; double prev_neighb_weight = neighb_weights[prev_community]; community_map_[node_index] = -1; community_size_[prev_community] -= prev_community_size[node_index]; community_in_weight_[prev_community] -= 2 * prev_neighb_weight + self_weight; community_total_weight_[prev_community] -= total_weight; std::unordered_map<size_t, double> prob_map; std::unordered_map<size_t, double>::const_iterator it = neighb_weights.begin(); for (; it != neighb_weights.end(); it++) { size_t neighb_community_index = it->first; size_t neighb_community_size = community_size_[neighb_community_index]; if (prev_community_size[node_index] + neighb_community_size >= max_community_) continue; double neighb_weight = it->second; double neighb_community_total_weight = community_total_weight_[neighb_community_index]; double inc = factor * (neighb_weight - (neighb_community_total_weight * total_weight) / sum_edge_weight_); double prob = std::exp(temperature_ * inc); prob_map[neighb_community_index] = prob; } assert(!prob_map.empty()); size_t best_community = RandomPick(prob_map); double best_neighb_weight = neighb_weights[best_community]; if (best_community != prev_community) improve = true; community_map_[node_index] = best_community; community_size_[best_community] += prev_community_size[node_index]; community_in_weight_[best_community] += 2 * best_neighb_weight + self_weight; community_total_weight_[best_community] += total_weight; } return improve; } void Louvain::RearrangeCommunities() { std::unordered_map<size_t, size_t> renumbers; // map from old cluster index to organized cluster index size_t num = 0; for (size_t i = 0; i < community_map_.size(); i++) { std::unordered_map<size_t, size_t>::const_iterator it = renumbers.find(community_map_[i]); if (it == renumbers.end()) { renumbers[community_map_[i]] = num; community_map_[i] = num; num++; } else { community_map_[i] = it->second; } } for (size_t i = 0; i < node_map_.size(); i++) { node_map_[i] = community_map_[node_map_[i]]; } std::vector<size_t> community_size_new(num); std::vector<double> community_in_weight_new(num); std::vector<double> community_total_weight_new(num); for (size_t i = 0; i < community_in_weight_.size(); i++) { std::unordered_map<size_t, size_t>::const_iterator it = renumbers.find(i); if (it != renumbers.end()) { size_t new_community_index = it->second; community_size_new[new_community_index] = community_size_[i]; community_in_weight_new[new_community_index] = community_in_weight_[i]; community_total_weight_new[new_community_index] = community_total_weight_[i]; } } community_size_new.swap(community_size_); community_in_weight_new.swap(community_in_weight_); community_total_weight_new.swap(community_total_weight_); } void Louvain::Rebuild() { RearrangeCommunities(); size_t num_communities = community_in_weight_.size(); std::vector<std::vector<size_t>> community_nodes(num_communities); for (size_t i = 0; i < graph_.NodeNum(); i++) { community_nodes[community_map_[i]].push_back(i); } Graph graph_new; graph_new.Resize(num_communities); for (size_t i = 0; i < num_communities; i++) { std::vector<size_t> const & nodes = community_nodes[i]; double self_weight = 0.0; std::unordered_map<size_t, double> edges_new; for (size_t j = 0; j < nodes.size(); j++) { size_t node_index = nodes[j]; self_weight += graph_.GetSelfWeight(node_index); std::vector<EdgeData> const & edges = graph_.GetIncidentEdges(node_index); for (size_t k = 0; k < edges.size(); k++) { EdgeData const & edge = edges[k]; edges_new[community_map_[edge.node]] += edge.weight; } } self_weight += edges_new[i]; graph_new.AddSelfEdge(i, self_weight); std::unordered_map<size_t, double>::const_iterator it = edges_new.begin(); for (; it != edges_new.end(); it++) { size_t neighb_community_index = it->first; double weight = it->second; if (i != neighb_community_index) {; graph_new.AddDirectedEdge(i, neighb_community_index, weight); } } } graph_.Swap(graph_new); community_map_.resize(num_communities); for (size_t i = 0; i < num_communities; i++) { community_map_[i] = i; } }
33.663818
132
0.609047
zlthinker
97ce6d330d558ae100db503d62572da03fa4e46a
1,593
cpp
C++
3rdparty/libcxx/libcxx/test/std/language.support/support.limits/support.limits.general/exception.version.pass.cpp
jbdelcuv/openenclave
c2e9cfabd788597f283c8dd39edda5837b1b1339
[ "MIT" ]
15
2019-08-05T01:24:20.000Z
2022-01-12T08:19:55.000Z
3rdparty/libcxx/libcxx/test/std/language.support/support.limits/support.limits.general/exception.version.pass.cpp
jbdelcuv/openenclave
c2e9cfabd788597f283c8dd39edda5837b1b1339
[ "MIT" ]
21
2020-02-05T11:09:56.000Z
2020-03-26T18:09:09.000Z
3rdparty/libcxx/libcxx/test/std/language.support/support.limits/support.limits.general/exception.version.pass.cpp
jbdelcuv/openenclave
c2e9cfabd788597f283c8dd39edda5837b1b1339
[ "MIT" ]
9
2019-09-24T06:26:58.000Z
2021-11-22T08:54:00.000Z
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // WARNING: This test was generated by generate_feature_test_macro_components.py // and should not be edited manually. // <exception> // Test the feature test macros defined by <exception> /* Constant Value __cpp_lib_uncaught_exceptions 201411L [C++17] */ #include <exception> #include "test_macros.h" #if TEST_STD_VER < 14 # ifdef __cpp_lib_uncaught_exceptions # error "__cpp_lib_uncaught_exceptions should not be defined before c++17" # endif #elif TEST_STD_VER == 14 # ifdef __cpp_lib_uncaught_exceptions # error "__cpp_lib_uncaught_exceptions should not be defined before c++17" # endif #elif TEST_STD_VER == 17 # ifndef __cpp_lib_uncaught_exceptions # error "__cpp_lib_uncaught_exceptions should be defined in c++17" # endif # if __cpp_lib_uncaught_exceptions != 201411L # error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++17" # endif #elif TEST_STD_VER > 17 # ifndef __cpp_lib_uncaught_exceptions # error "__cpp_lib_uncaught_exceptions should be defined in c++2a" # endif # if __cpp_lib_uncaught_exceptions != 201411L # error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++2a" # endif #endif // TEST_STD_VER > 17 int main() {}
27.947368
80
0.666667
jbdelcuv
97d2074f21a845e1b6b7ec12ba6a27e54cc3cf51
136,210
cpp
C++
capPaintPlayerWav2Sketch/AudioSampleYeahwav.cpp
Drc3p0/TouchSound
3748d161a3706918ce75934cd64543347426545e
[ "MIT" ]
1
2019-10-23T17:47:05.000Z
2019-10-23T17:47:05.000Z
capPaintPlayerWav2Sketch/AudioSampleYeahwav.cpp
Drc3p0/TouchSound
3748d161a3706918ce75934cd64543347426545e
[ "MIT" ]
null
null
null
capPaintPlayerWav2Sketch/AudioSampleYeahwav.cpp
Drc3p0/TouchSound
3748d161a3706918ce75934cd64543347426545e
[ "MIT" ]
null
null
null
// Audio data converted from WAV file by wav2sketch #include "AudioSampleYeahwav.h" // Converted from YEAHwav.wav, using 11025 Hz, u-law encoding const unsigned int AudioSampleYeahwav[12089] = { 0x0300BCDD,0x00020380,0x01010480,0x81808282,0x83868180,0x85878002,0x80018500,0x0003808A, 0x81000082,0x01018301,0x83820400,0x82000083,0x80810185,0x00038801,0x01800082,0x88810082, 0x84810203,0x83850300,0x81848484,0x01058687,0x02808780,0x03880205,0x84838103,0x84050085, 0x00030185,0x02818283,0x81848100,0x84848005,0x85800300,0x02020582,0x01808383,0x82018883, 0x84838184,0x81848183,0x02810002,0x00038001,0x84000186,0x028A8483,0x00868483,0x81038101, 0x81830501,0x01008883,0x81848186,0x83828600,0x84840202,0x81858280,0x82818400,0x81040285, 0x03050001,0x01038080,0x80018203,0x80850080,0x00848981,0x89828386,0x84890584,0x81838102, 0x83808385,0x82808187,0x02878284,0x01828502,0x00818200,0x03828202,0x02020283,0x01008403, 0x84010181,0x81870001,0x80818482,0x85008486,0x80858380,0x03858300,0x03858400,0x01038601, 0x85038187,0x02830481,0x04018206,0x00000284,0x01818582,0x81818484,0x81858384,0x87808681, 0x81830400,0x02020301,0x83068080,0x01850101,0x87008583,0x82870184,0x81838581,0x01008885, 0x8403858A,0x06888381,0x82838A04,0x89860386,0x86858181,0x00840481,0x83018282,0x03828000, 0x88858280,0x03878106,0x85058080,0x80018082,0x82008680,0x85068186,0x87810182,0x04888101, 0x81858201,0x86028482,0x87000188,0x87838085,0x00858501,0x81868384,0x83828883,0x80818582, 0x80850103,0x0081840A,0x87030280,0x8B810486,0x03860100,0x08838906,0x81038683,0x87850084, 0x888A8184,0x01828701,0x02820083,0x00028203,0x00848300,0x86048683,0x84838088,0x81808102, 0x02870800,0x87028103,0x01828101,0x8406848A,0x838B0586,0x00848B05,0x01868584,0x02878601, 0x02858202,0x82828602,0x81870104,0x87828082,0x80818389,0x8004868A,0x04838583,0x01028183, 0x04840305,0x03800305,0x82850503,0x83858603,0x8F848691,0x8483898F,0x05078588,0x03078085, 0x0D81040B,0x0983020D,0x81808307,0x91028188,0x89848089,0x88880484,0x81820282,0x03048101, 0x82090688,0x0D090306,0x01028581,0x828A8401,0x8D878885,0x8A8C8186,0x80878C05,0x81048083, 0x060D0500,0x00070F86,0x01848508,0x8A019000,0x83898685,0x81868985,0x86880886,0x05008005, 0x03030B80,0x0208070F,0x08810309,0x900C8B89,0x858A808D,0x01888883,0x09880283,0x00038500, 0x02000703,0x02030708,0x070A010B,0x8F020387,0x8B839185,0x86868B8E,0x03898886,0x07808881, 0x07810788,0x1004820E,0x800B0280,0x8C818282,0x8C8B8C85,0x8A849189,0x048A8586,0x81020281, 0x04801304,0x0E060610,0x030D0580,0x90880B8A,0x8E8A8788,0x80848C86,0x0F019085,0x81108492, 0x10048286,0x0C0B0802,0x8303020B,0x81900205,0x8F828B82,0x858A008B,0x89028D81,0x028D8187, 0x030B8902,0x0F050A07,0x8D040E09,0x888C840E,0x89908188,0x07908402,0x8D02878A,0x80840100, 0x010C1089,0x10060910,0x0C01870C,0x8984828F,0x89878B86,0x8D839185,0x038F8984,0x8805048C, 0x07030D0B,0x0107070A,0x04910D82,0x92098A89,0x8A8A0086,0x87878F83,0x028B818D,0x020D8100, 0x10040B11,0x0D8A0310,0x9387818D,0x89889005,0x85008F88,0x808A028B,0x85078184,0x10030510, 0x880F0506,0x128F8410,0x91018495,0x8F8E8B83,0x858E8E00,0x108A8700,0x82130281,0x0E85110A, 0x950D8785,0x048F8480,0x8581888F,0x06918388,0x8E099485,0x11860401,0x85100B81,0x10868215, 0x878E0E92,0x87028802,0x8C0A8B85,0x0B858A87,0x8A040C94,0x0E090416,0x0C901205,0x95039184, 0x038E9007,0x8485818A,0x05900687,0x84098A02,0x0D020C07,0x81061004,0x8A0E9411,0x80900B8D, 0x848A0787,0x8A838486,0x02068B05,0x08000D86,0x8F0D0306,0x068C8A10,0x02920890,0x03828708, 0x89098E82,0x06078A85,0x07030C8C,0x9210850C,0x12958112,0x82910D93,0x870A8708,0x89098202, 0x07018582,0x02820D89,0x9009030C,0x0C908607,0x8284059A,0x810F8980,0x0005850A,0x1086870D, 0x09820501,0x97108206,0x0093860C,0x83970F99,0x810D9007,0x00080081,0x0F068408,0x10000485, 0x8905000A,0x878A9512,0x069C0691,0x87858388,0x88058204,0x0806850D,0x07810E82,0x808E0601, 0x93099700,0x0E908B83,0x0109068B,0x88821001,0x8B038807,0x08850081,0x108F0787,0x90008888, 0x800F9213,0x81820F82,0x028A8387,0x85000793,0x0B05000B,0x0C0A8911,0x09910F8A,0x900C8B05, 0x88929005,0x8C899293,0x08880591,0x070C0E82,0x981B840D,0x14890A13,0x02041394,0x91048B89, 0x89018F91,0x01038292,0x07068504,0x0A961386,0x93100100,0x03070118,0x92880989,0x05888906, 0x06001087,0x910B0D03,0x87059714,0x199D108E,0x80808001,0x8E8D8D04,0x87839205,0x09890808, 0x00059011,0x11950F91,0x8E1A8406,0x0190100C,0x93038D93,0x83038890,0x070B0187,0x8D8F1492, 0x92158E03,0x110C0313,0x8A8F1192,0x928A8983,0x87850D00,0x09910F09,0x9A119500,0x13079215, 0x07871493,0x8906918B,0x0582888B,0x080A8300,0x94881189,0x94189A16,0x17901607,0x92800E92, 0x82938903,0x82858784,0x0C960A06,0x950F8F86,0x0B10921A,0x028E118A,0x87829288,0x0A8F0692, 0x921C8F00,0x16981581,0x98161091,0x84019219,0x859B0E94,0x90058C8A,0x068D1389,0x8C1A9412, 0x20961F03,0x9613868C,0x8A918380,0x92850693,0x8B888386,0x13950B8A,0x8D1B8A0C,0x068B8310, 0x898B8A8B,0x0A849009,0x82868682,0x8E128C07,0x1498131A,0x98940389,0x8892940C,0x0A8C078B, 0x01030E8A,0x1D0E1289,0x9311149A,0x89059702,0x858B809A,0x8B808289,0x11880406,0x86091909, 0x8A89911D,0x87A00392,0x8790828B,0x010D910B,0x1D051400,0x0013870C,0x03879980,0x81928DA1, 0x981B9A94,0x16828382,0x8C1E1381,0x86901610,0x889A0105,0x9B819A02,0x0E909C13,0x20810D8A, 0x19148F14,0x11858587,0x90920A94,0xA71EA50E,0x15998E81,0x8E811B98,0x12860912,0x0E88188B, 0x8682100C,0x9718A315,0x22938485,0x8E8382A1,0x09889985,0x81000991,0x8F030717,0x881A9D21, 0x23A41316,0x86938B96,0x118C9583,0x0A808291,0x00010687,0x9A20971C,0x169D8211,0x819A13A0, 0x19898A0F,0x03841091,0x1B83051C,0xA721A211,0x149A9C14,0x00931AA4,0x07010304,0x19821B86, 0x1C961315,0xA70F9F97,0x8614AB19,0x10971D9C,0x1A1B8D0A,0x108B2488,0x1A959D18,0x91A30CAC, 0x9E22AD0F,0x1618930F,0x10221E0E,0x1D931717,0x9F0D9C92,0x21AD019E,0x96018CAE,0x19190112, 0x981F1D87,0x1310041F,0xAD1E1091,0x8991A322,0x069520A5,0x9C17018D,0x848B1603,0x92201206, 0x1EAA2981,0xA8249401,0xA012A223,0xA082918C,0x038D0514,0x9C021B0D,0x28819530,0x0FA11F9A, 0x09979B00,0x839A129E,0x8D85A017,0x30A4121B,0xAC2AA495,0x2184A924,0x031B19A0,0x25169525, 0x1D0C1A9D,0xA92AAB91,0x0FA98DA7,0x86070CB1,0x220A2296,0x0530211A,0xA51E1A04,0xA8A81EA3, 0xA704A08C,0x129F1A8E,0x11292120,0x988C2A23,0xABA4121A,0xA1A1AD26,0x12B281A1,0x200E0D0C, 0x1F973013,0x8922A42E,0x298BA52C,0x1AA900AD,0x9E19AB98,0x23A5868E,0x20149688,0x241B8C0B, 0x992B979B,0x95138617,0x819C8F99,0x180E8C9E,0x8019208F,0xA7300292,0x11B12F92,0xB21DA5A2, 0x1B040692,0x0A1F32A0,0x8622291B,0x99B43481,0xB827C026,0x0CB00AA4,0x8F2C8C08,0x31903826, 0x8B09902E,0x28B9A60F,0xB59698BC,0x250DB233,0x3382341B,0x1930AC38,0x1CBB02A8,0xB22DC39C, 0x38C02FB0,0x2F389E27,0x3005322D,0xAA10A623,0x0DA9B598,0x9DBD30C4,0x1C3ABB37,0x2B9A3B94, 0x8030AA34,0xA1A80110,0xB0B421A8,0x1F2DC143,0x21BA3CA6,0x221EB338,0x20B932A2,0x2FA5B61A, 0xB343C522,0x3AB42580,0x1C37B502,0x37B32AA3,0x9429A1A1,0xBF9B31A8,0x2B11C145,0xB2AA40BE, 0x289BA73B,0x1BA53AA6,0x3B16B41F,0xC83834CA,0x3490A641,0xB32823B8,0x311CAB3A,0xC0AA30B8, 0x50C1C34B,0x869429C3,0x42AEB63A,0x9F10869E,0x2DBFA739,0xB1C135B1,0x2A21C750,0x8BA02421, 0x9FA7933B,0x9AB5A227,0xB337B5AD,0x33BF4CBC,0x10412816,0x94943EA3,0xA725B493,0x3A1DB3C2, 0xB54900CC,0x3842841A,0x2037B1AD,0x1129BFC0,0x382ABCBA,0x454CC72D,0x472F38AF,0x2DA4BFAE, 0xA2B4C5C9,0x119BC0B4,0x53B19D43,0x2D3D3029,0x13B2B941,0xABB8B7BA,0xB3A90BA5,0x83BD4530, 0xB1248D4C,0xC9A90320,0xB2B127A2,0x92244421,0xCF3450A9,0xBAAF2747,0xD1AF36C5,0xA2233194, 0x92434630,0xC84E3411,0xB1C747B4,0xB7B6A0C3,0x302417B7,0x2F3B3921,0x403AB38F,0xA02128D1, 0x4039C08A,0x3C45B3A4,0x812DB5A2,0x46B8CBBA,0xB652D1D0,0x45422699,0x36412C21,0x0714A891, 0x9DC4B4B0,0x252CC932,0x22B64204,0x9EC29440,0x04B8AD19,0xA2C1063B,0x51C5B954,0x32A41D31, 0xA9C3A133,0x98B3A015,0xC092BB2F,0x43D246A1,0xA741A327,0x9E983D2F,0xAE382E37,0xCEA740B4, 0xC8C44DB2,0xB634A54C,0xC5112CA1,0xC0B53B90,0x00B53131,0xC3284DA8,0x28209652,0xBC9530B7, 0x37BDA994,0x2E32B3AC,0xD054B4BF,0x37C13D03,0x293AA1AA,0x9144B1BF,0x944514BB,0xC153A5C0, 0x36B64CC6,0xAD43B198,0xAB9B3CCC,0xB0392C11,0x9B41BA8B,0xB3A143D2,0x13A1A330,0x3523B404, 0x443AA246,0x3A3DC18B,0x960A44D2,0x42BCC13A,0x2E21CFC3,0x3823C0B2,0x4D2BCAB9,0x2F4B37CB, 0x34412032,0x2D45B426,0xAC982813,0x44BDD3B2,0xCA2C1AD7,0x99BB2122,0x4110083D,0x3D223946, 0x53A0AF2A,0xC23623C3,0x0DC5C044,0x2DC3CE26,0xA1B6BE9C,0x54A0B997,0x3151B2B8,0x493C2C30, 0x2439B81F,0x80C0B0B0,0x49B0C4BA,0xCF50BAD7,0x993035AE,0x2D2F261C,0x37342E22,0x412CAC32, 0xC63921C6,0x94BD3638,0xA4BCC534,0x1E8284B6,0x51C3BB25,0x1043BCC8,0x46238045,0x30A0C333, 0x38212605,0x4E37D121,0xAE48A1D8,0x9823A4A7,0x2EB0CCAC,0x3C27170A,0x084CC0C6,0xAA4352CF, 0x2A233345,0x3A31C398,0xC0062A29,0xB89FCE9E,0x8EC644CA,0x2AB2C13E,0x3B43B4B4,0x489C4049, 0x374FC934,0x3FB545B3,0xB4B8CBA5,0xA412C2C4,0x1EA2C996,0xB156C0D0,0x49365112,0x42279935, 0x3540341A,0xCA9C1AB7,0xDA332AD5,0x9EC63033,0x40A2C0B3,0x81443D87,0xA5234442,0xC2915801, 0x21B1C256,0xB529C6CC,0xAEC719C4,0xB5B8C6A8,0x49B14F2A,0x9046874D,0x8C4533A4,0x85940913, 0xC0A8C5BE,0x40C332A2,0xC21BA0AA,0x9B2E4026,0xA23CA221,0xB01992B7,0x49A6B849,0x95A4A3C6, 0x21243D35,0xBB288E1C,0x29B30CB7,0x373BCD4B,0xBFAFA8CF,0x1CBA2430,0x9A823792,0x50A63B34, 0xB152BD3F,0x20A61DB9,0xC4BDB881,0xC0CAA9B9,0x539BBB30,0xC34A35C2,0x47434034,0x0AB03941, 0xB3C7C333,0x3039CE1B,0xC6BC43D1,0x362026A8,0x431BB137,0x4923B236,0xCD549FB2,0xBACE4680, 0x33862A2A,0x20ABCCB2,0x3833BAC2,0xD03E51C2,0x85C4B44D,0x39434232,0xAE3D00BC,0xB238B2C0, 0xB2CB57AF,0xB1BCD048,0xC1343083,0xC93534C5,0xB7383EAC,0x52CA4A51,0x1836970D,0xD09D4742, 0xCDCD18C0,0xBD1CA4C3,0x36B3C04A,0x44079CC7,0x81305251,0xBBC24740,0x45AB2616,0xCA49D123, 0xA0BFB5D3,0x85C2B13B,0xA3B52023,0x54413D31,0xC14838B9,0x45428D95,0xC0B1B93F,0xB6CFC1C0, 0xAA4F15A0,0xC2CF44C5,0x5242AEB9,0xAD493933,0xA4BAA926,0xC2504C15,0xBBCAA745,0x3540B5D2, 0xBCAC31C4,0xA9A2C2B9,0x28945A2C,0xB134C64C,0x215544B0,0xC3CC3E19,0xBAC5D0C0,0x3AC54E4E, 0xCDC4C5BA,0x345450B6,0xB4BA454D,0x45C6BBBB,0x4144B460,0xDBD1ACD1,0x349245B2,0xAEC90736, 0x5EBECBC2,0x265FBB55,0xC0C822B0,0x30205342,0xCAD5D02D,0x5C37D6D7,0xC84E44B5,0x94CCC5B8, 0x52565252,0xC3D4B64B,0x515BD3D5,0xCE1A5FB8,0xBFD8D9C7,0x425344A3,0xC8D0C221,0x435A11D2, 0x3D305A5B,0x92B1C8C3,0xB04C53AA,0xDBE2D5C4,0x46253BD5,0x152CAD63,0x2901C0D0,0x46586454, 0xDCE0D13B,0x51B945CF,0xD4A3105B,0xD0C7DADA,0x4E515F4E,0xD1DCC24B,0x65AB2154,0xC7262959, 0xD2C9D2D7,0x11465632,0xCDE2DBA0,0x6549CB52,0xCE224B51,0x12C7B3CE,0x25566155,0xD1E4D7B2, 0x5155D9B3,0xDABF3E50,0x45D6CEAF,0x4E5B6055,0xC1E0CA26,0x475ABFC3,0xD9BA425A,0xA5D5DCC8, 0x34525831,0xBEC7D4A9,0x575940D1,0xB18A4C5F,0xC0D0DFC4,0x444B474B,0xE0B6D7C2,0x544D48DB, 0x3E41524F,0x37A6D2D2,0x485A3F44,0xE9A1C1CA,0x43BF4FD2,0xC03A4A4B,0x420EC7D8,0x51595036, 0xE6CAA191,0x4CB2382D,0xC6184A50,0xA9C6D2E0,0x535B5222,0xE2CB4BAC,0x518184AE,0xB7395357, 0xC1D1D6D4,0x525242C6,0xC9DF4446,0x5432CCB8,0xB64B5253,0xC9CECEC6,0x265342A3,0xAFE03550, 0x2D4026DA,0xCC405953,0xB0CAD5C6,0x5954321B,0xC1DAC25D,0x5305C6E0,0xBB435E45,0xD2D4D8BD, 0x5A5147A5,0xB6BEC35F,0x0BA3D2E1,0x41265F55,0xB9D9D60B,0x6042BDCA,0xBD43CB57,0xB347B6DE, 0x20405738,0xB3C6CEB6,0x613FA2BB,0xCFB1D037,0x2C49B6D7,0x2D2B5357,0xB6D0D9C8,0x634F4398, 0xE2A1883F,0x4637C5DE,0xA24E584B,0xCED9DE24,0x67529E19,0xDC084433,0x2AA5C0D8,0xC9525451, 0xC3DED12F,0x614EA7C3,0xD2A94F3E,0x3434CFD4,0xB851524D,0xD1D4C9B2,0x415E14B9,0xCCCE4D83, 0x494DB6DD,0xB4565646,0xB2C9DEC7,0x566225BB,0xD0E12743,0x4635D2E2,0x3C53605B,0xC0D8E0B2, 0x5B6593D3,0xCAD24B57,0xC1D0D5E1,0x483E6254,0xCED5D623,0x49600FCC,0xC4A74F5B,0x982ACFDB, 0x3C475380,0xD2CDD4C3,0x505943C9,0xC0C08C52,0x4645C7D6,0x974F5946,0xCEDAD7D1,0x545155C9, 0xD8C6A85F,0x5134D5E0,0x415C6050,0xE0E3D5BB,0x504B5DD6,0xD2CD4366,0x0EB7DCDA,0x3E626241, 0xDCDABE26,0x442050DE,0xAA1B4963,0xBB12E0DC,0x0A545205,0xD1D0BB4F,0x4D4558CB,0xBFA9AF4E, 0x3B4AD8DE,0x0351514F,0xD5D6DEC1,0x62495ACB,0xD8A44C5E,0xAD30DFE2,0x4C5B5B4D,0xE1DED534, 0x65383CD4,0xC3444054,0xB9C3DDD6,0x31525B53,0xDCDAC73C,0x64C039C3,0xC7A03C5B,0x0795DBDC, 0x3F565C4C,0xE1DFC340,0x68B288B5,0xBA472151,0xD3CED4E0,0x2C575F58,0xE1D7313C,0x65A6BAAE, 0xC9402F4D,0xBD92CCDC,0xBC505151,0xDBE19F31,0x6444A146,0xD4284251,0xA7C1D8DE,0x33596157, 0xE2E1D0A3,0x6540B3B4,0xC948485D,0xC6C3DBE1,0x50605444,0xDEDFBB3E,0x61A4D22E,0xD0434C51, 0xBA02D4D7,0x32575743,0xD6DFBC2D,0x6327D32F,0xCAA34E5C,0xD1B1DCE0,0x4E616141,0xD6D9C382, 0x62B4D8A6,0x15403E5A,0xC8D4D8C9,0x3B5B4D06,0xD5D6323A,0x60B8C128,0xC12E0F57,0x2FB2DAD5, 0x40585947,0xD9D6D2C6,0x6926CCB0,0xC1373B62,0xC3DDE1DF,0x5A63634E,0xE6E29449,0x613AE1D4, 0x405F6357,0xD3E2E3D3,0x615343C1,0xD4D1415F,0x51DBDDAB,0x34524252,0xAAD7B1B6,0x394F4DA4, 0xD4D0B7AA,0x64ADC194,0xC9034B5B,0x97D2E4E2,0x62616444,0xE7E5C544,0x64BFD6D0,0x37576166, 0xE3EDDFDA,0x616457B1,0xE1CD5157,0x60DAE1DC,0x54585B5D,0xD5E4D3B7,0x56494382,0xE1AD1A48, 0x63D1C2C8,0x3F4D5551,0xC0E3DCD9,0x5C605751,0xEADFB758,0x60B8CDE5,0x45626564,0xE5E7E5E2, 0x6B6556C4,0xE4A54266,0x4FE7E1E6,0x506B654F,0xEAE0D03C,0x564B32D8,0xD7485463,0x3EDDB5DC, 0xB25D5253,0xE4D38DD3,0x4D5F473A,0xE1C81D52,0x62C0BEE3,0x46615A63,0xF0E8E5D4,0x655B673C, 0xEAC55364,0x1CD1E1F0,0x616E6769,0xEDE6E0C5,0x61498BE2,0xC8B66172,0xE0E0D9EB,0x62675F4F, 0xE5C2C04C,0x504324E3,0xA8BF5358,0xBFB7E4CD,0x3C4A5C5E,0xDEDFC794,0x5A6059D8,0xE01B505C, 0x55CEEBE8,0x5D66625A,0xE5EDE049,0x6360B1E3,0xD849656D,0xDEDEECE3,0x696C600E,0xE0E39A50, 0x5D47E7E6,0x3A5F6163,0xC8DEEBC9,0x535057A9,0xE3994F54,0x6251E4D8,0x3457354A,0x40D9E2D3, 0x51605443,0xE6E4CE51,0x610DAED1,0xCC605F60,0xC9E4E4E5,0x636C5A4B,0xE5DC3158,0x64DAEBE7, 0x5C5F5D6F,0xEBEEDDD8,0x675C4C2E,0xE0AA6464,0x44E2E2E4,0x6957564E,0xEAE3D412,0x60D24340, 0xC8485C5D,0xB2E1CADB,0x49545451,0xE139D4C3,0x56C762CF,0xAFA59D53,0x149DD0D6,0x3F4A5556, 0xE5E3D82D,0x39506DD2,0xE0223B65,0x40B7E2E3,0x52646351,0xE5E1D211,0x4F56A1E3,0x24315B6D, 0xD3E4E1DE,0x5D645CB1,0xE3D24C52,0x4B46D1E4,0x5E5F62BA,0xCEDCD9D5,0x654CD3C7,0xC8964C54, 0x50D3D0D9,0x2453458B,0xD71C35AE,0x5243B7BA,0x013D34BE,0x4537B1DC,0x4254C54E,0xCED4CCCC, 0x54AF464F,0xDAA74845,0xC539ADDA,0x5D4B4D51,0xC1BFD2C0,0x5D41D6D7,0xC644465A,0xD7CCD1C3, 0x443B578E,0xC1C4C162,0xBF42E0D1,0xCB6661A7,0xD3B7BCB0,0xBA5830DB,0x21425057,0x3FC9E2D0, 0x425342A9,0xCFC74047,0xB545B7D8,0x2A286341,0xD1D3CFAA,0x4D5D47D3,0x4A478BBB,0x57BCE0DA, 0xB052413A,0xCDE2C858,0x51AF1F35,0xDA4E4B50,0xD4AA94DA,0x56603952,0xD2D6B4D1,0x4A3839C7, 0x8957254D,0xDAD2D6D7,0x61C3625B,0xE5DCB84D,0x27489BC0,0xC853535E,0xD1D2CDD7,0x5B6352D2, 0xDDCAB956,0x56BAE3C9,0x5951485B,0xDADAD6BE,0x3E5640C2,0xE5A16824,0x42B0C7CD,0x62562287, 0xC7CDD3C4,0x61A1C0C4,0xE19AB35A,0x9CD90A28,0x50BD5855,0xC9D0C939,0x2F4034C2,0xC8D45360, 0x54C8C0E5,0x484A5A37,0xB0DDDD45,0x564318C2,0xE0CD6455,0xD3D5D3C1,0x17606222,0xD4CEB950, 0x4F55C0E3,0xB1674E0F,0x2CCCB0E4,0x50BEB4A5,0xB2DBB068,0xBECE9EB5,0x4933474A,0xD156C8D3, 0xB6953C07,0x56BCD14E,0x232CC912,0xD2C6274B,0x5A25D343,0xC2263F02,0xD0DC1F35,0xB5515243, 0xDA9D4241,0xC32C4CE4,0x11525262,0xC7C8D4C7,0x5849B0C9,0xCBCB4D60,0xC63CDFE2,0x41596834, 0xDFDB1F1F,0x6043A6CD,0x52493548,0x4CD7E9E1,0x335A0B52,0xE5D24958,0x55C508A8,0xC0534859, 0xDFAEDCE1,0x5C335B56,0xE03E3FD2,0x52223DD6,0x414D4858,0xCAD8E5D4,0x445E62C3,0xE1B02A45, 0x483CD0DF,0x3C5E5C58,0xC3D7DFD0,0x7051CDD4,0xD53DB32A,0xAADFC6C6,0x51475260,0xC1E0D335, 0x4F2B2AB4,0xB260D254,0x4FC0C3E5,0x5BA94F46,0xC2E1D64C,0x43353AB1,0xC9D66047,0xCCC788C7, 0xCE5A5C2E,0xCEC64BA3,0x5654CACE,0x3862C7B3,0x08D6C7DE,0x5A319954,0x17DBC941,0x38C3AB20, 0x5CD43B48,0xC54CD945,0x5028ADC7,0x15D0372F,0x41ABD551,0xC8D0B543,0x55DC3C5E,0xD6B3274A, 0xE09957C9,0x844F4956,0xCDA7CAC1,0xBD6233CB,0xC2C25139,0xC2C8D8B8,0x4F505751,0xE0CF0FB8, 0x6681CEC1,0xD85D494A,0xD5DFCED2,0x613DB95C,0xE2C1D163,0xB8DCA6B4,0x550A5E66,0xE2D5CEBB, 0x334750C8,0x8A11315C,0x21CBB9DA,0xA5624B9B,0xD5D6AE48,0x5048C3A4,0xE0C15147,0xBBC654DD, 0x5A535050,0xE051D0E0,0x5D4940D8,0xBB033A5E,0xD8DAD8E0,0x4E466454,0xD6DC3354,0x4342A9E5, 0xA1546647,0xD8C8A6D5,0x5E2DB4D0,0xE05C2052,0xB0DE83C7,0x4D5D4A31,0xC44236D2,0x4323A9C9, 0x68BAD1AF,0x8151D2E0,0x3FB4B296,0x1F3ABC41,0xB638A934,0xD7C83E24,0x288B59C2,0x9948CA3C, 0x2C59C2DE,0x44524DA7,0x43C3D6C8,0x9A5AD8C9,0x0BD65756,0x5031E3CB,0x4A5749BC,0xD5D33632, 0x5EC2CBC5,0x4448D157,0x44D6E543,0x55CEA058,0xD8D3025F,0xB9C20A8D,0xCFAF6847,0x4BC7E488, 0x585951D1,0xD7C5B43D,0x4FC6C9CB,0x5663444D,0xDDE1C0E0,0x5C5D42CD,0xC024345E,0x37DBE1DE, 0x47525652,0xBDE3CE5F,0x4AC1D8CC,0xBC816266,0xD7E59AC4,0x45455745,0xEB404F2C,0x30BA1D87, 0x5C533F31,0xCD9DD9D3,0x5594B444,0xB4E0AE60,0xC50FD341,0xC7395251,0xD13FC1BC,0x44523A87, 0xD720ADA3,0x29C661D5,0x9842B65D,0xE1B3C7D6,0x474E65AF,0xDBBBBA57,0x5257D1E5,0xAB5A651B, 0xC4DBDEBB,0x5F439CD8,0xD2234665,0xD2D7D5DC,0x624D5860,0xDCD5C41F,0x314245DE,0x4756554B, 0x39B1E0E4,0x4F65B5CB,0xB8DD2C52,0x5730DDCB,0xAD53514F,0x8ACAD4DB,0x5C53A99F,0xBA96DB59, 0x50A8D5DB,0x41395B59,0xCBE8DF36,0x551E5546,0xEAC0604A,0x43DBC9B1,0x4A636039,0xE1DDA5C6, 0x65B2C2C1,0x1DBB3861,0xD1DFE1C8,0x514E5E55,0xE4DE3A5B,0xA53C94C3,0xB95C5A49,0xDED94EE4, 0x5B5EB52D,0xE0553921,0x3E83ADE2,0x14525253,0x95C1D0D7,0x366037D6,0x16B7102B,0x5332DBC5, 0x3D594030,0xE0D7D6C2,0x60CC5F4A,0xE0B14253,0xCF45A5E1,0x46546052,0xC3D7DC1C,0x6C5ADDDF, 0xD64D5148,0x4FDAE9BE,0x5B5E3056,0xE1D6BF4F,0x932FD3D3,0x50545F58,0x21D7E2D5,0x605D42D5, 0xC5D34658,0x58D5E2D0,0x5656214F,0xDBE04EDB,0x582EB144,0xCD9A4E55,0xC5D5B7C9,0x87495552, 0xCEEECA56,0x4F02CC59,0xE2306451,0xDDD224B5,0x445B5C42,0xDA3EC634,0x54C737E4,0x3B524553, 0xCECADCBA,0x515552C3,0xE0D23352,0x48DD40AA,0x92654042,0xD0C0AADE,0x5C5C98DA,0xC1373E4B, 0x4049D8E3,0x1D4D5DA9,0xA2D4BFBD,0x545FE1C0,0xC82E4C4B,0xD2ABD6D3,0x5F216053,0xD0DDDE43, 0x54BDD630,0xBEB96261,0xCFD1D2D2,0x636153CE,0xD8D05030,0x61E4E1D5,0x5C575260,0xD6DEE090, 0x4F5296D4,0xD2D16761,0xE1DAD6A2,0x4B6D59CC,0xD0CA404A,0x5746E7E3,0x655B4947,0xE1CCD6D3, 0x45A010D0,0xA2D36364,0xD4CFE036,0x415650B6,0xE1985F39,0x3142D4D0,0x5040BA8D,0xC0C8C85D, 0x20C0B638,0x4CB92245,0x2437DF38,0xD9B05134,0x49C840C0,0x44414621,0x30B4CE31,0xC03209D3, 0x2B184855,0xD2C1C4C8,0xC16352D8,0xA82C4053,0x9FCBD8D6,0x584C0960,0xD543CACC,0x2D4AC3E2, 0x4E9C585C,0xE1D7C8C7,0x5D614EC1,0x953C4AB7,0x36CFE1E1,0x6524514B,0xDBDCD357,0x48BFC6D5, 0x50D16466,0xD8E1E249,0x535747C8,0xCF455156,0x2ECBE0E0,0x674B2F44,0xD5AED852,0x8CB3C7C8, 0xB444595D,0xD5C3C9D5,0x004C4A3B,0xE21A5783,0x4C91B9AD,0x425A4C15,0xE3D9D1D0,0x5008574C, 0xDED35A51,0x48C7D48B,0x3B5B5918,0xD4C5BCA9,0x579EB9D7,0xD0524D51,0x35B0DBD5,0x585654C4, 0xD1D6C543,0x4F55C3D3,0x42620711,0xBBDED7DF,0x62044D42,0xD0CFC463,0x52B5E2D8,0x5254565B, 0xE9CDAED7,0x614212C1,0xC852285A,0xC2DFDBD9,0x62505853,0xE8D9CC56,0x4ACD41C1,0xE3626651, 0xE0E1B4D0,0x5E5454AD,0xCD40205D,0x47D2DEE8,0x4060555F,0xCEEAD454,0x494B2FDC,0xC200605E, 0xC4D3D1CF,0x66623DC9,0xB194C7B9,0x513FDEE5,0x1136595A,0xC6E2D742,0x503F1A4A,0xDD48324E, 0x12DA3EDB,0x45555353,0xCCC6C8C2,0x52532ACF,0xDBAA4A50,0xC9D735DD,0x4E6A945B,0xDEBFBBD4, 0x574C1FD7,0xB3524E60,0xD2DAE3DB,0x6C6220AA,0xD8CD50BB,0x4BD8DDDA,0x55595A63,0xD9D7C2C1, 0x64C1D6E1,0xB1BC526B,0xD7E6E041,0x545E563C,0xDBCC5055,0x28DED5D1,0x63392363,0xE2B1D318, 0x43443ED1,0xC19C5B5C,0xD9CFDCC6,0x12515F48,0xE162ABC2,0x564544E7,0x5E50859F,0xCDBFD7C3, 0x4A5352E0,0xD3C03848,0x37D651D6,0xA1528955,0xD0372CC2,0x445DBED1,0x303DA23A,0x46E4E1C2, 0x5950C666,0xE1D9303D,0x5CC6B5C7,0x424C5457,0xDADABFCB,0x604DC1C8,0xD138574B,0x1FE3DACD, 0x58532E5C,0xE0C53645,0xCEC13AC2,0x48455744,0xD6D7CA93,0x51513CB5,0xD1285042,0x1B32CDD1, 0x49153A3E,0xD54BD644,0x503BB9D5,0x46474535,0x92C3D4B6,0x514B33BE,0xD214C12B,0xC8CA62E3, 0x32444E51,0xA0A7D09D,0x51468CC3,0xCDC03F42,0xDDD1A4D3,0x49394866,0xD5C02034,0x343634D5, 0x3E545052,0xAFD2DCD1,0x6923D5B2,0xAF3BB634,0xC3DDCDA0,0x5E254A57,0xC8D9C151,0x5C17D9A6, 0xBC5A23C0,0xC4DD46C2,0x5409C347,0xDCB74455,0xC9DE2635,0xD6575D51,0xE13453C2,0x4E5DC5D2, 0xA3614AD2,0xCFC8AED3,0x524440C6,0xC2C43653,0x30C391DB,0xBF535715,0xC71D34AD,0x5448CBDC, 0x6348C346,0xC5DEE8C4,0x584A2860,0x02D7D054,0x40C6D3C0,0x21445353,0xE2B99C15,0x6737B4DA, 0x422E484A,0xCDD6E2C6,0x51335450,0xE4DA4C5C,0xBAD846C6,0x30674A3F,0xD4CEC632,0x524942DF, 0xBF4D5150,0x46D6E0D7,0x2E46CD5D,0xE1CE6322,0x3949C8D4,0x44625343,0xD4D4D7D6,0x5D6030C9, 0xDBBB56C9,0x4DE4D138,0x5A564754,0xDDD7BB27,0x3A4026CD,0xDB556145,0xBED9D5CC,0x5E5FAB44, 0xDDCC1B53,0x43BFD5D3,0x59585150,0xC9DFDE3B,0x6457D7E0,0xB438624F,0x31E2E2C0,0x61498735, 0xB9CBC35A,0x8BBBD5DC,0xB15E5A3F,0xC3E0CD4C,0x3E40A4C0,0xD5C65E60,0xE0C7C8D1,0xA5536454, 0xDBC14FC9,0xAF61BDDB,0xB35A61B2,0xD6D0CACB,0x66534ED8,0xD4BAC443,0x41C6D0CC,0x2F576036, 0xCCD1C6A2,0x65A7D9C7,0xB255BC61,0xC7E8DECE,0x62503B60,0xDEDBB25F,0xB8C5B5D5,0x4A615855, 0xE1D440D5,0x6D31D3DF,0x39574458,0xD4E3DFD4,0x424B5841,0xDAB3574F,0xA4D1DCB8,0x5A642944, 0xD5D6319F,0x5A25D6C7,0xC5BA4754,0xC2E1C554,0xA440529B,0xDD535ABC,0xA6B9ADC0,0x475E4DC3, 0x48C7C1D1,0x385FC7DA,0xD3B09E35,0x45CA5022,0x2656CEC1,0xCD4709B9,0x5364D4D5,0x3E2C45C5, 0x21DCD6C9,0x55A5B860,0xD4CF4B39,0xC4DFA5B1,0x4330635B,0xD5C4C849,0x8ACBA7D4,0x17415163, 0xE0E1B83E,0x5CC00B2F,0xB63B2265,0xDBA5A3D4,0x604043CF,0xD336B047,0xBAC4BAD1,0x59604787, 0xD09513D1,0x53C1D2C5,0x5052BB52,0xC1C4BADA,0x4E40C2AB,0xD1504F4A,0xC3D5CBBC,0x51514C3C, 0xD957B5C8,0x4F09CBD3,0x4A453098,0xB1DA8B50,0x4646BAD2,0xC2B13F4A,0xA3D438BB,0xB74D3142, 0x41AF3799,0x5329E3B4,0xA6B40852,0xD6E3A956,0x41BE4A57,0xD83A5835,0xDA3291D0,0x904761C9, 0xD03555A5,0x41BECED2,0x43568953,0xD4C811C8,0xB24350D2,0x3251944C,0x3139D0DA,0x643FBDB8, 0xB3B8D642,0x52E0DA3E,0x60B6C465,0xD4D4D22E,0xB0B65393,0x90454359,0xBDC4A8DC,0x6432B7BB, 0xC023A834,0xB3BECDCB,0x4D3C4956,0xD748C5D2,0x2F5496CF,0xCA504FB4,0x40CACCA5,0x584D30BD, 0xDCBC9630,0xC2DA49D2,0xD6565E5F,0xCCDD3296,0x485736C4,0xC94D5340,0xE1D3C1D2,0x665A4EC8, 0xB3B5A387,0x3615E0D8,0x464E4F51,0xC1BEA741,0x60D6E5D3,0x4D469465,0xDAD9D1C4,0x44AB5B3E, 0xB5CE4555,0xD5D7B7A7,0x60B64454,0xE2A09242,0x09C151D4,0x2E4B3B5B,0xD4B2D0BA,0xB8525ADB, 0x525BBA24,0x4FC4D8DE,0x5929D454,0xCFC00934,0x4485B8D0,0x13C62759,0xC53CC9AC,0x5B4B9C04, 0xB94144D1,0x37C0D3D0,0x57543121,0xCDC4D1BA,0xC41351D2,0xC85B5948,0x09D0D28D,0x5A4CD78B, 0xC4403812,0xD3D2B4C1,0x31D15150,0xD4D44C62,0xD6D34FA8,0xB3536048,0xC8292DC6,0x3AA1C2D7, 0x56329755,0xDA41B4D7,0x4B523FD3,0x4C258F52,0xC5B0D4CE,0x5B03ACB4,0xC15ECE44,0x2BE2D2CD, 0x592E3454,0xD7D2915B,0xBAD03627,0x58281A34,0xCBD54B24,0x311BC5C9,0xB0534F44,0x34C3BEC2, 0xB7B5B543,0x45371036,0x41A1DBAF,0x37432AAD,0xC4CF163B,0x3B412600,0xD9254943,0xDF5A2CD3, 0x564352C6,0x413CC3CF,0x453CCFD4,0x4E4F393A,0xD5CBCEC1,0x52B65BD4,0x1241CA5A,0xC60DD7D2, 0x5B465104,0xABCBC857,0xB8DCDCD3,0x2A35546E,0xE3D13CC4,0xA1AC51D0,0x20386163,0xDAC2D1D0, 0x586229E0,0xB4B23452,0xA3DAD6D3,0x5359533A,0xD7C73C4C,0x04C6C3D8,0x49325D48,0xD5D1DA53, 0x5250CAB8,0xB74F5341,0xC7D3CFC0,0x4C3D429C,0x5442DB56,0x41C9D3E4,0x51A83C56,0xC0D2B059, 0x4CCBCEBB,0x503AB654,0xDE43BAD5,0x37C35220,0x5529BB42,0xC82915B7,0xB32C4CD2,0xD83653C3, 0xC4534CD2,0xC74B9730,0x425C30D8,0x5534CDC7,0x4EC6CF2F,0x37CEE250,0x29B65538,0xCFBF2131, 0xD2AB4B46,0x103F44B0,0x365127BD,0xB6C3AED7,0x51B8C355,0xA7231B35,0x13C3C4B6,0xAA234BA1, 0xE09D5FB4,0x4ED1B13A,0x0059C94B,0xD8C343C2,0x36C5303E,0x0A3A134A,0xB8C8C430,0x5F4B9FCA, 0xBB2F3CB2,0x4DC5E0AB,0x5A1FC348,0x41BED242,0xB3B2A2D1,0x2F573F2C,0xADC7A6B9,0xA8A4AE98, 0xD0B25D42,0xD3B047C6,0x2349844D,0xDB4D33D1,0x405840D0,0x3A5596C9,0xA6D0D5BE,0x64B3B853, 0xD4C0B72D,0xC0D844D7,0x45483A63,0xD6B31CB6,0x554309D2,0x0F564807,0xDCD9D3CF,0x60373B42, 0xD1B83D57,0xB0CAC6D5,0xB7606039,0xD9D0994F,0x3AE0D8D5,0x86595E69,0xE2E3B417,0x553629C2, 0x45335962,0xDECDCFDB,0x6A5EC7E2,0xC251A655,0x39DEE0D6,0x65422F53,0xD430C044,0xC3E0C7CD, 0x6149395E,0xE0CFB405,0x4624ADC0,0x9E5B3E4C,0xDCD421C3,0x3C304FBD,0xAD619B3C,0x4BA8CEDF, 0x4F37C4C1,0x40D05041,0x39C3D5A7,0x1840B340,0xD6A35004,0xAA238E36,0x314434C3,0x3745CFB7, 0x244225C6,0xC74318B4,0x93B752C5,0xB13CB83F,0xC851B5C2,0x35D24CC1,0x44BFBB4C,0xD9C21A51, 0x1ED35047,0xD3215419,0xDD3E60D1,0xB14F45C4,0x5259C7C9,0x28C0C9CB,0x461BCC54,0x32D4C839, 0x52D2D15A,0xC4CC4140,0xD1C35344,0x53CFB630,0xCB3E304B,0xB0D7BD37,0x105550C5,0xCB403B01, 0x38C3B0AA,0x5D53D0B9,0xBE2636CE,0x36C9D9BC,0x52C89760,0x9DD0CD4D,0xB135301E,0x185B18A9, 0xCCC4B7D2,0x563152D1,0xC0332538,0x4E52D1E0,0x3A113C3C,0xCEC73030,0x50D2D428,0xB958324B, 0xD8D6C434,0x40405491,0xDA375548,0xD0D14CC7,0x4C6437C9,0xD4914DD2,0x51C1D4D4,0x5B608C52, 0xD6DCD1C4,0x59DCA348,0xD8296257,0xD5D8C242,0x553C0CB8,0xCC3E5355,0xC6D9D3C7,0x345A411B, 0xC2D34E57,0xB0BFCBCE,0x1F5560AB,0xC6D63533,0x65C5DBCF,0x45A9B251,0xD1D9D752,0x3F418646, 0xB7315653,0xD0D2CBC7,0x5A60C0C5,0x2F5617D1,0x53DDD5D8,0x6012C154,0xC3B4BB54,0xC6D7B3C2, 0xB9574323,0xDEBD58A3,0x01332DC3,0x525D31B2,0xA7388AD0,0xBC32D1D2,0xC75051A5,0x3ABAC445, 0xB848A3D7,0x154C5889,0xB2D7CA42,0xB9C9BA3E,0x4CD95B50,0xD237D851,0xC7143BC4,0xCC006157, 0x9D49CFCD,0xC641B5C5,0x55C84251,0xC2A503D0,0x5231A6AB,0xCAC9B451,0xB0060434,0xCC163BB3, 0xCD54A344,0x1EC53585,0x4E398D33,0xAA4DC8CD,0x52C115B5,0x51DCDA45,0xC6B94748,0xD2D03B55, 0xC8413138,0xD4B4553F,0xC0CF5641,0x4B94D6B7,0x46512742,0xACD5CFC2,0x53480688,0x303EB043, 0x83D1CEC3,0x6746D19E,0xC186C03B,0xB0D2DFC5,0x5BB15759,0xD6C2944E,0xC905C5D1,0x40695021, 0xB3C42BD8,0x5D27E1E2,0x4F2C4F59,0xCCE1CB48,0x1740A7BC,0xE05965AB,0xD5BEC508,0x496946E2, 0xC1544CD2,0x4BC0D5D2,0x2688BF3B,0xAFE16443,0x34DAD804,0xA2524E55,0xE1D3394A,0xA1914C30, 0xD4884B1D,0xC1D0915C,0xBC3E4FDA,0x2E375443,0x2E08C7C4,0x234121BB,0x59D0B2C0,0x9F44E44C, 0xB2C7363A,0x88DC3060,0xAAB0AB4C,0xD5385622,0x5AB0D0C2,0x4C57D1D3,0x4FB4C3A7,0x22C4C245, 0xACB79142,0xD4C34E4D,0xD355B8D0,0xC5B85EB9,0x4F4E2AA8,0x3248C5D3,0x4831B10C,0x37C4D343, 0x2559C2DE,0x51CCA43A,0x34B4D24A,0x3EB7370C,0xAEC53D4D,0xE3D2864F,0xD03567D9,0xBC565521, 0xBC4CB9DD,0x484840BF,0x414C8EB6,0xCCD5D1CE,0x55B9354D,0xC122C34A,0xA9A137CE,0x42AB4050, 0xBB45AD30,0xB487A9E0,0x363B3A52,0xC5B4CCC2,0x261C3E3E,0xD4C3574F,0xD6C79F25,0x50453B3F, 0xCDA72D35,0xAA8036D8,0x5658A53B,0xD4BBB1B5,0x4E3ACDD0,0x5850C141,0xC1D2D5AA,0x4AD81A42, 0x22B13A65,0xDEDBB509,0x0A9860A6,0xCB4957A8,0xBB32D0D4,0x54534233,0x15B6C118,0x51C7D9BE, 0x43210A39,0xB4C3A230,0x5DD1C6BC,0x2C4F8654,0xCEC39ECA,0x495323C4,0xCE33C932,0xBB40C2C0, 0x590A49A8,0xBEA6AF31,0x2DC1CBB5,0x334B4F43,0xD9D4B8B0,0xAD592EC4,0xBE5A4E96,0xC40BA2CE, 0x5146D3BD,0x51503633,0x9DE2D5D0,0x39883F4D,0xD9354151,0xD5D14A9E,0xC6A4573E,0xD6445243, 0x2944BDD8,0x4A2648A5,0xC1C039A0,0x53C2C9B0,0x39BD313C,0x01D3C449,0x4786D822,0x25BC4056, 0xD3DB5043,0x29532DC2,0xB4453CA1,0xB9C634C3,0x5449CDD0,0x373EC448,0xADDBC647,0x1F43304A, 0x0527B541,0xC2C2B8C6,0x464B4CD0,0x8342BA30,0x563FE2C2,0x4C30411E,0xB5D4CD52,0xA1BDCF18, 0xBE47578D,0xC4CE35B0,0x39549CC9,0xB85655C3,0x9FB1B6C9,0x3834C5A3,0xC0A5421C,0x56C6C9C8, 0x4C2AA319,0xBDD1C253,0x428408A3,0xD6155149,0xD6D24221,0x155F3BD5,0xC95858CF,0x15C4CFC6, 0x5C55B1B1,0xD4D09639,0xC3DCC856,0x2C4C464D,0xD2B250B5,0xAB06AACF,0x40565245,0x9CDAD0CB, 0x54A4D64A,0xCCC6525C,0xC9D9AE34,0x3B5344BF,0xD33B5445,0x42DACBD3,0x4B622CC3,0xD3B04935, 0x4FCED5BA,0x4E4B3440,0xD1C81C22,0x64D9DDC4,0x3B49A354,0xD7DDA450,0x421E3640,0xBB2B444C, 0xDFC82E87,0x5A5EC8D6,0x4C5641CE,0x47D5DDC4,0x4B43C144,0xBDB93251,0xC5D1CA42,0x2B5FC8CD, 0x26285BC5,0x50D0D792,0x4E46BC21,0xA5C7A640,0x44D8C248,0xCD59B6C3,0xAA98560E,0x4FB8D2BB, 0x2B40429B,0xB44129C8,0x3346C1D1,0xC76047DA,0x90B2B445,0x534DD3D0,0x488A26AC,0xAED0D043, 0xC4A9C227,0xD52F68A3,0xC1B1B24B,0xC35894D0,0xD3505FCD,0x4C41C9CA,0x2940D2CC,0x15CD5DBF, 0xC113BF50,0x8757A1BF,0xD0933FC5,0x1F3647C7,0xDE11332C,0x4AD058C3,0xC9414149,0xC91340AE, 0x33C10A9C,0x1D403130,0xE8D7AC45,0x52C76143,0xD3575017,0xD22F41DE,0x5750BCAC,0x9A441244, 0xDDDAD9D1,0x61C55760,0xDBCF895A,0xD9C830D0,0x23506251,0xD3B44539,0xD7D3D0D6,0x55525B62, 0xDCD513B1,0x57C8BCD2,0x33424E58,0xD2D0B331,0x52D5C5C8,0x4222B86D,0xE1DE2DC7,0x454655B1, 0xA643404D,0xCBBACCD1,0x54D84821,0x29A8D56D,0xDEDDC0C0,0x21955D50,0xCBBA5254,0x2951CDDB, 0x61C717C7,0x0727DB63,0x38D5D5AB,0x55BC074A,0xC3DAA753,0xBBCD204E,0x61D6BA40,0xD554B951, 0xB0BF29CE,0x373E4045,0xB81EC4C2,0x80B34416,0x6CD4D930,0xC62FD633,0x11D1C151,0x49C72B5E, 0xC0B1C5A5,0xB7044A99,0x65B2D32B,0x324CD7D2,0x49C3D340,0x31CA2556,0xB3C2BD45,0xB927353C, 0x5B38D9C4,0x9E5155DD,0x4338D39F,0x534DD4C1,0x4BA9BB32,0xA2CCC74F,0x6498E4CD,0x41B751B7, 0xC4D8D457,0x4144AC2B,0xA64A533F,0xD2C9C2A9,0x636AE1DC,0x414E52DA,0x42D0E4D5,0x6052BC48, 0xC4B9B251,0xD9D0C8B3,0x5E669AC3,0xC3B755B5,0x369FE1E6,0x5C5E5545,0xC3CCC940,0x8AD6D7CA, 0x49654B21,0xD1D44621,0x4144CEE1,0x2B575140,0xBEAE21B7,0x4A4FD7D6,0x4567BED2,0x32D0C4C8, 0x523AC1C9,0xB83E8C42,0xD6D29FAB,0xC8B55555,0xD85452AE,0xB64644D8,0x445146D4,0xA249B5A6, 0x5125D0D7,0x9DC0B032,0x27242533,0xCBAD3123,0x973649C9,0xC4244539,0x3151B7C8,0xCE29A8B0, 0x4F39B3BA,0xBD0B4001,0xC4B534B9,0xD7474EB0,0xBD195139,0xD3C1442D,0x512EB312,0xC13D48CD, 0x43209ABD,0x4D8AD4A5,0x349CA02D,0xCED9914F,0x5493C557,0xDDCE55A5,0xD0C358B9,0x95514FB2, 0xB55635BF,0x3CCED0D6,0x6553D554,0xB5D0A0B7,0xD0D5C4C8,0x33A9575B,0xD5CC495A,0x42CECAD3, 0x5954C258,0xCAD8403A,0x49CBD8C7,0x50414E50,0xD0D7C548,0x58C6C8C2,0x5259BC51,0xD4D886BC, 0x4943A7C9,0x314E4353,0x96D1D6D2,0x6998D2C0,0x5813D754,0xD0DDD7B4,0xA2A2505A,0xC8C6475F, 0xD2B9B6C5,0x545740C7,0x562EC1C9,0x5F1BE5D1,0x4E3EC345,0x34CDD146,0x4BB6C632,0x1553C0AA, 0x51D3C3D4,0x3C52B407,0xC3419035,0x20A7C0BD,0x3A303E43,0xC354B8C6,0x44D7CBD1,0x1754AB4B, 0xD2973D41,0x4650A8D3,0xA65135A5,0xCC503AD5,0x58D7D712,0x5057D540,0xC7D1C221,0x42BB4148, 0xD0912249,0xD73460CA,0xB42893C1,0x955AB637,0xC63A96D8,0x45344AC1,0x98A7C745,0xD0CC462A, 0xC3C53E40,0x22C3465B,0xC4A9B2C3,0xC44654C1,0xC9C83846,0x4BD91649,0xD6BE1C43,0xC4D75D59, 0xC5C13D31,0xB35550AE,0xC3D3B3B9,0x5A46CC41,0xBD35BCAA,0x8ED251B7,0x2CBDA234,0xAF374454, 0xD1E1C5B7,0x4BB23257,0xDBD15055,0xC5B255CB,0x17544040,0xA6A1A124,0x41DBC4CB,0x5049CA5A, 0xD8D5C045,0x944D45C8,0x1F00475A,0x90C3C6A0,0x64C0D9CC,0x4832C75D,0xC4E1DB1B,0x38623CBF, 0xA5B3504A,0xC5CEBCCC,0x5C602BD8,0xB8443490,0x55D5E2C7,0x6157D136,0xB4C53AB3,0xACD6D2B3, 0x614EC855,0xD5C4409A,0x9ECAB1A5,0x61488A3A,0xCB34D3A7,0x2BC7C7C7,0x5D46B152,0xBAB2BAC2, 0x3129C3C1,0x5E3B2C2D,0x4333E332,0x9047D9D4,0x435245A0,0xA7CB2C9C,0x4C38D2C8,0x30B73E43, 0xCED7BE60,0xC4C348C2,0xC86757D3,0x09A82DCD,0x4A4AC7D3,0x554CBDBE,0x46E0BB3D,0x92D5B444, 0xDA554645,0x8AAA45BF,0x414B82C9,0xA117AF90,0x37928FC8,0xB9492C25,0xD64744C8,0x9A1242BA, 0x455C27D1,0xC394BEC3,0xB24F49D9,0xC93A1951,0x904445D7,0x333DB1B6,0x20A0A840,0xD0CDC9AD, 0xC35B5739,0xDCD24F08,0x132359D4,0xA3623700,0xAE2303D2,0x58CFDCC7,0x5743A652,0xD7CBB8D3, 0x43CE4A2F,0xA9308161,0xD0A739C7,0xB45044D1,0x47AB414B,0xD2C6E3C9,0x4F525248,0xD4D24B48, 0xB3B6C4B6,0xAE4D562C,0xD6C45443,0x42E1DCB2,0x5C40305E,0xDCD34790,0xB3D72136,0x262A4A5B, 0xE1C34F4C,0x24D24BD7,0x4646B55A,0xC183C9A4,0x5399C6BF,0x47AE3149,0xC0D1C247,0x41A8BBC0, 0xC338A15B,0xC0DA953B,0x2D523BCC,0xC0343F3F,0xC02B36B2,0x5B4AD3CD,0x404927BD,0xC5DDCE90, 0x4037343D,0x1BC73647,0xB7AA9D30,0x673DD4C6,0x3542AEB1,0x31DBE12A,0x3F16A754,0xD3C64150, 0xCAB640B6,0x5860A8B9,0x3742CDBB,0x59BCDDD0,0x5AAAB140,0xBBC7D34A,0xC7BD0CC1,0x12514645, 0xBFD85499,0x3154C9DA,0xAA585735,0xB2CCD1C3,0x49520DC5,0xBA54B0C3,0xD3D02FC6,0x524DBA43, 0xA6363A33,0xA1A1C3D6,0x40454248,0xC151B8CA,0x25A6D1DB,0x512F5238,0xD0D1964B,0xB050A5D1, 0xA8495A3E,0xD24886D4,0x6998DFD1,0x4A55CBC0,0xC2D4D33E,0x48C03047,0xD4984F55,0xE20551D3, 0x214850AA,0x2050B621,0x30A0C5D9,0x51353CBD,0xD0B71A5A,0xD1A807D2,0xA54B53A4,0xC0C158B6, 0xC422C4B2,0x3F5434C3,0xCBB13731,0xCFD651B2,0xB840B251,0xD75B55C4,0xBE3032CC,0x514042C3, 0xB33BCDBA,0x49C59CC5,0x3BA5C54E,0x3CA7BA32,0xB4A439C6,0xBC174232,0xDBD04B53,0x21023FCC, 0x2A5F3CB7,0x34C7C1C8,0x453ED73F,0x5341BD45,0xDED9A720,0x25C95432,0xC7484646,0xCE9DB8CE, 0x34B24C42,0xA0C5534F,0xE1CEC6B5,0x401E5D51,0xDA884E2D,0xBE2412D6,0x455B50C8,0xBE31A541, 0x2ADBDACB,0x508F5460,0xDAD0AB43,0xBCB3A7BA,0xA84B544F,0xCCAA43C1,0x2635BFD4,0x53463851, 0xC5D3BCC8,0x5641BF9B,0x38C2324B,0xB8CDD4BC,0x2C1B213F,0xAEB6305F,0xD3D0AED1,0x35405852, 0xD6C3354A,0xC4CBB52A,0x48CE5236,0xCA913255,0x9494C5D0,0x46464C91,0xB7C72741,0x1DCB9BCA, 0x42C6C158,0xCBD2CD5D,0x11D24C3C,0xC2344750,0xD0293DA4,0x4B56C5D1,0x5AAD21C3,0x3124DBB5, 0x4BC2C6B5,0x4FBD0455,0xC7D8AC50,0x51A4B5C6,0x4A40BD40,0xC3C6D74C,0x4EC4BB32,0x17324A45, 0xD0D6C63B,0x93C94546,0x510C0054,0xC2A7BCD3,0x5831ABAD,0x3B8ABA54,0x33DDD7C7,0x30C02454, 0xB0CE415E,0xCDA4C8C5,0x4D504238,0xC0A73F44,0x46BCD8CA,0x5251A3B4,0x3350D6BB,0x53C0B1DB, 0x5426BB41,0xBFC4C542,0x3991B0B5,0x9CB03157,0x5314D9D1,0x515599D3,0x262AD146,0x04CCD484, 0x44534C99,0xD7C3413C,0x3147CDD5,0x5B25263C,0x49B0D0AD,0x93D8CDBC,0x47821F62,0xDCD3194D, 0xCD5950D7,0xC14262B7,0xA048D3CE,0x5F57D1D4,0x4F2191B0,0xB8D5DA17,0x3B5E35BC,0xB44E272B, 0x2ECCB7DE,0x524BAB96,0xA045BB36,0xCCC7B6C2,0x315A53CC,0x4910B020,0xC254D3DA,0x263B45BF, 0x40103482,0xC4B9D0BE,0x235A56C6,0xC7D0B642,0x4CD4C938,0xB3904451,0xD5A25236,0xD5BE13C2, 0x395B5FC8,0xD75406AD,0x2844B3E7,0x57512E44,0xA3BAC519,0xCDCCC1C3,0xA1B05E40,0xDABA2F5F, 0x4459D1E1,0x445A59D0,0xAABAC5C3,0xB2B2CDB2,0xA9415E40,0xE1D02039,0x503E3CD8,0x26572857, 0xB6CBCCD1,0x2DA83AC1,0xB0D05462,0xE1D2CBAE,0xC43A5E36,0xD5C46247,0xC937B1C2,0x1A582BC3, 0x05C74F49,0x31CCCCD3,0x41452142,0xD99BB134,0x31CC46AF,0x15C64852,0xD0CCAD52,0xBD4A43CA, 0x2631513E,0x23CDC7C7,0x3A5AB2CA,0xA5C8AB42,0x36D8C955,0xB03549BF,0xCB3C4944,0xB8D2C3B8, 0x50C4425D,0xA4DBBB2F,0xD5B3B655,0xB4C8584C,0xD0B15043,0xC3471ED5,0xC25655AD,0x5AC5D219, 0x4CBADEB9,0x4DC6C04A,0xC4D90F60,0x87D3BA4B,0x44443938,0x40221FC1,0x29ABD3C4,0x51C4C749, 0xC33B2643,0x25C1B1B5,0x43C48045,0x541AD84D,0x2E3BC3CF,0x50C3CA23,0x19C8B358,0x36B3CAA6, 0xC19F5047,0xCB0B91C3,0x2A4A51CD,0x935DBBBD,0x912DA4D6,0x593FC7B7,0xA0A3BE4E,0xC757D7DC, 0x4CBD59C2,0x20CAAC4C,0x242BCFB6,0x41474C85,0xD2C42942,0xB08BA7DB,0x525DBD50,0xD0C0C4C3, 0x53B59AC8,0x3F523C51,0xD9C3C4BC,0xB7C049D1,0x2BB9595B,0xD8B5C2BE,0x11553CCA,0x113E5643, 0xD4CCC9BE,0x4E5433BF,0xCB5EA8B4,0x10D514D7,0x573E1430,0xC430A448,0xD3D6C4C8,0x46BB6053, 0xC8B73C27,0xC848C6C6,0x403B4591,0xB1C03E50,0x3FCCDBCF,0x39423852,0xD4DA4938,0x46D2453D, 0x263A1343,0xDAA8432E,0x46D82EC6,0x3939B85A,0xC7B2C441,0x285331C9,0x472A42B9,0x37C9BF1B, 0x5AABE1C2,0x2DA53019,0x95D8BA53,0x50BEC242,0xA743A44A,0xD2A8373C,0x5851D7D2,0x544BAAC4, 0x2CBEDACA,0x46A5B418,0x47D24453,0xCDC2C150,0xC364ADDF,0x3E47578C,0x35B1DBD4,0x4A53BFC4, 0x345DB9AD,0xD4C4B1D1,0x335456DF,0xA353424E,0xA4B7D1E0,0x46183826,0x10C43D4F,0xE1B0D20F, 0xA33F63B6,0xD337524C,0x813EACDA,0x545827C5,0xCAA90CBB,0xCFDA18D8,0x31B25A65,0xE2C9954E, 0xB92E53CA,0xB14F6040,0xD3A1B6B6,0x5225D6DD,0x55AD5355,0xD7D9C8B2,0x47B0A743,0x9E354F5C, 0xD9CC2499,0x59BECBCC,0x3F1DCB66,0xD1E1B6C1,0x2A48548C,0xC8395050,0xC0C0BCC2,0x5C52C3D2, 0xBF442445,0xCFE3D71E,0x4AC3465F,0xCEC45155,0xD6BE24BF,0x605532CF,0x9757C1A2,0x54CAD9D9, 0x5040A536,0x94C7C648,0xC8D5C54B,0x5C5024BD,0xD1BF42A6,0x3CC4D231,0x4B3E414E,0xB5A515B3, 0xDBC2BAB7,0x525F44B8,0xA9CA3EB4,0x3689D7CE,0x21513E51,0x91C63C49,0xBBDBD1C6,0x45613035, 0xCB8E341A,0x5635D7DD,0x575545B1,0xB507CD3B,0x23D4D8BE,0xA0555218,0xC9D52651,0x3314D5D5, 0x4F515754,0xC3CFB199,0x39B2D4D0,0x4B5D5939,0xD6D0D0B2,0x4422C3DE,0x99565F57,0xCDC1CCB0, 0x402DD0D9,0xB15A6932,0xD9D4D121,0x5A54C5DE,0x4A494D50,0xD0C5D3D2,0x4548D4D2,0x0E356060, 0xE1D3D1BE,0x4A5157C3,0xD0A94856,0xC4CEB6C1,0xB95630DB,0xC0306153,0xC8D0D5C0,0x565644A4, 0xD19B3C4C,0xDE92C3D1,0xA8AC5DBD,0xC0C05858,0xD11DC3DB,0x4F505637,0xC4C02249,0x2ECBD0CA, 0x3D84AD36,0xBDD33E60,0xBAD9BAC3,0x49535344,0xD1AB3A3F,0xDAC20CCE,0x42C2593E,0xC0B2C361, 0xC0BAC6D4,0x4D44523D,0xC5CDB245,0xCBD3B34B,0x5DA4AA32,0xCDAE3C55,0xC0D4C4CB,0x44514F4D, 0x03C8B52D,0xB6D4C4B9,0x61C3BD49,0xBBC1D264,0x1BD8C6CD,0x2F4B5A50,0xC9C1272F,0x2ED3CEBF, 0x6145A535,0xE03AB531,0x40C9CDBC,0x49345251,0xBDD0C04F,0x2BD1D0C5,0x60493A52,0xCACAD2A2, 0x4BA0CCC9,0x48503B53,0xB5C3CD0E,0x51D1D1C7,0x5C500F53,0xD9D6CDBA,0x51CAB43D,0x87455D49, 0xC3AECBB6,0x5A39D5CF,0x5E53C432,0xCFD6C9C7,0x4534CF96,0x2A854C61,0xC7C5CAC5,0x554B12CA, 0x4E4BC839,0x86D0CED2,0x6343D2B1,0x943CBC51,0xB1CED5BD,0x5C3FC438,0x3457B2A1,0xCCD3C0D7, 0x42403D80,0xAECA5558,0xB518C8CE,0x475BC0C9,0x4856C0C8,0x43D5CFCE,0x5019D044,0xBE43004A, 0xBDC93EB6,0x3B4DAAC1,0x836093CC,0x3221C5D8,0x5441BFC6,0x53C1C63D,0x32A1DB46,0x1641B2AD, 0xA15139C9,0xADC03CCB,0x4A43BDB5,0xB14628AB,0xB9B644D0,0x2A4BBBA7,0x4255C2C0,0x43C4C6B7, 0x4B2ECDBA,0x020C4148,0x499AD3AF,0x124C9AD3,0x3363B1D1,0x05BCC2CC,0x5532C7C2,0x2B3B2250, 0xBEC5D0C8,0x27261C31,0xBA5452B4,0x98C2B3D1,0x5655C2CC,0x93382939,0x9DADC8C9,0xA85424D4, 0xC05C26AD,0x29CEB2CD,0x503A32A1,0x962EB240,0x8C46B9CD,0x474FBAD3,0xBC5DC1CF,0x4AB7C8BE, 0x5145C2B4,0xB403068C,0xC7983BAF,0xC9354AC7,0xC35553C8,0x273BBCCA,0x5249C6C8,0x4228BE2B, 0x42B7C2C6,0xA93CBCA9,0xA15D94CD,0x2DBA3FC4,0x4649C9C7,0xAB478936,0xC536A4BD,0xAF4814D4, 0x2C591BD0,0x44C8C03A,0x471EC0CC,0xB8404139,0xD1AD4C32,0xC93AAAD1,0xB16752DB,0xC349AACC, 0x5642CDDA,0x59331392,0xBAC4C646,0xC507C3CA,0xB65E56A7,0x2EC6CBC3,0x4C58D5CF,0x33532127, 0xBCC20EC8,0x4246B0CD,0xBA6146BE,0xBBD1D0CA,0x34423CD0,0xB8474C51,0xBCC2C5B5,0x305B22D7, 0xB55E53CB,0x31C8D3CE,0x6241D2CD,0x2934B543,0xC9C2C7A8,0x8F3B2802,0xBF5F4FBE,0xB9B4ABC9, 0x3F51C4D3,0x37A54B40,0x90BDC0C4,0xA75ABCCF,0xB65F46CE,0x18C4C7C2,0x423935BC,0xB34B2440, 0xB13221D4,0x4350B2DB,0x356012CD,0x42D0D4C2,0x5434C720,0xB2B1A346,0xA4CAA451,0xA821A9C7, 0xB2624ED4,0x4130C7CF,0x4A49C7D0,0x3C1E112B,0xBF4BA6B1,0x2342C6D2,0xA75848D3,0xA8BE38C5, 0x449CB5BC,0x2A4E2831,0x818F34C2,0x3E40D9C4,0x4E59A2CC,0x22D3BA32,0x3193C6CA,0xB5435A46, 0xC4919A92,0x2157C8DF,0x3B6736D2,0x84CABBCC,0x570FC8D5,0x38403550,0xB7B2BCB8,0x44B5C9D0, 0x1A5F49B2,0xABD1CC26,0x4C4C9CD3,0xBF46573A,0x23A4C7D0,0x5514D6C9,0xC85847AE,0xD0C4C10F, 0x474241C0,0x9D2C4648,0x2B3CBECC,0x4643D2CC,0x45522DD3,0x8BC6D030,0x4646CABF,0xAB2D5239, 0xBEBA0DC1,0x16AF27A9,0xC55449C1,0xD04E36C9,0x095216D6,0x413A391E,0x47B4CDC0,0x42B6D123, 0xA64E2CB9,0xB6D0A64A,0x313FD022,0x21524C3F,0xB739C0D1,0x1189BAD1,0x34503FB0,0xC2BFBD4A, 0xC44F8DD8,0xBF49554A,0xB4BA43BD,0x28C5C5CA,0xA05A4AAD,0xCDB79C32,0x493DC1DA,0x544EAC52, 0x8CC7D237,0xC0D7C2C3,0xB7555A50,0xD3BF0243,0x194FB3DD,0x246749C1,0xBBA3A1CC,0x30D5CBCC, 0x225A5337,0xCAC21214,0x3931C9D9,0x344A524A,0xBAD1B043,0xC7C896C8,0xBD605EBB,0xBBBD2D0A, 0x572CD7E0,0x40523D4B,0xC0B1C6AA,0xC3CA36C5,0x935854B9,0xC58B2C30,0x434FCBE0,0x405444A8, 0x109BCBBE,0xC7C83BAE,0xC25549CB,0xBB9B4540,0x3F13BDCB,0x3C43222A,0xB64712C4,0xA6C81AB5, 0x2E59B7CF,0x4C3294AB,0x46B0DBC4,0x373BA03A,0xB4A03644,0xD4C29C30,0xC16536DE,0x935A52C9, 0x3FC1DAD5,0x5D46C4AB,0xB1380A46,0xCDC1C4C0,0x3559B0D2,0x49C05047,0x2AD2DAB6,0x3F5341B6, 0xB72F4442,0xBAB0C4CA,0x625ED5D7,0x5541BEC2,0x37D6DCCC,0x4C903850,0xB59AAF55,0xC9B5B0B6, 0x555DC3D4,0x133C22CB,0x22B6D0C9,0x40442C47,0xA4ACB23D,0x93BCB196,0x6091D437,0xBFA6BCB7, 0xA5C8B696,0x409A2E56,0x2FAC9A36,0x4130B3C0,0x6026D4C8,0x4715D3B7,0x3CD4D246,0x3B39C13C, 0xA72B48A1,0xC2904CAD,0x56CCD3AF,0x4041CE48,0xB2D3BF49,0xC1C72532,0xAFB95235,0xAE882557, 0x3ED2D7B6,0x303D3656,0xCDDA114A,0x2A3F1DA3,0x434216A5,0x8BB5CA34,0x4FD7D2B4,0x3DB44160, 0xD6D93343,0xBF3448B0,0x153A5634,0xA1A7C6A7,0x2FC3C9D4,0x34285355,0xCED61036,0x5091B718, 0x271F1D56,0xD3C9B71F,0xD7D252AF,0xBF98555C,0xD3193584,0x4A56A8D3,0x26384224,0x8BC2C0A1, 0xC9CBB924,0x25A54150,0xD5B94421,0xB6B652BE,0xB32E4C44,0xB74834B0,0xD4A731C5,0x404944CA, 0x352B1CC2,0x12ACC6C0,0xB1233340,0xBD804C4E,0xD0C1ACAF,0xBA544DD1,0xCF594DC1,0xC431AAD5, 0x5249A3C4,0x37463445,0xCEC7CAC8,0x2D5830D5,0x8AA15048,0xB3CBD4B8,0x414C43BF,0xB93B5426, 0xB8BEC3C5,0x5955CCD3,0x4428A42D,0x37B3D8CA,0x3E3E40B2,0xC0384440,0xC1B0C9A8,0x585DCAD4, 0x272A2AAF,0x2FC0D9C2,0x995449B7,0xA839082A,0x9BCCC435,0x56AEBFAF,0x95B20F3D,0x9F1BBCA0, 0xB08732A2,0x4FBDA440,0x50C7B831,0x49CAD8B0,0xABA6224A,0xAFCE1D53,0x39AA962D,0x4627AE88, 0xB149B3C1,0xA3C1CFBA,0x4792B04E,0x80C5354B,0x16B9B8B6,0x892C213F,0xD0204440,0xC9D8AD94, 0x3C404E20,0xB6A54B2F,0x38BECBAD,0x5427B843,0xC6C9C051,0xCADD9F0A,0xB8935458,0xD52F3431, 0x293C9DBB,0x434B221B,0xBE063C21,0xBED4CCC6,0x4745284D,0xD2912931,0xC0C836C9,0x13175B44, 0xB7A44040,0xCB3CA3C7,0x475138D2,0x4034A0CB,0x27C9C5C3,0x20A0A850,0xBC8C2248,0xC50B4323, 0xB13232C8,0xB45137B9,0x8E48C4CA,0x143C2DC3,0x4A011BB4,0x3216BF3A,0xA024CDCE,0x92194037, 0xC4C44640,0x951322C3,0x455813C2,0xA44294BB,0x45AFD7C9,0x46AEAD2C,0x47D2AF54,0x9CA9CE10, 0x2546321D,0xC0BE3F3D,0x41D1C6B1,0x4A481D27,0xC3BA8C23,0x3F27C9C0,0x493D373E,0xBCC49427, 0xBBD1BFA2,0xA7543141,0xCC964484,0x2D9DB6B6,0x1F224812,0xBA143437,0xD0D1C025,0x47A24246, 0xC1A13093,0x1F8B8CC1,0x99BA4840,0x2C99B949,0xADC1B5A6,0x0CC54519,0xC2221739,0xBE0A37A4, 0xB0333619,0x444EA61B,0xB23FA2D1,0xCA8043D5,0x42B1B54F,0x92278840,0xB58BAAC2,0x2D323EA3, 0xD53451A9,0xD6488CBE,0x4D2E42B1,0x3B44B5C0,0x35A0C5C0,0x489FB10A,0xCACB1A55,0x9696C92F, 0x004755D0,0xAD232CAD,0x40B3C1BA,0x5234C70C,0x932A984C,0x53B1D8CE,0x4551AAD0,0xA7BFB441, 0xB1CBB842,0x3232923F,0xB10C4026,0x4CC1BCC4,0x343DC832,0xB0C4931B,0xC8C54147,0xB7175029, 0xAF114423,0x91B6CBBF,0x41D19152,0xAEC2BA52,0xBAB33240,0xBFBA4722,0xB8414512,0xCBB61A99, 0xC7D44F3C,0x313E9B43,0x3C4C41CB,0xB936A9CF,0x3311A1A5,0xC8BC404A,0xDA8248BD,0xB94049AD, 0xAC5454D2,0xB43FB1CB,0x5646C6B0,0x9722B436,0xC547BFD1,0x284741D5,0x3C431EA3,0x31B9DA36, 0x5240C51D,0xBF304145,0x4428C7CB,0x2E39C7CD,0x44A70F33,0xB7B1C834,0x429740C5,0xA6A55344, 0x52C5CFBC,0x57B1DD38,0x29C8C34C,0xD1D40346,0xB1CA524A,0xB2B04F52,0xC2B3C496,0x3DC21247, 0xBEA89131,0xC3944228,0x46A18E9B,0x314A06C0,0xD40A25A0,0xD91D50A7,0xB6894E41,0x3B3D09C5, 0x2046B1C3,0xB74841CF,0xCCB21937,0xB04A310F,0x23383AD2,0x4A47C0B6,0x30AAC7AB,0x4BB0C2AE, 0x24BAC355,0x47C8C733,0x9645BAC8,0x85A14A19,0xADD03040,0x3F1BB231,0x2D45A009,0xA3C6C6AF, 0x4ED4C044,0xB7B24345,0xD3C7304C,0xBF2C463A,0xA04A44A4,0xC1C98887,0x30D140C5,0x29462C4E, 0xBD3D28C2,0xB8411ED0,0x2C5342B4,0xA33AB0B3,0x2841C7DC,0x443A4BC0,0x4199D036,0x27A5CD06, 0x2BC13945,0xC5C01C48,0x2FBE32B7,0xB14022BB,0x3F80B643,0x32C3CF3A,0x3BC5104D,0xC1B9364C, 0x93CEA4B0,0x3D3C9727,0xCE3933AC,0x31C081A8,0x31013247,0x0A993191,0xCBBF9530,0xCD8948BE, 0xCB443A4C,0xB33CA7B0,0x394931D0,0x463E07B2,0x22AABC32,0x44A2D3CC,0x3D9E9347,0xAE27BB2B, 0x092821D0,0x4E3F33B1,0x2BB4A737,0x38CFD2B3,0xBF480341,0xC7CA4C42,0x16C4169E,0x203A3420, 0xC7124740,0xCEC9B51C,0x158C3D32,0xB7C03F56,0x9DD0B7B2,0xA3424982,0xB7324933,0xC79CACC8, 0x494732D0,0x4E48B832,0xA5B8C2D6,0x261F4022,0x1A26B14E,0xC930B8AB,0x5150CBD5,0x3C3A2CB8, 0xA7CCB784,0x43A1AA42,0x4430B34A,0xC1C09E2D,0x2AC5C6C9,0x1D813D4C,0x3FD0B732,0x3742B5B1, 0xB9412F3C,0xC3C82F41,0xD7CF4243,0xC2B75731,0xCB493FB4,0xC8533FD3,0x96473AA2,0x34B3AB35, 0xBBC22527,0xB35122D2,0x304445B4,0x32C2C4C7,0x4C2CC741,0x4D35BC35,0xB4AFBE06,0x56BCD6CB, 0x432D2D44,0xCED6CD53,0x89489D1E,0x434A47A3,0x34AAA9C5,0x34D9D5C1,0x43C13762,0xD9CB4349, 0xCE9441C4,0x36445540,0x9EA731B2,0xCFB3CACB,0xB0515DAB,0xC0341E39,0x269BC6D0,0x474C3EA4, 0xB12C99BE,0xBB4113CB,0x5059CCD0,0x4D3088C4,0x3BD0D6B0,0x25C2364B,0xCBCA5147,0xC12E302C, 0x4EBDCFB0,0x4440C451,0xD0D9C13A,0xA2BA4A43,0x12A84545,0xB32A9D2A,0xD5C2B4A8,0x89975D28, 0xA52F3C2F,0x3646C6D2,0x423EBBC5,0xB3442533,0xD6C5A13E,0x435594D2,0x524D3ABD,0x44C2D9CE, 0x4F0CB200,0x28C4964F,0x91C4C546,0x53C9CFC1,0x2F440449,0xD5D31C25,0x39973C35,0x893C4250, 0x952EC2AA,0xD4D28BCA,0xC5966435,0xD4B4414B,0x255020D5,0x3E5848C2,0xB706B0C5,0xD0CA170B, 0x475138BD,0x9345AEA7,0x462DD5D1,0x453D2333,0x0EC4A642,0x45C4B4A2,0x51C2D814,0x3695C152, 0xD6D33D44,0xC3C35145,0x0E454746,0x1933B8C2,0xD415BDC9,0xB9425288,0x9BBD434D,0x4132C1CB, 0x44432AB8,0x3EAEBD95,0xC8B1C603,0x5426C5B7,0x433C9E49,0xA9D0CEB2,0x35113E39,0xAD0A3F44, 0xC6A82AC1,0x50A1D2C8,0x42404E31,0xD7C2A107,0xAC3A37B1,0x9D534640,0xBA9AB7C4,0xC3BAB0C2, 0x434847A3,0x8AA135A5,0x43AFD4BD,0x494A2E0B,0xBCCAAA49,0xA8B8B830,0x31A6C0C0,0x39A9B05A, 0xD2D0B508,0xB3AC5791,0xB52F5348,0x9F46A3C4,0xC6BFB3C2,0x345D93B0,0xC4A838C0,0x44B3ADCE, 0x50441629,0x25A6C198,0xBBBF1334,0x2AB3A3C1,0x81AD334D,0xB9D4C443,0x3F35A239,0xBA3E4D42, 0xABBC98B7,0x40BDC3BB,0x122E4589,0xC0C3CE53,0x1A34B6C4,0x92475334,0xA7A6971F,0xC7B6A8A2, 0x5711ABC2,0x4242C439,0xB0CEC6D2,0x42294344,0xC3B81452,0xA181AE1F,0x4037CBB9,0xC23F51BE, 0xD4B43BC1,0x3C4927B1,0x32403435,0x1C1EC4C3,0xB530B7BA,0x4D0027B1,0xAAAABB44,0x2CD7B52A, 0x49AD3543,0xD0993746,0xD23D3CC3,0x143A8CBC,0x3D4243B1,0x32BCC5A8,0x413EC5B2,0xBF1D3936, 0xBAA33BB5,0xC39A2330,0x4F25ABC1,0xB843203D,0x44B1D2C8,0x474137B3,0xC9C93640,0xC2BE9D38, 0xA94721B4,0xAF4E50BE,0xB2C4B09D,0x323AC5CB,0x3F244E49,0xC3CBAA2B,0x8EB8BDA5,0x44BB1647, 0xB0A5094C,0xC3CAB4C3,0xA0505485,0xCDB03344,0x2313A5B2,0x2541B2B6,0x3954A2CE,0x45BFC1C8, 0x4789CE9E,0xB3C24D48,0xB1C78947,0xBEAFAE3B,0xC3AE3024,0x42BB403F,0xC5A0B1AB,0x17342BC2, 0x37B65051,0xB6B1C497,0x0D45C0C5,0x5853BCC6,0xB4ACB7BF,0x47CAD0B8,0x37284550,0xBCD29048, 0xB0C68521,0xC4364132,0xCA5154C9,0x9492B5C3,0x514BB3C3,0xBAA13035,0x03D3B634,0x453DA197, 0xAEB6A191,0x98BFA744,0xB9A69403,0x0440452F,0xCEB73A32,0xB9B545BC,0xB8334A2F,0x4D42C7C2, 0x0241BDB2,0x48C6CFB6,0x32A72A50,0xD1CB3430,0x24C0408E,0xB933344F,0xBD4DADBB,0x3A4601CE, 0x142BC3B3,0x31B63936,0xCECFB540,0x98583DC8,0xC91E4937,0xB69E3FC2,0x2318BE19,0x33354039, 0xBFAA9BAF,0x399EC9C8,0x4D398047,0xC7B5BCAC,0xA5AB3A81,0x9600334B,0xBC1C1E11,0xCE9149B9, 0x404C9CCC,0x343D210D,0x43D9D6B5,0x4BB89D5A,0xD5C73F45,0xC32E50A5,0xC7B22931,0x324434B3, 0xB2C03F9E,0x44A2C9C2,0x35A29852,0xB6D49235,0xA6284647,0xB81DB8B6,0x513582C8,0xB5B49B44, 0x4BC8D1C9,0x3B432E56,0xBEC6B812,0xBBA53CA2,0x30A22F24,0x1E41320A,0xC0C9C3B2,0x5A22BEA2, 0xB33B1250,0xCDCAB0C0,0x532F0BB0,0x952C8A45,0xB1C2BF9E,0x93B2A232,0x5139A40B,0xBD88B032, 0xB2A6C4C9,0x8D454D39,0x13C0C12C,0x4A3CACAB,0xBDBEA13E,0x43C7BEA1,0xA54C2E40,0xCBD2BCC4, 0x38194F43,0xC0AB284B,0x313B98C6,0xA4283A13,0x472CB8C8,0xC6B0A948,0x2DBDCDD0,0x40515448, 0xD2D395AC,0x272320B4,0xB4405449,0xC1C3B8B8,0xB5B7A636,0x1F1D3FB1,0xA7434B3E,0xC9CECCC2, 0x425451B9,0xD1C04150,0x86B2CAD0,0x30465410,0xB3A1C281,0x2635B6C1,0xBE004632,0x8B20258B, 0x3947A8A4,0xC127B7CA,0x4359ADCE,0x0CC2B80A,0x3BC6BE3C,0xB4C5A14A,0x1B154131,0xC3974D49, 0xBFCBCDCB,0x58B22E42,0xCAD09E5A,0xC0C6C2C0,0x1449573F,0xB0B52728,0x223692AB,0x41A3CCC7, 0x948D1344,0xD5C64632,0xA93F3BCF,0x334E5232,0xBA92C0C1,0x42A9C1C8,0x3935394A,0xBCB1B8A9, 0x5132C7C4,0x45B9BC32,0xB3CC9D4B,0x13CA9545,0x3EBEC240,0xAF991C41,0xBAB82B3D,0xCCBD2238, 0xC5375433,0x3B411ABC,0xAE44BAC4,0x422FC7CB,0x4F2CAA32,0xB2C0C441,0xB4B3A69A,0x573A8981, 0xA59FBF35,0x82D4D1BD,0x36134957,0xD2C33741,0x813321C3,0x4F4B1AB3,0xB028B9C4,0xB2428FC3, 0x5438CDC5,0x5133A82F,0xC9D7C937,0x453BA298,0xC5265249,0x91CAC6BD,0x279DAC22,0xC8865241, 0xC42433B5,0x345327CA,0x4545B9C9,0x4C0EC4B1,0x20A3C03C,0x36C8C6B6,0x28CF0346,0xCBB43B55, 0xCD9A2E9C,0x3D533CC4,0x314A34BE,0xB1B4C0C2,0x013301BB,0xBB424627,0xA5CBC3B9,0x4032AC35, 0xBDB02D40,0x91BC412E,0xB8C6C330,0x1B494825,0xCBB14037,0x3434BBCE,0x514592AF,0xB7C8BA49, 0xBFC4C1B4,0x20544BB4,0xB51E2BA9,0x2E37AFCB,0x3E4122B9,0x09AB0D3B,0xC0C7BE10,0xCBC75048, 0xC5B34327,0xA84C46C1,0x9E992EB9,0x4980C382,0x1C91B340,0xB1BE3840,0xA8C9C1A6,0x88534BB0, 0xB89981B5,0x4318C8B6,0xACB39E43,0x92B7333F,0xC5803023,0xB34C40C9,0x8F3B3C94,0x3BC0CAA8, 0x39C2CD1C,0x06B24554,0xD2C22D32,0xAC8D30C4,0x3D414447,0xC3BF9E2B,0x33AAB6C5,0x2C832B4A, 0xBDAE27B3,0xB4233EAB,0x4830BFC0,0x40258E31,0xB2D0BB17,0x289D2A40,0x96193024,0xA0A02805, 0xAACAC1A1,0x920E4540,0xBCBD3622,0x13369026,0x2137A1AC,0x3710940D,0xB1C19B42,0x18A4BEBB, 0x1827341F,0x9136BC1A,0x208BC2BE,0x3E9B3542,0xB1B62F4B,0xC7AA9CB8,0x474B8FCD,0x2833A440, 0xB8CEC9B9,0x2DBB303F,0xB8294F4E,0xBA1920BB,0x4CA3C4C3,0x2314AE4D,0xB9CCB986,0x25853625, 0x203B3825,0x2F3116B8,0x27C0C5AF,0x4445B3B5,0x319EA526,0x31C2C19F,0xB81E2931,0xC10E4080, 0x443A26B1,0xB9A4BA9E,0x22A623AC,0x06B53540,0xBA2A1516,0x3432B3BF,0x4D37B698,0xBABBBB28, 0x32C9C5B9,0x3E3F4650,0xC8BEB038,0x1F38A5BC,0x32473125,0x3138B3C6,0x22B4C8C0,0x403DC2B1, 0xA9813943,0xC9C9AD14,0x4742338A,0xAA1F4336,0x20B1B6BE,0xB309B085,0x3A2128A2,0xAEB4162A, 0x2E0AC2C0,0x324346A4,0x21A6AEA7,0x4414C28A,0x34B5BE30,0xB2C30435,0xB63F3D2E,0xC78E19C2, 0x384040B3,0x3342A003,0xB5B1C3B6,0xA62E25BC,0x27483608,0xB1B9B6B3,0x5028BDB6,0x31302946, 0xC2C8BC0B,0xBCB42A0E,0xAC484836,0xBCA11DBE,0x3F35C3CB,0x44441FB0,0x21031323,0xBCC6B226, 0x434503BD,0xA132322B,0x09B9C7C6,0x9627302E,0xBCBF363A,0xA9302F15,0xC6403AB6,0x9A4022CA, 0x43451206,0x1AB1C19B,0x2FB3B017,0xB5BD153F,0x8C472CB7,0xC3C0AC00,0x36219C9A,0xB13C4B3D, 0xB0B3B4C4,0x343D31AC,0x962B3A0D,0xB2B1BDAC,0x4730C0C3,0x87283823,0xC3BA2028,0xB5A1149C, 0x2C404928,0xC0B48A32,0xB8A5C0C7,0x244848A6,0x0D35182C,0xA5B9CAB6,0x38863D1B,0xB3BA2847, 0xB89F8193,0xC2B13511,0x1821322F,0xA524B1B4,0x310333B6,0x91AB1F37,0x24351509,0xA9242F20, 0x40BBCFC4,0x382FA130,0xCCCD2B43,0xB5AB270C,0xB4474D36,0xB93236A8,0x0D32B5C1,0x2D40B2C4, 0x2BA12F40,0xC2CBBC0A,0x26161CA7,0x9F3E5047,0xAABABDB1,0xA6BFBAB0,0xAEB65050,0xC7B53B20, 0x173E10CF,0x4242338B,0x3A26C19B,0x10C0C194,0x35D0BF3A,0xA21A3846,0xC90E3E2F,0xA71302B6, 0x2B392426,0xBC95A5A7,0xB68E372E,0x3041B3C0,0x2E3F32AC,0xAFC2A69F,0x3D8AB706,0xB2AF3141, 0xC1C62742,0xC5BF2708,0x803E4DAC,0xA7323A28,0x2700C0B6,0x3308AF15,0x10B23048,0xB1BCB692, 0xA7C3B5B3,0x2E244049,0xC0AD2E3A,0x9B20A7C8,0x4039403F,0x94A8B882,0xA727209D,0x1EC1B3AD, 0x3328A783,0xC1A39E1D,0x04940A2E,0x2A2C2F2D,0x001D3412,0xBAA6301C,0x2B3FB6C1,0x2A9AB4B3, 0x99C6A033,0xA6BB9F2C,0x99314937,0xBA113C29,0xB91EA0B4,0x1B4438C0,0x99131239,0xB6C5CCB9, 0x3B293523,0xB2AE4448,0xABA2A4A5,0xBFBEA5B0,0x20A8504C,0xC3B92020,0x8A3D28C6,0x312F3093, 0x3A18BCA5,0x9FACAA28,0x15CFB034,0xB2B60A4C,0xBF314334,0xB89238B9,0x413E21BE,0x2796B8A4, 0x89B69030,0x40BAC4AC,0x163E3D2D,0xC7B82D2D,0x323594B3,0xA88E232D,0xAFBC3822,0xC5A49A06, 0x415420D0,0x313136B0,0x2CC7C9B6,0x21A22830,0xC3B4504B,0xBDB09809,0xB2442EC1,0xB6493DCA, 0x413FABB9,0xB1C3BE88,0x16B93301,0xA9A14445,0x883795A5,0xC4B118B2,0x151E42B0,0xC0243F24, 0xAD200BBD,0x28189A30,0x3E31B7A1,0xA78E2825,0xAAC8BFB2,0xACA83D46,0xC727499C,0xA19421B6, 0x4D46AEB3,0xA9278C30,0x24ACB5A6,0x04BEB614,0xB62A1031,0xC2AE2C38,0x3B25B0C3,0x35453104, 0x10A1A5A0,0xB28C8F1A,0x4244B8C2,0x1989A128,0xA7BBC52F,0xB92C1A33,0x1E3833AB,0x8D3197A0, 0xAD41B2C0,0x403EA9C3,0x4DA8B7AA,0xABB4A441,0xB9B5AA19,0xB9263A39,0x054D9ABA,0xBE2712C4, 0x3637BEC2,0x4241243B,0x8AC0B6AF,0x33AD8010,0x32341F2E,0xC1A70EAD,0xC0C09FBA,0x8C45481D, 0xA73804A6,0x308BB9AF,0x4C32AC8A,0x0FA28498,0x98C18789,0xB8BE933D,0xB2A144AE,0xB3344320, 0x4012C5C2,0x423CB8A1,0xA3C1A737,0x2DA63641,0xC0C0B625,0x9DB13E93,0x2C974333,0x950CC4B3, 0x3013BCB3,0x362A3743,0xB0B7B032,0xA5BBB7B2,0x32AC3145,0xB3B29641,0xADAAA2B6,0x3E3C3D21, 0x0990B930,0xA805A401,0x86C9BFA8,0x3A16AC51,0xCEBE2243,0x882238C5,0x3837403B,0x2021B7AB, 0x1AA5BBAA,0x34C7BE38,0xB3A6B347,0xBB294037,0xBEB42B98,0x393834B8,0x852C2E22,0x80C0AA0A, 0x40C1C3B6,0x353D303B,0xCDC01E43,0x981B11B1,0xB727411A,0x25AC44A1,0xA987A6A1,0x471BC5C9, 0x3E233728,0xBFB89839,0xB9ADA39F,0xAB3A502D,0xC5B6332B,0x2E41B4CA,0x44409AC0,0x40A4A9B5, 0xB2B8B527,0xC033321E,0xB2203D3B,0x2A23000B,0xC21F23B0,0x403EC1CC,0x42402AAF,0xBC88C0A9, 0xA4AC9FA2,0x4139353D,0xB2280137,0xBEA895BA,0x3735B3BB,0x434A0CC2,0xB8AAA1BA,0x2EBEC0B7, 0x36423D49,0xB7958026,0xB1AE8CB2,0x4C3CB8B6,0x2A3512BB,0xA4C2ABBF,0x19A02A3E,0xAB272730, 0x102204A0,0x27AA9CA2,0x403AC7B9,0x3C8986B0,0xAFC52241,0xB4B2A2A1,0x9A414939,0x92B5AF24, 0x9DA2C112,0x3632C0BD,0x4019412E,0xB4C4AE26,0xB094A6A3,0xAE28423C,0x94B11646,0xC0BCB9AF, 0x42422DBF,0x3D9B332D,0xABBCBCA7,0xB5B1978C,0xA6954944,0xADAA8F08,0xB33336A4,0x410EB4C2, 0x4C2606AC,0xC8BF9535,0xC0B133AB,0x90313F3C,0x963D0B8B,0xAE129FC5,0x4E10BBBC,0x1D9D962E, 0xCA158B80,0xB89D302B,0x2B453936,0x0939AAB1,0xA8B1B9B8,0x3E97C1B4,0x2745A213,0xC9BB932C, 0x30918310,0x30433437,0x131F03A2,0xA4A6A087,0x42B5CCC2,0xA03C9D8C,0xC0B23540,0x23B5BA9A, 0x35413521,0x95143C35,0x31BDC1B5,0x34AAC8A0,0xB6891948,0xBEAC2E3B,0x862011B7,0x1C3938AA, 0x2AA9AB8F,0x21A5BA41,0xBBC1BA0B,0x01A73A43,0xAD824043,0x9F24ABC6,0x112628BD,0x23B1333A, 0xA2A2B025,0xB8BAACB9,0x360D4941,0x9E0C3C2C,0xB9B0B7CC,0x382D3BB4,0x8D293142,0xAD94BBB6, 0xA5B106B7,0x2F914731,0xB60B2F21,0xAB3EBBC9,0x29352E27,0x35ABC028,0x2C33A285,0xC5C0141A, 0xA63235B6,0x3D491095,0xAD94B9B1,0x3BBDC0B0,0x40332F45,0xC1C11931,0xBABA9799,0x44429FBF, 0x27420921,0xA2C5C3B1,0x41B61435,0xAF923B49,0xC00B3091,0xBAC0B2B4,0x4A36B32A,0x1A8E019B, 0xA2C1A3B0,0x279A3142,0xB721363C,0xB9A027A6,0xA09F4626,0x2EC2CAC4,0x424190B0,0xC3A93C4A, 0xB3BEC2B0,0x2C41412C,0xBF39452A,0xA1A2B4BC,0x430CC7B9,0xA20E9146,0xC4B82E30,0xB09920A2, 0x3E4723B6,0x343125B5,0x35BCC09B,0x10B8C121,0x94A6453E,0xBBB63B27,0x411ABDC6,0x3C4080B1, 0x85B6B89C,0x389A2042,0xCBC3A23C,0xAC383AC0,0x143D3D3A,0xA4C4C920,0x38A1BEB2,0x1B364645, 0xC0B61836,0xB7A4ACB7,0x20411CB3,0x30064092,0xB1C1B28B,0x121F9BAF,0x1A2A4434,0xA6A69631, 0xB912A7B3,0x3F3EB5C5,0x168A1531,0xA9AFB626,0x813C2501,0xA21B2917,0x1A289091,0x2D05B3AF, 0x8EC0C2C1,0x369F3145,0xB1A53D46,0xAB97A6C4,0x474433B6,0x32BDB532,0x87B8C429,0xC6BAB291, 0x91224D14,0xB13E4439,0x8B16C9C4,0x3815A68A,0x0AB9424A,0xC2C2A82D,0xBC200CB6,0x29493CA1, 0x412BC0C0,0x95B1B2A7,0xB20C16AC,0x9422433D,0x052C2125,0xB02691B4,0x42AFC1C4,0x3A308C38, 0xB0C0C710,0x99201BB0,0x0A303E31,0x322B1F20,0xB2A59BA7,0x26AEA6B8,0x3BBFA743,0xBAB10647, 0xC2AFA7C4,0x48454297,0xAEA6153F,0x8193C2C1,0xC0B91C29,0xB0904B2B,0xB139312E,0x2235B2C5, 0x3B0AA093,0x379EB523,0xC5A81233,0xC3221ABF,0x3E4229AF,0x48369CB2,0x08A4B8B1,0x14B7B58E, 0x9C0A4249,0x29A5B7AB,0x8529A3C1,0x37C0C1B0,0x3F28A24D,0xC5BCAA3F,0x832236B9,0x2D282B0A, 0x1293AE37,0xB4B2ACAB,0xB2B43004,0x9BB3453D,0xAA34349E,0xB9A1ABBF,0x393839B2,0x9C1B0138, 0x0E1ABAB1,0xB71D231D,0x313EB2BF,0x17312323,0x0989BFB9,0x368094B2,0x3DA21034,0xA0808338, 0xB0B5ACBA,0x40AB1F98,0x33ACC036,0x9D9ABD36,0xB2AD1A93,0x24374438,0xAAA89923,0x872D0FAC, 0xC5C3B0A4,0x26B8491E,0xC11E4138,0xA236AFC2,0x3B311A9D,0x35240D29,0xBDB2B22A,0xBA358EB5, 0x274624AE,0x4220B2BC,0x8AA0B6A9,0x28A4B3B4,0x890D3F46,0x2AACB5AF,0x2C3D84B5,0x31C0BEAA, 0x3098A34A,0xC0B99F42,0xB2842EB5,0x232116AA,0x399CA139,0xA8BBB602,0xB7B03516,0xBCA2482E, 0x2C493A17,0xB6A9BEBE,0x2F288FC4,0xB18D3C45,0xAAABB391,0xB3292D97,0x4736A9C5,0x382F9A0A, 0x98B3C79F,0x1323251E,0x12983834,0x2028B58C,0x292DB6B5,0xB8BCAB25,0x25C69D81,0x932A4447, 0xC5B0A8A2,0x424134A3,0x8EAE1341,0xA0B2ACA0,0xC3B78620,0x0F3332AA,0x24313683,0x9101B9C2, 0x11252286,0x29302C37,0xB404981D,0x1136B4C1,0xB0138AB5,0x40A91D28,0x15A8152D,0x15A6BDBD, 0x21383637,0x32B4BB96,0x371CB031,0xC5B8A329,0x382FB494,0x37932933,0xB2B4139E,0xB5B4A2B2, 0x1929463C,0xB2921230,0x1F338CC0,0xC1A5099D,0x26212238,0xB8B23234,0x1336B3CA,0x334034A7, 0x35A5B207,0x2F08AC1A,0xA9AA9C87,0x163496A0,0x459FB8B1,0x0FA1B90E,0xB4AE8B85,0x11273F40, 0x95ACA421,0xA6352C96,0xC2C1B4AF,0x33AD4240,0xB4AF3D3C,0x9817A1C7,0x15371D99,0x302F1C37, 0xAFA8BDA0,0x002FB8BE,0x18453283,0x38918AAD,0x1EB4A3A8,0x229384A8,0xB397393A,0x28B9B99D, 0x2D369034,0xC1BABDB2,0x37153A36,0x18983537,0xB293B0B9,0xAA1F27AA,0x23113F21,0x13A5AA24, 0xA984B5AD,0x3A32B1B5,0x3D10372D,0xC1C0B184,0x403AB4C0,0x0838403B,0xADB7B6B0,0x2AA30490, 0xB9A11237,0x99B83B14,0x25A70EAA,0x1C0BB237,0x9415988A,0x25203089,0x9B9D3432,0xB19BB9A8, 0x36A1B0BE,0x2D35459B,0xC4B4B035,0x1D80BDAD,0x29454432,0xA2AB1285,0x9589B5AF,0x30A3BAAB, 0x040D3C96,0xBD841727,0x2A2DB11B,0x290BA021,0x9A9C2020,0xAAB6A527,0x84A21D41,0xA7C1B2B3, 0x304B32A0,0xBEA2223C,0x1EAAB5C0,0x2535348A,0xAA3A2AA1,0xB2A3A80C,0x3190AAAA,0x04429EA1, 0x0A839119,0x10C0AD94,0x459CB5B3,0xA133353D,0xBAB18792,0x2B972626,0xB9ACB021,0x85052424, 0xAEB5361A,0x9FA33090,0x2234A3A2,0x293420A8,0xADB2121C,0xA1959598,0x312AA296,0x323A28B7, 0xBCB8AF96,0x3FA4BBA1,0x36372C41,0xB2AF9500,0x889E90B2,0x37ABBBA5,0x25323703,0xC5971824, 0x9194A587,0x2B221723,0xA3253120,0xC2C19D03,0x96834033,0xA1B6A2A3,0x3343A082,0xBDA1213D, 0x3096B1C2,0x28413806,0xA52CB0AD,0x1F06B3BB,0x39828D14,0x9B26B921,0x32258FA4,0x11BA299A, 0x3ABEBA9D,0x0A301C45,0xC0B0AEA5,0x2B244205,0xBFB29833,0x1DA123A8,0xB5A44098,0xB02538A7, 0x2E23B49D,0x2C2B9820,0xB19F2423,0xA491A29B,0x3F9EB8B1,0x404296A8,0xB6A8B118,0x2BB1B9A4, 0x1E2E3943,0xB20D8AAB,0x232E15B0,0x9EC4BC82,0x16229C2C,0xB532283C,0xA3B028AE,0x35922699, 0x261E0F2B,0xB89E8893,0xA52736B0,0xBFB6A28B,0x3D31AB15,0x1F223929,0xAAB8AEC2,0x3E392121, 0x2D9CAA25,0x2481A7AF,0xB0A90B15,0x36ABAE30,0x2A9B989B,0xB8060C22,0xBABAB108,0x3216403B, 0xA70F2528,0x8D3905BF,0xAC8E2320,0x202E00B4,0xB33D8D1A,0xB633B3C0,0x26A424B9,0x39951D35, 0x92139C32,0xA1959CA2,0x91B4098C,0x42AAB036,0xA59B1341,0xB1BAB4C2,0x3D383727,0x9FA2013C, 0xA1A2ADA8,0xBCB61693,0x35153194,0x24273216,0xA212B2B8,0x8610A092,0x162E3A31,0xB41C1106, 0x3639B5C3,0xA89598AB,0x2AA702C0,0x94372743,0xB3B1BA10,0x3A252BA1,0x15BB8B37,0x17A8B73C, 0xAC099426,0xB4B124B5,0x19232938,0x1D0B122B,0xB2B4A0BE,0x1A4240B4,0xB4202531,0x2FA0B5B8, 0x99233628,0x3AB3BEA9,0x3B21181C,0x06AEB5A4,0xA41EAAAC,0x8F2D3122,0x18A32536,0x1AA0B09A, 0xB214A2A1,0xB7222BB4,0x12253742,0xADBDC184,0x3D361CB3,0x9F224441,0x97B2BBAA,0xAC289CA2, 0xB7229AC0,0x8504373A,0x27B41E1E,0x1421A4B9,0x373A2794,0x99AA1A3C,0x2EC1BEA5,0xA4181B3E, 0x1ABDC0B3,0x403839A0,0xC0A9AD35,0x8393B5B0,0x97334233,0xAB243BA4,0xA39CA792,0x3303B6A0, 0xA43F92AA,0x8F121205,0x88BEA819,0x4507B7B2,0xA52C3129,0xACAFA7A8,0x302A3434,0xC1AFAF9F, 0x25243E95,0xACB42929,0x01A9AA8E,0x2A2DA10C,0x162B119A,0xA19A058B,0x01039111,0xA8B1B093, 0x2F44881B,0xBFA62429,0x27BBA7C0,0x3D3E433B,0xADABB087,0x1492A5AB,0xACB99E26,0x3812BC30, 0x3082259A,0xB2A732A6,0x0FA0A29C,0x343F3033,0xBDA08699,0x163405C3,0xB19CA135,0x2E2CA3BF, 0x223F1824,0xA8B5BC9D,0x39A20E82,0x2DB11026,0xB4029136,0xB4218B9B,0xB2922BAC,0x27A83135, 0x8D063A25,0xC0B59FBA,0x203F3BB1,0x8B87A72D,0x3D13C0B0,0xA7122130,0x25C1B1AF,0x3032173D, 0x1B9DB729,0x8194ABB4,0x1826310F,0xA8A62431,0x9099A6A5,0xAB932910,0x99B5BBA4,0x3D2D4626, 0xB9B28A10,0x3132B4BE,0x19353C3F,0xA7B4B283,0x22189E11,0x2635BEB8,0x2737AAC7,0x2720952B, 0xA4BCA839,0x33160EA6,0x92323F36,0xB5BFBB94,0x20052C29,0xC7B42491,0x143C42BB,0xA7303C1D, 0x9CA6C3B7,0x24338A0F,0x183F2511,0xABA022AE,0x20A5A3A7,0x02B7B31F,0x24201C3C,0xB0AA3430, 0x24C0BFC0,0x39303041,0xB3B4A12C,0x171523AF,0xAD8A302B,0x36B4BEB0,0xA2222833,0xC3301925, 0x0C1CA0B5,0x433220A6,0x1E908614,0x0491B586,0xA0A71D2B,0x40B0C5BA,0x42281439,0xBEC0B81F, 0x0A2429B3,0x962C423A,0x8A0CAE0E,0xAC1E13B7,0xAB3D2DB4,0x9D3A96B2,0x3724AA9B,0x9FB7A3A4, 0x98A721A1,0x11283E3D,0x15B7B8B4,0x28139533,0xC2B49923,0x923445B0,0xA3323023,0x2F94C3B5, 0x23A5AB86,0xAE254027,0xB3A6028C,0x3626B1A2,0xAAA4A089,0x0FA63525,0xAC9F3F34,0x15B6C3C1, 0x3E3E032C,0xBCAC8F3D,0x93A61AA7,0x9A2C361C,0x0CB0B8B1,0x99A38534,0xB6223D2F,0xACADA2B8, 0x493C90B3,0x2B27A830,0x96B4BDAB,0x9B953637,0x3EC0C0AE,0x3738A93D,0xC6B4B336,0x928618B3, 0x0B364133,0xA68781B3,0xA2088DAE,0xA3332D87,0x3198B8A8,0x451B95AA,0xB5A79735,0xA619AEB1, 0x93323F38,0x84C0C1A7,0x342E9932,0xBDB0A529,0x313DA0C5,0x35323927,0xA4BCB5A9,0x948F1793, 0x86413C27,0xAAA4A3AD,0x2E9BA3B6,0xB4981F3A,0xAA31AABA,0x233F3717,0xA9C5BEAC,0x3BA22E28, 0xB1AB3941,0x962C04B6,0x242317A0,0x81A7B692,0xAC3321AA,0x1C3980A5,0x8CB0AEB0,0x3EA8AEA8, 0x118E3246,0xB3A69E00,0x1C3532B1,0xC4B79CAB,0x201B46AE,0xB4982F35,0x2227C4B3,0x3C3C1420, 0x13A78F20,0x99A2998D,0x318E9DA9,0xBAB7A616,0x80A21BA0,0x983B4139,0xACB3BDB0,0x3F3C98A0, 0xBEA1303E,0xAF3118B8,0xA4282C22,0xA5C0BCAB,0x32103410,0xB2963928,0xA084AEB0,0x3F24B5A3, 0x91902645,0xB4BBB69F,0x28403B93,0xC2B59522,0x42A594A2,0xB0A02C3B,0x1012BEC1,0x333827A0, 0x92AD9B08,0x15A00D2F,0xAC852032,0xB6AA06A2,0x06AC0122,0x92194011,0xB2ADA7B8,0x42440E9A, 0xA7019434,0x29B3B7B5,0x920F303B,0xA0C4C2A8,0x29273040,0xB7B0911F,0x2A9594B4,0x35302F29, 0xAF0F8A21,0xB0A5979D,0x1A42328C,0xBDC0BA99,0x3FA1A42C,0xA69F3A3F,0x9694B8C5,0x3F44389B, 0xB4C1B224,0x23AB902D,0x9A011F2A,0x9D93B3B0,0x231B2B34,0x9E9C2D2A,0xB19CA3BD,0x473789B9, 0xAAAD062D,0xA4B4A4A1,0x982F3938,0xB8B4B4A1,0x39223026,0xC0BC3229,0xA72A28C1,0x333D1D0D, 0x329EB895,0x26A49720,0xAAA10523,0xBAB3A523,0x2CA91C20,0xA7A73C3A,0xA9B2B3B9,0x3B432CA8, 0xB382141B,0x1C8A01A3,0xA2292F2C,0x22A1C1BC,0x33863213,0xB0B42302,0x9E9CA087,0x31320121, 0x02909012,0xB8BEA821,0x89413A0A,0xC0B59694,0x3AA127B3,0x0C393D39,0xB3A0B9B1,0x38338592, 0xB1BAAA34,0xA6B2041C,0x9031329B,0x8F1FA2B3,0x1D0C25B5,0x952A2128,0xB2A2A229,0x4318B5B0, 0x8B22923F,0xC2BAAC91,0x9B254421,0xBEAB2D02,0x1E39A1C2,0xAB3B1D2C,0x170DB9B4,0x3C1E07AC, 0x02AD072E,0x9FA40A2F,0x1904111C,0xAC951E12,0xB919A2B7,0x863D3D29,0xB6B9A800,0x401FB0B7, 0x15233440,0xB1ACADA9,0x30312E8D,0xB5B0B8A0,0x2438ADAD,0x22223529,0x93B195B2,0x32220BA2, 0x1E183037,0xB8A0808A,0x3C2EA9C0,0xB7119513,0x96A2BCC0,0x3933442D,0xBABC0029,0x321BA6B5, 0xB2153A3F,0xAD2A11AE,0x01331EA6,0x97A9A69E,0x3EB1B4A8,0x2B071227,0xB7A1952D,0xABB5B2A2, 0x2E2C433D,0xB1B0A71C,0x303AA2B4,0xA0242C26,0x2AC1BFBC,0x333A1835,0x9FB0B825,0x0481AD89, 0x042C2221,0x90251A92,0x90999399,0x1F14220B,0xC0B7B194,0x3C3AAAA7,0xA7913E23,0x9EB8ABBE, 0x37413A2F,0xA0A29722,0x26938DA7,0xBAA9282D,0xBF9C0DA9,0x20912B99,0x289986A0,0x98A9AD18, 0x25302684,0x8A2B3631,0xA3BFBBA9,0x1F24393C,0xBEBDA305,0x383A22C6,0xA8382938,0x9CB8C2AB, 0x33312F0F,0x1DA0A411,0xA0ACB32B,0x8C221622,0xB2082D9C,0x1D36B2BD,0x38331930,0xBEC4A48A, 0x3E309CBF,0x92343B38,0xB1B6B5B3,0x39363214,0xB4A08929,0x3CA1C2BE,0x1581362C,0xB81397AA, 0x8E92B1B0,0x30063437,0xAA9F262B,0x20329EAA,0x1F271C20,0xABC8BCB3,0x8B3C3C31,0xBD1F0835, 0x34AABFC1,0x3B25292F,0xAF8FA220,0x252995AA,0x96B79C1A,0xC0C11232,0x04083D2B,0x2A3C32AB, 0x0986B8B3,0x3214A008,0xA5282E33,0x18AAB6BD,0x1A1D9135,0xC1BFAE22,0x284033C3,0x9A3D2E34, 0x91BABF9D,0x2E122404,0x2421130A,0xA6A2A49A,0x9A8C1A19,0xB0203520,0x3310BAB8,0x41222F81, 0xC6BF9920,0x2D35B4C0,0x26373A31,0xAFC4B4A5,0x3628252A,0xA11E1C3B,0x28C0BDBF,0xA621243E, 0xC3313436,0x120AA8C2,0x443120A4,0xB3B50038,0x0DAAB6A8,0x3538361D,0xC5C5C1A2,0x34134092, 0xB2274334,0x009BC3C0,0x3E371C2D,0xB4AB2639,0x9F90A4AF,0x8A2D9295,0xB0B22128,0x1E29B5BE, 0x3C401E0C,0xA6BCAB8A,0x29AA8FA7,0x9D314041,0xAAB5C0B3,0x312D2217,0xBBA22A26,0x34ABB2BB, 0x2334333A,0xBBADA632,0x060094A7,0x3E2B08A9,0x95AEB623,0xA3ACB292,0x1B2B3D25,0xBFBDA988, 0x362E34A6,0xB42D3A38,0x29A7C4C3,0x413C170E,0xBEB39231,0x9F822197,0x0C26322A,0xA3B1B1B0, 0x2E97C2B1,0x42361C18,0xB6B69080,0x0DA2B1B7,0x0E414546,0xB6B9AC98,0x3F3914B5,0xB7AE9434, 0xADA0C5C3,0x36404224,0xA5B422A3,0x11AAB0B2,0x34322A30,0xB29F1E35,0xA7B9B7B0,0x17443B80, 0xC5B1A11D,0x462EC0C8,0x38344144,0xBDC4BEA2,0x36382AB1,0xB68A3336,0xAD9194BB,0x152B2291, 0x2995AE21,0xBDC0B591,0x2228442A,0xB6064131,0xAFB7C6C3,0x403D452B,0xBAB61B34,0x3E2DBBB8, 0x012F263A,0xBCBB9FA0,0x3719B0B8,0x25A3A51E,0xB5C0003D,0x84B29199,0x324A422A,0xB195A8A5, 0x361B9FB4,0xAB822335,0x05C2C3B9,0x35323228,0xB71D942B,0xA51587B2,0x322E3111,0x9395912C, 0xB6BBB8A1,0x37401198,0xB59C2207,0x23B4B5C3,0x28403E48,0xBBB9AD21,0x2D2B0CBC,0x22202213, 0xB2B59731,0x8696139B,0x18332C21,0xB4B3B3A1,0x223120B5,0xB991918D,0x1A1E298E,0x0A933225, 0x21260788,0x1E0AAC91,0x2D97A112,0xBC8A3033,0x83ADBBBF,0x8F1B3638,0xABB29C90,0x27159DA5, 0x1E2A2009,0xAC9A1112,0x2726289C,0x8A030824,0xB8B9B7A9,0x41359BB9,0xB338443F,0x83B9C1C1, 0x292F383F,0xBFB9AB1C,0x2F2C37A1,0x8596A218,0x9707A5A1,0x88ABA49F,0x86263421,0xA1AAAEAF, 0x3F27961D,0x9888273C,0xA5A0A5A5,0x00242413,0xBDB6A99C,0x353D90A7,0xAE1E3B2C,0x2AAFC1C8, 0x27272740,0x0DB0B894,0x36403C1A,0xB1B7B683,0x89141BA5,0xA9992220,0x2A1A0F99,0x091A121D, 0xAFA6A687,0x1F32A3B7,0xB0A12301,0x3192A6AB,0x00202434,0x22298696,0x86A8A509,0x1BA2B5AD, 0x2302232F,0x9B2E382F,0xB292A5B7,0x1614308E,0xA0ACA882,0x2F88969C,0x96078920,0x96A8A224, 0x31262905,0xB4A9A022,0x88A8B8B3,0x19233D33,0x00212120,0xAAADB09B,0x9F87149E,0x0A849B1C, 0x2A203723,0xAAA38796,0x87010707,0x2C94A687,0xB5B7B513,0x302797AF,0xA3043234,0x341991A3, 0x11221633,0xA7B0A79A,0x160B11AC,0x153B3F0D,0xAFB4BFA4,0x3892B9A9,0xA1962017,0xB591A6B3, 0x3B3C2C24,0x9E952C35,0x11ACACAB,0xA1312002,0xB70899A8,0x898034B1,0xA5133329,0xAE068F24, 0x27ADA195,0x241A8290,0xA4919712,0xA3819A93,0x292795A4,0x15912B16,0x23C1C004,0x30282334, 0xA9B89922,0x18050F14,0x32228406,0x9D231D23,0x9D00A6AB,0x882F2482,0xAEC3B3B0,0x3710AFAE, 0x85271437,0x09A42114,0x14283412,0x01918F2A,0xADB4A99A,0xAAAC0515,0x121F3731,0x9D86108E, 0x2A06ABB1,0x049D0F8E,0x91B3B182,0x2A279535,0x8B901930,0x859594AB,0x15238BA8,0x2190A131, 0xB2B2812E,0x91939291,0x9F2C1AA0,0x218221A7,0xA41C231D,0x249E1025,0x21949596,0xA9AFB6AC, 0x251EAD8D,0x201F2C8E,0xA3959615,0x32960535,0x958F2284,0xB8181293,0x04282C9F,0x92A3870E, 0x1C97ABA8,0xB4A02A2D,0x97B1259D,0x8B811A2C,0x0707AE9D,0x941E1D20,0x09991F88,0x25111F2C, 0x9B0D9D15,0x1B8583AC,0xB2A32220,0xA3A7A9A4,0x951D2121,0x102813A5,0x1D89A598,0x03139299, 0xA7102A1B,0x96AA1980,0x3029A582,0x2426A78E,0x9E8A2A9B,0xA18C009A,0x16998925,0x05A91F26, 0xA29A9B0E,0x1931AAA1,0xA5A39BB2,0xAEAD2D8F,0x90222E31,0x32290090,0x2389A290,0x93A99505, 0xAE222614,0x1A0517A3,0x0E819C0C,0xA4B8A910,0x86A0212D,0x20191523,0x9414A2A7,0x9B978D9C, 0x9C0B2386,0x9F1A1612,0x21978890,0x26169B21,0xA020900A,0x02151F98,0x9D972087,0x99A6ACA2, 0x06131101,0xA411210A,0x98198495,0x1D041213,0x99B39F14,0x9C001F85,0x8A261814,0x9B0D10A3, 0x1A061707,0x18A01E29,0x1583A117,0x1724A195,0xA3A1919F,0x8FAFA2A9,0x90A09B28,0x1780029D, 0x122B1689,0x1C141E12,0x81051519,0x9A951887,0x83019219,0x089AA68B,0x1D0D85A1,0x96148495, 0x09079292,0x069D910D,0x0810991C,0x03808A00,0x991614A1,0xA08E8291,0x0C9DA2A2,0x15271886, 0x10251E0E,0x1E1783A2,0x0D089C18,0x99A29204,0x8693231A,0xA0891511,0xA09B9CA2,0xA49DA00B, 0x98951A8A,0x141E248B,0x1B231299,0x03201080,0x06221604,0x8C89158C,0x0494A492,0x84929310, 0xAEAB9806,0x92A0228A,0x130A0320,0x8A979FA0,0x1B00200E,0x150C1024,0x0E069C97,0x0F099990, 0x91969715,0x8FA38E9D,0x1B071621,0x0D8D0A22,0xA39B9915,0x931D179E,0x12141598,0x88089D94, 0x090B1B00,0xA2979000,0x9AA6A495,0x12988C17,0x15801420,0x819E890C,0x1124100A,0x03181580, 0x1000919D,0x8C009691,0x9A110F03,0xA3A8A095,0x16A40809,0x9E841B27,0xA5140E9A,0x1F1A169F, 0x8C1A1704,0x90939203,0x14130E89,0x8D118907,0x93A19390,0xA306269D,0x098A880E,0x968D9092, 0x10159C9E,0x2823819A,0x2203961E,0x08948923,0x8E881A92,0xA4A09C96,0xA2069FA3,0x871B2098, 0x1B1E9100,0x2084908C,0x0F0B1414,0x820E2121,0x928F9109,0x8D969BA2,0xA0A3A295,0x1907A495, 0x1D241394,0x1C20120E,0x138B9992,0x90979319,0xA09E191A,0x8C18168D,0x2020818D,0x92971016, 0x859F9392,0x0D0FA403,0x92A49A92,0x8A9D929B,0x13131425,0x13171C17,0x22211B00,0x9E8D9509, 0xA2A6A898,0x89A3989A,0x12839A8B,0x1A8B021F,0x11822323,0x86192825,0x930F929E,0x8980A299, 0x99A08E93,0x8F200799,0x08808112,0x91A81C23,0xA59E020D,0x950D9596,0x0B8D0CA0,0x22191688, 0x14242224,0x178C0E23,0x0991930B,0xACA3A3A2,0xA6A39CA9,0x988B1203,0x1413190E,0x26238700, 0x24190E20,0x9A828411,0x8C8F88A1,0x8F0D1095,0xA19E9D90,0x132411A4,0x1C10211F,0xA6A29811, 0x85039CA4,0x171A0997,0x06959609,0x231B2516,0x03222125,0xA4A6A38E,0x9299A5A4,0x941295A3, 0x1C83A0A2,0x1A81111C,0x1A1A2129,0x0A8A0115,0x95139007,0x98920B98,0xA2A0A0A6,0x12A0A097, 0x20162227,0x83111B1D,0x999A9189,0x979D908E,0x84170F81,0x10938782,0x1B181513,0x101C1C1C, 0x99A0A08A,0x99A29090,0xA4940813,0x959F9CA0,0x1F140A04,0x1F182A26,0x0A208705,0x81819A92, 0x99909096,0xA49D989D,0x810D03A2,0x1F1B2210,0x1502860E,0x1A099503,0xA6848A14,0x97A09299, 0x1C168A9E,0x1B060B23,0x0E0B121E,0x818C9383,0x99949B9C,0xA29FA4A3,0x12218299,0x22112116, 0x83131E19,0x00088410,0x85928404,0xA8A49594,0x9B8B9EA6,0x150F8797,0x0B871A20,0x0A87221A, 0x101D0509,0x93978207,0x97888D94,0x0D078E88,0x8891800E,0x948A8982,0x118D9696,0x06908E04, 0x910C8017,0x8793109B,0x08038B8C,0x131D2123,0x0305211B,0x858E9D93,0x8A9DA391,0xA0959791, 0x05849EA0,0x07191592,0x04191211,0x16018F96,0x1710131C,0x94970916,0x0D888293,0x8D879501, 0x95900981,0x962003A1,0x06A09902,0xA19B0087,0x81028891,0x1E1C1008,0x030D1215,0x09131304, 0x06918601,0x94999205,0x92978A86,0x8203A2A0,0x8F958A8F,0x1715130F,0x1115180A,0x96888481, 0x8D8A8C8B,0x11028F91,0x84979410,0x0D890320,0x0E100E8C,0x9092A18E,0x93901207,0x9080858C, 0x098C9798,0x92080584,0x11151201,0x1B068491,0x840D900C,0x89960D1A,0x0689939B,0x91010A14, 0x95871002,0x8787919A,0x038E9006,0x00908D03,0x17189193,0x848A1188,0x95868314,0x0202118A, 0x02840383,0x87838A0B,0x1304028B,0x81849687,0x8C808202,0x90101490,0x8B940292,0x92888809, 0x0501108F,0x8004040C,0x910C120F,0x0E88918A,0x8D93858C,0x96879009,0x8408138E,0x1690900E, 0x95909004,0x0810078A,0x14128997,0x919A9112,0x0B858385,0x848E9304,0x86938A03,0x8D861685, 0x080A9000,0x9E900F92,0x191D028A,0x13100382,0x97978485,0x90848689,0x13809886,0x958F978C, 0x1186160D,0x010C8F00,0x829E9612,0x88161500,0x06150B86,0x8C959F97,0x85838986,0x0F070F8B, 0x86859584,0x069C0F1B,0x930C0489,0x0C999704,0x10090780,0x02078013,0x8596918E,0x93818D83, 0x87808D8C,0x0C94908C,0x14880B17,0x94130304,0x88958802,0x83020E88,0x86810301,0x888E9890, 0x03080B81,0x0C0C858A,0x0E840B0E,0x05030B15,0x8E8F8B8D,0x939C9D95,0x8E838491,0x0C070187, 0x11858386,0x04040F1D,0x09058004,0x889A9093,0x85018312,0x8E870090,0x8391908A,0x0B141001, 0x010A0A05,0x908F9493,0x8A968A8B,0x9080928C,0x0E93918C,0x170F1616,0x8615140A,0x818B890D, 0x8B0E028C,0x908C8991,0x90919E9A,0x04890504,0x90120F83,0x028C9280,0x0D941417,0x890C8E8F, 0x85959F01,0x03151482,0x8D008581,0x828F0092,0x90078789,0x0388910B,0x889B8396,0x130F091F, 0x07110905,0x8E939088,0x01079183,0x03948A91,0x94809384,0x0D000A89,0x0D0D8184,0x918F8F86, 0x8C921012,0x05078A90,0x008E888F,0x0A058014,0x13080F08,0x8E008B86,0x958C9087,0x8F97849B, 0x96048F8B,0x130E200A,0x10050212,0x95960001,0x06889408,0x0A00828F,0x86038711,0x8C850C8E, 0x85809290,0x8B859105,0x8703178C,0x0F948310,0xA2090689,0x170B0104,0x1B040981,0x81928016, 0xA3889301,0x849599A2,0x858E9392,0x12201A03,0x14101519,0x95888706,0x8E958C96,0x0485968A, 0x05861012,0x8C050084,0x008D9393,0x8A8B040D,0x071C068D,0x85910492,0x998A830A,0x0A0C8B92, 0x1B8E098F,0x8A0A0319,0x86908506,0x9B979095,0x918E8C80,0x18028095,0x811E8281,0x06900714, 0x07839193,0x05040581,0x850E0A11,0x928E8B87,0x92979398,0x94919392,0x16810080,0x13188012, 0x82841200,0x890B9789,0x08830693,0x8410038B,0x88818505,0x93968A85,0x95969190,0x11858792, 0x02100210,0x830C1602,0x00839393,0x84828B91,0x05081218,0x85021002,0x96949C8E,0x9696929A, 0x07198896,0x18131A11,0x8F101811,0x948A850A,0x85988298,0x00019102,0x05818108,0x8697928A, 0x90939382,0x1110180C,0x12100C0F,0x8F838A06,0x92968783,0x850A9098,0x19818605,0x82820E12, 0x9D889281,0x02929BA0,0x09899291,0x0614110C,0x10128611,0x8692098F,0x90080086,0x83088C05, 0x83961187,0x9C899593,0x848D908F,0x01080C93,0x1117131A,0x82851387,0x8D8B900A,0x8D958980, 0x84000683,0x00888F81,0x84959489,0x02848509,0x10128A82,0x100A0903,0x80068683,0x948F9090, 0x868F8E01,0x8B891087,0x86818688,0x0805948C,0x05868191,0x92131102,0x060B0C00,0x8D88088D, 0x928D8F0E,0x888F0586,0x8A8A828F,0x86898588,0x0B848508,0x0E00840E,0x078E0308,0x07838B09, 0x88048D8B,0x03848481,0x90838392,0x85868C81,0x850B8393,0x8582808F,0x850F0D07,0x890B0704, 0x0A8D0A84,0x90860006,0x8B870A09,0x93968C90,0x89949190,0x08018909,0x180F8100,0x19820111, 0x8E068508,0x8C8B9284,0x00878493,0x9681848D,0x9184908E,0x88930988,0x120C070F,0x020F0405, 0x04888710,0x878D848F,0x92000603,0x85828901,0x90878E97,0x8B8F928E,0x88880D87,0x0F0F000F, 0x05081710,0x07840A0C,0x90049187,0x85928F8D,0x948E8992,0x91059792,0x10890295,0x8309140D, 0x10151719,0x8C850E0B,0x938C8501,0x938C8896,0x8A899A95,0x008A8181,0x06110B8C,0x0F860110, 0x05050916,0x82101682,0x81089088,0x95979192,0x918B8E95,0x05120098,0x81080E03,0x0606120B, 0x8C0C1200,0x89030700,0x8790030B,0x8A909186,0x949B9792,0x90108497,0x18840D01,0x04111016, 0x85020915,0x87850788,0x85800083,0x8A86878A,0x9A9A9684,0x9384098F,0x15800F81,0x09800214, 0x8701151D,0x830A0B01,0x05839495,0x99988A02,0x908C8A93,0x8996900B,0x1090030F,0x0D110D08, 0x0F120A15,0x80870711,0x8A8F8D88,0x9191998F,0x03998B86,0x0E889181,0x1903900C,0x160F0203, 0x12018216,0x85048808,0x8E87808C,0x93849899,0x07909A94,0x08129996,0x1410818A,0x14181180, 0x07110F0A,0x8E80078D,0x9B848185,0x94908D94,0x9085869B,0x86110690,0x0211180A,0x0A1A1901, 0x0282010D,0x96970380,0x96830C04,0x85939093,0x97A08514,0x8081080F,0x1A919284,0x03860E1B, 0x1A181313,0x0C908505,0x9B979303,0x91989E95,0x0897A19E,0x05069501,0x24231D81,0x1B1C141C, 0x07171617,0xA5979795,0xAEA8A5A8,0x1C1281A4,0x090B1112,0x1B252421,0x99970512,0x108D979D, 0x950E2020,0x0A0F1088,0xA4A2968C,0xA4A49F9D,0x06060F95,0x26978E15,0x111D2D33,0x16048913, 0xA0998E84,0xA2A3A2A0,0x041F0E94,0x1994A09B,0x89061019,0x25188485,0x1F1D1D1F,0xA69E8917, 0x1002A0AA,0x920B8393,0x232495A2,0xA7970111,0x9395A5B0,0x122D2F20,0x21202813,0xA4971826, 0x9BA1A2A2,0x0E100991,0xACA38A16,0x10A1A7A7,0x129CA39C,0x2F2E2F2F,0x1A263332,0xAFB0AB91, 0xB2A5A1AB,0x272220A4,0x09881326,0x9DA19C16,0x0AA0A7A8,0x33312825,0x0A191E2C,0xA99DA095, 0xA1A7AAAC,0x19210F97,0xA01B2315,0x97ACA4A7,0x070D9382,0x3431302A,0x861C302E,0xB6B4B092, 0x909FABB2,0x1E110C9D,0x1627252E,0x86A39583,0x80919F97,0x81162622,0x0D162D10,0xA7A3A916, 0x10A2A3A2,0x850B9BA8,0x23218412,0x24038D13,0x01210C8C,0x93222019,0x92931499,0xB39F9091, 0xA217A2B4,0x03A01D81,0x15142814,0x1C242533,0x83A20911,0x9FB0A20D,0x139F9126,0x1D869DA3, 0x8785B199,0x1B100186,0x22311C93,0x223198A1,0xAA9C2401,0xAB0610A5,0x12030F0D,0xA6A32013, 0xB5AB928C,0x219F1198,0x25191129,0x2F1C2032,0x0F151C1C,0xA1A7B098,0x83B0B0A7,0x891FA190, 0x1508849E,0x232A18A0,0x21302E31,0x951A2413,0x959EB2B0,0xACAC98AB,0xA41B9190,0x30861712, 0x99991A1B,0x9D100221,0x26311CA4,0x15921426,0xACA52188,0x9920A7A0,0x94AEA3A1,0xB2A60091, 0x27273288,0x2428172E,0x1F952735,0xA1872191,0xA2AAB7A3,0xADB8B2A2,0x26101209,0x3225819D, 0x1C299730,0x22233628,0x9013929E,0xA2B7B49D,0xB09B9D0E,0x239290AB,0x1690A1A4,0x1B292336, 0x32302D00,0x2790A404,0xB4988D21,0xAA95A8AC,0x8AAAA3BB,0x9922050F,0x222E3222,0x32270A8F, 0x9B0E2726,0xB017890F,0x80A49CAD,0xAEA698A8,0xAA8C8F8C,0x32278EA7,0x22203027,0x9E252A2D, 0x0D111618,0x9DA99499,0xB3ACAAA1,0x910EB2B5,0x2089249A,0x1C303223,0x2C2B2D37,0x9A9A2122, 0xB4B1AB9D,0xA28FB4B9,0x0BA59797,0x12202998,0x2C331E2C,0x17112D2B,0xB2A0181F,0x9B8DA5B3, 0x94B1B185,0x06961A9A,0x29320189,0x20141F21,0xAA991021,0x902129A7,0x9D9FB00E,0x1EAC8583, 0x882995A4,0x1F248092,0xA2921090,0x901F2C05,0x84898B17,0x8E960615,0xA011A5AC,0x9C089BA9, 0x841D2B94,0x2C2E2E26,0x9E9D2231,0xB4AD9C8B,0x90A2ACB4,0xAC00230C,0x949014A0,0x3A1E2823, 0x88193744,0x1A8AA294,0xB1C1C0AB,0xACB0881D,0x3410B2B3,0x39929332,0x2A3B363D,0x3726A39D, 0xBDAD9C18,0xAF1593B8,0x02AFC4C5,0x9C0B1D11,0x3B494108,0x23151621,0xB7813937,0xA291A1B5, 0xC1C3B4A5,0xB3012EA5,0x3D0AACAE,0x03A43442,0x363D3D37,0x2FA2B587,0xB8ADA128,0x9393BCC2, 0x9DB4C0BA,0x153B3721,0x40402FA3,0xA406353E,0xAD15351D,0xB7C1BBB0,0xC2C2A788,0x383411B5, 0x368F9136,0x11323E3E,0x322C96A2,0xBCB7A419,0xAD8FA4B4,0x12B0B5BD,0x9B27313B,0x38322C98, 0x82A39E2A,0x102A302A,0x2196C0B7,0xBEB39D9A,0x1B3B26B5,0x20A59C94,0xA21F3B39,0x342E88A3, 0xAFBCA131,0x8E06A0A3,0x27A4BCB2,0x9825322D,0x2A2285A6,0xA4B38733,0x9A19311D,0x1DAFB192, 0x929E9224,0x301CA49A,0x96212118,0x97218DA5,0xB6AD0BA2,0x0F263006,0x29A4A085,0x93861736, 0x2C17A6A6,0xA7049991,0xA51118A2,0xACA483A5,0x2B11281E,0x2B908A31,0x8986032E,0x8292B7B7, 0xA01D2592,0x942A2B9E,0xB4B7880B,0x17A40204,0x321C2534,0x24269227,0xB8A8B0A9,0x8E3125B6, 0x91961594,0xB1A73035,0x29A7AAA7,0x10050830,0x92322B86,0xAEA49BA6,0x069C09A1,0x0E922733, 0x25181720,0xA5B7BC91,0x952489AB,0x112B1EA2,0x80122C21,0x8FAF9321,0x2428282F,0x889F9E04, 0xC0A4A09D,0x9EA3A0BC,0x30233026,0x218A2F3C,0xAFAA0330,0x23A0B3B2,0xA5142728,0x101E21A2, 0xA5B4A810,0x2D11890D,0x151D1628,0xAB021680,0xACB197A4,0x1BA3908F,0x29202C35,0x2902A202, 0xB2ABA21D,0x232984B2,0x8CAD1C30,0x0B980225,0x249DB8A1,0x3126A7A3,0xA32B301F,0x9F10219C, 0x99B7B7A8,0x3322ABA2,0x24362F2A,0x1129129A,0xB0AE9387,0x14020198,0xA113A191,0x9E02A9B7, 0xB397209E,0x3235338E,0x05963038,0xA3212621,0xB0A8AAB3,0x98A5A3AE,0xA6A5252B,0x27141513, 0x09A8A521,0x91060514,0x82112E25,0x1F8E0081,0xA2B7B21C,0x260C958A,0x21258316,0x2A189590, 0xA5A49E21,0x09119CAA,0x139DA49F,0x0B101021,0x172195A0,0x3133A0AE,0xB0042E27,0xA5143211, 0xB3B6B3AE,0x1897AEAD,0x9326352C,0x182E3926,0xA2B8AC20,0x098F9780,0x95A5A995,0x1A84A1A1, 0x2AADAA08,0x3634353B,0x1825182C,0xAFA0A6A5,0xB9B9BCBC,0x323013AC,0x3632A290,0xAB20332F, 0xA1121BB0,0x851D271C,0x8CA8A399,0xBDA71011,0x879C10AD,0x312A3132,0x07980F30,0xB3B0A412, 0x3683B9BA,0x23A49630,0x182F232A,0x9D92A5AB,0x3120A5AB,0x9C202E30,0xA61D85A1,0xAFA0B3BE, 0x282C3195,0x81813033,0xA6102E2A,0xACB5BBB5,0x94A41B88,0x1A14373B,0x1A99A685,0x05B3B204, 0x20213032,0x2F1DA797,0x8518B19F,0xAD98A9B8,0x282F2E90,0x13332E24,0x9EB0AF9C,0xBDA32A85, 0x10172F95,0x27A2A60B,0xA9A20A30,0x00861194,0x2B208997,0x30A0B316,0xA7018A1C,0x1522219D, 0x2B290192,0xB5BDAB22,0xB81A308F,0x109589B3,0x2D1D1F29,0x1D828329,0xAC892127,0x2591AEB5, 0x3098B384,0xAEA10F28,0x9330318B,0x2E06A3AB,0xB1B10833,0xA680298D,0xA1A21210,0x2781B2AA, 0x23050515,0x95183033,0x3328A5A6,0x0A93B7A5,0xB5A61794,0x2229298F,0x192D2717,0x9AACAFA5, 0xB0C1A225,0x2A32282B,0x2A2EADB3,0xA6952214,0xABB2021C,0x2436258B,0x9C2726A1,0xABC1B086, 0x93AA9D20,0x3542341A,0x37289BA6,0xA5B3AC2A,0xC1B1B4B2,0x213338B1,0x2F170125,0x0BBEB132, 0x9F113235,0x2A372D8F,0x93A2B3A7,0xBAB6B3A8,0xA4262DA8,0x33433F0A,0x07013126,0xB4C6BA21, 0xA1B2AB87,0x2F29A19D,0x3D2D9109,0x8A84A316,0xB1192811,0x10343597,0x208AB0AF,0xAABFB111, 0x8BB1082F,0x2B391406,0x1C2A91A8,0xA6B39F8D,0xAEAD121A,0xA12F380C,0x238B1115,0x36B5AA2B, 0xA5A2B01C,0x9924901D,0x213D22B6,0x8F9C83AD,0xB4B51430,0xAF213020,0x91039BB4,0x3A07A79F, 0x0C0FA422,0xB1143127,0x2C362AAB,0x2596AE94,0x9CB7A523,0xA4ADB38C,0x08231098,0x342D01B4, 0x20019932,0xB4A7131D,0x24842B12,0x29280A2A,0xAAA5AFAE,0xA7A5A0AC,0xA7A80133,0x17273F87, 0x2A990B23,0x86ADBB1E,0xA31E1E0E,0xA9312EA2,0x2C2E9BBC,0xA6991B99,0xAFA12036,0x14821E91, 0x1C1A8094,0x3627B4AA,0xAD869C9B,0xBBB9141B,0x37301799,0x3F2D2007,0x92A8B530,0x12A5B287, 0xB13023AE,0x1C1B2DA2,0xA9A8AB98,0x96B58B06,0x29992F42,0x1F322C20,0x088ABABB,0x9AB4B188, 0xA022362E,0x06303F2A,0x26ABBBA7,0xADABBDB5,0x19202124,0xAE213582,0x082A30A1,0x36A18120, 0xACAAB032,0xAEB298A0,0x2A202214,0x293911AC,0xABA78527,0xADB7AA07,0x0B158AB2,0x3A39291E, 0x012F9488,0xB99697B1,0xA0B82F24,0x0C2B3522,0x049DA117,0x309CC1A7,0x912A04A1,0xAD8F3E27, 0x1583ACA1,0x81279BAD,0x32ACB113,0x07191E29,0xB0303F12,0x2F20A8A0,0xA1A9B1A2,0xB4C3A321, 0x3714801E,0x22431FA0,0x20A3002A,0xAAA2B2A8,0xA2B01BA5,0x3722303A,0x9C359420,0xA0A4ACBF, 0x12AA8F1E,0xB8892E12,0x20B01B27,0x231CB421,0x281899B7,0x2A1D2134,0xB3A70D1E,0xA5062092, 0x3C24A58B,0xB0A8A9B0,0x909F1222,0x99302A16,0xA7803183,0x90BBB315,0x20A6A398,0x331C852F, 0x98312137,0xA02727B5,0x24B3AEA2,0x9595AD13,0xA99C2F24,0xA73090AA,0x8D2130AB,0x07AC3222, 0xA1B5BA30,0x17972419,0x30342530,0x9C3889B3,0x0EB7ADB3,0xB792A122,0x912A369D,0x14892319, 0x8E26AAB3,0x10961798,0x8D8E2038,0xB9A0239F,0x3600878B,0x3931AFA3,0xB493821E,0xAEA7181C, 0x922F14B7,0x2296849E,0x0404A51C,0xA92C3896,0x93B01738,0xA48C10A4,0x18ABA7A7,0x3410B413, 0x1937322D,0xB3A83227,0xA592C1BF,0x14811CB4,0x3439202F,0xAF918311,0xACB4270F,0x122D0696, 0x231E1B9C,0x35B3B620,0xAB29A823,0x949A30B0,0x952F90A3,0x9A181AA7,0x38A7B001,0x90321D2A, 0xC3AA3914,0x2E069CB0,0x31249E8F,0x25B9AC3A,0xA114B295,0x9C2535B0,0x2630910C,0x97078FA7, 0x1DA1AEA7,0xA2A3012F,0xB0303CAA,0x2B22A594,0x18A6AE9E,0x34AF9B29,0x96322438,0xB19293B9, 0x1A2EB3BF,0x322F1302,0x95BE102E,0x9B190A32,0x94392FB2,0x268BB0A9,0xA1B2AEA3,0x2EB6133B, 0x2D269B29,0x9D3913B0,0x2422A9AD,0xA5A9A8AF,0x11B12123,0x81212B40,0xB0280DBC,0x32A4BBA5, 0x010B2B23,0x9DB81226,0x30251535,0x94341899,0x0CB1BCB0,0x2528B2B6,0xB0A4402E,0xA2831C35, 0x0231A3B8,0x28B2A504,0x198CA785,0x8884322F,0x07AA1637,0x8831B4AD,0x3D87A0B4,0xB210A314, 0xB9B32B87,0x39213232,0x01329B1B,0xB3C0B8B3,0x2A0B2391,0xB19C243E,0x27AE2F35,0x3138B5AB, 0x22A5B1B5,0xA191A72B,0xB9233C87,0x0E1123A3,0x21A1A404,0x042D93A0,0xADAD9011,0xB7AB1D1A, 0x343A4505,0x2DA4B037,0xB5BCBFAC,0x241C0716,0x8523209C,0xA6172D9B,0x2A18101F,0x0692A106, 0xA09A9C03,0xB59D2491,0x8F3925B5,0x1EB61930,0x11912531,0x979CB295,0xA2A793A8,0x29403119, 0xA4A92189,0x99C0B40B,0x1E391A1C,0x041A298E,0xA316AFA6,0xA0A1349D,0x24991031,0x8F219411, 0xB8A99BAA,0x2B3398B8,0x1A003330,0x06B1153B,0xAE30B1BA,0x0E841EA9,0x2337280E,0xB0B02D27, 0xA1C2C2AD,0x20281184,0x133C3830,0x85A10984,0x048E969B,0x9A848E97,0x99A0171D,0xB39D888C, 0x3A322D94,0x10120F09,0xB1B8B41C,0xAFB2A7A1,0x334323A8,0x23344026,0xBEC0B491,0x24A3A5AB, 0x2B363637,0xAB992C2F,0xB7A2B4BA,0x399D87A4,0x9230932E,0xAEB72C1C,0xB0A1AF9D,0x40402BA2, 0x32300028,0xBBB7B5A4,0xA7A18497,0x2B30398D,0x273C2B2C,0xB2BEBAB5,0x8FBAB99B,0x29213838, 0x90363122,0xACB3BFB7,0x372687B0,0x312D3340,0xBEA4312C,0xB7B1B3BC,0x402CA7B7,0x24212135, 0xA2A31033,0xBDAFA9B6,0x383306B0,0x302F2B2B,0xA0A30030,0xBDBDB8B3,0x283B2BB0,0x2C273D37, 0xB4A99B20,0xAFBCBAB3,0x35362798,0xA1833936,0xB0989CA2,0x22B0B8B1,0x36342F1E,0x1D8F2240, 0xBA9A0A83,0xA7B8B5BA,0x3C3282A4,0x258D223F,0xB3A71A19,0xB5AAADA6,0x373617B1,0x36291A31, 0xB4A81E87,0xB6B5B115,0x333030A7,0x2A2B1A2C,0x96B0B3B1,0xBFBAB090,0x302D311F,0x333C2E31, 0x1FA49FA1,0xACB0BDA0,0x9A9A239B,0x19373925,0x2318A0A4,0xA7ACBDB0,0x07B1A299,0x1D3D3E23, 0x98023234,0x9B9CB2B0,0x17AAB2A1,0x21292E11,0xAD803839,0xA09DA6B4,0x05A0B09B,0x2C1B8CA5, 0x981D2938,0x8CA7A4A7,0x82250F8A,0x332882AE,0x9C252736,0xB3BDAA9A,0xA21208A5,0x2E078CA8, 0x98242829,0xAAB6AA83,0x092405A2,0x2C202931,0x040F1D20,0x919EA90F,0x1F9FA9AD,0x8F248E26, 0xA5A7A0A7,0x062186A0,0x350C8C08,0x0D302A2A,0xAFAAA581,0x05161E99,0x1F030E23,0x11851593, 0xBCB3B593,0x04A002B5,0x2A34312E,0x23222D26,0xA78A9807,0x8AA7A69C,0x19202B14,0xACA39126, 0xAFA7A3B5,0x32A4B1A2,0x3229252E,0x9F102525,0x1D189498,0x17151518,0x8A9F9010,0xABAEA49B, 0x92A7AB91,0x20310CA1,0x1C120E1D,0x2089180B,0xA1112028,0x242293A0,0xA4021007,0x9FACB7B2, 0x1A032487,0x9E871625,0x9C0F1C0C,0x230682A9,0x2918102D,0xA3962130,0xA99E9A94,0xABABAFB4, 0x331D99A3,0x94212328,0x0B099015,0x18303723,0x97A3A7A2,0x9AA8A486,0x90A68989,0x8A918410, 0x858EA49E,0x1D251992,0x1E8A8220,0x2E223132,0xB3AC9724,0x2104AAB4,0x98130002,0x97A0A49F, 0xABA8A093,0x26253091,0x2A302A2A,0x220DA113,0xBCB19C0D,0x211698B1,0x22323223,0xA3A6B1A5, 0xABAEA49A,0x148A1C9D,0x1C313231,0x86900792,0xA0A09A14,0x30929A8D,0x93192632,0xB0B1B3B2, 0x0B16A3AB,0x38341D82,0x99962231,0xA08DA0A2,0xA8A59492,0x3135269E,0x96022930,0xB4AD99A2, 0xA9B1B1B1,0x3735200D,0x8F82222E,0x920C058A,0x95A1A098,0x26262097,0x921A2030,0xA5802194, 0xB0B4BDBD,0x27180285,0x222B3220,0x82190928,0x8FAE9D99,0x202F2204,0x18099121,0xA2801D17, 0xB5B2AFB2,0x2094AEAC,0x04132D27,0x8B313023,0x1EAEACA8,0x23242F2D,0x8B91832D,0x970F1B19, 0xB1B1B0B3,0x8083A29E,0x0100149A,0x06170D18,0x2493101A,0x2D252D29,0x14129423,0xA9A5A103, 0x1FA1B7BB,0xA986891A,0xA51B2A80,0x252092A4,0x2A15191A,0x16241E24,0x9DA1A4A3,0x978887AD, 0x23282318,0xA2A78118,0xA8B1B3A6,0x20208097,0x2531382E,0xA3979081,0x94ACAE8A,0x2C800198, 0x222A242C,0xB2A9AA89,0xA4A192B2,0x2D140899,0x8D1D2C32,0x11108914,0x1510A1A9,0x8E191213, 0x82181F8C,0xB1B3AA95,0x8611ADB3,0x3316211F,0x1730352F,0xA4A51220,0xADABA6A2,0x3633269B, 0x91A2AC29,0xBABB950F,0xA392A8B6,0x3B2D2516,0x0B2B2632,0x12A0A305,0x00100A11,0x86050813, 0x86A4150F,0x028FB3B4,0x0B809D19,0x9526301C,0xA5A5A0A3,0x139E9D86,0x1702272B,0x232E228B, 0x9491A413,0xA8A9800C,0x85901D82,0x231F9593,0x168E9F00,0xA298A0A3,0x0D13859E,0xA502178C, 0x881E288A,0x80111215,0x20101823,0x91181423,0xB1B0ACA4,0x919298AC,0x32332929,0x83A49A1E, 0xA6B0B4A2,0x202121A2,0x35382913,0xAEA88921,0xB9B1A2AD,0x271C2C87,0x2920222B,0xABAD952D, 0x2513B4AD,0x3117AD9E,0x9C1F0E24,0xB8A019A6,0x21281AB3,0x2814262C,0xA59A2434,0xA2B2B0AE, 0x2A2697A8,0x152B3327,0xB8A11217,0x91B6B7B5,0x2D1F1808,0x30393232,0xB2AFA888,0xA0A1A7A9, 0x323C2D92,0xA817362F,0xB2BDB8B0,0x22AEB0A5,0x37353336,0xAE822A2E,0xA9AFB7BB,0x3884A2A0, 0x31333239,0xBAAE1733,0xB1A5B0BC,0x253322A8,0x25203433,0xAEB9A920,0xA2B8B103,0x32273121, 0x8A2E1621,0x95A6B2B0,0x09179EA6,0x262A341C,0xA0A38521,0xAD9F8087,0x8A3118AA,0x262B91A2, 0xA2B6B5A1,0x8D941F24,0x2E20262A,0x15ABAA25,0x0E0BA498,0x31371C9D,0x8B2E06A7,0xB4B4AAA4, 0xAFB20B8C,0x16203427,0x96102C2E,0x14A2B2A3,0x3080AD8B,0x26262336,0x8C9DAF9E,0xA015B1B2, 0xAB333894,0xAC3237A7,0x82B3A9B3,0x28BCAC25,0x298C3042,0x9B110730,0x1825B9BF,0x28380EB3, 0xAB132524,0xBB9A0DAA,0x82A50EA5,0x2EA0303A,0xA9A02C3B,0x9E08AEB4,0x442CB9C0,0x301FA42E, 0xBE9C3230,0xBC8730AD,0x268D90A8,0x16B59635,0x22A10F35,0x3425B20A,0x2A25B4B2,0xB1919EAC, 0xBC1E3F06,0x9F393DB0,0x920886B0,0x15BCA327,0x9DAA213D,0x3228A511,0x30B1C0B2,0x22988E35, 0xAB31331F,0x0B28A1C0,0x308FAFAD,0xA9A42F3D,0xBF2B3294,0xA6A803B3,0x3210060B,0x9787273B, 0xB99314A0,0x4228B2C2,0x372BA32B,0xB9BB1630,0xB4A79897,0x45369DA9,0x9699043B,0xC6B72C27, 0x2F9EB0B9,0x45401B0C,0xAAA18435,0xC6BB8AAE,0x313696BA,0x2A3F341D,0xB9B31324,0xABB9AD98, 0x443B2B1F,0x2AA1B127,0xB2CAB92F,0x05228A98,0x34473799,0xAB8C8CA6,0xB9BCB2A5,0x30422FA3, 0x0A2F350E,0xB8C2B118,0x14B29515,0x2E3C372B,0x2999A496,0x23BDC394,0x20299E15,0x923B3923, 0xAAA1A0B0,0xB0B5B4A5,0xA9303E24,0x95233D0C,0x27AEB187,0x119CA30B,0xA134361D,0x3185A7B1, 0x2AB3C10F,0xA686A183,0x86262C03,0x292C8F98,0xAFA4A01A,0xB6233891,0x250E3389,0x22B0A82F, 0x97B6AC23,0xA2A31119,0x3D2AA6A2,0x0521B39A,0xA61F91B3,0x27333310,0x1E282E30,0xBDBDB6A7, 0xBBB12A06,0x2F2D4035,0x0994A821,0xAABFC1B2,0x2D1E2905,0x42453330,0x929EC1AC,0xB9B6A9B4, 0x26404011,0x07363517,0xC6C5C1B6,0xA5B72193,0x40384042,0x2399A82E,0xA3B2BDAD,0x32301A17, 0x34432A19,0xBB8AB7BF,0xA2B4B0C1,0x19263D30,0xB0243632,0x9BBDB2B8,0x31B48236,0x26233C4A, 0xAA13A396,0x19B0C5C1,0x191C202B,0x963D2C97,0xA726B9C5,0x13A622AE,0x932D4441,0xAC0B372C, 0x8FBFC0B7,0x399E9D30,0x8D920B41,0xBCB0B3B4,0x3320AFB8,0x3035312B,0xA03D3623,0xB89C9AC0, 0x3A8EA5B5,0x960A3342,0xBDA92B2C,0x96B5C4C7,0x40A19C34,0x2932323B,0xB09F1C2C,0x139DB5BA, 0x172C2C20,0xAC343317,0xB4B1A6BC,0x10A59EA5,0x2820042B,0x8C1F302B,0x19A2B8B1,0x2F9FA425, 0xA0253032,0x9B1187A1,0x2E06AFB4,0xA18A0A20,0xB421341B,0xB18DAAC1,0x371E230F,0xA4893032, 0x93902128,0x10B9BDB0,0x3A231C36,0x23333132,0xBDB3B7A8,0x83A3BBC6,0x31342F21,0xB0293936, 0xA22121B3,0x9AA1AAAF,0x25852D2C,0x95243D3D,0xB8BBBCB4,0x23BFBDB0,0x393B3B33,0x1981B028, 0x303594A8,0x92A4B3B2,0x272B1B05,0xAF312600,0x9F1426B0,0xBFBAA3A4,0x17093522,0x911E8E21, 0x9A9B2116,0x99B4262B,0x10119126,0x3D22B1B0,0x1C128931,0x9CB7A41E,0x0B8AB9A1,0x262598B1, 0x00270D24,0xA01B3196,0xA783A392,0x903A34AA,0xAD932A98,0xACAD1618,0x24AF9E1B,0x21A4A713, 0x0BACA620,0x25A3253A,0x331AB29B,0x292BA597,0xBCA32210,0xA0363DAA,0x2F25B4B7,0xAD0BA09A, 0xB1A309A9,0x352E2CA3,0x23A09D37,0xB1B48C2E,0xAC0722A2,0x2A283024,0x92B29727,0xABB0A721, 0x958C98A4,0x3B22A896,0x36A4B023,0x21388624,0x212CADB6,0xB6A69BA5,0x070484A1,0x14443DA2, 0xB21C99AE,0xBFB81DAD,0x0CB01015,0x39283437,0xAFB29736,0xAAC21332,0x2F8AB597,0x462F9B25, 0xA7298E2B,0xAD97B2BC,0x2798B8B8,0x333D2491,0xB22B3484,0xB08692A7,0x8393309C,0xA1992233, 0xB0892699,0x889296AE,0x829E2B36,0xA8B69625,0x3310B1A5,0x321F9915,0xA5A12836,0x9B929FA1, 0x311AA9A1,0x8D0E0913,0x9B24241A,0x23A9B3B1,0x1A13AD93,0xA22E3115,0xA92326A3,0x12B09398, 0x05948B30,0xA41D2A1E,0xA48982AA,0x19A69C91,0x18931922,0x1B342123,0xAAB7A1A0,0x92B3A787, 0x34202A35,0x1D15A31C,0x8114B6B3,0x200189A9,0x27231425,0x1D27B0AA,0xA323099B,0xB5042BAA, 0x0B0F1B9E,0x920A2123,0xB71C328A,0x9FB5009A,0x0AB9A027,0x31118238,0x341A9A22,0xA7B19F1E, 0x03A1A382,0x2E24A2A1,0x2929968E,0xA52B0D9A,0xA8198DB1,0x2A15B3B5,0x28310A9D,0xA9223424, 0xB7922997,0x8FB01C81,0xB0981730,0xB310299C,0x209421AC,0x10B3A52D,0x2E9F0A33,0x23341530, 0x10B4AFA6,0x93BAB710,0x2A320112,0x333688AE,0x9B279FAC,0xB4903018,0x8F259BB6,0x122181B0, 0xAEA22E28,0x9C033022,0x17A98720,0xA6A1AB02,0xA51A3083,0x8C052707,0x23A6A913,0x3319A322, 0x11049C18,0x83ACA79B,0x1BA2B108,0x231DA199,0x2E362083,0xA61A281B,0xA8A3859E,0x0F26A8B5, 0x022E04B4,0xAA132702,0x9FA22718,0x90A61E2B,0xACA9861D,0x11A52920,0x11A21033,0x2D90B381, 0x0302A30E,0x192492AA,0x240C9D83,0x8F8CB3A4,0xA2282395,0x032D29A7,0x9E17352A,0xB6AC8610, 0xA71890B8,0x8B8584AA,0x1B813233,0x11AB1733,0x240C9C15,0x93B3B49A,0x25A6802A,0x05088728, 0x262895A2,0xA804A2A6,0x122D3085,0x1009A8A1,0x8D19A5B1,0xAE940D95,0x232C3B1C,0xA3A02231, 0xA9AAAB9C,0xACB5A3A2,0x32292E2C,0x3291842E,0x8C95AA07,0xAFA2ABA7,0x2F2C179D,0x21278F9A, 0x9C0FA190,0x992024A9,0x92932717,0xA9A90C20,0xA6A69187,0x23978311,0x23252430,0x01A6A681, 0x112499A0,0x221C83A0,0x2723B0A6,0xABA09D97,0x1A1B13A7,0x91292D1E,0xA39F211F,0xC4B6290C, 0x199315A5,0x23172832,0x1721111E,0x099FB09C,0x351CAFB0,0x291DB186,0x8214A18C,0xA29D2A85, 0x90121320,0x9EA1211E,0xB49D1698,0x80971692,0x26162727,0x22149014,0x949EB5A0,0x262695A2, 0x80322497,0x9BA8A4A2,0xADA9840B,0x13212194,0x2F232320,0x13B3A22A,0xA0A7B117,0x0A05A5A5, 0x26302F87,0xAE9A8006,0xA516218F,0xAF103491,0x80200AA0,0x2096A5A0,0x1985A113,0x8E2E9591, 0x22312BAF,0xA2A3090F,0x90B7B017,0x199A9902,0x0C211E25,0x122B3424,0x9D8D9C9A,0x8DA9BAB1, 0x21A88D8E,0x18353130,0x1E168D08,0x138AB1B2,0x9E82081A,0xA396180E,0xADA9819C,0x981A1886, 0x201A3530,0xA1812C23,0xA5B0B292,0x81A5B1B0,0x282E271A,0x302A0312,0x12089407,0x9E01A092, 0xA6AE93A3,0x0E2492A3,0x100E241A,0xA28D250F,0x1C0F1119,0x86938A23,0xB49397A8,0x8D1A14B1, 0x31333219,0x9697902B,0xB5B4A89F,0x0207A6B2,0x3633228C,0x1C1C2130,0xA4B3A511,0x0B920A1A, 0x9C850610,0x9513B0B3,0x312B94AF,0x251D1726,0xA4951728,0x9E9B1494,0x909BA79F,0x21959F97, 0x17921222,0x9D9D2130,0x12081611,0x0208A19A,0xA4A19C9A,0xA1912284,0x1B2B2710,0x2124A09E, 0x14A6A392,0x99A68F24,0x91841915,0x171298A4,0x28949C16,0x05AB8C2E,0xA4121B21,0xA8200DAA, 0x29219FB5,0x2B0C8923,0xAEA02731,0xB29207A0,0x102C1AAB,0x311F93A1,0x1BADB219,0x91AD072F, 0xA606302C,0x9C2A2093,0x978DA9B6,0x2D10A8AB,0x31131C30,0xADA22335,0xB4A51399,0x2323A4B0, 0x32299AA3,0x13A59828,0xAAA80F26,0xA41E2397,0x15222490,0x0A93A198,0x08ADA312,0x00A50E2A, 0x9A811322,0x0F23029C,0x243214A9,0x1D13A09B,0x9DB3A412,0xADA20E1D,0x8324298A,0x23281F90, 0x1E179685,0x0EA8B1A1,0x989DA385,0x90152817,0x13222614,0x81060210,0x9EA69F8D,0x999B9E94, 0x24259EA2,0x2A2E1806,0x98041414,0xA3AA9083,0xA3AB0514,0x95891115,0x282A1687,0x2720A495, 0x94929689,0xA9A40A15,0x9D961098,0x30208B00,0x221F861A,0xA28E0C16,0xA7A3909F,0x9BA70C85, 0x889D1524,0x1924170A,0x0C2B2285,0x98828B91,0xA6959CA5,0x0E1982A5,0x20241506,0x1C0C8B02, 0x04A4A20B,0x8FA08624,0xA0950008,0x0F1A809B,0x2A32129F,0x181D0403,0x97A1A69C,0xACB39A83, 0xA5052B1E,0x8E1F2D0F,0x2725059C,0x2E9EA982,0x90B0A531,0x9289968B,0x962C17A7,0x1D230A9D, 0xA5A30784,0x8EA31319,0x10918922,0x21088906,0x220DA58B,0xA2161408,0xA42020A3,0xA28E17A0, 0x9F991707,0x08A78715,0x26088422,0x2990951B,0x919A9F1F,0x9C2282A3,0x942B22A3,0x900486A4, 0x10AEA38C,0x1CA30430,0x0E110D26,0x972D91A5,0x93278DB2,0x9C0813A3,0x10972623,0x97B38332, 0xA2A10A28,0x2F1DB0AF,0x282AA1A1,0x02200B07,0xB1A92217,0x98942609,0x23980D25,0x14A2B285, 0x3016B1A7,0x96232825,0xB417330E,0xA6A193AD,0x3119A19C,0x268F9E16,0x95188E22,0xA21B17B0, 0xAE852F0E,0xA6A32205,0x13B7AA10,0x35151835,0x231AA71D,0xA9A0A7A1,0x89311DB0,0x9F962917, 0x92AB801E,0x29ABB091,0x242C1B30,0xA22F98B0,0xA48182B1,0xA0823203,0x01B1862B,0x2C9DA32A, 0x2308AF06,0xA01E039A,0x9E2D11B2,0x9EA32119,0x08A62629,0x28A28E30,0x0C19AC91,0x0E14B7B5, 0x93202F92,0xA481310C,0x94B49E24,0x2A859029,0x2786AA18,0x04299AA9,0xA92317B0,0xB59A311D, 0x0EA81D95,0x31AB9E2B,0x2511A92B,0x1818A68D,0xA52812AB,0xAD0D04B0,0x85823317,0x15871D25, 0x13B6AF27,0x1C97A61A,0x09949C8D,0x072B8AA0,0x9E29229E,0x9D872C00,0x81AA9185,0x9CA90923, 0x23179225,0x1F9DA38F,0x92198A90,0xA21795A3,0x0C221F9C,0x8E95231D,0xA9A50D10,0x22038483, 0x97A31124,0x80071006,0x0C16A2A5,0x1C17988D,0x1E95978E,0xA21F1F20,0x131091A0,0x9B89869D, 0x011100A1,0xA102130C,0x97172491,0xA9AC1916,0x0C852191,0x1B150A10,0x87ACA52B,0x1F9F9285, 0x18320E21,0x2294A6A3,0xA8128AAA,0x1B29A584,0x108C22A1,0xAA23009C,0xA8972728,0xA18B27B2, 0x9C259820,0x18A52F19,0xABA2A38D,0x298E8421,0xA2A70783,0x03109433,0x2AA613A6,0x91279E23, 0x14A99300,0x8C17A09A,0x2C189784,0x8C158EA1,0x111C9899,0x981687A4,0x041B1312,0xA3A21007, 0x1111A58D,0x21802711,0x998C920E,0x9E8D1C93,0x1604A79E,0x9787241C,0x179DA488,0x12201281, 0x14219186,0x960A08A0,0x8B970611,0x95909296,0x25A28D1D,0x2304950A,0x93109787,0x95110D1D, 0x9508238E,0xA2AAA295,0x24231297,0x01A29E02,0x8A969101,0x981C2724,0x1E9AB08B,0x2D148FA2, 0xAE99062B,0x923001B5,0x23311AA6,0xB6A41916,0x96911EA2,0x2D272D29,0xB2B39D1B,0x91A0A19A, 0x152B362C,0x9AB8AE90,0x3014A3A0,0x16292E33,0x9BACBEA7,0x2B150C98,0x9E2A221C,0x96A2AFB4, 0x242C2695,0xB1892E30,0xA19B8FAF,0x2E22191A,0xB5B10E2A,0x8F0B10A2,0x2929251B,0xA7B29D88, 0x10819310,0x8A241E19,0x1BA1B0B1,0x181F1D25,0xA1831914,0x808FA4AC,0x2223138C,0xABA89C1E, 0x151F13A1,0x111F2019,0xAAACA28E,0x2E231899,0x840B232A,0x95A8B3A4,0x29261C8B,0xA6831523, 0x909483A9,0x171B1704,0x8299A607,0x23139780,0xA7882224,0x9F9F99A9,0x29221A14,0xAEAC9720, 0x132190A4,0x93263223,0xA4A49FAD,0x0AA0998B,0x16243317,0x9C02941C,0x269AB0A8,0x18211C18, 0xA3A89420,0x24079D8D,0xA11D9316,0x018919A9,0x11152411,0x02A7A309,0x85140A0C,0xA9A11213, 0x20128696,0x21939182,0x9F959221,0x9F93900D,0x1C2B2BA1,0x93861213,0x8DB1A796,0x1D22840E, 0xA69E1324,0x1F0285A0,0x0C1A800F,0xA08E96A6,0x0B161485,0x179D851C,0x0C1E0710,0x99938507, 0x8C979595,0x8F8F8011,0x1C032227,0xA59A001A,0x028EAAAC,0x22272484,0xA1A49719,0x1C829299, 0x101D1A10,0x9394958D,0x95948605,0x83021288,0x1384010B,0x15089986,0x061E8300,0x8B839B91, 0x13151699,0xA4988F96,0x9390098B,0x83222D22,0x1098A499,0x21089303,0x889D921E,0x151B9291, 0x94949300,0x89891192,0x97202311,0x0280A4AA,0x1711130F,0xA4AE0F22,0x10110D02,0xA28A0601, 0x1F03969E,0x08202223,0x9EA7AFA0,0x25231D91,0xA59B1023,0x058298A1,0x11242508,0x0496A389, 0x198A8F91,0x9B998F1A,0x07130997,0x16211A14,0x9493918B,0x200B9AA1,0x989D8420,0x9B950C83, 0x061A1F16,0x1B889D97,0x0B019189,0xA0A39C12,0x19050894,0x9E1A1A12,0x9291A1A8,0x24231D0A, 0xA4A79318,0x0F029198,0xA216261A,0x0F87A4AC,0x2D158E07,0xA4A58A28,0x940A1197,0x1A2C2685, 0x84A5AEA3,0x1F959E00,0xA588282D,0x84099AA7,0x30288D9A,0xA0A39F15,0x97998588,0x981C291F, 0x048FA2A6,0x271C130B,0xA59F0E26,0x918499A1,0x21251D85,0x949D9989,0x87918104,0x98102522, 0x99919B9F,0x20839F9B,0x98980519,0x9B8F878E,0x131C0697,0x8F918603,0x99979083,0x1413148D, 0x90979214,0x829E998A,0x10242119,0x92059394,0x240E8A9F,0xA2861E26,0x99A0A5A7,0x25261A05, 0xA39D1522,0x0D8A0592,0x1416090C,0x9293968A,0x0886888A,0x071A1580,0x12168684,0x9D998109, 0x08060A93,0x86949411,0x93948E91,0x1B231788,0x0C029484,0x9EA09A03,0x0208949B,0x21849997, 0x91861422,0xA2182084,0x810386A0,0x238EA992,0x1308221F,0xA3021C16,0x868E909A,0x1502A4A2, 0x20219012,0x93102B10,0xA9958286,0xA0A69AA2,0x1890A2A3,0x2B212930,0xA7831D23,0x9795AAB0, 0x129297A1,0x11160819,0x1E232613,0xA6940612,0x9CA7A3A1,0x298F9D9D,0x220A1636,0x081F2116, 0xA79DA5A3,0xA4B0AFAB,0x2C332902,0x24253332,0xA6A5A201,0xA9A7B6B0,0x2C2880B2,0x23202330, 0x9E92282E,0x93139DA7,0xA9B0A8A4,0x1D1D9AA7,0x39341716,0xB0863230,0xBAB3A2A0,0x22AFB9BF, 0x35353238,0xA7173433,0x9EAAB1B2,0x009CA48F,0x9F2991A4,0x301086A7,0x27273635,0xB3A2932E, 0xB1B8BFC1,0x3531240B,0x0C314440,0xB4B6B392,0x1CA6B2B2,0x162D1C1A,0x1B010385,0x242E3121, 0x9EA29223,0xB1B9BEB5,0x29260A94,0x37423C1D,0xADADA425,0xB3BCB3AD,0x21008D88,0x262F1D15, 0x96282C26,0x19119FA9,0xA7A7B0A9,0xA0981B9A,0x3330332A,0xAE932833,0xB7B6B9BA,0x2E208DB2, 0x1713313B,0x1632352B,0xACA68110,0xB0C1C0B2,0x2E13A7A4,0x34362725,0x21303432,0xABAC9508, 0xBCBDB9B1,0x13331FB3,0x362F3420,0x1B021E34,0xB8AB981F,0xAEABB2BA,0x2F211F92,0x32281626, 0x161B2534,0xB4A59295,0x9FBCBEB6,0x352B0F85,0x27333133,0x92818D80,0xA2A1A1A3,0x9A898F9F, 0x96989799,0x2E382B0B,0xA4871612,0xAEB1A9A6,0x07131192,0x23242117,0x22018C03,0x9EA3A214, 0x9AAFA79F,0x86212524,0x10292495,0x13870712,0xA3ACB0A0,0x2084988A,0x85132726,0x1B1F1192, 0x15169E8D,0x9D9EA497,0xA2A197A3,0x2317048C,0x2726252A,0xA59F8511,0xA293959A,0xA2A0A3A5, 0x2F2A12A1,0x222E312B,0xA69CA580,0xA3AAA3B0,0x9DA28211,0x2C160614,0x2F30332E,0xB19F8A23, 0xB7B4B1B3,0x251CA0B4,0x32332D23,0x322D232B,0xB9B3A41D,0xA3B2BAB7,0x2A2909A7,0x30313835, 0xB39F2632,0xAAB3AFB2,0x0F93ADA5,0x0C182922,0x2C333122,0x968A9A0B,0xABB8B5AB,0x820697A5, 0x3B322C23,0xA4902538,0xB1A6ADAC,0xA18A92AE,0x1C122099,0x16223030,0x85181615,0x0CA4B1AD, 0x8A99A189,0x02030E17,0x251A1203,0x018D8B21,0x9C990A19,0x9190889C,0xA9B1A99F,0x2C202422, 0x252F332D,0xA1A29D14,0xA5B4C1B5,0x0C1B20A3,0x33392B16,0x292B2B2B,0xB9B8AC0E,0xB5A4ACB9, 0x372293A7,0x35262C36,0xAF0A2A36,0xB102B0B8,0x1CA8B1BB,0x25151C26,0x932C3A39,0x909A9792, 0xA9B5B5B1,0xA5212613,0x0E253000,0x3716911B,0xA0A5B182,0xAE021B10,0x981F17AE,0x2FA1A39E, 0x9C9B0A31,0x94203834,0xA38692A4,0x91B8BCB7,0x001C2534,0x25343821,0x15300C9B,0xB9BBB4AB, 0xA1B5A995,0x3736392E,0x372E0A2D,0xB5BCB422,0xACB3B1A5,0x263219AC,0x4038198C,0xAAA6273C, 0xBDB39803,0x889BA7B8,0x361FA29D,0x1C860D32,0xA0243837,0xA004A2B4,0x0CB0BBB5,0x92A20524, 0xA50B3F3A,0x32332C84,0xA1B2B211,0xB7BAB9AA,0x24313097,0x343B3523,0x14110B1B,0xBABCB280, 0xA6A0ADB2,0x433E03B4,0x2C343137,0xB8B38D20,0xB9B1939F,0x2D19ABBC,0x3E0F9424,0x119A2C40, 0xAA9B912A,0x9C06ACB7,0x1291A2B1,0xA3A02A2B,0x0E313933,0xA4AB0003,0x03AFB3AC,0x20A5AB10, 0x18322521,0x303C3391,0xB49C8E0B,0xA8BFBEBC,0x2B1C1415,0x2E313134,0x2C20A212,0x97A5AD91, 0xB1B5B9B5,0x2E33308E,0x31323433,0x11B2B607,0xA7B3A113,0xA29F9493,0x2F3186A4,0x31302121, 0xB1BF9E29,0xA4960F15,0xAF811683,0x3124A1B0,0x312A3136,0xC2B51832,0xACA69EB2,0x8F851E96, 0x3392A89B,0x2F3A3A38,0xC4B18419,0x9DA6AAC4,0x2D30331F,0x15A59023,0x1A20202B,0xB7A5841C, 0x1810B9C4,0x343B3014,0xADACA223,0x2624210F,0xA315221F,0x22A8C3BF,0x35321415,0xAA83262D, 0x1E17259A,0xB1A30721,0x9DC0C1B5,0x3E322F30,0x90182E3C,0xA9A1A2A5,0xAB8106A3,0xA1B0A3AE, 0x372A2923,0xA3803540,0xA4ACB8B2,0x302D90A6,0xABA1A78E,0x131725A0,0x92323C32,0xA0A7A8A5, 0x219CA09B,0x80A9B483,0x2E31240C,0x152D2328,0xB2B1A3A0,0x809FADB0,0x8F942326,0x2E169280, 0x27383831,0xBFC0BBA7,0x2E228CB0,0x9A1B312F,0x1F8695A2,0x978E2026,0xA9A9A991,0x091C2297, 0x990C211E,0x27049FA5,0x911D2C33,0xA1A5ADA6,0x2884ABB0,0x178E0626,0x9B15292B,0x1B1E1699, 0x93A3A390,0x9EB3B5A1,0x26303128,0x21313023,0xAFACA9A4,0xAAA493A8,0x8E810C92,0x38342B0F, 0xA7AB9732,0x98A1ADAE,0x220A9B92,0x2481A300,0x2C282526,0xB2A60E27,0x9CADADB0,0x1C190703, 0x11130A13,0x1922220F,0x98191E11,0xB0AEA6A5,0x162518A4,0x030D1C19,0x21201503,0xA19B8320, 0xB2A6A09A,0x292383AF,0x9422302E,0x84A29897,0x14901526,0xACB6AC17,0x2F0CA4A4,0x24353331, 0xA699A193,0x1484A9B1,0xA5A41513,0x209BA095,0x272E2727,0x959C0117,0x98870792,0xA49D9A9B, 0x231294A1,0x9E213532,0xA0A79CA4,0x1782A0A0,0x1B090D1B,0x08959518,0x221D1814,0xA4A9AB03, 0x1B2487A7,0x0321170B,0x02898B96,0x988F1E18,0xA6A18E94,0x1D1E97A8,0x94122724,0x90931402, 0x1B88010D,0xA195980C,0x98A0A1A2,0x2234268F,0x94908892,0x1696A695,0x93841C20,0x898AA5A6, 0x242E2B12,0xADA99420,0x15868A9D,0x8D998D1A,0x0690A3A2,0x2622181C,0xA7851921,0x959197A9, 0x200E8497,0xA0A08E1B,0x1D111C05,0x871E2524,0xA3AFA9A2,0x12161914,0x9F920410,0x1E840305, 0x9C97031F,0x03A39C86,0x25268593,0x1A100A15,0x9208928B,0x9B8510A0,0x8E959B95,0x2218028D, 0x93181922,0x8B8D96A2,0x938D9592,0x85A2A38E,0x25191A89,0x0F1A1B27,0x9596A190,0x91068590, 0x939F8A95,0x1C100186,0x10101421,0x99918102,0x0592A69E,0x9A930608,0x10888386,0x23242D20, 0xA09E871C,0x9DA39792,0x8E0C079D,0x0C838100,0x1C232620,0xA2948813,0xA1A7A3A1,0x0088A1A2, 0x201A211B,0x1C192425,0x9686821A,0xA39AA4A9,0x09918D9E,0x16161A19,0x141F1A0B,0xA2A6950F, 0x8E9DA4A5,0x06191710,0x20211101,0x03071522,0xA8A69B92,0x019DA19E,0x29221386,0x15111526, 0x83050E12,0xABA18980,0x90A09DA7,0x221C1311,0x1A1D1C20,0x918F020F,0xA3979A94,0x928B9EA4, 0x21201888,0x181D2321,0xA0998911,0xA09B9595,0x0A96A1A1,0x2520818C,0x0C202725,0xA2968705, 0xA2A19BA2,0x87A2A39E,0x271C1617,0x20262528,0x9F949581,0xA09A96A0,0x9EA19A9A,0x271F1D0E, 0x20211B24,0xA1A49116,0x9595A1A1,0x9A92949A,0x1712158E,0x1B212526,0x9FA10315,0x989AA29A, 0x8E979698,0x1D16088B,0x1A1B1E23,0x9E970812,0x9C9FA49F,0x8492949E,0x14100083,0x2020221C, 0x978A1921,0x9EA0A5A0,0x818D8F97,0x0D080080,0x20211D19,0x99861417,0xA0A2A19E,0x0403919E, 0x11038401,0x1D1B1F1D,0x93880A1C,0x9BA19E9B,0x1B079898,0x08101217,0x111B1B0A,0x8E8D0911, 0xA0A3A39C,0x108C9796,0x09141517,0x0D160B83,0x908E070A,0x9CA19C92,0x838D8E8D,0x11131B13, 0x0D0A1012,0x8D010E0C,0x90909896,0x878E8E8C,0x0A151283,0x0B0B1110,0x00080485,0x9A999589, 0x8A949A9A,0x0F181085,0x11050E06,0x0D141014,0xA19A9083,0x8F969C9E,0x130E8086,0x1510050F, 0x10161616,0x9E928303,0xA0A1A4A3,0x1B108C98,0x1615191C,0x13161D1B,0x9F928008,0x989BA2A2, 0x0C909C9F,0x1A1D1F16,0x05151B1E,0xA0948D90,0x9DA2A19F,0x0A909799,0x27251D16,0x1A1D2324, 0xA598920A,0xA3A2A4A6,0x859098A1,0x26211911,0x191E262A,0xA19F9808,0x9FA3A6A4,0x0A0397A1, 0x221A1309,0x20222422,0xA3988A16,0xA1A4A5A8,0x1807949D,0x1B141517,0x1417181A,0x9B8D0512, 0xA5A6A5A3,0x1989949D,0x1F212120,0x1A1F1C1E,0x9E938613,0xABAEAFAA,0x1D10849B,0x201D1D21, 0x151C2121,0x94989706,0xA1A4A4A2,0x8091999C,0x1014150D,0x2F2D230E,0x9C991226,0xACAAA59C, 0x8F9AA4AA,0x2A292510,0x161A1C28,0xACA99702,0x8E0090A1,0x08849391,0x08040C05,0x21201D1B, 0x94801518,0xAAA6A497,0x8AA4ACB0,0x24282215,0x21232928,0xA1918214,0x9C9B9B9F,0x9DA0A3A1, 0x18079399,0x2A282921,0x901C2328,0xA7AAA49C,0x9FA3A8AA,0x2112008E,0x1F252217,0x070A1420, 0xA69F0707,0x999BA5A1,0x200A9098,0x1B251A1E,0x83081A1C,0xA49D9597,0x9CA4A9A8,0x21818E96, 0x2126292C,0x86172421,0xA1A6A9A1,0x92959699,0x94910485,0x05030688,0x23232111,0x8F031A25, 0xADAAA5A0,0x8987A2AB,0x2A2F2A17,0x91802026,0x99A0A2A0,0x0D038F97,0x99968A13,0x1E0F9FA2, 0x1D262A20,0xA6900519,0x9AAAADB0,0x1C181207,0x20211C1E,0x8204900A,0x8A988A92,0x9E818080, 0x989F9F9F,0x23019296,0x18212C30,0xA79E9105,0x8199A2A5,0x19111107,0xA3968514,0x05101395, 0x1E131013,0x9F948611,0x04899CA1,0x181A1812,0x960D0787,0x9293979C,0x05870100,0x01858213, 0x0A000401,0x200F0E10,0xA0949218,0xA3A397A5,0x26188994,0x11202127,0x969B9994,0x00860304, 0x8F948904,0x81849290,0x17058108,0x02130F12,0x9B060A88,0x90958795,0x8787150E,0x110C9082, 0x1519110B,0x9B939195,0x9494A39A,0x1E1A1B82,0x221B2120,0xA19B9F13,0x95978A97,0x9798140B, 0x0896AB9C,0x2127210B,0x1D202B24,0xB0A49D03,0x93A2A9A9,0x131E179B,0x01041820,0x201D0184, 0x0814121C,0xAFA99594,0x8EA1A9AB,0x32241614,0x001B292E,0x94A29E83,0x8E909AA0,0x0894A087, 0x8D9FA098,0x29292314,0x1520252D,0xB0ACA79F,0x929BA3A9,0x2B281C91,0x99141A23,0x02852012, 0x8B150789,0xA8B0AC9C,0x099799A3,0x2D2D231D,0x1013252F,0xAC909FA2,0x16909DA4,0x9D9B9895, 0x181F0C06,0x211C1F0F,0x9306211F,0xA1A8B09B,0x0EA4A4A8,0x1F25272A,0x191C1211,0x9B98948C, 0xA3020A93,0x0EA6A399,0x1F178591,0x132A2729,0x90931786,0xA6A6A595,0x1390A69C,0x14170D9E, 0x1E121221,0x1E202429,0xA291959B,0xA8AFA7A1,0x218E9391,0x2820121F,0x9615191C,0x02088783, 0x979A999F,0xA3948192,0x21888E82,0x22910423,0x86228E09,0x949099A0,0x03000993,0x10131817, 0x9B92978D,0x92A01313,0x1C109693,0x80079C92,0x80182415,0x17000704,0x9A989C82,0xAC870595, 0x1E130FA7,0x0A92091D,0x19192026,0x87158704,0xA3ADA6A2,0xA116099B,0x09042509,0x248D9314, 0x0D0B1728,0xA0969B9A,0x908C9EA0,0x04920E86,0x03171212,0x01090384,0x0F088F9B,0x8B8C1A22, 0x94A39791,0x242C9797,0xA7A01400,0x9E97148D,0x251E860B,0x22119185,0xAC8F1216,0x13949294, 0x15039695,0xA9A09615,0x272713A2,0x11292513,0xA2A2950C,0x8D94929F,0x989E9F96,0x0E181205, 0x26211708,0x830D840B,0xA793111B,0x1712A5B5,0x89848B82,0xA1A41820,0x27282515,0x8F939901, 0x9AA0A695,0x0D26208E,0x81919CA8,0x86161622,0x9892098B,0x13820F94,0x9F988125,0x801C159D, 0x1A07948A,0x8499A18E,0x98231788,0x16101198,0x9396131B,0xA4A50918,0x2C13A59C,0x9A110711, 0x9608109F,0x17202414,0x94A9A592,0x119B9F1B,0x83211E92,0x0E120304,0x9DA11420,0x140DA2A5, 0x1F0AA48F,0x9D92858E,0x842D3117,0x9DA19392,0x11909296,0xA6020B1A,0x201791B0,0x19121A25, 0xA1A6A382,0x22302592,0xA5B29B16,0x14999D90,0x92202226,0x1513A0AF,0x1E1D2423,0xA69F9302, 0x8E82969D,0x86A2A099,0x25211E13,0x921A1C29,0x111091A4,0xAC9E8A92,0x93A2A9A5,0x22232E13, 0x13841028,0x82820C1C,0xACA29596,0x1300A6AB,0x25201083,0x0A170911,0x0D161919,0xA2A39492, 0x859EA39A,0x8A090C11,0x0B161B94,0x0A11121D,0x97950702,0x0B130284,0x979BA8A1,0x1A8A0F8A, 0x980C1A26,0x19830588,0x91900A1E,0x960DA1A5,0x09121192,0x9392879B,0x151C2120,0x929A9012, 0x168E8E9E,0x97869918,0x21838D97,0x9711130C,0x90050283,0x149C0511,0x12109C91,0xA3018888, 0x0400208A,0x8C871915,0x100C9E85,0x938A8288,0x9000849E,0x01200988,0x01931A11,0x078D1114, 0x0401A590,0x94108997,0x0B9484A5,0x0B191E29,0x8592938B,0x1E11088A,0xA7A3A083,0x11120492, 0x08801610,0x20120308,0x9E95901D,0x8993959B,0x9100008F,0x18020185,0x1B1E1721,0x97888588, 0xA1A79D99,0x21919784,0x191A091F,0x1A261C84,0xA3A28008,0xA3A6A39C,0x0616168C,0x2E1A078B, 0x84171D2C,0xA59EA096,0x9F9A8BA7,0x12901015,0x20241D22,0x8A828504,0xA8A59B9C,0x2204A29C, 0x1F212122,0x9D841D17,0xA4068F9A,0x9BADADAD,0x261F271E,0x232B2929,0xA0939A09,0xB2B3ABAA, 0x16809BAD,0x332C2422,0x16273237,0xB2AFA29F,0xAFAEB2B4,0x2107929A,0x3D383026,0xA2112633, 0xB7B1A8A4,0x99AFB0B3,0x3323888A,0x2A353535,0xA791181E,0xB1B5B5B2,0x14889BA7,0x312F2720, 0x1824272C,0xB3ACA28E,0x99A6B0B6,0x2D231F1C,0x232D302E,0xA5A29804,0xAEB1B2AC,0x2115019F, 0x35343023,0xA0001C2D,0xB4B1AFA6,0x87ABAFB4,0x34312620,0x1C303537,0xAAACA594,0xB4B7B5AD, 0x2F2A87AC,0x35363631,0xA399132C,0xB6B3A8A2,0x1CA3B3B6,0x36322929,0x032A3535,0xB3AC9294, 0xA3B4BAB4,0x2C2B1998,0x31353632,0xADA01A28,0xB3B7B5B0,0x2495B0B0,0x34352F2A,0x97273633, 0xB1B2AFA5,0xAAB5B9B3,0x30282483,0x2D3B3A36,0xA7A7A011,0xB5B9B2AC,0x2219A1AE,0x36383322, 0x91932235,0xB6B3A896,0x10A5B2B5,0x32322920,0x81243234,0xB1AC9980,0x9FB3B6B7,0x31302014, 0x21293334,0xB0A78A10,0xACB2B6B4,0x2B2C1898,0x2C262E2B,0xA9961627,0xADB0B1AC,0x221A96AA, 0x23192323,0x9D00252C,0x9B99A5A5,0x0E1299A0,0x02871C08,0x96940C1A,0x008C9F97,0x1E20150F, 0x05800C05,0xA99D8512,0x809CA8A7,0x292B2085,0x82151F20,0xA3930014,0xA4AAA9AA,0x28211296, 0x20261725,0xA301201B,0xADAEA2AA,0x3008A3A1,0x13250825,0x951D311A,0xA4ACA49B,0x91A5ADA6, 0x23221B1A,0x28312D22,0xADA79983,0xA9ADA7A9,0x2908A093,0x30322921,0xA5891F2A,0xA8A9A4A5, 0x8EAAA7A5,0x302E1910,0x08242A2B,0xA3A09693,0xAAADA1A2,0x28149AA1,0x24272E2F,0x9C840C14, 0xAAA3A2A5,0x09A5A7A3,0x2D2C2620,0x0821231E,0xA4A2A000,0xA9AEA9A7,0x2325139E,0x262B2B24, 0x90978C24,0xB0A8ABA4,0x0E068EAF,0x25222020,0x170A2630,0xACA29584,0x919CABB1,0x1E0E8612, 0x231F2922,0xA2072022,0x96ACB1A3,0x16939483,0x05211795,0x1829231C,0x9BAE9A08,0x8C849098, 0x8B179C98,0x2415118B,0xA2861816,0x8B169097,0x82989092,0x10880E8A,0x97000224,0x210D919D, 0x9F0A0B8B,0x98939090,0x8095211F,0x1F949F94,0x881C8224,0x9593899B,0x0C081196,0x9A9AA090, 0x231A1C1A,0x848E0911,0x8A88A095,0xA0989F8F,0x231A199F,0x891D1A1D,0x01898D0D,0x9F9D8F91, 0x840390A5,0x16191820,0x078D120E,0x8F818A80,0xA09AA398,0x20151D85,0x97900905,0x8183001E, 0x9A931095,0x17959997,0x840C8323,0x15030697,0x060F8E82,0x9C98920E,0x1F17078F,0x97891085, 0x130B9C88,0x0A811611,0x94919390,0x13210F07,0x9AA78A03,0x18188A92,0x8D800020,0x160198A4, 0x9C182614,0x96A1ACA1,0x14062611,0xA0929310,0x26248A9A,0xABA91020,0x041591A9,0x1F161924, 0x94A29D97,0x0A222520,0xA3A7A601,0x251306A5,0x9D1A1627,0x88920F98,0x1381201F,0xA0A6B19C, 0x28231983,0x97131606,0x09929207,0x9194141B,0x979BACAE,0x2424211A,0xA0841A14,0x08A09E96, 0x89070C19,0x9B98A0A2,0x2825200E,0xA295950F,0x0EA09D9A,0x0821241D,0x939AA5A0,0x1C221908, 0x9792949E,0x1216110B,0x92051B1C,0x93A3A5A2,0x21250D80,0x09900A03,0x8E088A13,0x941F1889, 0x99AFA8A6,0x2E2B0B02,0x9C8E2326,0x9692A39E,0x86160E90,0x9B9F91A1,0x28210116,0x93962022, 0xA28B969E,0x0B8C9E8D,0x09072003,0x0A20938B,0x828A1B0D,0x97939A93,0x880C0B03,0x108B0E89, 0x11239286,0x0B971404,0x92A19A92,0x97211221,0x1E8297A8,0x10180006,0x90971C20,0x9B969082, 0x9607008F,0x20969F9E,0x03252324,0x8C960004,0x8F898C9D,0x9886920C,0x01988E9A,0x1C302287, 0x8B9A0225,0x8BA2A0AA,0x9B211315,0x8B991912,0x292297A7,0x9D93132E,0x92A092A2,0x88231A81, 0x88868D85,0x0400829D,0x0880242F,0x9FA1A0A0,0x1A1AA1A0,0x92922423,0x99118E9C,0x2E230F19, 0xAEAC140D,0x990CA5A7,0x12082220,0x87211BA3,0x18979821,0x908C2520,0xA192A6A5,0x271B928F, 0x8E0C2203,0x8595A21A,0x1D172286,0xAB979A93,0x1E02878E,0x85172622,0x9AA0A092,0x1488879A, 0x9F142327,0x0E9EA5A5,0x26298106,0xA2A4160A,0x9482A19E,0x242A2018,0xADAB8D98,0x20119F99, 0x10022722,0x9404A485,0x18131F8F,0xA7920F11,0x278DA3A0,0x801D0718,0xA2931012,0x201012A4, 0x84189F18,0x9AA6048E,0x0A211318,0x1A991706,0x9C85A798,0x10888210,0x9609208B,0x1A929309, 0x11150100,0xAB82111E,0x09A108AB,0x15149321,0x90811D11,0x0B11998B,0x1D801D00,0xA393A306, 0x2311130E,0x0C138191,0xA0A3998E,0x01171208,0x9109141B,0x141092AD,0x90991528,0xA68B0F18, 0x248699A6,0x0D1C1880,0x9EA6AC1D,0x1F19298C,0x1711900C,0xA19F9A9E,0x0622121B,0x859B2206, 0x0815A9A7,0x9B852620,0x9A101305,0x2795959A,0x950E0417,0x9BA59F19,0x122820A4,0x2499970F, 0xA4860E10,0x88178915,0x84941BA6,0x210AAE92,0x9F93241E,0x94288297,0x22A39097,0x958E860A, 0x84928722,0x092216A1,0x2196901E,0xA0961110,0x8913988A,0x118716A2,0x8D85A513,0x1F08211E, 0x84241394,0x9DABA796,0x03928792,0x8A241423,0x251613A1,0x96988012,0xA9A3A013,0x231990AC, 0x1F292317,0x93A69924,0x888D0198,0x9414A19C,0x188C91A3,0x22182327,0xA7030C23,0x1291A2B0, 0x8C8F8E8C,0x93121316,0x201C0D87,0x9C021E03,0x98A6A38D,0x8200098D,0x11131C17,0x8102928C, 0x148C0F22,0xA29C8600,0x009EA8AA,0x231F1121,0x141D2018,0x93899191,0xA3958683,0x83A6A7A3, 0x1C201590,0x1B2A292E,0x99A89495,0x9C9FA89C,0x8E899896,0x27131483,0x24312E28,0xAEA5A60C, 0xA2ACA8B1,0x15201E89,0x19241019,0x24202A1D,0xB0A0031C,0xA4B1B3B0,0x2826128C,0x1C16281C, 0x0D089424,0x9091160C,0xA7A8B0A9,0x1F1701A0,0x2120282D,0xA18C1407,0x0385A099,0xA1A2998D, 0x178F919E,0x24332521,0x009B0A10,0xA4A0A79C,0x8F151291,0x0994A092,0x25222887,0x97051831, 0xACAE94A1,0x24179DA4,0x96029321,0x1B8D1F92,0x882A221F,0x989FA2A0,0x849DA4AA,0x89222424, 0x138A0090,0x1C160281,0xA5A39318,0x9BA99896,0x2B2E0982,0x859C171B,0x95099410,0x93002085, 0xA38AA5A5,0x250195A0,0x8018322C,0x8A0C9F83,0x168B949E,0xA1A09E86,0x0B9D9883,0x24302C11, 0x96A19B1C,0x99998899,0x9E80030E,0x86968CA1,0x24271391,0x99921B32,0x979596AD,0x101C9995, 0x07A29200,0x07168E88,0x1E262C25,0xA1A7A89E,0x829B9191,0x9B821111,0x1109840C,0x281B2389, 0xAC989D25,0x029985A8,0x84238A89,0x129D838C,0x051A128E,0x00111727,0x97A4A3A9,0x1A0A911A, 0x93991687,0x81159C14,0x24092187,0xAA9A9F12,0x0A810E9F,0x8C1E8701,0x0C93118C,0x011A1088, 0x948C1322,0x839BA1A8,0x1A888A15,0x90080804,0x17138E13,0x100A2083,0xA2A2A681,0x9105129E, 0x12130F18,0x05901291,0x05219016,0xA1A31607,0x0B85A2A0,0x1E041181,0x96198A18,0x15910689, 0x8F030701,0x989CA190,0x071B0A91,0x13842115,0x9690948C,0x03128910,0x9C991290,0x1C899A8D, 0x0C1B1202,0x97848914,0x8096129E,0x080E9415,0x91939295,0x12138012,0x118A220E,0x9387A68F, 0x04890A83,0x99060B02,0x20948D00,0x87201400,0x9F989511,0x039208A4,0x1218851D,0x9492129A, 0x09169511,0x00981980,0x969BA694,0x1B131B10,0x90138385,0x089B900C,0x97151390,0x95998C0A, 0x181702A4,0x90120321,0x01951B02,0x01089993,0x87938704,0x94959790,0x181F1C1E,0x1E91018B, 0xA6939709,0x88000E91,0x85058494,0x211C9590,0x9194211D,0xA3160992,0x12A1A2A0,0x81820710, 0x8B00091A,0x18202208,0x90A0A194,0xA5A39910,0x1A1B1593,0x1A201086,0x0B848F14,0xA4A1171D, 0x8A0F9AA6,0x168D9B99,0x18102122,0x8D081B22,0x05819D97,0x96A8A5A0,0x98081408,0x2A231B16, 0x10141511,0xA6A4A385,0x9B908EA2,0x20138EA1,0x20211C23,0x8B051B1D,0xAAA49B8E,0x9296A2AC, 0x2010120D,0x20222327,0x9D0D1317,0xA0A8A3A4,0x98A2A4A0,0x2B211915,0x14202127,0x98811181, 0xA4ABA9A2,0x878F9A9F,0x2828200A,0x24252121,0xABAA9F11,0xA6A29FA0,0x251299A7,0x2124292B, 0x9B0A2221,0xA79DA5A1,0x05A0A2AB,0x1F222520,0x1B1D1121,0xA3A49481,0x88929EA1,0x11180D90, 0x0B84121E,0x95040500,0x0282919B,0x93968A8C,0x93071317,0x1B091586,0x87899108,0x9F9F9A0C, 0x108A8799,0x22171317,0x800E0F20,0xA7A49985,0x0190A7AF,0x29252316,0x16212629,0xABA6A100, 0x96A9ABB1,0x20211512,0x282E302A,0xA4A2980F,0xA8AAABA7,0x1F1E05A2,0x30292120,0xA2A08D24, 0xA69A8698,0x180EA0A8,0x110B1016,0x93082018,0x1119858B,0x96A5A09A,0x9C88110B,0x111D1183, 0x13061203,0x9E98041B,0x9984909A,0x17949DA2,0x1B1D2322,0x95811720,0xA2A5A4A0,0x0A929398, 0x1A2B2712,0x09100717,0xABAC9881,0x8E9699A5,0x2B281510,0x11182129,0xB4A70C8B,0x0196ADB0, 0x29130008,0x19242A2D,0xA68E130D,0xA5A9AFAE,0x11990186,0x272F2821,0x8B0E161E,0xACAAA7A5, 0x819B9F9B,0x27212312,0x8A181A29,0x9E9B999F,0x969AA4A4,0x19202104,0x060B1F22,0x9595968F, 0x9BA4A495,0x1B222103,0x0B161520,0x939B9396,0x99A1A499,0x1C1F1E0B,0x12101521,0x96988E8A, 0x9792979B,0x20009285,0x18141614,0x97880317,0x92998900,0x0C8C929E,0x8C15840E,0x20801103, 0x8E150913,0x929B8302,0x9F98A3A1,0x2816858D,0x101C2923,0x950A8F11,0xA4ACABA8,0x21129898, 0x24222A24,0x931F1A1F,0xB0B3A89D,0x1B0C97AE,0x2B252728,0x8A142027,0xB3ADAC98,0x1C09A1B2, 0x2B282729,0x0A122724,0xB1ADAB9A,0x189AA8AE,0x252B2923,0x10262829,0xAFB2A595,0x04A1ACAE, 0x292C2220,0x122A2A28,0xAEAF9B94,0x939CAEAB,0x2D15150E,0x23292121,0xA29E9818,0xA7979FAB, 0x06928A9B,0x211A2722,0x90980D2E,0x8897A1A3,0x969EA785,0x23191596,0x9320261D,0x10810A09, 0xAEB0A382,0x22199DA3,0x1E272D21,0x10120A1F,0xAEABA198,0x110AB0B3,0x2C272D20,0x111C2B2D, 0xB6AF9B10,0x85A6B6B9,0x3430231C,0x182D322F,0xB1A79C04,0xA6B7B9B7,0x2A302785,0x34343131, 0xACA9A521,0xB4B6B6B5,0x262911A7,0x322E3332,0xABA01D2D,0xA2B0B4A5,0x1B91ACAD,0x26302917, 0x911D302E,0xA8AD9695,0xA3A8AA98,0x291E8EA7,0x2B302F2B,0xA1908022,0xB0AAA3A5,0x08A4AFB3, 0x353B332B,0x8C02272F,0xB6B3A494,0x8BB0B8B5,0x3734311E,0x16303036,0xB1A9A1A1,0xB2B7B7B6, 0x342A228E,0x30343A39,0xADA49E1D,0xB7B7B7B3,0x302301B2,0x302A3336,0x9A062732,0xB2B0ADAA, 0x0CA9B4B3,0x31251E23,0x303A372D,0xB6A9A015,0xB3B3B1B5,0x2D1298AF,0x3E36323A,0xAE9B2133, 0xB3B0B6B6,0x92A0B0B5,0x32343B2A,0x05303235,0xB1B8B5A7,0xA7B4AFAB,0x3C351892,0x262D3034, 0xB1AD9C14,0xAB99AEB3,0x2F84A4AE,0x172B3437,0x91172922,0xACAEA6A3,0xA4AEB1AE,0x2E33311D, 0x302B2F27,0xAEB2A824,0xB3B3B3B0,0x313005AD,0x35363229,0xA7930B34,0xB8B7B3B3,0x159AA6B5, 0x38333430,0x11303134,0xB8B6B5AB,0xA4AEB1B5,0x352E2B13,0x24383332,0xB1AFA182,0xA4A9B1B5, 0x201D9399,0x28333424,0xAC922225,0xA6B2AAA8,0x108BA3A1,0x2F301B02,0x0417272E,0xA9A5A29A, 0xA49BA1A5,0x2F08009F,0x2025242C,0xA0A00D23,0x9A85A6AC,0x0A9EB0AB,0x22303320,0x80232121, 0x98B1ACA2,0xA2A9A591,0x33371E96,0x98132126,0xA8A88C80,0xA0999BA7,0x3092A59A,0x08223135, 0x94058782,0xA1A8ABA8,0x1397A2A2,0x2130372B,0xA0898E13,0xA9B2AB9E,0x07959891,0x35352E19, 0x8A979025,0xB0A7A395,0x9488A0B1,0x322B1290,0x941D3134,0xAEA69790,0x9FAEB2B3,0x2A131182, 0x28323737,0x9C97A386,0xAEB7B7AB,0x8A9381A2,0x393A321A,0x1915032D,0xB9B29D12,0xA3A5B1B5, 0x322495A0,0x21313735,0x9F192424,0xB1B8B5B1,0x90A7AEAC,0x3233311E,0x282D2E30,0xAFB1A712, 0xA9AEB2B0,0x292703AA,0x302B252B,0xA901202F,0xACA0A2AF,0x15A6A5A6,0x12141D25,0x161B2217, 0x8199A5A0,0x99000809,0x110D220C,0x918C940E,0xA1A1A39C,0x20221198,0x24211D1D,0x9D122119, 0xB1AE9A03,0x95A3A4A8,0x2C1E8301,0x2F292D26,0xA3071927,0xA9B4AFA9,0x99A1A7A8,0x302A2001, 0x232F332E,0xAA9E0E20,0xB0B1A9A7,0x049AA3A6,0x2E28191A,0x222C2131,0xA09C0D18,0xA3A7ACAA, 0x8D9EA3AD,0x1726248B,0x1E20272A,0x9D8A1B17,0x9A9EA49A,0x90A6A894,0x05159014,0x26171802, 0x1D101513,0xA4091A1B,0xA68388A4,0x9AA89DA3,0x198A0C86,0x2B29272A,0x04129020,0xABA39D81, 0xA0A19EB2,0x21849293,0x20242229,0x0C262926,0x90A4989E,0xA5ADB0A5,0x94859298,0x2A2F2111, 0x2624232D,0xB2A41D1C,0xA8ACABA6,0x17A4AAA7,0x2B2A1511,0x2A2E3421,0xA8939624,0xB1B09AA2, 0x9F97AAAD,0x331D2108,0x19312331,0x8C811B19,0xB0AAA1A5,0x8AABA9A8,0x1C270112,0x2A232523, 0x8212231F,0xA1AAA38C,0xA18B9DA3,0x1C079882,0x1F212092,0x0B232325,0x9B978493,0x87A79983, 0xA2969298,0x0F139193,0x20151D14,0x1E071E24,0xA202970A,0xA4A8A4A5,0x098D99A2,0x25231B13, 0x2132281D,0x92A11620,0xA9ADAEA5,0x0A93A1A1,0x1E231706,0x22232921,0xA21B011F,0xA9ABA3A3, 0x909C95A5,0x24041B15,0x292C2028,0x90940710,0x99A3A19B,0x9997A191,0x261B929A,0x0C242413, 0x888E090C,0x8F969903,0x80819B8C,0x82178B8F,0x1A05040B,0x03841280,0x92080682,0x9E9796A2, 0x14941308,0x8F1F9283,0x840A0993,0x8D071A18,0x02968E07,0x92819118,0x10980C97,0x20049002, 0x0B058316,0x160C058E,0x96028A88,0xA095A191,0x211A8394,0x10121012,0x05172315,0x81081818, 0x979EA2A0,0x0907959D,0x810C1702,0x16162116,0xA10D8080,0x96929698,0x9B9D9190,0x1C919889, 0x161D1D23,0x89902007,0x0B039606,0x8FA09880,0x1510829B,0x821C1417,0x958C8511,0x021495A0, 0x968E9494,0x08190A90,0x21851F0B,0x8C009794,0x87141487,0xA3939290,0x100F170D,0x15180B22, 0x07850B92,0x9902088D,0x94A19B97,0x81870E94,0x061D060B,0x0E0D0814,0x8D921008,0x8A8C9987, 0x0D891911,0x89920590,0x0E149012,0x93950414,0x0A800A88,0x8708811C,0x10A19CA1,0x81119597, 0x91059009,0x1C061682,0x9317120B,0x8A8E9182,0x809A8685,0x85849293,0x23279112,0x048B2092, 0x9D899592,0x9A86868F,0x91010E9E,0x821C211A,0x859B9221,0x0A929399,0xA0008791,0x20070F03, 0x200E2822,0x9E87A08A,0x8A93A49C,0x909A0386,0x1E200E14,0x0C191925,0x8BA18790,0x89899EA2, 0x83909F87,0x1D251C90,0x02801A11,0xA0A09117,0x81090594,0x9A888BA0,0x0B112115,0x140F8214, 0x889F9D0A,0xA1810A06,0x23949290,0x0E1B110B,0x89878617,0x8B8D909D,0x91928480,0x0C23158F, 0x0D11111C,0x9CA29593,0x040C838D,0x108F8E9C,0x0319141A,0x9D0E1F12,0x018FA0A3,0x93988214, 0x06221701,0x17121B8C,0xA7A59506,0x04100C8D,0x1C8C948E,0x038D061C,0x9E121D1C,0x0995A2A7, 0x8799920D,0x14201614,0x2322198E,0xA0A6A000,0x9406828D,0x1F1691A1,0x0D050A1B,0xA0831D21, 0x0696A0A2,0x8C998A83,0x021C241B,0x1C020E10,0xA2A3A488,0x94908E90,0x26180286,0x1C142021, 0xA89A8A16,0x869FA3A6,0x878C9282,0x19222015,0x1B1C2020,0xA1A9A597,0x9200A0A4,0x1B16059E, 0x24242121,0x9B030D22,0x99A3A4A5,0x91978493,0x1C1E1309,0x1C22231D,0xA3A29D8D,0x90919E9A, 0x0B8B8084,0x1D1E211C,0x9D831E21,0x00A3A9A0,0x8402978F,0x101D1A04,0x181D1910,0xA9A49105, 0x9093909C,0x22100486,0x1C080D17,0xA1111520,0x96A2A4A7,0x07138689,0x11191E10,0x20211F16, 0xAEA8920B,0x9691A3A7,0x20130996,0x211F1821,0x90142227,0xA9AAA5A2,0x939D9BA6,0x2221118B, 0x2C2A2422,0xA7921523,0xA5A4A2A4,0x909B9FA6,0x22151706,0x22282A28,0xA09B8C18,0xA4A09FA0, 0x87A09FA0,0x251B0708,0x031D2326,0x0C089102,0x969B8B90,0x918AA1A1,0x111A1988,0x908F8911, 0x1513100B,0x8A8E011B,0x0499898D,0x9D8A0312,0x9295A5A8,0x23211C84,0x171D2124,0x030A1314, 0xAEA8A08B,0x99A6A8AE,0x23201685,0x292A2C29,0x12161D28,0xB1B2AB95,0xA0A7AFB2,0x251A0596, 0x30312C2D,0x0B1D2730,0xAFADACA3,0xA9ABAFB3,0x24168AA3,0x32312E30,0x96162B31,0xA79F9E9E, 0xA7AFB0AD,0x1A878DA4,0x282E2C27,0x810B1716,0xA101010D,0x99A09EA0,0x1086938F,0x979C1419, 0x150B869B,0x1A10091B,0x0823211E,0x96128304,0xACB3B0AE,0x889293A1,0x33312C17,0x1E262B33, 0xB3AC9D1A,0xAAB1B1B3,0x2190A4A8,0x2D2F3027,0x0A263430,0xAEB1A88B,0xA2ABADA2,0x210A949A, 0x2D281C20,0x98002124,0x990B04A0,0xA3A2A4A0,0x0B141D0E,0x1A202324,0xA0AAA8A0,0x949A9591, 0x2B292488,0x23241B26,0xB0A99C18,0xAAA5A8AD,0x301892A7,0x30302F30,0xA21F302E,0xB5B3B4AE, 0x9DAFB2B4,0x31312F1D,0x32343534,0xB2ADA50E,0xB5B6B5B2,0x272282AD,0x36363330,0x93132733, 0xB6B3B0A8,0xA5ADB1B4,0x2F272001,0x2C303231,0xA69A8921,0xAAAEAEAC,0x201387A2,0x22212728, 0x9C091821,0x98A2A4A1,0x899197A1,0x1D1B1B13,0x04091512,0x98929D8A,0x099B9B97,0x1A1A8215, 0x03202511,0x9B959CA1,0x109B9E98,0x821C1914,0x16122420,0x9F829292,0x9CA9A99F,0x8A8583A1, 0x2E241920,0x1C1F1A20,0xA4910820,0xA1A7A8B1,0x039AA79A,0x19262D1B,0x29342B24,0xA2AC9A06, 0xB2AAA4A2,0x1F0C9CAC,0x2F221013,0x86172A35,0xA5939398,0x97A9B1B0,0x10890905,0x27343423, 0x89008611,0xB1B0A795,0x8F0C96A6,0x31210E91,0x8E112831,0xA7980713,0x8BA3AFB1,0x0C9C9A08, 0x212F3428,0x83140009,0xA9B3AC9A,0x9D8A95A1,0x352E1894,0x071A2530,0xAEA0801D,0x9DA5ADB3, 0x1A97A18B,0x252D3428,0x071D0F20,0xACB2ABA2,0x9C92A0A5,0x332D218B,0x0B14212C,0xADA69115, 0x9FA2A8B1,0x260C9393,0x242B3432,0x94038017,0xAFB3B1A9,0x9492A0AA,0x35322512,0x101F2A32, 0xB0AA9F09,0xA3ADB0B3,0x2410989B,0x2D323630,0x9C0D1624,0xB0B2B0A9,0x9997A2AE,0x332D2314, 0x16202B31,0xAAA39714,0xA2ADB2B2,0x1E028C92,0x2C33332A,0x8C86801D,0xB2B2A89F,0x8484A0AA, 0x3329188C,0x09202B34,0xA9A18300,0xA0A7B3B3,0x168D858A,0x2A333024,0x02011221,0xB3AEA69D, 0x8799A3A8,0x30240D91,0x1C252E32,0xA4901211,0xA6AEB3AE,0x8494889A,0x3031271C,0x13122127, 0xB2A8A005,0x92A3A8B0,0x23129599,0x2529312F,0x8F18171F,0xA9AEABA0,0x999CA1A8,0x312C1B85, 0x1526282F,0xAAA28C0D,0xA8A8ACAF,0x099A9FA3,0x2D312E23,0x191D252A,0xAFADA38E,0x9FA4A8AA, 0x251A0198,0x28292A29,0x980B1F23,0xAAACACA6,0x9AA3A5A7,0x251F118F,0x262B292A,0xA0910214, 0xA9A8A6A0,0x809399A6,0x27241E18,0x19212929,0xA3978F0F,0xA4A9AAA9,0x098C989E,0x23252317, 0x121A2324,0xA3A29704,0x9A9CA0A4,0x1B029093,0x20222320,0x02151921,0x99A1A095,0x9A9B9A96, 0x0A0A8496,0x17161411,0x86000611,0x9294938B,0x8891928F,0x06050502,0x0B12130D,0x0D080409, 0x91939487,0x978A8587,0x098A909B,0x130F0D13,0x04111617,0x868D928C,0x969B9B92,0x0505018F, 0x1A1A110D,0x80060F15,0x9B958F89,0x8B929BA0,0x13068080,0x13181E1D,0x830D0B0F,0x9DA09D96, 0x93949C9C,0x1C150D88,0x1114181C,0x92801012,0x9B989999,0x82959BA0,0x17100B0E,0x151B201D, 0x89820811,0xA09E9D96,0x9094999E,0x1E120788,0x14131620,0x90031316,0x9A969A9B,0x88949796, 0x12120D06,0x15131816,0x928E8010,0x94939394,0x0F818C90,0x10008608,0x040E1517,0x80058884, 0x91959290,0x85828484,0x130A0485,0x0383830C,0x8F860307,0x84858D94,0x81908D82,0x83050304, 0x05040581,0x90919101,0x95908487,0x02028290,0x15120705,0x10060510,0x82890513,0x918F8981, 0x8904068A,0x05080681,0x0E038683,0x85000C0E,0x86848482,0x80048B90,0x060A0789,0x03060402, 0x96978D82,0x8D840888,0x0C0D0D02,0x090F0603,0x9190958A,0x938B9298,0x06868990,0x190B0610, 0x09110616,0x93910182,0x9496958E,0x068B9293,0x161B1911,0x110E1A1E,0x96929388,0x858D9796, 0x01858592,0x161A0B0C,0x01131E0E,0x98988E0B,0x90A09C95,0x05059192,0x1D131210,0x021D1415, 0x97998388,0x979F9D9B,0x02919480,0x1710078A,0x1C19131F,0xA2920181,0x9A9E9E9B,0x03938995, 0x191A030E,0x140B1A17,0x90080015,0x9B960595,0x8A8F9693,0x20048200,0x1519141A,0x96008209, 0xA3958F9E,0x858E0795,0x14098707,0x1B0D0515,0x810F0810,0x9890908B,0x97929298,0x108A9090, 0x0E128606,0x81038686,0x83880383,0x92980D14,0x04069387,0x1B0E8490,0x01130003,0x93920807, 0x92958602,0x03808992,0x10129392,0x110A130D,0x83890E14,0x8696930E,0x06869C96,0x10110684, 0x03140B02,0x928B1007,0x9F958487,0x86929997,0x19138F91,0x0F1B1705,0x04021216,0x90968902, 0x90A1A191,0x12999B82,0x07128C84,0x0914150C,0x8B8D0E06,0x0E869506,0x0102018C,0x00119006, 0x9108089A,0x01120A8B,0x8D9A0211,0x91150389,0x98881B86,0x97028294,0x02858589,0x02171887, 0x02060C15,0x99060592,0x8F928492,0x9C958B90,0x05918380,0x050B0A80,0x8C031715,0x00001208, 0x09828A82,0x94038189,0x8D958301,0x0A8A0600,0x89028211,0x030A2200,0x8F919A83,0xA0988304, 0x8B900E8C,0x111D0387,0x85171E11,0x8C010A85,0x99989094,0x8E939490,0x00050980,0x02111E12, 0x86910D1F,0x9994908E,0x91939095,0x100C0E04,0x11131518,0x9101210E,0x9796930C,0x91919299, 0x0F810680,0x0E1D1207,0x92050F08,0x94988484,0x92919793,0x09878791,0x120E1615,0x1407111B, 0x9893800F,0x95A29490,0x8690998F,0x0C171702,0x121B180E,0x88051011,0x989D9487,0x909D9A91, 0x8A01888E,0x15151B13,0x0F151F20,0x95888902,0x919A9A9A,0x06919885,0x120B858B,0x15151516, 0x00870D14,0xA09B8F80,0x8994939A,0x08160389,0x08080C86,0x0B021315,0x8B8E880C,0x8A91868A, 0x0D089990,0x01140499,0x00820B11,0x8C8B0180,0x8D898202,0x85858E8B,0x9283008A,0x82000800, 0x12121206,0x8F810512,0x81009391,0x8C939192,0x13909384,0x04068309,0x03030E11,0x9108018E, 0x98968C86,0x92050094,0x0B121901,0x020E1213,0x84808A00,0x898B9091,0x86889292,0x81051106, 0x12060207,0x92890106,0x99958B85,0x038D8490,0x11140202,0x12120F0C,0x87088304,0x91918A8F, 0x888C9193,0x850D0786,0x0D070A87,0x0B810713,0x91929487,0x8B928A8D,0x09828103,0x12171208, 0x0F0C090A,0x908E8802,0x94949490,0x82858C98,0x080C1310,0x150D1814,0x87880417,0x8F919B98, 0x968F8992,0x14058792,0x151C1713,0x09100F0F,0x95969384,0x96969597,0x85868B92,0x16121503, 0x18161218,0x918C8310,0x9F9C999A,0x9090919A,0x1A151202,0x13181C16,0x8D880913,0x9B9F9887, 0x92979695,0x0D10058B,0x211A1013,0x11181619,0x9E939002,0x9F9E9FA0,0x0401929E,0x1D16150E, 0x18171F21,0x98968A09,0x9A99A0A0,0x01959596,0x1E150D0F,0x00171E1B,0x8F090804,0x9A9C9B99, 0x9391989A,0x04040301,0x1F201B11,0x090F0715,0x97939588,0x95A09A9C,0x0A07858F,0x1C121311, 0x040D171C,0x96938E86,0x8F90959B,0x8D91868F,0x010F1314,0x0114180F,0x00110B07,0x96918C8C, 0x8C969B96,0x0A048C8F,0x2211820C,0x17140D19,0x97938804,0x9C9C9094,0x8C948593,0x050F0E02, 0x07111710,0x0710130E,0x8981030B,0x93909A95,0x87929F98,0x1A019691,0x201C191E,0x91061019, 0x9F96888F,0x9A999CA1,0x10090C8E,0x16141111,0x06121614,0x8E929484,0x84949894,0x00959B87, 0x00021012,0x121A120B,0x00130609,0xA2A0929A,0x9F829399,0x221702A0,0x181D1C1E,0x83070E13, 0x9EA19794,0x8A9CA09E,0x10940E18,0x08131E22,0x938C820C,0x88951108,0x8F01A198,0x08818E92, 0x0C158E96,0x1C110B0D,0x0C0C181D,0x99840009,0xA1A49C99,0x989099A0,0x1D11148F,0x192A221E, 0x8212170B,0x97A4A49D,0x9292948C,0x8090140F,0x19100111,0x8C852022,0x98938008,0x818E9392, 0x8B969D98,0x17869480,0x1F1C0E05,0x200A811A,0x00868A10,0x9C93958E,0x8792929C,0x110F938C, 0x9B881280,0x191597A0,0x17151211,0x09151711,0x9D9F9507,0x0D02A2A2,0x00040207,0x1A1F0293, 0x82161311,0x86010791,0x95939584,0x92919D9E,0x8A820D8C,0x191E0596,0x19201B14,0x0D18150B, 0x9D9A9A92,0x819EA3A0,0x89018185,0x16148686,0x14130912,0x01141303,0x9C968F8E,0x0E91939C, 0x9998970C,0x0F051184,0x191D110E,0x201A191A,0xA19A9414,0x90849FA2,0x9499A0A5,0x19068C02, 0x1A262216,0x0D1E2116,0xA5A39600,0x998994A0,0x92A19199,0x100E0713,0x1414231F,0x0D121819, 0xA3A39F00,0x1B0A939E,0x8C9AA002,0x0D109289,0x150F0184,0x18210781,0x9F9A8010,0x84151390, 0x9C918984,0x9085919B,0x83070396,0x20241706,0x90840C0E,0x8612018D,0xA0871692,0x87959699, 0x95899594,0x1715250A,0x01171B21,0x938B0E05,0x8F959C96,0x8297A5A1,0x1285880B,0x04202218, 0x0E10201B,0x9C940004,0xA3A49E9B,0x88040298,0x21128592,0x12111B22,0x1092040D,0x8B908019, 0x98A49F8F,0x95989B99,0x15131B0C,0x1E231511,0x170F8787,0x1C979E12,0x999DA293,0x8695A09F, 0x1F039B96,0x1429291C,0x141A150F,0x03118590,0xA2A0A3A0,0x908B9A9F,0x150A939C,0x1E221414, 0x11171D19,0x9989131A,0xA9938998,0x949F8CA0,0x00029193,0x11101712,0x26221E1A,0x90939015, 0xA2A38F07,0x85A2A195,0x0983938A,0x14020D20,0x13161610,0x12178F03,0x969B9890,0x07859995, 0x90089AA0,0x1D0F020C,0x10090F10,0x8F128204,0x8B910C06,0x9E928489,0x91A38B90,0x88058F13, 0x18161685,0x170B070E,0x8082861D,0x9797908E,0x8D07A0A0,0x8F8080A2,0x0E17040D,0x170A1A0C, 0x82161B18,0x9C888008,0x92A7A1A3,0x0907A492,0x1E120787,0x211F1C0F,0x85161121,0x93020893, 0x9BA3A3A3,0x0B92A48A,0x11020F95,0x1F208010,0x18171016,0x87800788,0x959E9F90,0x84959C8B, 0x89880B91,0x1D208A84,0x13141010,0x95828191,0x848C8D88,0x94849094,0x808A0E81,0x0A179091, 0x0901028C,0x818D810A,0x85810308,0x00060D84,0x90928F81,0x93811788,0x958F8306,0x04818091, 0x1514120D,0x07110C14,0x95A09588,0x959A9685,0x8401868D,0x1213100C,0x0F1E1E11,0x928B000A, 0x069FA79F,0x969B9407,0x0405808C,0x1C221682,0x0E0E1D1B,0x9E93870B,0x9494989E,0x899D9A98, 0x0C13020A,0x1E21271A,0x0A16000E,0x9EA39E90,0x90969090,0x88859593,0x22140483,0x840B1321, 0x8F091300,0x02849A9A,0x94908587,0x89820689,0x19150388,0x08918E0F,0x968E0008,0x82040B8C, 0x0B868E86,0x02030801,0x850C1715,0x85899396,0x099A9682,0x05838A13,0x14150B83,0x8307010F, 0x878A8B8B,0x9B988F8C,0x84070490,0x06000203,0x0C0C0E0A,0x8003850B,0x00898E86,0x80919C94, 0x0A058880,0x16180B88,0x01080810,0x86848202,0x92949697,0x04838D91,0x060A0609,0x11121300, 0x8A02050F,0x98989389,0x89919698,0x10130F03,0x0E181B18,0x05908D0B,0x85898F86,0x9F9D9890, 0x060A0393,0x16161384,0x13131219,0x97958110,0x9D999499,0x10038F98,0x0F0B040A,0x01091D17, 0x958D8681,0x0D079092,0x9795928A,0x00070690,0x11131111,0x02868B84,0x908D0106,0x95830382, 0x02888C98,0x1710040E,0x02091117,0x90810285,0x91949695,0x9190888B,0x141B1905,0x12100407, 0x919B9104,0x9D928888,0x0A0D0197,0x0D8C948D,0x1310191A,0x8B131213,0x8E92999A,0x949C9D98, 0x828D9089,0x22242213,0x07141821,0xA09E9990,0xA1A1989A,0x10078693,0x22211205,0x1817181C, 0xA297840F,0x9E9D9AA0,0x04959D9F,0x211C120F,0x1921211E,0x85830111,0xA5A19D98,0x8E909BA3, 0x1D100384,0x2020191C,0x880B171B,0x9F939797,0x99979EA1,0x0C018694,0x1A1C211C,0x878B0E1B, 0x8B91998F,0x8C999D98,0x12088282,0x101C221A,0x8E86090E,0x95989894,0x95999595,0x10090887, 0x1D232118,0x8F8C0A14,0x9B9C9E99,0x979B9997,0x05090A87,0x20222115,0x8A0C0E17,0x979E9F96, 0xA09C9392,0x0B170599,0x1C201800,0x04870E1D,0x9C96080D,0x988D969C,0x1380939A,0x151A0100, 0x0F151B15,0x9E8A0606,0x99969498,0x1092949A,0x210C8D15,0x0F1A1213,0x900E0382,0x9187919D, 0x94969899,0x0B941011,0x1A121421,0x15118610,0x8B8FA195,0x9A969996,0x9911149A,0x15152211, 0x1288111B,0x829EA00D,0x8C989981,0x0C189A9D,0x0D24169B,0x9509180F,0x99952013,0x9B950084, 0x149DA196,0x2102A205,0x1B221610,0x98201A03,0xA08F8699,0x9EA296A0,0x12A08115,0x1D181223, 0x1E168914,0x81829998,0xA4939897,0xA286119F,0x14122003,0x16021F1F,0x8096951F,0x95A19C82, 0x0310A2A3,0x14230BA1,0x041E2017,0x98971D15,0xA29C8A8C,0x10A2A191,0x2310A103,0x1C201B17, 0x921F1081,0x9D8C8C96,0xA0A39AA4,0x0F9F0816,0x20191422,0x2017021D,0x88879697,0xA599A198, 0xA0840EA2,0x19142209,0x18052022,0x89989221,0x96A3A08C,0x020CA4A4,0x0E24149D,0x00202416, 0x95902118,0xA39E8A87,0x079FA295,0x200DA293,0x21221714,0x9621200F,0xA0878395,0xA3AAA2A6, 0x159B030F,0x221C1624,0x1F1F0B1D,0x8F949F9A,0xA495A2A1,0x9C001A9A,0x16081E10,0x1F801621, 0x03919321,0x949B9B85,0x9381A3A7,0x1024189D,0x101A1D11,0x96941C20,0xA3A2898B,0x1693A699, 0x21149A91,0x13211D18,0x98152008,0xA2938393,0x94A59D9E,0x1B948D0B,0x17171924,0x1A1F0207, 0x84819495,0xA59D9EA0,0x9D91138F,0x1F191F0D,0x2006121F,0x9097901E,0xA09DA091,0x8B0796A6, 0x15231F8C,0x81831D1E,0x96961720,0x95A08B03,0x0D8CA9A0,0x1D159B97,0x16211D13,0x9414271A, 0xA19A9591,0x8FA8A4A2,0x26949912,0x1C201624,0x0A22160D,0x94919FA0,0xA3A2A0A2,0x8A91110C, 0x1707201F,0x20121621,0x84989F17,0xA29DA3A0,0x898E8B9D,0x14222304,0x1316201F,0x93A2821D, 0xA1A19982,0x0E009BA2,0x181B0085,0x11211F13,0x96081F0E,0xA5A3928B,0x92A29A9D,0x230F0310, 0x24230F18,0x99170805,0xA18D809E,0xA2A096A2,0x09961210,0x27140A21,0x1C1A8D18,0x9885938C, 0xA8929CA5,0x8E0F1CA0,0x20122118,0x06850F25,0x8F958906,0x9191A095,0x0D1B91A5,0x15131286, 0x840F1721,0x91021388,0x969D9788,0x1092A19B,0x18138C83,0x191A1F1C,0x961B108E,0x9DA39796, 0x929E9D9A,0x20020915,0x1B1C1B1D,0x0E159701,0x9994959B,0x9A91949A,0x0C011701,0x1814181C, 0x1B848418,0x938E960F,0x9A95A0A1,0x0105839A,0x1D181F1A,0x0A86111A,0x909C9716,0x9194A1A0, 0x1212949A,0x13132416,0x8809101E,0x009C8208,0x9497A28F,0x08069296,0x88181F8A,0x84850F1B, 0x8D931002,0x8F999D03,0x0D869998,0x87261B8E,0x88812313,0x9D910C05,0x00A1940A,0x1B8E9C91, 0x1528830F,0x96101C9B,0x9C04078D,0x91A10E02,0x0C949307,0x24179A11,0x901D0D95,0x8F100286, 0xA3990D9B,0x82958F82,0x21858712,0x8F198C05,0x058D8795,0x9B058292,0x82900982,0x1D8D0013, 0x84148F0F,0x88000891,0x908A898D,0x898F9191,0x208C0614,0x051F8913,0x850A8798,0x9791058D, 0x03968705,0x12980112,0x1011A107,0x091089A2,0x91110282,0x888F200A,0x08971121,0x14919F10, 0x9792A7A0,0x8F05079D,0x89151687,0x210C251F,0x8D918524,0x969FA3A0,0x958FA19A,0x8C801095, 0x16071B19,0x1605801F,0x14118903,0x9A07038C,0x9D960688,0x968E1393,0x0D94990A,0x0C8F9C94, 0x1A1B1114,0x1B24231F,0x94951310,0xA2A8A305,0x9DA9ACA8,0x22039198,0x232A2524,0x22242D23, 0xA08D8A20,0xA7B0B0AC,0xA5A1A1A7,0x1F128A97,0x2628291F,0x120E1C2D,0x91928A00,0xA399A1A1, 0x959A9EA0,0x84090B8E,0x02001C11,0x15038612,0x15131719,0x030B1119,0x99949998,0xA3939097, 0x93A4A6A6,0x211D0C87,0x24272A2A,0x2122201E,0xB0A7A282,0xACAAACB0,0x8AA2A0A7,0x28221210, 0x2B2D3233,0x02131722,0xAFADABA1,0xA6A8A6AA,0x808F97A1,0x25201E12,0x2023252E,0x05989680, 0x98949785,0x9188939D,0x05899299,0x91939111,0x10060B84,0x21121012,0x16161320,0x03190913, 0xA7A5A3A2,0xA9A9ABAC,0x1B121D89,0x2E241D1A,0x23262530,0xA29B8816,0xB0ACB1B1,0x9BA4A3A7, 0x28251893,0x26262927,0x940A1F29,0xA0A49D99,0xA0A3A7A1,0x0F05939C,0x20241D0C,0x9C86141E, 0x03820895,0x02838B0B,0x0F0D120E,0x85018587,0xA1A5A493,0x908B93A1,0x25200F8C,0x1F212827, 0x8B122023,0xAAB0ACA0,0x9BA7A9AB,0x1B168895,0x2B272626,0x0A1B2528,0xA09FA297,0xA8ABA7A3, 0x048B99A1,0x232A2013,0x100C1C19,0x9A948A11,0x849C968D,0x1011968C,0x84121501,0x93868B90, 0x9EA09795,0x130A0F02,0x24272211,0x8B842326,0xA79EA194,0x95A1ABAB,0x87898591,0x252B2B13, 0x2312172B,0xA79B8810,0xA4A3ADAC,0x91A4A3A6,0x26222725,0x1C241017,0x989D8B0F,0x93828598, 0x0DA1A29A,0x08191122,0x0A1F1C92,0x98A1A398,0x95940A81,0x2F208C8A,0x931F1A23,0x9C8D1488, 0x9BA1A3A9,0x99A29C8A,0x2B291788,0x17202421,0xA1891825,0xA0A8A6AB,0x959FA9A2,0x10211B8A, 0x211F2518,0x96811221,0x95A09591,0x969DA5A2,0x131C1593,0x14092125,0x928A8A80,0x8F94A193, 0x92810396,0x1719210B,0x14930321,0x9E978813,0x9291A8AA,0x898A8490,0x24242E1F,0x19028B21, 0xA6A49811,0xA1029FA9,0x0C9EA1A3,0x20172A28,0x2622071D,0xA5A29D0B,0xA28A92A6,0x11868DA0, 0x23881522,0x1423171E,0x9A9D9E8D,0xA295939E,0x138B8393,0x231C2021,0x070F8F14,0xA59D918A, 0x959499A3,0x11880385,0x241C2126,0x161D0711,0xA7A7A795,0x980101A0,0x0D909099,0x21112029, 0x141D1015,0x9BA0A396,0xA49A9BA2,0x1B0A128B,0x18151D21,0x17100820,0x9F939F9B,0x9B95949B, 0x8C958F97,0x261D2622,0x09028D20,0x9F9B9C91,0x8F0B92A4,0x89918B8A,0x09052218,0x24121121, 0xA39DA006,0x8A8194A3,0x0411869F,0x04072420,0x819E821A,0x0B849008,0x9691A095,0x8E838B9E, 0x10252483,0x0A981A22,0xA1AAA112,0x2016989D,0x99899286,0x09221499,0x100E1E0F,0x949D0924, 0x9DA5A396,0x20119896,0x0C1C1512,0x030F8590,0x98081C11,0x8690120B,0x9BA4A08F,0x24039691, 0x11251A21,0x9B8C909F,0x99861A86,0x1081008D,0x87A29B0B,0x0F038411,0x1D230A88,0xA2908D84, 0x8884869F,0x83979388,0x07032221,0x1588930B,0x06819C90,0x85100188,0xA3948A97,0x100F1889, 0x1B8A1720,0x8F938023,0x0F90A8A6,0x8D0C898D,0x8A1C1C8C,0x8293038C,0x808C1E23,0x088C9210, 0x93A0A698,0x1B200592,0x931E1B0E,0x9D8A1692,0x0286008D,0x08968B12,0x869A9C02,0x20148D8A, 0x0F241D13,0xA49A8993,0x8491919B,0x06970512,0x1204101D,0x12019987,0x85110702,0x8B140D95, 0xA0A19693,0x88081909,0x17850B0D,0x1405821B,0x8288948D,0x9281908E,0x93088096,0x0D01098A, 0x85091D1A,0x07908905,0x92939106,0x10039694,0x8A078983,0x10130F8D,0x840F1507,0x94940B10, 0x92A29E91,0x190A8580,0x1C138111,0x8E088202,0x8B0D0792,0xA09C8B90,0x02828291,0x18040A0F, 0x0F0B1923,0x0486998C,0x948D9995,0x8E018896,0x020D0293,0x14192116,0x848B0D18,0x9DA09780, 0x80919E9F,0x170B0001,0x191B0F12,0x81120D08,0x9E900583,0x9AA09999,0x1084878B,0x1B141417, 0x10070E1B,0x02068F82,0x9C949493,0x908A939D,0x1611068B,0x091C231F,0x8A930411,0x949F9A88, 0x06889994,0x0C0A8187,0x1717100A,0x87111510,0x98938488,0x979C9797,0x09048188,0x160F1110, 0x0908161D,0x05808D02,0x9D989D96,0x8388929C,0x17181004,0x0D171918,0x92850803,0x979B9490, 0x90979693,0x13070083,0x1C131619,0x0F0F0419,0x9A899292,0x9A9596A0,0x01008493,0x1016180E, 0x10101A18,0x92968414,0x91979B94,0x818E9996,0x15110702,0x18161214,0x85040712,0x9A8F8E91, 0x9796949A,0x0E020387,0x10101415,0x070D1614,0x92958F06,0x8C949A95,0x04829394,0x1212150F, 0x0F0E0910,0x87040003,0x97918A91,0x91959092,0x11110186,0x02101511,0x8005120F,0x8C959000, 0x8A8D918C,0x06869392,0x11100D0C,0x1311030A,0x92810004,0x8D828A96,0x94938B8E,0x09090586, 0x090B0D07,0x860F1712,0x8C968984,0x87929281,0x07839390,0x090B0801,0x130E0C0E,0x8305800D, 0x94888B90,0x93908E96,0x0E810182,0x0E10070F,0x0513110A,0x928E8484,0x90928A89,0x83909591, 0x040E0E03,0x1105100D,0x00830614,0x8887908B,0x92919291,0x04838691,0x1406050F,0x0F120710, 0x88018585,0x948B8790,0x898E888F,0x05088083,0x030D1004,0x01021110,0x868D8802,0x888D9189, 0x00808D8E,0x04090C01,0x06010D0F,0x8885030A,0x818B8B86,0x878C8E86,0x09018083,0x11070009, 0x05090208,0x86818587,0x8C888C8D,0x86810187,0x08010080,0x080D0607,0x00050082,0x91878083, 0x8788828A,0x00898104,0x0E078106,0x02068200,0x84050600,0x8A858489,0x84870183,0x03828001, 0x05058102,0x82030282,0x85000500,0x85828285,0x85880081,0x80848201,0x04018482,0x00060082, 0x87810480,0x83840280,0x01838202,0x80818581,0x01028385,0x81030181,0x82020380,0x83810382, 0x82840302,0x81858300,0x02838783,0x03018480,0x01070281,0x80020282,0x84810000,0x85838284, 0x82868485,0x04818300,0x06068001,0x82050300,0x86010085,0x87868185,0x81868381,0x03820004, 0x08038104,0x01808003,0x80808200,0x86828486,0x86838287,0x00000500,0x05800809,0x8183010A, 0x81848884,0x80808A89,0x03060183,0x82040903,0x89830702,0x84898380,0x03878982,0x06008006, 0x00040507,0x8A010282,0x8B80808B,0x82828088,0x03800302,0x02010408,0x80058081,0x0101888C, 0x03818B87,0x82838481,0x83040481,0x01080B01,0x03818180,0x808A8D80,0x028A8A80,0x82010002, 0x02060481,0x01090500,0x01018284,0x83858A86,0x80858484,0x82830304,0x00030605,0x05050300, 0x03808500,0x00838A85,0x80868782,0x87010400,0x81050880,0x01040600,0x05818003,0x80858C82, 0x80898983,0x82000001,0x04080500,0x00080580,0x02028184,0x84898A84,0x81898782,0x81000303, 0x02060804,0x00050280,0x04828884,0x00818A85,0x81838482,0x85010700,0x83040901,0x82020381, 0x05828583,0x03818781,0x00808500,0x85000381,0x82040400,0x82030385,0x80808382,0x01020083, 0x01018180,0x85850101,0x83828000,0x00828182,0x80030200,0x01050400,0x82000083,0x83868480, 0x80828181,0x00000001,0x00820405,0x80000102,0x00818200,0x82008183,0x01818382,0x04018281, 0x05038200,0x01008002,0x84800080,0x83828182,0x83820083,0x81030280,0x04010300,0x81018000, 0x82808282,0x83818085,0x80828000,0x05828002,0x00808003,0x82800102,0x84820181,0x83810080, 0x01020081,0x04028082,0x02808301,0x03818201,0x82808080,0x82818080,0x00810281,0x81800003, 0x80800080,0x80000181,0x82000100,0x00808182,0x03018383,0x02018200,0x80818000,0x81820001, 0x82810001,0x82810180,0x81000180,0x02000000,0x00008180,0x00008100,0x01008181,0x00018080, 0x01818180,0x00008180,0x00000000,0x82810000,0x82800181,0x00020080,0x80008082,0x00808181, 0x01808000,0x80818001,0x80818000,0x81010180,0x80000080,0x80808181,0x00008000,0x00008080, 0x00818100,0x80818001,0x80808000,0x80808080,0x81800080,0x01000080,0x01018180,0x00008180, 0x81808081,0x80800081,0x80800000,0x80000000,0x00010080,0x80808080,0x81818000,0x80808000, 0x80000080,0x80010000,0x00010080,0x00008080,0x80808080,0x80800000,0x80800000,0x80000000, 0x00000080,0x00008080,0x00818100,0x80808080,0x80000000,0x80800000,0x80000000,0x00008000, 0x00808080,0x00808000,0x00008080,0x80000080,0x80000000,0x00000080,0x00808080,0x00808000, 0x00008000,0x80800000,0x00000000,0x00000000,0x00808000,0x00800000,0x00000000,0x00000000, 0x00000000, };
89.611842
89
0.88865
Drc3p0
97d22cfa4d2c779f4392e9567e15715f18ec83b1
2,136
cpp
C++
user_models/src/coding/galois.cpp
uclanrl/dt-icansim
3d4288145abe4cafbbd75af2b0bc697c0bebe4e8
[ "bzip2-1.0.6" ]
null
null
null
user_models/src/coding/galois.cpp
uclanrl/dt-icansim
3d4288145abe4cafbbd75af2b0bc697c0bebe4e8
[ "bzip2-1.0.6" ]
null
null
null
user_models/src/coding/galois.cpp
uclanrl/dt-icansim
3d4288145abe4cafbbd75af2b0bc697c0bebe4e8
[ "bzip2-1.0.6" ]
null
null
null
/* * Copyright (c) 2006-2013, University of California, Los Angeles * Coded by Joe Yeh/Uichin Lee * Modified and extended by Seunghoon Lee/Sung Chul Choi * 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 the University of California, Los Angeles 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 "galois.h" /* unsigned char Galois::Mul(unsigned char a, unsigned char b, int ff) { if( a == 0 || b == 0 ) return 0; else //return ALog[(Log[a]+Log[b])%(GF-1)]; w/o optimization return ALog[Log[a]+Log[b]]; } unsigned char Galois::Div(unsigned char a, unsigned char b, int ff) { if( a == 0 || b == 0 ) return 0; else //return ALog[(Log[a]-Log[b]+GF-1)%(GF-1)]; w/o optimization return ALog[Log[a]-Log[b]+GF-1]; } */
49.674419
188
0.740637
uclanrl
97d25f3120d7c58bf0ce3edfff4aea1bb1ae8ec7
501
cpp
C++
common/tests/StringToIntMapTest.cpp
alexandru-andronache/adventofcode
ee41d82bae8b705818fda5bd43e9962bb0686fec
[ "Apache-2.0" ]
3
2021-07-01T14:31:06.000Z
2022-03-29T20:41:21.000Z
common/tests/StringToIntMapTest.cpp
alexandru-andronache/adventofcode
ee41d82bae8b705818fda5bd43e9962bb0686fec
[ "Apache-2.0" ]
null
null
null
common/tests/StringToIntMapTest.cpp
alexandru-andronache/adventofcode
ee41d82bae8b705818fda5bd43e9962bb0686fec
[ "Apache-2.0" ]
null
null
null
#include "StringToIntMapTest.h" #include <StringToIntMap.h> using namespace stringtointmap; TEST_F(StringToIntMapTest, add_string_test_get_index) { StringToIntMap t; t.addString("aaa"); t.addString("bbb"); ASSERT_EQ(t.getIndex("aaa"), 0); ASSERT_EQ(t.getIndex("ccc"), -1); } TEST_F(StringToIntMapTest, add_string_test_get_string) { StringToIntMap t; t.addString("aaa"); t.addString("bbb"); ASSERT_EQ(t.getString(1), "bbb"); ASSERT_EQ(t.getString(2), ""); }
20.875
54
0.686627
alexandru-andronache
97d327047291fe0f38d38e90a1c8411abf3f7bd4
105,063
cc
C++
frontend/src/frontend.cc
robert-mijakovic/readex-ptf
5514b0545721ef27de0426a7fa0116d2e0bb5eef
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
frontend/src/frontend.cc
robert-mijakovic/readex-ptf
5514b0545721ef27de0426a7fa0116d2e0bb5eef
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
frontend/src/frontend.cc
robert-mijakovic/readex-ptf
5514b0545721ef27de0426a7fa0116d2e0bb5eef
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
/** @file frontend.cc @ingroup Frontend @brief Front-end agent @author Karl Fuerlinger @verbatim Revision: $Revision$ Revision date: $Date$ Committed by: $Author$ This file is part of the Periscope Tuning Framework. See http://www.lrr.in.tum.de/periscope for details. Copyright (c) 2005-2014, Technische Universitaet Muenchen, Germany See the COPYING file in the base directory of the package for details. @endverbatim */ #include <string> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <dlfcn.h> #include "config.h" #include "psc_config.h" #include "stringutil.h" #include "timing.h" #include "frontend.h" #define PSC_AUTOTUNE_GLOBALS #include "IPlugin.h" #include "autotune_services.h" #include "frontend_accl_handler.h" #include "frontend_statemachine.h" #include <ctime> #include <cmath> #include <map> #include "MetaProperty.h" #include "PropertyID.h" #include "application.h" #include "global.h" #include "selective_debug.h" #include "TuningParameter.h" #include <boost/lexical_cast.hpp> using namespace std; using namespace frontend_statemachine; extern IPlugin* plugin; extern bool search_done; bool restart_requested_for_no_tuning; int agent_pid = -1; int application_pid; char user_specified_environment[ 5000 ] = "\0"; PeriscopeFrontend::PeriscopeFrontend( ACE_Reactor* r ) : PeriscopeAgent( r ), plugin_context( new DriverContext() ), fe_context( new DriverContext() ), frontend_pool_set( new ScenarioPoolSet() ) { automatic_mode = true; need_restart = false; shutdown_allowed = true; interval = 0; quit_fe = false; badRegionsRemoved = false; allRegionsCommented = false; ACE_Event_Handler::reactor( r ); RequiredRegions.erase(); requiredRegionsListLastRun.clear(); timer_action = STARTUP; *masteragent_cmd_string = 0; *app_name_string = 0; *app_cmd_line_string = 0; *master_host_string = 0; outfilename_string = " "; *psc_reg_host = 0; psc_reg_port = 0; ompnumthreads_val = 1; iter_count = 1; //sss ompfinalthreads_val = 1; //sss mpinumprocs_val = 1; maxcluster_val = 3; ranks_started = 0; total_agents_number = 0; started_agents_count = 0; agent_hierarchy_started = false; } void PeriscopeFrontend::terminate_autotune() { /* * TODO do proper termination here * * 1. Call plugin terminate * 2. Destroy shared pools * 3. Destroy other frontend structures * 4. Kill agent hierarchy * - etc... */ if( plugin ) { plugin->terminate(); delete plugin; } fe_context->unloadPlugins(); } // #define HYBRID__MPI_PROC_ON_PROCESSOR int PeriscopeFrontend::register_self() { if( !regsrv_ ) { psc_errmsg( "PeriscopeFrontend::register_self(): registry not set\n" ); return -1; } int pid, port; pid = getpid(); port = get_local_port(); char hostname[ 200 ]; gethostname( hostname, 200 ); EntryData data; data.id = -1; data.app = fe->get_appname(); data.site = sitename(); data.mach = machinename(); data.node = hostname; data.port = port; data.pid = pid; data.comp = "PeriscopeFrontend"; data.tag = get_local_tag(); regid_ = regsrv_->add_entry( data ); char buf[ 200 ]; sprintf( buf, "%s[%d]", data.tag.c_str(), regid_ ); data.tag = buf; regsrv_->change_entry( data, regid_ ); return regid_; } void PeriscopeFrontend::register_master_agent( char* ma_cmd_string ) { sprintf( masteragent_cmd_string, "%s", ma_cmd_string ); } void PeriscopeFrontend::register_app_name( char* aname_string ) { sprintf( app_name_string, "%s", aname_string ); } void PeriscopeFrontend::register_app_cmd_line( char* acmdline_string ) { sprintf( app_cmd_line_string, "%s", acmdline_string ); } void PeriscopeFrontend::register_master_host( char* mhost_string ) { sprintf( master_host_string, "%s", mhost_string ); } void PeriscopeFrontend::register_reg_host( char* rhost_string ) { sprintf( psc_reg_host, "%s", rhost_string ); } void PeriscopeFrontend::register_reg_port( int reg_port ) { psc_reg_port = reg_port; } void PeriscopeFrontend::set_outfilename( const std::string& outfn_string ) { outfilename_string = outfn_string; } void PeriscopeFrontend::set_ompnumthreads( int ompnt_val ) { ompnumthreads_val = ompnt_val; } void PeriscopeFrontend::set_ompfinalthreads( int ompfinal_val ) { ompfinalthreads_val = ompfinal_val; } void PeriscopeFrontend::set_maxiterations( int iter_val ) { iter_count = iter_val; } void PeriscopeFrontend::set_mpinumprocs( int mpinp_val ) { mpinumprocs_val = mpinp_val; } void PeriscopeFrontend::set_maxcluster( int mcluster_val ) { maxcluster_val = mcluster_val; } ACCL_Handler* PeriscopeFrontend::create_protocol_handler( ACE_SOCK_Stream& peer ) { #ifdef __p575 sleep( 1 ); #endif return new ACCL_Frontend_Handler( this, peer ); } void PeriscopeFrontend::run() { ranks_started = 0; started_agents_count = 0; if( opts.has_scalability_OMP ) { sleep( 30 ); } int cores_per_processor = 4; char senvbuf[ 512 ]; ACE_Reactor* reactor = ACE_Event_Handler::reactor(); if( !reactor ) { psc_errmsg( "Error: Reactor could not start.\n" ); exit( 0 ); } // We branch here to start the autotune state machine if( opts.has_strategy && !strcmp( opts.strategy, "tune" ) ) { run_tuning_plugin( reactor ); } else { run_analysis( reactor ); } } /** * @brief Drives tuning plugins execution * */ void PeriscopeFrontend::run_tuning_plugin( ACE_Reactor* reactor ) { psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( FrontendStateMachines ), "Autotuning application with %s processes...\n", opts.mpinumprocs_string ); autotune_statemachine atmsm; atmsm.start(); this->plugin_context->tuning_step = 0; this->plugin_context->search_step = 0; this->plugin_context->experiment_count = 0; bool scenarios_executed = true; try{ // starting to pass events to the state machine atmsm.process_event( initialize_plugin( this, reactor, starter ) ); do { atmsm.process_event( start_tuning_step() ); do { StrategyRequest* strategy_request = NULL; if( plugin->analysisRequired( &strategy_request ) ) { if( strategy_request == NULL ) { psc_abort( "Pre-analysis requested by plugin, with an invalid strategy request\n" ); } // TODO find out why the strategy name needs to be set regardless of what is passed to perform analysis strcpy( opts.strategy, strategy_request->getGeneralInfo()->strategy_name.c_str() ); atmsm.process_event( perform_analysis( strategy_request, this, reactor, starter, this->plugin_context->tuning_step ) ); strcpy( opts.strategy, "tune" ); } atmsm.process_event( create_scenarios( this ) ); while( !frontend_pool_set->csp->empty() ) { atmsm.process_event( prepare_scenarios() ); do { atmsm.process_event( define_experiment() ); atmsm.process_event( consider_restart( this, reactor, starter, this->plugin_context->search_step ) ); do { atmsm.process_event( run_phase_experiments( this, reactor, starter, this->plugin_context->search_step, &scenarios_executed, this->plugin_context->experiment_count ) ); if( scenarios_executed ) { psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( FrontendStateMachines ), "Scenarios executed\n" ); } else { psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( FrontendStateMachines ), "Scenarios NOT executed\n" ); } } while( !scenarios_executed ); psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( FrontendStateMachines ), "Prepared scenario pool empty = %d\n", frontend_pool_set->psp->empty() ); if( !frontend_pool_set->psp->empty() ) { psc_infomsg( "Prepared scenario pool not empty, still searching...\n" ); } this->plugin_context->experiment_count++; } while( !frontend_pool_set->psp->empty() ); psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( FrontendStateMachines ), "Scenario pool empty = %d\n", frontend_pool_set->csp->empty() ); if( !frontend_pool_set->csp->empty() ) { psc_infomsg( "Scenario pool not empty, still searching...\n" ); } } this->plugin_context->search_step++; } while( !plugin->searchFinished() ); atmsm.process_event( finish_tuning_step() ); this->plugin_context->tuning_step++; } while( !plugin->tuningFinished() ); atmsm.process_event( create_tuning_advice() ); atmsm.process_event( finalize_autotuning( this ) ); } catch( std::exception& ex ) { psc_errmsg( "Exception caught from the Autotune State Machine: %s\n", ex.what() ); terminate_autotune(); abort(); } } void PeriscopeFrontend::run_analysis( ACE_Reactor* reactor ) { set_shutdown_allowed( false ); psc_infomsg( "Starting application %s using %s MPI procs and %s OpenMP threads...\n", opts.app_run_string, ( strlen( opts.mpinumprocs_string ) ? opts.mpinumprocs_string : "0" ), ( strlen( opts.ompnumthreads_string ) ? opts.ompnumthreads_string : "0" ) ); // TODO invert the order here, when in fast mode if( get_fastmode() ) { psc_infomsg( "Starting agents network...\n" ); starter->runAgents(); // TODO need to wait for the agents here first; this prevents connection retries that exhaust file descriptors starter->runApplication(); psc_dbgmsg( 1, "Application started after %5.1f seconds\n", psc_wall_time() ); } else { starter->runApplication(); psc_dbgmsg( 1, "Application started after %5.1f seconds\n", psc_wall_time() ); psc_infomsg( "Starting agents network...\n" ); starter->runAgents(); } init_analysis_strategy_requests(); print_StrategyRequestGeneralInfoQueue(); if( opts.has_scalability_OMP ) { sleep( 30 ); //sss } reactor->reset_event_loop(); reactor->register_handler( 0, this, ACE_Event_Handler::READ_MASK ); reactor->register_handler( SIGINT, this ); //psc_dbgmsg(1, "STARTUP: run reactor\n"); #ifndef _BGP_PORT_HEARTBEAT_V1 set_timer( 2, 1, timeout_delta(), PeriscopeFrontend::STARTUP ); #endif reactor->run_event_loop(); int max_runs = 40; for( int runs = 1; need_restart && runs < max_runs && !quit_fe && restart_requested_for_no_tuning; runs++ ) { fe->increment_global_timeout(); psc_dbgmsg( FRONTEND_GENERAL_DEBUG_LEVEL, "Restarting application\n" ); set_shutdown_allowed( runs == max_runs - 1 ); //Needrestart msg will be ignored std::map<std::string, AgentInfo>::iterator it; for( it = fe->get_child_agents()->begin(); it != fe->get_child_agents()->end(); it++ ) { AgentInfo& ag = it->second; if( ag.status != AgentInfo::CONNECTED && fe->connect_to_child( &ag ) == -1 ) { psc_errmsg( "Error FE not connected to child\n" ); exit( 1 ); } else { ag.appl_terminated = false; ag.handler->terminate(); } } psc_dbgmsg( FRONTEND_GENERAL_DEBUG_LEVEL, "RESTART_ACTION: waiting for application to terminate\n" ); reactor->reset_event_loop(); //evt.reactor->register_handler(0, evt.fe, ACE_Event_Handler::READ_MASK); //evt.reactor->register_handler(SIGINT, evt.fe); set_timer( 2, 1, timeout_delta(), PeriscopeFrontend::APPLICATION_TERMINATION ); reactor->run_event_loop(); psc_dbgmsg( FRONTEND_GENERAL_DEBUG_LEVEL, "RESTART_ACTION: application terminated.\n" ); starter->rerunApplication(); ACE_Reactor* reactor = ACE_Event_Handler::reactor(); if( !reactor ) { psc_errmsg( "Error: Reactor could not start.\n" ); exit( 0 ); } reactor->reset_event_loop(); //psc_dbgmsg(1, "register reactor\n"); reactor->register_handler( 0, this, ACE_Event_Handler::READ_MASK ); reactor->register_handler( SIGINT, this ); //psc_dbgmsg(1, "REINIT: run reactor\n"); set_timer( 2, 1, timeout_delta(), PeriscopeFrontend::STARTUP_REINIT ); reactor->run_event_loop(); //psc_dbgmsg(1, "finished reactor\n"); } } void PeriscopeFrontend::stop() { ACE_Reactor* reactor = ACE_Event_Handler::reactor(); if( !get_fastmode() ) { if( reactor ) { psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( HierarchySetup ), "Stopping the ACE Reactor (NOT fast mode)\n" ); reactor->end_event_loop(); } } #ifdef __p575 if( !get_fastmode() ) { regsrv_->delete_entry( regid_ ); } #endif } int PeriscopeFrontend::handle_input( ACE_HANDLE hdle ) { int cnt; const int bufsize = 200; char buf[ bufsize ]; buf[ 0 ] = '\0'; buf[ 1 ] = '\0'; if( !read_line( hdle, buf, bufsize ) ) { return -1; } handle_command( buf ); return 0; } int PeriscopeFrontend::handle_signal( int signum, siginfo_t*, ucontext_t* ) { ACE_Reactor* reactor = ACE_Event_Handler::reactor(); if( reactor ) { reactor->end_event_loop(); } quit(); return 0; } void PeriscopeFrontend::handle_command( const std::string& line ) { string cmd; ssize_t pos; pos = strskip_ws( line, 0 ); pos = get_token( line, pos, "\t \n", cmd ); if( cmd.compare( "graph" ) == 0 ) { graph(); prompt(); return; } if( cmd.compare( "start" ) == 0 ) { start(); return; } if( cmd.compare( "check" ) == 0 ) { check(); prompt(); return; } if( cmd.compare( "help" ) == 0 ) { help(); return; } if( cmd.compare( "quit" ) == 0 ) { quit(); return; } if( cmd.compare( "properties" ) == 0 ) { properties(); return; } fprintf( stdout, "Unknown command: '%s'\n", cmd.c_str() ); prompt(); } // adds a started agent without tracking the processes it handles; there is no need to track the controlled processes here in fast mode, since the // processes are specified before the launch explicitly void PeriscopeFrontend::add_started_agent() { psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( HierarchySetup ), "Entering add_started_agent(); started: %d; total %d; ready: %s;\n", started_agents_count, total_agents_number, agent_hierarchy_started ? "true" : "false" ); started_agents_count++; if( !agent_hierarchy_started ) { if( started_agents_count == total_agents_number ) { agent_hierarchy_started = true; } } } // increases the number of started agents and if it equals to the total amount issues start command // this version is used in the BGP style launchers void PeriscopeFrontend::add_started_agent( int num_procs ) { started_agents_count++; ranks_started += num_procs; if( num_procs != 0 ) { psc_dbgmsg( 0, "Heartbeat received: (%d mpi processes out of %d ready for analysis)\n", ranks_started, get_mpinumprocs() ); } if( ranks_started == get_mpinumprocs() ) { psc_dbgmsg( 1, "Agent network UP and RUNNING. Starting search.\n\n" ); psc_dbgmsg( 1, "Agent network started in %5.1f seconds\n", psc_wall_time() ); if( !agent_hierarchy_started ) { agent_hierarchy_started = true; fe->set_startup_time( psc_wall_time() ); } if( automatic_mode ) { start(); } else { prompt(); } } } void PeriscopeFrontend::remove_started_agent() { // increases the number of started agents and if it equals to the total amount issues start command started_agents_count--; total_agents_number--; psc_dbgmsg( FRONTEND_HIGH_DEBUG_LEVEL, "One agent was dismissed\n" ); } int PeriscopeFrontend::handle_timeout( const ACE_Time_Value& time, const void* arg ) { psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( ACECommunication ), "PeriscopeFrontend::handle_timeout() called\n" ); return handle_step( timer_action ); } int PeriscopeFrontend::handle_step( TimerAction timer_action ) { std::map<std::string, AgentInfo>::iterator it; bool done; psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( ACECommunication ), "PeriscopeFrontend::handle_step()\n" ); switch( timer_action ) { case STARTUP: psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( ACECommunication ), "PeriscopeFrontend::handle_step() STARTUP\n" ); done = true; for( it = child_agents_.begin(); it != child_agents_.end(); it++ ) { if( it->second.status != AgentInfo::STARTED ) { psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( HierarchySetup ), "Child agent %s at (%s:%d) not started, still waiting...\n", it->first.c_str(), it->second.hostname.c_str(), it->second.port ); done = false; } } if( done ) { if( !agent_hierarchy_started ) { agent_hierarchy_started = true; psc_dbgmsg( 1, "Agent network UP and RUNNING. Starting search.\n\n" ); psc_dbgmsg( 1, "Agent network started in %5.1f seconds\n", psc_wall_time() ); fe->set_startup_time( psc_wall_time() ); } ACE_Reactor* reactor = ACE_Event_Handler::reactor(); reactor->cancel_timer( this ); if( automatic_mode ) { // TODO in fast mode, the call to start() needs to occur after the application is launched with the starter if( get_fastmode() ) { search_done = true; // exit the comm phase in fast mode } else { start(); } } else { prompt(); } } else { if( this->timed_out() ) { psc_errmsg( "Timed out waiting for child agent(s)\n" ); quit(); } } psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( ACECommunication ), "PeriscopeFrontend::handle_step() STARTUP done!\n" ); break; case STARTUP_REINIT: // TODO check this are for the restart bug psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( ACECommunication ), "PeriscopeFrontend::handle_step() STARTUP_REINIT\n" ); done = true; for( it = child_agents_.begin(); it != child_agents_.end(); it++ ) { if( it->second.status_reinit != AgentInfo::STARTED ) { done = false; } } if( done ) { psc_dbgmsg( 0, "Analysis agents connected to new processes and ready for search.\n" ); ACE_Reactor* reactor = ACE_Event_Handler::reactor(); reactor->cancel_timer( this ); for( it = child_agents_.begin(); it != child_agents_.end(); it++ ) { AgentInfo& ai = it->second; if( fe->connect_to_child( &ai ) == -1 ) { psc_errmsg( "Error connecting to child at %s:%d\n", ai.hostname.c_str(), ai.port ); } else { ai.search_status = AgentInfo::UNDEFINED; ai.handler->startexperiment(); ai.properties_sent = false; } } } else { // Agent network still not running // TODO verify why this is empty -IC } break; case AGENT_STARTUP: psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( ACECommunication ), "PeriscopeFrontend::handle_step() AGENT_STARTUP\n" ); done = true; for( it = child_agents_.begin(); it != child_agents_.end(); it++ ) { if( it->second.status != AgentInfo::STARTED ) { done = false; } } if( done ) { //psc_dbgmsg(1,"....Done.....\n\n"); if( !agent_hierarchy_started ) { agent_hierarchy_started = true; psc_dbgmsg( 1, "Agent network UP and RUNNING. Starting search.\n\n" ); psc_dbgmsg( 1, "Agent network started in %5.1f seconds\n", psc_wall_time() ); fe->set_startup_time( psc_wall_time() ); } ACE_Reactor* reactor = ACE_Event_Handler::reactor(); reactor->cancel_timer( this ); stop(); } else { if( this->timed_out() ) { psc_errmsg( "Timed out waiting for child agent(s)\n" ); quit(); } } break; case APPLICATION_TERMINATION: psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( ACECommunication ), "PeriscopeFrontend::handle_step() APPLICATION_TERMINATION\n" ); done = true; for( it = child_agents_.begin(); it != child_agents_.end(); it++ ) { if( !it->second.appl_terminated ) { done = false; } } if( done ) { RegistryService* regsrv = fe->get_registry(); EntryData query; std::list< EntryData > rresult; query.app = fe->get_appname(); query.comp = "MRIMONITOR"; query.tag = "none"; if( !fe->get_fastmode() ) { rresult.clear(); if( regsrv->query_entries( rresult, query, false ) == -1 ) { psc_errmsg( "Error querying registry for application\n" ); exit( 1 ); } if( rresult.size() > 0 ) { psc_dbgmsg( FRONTEND_GENERAL_DEBUG_LEVEL, "%d processes of application %s still registered\n", rresult.size(), fe->get_appname() ); } else { //psc_dbgmsg(1,"....All application processes terminated.....\n\n"); ACE_Reactor* reactor = ACE_Event_Handler::reactor(); reactor->cancel_timer( this ); stop(); } } // force elimination from registry // if( !startup_finished ) { // std::list<EntryData>::iterator entryit; // // for( entryit = rresult.begin(); entryit != rresult.end(); entryit++) { // regsrv->delete_entry( ( *entryit ).id ); // } } else { if( this->timed_out() ) { psc_errmsg( "Timed out waiting for child agent(s)\n" ); quit(); } } break; case CHECK: psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( ACECommunication ), "PeriscopeFrontend::handle_step() CHECK\n" ); this->check(); break; case SHUTDOWN: psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( ACECommunication ), "PeriscopeFrontend::handle_step() SHUTDOWN\n" ); psc_dbgmsg( 1, "PERISCOPE shutdown requested [%d], restart needed [%d]\n", shutdown_allowed, need_restart ); ACE_Reactor* reactor = ACE_Event_Handler::reactor(); reactor->cancel_timer( this ); if( shutdown_allowed || !need_restart ) { // shutdown the agent hierarchy quit(); } else { // only exit the reactor event loop stop(); } break; } return 0; } void PeriscopeFrontend::graph() { char command_string[ 200 ]; RegistryService* regsrv = fe->get_registry(); EntryData query; std::list<EntryData> result; std::list<EntryData>::iterator entryit; query.app = appname(); if( regsrv->query_entries( result, query ) == -1 ) { psc_errmsg( "Error querying registry for application\n" ); exit( 1 ); } char buf[ 200 ]; char* tmp, * last, * t, * parent; FILE* graph; graph = fopen( "/tmp/test.dot", "w" ); fprintf( graph, "digraph test {\n" ); std::map<std::string, std::list<std::string> > children; std::map<std::string, std::string> label; for( entryit = result.begin(); entryit != result.end(); entryit++ ) { sprintf( buf, "fe[%d]", regid_ ); if( ( entryit->tag ).find( buf ) == std::string::npos ) { continue; } if( entryit->comp == "Periscope Frontend" ) { sprintf( buf, "Frontend\\n%s:%d", entryit->node.c_str(), entryit->port ); } if( entryit->comp == "Periscope HL Agent" ) { sprintf( buf, "HL-Agent\\n%s:%d", entryit->node.c_str(), entryit->port ); } if( entryit->comp == "Periscope Node-Agent" ) { sprintf( buf, "Node-Agent\\n%s:%d", entryit->node.c_str(), entryit->port ); } if( entryit->comp == "Monlib" ) { sprintf( buf, "Monlib\\n%s %s", entryit->app.c_str(), entryit->node.c_str() ); } label[ entryit->tag ] = buf; strcpy( buf, entryit->tag.c_str() ); tmp = strtok( buf, ":" ); last = tmp; while( tmp != 0 ) { last = tmp; tmp = strtok( 0, ":" ); } t = buf; if( buf != last ) { while( t != ( last - 1 ) ) { if( *t == '\0' ) { *t = ':'; } t++; } parent = buf; } else { parent = 0; } if( parent ) { children[ parent ].push_back( entryit->tag ); } } std::map<std::string, std::list<std::string> >::iterator it1; std::list<std::string>::iterator it2; std::map<std::string, std::string>::iterator it3; for( it1 = children.begin(); it1 != children.end(); it1++ ) { for( it2 = it1->second.begin(); it2 != it1->second.end(); it2++ ) { fprintf( graph, " \"%s\" -> \"%s\" ;\n", ( *it1 ).first.c_str(), ( *it2 ).c_str() ); } } for( it3 = label.begin(); it3 != label.end(); it3++ ) { if( ( *it3 ).second.find( "Frontend" ) != string::npos ) { fprintf( graph, " \"%s\" [shape=\"ellipse\" style=\"filled\" fillcolor=yellow label =\"%s\"]\n", ( *it3 ).first.c_str(), ( *it3 ).second.c_str() ); } if( ( *it3 ).second.find( "Node-Agent" ) != string::npos ) { fprintf( graph, " \"%s\" [shape=\"rect\" style=\"filled\" fillcolor=grey label =\"%s\"]\n", ( *it3 ).first.c_str(), ( *it3 ).second.c_str() ); } if( ( *it3 ).second.find( "HL-Agent" ) != string::npos ) { fprintf( graph, " \"%s\" [shape=\"octagon\" label =\"%s\"]\n", ( *it3 ).first.c_str(), ( *it3 ).second.c_str() ); } if( ( *it3 ).second.find( "Monlib" ) != string::npos ) { fprintf( graph, " \"%s\" [shape=\"rect\" label =\"%s\"]\n", ( *it3 ).first.c_str(), ( *it3 ).second.c_str() ); } } fprintf( graph, "}\n" ); fclose( graph ); sprintf( command_string, "%s", "dot /tmp/test.dot -Tpng > /tmp/test.png 2> /dev/null ;" "qiv /tmp/test.png &" ); psc_dbgmsg( FRONTEND_MEDIUM_DEBUG_LEVEL, "Going to execute: '%s'\n", command_string ); int retVal = system( command_string ); } void PeriscopeFrontend::prompt() { // TODO verify what is the purpose of this operation and why it is empty -IC } void PeriscopeFrontend::help() { fprintf( stdout, " Periscope commands:\n" ); fprintf( stdout, " help -- show this help\n" ); fprintf( stdout, " start -- start target application\n" ); fprintf( stdout, " quit -- quit Periscope\n" ); fprintf( stdout, " graph -- show the agent network graph\n" ); fprintf( stdout, " check -- check properties\n" ); fflush( stdout ); prompt(); } void PeriscopeFrontend::push_StrategyRequestGeneralInfo2Queue( const std::string& strategy_name, bool pedantic, int analysis_duration, int delay_phases, int delay_seconds ) { StrategyRequestGeneralInfo* strategyRequestGeneralInfo = new StrategyRequestGeneralInfo; strategyRequestGeneralInfo->strategy_name = strategy_name; strategyRequestGeneralInfo->pedantic = pedantic; strategyRequestGeneralInfo->delay_phases = delay_phases; strategyRequestGeneralInfo->delay_seconds = delay_seconds; strategyRequestGeneralInfo->analysis_duration = analysis_duration; push_StrategyRequestGeneralInfo2Queue( strategyRequestGeneralInfo ); } void PeriscopeFrontend::print_StrategyRequestQueue() { psc_dbgmsg( 1, "Requested strategy request:\n\n" ); for( std::list<StrategyRequest*>::iterator sr_it = strategy_request_queue.begin(); sr_it != strategy_request_queue.end(); sr_it++ ) { StrategyRequestGeneralInfo* srgi; srgi = ( *sr_it )->getGeneralInfo(); psc_dbgmsg( 1, "Strategy name: %s, analysis duration %d, analysis delay %d/%d\n (phases/seconds)", srgi->strategy_name.c_str(), srgi->analysis_duration, srgi->delay_phases, srgi->delay_seconds ); if( ( *sr_it )->getTypeOfConfiguration() == strategy_configuration_type( TUNE ) ) { std::list<Scenario*>* sc_list; sc_list = ( *sr_it )->getConfiguration().configuration_union.TuneScenario_list; for( std::list<Scenario*>::iterator sc_it = sc_list->begin(); sc_it != sc_list->end(); sc_it++ ) { ( *sc_it )->print(); } } else if( ( *sr_it )->getTypeOfConfiguration() == strategy_configuration_type( PERSYST ) ) { std::list<int>* propID_list; propID_list = ( *sr_it )->getConfiguration().configuration_union.PersystPropertyID_list; psc_dbgmsg( 1, "Initial candidate properties:\n" ); for( std::list<int>::iterator propID_it = propID_list->begin(); propID_it != propID_list->end(); propID_it++ ) { psc_dbgmsg( 1, "\t - %d", ( *propID_it ) ); } } } } void PeriscopeFrontend::init_analysis_strategy_requests() { StrategyRequestGeneralInfo* strategyRequestGeneralInfo = new StrategyRequestGeneralInfo; std::string sname = opts.strategy; if( sname.compare( "tune" ) ) { std::list<int> empty_list; int delay_phases = 0; if( opts.has_delay ) { delay_phases = atoi( opts.delay_string ); } int duration = 1; if( opts.has_duration ) { duration = atoi( opts.duration_string ); } strategyRequestGeneralInfo->strategy_name = opts.strategy; strategyRequestGeneralInfo->pedantic = opts.has_pedantic; strategyRequestGeneralInfo->delay_phases = delay_phases; strategyRequestGeneralInfo->delay_seconds = 0; strategyRequestGeneralInfo->analysis_duration = duration; StrategyRequest* strategy_request = new StrategyRequest( &empty_list, strategyRequestGeneralInfo ); serializeStrategyRequests( strategy_request ); } } void PeriscopeFrontend::start() { std::vector<char> serializedStrategyRequest; std::map<std::string, AgentInfo>::iterator it; psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( ACECommunication ), "PeriscopeFrontend::start() called\n" ); serializedStrategyRequest = get_SerializedStrategyRequestBuffer(); //RM: Should be cleaned up here and moved into run handle for both analysis and tuning. if( serializedStrategyRequest.size() == 0 ) { psc_dbgmsg( 1, "Search finished.\n" ); fe->stop(); return; } psc_dbgmsg( PSC_AUTOTUNE_ALL_DEBUG, "Start with next strategy request: time: %5.1f seconds\n", psc_wall_time() ); psc_dbgmsg( FRONTEND_HIGH_DEBUG_LEVEL, "Sending START with strategy request buffer size %d...\n", serializedStrategyRequest.size() ); for( it = child_agents_.begin(); it != child_agents_.end(); it++ ) { AgentInfo& ag = it->second; if( ag.status != AgentInfo::CONNECTED ) { if( connect_to_child( &ag ) == -1 ) { psc_errmsg( "Error connecting to child\n" ); abort(); } else { ag.handler->start( serializedStrategyRequest.size(), ( unsigned char* )&serializedStrategyRequest[ 0 ] ); } ag.properties_sent = false; } } strategyRequestBuffer.clear(); } /** * @brief Terminates the frontend and all agents. * * This method is executed just before the frontend terminates. * It stops all child agents, stops the communication routines, * and exports the found properties to a file. * */ void PeriscopeFrontend::quit() { std::map<std::string, AgentInfo>::iterator it; psc_dbgmsg( 5, "Frontend on quit!\n" ); quit_fe = true; //Do scalability analysis only at the final run and export only the scalability-based properties if( opts.has_scalability_OMP && fe->get_ompnumthreads() == fe->get_ompfinalthreads() ) { do_pre_analysis(); export_scalability_properties(); } else if( opts.has_scalability_OMP ) { ; } else { export_properties(); if( psc_get_debug_level() >= 1 ) { properties(); } } for( it = child_agents_.begin(); it != child_agents_.end(); it++ ) { AgentInfo& ag = it->second; if( connect_to_child( &ag ) == -1 ) { psc_errmsg( "Error connecting to child\n" ); abort(); } else { psc_dbgmsg( 5, "Sending QUIT command...\n" ); ag.handler->quit(); //psc_dbgmsg(1, "Sending QUIT command...OK\n"); } } if( !get_fastmode() ) { RegistryService* regsrv = fe->get_registry(); EntryData query; std::list< EntryData > rresult; std::list< EntryData >::iterator entry; bool shutdown_finished = false; double start_time, current_time; PSC_WTIME( start_time ); while( !shutdown_finished && ( current_time - start_time ) < 60.0 ) { sleep( 1 ); query.app = fe->get_appname(); query.comp = "MRIMONITOR"; query.tag = "none"; rresult.clear(); if( regsrv->query_entries( rresult, query, false ) == -1 ) { psc_errmsg( "Error querying registry for application\n" ); exit( 1 ); } if( rresult.size() > 0 ) { psc_dbgmsg( 1, "%d processes of %s still registered\n", rresult.size(), query.app.c_str() ); } shutdown_finished = ( rresult.size() == 0 ); PSC_WTIME( current_time ); } if( !shutdown_finished ) { psc_errmsg( "Not all application processes terminated on time! Cleaning registry.\n" ); for( entry = rresult.begin(); entry != rresult.end(); entry++ ) { regsrv->delete_entry( ( *entry ).id ); } } else { psc_dbgmsg( 1, "All application processes terminated.\n" ); } } psc_dbgmsg( FRONTEND_HIGH_DEBUG_LEVEL, "Sending STOP command...\n" ); stop(); } void PeriscopeFrontend::terminate_agent_hierarchy() { std::map<std::string, AgentInfo>::iterator it; for( it = child_agents_.begin(); it != child_agents_.end(); it++ ) { AgentInfo& ag = it->second; if( connect_to_child( &ag ) == -1 ) { psc_errmsg( "Error connecting to child\n" ); abort(); } else { psc_dbgmsg( 5, "Sending QUIT command...\n" ); ag.handler->quit(); } } double start_time, current_time; int status; PSC_WTIME( start_time ); psc_dbgmsg( 2, "size of child agents: %d\n", child_agents_.size() ); child_agents_.erase( child_agents_.begin(), child_agents_.end() ); if( get_fastmode() ) { // check for starters that work in fast mode // TODO need to terminate the application and agents in fast mode -IC // need a way to verify that the agents and MPI application terminated, before continuing // instead of waiting, we can simply use new ports and execute asynchronously if( agent_pid > 0 ) { // in interactive runs, this variable holds the PID of the current forked AA -IC psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( HierarchySetup ), "This is an interactive run.\n" ); psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( HierarchySetup ), "Waiting for id of the Agent: %d\n\n", agent_pid ); waitpid( agent_pid, &status, 0 ); } else { // agents in a distributed memory run psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( HierarchySetup ), "Running on a distributed system.\n" ); psc_errmsg( "Waiting for agents on distributed systems not yet implemented. " "Throwing an exception at PeriscopeFrontend::terminate_agent_hierarchy()" ); throw 0; // TODO need to verify the termination of agents in distributed systems } } else { RegistryService* regsrv = fe->get_registry(); EntryData query; std::list< EntryData > rresult; std::list< EntryData >::iterator entry; bool shutdown_finished = false; while( !shutdown_finished && ( current_time - start_time ) < 60.0 ) { query.app = fe->get_appname(); query.comp = "MRIMONITOR"; query.tag = "none"; rresult.clear(); if( regsrv->query_entries( rresult, query, false ) == -1 ) { psc_errmsg( "Error querying registry for application\n" ); exit( 1 ); } if( rresult.size() > 0 ) { psc_dbgmsg( 1, "%d processes of %s still registered\n", rresult.size(), query.app.c_str() ); } shutdown_finished = ( rresult.size() == 0 ); PSC_WTIME( current_time ); } if( !shutdown_finished ) { psc_errmsg( "Not all application processes terminated on time! Cleaning registry.\n" ); for( entry = rresult.begin(); entry != rresult.end(); entry++ ) { regsrv->delete_entry( ( *entry ).id ); } //exit(1); } else { psc_dbgmsg( 1, "All application processes terminated.\n" ); } } // the frontend will hold the PID of the MPI application (more accurately, the mpiexec/launcher's PID) // the reason is that we fork a child that becomes an mpiexec process; this process terminates with the parallel // job, regardless of whether it is running locally or on a distributed system -IC psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( HierarchySetup ), "Waiting for id of the MPI application: %d\n\n", application_pid ); waitpid( application_pid, &status, 0 ); psc_dbgmsg( PSC_SELECTIVE_DEBUG_LEVEL( HierarchySetup ), "Termination of the application and agents done (fast mode).\n" ); psc_dbgmsg( FRONTEND_HIGH_DEBUG_LEVEL, "Sending STOP command...\n" ); psc_dbgmsg( 2, "stopping the agents...\n" ); stop(); fe->set_agent_hierarchy_started( false ); } /** * @brief Pre-analysis for scalability tests in OpenMP codes * * Does speedup analysis, scalability tests, and inserts the appropriate properties * */ void PeriscopeFrontend::do_pre_analysis() { //initializations properties_.clear(); property.clear(); property_threads.clear(); p_threads.clear(); PhaseTime_user.clear(); std::list<PropertyInfo>::iterator prop_it; //Get the properties information //for( int i = 0; std::list<MetaProperty>::iterator it = metaproperties_.begin(); it != metaproperties_.end(); it++ ){ for( int i = 0; i < metaproperties_.size(); i++ ) { get_prop_info( metaproperties_[ i ] ); } //Copy list of properties starting from thread no. 2 copy_properties_for_analysis(); //This function finds the existing properties for all runs find_existing_properties(); //Determine if the user_region scales or not / Meantime find the deviation time, execution time for user region bool user_flag = false; for( prop_it = properties_.begin(); prop_it != properties_.end(); ++prop_it ) { long double seq_user_time = 0.0; if( ( *prop_it ).maxThreads == 1 ) { if( ( *prop_it ).region == "USER_REGION" ) { string phase_user_Region = "USER_REGION"; seq_user_time = find_sequential_time( *prop_it ); do_speedup_analysis( *prop_it, seq_user_time, phase_user_Region ); user_flag = true; } else { ; } } else if( ( *prop_it ).maxThreads > 1 ) { break; } else { ; } } //If there is no user_region, then depend on main region, so.. if( !user_flag ) { for( prop_it = properties_.begin(); prop_it != properties_.end(); ++prop_it ) { long double seq_main_time = 0.0; if( ( *prop_it ).maxThreads == 1 ) { if( ( *prop_it ).region == "MAIN_REGION" ) { string phase_main_Region = "MAIN_REGION"; seq_main_time = find_sequential_time( *prop_it ); do_speedup_analysis( *prop_it, seq_main_time, phase_main_Region ); } else { ; } } else if( ( *prop_it ).maxThreads > 1 ) { break; } else { ; } } } //Find speedup for OpenMP regions std::list<long double> RFL_history; RFL_history.clear(); for( prop_it = properties_.begin(); prop_it != properties_.end(); ++prop_it ) { long double seq_time = 0.0; bool RFL_check = false; RFL_history.push_back( ( *prop_it ).RFL ); if( ( *prop_it ).maxThreads == 1 ) { if( ( int )count( RFL_history.begin(), RFL_history.end(), ( *prop_it ).RFL ) > 1 ) { RFL_check = true; } if( ( ( *prop_it ).region == "PARALLEL_REGION" || ( *prop_it ).region == "WORKSHARE_DO" || ( *prop_it ).region == "DO_REGION" || ( *prop_it ).region == "CALL_REGION" || ( *prop_it ).region == "SUB_REGION" ) && !RFL_check ) { string phaseRegion = ( *prop_it ).region; seq_time = find_sequential_time( *prop_it ); do_speedup_analysis( *prop_it, seq_time, phaseRegion ); } else { ; } } else if( ( *prop_it ).maxThreads > 1 ) { break; } else { ; } } //This function calculates the total deviation among the regions; //it finds the maximum among them; it shows the region with its severity value. for( int i = 1; i <= fe->get_ompfinalthreads(); i += i ) { Check_severity_among_parallel_regions( i ); } } /** * @brief Export scalability based found properties to a file * * Exports scalability based found properties to a file in XML format. * */ void PeriscopeFrontend::export_scalability_properties() { //initialization std::list<PropertyInfo>::iterator prop_it, prop_itr, s_it, e_it, sc_it, sp_it, d_it, p_it; double threshold_for_foundproperties = 0.0; //threshold above which the properties are displayed std::string propfilename = fe->get_outfilename(); std::ofstream xmlfile( propfilename.c_str() ); if( ( !xmlfile ) && opts.has_propfile ) { std::cout << "Cannot open xmlfile. \n"; exit( 1 ); } if( xmlfile && fe->get_ompnumthreads() == fe->get_ompfinalthreads() ) { psc_infomsg( "Exporting results to %s\n", propfilename.c_str() ); time_t rawtime; tm* timeinfo; time( &rawtime ); timeinfo = localtime( &rawtime ); xmlfile << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl; xmlfile << "<Experiment xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " "xmlns=\"http://www.lrr.in.tum.de/Periscope\" " "xsi:schemaLocation=\"http://www.lrr.in.tum.de/Periscope psc_properties.xsd \">" << std::endl << std::endl; xmlfile << std::setfill( '0' ); xmlfile << " <date>" << std::setw( 4 ) << ( timeinfo->tm_year + 1900 ) << "-" << std::setw( 2 ) << timeinfo->tm_mon + 1 << "-" << std::setw( 2 ) << timeinfo->tm_mday << "</date>" << std::endl; xmlfile << " <time>" << std::setw( 2 ) << timeinfo->tm_hour << ":" << std::setw( 2 ) << timeinfo->tm_min << ":" << std::setw( 2 ) << timeinfo->tm_sec << "</time>" << std::endl; // Wording directory for the experiment: can be used to find the data file(s) char* cwd = getenv( "PWD" ); xmlfile << " <dir>" << cwd << "</dir>" << std::endl; // Source revision if( opts.has_srcrev ) { // Source revision xmlfile << " <rev>" << opts.srcrev << "</rev>" << std::endl; } // Empty line before the properties xmlfile << std::endl; /* //The following lines should be removed sss std::list<std::string>::iterator it; //sss here we have to process the required properties. for( it = xmlproperties_.begin(); it != xmlproperties_.end(); it++ ){ xmlfile << *it; } */ } if( xmlfile && fe->get_ompnumthreads() == fe->get_ompfinalthreads() ) { // std::cout << std::endl; //Export all properties other than exectime::::: properties to .psc file for( p_it = properties_.begin(); p_it != properties_.end(); ++p_it ) { string::size_type p_loc = ( ( *p_it ).name ).find( ":::::", 0 ); if( false && p_loc != string::npos ) { ; } else { if( ( *p_it ).severity > threshold_for_foundproperties ) { xmlfile << "<property cluster=\"" << ( *p_it ).cluster << "\" ID=\"" << ( *p_it ).ID << "\" >\n " << "\t<name>" << ( *p_it ).name << "</name>\n " << "\t<context FileID=\"" << ( *p_it ).fileid << "\" FileName=\"" << ( *p_it ).filename << "\" RFL=\"" << ( *p_it ).RFL << "\" Config=\"" << ( *p_it ).maxProcs << "x" << ( *p_it ).maxThreads << "\" Region=\"" << ( *p_it ).region << "\" RegionId=\"" << ( *p_it ).RegionId << "\">\n " << "\t\t<execObj process=\"" << ( *p_it ).process << "\" thread=\"" << ( *p_it ).numthreads << "\"/>\n " << "\t</context>\n \t<severity>" << double( ( *p_it ).severity ) << "</severity>\n " << "\t<confidence>" << double( ( *p_it ).confidence ) << "</confidence>\n \t<addInfo>\n " << "\t\t"; xmlfile << ( *p_it ).addInfo; string::size_type p_loc = ( ( *p_it ).name ).find( ":::::", 0 ); if( p_loc != string::npos ) { xmlfile << "\t<exectime>" << ( p_it->execTime / NANOSEC_PER_SEC_DOUBLE ) << "s </exectime> "; } xmlfile << "\n\t</addInfo>\n </property>\n"; } } } // std::cout << std::endl; //Export speedup based newly developed property to properties.psc file for( sp_it = speedup_based_properties.begin(); sp_it != speedup_based_properties.end(); ++sp_it ) { // std::cout << " speedup_based_properties " << " size = " // << speedup_based_properties.size() << " config= " // << ( *sp_it ).maxThreads << " RFL = " << ( *sp_it ).RFL // << " " << ( *sp_it ).filename << " region = " // << ( *sp_it ).region << " process = " // << ( *sp_it ).process << " severity = " // << double( ( *sp_it ).severity ) << " cluster = " // << ( *sp_it ).cluster << " ID = " << ( *sp_it ).ID << " " // << ( *sp_it ).name << " fileid = " << ( *sp_it ).fileid // << std::endl; if( ( *sp_it ).severity > threshold_for_foundproperties ) { xmlfile << "<property cluster=\"" << ( *sp_it ).cluster << "\" ID=\""<< ( *sp_it ).ID << "\" >\n " << "\t<name>" << ( *sp_it ).name << "</name>\n " << "\t<context FileID=\"" << ( *sp_it ).fileid << "\" FileName=\"" << ( *sp_it ).filename << "\" RFL=\"" << ( *sp_it ).RFL << "\" Config=\"" << ( *sp_it ).maxProcs << "x" << ( *sp_it ).maxThreads << "\" Region=\"" << ( *sp_it ).region << "\" RegionId=\"" << ( *sp_it ).RegionId << "\">\n " << "\t\t<execObj process=\"" << ( *sp_it ).process << "\" thread=\"" << ( *sp_it ).numthreads << "\"/>\n " << "\t</context>\n \t<severity>" << double( ( *sp_it ).severity ) << "</severity>\n " << "\t<confidence>" << double( ( *sp_it ).confidence ) << "</confidence>\n \t<addInfo>\n " << "\t\t"; if( ( *sp_it ).addInfo == "" ) { ; } else { xmlfile << ( *sp_it ).addInfo; } xmlfile << "\n\t</addInfo>\n </property>\n"; } else { ; } } // std::cout << std::endl; //Export PropertyInfo from existing property list to properties.psc file //Different approach for printing properties for( prop_it = existing_properties.begin(); prop_it != existing_properties.end(); ++prop_it ) { string::size_type e_loc = ( ( *prop_it ).name ).find( ":::::", 0 ); if( e_loc != string::npos ) { ; } else { // std::cout << " existing_properties " << " size = " // << existing_properties.size() << " exec = " // << ( *prop_it ).execTime << " config= " // << ( *prop_it ).maxThreads << " RFL = " // << ( *prop_it ).RFL << " " << ( *prop_it ).filename // << " region = " << ( *prop_it ).region // << " process = " << ( *prop_it ).process // << " severity = " << double( ( *prop_it ).severity ) // << " cluster = " << ( *prop_it ).cluster << " ID = " // << ( *prop_it ).ID << " " << ( *prop_it ).name // << " fileid = " << ( *prop_it ).fileid << std::endl; string addinfo_name = ( *prop_it ).name; //get the property name which stays for all the configurations here int id = Property_occurring_in_all_configurations_id(); string id_s = convertInt( id ); if( ( *prop_it ).severity > threshold_for_foundproperties ) { xmlfile << "<property cluster=\"" << ( *prop_it ).cluster << "\" ID=\"" << id_s << "\" >\n " << "\t<name>" << " SCA -- Property occurring in all configurations " << "</name>\n " << "\t<context FileID=\"" << ( *prop_it ).fileid << "\" FileName=\"" << ( *prop_it ).filename << "\" RFL=\"" << ( *prop_it ).RFL << "\" Config=\"" << ( *prop_it ).maxProcs << "x" << ( *prop_it ).maxThreads << "\" Region=\"" << ( *prop_it ).region << "\" RegionId=\"" << ( *prop_it ).RegionId << "\">\n " << "\t\t<execObj process=\"" << ( *prop_it ).process << "\" thread=\"" << ( *prop_it ).numthreads << "\"/>\n " << "\t</context>\n \t<severity>" << double( ( *prop_it ).severity ) << "</severity>\n " << "\t<confidence>" << double( ( *prop_it ).confidence ) << "</confidence>\n \t<addInfo>\n " << "\t\t"; if( addinfo_name == "" ) { ; } else { xmlfile << "<Property_Name>" << addinfo_name << "</Property_Name>"; } xmlfile << "\n\t</addInfo>\n </property>\n"; } else { ; } } } // std::cout << std::endl; //Export severity based newly developed property to properties.psc file for( s_it = severity_based_properties.begin(); s_it != severity_based_properties.end(); ++s_it ) { // std::cout << " severity_based_properties " << " size = " // << severity_based_properties.size() << " exec = " // << ( *s_it ).execTime << " config= " // << ( *s_it ).maxThreads << " RFL = " << ( *s_it ).RFL // << " " << ( *s_it ).filename << " region = " // << ( *s_it ).region << " process = " // << ( *s_it ).process << " severity = " // << double( ( *s_it ).severity ) << " cluster = " // << ( *s_it ).cluster << " ID = " << ( *s_it ).ID << " " // << ( *s_it ).name << " fileid = " << ( *s_it ).fileid // << std::endl; if( ( *s_it ).severity > threshold_for_foundproperties ) { xmlfile << "<property cluster=\"" << ( *s_it ).cluster << "\" ID=\"" << ( *s_it ).ID << "\" >\n " << "\t<name>" << ( *s_it ).name << "</name>\n " << "\t<context FileID=\"" << ( *s_it ).fileid << "\" FileName=\"" << ( *s_it ).filename << "\" RFL=\"" << ( *s_it ).RFL << "\" Config=\"" << ( *s_it ).maxProcs << "x" << ( *s_it ).maxThreads << "\" Region=\"" << ( *s_it ).region << "\" RegionId=\"" << ( *s_it ).RegionId << "\">\n " << "\t\t<execObj process=\"" << ( *s_it ).process << "\" thread=\"" << ( *s_it ).numthreads << "\"/>\n " << "\t</context>\n \t<severity>" << double( ( *s_it ).severity ) << "</severity>\n " << "\t<confidence>" << double( ( *s_it ).confidence ) << "</confidence>\n \t<addInfo>\n " << "\t\t"; if( ( *s_it ).addInfo == "" ) { ; } else { xmlfile << ( *s_it ).addInfo; } xmlfile << "\n\t</addInfo>\n </property>\n"; } else { ; } } // std::cout << std::endl; for( d_it = DeviationProperties.begin(); d_it != DeviationProperties.end(); ++d_it ) { // std::cout << " DeviationProperties " << " size = " // << DeviationProperties.size() << " config= " // << ( *d_it ).maxThreads << " RFL = " // << ( *d_it ).RFL << " " << ( *d_it ).filename // << " region = " << ( *d_it ).region // << " process = " << ( *d_it ).process << " severity = " // << double( ( *d_it ).severity ) << " cluster = " // << ( *d_it ).cluster << " ID = " << ( *d_it ).ID << " " // << ( *d_it ).name << " fileid = " << ( *d_it ).fileid // << std::endl; if( ( *d_it ).severity > threshold_for_foundproperties ) { xmlfile << "<property cluster=\"" << ( *d_it ).cluster << "\" ID=\"" << ( *d_it ).ID << "\" >\n " << "\t<name>" << ( *d_it ).name << "</name>\n " << "\t<context FileID=\"" << ( *d_it ).fileid << "\" FileName=\"" << ( *d_it ).filename << "\" RFL=\"" << ( *d_it ).RFL << "\" Config=\"" << ( *d_it ).maxProcs << "x" << ( *d_it ).maxThreads << "\" Region=\"" << ( *d_it ).region << "\" RegionId=\"" << ( *d_it ).RegionId << "\">\n " << "\t\t<execObj process=\"" << ( *d_it ).process << "\" thread=\"" << ( *d_it ).numthreads << "\"/>\n " << "\t</context>\n \t<severity>" << double( ( *d_it ).severity ) << "</severity>\n " << "\t<confidence>" << double( ( *d_it ).confidence ) << "</confidence>\n \t<addInfo>\n " << "\t\t"; if( ( *d_it ).addInfo == "" ) { ; } else { xmlfile << ( *d_it ).addInfo; } xmlfile << "\n\t</addInfo>\n </property>\n"; } else { ; } } xmlfile << "</Experiment>" << std::endl; } xmlfile.close(); } //This function calculates the total deviation among the regions; //it finds the maximum among them; it shows the region with its severity value. void PeriscopeFrontend::Check_severity_among_parallel_regions( int config ) { std::list<PropertyInfo>::iterator prop_it, ex_it, p_it; std::list<PropertyInfo> prop_threadbased; std::list<long double> RFL_history; long double total_deviation_time = 0.0; long double phaseTime = 0.0; long double parallelTime = 0.0; bool severity_check = false; string userregion_filename; int userregion_fileid; string userregion_cluster; string userregion_ID; string userregion_context; string userregion_region; string userregion_RegionId; double userregion_RFL = 0.0; int userregion_maxThreads = 0; int userregion_maxProcs = 0; int userregion_numthreads = 0; int userregion_process = 0; double userregion_confidence = 0.0; prop_threadbased.clear(); RFL_history.clear(); //Finds the right config based properties and add them in a list; //calculates the sequential time for parallel regions in the program for( p_it = properties_.begin(); p_it != properties_.end(); ++p_it ) { //it should be restricted to only if( ( *p_it ).maxThreads == config ) { prop_threadbased.push_back( *p_it ); } else { ; } if( ( ( *p_it ).maxThreads == 1 ) && ( ( *p_it ).region == "PARALLEL_REGION" || ( *p_it ).region == "DO_REGION" || ( *p_it ).region == "WORKSHARE_REGION" ) ) { parallelTime += ( *p_it ).execTime; } else { ; } } int config_thread_count = prop_threadbased.size(); //Finds the total deviation time among all the regions for( ex_it = ExecAndDeviaProperties.begin(); ex_it != ExecAndDeviaProperties.end(); ++ex_it ) { //convert config to equivalent array. int config_equiv = 0; int count = 0; for( int i = 1; i <= fe->get_ompfinalthreads(); i += i ) { if( i == config ) { config_equiv = count; } count++; } //Get the phasetime for this configuration if( ( *ex_it ).region == "USER_REGION" ) { phaseTime = ( *ex_it ).exec_regions[ config_equiv ]; userregion_filename = ( *ex_it ).filename; userregion_region = ( *ex_it ).region; userregion_fileid = ( *ex_it ).fileid; userregion_cluster = ( *ex_it ).cluster; userregion_RFL = ( *ex_it ).RFL; userregion_ID = ( *ex_it ).ID; userregion_context = ( *ex_it ).context; userregion_maxThreads = ( *ex_it ).maxThreads; userregion_maxProcs = ( *ex_it ).maxProcs; userregion_numthreads = ( *ex_it ).numthreads; userregion_process = ( *ex_it ).process; userregion_confidence = ( *ex_it ).confidence; userregion_RegionId = ( *ex_it ).RegionId; } else if( ( *ex_it ).region == "MAIN_REGION" ) { phaseTime = ( *ex_it ).exec_regions[ config_equiv ]; userregion_region = ( *ex_it ).region; userregion_filename = ( *ex_it ).filename; userregion_fileid = ( *ex_it ).fileid; userregion_cluster = ( *ex_it ).cluster; userregion_RFL = ( *ex_it ).RFL; userregion_ID = ( *ex_it ).ID; userregion_context = ( *ex_it ).context; userregion_maxThreads = ( *ex_it ).maxThreads; userregion_maxProcs = ( *ex_it ).maxProcs; userregion_numthreads = ( *ex_it ).numthreads; userregion_process = ( *ex_it ).process; userregion_confidence = ( *ex_it ).confidence; userregion_RegionId = ( *ex_it ).RegionId; } else { ; } total_deviation_time += ( *ex_it ).devia_regions[ config_equiv ]; } long double max_deviation_time = 0.0; PropertyInfo max_info; for( prop_it = prop_threadbased.begin(); prop_it != prop_threadbased.end(); ++prop_it ) { //First find for main_region / user_region config_thread_count--; bool RFL_check = false; //Ensure that the RFL is unique RFL_history.push_back( ( *prop_it ).RFL ); if( ( int )count( RFL_history.begin(), RFL_history.end(), ( *prop_it ).RFL ) > 1 ) { RFL_check = true; } //if((*prop_it).region == "USER_REGION" || (*prop_it).region == "MAIN_REGION" || if( ( ( *prop_it ).region == "PARALLEL_REGION" || ( *prop_it ).region == "WORKSHARE_DO" || ( *prop_it ).region == "DO_REGION" || ( *prop_it ).region == "CALL_REGION" || ( *prop_it ).region == "SUB_REGION" ) && !RFL_check ) { //check if it matches with devia_properties string temp_region = ( *prop_it ).region; double temp_process = ( *prop_it ).process; int temp_maxThreads = ( *prop_it ).maxThreads; double temp_RFL = ( *prop_it ).RFL; int temp_fileid = ( *prop_it ).fileid; for( ex_it = ExecAndDeviaProperties.begin(); ex_it != ExecAndDeviaProperties.end(); ++ex_it ) { if( temp_process == ( *ex_it ).process && temp_RFL == ( *ex_it ).RFL && ( *ex_it ).fileid == temp_fileid && ( *ex_it ).region == temp_region ) { //here we have to find the maximal deviation based region int count = 0; int config_equiv = 0; long double devia_time_region = 0.0; for( int i = 1; i <= fe->get_ompfinalthreads(); i += i ) { if( i == config ) { config_equiv = count; } count++; } devia_time_region = ( *ex_it ).devia_regions[ config_equiv ]; if( devia_time_region > max_deviation_time ) { max_deviation_time = devia_time_region; //store the maximal region and its context max_info.filename = ( *prop_it ).filename; max_info.context = ( *prop_it ).context; max_info.region = ( *prop_it ).region; max_info.cluster = ( *prop_it ).cluster; int id = Code_region_with_the_lowest_speedup_in_the_run_id(); max_info.ID = convertInt( id ); max_info.fileid = ( *prop_it ).fileid; max_info.RFL = ( *prop_it ).RFL; max_info.confidence = ( double )( *prop_it ).confidence; max_info.maxThreads = config; //config val max_info.process = ( *prop_it ).process; max_info.numthreads = ( *prop_it ).numthreads; max_info.maxProcs = ( *prop_it ).maxProcs; max_info.RegionId = ( *prop_it ).RegionId; //here include the property saying that the region had maximal deviation with //the severity calculated double severity = 0.0; double condition = 0.0; if( config == 1 ) { max_info.severity = 0.0; //because the deviation is always zero for config 1 } else { condition = ( devia_time_region / total_deviation_time ) * 100; severity = ( devia_time_region / phaseTime ) * 100; max_info.severity = severity; } max_info.name = " SCA -- Code region with the lowest speedup in the run "; if( condition > 5 ) { severity_check = true; } else { severity_check = false; } } else { ; } break; } else { ; } } } else { ; //for region checks } //We need to add in the list which has the maximal deviation if( severity_check && config_thread_count == 0 ) { //ensure that we are in the final region check process DeviationProperties.push_back( max_info ); } } //Add another property for finding the percentage of the parallelized code if( config == 1 ) { PropertyInfo s_info; s_info.filename = userregion_filename; s_info.context = userregion_context; s_info.region = userregion_region; s_info.cluster = userregion_cluster; // char buf[ 5 ]; // itoa( Sequential_Computation_id(), buf, 10 ); int id = Sequential_Computation_id(); s_info.ID = convertInt( id ); // std::cout << " SEQUENTIALCOMPUTATION " << id << " s_info " << s_info.ID << std::endl; s_info.fileid = userregion_fileid; s_info.RFL = userregion_RFL; s_info.confidence = userregion_confidence; s_info.process = userregion_process; s_info.numthreads = userregion_numthreads; s_info.maxThreads = userregion_maxThreads; s_info.maxProcs = userregion_maxProcs; s_info.severity = ( ( phaseTime - parallelTime ) / phaseTime ) * 100; s_info.RegionId = userregion_RegionId; s_info.name = " SCA -- Sequential Computation "; DeviationProperties.push_back( s_info ); } else { ; } } //This function find the sequential time for the forwarded existing property long double PeriscopeFrontend::find_sequential_time( PropertyInfo prop_info ) { std::list<PropertyInfo>::iterator seq_it; string region_t = prop_info.region; string ID_t = prop_info.ID; string name_t = prop_info.name; double process_t = prop_info.process; double RFL_t = prop_info.RFL; int fileid_t = prop_info.fileid; //Check all the properties and if it identifies the same property, return its execution time. for( seq_it = properties_.begin(); seq_it != properties_.end(); ++seq_it ) { if( region_t == ( *seq_it ).region && process_t == ( *seq_it ).process && RFL_t == ( *seq_it ).RFL && fileid_t == ( *seq_it ).fileid && ID_t == ( *seq_it ).ID && name_t == ( *seq_it ).name ) { return ( *seq_it ).execTime; } else { ; } } return 0.0; } //This function copies properties from thread 2 void PeriscopeFrontend::copy_properties_for_analysis() { std::list<PropertyInfo>::iterator copy_it; //Check all the properties and add in the list if the threads are above 2 //Required because the OpenMP properties show up only after thread no. 2 for( copy_it = properties_.begin(); copy_it != properties_.end(); ++copy_it ) { if( ( *copy_it ).maxThreads > 1 ) { property_threads.push_back( *copy_it ); p_threads.push_back( *copy_it ); } else { ; } } } //This function identifies the existing_properties among threads void PeriscopeFrontend::find_existing_properties() { std::list<PropertyInfo>::iterator prop_it, prop_itr; existing_properties.clear(); int initial_thread = 2; std::cout << std::endl; long int count = 0; for( prop_it = property_threads.begin(); prop_it != property_threads.end(); ++prop_it ) { //surf within property infos... //fixing on one propertyInfo, check if we have to include in the list of properties or not. count++; if( ( *prop_it ).maxThreads == initial_thread ) { string temp_region = ( *prop_it ).region; string temp_name = ( *prop_it ).name; double temp_severity = double( ( *prop_it ).severity ); double temp_process = ( *prop_it ).process; int temp_maxThreads = ( *prop_it ).maxThreads; double temp_RFL = ( *prop_it ).RFL; int temp_fileid = ( *prop_it ).fileid; long int count_scaled = 0; for( int th_number = initial_thread; th_number <= fe->get_ompfinalthreads(); th_number += th_number ) { long int count_in = 0; for( prop_itr = p_threads.begin(); prop_itr != p_threads.end(); ++prop_itr ) { //after storing details, go through all the properties from the point of comparison to compare //and determine whether that property should be in the list of scalable properties count_in++; // if( temp_name == ( *prop_itr ).name && temp_process == ( *prop_itr ).process && temp_RFL == ( *prop_itr ).RFL && count_in >= count && temp_fileid == ( *prop_itr ).fileid && ( *prop_itr ).maxThreads == th_number && ( *prop_itr ).maxThreads != 1 ) { //For existing_properties checks process here count_scaled++; if( ( count_scaled + 1 ) >= fe->get_maxiterations() ) { string::size_type loc = ( ( *prop_it ).name ).find( ":::::", 0 ); if( loc != string::npos ) { ; } else { existing_properties.push_back( *prop_it ); } } break; //need not check for other properties in that thread number } else { ; } } } } else { break; } //not from initial thread } } ////Function that converts integer to string //std::string PeriscopeFrontend::convertInt( int number ) //{ // if( number == 0 ) { // return "0"; // } // string temp = ""; // string returnvalue = ""; // while(number > 0) { // temp += number % 10 + 48; // number /= 10; // } // for( int i = 0; i < temp.length(); i++ ) { // returnvalue += temp[ temp.length() - i - 1 ]; // } // return returnvalue; //} //Function that converts integer to string std::string PeriscopeFrontend::convertInt( int number ) { stringstream ss; //create a stringstream ss << number; //add number to the stream return ss.str(); //return a string with the contents of the stream } //This function does speedup analysis for every parallel regions void PeriscopeFrontend::do_speedup_analysis( PropertyInfo prop, long double seq_time, const std::string& phase_region ) { std::list<PropertyInfo>::iterator prop_itr; std::list<long double>::iterator rt_it; std::list<long double> temp_PhaseTime; temp_PhaseTime.clear(); string temp_region = prop.region; string temp_name = prop.name; double temp_severity = double( prop.severity ); double temp_process = prop.process; int temp_maxThreads = prop.maxThreads; double temp_RFL = prop.RFL; double severity_for_initialthread = 0.0; long double PhaseTime = 0.0; int temp_fileid = prop.fileid; string temp_ID = prop.ID; int count_scaled = 0; int count_execTime = 0; int count_speedup = 0; int count_severity = 0; bool stop_speedup_check = false; bool stop_tspeedup_check = false; bool stop_severity_check = false; bool need_not_list = false; double t_execTime = 0.0; double t_severity = 0.0; int initial_thread = 2; long double initial_execTime = seq_time; double speedup_prop = 0.0; double t_speedup = 0.0; std::string string_name = " "; //First initialization int Max = 10000; long double* execTime_regions = new long double[ Max ]; long double* deviationTime = new long double[ Max ]; execTime_regions[ 1 ] = initial_execTime; deviationTime[ 1 ] = 0.0; if( phase_region == "MAIN_REGION" || phase_region == "USER_REGION" ) { PhaseTime_user.push_back( initial_execTime ); } //make a temp list of phaseTime and remove the first one else if( ( phase_region != "MAIN_REGION" || phase_region != "USER_REGION" ) && PhaseTime_user.size() > 0 ) { temp_PhaseTime.assign( PhaseTime_user.begin(), PhaseTime_user.end() ); temp_PhaseTime.pop_front(); } else { ; } for( int th_number = initial_thread; th_number <= fe->get_ompfinalthreads(); th_number += th_number ) { execTime_regions[ th_number ] = 0.0; deviationTime[ th_number ] = 0.0; //For each thread number, we have to calculate the phaseTime PhaseTime = 0.0; if( temp_PhaseTime.size() > 0 && PhaseTime_user.size() > 0 ) { PhaseTime = temp_PhaseTime.front(); temp_PhaseTime.pop_front(); } else { ; } for( prop_itr = property_threads.begin(); prop_itr != property_threads.end(); ++prop_itr ) { need_not_list = false; if( temp_process == ( *prop_itr ).process && temp_fileid == ( *prop_itr ).fileid && temp_RFL == ( *prop_itr ).RFL && ( *prop_itr ).maxThreads == th_number && ( *prop_itr ).maxThreads != 1 && temp_name == ( *prop_itr ).name && ( *prop_itr ).ID == temp_ID ) { //We don't need to add the property relating to execTime string p_name = ( *prop_itr ).name; string::size_type loc = p_name.find( ":::::", 0 ); if( loc != string::npos ) { need_not_list = true; } else { ; } //we need to get the severity for initial run if( th_number == initial_thread ) { severity_for_initialthread = ( *prop_itr ).severity; } else { ; } count_scaled++; //the following property should be checked again //here we have to check if the severity is increasing or not. if( ( *prop_itr ).severity >= t_severity && stop_severity_check == false ) { count_severity++; if( ( count_severity + 1 ) >= fe->get_maxiterations() ) { //if the severity has continuously increased PropertyInfo s_info; s_info.name = " SCA -- Property with increasing severity across configurations "; s_info.filename = prop.filename; s_info.context = prop.context; s_info.region = prop.region; s_info.cluster = prop.cluster; int id = Property_with_increasing_severity_across_configurations_id(); s_info.ID = convertInt( id ); s_info.fileid = prop.fileid; s_info.numthreads = prop.numthreads; s_info.maxProcs = prop.maxProcs; s_info.RegionId = prop.RegionId; //make a definition here //severity is defined based on how much it increased for this particular property for various threads s_info.severity = ( prop.severity - severity_for_initialthread ); s_info.RFL = prop.RFL; s_info.confidence = ( double )prop.confidence; s_info.maxThreads = th_number; //the property increased till this thread number string_name = "<prop_name>"; string string_name_end = "</prop_name>"; s_info.addInfo = string_name + prop.name + string_name_end; s_info.process = prop.process; if( !need_not_list ) { severity_based_properties.push_back( s_info ); } else { ; } } t_severity = ( *prop_itr ).severity; } else { ; } //Speedup property requirements speedup_prop = ( long double )initial_execTime / ( double )( *prop_itr ).execTime; int rounded_speedup = speedup_prop; double decimal_val = ( double )speedup_prop - rounded_speedup; if( decimal_val > 0.5 ) { rounded_speedup++; } else { ; } //Store the execution time & deviation time for regions execTime_regions[ th_number ] = ( *prop_itr ).execTime; if( phase_region == "MAIN_REGION" || phase_region == "USER_REGION" ) { PhaseTime_user.push_back( ( *prop_itr ).execTime ); } else { ; } if( ( ( *prop_itr ).execTime ) - ( initial_execTime / th_number ) > 0 ) { deviationTime[ th_number ] = ( ( *prop_itr ).execTime ) - ( initial_execTime / th_number ); } else { deviationTime[ th_number ] = 0.0; } //Converting double to string std::ostringstream sstream; sstream << speedup_prop; std::string speedup_str = sstream.str(); speedup_str += ""; string speedup_start = "<speedup>"; string speedup_end = "</speedup>"; //Check if this satisfies the linear speedup/superlinear speedup condition (RARELY OCCURS) if( rounded_speedup == th_number || rounded_speedup > th_number && stop_speedup_check == false ) { count_speedup++; PropertyInfo s_info; s_info.filename = prop.filename; s_info.context = prop.context; s_info.region = prop.region; s_info.cluster = prop.cluster; s_info.fileid = prop.fileid; s_info.severity = 0.0; //severity should be 0.0 s_info.RFL = prop.RFL; s_info.confidence = ( double )prop.confidence; s_info.maxThreads = th_number; s_info.addInfo = speedup_start + speedup_str + speedup_end; s_info.process = prop.process; s_info.numthreads = prop.numthreads; s_info.maxProcs = prop.maxProcs; s_info.RegionId = prop.RegionId; if( rounded_speedup > th_number ) { s_info.name = " SCA -- SuperLinear Speedup for all configurations "; int id = SuperLinear_Speedup_for_all_configurations_id(); s_info.ID = convertInt( id ); speedup_based_properties.push_back( s_info ); } else { ; } if( ( count_speedup + 1 ) >= fe->get_maxiterations() ) { //now we shall include a new property saying that the speedup satisfied for all threads // in the particular RFL s_info.name = " SCA -- Linear Speedup for all configurations "; int id = Linear_Speedup_for_all_configurations_id(); s_info.ID = convertInt( id ); speedup_based_properties.push_back( s_info ); } } else if( !stop_speedup_check ) { //speedup fails in linear speedup condition once from the previous runs stop_speedup_check = true; //now we shall include a new property saying that the speedup is not satisfied due to these properties // in the particular RFL PropertyInfo s_info; s_info.name = " SCA -- Linear speedup failed for the first time "; s_info.filename = prop.filename; s_info.context = prop.context; s_info.region = prop.region; s_info.cluster = prop.cluster; int id = Linear_speedup_failed_for_the_first_time_id(); s_info.ID = convertInt( id ); s_info.fileid = prop.fileid; if( s_info.region == "MAIN_REGION" || s_info.region == "USER_REGION" ) { s_info.severity = ( deviationTime[ th_number ] / ( *prop_itr ).execTime ) * 100; } else { s_info.severity = ( deviationTime[ th_number ] / PhaseTime ) * 100; } s_info.RFL = prop.RFL; s_info.confidence = ( double )prop.confidence; s_info.maxThreads = th_number; s_info.addInfo = speedup_start + speedup_str + speedup_end; s_info.process = prop.process; s_info.numthreads = prop.numthreads; s_info.maxProcs = prop.maxProcs; s_info.RegionId = prop.RegionId; speedup_based_properties.push_back( s_info ); } else { ; } //We shall include a property that reports the low speedup considering every regions PropertyInfo l_info; long double l_condition = 0.0; l_condition = ( deviationTime[ th_number ] / PhaseTime ) * 100; if( l_condition > 0 ) { //Threshold set to zero (Increase later) l_info.name = " SCA -- Low Speedup "; l_info.filename = prop.filename; l_info.context = prop.context; l_info.region = prop.region; l_info.cluster = prop.cluster; int id = Low_Speedup_id(); l_info.ID = convertInt( id ); l_info.fileid = prop.fileid; if( l_info.region == "MAIN_REGION" || l_info.region == "USER_REGION" ) { l_info.severity = ( deviationTime[ th_number ] / ( *prop_itr ).execTime ) * 100; } else { l_info.severity = ( deviationTime[ th_number ] / PhaseTime ) * 100; } l_info.RFL = prop.RFL; l_info.confidence = ( double )prop.confidence; l_info.maxThreads = th_number; l_info.addInfo = speedup_start + speedup_str + speedup_end; l_info.process = prop.process; l_info.numthreads = prop.numthreads; l_info.maxProcs = prop.maxProcs; l_info.RegionId = prop.RegionId; speedup_based_properties.push_back( l_info ); } else { ; } //Find the thread when the speedup decreased //if(rounded_speedup < t_speedup && th_number != initial_thread && !stop_tspeedup_check){ if( rounded_speedup < t_speedup && !stop_tspeedup_check ) { //now we shall include a new property saying that the highest speedup reached until this threadno. // in the particular RFL stop_tspeedup_check = true; PropertyInfo s_info; s_info.name = " SCA -- Speedup Decreasing "; s_info.filename = prop.filename; s_info.context = prop.context; s_info.region = prop.region; s_info.cluster = prop.cluster; int id = Speedup_Decreasing_id(); s_info.ID = convertInt( id ); s_info.fileid = prop.fileid; if( s_info.region == "MAIN_REGION" || s_info.region == "USER_REGION" ) { s_info.severity = 0.0; } else { s_info.severity = ( deviationTime[ th_number ] / PhaseTime ) * 100; } s_info.RFL = prop.RFL; s_info.confidence = ( double )prop.confidence; s_info.maxThreads = th_number; s_info.addInfo = speedup_start + speedup_str + speedup_end; s_info.process = prop.process; s_info.numthreads = prop.numthreads; s_info.maxProcs = prop.maxProcs; s_info.RegionId = prop.RegionId; speedup_based_properties.push_back( s_info ); } else { t_speedup = rounded_speedup; } break; //need not check for other properties in that thread number } //if(th_number==) else { ; } } //for all properties_ } //for all threads PropertyInfo d_info; d_info.name = " "; d_info.filename = prop.filename; d_info.context = prop.context; d_info.region = prop.region; d_info.cluster = prop.cluster; d_info.ID = prop.ID; d_info.fileid = prop.fileid; d_info.severity = 0.0; d_info.RFL = prop.RFL; d_info.confidence = ( double )prop.confidence; d_info.maxThreads = prop.maxThreads; d_info.addInfo = " "; d_info.execTime = prop.execTime; d_info.process = prop.process; d_info.numthreads = prop.numthreads; d_info.maxProcs = prop.maxProcs; d_info.RegionId = prop.RegionId; int count_exec = 0; long double temp_execTime[ 30 ]; long double temp_deviaTime[ 30 ]; for( int i = 1; i <= fe->get_ompfinalthreads(); i += i ) { temp_execTime[ count_exec ] = execTime_regions[ i ]; temp_deviaTime[ count_exec ] = deviationTime[ i ]; count_exec++; } for( int i = 0; i < count_exec; i++ ) { d_info.exec_regions[ i ] = temp_execTime[ i ]; d_info.devia_regions[ i ] = temp_deviaTime[ i ]; } ExecAndDeviaProperties.push_back( d_info ); delete[] execTime_regions; delete[] deviationTime; } PropertyID PeriscopeFrontend::Property_with_increasing_severity_across_configurations_id() { return PROPERTYWITHINCREASINGSEVERITYACROSSCONFIGURATIONS; } PropertyID PeriscopeFrontend::SuperLinear_Speedup_for_all_configurations_id() { return SUPERLINEARSPEEDUPFORALLCONFIGURATIONS; } PropertyID PeriscopeFrontend::Linear_Speedup_for_all_configurations_id() { return LINEARSPEEDUPFORALLCONFIGURATIONS; } PropertyID PeriscopeFrontend::Linear_speedup_failed_for_the_first_time_id() { return LINEARSPEEDUPFAILEDFORTHEFIRSTTIME; } PropertyID PeriscopeFrontend::Low_Speedup_id() { return LOWSPEEDUP; } PropertyID PeriscopeFrontend::Speedup_Decreasing_id() { return SPEEDUPDECREASING; } PropertyID PeriscopeFrontend::Sequential_Computation_id() { return SEQUENTIALCOMPUTATION; } PropertyID PeriscopeFrontend::Code_region_with_the_lowest_speedup_in_the_run_id() { return CODEREGIONWITHTHELOWESTSPEEDUPINTHERUN; } PropertyID PeriscopeFrontend::Property_occurring_in_all_configurations_id() { return PROPERTYOCCURRINGINALLCONFIGURATIONS; } /* * This function returns the property info as a list using MetaProperty.cc */ void PeriscopeFrontend::get_prop_info( MetaProperty& prop ) { PropertyInfo info; info.filename = prop.getFileName(); info.name = prop.getName(); info.region = prop.getRegionType(); if( prop.getCluster() ) { info.cluster = "true"; } else { info.cluster = "false"; } info.ID = prop.getId(); info.RegionId = prop.getRegionId(); info.Config = prop.getConfiguration(); info.fileid = prop.getFileId(); info.RFL = prop.getStartPosition(); info.process = prop.getProcess(); info.numthreads = prop.getThread(); info.severity = prop.getSeverity(); info.confidence = prop.getConfidence(); info.maxThreads = prop.getMaxThreads(); info.maxProcs = prop.getMaxProcs(); info.purpose = prop.getPurpose(); //To find info.execTime addInfoType addInfo = prop.getExtraInfo(); addInfoType::const_iterator it = addInfo.find( "ExecTime" ); string addInfo_ExecTime = it->second; info.execTime = atof( addInfo_ExecTime.c_str() ); //To find info.addInfo string addInfo_str; for( addInfoType::const_iterator it = addInfo.begin(); it != addInfo.end(); ++it ) { addInfo_str = "\t\t<"; addInfo_str += it->first; addInfo_str += ">"; addInfo_str += it->second; addInfo_str += "</"; addInfo_str += it->first; addInfo_str += ">\n"; } //Add in the list of properties if( info.execTime == 0 && ( info.region == "SUB_REGION" || info.region == "CALL_REGION" ) ) { ; } else { property.push_back( info ); properties_.push_back( info ); } } void PeriscopeFrontend::reinit( int map_len, int map_from[ 8192 ], int map_to[ 8192 ] ) { std::map<std::string, AgentInfo>::iterator it; for( it = child_agents_.begin(); it != child_agents_.end(); it++ ) { AgentInfo& ag = it->second; if( ag.status != AgentInfo::CONNECTED ) { if( connect_to_child( &ag ) == -1 ) { psc_errmsg( "Error connecting to child\n" ); abort(); } else { psc_dbgmsg( 5, "Sending REINIT command...\n" ); ag.handler->reinit( map_len, map_from, map_to ); psc_dbgmsg( 5, "Sending REINIT command...OK\n" ); } } } } std::ostream& operator<<( std::ostream& os, const PropertyInfo& info ) { os << endl; os << "Property '" << info.name << "'" << endl; os << " holds for '" << info.context << "'" << endl; os << " on '" << info.host << "'" << endl; os << " severity " << setprecision( 5 ) << info.severity << ", confidence " << info.confidence; return os; } bool sevComparator( MetaProperty p1, MetaProperty p2 ) { return p1.getSeverity() > p2.getSeverity(); } /** * @brief Prints all found properties * */ void PeriscopeFrontend::properties() { int limitProps = 50; if( opts.has_nrprops ) { limitProps = opts.nrprops; } if( limitProps > 0 ) { std::cout << std::endl << "ALL FOUND PROPERTIES" << std::endl; std::cout << "-------------------------------------------------------------------------------\n"; // std::cout << std::setw(7) << "Procs\t" << std::setw(7) << "Threads\t" // << std::setw(13) << "Region\t" << std::setw(12) << "Location\t" // << std::setw(10) << "Severity\t" << "Description" << std::endl; std::cout << std::setw(7) << "Procs\t" << std::setw(13) << "Region\t" << std::setw(12) << "Location\t" << std::setw(10) << "Severity\t" << "Description" << std::endl; std::cout << "-------------------------------------------------------------------------------\n"; //metaproperties_.sort(sevComparator); std::sort( metaproperties_.begin(), metaproperties_.end(), sevComparator ); //for(std::list<MetaProperty>::iterator it = metaproperties_.begin(); ( it != metaproperties_.end() && limitProps > 0) ; it++, limitProps-- ){ for( int i = 0; i < metaproperties_.size() && limitProps > 0; i++, limitProps-- ) { string prop_string = ( metaproperties_[ i ] ).toString(); string::size_type p_loc = prop_string.find( ":::::", 0 ); // Exclude internal properties used to calculate the execution time for the scalability analysis if( p_loc != string::npos ) { ; } else { std::cout << prop_string << std::endl; } } //prompt(); } } /** * @brief Export all found properties to a file * * Exports all found properties to a file in XML format. * The filename can be specified using the --propfile command argument. */ void PeriscopeFrontend::export_properties() { std::string propfilename = fe->get_outfilename(); std::ofstream xmlfile( propfilename.c_str() ); if( !xmlfile && opts.has_propfile ) { std::cout << "Cannot open xmlfile. \n"; exit( 1 ); } if( xmlfile ) { psc_infomsg( "Exporting results to %s\n", propfilename.c_str() ); time_t rawtime; tm* timeinfo; time( &rawtime ); timeinfo = localtime( &rawtime ); xmlfile << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl; xmlfile << "<Experiment xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " "xmlns=\"http://www.lrr.in.tum.de/Periscope\" " "xsi:schemaLocation=\"http://www.lrr.in.tum.de/Periscope psc_properties.xsd \">" << std::endl << std::endl; xmlfile << std::setfill( '0' ); xmlfile << " <date>" << std::setw( 4 ) << ( timeinfo->tm_year + 1900 ) << "-" << std::setw( 2 ) << timeinfo->tm_mon + 1 << "-" << std::setw( 2 ) << timeinfo->tm_mday << "</date>" << std::endl; xmlfile << " <time>" << std::setw( 2 ) << timeinfo->tm_hour << ":" << std::setw( 2 ) << timeinfo->tm_min << ":" << std::setw( 2 ) << timeinfo->tm_sec << "</time>" << std::endl; xmlfile << " <numProcs>" << opts.mpinumprocs_string << "</numProcs>" << std::endl; xmlfile << " <numThreads>" << opts.ompnumthreads_string << "</numThreads>" << std::endl; // Wording directory for the experiment: can be used to find the data file(s) char* cwd = getenv( "PWD" ); xmlfile << " <dir>" << cwd << "</dir>" << std::endl; // Source revision if( opts.has_srcrev ) { // Source revision xmlfile << " <rev>" << opts.srcrev << "</rev>" << std::endl; } // Empty line before the properties xmlfile << std::endl; for( int i = 0; i < metaproperties_.size(); i++ ) { string prop_string = ( metaproperties_[ i ] ).toString(); string::size_type p_loc = prop_string.find( ":::::", 0 ); // Exclude internal properties used to calculate the execution time for the scalability analysis if( p_loc != string::npos ) { ; } else { xmlfile << ( metaproperties_[ i ] ).toXML(); } } xmlfile << "</Experiment>" << std::endl; } xmlfile.close(); } /** * @brief Checks all child agents for new properties * * Triggers connection to all lower level agents and * checks if new properties are available. */ void PeriscopeFrontend::check() { std::map<std::string, AgentInfo>::iterator it; for( it = child_agents_.begin(); it != child_agents_.end(); it++ ) { AgentInfo& ag = it->second; if( ag.status != AgentInfo::CONNECTED ) { if( connect_to_child( &ag ) == -1 ) { psc_errmsg( "Error connecting to child\n" ); abort(); } else { psc_dbgmsg( 1, "Checking properties...\n" ); ag.handler->check(); } } } } int PeriscopeFrontend::read_line( ACE_HANDLE hdle, char* buf, int len ) { int eoln = 0; while( !eoln && ( len > 0 ) && ( ACE::recv( hdle, buf, 1 ) == 1 ) ) { eoln = ( *buf == '\n' ); buf++; len--; } return eoln; } /** * @deprecated Properties are transmitted/processed using XML * @brief Prints the found performance property * * This method is called whenever a new performance property is found * * @param prop performance property to print */ void PeriscopeFrontend::found_property( PropertyInfo& prop ) { std::cout << prop.name << "\t" << prop.context << "\t" << prop.host << "\t" << prop.severity << std::endl; prompt(); } /** * @brief Processes the found performance property * * This method is called whenever a new performance property is found. * This new property is added to a list containing all properties. * * @param propData performance property (as string) */ void PeriscopeFrontend::found_property( std::string& propData ) { metaproperties_.push_back( MetaProperty::fromXML( propData ) ); } void PeriscopeFrontend::set_timer( int init, int inter, int max, TimerAction ta ) { ACE_Reactor* reactor = ACE_Event_Handler::reactor(); ACE_Time_Value initial( init ); ACE_Time_Value interval( inter ); reactor->schedule_timer( this, 0, initial, interval ); ACE_Time_Value timeout = ACE_OS::gettimeofday(); timeout += max; set_timeout( timeout ); timer_action = ta; } std::string region2string( int fid, int rfl ) { std::stringstream info; std::string str; info << ":" << fid << ":" << rfl << ":"; str = info.str(); return str; } bool applUninstrumented() { if( opts.has_uninstrumented ) { return true; } if( psc_config_open() ) { if( psc_config_uninstrumented() ) { return true; } psc_config_close(); } if( getenv( "PSC_UNINSTRUMENTED" ) ) { return true; } return false; }
39.63146
150
0.513987
robert-mijakovic
97d8d86a5d670d77b6f886800afe52610252c49c
3,455
cpp
C++
tc 160+/StonesGame.cpp
ibudiselic/contest-problem-solutions
88082981b4d87da843472e3ca9ed5f4c42b3f0aa
[ "BSD-2-Clause" ]
3
2015-05-25T06:24:37.000Z
2016-09-10T07:58:00.000Z
tc 160+/StonesGame.cpp
ibudiselic/contest-problem-solutions
88082981b4d87da843472e3ca9ed5f4c42b3f0aa
[ "BSD-2-Clause" ]
null
null
null
tc 160+/StonesGame.cpp
ibudiselic/contest-problem-solutions
88082981b4d87da843472e3ca9ed5f4c42b3f0aa
[ "BSD-2-Clause" ]
5
2015-05-25T06:24:40.000Z
2021-08-19T19:22:29.000Z
#include <algorithm> #include <cassert> #include <cstdio> #include <iostream> #include <sstream> #include <string> #include <vector> #include <cstring> using namespace std; void bounds(int N, int M, int K, int &l, int &r) { int rpoint = max(K, M); int inpoint = M - rpoint + K; l = M - 2*(inpoint-(K+1)/2) + (K+1)%2; int lpoint = min(N-K+1, M); inpoint = M - lpoint + 1; r = M - 2*(inpoint-(K+1)/2) + (K+1)%2; } class StonesGame { public: string winner(int N, int M, int K, int L) { int l, r, ll, rr; bounds(N, M, K, l, r); bounds(N, L, K, ll, rr); if (K & 1) { if ((L&1) != (M&1)) { return "Draw"; } if (l<=L && L<=r) { return "Romeo"; } if (ll<=l && r<=rr) { return "Strangelet"; } else { return "Draw"; } } else { if ((L&1) == (M&1)) { if (ll<=l && r<=rr) { return "Strangelet"; } else { return "Draw"; } } else { if (l<=L && L<=r) { return "Romeo"; } else { return "Draw"; } } } } // BEGIN CUT HERE public: void run_test(int Case) { if ((Case == -1) || (Case == 0)) test_case_0(); if ((Case == -1) || (Case == 1)) test_case_1(); if ((Case == -1) || (Case == 2)) test_case_2(); if ((Case == -1) || (Case == 3)) test_case_3(); if ((Case == -1) || (Case == 4)) test_case_4(); if ((Case == -1) || (Case == 5)) test_case_5(); } private: template <typename T> string print_array(const vector<T> &V) { ostringstream os; os << "{ "; for (typename vector<T>::const_iterator iter = V.begin(); iter != V.end(); ++iter) os << '\"' << *iter << "\","; os << " }"; return os.str(); } void verify_case(int Case, const string &Expected, const string &Received) { cerr << "Test Case #" << Case << "..."; if (Expected == Received) cerr << "PASSED" << endl; else { cerr << "FAILED" << endl; cerr << "\tExpected: \"" << Expected << '\"' << endl; cerr << "\tReceived: \"" << Received << '\"' << endl; } } void test_case_0() { int Arg0 = 3; int Arg1 = 1; int Arg2 = 1; int Arg3 = 2; string Arg4 = "Draw"; verify_case(0, Arg4, winner(Arg0, Arg1, Arg2, Arg3)); } void test_case_1() { int Arg0 = 5; int Arg1 = 1; int Arg2 = 2; int Arg3 = 2; string Arg4 = "Romeo"; verify_case(1, Arg4, winner(Arg0, Arg1, Arg2, Arg3)); } void test_case_2() { int Arg0 = 5; int Arg1 = 5; int Arg2 = 2; int Arg3 = 3; string Arg4 = "Strangelet"; verify_case(2, Arg4, winner(Arg0, Arg1, Arg2, Arg3)); } void test_case_3() { int Arg0 = 5; int Arg1 = 5; int Arg2 = 2; int Arg3 = 2; string Arg4 = "Draw"; verify_case(3, Arg4, winner(Arg0, Arg1, Arg2, Arg3)); } void test_case_4() { int Arg0 = 1000000; int Arg1 = 804588; int Arg2 = 705444; int Arg3 = 292263; string Arg4 = "Romeo"; verify_case(4, Arg4, winner(Arg0, Arg1, Arg2, Arg3)); } void test_case_5() { int Arg0 = 1000000; int Arg1 = 100000; int Arg2 = 500000; int Arg3 = 600000; string Arg4 = "Strangelet"; verify_case(5, Arg4, winner(Arg0, Arg1, Arg2, Arg3)); } // END CUT HERE }; // BEGIN CUT HERE int main() { StonesGame ___test; ___test.run_test(-1); } // END CUT HERE
39.712644
317
0.495224
ibudiselic
97da2f72108d65d88e60fdf55eb84c7142c85449
17,713
cpp
C++
imdexp/src/viewer/viewer.cpp
olivierchatry/iri3d
cae98c61d9257546d0fc81e69709297d04a17a14
[ "MIT" ]
2
2022-01-02T08:12:29.000Z
2022-02-12T22:15:11.000Z
imdexp/src/viewer/viewer.cpp
olivierchatry/iri3d
cae98c61d9257546d0fc81e69709297d04a17a14
[ "MIT" ]
null
null
null
imdexp/src/viewer/viewer.cpp
olivierchatry/iri3d
cae98c61d9257546d0fc81e69709297d04a17a14
[ "MIT" ]
1
2022-01-02T08:09:51.000Z
2022-01-02T08:09:51.000Z
#include <stdafx.h> const int grid_size = 80; // draw a 10x10 grid. const int grid_primitive_count = grid_size * grid_size * 4; // eache sqaure take 4 lines. const float grid_increment = 20.0f; Viewer::Viewer() : _loger(0), _d3d_device(0), _d3d_object(0), _d3d_backbuffer(0), _d3d_depthbuffer(0), _wnd(0), _list_element(0), _list_material(0), _texture(0), _viewer_timer_event(0), _capture_movement(false), _angle_x(0), _angle_y(0), _angle_z(0), _zoom(10), _at(0.0f, 0.0f, 0.0f), _up(0.0f, 0.0f, 1.0f), _position(0.0f, -2.0f, 0.0f), _thread_handle(0), _end_thread(false), _can_free(false) { } ////////////////////////////////////////////////////////////////////////// // generate a vertex buffer containt line list for drawing a grid. // !!!!!!! not efficient !!!!!!!!! ////////////////////////////////////////////////////////////////////////// void Viewer::GenerateGrid(int size, float increment) { float middle = (float)size / 2.0f; float inc_middle = increment / 2.0f; _vb_grid.Allocate(_d3d_device, size * size * 8, D3DPT_LINELIST); vertex3d_t *v = _vb_grid.Lock(); for (float x = -middle; x < middle; ++x) { for (float y = -middle; y < middle; ++y) { v->_color = 0xffffffff; v->_pos = D3DXVECTOR3((x * increment) - inc_middle, (y * increment) - inc_middle, 0.0f); v++; v->_color = 0xffffffff; v->_pos = D3DXVECTOR3((x * increment) - inc_middle, (y * increment) + inc_middle, 0.0f); v++; v->_color = 0xffffffff; v->_pos = D3DXVECTOR3((x * increment) - inc_middle, (y * increment) + inc_middle, 0.0f); v++; v->_color = 0xffffffff; v->_pos = D3DXVECTOR3((x * increment) + inc_middle, (y * increment) + inc_middle, 0.0f); v++; v->_color = 0xffffffff; v->_pos = D3DXVECTOR3((x * increment) + inc_middle, (y * increment) + inc_middle, 0.0f); v++; v->_color = 0xffffffff; v->_pos = D3DXVECTOR3((x * increment) + inc_middle, (y * increment) - inc_middle, 0.0f); v++; v->_color = 0xffffffff; v->_pos = D3DXVECTOR3((x * increment) + inc_middle, (y * increment) - inc_middle, 0.0f); v++; v->_color = 0xffffffff; v->_pos = D3DXVECTOR3((x * increment) - inc_middle, (y * increment) - inc_middle, 0.0f); v++; } } _vb_grid.Unlock(); } void Viewer::StartD3DThread() { _thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)D3DThread, this, 0, (LPDWORD)&_thread_id); _can_free = false; SetThreadPriority(_thread_handle, THREAD_PRIORITY_IDLE); } INT_PTR CALLBACK Viewer::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static POINT old_mouse_pos = {0}; switch (msg) { case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: Viewer::Get().Destroy(); EndDialog(hWnd, 1); break; } break; case WM_KEYDOWN: if (wParam == VK_UP) Viewer::Get().GoUp(); if (wParam == VK_DOWN) Viewer::Get().GoDown(); if (wParam == VK_LEFT) Viewer::Get().StrafeLeft(); if (wParam == VK_RIGHT) Viewer::Get().StrafeRight(); break; case WM_LBUTTONDOWN: if (Viewer::Get()._capture_movement == false) { RECT rect; ShowCursor(FALSE); GetClientRect(hWnd, &rect); Viewer::Get().SetWindowSize(&rect); GetCursorPos(&Viewer::Get()._old_pos); SetCursorPos(Viewer::Get()._wnd_middle_x, Viewer::Get()._wnd_middle_y); Viewer::Get()._capture_movement = true; } else { Viewer::Get()._capture_movement = false; ShowCursor(TRUE); SetCursorPos(Viewer::Get()._old_pos.x, Viewer::Get()._old_pos.y); } break; case WM_LBUTTONUP: break; case WM_MOUSEMOVE: if (Viewer::Get()._capture_movement) { POINT new_pos; GetCursorPos(&new_pos); if ((new_pos.x == Viewer::Get()._wnd_middle_x) && (new_pos.y == Viewer::Get()._wnd_middle_y)) break; int offset_y = Viewer::Get()._wnd_middle_x - new_pos.x; int offset_z = Viewer::Get()._wnd_middle_y - new_pos.y; SetCursorPos(Viewer::Get()._wnd_middle_x, Viewer::Get()._wnd_middle_y); if (offset_y != 0 || offset_z != 0) { Viewer::Get().SetCameraAngle(offset_y / 1000.0f, offset_z / 1000.0f); } } break; case WM_CLOSE: case WM_QUIT: case WM_DESTROY: Viewer::Get().Destroy(); EndDialog(hWnd, 0); break; default: return FALSE; } return TRUE; } Viewer::~Viewer() { Destroy(); } void Viewer::DestroyTextures() { if (_texture) { for (uint i = 0; i < _texture_count; ++i) if (_texture[i]) _texture[i]->Release(); delete[] _texture; _texture = 0; } } void Viewer::PrintIluError() { ILenum error; while ((error = ilGetError())) Debugf("+ ilu error: %s", iluErrorString(error)); } typedef LPDIRECT3D8(__stdcall *DIRECT3DCREATE8)(uint); bool Viewer::InitDirect3D(HWND hwnd, bool fullscreen, int size_x, int size_y) { // loading d3d8.dll _d3d_object = Direct3DCreate8(D3D_SDK_VERSION); ASSERT_VIEWER(_d3d_object != 0, "!!! Cannot create d3d object"); D3DCAPS8 dev_caps; HRESULT hres; // look for hardware card, if no exit. hres = _d3d_object->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &dev_caps); ASSERT_VIEWER(SUCCEEDED(hres), "No 3d hardware"); D3DPRESENT_PARAMETERS pp = {0}; pp.BackBufferWidth = size_x; pp.BackBufferHeight = size_y; pp.BackBufferCount = 1; // no faa pp.MultiSampleType = D3DMULTISAMPLE_NONE; // no aa pp.hDeviceWindow = hwnd; pp.Windowed = !fullscreen; // stencil for shadow pp.EnableAutoDepthStencil = true; pp.AutoDepthStencilFormat = D3DFMT_D16; pp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; pp.SwapEffect = D3DSWAPEFFECT_DISCARD; pp.FullScreen_PresentationInterval = fullscreen ? D3DPRESENT_INTERVAL_IMMEDIATE : D3DPRESENT_INTERVAL_DEFAULT; if (!fullscreen) { // FIX ME : don't like voodoo card so ... don't really need this ASSERT_VIEWER((dev_caps.Caps2 & D3DCAPS2_CANRENDERWINDOWED), "cannot render on windows"); D3DDISPLAYMODE current_displaye_mode; hres = _d3d_object->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &current_displaye_mode); ASSERT_VIEWER(SUCCEEDED(hres), "get display mode"); pp.BackBufferFormat = current_displaye_mode.Format; } else { int mode_count = _d3d_object->GetAdapterModeCount(D3DADAPTER_DEFAULT); ASSERT_VIEWER(mode_count != 0, "no display mode"); D3DDISPLAYMODE new_mode, best_mode; bool found = false; do { hres = _d3d_object->EnumAdapterModes(D3DADAPTER_DEFAULT, mode_count - 1, &new_mode); ASSERT_VIEWER(SUCCEEDED(hres), "adaptator enumeration"); if (new_mode.Height == size_y && new_mode.Width == size_x) if ((found && (new_mode.Format < new_mode.Format)) || !found) best_mode = new_mode, found = true; } while (--mode_count); ASSERT_VIEWER(found, "cannot find a suitable display mode"); pp.BackBufferFormat = best_mode.Format; } // look for hardware vertex proecesind int flags = D3DCREATE_SOFTWARE_VERTEXPROCESSING; if (dev_caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) flags = (dev_caps.DevCaps & D3DDEVCAPS_PUREDEVICE) ? D3DCREATE_HARDWARE_VERTEXPROCESSING : D3DCREATE_MIXED_VERTEXPROCESSING; hres = _d3d_object->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, _wnd, flags | D3DCREATE_MULTITHREADED, &pp, &_d3d_device); ASSERT_VIEWER(SUCCEEDED(hres), "device creation"); hres = _d3d_device->GetRenderTarget(&_d3d_backbuffer); ASSERT_VIEWER(SUCCEEDED(hres), "set backbuffer"); hres = _d3d_device->GetDepthStencilSurface(&_d3d_depthbuffer); ASSERT_VIEWER(SUCCEEDED(hres), "set stencil buffer"); return true; } void Viewer::SetImportedElements(ImdExp::element_list_t *list_element) { _list_element = list_element; } void Viewer::LoadTextures() { bool il_error = false; DestroyTextures(); if (_list_material == 0) return; _texture_count = _list_material->_material_data.size(); _texture = new IDirect3DTexture8 *[_texture_count]; for (uint i = 0; i < _texture_count; ++i) { MaterialData *material = _list_material->_material_data[i]; ILuint il_id; material->_data = 0; if (material->_diffuse_map == 0) continue; ilGenImages(1, &il_id); ilBindImage(il_id); _texture[i] = 0; if (ilLoadImage(material->_diffuse_map) == IL_TRUE) { if (ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE) == IL_TRUE) { ilutSetInteger(ILUT_D3D_POOL, D3DPOOL_MANAGED); _texture[i] = ilutD3D8Texture(_d3d_device); material->_data = (void *)(_texture[i]); } else il_error = true; } else il_error = true; if (il_error) { PrintIluError(); } ilDeleteImages(1, &il_id); } } void Viewer::Debug(char *str) { Loger::Get().Print(str); } void Viewer::Debugf(char *str, ...) { va_list args; TCHAR buffer[1024]; // FIXMEEE va_start(args, str); vsprintf(buffer, str, args); Debug(buffer); va_end(args); } void Viewer::UpdateCamera() { D3DXVECTOR3 axis, sub; D3DXVec3Subtract(&_direction, &_at, &_position); D3DXVec3Cross(&_inv_strafe_left, &_up, &_direction); D3DXVec3Normalize(&_inv_strafe_left, &_inv_strafe_left); RotateAt(_angle_z, &_inv_strafe_left); RotateAt(_angle_y, &D3DXVECTOR3(0.0f, 0.0f, 1.0f)); D3DXVec3Normalize(&_direction, &_direction); _inv_direction = -_direction; _strafe_left = -_inv_strafe_left; D3DXMATRIX view_matrix; D3DXMatrixLookAtLH(&view_matrix, &_position, &_at, &_up); _angle_z = _angle_y = 0; _d3d_device->SetTransform(D3DTS_VIEW, &view_matrix); } void Viewer::RotateAt(float angle, D3DXVECTOR3 *axis) { D3DXVECTOR3 tmp; D3DXVECTOR3 direction; D3DXVec3Subtract(&direction, &_at, &_position); float c = cosf(angle); float s = sinf(angle); tmp.x = (c + (1 - c) * axis->x) * direction.x; tmp.x += ((1 - c) * axis->x * axis->y - axis->z * s) * direction.y; tmp.x += ((1 - c) * axis->x * axis->z + axis->y * s) * direction.z; tmp.y = ((1 - c) * axis->x * axis->y + axis->z * s) * direction.x; tmp.y += (c + (1 - c) * axis->y) * direction.y; tmp.y += ((1 - c) * axis->y * axis->z - axis->x * s) * direction.z; tmp.z = ((1 - c) * axis->x * axis->z - axis->y * s) * direction.x; tmp.z += ((1 - c) * axis->y * axis->z + axis->x * s) * direction.y; tmp.z += (c + (1 - c) * axis->z) * direction.z; D3DXVec3Add(&_at, &_position, &tmp); } void Viewer::Render() { if (_d3d_device) { _d3d_device->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB(0x00, 0x0, 0x0, 0x0), 1, 0); _d3d_device->BeginScene(); _d3d_device->SetTexture(0, 0); _d3d_device->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR); _d3d_device->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_LINEAR); _d3d_device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE); _d3d_device->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); _d3d_device->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE); _d3d_device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE); _vb_grid.Draw(_d3d_device, grid_primitive_count); for (uint mesh = 0; mesh < _vb.size(); ++mesh) { _d3d_device->SetTexture(0, (IDirect3DBaseTexture8 *)_texture_list[mesh]); _vb[mesh].DrawIndexed(_d3d_device, D3DPT_TRIANGLESTRIP); } _d3d_device->EndScene(); _d3d_device->Present(NULL, NULL, NULL, NULL); } } void Viewer::Destroy() { DestroyThread(); if (_loger) _loger = 0; _d3d_device = 0; _d3d_object = 0; _wnd = 0; } void Viewer::DestroyThread() { if (_thread_handle) { Viewer::_end_thread = true; WaitForSingleObject(_thread_handle, 2000); CloseHandle(_thread_handle); _thread_handle = 0; Viewer::_end_thread = false; } } bool Viewer::Create(HINSTANCE hinstance) { if (_wnd) SendMessage(_wnd, WM_QUIT, 0, 0); // destroy our windows. RECT rect; _wnd = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_DIALOGVIEWER), 0, WndProc); ASSERT_VIEWER(_wnd != 0, "Cannot create window !!!"); GetClientRect(_wnd, &rect); _wnd_height = rect.bottom - rect.top; _wnd_width = rect.right - rect.left; _wnd_middle_x = _wnd_width >> 1; _wnd_middle_y = _wnd_height >> 1; Loger::Get().Printf("Client window is %d %d", _wnd_width, _wnd_height); ShowWindow(_wnd, SW_SHOW); return true; } void Viewer::D3DThread(Viewer *viewer) { ilInit(); iluInit(); ilutInit(); if (ilGetInteger(IL_VERSION_NUM) < IL_VERSION || iluGetInteger(ILU_VERSION_NUM) < ILU_VERSION) viewer->Debug("DevIL header version is different from lib version !!!!"); viewer->InitDirect3D(viewer->_wnd, false, viewer->_wnd_width, viewer->_wnd_height); viewer->GenerateGrid(grid_size, grid_increment); viewer->LoadTextures(); viewer->CreateD3dBuffer(); // default setting. D3DXMATRIX projection_matrix; D3DXMatrixPerspectiveFovLH(&projection_matrix, D3DX_PI / 3, (float)viewer->_wnd_width / (float)viewer->_wnd_height, 1.0f, 1000.0f); viewer->_d3d_device->SetTransform(D3DTS_PROJECTION, &projection_matrix); D3DMATERIAL8 material; material.Ambient.a = 0; material.Ambient.r = material.Ambient.g = material.Ambient.b = 0.0f; material.Diffuse.r = material.Diffuse.g = material.Diffuse.b = 0.1f; material.Specular.r = material.Specular.g = material.Specular.b = 0.1f; material.Power = 0.0f; viewer->_d3d_device->SetMaterial(&material); // no lighting viewer->_d3d_device->SetRenderState(D3DRS_LIGHTING, 0); // no culling viewer->_d3d_device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); // set default material viewer->_can_free = true; while (!viewer->_end_thread) { viewer->UpdateCamera(); viewer->Render(); } viewer->DestroyTextures(); for (uint i = 0; i < viewer->_vb.size(); ++i) viewer->_vb[i].Deallocate(); viewer->_vb_grid.Deallocate(); if (viewer->_d3d_device) viewer->_d3d_device->Release(); if (viewer->_d3d_object) viewer->_d3d_object->Release(); } ////////////////////////////////////////////////////////////////////////// // Create Vertex Buffer from imported element ////////////////////////////////////////////////////////////////////////// void Viewer::CreateD3dBuffer() { // get number of vertex in totla mesh. ImdExp::element_list_it_t it; size_t num_indices_total = 0; size_t num_vertex_total = 0; size_t num_mesh = 0; size_t num_strip = 0; for (it = _list_element->begin(); it != _list_element->end(); ++it) { if ((*it)->_type == mesh_element) { ImportedMesh *mesh = (ImportedMesh *)(*it); for (uint i = 0; i < mesh->_strip.size(); ++i) num_indices_total += mesh->_strip[i]._face_index.size(); num_vertex_total += mesh->_mesh_data[0]._vertex.size(); num_strip += mesh->_strip.size(); num_mesh++; } } // create our vertex buffer. _vb.resize(num_mesh); _texture_list.resize(num_mesh); num_mesh = 0; // fill our vertex buffer for (it = _list_element->begin(); it != _list_element->end(); ++it) { if ((*it)->_type == mesh_element) { ImportedMesh *mesh = (ImportedMesh *)(*it); MeshData *data = &(mesh->_mesh_data[0]); MeshColorMapping *mapping_color = &(mesh->_mesh_color_mapping); bool have_color = mapping_color->_color.size() > 0; if (mesh->_material) _texture_list[num_mesh] = mesh->_material->_data; else _texture_list[num_mesh] = 0; _vb[num_mesh].Allocate(_d3d_device, (uint)data->_vertex.size(), D3DPT_TRIANGLESTRIP); ////////////////////////////////////////////////////////////////////////// // fill our vertex buffer vertex3d_t *v = _vb[num_mesh].Lock(); for (uint i = 0; i < data->_vertex.size(); ++i) { v->_pos.x = data->_vertex[i].x; v->_pos.y = data->_vertex[i].y; v->_pos.z = data->_vertex[i].z; v->_norm.x = data->_normal[i].x; v->_norm.y = data->_normal[i].y; v->_norm.z = data->_normal[i].z; v->_u = mapping_color->_mapping[i]._uv.x; v->_v = 1.0f - mapping_color->_mapping[i]._uv.y; uint r = (uint)(mapping_color->_color[i].x * 255) & 0xff; uint g = (uint)(mapping_color->_color[i].y * 255) & 0xff; uint b = (uint)(mapping_color->_color[i].z * 255) & 0xff; v->_color = have_color ? (r << 16 | g << 8 | b) : 0; v++; } _vb[num_mesh].Unlock(); ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // fill our index buffer; _vb[num_mesh].PrealocateIBList((uint)mesh->_strip.size()); for (i = 0; i < mesh->_strip.size(); ++i) { uword_list_t &indices = mesh->_strip[i]._face_index; _vb[num_mesh].CreateIB(_d3d_device, i, (uint)indices.size(), (uint)indices.size() - 2); WORD *ib = _vb[num_mesh]._ib[i].Lock(); for (uint f = 0; f < indices.size(); ++f) { *ib = indices[f]; ib++; } _vb[num_mesh]._ib[i].Unlock(); } ////////////////////////////////////////////////////////////////////////// num_mesh++; } } } void Viewer::SetImportedMaterial(ImportedMaterial *list_material) { _list_material = list_material; }
32.923792
133
0.616666
olivierchatry
97ded0faefa2f15836eacf1033fdbb91b50abc48
1,356
cpp
C++
algorithms/RANGETREELAZY.cpp
chinoxyz/guiafuentes
753d026d91ddcbabcccee7947a2ee6c581eb94eb
[ "MIT" ]
null
null
null
algorithms/RANGETREELAZY.cpp
chinoxyz/guiafuentes
753d026d91ddcbabcccee7947a2ee6c581eb94eb
[ "MIT" ]
null
null
null
algorithms/RANGETREELAZY.cpp
chinoxyz/guiafuentes
753d026d91ddcbabcccee7947a2ee6c581eb94eb
[ "MIT" ]
null
null
null
#define MAXN 100000 #define T int #define neutro 0 // entrada, arbol, acumulado(propagacion) elemento 0 se desperdicia T input[MAXN]; T tree[MAXN*17]; T acum[MAXN*17]; T f(T a, T b) { return a + b; } // Funcion que mantiene el segment tree // init(1,1,n) void init(int node, int b, int e) { acum[node] = 0; if(b == e) tree[node] = input[b]; else { int m = (b + e) >> 1, lt = node << 1, rt = lt | 1; init(lt, b, m); init(rt, m+1, e); tree[node] = f(tree[lt], tree[rt]); } } // query(1,1,N,i,j) T query(int node, int b, int e, int i, int j) { int m = (b + e) >> 1, lt = node << 1, rt = lt | 1; tree[node] += acum[node] * (e - b + 1); acum[lt] += acum[node]; acum[rt] += acum[node]; acum[node] = 0; if(i > e || j < b) return neutro; if (i <= b && e <= j) return tree[node]; else return f(query(lt, b, m, i, j), query(rt, m+1, e, i, j)); } // modify(1,1,N,i,j,val) void modify(int node, int b, int e, int i, int j, int v) { int m = (b + e) >> 1, lt = node << 1, rt = lt | 1; tree[node] += acum[node] * (e - b + 1); acum[lt] += acum[node]; acum[rt] += acum[node]; acum[node] = 0; if(i > e || j < b) return; if (i <= b && e <= j) { tree[node] += v * (e - b + 1); acum[lt] += v; acum[rt] += v; return; } modify(lt, b, m, i, j, v); modify(rt, m+1, e, i, j, v); tree[node] = f(tree[lt], tree[rt]); }
27.673469
71
0.514749
chinoxyz
97dfc4c86bb06a5524073a57fa567a120bd0c5e7
602
cc
C++
examples/channels.cc
kjdv/kthread
d606c2455e9db52c731f58b8b30ad37a55e956d6
[ "MIT" ]
1
2021-05-09T16:12:56.000Z
2021-05-09T16:12:56.000Z
examples/channels.cc
kjdv/kthread
d606c2455e9db52c731f58b8b30ad37a55e956d6
[ "MIT" ]
null
null
null
examples/channels.cc
kjdv/kthread
d606c2455e9db52c731f58b8b30ad37a55e956d6
[ "MIT" ]
1
2021-05-09T16:12:57.000Z
2021-05-09T16:12:57.000Z
#include <channel.hh> #include <threadpool.hh> #include <iostream> namespace { using namespace std; using namespace kthread; void consume(receiver<int> tx) { while(tx.receive() .map([](auto&& item) { cout << "consuming " << item << '\n'; return 0; }) .is_some()) ; } void produce(int n, sender<int> tx) { for(int i = 0; i < n; ++i) tx.send(i); tx.close(); } } int main() { threadpool pool; auto c = make_channel<int>(); pool.post([=] { produce(10, c.tx); }); pool.post([=] { consume(c.rx); }); return 0; }
15.05
51
0.523256
kjdv
97e2a9ee82142776598131c22d6f79ad122e0f03
1,063
cpp
C++
solved/o-q/phone-list/uva/phone.cpp
abuasifkhan/pc-code
77ce51d692acf6edcb9e47aeb7b7f06bf56e4e90
[ "Unlicense" ]
13
2015-09-30T19:18:04.000Z
2021-06-26T21:11:30.000Z
solved/o-q/phone-list/uva/phone.cpp
sbmaruf/pc-code
77ce51d692acf6edcb9e47aeb7b7f06bf56e4e90
[ "Unlicense" ]
null
null
null
solved/o-q/phone-list/uva/phone.cpp
sbmaruf/pc-code
77ce51d692acf6edcb9e47aeb7b7f06bf56e4e90
[ "Unlicense" ]
13
2015-01-04T09:49:54.000Z
2021-06-03T13:18:44.000Z
#include <cstdio> #include <cstring> #define ALPHABET 10 #define WORDS 10000 #define WORDLEN 10 #define Zero(v) memset(v, 0, sizeof(v)) #define NonZero(v) (memcmp(v, _zero, sizeof(_zero)) != 0) static const int _zero[ALPHABET] = {0}; struct Trie { struct Node { int children[ALPHABET]; bool end; }; int nxt; Node nodes[WORDS * WORDLEN]; void init() { Zero(nodes); nxt = 1; } void insert(const char *s, bool &c) { int cur = 0; while (*s) { if (nodes[cur].end) { c = false; return; } int idx = *s - '0'; if (! nodes[cur].children[idx]) nodes[cur].children[idx] = nxt++; cur = nodes[cur].children[idx]; ++s; } if (NonZero(nodes[cur].children)) { c = false; return; } nodes[cur].end = true; } }; Trie t; char num[WORDLEN + 1]; int main() { int T; scanf("%d", &T); while (T--) { int n; scanf("%d", &n); t.init(); bool consistent = true; while (n--) { scanf("%s", num); if (consistent) t.insert(num, consistent); } if (consistent) puts("YES"); else puts("NO"); } return 0; }
15.185714
58
0.573848
abuasifkhan
97e3bb6c7ff45308e577587f3a2c2f82ec39c4c1
1,472
cpp
C++
Code/ecrireMemoire/ecirreMemoire.cpp
joabda/Robot
ce27e2e615cb87480c05f9e0ce32124648f9baff
[ "MIT" ]
1
2020-01-26T15:36:07.000Z
2020-01-26T15:36:07.000Z
Code/ecrireMemoire/ecirreMemoire.cpp
joabda/Robot
ce27e2e615cb87480c05f9e0ce32124648f9baff
[ "MIT" ]
null
null
null
Code/ecrireMemoire/ecirreMemoire.cpp
joabda/Robot
ce27e2e615cb87480c05f9e0ce32124648f9baff
[ "MIT" ]
null
null
null
/* * Code permettant d'ecrire sur la mémoire externe * du microcontroleur ATMega16 de Atmel. * * Ecole Polytechnique de Montreal * Departement de genie informatique * Cours inf1900 * * Joe Abdo, Mathurin Critin, Teo Quiquempoix et Philippe Babin, * 2019 * * Code qui n'est sous aucune license. * */ #include "libCommune.h" uint16_t getSizeFichier(Uart& uart) { uint16_t octet16 = ( uart.reception() << 8) | uart.reception(); return octet16; // Concatenantion des deux octet pour trouver la taille du fichiers transmit } void test(Memoire24CXXX memoire1, uint8_t adresse, Uart& uart) // Avec serieViaUSB -l va recevoir le contenu de la memoire qui devrait etre le meme que ce qui a ete transmis { unsigned char donee[] = {0}; for(uint8_t i = 0; i <= adresse; i++) { memoire1.lecture(i, &donee[0],1); uart.transmission(&donee[0]); } } int main() { Uart uart1; LED led1(A,ledRouge,0,1); Memoire24CXXX memoire1; uint16_t sizeFichier = getSizeFichier(uart1); if(sizeFichier == 106) led1.activer(); uint16_t adresse = 0; for (; adresse != sizeFichier - 2; adresse++) // -2 car on lit les 2 premiers octets qui donnent la taille (on ne veut pas les ecrire ) { unsigned char doneeRecue[] = {uart1.reception()}; memoire1.ecriture(adresse, &doneeRecue[0], 1); } test(memoire1, adresse, uart1); //Decommenter cette ligne pour tester le code }
29.44
140
0.661005
joabda
97e7691f6689308ea11c838e4f93a9ed034a0db2
2,168
cpp
C++
parrot/src/parrot/renderer/Shader.cpp
MiloHX/Parrot
159f583b2e43396dcc42dc3456a9c5d3fb043133
[ "Apache-2.0" ]
null
null
null
parrot/src/parrot/renderer/Shader.cpp
MiloHX/Parrot
159f583b2e43396dcc42dc3456a9c5d3fb043133
[ "Apache-2.0" ]
null
null
null
parrot/src/parrot/renderer/Shader.cpp
MiloHX/Parrot
159f583b2e43396dcc42dc3456a9c5d3fb043133
[ "Apache-2.0" ]
null
null
null
#include "prpch.h" #include "parrot/renderer/Shader.h" #include "parrot/renderer/Renderer.h" #include "platform/OpenGL/OpenGLShader.h" namespace parrot { Ref<Shader> Shader::create(const std::string& file_path) { switch (Renderer::getAPI()) { case RendererAPI::API::None: PR_CORE_ASSERT(false, "RendererAPI::None is not supported"); return nullptr; case RendererAPI::API::OpenGL: return createRef<OpenGLShader>(file_path); } PR_CORE_ASSERT(false, "Unknown RendererAPI when creating shader"); return nullptr; } Ref<Shader> Shader::create(const std::string& name, const std::string& vertex_source, const std::string& fragment_source) { switch (Renderer::getAPI()) { case RendererAPI::API::None: PR_CORE_ASSERT(false, "RendererAPI::None is not supported"); return nullptr; case RendererAPI::API::OpenGL: return createRef<OpenGLShader>(name, vertex_source, fragment_source); } PR_CORE_ASSERT(false, "Unknown RendererAPI when creating shader"); return nullptr; } void ShaderLibrary::add(const Ref<Shader>& shader) { auto& name = shader->getName(); add(name, shader); } void ShaderLibrary::add(const std::string& name, const Ref<Shader>& shader) { PR_CORE_ASSERT(!exists(name), "Shader already exists") m_shader_map[name] = shader; } Ref<Shader> ShaderLibrary::load(const std::string& file_path) { auto shader = Shader::create(file_path); add(shader); return shader; } Ref<Shader> ShaderLibrary::load(const std::string& name, const std::string& file_path) { auto shader = Shader::create(file_path); add(name, shader); return shader; } Ref<Shader> ShaderLibrary::get(const std::string& name) { PR_CORE_ASSERT(exists(name), "Shader not found!") return m_shader_map[name]; } bool ShaderLibrary::exists(const std::string& name) const { return m_shader_map.find(name) != m_shader_map.end(); } }
34.967742
127
0.625
MiloHX
97ea9746475e69d636022c161a72c557f296e6d9
2,318
cpp
C++
unittest/splitter/splitter.cpp
relick/tls
a9ef85384e0b6394d94daf7798891f8ee4aa31ac
[ "MIT" ]
null
null
null
unittest/splitter/splitter.cpp
relick/tls
a9ef85384e0b6394d94daf7798891f8ee4aa31ac
[ "MIT" ]
null
null
null
unittest/splitter/splitter.cpp
relick/tls
a9ef85384e0b6394d94daf7798891f8ee4aa31ac
[ "MIT" ]
null
null
null
#include <execution> #include <tls/splitter.h> #include "../catch.hpp" TEST_CASE("tls::splitter<> specification") { SECTION("new instances are default initialized") { struct test { int x = 4; }; REQUIRE(tls::splitter<int>().local() == int{}); REQUIRE(tls::splitter<double>().local() == double{}); REQUIRE(tls::splitter<test>().local().x == test{}.x); } SECTION("does not cause data races") { std::vector<int> vec(1024 * 1024, 1); tls::splitter<int> acc; std::for_each(std::execution::par, vec.begin(), vec.end(), [&acc](int const& i) { acc.local() += i; }); int result = std::reduce(acc.begin(), acc.end()); REQUIRE(result == 1024 * 1024); } SECTION("clearing after use cleans up properly") { std::vector<int> vec(1024, 1); tls::splitter<int> acc; std::for_each(std::execution::par, vec.begin(), vec.end(), [&acc](int const& i) { acc.local() += i; }); acc.clear(); int result = std::reduce(acc.begin(), acc.end()); REQUIRE(result == 0); } SECTION("multiple instances points to the same data") { tls::splitter<int> s1, s2, s3; s1.local() = 1; s2.local() = 2; s3.local() = 3; CHECK(s1.local() == 3); CHECK(s2.local() == 3); CHECK(s3.local() == 3); tls::splitter<int, bool> s4; tls::splitter<int, char> s5; tls::splitter<int, short> s6; tls::splitter<int, void> s7; // same as splitter<int> s1,s2,s3 s4.local() = 1; s5.local() = 2; s6.local() = 3; CHECK(s4.local() == 1); CHECK(s5.local() == 2); CHECK(s6.local() == 3); CHECK(s7.local() == 3); } SECTION("tls::splitter<> variables can be copied") { std::vector<int> vec(1024 * 1024, 1); tls::splitter<int> acc; std::for_each(std::execution::par, vec.begin(), vec.end(), [&acc](int const& i) { acc.local() += i; }); tls::splitter<int> const acc_copy = acc; int const result = std::reduce(acc.begin(), acc.end()); acc.clear(); CHECK(result == 1024 * 1024); int const result_copy = std::reduce(acc_copy.begin(), acc_copy.end()); CHECK(result == result_copy); } }
31.324324
111
0.52761
relick
97ebafe714b489aff42b63d3d3702660ca97c4c9
3,165
cxx
C++
bpkg/types-parsers.cxx
build2/bpkg
bd939839b44d90d027517e447537dd52539269ff
[ "MIT" ]
19
2018-05-30T12:01:25.000Z
2022-01-29T21:37:23.000Z
bpkg/types-parsers.cxx
build2/bpkg
bd939839b44d90d027517e447537dd52539269ff
[ "MIT" ]
2
2019-03-18T22:31:45.000Z
2020-07-28T06:44:03.000Z
bpkg/types-parsers.cxx
build2/bpkg
bd939839b44d90d027517e447537dd52539269ff
[ "MIT" ]
1
2019-02-04T02:58:14.000Z
2019-02-04T02:58:14.000Z
// file : bpkg/types-parsers.cxx -*- C++ -*- // license : MIT; see accompanying LICENSE file #include <bpkg/types-parsers.hxx> namespace bpkg { namespace cli { void parser<url>:: parse (url& x, bool& xs, scanner& s) { const char* o (s.next ()); if (!s.more ()) throw missing_value (o); const char* v (s.next ()); try { x = url (v); } catch (const invalid_argument& e) { throw invalid_value (o, v, e.what ()); } xs = true; } template <typename T> static void parse_path (T& x, scanner& s) { const char* o (s.next ()); if (!s.more ()) throw missing_value (o); const char* v (s.next ()); try { x = T (v); if (x.empty ()) throw invalid_value (o, v); } catch (const invalid_path&) { throw invalid_value (o, v); } } void parser<path>:: parse (path& x, bool& xs, scanner& s) { xs = true; parse_path (x, s); } void parser<dir_path>:: parse (dir_path& x, bool& xs, scanner& s) { xs = true; parse_path (x, s); } void parser<uuid>:: parse (uuid& x, bool& xs, scanner& s) { xs = true; const char* o (s.next ()); if (!s.more ()) throw missing_value (o); const char* v (s.next ()); try { x = uuid (v); if (x.nil ()) throw invalid_value (o, v); } catch (const invalid_argument&) { throw invalid_value (o, v); } } void parser<butl::standard_version>:: parse (butl::standard_version& x, bool& xs, scanner& s) { using butl::standard_version; xs = true; const char* o (s.next ()); if (!s.more ()) throw missing_value (o); const char* v (s.next ()); try { // Note that we allow all kinds of versions, so that the caller can // restrict them as they wish after the parsing. // x = standard_version (v, standard_version::allow_earliest | standard_version::allow_stub); } catch (const invalid_argument& e) { throw invalid_value (o, v, e.what ()); } } void parser<auth>:: parse (auth& x, bool& xs, scanner& s) { xs = true; const char* o (s.next ()); if (!s.more ()) throw missing_value (o); const string v (s.next ()); if (v == "none") x = auth::none; else if (v == "remote") x = auth::remote; else if (v == "all") x = auth::all; else throw invalid_value (o, v); } void parser<repository_type>:: parse (repository_type& x, bool& xs, scanner& s) { xs = true; const char* o (s.next ()); if (!s.more ()) throw missing_value (o); const string v (s.next ()); try { x = to_repository_type (v); } catch (const invalid_argument&) { throw invalid_value (o, v); } } } }
19.066265
75
0.473934
build2
97ecdd04a7d87b1c52a06075aa9abd8c6990c1b2
770
cc
C++
base/containers/flag_set_test.cc
mayah/base
aec046929938d2aaebaadce5c5abb58b5cf342b4
[ "MIT" ]
null
null
null
base/containers/flag_set_test.cc
mayah/base
aec046929938d2aaebaadce5c5abb58b5cf342b4
[ "MIT" ]
null
null
null
base/containers/flag_set_test.cc
mayah/base
aec046929938d2aaebaadce5c5abb58b5cf342b4
[ "MIT" ]
null
null
null
#include "base/containers/flag_set.h" #include <gtest/gtest.h> TEST(FlagSetTest, basic) { base::FlagSet s; EXPECT_TRUE(s.empty()); EXPECT_EQ(0, s.size()); s.set(0); s.set(1); s.set(5); s.set(8); s.set(16); s.set(31); s.set(31); s.set(63); EXPECT_EQ(7, s.size()); s.unset(8); EXPECT_EQ(6, s.size()); EXPECT_EQ(0, s.smallest()); s.remove_smallest(); EXPECT_EQ(1, s.smallest()); s.remove_smallest(); EXPECT_EQ(5, s.smallest()); s.remove_smallest(); EXPECT_EQ(16, s.smallest()); s.remove_smallest(); EXPECT_EQ(31, s.smallest()); s.remove_smallest(); EXPECT_EQ(63, s.smallest()); s.remove_smallest(); EXPECT_TRUE(s.empty()); EXPECT_EQ(0, s.size()); }
16.73913
37
0.568831
mayah
97fcf84aeade82751ece864173c2ab4e874befb6
1,415
hpp
C++
include/synthizer/downsampler.hpp
wiresong/synthizer
d6fb7a5f9eb0c5760411eee29b12a10fdd7ad420
[ "Unlicense" ]
25
2020-09-05T18:21:21.000Z
2021-12-05T02:47:42.000Z
include/synthizer/downsampler.hpp
wiresong/synthizer
d6fb7a5f9eb0c5760411eee29b12a10fdd7ad420
[ "Unlicense" ]
77
2020-07-08T23:33:46.000Z
2022-03-19T05:34:26.000Z
include/synthizer/downsampler.hpp
wiresong/synthizer
d6fb7a5f9eb0c5760411eee29b12a10fdd7ad420
[ "Unlicense" ]
9
2020-07-08T18:16:53.000Z
2022-03-02T21:35:28.000Z
#pragma once #include <algorithm> #include <cstddef> #include <type_traits> #include "synthizer/filter_design.hpp" #include "synthizer/iir_filter.hpp" #include "synthizer/types.hpp" namespace synthizer { /* * A downsampler. Requires that the size be a power of 2 for the time being. * * We use this for efficient delays, so that the delay lines themselves never have to deal with fractional values: * we can filter once at the end of processing instead. * * For instance 44100 oversampled by a factor of 4 (for HRTF) gives delays of 2 microseconds, * * The tick method consumes AMOUNT frames from the input, and produces 1 frame in the output. * */ template <std::size_t LANES, std::size_t AMOUNT, typename enabled = void> class Downsampler; template <std::size_t LANES, std::size_t AMOUNT> class Downsampler<LANES, AMOUNT, All<void, PowerOfTwo<AMOUNT>, std::enable_if_t<AMOUNT != 1>>> { private: IIRFilter<LANES, 81, 3> filter; public: Downsampler() { // 0.6 is a rough approximation of a magic constant from WDL's resampler. // We want to pull the filter down so that frequencies just above nyquist don't alias. filter.setParameters(designSincLowpass<9>(1.0 / AMOUNT / 2)); } void tick(float *in, float *out) { float tmp[LANES]; filter.tick(in, out); for (int i = 1; i < AMOUNT; i++) { filter.tick(in + LANES * i, tmp); } } }; } // namespace synthizer
30.106383
114
0.7053
wiresong
3f05727f9a934649f20584837066023f36e7ee0f
1,075
hpp
C++
src/Core/CCubeMap.hpp
Sebajuste/Omeglond3D
28a3910b47490ec837a29e40e132369f957aedc7
[ "MIT" ]
1
2019-06-14T08:24:17.000Z
2019-06-14T08:24:17.000Z
src/Core/CCubeMap.hpp
Sebajuste/Omeglond3D
28a3910b47490ec837a29e40e132369f957aedc7
[ "MIT" ]
null
null
null
src/Core/CCubeMap.hpp
Sebajuste/Omeglond3D
28a3910b47490ec837a29e40e132369f957aedc7
[ "MIT" ]
null
null
null
#ifndef _DEF_OMEGLOND3D_CCUBEMAP_HPP #define _DEF_OMEGLOND3D_CCUBEMAP_HPP #include "ICubeMap.hpp" namespace OMGL3D { namespace CORE { class CCubeMap : public ICubeMap { public: CCubeMap(const std::string &name); virtual ~CCubeMap(); unsigned int GetBpp() const; unsigned int GetWidth() const; unsigned int GetHeight() const; void SetTexture(const CubeMapOrientation & orient, const std::string & picture_name) const; virtual void SetTexture(const CubeMapOrientation &orient, const CPicture &picture) const=0; virtual void Enable(unsigned int position=0, const TextureEnvironement &texEnv=OMGL_TEXENV_STANDART) const=0; virtual void Disable(unsigned int position=0) const=0; virtual void GenerateTexCoord(unsigned int position, const TexCoordPlane *planes, std::size_t size)=0; private: unsigned int _bpp, _width, _height; }; } } #endif
25
122
0.623256
Sebajuste
3f1ab60a81464b8c1978ae75ddbec6c47fb91e20
557
cpp
C++
exam2/passFunction.cpp
WeiChienHsu/CS165
65e95efc90415c8acc707e2d544eb384d3982e18
[ "MIT" ]
1
2019-01-06T22:36:01.000Z
2019-01-06T22:36:01.000Z
exam2/passFunction.cpp
WeiChienHsu/CS165
65e95efc90415c8acc707e2d544eb384d3982e18
[ "MIT" ]
null
null
null
exam2/passFunction.cpp
WeiChienHsu/CS165
65e95efc90415c8acc707e2d544eb384d3982e18
[ "MIT" ]
null
null
null
#include <iostream> int compare(int a, int b) { if(a > b) return -1; else return 1; } void bubbleSort(int *arr, int size, int (*compare)(int, int)) { for(int i = 0; i < size; i++) { for(int j = 0; j < size - 1; j++) { if(compare(arr[j], arr[j+1]) > 0) { int temp = arr[j]; arr[j] = arr[j+1]; arr[j+1] = temp; } } } } int main() { const int SIZE = 5; int arr[SIZE] = {1, 5, 3, 4, 2}; bubbleSort(arr, SIZE, compare); for(int i = 0; i <SIZE; i++) { std::cout << arr[i] << std::endl; } return 0; }
19.892857
63
0.490126
WeiChienHsu
278b96e92f4373c89dc965d0fbee66db9fe66e19
1,067
hpp
C++
src/demo/fly_sorter/identity_tracker.hpp
hhhHanqing/bias
ac409978ac0bfc6bc4cf8570bf7ce7509e81a219
[ "Apache-2.0" ]
5
2020-07-23T18:59:08.000Z
2021-12-14T02:56:12.000Z
src/demo/fly_sorter/identity_tracker.hpp
hhhHanqing/bias
ac409978ac0bfc6bc4cf8570bf7ce7509e81a219
[ "Apache-2.0" ]
4
2020-08-30T13:55:22.000Z
2022-03-24T21:14:15.000Z
src/demo/fly_sorter/identity_tracker.hpp
hhhHanqing/bias
ac409978ac0bfc6bc4cf8570bf7ce7509e81a219
[ "Apache-2.0" ]
3
2020-10-04T17:53:15.000Z
2022-02-24T05:55:53.000Z
#ifndef IDENTITY_TRACKKER_HPP #define IDENTITY_TRACKKER_HPP #include "parameters.hpp" #include "blob_finder.hpp" #include <vector> #include <memory> #include <map> class IdentityTracker { public: IdentityTracker(); IdentityTracker(IdentityTrackerParam param); void setParam(IdentityTrackerParam param); void update(BlobFinderData &blodFinderData); private: bool isFirst_; long idCounter_; IdentityTrackerParam param_; BlobFinderData blobFinderDataPrev_; void assignBlobsGreedy(BlobFinderData &blobfinderData); std::vector<std::vector<float>> getCostMatrix(BlobFinderData &blobFinderData); float getCost(BlobData blobCurr, BlobData blobPrev); std::map<int,BlobDataList::iterator> getIndexToBlobDataMap( BlobFinderData &blobFinderData ); }; int getNumberOkItems(BlobDataList blobDataList); void printMatrix(std::vector<std::vector<float>> matrix); #endif // ifndef IDENTITY_TRACKER_HPP
27.358974
87
0.686036
hhhHanqing
278ed8f8742fd69407d3c303a6a78863e35ff914
8,207
cpp
C++
NLoader/loadermain.cpp
NellaR1/NEPS
f8ea7181449a858bf660f58ef7c40c11d04b8bf1
[ "BSD-2-Clause" ]
null
null
null
NLoader/loadermain.cpp
NellaR1/NEPS
f8ea7181449a858bf660f58ef7c40c11d04b8bf1
[ "BSD-2-Clause" ]
null
null
null
NLoader/loadermain.cpp
NellaR1/NEPS
f8ea7181449a858bf660f58ef7c40c11d04b8bf1
[ "BSD-2-Clause" ]
null
null
null
#include <iostream> #include <Windows.h> #include <TlHelp32.h> #ifdef REQ_NET #include "curl/curl.h" #endif // REQ_NET #include "resource.h" #include "version.hpp" using namespace std; typedef HMODULE(__stdcall *PLOADLIBRARY)(LPCSTR); typedef FARPROC(__stdcall *PGETPROCADDRESS)(HMODULE, LPCSTR); typedef BOOL(__stdcall *DLLMAIN)(HMODULE, DWORD, LPVOID); struct LOADERDATA { LPVOID ImageBase; PIMAGE_NT_HEADERS NtHeaders; PIMAGE_BASE_RELOCATION BaseReloc; PIMAGE_IMPORT_DESCRIPTOR ImportDirectory; PLOADLIBRARY fnLoadLibraryA; PGETPROCADDRESS fnGetProcAddress; }; static DWORD FindPID(wstring processName) { PROCESSENTRY32 processInfo; processInfo.dwSize = sizeof(processInfo); HANDLE processSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); if (processSnapshot == INVALID_HANDLE_VALUE) return 0; Process32First(processSnapshot, &processInfo); if (!processName.compare(processInfo.szExeFile)) { CloseHandle(processSnapshot); return processInfo.th32ProcessID; } while (Process32Next(processSnapshot, &processInfo)) { if (!processName.compare(processInfo.szExeFile)) { CloseHandle(processSnapshot); return processInfo.th32ProcessID; } } CloseHandle(processSnapshot); return 0; } #ifdef REQ_NET static BOOL RequestBinary(LPVOID out) { auto curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, CURLOPT_URL, ""); curl_easy_cleanup(curl); } } #endif // REQ_NET BOOL __stdcall LibraryLoader(LPVOID memory) { LOADERDATA *LoaderParams = (LOADERDATA *)memory; // Call TLS callbacks #ifdef CALL_TLS IMAGE_DATA_DIRECTORY pIDD = LoaderParams->NtHeaders->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS]; if (pIDD.VirtualAddress) { PIMAGE_TLS_DIRECTORY pITD = (PIMAGE_TLS_DIRECTORY)((LPBYTE)LoaderParams->ImageBase + pIDD.VirtualAddress); if (pITD) { PIMAGE_TLS_CALLBACK *pITC = (PIMAGE_TLS_CALLBACK *)pITD->AddressOfCallBacks; if (pITC) { while (*pITC) { (*pITC)((LPVOID)LoaderParams->ImageBase, DLL_PROCESS_ATTACH, NULL); pITC++; } } } } #endif // CALL_TLS // ???1 PIMAGE_BASE_RELOCATION pIBR = LoaderParams->BaseReloc; // Calculate the delta DWORD delta = (DWORD)((LPBYTE)LoaderParams->ImageBase - LoaderParams->NtHeaders->OptionalHeader.ImageBase); // ???1 while (pIBR->VirtualAddress) { if (pIBR->SizeOfBlock >= sizeof(IMAGE_BASE_RELOCATION)) { int count = (pIBR->SizeOfBlock - sizeof(IMAGE_BASE_RELOCATION)) / sizeof(WORD); PWORD list = (PWORD)(pIBR + 1); for (int i = 0; i < count; i++) { if (list[i]) { PDWORD ptr = (PDWORD)((LPBYTE)LoaderParams->ImageBase + (pIBR->VirtualAddress + (list[i] & 0xFFF))); *ptr += delta; } } } pIBR = (PIMAGE_BASE_RELOCATION)((LPBYTE)pIBR + pIBR->SizeOfBlock); } // Resolve DLL imports PIMAGE_IMPORT_DESCRIPTOR pIID = LoaderParams->ImportDirectory; while (pIID->Characteristics) { PIMAGE_THUNK_DATA OrigFirstThunk = (PIMAGE_THUNK_DATA)((LPBYTE)LoaderParams->ImageBase + pIID->OriginalFirstThunk); PIMAGE_THUNK_DATA FirstThunk = (PIMAGE_THUNK_DATA)((LPBYTE)LoaderParams->ImageBase + pIID->FirstThunk); HMODULE hModule = LoaderParams->fnLoadLibraryA((LPCSTR)LoaderParams->ImageBase + pIID->Name); if (!hModule) return FALSE; while (OrigFirstThunk->u1.AddressOfData) { if (OrigFirstThunk->u1.Ordinal & IMAGE_ORDINAL_FLAG) { // Import by ordinal DWORD Function = (DWORD)LoaderParams->fnGetProcAddress(hModule, (LPCSTR)(OrigFirstThunk->u1.Ordinal & 0xFFFF)); if (!Function) return FALSE; FirstThunk->u1.Function = Function; } else { // Import by name PIMAGE_IMPORT_BY_NAME pIBN = (PIMAGE_IMPORT_BY_NAME)((LPBYTE)LoaderParams->ImageBase + OrigFirstThunk->u1.AddressOfData); DWORD Function = (DWORD)LoaderParams->fnGetProcAddress(hModule, (LPCSTR)pIBN->Name); if (!Function) return FALSE; FirstThunk->u1.Function = Function; } OrigFirstThunk++; FirstThunk++; } pIID++; } // Call the entry point if it exists if (LoaderParams->NtHeaders->OptionalHeader.AddressOfEntryPoint) { DLLMAIN EntryPoint = (DLLMAIN)((LPBYTE)LoaderParams->ImageBase + LoaderParams->NtHeaders->OptionalHeader.AddressOfEntryPoint); // Call the entry point with exclusive parameters return EntryPoint((HMODULE)LoaderParams->ImageBase, DLL_PROCESS_ATTACH | SIGNATURE, NULL); } return FALSE; } DWORD __stdcall Stub() { return 0; } BOOL APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR cmdLine, int cmdShow) { // Find CS:GO DWORD ProcessID = FindPID(L"csgo.exe"); if (!ProcessID) { MessageBoxA(NULL, "Falied to load NEPS.\nYou need to run CS:GO before running the loader.", "NEPS", MB_OK | MB_ICONERROR); return FALSE; } LOADERDATA LoaderParams; HMODULE hModule = GetModuleHandleA(NULL); HRSRC hResource = FindResourceA(hModule, MAKEINTRESOURCEA(IDR_BIN1), "BIN"); HGLOBAL hResData = LoadResource(hModule, hResource); PVOID Buffer = LockResource(hResData); // Target DLL's DOS Header PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)Buffer; // Target DLL's NT Headers PIMAGE_NT_HEADERS pNtHeaders = (PIMAGE_NT_HEADERS)((LPBYTE)Buffer + pDosHeader->e_lfanew); // Opening target process. HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ProcessID); // Allocating memory for the DLL PVOID ExecutableImage = VirtualAllocEx(hProcess, NULL, pNtHeaders->OptionalHeader.SizeOfImage, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); // Copy the headers to target process WriteProcessMemory(hProcess, ExecutableImage, Buffer, pNtHeaders->OptionalHeader.SizeOfHeaders, NULL); // Target DLL's Section Header PIMAGE_SECTION_HEADER pSectHeader = (PIMAGE_SECTION_HEADER)(pNtHeaders + 1); // Copying sections of the dll to the target process for (int i = 0; i < pNtHeaders->FileHeader.NumberOfSections; i++) { WriteProcessMemory(hProcess, (PVOID)((LPBYTE)ExecutableImage + pSectHeader[i].VirtualAddress), (PVOID)((LPBYTE)Buffer + pSectHeader[i].PointerToRawData), pSectHeader[i].SizeOfRawData, NULL); } // Allocate memory for the loader code. PVOID LoaderMemory = VirtualAllocEx(hProcess, NULL, 4096, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); LoaderParams.ImageBase = ExecutableImage; LoaderParams.NtHeaders = (PIMAGE_NT_HEADERS)((LPBYTE)ExecutableImage + pDosHeader->e_lfanew); LoaderParams.BaseReloc = (PIMAGE_BASE_RELOCATION)((LPBYTE)ExecutableImage + pNtHeaders->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress); LoaderParams.ImportDirectory = (PIMAGE_IMPORT_DESCRIPTOR)((LPBYTE)ExecutableImage + pNtHeaders->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress); LoaderParams.fnLoadLibraryA = LoadLibraryA; LoaderParams.fnGetProcAddress = GetProcAddress; // Write the loader information to target process WriteProcessMemory(hProcess, LoaderMemory, &LoaderParams, sizeof(LOADERDATA), NULL); // Write the loader code to target process WriteProcessMemory(hProcess, (PVOID)((LOADERDATA *)LoaderMemory + 1), LibraryLoader, (DWORD)Stub - (DWORD)LibraryLoader, NULL); // Create a remote thread to execute the loader code HANDLE hThread = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)((LOADERDATA *)LoaderMemory + 1), LoaderMemory, 0, NULL); // Wait for the loader to finish executing WaitForSingleObject(hThread, INFINITE); // Get loader's return value to determine DllMain's return value DWORD dwReturnValue = 0; GetExitCodeThread(hThread, &dwReturnValue); // Inform user about errors if (!dwReturnValue) MessageBoxA(NULL, "Falied to load NEPS.\nTry running the loader with administrator privileges.", "NEPS", MB_OK | MB_ICONERROR); else MessageBoxA(NULL, "Success! NEPS is now loaded.", "NEPS", MB_OK | MB_ICONINFORMATION); // Free the allocated loader code VirtualFreeEx(hProcess, LoaderMemory, 0, MEM_RELEASE); FreeResource(hResData); return TRUE; }
30.623134
149
0.7256
NellaR1
2793ae74e55517111e854a55bf1617dc3554c5a7
1,383
cpp
C++
lib/socket_server.cpp
itsPG/asiod
29b56947ed1021f6d45a1275ef7b23fde7b94511
[ "MIT" ]
2
2019-01-29T08:17:19.000Z
2019-01-29T08:52:20.000Z
lib/socket_server.cpp
itsPG/asiod
29b56947ed1021f6d45a1275ef7b23fde7b94511
[ "MIT" ]
null
null
null
lib/socket_server.cpp
itsPG/asiod
29b56947ed1021f6d45a1275ef7b23fde7b94511
[ "MIT" ]
null
null
null
// by PG, MIT license. // this repo is for practicing boost::asio, not well tested, use it at your own risk. #include "socket_server.h" #include <cstdio> #include "packet.h" #include "session.h" namespace PG { socket_server::socket_server(asio::io_context::strand& strand, string path) : strand_{strand} , path_{std::move(path)} { std::remove(path_.c_str()); listen(); } socket_server::~socket_server() { std::remove(path_.c_str()); } void socket_server::listen() { cout << "socket_server::listen()" << endl; asio::spawn(strand_, [&](asio::yield_context yield) { asio::local::stream_protocol::acceptor acceptor{strand_.context(), asio::local::stream_protocol::endpoint{path_}}; asio::local::stream_protocol::socket socket{strand_.context()}; while (true) { boost::system::error_code error; acceptor.async_accept(socket, yield[error]); if (error) { cout << "accept error" << endl; } else { cout << "accept one connection" << endl; start_session(std::move(socket)); } } }); } void socket_server::start_session(asio::local::stream_protocol::socket socket) { std::make_shared<session>(strand_, std::move(socket))->start(); } } // namespace PG
25.611111
103
0.591468
itsPG
27968bd02dbc519b7804b0cfac104f9ae9e73ca1
438
hpp
C++
graphics-library/include/scene/scene_shape.hpp
thetorine/opengl3-library
3904d857fd1085ba2c57c4289eb0e0d123f11a14
[ "MIT" ]
null
null
null
graphics-library/include/scene/scene_shape.hpp
thetorine/opengl3-library
3904d857fd1085ba2c57c4289eb0e0d123f11a14
[ "MIT" ]
null
null
null
graphics-library/include/scene/scene_shape.hpp
thetorine/opengl3-library
3904d857fd1085ba2c57c4289eb0e0d123f11a14
[ "MIT" ]
null
null
null
#pragma once #include "geometry/shape.hpp" #include "scene/scene_object.hpp" namespace gl::scene { class SceneShape : public SceneObject { public: static std::shared_ptr<SceneShape> create(const std::shared_ptr<geometry::Shape> &shape); void drawSelf() const; private: std::shared_ptr<geometry::Shape> m_shape; SceneShape(const std::shared_ptr<geometry::Shape> &shape); }; }
29.2
98
0.657534
thetorine
2799cac237d65f737878d98c615edc69f4bcb292
3,997
cpp
C++
benchmarks/allocator_benchmarks.cpp
nanzifan/Umpire-edit
990895b527bef0716aaa0fbb0c0f2017e8e15882
[ "MIT" ]
null
null
null
benchmarks/allocator_benchmarks.cpp
nanzifan/Umpire-edit
990895b527bef0716aaa0fbb0c0f2017e8e15882
[ "MIT" ]
null
null
null
benchmarks/allocator_benchmarks.cpp
nanzifan/Umpire-edit
990895b527bef0716aaa0fbb0c0f2017e8e15882
[ "MIT" ]
null
null
null
////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2018, Lawrence Livermore National Security, LLC. // Produced at the Lawrence Livermore National Laboratory // // Created by David Beckingsale, david@llnl.gov // LLNL-CODE-747640 // // All rights reserved. // // This file is part of Umpire. // // For details, see https://github.com/LLNL/Umpire // Please also see the LICENSE file for MIT license. ////////////////////////////////////////////////////////////////////////////// #include <iostream> #include "benchmark/benchmark_api.h" #include "umpire/config.hpp" #include "umpire/ResourceManager.hpp" #include "umpire/Allocator.hpp" static const size_t max_allocations = 100000; static void benchmark_allocate(benchmark::State& state, std::string name) { auto allocator = umpire::ResourceManager::getInstance().getAllocator(name); void** allocations = new void*[max_allocations]; auto size = state.range(0); size_t i = 0; while (state.KeepRunning()) { if ( i == max_allocations ) { state.PauseTiming(); for (size_t j = 0; j < max_allocations; j++) allocator.deallocate(allocations[j]); i = 0; state.ResumeTiming(); } allocations[i++] = allocator.allocate(size); } for (size_t j = 0; j < i; j++) allocator.deallocate(allocations[j]); delete[] allocations; } static void benchmark_deallocate(benchmark::State& state, std::string name) { auto allocator = umpire::ResourceManager::getInstance().getAllocator(name); void** allocations = new void*[max_allocations]; auto size = state.range(0); size_t i = 0; while (state.KeepRunning()) { if ( i == 0 || i == max_allocations ) { state.PauseTiming(); for (size_t j = 0; j < max_allocations; j++) allocations[j] = allocator.allocate(size); i = 0; state.ResumeTiming(); } allocator.deallocate(allocations[i++]); } for (size_t j = i; j < max_allocations; j++) allocator.deallocate(allocations[j]); delete[] allocations; } static void benchmark_malloc(benchmark::State& state, std::string name) { auto allocator = umpire::ResourceManager::getInstance().getAllocator(name); void** allocations = new void*[max_allocations]; auto size = state.range(0); size_t i = 0; while (state.KeepRunning()) { if ( i == max_allocations ) { state.PauseTiming(); for (size_t j = 0; j < max_allocations; j++) free(allocations[j]); i = 0; state.ResumeTiming(); } allocations[i++] = malloc(size); } for (size_t j = 0; j < i; j++) free(allocations[j]); delete[] allocations; } static void benchmark_free(benchmark::State& state, std::string name) { auto allocator = umpire::ResourceManager::getInstance().getAllocator(name); void** allocations = new void*[max_allocations]; auto size = state.range(0); size_t i = 0; while (state.KeepRunning()) { if ( i == 0 || i == max_allocations ) { state.PauseTiming(); for (size_t j = 0; j < max_allocations; j++) allocations[j] = malloc(size); i = 0; state.ResumeTiming(); } free(allocations[i++]); } for (size_t j = i; j < max_allocations; j++) free(allocations[j]); delete[] allocations; } BENCHMARK_CAPTURE(benchmark_allocate, host, std::string("HOST"))->Range(4, 1024); BENCHMARK_CAPTURE(benchmark_malloc, host, std::string("HOST"))->Range(4, 1024); BENCHMARK_CAPTURE(benchmark_deallocate, host, std::string("HOST"))->Range(4, 1024); BENCHMARK_CAPTURE(benchmark_free, host, std::string("HOST"))->Range(4, 1024); #if defined(UMPIRE_ENABLE_CUDA) BENCHMARK_CAPTURE(benchmark_allocate, um, std::string("UM"))->Range(4, 1024); BENCHMARK_CAPTURE(benchmark_deallocate, um, std::string("UM"))->Range(4, 1024); BENCHMARK_CAPTURE(benchmark_allocate, device, std::string("DEVICE"))->Range(4, 1024); BENCHMARK_CAPTURE(benchmark_deallocate, device, std::string("DEVICE"))->Range(4, 1024); #endif BENCHMARK_MAIN();
29.607407
87
0.641981
nanzifan
279b22e9f90e6a8cb81f16bf7bfb8a29ee781a25
763
cpp
C++
src/random-set/main.cpp
schien/practices
b248813e51314095c21cf9dc6193d0e1e48550d3
[ "MIT" ]
null
null
null
src/random-set/main.cpp
schien/practices
b248813e51314095c21cf9dc6193d0e1e48550d3
[ "MIT" ]
null
null
null
src/random-set/main.cpp
schien/practices
b248813e51314095c21cf9dc6193d0e1e48550d3
[ "MIT" ]
null
null
null
#include <iostream> #include "input_helper.h" #include "solution.cpp" int main() { RandomizedSet rset; while (std::cin.good()) { char op; std::cin >> op; if (std::cin.eof()) { break; } switch (op) { case 'i': { std::cout << std::boolalpha << rset.insert(next<int>()) << '\n'; break; } case 'd': { std::cout << std::boolalpha << rset.remove(next<int>()) << '\n'; break; } case 'r': { try { std::cout << rset.getRandom() << '\n'; } catch (runtime_error& ex) { std::cerr << ex.what() << std::endl; } break; } default: break; } } return 0; }
18.609756
74
0.415465
schien
279c9c7e74e622d478ea12804163ac171fa04981
207
hpp
C++
parser/spirit/BoostPrecompile.hpp
Vitaliy-Grigoriev/PDL
da528e34e91add4e11415e31e01535db04e7043f
[ "MIT" ]
1
2019-09-23T08:27:31.000Z
2019-09-23T08:27:31.000Z
parser/spirit/BoostPrecompile.hpp
Vitaliy-Grigoriev/PDL
da528e34e91add4e11415e31e01535db04e7043f
[ "MIT" ]
null
null
null
parser/spirit/BoostPrecompile.hpp
Vitaliy-Grigoriev/PDL
da528e34e91add4e11415e31e01535db04e7043f
[ "MIT" ]
null
null
null
//#define BOOST_SPIRIT_X3_DEBUG #define BOOST_SPIRIT_NO_STANDARD_WIDE // Disable wide characters for compilation speed. #include <boost/spirit/home/x3.hpp> #include <boost/fusion/include/adapt_struct.hpp>
34.5
88
0.816425
Vitaliy-Grigoriev
279fca8026a43de5182a515cb704965a388aa3a8
6,403
cpp
C++
src/lllarith.cpp
gligneul/Lua-LLVM
1579b46e28d9ca16b70b9e9f3c11b389734eca00
[ "MIT" ]
12
2016-02-26T02:50:59.000Z
2021-05-27T00:56:16.000Z
src/lllarith.cpp
gligneul/Lua-LLVM
1579b46e28d9ca16b70b9e9f3c11b389734eca00
[ "MIT" ]
null
null
null
src/lllarith.cpp
gligneul/Lua-LLVM
1579b46e28d9ca16b70b9e9f3c11b389734eca00
[ "MIT" ]
1
2021-03-25T18:56:50.000Z
2021-03-25T18:56:50.000Z
/* ** LLL - Lua Low Level ** September, 2015 ** Author: Gabriel de Quadros Ligneul ** Copyright Notice for LLL: see lllcore.h ** ** lllarith.cpp ** Compiles the arithmetics opcodes */ #include "lllarith.h" #include "lllcompilerstate.h" #include "lllvalue.h" extern "C" { #include "lprefix.h" #include "lobject.h" #include "lopcodes.h" #include "lvm.h" } namespace lll { Arith::Arith(CompilerState& cs, Stack& stack) : Opcode(cs, stack), ra_(stack.GetR(GETARG_A(cs.instr_))), rkb_(stack.GetRK(GETARG_B(cs.instr_))), rkc_(stack.GetRK(GETARG_C(cs.instr_))), x_(rkb_), y_(rkc_), check_y_(cs.CreateSubBlock("check_y")), intop_(cs.CreateSubBlock("intop", check_y_)), floatop_(cs.CreateSubBlock("floatop", intop_)), tmop_(cs.CreateSubBlock("tmop", floatop_)), x_int_(nullptr), x_float_(nullptr) { } void Arith::Compile() { CheckXTag(); CheckYTag(); ComputeInt(); ComputeFloat(); ComputeTaggedMethod(); } void Arith::CheckXTag() { auto check_y_int = cs_.CreateSubBlock("is_y_int"); auto check_x_float = cs_.CreateSubBlock("is_x_float", check_y_int); auto tonumber_x = cs_.CreateSubBlock("tonumber_x", check_x_float); cs_.B_.SetInsertPoint(entry_); auto xtag = x_.GetTag(); auto is_x_int = cs_.B_.CreateICmpEQ(xtag, cs_.MakeInt(LUA_TNUMINT)); cs_.B_.CreateCondBr(is_x_int, check_y_int, check_x_float); cs_.B_.SetInsertPoint(check_y_int); x_int_ = x_.GetInteger(); auto floatt = cs_.rt_.GetType("lua_Number"); auto x_itof = cs_.B_.CreateSIToFP(x_int_, floatt, x_int_->getName() + "_flt"); x_float_inc_.push_back({x_itof, check_y_int}); auto is_y_int = y_.HasTag(LUA_TNUMINT); cs_.B_.CreateCondBr(is_y_int, intop_, check_y_); cs_.B_.SetInsertPoint(check_x_float); x_float_inc_.push_back({x_.GetFloat(), check_x_float}); auto is_x_float = cs_.B_.CreateICmpEQ(xtag, cs_.MakeInt(LUA_TNUMFLT)); cs_.B_.CreateCondBr(is_x_float, check_y_, tonumber_x); cs_.B_.SetInsertPoint(tonumber_x); auto args = {x_.GetTValue(), cs_.values_.xnumber}; auto tonumberret = cs_.CreateCall("luaV_tonumber_", args); auto x_converted = cs_.B_.CreateLoad(cs_.values_.xnumber); x_float_inc_.push_back({x_converted, tonumber_x}); auto converted = cs_.ToBool(tonumberret); cs_.B_.CreateCondBr(converted, check_y_, tmop_); } void Arith::CheckYTag() { auto tonumber_y = cs_.CreateSubBlock("tonumber_y", check_y_); cs_.B_.SetInsertPoint(check_y_); auto floatt = cs_.rt_.GetType("lua_Number"); x_float_ = CreatePHI(floatt, x_float_inc_, "xfloat"); y_float_inc_.push_back({y_.GetFloat(), check_y_}); auto is_y_float = y_.HasTag(LUA_TNUMFLT); cs_.B_.CreateCondBr(is_y_float, floatop_, tonumber_y); cs_.B_.SetInsertPoint(tonumber_y); auto args = {y_.GetTValue(), cs_.values_.ynumber}; auto tonumberret = cs_.CreateCall("luaV_tonumber_", args); auto y_converted = cs_.B_.CreateLoad(cs_.values_.ynumber); y_float_inc_.push_back({y_converted, tonumber_y}); auto converted = cs_.ToBool(tonumberret); cs_.B_.CreateCondBr(converted, floatop_, tmop_); } void Arith::ComputeInt() { cs_.B_.SetInsertPoint(intop_); auto y_int = y_.GetInteger(); if (HasIntegerOp()) { ra_.SetInteger(PerformIntOp(x_int_, y_int)); cs_.B_.CreateBr(exit_); } else { auto floatt = cs_.rt_.GetType("lua_Number"); auto x_float = cs_.B_.CreateSIToFP(x_int_, floatt); auto y_float = cs_.B_.CreateSIToFP(y_int, floatt); ra_.SetFloat(PerformFloatOp(x_float, y_float)); cs_.B_.CreateBr(exit_); } } void Arith::ComputeFloat() { cs_.B_.SetInsertPoint(floatop_); auto floatt = cs_.rt_.GetType("lua_Number"); auto y_float = CreatePHI(floatt, y_float_inc_, "yfloat"); ra_.SetFloat(PerformFloatOp(x_float_, y_float)); cs_.B_.CreateBr(exit_); } void Arith::ComputeTaggedMethod() { cs_.B_.SetInsertPoint(tmop_); auto args = { cs_.values_.state, x_.GetTValue(), y_.GetTValue(), ra_.GetTValue(), cs_.MakeInt(GetMethodTag()) }; cs_.CreateCall("luaT_trybinTM", args); stack_.Update(); cs_.B_.CreateBr(exit_); } bool Arith::HasIntegerOp() { switch (GET_OPCODE(cs_.instr_)) { case OP_ADD: case OP_SUB: case OP_MUL: case OP_MOD: case OP_IDIV: return true; default: break; } return false; } llvm::Value* Arith::PerformIntOp(llvm::Value* lhs, llvm::Value* rhs) { auto name = "result"; switch (GET_OPCODE(cs_.instr_)) { case OP_ADD: return cs_.B_.CreateAdd(lhs, rhs, name); case OP_SUB: return cs_.B_.CreateSub(lhs, rhs, name); case OP_MUL: return cs_.B_.CreateMul(lhs, rhs, name); case OP_MOD: return cs_.CreateCall("luaV_mod", {cs_.values_.state, lhs, rhs}, name); case OP_IDIV: return cs_.CreateCall("luaV_div", {cs_.values_.state, lhs, rhs}, name); default: break; } assert(false); return nullptr; } llvm::Value* Arith::PerformFloatOp(llvm::Value* lhs, llvm::Value* rhs) { auto name = "result"; switch (GET_OPCODE(cs_.instr_)) { case OP_ADD: return cs_.B_.CreateFAdd(lhs, rhs, name); case OP_SUB: return cs_.B_.CreateFSub(lhs, rhs, name); case OP_MUL: return cs_.B_.CreateFMul(lhs, rhs, name); case OP_MOD: return cs_.CreateCall("LLLNumMod", {lhs, rhs}, name); case OP_POW: return cs_.CreateCall(STRINGFY2(l_mathop(pow)), {lhs, rhs}, name); case OP_DIV: return cs_.B_.CreateFDiv(lhs, rhs, name); case OP_IDIV: return cs_.CreateCall(STRINGFY2(l_mathop(floor)), {cs_.B_.CreateFDiv(lhs, rhs, name)}, "floor"); default: break; } assert(false); return nullptr; } int Arith::GetMethodTag() { switch (GET_OPCODE(cs_.instr_)) { case OP_ADD: return TM_ADD; case OP_SUB: return TM_SUB; case OP_MUL: return TM_MUL; case OP_MOD: return TM_MOD; case OP_POW: return TM_POW; case OP_DIV: return TM_DIV; case OP_IDIV: return TM_IDIV; default: break; } assert(false); return -1; } }
30.636364
82
0.640325
gligneul
27a1ee71243b7276ca7d333f8a7d3dde4bc3800b
785
cpp
C++
Codeforces/1108A-Two_distinct_points.cpp
Pankajcoder1/Competitive_programming
72ee0d41f3f72f43a5c2a232255eb84a04b14df9
[ "MIT" ]
null
null
null
Codeforces/1108A-Two_distinct_points.cpp
Pankajcoder1/Competitive_programming
72ee0d41f3f72f43a5c2a232255eb84a04b14df9
[ "MIT" ]
null
null
null
Codeforces/1108A-Two_distinct_points.cpp
Pankajcoder1/Competitive_programming
72ee0d41f3f72f43a5c2a232255eb84a04b14df9
[ "MIT" ]
1
2020-10-02T04:51:22.000Z
2020-10-02T04:51:22.000Z
/* written by Pankaj Kumar. country:-INDIA Institute: National Institute of Technology, Uttarakhand */ #include<iostream> #include<vector> #include<cmath> #include<algorithm> #include<string.h> #define pan cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0); #define mod 1000000007; using namespace std; typedef long long ll ; #define line cout<<endl; int main() { pan; ll t; cin>>t; while(t--) { ll l1,r1,l2,r2; cin>>l1>>r1>>l2>>r2; if(l2!=l1) cout<<l1<<" "<<l2<<endl; else cout<<l1<<" "<<l2+1<<endl; } } // * -----------------END OF PROGRAM --------------------*/ /* * stuff you should look before submission * constraint and time limit * int overflow * special test case (n=0||n=1||n=2) * don't get stuck on one approach if you get wrong answer */
19.625
64
0.628025
Pankajcoder1
27a6b11730fa13345cf43b0a3ed5ce356008fcee
1,848
hpp
C++
ParticleSystem/src/ParticleUpdater.hpp
Azatsu/ParticleSystem
8d8a5f41200c1865089b3b2dff8c41cc63dc3b13
[ "MIT" ]
1
2021-05-05T06:42:19.000Z
2021-05-05T06:42:19.000Z
ParticleSystem/src/ParticleUpdater.hpp
Azatsu/ParticleSystem
8d8a5f41200c1865089b3b2dff8c41cc63dc3b13
[ "MIT" ]
5
2021-05-04T10:05:11.000Z
2021-05-05T08:28:02.000Z
ParticleSystem/src/ParticleUpdater.hpp
Azatsu/ParticleSystem
8d8a5f41200c1865089b3b2dff8c41cc63dc3b13
[ "MIT" ]
null
null
null
#ifndef __PRTCL_UPDT_HPP__ #define __PRTCL_UPDT_HPP__ #include <vector> #include <algorithm> #include "particleGenerator.hpp" class ParticleUpdater { public: ParticleUpdater() { } virtual ~ParticleUpdater() { } virtual void Update(float dt, ParticleData* p) = 0; }; class EulerUpdater : public ParticleUpdater { public: float4 globalAcceleration; public: EulerUpdater() : globalAcceleration(0.f, 0.f, 0.f, 0.f) { } virtual void Update(float dt, ParticleData* p) override; }; // collision with the floor :) todo: implement a collision model class FloorUpdater : public ParticleUpdater { public: float floorY; float bounceFactor; public: FloorUpdater() :floorY(0.0), bounceFactor(0.5f) { } virtual void Update(float dt, ParticleData* p) override; }; class AttractorUpdater : public ParticleUpdater { protected: std::vector<float4> attractors; // .w is force public: virtual void Update(float dt, ParticleData* p) override; size_t CollectionSize() const { return attractors.size(); } void Add(const float4& attr) { attractors.push_back(attr); } float4& Get(size_t id) { return attractors[id]; } }; class BasicColorUpdater : public ParticleUpdater { public: virtual void Update(float dt, ParticleData* p) override; }; class PosColorUpdater : public ParticleUpdater { public: float4 minPos; float4 maxPos; public: PosColorUpdater() : minPos(0.f, 0.f, 0.f, 0.f), maxPos(1.f, 1.f, 1.f, 1.f) { } virtual void Update(float dt, ParticleData* p) override; }; class VelColorUpdater : public ParticleUpdater { public: float4 minVel; float4 maxVel; public: VelColorUpdater() : minVel(0.f, 0.f, 0.f, 0.f), maxVel(1.f, 1.f, 1.f, 1.f) { } virtual void Update(float dt, ParticleData* p) override; }; class BasicTimeUpdater : public ParticleUpdater { public: virtual void Update(float dt, ParticleData* p) override; }; #endif
21.488372
79
0.731061
Azatsu
27a79a997fe218c175ba9a076c86934794aa53d3
96
hh
C++
vm/vm/main/cached/Unit-implem-decl.hh
Ahzed11/mozart2
4806504b103e11be723e7813be8f69e4d85875cf
[ "BSD-2-Clause" ]
379
2015-01-02T20:27:33.000Z
2022-03-26T23:18:17.000Z
vm/vm/main/cached/Unit-implem-decl.hh
Ahzed11/mozart2
4806504b103e11be723e7813be8f69e4d85875cf
[ "BSD-2-Clause" ]
81
2015-01-08T13:18:52.000Z
2021-12-21T14:02:21.000Z
vm/vm/main/cached/Unit-implem-decl.hh
Ahzed11/mozart2
4806504b103e11be723e7813be8f69e4d85875cf
[ "BSD-2-Clause" ]
75
2015-01-06T09:08:20.000Z
2021-12-17T09:40:18.000Z
class Unit; template <> class Storage<Unit> { public: typedef struct mozart::unit_t Type; };
12
37
0.708333
Ahzed11
27a836943d08f7a9b12542c16ca7586f2d6c4e34
1,689
cpp
C++
BRAC University Competitive Programming training/Prefix sum/chechinkg range for a particular summation.cpp
Mit382/Mitul-s-Competitive-Programming-March-August
3b0d9b3d018444584020e37b892021f7e9ec984d
[ "MIT" ]
1
2021-04-23T16:53:35.000Z
2021-04-23T16:53:35.000Z
BRAC University Competitive Programming training/Prefix sum/chechinkg range for a particular summation.cpp
Mit382/Mitul-s-Competitive-Programming-March-August
3b0d9b3d018444584020e37b892021f7e9ec984d
[ "MIT" ]
null
null
null
BRAC University Competitive Programming training/Prefix sum/chechinkg range for a particular summation.cpp
Mit382/Mitul-s-Competitive-Programming-March-August
3b0d9b3d018444584020e37b892021f7e9ec984d
[ "MIT" ]
1
2021-03-27T19:56:19.000Z
2021-03-27T19:56:19.000Z
//Question in array 1 , -1, 0,2 there is how many ranges, that can make the summation 2? //Input: //4 2 //1 -1 0 2 //Output: //3 //solve: //index: 0 1 2 3 4 //array 1 -1 0 2 //prefix: 0 1 0 0 2 // check that there is 2 , (0,2 ), (1,-1,0,2) can make summation 2. thus answer is 3 //now check the prefix array and relate: prefix[4]-2=0 . here 0 is there 3 times beacuse in the prefix we assume index 0 has default value =0 and such 0 is there 3 times and that is the answer. Note: prefix[4]=2 #include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n,s; cin>>n>>s; //n+1 beacuse in for loop we took i=1 to i<=n and thus vector<long long int > input(n+1);//creating input vecor (dynamic array). Note:1≤xi≤10^9 in problem and thus you may need to add a lot of this and it may exceed the integer range and thus long long integer is suggested vector<long long int>pref(n+1);// creating prefix vecor . Note:1≤xi≤10^9 in problem and thus you may need to add a lot of this and it may exceed the integer range and thus long long integer is suggested for(int i=1; i<=n;i++){ cin>>input[i]; } //Prefix sum building pref[0]=0; //prefix[0]=0 for(int i=1; i<=n;i++){ pref[i]=pref[i-1]+input[i]; } map<long long int, int> mp; long long int ans=0;// defining from the map; mp[0]=1;//defining from the map for( int i=1; i<=n;i++){ long long int key=pref[i]-s; ans+=mp[key]; mp[pref[i]]++;// adding value to map's 2nd parameter } cout<<ans<<endl; return 0; }
31.867925
222
0.606868
Mit382
27ad1a1f8e279742a161e298429f27e55e93c7b6
1,481
cc
C++
src/Parser/AST/MatchStatementNode.cc
stenbror/PythonCoreNative
9b5b1e55acf7d6adc7d8202e951872b2b9f71167
[ "BSL-1.0" ]
null
null
null
src/Parser/AST/MatchStatementNode.cc
stenbror/PythonCoreNative
9b5b1e55acf7d6adc7d8202e951872b2b9f71167
[ "BSL-1.0" ]
null
null
null
src/Parser/AST/MatchStatementNode.cc
stenbror/PythonCoreNative
9b5b1e55acf7d6adc7d8202e951872b2b9f71167
[ "BSL-1.0" ]
1
2021-05-24T11:18:32.000Z
2021-05-24T11:18:32.000Z
#include <ast/MatchStatementNode.h> using namespace PythonCoreNative::RunTime::Parser::AST; using namespace PythonCoreNative::RunTime::Parser; MatchStatementNode::MatchStatementNode( unsigned int start, unsigned int end, std::shared_ptr<Token> op1, std::shared_ptr<AST::StatementNode> left, std::shared_ptr<Token> op2, std::shared_ptr<Token> op3, std::shared_ptr<Token> op4, std::shared_ptr<std::vector<std::shared_ptr<StatementNode>>> nodes, std::shared_ptr<Token> op5 ) : StatementNode(start, end) { mOp1 = op1; mLeft = left; mOp2 = op2; mOp3 = op3; mOp4 = op4; mNodes = nodes; mOp3 = op5; } std::shared_ptr<Token> MatchStatementNode::GetOperator1() { return mOp1; } std::shared_ptr<Token> MatchStatementNode::GetOperator2() { return mOp2; } std::shared_ptr<Token> MatchStatementNode::GetOperator3() { return mOp3; } std::shared_ptr<Token> MatchStatementNode::GetOperator4() { return mOp4; } std::shared_ptr<Token> MatchStatementNode::GetOperator5() { return mOp5; } std::shared_ptr<AST::StatementNode> MatchStatementNode::GetLeft() { return mLeft; } std::shared_ptr<std::vector<std::shared_ptr<StatementNode>>> MatchStatementNode::GetNodes() { return mNodes; }
24.278689
95
0.602296
stenbror
27ad2135e457a7db745ea1d84b8fd2e9f8eb59b5
1,239
cpp
C++
arm9/source/menuDemo.cpp
henke37/hblankmegademo
638d6200c930e305acb6aea341211cff99dc5893
[ "BSD-2-Clause" ]
2
2019-09-01T14:31:51.000Z
2019-09-10T11:00:20.000Z
arm9/source/menuDemo.cpp
henke37/hblankmegademo
638d6200c930e305acb6aea341211cff99dc5893
[ "BSD-2-Clause" ]
8
2017-09-24T20:21:15.000Z
2022-03-04T15:29:05.000Z
arm9/source/menuDemo.cpp
henke37/hblankmegademo
638d6200c930e305acb6aea341211cff99dc5893
[ "BSD-2-Clause" ]
2
2019-02-04T02:59:42.000Z
2019-02-05T06:16:07.000Z
#include "menuDemo.h" #include "sinScrollDemo.h" #include "peepHoleWindowDemo.h" #include "spotlightDemo.h" #include "demoRunner.h" #include "scanInDemo.h" #include "rasterbarDemo.h" #include "flutterDemo.h" #include <nds/arm9/console.h> #include <cassert> #include <nds/arm9/input.h> MenuDemo::MenuDemo() : selection(0) {} MenuDemo::~MenuDemo() {} void MenuDemo::Load() { setupDefaultBG(); consoleClear(); } void MenuDemo::Unload() {} void MenuDemo::PrepareFrame(VramBatcher &) {} void MenuDemo::AcceptInput() { auto keys = keysDown(); if(keys & KEY_UP && selection > 0) { selection--; } else if(keys & KEY_DOWN && selection+1 < demoCount) { selection++; } if(keys & KEY_START) { runner.RunDemo(makeDemo()); } } std::shared_ptr<Demo> MenuDemo::makeDemo() { switch(selection) { case 0: return std::make_shared<SinXScrollDemo>(); case 1: return std::make_shared<SinYScrollDemo>(); case 2: return std::make_shared<ScanInDemo>(); case 3: return std::make_shared<PeepHoleWindowDemo>(); case 4: return std::make_shared<SpotLightDemo>(); case 5: return std::make_shared<RasterBarDemo>(); case 6: return std::make_shared<FlutterDemo>(); } sassert(0,"Bad menu selection instatiated"); assert(0); }
21
56
0.696529
henke37
27b7166908d70e2f3a7588a7d6f426a25888dffc
1,287
cpp
C++
VeronixApp.cpp
LNAV/Sudoku_Solver_Cpp
431a5d0e370d3d5f7da33674601f3a57efd7032a
[ "Apache-2.0" ]
1
2020-05-17T11:46:46.000Z
2020-05-17T11:46:46.000Z
VeronixApp.cpp
LNAV/VeronixApp-Sudoku_Solver
431a5d0e370d3d5f7da33674601f3a57efd7032a
[ "Apache-2.0" ]
null
null
null
VeronixApp.cpp
LNAV/VeronixApp-Sudoku_Solver
431a5d0e370d3d5f7da33674601f3a57efd7032a
[ "Apache-2.0" ]
null
null
null
/* * VeronixApp.cpp * * Created on: May 18, 2019 * Author: LavishK1 */ #include <SudokuConsoleViewController.h> #include "VeronixApp.h" #include "AppDefines.h" #include "APP/GridSolver.h" #include "APP/Helper/InputHelper.h" namespace Veronix { namespace App { VeronixApp::VeronixApp() { DEF_COUT( "VeronixApp::VeronixApp" ); } VeronixApp::~VeronixApp() { DEF_COUT( "VeronixApp::~VeronixApp" ); } void VeronixApp::start() { DEF_COUT( "This is a Start" ); try { helper::InputHelper inputProcessor; const Array::TabularArray<int> & gridValues = inputProcessor.getSudokuGridData(/*helper::console_read*/); sudosolver::container::GridContainer gridContainer(gridValues); viewcontroller::SudokuViewController sudokuView(gridContainer); DEF_COUT( "Before Solving Sudoku: " ); sudokuView.displaySudoku(); sudosolver::GridSolver gridSolver(gridContainer); gridSolver.solveGrid(); DEF_COUT( "After Solving Sudoku: " ); sudokuView.displaySudoku(); } catch (const std::string e) { DEF_COUT( "Exception Thrown" << e ); } catch (const char * e) { DEF_COUT( "Exception Thrown int *: " << e ); } catch (...) { DEF_COUT("Exception is thrown somewhere"); } DEF_COUT( "Start Ended Here" ); } } /* namespace App */ } /* namespace Veronix */
18.652174
107
0.694639
LNAV
27bf7731c49ad3e4ee83bc3d6c5443f9e1de0774
1,980
hpp
C++
include/Animation.hpp
prfcto2/noName
e179d49282755039f2acb267931ef445aff5000b
[ "MIT" ]
3
2019-08-05T13:33:01.000Z
2022-02-14T12:55:18.000Z
include/Animation.hpp
prfcto2/noName
e179d49282755039f2acb267931ef445aff5000b
[ "MIT" ]
null
null
null
include/Animation.hpp
prfcto2/noName
e179d49282755039f2acb267931ef445aff5000b
[ "MIT" ]
null
null
null
# define ANIMATION_HPP # ifndef HELPERS_HPP # include <Helpers.hpp> # endif # include <vector> //Animation has the animation's frames, it's duration and it's loop conditional. // if the animation is looping, it means that the animation is going to repite itself // in the pass of time but, if it is not looping, it is going to show it last frame after the // total duration has been reached class Animation { public: // constructor takes as parameters the total time to get to the last frame // and if it is going to loop Animation(const sf::Time &, bool = false); Animation(const Animation &); ~Animation(); //sets animation time elapsed to zero void reset(); // methods identifiers are pretty clear I believe void setDuraton(const sf::Time &); void setLooping(bool); sf::Texture & getFrame() const; const sf::Time & getDuration() const; const sf::Time & getElapsed() const; bool getLooping() const; size_t size() const; // it's mean to work as a manual setter of frames getting as parameter // the complete path of it's texture on assets folder void addFrame(const std::string &); // parameter 1 is the path to a folder of animation, // for simplicity, our animations using this method are going to have a name // "frame" and what our function does is to take all frames starting from 1. // it takes all frames placed on the prefix path // parameter 2 is the postfx of the frame,s by default they are ".png" void addFrames(const std::string &, const std::string & = ".png", bool = false); void addFrames(const std::string &, bool); // @note: This method is setted virtual so we can define different types of interactions // from derived classes, with aims of class Enemies having a global Animator. virtual void update(const sf::Time &); private: std::vector<sf::Texture *> m_frames; sf::Time m_duration; bool m_looping; sf::Time m_elapsed; uint m_pos; };
33
93
0.697475
prfcto2
27c63cfb63003f012076586134080800fb72ffc3
46
cpp
C++
libs/vis_utils/summedareatable.cpp
danniesim/cpp_volume_rendering
242c8917aea0a58c9851c2ae3e6c1555db51912e
[ "MIT" ]
10
2020-05-15T23:50:19.000Z
2022-02-17T09:54:44.000Z
libs/vis_utils/summedareatable.cpp
danniesim/cpp_volume_rendering
242c8917aea0a58c9851c2ae3e6c1555db51912e
[ "MIT" ]
1
2022-01-25T02:36:59.000Z
2022-01-26T11:41:38.000Z
libs/vis_utils/summedareatable.cpp
danniesim/cpp_volume_rendering
242c8917aea0a58c9851c2ae3e6c1555db51912e
[ "MIT" ]
3
2021-11-01T10:32:46.000Z
2021-12-28T16:40:10.000Z
#include "summedareatable.h" namespace vis {}
11.5
28
0.76087
danniesim
27cc89b508504ad3d2e1b8f11c79735721451191
1,441
cpp
C++
src/image/todo/bezier.cpp
TurkMvc/lol
c3fb98c6f371e4648891b59b4adc6cb95ae73451
[ "WTFPL" ]
4
2015-02-14T21:14:25.000Z
2021-12-12T15:45:44.000Z
src/image/todo/bezier.cpp
TurkMvc/lol
c3fb98c6f371e4648891b59b4adc6cb95ae73451
[ "WTFPL" ]
3
2015-02-14T20:56:26.000Z
2015-02-16T08:50:54.000Z
src/image/todo/bezier.cpp
TurkMvc/lol
c3fb98c6f371e4648891b59b4adc6cb95ae73451
[ "WTFPL" ]
1
2021-10-06T16:01:03.000Z
2021-10-06T16:01:03.000Z
/* * Lol Engine * * Copyright © 2004—2008 Sam Hocevar <sam@hocevar.net> * © 2008 Jean-Yves Lamoureux <jylam@lnxscene.org> * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What the Fuck You Want * to Public License, Version 2, as published by the WTFPL Task Force. * See http://www.wtfpl.net/ for more details. */ /* * bezier.c: bezier curves rendering functions */ #include "config.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include "pipi.h" #include "pipi-internals.h" int pipi_draw_bezier4(pipi_image_t *img , int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, uint32_t c, int n, int aa) { if(img->last_modified == PIPI_PIXELS_RGBA_U8) { float t; float x= x1, y= y1; float lx, ly; for(t=0; t<1; t+=(1.0f/n)) { float a = t; float b = 1 - t; lx = x; ly = y; x = (x1*(b*b*b)) + 3*x2*(b*b)*a + 3*x4*b*(a*a) + x3*(a*a*a); y = (y1*(b*b*b)) + 3*y2*(b*b)*a + 3*y4*b*(a*a) + y3*(a*a*a); pipi_draw_line(img , lx, ly, x, y, c, aa); } pipi_draw_line(img , x, y, x3, y3, c, aa); } return 0; }
25.280702
72
0.517696
TurkMvc
27d0429e58d7d8f5e96edd66b15c88fb56dc89ac
21,788
cc
C++
wrappers/7.0.0/vtkPointSetToLabelHierarchyWrap.cc
axkibe/node-vtk
900ad7b5500f672519da5aa24c99aa5a96466ef3
[ "BSD-3-Clause" ]
6
2016-02-03T12:48:36.000Z
2020-09-16T15:07:51.000Z
wrappers/7.0.0/vtkPointSetToLabelHierarchyWrap.cc
axkibe/node-vtk
900ad7b5500f672519da5aa24c99aa5a96466ef3
[ "BSD-3-Clause" ]
4
2016-02-13T01:30:43.000Z
2020-03-30T16:59:32.000Z
wrappers/7.0.0/vtkPointSetToLabelHierarchyWrap.cc
axkibe/node-vtk
900ad7b5500f672519da5aa24c99aa5a96466ef3
[ "BSD-3-Clause" ]
null
null
null
/* this file has been autogenerated by vtkNodeJsWrap */ /* editing this might proof futile */ #define VTK_WRAPPING_CXX #define VTK_STREAMS_FWD_ONLY #include <nan.h> #include "vtkLabelHierarchyAlgorithmWrap.h" #include "vtkPointSetToLabelHierarchyWrap.h" #include "vtkObjectWrap.h" #include "vtkTextPropertyWrap.h" #include "../../plus/plus.h" using namespace v8; extern Nan::Persistent<v8::Object> vtkNodeJsNoWrap; Nan::Persistent<v8::FunctionTemplate> VtkPointSetToLabelHierarchyWrap::ptpl; VtkPointSetToLabelHierarchyWrap::VtkPointSetToLabelHierarchyWrap() { } VtkPointSetToLabelHierarchyWrap::VtkPointSetToLabelHierarchyWrap(vtkSmartPointer<vtkPointSetToLabelHierarchy> _native) { native = _native; } VtkPointSetToLabelHierarchyWrap::~VtkPointSetToLabelHierarchyWrap() { } void VtkPointSetToLabelHierarchyWrap::Init(v8::Local<v8::Object> exports) { Nan::SetAccessor(exports, Nan::New("vtkPointSetToLabelHierarchy").ToLocalChecked(), ConstructorGetter); Nan::SetAccessor(exports, Nan::New("PointSetToLabelHierarchy").ToLocalChecked(), ConstructorGetter); } void VtkPointSetToLabelHierarchyWrap::ConstructorGetter( v8::Local<v8::String> property, const Nan::PropertyCallbackInfo<v8::Value>& info) { InitPtpl(); info.GetReturnValue().Set(Nan::New(ptpl)->GetFunction()); } void VtkPointSetToLabelHierarchyWrap::InitPtpl() { if (!ptpl.IsEmpty()) return; v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New); VtkLabelHierarchyAlgorithmWrap::InitPtpl( ); tpl->Inherit(Nan::New<FunctionTemplate>(VtkLabelHierarchyAlgorithmWrap::ptpl)); tpl->SetClassName(Nan::New("VtkPointSetToLabelHierarchyWrap").ToLocalChecked()); tpl->InstanceTemplate()->SetInternalFieldCount(1); Nan::SetPrototypeMethod(tpl, "GetBoundedSizeArrayName", GetBoundedSizeArrayName); Nan::SetPrototypeMethod(tpl, "getBoundedSizeArrayName", GetBoundedSizeArrayName); Nan::SetPrototypeMethod(tpl, "GetClassName", GetClassName); Nan::SetPrototypeMethod(tpl, "getClassName", GetClassName); Nan::SetPrototypeMethod(tpl, "GetIconIndexArrayName", GetIconIndexArrayName); Nan::SetPrototypeMethod(tpl, "getIconIndexArrayName", GetIconIndexArrayName); Nan::SetPrototypeMethod(tpl, "GetLabelArrayName", GetLabelArrayName); Nan::SetPrototypeMethod(tpl, "getLabelArrayName", GetLabelArrayName); Nan::SetPrototypeMethod(tpl, "GetMaximumDepth", GetMaximumDepth); Nan::SetPrototypeMethod(tpl, "getMaximumDepth", GetMaximumDepth); Nan::SetPrototypeMethod(tpl, "GetOrientationArrayName", GetOrientationArrayName); Nan::SetPrototypeMethod(tpl, "getOrientationArrayName", GetOrientationArrayName); Nan::SetPrototypeMethod(tpl, "GetPriorityArrayName", GetPriorityArrayName); Nan::SetPrototypeMethod(tpl, "getPriorityArrayName", GetPriorityArrayName); Nan::SetPrototypeMethod(tpl, "GetSizeArrayName", GetSizeArrayName); Nan::SetPrototypeMethod(tpl, "getSizeArrayName", GetSizeArrayName); Nan::SetPrototypeMethod(tpl, "GetTargetLabelCount", GetTargetLabelCount); Nan::SetPrototypeMethod(tpl, "getTargetLabelCount", GetTargetLabelCount); Nan::SetPrototypeMethod(tpl, "GetTextProperty", GetTextProperty); Nan::SetPrototypeMethod(tpl, "getTextProperty", GetTextProperty); Nan::SetPrototypeMethod(tpl, "GetUseUnicodeStrings", GetUseUnicodeStrings); Nan::SetPrototypeMethod(tpl, "getUseUnicodeStrings", GetUseUnicodeStrings); Nan::SetPrototypeMethod(tpl, "IsA", IsA); Nan::SetPrototypeMethod(tpl, "isA", IsA); Nan::SetPrototypeMethod(tpl, "NewInstance", NewInstance); Nan::SetPrototypeMethod(tpl, "newInstance", NewInstance); Nan::SetPrototypeMethod(tpl, "SafeDownCast", SafeDownCast); Nan::SetPrototypeMethod(tpl, "safeDownCast", SafeDownCast); Nan::SetPrototypeMethod(tpl, "SetBoundedSizeArrayName", SetBoundedSizeArrayName); Nan::SetPrototypeMethod(tpl, "setBoundedSizeArrayName", SetBoundedSizeArrayName); Nan::SetPrototypeMethod(tpl, "SetIconIndexArrayName", SetIconIndexArrayName); Nan::SetPrototypeMethod(tpl, "setIconIndexArrayName", SetIconIndexArrayName); Nan::SetPrototypeMethod(tpl, "SetLabelArrayName", SetLabelArrayName); Nan::SetPrototypeMethod(tpl, "setLabelArrayName", SetLabelArrayName); Nan::SetPrototypeMethod(tpl, "SetMaximumDepth", SetMaximumDepth); Nan::SetPrototypeMethod(tpl, "setMaximumDepth", SetMaximumDepth); Nan::SetPrototypeMethod(tpl, "SetOrientationArrayName", SetOrientationArrayName); Nan::SetPrototypeMethod(tpl, "setOrientationArrayName", SetOrientationArrayName); Nan::SetPrototypeMethod(tpl, "SetPriorityArrayName", SetPriorityArrayName); Nan::SetPrototypeMethod(tpl, "setPriorityArrayName", SetPriorityArrayName); Nan::SetPrototypeMethod(tpl, "SetSizeArrayName", SetSizeArrayName); Nan::SetPrototypeMethod(tpl, "setSizeArrayName", SetSizeArrayName); Nan::SetPrototypeMethod(tpl, "SetTargetLabelCount", SetTargetLabelCount); Nan::SetPrototypeMethod(tpl, "setTargetLabelCount", SetTargetLabelCount); Nan::SetPrototypeMethod(tpl, "SetTextProperty", SetTextProperty); Nan::SetPrototypeMethod(tpl, "setTextProperty", SetTextProperty); Nan::SetPrototypeMethod(tpl, "SetUseUnicodeStrings", SetUseUnicodeStrings); Nan::SetPrototypeMethod(tpl, "setUseUnicodeStrings", SetUseUnicodeStrings); Nan::SetPrototypeMethod(tpl, "UseUnicodeStringsOff", UseUnicodeStringsOff); Nan::SetPrototypeMethod(tpl, "useUnicodeStringsOff", UseUnicodeStringsOff); Nan::SetPrototypeMethod(tpl, "UseUnicodeStringsOn", UseUnicodeStringsOn); Nan::SetPrototypeMethod(tpl, "useUnicodeStringsOn", UseUnicodeStringsOn); #ifdef VTK_NODE_PLUS_VTKPOINTSETTOLABELHIERARCHYWRAP_INITPTPL VTK_NODE_PLUS_VTKPOINTSETTOLABELHIERARCHYWRAP_INITPTPL #endif ptpl.Reset( tpl ); } void VtkPointSetToLabelHierarchyWrap::New(const Nan::FunctionCallbackInfo<v8::Value>& info) { if(!info.IsConstructCall()) { Nan::ThrowError("Constructor not called in a construct call."); return; } if(info.Length() == 0) { vtkSmartPointer<vtkPointSetToLabelHierarchy> native = vtkSmartPointer<vtkPointSetToLabelHierarchy>::New(); VtkPointSetToLabelHierarchyWrap* obj = new VtkPointSetToLabelHierarchyWrap(native); obj->Wrap(info.This()); } else { if(info[0]->ToObject() != vtkNodeJsNoWrap ) { Nan::ThrowError("Parameter Error"); return; } } info.GetReturnValue().Set(info.This()); } void VtkPointSetToLabelHierarchyWrap::GetBoundedSizeArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); char const * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetBoundedSizeArrayName(); info.GetReturnValue().Set(Nan::New(r).ToLocalChecked()); } void VtkPointSetToLabelHierarchyWrap::GetClassName(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); char const * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetClassName(); info.GetReturnValue().Set(Nan::New(r).ToLocalChecked()); } void VtkPointSetToLabelHierarchyWrap::GetIconIndexArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); char const * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetIconIndexArrayName(); info.GetReturnValue().Set(Nan::New(r).ToLocalChecked()); } void VtkPointSetToLabelHierarchyWrap::GetLabelArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); char const * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetLabelArrayName(); info.GetReturnValue().Set(Nan::New(r).ToLocalChecked()); } void VtkPointSetToLabelHierarchyWrap::GetMaximumDepth(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); int r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetMaximumDepth(); info.GetReturnValue().Set(Nan::New(r)); } void VtkPointSetToLabelHierarchyWrap::GetOrientationArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); char const * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetOrientationArrayName(); info.GetReturnValue().Set(Nan::New(r).ToLocalChecked()); } void VtkPointSetToLabelHierarchyWrap::GetPriorityArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); char const * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetPriorityArrayName(); info.GetReturnValue().Set(Nan::New(r).ToLocalChecked()); } void VtkPointSetToLabelHierarchyWrap::GetSizeArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); char const * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetSizeArrayName(); info.GetReturnValue().Set(Nan::New(r).ToLocalChecked()); } void VtkPointSetToLabelHierarchyWrap::GetTargetLabelCount(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); int r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetTargetLabelCount(); info.GetReturnValue().Set(Nan::New(r)); } void VtkPointSetToLabelHierarchyWrap::GetTextProperty(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); vtkTextProperty * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetTextProperty(); VtkTextPropertyWrap::InitPtpl(); v8::Local<v8::Value> argv[1] = { Nan::New(vtkNodeJsNoWrap) }; v8::Local<v8::Function> cons = Nan::New<v8::FunctionTemplate>(VtkTextPropertyWrap::ptpl)->GetFunction(); v8::Local<v8::Object> wo = cons->NewInstance(1, argv); VtkTextPropertyWrap *w = new VtkTextPropertyWrap(); w->native = r; w->Wrap(wo); info.GetReturnValue().Set(wo); } void VtkPointSetToLabelHierarchyWrap::GetUseUnicodeStrings(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); bool r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetUseUnicodeStrings(); info.GetReturnValue().Set(Nan::New(r)); } void VtkPointSetToLabelHierarchyWrap::IsA(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsString()) { Nan::Utf8String a0(info[0]); int r; if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } r = native->IsA( *a0 ); info.GetReturnValue().Set(Nan::New(r)); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointSetToLabelHierarchyWrap::NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); vtkPointSetToLabelHierarchy * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->NewInstance(); VtkPointSetToLabelHierarchyWrap::InitPtpl(); v8::Local<v8::Value> argv[1] = { Nan::New(vtkNodeJsNoWrap) }; v8::Local<v8::Function> cons = Nan::New<v8::FunctionTemplate>(VtkPointSetToLabelHierarchyWrap::ptpl)->GetFunction(); v8::Local<v8::Object> wo = cons->NewInstance(1, argv); VtkPointSetToLabelHierarchyWrap *w = new VtkPointSetToLabelHierarchyWrap(); w->native = r; w->Wrap(wo); info.GetReturnValue().Set(wo); } void VtkPointSetToLabelHierarchyWrap::SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkObjectWrap::ptpl))->HasInstance(info[0])) { VtkObjectWrap *a0 = ObjectWrap::Unwrap<VtkObjectWrap>(info[0]->ToObject()); vtkPointSetToLabelHierarchy * r; if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } r = native->SafeDownCast( (vtkObject *) a0->native.GetPointer() ); VtkPointSetToLabelHierarchyWrap::InitPtpl(); v8::Local<v8::Value> argv[1] = { Nan::New(vtkNodeJsNoWrap) }; v8::Local<v8::Function> cons = Nan::New<v8::FunctionTemplate>(VtkPointSetToLabelHierarchyWrap::ptpl)->GetFunction(); v8::Local<v8::Object> wo = cons->NewInstance(1, argv); VtkPointSetToLabelHierarchyWrap *w = new VtkPointSetToLabelHierarchyWrap(); w->native = r; w->Wrap(wo); info.GetReturnValue().Set(wo); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointSetToLabelHierarchyWrap::SetBoundedSizeArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsString()) { Nan::Utf8String a0(info[0]); if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetBoundedSizeArrayName( *a0 ); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointSetToLabelHierarchyWrap::SetIconIndexArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsString()) { Nan::Utf8String a0(info[0]); if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetIconIndexArrayName( *a0 ); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointSetToLabelHierarchyWrap::SetLabelArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsString()) { Nan::Utf8String a0(info[0]); if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetLabelArrayName( *a0 ); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointSetToLabelHierarchyWrap::SetMaximumDepth(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsInt32()) { if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetMaximumDepth( info[0]->Int32Value() ); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointSetToLabelHierarchyWrap::SetOrientationArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsString()) { Nan::Utf8String a0(info[0]); if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetOrientationArrayName( *a0 ); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointSetToLabelHierarchyWrap::SetPriorityArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsString()) { Nan::Utf8String a0(info[0]); if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetPriorityArrayName( *a0 ); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointSetToLabelHierarchyWrap::SetSizeArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsString()) { Nan::Utf8String a0(info[0]); if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetSizeArrayName( *a0 ); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointSetToLabelHierarchyWrap::SetTargetLabelCount(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsInt32()) { if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetTargetLabelCount( info[0]->Int32Value() ); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointSetToLabelHierarchyWrap::SetTextProperty(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkTextPropertyWrap::ptpl))->HasInstance(info[0])) { VtkTextPropertyWrap *a0 = ObjectWrap::Unwrap<VtkTextPropertyWrap>(info[0]->ToObject()); if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetTextProperty( (vtkTextProperty *) a0->native.GetPointer() ); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointSetToLabelHierarchyWrap::SetUseUnicodeStrings(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsBoolean()) { if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetUseUnicodeStrings( info[0]->BooleanValue() ); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointSetToLabelHierarchyWrap::UseUnicodeStringsOff(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } native->UseUnicodeStringsOff(); } void VtkPointSetToLabelHierarchyWrap::UseUnicodeStringsOn(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointSetToLabelHierarchyWrap *wrapper = ObjectWrap::Unwrap<VtkPointSetToLabelHierarchyWrap>(info.Holder()); vtkPointSetToLabelHierarchy *native = (vtkPointSetToLabelHierarchy *)wrapper->native.GetPointer(); if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } native->UseUnicodeStringsOn(); }
35.085346
118
0.760694
axkibe
27d526834319a6235abb936f009d3d0696ae33c9
34
cpp
C++
src/MinoGame/ApplicationBuilder.cpp
Nicowcow/Minotaur
74689a1a76b0577138009acc5f8cd37db7bd7630
[ "MIT" ]
5
2017-07-09T08:24:24.000Z
2021-01-11T21:32:39.000Z
src/MinoGame/ApplicationBuilder.cpp
Nicowcow/Minotaur
74689a1a76b0577138009acc5f8cd37db7bd7630
[ "MIT" ]
1
2018-03-06T18:55:13.000Z
2018-12-21T14:20:23.000Z
src/MinoGame/ApplicationBuilder.cpp
Nicowcow/Minotaur
74689a1a76b0577138009acc5f8cd37db7bd7630
[ "MIT" ]
1
2019-01-24T09:32:04.000Z
2019-01-24T09:32:04.000Z
namespace MinoGame { }
2.428571
20
0.5
Nicowcow
27d975962cf6301c44ffaf27390159f286a0a5b9
2,891
hpp
C++
libs/Aether/include/Aether/primary/Text.hpp
tkgstrator/SeedHack
227566d993bdea7a2851a8fc664b539186509697
[ "MIT" ]
1
2021-02-04T07:27:46.000Z
2021-02-04T07:27:46.000Z
libs/Aether/include/Aether/primary/Text.hpp
tkgstrator/SeedHack
227566d993bdea7a2851a8fc664b539186509697
[ "MIT" ]
null
null
null
libs/Aether/include/Aether/primary/Text.hpp
tkgstrator/SeedHack
227566d993bdea7a2851a8fc664b539186509697
[ "MIT" ]
null
null
null
#ifndef AETHER_TEXT_HPP #define AETHER_TEXT_HPP #include "Aether/base/BaseText.hpp" namespace Aether { /** * @brief Text extends BaseText by implementing scrolling when the text overflows. * * It's for single-line text. */ class Text : public BaseText { private: /** @brief Indicator on whether the text is scrollable */ bool scroll_; /** @brief Pixels to scroll per second */ int scrollSpeed_; /** @brief Time since scroll finished (in ms) (only used internally) */ int scrollPauseTime; /** @brief Generate a text surface */ void generateSurface(); public: /** * @brief Construct a new Text object * * @param x x-coordinate of start position offset * @param y y-coordinate of start position offset * @param s text string * @param f font size * @param l font style * @param t \ref ::RenderType to use for texture generation */ Text(int x, int y, std::string s, unsigned int f, FontStyle l = FontStyle::Regular, RenderType t = RenderType::OnCreate); /** * @brief Indicator on whether the text is scrollable * * @return true if it is scrollable * @return false otherwise */ bool scroll(); /** * @brief Set whether the text is scrollable * * @param s true if text is scrollable, false otherwise */ void setScroll(bool s); /** * @brief Get the scroll speed for text * * @return scroll speed for text */ int scrollSpeed(); /** * @brief Set the scroll speed for text * * @param s new scroll speed for text */ void setScrollSpeed(int s); /** * @brief Set the font size for the text * * @param f new font size */ void setFontSize(unsigned int f); /** * @brief Set text * * @param s new text to set */ void setString(std::string s); /** * @brief Updates the text. * * Update handles animating the scroll if necessary. * * @param dt change in time */ void update(uint32_t dt); /** * @brief Adjusts the text width. * * Adjusting width may need to adjust amount of text shown. * * @param w new width */ void setW(int w); }; }; #endif
29.20202
133
0.471117
tkgstrator
27e252a5da99b05ecfa26445abd8b1f44f37d85a
722
cpp
C++
code/415.addStrings.cpp
T1mzhou/LeetCode
574540d30f5696e55799831dc3c8d8b7246b74f1
[ "MIT" ]
1
2020-10-04T13:39:34.000Z
2020-10-04T13:39:34.000Z
code/415.addStrings.cpp
T1mzhou/LeetCode
574540d30f5696e55799831dc3c8d8b7246b74f1
[ "MIT" ]
null
null
null
code/415.addStrings.cpp
T1mzhou/LeetCode
574540d30f5696e55799831dc3c8d8b7246b74f1
[ "MIT" ]
null
null
null
class Solution { public: vector<int> add(vector<int>& A, vector<int>& B) { vector<int> C; for (int i = 0, t = 0; i < A.size() || i < B.size() || t; i++) { if (i < A.size()) t += A[i]; if (i < B.size()) t += B[i]; C.push_back(t % 10); t /= 10; } return C; } string addStrings(string num1, string num2) { vector<int> A, B; for (int i = num1.size() - 1; i >= 0; i--) A.push_back(num1[i] - '0'); for (int i = num2.size() - 1; i >= 0; i--) B.push_back(num2[i] - '0'); auto C = add(A, B); string c; for (int i = C.size() - 1; i >= 0; i--) c += to_string(C[i]); return c; } };
31.391304
78
0.414127
T1mzhou
27f2e20ee83b2678a10d6728ab2b4ca3b15b0503
580
cpp
C++
ports/esp32/src/hSystem.cpp
ygjukim/hFramework
994ea7550c34b4943e2fa2d5e9ca447aa555f39e
[ "MIT" ]
33
2017-07-03T22:49:30.000Z
2022-03-31T19:32:55.000Z
ports/esp32/src/hSystem.cpp
ygjukim/hFramework
994ea7550c34b4943e2fa2d5e9ca447aa555f39e
[ "MIT" ]
6
2017-07-13T13:23:22.000Z
2019-10-25T17:51:28.000Z
ports/esp32/src/hSystem.cpp
ygjukim/hFramework
994ea7550c34b4943e2fa2d5e9ca447aa555f39e
[ "MIT" ]
17
2017-07-01T05:35:47.000Z
2022-03-22T23:33:00.000Z
/** * Copyright (c) 2013-2017 Husarion Sp. z o.o. * Distributed under the MIT license. * For full terms see the file LICENSE.md. */ #include "hSystem.h" #include <cstring> extern "C" { #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "esp_system.h" }; namespace hFramework { uint32_t hSystem::getRandNr() { return (uint32_t)esp_random(); } uint64_t hSystem::getSerialNum() { uint8_t mac[8]; esp_efuse_read_mac(mac); uint64_t id; memcpy(&id, mac, 8); return id; } void hSystem::reset() { system_restart(); } hSystem sys; }
15.675676
46
0.663793
ygjukim
27fb12c20936fbd399932af3586df1acb164d0df
29,028
inl
C++
include/sre/impl/ShaderSource.inl
KasperHdL/SimpleRenderEngine
2d7edeead1d14e00c3d41a29cf9880e216d366e0
[ "MIT" ]
null
null
null
include/sre/impl/ShaderSource.inl
KasperHdL/SimpleRenderEngine
2d7edeead1d14e00c3d41a29cf9880e216d366e0
[ "MIT" ]
null
null
null
include/sre/impl/ShaderSource.inl
KasperHdL/SimpleRenderEngine
2d7edeead1d14e00c3d41a29cf9880e216d366e0
[ "MIT" ]
null
null
null
// autogenerated by // files_to_cpp shader src/embedded_deps/skybox_frag.glsl skybox_frag.glsl src/embedded_deps/skybox_vert.glsl skybox_vert.glsl src/embedded_deps/sre_utils_incl.glsl sre_utils_incl.glsl src/embedded_deps/debug_normal_frag.glsl debug_normal_frag.glsl src/embedded_deps/debug_normal_vert.glsl debug_normal_vert.glsl src/embedded_deps/debug_uv_frag.glsl debug_uv_frag.glsl src/embedded_deps/debug_uv_vert.glsl debug_uv_vert.glsl src/embedded_deps/light_incl.glsl light_incl.glsl src/embedded_deps/particles_frag.glsl particles_frag.glsl src/embedded_deps/particles_vert.glsl particles_vert.glsl src/embedded_deps/sprite_frag.glsl sprite_frag.glsl src/embedded_deps/sprite_vert.glsl sprite_vert.glsl src/embedded_deps/standard_pbr_frag.glsl standard_pbr_frag.glsl src/embedded_deps/standard_pbr_vert.glsl standard_pbr_vert.glsl src/embedded_deps/standard_blinn_phong_frag.glsl standard_blinn_phong_frag.glsl src/embedded_deps/standard_blinn_phong_vert.glsl standard_blinn_phong_vert.glsl src/embedded_deps/standard_phong_frag.glsl standard_phong_frag.glsl src/embedded_deps/standard_phong_vert.glsl standard_phong_vert.glsl src/embedded_deps/blit_frag.glsl blit_frag.glsl src/embedded_deps/blit_vert.glsl blit_vert.glsl src/embedded_deps/unlit_frag.glsl unlit_frag.glsl src/embedded_deps/unlit_vert.glsl unlit_vert.glsl src/embedded_deps/debug_tangent_frag.glsl debug_tangent_frag.glsl src/embedded_deps/debug_tangent_vert.glsl debug_tangent_vert.glsl src/embedded_deps/normalmap_incl.glsl normalmap_incl.glsl src/embedded_deps/global_uniforms_incl.glsl global_uniforms_incl.glsl include/sre/impl/ShaderSource.inl #include <map> #include <utility> #include <string> std::map<std::string, std::string> builtInShaderSource { std::make_pair<std::string,std::string>("skybox_frag.glsl",R"(#version 330 out vec4 fragColor; in vec3 vUV; uniform vec4 color; uniform samplerCube tex; #pragma include "sre_utils_incl.glsl" void main(void) { fragColor = color * toLinear(texture(tex, vUV)); //fragColor = toOutput(fragColor); })"), std::make_pair<std::string,std::string>("skybox_vert.glsl",R"(#version 330 in vec3 position; out vec3 vUV; #pragma include "global_uniforms_incl.glsl" void main(void) { vec4 eyespacePos = (g_view * vec4(position, 0.0)); eyespacePos.w = 1.0; gl_Position = g_model * eyespacePos; // model matrix here contains the infinite projection vUV = position; })"), std::make_pair<std::string,std::string>("sre_utils_incl.glsl",R"(vec4 toLinear(vec4 col){ #ifndef SI_TEX_SAMPLER_SRGB float gamma = 2.2; return vec4 ( col.xyz = pow(col.xyz, vec3(gamma)), col.w ); #else return col; #endif } vec4 toOutput(vec4 colorLinear){ #ifndef SI_FRAMEBUFFER_SRGB float gamma = 2.2; return vec4(pow(colorLinear.xyz,vec3(1.0/gamma)), colorLinear.a); // gamma correction #else return colorLinear; #endif } vec4 toOutput(vec3 colorLinear, float alpha){ #ifndef SI_FRAMEBUFFER_SRGB float gamma = 2.2; return vec4(pow(colorLinear,vec3(1.0/gamma)), alpha); // gamma correction #else return vec4(colorLinear, alpha); // pass through #endif })"), std::make_pair<std::string,std::string>("debug_normal_frag.glsl",R"(#version 330 out vec4 fragColor; in vec3 vNormal; #pragma include "sre_utils_incl.glsl" void main(void) { fragColor = vec4(vNormal*0.5+0.5,1.0); fragColor = toOutput(fragColor); })"), std::make_pair<std::string,std::string>("debug_normal_vert.glsl",R"(#version 330 in vec3 position; in vec3 normal; out vec3 vNormal; #pragma include "global_uniforms_incl.glsl" void main(void) { gl_Position = g_projection * g_view * g_model * vec4(position,1.0); vNormal = normal; })"), std::make_pair<std::string,std::string>("debug_uv_frag.glsl",R"(#version 330 out vec4 fragColor; in vec4 vUV; #pragma include "sre_utils_incl.glsl" void main(void) { fragColor = vUV; fragColor = toOutput(fragColor); })"), std::make_pair<std::string,std::string>("debug_uv_vert.glsl",R"(#version 330 in vec3 position; in vec4 uv; out vec4 vUV; #pragma include "global_uniforms_incl.glsl" void main(void) { gl_Position = g_projection * g_view * g_model * vec4(position,1.0); vUV = uv; })"), std::make_pair<std::string,std::string>("light_incl.glsl",R"( in vec4 vLightDir[SI_LIGHTS]; uniform vec4 specularity; void lightDirectionAndAttenuation(vec4 lightPosType, float lightRange, vec3 pos, out vec3 lightDirection, out float attenuation){ bool isDirectional = lightPosType.w == 0.0; bool isPoint = lightPosType.w == 1.0; if (isDirectional){ lightDirection = lightPosType.xyz; attenuation = 1.0; } else if (isPoint) { vec3 lightVector = lightPosType.xyz - pos; float lightVectorLength = length(lightVector); lightDirection = lightVector / lightVectorLength; // normalize if (lightRange <= 0.0){ // attenuation disabled attenuation = 1.0; } else if (lightVectorLength >= lightRange){ attenuation = 0.0; return; } else { attenuation = pow(1.0 - (lightVectorLength / lightRange), 1.5); // non physical range based attenuation } } else { attenuation = 0.0; lightDirection = vec3(0.0, 0.0, 0.0); } } vec3 computeLightBlinnPhong(vec3 wsPos, vec3 wsCameraPos, vec3 normal, out vec3 specularityOut){ specularityOut = vec3(0.0, 0.0, 0.0); vec3 lightColor = vec3(0.0,0.0,0.0); vec3 cam = normalize(wsCameraPos - wsPos); for (int i=0;i<SI_LIGHTS;i++){ vec3 lightDirection = vec3(0.0,0.0,0.0); float att = 0.0; lightDirectionAndAttenuation(g_lightPosType[i], g_lightColorRange[i].w, wsPos, lightDirection, att); if (att <= 0.0){ continue; } // diffuse light float diffuse = dot(lightDirection, normal); if (diffuse > 0.0){ lightColor += (att * diffuse) * g_lightColorRange[i].xyz; } // specular light if (specularity.a > 0.0){ vec3 H = normalize(lightDirection + cam); float nDotHV = dot(normal, H); if (nDotHV > 0.0){ float pf = pow(nDotHV, specularity.a); specularityOut += specularity.rgb * pf * att * diffuse; // white specular highlights } } } lightColor = max(g_ambientLight.xyz, lightColor); return lightColor; } vec3 computeLightBlinn(vec3 wsPos, vec3 wsCameraPos, vec3 normal){ vec3 lightColor = vec3(0.0,0.0,0.0); for (int i=0;i<SI_LIGHTS;i++){ vec3 lightDirection = vec3(0.0,0.0,0.0); float att = 0.0; lightDirectionAndAttenuation(g_lightPosType[i], g_lightColorRange[i].w, wsPos, lightDirection, att); if (att <= 0.0){ continue; } // diffuse light float diffuse = dot(lightDirection, normal); if (diffuse > 0.0){ lightColor += (att * diffuse) * g_lightColorRange[i].xyz; } } lightColor = max(g_ambientLight.xyz, lightColor); return lightColor; } vec3 computeLightPhong(vec3 wsPos, vec3 wsCameraPos, vec3 normal, out vec3 specularityOut){ specularityOut = vec3(0.0, 0.0, 0.0); vec3 lightColor = vec3(0.0,0.0,0.0); vec3 cam = normalize(wsCameraPos - wsPos); for (int i=0;i<SI_LIGHTS;i++){ vec3 lightDirection = vec3(0.0,0.0,0.0); float att = 0.0; lightDirectionAndAttenuation(g_lightPosType[i], g_lightColorRange[i].w, wsPos, lightDirection, att); if (att <= 0.0){ continue; } // diffuse light float diffuse = dot(lightDirection, normal); if (diffuse > 0.0){ lightColor += (att * diffuse) * g_lightColorRange[i].xyz; } // specular light if (specularity.a > 0.0){ vec3 R = reflect(-lightDirection, normal); float nDotRV = dot(cam, R); if (nDotRV > 0.0){ float pf = pow(nDotRV, specularity.a); specularityOut += specularity.rgb * (pf * att); // white specular highlights } } } lightColor = max(g_ambientLight.xyz, lightColor); return lightColor; })"), std::make_pair<std::string,std::string>("particles_frag.glsl",R"(#version 330 out vec4 fragColor; in mat3 vUVMat; in vec3 uvSize; in vec4 vColor; #pragma include "global_uniforms_incl.glsl" uniform sampler2D tex; #pragma include "sre_utils_incl.glsl" void main(void) { vec2 uv = (vUVMat * vec3(gl_PointCoord,1.0)).xy; if (uv != clamp(uv, uvSize.xy, uvSize.xy + uvSize.zz)){ discard; } vec4 c = vColor * toLinear(texture(tex, uv)); fragColor = c; fragColor = toOutput(fragColor); })"), std::make_pair<std::string,std::string>("particles_vert.glsl",R"(#version 330 in vec3 position; in float particleSize; in vec4 uv; in vec4 vertex_color; out mat3 vUVMat; out vec4 vColor; out vec3 uvSize; #pragma include "global_uniforms_incl.glsl" mat3 translate(vec2 p){ return mat3(1.0,0.0,0.0,0.0,1.0,0.0,p.x,p.y,1.0); } mat3 rotate(float rad){ float s = sin(rad); float c = cos(rad); return mat3(c,s,0.0,-s,c,0.0,0.0,0.0,1.0); } mat3 scale(float s){ return mat3(s,0.0,0.0,0.0,s,0.0,0.0,0.0,1.0); } void main(void) { vec4 pos = vec4( position, 1.0); vec4 eyeSpacePos = g_view * g_model * pos; gl_Position = g_projection * eyeSpacePos; if (g_projection[2][3] != 0.0){ // if perspective projection gl_PointSize = (g_viewport.y / 600.0) * particleSize * 1.0 / -eyeSpacePos.z; } else { gl_PointSize = particleSize*(g_viewport.y / 600.0); } vUVMat = translate(uv.xy)*scale(uv.z) * translate(vec2(0.5,0.5))*rotate(uv.w) * translate(vec2(-0.5,-0.5)); vColor = vertex_color; uvSize = uv.xyz; })"), std::make_pair<std::string,std::string>("sprite_frag.glsl",R"(#version 330 out vec4 fragColor; in vec2 vUV; in vec4 vColor; uniform sampler2D tex; #pragma include "sre_utils_incl.glsl" void main(void) { fragColor = vColor * toLinear(texture(tex, vUV)); fragColor = toOutput(fragColor); })"), std::make_pair<std::string,std::string>("sprite_vert.glsl",R"(#version 330 in vec3 position; in vec4 uv; in vec4 vertex_color; out vec2 vUV; out vec4 vColor; #pragma include "global_uniforms_incl.glsl" void main(void) { gl_Position = g_projection * g_view * g_model * vec4(position,1.0); vUV = uv.xy; vColor = vertex_color; })"), std::make_pair<std::string,std::string>("standard_pbr_frag.glsl",R"(#version 330 #extension GL_EXT_shader_texture_lod: enable #extension GL_OES_standard_derivatives : enable out vec4 fragColor; #if defined(S_TANGENTS) && defined(S_NORMALMAP) in mat3 vTBN; #else in vec3 vNormal; #endif in vec2 vUV; in vec3 vWsPos; uniform vec4 color; uniform vec4 metallicRoughness; uniform sampler2D tex; #ifdef S_METALROUGHNESSMAP uniform sampler2D mrTex; #endif #ifdef S_NORMALMAP uniform sampler2D normalTex; uniform float normalScale; #endif #ifdef S_EMISSIVEMAP uniform sampler2D emissiveTex; uniform vec4 emissiveFactor; #endif #ifdef S_OCCLUSIONMAP uniform sampler2D occlusionTex; uniform float occlusionStrength; #endif #ifdef S_VERTEX_COLOR in vec4 vColor; #endif #pragma include "global_uniforms_incl.glsl" #pragma include "normalmap_incl.glsl" #pragma include "light_incl.glsl" #pragma include "sre_utils_incl.glsl" // Encapsulate the various inputs used by the various functions in the shading equation // We store values in this struct to simplify the integration of alternative implementations // of the shading terms, outlined in the Readme.MD Appendix. struct PBRInfo { float NdotL; // cos angle between normal and light direction float NdotV; // cos angle between normal and view direction float NdotH; // cos angle between normal and half vector float LdotH; // cos angle between light direction and half vector float VdotH; // cos angle between view direction and half vector float perceptualRoughness; // roughness value, as authored by the model creator (input to shader) float metalness; // metallic value at the surface vec3 reflectance0; // full reflectance color (normal incidence angle) vec3 reflectance90; // reflectance color at grazing angle float alphaRoughness; // roughness mapped to a more linear change in the roughness (proposed by [2]) vec3 diffuseColor; // color contribution from diffuse lighting vec3 specularColor; // color contribution from specular lighting }; const float M_PI = 3.141592653589793; const float c_MinRoughness = 0.04; // The following equation models the Fresnel reflectance term of the spec equation (aka F()) // Implementation of fresnel from [4], Equation 15 vec3 specularReflection(PBRInfo pbrInputs) { return pbrInputs.reflectance0 + (pbrInputs.reflectance90 - pbrInputs.reflectance0) * pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0); } // Basic Lambertian diffuse // Implementation from Lambert's Photometria https://archive.org/details/lambertsphotome00lambgoog // See also [1], Equation 1 vec3 diffuse(PBRInfo pbrInputs) { return pbrInputs.diffuseColor / M_PI; } // This calculates the specular geometric attenuation (aka G()), // where rougher material will reflect less light back to the viewer. // This implementation is based on [1] Equation 4, and we adopt their modifications to // alphaRoughness as input as originally proposed in [2]. float geometricOcclusion(PBRInfo pbrInputs) { float NdotL = pbrInputs.NdotL; float NdotV = pbrInputs.NdotV; float r = pbrInputs.alphaRoughness; float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL))); float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV))); return attenuationL * attenuationV; } // The following equation(s) model the distribution of microfacet normals across the area being drawn (aka D()) // Implementation from "Average Irregularity Representation of a Roughened Surface for Ray Reflection" by T. S. Trowbridge, and K. P. Reitz // Follows the distribution function recommended in the SIGGRAPH 2013 course notes from EPIC Games [1], Equation 3. float microfacetDistribution(PBRInfo pbrInputs) { float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness; float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0; return roughnessSq / (M_PI * f * f); } void main(void) { float perceptualRoughness = metallicRoughness.y; float metallic = metallicRoughness.x; #ifdef S_METALROUGHNESSMAP // Roughness is stored in the 'g' channel, metallic is stored in the 'b' channel. // This layout intentionally reserves the 'r' channel for (optional) occlusion map data vec4 mrSample = texture(mrTex, vUV); perceptualRoughness = mrSample.g * perceptualRoughness; metallic = mrSample.b * metallic; #endif perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0); metallic = clamp(metallic, 0.0, 1.0); // Roughness is authored as perceptual roughness; as is convention, // convert to material roughness by squaring the perceptual roughness [2]. float alphaRoughness = perceptualRoughness * perceptualRoughness; #ifndef S_NO_BASECOLORMAP vec4 baseColor = toLinear(texture(tex, vUV)) * color; #else vec4 baseColor = color; #endif #ifdef S_VERTEX_COLOR baseColor = baseColor * vColor; #endif vec3 f0 = vec3(0.04); vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0); diffuseColor *= 1.0 - metallic; vec3 specularColor = mix(f0, baseColor.rgb, metallic); // Compute reflectance. float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b); // For typical incident reflectance range (between 4% to 100%) set the grazing reflectance to 100% for typical fresnel effect. // For very low reflectance range on highly diffuse objects (below 4%), incrementally reduce grazing reflectance to 0%. float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0); vec3 specularEnvironmentR0 = specularColor.rgb; vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90; vec3 color = baseColor.rgb * g_ambientLight.rgb; // non pbr vec3 n = getNormal(); // Normal at surface point vec3 v = normalize(g_cameraPos.xyz - vWsPos.xyz); // Vector from surface point to camera for (int i=0;i<SI_LIGHTS;i++) { float attenuation = 0.0; vec3 l = vec3(0.0,0.0,0.0); lightDirectionAndAttenuation(g_lightPosType[i], g_lightColorRange[i].w, vWsPos, l, attenuation); if (attenuation <= 0.0){ continue; } vec3 h = normalize(l+v); // Half vector between both l and v vec3 reflection = -normalize(reflect(v, n)); float NdotL = clamp(dot(n, l), 0.0001, 1.0); float NdotV = abs(dot(n, v)) + 0.0001; float NdotH = clamp(dot(n, h), 0.0, 1.0); float LdotH = clamp(dot(l, h), 0.0, 1.0); float VdotH = clamp(dot(v, h), 0.0, 1.0); PBRInfo pbrInputs = PBRInfo( NdotL, NdotV, NdotH, LdotH, VdotH, perceptualRoughness, metallic, specularEnvironmentR0, specularEnvironmentR90, alphaRoughness, diffuseColor, specularColor ); // Calculate the shading terms for the microfacet specular shading model vec3 F = specularReflection(pbrInputs); float G = geometricOcclusion(pbrInputs); float D = microfacetDistribution(pbrInputs); // Calculation of analytical lighting contribution vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs); vec3 specContrib = F * G * D / (4.0 * NdotL * NdotV); color += attenuation * NdotL * g_lightColorRange[i].xyz * (diffuseContrib + specContrib); } // Apply optional PBR terms for additional (optional) shading #ifdef S_OCCLUSIONMAP float ao = texture(occlusionTex, vUV).r; color = mix(color, color * ao, occlusionStrength); #endif #ifdef S_EMISSIVEMAP vec3 emissive = toLinear(texture(emissiveTex, vUV)).rgb * emissiveFactor.xyz; color += emissive; #endif fragColor = toOutput(color,baseColor.a); })"), std::make_pair<std::string,std::string>("standard_pbr_vert.glsl",R"(#version 330 in vec3 position; in vec3 normal; in vec4 uv; #if defined(S_TANGENTS) && defined(S_NORMALMAP) in vec4 tangent; out mat3 vTBN; #else out vec3 vNormal; #endif #ifdef S_VERTEX_COLOR in vec4 vertex_color; out vec4 vColor; #endif out vec2 vUV; out vec3 vWsPos; #pragma include "global_uniforms_incl.glsl" #pragma include "normalmap_incl.glsl" void main(void) { vec4 wsPos = g_model * vec4(position,1.0); vWsPos = wsPos.xyz; gl_Position = g_projection * g_view * wsPos; #if defined(S_TANGENTS) && defined(S_NORMALMAP) vTBN = computeTBN(g_model_it, normal, tangent); #else vNormal = normalize(g_model_it * normal); #endif vUV = uv.xy; #ifdef S_VERTEX_COLOR vColor = vertex_color; #endif })"), std::make_pair<std::string,std::string>("standard_blinn_phong_frag.glsl",R"(#version 330 out vec4 fragColor; #if defined(S_TANGENTS) && defined(S_NORMALMAP) in mat3 vTBN; #else in vec3 vNormal; #endif in vec2 vUV; in vec3 vWsPos; #ifdef S_NORMALMAP uniform sampler2D normalTex; uniform float normalScale; #endif #ifdef S_VERTEX_COLOR in vec4 vColor; #endif uniform vec4 color; uniform sampler2D tex; #pragma include "global_uniforms_incl.glsl" #pragma include "light_incl.glsl" #pragma include "normalmap_incl.glsl" #pragma include "sre_utils_incl.glsl" void main() { vec4 c = color * toLinear(texture(tex, vUV)); #ifdef S_VERTEX_COLOR c = c * vColor; #endif vec3 normal = getNormal(); vec3 specularLight = vec3(0.0,0.0,0.0); vec3 l = computeLightBlinnPhong(vWsPos, g_cameraPos.xyz, normal, specularLight); fragColor = c * vec4(l, 1.0) + vec4(specularLight,0); fragColor = toOutput(fragColor); })"), std::make_pair<std::string,std::string>("standard_blinn_phong_vert.glsl",R"(#version 330 in vec3 position; in vec3 normal; in vec4 uv; out vec2 vUV; #if defined(S_TANGENTS) && defined(S_NORMALMAP) in vec4 tangent; out mat3 vTBN; #else out vec3 vNormal; #endif out vec3 vWsPos; #ifdef S_VERTEX_COLOR in vec4 vertex_color; out vec4 vColor; #endif #pragma include "global_uniforms_incl.glsl" #pragma include "normalmap_incl.glsl" void main(void) { vec4 wsPos = g_model * vec4(position,1.0); gl_Position = g_projection * g_view * wsPos; #if defined(S_TANGENTS) && defined(S_NORMALMAP) vTBN = computeTBN(g_model_it, normal, tangent); #else vNormal = normalize(g_model_it * normal); #endif vUV = uv.xy; vWsPos = wsPos.xyz; #ifdef S_VERTEX_COLOR vColor = vertex_color; #endif })"), std::make_pair<std::string,std::string>("standard_phong_frag.glsl",R"(#version 330 out vec4 fragColor; #if defined(S_TANGENTS) && defined(S_NORMALMAP) in mat3 vTBN; #else in vec3 vNormal; #endif in vec2 vUV; in vec3 vWsPos; #ifdef S_NORMALMAP uniform sampler2D normalTex; uniform float normalScale; #endif #ifdef S_VERTEX_COLOR in vec4 vColor; #endif uniform vec4 color; uniform sampler2D tex; #pragma include "global_uniforms_incl.glsl" #pragma include "light_incl.glsl" #pragma include "normalmap_incl.glsl" #pragma include "sre_utils_incl.glsl" void main() { vec4 c = color * toLinear(texture(tex, vUV)); #ifdef S_VERTEX_COLOR c = c * vColor; #endif vec3 normal = getNormal(); vec3 specularLight = vec3(0.0,0.0,0.0); vec3 l = computeLightPhong(vWsPos, g_cameraPos.xyz, normal, specularLight); fragColor = c * vec4(l, 1.0) + vec4(specularLight,0); fragColor = toOutput(fragColor); })"), std::make_pair<std::string,std::string>("standard_phong_vert.glsl",R"(#version 330 in vec3 position; in vec3 normal; in vec4 uv; out vec2 vUV; #if defined(S_TANGENTS) && defined(S_NORMALMAP) in vec4 tangent; out mat3 vTBN; #else out vec3 vNormal; #endif out vec3 vWsPos; #ifdef S_VERTEX_COLOR in vec4 vertex_color; out vec4 vColor; #endif #pragma include "global_uniforms_incl.glsl" #pragma include "normalmap_incl.glsl" void main(void) { vec4 wsPos = g_model * vec4(position,1.0); gl_Position = g_projection * g_view * wsPos; #if defined(S_TANGENTS) && defined(S_NORMALMAP) vTBN = computeTBN(g_model_it, normal, tangent); #else vNormal = normalize(g_model_it * normal); #endif vUV = uv.xy; vWsPos = wsPos.xyz; #ifdef S_VERTEX_COLOR vColor = vertex_color; #endif })"), std::make_pair<std::string,std::string>("blit_frag.glsl",R"(#version 330 out vec4 fragColor; in vec2 vUV; uniform sampler2D tex; #pragma include "sre_utils_incl.glsl" void main(void) { fragColor = toLinear(texture(tex, vUV)); fragColor = toOutput(fragColor); })"), std::make_pair<std::string,std::string>("blit_vert.glsl",R"(#version 330 in vec3 position; in vec3 normal; in vec4 uv; out vec2 vUV; #pragma include "global_uniforms_incl.glsl" void main(void) { gl_Position = g_model * vec4(position,1.0); vUV = uv.xy; })"), std::make_pair<std::string,std::string>("unlit_frag.glsl",R"(#version 330 out vec4 fragColor; in vec2 vUV; #ifdef S_VERTEX_COLOR in vec4 vColor; #endif uniform vec4 color; uniform sampler2D tex; #pragma include "sre_utils_incl.glsl" void main(void) { fragColor = color * toLinear(texture(tex, vUV)); #ifdef S_VERTEX_COLOR fragColor = fragColor * vColor; #endif //fragColor = toOutput(fragColor); })"), std::make_pair<std::string,std::string>("unlit_vert.glsl",R"(#version 330 in vec3 position; in vec3 normal; #ifdef S_VERTEX_COLOR in vec4 vertex_color; out vec4 vColor; #endif in vec4 uv; out vec2 vUV; #pragma include "global_uniforms_incl.glsl" void main(void) { gl_Position = g_projection * g_view * g_model * vec4(position,1.0); vUV = uv.xy; #ifdef S_VERTEX_COLOR vColor = vertex_color; #endif })"), std::make_pair<std::string,std::string>("debug_tangent_frag.glsl",R"(#version 330 out vec4 fragColor; in vec3 vTangent; #pragma include "sre_utils_incl.glsl" void main(void) { fragColor = vec4(vTangent*0.5+0.5,1.0); fragColor = toOutput(fragColor); })"), std::make_pair<std::string,std::string>("debug_tangent_vert.glsl",R"(#version 330 in vec3 position; in vec4 tangent; out vec3 vTangent; #pragma include "global_uniforms_incl.glsl" void main(void) { gl_Position = g_projection * g_view * g_model * vec4(position,1.0); vTangent = tangent.xyz * tangent.w; })"), std::make_pair<std::string,std::string>("normalmap_incl.glsl",R"(#ifdef SI_VERTEX mat3 computeTBN(mat3 g_model_it, vec3 normal, vec4 tangent){ vec3 wsNormal = normalize(g_model_it * normal); vec3 wsTangent = normalize(g_model_it * tangent.xyz); vec3 wsBitangent = cross(wsNormal, wsTangent) * tangent.w; return mat3(wsTangent, wsBitangent, wsNormal); } #endif #ifdef SI_FRAGMENT // Find the normal for this fragment, pulling either from a predefined normal map // or from the interpolated mesh normal and tangent attributes. vec3 getNormal() { #ifdef S_NORMALMAP // Retrieve the tangent space matrix #ifndef S_TANGENTS vec3 pos_dx = dFdx(vWsPos); vec3 pos_dy = dFdy(vWsPos); vec3 tex_dx = dFdx(vec3(vUV, 0.0)); vec3 tex_dy = dFdy(vec3(vUV, 0.0)); vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t); vec3 ng = normalize(vNormal); t = normalize(t - ng * dot(ng, t)); vec3 b = normalize(cross(ng, t)); mat3 tbn = mat3(t, b, ng); #else // S_TANGENTS mat3 tbn = vTBN; #endif vec3 n = texture(normalTex, vUV).rgb; n = normalize(tbn * ((2.0 * n - 1.0) * vec3(normalScale, normalScale, 1.0))); #else vec3 n = normalize(vNormal); #endif return n; } #endif)"), std::make_pair<std::string,std::string>("global_uniforms_incl.glsl",R"(// Per render-pass uniforms #if __VERSION__ > 100 layout(std140) uniform g_global_uniforms { #endif #ifdef GL_ES #ifdef GL_FRAGMENT_PRECISION_HIGH uniform highp mat4 g_view; uniform highp mat4 g_projection; uniform highp vec4 g_viewport; uniform highp vec4 g_cameraPos; uniform highp vec4 g_ambientLight; uniform highp vec4 g_lightColorRange[SI_LIGHTS]; uniform highp vec4 g_lightPosType[SI_LIGHTS]; #else uniform mediump mat4 g_view; uniform mediump mat4 g_projection; uniform mediump vec4 g_viewport; uniform mediump vec4 g_cameraPos; uniform mediump vec4 g_ambientLight; uniform mediump vec4 g_lightColorRange[SI_LIGHTS]; uniform mediump vec4 g_lightPosType[SI_LIGHTS]; #endif #else uniform mat4 g_view; uniform mat4 g_projection; uniform vec4 g_viewport; uniform vec4 g_cameraPos; uniform vec4 g_ambientLight; uniform vec4 g_lightColorRange[SI_LIGHTS]; uniform vec4 g_lightPosType[SI_LIGHTS]; #endif #if __VERSION__ > 100 }; #endif #ifdef GL_ES // Per draw call uniforms #ifdef GL_FRAGMENT_PRECISION_HIGH uniform highp mat4 g_model; uniform highp mat3 g_model_it; uniform highp mat3 g_model_view_it; #else uniform mediump mat4 g_model; uniform mediump mat3 g_model_it; uniform mediump mat3 g_model_view_it; #endif #else uniform mat4 g_model; uniform mat3 g_model_it; uniform mat3 g_model_view_it; #endif)"), std::make_pair<std::string,std::string>("standard_blinn_frag.glsl",R"(#version 330 out vec4 fragColor; #if defined(S_TANGENTS) && defined(S_NORMALMAP) in mat3 vTBN; #else in vec3 vNormal; #endif in vec2 vUV; in vec3 vWsPos; #ifdef S_NORMALMAP uniform sampler2D normalTex; uniform float normalScale; #endif #ifdef S_VERTEX_COLOR in vec4 vColor; #endif uniform vec4 color; uniform sampler2D tex; #pragma include "global_uniforms_incl.glsl" #pragma include "light_incl.glsl" #pragma include "normalmap_incl.glsl" #pragma include "sre_utils_incl.glsl" void main() { vec4 c = color * toLinear(texture(tex, vUV)); #ifdef S_VERTEX_COLOR c = c * vColor; #endif vec3 normal = getNormal(); vec3 l = computeLightBlinn(vWsPos, g_cameraPos.xyz, normal); fragColor = c * vec4(l, 1.0); //fragColor = toOutput(fragColor); })"), std::make_pair<std::string,std::string>("standard_blinn_vert.glsl",R"(#version 330 in vec3 position; in vec3 normal; in vec4 uv; out vec2 vUV; #if defined(S_TANGENTS) && defined(S_NORMALMAP) in vec4 tangent; out mat3 vTBN; #else out vec3 vNormal; #endif out vec3 vWsPos; #ifdef S_VERTEX_COLOR in vec4 vertex_color; out vec4 vColor; #endif #pragma include "global_uniforms_incl.glsl" #pragma include "normalmap_incl.glsl" void main(void) { vec4 wsPos = g_model * vec4(position,1.0); gl_Position = g_projection * g_view * wsPos; #if defined(S_TANGENTS) && defined(S_NORMALMAP) vTBN = computeTBN(g_model_it, normal, tangent); #else vNormal = normalize(g_model_it * normal); #endif vUV = uv.xy; vWsPos = wsPos.xyz; #ifdef S_VERTEX_COLOR vColor = vertex_color; #endif })"), };
30.427673
1,608
0.701805
KasperHdL
27fb453dc6c7a40951d513a131c0e349d4c57920
1,040
hpp
C++
Pi/server.hpp
FundCompXbee/XBeeMessenger
f3210077cb82e1597980b33bc6e2f8f9cf7bc042
[ "MIT" ]
1
2016-04-29T22:30:58.000Z
2016-04-29T22:30:58.000Z
Pi/server.hpp
FundCompXbee/XBeeMessenger
f3210077cb82e1597980b33bc6e2f8f9cf7bc042
[ "MIT" ]
null
null
null
Pi/server.hpp
FundCompXbee/XBeeMessenger
f3210077cb82e1597980b33bc6e2f8f9cf7bc042
[ "MIT" ]
null
null
null
// Team: XBeeMessenger // Course: Fundamentals of Computing II // Assignment: Final Project // Purpose: Interface for a server which receives requests, handles // requests, and broadcasts responses #ifndef SERVER #define SERVER #include <string> #include <unistd.h> #include <cstdlib> #include "IRCCommandHandler.hpp" #include "serial.hpp" #include "envelope.hpp" class Server { public: Server(int baud); // contructor, initializes serial and gets hostname void run(); // Sets the server into action private: static const char delimiter; // signals the end of a serial transmission std::string name; // The server's name. By default this is retrieved from the // server's hostname IRCCommandHandler IRCHandler; // Handles commands Serial serial; // Handles data transmission std::string retrieveSerialData(); // retrieves raw JSON-string from serial void broadcastSerialData(std::string broadcastMessage); // broadcasts message std::string validateRequest(Envelope& request); }; #endif
28.888889
79
0.735577
FundCompXbee
7e0119a4fd94dd780940a2fc66941202f79fc7b6
2,088
cpp
C++
libs/libvtrutil/src/vtr_list.cpp
rding2454/IndeStudy
c27be794bc2ce5ada93b16c92569a4bcafc8a21c
[ "MIT" ]
null
null
null
libs/libvtrutil/src/vtr_list.cpp
rding2454/IndeStudy
c27be794bc2ce5ada93b16c92569a4bcafc8a21c
[ "MIT" ]
null
null
null
libs/libvtrutil/src/vtr_list.cpp
rding2454/IndeStudy
c27be794bc2ce5ada93b16c92569a4bcafc8a21c
[ "MIT" ]
null
null
null
#include <cstdlib> #include "vtr_list.h" #include "vtr_memory.h" namespace vtr { t_linked_vptr *insert_in_vptr_list(t_linked_vptr *head, void *vptr_to_add) { /* Inserts a new element at the head of a linked list of void pointers. * * Returns the new head of the list. */ t_linked_vptr *linked_vptr; linked_vptr = (t_linked_vptr *) vtr::malloc(sizeof(t_linked_vptr)); linked_vptr->data_vptr = vptr_to_add; linked_vptr->next = head; return (linked_vptr); /* New head of the list */ } /* Deletes the element at the head of a linked list of void pointers. * * Returns the new head of the list. */ t_linked_vptr *delete_in_vptr_list(t_linked_vptr *head) { t_linked_vptr *linked_vptr; if (head == NULL ) return NULL ; linked_vptr = head->next; free(head); return linked_vptr; /* New head of the list */ } t_linked_int *insert_in_int_list(t_linked_int * head, int data, t_linked_int ** free_list_head_ptr) { /* Inserts a new element at the head of a linked list of integers. Returns * * the new head of the list. One argument is the address of the head of * * a list of free ilist elements. If there are any elements on this free * * list, the new element is taken from it. Otherwise a new one is malloced. */ t_linked_int *linked_int; if (*free_list_head_ptr != NULL ) { linked_int = *free_list_head_ptr; *free_list_head_ptr = linked_int->next; } else { linked_int = (t_linked_int *) vtr::malloc(sizeof(t_linked_int)); } linked_int->data = data; linked_int->next = head; return (linked_int); } void free_int_list(t_linked_int ** int_list_head_ptr) { /* This routine truly frees (calls free) all the integer list elements * * on the linked list pointed to by *head, and sets head = NULL. */ t_linked_int *linked_int, *next_linked_int; linked_int = *int_list_head_ptr; while (linked_int != NULL ) { next_linked_int = linked_int->next; free(linked_int); linked_int = next_linked_int; } *int_list_head_ptr = NULL; } } //namespace
27.84
80
0.688218
rding2454
7e042ee4252496e14df8e3c73c6b1adecbcd3299
1,248
cc
C++
StatModules/src/ToyMCLikelihoodEvaluator.cc
GooStats/GooStats
5a8bc35736eb390d658c790fa0026b576898a462
[ "MIT" ]
3
2020-01-28T21:51:46.000Z
2021-09-06T18:43:00.000Z
StatModules/src/ToyMCLikelihoodEvaluator.cc
GooStats/GooStats
5a8bc35736eb390d658c790fa0026b576898a462
[ "MIT" ]
12
2019-08-09T08:58:49.000Z
2022-03-16T04:00:11.000Z
StatModules/src/ToyMCLikelihoodEvaluator.cc
GooStats/GooStats
5a8bc35736eb390d658c790fa0026b576898a462
[ "MIT" ]
3
2018-04-12T11:53:55.000Z
2022-03-17T13:06:06.000Z
/*****************************************************************************/ // Author: Xuefeng Ding <xuefeng.ding.physics@gmail.com> // Insitute: Gran Sasso Science Institute, L'Aquila, 67100, Italy // Date: 2018 April 7th // Version: v1.0 // Description: GooStats, a statistical analysis toolkit that runs on GPU. // // All rights reserved. 2018 copyrighted. /*****************************************************************************/ #include "ToyMCLikelihoodEvaluator.h" #include "InputManager.h" #include "SumLikelihoodPdf.h" #include "GSFitManager.h" void ToyMCLikelihoodEvaluator::get_p_value(GSFitManager *gsFitManager,InputManager *manager,double LL,double &p,double &perr,FitControl *fit) { const OptionManager *gOp = manager->GlobalOption(); int N = gOp->has("toyMC_size")?gOp->get<double>("toyMC_size"):100; if(N==0) return; SumLikelihoodPdf *totalPdf = manager->getTotalPdf(); totalPdf->setFitControl(fit); totalPdf->copyParams(); totalPdf->cache(); LLs.clear(); int n = 0; for(int i = 0;i<N;++i) { manager->fillRandomData(); LLs.push_back(totalPdf->calculateNLL()); if(LLs.back()>LL) ++n; } totalPdf->restore(); gsFitManager->restoreFitControl(); p = n*1./N; perr = sqrt(p*(1-p)/N); }
36.705882
143
0.614583
GooStats
7e06656f021627fc251d7c71b350492b3a325178
7,917
cpp
C++
test/stkdatatest/ManyRecords.cpp
Aekras1a/YaizuComLib
470d33376add0d448002221b75f7efd40eec506f
[ "MIT" ]
1
2022-01-30T20:17:16.000Z
2022-01-30T20:17:16.000Z
test/stkdatatest/ManyRecords.cpp
Aekras1a/YaizuComLib
470d33376add0d448002221b75f7efd40eec506f
[ "MIT" ]
null
null
null
test/stkdatatest/ManyRecords.cpp
Aekras1a/YaizuComLib
470d33376add0d448002221b75f7efd40eec506f
[ "MIT" ]
null
null
null
#include "../../src/stkpl/StkPl.h" #include "../../src/stkdata/stkdata.h" #include "../../src/stkdata/stkdataapi.h" /* ManyRecords ・WStr(256)×32カラム×16383レコードのテーブルを作成することができる。InsertRecordを16383回繰り返しレコードを追加できる ・既存の[焼津沼津辰口町和泉町中田北白楽]テーブルから10レコードを削除できる。条件として連結されたレコードを指定する ・存在しないカラム名を指定してZaSortRecordを実行したとき,-1が返却される。 */ int ManyRecords() { { StkPlPrintf("Table can be created defined as WStr(256) x 32 columns×16383 records. Records can be inserted 16383 times using InsertRecord."); ColumnDefWStr* ColDef[32]; TableDef LargeTable(L"焼津沼津辰口町和泉町中田北白楽", 16383); for (int i = 0; i < 32; i++) { wchar_t ColName[16]; StkPlSwPrintf(ColName, 16, L"東西南北老若男女焼肉定食愛%d", i); ColDef[i] = new ColumnDefWStr(ColName, 256); LargeTable.AddColumnDef(ColDef[i]); } if (CreateTable(&LargeTable) != 0) { StkPlPrintf("...[NG]\n"); return -1; } for (int i = 0; i < 32; i++) { delete ColDef[i]; } for (int k = 0; k < 16383; k++) { RecordData* RecDat; ColumnData* ColDat[32]; for (int i = 0; i < 32; i++) { wchar_t ColName[16]; wchar_t Val[256] = L""; StkPlSwPrintf(ColName, 16, L"東西南北老若男女焼肉定食愛%d", i); StkPlSwPrintf(Val, 256, L"%d %d :12345", k, i); for (int j = 0; j < 24; j++) { StkPlWcsCat(Val, 256, L"一二三四五六七八九十"); } ColDat[i] = new ColumnDataWStr(ColName, Val); } RecDat = new RecordData(L"焼津沼津辰口町和泉町中田北白楽", ColDat, 32); LockTable(L"焼津沼津辰口町和泉町中田北白楽", 2); if (InsertRecord(RecDat) != 0) { StkPlPrintf("...[NG]\n"); return -1; } UnlockTable(L"焼津沼津辰口町和泉町中田北白楽"); delete RecDat; } StkPlPrintf("...[OK]\n"); } { StkPlPrintf("Records can be acquired from exising table."); LockTable(L"焼津沼津辰口町和泉町中田北白楽", LOCK_SHARE); RecordData* RecDat = GetRecord(L"焼津沼津辰口町和泉町中田北白楽"); UnlockTable(L"焼津沼津辰口町和泉町中田北白楽"); RecordData* CurRecDat = RecDat; StkPlPrintf("Column information can be acquired with column name specification."); do { ColumnDataWStr* ColDat0 = (ColumnDataWStr*)CurRecDat->GetColumn(L"東西南北老若男女焼肉定食愛0"); if (ColDat0 == NULL) { StkPlPrintf("...[NG]\n"); return -1; } wchar_t* ColDat0Value = ColDat0->GetValue(); if (ColDat0Value == NULL || StkPlWcsLen(ColDat0Value) == 0) { StkPlPrintf("...[NG]\n"); return -1; } ColumnDataWStr* ColDat31 = (ColumnDataWStr*)CurRecDat->GetColumn(L"東西南北老若男女焼肉定食愛31"); if (ColDat31 == NULL) { StkPlPrintf("...[NG]\n"); return -1; } wchar_t* ColDat31Value = ColDat0->GetValue(); if (ColDat31Value == NULL || StkPlWcsLen(ColDat31Value) == 0) { StkPlPrintf("...[NG]\n"); return -1; } } while (CurRecDat = CurRecDat->GetNextRecord()); StkPlPrintf("...[OK]\n"); delete RecDat; } { StkPlPrintf("Search records from existing table. Search criteria=WStr:multi+CONTAIN"); ColumnData* ColDat[2]; ColDat[0] = new ColumnDataWStr(L"東西南北老若男女焼肉定食愛2", L"100 2 :"); ColDat[0]->SetComparisonOperator(COMP_CONTAIN); ColDat[1] = new ColumnDataWStr(L"東西南北老若男女焼肉定食愛3", L"100 3 :"); ColDat[1]->SetComparisonOperator(COMP_CONTAIN); RecordData* RecDatSch = new RecordData(L"焼津沼津辰口町和泉町中田北白楽", ColDat, 2); LockTable(L"焼津沼津辰口町和泉町中田北白楽", LOCK_SHARE); RecordData* RecDatRet = GetRecord(RecDatSch); UnlockTable(L"焼津沼津辰口町和泉町中田北白楽"); RecordData* CurRecDat = RecDatRet; do { ColumnDataWStr* ColDat2 = (ColumnDataWStr*)CurRecDat->GetColumn(L"東西南北老若男女焼肉定食愛2"); ColumnDataWStr* ColDat3 = (ColumnDataWStr*)CurRecDat->GetColumn(L"東西南北老若男女焼肉定食愛3"); if (ColDat2 == NULL || ColDat3 == NULL) { StkPlPrintf("...[NG]\n"); return -1; } wchar_t* ColDat0Value2 = ColDat2->GetValue(); wchar_t* ColDat0Value3 = ColDat3->GetValue(); if (StkPlWcsStr(ColDat0Value2, L"100 2 :") == NULL) { StkPlPrintf("...[NG]\n"); return -1; } if (StkPlWcsStr(ColDat0Value3, L"100 3 :") == NULL) { StkPlPrintf("...[NG]\n"); return -1; } } while (CurRecDat = CurRecDat->GetNextRecord()); delete RecDatSch; delete RecDatRet; StkPlPrintf("...[OK]\n"); } { StkPlPrintf("Search records from existing table. Search criteria=WStr:multi+EQUAL(invalid)"); ColumnData* ColDat[1]; ColDat[0] = new ColumnDataWStr(L"東西南北老若男女焼肉定食愛2", L"100 2 :"); ColDat[0]->SetComparisonOperator(COMP_EQUAL); RecordData* RecDatSch = new RecordData(L"焼津沼津辰口町和泉町中田北白楽", ColDat, 1); LockTable(L"焼津沼津辰口町和泉町中田北白楽", LOCK_SHARE); RecordData* RecDatRet = GetRecord(RecDatSch); UnlockTable(L"焼津沼津辰口町和泉町中田北白楽"); if (RecDatRet != NULL) { StkPlPrintf("...[NG]\n"); return -1; } delete RecDatSch; StkPlPrintf("...[OK]\n"); } { StkPlPrintf("Search records from existing table. Search criteria=WStr:multi+NOT CONTAIN"); ColumnData* ColDat[2]; ColDat[0] = new ColumnDataWStr(L"東西南北老若男女焼肉定食愛2", L"100 2 :", COMP_NOT_CONTAIN); ColDat[1] = new ColumnDataWStr(L"東西南北老若男女焼肉定食愛3", L"100 3 :", COMP_NOT_CONTAIN); RecordData* RecDatSch = new RecordData(L"焼津沼津辰口町和泉町中田北白楽", ColDat, 2); LockTable(L"焼津沼津辰口町和泉町中田北白楽", LOCK_SHARE); RecordData* RecDatRet = GetRecord(RecDatSch); UnlockTable(L"焼津沼津辰口町和泉町中田北白楽"); RecordData* CurRecDat = RecDatRet; int NumOfDat = 0; do { ColumnDataWStr* ColDat2 = (ColumnDataWStr*)CurRecDat->GetColumn(L"東西南北老若男女焼肉定食愛2"); ColumnDataWStr* ColDat3 = (ColumnDataWStr*)CurRecDat->GetColumn(L"東西南北老若男女焼肉定食愛3"); if (ColDat2 == NULL || ColDat3 == NULL) { StkPlPrintf("...[NG]\n"); return -1; } wchar_t* ColDat0Value2 = ColDat2->GetValue(); wchar_t* ColDat0Value3 = ColDat3->GetValue(); if (StkPlWcsStr(ColDat0Value2, L"100 2 :") != NULL) { StkPlPrintf("...[NG]\n"); return -1; } if (StkPlWcsStr(ColDat0Value3, L"100 3 :") != NULL) { StkPlPrintf("...[NG]\n"); return -1; } NumOfDat++; } while (CurRecDat = CurRecDat->GetNextRecord()); delete RecDatSch; delete RecDatRet; StkPlPrintf("...%d[OK]\n", NumOfDat); } { StkPlPrintf("Search records from existing table. Search criteria=WStr:multi(invalid)"); ColumnData* ColDat[2]; ColDat[0] = new ColumnDataWStr(L"東西南北老若男女焼肉定食愛2", L"100 2 :", COMP_CONTAIN); ColDat[1] = new ColumnDataWStr(L"東西南北老若男女焼肉定食愛3", L"100 3 :", COMP_NOT_CONTAIN); RecordData* RecDatSch = new RecordData(L"焼津沼津辰口町和泉町中田北白楽", ColDat, 2); LockTable(L"焼津沼津辰口町和泉町中田北白楽", LOCK_SHARE); RecordData* RecDatRet = GetRecord(RecDatSch); UnlockTable(L"焼津沼津辰口町和泉町中田北白楽"); if (RecDatRet != NULL) { StkPlPrintf("...[NG]\n"); return -1; } delete RecDatSch; StkPlPrintf("...[OK]\n"); } { StkPlPrintf("10 records can be acquired from specified table. Connected records are specified."); RecordData* RecDat; RecordData* TopRecDat; RecordData* PrvRecDat; ColumnData* ColDat; for (int i = 0; i < 10; i ++) { wchar_t ColName[16]; wchar_t Val[256] = L""; StkPlSwPrintf(ColName, 16, L"東西南北老若男女焼肉定食愛%d", 0); StkPlSwPrintf(Val, 256, L"%d %d :12345", i, 0); for (int j = 0; j < 24; j++) { StkPlWcsCat(Val, 256, L"一二三四五六七八九十"); } ColDat = new ColumnDataWStr(ColName, Val); RecDat = new RecordData(L"焼津沼津辰口町和泉町中田北白楽", &ColDat, 1); if (i == 0) { TopRecDat = RecDat; } if (i >= 1) { PrvRecDat->SetNextRecord(RecDat); } PrvRecDat = RecDat; } LockTable(L"焼津沼津辰口町和泉町中田北白楽", 2); DeleteRecord(TopRecDat); UnlockTable(L"焼津沼津辰口町和泉町中田北白楽"); delete TopRecDat; if (GetNumOfRecords(L"焼津沼津辰口町和泉町中田北白楽") != 16373) { StkPlPrintf("...[NG]\n"); return -1; } StkPlPrintf("...[OK]\n"); } { StkPlPrintf("-1 is returned if non existing column name is specified to ZaSortRecord."); LockTable(L"焼津沼津辰口町和泉町中田北白楽", LOCK_EXCLUSIVE); if (ZaSortRecord(L"焼津沼津辰口町和泉町中田北白楽", L"aaa") != -1) { StkPlPrintf("...[NG]\n"); return -1; } UnlockTable(L"焼津沼津辰口町和泉町中田北白楽"); StkPlPrintf("...[OK]\n"); } StkPlPrintf("Delete a table which contains large number of records."); if (DeleteTable(L"焼津沼津辰口町和泉町中田北白楽") != 0) { StkPlPrintf("...[NG]\n"); return -1; } StkPlPrintf("...[OK]\n"); return 0; }
31.795181
143
0.662372
Aekras1a
7e0765782b6bd26a518cb85d5d7cc059157aefbb
1,148
hpp
C++
_engine/code/include/global/component/profiler.hpp
Shelim/pixie_engine
bf1d80f3f03bd3d6890f4dfc63440f7dd0ff34a1
[ "MIT" ]
null
null
null
_engine/code/include/global/component/profiler.hpp
Shelim/pixie_engine
bf1d80f3f03bd3d6890f4dfc63440f7dd0ff34a1
[ "MIT" ]
null
null
null
_engine/code/include/global/component/profiler.hpp
Shelim/pixie_engine
bf1d80f3f03bd3d6890f4dfc63440f7dd0ff34a1
[ "MIT" ]
null
null
null
#ifndef ENGINE_GLOBAL_COMPONENT_PROFILER_HPP #define ENGINE_GLOBAL_COMPONENT_PROFILER_HPP #pragma once #include "utility/text/ustring.hpp" namespace engine { class profiler_t { public: virtual ~profiler_t() { } virtual void prof_begin_section(const char * name) { } virtual void prof_end_section() { } virtual void name_current_thread(const ustring_t & name) { } class section_t { public: section_t(std::shared_ptr<profiler_t> profiler, const char * name) : profiler(profiler) { profiler->prof_begin_section(name); } ~section_t() { profiler->prof_end_section(); } private: std::shared_ptr<profiler_t> profiler; }; }; } #define prof_function(profiler) engine::profiler_t::section_t _function_section_at_##__LINE__(profiler, __FUNCTION__) #include "global/component/profiler/dummy.hpp" #include "global/component/profiler/real.hpp" #endif
17.661538
117
0.577526
Shelim
7e086850a54e4560c0bc1ff6f6ab4de9098222e9
2,803
hxx
C++
src/control/genai/c_frontal.hxx
AltSysrq/Abendstern
106e1ad2457f7bfd90080eecf49a33f6079f8e1e
[ "BSD-3-Clause" ]
null
null
null
src/control/genai/c_frontal.hxx
AltSysrq/Abendstern
106e1ad2457f7bfd90080eecf49a33f6079f8e1e
[ "BSD-3-Clause" ]
null
null
null
src/control/genai/c_frontal.hxx
AltSysrq/Abendstern
106e1ad2457f7bfd90080eecf49a33f6079f8e1e
[ "BSD-3-Clause" ]
1
2022-01-29T11:54:41.000Z
2022-01-29T11:54:41.000Z
/** * @file * @author Jason Lingle * @brief Contains the FrontalCortex */ /* * c_frontal.hxx * * Created on: 02.11.2011 * Author: jason */ #ifndef C_FRONTAL_HXX_ #define C_FRONTAL_HXX_ #include "src/sim/objdl.hxx" #include "cortex.hxx" #include "ci_nil.hxx" #include "ci_self.hxx" #include "ci_objective.hxx" class GameObject; class Ship; /** * The FrontalCortex examines possible objectives and returns the one * given the highest score. * * All FrontalCortices maintain a global telepathy map of * (insignia,objective) --> cortices... */ class FrontalCortex: public Cortex, private cortex_input::Self <cortex_input::Objective <cortex_input::Nil> > { Ship*const ship; ObjDL objective; float objectiveScore; //Telepathy output const float distanceParm, scoreWeightParm, dislikeWeightParm, happyWeightParm; //The last known insignia of the ship //(Specifically, the insignia when we inserted ourselves // into the global map). //0 indicates not inserted unsigned long insertedInsignia; //The GameObject* used to insert us into the global map. //This may be a dangling pointer, never dereference GameObject* insertedObjective; //Milliseconds until the next scan float timeUntilRescan; //Add the opriority, ocurr, and otel inputs static const unsigned cipe_last = cip_last+3, cip_opriority = cip_last, cip_ocurr = cip_last+1, cip_otel = cip_last+2; enum Output { target = 0 }; static const unsigned numOutputs = 1+(unsigned)target; public: class input_map: public cip_input_map { public: input_map() { ins("opriority", cip_opriority); ins("ocurr", cip_ocurr); ins("otel", cip_otel); } }; /** Gives instructions on how to proceed */ struct Directive { /** The objective to persue. * If NULL, park. */ GameObject* objective; /** What to do to the objective. */ enum Mode { Attack, /// Proceed with the attack series of cortices Navigate /// Phoceed with the Navigation cortex } mode; }; /** * Constructs a new SelfSource. * @param species The root of the species data to read from * @param s The Ship to operate on * @param ss The SelfSource to use */ FrontalCortex(const libconfig::Setting& species, Ship* s, cortex_input::SelfSource* ss); ~FrontalCortex(); /** * Evaluates the cortex and returns its decision, given te elapsed time. */ Directive evaluate(float); /** Returns the score of the cortex. */ float getScore() const; private: //Remove from global multimap if inserted void unmap(); //Insert to global multimap; //if inserted, unmap first. //Does nothing if no objective. void mapins(); }; #endif /* C_FRONTAL_HXX_ */
24.80531
90
0.674278
AltSysrq
7e0960ec09e3cb190439b783fe4f7141de760acb
2,479
cpp
C++
Infinit/src/Platform/OpenGL/OpenGLFrameBuffer.cpp
J4m3s00/Infinit
dd877100f8529e4a97c13f0d179b356800ef2eb9
[ "Apache-2.0" ]
null
null
null
Infinit/src/Platform/OpenGL/OpenGLFrameBuffer.cpp
J4m3s00/Infinit
dd877100f8529e4a97c13f0d179b356800ef2eb9
[ "Apache-2.0" ]
6
2019-07-03T14:21:06.000Z
2019-12-22T12:37:56.000Z
Infinit/src/Platform/OpenGL/OpenGLFrameBuffer.cpp
J4m3s00/Infinit
dd877100f8529e4a97c13f0d179b356800ef2eb9
[ "Apache-2.0" ]
null
null
null
#include "inpch.h" namespace Infinit { OpenGLFrameBuffer::OpenGLFrameBuffer(uint width, uint height, FramebufferFormat format) : m_Format(format), m_Width(0), m_Height(0), m_RendererID(0) { Resize(width, height); } OpenGLFrameBuffer::~OpenGLFrameBuffer() { } void OpenGLFrameBuffer::Resize(uint width, uint height) { if (width == m_Width && height == m_Height) return; m_Width = width; m_Height = height; if (m_RendererID) { IN_RENDER_S({ glDeleteFramebuffers(1, &self->m_RendererID); glDeleteTextures(1, &self->m_ColorAttachment); glDeleteTextures(1, &self->m_DepthAttachment); }) } IN_RENDER_S({ glGenFramebuffers(1, &self->m_RendererID); glBindFramebuffer(GL_FRAMEBUFFER, self->m_RendererID); glGenTextures(1, &self->m_ColorAttachment); glBindTexture(GL_TEXTURE_2D, self->m_ColorAttachment); if (self->m_Format == FramebufferFormat::RGBA16F) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, self->m_Width, self->m_Height, 0, GL_RGBA, GL_FLOAT, nullptr); } else if (self->m_Format == FramebufferFormat::RGBA8) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, self->m_Width, self->m_Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); } glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, self->m_ColorAttachment, 0); glGenTextures(1, &self->m_DepthAttachment); glBindTexture(GL_TEXTURE_2D, self->m_DepthAttachment); glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, self->m_Width, self->m_Height, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, NULL); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, self->m_DepthAttachment, 0); if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) IN_CORE_ERROR("Framebuffer is incomplete!"); glBindFramebuffer(GL_FRAMEBUFFER, 0); }) } void OpenGLFrameBuffer::Bind() const { IN_RENDER_S({ glBindFramebuffer(GL_FRAMEBUFFER, self->m_RendererID); glViewport(0, 0, self->m_Width, self->m_Height); }) } void OpenGLFrameBuffer::Unbind() const { IN_RENDER({ glBindFramebuffer(GL_FRAMEBUFFER, 0); }) } void OpenGLFrameBuffer::BindTexture(uint slot) const { IN_RENDER_S1(slot, { glActiveTexture(GL_TEXTURE0 + slot); glBindTexture(GL_TEXTURE_2D, self->m_ColorAttachment); }) } }
28.170455
135
0.736587
J4m3s00
7e1a088a7797a422fe47eb3c8731608f189a1c84
3,975
cpp
C++
Firmware/Src/io/lcd/LcdDriver.cpp
borgu/midi-grid
ce65669f55d5d5598a8ff185debcec76ab001bfa
[ "BSD-3-Clause" ]
null
null
null
Firmware/Src/io/lcd/LcdDriver.cpp
borgu/midi-grid
ce65669f55d5d5598a8ff185debcec76ab001bfa
[ "BSD-3-Clause" ]
null
null
null
Firmware/Src/io/lcd/LcdDriver.cpp
borgu/midi-grid
ce65669f55d5d5598a8ff185debcec76ab001bfa
[ "BSD-3-Clause" ]
null
null
null
#include "io/lcd/LcdDriver.hpp" #include "system/gpio_definitions.h" #include "stm32f4xx_hal.h" namespace lcd { static DMA_HandleTypeDef lcdSpiDma; static SPI_HandleTypeDef lcdSpi; extern "C" void DMA1_Stream4_IRQHandler() { HAL_DMA_IRQHandler(&lcdSpiDma); } LcdDriver::LcdDriver() { } LcdDriver::~LcdDriver() { } void LcdDriver::initialize() { initializeGpio(); initializeSpi(); initializeDma(); resetController(); writeCommand( 0x21 ); // LCD extended commands. writeCommand( 0xB8 ); // set LCD Vop(Contrast). writeCommand( 0x04 ); // set temp coefficent. writeCommand( 0x15 ); // LCD bias mode 1:65. used to be 0x14 - 1:40 writeCommand( 0x20 ); // LCD basic commands. writeCommand( 0x0C ); // LCD normal. } void LcdDriver::transmit( uint8_t* const buffer ) { setCursor( 0, 0 ); while (HAL_DMA_STATE_BUSY == HAL_DMA_GetState( &lcdSpiDma )) { // wait until previous transfer is done } HAL_GPIO_WritePin( mcu::LCD_GPIO_Port, mcu::DC_Pin, GPIO_PIN_SET ); //data mode HAL_SPI_Transmit_DMA( &lcdSpi, &buffer[0], bufferSize ); } void LcdDriver::initializeDma() { __HAL_RCC_DMA1_CLK_ENABLE(); // SPI2 DMA Init // SPI2_TX Init lcdSpiDma.Instance = DMA1_Stream4; lcdSpiDma.Init.Channel = DMA_CHANNEL_0; lcdSpiDma.Init.Direction = DMA_MEMORY_TO_PERIPH; lcdSpiDma.Init.PeriphInc = DMA_PINC_DISABLE; lcdSpiDma.Init.MemInc = DMA_MINC_ENABLE; lcdSpiDma.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; lcdSpiDma.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; lcdSpiDma.Init.Mode = DMA_NORMAL; lcdSpiDma.Init.Priority = DMA_PRIORITY_LOW; lcdSpiDma.Init.FIFOMode = DMA_FIFOMODE_DISABLE; HAL_DMA_Init( &lcdSpiDma ); __HAL_LINKDMA( &lcdSpi, hdmatx, lcdSpiDma ); // DMA interrupt init // DMA1_Stream4_IRQn interrupt configuration HAL_NVIC_SetPriority( DMA1_Stream4_IRQn, 6, 0 ); HAL_NVIC_EnableIRQ( DMA1_Stream4_IRQn ); } void LcdDriver::initializeGpio() { static GPIO_InitTypeDef gpioConfiguration; __HAL_RCC_GPIOB_CLK_ENABLE(); gpioConfiguration.Pin = mcu::DC_Pin | mcu::RESET_Pin; gpioConfiguration.Mode = GPIO_MODE_OUTPUT_PP; gpioConfiguration.Pull = GPIO_NOPULL; gpioConfiguration.Speed = GPIO_SPEED_FREQ_VERY_HIGH; HAL_GPIO_Init( mcu::LCD_GPIO_Port, &gpioConfiguration ); gpioConfiguration.Pin = mcu::CS_Pin | mcu::SCK_Pin | mcu::MOSI_Pin; gpioConfiguration.Mode = GPIO_MODE_AF_PP; gpioConfiguration.Alternate = GPIO_AF5_SPI2; HAL_GPIO_Init( mcu::LCD_GPIO_Port, &gpioConfiguration ); } void LcdDriver::initializeSpi() { __HAL_RCC_SPI2_CLK_ENABLE(); // SPI2 parameter configuration lcdSpi.Instance = SPI2; lcdSpi.Init.Mode = SPI_MODE_MASTER; lcdSpi.Init.Direction = SPI_DIRECTION_2LINES; lcdSpi.Init.DataSize = SPI_DATASIZE_8BIT; lcdSpi.Init.CLKPolarity = SPI_POLARITY_LOW; lcdSpi.Init.CLKPhase = SPI_PHASE_1EDGE; lcdSpi.Init.NSS = SPI_NSS_HARD_OUTPUT; lcdSpi.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_32; // 3MBbit? lcdSpi.Init.FirstBit = SPI_FIRSTBIT_MSB; lcdSpi.Init.TIMode = SPI_TIMODE_DISABLE; lcdSpi.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; HAL_SPI_Init( &lcdSpi ); } void LcdDriver::resetController() { HAL_GPIO_WritePin( mcu::LCD_GPIO_Port, mcu::RESET_Pin, GPIO_PIN_RESET ); HAL_GPIO_WritePin( mcu::LCD_GPIO_Port, mcu::RESET_Pin, GPIO_PIN_SET ); } void LcdDriver::setCursor( const uint8_t x, const uint8_t y ) { writeCommand( 0x80 | x ); // column. writeCommand( 0x40 | y ); // row. } void LcdDriver::writeCommand( const uint8_t command ) { uint8_t commandToWrite = command; while (HAL_DMA_STATE_BUSY == HAL_DMA_GetState( &lcdSpiDma )) { // wait until previous transfer is done } HAL_GPIO_WritePin( mcu::LCD_GPIO_Port, mcu::DC_Pin, GPIO_PIN_RESET ); //command mode HAL_SPI_Transmit_DMA( &lcdSpi, &commandToWrite, 1 ); } } // namespace lcd
27.797203
88
0.720755
borgu
7e1ae4aa4ceb168d6d7f5a29b2f60d26b7096f1f
9,157
cpp
C++
Source/dvlnet/tcp_server.cpp
pionere/devilutionX
63f8deb298a00b040010fc299c0568eae19522e1
[ "Unlicense" ]
2
2021-02-02T19:27:20.000Z
2022-03-07T16:50:55.000Z
Source/dvlnet/tcp_server.cpp
pionere/devilutionX
63f8deb298a00b040010fc299c0568eae19522e1
[ "Unlicense" ]
null
null
null
Source/dvlnet/tcp_server.cpp
pionere/devilutionX
63f8deb298a00b040010fc299c0568eae19522e1
[ "Unlicense" ]
1
2022-03-07T16:51:16.000Z
2022-03-07T16:51:16.000Z
#include "tcp_server.h" #ifdef TCPIP #include <chrono> #include <memory> #include "base.h" DEVILUTION_BEGIN_NAMESPACE namespace net { tcp_server::tcp_server(asio::io_context &ioc, buffer_t info, unsigned srvType) : ioc(ioc) , acceptor(ioc) , connTimer(ioc) , game_init_info(info) , serverType(srvType) { assert(game_init_info.size() == sizeof(SNetGameData)); } bool tcp_server::setup_server(const char* bindAddr, unsigned short port, const char* passwd) { pktfty.setup_password(passwd); asio::error_code err; auto addr = asio::ip::address::from_string(bindAddr, err); if (!err) { auto ep = asio::ip::tcp::endpoint(addr, port); connect_acceptor(acceptor, ep, err); } if (err) { SDL_SetError("%s", err.message().c_str()); close(); return false; } start_accept(); start_timeout(); return true; } void tcp_server::connect_acceptor(asio::ip::tcp::acceptor &acceptor, const asio::ip::tcp::endpoint& ep, asio::error_code &ec) { acceptor.open(ep.protocol(), ec); if (ec) return; acceptor.set_option(asio::socket_base::reuse_address(true), ec); assert(!ec); acceptor.bind(ep, ec); if (ec) return; acceptor.listen(2 * MAX_PLRS, ec); } void tcp_server::connect_socket(asio::ip::tcp::socket &sock, const char* addrstr, unsigned port, asio::io_context &ioc, asio::error_code &ec) { std::string strPort = std::to_string(port); auto resolver = asio::ip::tcp::resolver(ioc); auto addrList = resolver.resolve(addrstr, strPort, ec); if (ec) return; asio::connect(sock, addrList, ec); if (ec) return; asio::ip::tcp::no_delay option(true); sock.set_option(option, ec); assert(!ec); } void tcp_server::endpoint_to_string(const scc &con, std::string &addr) { asio::error_code err; const auto &ep = con->socket.remote_endpoint(err); assert(!err); char buf[PORT_LENGTH + 2]; snprintf(buf, sizeof(buf), ":%05d", ep.port()); addr = ep.address().to_string(); addr.append(buf); } void tcp_server::make_default_gamename(char (&gamename)[128]) { if (!getIniValue("Network", "Bind Address", gamename, sizeof(gamename) - 1)) { copy_cstr(gamename, "127.0.0.1"); //SStrCopy(gamename, asio::ip::address_v4::loopback().to_string().c_str(), sizeof(gamename)); } } tcp_server::scc tcp_server::make_connection(asio::io_context &ioc) { return std::make_shared<client_connection>(ioc); } plr_t tcp_server::next_free_conn() { plr_t i; for (i = 0; i < MAX_PLRS; i++) if (connections[i] == NULL) break; return i < ((SNetGameData*)game_init_info.data())->bMaxPlayers ? i : MAX_PLRS; } plr_t tcp_server::next_free_queue() { plr_t i; for (i = 0; i < MAX_PLRS; i++) if (pending_connections[i] == NULL) break; return i; } void tcp_server::start_recv(const scc &con) { con->socket.async_receive(asio::buffer(con->recv_buffer), std::bind(&tcp_server::handle_recv, this, con, std::placeholders::_1, std::placeholders::_2)); } void tcp_server::handle_recv(const scc &con, const asio::error_code &ec, size_t bytesRead) { if (ec || bytesRead == 0) { drop_connection(con); return; } con->timeout = TIMEOUT_ACTIVE; con->recv_buffer.resize(bytesRead); con->recv_queue.write(std::move(con->recv_buffer)); con->recv_buffer.resize(frame_queue::MAX_FRAME_SIZE); while (con->recv_queue.packet_ready()) { auto pkt = pktfty.make_in_packet(con->recv_queue.read_packet()); if (pkt == NULL || !handle_recv_packet(con, *pkt)) { drop_connection(con); return; } } start_recv(con); } /*void tcp_server::send_connect(const scc &con) { auto pkt = pktfty.make_out_packet<PT_CONNECT>(PLR_MASTER, PLR_BROADCAST, con->pnum); send_packet(*pkt); }*/ bool tcp_server::handle_recv_newplr(const scc &con, packet &pkt) { plr_t i, pnum; if (pkt.pktType() != PT_JOIN_REQUEST) { // SDL_Log("Invalid join packet."); return false; } pnum = next_free_conn(); for (i = 0; i < MAX_PLRS; i++) { if (pending_connections[i] == con) break; } if (pnum == MAX_PLRS || i == MAX_PLRS) { // SDL_Log(pnum == MAX_PLRS ? "Server is full." : "Dropped connection."); return false; } pending_connections[i] = NULL; connections[pnum] = con; con->pnum = pnum; auto reply = pktfty.make_out_packet<PT_JOIN_ACCEPT>(PLR_MASTER, PLR_BROADCAST, pkt.pktJoinReqCookie(), pnum, game_init_info); start_send(con, *reply); //send_connect(con); if (serverType == SRV_DIRECT) { std::string addr; for (i = 0; i < MAX_PLRS; i++) { if (connections[i] != NULL && connections[i] != con) { endpoint_to_string(connections[i], addr); auto oldConPkt = pktfty.make_out_packet<PT_CONNECT>(PLR_MASTER, PLR_BROADCAST, i, buffer_t(addr.begin(), addr.end())); start_send(con, *oldConPkt); } } } return true; } bool tcp_server::handle_recv_packet(const scc &con, packet &pkt) { if (con->pnum != PLR_BROADCAST) { return con->pnum == pkt.pktSrc() && send_packet(pkt); } else { return handle_recv_newplr(con, pkt); } } bool tcp_server::send_packet(packet &pkt) { plr_t dest = pkt.pktDest(); plr_t src = pkt.pktSrc(); if (dest == PLR_BROADCAST) { for (int i = 0; i < MAX_PLRS; i++) if (i != src && connections[i] != NULL) start_send(connections[i], pkt); } else { if (dest >= MAX_PLRS) { // SDL_Log("Invalid destination %d", dest); return false; } if ((dest != src) && connections[dest] != NULL) start_send(connections[dest], pkt); } return true; } void tcp_server::start_send(const scc &con, packet &pkt) { const auto *frame = new buffer_t(frame_queue::make_frame(pkt.encrypted_data())); auto buf = asio::buffer(*frame); asio::async_write(con->socket, buf, [frame](const asio::error_code &ec, size_t bytesSent) { delete frame; }); } void tcp_server::start_accept() { if (next_free_queue() != MAX_PLRS) { nextcon = make_connection(ioc); acceptor.async_accept(nextcon->socket, std::bind(&tcp_server::handle_accept, this, true, std::placeholders::_1)); } else { nextcon = NULL; connTimer.expires_after(std::chrono::seconds(10)); connTimer.async_wait(std::bind(&tcp_server::handle_accept, this, false, std::placeholders::_1)); } } void tcp_server::handle_accept(bool valid, const asio::error_code &ec) { if (ec) return; if (valid) { asio::error_code err; asio::ip::tcp::no_delay option(true); nextcon->socket.set_option(option, err); assert(!err); nextcon->timeout = TIMEOUT_CONNECT; pending_connections[next_free_queue()] = nextcon; start_recv(nextcon); } start_accept(); } void tcp_server::start_timeout() { connTimer.expires_after(std::chrono::seconds(1)); connTimer.async_wait(std::bind(&tcp_server::handle_timeout, this, std::placeholders::_1)); } void tcp_server::handle_timeout(const asio::error_code &ec) { int i, n; if (ec) return; scc expired_connections[2 * MAX_PLRS] = { }; n = 0; for (i = 0; i < MAX_PLRS; i++) { if (pending_connections[i] != NULL) { if (pending_connections[i]->timeout > 0) { pending_connections[i]->timeout--; } else { expired_connections[n] = pending_connections[i]; n++; } } } for (i = 0; i < MAX_PLRS; i++) { if (connections[i] != NULL) { if (connections[i]->timeout > 0) { connections[i]->timeout--; } else { expired_connections[n] = connections[i]; n++; } } } for (i = 0; i < n; i++) drop_connection(expired_connections[i]); start_timeout(); } void tcp_server::drop_connection(const scc &con) { plr_t i, pnum = con->pnum; if (pnum != PLR_BROADCAST) { // live connection if (connections[pnum] == con) { connections[pnum] = NULL; // notify the other clients auto pkt = pktfty.make_out_packet<PT_DISCONNECT>(PLR_MASTER, PLR_BROADCAST, pnum, (leaveinfo_t)LEAVE_DROP); send_packet(*pkt); } } else { // pending connection for (i = 0; i < MAX_PLRS; i++) { if (pending_connections[i] == con) { pending_connections[i] = NULL; } } } asio::error_code err; con->socket.close(err); } void tcp_server::close() { int i; asio::error_code err; if (acceptor.is_open()) { auto pkt = pktfty.make_out_packet<PT_DISCONNECT>(PLR_MASTER, PLR_BROADCAST, PLR_MASTER, (leaveinfo_t)LEAVE_DROP); send_packet(*pkt); ioc.poll(err); err.clear(); } acceptor.close(err); err.clear(); connTimer.cancel(err); err.clear(); ioc.poll(err); err.clear(); if (nextcon != NULL) { nextcon->socket.close(err); err.clear(); } for (i = 0; i < MAX_PLRS; i++) { if (connections[i] != NULL) { connections[i]->socket.shutdown(asio::socket_base::shutdown_both, err); err.clear(); connections[i]->socket.close(err); err.clear(); } } for (i = 0; i < MAX_PLRS; i++) { if (pending_connections[i] != NULL) { pending_connections[i]->socket.close(err); err.clear(); } } ioc.poll(err); } } // namespace net DEVILUTION_END_NAMESPACE #endif // TCPIP
24.748649
96
0.642569
pionere
7e1b2f410e7f84f5311dea12c79674b57900bc0a
758
cpp
C++
cpp/BalancedBinaryTree.cpp
thinksource/code_interview
08be992240508b73894eaf6b8c025168fd19df19
[ "Apache-2.0" ]
12
2015-03-12T03:27:26.000Z
2021-03-11T09:26:16.000Z
cpp/BalancedBinaryTree.cpp
thinksource/code_interview
08be992240508b73894eaf6b8c025168fd19df19
[ "Apache-2.0" ]
null
null
null
cpp/BalancedBinaryTree.cpp
thinksource/code_interview
08be992240508b73894eaf6b8c025168fd19df19
[ "Apache-2.0" ]
11
2015-01-28T16:45:40.000Z
2017-03-28T20:01:38.000Z
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: bool isBalanced(TreeNode *root) { int h = 0; return isBalanced(root, h); } bool isBalanced(TreeNode* root, int& height) { if(root==NULL) { height = 0; return true; } int heightLeft = 0; int heightRight = 0; bool isBLeft = isBalanced(root->left, heightLeft); bool isBRight = isBalanced(root->right, heightRight); height = 1+max(heightLeft, heightRight); return abs(heightLeft-heightRight)<=1 && isBLeft && isBRight; } };
25.266667
69
0.555409
thinksource
7e1be89d5ebd582653ffef7f21993d81a14d0ab8
5,033
cpp
C++
gui/statuses/LocalStatuses.cpp
mail-ru-im/im-desktop
d6bb606650ad84b31046fe39b81db1fec4e6050b
[ "Apache-2.0" ]
81
2019-09-18T13:53:17.000Z
2022-03-19T00:44:20.000Z
gui/statuses/LocalStatuses.cpp
mail-ru-im/im-desktop
d6bb606650ad84b31046fe39b81db1fec4e6050b
[ "Apache-2.0" ]
4
2019-10-03T15:17:00.000Z
2019-11-03T01:05:41.000Z
gui/statuses/LocalStatuses.cpp
mail-ru-im/im-desktop
d6bb606650ad84b31046fe39b81db1fec4e6050b
[ "Apache-2.0" ]
25
2019-09-27T16:56:02.000Z
2022-03-14T07:11:14.000Z
#include "stdafx.h" #include "utils/JsonUtils.h" #include "../utils/features.h" #include "LocalStatuses.h" #include "gui_settings.h" #include "utils/utils.h" #include "utils/InterConnector.h" #include "rapidjson/writer.h" namespace { inline QString getDefaultJSONPath() { return (Ui::get_gui_settings()->get_value(settings_language, QString()) == u"ru") ? qsl(":/statuses/default_statuses") : qsl(":/statuses/default_statuses_eng"); } std::vector<Statuses::LocalStatus> defaultStatuses() { std::vector<Statuses::LocalStatus> statuses; rapidjson::Document doc; doc.Parse(Features::getStatusJson()); if (doc.HasParseError()) { im_assert(QFile::exists(getDefaultJSONPath())); QFile file(getDefaultJSONPath()); if (!file.open(QFile::ReadOnly | QFile::Text)) return statuses; const auto json = file.readAll(); doc.Parse(json.constData(), json.size()); if (doc.HasParseError()) { im_assert(false); return statuses; } file.close(); } if (doc.IsArray()) { statuses.reserve(doc.Size()); for (const auto& item : doc.GetArray()) { Statuses::LocalStatus status; JsonUtils::unserialize_value(item, "status", status.status_); JsonUtils::unserialize_value(item, "text", status.description_); JsonUtils::unserialize_value(item, "duration", status.duration_); statuses.push_back(std::move(status)); } } return statuses; } } namespace Statuses { using namespace Ui; class LocalStatuses_p { public: void updateIndex() { index_.clear(); for (auto i = 0u; i < statuses_.size(); i++) index_[statuses_[i].status_] = i; } void overrideStatusDurationsFromSettings() { for (auto& status : statuses_) { if (get_gui_settings()->contains_value(status_duration, status.status_)) status.duration_ = std::chrono::seconds(get_gui_settings()->get_value<int64_t>(status_duration, 0, status.status_)); } } void load() { statuses_ = defaultStatuses(); migrateOldSettingsData(); overrideStatusDurationsFromSettings(); updateIndex(); } void resetToDefaults() { statuses_ = defaultStatuses(); updateIndex(); } void migrateOldSettingsData() { const auto statusesStr = get_gui_settings()->get_value<QString>(statuses_user_statuses, QString()); const auto statuses = statusesStr.splitRef(ql1c(';'), QString::SkipEmptyParts); for (const auto& s : boost::adaptors::reverse(statuses)) { const auto& stat = s.split(ql1c(':'), QString::SkipEmptyParts); if (!stat.isEmpty() && stat.size() == 2) get_gui_settings()->set_value<int64_t>(status_duration, stat[1].toLongLong(), stat[0].toString()); } get_gui_settings()->set_value(statuses_user_statuses, QString()); } std::vector<LocalStatus> statuses_; std::unordered_map<QString, size_t, Utils::QStringHasher> index_; }; LocalStatuses::LocalStatuses() : d(std::make_unique<LocalStatuses_p>()) { d->load(); connect(&Utils::InterConnector::instance(), &Utils::InterConnector::omicronUpdated, this, &LocalStatuses::onOmicronUpdated); } LocalStatuses::~LocalStatuses() = default; LocalStatuses* LocalStatuses::instance() { static LocalStatuses localStatuses; return &localStatuses; } const LocalStatus& LocalStatuses::getStatus(const QString& _statusCode) const { auto it = d->index_.find(_statusCode); if (it != d->index_.end()) return d->statuses_[it->second]; static LocalStatus empty; return empty; } void LocalStatuses::setDuration(const QString& _statusCode, std::chrono::seconds _duration) { auto it = d->index_.find(_statusCode); if (it != d->index_.end()) { d->statuses_[it->second].duration_ = _duration; get_gui_settings()->set_value<int64_t>(status_duration, _duration.count(), _statusCode); } } std::chrono::seconds LocalStatuses::statusDuration(const QString& _statusCode) const { auto it = d->index_.find(_statusCode); if (it != d->index_.end()) return d->statuses_[it->second].duration_; return std::chrono::seconds::zero(); } const QString& LocalStatuses::statusDescription(const QString& _statusCode) const { auto it = d->index_.find(_statusCode); if (it != d->index_.end()) return d->statuses_[it->second].description_; static QString empty; return empty; } const std::vector<LocalStatus>& LocalStatuses::statuses() const { return d->statuses_; } void LocalStatuses::resetToDefaults() { d->resetToDefaults(); } void LocalStatuses::onOmicronUpdated() { d->load(); } }
25.943299
168
0.622293
mail-ru-im
7e1caedc68709129a2d488241201b6042bf4625e
1,608
cpp
C++
Native/Framework/source/Library.Shared/SpriteManager.cpp
btrowbridge/DirectX.2D.Bespoke.Games
382728f7c9d50597f9fc84e222efd468c33716a5
[ "MS-PL" ]
null
null
null
Native/Framework/source/Library.Shared/SpriteManager.cpp
btrowbridge/DirectX.2D.Bespoke.Games
382728f7c9d50597f9fc84e222efd468c33716a5
[ "MS-PL" ]
null
null
null
Native/Framework/source/Library.Shared/SpriteManager.cpp
btrowbridge/DirectX.2D.Bespoke.Games
382728f7c9d50597f9fc84e222efd468c33716a5
[ "MS-PL" ]
null
null
null
#include "pch.h" #include "SpriteManager.h" using namespace std; using namespace DirectX; namespace Library { unique_ptr<SpriteManager> SpriteManager::sInstance; SpriteManager::SpriteManager(Game& game) : mGame(&game), mSpriteBatch(make_shared<DirectX::SpriteBatch>(mGame->Direct3DDeviceContext())) { } shared_ptr<SpriteBatch> SpriteManager::SpriteBatch() { return sInstance->mSpriteBatch; } void SpriteManager::Initialize(Game& game) { sInstance = unique_ptr<SpriteManager>(new SpriteManager(game)); } void SpriteManager::Shutdown() { sInstance = nullptr; } void SpriteManager::DrawTexture2D(ID3D11ShaderResourceView* texture, const XMFLOAT2& position, FXMVECTOR color) { assert(sInstance != nullptr); sInstance->mSpriteBatch->Begin(); sInstance->mSpriteBatch->Draw(texture, position, color); sInstance->mSpriteBatch->End(); } void SpriteManager::DrawTexture2D(ID3D11ShaderResourceView* texture, const Rectangle& destinationRectangle, FXMVECTOR color) { assert(sInstance != nullptr); sInstance->mSpriteBatch->Begin(); RECT destinationRect = { destinationRectangle.X, destinationRectangle.Y, destinationRectangle.Width, destinationRectangle.Height }; sInstance->mSpriteBatch->Draw(texture, destinationRect, color); sInstance->mSpriteBatch->End(); } void SpriteManager::DrawString(shared_ptr<SpriteFont> font, const wstring& text, const XMFLOAT2& textPosition) { assert(sInstance != nullptr); sInstance->mSpriteBatch->Begin(); font->DrawString(sInstance->mSpriteBatch.get(), text.c_str(), textPosition); sInstance->mSpriteBatch->End(); } }
27.724138
133
0.75995
btrowbridge
7e1dbbe5a0decdaec568540334ac2b00e0186796
5,991
cpp
C++
JNIManagedPeer.cpp
jessebenson/JNIManagedPeerBase
7188fc75ecd2010901c9baf98436e7f16eb488b2
[ "MIT" ]
null
null
null
JNIManagedPeer.cpp
jessebenson/JNIManagedPeerBase
7188fc75ecd2010901c9baf98436e7f16eb488b2
[ "MIT" ]
null
null
null
JNIManagedPeer.cpp
jessebenson/JNIManagedPeerBase
7188fc75ecd2010901c9baf98436e7f16eb488b2
[ "MIT" ]
1
2019-01-03T12:34:01.000Z
2019-01-03T12:34:01.000Z
/* * The MIT License (MIT) * * Copyright (c) 2014 Jesse Benson * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "stdafx.h" #include "JNIManagedPeer.h" namespace JNI { static JavaVM* s_JVM = nullptr; void STDMETHODCALLTYPE SetJVM(JavaVM* jvm) { s_JVM = jvm; } JavaVM* STDMETHODCALLTYPE GetJVM() { return s_JVM; } static JNIEnv* GetEnvironment() { JNIEnv* env = nullptr; if (s_JVM != nullptr) s_JVM->AttachCurrentThread(reinterpret_cast<void**>(&env), nullptr); return env; } JNIEnv& STDMETHODCALLTYPE GetEnv() { return *GetEnvironment(); } JObject::JObject() { } JObject::JObject(jobject object, bool releaseLocalRef) { JNIEnv* env = GetEnvironment(); AttachObject(env, object); if (releaseLocalRef) { env->DeleteLocalRef(object); } } JObject::JObject(const JObject& object) { AttachObject(GetEnvironment(), object.m_Object); } JObject::JObject(JObject&& object) : m_Object(object.m_Object) { object.m_Object = nullptr; } JObject::~JObject() { ReleaseObject(GetEnvironment()); } JObject& JObject::operator=(jobject object) { JNIEnv* env = GetEnvironment(); ReleaseObject(env); AttachObject(env, object); return *this; } JObject& JObject::operator=(const JObject& object) { if (this != &object) { JNIEnv* env = GetEnvironment(); ReleaseObject(env); AttachObject(env, object.m_Object); } return *this; } JObject& JObject::operator=(JObject&& object) { if (this != &object) { ReleaseObject(GetEnvironment()); m_Object = object.m_Object; object.m_Object = nullptr; } return *this; } void JObject::AttachObject(JNIEnv* env, jobject object) { if (object != nullptr) { m_Object = env->NewGlobalRef(object); } } void JObject::ReleaseObject(JNIEnv* env) { if (m_Object != nullptr) { env->DeleteGlobalRef(m_Object); m_Object = nullptr; } } void JObject::AttachLocalObject(JNIEnv* env, jobject object) { if (object != nullptr) { m_Object = env->NewGlobalRef(object); env->DeleteLocalRef(object); } } JClass::JClass(const char* className) : JObject(GetEnvironment()->FindClass(className), /*deleteLocalRef:*/ true) { } JClass::~JClass() { } JString::JString(jstring string, bool removeLocalRef) : JObject(string, removeLocalRef) { } JString::JString(const char* content) { JNIEnv* env = GetEnvironment(); AttachLocalObject(env, env->NewStringUTF(content)); } JString::JString(const wchar_t* content) { JNIEnv* env = GetEnvironment(); AttachLocalObject(env, env->NewString((const jchar *)content, wcslen(content))); } JString::~JString() { Clear(); } const char* JString::GetUTFString() const { if (m_pString == nullptr) { // Logically, this method doesn't change the JString const_cast<JString*>(this)->m_pString = GetEnvironment()->GetStringUTFChars(String(), nullptr); } return m_pString; } int JString::GetUTFLength() const { return (int)GetEnvironment()->GetStringUTFLength(String()); } const wchar_t* JString::GetStringChars() const { if (m_pWString == nullptr) { // Logically, this method doesn't change the JString const_cast<JString*>(this)->m_pWString = (const wchar_t*)GetEnvironment()->GetStringChars(String(), nullptr); } return m_pWString; } int JString::GetLength() const { return (int)GetEnvironment()->GetStringLength(String()); } void JString::Clear() { if (m_pString != nullptr && String() != nullptr) { GetEnvironment()->ReleaseStringUTFChars(String(), m_pString); m_pString = nullptr; } if (m_pWString != nullptr && String() != nullptr) { GetEnvironment()->ReleaseStringChars(String(), (const jchar*)m_pWString); m_pWString = nullptr; } } ManagedPeer::ManagedPeer() : m_Object(nullptr) { } ManagedPeer::ManagedPeer(jobject object) : m_Object(object) { } ManagedPeer::~ManagedPeer() { } ManagedPeer& ManagedPeer::operator=(jobject obj) { m_Object = obj; return *this; } JNIEnv& ManagedPeer::Env() { return *GetEnvironment(); } } // namespace JNI
24.157258
121
0.59122
jessebenson
7e2ee7a99267f610e6b03bd97bb9fb7424d661bc
13,599
cpp
C++
src/plugins/summary/summarywidget.cpp
devel29a/leechcraft
faf5e856010fb785e4bbf3ce7b5c6a5c49f3239a
[ "BSL-1.0" ]
null
null
null
src/plugins/summary/summarywidget.cpp
devel29a/leechcraft
faf5e856010fb785e4bbf3ce7b5c6a5c49f3239a
[ "BSL-1.0" ]
null
null
null
src/plugins/summary/summarywidget.cpp
devel29a/leechcraft
faf5e856010fb785e4bbf3ce7b5c6a5c49f3239a
[ "BSL-1.0" ]
null
null
null
/********************************************************************** * LeechCraft - modular cross-platform feature rich internet client. * Copyright (C) 2006-2014 Georg Rudoy * * Boost Software License - Version 1.0 - August 17th, 2003 * * Permission is hereby granted, free of charge, to any person or organization * obtaining a copy of the software and accompanying documentation covered by * this license (the "Software") to use, reproduce, display, distribute, * execute, and transmit the Software, and to prepare derivative works of the * Software, and to permit third-parties to whom the Software is furnished to * do so, all subject to the following: * * The copyright notices in the Software and this entire statement, including * the above license grant, this restriction and the following disclaimer, * must be included in all copies of the Software, in whole or in part, and * all derivative works of the Software, unless such copies or derivative * works are solely in the form of machine-executable object code generated by * a source language processor. * * 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. **********************************************************************/ #include "summarywidget.h" #include <QTimer> #include <QComboBox> #include <QMenu> #include <QToolBar> #include <QMainWindow> #include <QWidgetAction> #include <QCloseEvent> #include <QSortFilterProxyModel> #include <QLineEdit> #include <QtDebug> #include <interfaces/structures.h> #include <interfaces/ijobholder.h> #include <interfaces/core/icoreproxy.h> #include <interfaces/core/ipluginsmanager.h> #include <interfaces/core/irootwindowsmanager.h> #include <interfaces/core/iiconthememanager.h> #include <interfaces/imwproxy.h> #include <util/gui/clearlineeditaddon.h> #include "core.h" #include "summary.h" #include "modeldelegate.h" Q_DECLARE_METATYPE (QMenu*) namespace LeechCraft { namespace Summary { QObject *SummaryWidget::S_ParentMultiTabs_ = 0; class SearchWidget : public QWidget { QLineEdit *Edit_; public: SearchWidget (SummaryWidget *summary) : Edit_ (new QLineEdit) { auto lay = new QHBoxLayout; setLayout (lay); Edit_->setPlaceholderText (SummaryWidget::tr ("Search...")); Edit_->setMaximumWidth (400); Edit_->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed); lay->addStretch (); lay->addWidget (Edit_, 0, Qt::AlignRight); new Util::ClearLineEditAddon (Core::Instance ().GetProxy (), Edit_); connect (Edit_, SIGNAL (textChanged (QString)), summary, SLOT (filterParametersChanged ())); connect (Edit_, SIGNAL (returnPressed ()), summary, SLOT (feedFilterParameters ())); } QString GetText () const { return Edit_->text (); } void SetText (const QString& text) { Edit_->setText (text); } }; SummaryWidget::SummaryWidget (QWidget *parent) : QWidget (parent) , FilterTimer_ (new QTimer) , SearchWidget_ (CreateSearchWidget ()) , Toolbar_ (new QToolBar) , Sorter_ (Core::Instance ().GetTasksModel ()) { Toolbar_->setWindowTitle ("Summary"); connect (Toolbar_.get (), SIGNAL (actionTriggered (QAction*)), this, SLOT (handleActionTriggered (QAction*))); Toolbar_->addWidget (SearchWidget_); Ui_.setupUi (this); Ui_.PluginsTasksTree_->setItemDelegate (new ModelDelegate (this)); FilterTimer_->setSingleShot (true); FilterTimer_->setInterval (800); connect (FilterTimer_, SIGNAL (timeout ()), this, SLOT (feedFilterParameters ())); Ui_.ControlsDockWidget_->hide (); auto pm = Core::Instance ().GetProxy ()->GetPluginsManager (); for (const auto plugin : pm->GetAllCastableRoots<IJobHolder*> ()) ConnectObject (plugin); Ui_.PluginsTasksTree_->setModel (Sorter_); connect (Sorter_, SIGNAL (dataChanged (QModelIndex, QModelIndex)), this, SLOT (checkDataChanged (QModelIndex, QModelIndex))); connect (Sorter_, SIGNAL (modelAboutToBeReset ()), this, SLOT (handleReset ())); connect (Sorter_, SIGNAL (rowsAboutToBeRemoved (QModelIndex, int, int)), this, SLOT (checkRowsToBeRemoved (QModelIndex, int, int))); connect (Ui_.PluginsTasksTree_->selectionModel (), SIGNAL (currentRowChanged (QModelIndex, QModelIndex)), this, SLOT (updatePanes (QModelIndex, QModelIndex))); connect (Ui_.PluginsTasksTree_->selectionModel (), SIGNAL (currentRowChanged (QModelIndex, QModelIndex)), this, SLOT (syncSelection (QModelIndex)), Qt::QueuedConnection); const auto itemsHeader = Ui_.PluginsTasksTree_->header (); const auto& fm = fontMetrics (); itemsHeader->resizeSection (0, fm.width ("Average download job or torrent name is just like this.")); itemsHeader->resizeSection (1, fm.width ("Of the download.")); itemsHeader->resizeSection (2, fm.width ("99.99% (1024.0 kb from 1024.0 kb at 1024.0 kb/s)")); ReconnectModelSpecific (); } void SummaryWidget::ReconnectModelSpecific () { const auto sel = Ui_.PluginsTasksTree_->selectionModel (); #define C2(sig,sl,arg1,arg2) \ if (mo->indexOfMethod (QMetaObject::normalizedSignature ("handleTasksTreeSelection" #sl "(" #arg1 ", " #arg2 ")")) != -1) \ connect (sel, \ SIGNAL (sig (arg1, arg2)), \ object, \ SLOT (handleTasksTreeSelection##sl (arg1, arg2))); auto pm = Core::Instance ().GetProxy ()->GetPluginsManager (); Q_FOREACH (QObject *object, pm->GetAllCastableRoots<IJobHolder*> ()) { const auto *mo = object->metaObject (); C2 (currentChanged, CurrentChanged, QModelIndex, QModelIndex); C2 (currentColumnChanged, CurrentColumnChanged, QModelIndex, QModelIndex); C2 (currentRowChanged, CurrentRowChanged, QModelIndex, QModelIndex); } #undef C2 } void SummaryWidget::ConnectObject (QObject *object) { const auto *mo = object->metaObject (); #define C1(sig,sl,arg) \ if (mo->indexOfMethod (QMetaObject::normalizedSignature ("handleTasksTree" #sl "(" #arg ")")) != -1) \ connect (Ui_.PluginsTasksTree_, \ SIGNAL (sig (arg)), \ object, \ SLOT (handleTasksTree##sl (arg))); C1 (activated, Activated, QModelIndex); C1 (clicked, Clicked, QModelIndex); C1 (doubleClicked, DoubleClicked, QModelIndex); C1 (entered, Entered, QModelIndex); C1 (pressed, Pressed, QModelIndex); C1 (viewportEntered, ViewportEntered, ); #undef C1 } SummaryWidget::~SummaryWidget () { Toolbar_->clear (); QWidget *widget = Ui_.ControlsDockWidget_->widget (); Ui_.ControlsDockWidget_->setWidget (0); if (widget) widget->setParent (0); delete Sorter_; } void SummaryWidget::SetParentMultiTabs (QObject *parent) { S_ParentMultiTabs_ = parent; } void SummaryWidget::Remove () { emit needToClose (); } QToolBar* SummaryWidget::GetToolBar () const { return Toolbar_.get (); } QList<QAction*> SummaryWidget::GetTabBarContextMenuActions () const { return QList<QAction*> (); } QObject* SummaryWidget::ParentMultiTabs () { return S_ParentMultiTabs_; } TabClassInfo SummaryWidget::GetTabClassInfo () const { return qobject_cast<Summary*> (S_ParentMultiTabs_)->GetTabClasses ().first (); } SearchWidget* SummaryWidget::CreateSearchWidget () { return new SearchWidget (this); } void SummaryWidget::ReinitToolbar () { Q_FOREACH (QAction *action, Toolbar_->actions ()) { auto wa = qobject_cast<QWidgetAction*> (action); if (!wa || wa->defaultWidget () != SearchWidget_) { Toolbar_->removeAction (action); delete action; } else if (wa->defaultWidget () != SearchWidget_) Toolbar_->removeAction (action); } } QList<QAction*> SummaryWidget::CreateProxyActions (const QList<QAction*>& actions, QObject *parent) const { QList<QAction*> proxies; Q_FOREACH (QAction *action, actions) { if (qobject_cast<QWidgetAction*> (action)) { proxies << action; continue; } QAction *pa = new QAction (action->icon (), action->text (), parent); if (action->isSeparator ()) pa->setSeparator (true); else { pa->setCheckable (action->isCheckable ()); pa->setChecked (action->isChecked ()); pa->setShortcuts (action->shortcuts ()); pa->setStatusTip (action->statusTip ()); pa->setToolTip (action->toolTip ()); pa->setWhatsThis (action->whatsThis ()); pa->setData (QVariant::fromValue<QObject*> (action)); connect (pa, SIGNAL (hovered ()), action, SIGNAL (hovered ())); connect (pa, SIGNAL (toggled (bool)), action, SIGNAL (toggled (bool))); } proxies << pa; } return proxies; } QByteArray SummaryWidget::GetTabRecoverData () const { QByteArray result; QDataStream out (&result, QIODevice::WriteOnly); out << static_cast<quint8> (1); return result; } QString SummaryWidget::GetTabRecoverName () const { return GetTabClassInfo ().VisibleName_; } QIcon SummaryWidget::GetTabRecoverIcon () const { return GetTabClassInfo ().Icon_; } void SummaryWidget::RestoreState (const QByteArray& data) { QDataStream in (data); quint8 version = 0; in >> version; if (version != 1) { qWarning () << Q_FUNC_INFO << "unknown version"; return; } } void SummaryWidget::SetUpdatesEnabled (bool) { // TODO implement this } Ui::SummaryWidget SummaryWidget::GetUi () const { return Ui_; } void SummaryWidget::handleActionTriggered (QAction *proxyAction) { QAction *action = qobject_cast<QAction*> (proxyAction-> data ().value<QObject*> ()); QItemSelectionModel *selModel = Ui_.PluginsTasksTree_->selectionModel (); QModelIndexList indexes = selModel->selectedRows (); action->setProperty ("SelectedRows", QVariant::fromValue<QList<QModelIndex>> (indexes)); action->setProperty ("ItemSelectionModel", QVariant::fromValue<QObject*> (selModel)); action->activate (QAction::Trigger); } void SummaryWidget::checkDataChanged (const QModelIndex& topLeft, const QModelIndex& bottomRight) { const QModelIndex& cur = Ui_.PluginsTasksTree_-> selectionModel ()->currentIndex (); if (topLeft.row () <= cur.row () && bottomRight.row () >= cur.row ()) updatePanes (cur, cur); } void SummaryWidget::handleReset () { Ui_.PluginsTasksTree_->selectionModel ()->clear (); } void SummaryWidget::checkRowsToBeRemoved (const QModelIndex&, int begin, int end) { const QModelIndex& cur = Ui_.PluginsTasksTree_-> selectionModel ()->currentIndex (); if (begin <= cur.row () && end >= cur.row ()) Ui_.PluginsTasksTree_->selectionModel ()->clear (); } void SummaryWidget::updatePanes (const QModelIndex& newIndex, const QModelIndex& oldIndex) { QToolBar *controls = Core::Instance ().GetControls (newIndex); QWidget *addiInfo = Core::Instance ().GetAdditionalInfo (newIndex); if (oldIndex.isValid () && addiInfo != Ui_.ControlsDockWidget_->widget ()) Ui_.ControlsDockWidget_->hide (); if (Core::Instance ().SameModel (newIndex, oldIndex)) return; ReinitToolbar (); if (newIndex.isValid ()) { if (controls) { Q_FOREACH (QAction *action, controls->actions ()) { QString ai = action->property ("ActionIcon").toString (); if (!ai.isEmpty () && action->icon ().isNull ()) action->setIcon (Core::Instance ().GetProxy ()-> GetIconThemeManager ()->GetIcon (ai)); } const auto& proxies = CreateProxyActions (controls->actions (), Toolbar_.get ()); Toolbar_->insertActions (Toolbar_->actions ().first (), proxies); } if (addiInfo != Ui_.ControlsDockWidget_->widget ()) Ui_.ControlsDockWidget_->setWidget (addiInfo); if (addiInfo) { Ui_.ControlsDockWidget_->show (); Core::Instance ().GetProxy ()->GetIconThemeManager ()-> UpdateIconset (addiInfo->findChildren<QAction*> ()); } } } void SummaryWidget::filterParametersChanged () { FilterTimer_->stop (); FilterTimer_->start (); } void SummaryWidget::filterReturnPressed () { FilterTimer_->stop (); feedFilterParameters (); } void SummaryWidget::feedFilterParameters () { Sorter_->setFilterFixedString (SearchWidget_->GetText ()); } void SummaryWidget::on_PluginsTasksTree__customContextMenuRequested (const QPoint& pos) { QModelIndex current = Ui_.PluginsTasksTree_->currentIndex (); QMenu *sourceMenu = current.data (RoleContextMenu).value<QMenu*> (); if (!sourceMenu) return; QMenu *menu = new QMenu (); connect (menu, SIGNAL (triggered (QAction*)), this, SLOT (handleActionTriggered (QAction*))); menu->setAttribute (Qt::WA_DeleteOnClose, true); menu->addActions (CreateProxyActions (sourceMenu->actions (), menu)); menu->setTitle (sourceMenu->title ()); menu->popup (Ui_.PluginsTasksTree_->viewport ()->mapToGlobal (pos)); } void SummaryWidget::syncSelection (const QModelIndex& current) { QItemSelectionModel *selm = Ui_.PluginsTasksTree_->selectionModel (); const QModelIndex& now = selm->currentIndex (); if (current != now || (now.isValid () && !selm->rowIntersectsSelection (now.row (), QModelIndex ()))) { selm->select (now, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); updatePanes (now, current); } } } }
28.390397
125
0.686521
devel29a
7e305c2400bc8774a10c5cc9dec4757f2847085b
1,031
hpp
C++
RayCharles/Sphere.hpp
CoderGirl42/RayTracer
4e370864ec6b9c02ea030a9cbe4354b2d55f3aba
[ "MIT" ]
null
null
null
RayCharles/Sphere.hpp
CoderGirl42/RayTracer
4e370864ec6b9c02ea030a9cbe4354b2d55f3aba
[ "MIT" ]
null
null
null
RayCharles/Sphere.hpp
CoderGirl42/RayTracer
4e370864ec6b9c02ea030a9cbe4354b2d55f3aba
[ "MIT" ]
null
null
null
#pragma once #include "Entity.hpp" class _MMX_ALIGN_ Sphere : public Entity { public: Sphere() {} Sphere(const Vec3& c, real r) : Center(c), Radius(r) {}; virtual bool Hit(const Ray& r, real t_min, real t_max, HitRecord& rec); Vec3 Center; real Radius; Entity *Entity; }; bool Sphere::Hit(const Ray& r, real t_min, real t_max, HitRecord& rec) { Vec3 oc = r.Origin() - Center; real a = r.Direction().Dot(r.Direction()); real b = oc.Dot(r.Direction()); real c = oc.Dot(oc) - Radius * Radius; real discriminant = b * b - a * c; if (discriminant > 0) { float temp = (-b - SQRT(b * b - a * c)) / a; if (temp < t_max && temp > t_min) { rec.t = temp; rec.p = r.PointAtParameter(rec.t); rec.normal = (rec.p - Center) / Radius; rec.e = this; return true; } temp = (-b + SQRT(b * b - a * c)) / a; if (temp < t_max && temp > t_min) { rec.t = temp; rec.p = r.PointAtParameter(rec.t); rec.normal = (rec.p - Center) / Radius; rec.e = this; return true; } } return false; }
19.092593
72
0.587779
CoderGirl42
cce1758fd8acd349c852f95809bfb32fcc86af24
51,552
cpp
C++
solarpilot/Toolbox.cpp
rchintala13/ssc
3424d9b1bfab50cc11d1895d0893cf1771fd3a5e
[ "BSD-3-Clause" ]
null
null
null
solarpilot/Toolbox.cpp
rchintala13/ssc
3424d9b1bfab50cc11d1895d0893cf1771fd3a5e
[ "BSD-3-Clause" ]
null
null
null
solarpilot/Toolbox.cpp
rchintala13/ssc
3424d9b1bfab50cc11d1895d0893cf1771fd3a5e
[ "BSD-3-Clause" ]
1
2017-10-01T08:36:05.000Z
2017-10-01T08:36:05.000Z
/** BSD-3-Clause Copyright 2019 Alliance for Sustainable Energy, LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met : 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT HOLDER, CONTRIBUTORS, UNITED STATES GOVERNMENT OR UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, 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 "math.h" #include <stdio.h> #include <ctime> #include <vector> #include <algorithm> #include "Toolbox.h" #include "definitions.h" using namespace std; // ----------- points and vectors ----------------------- sp_point::sp_point(){}; sp_point::sp_point( const sp_point &P ) : x(P.x), y(P.y), z(P.z) { } sp_point::sp_point(double X, double Y, double Z) : x(X), y(Y), z(Z) { } void sp_point::Set(double _x, double _y, double _z) { this->x = _x; this->y = _y; this->z = _z; } void sp_point::Set( sp_point &P ) { this->x = P.x; this->y = P.y; this->z = P.z; } void sp_point::Add( sp_point &P ) { this->x+=P.x; this->y+=P.y; this->z+=P.z; } void sp_point::Add(double _x, double _y, double _z) { this->x += _x; this->y += _y; this->z += _z; } void sp_point::Subtract( sp_point &P ) { this->x += -P.x; this->y += -P.y; this->z += -P.z; } double& sp_point::operator [](const int &index){ switch (index) { case 0: return x; break; case 1: return y; break; case 2: return z; break; default: throw spexception("Index out of range in sp_point()"); break; } }; bool sp_point::operator <(const sp_point &p) const { return this->x < p.x || (this->x == p.x && this->y < p.y); }; Vect::Vect(){}; Vect::Vect( const Vect &V ) : i(V.i), j(V.j), k(V.k) {} Vect::Vect(double i, double j, double k ) : i(i), j(j), k(k) { } void Vect::Set(double _i, double _j, double _k) { i=_i; j=_j; k=_k; } void Vect::Set( Vect &V ) { i = V.i; j = V.j; k = V.k; } void Vect::Add( Vect &V ) { i+=V.i; j+=V.j; k+=V.k; } void Vect::Subtract( Vect &V ) { i+=-V.i; j+=-V.j; k+=-V.k; } void Vect::Add(double _i, double _j, double _k) { i+=_i; j+=_j; k+=_k; } void Vect::Scale( double m ) { i *= m; j *= m; k *= m; } double &Vect::operator[](int index){ if( index == 0) return i; if( index == 1) return j; if( index == 2) return k; throw spexception("Index out of range in Vect()"); //range error }; PointVect::PointVect(const PointVect &v){ x = v.x; y=v.y; z=v.z; i = v.i; j=v.j; k=v.k; } PointVect& PointVect::operator= (const PointVect &v) { x = v.x; y=v.y; z=v.z; i = v.i; j=v.j; k=v.k; return *this; } PointVect::PointVect(double px, double py, double pz, double vi, double vj, double vk) { x=px; y=py; z=pz; i=vi; j=vj; k=vk; } sp_point *PointVect::point() { p.Set(x, y, z); return &p; }; Vect *PointVect::vect() { v.Set(i, j, k); return &v; }; //------------------------------------------------------- //------------------ DTObj class ------------------------------------- DTobj::DTobj() { setZero(); } void DTobj::setZero() { _year=0; _month=0; _yday=0; _mday=0; _wday=0; _hour=0; _min=0; _sec=0; _ms=0; } DTobj *DTobj::Now() { struct tm now; #ifdef _MSC_VER __time64_t long_time; // Get time as 64-bit integer. _time64( &long_time ); // Convert to local time. _localtime64_s( &now, &long_time ); #else time_t long_time; // Get time as 64-bit integer. time( &long_time ); // Convert to local time. now = *localtime(&long_time); #endif _year=now.tm_year+1900; _month=now.tm_mon; _yday=now.tm_yday; _mday=now.tm_mday; _wday=now.tm_wday; _hour=now.tm_hour; _min=now.tm_min; _sec=now.tm_sec; _ms=0; return this; } //------------------------------------------------------- //-----------------------DateTime class------------------- //accessors //GETS int DateTime::GetYear(){return _year;} int DateTime::GetMonth(){return _month;} int DateTime::GetYearDay(){return _yday;}; int DateTime::GetMonthDay(){return _mday;} int DateTime::GetWeekDay(){return _wday;} int DateTime::GetMinute(){return _min;}; int DateTime::GetSecond() {return _sec;}; int DateTime::GetMillisecond(){return _ms;}; // SETS void DateTime::SetYear(const int val){_year=val; SetMonthLengths(_year);} void DateTime::SetMonth(const int val){_month=val;} void DateTime::SetYearDay(const int val){_yday=val;} void DateTime::SetMonthDay(const int val){_mday=val;} void DateTime::SetWeekDay(const int val){_wday=val;} void DateTime::SetHour(const int val){_hour=val;} void DateTime::SetMinute(const int val){_min=val;} void DateTime::SetSecond(const int val){_sec=val;} void DateTime::SetMillisecond(const int val){_ms=val;} //Default constructor DateTime::DateTime(){ //Initialize all variables to the current date and time setDefaults(); } DateTime::DateTime(double doy, double hour){ //Convert from fractional hours to integer values for hr, min, sec int hr = int(floor(hour)); double minutes = 60. * (hour - double(hr)); int min = int(floor(minutes)); int sec = int(60.*(minutes - double(min))); setZero(); //Zero values SetYearDay(int(doy+.001)); //day of the year SetHour(hr); SetMinute(min); SetSecond(sec); } //Fully specified constructor DateTime::DateTime(DTobj &DT) { _year=DT._year; _month=DT._month; _yday=DT._yday; _mday=DT._mday; _wday=DT._wday; _hour=DT._hour; _min=DT._min; _sec=DT._sec; _ms=DT._ms; //Initialize the month lengths array SetMonthLengths(_year); } void DateTime::setDefaults(){ setZero(); //everything zeros but the day of year and year (hr=12 is noon) //Get the current year and set it as the default value DTobj N; N.Now(); //SetYear(N._year); SetYear(2011); //Choose a non-leap year SetMonth(6); SetMonthDay(21); SetYearDay( GetDayOfYear() ); //Summer solstice SetHour(12); } void DateTime::SetDate(int year, int month, int day) { //Given a year, month (1-12), and day of the month (1-N), set the values. Leave the time as it is SetYear(year); SetMonth(month); SetMonthDay(day); SetMonthLengths(_year); SetYearDay( GetDayOfYear(year, month, day) ); } void DateTime::SetMonthLengths(const int year){ /* Calculate the number of days in each month and assign the result to the monthLength[] array. Provide special handling for 4-year, 100-year, and 400-year leap years.*/ //Initialize the array of month lengths (accounting for leap year) for (int i=0; i<12; i+=2){ monthLength[i]=31; }; for (int i=1; i<12; i+=2){ monthLength[i]=30; }; //Given the year, determine how many days are in Feb. monthLength[1]=28; //Default if(year%4==0) {monthLength[1]=29;} //All years divisible by 4 are leap years if(year%100==0){ //All years divisible by 100 are not leap years, unless... if(year%400 == 0){monthLength[1]=29;} //.. the year is also divisible by 400. else {monthLength[1]=28;} }; } int DateTime::GetDayOfYear(){ int val = GetDayOfYear(_year, _month, _mday); return val; } int DateTime::GetDayOfYear(int /*year*/, int month, int mday){ //Return the day of the year specified by the class day/month/year class members //Day of the year runs from 1-365 int doy=0; if(month>1) { for (int i=0; i<month-1; i++) {doy+=monthLength[i];}; }; doy+= mday; return doy; } int DateTime::CalculateDayOfYear( int year, int month, int mday ){ //Static version int monthLength[12]; //Initialize the array of month lengths (accounting for leap year) for (int i=0; i<12; i+=2){ monthLength[i]=31; }; for (int i=1; i<12; i+=2){ monthLength[i]=30; }; //Given the year, determine how many days are in Feb. monthLength[1]=28; //Default if(year%4==0) {monthLength[1]=29;} //All years divisible by 4 are leap years if(year%100==0){ //All years divisible by 100 are not leap years, unless... if(year%400 == 0){monthLength[1]=29;} //.. the year is also divisible by 400. else {monthLength[1]=28;} }; int doy=0; if(month>1) { for (int i=0; i<month-1; i++) {doy+=monthLength[i];}; }; doy+= mday; return doy; } int DateTime::GetHourOfYear(){ //Return the hour of the year according to the values specified by the class members int doy = GetDayOfYear(); int hr = (doy-1)*24 + _hour; return hr; }; void DateTime::hours_to_date(double hours, int &month, int &day_of_month){ /* Take hour of the year (0-8759) and convert it to month and day of the month. If the year is not provided, the default is 2011 (no leap year) Month = 1-12 Day = 1-365 The monthLength[] array contains the number of days in each month. This array is taken from the DateTime class and accounts for leap years. To modify the year to not include leap year days, change the year in the DateTime instance. */ double days = hours/24.; int dsum=0; for(int i=0; i<12; i++){ dsum += monthLength[i]; if(days <= dsum){month = i+1; break;} } day_of_month = (int)floor(days - (dsum - monthLength[month-1]))+1; } std::string DateTime::GetMonthName(int month){ switch(month) { case 1: return "January"; case 2: return "February"; case 3: return "March"; case 4: return "April"; case 5: return "May"; case 6: return "June"; case 7: return "July"; case 8: return "August"; case 9: return "September"; case 10: return "October"; case 11: return "November"; case 12: return "December"; default: return ""; } } //---------Weather data object class -------------------- //Copy constructor WeatherData::WeatherData( const WeatherData &wd) : _N_items( wd._N_items ), Day( wd.Day ), Hour( wd.Hour ), Month( wd.Month ), DNI( wd.DNI ), T_db( wd.T_db ), Pres( wd.Pres ), V_wind( wd.V_wind ), Step_weight( wd.Step_weight ) { //Recreate the pointer array initPointers(); } WeatherData::WeatherData(){ initPointers(); }; void WeatherData::initPointers(){ //On initialization, create a vector of pointers to all of the data arrays v_ptrs.resize(8); v_ptrs.at(0) = &Day; v_ptrs.at(1) = &Hour; v_ptrs.at(2) = &Month; v_ptrs.at(3) = &DNI; v_ptrs.at(4) = &T_db; v_ptrs.at(5) = &Pres; v_ptrs.at(6) = &V_wind; v_ptrs.at(7) = &Step_weight; //Initialize the number of items _N_items = (int)Day.size(); } void WeatherData::resizeAll(int size, double val){ for(unsigned int i=0; i<v_ptrs.size(); i++){ v_ptrs.at(i)->resize(size, val); _N_items = size; } }; void WeatherData::clear() { for(unsigned int i=0; i<v_ptrs.size(); i++){ v_ptrs.at(i)->clear(); _N_items = 0; } } void WeatherData::getStep(int step, double &day, double &hour, double &dni, double &step_weight){ //retrieve weather data from the desired time step day = Day.at(step); hour = Hour.at(step); dni = DNI.at(step); step_weight = Step_weight.at(step); } void WeatherData::getStep(int step, double &day, double &hour, double &month, double &dni, double &tdb, double &pres, double &vwind, double &step_weight){ double *args[] = {&day, &hour, &month, &dni, &tdb, &pres, &vwind, &step_weight}; //retrieve weather data from the desired time step for(unsigned int i=0; i<v_ptrs.size(); i++){ *args[i] = v_ptrs.at(i)->at(step); } } void WeatherData::append(double day, double hour, double dni, double step_weight){ Day.push_back(day); Hour.push_back( hour ); DNI.push_back( dni ); Step_weight.push_back( step_weight ); _N_items ++; } void WeatherData::append(double day, double hour, double month, double dni, double tdb, double pres, double vwind, double step_weight){ Day.push_back( day ); Hour.push_back( hour ); Month.push_back( month ); DNI.push_back( dni ); T_db.push_back( tdb ); Pres.push_back( pres ); V_wind.push_back( vwind ); Step_weight.push_back( step_weight ); _N_items ++; } void WeatherData::setStep(int step, double day, double hour, double dni, double step_weight){ Day.at(step) = day; Hour.at(step) = hour; DNI.at(step) = dni; Step_weight.at(step) = step_weight; } void WeatherData::setStep(int step, double day, double hour, double month, double dni, double tdb, double pres, double vwind, double step_weight){ Day.at(step) = day; Hour.at(step) = hour; Month.at(step) = month; DNI.at(step) = dni; T_db.at(step) = tdb; Pres.at(step) = pres; V_wind.at(step) = vwind; Step_weight.at(step) = step_weight; } std::vector<std::vector<double>*> *WeatherData::getEntryPointers() { return &v_ptrs; } //-----------------------Toolbox namespace-------------------- //misc double Toolbox::round(double x){ return fabs(x - ceil(x)) > 0.5 ? floor(x) : ceil(x); } void Toolbox::writeMatD(string dir, string name, matrix_t<double> &mat, bool clear){ //write the data to a log file FILE *file; //ofstream file; string path; path.append(dir); path.append("\\matrix_data_log.txt"); if( clear ) { file = fopen(path.c_str(), "w"); } else{ file = fopen(path.c_str(), "a"); } int nr = (int)mat.nrows(); int nc = (int)mat.ncols(); fprintf(file, "%s\n", name.c_str()); for (int i=0; i<nr; i++){ for (int j=0; j<nc; j++){ fprintf(file, "%e\t", mat.at(i,j)); } fprintf(file, "%s", "\n"); } fprintf(file, "%s", "\n"); fclose(file); } void Toolbox::writeMatD(string dir, string name, block_t<double> &mat, bool clear){ //write the data to a log file FILE *file; //ofstream file; string path; path.append(dir); path.append("\\matrix_data_log.txt"); if( clear ) { file =fopen(path.c_str(), "w"); } else{ file =fopen(path.c_str(), "a"); } int nr = (int)mat.nrows(); int nc = (int)mat.ncols(); int nl = (int)mat.nlayers(); fprintf(file, "%s\n", name.c_str()); for (int k=0; k<nl; k++){ fprintf(file, "%i%s", k, "--\n"); for (int i=0; i<nr; i++){ for (int j=0; j<nc; j++){ fprintf(file, "%e\t", mat.at(i,j,k)); } fprintf(file, "%s", "\n"); } } fprintf(file, "%s", "\n"); fclose(file); } void Toolbox::swap(double &a, double &b){ //Swap the values in A and B double xt = a; a = b; b = xt; } void Toolbox::swap(double *a, double *b){ double xt = *a; *a = *b; *b = xt; } double Toolbox::atan3(double &x, double &y){ double v = atan2(x,y); return v < 0. ? v += 2.*PI : v; } void Toolbox::map_profiles(double *source, int nsource, double *dest, int ndest, double *weights){ /* Take a source array 'source(nsource)' and map the values to 'dest(ndest)'. This method creates an integral-conserved map of values in 'dest' that may have a different number of elements than 'source'. The size of each node within 'source' is optionally specified by the 'weights(nsource)' array. If all elements are of the same size, set weights=(double*)NULL or omit the optional argument. */ double *wsize; double wtot = 0.; if(weights != (double*)NULL){ wsize = new double[nsource]; for(int i=0; i<nsource; i++){ wtot += weights[i]; //sum up weights wsize[i] = weights[i]; } } else{ wsize = new double[nsource]; for(int i=0; i<nsource; i++) wsize[i] = 1.; wtot = (double)nsource; } double delta_D = wtot/(double)ndest; int i=0; double ix = 0.; for(int j=0; j<ndest; j++){ dest[j] = 0.; double jx = (double)(j+1)*delta_D, jx0 = (double)j*delta_D; //From previous step if(ix-jx0>0) dest[j] += (ix-jx0)*source[i-1]; //internal steps while(ix < jx ){ ix += wsize[i]; dest[j] += wsize[i] * source[i]; i++; } //subtract overage if(ix > jx ) dest[j] += -(ix-jx)*source[i-1]; //Divide by length dest[j] *= 1./delta_D; } //Memory cleanup delete [] wsize; } /* Factorial of an integer x*/ int Toolbox::factorial(int x) { //if (floor(3.2)!=x) { cout << "Factorial must be an integer!" }; int f = x; for (int i=1; i<x; i++) { int j=x-i; f=f*j; } if(f<1) f=1; //Minimum of any factorial is 1 return f; } double Toolbox::factorial_d(int x) { //returns the same as factorial, but with a doub value return double(factorial(x)); } bool Toolbox::pointInPolygon( const vector< sp_point > &poly, const sp_point &pt) { /* This subroutine takes a polynomial array containing L_poly vertices (X,Y,Z) and a single point (X,Y,Z) and determines whether the point lies within the polygon. If so, the algorithm returns TRUE (otherwise FALSE) */ //if polywind returns a number between -1 and 1, the point is in the polygon int wind = polywind(poly, pt); if (wind == -1 || wind == 1) { return true;} else {return false;} } vector<sp_point> Toolbox::projectPolygon(vector<sp_point> &poly, PointVect &plane) { /* Take a polygon with points in three dimensions (X,Y,Z) and project all points onto a plane defined by the point-vector {x,y,z,i,j,k}. The subroutine returns a new polygon with the adjusted points all lying on the plane. The points are also assigned vector values corresponding to the normal vector of the plane that they lie in.*/ //Declare variables double dist, A, B, C, D; sp_point pt; //Declare a new polygon of type vector int Lpoly = (int)poly.size(); vector< sp_point > FPoly(Lpoly); //Determine the coefficients for the equation of the plane {A,B,C,D} A=plane.i; B=plane.j; C=plane.k; Vect uplane; uplane.Set(A,B,C); vectmag(uplane); D = -A*plane.x - B*plane.y - C*plane.z; for (int i=0; i<Lpoly; i++) { //Determine the distance between the point and the plane pt = poly.at(i); dist = -(A*pt.x + B*pt.y + C*pt.z + D)/vectmag(*plane.vect()); //knowing the distance, now shift the point to the plane FPoly.at(i).x = pt.x+dist*A; FPoly.at(i).y = pt.y+dist*B; FPoly.at(i).z = pt.z+dist*C; } return FPoly; } int Toolbox::polywind( const vector<sp_point> &vt, const sp_point &pt) { /* Determine the winding number of a polygon with respect to a point. This helps calculate the inclusion/exclusion of the point inside the polygon. If the point is inside the polygon, the winding number is equal to -1 or 1. */ //Declarations int i, np, wind = 0, which_ign; double d0=0., d1=0., p0=0., p1=0., pt0=0., pt1=0.; /*The 2D polywind function can be mapped to 3D polygons by choosing a single dimension to ignore. The best ignored dimension corresponds to the largest magnitude component of the normal vector to the plane containing the polygon.*/ //Get the cross product of the first three points in the polygon to determine the planar normal vector Vect v1, v2; v1.Set((vt.at(0).x-vt.at(1).x),(vt.at(0).y - vt.at(1).y),(vt.at(0).z - vt.at(1).z)); v2.Set((vt.at(2).x-vt.at(1).x),(vt.at(2).y - vt.at(1).y),(vt.at(2).z - vt.at(1).z)); Vect pn = crossprod( v1, v2 ); which_ign = 1; if(fabs(pn.j) > fabs(pn.i)) {which_ign=1;} if(fabs(pn.k) > fabs(pn.j)) {which_ign=2;} if(fabs(pn.i) > fabs(pn.k)) {which_ign=0;} /* Return the winding number of a polygon (specified by a vector of vertex points vt) around an arbitrary point pt.*/ np = (int)vt.size(); switch (which_ign) { case 0: pt0 = pt.y; pt1 = pt.z; p0 = vt[np-1].y; p1 = vt[np-1].z; break; case 1: pt0 = pt.x; pt1 = pt.z; p0 = vt[np-1].x; p1 = vt[np-1].z; break; case 2: pt0 = pt.x; pt1 = pt.y; p0 = vt[np-1].x; p1 = vt[np-1].y; } for (i=0; i<np; i++) { switch (which_ign) { case 0: d0 = vt[i].y; d1 = vt[i].z; break; case 1: d0 = vt[i].x; d1 = vt[i].z; break; case 2: d0 = vt[i].x; d1 = vt[i].y; } if (p1 <= pt1) { if (d1 > pt1 && (p0-pt0)*(d1-pt1)-(p1-pt1)*(d0-pt0) > 0) wind++; } else { if (d1 <= pt1 && (p0-pt0)*(d1-pt1)-(p1-pt1)*(d0-pt0) < 0) wind--; } p0=d0; p1=d1; } return wind; } Vect Toolbox::crossprod(const Vect &A, const Vect &B) { /* Calculate the cross product of two vectors. The magnitude of the cross product represents the area contained in a parallelogram bounded by the multipled vectors.*/ Vect res; res.i = A.j*B.k - A.k*B.j; res.j = A.k*B.i - A.i*B.k; res.k = A.i*B.j - A.j*B.i; return res; }; double Toolbox::crossprod(const sp_point &O, const sp_point &A, const sp_point &B) { //2D cross-product of vectors OA and OB. return (A.x - O.x) * (B.y - O.y) - (A.y - O.y) * (B.x - O.x); } void Toolbox::unitvect(Vect &A) { /*Take a vector that may or may not be in unit vector form and scale the magnitude to make it a unit vector*/ double M = vectmag(A); if(M==0.){A.i=0; A.j=0; A.k=0; return;} A.i /= M; A.j /= M; A.k /= M; return; } double Toolbox::dotprod(const Vect &A, const Vect &B) { return (A.i * B.i + A.j * B.j + A.k * B.k); } double Toolbox::dotprod(const Vect &A, const sp_point &B) { return (A.i * B.x + A.j * B.y + A.k * B.z); } double Toolbox::vectmag(const Vect &A) { return sqrt(pow(A.i,2) + pow(A.j,2) + pow(A.k,2)); } double Toolbox::vectmag(const sp_point &P){ return sqrt( pow(P.x,2) + pow(P.y,2) + pow(P.z,3) ); } double Toolbox::vectmag(double i, double j, double k){ return sqrt( pow(i,2) + pow(j,2) + pow(k,2) ); } double Toolbox::vectangle(const Vect &A, const Vect&B) { //Determine the angle between two vectors return acos(dotprod(A,B)/(vectmag(A)*vectmag(B))); } void Toolbox::rotation(double theta, int axis, Vect &V){ sp_point p; p.Set(V.i, V.j, V.k); Toolbox::rotation(theta, axis, p); V.Set(p.x, p.y, p.z); } void Toolbox::rotation(double theta, int axis, sp_point &P){ /* This method takes a point, a rotation angle, and the axis of rotation and rotates the point about the origin in the specified direction. The inputs are: theta | [rad] | Angle of rotation axis | none | X=0, Y=1, Z=2 : Axis to rotate about The method returns a modified point "P" that has been rotated according to the inputs. Rotation is clockwise about each axis (left hand rule). In other words, positive rotation for each axis is defined by the apparent motion when positive end of the axis points toward the viewer. */ //the 3x3 rotation matrix double MR0i, MR0j, MR0k, MR1i, MR1j, MR1k, MR2i, MR2j, MR2k; double costheta = cos(theta); double sintheta = sin(theta); switch(axis) { /* The rotation vectors are entered in as the transverse for convenience of multiplication. The correct matrix form for each are: X axis [1, 0, 0, 0, cos(theta), -sin(theta), 0, sin(theta), cos(theta)] Y axis [cos(theta), 0, sin(theta), 0, 1, 0, -sin(theta), 0, cos(theta)] Z axis [cos(theta), -sin(theta), 0, sin(theta), cos(theta), 0, 0, 0, 1 ] */ case 0: //X axis //Fill in the x-rotation matrix for this angle theta MR0i = 1; MR0j = 0; MR0k = 0; MR1i = 0; MR1j = costheta; MR1k = sintheta; MR2i = 0; MR2j = -sintheta; MR2k = costheta; break; case 1: //Y axis //Fill in the y-rotation matrix for this angle theta MR0i = costheta; MR0j = 0; MR0k = -sintheta; MR1i = 0; MR1j = 1; MR1k = 0; MR2i = sintheta; MR2j = 0; MR2k = costheta; break; case 2: //Z axis //Fill in the z-rotation matrix for this angle theta MR0i = costheta; MR0j = sintheta; MR0k = 0; MR1i = -sintheta; MR1j = costheta; MR1k = 0; MR2i = 0; MR2j = 0; MR2k = 1; break; default: throw spexception("Internal error: invalid axis number specified in rotation() method."); } //Create a copy of the point double Pcx = P.x; double Pcy = P.y; double Pcz = P.z; //Do the rotation. The A matrix is the rotation vector and the B matrix is the point vector P.x = MR0i*Pcx + MR0j*Pcy + MR0k*Pcz; //dotprod(MR0, Pc); //do the dotprod's here to avoid function call P.y = MR1i*Pcx + MR1j*Pcy + MR1k*Pcz; //dotprod(MR1, Pc); P.z = MR2i*Pcx + MR2j*Pcy + MR2k*Pcz; //dotprod(MR2, Pc); return; } bool Toolbox::plane_intersect(sp_point &P, Vect &N, sp_point &C, Vect &L, sp_point &Int){ /* Determine the intersection point of a line and a plane. The plane is defined by: P | sp_point on the plane N | Normal unit vector to the plane The line/vector is defined by: C | (x,y,z) coordinate of the beginning of the line L | Unit vector pointing along the line The distance 'd' along the unit vector is given by the equation: d = ((P - C) dot N)/(L dot N) The method fills in the values of a point "Int" that is the intersection. In the case that the vector does not intersect with the plane, the method returns FALSE and the point Int is not modified. If an intersection is found, the method will return TRUE. */ double PC[3], LdN, PCdN, d; int i; //Create a vector between P and C for(i=0; i<3; i++){PC[i] = P[i]-C[i];} //Calculate the dot product of L and N LdN = 0.; for(i=0; i<3; i++){ LdN += L[i]*N[i]; } //Calculate the dot product of (P-C) and N PCdN = 0.; for(i=0; i<3; i++){ PCdN += PC[i]*N[i]; } if(LdN == 0.) return false; //Line is parallel to the plane d = PCdN / LdN; //Multiplier on unit vector that intersects the plane //Calculate the coordinates of intersection Int.x = C.x + d*L.i; Int.y = C.y + d*L.j; Int.z = C.z + d*L.k; return true; } bool Toolbox::line_norm_intersect(sp_point &line_p0, sp_point &line_p1, sp_point &P, sp_point &I, double &rad){ /* Note: 2D implementation (no Z component) Given two points that form a line segment (line_p0 and line_p1) and an external point NOT on the line (P), return the location of the intersection (I) between a second line that is normal to the first and passes through P. Also return the corresponding radius 'rad' ||P I||. (line_p0) (I) (line_p1) O--------------X----------------------------O |_| | | O (P) If the normal to the line segment lies outside of the segment, the method returns FALSE, otherwise its TRUE. In the first case, 'I' is equal to the segment point closest to 'P', otherwise it is the intersection point. Solve for 'I' using the derivative of the distance formula (r(x,y)) between I and P. I is the point where dr(x,y)/dx = 0. */ //Check to see if the 'x' components of p0 and p1 are the same, which is undefined slope. if(line_p0.x == line_p1.x){ //check for containment double Iyr = (P.y - line_p0.y)/(line_p1.y - line_p0.y); if(Iyr < 0.){ //out of bounds on the p0 side I.Set(line_p0.x, line_p0.y, 0.); rad = vectmag(I.x - P.x, I.y - P.y, 0.); return false; } else if(Iyr > 1.){ //out of bounds on the p1 side I.Set(line_p1.x, line_p1.y, 0.); rad = vectmag(I.x - P.x, I.y - P.y, 0.); return false; } I.Set(line_p0.x, P.y, 0.); } double drdx = (line_p1.y - line_p0.y)/(line_p1.x - line_p0.x), drdx_sq = pow(drdx,2); I.x = (P.x + P.y * drdx - line_p0.y*drdx + line_p0.x*drdx_sq)/(1. + drdx_sq); //check for containment double Ixr = (I.x - line_p0.x)/(line_p1.x - line_p0.x); if(Ixr < 0.){ //outside the bounds on the p0 side I.x = line_p0.x; I.y = line_p0.y; rad = vectmag(I.x - P.x, I.y - P.y, 0.); return false; } else if(Ixr > 1.){ //outside the bounds on the p1 side I.x = line_p1.x; I.y = line_p1.y; rad = vectmag(I.x - P.x, I.y - P.y, 0.); return false; } //in bounds I.y = line_p0.y + (I.x - line_p0.x)*drdx; rad = vectmag(I.x - P.x, I.y - P.y, 0.); return true; } void Toolbox::ellipse_bounding_box(double &A, double &B, double &phi, double sides[4], double cx, double cy){ /* This algorithm takes an ellipse in a plane at location {cx,cy} and with unrotated X axis size A, unrotated Y axis size B, and with angle of rotation 'phi' [radians] and calculates the bounding box edge locations in the coordinate system of the plane. This method fills the 'sides' array with values for: sides[0] | x-axis minimum sides[1] | x-axis maximum sides[2] | y-axis minimum sides[3] | y-axis maximum Reference: http://stackoverflow.com/questions/87734/how-do-you-calculate-the-axis-aligned-bounding-box-of-an-ellipse Governing equations are: x = cx + A*cos(t)*cos(phi) - b*sin(t)*sin(phi) y = cy + b*sin(t)*cos(phi) - a*cos(t)*sin(phi) where 't' is an eigenvalue with repeating solutions of dy/dt=0 For X values: 0 = dx/dt = -A*sin(t)*cos(phi) - B*cos(t)*sin(phi) --> tan(t) = -B*tan(phi)/A --> t = atan( -B*tan(phi)/A ) for Y values: 0 = dy/dt = B*cos(t)*cos(phi) - A*sin(t)*sin(phi) --> tan(t) = B*cot(phi)/A --> t = aan( B*cot(phi)/A ) */ //double pi = PI; //X first //double tx = atan( -B*tan(phi)/A ); double tx = atan2( -B*tan(phi), A); //plug back into the gov. equation double txx = A*cos(tx)*cos(phi) - B*sin(tx)*sin(phi); sides[0] = cx + txx/2.; sides[1] = cx - txx/2.; //enforce orderedness if(sides[1] < sides[0]) swap(&sides[0], &sides[1]); //Y next double ty = atan2( -B, tan(phi)*A ); double tyy = B*sin(ty)*cos(phi) - A*cos(ty)*sin(phi); sides[2] = cy + tyy/2.; sides[3] = cy - tyy/2.; if(sides[3] < sides[2]) swap(&sides[3], &sides[2]); } void Toolbox::convex_hull(std::vector<sp_point> &points, std::vector<sp_point> &hull) { /* Returns a list of points on the convex hull in counter-clockwise order. Note: the last point in the returned list is the same as the first one. Source: http://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain */ int n = (int)points.size(), k = 0; vector<sp_point> H(2*n); //copy points vector<sp_point> pointscpy; pointscpy.reserve( points.size() ); for(size_t i=0; i<points.size(); i++) pointscpy.push_back( points.at(i) ); // Sort points lexicographically sort(pointscpy.begin(), pointscpy.end()); // Build lower hull for (int i = 0; i < n; ++i) { while (k >= 2 && crossprod(H.at(k-2), H.at(k-1), pointscpy.at(i)) <= 0) k--; H.at(k++) = pointscpy[i]; } // Build upper hull for (int i = n-2, t = k+1; i >= 0; i--) { while (k >= t && crossprod(H.at(k-2), H.at(k-1), pointscpy.at(i)) <= 0) k--; H.at(k++) = pointscpy[i]; } H.resize(k); hull = H; } double Toolbox::area_polygon(std::vector<sp_point> &points){ /* INPUT: vector<sp_point> a list of 'sp_point' objects. OUTPUT: Return the total area ASSUME: we care about the area projected into the Z plane, therefore only x,y coordinates are considered. Calculate the area contained within a generic polygon. Use the projected segments method. The polygon can be convex or non-convex and can be irregular. The vector "points" is an ordered list of points composing the polygon in CLOCKWISE order. The final point in "points" is assumed to be connected to the first point in "points". */ //add the first point to the end of the list if( points.size() == 0 ) return 0.; points.push_back(points.front()); int npt = (int)points.size(); double area = 0.; for(int i=0; i<npt-1; i++){ double w = points.at(i).x - points.at(i+1).x; double ybar = (points.at(i).y + points.at(i+1).y)*0.5; area += w * ybar; } //restore the array points.pop_back(); return area; } typedef vector<sp_point> Poly; //Local definitino of polygon, used only in polyclip class polyclip { /* A class dedicated to clipping polygons This class must remain in Toolbox.cpp to compile! */ public: Poly clip(Poly &subjectPolygon, Poly &clipPolygon) { /* http://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm */ outputList = subjectPolygon; cp1 = clipPolygon.back(); for(int i=0; i<(int)clipPolygon.size(); i++) { cp2 = clipPolygon.at(i); inputList = outputList; outputList.clear(); s = inputList.back(); for(int j=0; j<(int)inputList.size(); j++) { e = inputList.at(j); if(inside(&e) ){ if(! inside(&s) ) outputList.push_back( computeIntersection() ); outputList.push_back(e); } else if( inside(&s) ){ outputList.push_back( computeIntersection() ); } s = e; } cp1 = cp2; } return outputList; } private: sp_point cp1, cp2; Poly outputList, inputList; sp_point s, e; bool inside(sp_point *P){ return (cp2.x - cp1.x)*(P->y - cp1.y) > (cp2.y - cp1.y)*(P->x - cp1.x); }; sp_point computeIntersection() { sp_point dc = cp1; dc.Subtract(cp2); sp_point dp = s; dp.Subtract(e); double n1 = cp1.x * cp2.y - cp1.y * cp2.x; double n2 = s.x * e.y - s.y * e.x; double n3 = 1./ (dc.x * dp.y - dc.y * dp.x); sp_point ret; ret.Set((n1*dp.x - n2*dc.x) * n3, (n1*dp.y - n2*dc.y)*n3, 0.); return ret; } }; vector<sp_point> Toolbox::clipPolygon(std::vector<sp_point> &A, std::vector<sp_point> &B) { /* Compute the polygon that forms the intersection of two polygons subjectPolygon and clipPolygon. (clipPolygon clips subjectPolygon). This only considers 2D polygons -- vertices X and Y in "sp_point" structure! */ polyclip P; return P.clip(A,B); } void Toolbox::BezierQ(sp_point &start, sp_point &control, sp_point &end, double t, sp_point &result) { /* Locate a point 'result' along a quadratic Bezier curve. */ double tc = 1. - t; result.x = tc * tc * start.x + 2 * (1 - t) * t * control.x + t * t * end.x; result.y = tc * tc * start.y + 2 * (1 - t) * t * control.y + t * t * end.y; result.z = tc * tc * start.z + 2 * (1 - t) * t * control.z + t * t * end.z; } void Toolbox::BezierC(sp_point &start, sp_point &control1, sp_point &control2, sp_point &end, double t, sp_point &result) { /* Locate a point 'result' along a cubic Bezier curve. */ double tc = 1. - t; result.x = tc*tc*tc * start.x + 3. * tc *tc * t * control1.x + 3. * tc * t * t * control2.x + t * t * t * end.x; result.y = tc*tc*tc * start.y + 3. * tc *tc * t * control1.y + 3. * tc * t * t * control2.y + t * t * t * end.y; result.z = tc*tc*tc * start.z + 3. * tc *tc * t * control1.z + 3. * tc * t * t * control2.z + t * t * t * end.z; } void Toolbox::poly_from_svg(std::string &svg, std::vector< sp_point > &polygon, bool clear_poly) //construct a polygon from an SVG path { /* The following commands are available for path data: M = moveto L = lineto H = horizontal lineto V = vertical lineto C = curveto Q = quadratic Bezier curve Z = closepath >> not yet supported S = smooth curveto T = smooth quadratic Bezier curveto A = elliptical Arc << Note: All of the commands above can also be expressed with lower letters. Capital letters means absolutely positioned, lower cases means relatively positioned. */ int move=-1; //initialize std::string movedat; bool process_now = false; if( clear_poly ) polygon.clear(); polygon.reserve( svg.size()/5 ); double x0,y0; x0=y0=0.; //last position for relative calcs for(size_t i=0; i<svg.size(); i++) { int c = svg.at(i); if( c > 64 && c < 123 ) //a new command { if( move > 0 ) process_now = true; else move = c; } else { movedat += svg.at(i); } if( process_now ) { std::vector< std::string > points_s = split(movedat, " "); std::vector< std::vector<double> > points; for(size_t j=0; j<points_s.size(); j++) { std::vector< std::string > xy_s = split( points_s.at(j), "," ); points.push_back( std::vector<double>() ); for( size_t k=0; k<xy_s.size(); k++) { points.back().push_back( 0 ); to_double( xy_s.at(k), &points.back().at(k) ); } } int npt = (int)points.size(); switch (move) { case 'm': //pick up and move cursor (reset last position) x0 += points.front().at(0); y0 += points.front().at(1); polygon.push_back( sp_point(x0, -y0, 0.) ); if( npt > 1 ) //any subsequent points are assumed to be 'l' { for(int j=1; j<npt; j++) { x0 += points.at(j).at(0); y0 += points.at(j).at(1); polygon.push_back( sp_point(x0, -y0, 0.) ); } } break; case 'M': //pick up and move cursor (reset last position) x0 = points.front().at(0); y0 = points.front().at(1); polygon.push_back( sp_point(x0, -y0, 0.) ); if( npt > 1 ) //any subsequent points are assumed to be 'l' { for(int j=1; j<npt; j++) { x0 += points.at(j).at(0); y0 += points.at(j).at(1); polygon.push_back( sp_point(x0, -y0, 0.) ); } } break; case 'l': //trace all points for(int j=0; j<npt; j++) { x0 += points.at(j).at(0); y0 += points.at(j).at(1); polygon.push_back( sp_point(x0, -y0, 0.) ); } break; case 'L': //trace all points - absolute for(int j=0; j<npt; j++) { x0 = points.at(j).at(0); y0 = points.at(j).at(1); polygon.push_back( sp_point(x0, -y0, 0.) ); } break; case 'h': //horizontal line relative for(int j=0; j<npt; j++) { x0 += points.at(j).front(); polygon.push_back( sp_point(x0, -y0, 0.) ); } break; case 'H': //horizontal line absolute for(int j=0; j<npt; j++) { x0 = points.at(j).front(); polygon.push_back( sp_point(x0, -y0, 0.) ); } break; case 'v': //vertical line relative for(int j=0; j<npt; j++) { y0 += points.at(j).front(); polygon.push_back( sp_point(x0, -y0, 0.) ); } break; case 'V': //vertical line absolute for(int j=0; j<npt; j++) { y0 = points.at(j).front(); polygon.push_back( sp_point(x0, -y0, 0.) ); } break; case 'q': case 'Q': { //bezier curve double xcond=0.; double ycond=0.; //check to make sure there are an even number of points if( npt % 2 != 0 ) return; int nbz = 5; //number of internal bezier points for(int j=0; j<npt; j+=2) //jump through in pairs { sp_point start(x0, y0, 0.); if( move == 'q' ) //if relative, set the relative adder to the start point location { xcond = start.x; ycond = start.y; } sp_point control( points.at(j).at(0) + xcond, points.at(j).at(1) + ycond, 0. ); sp_point end( points.at(j+1).at(0) + xcond, points.at(j+1).at(1) + ycond, 0. ); for(int k=0; k<nbz; k++) { double t = (k+1)/(double)(nbz+1); sp_point result; Toolbox::BezierQ(start, control, end, t, result); result.y = -result.y; polygon.push_back( result ); } //update cursor position x0 = end.x; y0 = end.y; //add the end point end.y = -end.y; polygon.push_back( end ); } break; } case 'c': case 'C': { //bezier curve double xcond=0.; double ycond=0.; //check to make sure there are a divisible number of points if( npt % 3 != 0 ) return; int nbz = 7; //number of internal bezier points for(int j=0; j<npt; j+=3) //jump through in pairs { sp_point start(x0, y0, 0.); //sp_point start = polygon.back(); if( move == 'c' ) //if relative, set the relative adder to the start point location { xcond = start.x; ycond = start.y; } sp_point control1( points.at(j).at(0) + xcond, points.at(j).at(1) + ycond, 0. ); sp_point control2( points.at(j+1).at(0) + xcond, points.at(j+1).at(1) + ycond, 0. ); sp_point end( points.at(j+2).at(0) + xcond, points.at(j+2).at(1) + ycond, 0. ); for(int k=0; k<nbz; k++) { double t = (k+1)/(double)(nbz+2); sp_point result; Toolbox::BezierC(start, control1, control2, end, t, result); result.y = -result.y; polygon.push_back( result ); } //update cursor position x0 = end.x; y0 = end.y; //add the end point end.y = -end.y; polygon.push_back( end ); } break; } case 'z': case 'Z': break; default: //c, t, s, a break; } movedat.clear(); move = c; //next move process_now = false; } } return; } sp_point Toolbox::rotation_arbitrary(double theta, Vect &axis, sp_point &axloc, sp_point &pt){ /* Rotation of a point 'pt' about an arbitrary axis with direction 'axis' centered at point 'axloc'. The point is rotated through 'theta' radians. http://inside.mines.edu/~gmurray/ArbitraryAxisRotation/ Returns the rotated sp_point location */ double a = axloc.x, //Point through which the axis passes b = axloc.y, c = axloc.z, x = pt.x, //Point that we're rotating y = pt.y, z = pt.z, u = axis.i, //Direction of the axis that we're rotating about v = axis.j, w = axis.k; sp_point fin; double sinth = sin(theta), costh = cos(theta); fin.x = (a*(pow(v,2)+pow(w,2)) - u*(b*v + c*w - u*x - v*y - w*z))*(1.-costh) + x*costh + (-c*v + b*w - w*y + v*z)*sinth; fin.y = (b*(pow(u,2)+pow(w,2)) - v*(a*u + c*w - u*x - v*y - w*z))*(1.-costh) + y*costh + (c*u - a*w + w*x - u*z)*sinth; fin.z = (c*(pow(u,2)+pow(v,2)) - w*(a*u + b*v - u*x - v*y - w*z))*(1.-costh) + z*costh + (-b*u + a*v - v*x + u*y)*sinth; return fin; } double Toolbox::ZRotationTransform(Vect &normal_vect){ /* When a heliostat position is transformed using the SolTrace convention, the heliostat ends up such that the horizontal (x) axis is not parallel with the ground XZ plane. This is caused by a mismatch between conventional rotation about (1) the y axis and (2) the rotated y axis, and azimuth-elevation rotation about (1) the x axis and (2) the original z axis. This method calculates the angle of rotation about the modified z-axis in order to restore the azimuth-elevation positioning. Rotations are assumed to be: (1) CCW about Y axis (2) CW about X' axis (3) CW about Z'' axis */ //double Pi = PI; double az = atan3(normal_vect.i,normal_vect.j); double el = asin(normal_vect.k); //Calculate Euler angles double alpha = atan2(normal_vect.i, normal_vect.k); //Rotation about the Y axis double bsign = normal_vect.j > 0. ? 1. : -1.; double beta = -bsign*acos( ( pow(normal_vect.i,2) + pow(normal_vect.k,2) )/ max(sqrt(pow(normal_vect.i,2) + pow(normal_vect.k,2)), 1.e-8) ); //Rotation about the modified X axis //Calculate the modified axis vector Vect modax; modax.Set( cos(alpha), 0., -sin(alpha) ); //Rotation references - axis point sp_point axpos; axpos.Set(0.,0.,0.); //Set as origin //sp_point to rotate sp_point pbase; pbase.Set(0., -1., 0.); //lower edge of heliostat //Rotated point sp_point prot = Toolbox::rotation_arbitrary(beta, modax, axpos, pbase); //Azimuth/elevation reference vector (vector normal to where the base of the heliostat should be) Vect azelref; azelref.Set( sin(az)*sin(el), cos(az)*sin(el), -cos(el) ); //Calculate the angle between the rotated point and the azel ref vector //double gamma = acos( Toolbox::dotprod(azelref, prot) ); /* the sign of the rotation angle is determined by whether the 'k' component of the cross product vector is positive or negative. */ Vect protv; protv.Set(prot.x, prot.y, prot.z); unitvect(protv); Vect cp = crossprod(protv, azelref); double gamma = asin( vectmag( cp )); double gsign = (cp.k > 0. ? 1. : -1.) * (normal_vect.j > 0. ? 1. : -1.); return gamma * gsign; } double Toolbox::ZRotationTransform(double Az, double Zen){ /* Overload for az-zen specification Notes: The Azimuth angle should be [-180,180], zero is north, +east, -west. Az and Zen are both in Radians. */ //Calculate the normal vector to the heliostat based on elevation and azimuth double Pi = PI; double el = Pi/2.-Zen; double az = Az+Pi; //Transform to 0..360 (in radians) Vect aim; aim.Set( sin(az)*cos(el), cos(az)*cos(el), sin(el) ); return ZRotationTransform(aim); } double Toolbox::intersect_fuv(double U, double V){ /* Helper function for intersect_ellipse_rect() */ double u2 = sqrt(1.-pow(U,2)), v2 = sqrt(1.-pow(V,2)); return asin(u2 * v2 - U*V) - U*u2 - V*v2 + 2.*U*V; } double Toolbox::intersect_ellipse_rect(double rect[4], double ellipse[2]){ /* Calculate the area of intersection of a rectangle and an ellipse where the sides of the rectangle area parallel with the axes of the ellipse. {rect[0], rect[1]} = Point location of center of rectangle {rect[2], rect[3]} = Rectangle width, Rectangle height {ellipse[0], ellipse[1]} = Ellipse width and height (A.D. Groves, 1963. Area of intersection of an ellipse and a rectangle. Ballistic Research Laboratories.) */ //Unpack double //a = rect[0] - rect[2]/2., //Lower left corner X location //b = rect[1] - rect[3]/2., //Lower left corner Y location c = rect[2], //Rect width d = rect[3]; //Rect height double w = ellipse[0], //Ellipse width h = ellipse[1]; //Ellipse height //Construct 4 separate possible rectangles double A[4], B[4], C[4], D[4]; for(int i=1; i<5; i++){ A[i-1] = max(0., pow(-1, (pow((double)i,2)-i)/2)*rect[0] - c/2.); B[i-1] = max(0., pow(-1, (pow((double)i,2)+i-2)/2)*rect[1] - d/2.); C[i-1] = max(0., pow(-1, (pow((double)i,2)-i)/2)*rect[0]+c/d-A[i-1]); D[i-1] = max(0., pow(-1, (pow((double)i,2)+i-2)/2)*rect[1]+d/2.-B[i-1]); } double atot=0.; for(int i=0; i<4; i++){ if(C[i] == 0. || D[i] == 0.) continue; //No area if width or height are 0 //Calculate vertex radii double V[4]; V[0] = pow(A[i]/w,2) + pow(B[i]/h,2); V[1] = pow(A[i]/w,2) + pow((B[i]+D[i])/h,2); V[2] = pow((A[i]+C[i])/w,2) + pow((B[i]+D[i])/h,2); V[3] = pow((A[i]+C[i])/w,2) + pow(B[i]/h,2); //Seven cases if(pow(A[i]/w,2) + pow(B[i]/h,2) >= 1.){ continue; //no area overlap } else if(V[0] < 1. && V[1] >= 1 && V[3] >= 1.){ //Lower left vertex is the only one in the ellipse atot += w*h/2.*intersect_fuv(A[i]/w, B[i]/h); } else if(V[3] < 1. && V[1] >= 1.){ //Lower edge inside ellipse, upper edge outside atot += w*h/2. * (intersect_fuv(A[i]/w, B[i]/h) - intersect_fuv((A[i]+C[i])/w, B[i]/h)); } else if(V[1] < 1. && V[3] >= 1.){ //Left edge inside, right edge outside atot += w*h/2. * (intersect_fuv(A[i]/w, B[i]/h) - intersect_fuv(A[i]/w, (B[i]+D[i])/h)); } else if(V[1] < 1. && V[3] < 1. && V[2] > 1.){ //All vertices inside ellipse except upper right corner atot += w*h/2.*(intersect_fuv(A[i]/w, B[i]/h) - intersect_fuv((A[i]+C[i])/w, B[i]/h) - intersect_fuv(A[i]/w, (B[i]+D[i])/h)); } else if(V[2] < 1.){ //All vertices inside the ellipse atot += w*h; } else{ continue; //Error } } return atot; } string Toolbox::getDelimiter(std::string &text){ if (text.empty()) return ","; //Find the type of delimiter vector<string> delims; delims.push_back(","); delims.push_back(" "); delims.push_back("\t"); delims.push_back(";"); string delim = "\t"; //initialize int ns=0; for(int i=0; i<4; i++){ vector<string> data = Toolbox::split(text, delims[i]); if((int)data.size()>ns){ delim = delims[i]; ns = (int)data.size(); } //pick the delimiter that returns the most entries } return delim; } vector< string > Toolbox::split( const string &str, const string &delim, bool ret_empty, bool ret_delim ) { //Take a string with a delimiter and return a vector of separated values vector< string > list; char cur_delim[2] = {0,0}; string::size_type m_pos = 0; string token; int dsize = (int)delim.size(); while (m_pos < str.length()) { //string::size_type pos = str.find_first_of(delim, m_pos); string::size_type pos = str.find(delim, m_pos); if (pos == string::npos) { cur_delim[0] = 0; token.assign(str, m_pos, string::npos); m_pos = str.length(); } else { cur_delim[0] = str[pos]; string::size_type len = pos - m_pos; token.assign(str, m_pos, len); //m_pos = pos + 1; m_pos = pos + dsize; } if (token.empty() && !ret_empty) continue; list.push_back( token ); if ( ret_delim && cur_delim[0] != 0 && m_pos < str.length() ) list.push_back( string( cur_delim ) ); } return list; }
27.523759
178
0.585118
rchintala13
cce4c58fd7f2fe5c465f493d28169a189cb5e6b9
2,019
cpp
C++
cocos2dx_playground/Classes/cpg_input_BasicKeyCollector.cpp
R2Road/cocos2dx_playground
6e6f349b5c9fc702558fe8720ba9253a8ba00164
[ "Apache-2.0" ]
9
2020-06-11T17:09:44.000Z
2021-12-25T00:34:33.000Z
cocos2dx_playground/Classes/cpg_input_BasicKeyCollector.cpp
R2Road/cocos2dx_playground
6e6f349b5c9fc702558fe8720ba9253a8ba00164
[ "Apache-2.0" ]
9
2019-12-21T15:01:01.000Z
2020-12-05T15:42:43.000Z
cocos2dx_playground/Classes/cpg_input_BasicKeyCollector.cpp
R2Road/cocos2dx_playground
6e6f349b5c9fc702558fe8720ba9253a8ba00164
[ "Apache-2.0" ]
1
2020-09-07T01:32:16.000Z
2020-09-07T01:32:16.000Z
#include "cpg_input_BasicKeyCollector.h" #include "cpg_input_KeyMap.h" #include "step_rain_of_chaos_input_KeyCodeCollector.h" USING_NS_CC; namespace cpg_input { BasicKeyCollector::BasicKeyCollector( const KeyMapSp& key_map_container ) : iKeyCollector( key_map_container ) , mKeyHistory() , mCurrent_KeyStatus_Container() , mLast_KeyStatus_Container() { mLast_KeyStatus_Container = mKeyHistory.begin(); mCurrent_KeyStatus_Container = mLast_KeyStatus_Container + 1; } KeyCollectorSp BasicKeyCollector::create( const KeyMapSp& key_map_container ) { KeyCollectorSp ret( new ( std::nothrow ) BasicKeyCollector( key_map_container ) ); return ret; } void BasicKeyCollector::collect( const step_rain_of_chaos::input::KeyCodeCollector& key_code_collector ) { for( const auto k : mKeyMapContainer->mContainer ) ( *mCurrent_KeyStatus_Container )[k.idx] = key_code_collector.isActiveKey( k.keycode ); } void BasicKeyCollector::update_forHistory() { if( mLast_KeyStatus_Container->to_ulong() != mCurrent_KeyStatus_Container->to_ulong() ) { mLast_KeyStatus_Container = mCurrent_KeyStatus_Container; ++mCurrent_KeyStatus_Container; if( mKeyHistory.end() == mCurrent_KeyStatus_Container ) mCurrent_KeyStatus_Container = mKeyHistory.begin(); *mCurrent_KeyStatus_Container = *mLast_KeyStatus_Container; } } bool BasicKeyCollector::getKeyStatus( const cocos2d::EventKeyboard::KeyCode keycode ) const { for( auto& k : mKeyMapContainer->mContainer ) if( keycode == k.keycode ) return ( *mCurrent_KeyStatus_Container )[k.idx]; return false; } bool BasicKeyCollector::getKeyStatus( const int target_key_index ) const { if( 0 > target_key_index || static_cast<std::size_t>( target_key_index ) >= ( *mCurrent_KeyStatus_Container ).size() ) return false; return ( *mCurrent_KeyStatus_Container )[target_key_index]; } bool BasicKeyCollector::hasChanged() const { return mLast_KeyStatus_Container->to_ulong() != mCurrent_KeyStatus_Container->to_ulong(); } }
33.098361
120
0.771174
R2Road
cce5501e3b418a4945627888a305392c92ee0906
1,763
inl
C++
libblk/info.inl
transpixel/tpqz
2d8400b1be03292d0c5ab74710b87e798ae6c52c
[ "MIT" ]
1
2017-06-01T00:21:16.000Z
2017-06-01T00:21:16.000Z
libblk/info.inl
transpixel/tpqz
2d8400b1be03292d0c5ab74710b87e798ae6c52c
[ "MIT" ]
3
2017-06-01T00:26:16.000Z
2020-05-09T21:06:27.000Z
libblk/info.inl
transpixel/tpqz
2d8400b1be03292d0c5ab74710b87e798ae6c52c
[ "MIT" ]
null
null
null
// // // MIT License // // Copyright (c) 2017 Stellacore Corporation. // // 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. // // /*! \file \brief Definitions for blk::info */ namespace blk { template <typename TypeKey> std::string infoString ( std::map<TypeKey, ga::Rigid> const & oriMap , std::string const & title ) { std::ostringstream oss; if (! title.empty()) { oss << title << std::endl; } oss << "NumberNodes: " << oriMap.size(); for (typename std::map<TypeKey, ga::Rigid>::const_iterator iter(oriMap.begin()) ; oriMap.end() != iter ; ++iter) { oss << std::endl; oss << dat::infoString(iter->first) << " " << ":" << " " << iter->second.infoStringShort() ; } return oss.str(); } } // blk
25.926471
72
0.695973
transpixel
cce6a75dd76da1b27efb082873e079f1c618091f
6,868
hpp
C++
src/Renderer.hpp
CobaltXII/Tempest
5963e21b98cd414b1b525b11a193512ec3e35f14
[ "MIT" ]
4
2020-01-03T02:52:53.000Z
2021-09-16T23:03:06.000Z
src/Renderer.hpp
CobaltXII/Tempest
5963e21b98cd414b1b525b11a193512ec3e35f14
[ "MIT" ]
null
null
null
src/Renderer.hpp
CobaltXII/Tempest
5963e21b98cd414b1b525b11a193512ec3e35f14
[ "MIT" ]
null
null
null
// A renderer. struct Renderer { const float FOV = 60.0f; const float NEAR_PLANE = 0.5f; const float FAR_PLANE = 5000.0f; Display display; glm::mat4 projection; int width; int height; Renderer() { return; } Renderer(std::string title, int width, int height) { display = Display(title, width, height); SDL_GL_GetDrawableSize(display.window, &this->width, &this->height); projection = glm::perspectiveFov( glm::radians(FOV), float(display.width), float(display.height), NEAR_PLANE, FAR_PLANE ); } // Get the mouse ray. glm::vec3 getMouseRay(Camera camera, int mouseX, int mouseY) { float u = float(mouseX) * 2.0f / float(display.width) - 1.0f; float v = 1.0f - float(mouseY) * 2.0f / float(display.height); glm::vec4 b = glm::inverse(projection) * glm::vec4(u, v, -1.0f, 1.0f); return normalize(glm::inverse(camera.getView()) * glm::vec4(b.x, b.y, -1.0f, 0.0f)); } // Get the time in seconds. float getTime() { return float(SDL_GetTicks()) / 1000.0f; } // Bind the default framebuffer. void bindDefaultFramebuffer() { glBindFramebuffer(GL_FRAMEBUFFER, 0); glViewport(0, 0, width, height); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } // Unbind the default framebuffer. void unbindDefaultFramebuffer() { return; } // Prepare the frame. void prepare() { glEnable(GL_DEPTH_TEST); glEnable(GL_CULL_FACE); glCullFace(GL_BACK); } // Render a textured model. template<typename T> void renderTexturedModel(TexturedModel& model, T& shader) { glBindVertexArray(model.model.vaoID); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); shader.setUniformSampler2D(shader.uTexture, GL_TEXTURE0, model.texture.textureID); glDrawArrays(GL_TRIANGLES, 0, model.model.vertexCount); glDisableVertexAttribArray(2); glDisableVertexAttribArray(1); glDisableVertexAttribArray(0); glBindVertexArray(0); } // Render a terrain object. template<typename T> void renderTerrainObject(TerrainObject& model, T& shader) { glBindVertexArray(model.model.vaoID); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); shader.setUniformSampler2D(shader.uTexture1, GL_TEXTURE0, model.texture1.textureID); shader.setUniformSampler2D(shader.uTexture2, GL_TEXTURE1, model.texture2.textureID); shader.setUniformSampler2D(shader.uTexture3, GL_TEXTURE2, model.texture3.textureID); shader.setUniformSampler2D(shader.uHeightmap, GL_TEXTURE3, model.heightmap.textureID); glDrawArrays(GL_TRIANGLES, 0, model.model.vertexCount); glDisableVertexAttribArray(1); glDisableVertexAttribArray(0); glBindVertexArray(0); } // Render an entity. template<typename T> void renderEntity(Entity& entity, T& shader) { glBindVertexArray(entity.model.model.vaoID); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); shader.setUniformSampler2D(shader.uTexture, GL_TEXTURE0, entity.model.texture.textureID); glm::mat4 transformation = createTransformation( entity.position, entity.rotation, entity.scale ); shader.setModel(transformation); glDrawArrays(GL_TRIANGLES, 0, entity.model.model.vertexCount); glDisableVertexAttribArray(2); glDisableVertexAttribArray(1); glDisableVertexAttribArray(0); glBindVertexArray(0); } // Render entities. template<typename T> void renderEntities(std::vector<Entity> entities, T& shader) { if (entities.empty()) { return; } glBindVertexArray(entities[0].model.model.vaoID); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); shader.setUniformSampler2D(shader.uTexture, GL_TEXTURE0, entities[0].model.texture.textureID); for (auto& entity: entities) { glm::mat4 transformation = createTransformation( entity.position, entity.rotation, entity.scale ); shader.setModel(transformation); glDrawArrays(GL_TRIANGLES, 0, entity.model.model.vertexCount); } glDisableVertexAttribArray(2); glDisableVertexAttribArray(1); glDisableVertexAttribArray(0); glBindVertexArray(0); } // Render a cubemap. template<typename T> void renderCubemap(Cubemap& cubemap, T& shader) { glDisable(GL_DEPTH_TEST); glBindVertexArray(cubemap.modelID); glEnableVertexAttribArray(0); shader.setUniformSamplerCube(cubemap.cubemapID); glDrawArrays(GL_TRIANGLES, 0, 36); glDisableVertexAttribArray(0); glBindVertexArray(0); glEnable(GL_DEPTH_TEST); } // Render a quad. template<typename T> void renderQuad(Model& model, GLuint textureID, T& shader) { glDisable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE); glBindVertexArray(model.vaoID); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); shader.setUniformSampler2D(shader.uTexture, GL_TEXTURE0, textureID); glDrawArrays(GL_TRIANGLES, 0, model.vertexCount); glDisableVertexAttribArray(1); glDisableVertexAttribArray(0); glBindVertexArray(0); glEnable(GL_CULL_FACE); glEnable(GL_DEPTH_TEST); } // Render an untextured quad. void renderUntexturedQuad(Model& model) { glDisable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE); glBindVertexArray(model.vaoID); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glDrawArrays(GL_TRIANGLES, 0, model.vertexCount); glDisableVertexAttribArray(1); glDisableVertexAttribArray(0); glBindVertexArray(0); glEnable(GL_CULL_FACE); glEnable(GL_DEPTH_TEST); } // Render water. template<typename T> void renderWaterObject(WaterObject& model, T& shader) { glBindVertexArray(model.model.vaoID); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); shader.setUniformSampler2D(shader.uReflectionTexture, GL_TEXTURE0, model.reflectionTextureID); shader.setUniformSampler2D(shader.uRefractionTexture, GL_TEXTURE1, model.refractionTextureID); shader.setUniformSampler2D(shader.uDepthTexture, GL_TEXTURE2, model.refractionDepthTextureID); shader.setUniformSampler2D(shader.uWaterDuDv, GL_TEXTURE3, model.waterDuDv.textureID); shader.setUniformSampler2D(shader.uWaterNormal, GL_TEXTURE4, model.waterNormal.textureID); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDrawArrays(GL_TRIANGLES, 0, model.model.vertexCount); glDisable(GL_BLEND); glDisableVertexAttribArray(2); glDisableVertexAttribArray(1); glDisableVertexAttribArray(0); glBindVertexArray(0); } // Prepare ImGui. void prepareImGui() { ImGui_ImplOpenGL3_NewFrame(); ImGui_ImplSDL2_NewFrame(display.window); ImGui::NewFrame(); } // Render ImGui. void renderImGui() { ImGui::Render(); ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); } // Update the frame. void update(int fps) { display.update(fps); } // Destroy the renderer. void destroy() { display.destroy(); } };
27.805668
96
0.755679
CobaltXII
cceaba2286593dc1fa55e6559cc1ece25b0bc55a
18,490
cpp
C++
src/QMCWaveFunctions/tests/test_einset_spinor.cpp
kayahans/qmcpack
c25d77702e36363ff7368ded783bf31c1b1c5f17
[ "NCSA" ]
null
null
null
src/QMCWaveFunctions/tests/test_einset_spinor.cpp
kayahans/qmcpack
c25d77702e36363ff7368ded783bf31c1b1c5f17
[ "NCSA" ]
null
null
null
src/QMCWaveFunctions/tests/test_einset_spinor.cpp
kayahans/qmcpack
c25d77702e36363ff7368ded783bf31c1b1c5f17
[ "NCSA" ]
null
null
null
////////////////////////////////////////////////////////////////////////////////////// // This file is distributed under the University of Illinois/NCSA Open Source License. // See LICENSE file in top directory for details. // // Copyright (c) 2020 Jeongnim Kim and QMCPACK developers. // // File developed by: Raymond Clay, rclay@sandia.gov, Sandia National Laboratories // // File created by: Raymond Clay, rclay@sandia.gov, Sandia National Laboratories ////////////////////////////////////////////////////////////////////////////////////// #include "catch.hpp" #include "OhmmsData/Libxml2Doc.h" #include "OhmmsPETE/OhmmsMatrix.h" #include "Particle/ParticleSet.h" #include "Particle/ParticleSetPool.h" #include "QMCWaveFunctions/WaveFunctionComponent.h" #include "QMCWaveFunctions/EinsplineSetBuilder.h" #include "QMCWaveFunctions/EinsplineSpinorSetBuilder.h" #include <stdio.h> #include <string> #include <limits> using std::string; namespace qmcplusplus { //Now we test the spinor set with Einspline orbitals from HDF. #ifdef QMC_COMPLEX TEST_CASE("Einspline SpinorSet from HDF", "[wavefunction]") { app_log() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; app_log() << "!!!!! Einspline SpinorSet from HDF !!!!!\n"; app_log() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; using ValueType = SPOSet::ValueType; using RealType = SPOSet::RealType; Communicate* c; c = OHMMS::Controller; ParticleSet ions_; ParticleSet elec_; ions_.setName("ion"); ions_.create(2); ions_.R[0][0] = 0.00000000; ions_.R[0][1] = 0.00000000; ions_.R[0][2] = 1.08659253; ions_.R[1][0] = 0.00000000; ions_.R[1][1] = 0.00000000; ions_.R[1][2] = -1.08659253; elec_.setName("elec"); elec_.create(3); elec_.R[0][0] = 0.1; elec_.R[0][1] = -0.3; elec_.R[0][2] = 1.0; elec_.R[1][0] = -0.1; elec_.R[1][1] = 0.3; elec_.R[1][2] = 1.0; elec_.R[2][0] = 0.1; elec_.R[2][1] = 0.2; elec_.R[2][2] = 0.3; elec_.spins[0] = 0.0; elec_.spins[1] = 0.2; elec_.spins[2] = 0.4; // O2 test example from pwscf non-collinear calculation. elec_.Lattice.R(0, 0) = 5.10509515; elec_.Lattice.R(0, 1) = -3.23993545; elec_.Lattice.R(0, 2) = 0.00000000; elec_.Lattice.R(1, 0) = 5.10509515; elec_.Lattice.R(1, 1) = 3.23993545; elec_.Lattice.R(1, 2) = 0.00000000; elec_.Lattice.R(2, 0) = -6.49690625; elec_.Lattice.R(2, 1) = 0.00000000; elec_.Lattice.R(2, 2) = 7.08268015; SpeciesSet& tspecies = elec_.getSpeciesSet(); int upIdx = tspecies.addSpecies("u"); int chargeIdx = tspecies.addAttribute("charge"); tspecies(chargeIdx, upIdx) = -1; ParticleSetPool ptcl = ParticleSetPool(c); ptcl.addParticleSet(&elec_); ptcl.addParticleSet(&ions_); const char* particles = "<tmp> \ <sposet_builder name=\"A\" type=\"spinorbspline\" href=\"o2_45deg_spins.pwscf.h5\" tilematrix=\"1 0 0 0 1 0 0 0 1\" twistnum=\"0\" source=\"ion\" size=\"3\" precision=\"float\"> \ <sposet name=\"myspo\" size=\"3\"> \ <occupation mode=\"ground\"/> \ </sposet> \ </sposet_builder> \ </tmp> \ "; Libxml2Document doc; bool okay = doc.parseFromString(particles); REQUIRE(okay); xmlNodePtr root = doc.getRoot(); xmlNodePtr ein1 = xmlFirstElementChild(root); EinsplineSpinorSetBuilder einSet(elec_, ptcl.getPool(), c, ein1); std::unique_ptr<SPOSet> spo(einSet.createSPOSetFromXML(ein1)); REQUIRE(spo); SPOSet::ValueMatrix_t psiM(elec_.R.size(), spo->getOrbitalSetSize()); SPOSet::GradMatrix_t dpsiM(elec_.R.size(), spo->getOrbitalSetSize()); SPOSet::ValueMatrix_t dspsiM(elec_.R.size(), spo->getOrbitalSetSize()); //spin gradient SPOSet::ValueMatrix_t d2psiM(elec_.R.size(), spo->getOrbitalSetSize()); //These are the reference values computed from a spin-polarized calculation, //with the assumption that the coefficients for phi^\uparrow SPOSet::ValueMatrix_t psiM_up(elec_.R.size(), spo->getOrbitalSetSize()); SPOSet::ValueMatrix_t psiM_down(elec_.R.size(), spo->getOrbitalSetSize()); SPOSet::ValueMatrix_t psiM_ref(elec_.R.size(), spo->getOrbitalSetSize()); SPOSet::ValueMatrix_t dspsiM_ref(elec_.R.size(), spo->getOrbitalSetSize()); SPOSet::GradMatrix_t dpsiM_up(elec_.R.size(), spo->getOrbitalSetSize()); SPOSet::GradMatrix_t dpsiM_down(elec_.R.size(), spo->getOrbitalSetSize()); SPOSet::GradMatrix_t dpsiM_ref(elec_.R.size(), spo->getOrbitalSetSize()); SPOSet::ValueMatrix_t d2psiM_up(elec_.R.size(), spo->getOrbitalSetSize()); SPOSet::ValueMatrix_t d2psiM_down(elec_.R.size(), spo->getOrbitalSetSize()); SPOSet::ValueMatrix_t d2psiM_ref(elec_.R.size(), spo->getOrbitalSetSize()); //These reference values were generated as follows: // 1.) Non-Collinear O2 calculation in PBC's performed using Quantum Espresso. // 2.) Spinor wavefunction converted to HDF5 using convertpw4qmc tool. Mainly, this places the up channel in the spin_0 slot, and spin down in spin_1. // 3.) The HDF5 metadata was hacked by hand to correspond to a fictional but consistent spin-polarized set of orbitals. // 4.) A spin polarized QMCPACK run was done using the electron and ion configuration specified in this block. Orbital values, gradients, and laplacians were calculated // for both "spin up" and "spin down" orbitals. This is where the psiM_up(down), d2psiM_up(down) values come from. // 5.) By hand, the reference values, gradients, and laplacians are calculated by using the formula for a spinor e^is phi_up + e^{-is} phi_down. // 6.) These are compared against the integrated initialization/parsing/evaluation of the Einspline Spinor object. //Reference values for spin up component. psiM_up[0][0] = ValueType(2.8696985245e+00, -2.8696982861e+00); psiM_up[0][1] = ValueType(1.1698637009e+00, -1.1698638201e+00); psiM_up[0][2] = ValueType(-2.6149117947e+00, 2.6149117947e+00); psiM_up[1][0] = ValueType(2.8670933247e+00, -2.8670933247e+00); psiM_up[1][1] = ValueType(1.1687355042e+00, -1.1687356234e+00); psiM_up[1][2] = ValueType(-2.6131081581e+00, 2.6131081581e+00); psiM_up[2][0] = ValueType(4.4833350182e+00, -4.4833350182e+00); psiM_up[2][1] = ValueType(1.8927993774e+00, -1.8927993774e+00); psiM_up[2][2] = ValueType(-8.3977413177e-01, 8.3977431059e-01); //Reference values for spin down component. psiM_down[0][0] = ValueType(1.1886650324e+00, -1.1886655092e+00); psiM_down[0][1] = ValueType(-2.8243079185e+00, 2.8243076801e+00); psiM_down[0][2] = ValueType(-1.0831292868e+00, 1.0831292868e+00); psiM_down[1][0] = ValueType(1.1875861883e+00, -1.1875866652e+00); psiM_down[1][1] = ValueType(-2.8215842247e+00, 2.8215837479e+00); psiM_down[1][2] = ValueType(-1.0823822021e+00, 1.0823823214e+00); psiM_down[2][0] = ValueType(1.8570541143e+00, -1.8570543528e+00); psiM_down[2][1] = ValueType(-4.5696320534e+00, 4.5696320534e+00); psiM_down[2][2] = ValueType(-3.4784498811e-01, 3.4784474969e-01); //And the laplacians... d2psiM_up[0][0] = ValueType(-6.1587309837e+00, 6.1587429047e+00); d2psiM_up[0][1] = ValueType(-2.4736759663e+00, 2.4736781120e+00); d2psiM_up[0][2] = ValueType(2.1381640434e-01, -2.1381306648e-01); d2psiM_up[1][0] = ValueType(-5.0561609268e+00, 5.0561575890e+00); d2psiM_up[1][1] = ValueType(-2.0328726768e+00, 2.0328762531e+00); d2psiM_up[1][2] = ValueType(-7.4090242386e-01, 7.4090546370e-01); d2psiM_up[2][0] = ValueType(-1.8970542908e+01, 1.8970539093e+01); d2psiM_up[2][1] = ValueType(-8.2134075165e+00, 8.2134037018e+00); d2psiM_up[2][2] = ValueType(1.0161912441e+00, -1.0161914825e+00); d2psiM_down[0][0] = ValueType(-2.5510206223e+00, 2.5510258675e+00); d2psiM_down[0][1] = ValueType(5.9720201492e+00, -5.9720129967e+00); d2psiM_down[0][2] = ValueType(8.8568925858e-02, -8.8571548462e-02); d2psiM_down[1][0] = ValueType(-2.0943276882e+00, 2.0943336487e+00); d2psiM_down[1][1] = ValueType(4.9078116417e+00, -4.9078197479e+00); d2psiM_down[1][2] = ValueType(-3.0689623952e-01, 3.0689093471e-01); d2psiM_down[2][0] = ValueType(-7.8578405380e+00, 7.8578381538e+00); d2psiM_down[2][1] = ValueType(1.9828968048e+01, -1.9828992844e+01); d2psiM_down[2][2] = ValueType(4.2092007399e-01, -4.2091816664e-01); //And now a looooot of gradient info. ////////SPIN UP////////// dpsiM_up[0][0][0] = ValueType(-1.7161563039e-01, 1.7161482573e-01); dpsiM_up[0][0][1] = ValueType(5.6693041325e-01, -5.6692999601e-01); dpsiM_up[0][0][2] = ValueType(-4.5538558960e+00, 4.5538554192e+00); dpsiM_up[0][1][0] = ValueType(-7.4953302741e-02, 7.4952393770e-02); dpsiM_up[0][1][1] = ValueType(2.4608184397e-01, -2.4608163536e-01); dpsiM_up[0][1][2] = ValueType(-1.9720511436e+00, 1.9720509052e+00); dpsiM_up[0][2][0] = ValueType(-4.2384520173e-02, 4.2384237051e-02); dpsiM_up[0][2][1] = ValueType(1.1735939980e-01, -1.1735984683e-01); dpsiM_up[0][2][2] = ValueType(-3.1189033985e+00, 3.1189031601e+00); dpsiM_up[1][0][0] = ValueType(1.9333077967e-01, -1.9333113730e-01); dpsiM_up[1][0][1] = ValueType(-5.7470333576e-01, 5.7470202446e-01); dpsiM_up[1][0][2] = ValueType(-4.5568108559e+00, 4.5568113327e+00); dpsiM_up[1][1][0] = ValueType(8.4540992975e-02, -8.4540143609e-02); dpsiM_up[1][1][1] = ValueType(-2.4946013093e-01, 2.4946044385e-01); dpsiM_up[1][1][2] = ValueType(-1.9727530479e+00, 1.9727528095e+00); dpsiM_up[1][2][0] = ValueType(3.1103719026e-02, -3.1103719026e-02); dpsiM_up[1][2][1] = ValueType(-1.2540178001e-01, 1.2540178001e-01); dpsiM_up[1][2][2] = ValueType(-3.1043677330e+00, 3.1043677330e+00); dpsiM_up[2][0][0] = ValueType(-8.8733488321e-01, 8.8733488321e-01); dpsiM_up[2][0][1] = ValueType(-1.7726477385e+00, 1.7726477385e+00); dpsiM_up[2][0][2] = ValueType(7.3728728294e-01, -7.3728692532e-01); dpsiM_up[2][1][0] = ValueType(-3.8018247485e-01, 3.8018330932e-01); dpsiM_up[2][1][1] = ValueType(-7.5880718231e-01, 7.5880759954e-01); dpsiM_up[2][1][2] = ValueType(2.7537062764e-01, -2.7537041903e-01); dpsiM_up[2][2][0] = ValueType(-9.5389984548e-02, 9.5390148461e-02); dpsiM_up[2][2][1] = ValueType(-1.8467208743e-01, 1.8467210233e-01); dpsiM_up[2][2][2] = ValueType(-2.4704084396e+00, 2.4704084396e+00); ////////SPIN DOWN////////// dpsiM_down[0][0][0] = ValueType(-7.1084961295e-02, 7.1085616946e-02); dpsiM_down[0][0][1] = ValueType(2.3483029008e-01, -2.3482969403e-01); dpsiM_down[0][0][2] = ValueType(-1.8862648010e+00, 1.8862643242e+00); dpsiM_down[0][1][0] = ValueType(1.8095153570e-01, -1.8095159531e-01); dpsiM_down[0][1][1] = ValueType(-5.9409534931e-01, 5.9409546852e-01); dpsiM_down[0][1][2] = ValueType(4.7609643936e+00, -4.7609624863e+00); dpsiM_down[0][2][0] = ValueType(-1.7556600273e-02, 1.7556769773e-02); dpsiM_down[0][2][1] = ValueType(4.8611730337e-02, -4.8612065613e-02); dpsiM_down[0][2][2] = ValueType(-1.2918885946e+00, 1.2918891907e+00); dpsiM_down[1][0][0] = ValueType(8.0079451203e-02, -8.0079004169e-02); dpsiM_down[1][0][1] = ValueType(-2.3804906011e-01, 2.3804855347e-01); dpsiM_down[1][0][2] = ValueType(-1.8874882460e+00, 1.8874886036e+00); dpsiM_down[1][1][0] = ValueType(-2.0409825444e-01, 2.0409949124e-01); dpsiM_down[1][1][1] = ValueType(6.0225284100e-01, -6.0225236416e-01); dpsiM_down[1][1][2] = ValueType(4.7626581192e+00, -4.7626576424e+00); dpsiM_down[1][2][0] = ValueType(1.2884057127e-02, -1.2884397991e-02); dpsiM_down[1][2][1] = ValueType(-5.1943197846e-02, 5.1943652332e-02); dpsiM_down[1][2][2] = ValueType(-1.2858681679e+00, 1.2858685255e+00); dpsiM_down[2][0][0] = ValueType(-3.6754500866e-01, 3.6754477024e-01); dpsiM_down[2][0][1] = ValueType(-7.3425340652e-01, 7.3425388336e-01); dpsiM_down[2][0][2] = ValueType(3.0539327860e-01, -3.0539402366e-01); dpsiM_down[2][1][0] = ValueType(9.1784656048e-01, -9.1784602404e-01); dpsiM_down[2][1][1] = ValueType(1.8319253922e+00, -1.8319247961e+00); dpsiM_down[2][1][2] = ValueType(-6.6480386257e-01, 6.6480308771e-01); dpsiM_down[2][2][0] = ValueType(-3.9511863142e-02, 3.9511814713e-02); dpsiM_down[2][2][1] = ValueType(-7.6493337750e-02, 7.6493576169e-02); dpsiM_down[2][2][2] = ValueType(-1.0232743025e+00, 1.0232743025e+00); for (unsigned int iat = 0; iat < 3; iat++) { RealType s = elec_.spins[iat]; RealType coss(0.0), sins(0.0); coss = std::cos(s); sins = std::sin(s); ValueType eis(coss, sins); ValueType emis(coss, -sins); ValueType eye(0, 1.0); //Using the reference values for the up and down channels invdividually, we build the total reference spinor value //consistent with the current spin value of particle iat. psiM_ref[iat][0] = eis * psiM_up[iat][0] + emis * psiM_down[iat][0]; psiM_ref[iat][1] = eis * psiM_up[iat][1] + emis * psiM_down[iat][1]; psiM_ref[iat][2] = eis * psiM_up[iat][2] + emis * psiM_down[iat][2]; dspsiM_ref[iat][0] = eye * (eis * psiM_up[iat][0] - emis * psiM_down[iat][0]); dspsiM_ref[iat][1] = eye * (eis * psiM_up[iat][1] - emis * psiM_down[iat][1]); dspsiM_ref[iat][2] = eye * (eis * psiM_up[iat][2] - emis * psiM_down[iat][2]); dpsiM_ref[iat][0] = eis * dpsiM_up[iat][0] + emis * dpsiM_down[iat][0]; dpsiM_ref[iat][1] = eis * dpsiM_up[iat][1] + emis * dpsiM_down[iat][1]; dpsiM_ref[iat][2] = eis * dpsiM_up[iat][2] + emis * dpsiM_down[iat][2]; d2psiM_ref[iat][0] = eis * d2psiM_up[iat][0] + emis * d2psiM_down[iat][0]; d2psiM_ref[iat][1] = eis * d2psiM_up[iat][1] + emis * d2psiM_down[iat][1]; d2psiM_ref[iat][2] = eis * d2psiM_up[iat][2] + emis * d2psiM_down[iat][2]; } //OK. Going to test evaluate_notranspose with spin. spo->evaluate_notranspose(elec_, 0, elec_.R.size(), psiM, dpsiM, d2psiM); for (unsigned int iat = 0; iat < 3; iat++) { REQUIRE(psiM[iat][0] == ComplexApprox(psiM_ref[iat][0])); REQUIRE(psiM[iat][1] == ComplexApprox(psiM_ref[iat][1])); REQUIRE(psiM[iat][2] == ComplexApprox(psiM_ref[iat][2])); REQUIRE(dpsiM[iat][0][0] == ComplexApprox(dpsiM_ref[iat][0][0])); REQUIRE(dpsiM[iat][0][1] == ComplexApprox(dpsiM_ref[iat][0][1])); REQUIRE(dpsiM[iat][0][2] == ComplexApprox(dpsiM_ref[iat][0][2])); REQUIRE(dpsiM[iat][1][0] == ComplexApprox(dpsiM_ref[iat][1][0])); REQUIRE(dpsiM[iat][1][1] == ComplexApprox(dpsiM_ref[iat][1][1])); REQUIRE(dpsiM[iat][1][2] == ComplexApprox(dpsiM_ref[iat][1][2])); REQUIRE(dpsiM[iat][2][0] == ComplexApprox(dpsiM_ref[iat][2][0])); REQUIRE(dpsiM[iat][2][1] == ComplexApprox(dpsiM_ref[iat][2][1])); REQUIRE(dpsiM[iat][2][2] == ComplexApprox(dpsiM_ref[iat][2][2])); REQUIRE(d2psiM[iat][0] == ComplexApprox(d2psiM_ref[iat][0])); REQUIRE(d2psiM[iat][1] == ComplexApprox(d2psiM_ref[iat][1])); REQUIRE(d2psiM[iat][2] == ComplexApprox(d2psiM_ref[iat][2])); } //Now we're going to test evaluateValue and evaluateVGL: int OrbitalSetSize = spo->getOrbitalSetSize(); //temporary arrays for holding the values of the up and down channels respectively. SPOSet::ValueVector_t psi_work; //temporary arrays for holding the gradients of the up and down channels respectively. SPOSet::GradVector_t dpsi_work; //temporary arrays for holding the laplacians of the up and down channels respectively. SPOSet::ValueVector_t d2psi_work; psi_work.resize(OrbitalSetSize); dpsi_work.resize(OrbitalSetSize); d2psi_work.resize(OrbitalSetSize); //We worked hard to generate nice reference data above. Let's generate a test for evaluateV //and evaluateVGL by perturbing the electronic configuration by dR, and then make //single particle moves that bring it back to our original R reference values. //Our perturbation vector. ParticleSet::ParticlePos_t dR; dR.resize(3); //Values chosen based on divine inspiration. Not important. dR[0][0] = 0.1; dR[0][1] = 0.2; dR[0][2] = 0.1; dR[1][0] = -0.1; dR[1][1] = -0.05; dR[1][2] = 0.05; dR[2][0] = -0.1; dR[2][1] = 0.0; dR[2][2] = 0.0; //The new R of our perturbed particle set. ParticleSet::ParticlePos_t Rnew; Rnew.resize(3); Rnew = elec_.R + dR; elec_.R = Rnew; elec_.update(); //Now we test evaluateValue() for (unsigned int iat = 0; iat < 3; iat++) { psi_work = 0.0; elec_.makeMove(iat, -dR[iat], false); spo->evaluateValue(elec_, iat, psi_work); REQUIRE(psi_work[0] == ComplexApprox(psiM_ref[iat][0])); REQUIRE(psi_work[1] == ComplexApprox(psiM_ref[iat][1])); REQUIRE(psi_work[2] == ComplexApprox(psiM_ref[iat][2])); elec_.rejectMove(iat); } //Now we test evaluateVGL() for (unsigned int iat = 0; iat < 3; iat++) { psi_work = 0.0; dpsi_work = 0.0; d2psi_work = 0.0; elec_.makeMove(iat, -dR[iat], false); spo->evaluateVGL(elec_, iat, psi_work, dpsi_work, d2psi_work); REQUIRE(psi_work[0] == ComplexApprox(psiM_ref[iat][0])); REQUIRE(psi_work[1] == ComplexApprox(psiM_ref[iat][1])); REQUIRE(psi_work[2] == ComplexApprox(psiM_ref[iat][2])); REQUIRE(dpsi_work[0][0] == ComplexApprox(dpsiM_ref[iat][0][0])); REQUIRE(dpsi_work[0][1] == ComplexApprox(dpsiM_ref[iat][0][1])); REQUIRE(dpsi_work[0][2] == ComplexApprox(dpsiM_ref[iat][0][2])); REQUIRE(dpsi_work[1][0] == ComplexApprox(dpsiM_ref[iat][1][0])); REQUIRE(dpsi_work[1][1] == ComplexApprox(dpsiM_ref[iat][1][1])); REQUIRE(dpsi_work[1][2] == ComplexApprox(dpsiM_ref[iat][1][2])); REQUIRE(dpsi_work[2][0] == ComplexApprox(dpsiM_ref[iat][2][0])); REQUIRE(dpsi_work[2][1] == ComplexApprox(dpsiM_ref[iat][2][1])); REQUIRE(dpsi_work[2][2] == ComplexApprox(dpsiM_ref[iat][2][2])); REQUIRE(d2psi_work[0] == ComplexApprox(d2psiM_ref[iat][0])); REQUIRE(d2psi_work[1] == ComplexApprox(d2psiM_ref[iat][1])); REQUIRE(d2psi_work[2] == ComplexApprox(d2psiM_ref[iat][2])); elec_.rejectMove(iat); } //Now we test evaluateSpin: SPOSet::ValueVector_t dspsi_work; dspsi_work.resize(OrbitalSetSize); for (unsigned int iat = 0; iat < 3; iat++) { psi_work = 0.0; dspsi_work = 0.0; elec_.makeMove(iat, -dR[iat], false); spo->evaluate_spin(elec_, iat, psi_work, dspsi_work); REQUIRE(psi_work[0] == ComplexApprox(psiM_ref[iat][0])); REQUIRE(psi_work[1] == ComplexApprox(psiM_ref[iat][1])); REQUIRE(psi_work[2] == ComplexApprox(psiM_ref[iat][2])); REQUIRE(dspsi_work[0] == ComplexApprox(dspsiM_ref[iat][0])); REQUIRE(dspsi_work[1] == ComplexApprox(dspsiM_ref[iat][1])); REQUIRE(dspsi_work[2] == ComplexApprox(dspsiM_ref[iat][2])); elec_.rejectMove(iat); } } #endif //QMC_COMPLEX } // namespace qmcplusplus
43.505882
182
0.669605
kayahans
ccedd60d98c2a361b0bdc6a2daf26844379be7bf
1,550
cpp
C++
gui/previewer/Previewer.cpp
ERPShuen/ICQ1
f319a72ad60aae4809eef0e4eb362f4d69292296
[ "Apache-2.0" ]
1
2019-12-02T08:37:10.000Z
2019-12-02T08:37:10.000Z
gui/previewer/Previewer.cpp
ERPShuen/ICQ1
f319a72ad60aae4809eef0e4eb362f4d69292296
[ "Apache-2.0" ]
null
null
null
gui/previewer/Previewer.cpp
ERPShuen/ICQ1
f319a72ad60aae4809eef0e4eb362f4d69292296
[ "Apache-2.0" ]
null
null
null
#include "stdafx.h" #include "Previewer.h" #include "../main_window/MainWindow.h" #include "../utils/InterConnector.h" #include "../../corelib/enumerations.h" #include "../../gui.shared/implayer.h" #include "../utils/utils.h" namespace { std::unique_ptr<QWidget> PreviewWidget_; std::unique_ptr<QWidget> g_multimediaViewer; } const char* mplayer_exe = "mplayer.exe"; namespace Previewer { void ShowMedia(const core::file_sharing_content_type /*_contentType*/, const QString& _path) { if (platform::is_windows()) { // const auto exePath = QCoreApplication::applicationFilePath(); // // const auto forder = QFileInfo(exePath).path(); // // const int scale = Utils::scale_value(100); // // const int screenNumber = Utils::InterConnector::instance().getMainWindow()->getScreen(); // // const QString command = "\"" + forder + "/" + QString(mplayer_exe) + "\"" + QString(" /media \"") + _path + "\"" + " /scale " + QString::number(scale) + " /screen_number " + QString::number(screenNumber); // // QProcess::startDetached(command); } else { QUrl url = QUrl::fromLocalFile(_path); if (!url.isLocalFile() || !platform::is_apple()) url = QUrl(QDir::fromNativeSeparators(_path)); QDesktopServices::openUrl(url); } } void CloseMedia() { g_multimediaViewer.reset(); } } namespace { }
27.678571
220
0.574839
ERPShuen
ccf059187eb3c8bccf715f1eae37d74469aa3c52
1,684
hpp
C++
include/memory/hadesmem/detail/force_initialize.hpp
CvX/hadesmem
d2c5164cc753dac37879ac8079f2ae23f2b8edb5
[ "MIT" ]
24
2018-08-18T18:05:37.000Z
2021-09-28T00:26:35.000Z
include/memory/hadesmem/detail/force_initialize.hpp
CvX/hadesmem
d2c5164cc753dac37879ac8079f2ae23f2b8edb5
[ "MIT" ]
null
null
null
include/memory/hadesmem/detail/force_initialize.hpp
CvX/hadesmem
d2c5164cc753dac37879ac8079f2ae23f2b8edb5
[ "MIT" ]
9
2018-04-16T09:53:09.000Z
2021-02-26T05:04:49.000Z
// Copyright (C) 2010-2014 Joshua Boyce. // See the file COPYING for copying permission. #pragma once #include <array> #include <windows.h> #include <hadesmem/config.hpp> #include <hadesmem/detail/remote_thread.hpp> #include <hadesmem/detail/trace.hpp> #include <hadesmem/process.hpp> #include <hadesmem/write.hpp> namespace hadesmem { namespace detail { // This is used to generate a 'nullsub' function, which is called // in the context of the remote process in order to 'force' a // call to ntdll.dll!LdrInitializeThunk. This is necessary // because module enumeration will fail if LdrInitializeThunk has // not been called, and Injector::InjectDll (and the APIs it // uses) depends on the module enumeration APIs. inline void ForceLdrInitializeThunk(DWORD proc_id) { Process const process{proc_id}; #if defined(HADESMEM_DETAIL_ARCH_X64) // RET std::array<BYTE, 1> const return_instr = {{0xC3}}; #elif defined(HADESMEM_DETAIL_ARCH_X86) // RET 4 std::array<BYTE, 3> const return_instr = {{0xC2, 0x04, 0x00}}; #else #error "[HadesMem] Unsupported architecture." #endif HADESMEM_DETAIL_TRACE_A("Allocating memory for remote stub."); Allocator const stub_remote{process, sizeof(return_instr)}; HADESMEM_DETAIL_TRACE_A("Writing remote stub."); Write(process, stub_remote.GetBase(), return_instr); auto const stub_remote_pfn = reinterpret_cast<LPTHREAD_START_ROUTINE>( reinterpret_cast<DWORD_PTR>(stub_remote.GetBase())); HADESMEM_DETAIL_TRACE_A("Starting remote thread."); CreateRemoteThreadAndWait(process, stub_remote_pfn); HADESMEM_DETAIL_TRACE_A("Remote thread complete."); } } }
28.542373
73
0.736342
CvX
ccf1d89f4b4f212721515d1d3cc2aabfa14856a5
1,807
cpp
C++
1 term/2/3/A/A.cpp
alexkats/Discrete-Math
dd4edd9ff9322e319d162d56567b9d81a6636373
[ "Unlicense" ]
null
null
null
1 term/2/3/A/A.cpp
alexkats/Discrete-Math
dd4edd9ff9322e319d162d56567b9d81a6636373
[ "Unlicense" ]
null
null
null
1 term/2/3/A/A.cpp
alexkats/Discrete-Math
dd4edd9ff9322e319d162d56567b9d81a6636373
[ "Unlicense" ]
null
null
null
#include <iostream> #include <fstream> #include <string> #include <cstring> #include <cmath> #include <cstdio> #include <cstdlib> #include <vector> #include <algorithm> #include <set> #include <map> #include <cassert> #include <ctime> #include <stack> #include <queue> #include <deque> #include <utility> #include <iterator> #define NAME "nextvector" #define INF 1000000000 #define EPS 0.000000001 #define sqr(a) a*a #define mp make_pair #define pb push_back #define rep0(i, n) for (int i = 0; i < n; i++) #define rep(i, l, r) for (int i = l; i < r; i++) #define repd0(i, n) for (int i = (n - 1); i > -1; i--) #define repd(i, l, r) for (int i = (r - 1); i > (l - 1); i--) typedef unsigned long long ull; typedef long long ll; typedef long double ld; using namespace std; string s; string solve1 (string s) { int n = s.length (); rep0(i, n) if (s [i] == '0') s [i] = '1'; else { s [i] = '0'; break; } rep0(i, n / 2) swap (s [i], s [n - i - 1]); return s; } string solve2 (string s) { int n = s.length (); rep0(i, n) if (s [i] == '1') s [i] = '0'; else { s [i] = '1'; break; } rep0(i, n / 2) swap (s [i], s [n - i - 1]); return s; } int main () { freopen (NAME".in", "r", stdin); freopen (NAME".out", "w", stdout); cin >> s; int n = s.length (); rep0(i, n / 2) swap (s [i], s [n - i - 1]); bool z0 = false; bool z1 = false; string ans1 = ""; string ans2 = ""; rep0(i, n) { if (s [i] != '0') z0 = true; if (s [i] != '1') z1 = true; } if (!z0) ans1 = "-"; else ans1 = solve1 (s); if (!z1) ans2 = "-"; else ans2 = solve2 (s); cout << ans1 << endl; cout << ans2 << endl; return 0; }
15.444444
62
0.50249
alexkats
ccf7ec1dcc93d8a545e8911fc4acaa7925ef9731
888
cpp
C++
src/13merge.cpp
baseoursteps/faang
8508b3bd66a607fa4ff5a71efd9e2a25a2a263d5
[ "MIT" ]
1
2021-07-13T19:47:57.000Z
2021-07-13T19:47:57.000Z
src/13merge.cpp
baseoursteps/faang
8508b3bd66a607fa4ff5a71efd9e2a25a2a263d5
[ "MIT" ]
1
2021-05-07T15:02:27.000Z
2021-05-09T08:44:05.000Z
src/13merge.cpp
baseoursteps/faang
8508b3bd66a607fa4ff5a71efd9e2a25a2a263d5
[ "MIT" ]
1
2021-05-07T13:18:01.000Z
2021-05-07T13:18:01.000Z
#include <algorithm> #include <iostream> #include <vector> struct interval { int start { -1 }, end { -1 }; interval(int a, int b) : start(a), end(b) {} bool operator<(const interval &o) const { return start < o.start; } }; int main() { using namespace std; vector<interval> vals { { 11, 15 }, { 1, 3 }, { 0, 2 }, { 3, 5 }, { 6, 8 }, { 9, 10 }, { 16, 20 } }; for (auto &&i : vals) cout << i.start << "->" << i.end << "\n"; sort(vals.begin(), vals.end()); for (int i = 0; i < vals.size() - 1;) { if (vals[i].end >= vals[i + 1].start) { vals[i].end = vals[i + 1].end; vals.erase(vals.begin() + i + 1); } else ++i; } cout << "\nMerged:\n"; for (auto &&i : vals) cout << i.start << "->" << i.end << "\n"; return 0; }
20.651163
71
0.427928
baseoursteps
ccfd8be8e8655529c7f77980743cf67f842fc07f
1,759
cpp
C++
Graph Theory/Union-Find (Disjoint-Sets) and MST/prim.cpp
hoanghai1803/DataStructures_Algorithms
b5e8ccb3deba7566b915b21c6b7e9435cfe55301
[ "MIT" ]
1
2021-03-06T00:36:08.000Z
2021-03-06T00:36:08.000Z
Graph Theory/Union-Find (Disjoint-Sets) and MST/prim.cpp
hoanghai1803/DataStructures_Algorithms
b5e8ccb3deba7566b915b21c6b7e9435cfe55301
[ "MIT" ]
null
null
null
Graph Theory/Union-Find (Disjoint-Sets) and MST/prim.cpp
hoanghai1803/DataStructures_Algorithms
b5e8ccb3deba7566b915b21c6b7e9435cfe55301
[ "MIT" ]
null
null
null
/* ========== PRIM'S ALGORITHM IMPLEMENTATION ========== */ // This implementation of Prim's algorithm calculates the minimum // weight spanning tree of the weighted undirected graph with non-negative // edge weights. We assume that the graph is connected. // Time complexity: // Using adjacency matrix: O(V^2) // Using adjacency list (+ binary heap): O(max(V, E) * log_2(V)) - Implemented bellow #include <iostream> #include <vector> #include <queue> #include <climits> #define INF INT_MAX #define N 100005 typedef std::pair<int, int> Edge; int n, m; // The number of vertices and edges std::vector<Edge> adj[N]; // Adjacency List int cost[N]; // cost[u] - cost of vertex u void Prim() { // Initialize minCost = 0 (minimum cost of spanning tree). int minCost = 0; int u, v, costU; // Initialize cost of all vertices = +oo, except cost[1] = 0. for (int u = 2; u <= n; u++) cost[u] = +INF; cost[1] = 0; std::priority_queue<Edge, std::vector<Edge>, std::greater<Edge> > Heap; // Min Heap Heap.push(Edge(cost[1], 1)); // Push vertex 1 and its cost into Min Heap while (Heap.size()) { u = Heap.top().second, costU = Heap.top().first; Heap.pop(); if (costU != cost[u]) continue; minCost += cost[u]; cost[u] = 0; for (Edge e: adj[u]) { if (cost[v = e.first] > e.second) { cost[v] = e.second; Heap.push(Edge(cost[v], v)); } } } std::cout << minCost << "\n"; } // Driver code int main() { std::cin >> n >> m; while (m--) { int u, v, w; std::cin >> u >> v >> w; adj[u].push_back(Edge(v, w)); adj[v].push_back(Edge(u, w)); } Prim(); }
25.492754
87
0.554292
hoanghai1803
ccff98407b71a41ddc6d1cfe4c03e22bb036ff48
738
cpp
C++
Curso/PILHA.cpp
Pedro-H-Castoldi/c-
a01cec85559efec8c84bef142119d83dad12bb1e
[ "Apache-2.0" ]
null
null
null
Curso/PILHA.cpp
Pedro-H-Castoldi/c-
a01cec85559efec8c84bef142119d83dad12bb1e
[ "Apache-2.0" ]
null
null
null
Curso/PILHA.cpp
Pedro-H-Castoldi/c-
a01cec85559efec8c84bef142119d83dad12bb1e
[ "Apache-2.0" ]
null
null
null
#include <iostream> #include <stack> using namespace std; int main(){ stack <string> cartas; cartas.push("Carta 1"); cartas.push("Carta 2"); cartas.push("Carta 3"); cartas.push("carta 4"); /*while (!cartas.empty()){ // Maneira de excluir elementos da Pilha cartas.pop(); }*/ if(cartas.empty()){ cout << "Pilha vazia\n\n"; return 0; } else{ cout << "Pilha com cartas\n\n"; } /* cout << "Quantidade de cartas: " << cartas.size() << "\n"; cartas.pop(); cout << "Quantidade de cartas: " << cartas.size() << "\n"; cout << "Carta do topo: "<< cartas.top();*/ for (int i=0; i<4; i++){ cout << "Carta do topo: " << cartas.top() << "\n\n"; // Mostrar os valores da Pilha. cartas.pop(); } return 0; }
18.923077
86
0.574526
Pedro-H-Castoldi
6905dfe09a3904ce69ca6b5d0687257e919975aa
1,427
cpp
C++
PIXEL2D/Utilities/StringExtensions.cpp
Maxchii/PIXEL2D
ac1ce604e4f1b8448f14a4f92c69a2ff6d127f56
[ "Apache-2.0" ]
1
2015-05-18T15:20:19.000Z
2015-05-18T15:20:19.000Z
PIXEL2D/Utilities/StringExtensions.cpp
Ossadtchii/PIXEL2D
ac1ce604e4f1b8448f14a4f92c69a2ff6d127f56
[ "Apache-2.0" ]
5
2015-05-18T15:21:28.000Z
2015-06-28T12:43:52.000Z
PIXEL2D/Utilities/StringExtensions.cpp
Maxchii/PIXEL2D
ac1ce604e4f1b8448f14a4f92c69a2ff6d127f56
[ "Apache-2.0" ]
null
null
null
#include "StringExtensions.h" #include <sstream> namespace PIXL { namespace utilities { void GetWords(std::string s, std::vector<std::string>& words) { UInt32 end = 0; while (s.size() > 0) { for (unsigned int i = 0; i < s.size(); i++) { if (s[i] == ' ') { end = i; string word = s.substr(0, end); s.erase(s.begin(), s.begin() + end + 1); words.push_back(word); break; } else if (i == s.size() - 1) { end = i; string word = s.substr(0, end + 1); s.clear(); words.push_back(word); break; } } } } std::vector<std::string> SplitString(const std::string &s, char delimeter) { std::vector<std::string> elems; std::stringstream ss(s); std::string item; while (std::getline(ss, item, delimeter)) { elems.push_back(item); } return elems; } std::string F2S(Float32 val) { std::stringstream stream; stream << val; std::string sValue = stream.str(); val = S2F(sValue); if (val == (int)val) { sValue.append(".0"); } return sValue; } std::string I2S(SInt32 val) { std::stringstream stream; stream << val; return stream.str(); } Float32 S2F(const std::string& s) { std::stringstream stream(s); float value = 0.0f; stream >> value; return value; } SInt32 S2I(const std::string& s) { std::stringstream stream(s); SInt32 value = 0; stream >> value; return value; } } }
17.192771
75
0.576034
Maxchii
691328ec21e9bae7dd92209d732428dfda11a04d
2,656
hpp
C++
sdk/attestation/azure-security-attestation/src/private/crypto/openssl/openssl_helpers.hpp
JinmingHu-MSFT/azure-sdk-for-cpp
933486385a54a5a09a7444dbd823425f145ad75a
[ "MIT" ]
1
2022-01-19T22:54:41.000Z
2022-01-19T22:54:41.000Z
sdk/attestation/azure-security-attestation/src/private/crypto/openssl/openssl_helpers.hpp
LarryOsterman/azure-sdk-for-cpp
d96216f50909a2bd39b555c9088f685bf0f7d6e6
[ "MIT" ]
null
null
null
sdk/attestation/azure-security-attestation/src/private/crypto/openssl/openssl_helpers.hpp
LarryOsterman/azure-sdk-for-cpp
d96216f50909a2bd39b555c9088f685bf0f7d6e6
[ "MIT" ]
null
null
null
// Copyright (c) Microsoft Corporation. All rights reserved. // SPDX-License-Identifier: MIT #pragma once #include <memory> #include <openssl/bio.h> #include <openssl/evp.h> #include <stdexcept> #include <type_traits> #include <utility> namespace Azure { namespace Security { namespace Attestation { namespace _detail { // Helpers to provide RAII wrappers for OpenSSL types. template <typename T, void (&Deleter)(T*)> struct openssl_deleter { void operator()(T* obj) { Deleter(obj); } }; template <typename T, void (&FreeFunc)(T*)> using basic_openssl_unique_ptr = std::unique_ptr<T, openssl_deleter<T, FreeFunc>>; // *** Given just T, map it to the corresponding FreeFunc: template <typename T> struct type_map_helper; template <> struct type_map_helper<EVP_PKEY> { using type = basic_openssl_unique_ptr<EVP_PKEY, EVP_PKEY_free>; }; template <> struct type_map_helper<BIO> { using type = basic_openssl_unique_ptr<BIO, BIO_free_all>; }; // *** Now users can say openssl_unique_ptr<T> if they want: template <typename T> using openssl_unique_ptr = typename type_map_helper<T>::type; // *** Or the current solution's convenience aliases: using openssl_evp_pkey = openssl_unique_ptr<EVP_PKEY>; using openssl_bio = openssl_unique_ptr<BIO>; #ifdef __cpp_nontype_template_parameter_auto // *** Wrapper function that calls a given OpensslApi, and returns the corresponding // openssl_unique_ptr<T>: template <auto OpensslApi, typename... Args> auto make_openssl_unique(Args&&... args) { auto raw = OpensslApi( forward<Args>(args)...); // forwarding is probably unnecessary, could use const Args&... // check raw using T = remove_pointer_t<decltype(raw)>; // no need to request T when we can see // what OpensslApi returned return openssl_unique_ptr<T>{raw}; } #else // ^^^ C++17 ^^^ / vvv C++14 vvv template <typename Api, typename... Args> auto make_openssl_unique(Api& OpensslApi, Args&&... args) { auto raw = OpensslApi(std::forward<Args>( args)...); // forwarding is probably unnecessary, could use const Args&... // check raw using T = std::remove_pointer_t<decltype(raw)>; // no need to request T when we can see // what OpensslApi returned return openssl_unique_ptr<T>{raw}; } #endif // ^^^ C++14 ^^^ extern std::string GetOpenSSLError(std::string const& what); struct OpenSSLException : public std::runtime_error { OpenSSLException(std::string const& what); }; }}}} // namespace Azure::Security::Attestation::_detail
35.891892
96
0.67997
JinmingHu-MSFT
6913324610ba42002ca621321552d927c8186c93
1,341
cpp
C++
src/CLR/Core/StringTable.cpp
TIPConsulting/nf-interpreter
d5407872f4705d6177e1ee5a2e966bd02fd476e4
[ "MIT" ]
null
null
null
src/CLR/Core/StringTable.cpp
TIPConsulting/nf-interpreter
d5407872f4705d6177e1ee5a2e966bd02fd476e4
[ "MIT" ]
1
2021-02-22T07:54:30.000Z
2021-02-22T07:54:30.000Z
src/CLR/Core/StringTable.cpp
TIPConsulting/nf-interpreter
d5407872f4705d6177e1ee5a2e966bd02fd476e4
[ "MIT" ]
null
null
null
// // Copyright (c) .NET Foundation and Contributors // Portions Copyright (c) Microsoft Corporation. All rights reserved. // See LICENSE file in the project root for full license information. // #include "stdafx.h" #include "Core.h" //////////////////////////////////////////////////////////////////////////////////////////////////// #include "StringTableData.cpp" //////////////////////////////////////////////////////////////////////////////////////////////////// void CLR_RT_Assembly::InitString() { NATIVE_PROFILE_CLR_CORE(); } const char* CLR_RT_Assembly::GetString( CLR_STRING i ) { NATIVE_PROFILE_CLR_CORE(); static const CLR_STRING iMax = 0xFFFF - c_CLR_StringTable_Size; if(i >= iMax) { return &c_CLR_StringTable_Data[ c_CLR_StringTable_Lookup[ (CLR_STRING)0xFFFF - i ] ]; } return &(((const char*)GetTable( TBL_Strings ))[ i ]); } #if defined(_WIN32) void CLR_RT_Assembly::InitString( std::map<std::string,CLR_OFFSET>& map ) { NATIVE_PROFILE_CLR_CORE(); const CLR_STRING* array = c_CLR_StringTable_Lookup; size_t len = c_CLR_StringTable_Size; CLR_STRING idx = 0xFFFF; map.clear(); while(len-- > 0) { map[ &c_CLR_StringTable_Data[ *array++ ] ] = idx--; } } #endif
24.833333
101
0.541387
TIPConsulting
6917d70520912ba9c78126e9e2359c219333c51c
1,184
hh
C++
src/faodel-services/MPISyncStart.hh
faodel/faodel
ef2bd8ff335433e695eb561d7ecd44f233e58bf0
[ "MIT" ]
2
2019-01-25T21:21:07.000Z
2021-04-29T17:24:00.000Z
src/faodel-services/MPISyncStart.hh
faodel/faodel
ef2bd8ff335433e695eb561d7ecd44f233e58bf0
[ "MIT" ]
8
2018-10-09T14:35:30.000Z
2020-09-30T20:09:42.000Z
src/faodel-services/MPISyncStart.hh
faodel/faodel
ef2bd8ff335433e695eb561d7ecd44f233e58bf0
[ "MIT" ]
2
2019-04-23T19:01:36.000Z
2021-05-11T07:44:55.000Z
// Copyright 2021 National Technology & Engineering Solutions of Sandia, LLC // (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. // Government retains certain rights in this software. #ifndef FAODEL_MPISYNCHSTART_HH #define FAODEL_MPISYNCHSTART_HH #include <string> #include "faodel-common/BootstrapInterface.hh" #include "faodel-common/LoggingInterface.hh" namespace faodel { namespace mpisyncstart { std::string bootstrap(); class MPISyncStart : public faodel::bootstrap::BootstrapInterface, public faodel::LoggingInterface { public: MPISyncStart(); ~MPISyncStart() override; //Bootstrap API void Init(const faodel::Configuration &config) override {} void InitAndModifyConfiguration(faodel::Configuration *config) override; void Start() override; void Finish() override {}; void GetBootstrapDependencies(std::string &name, std::vector<std::string> &requires, std::vector<std::string> &optional) const override; private: bool needs_patch; //True when detected a change in config }; } // namespace mpisyncstart } // namespace faodel #endif //FAODEL_MPISYNCHSTART_HH
25.73913
76
0.727196
faodel
691a7ea5b06c5bdcd19fb807d06fcd2fa90ae730
1,241
cpp
C++
tests/expected/loop.cpp
div72/py2many
60277bc13597bd32d078b88a7390715568115fc6
[ "MIT" ]
345
2021-01-28T17:33:08.000Z
2022-03-25T16:07:56.000Z
tests/expected/loop.cpp
mkos11/py2many
be6cfaad5af32c43eb24f182cb20ad63b979d4ef
[ "MIT" ]
291
2021-01-31T13:15:06.000Z
2022-03-23T21:28:49.000Z
tests/expected/loop.cpp
mkos11/py2many
be6cfaad5af32c43eb24f182cb20ad63b979d4ef
[ "MIT" ]
23
2021-02-09T17:15:03.000Z
2022-02-03T05:57:44.000Z
#include <iostream> // NOLINT(build/include_order) #include "pycpp/runtime/builtins.h" // NOLINT(build/include_order) #include "pycpp/runtime/range.hpp" // NOLINT(build/include_order) #include "pycpp/runtime/sys.h" // NOLINT(build/include_order) inline void for_with_break() { for (auto i : rangepp::xrange(4)) { if (i == 2) { break; } std::cout << i; std::cout << std::endl; } } inline void for_with_continue() { for (auto i : rangepp::xrange(4)) { if (i == 2) { continue; } std::cout << i; std::cout << std::endl; } } inline void for_with_else() { for (auto i : rangepp::xrange(4)) { std::cout << i; std::cout << std::endl; } } inline void while_with_break() { int i = 0; while (true) { if (i == 2) { break; } std::cout << i; std::cout << std::endl; i += 1; } } inline void while_with_continue() { int i = 0; while (i < 5) { i += 1; if (i == 2) { continue; } std::cout << i; std::cout << std::endl; } } int main(int argc, char** argv) { pycpp::sys::argv = std::vector<std::string>(argv, argv + argc); for_with_break(); for_with_continue(); while_with_break(); while_with_continue(); }
19.390625
67
0.560838
div72
6926473b43e569d52091c06c3d4d9dfa004429e6
2,103
hpp
C++
test/core/point_comparisons.hpp
cynodelic/tesela
3b86a7b9501c7136d5168c7e314740fa7f72f7a7
[ "BSL-1.0" ]
null
null
null
test/core/point_comparisons.hpp
cynodelic/tesela
3b86a7b9501c7136d5168c7e314740fa7f72f7a7
[ "BSL-1.0" ]
null
null
null
test/core/point_comparisons.hpp
cynodelic/tesela
3b86a7b9501c7136d5168c7e314740fa7f72f7a7
[ "BSL-1.0" ]
null
null
null
// Copyright (c) 2019 Álvaro Ceballos // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt #ifndef CYNODELIC_TESELA_TEST_CORE_POINT_COMPARISONS_HPP #define CYNODELIC_TESELA_TEST_CORE_POINT_COMPARISONS_HPP CYNODELIC_TESTER_TEST_CASE(point_equals); CYNODELIC_TESTER_SECTION(point_equals,main) { tsl::point pt1(439,115); tsl::point pt2(439,115); tsl::point pt3(600,412); CYNODELIC_TESTER_MESSAGE << "Values for pt1:" << tst::newline << " pt1.x = " << pt1.x << tst::newline << " pt1.y = " << pt1.y; CYNODELIC_TESTER_MESSAGE << "Values for pt2:" << tst::newline << " pt2.x = " << pt2.x << tst::newline << " pt2.y = " << pt2.y; CYNODELIC_TESTER_MESSAGE << "Values for pt3:" << tst::newline << " pt3.x = " << pt3.x << tst::newline << " pt3.y = " << pt3.y; CYNODELIC_TESTER_CHECK_EQUALS(pt1.x,pt2.x); CYNODELIC_TESTER_CHECK_EQUALS(pt1.y,pt2.y); CYNODELIC_TESTER_CHECK_TRUE(pt1 == pt2); CYNODELIC_TESTER_CHECK_NOT_EQUALS(pt1.x,pt3.x); CYNODELIC_TESTER_CHECK_NOT_EQUALS(pt1.y,pt3.y); CYNODELIC_TESTER_CHECK_FALSE(pt1 == pt3); } CYNODELIC_TESTER_TEST_CASE(point_not_equals); CYNODELIC_TESTER_SECTION(point_not_equals,main) { tsl::point pt1(556,120); tsl::point pt2(901,396); tsl::point pt3(556,120); CYNODELIC_TESTER_MESSAGE << "Values for pt1:" << tst::newline << " pt1.x = " << pt1.x << tst::newline << " pt1.y = " << pt1.y; CYNODELIC_TESTER_MESSAGE << "Values for pt2:" << tst::newline << " pt2.x = " << pt2.x << tst::newline << " pt2.y = " << pt2.y; CYNODELIC_TESTER_MESSAGE << "Values for pt3:" << tst::newline << " pt3.x = " << pt3.x << tst::newline << " pt3.y = " << pt3.y; CYNODELIC_TESTER_CHECK_NOT_EQUALS(pt1.x,pt2.x); CYNODELIC_TESTER_CHECK_NOT_EQUALS(pt1.y,pt2.y); CYNODELIC_TESTER_CHECK_TRUE(pt1 != pt2); CYNODELIC_TESTER_CHECK_EQUALS(pt1.x,pt3.x); CYNODELIC_TESTER_CHECK_EQUALS(pt1.y,pt3.y); CYNODELIC_TESTER_CHECK_FALSE(pt1 != pt3); } #endif // CYNODELIC_TESELA_TEST_CORE_POINT_COMPARISONS_HPP
27.671053
80
0.686638
cynodelic
692c6e26f56afdf089586a6efad5c6577d8200f6
223
cpp
C++
src/filesystem/tempfile.cpp
bunsanorg/testing
2532858878628c9925ddd0e58436bba53e4b6cb9
[ "Apache-2.0" ]
null
null
null
src/filesystem/tempfile.cpp
bunsanorg/testing
2532858878628c9925ddd0e58436bba53e4b6cb9
[ "Apache-2.0" ]
null
null
null
src/filesystem/tempfile.cpp
bunsanorg/testing
2532858878628c9925ddd0e58436bba53e4b6cb9
[ "Apache-2.0" ]
null
null
null
#include <bunsan/test/filesystem/tempfile.hpp> namespace bunsan { namespace test { namespace filesystem { tempfile::tempfile() : path(allocate()) {} } // namespace filesystem } // namespace test } // namespace bunsan
18.583333
46
0.717489
bunsanorg
692dd779f0ef60917299d863b1636a27f2793641
9,551
cpp
C++
runtime/test/dnp3s/test_dnp3_publisher.cpp
kinsamanka/OpenPLC_v3
fc1afcf702eebaf518971b304acf487809c804d4
[ "Apache-2.0" ]
null
null
null
runtime/test/dnp3s/test_dnp3_publisher.cpp
kinsamanka/OpenPLC_v3
fc1afcf702eebaf518971b304acf487809c804d4
[ "Apache-2.0" ]
null
null
null
runtime/test/dnp3s/test_dnp3_publisher.cpp
kinsamanka/OpenPLC_v3
fc1afcf702eebaf518971b304acf487809c804d4
[ "Apache-2.0" ]
null
null
null
// Copyright 2019 Smarter Grid Solutions // // 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 permissionsand // limitations under the License. #ifdef OPLC_DNP3_OUTSTATION #include <cstdint> #include <utility> #include <vector> #include <asiodnp3/IOutstation.h> #include "catch.hpp" #include "fakeit.hpp" #include "glue.h" #include "dnp3s/dnp3.h" #include "dnp3s/dnp3_publisher.h" using namespace std; using namespace fakeit; using namespace opendnp3; /// An implementation of the update handler that caches the updates that were /// requested. This implementation allows us to spy on the behaviour and to know /// during the tests whether the correct updates were called. class UpdateCaptureHandler : public opendnp3::IUpdateHandler { public: vector<pair<bool, uint16_t>> binary; vector<pair<bool, uint16_t>> binary_output; vector<pair<double, uint16_t>> analog; vector<pair<double, uint16_t>> analog_output; virtual ~UpdateCaptureHandler() {} virtual bool Update(const Binary& meas, uint16_t index, EventMode mode) { binary.push_back(std::make_pair(meas.value, index)); return true; } /// Simple mocked implementation. /// @copydoc virtual bool Update(const DoubleBitBinary& meas, uint16_t index, EventMode mode) { return true; } /// Simple mocked implementation. /// @copydoc virtual bool Update(const Analog& meas, uint16_t index, EventMode mode) { analog.push_back(std::make_pair(meas.value, index)); return true; } /// Simple mocked implementation. /// @copydoc virtual bool Update(const Counter& meas, uint16_t index, EventMode mode) { return true; } /// Simple mocked implementation. /// @copydoc virtual bool Update(const FrozenCounter& meas, uint16_t index, EventMode mode) { return true; } /// Simple mocked implementation. /// @copydoc virtual bool Update(const BinaryOutputStatus& meas, uint16_t index, EventMode mode) { binary_output.push_back(std::make_pair(meas.value, index)); return true; } /// Simple mocked implementation. /// @copydoc virtual bool Update(const AnalogOutputStatus& meas, uint16_t index, EventMode mode) { analog_output.push_back(std::make_pair(meas.value, index)); return true; } /// Simple mocked implementation. /// @copydoc virtual bool Update(const TimeAndInterval& meas, uint16_t index) { return true; } /// Simple mocked implementation. /// @copydoc virtual bool Modify(FlagsType type, uint16_t start, uint16_t stop, uint8_t flags) { return true; } }; SCENARIO("dnp3 publisher", "ExchangeGlue") { Mock<asiodnp3::IOutstation> mock_outstation; UpdateCaptureHandler update_handler; When(Method(mock_outstation, Apply)).AlwaysDo([&](const asiodnp3::Updates& updates) { updates.Apply(update_handler); }); auto outstation = std::shared_ptr<asiodnp3::IOutstation>(&mock_outstation.get(), [](asiodnp3::IOutstation*) {}); Dnp3MappedGroup measurements = {0}; Dnp3Publisher publisher(outstation, measurements); GIVEN("No glued measurements") { auto num_writes = publisher.ExchangeGlue(); THEN("Writes nothing") { REQUIRE(num_writes == 0); } } GIVEN("Boolean input variable at offset 0") { IEC_BOOL bool_val(0); auto group = GlueBoolGroup { .index = 0, .values = { &bool_val, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr } }; const GlueVariable glue_var = { IECLDT_OUT, IECLST_BIT, 0, 0, IECVT_BOOL, &group }; DNP3MappedGlueVariable mapped_vars[] = { { .group = 1, .point_index_number = 0, .variable = &glue_var } }; Dnp3MappedGroup measurements; measurements.size = 1; measurements.items = mapped_vars; Dnp3Publisher publisher(outstation, measurements); WHEN("value is false") { bool_val = false; auto num_writes = publisher.ExchangeGlue(); THEN("Writes binary input false") { REQUIRE(num_writes == 1); Verify(Method(mock_outstation, Apply)).Exactly(Once); REQUIRE(update_handler.binary.size() == 1); REQUIRE(update_handler.binary[0].first == false); REQUIRE(update_handler.binary[0].second == 0); } } WHEN("value is true") { bool_val = true; auto num_writes = publisher.ExchangeGlue(); THEN("Writes binary input true") { REQUIRE(num_writes == 1); Verify(Method(mock_outstation, Apply)).Exactly(Once); REQUIRE(update_handler.binary.size() == 1); REQUIRE(update_handler.binary[0].first == true); REQUIRE(update_handler.binary[0].second == 0); } } } GIVEN("Boolean output status variable at offset 0") { IEC_BOOL bool_val(0); auto group = GlueBoolGroup { .index = 0, .values = { &bool_val, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr } }; const GlueVariable glue_var = { IECLDT_OUT, IECLST_BIT, 0, 0, IECVT_BOOL, &group }; DNP3MappedGlueVariable mapped_vars[] = { { .group = 10, .point_index_number = 0, .variable = &glue_var } }; Dnp3MappedGroup measurements; measurements.size = 1; measurements.items = mapped_vars; Dnp3Publisher publisher(outstation, measurements); WHEN("value is false") { bool_val = false; auto num_writes = publisher.ExchangeGlue(); THEN("Writes binary input false") { REQUIRE(num_writes == 1); Verify(Method(mock_outstation, Apply)).Exactly(Once); REQUIRE(update_handler.binary_output.size() == 1); REQUIRE(update_handler.binary_output[0].first == false); REQUIRE(update_handler.binary_output[0].second == 0); } } WHEN("value is true") { bool_val = true; auto num_writes = publisher.ExchangeGlue(); THEN("Writes binary input true") { REQUIRE(num_writes == 1); Verify(Method(mock_outstation, Apply)).Exactly(Once); REQUIRE(update_handler.binary_output.size() == 1); REQUIRE(update_handler.binary_output[0].first == true); REQUIRE(update_handler.binary_output[0].second == 0); } } } GIVEN("Real variable at offset 0") { IEC_REAL real_val(9); const GlueVariable glue_var = { IECLDT_OUT, IECLST_DOUBLEWORD, 0, 0, IECVT_REAL, &real_val }; DNP3MappedGlueVariable mapped_vars[] = { { .group = 30, .point_index_number = 0, .variable = &glue_var } }; Dnp3MappedGroup measurements; measurements.size = 1; measurements.items = mapped_vars; Dnp3Publisher publisher(outstation, measurements); WHEN("value is 9") { auto num_writes = publisher.ExchangeGlue(); THEN("Writes binary input false") { REQUIRE(num_writes == 1); Verify(Method(mock_outstation, Apply)).Exactly(Once); REQUIRE(update_handler.analog.size() == 1); REQUIRE(update_handler.analog[0].first == 9); REQUIRE(update_handler.analog[0].second == 0); } } } GIVEN("Real status variable at offset 0") { IEC_REAL real_val(9); const GlueVariable glue_var = { IECLDT_OUT, IECLST_DOUBLEWORD, 0, 0, IECVT_REAL, &real_val }; DNP3MappedGlueVariable mapped_vars[] = { { .group = 40, .point_index_number = 0, .variable = &glue_var } }; Dnp3MappedGroup measurements; measurements.size = 1; measurements.items = mapped_vars; Dnp3Publisher publisher(outstation, measurements); WHEN("value is 9") { auto num_writes = publisher.ExchangeGlue(); THEN("Writes binary input false") { REQUIRE(num_writes == 1); Verify(Method(mock_outstation, Apply)).Exactly(Once); REQUIRE(update_handler.analog_output.size() == 1); REQUIRE(update_handler.analog_output[0].first == 9); REQUIRE(update_handler.analog_output[0].second == 0); } } } } #endif // OPLC_DNP3_OUTSTATION
32.266892
116
0.587373
kinsamanka
692fae95fbbad4c60a0e638f73eea0e614ffc732
5,711
cpp
C++
src/gui/gl/slicerenderer.cpp
mhough/braingl
53e2078adc10731ee62feec11dcb767c4c6c0d35
[ "MIT" ]
5
2016-03-17T07:02:11.000Z
2021-12-12T14:43:58.000Z
src/gui/gl/slicerenderer.cpp
mhough/braingl
53e2078adc10731ee62feec11dcb767c4c6c0d35
[ "MIT" ]
null
null
null
src/gui/gl/slicerenderer.cpp
mhough/braingl
53e2078adc10731ee62feec11dcb767c4c6c0d35
[ "MIT" ]
3
2015-10-29T15:21:01.000Z
2020-11-25T09:41:21.000Z
/* * slicerenderer.cpp * * Created on: 09.05.2012 * @author Ralph Schurade */ #include "slicerenderer.h" #include "glfunctions.h" #include "../../data/enums.h" #include "../../data/models.h" #include "../../data/datasets/dataset.h" #include <QtOpenGL/QGLShaderProgram> #include <QVector3D> #include <QMatrix4x4> SliceRenderer::SliceRenderer() : vbo0( 0 ), vbo1( 0 ), vbo2( 0 ) { } SliceRenderer::~SliceRenderer() { glDeleteBuffers( 1, &vbo0 ); glDeleteBuffers( 1, &vbo1 ); glDeleteBuffers( 1, &vbo2 ); } void SliceRenderer::init() { initializeOpenGLFunctions(); glGenBuffers( 1, &vbo0 ); glGenBuffers( 1, &vbo1 ); glGenBuffers( 1, &vbo2 ); initGeometry(); } void SliceRenderer::initGeometry() { float maxDim = GLFunctions::maxDim; QList< int > tl = GLFunctions::getTextureIndexes( "maingl" ); float x = Models::getGlobal( Fn::Property::G_SAGITTAL ).toFloat(); float y = Models::getGlobal( Fn::Property::G_CORONAL ).toFloat(); float z = Models::getGlobal( Fn::Property::G_AXIAL ).toFloat(); float lx = -maxDim; float ly = -maxDim; float lz = -maxDim; float xb = maxDim; float yb = maxDim; float zb = maxDim; float verticesAxial[] = { lx, ly, z, xb, ly, z, lx, yb, z, xb, yb, z }; // Transfer vertex data to VBO 1 glBindBuffer( GL_ARRAY_BUFFER, vbo0 ); glBufferData( GL_ARRAY_BUFFER, 12 * sizeof(float), verticesAxial, GL_STATIC_DRAW ); glBindBuffer( GL_ARRAY_BUFFER, 0 ); float verticesCoronal[] = { lx, y, lz, xb, y, lz, lx, y, zb, xb, y, zb }; // Transfer vertex data to VBO 2 glBindBuffer( GL_ARRAY_BUFFER, vbo1 ); glBufferData( GL_ARRAY_BUFFER, 12 * sizeof(float), verticesCoronal, GL_STATIC_DRAW ); glBindBuffer( GL_ARRAY_BUFFER, 0 ); float verticesSagittal[] = { x, ly, lz, x, yb, lz, x, ly, zb, x, yb, zb }; // Transfer vertex data to VBO 3 glBindBuffer( GL_ARRAY_BUFFER, vbo2 ); glBufferData( GL_ARRAY_BUFFER, 12 * sizeof(float), verticesSagittal, GL_STATIC_DRAW ); glBindBuffer( GL_ARRAY_BUFFER, 0 ); } void SliceRenderer::setupTextures() { GLFunctions::setupTextures(); } void SliceRenderer::setShaderVars( QString target ) { QGLShaderProgram* program = GLFunctions::getShader( "slice" ); int vertexLocation = program->attributeLocation( "a_position" ); program->enableAttributeArray( vertexLocation ); glVertexAttribPointer( vertexLocation, 3, GL_FLOAT, GL_FALSE, sizeof(float) * 3, 0 ); GLFunctions::setTextureUniforms( program, target ); } void SliceRenderer::draw( QMatrix4x4 p_matrix, QMatrix4x4 mv_matrix, int width, int height, int renderMode, QString target ) { float alpha = GLFunctions::sliceAlpha[target]; switch ( renderMode ) { case 0: break; case 1: { if ( alpha < 1.0 ) // obviously not opaque { return; } break; } default: { if ( alpha == 1.0 ) // not transparent { return; } break; } } if ( !GLFunctions::setupTextures() ) { return; } QGLShaderProgram* program = GLFunctions::getShader( "slice" ); program->bind(); // Set modelview-projection matrix program->setUniformValue( "mvp_matrix", p_matrix * mv_matrix ); program->setUniformValue( "u_alpha", alpha ); program->setUniformValue( "u_renderMode", renderMode ); program->setUniformValue( "u_canvasSize", width, height ); program->setUniformValue( "D0", 9 ); program->setUniformValue( "D1", 10 ); program->setUniformValue( "D2", 11 ); program->setUniformValue( "P0", 12 ); float pAlpha = 1.0; float green = 0.0f; float red = 0.0f; initGeometry(); if ( Models::getGlobal( Fn::Property::G_SHOW_AXIAL ).toBool() ) { float blue = (float)(( 1 ) & 0xFF) / 255.f; GLFunctions::getShader( "slice" )->setUniformValue( "u_pickColor", red, green , blue, pAlpha ); drawAxial( target ); } if ( Models::getGlobal( Fn::Property::G_SHOW_CORONAL ).toBool() ) { float blue = (float)(( 2 ) & 0xFF) / 255.f; GLFunctions::getShader( "slice" )->setUniformValue( "u_pickColor", red, green , blue, pAlpha ); drawCoronal( target ); } if ( Models::getGlobal( Fn::Property::G_SHOW_SAGITTAL ).toBool() ) { float blue = (float)(( 3 ) & 0xFF) / 255.f; GLFunctions::getShader( "slice" )->setUniformValue( "u_pickColor", red, green , blue, pAlpha ); drawSagittal( target ); } } void SliceRenderer::drawAxial( QString target ) { // Tell OpenGL which VBOs to use glBindBuffer( GL_ARRAY_BUFFER, vbo0 ); setShaderVars( target ); glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 ); glBindBuffer( GL_ARRAY_BUFFER, 0 ); } void SliceRenderer::drawCoronal( QString target ) { // Tell OpenGL which VBOs to use glBindBuffer( GL_ARRAY_BUFFER, vbo1 ); setShaderVars( target ); glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 ); glBindBuffer( GL_ARRAY_BUFFER, 0 ); } void SliceRenderer::drawSagittal( QString target ) { // Tell OpenGL which VBOs to use glBindBuffer( GL_ARRAY_BUFFER, vbo2 ); setShaderVars( target ); glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 ); glBindBuffer( GL_ARRAY_BUFFER, 0 ); }
27.195238
125
0.589914
mhough
69366e3f8e83342a45fdecb6fea9106253de68aa
5,349
hh
C++
hackt_docker/hackt/src/Object/lang/RTE_base.hh
broken-wheel/hacktist
36e832ae7dd38b27bca9be7d0889d06054dc2806
[ "MIT" ]
null
null
null
hackt_docker/hackt/src/Object/lang/RTE_base.hh
broken-wheel/hacktist
36e832ae7dd38b27bca9be7d0889d06054dc2806
[ "MIT" ]
null
null
null
hackt_docker/hackt/src/Object/lang/RTE_base.hh
broken-wheel/hacktist
36e832ae7dd38b27bca9be7d0889d06054dc2806
[ "MIT" ]
null
null
null
/** \file "Object/lang/RTE_base.hh" Structures for production assignments. $Id: RTE_base.hh,v 1.12 2010/07/09 02:14:13 fang Exp $ */ #ifndef __HAC_OBJECT_LANG_RTE_BASE_HH__ #define __HAC_OBJECT_LANG_RTE_BASE_HH__ #include <list> #include "util/memory/excl_ptr.hh" #include "util/memory/count_ptr.hh" #include "util/persistent.hh" #include "util/boolean_types.hh" #include "Object/inst/instance_pool_fwd.hh" #include "Object/lang/PRS_dump_context.hh" namespace HAC { namespace entity { class unroll_context; class scopespace; struct bool_tag; template <class> class state_instance; /** Namespace for RTE objects. There are classes that are stored in process definitions, but not the final result of unroll-creation. */ namespace PRS { struct rule_dump_context; struct expr_dump_context; } namespace RTE { class footprint; // defined in "Object/lang/RTE_footprint.h" using std::list; using std::istream; using std::ostream; using util::good_bool; using util::memory::never_ptr; using util::memory::excl_ptr; using util::memory::count_ptr; using util::memory::sticky_ptr; using util::persistent; using util::persistent_object_manager; //============================================================================= class atomic_assignment; class rte_expr; typedef count_ptr<rte_expr> rte_expr_ptr_type; typedef count_ptr<const rte_expr> const_rte_expr_ptr_type; typedef state_instance<bool_tag> bool_instance_type; typedef instance_pool<bool_instance_type> node_pool_type; typedef size_t node_index_type; //============================================================================= /** Dump modifier for RTE assignments. */ typedef PRS::rule_dump_context assignment_dump_context; /** Helper class for controlling RTE and expression dumps. Reuse from PRS. */ typedef PRS::expr_dump_context expr_dump_context; //============================================================================= /** Abstract base class for a production atomic_assignment. TODO: parent link for upward structure? */ class atomic_assignment : public persistent { public: atomic_assignment() { } virtual ~atomic_assignment() { } virtual ostream& dump(ostream&, const assignment_dump_context&) const = 0; /** Prototype for unroll visiting. */ #define RTE_UNROLL_ASSIGN_PROTO \ good_bool \ unroll(const unroll_context&) const virtual RTE_UNROLL_ASSIGN_PROTO = 0; #define RTE_CHECK_ASSIGN_PROTO \ void check(void) const virtual RTE_CHECK_ASSIGN_PROTO = 0; struct checker; struct dumper; }; // end class atomic_assignment //============================================================================= /** A collection or production assignments. This class wants to be pure-virtual, except that it is instantiated non-dynamically by process_definition. */ class assignment_set_base : public list<sticky_ptr<atomic_assignment> > { protected: typedef list<sticky_ptr<atomic_assignment> > parent_type; public: typedef parent_type::value_type value_type; public: assignment_set_base(); // dtor needs to be polymorphic to dynamic_cast to assignment_set virtual ~assignment_set_base(); #if 0 private: // not copy-constructible, or should be restricted with run-time check explicit assignment_set(_baseconst this_type&); #endif public: ostream& dump(ostream&, const assignment_dump_context& = assignment_dump_context()) const; void append_assignment(excl_ptr<atomic_assignment>&); template <class R> void append_assignment(excl_ptr<R>& r) { excl_ptr<atomic_assignment> tr = r.template as_a_xfer<atomic_assignment>(); this->append_assignment(tr); } // supply these for derived classes RTE_UNROLL_ASSIGN_PROTO; RTE_CHECK_ASSIGN_PROTO; void collect_transient_info_base(persistent_object_manager&) const; void write_object_base(const persistent_object_manager&, ostream&) const; void load_object_base(const persistent_object_manager&, istream&); private: // hide this from user using parent_type::push_back; }; // end class assignment_set_base typedef assignment_set_base nested_assignments; //============================================================================= /** Abstract class of atomic assignment expressions. These expressions are not unrolled. */ class rte_expr : public persistent { public: /** Worry about implementation efficiency later... (Vector of raw pointers or excl_ptr with copy-constructor.) */ typedef list<rte_expr_ptr_type> expr_sequence_type; public: rte_expr() { } virtual ~rte_expr() { } virtual ostream& dump(ostream&, const expr_dump_context&) const = 0; ostream& dump(ostream& o) const { return dump(o, expr_dump_context()); } virtual void check(void) const = 0; // accumulate set of used node indices #define RTE_UNROLL_EXPR_PROTO \ size_t \ unroll(const unroll_context&) const virtual RTE_UNROLL_EXPR_PROTO = 0; #define RTE_UNROLL_COPY_PROTO \ rte_expr_ptr_type \ unroll_copy(const unroll_context&, const rte_expr_ptr_type&) const virtual RTE_UNROLL_COPY_PROTO = 0; protected: struct checker; struct unroller; struct unroll_copier; }; // end class rte_expr //============================================================================= } // end namespace RTE } // end namespace entity } // end namespace HAC #endif // __HAC_OBJECT_LANG_RTE_BASE_HH__
25.112676
82
0.699944
broken-wheel