blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
201
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
7
100
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
260 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
11.4k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
80 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
8
9.86M
extension
stringclasses
52 values
content
stringlengths
8
9.86M
authors
listlengths
1
1
author
stringlengths
0
119
54bd835a69bc7845510c40709914ab7616f795fd
fb59dcedeb1aae73e92afebeb6cb2e51b13d5c22
/middleware/src/app/NativeHandler/Huawei/C10/NativeHandlerRunningC10.cpp
d72e89bad24faff519c9f49dec911daca453bec0
[]
no_license
qrsforever/yxstb
a04a7c7c814b7a5647f9528603bd0c5859406631
78bbbae07aa7513adc66d6f18ab04cd7c3ea30d5
refs/heads/master
2020-06-18T20:13:38.214225
2019-07-11T16:40:14
2019-07-11T16:40:14
196,431,357
0
1
null
2020-03-08T00:54:09
2019-07-11T16:38:29
C
GB18030
C++
false
false
15,212
cpp
#include <iostream> #include "NativeHandlerRunningC10.h" #include "NativeHandlerAssertions.h" #include "Message.h" #include "SystemManager.h" #include "Business.h" #include "Session.h" #include "UltraPlayer.h" #include "UltraPlayerWebPage.h" #include "Hippo_Context.h" #include "Hippo_MediaPlayer.h" #include "BrowserAgentTakin.h" #include "SysSetting.h" #include "mid_stream.h" #include "stream_port.h" #include "codec.h" #include "SystemManager.h" #include "UltraPlayer.h" #include "irkey_tab.h" #include "KeyDispatcher.h" #include "ProgressBarDialog.h" #include "BootImagesShow.h" #include "app_sys.h" #include "libzebra.h" #include "MessageTypes.h" #include "MessageValueNetwork.h" extern "C" int TAKIN_browser_editingEnabled(int *handle, int *x, int *y, int *w, int *h); namespace Hippo { NativeHandlerRunningC10::NativeHandlerRunningC10() { } NativeHandlerRunningC10::~NativeHandlerRunningC10() { } void NativeHandlerRunningC10::onActive() { /* 启用键值表功能 */ if(!mDialog) keyDispatcher().setEnabled(true); //Network mask set DONT_SET(NMB_SHOW_ERROR_CODE); DONT_SET(NMB_SHOW_BOTTOM_ICON); DONT_SET(NMB_CONNECTOK_DOMENU); DONT_SET(NMB_REJOIN_WIRELESS); } void NativeHandlerRunningC10::onUnactive() { /* 关闭键值表功能 */ keyDispatcher().setEnabled(false); //Network mask clear DONT_ZERO(); } bool NativeHandlerRunningC10::handleMessage(Message *msg) { int speed = stream_port_get_rate(); if(MessageType_Repaint != msg->what) NATIVEHANDLER_LOG("what(0x%x), info(0x%x & 0x%x)\n", msg->what, msg->arg1, msg->arg2); if(mDialog) return NativeHandlerPublicC10::handleMessage(msg); SystemManager &sysManager = systemManager(); UltraPlayer *player = sysManager.obtainMainPlayer(); #if defined(Jiangsu) if(MessageType_Network == msg->what) { switch (msg->arg1) { case MV_Network_PhysicalDown: sendMessageToNativeHandler(MessageType_Network, MV_Network_PhysicalDown_OnOpenError, 0, 0); break; default: break; } } #endif switch (msg->arg1) { case EIS_IRKEY_VOLUME_UP:{ if(player){ int tVolume = player->GetVolume( ); if(tVolume < AUDIO_VOLUME_MAX){ tVolume += 5; } player->SetVolume(tVolume); sysManager.releaseMainPlayer(player); return true; } break; } case EIS_IRKEY_VOLUME_DOWN:{ if(player){ int tVolume = player->GetVolume( ); if(tVolume > 0){ tVolume -= 5; } player->SetVolume(tVolume); sysManager.releaseMainPlayer(player); return true; } break; } case EIS_IRKEY_VOLUME_MUTE:{ if(player){ if(player->GetMute()){ player->SetMute(0); } else{ player->SetMute(1); } sysManager.releaseMainPlayer(player); return true; } break; } case EIS_IRKEY_TRACK: case EIS_IRKEY_AUDIO: case EIS_IRKEY_AUDIO_MODE:{ if(player){ int tAudioChannel = player->GetChannel(); tAudioChannel += 1; NATIVEHANDLER_LOG("Set audio channel to %d\n", tAudioChannel); player->SetChannel(tAudioChannel); sysManager.releaseMainPlayer(player); return true; } break; } case EIS_IRKEY_PLAY: { int type; if(player) { type = player->getMediaType(); NATIVEHANDLER_LOG("Player type(%d); iptv<->%d,iptv2<->%d,vod<->%d\n", type, APP_TYPE_IPTV, APP_TYPE_IPTV2, APP_TYPE_VOD); if(type == APP_TYPE_IPTV || type == APP_TYPE_IPTV2 || type == APP_TYPE_VOD) { int ret = stream_port_get_state(); NATIVEHANDLER_LOG("playstate = %d\n", ret); if(ret == STRM_STATE_PLAY || ret == STRM_STATE_IPTV) { player->pause(); player->onPause(); keyDispatcher().setEnabled(false); if(!mProgressBarDialog) { ProgressBarDialog * dlg = new ProgressBarDialog(); mProgressBarDialog = dlg; dlg->setHandler(this); mProgressBarDialog->draw(); } } else if(ret == STRM_STATE_PAUSE) { if(mProgressBarDialog) { mProgressBarDialog->Close(); } player->resume(); } else if(ret == STRM_STATE_FAST) { player->resume(); mProgressBarDialog->Close(); } systemManager().releaseMainPlayer(player); return true; } } break; } case EIS_IRKEY_FASTFORWARD: { int type; if(player) { type = player->getMediaType(); if(type == APP_TYPE_IPTV || type == APP_TYPE_IPTV2 || type == APP_TYPE_VOD) { int ret = stream_port_get_state(); NATIVEHANDLER_LOG("playstate = %d\n", ret); if(ret != STRM_STATE_CLOSE) { if(speed <= 0) speed = 1; speed *= 2; if(speed > 32) speed = 2; NATIVEHANDLER_LOG("FastForward speed(%d)\n", speed); player->fastForward(speed); keyDispatcher().setEnabled(false); if(!mProgressBarDialog) { ProgressBarDialog *dlg = new ProgressBarDialog(); mProgressBarDialog = dlg; dlg->setHandler(this); mProgressBarDialog->draw(); } systemManager().releaseMainPlayer(player); return true; } } } break; } case EIS_IRKEY_REWIND: { int type; if(player) { type = player->getMediaType(); if(type == APP_TYPE_IPTV || type == APP_TYPE_IPTV2 || type == APP_TYPE_VOD) { int ret = stream_port_get_state(); NATIVEHANDLER_LOG("Current playstate(%d)\n", ret); if(ret != STRM_STATE_CLOSE) { if(speed >= 0) speed = -1; speed *= 2; if(speed < -32) speed = -2; NATIVEHANDLER_LOG("FastRewind speed(%d)\n", speed); player->fastRewind(speed); keyDispatcher().setEnabled(false); NATIVEHANDLER_LOG("FastRewind speed(%d)\n", speed); if(!mProgressBarDialog) { ProgressBarDialog *dlg = new ProgressBarDialog(); mProgressBarDialog = dlg; dlg->setHandler(this); mProgressBarDialog->draw(); } systemManager().releaseMainPlayer(player); return true; } } } break; } case EIS_IRKEY_PAGE_UP: { int type; if(player) { type = player->getMediaType(); if(type == APP_TYPE_IPTV || type == APP_TYPE_IPTV2 || type == APP_TYPE_VOD) { player->SeekToStart(); systemManager().releaseMainPlayer(player); return true; } } break; } case EIS_IRKEY_PAGE_DOWN: { int type; if(player) { type = player->getMediaType(); if(type == APP_TYPE_IPTV || type == APP_TYPE_IPTV2 || type == APP_TYPE_VOD) { #ifdef Liaoning player->seekEnd(); // 一键到尾立即结束 #else player->stop(); // 一键到尾播放3秒 #endif systemManager().releaseMainPlayer(player); return true; } } break; } case EIS_IRKEY_BACK: case EIS_IRKEY_STOP: { int type; if(player) { type = player->getMediaType(); if(type == APP_TYPE_IPTV || type == APP_TYPE_IPTV2) { int ret = stream_port_get_state(); NATIVEHANDLER_LOG("playstate = %d,%d\n", ret, type); if (type == APP_TYPE_IPTV || type == APP_TYPE_IPTV2) { if (ret == STRM_STATE_IPTV) { int changeVideoMode = 0; sysSettingGetInt("changevideomode", &changeVideoMode, 0); if (!changeVideoMode){ //0 is black screen 1 is last frame 2 is smooth change player->close(UltraPlayer::BlackScreenMode); } else { if (UltraPlayer::getVideoClearFlag()){ player->close(UltraPlayer::BlackScreenMode); UltraPlayer::setVideoClearFlag(0); } else{ player->close(UltraPlayer::LastFrameMode); } } } else { #ifdef Liaoning player->seekEnd(); // 一键到尾立即结束 #else player->stop(); // 一键到尾播放3秒 #endif } } else { int changeVideoMode = 0; sysSettingGetInt("changevideomode", &changeVideoMode, 0); if (!changeVideoMode){ //0 is black screen 1 is last frame 2 is smooth change player->close(UltraPlayer::BlackScreenMode); } else { if (UltraPlayer::getVideoClearFlag()){ player->close(UltraPlayer::BlackScreenMode); UltraPlayer::setVideoClearFlag(0); } else{ player->close(UltraPlayer::LastFrameMode); } } } systemManager().releaseMainPlayer(player); return true; } } break; } default:{ break; } } systemManager().releaseMainPlayer(player); if (msg->what == MessageType_System && msg->arg1 == HM_CLOSEDIALOG) { if(mProgressBarDialog) { if (mProgressBarDialog->onClose()) { delete mProgressBarDialog; mProgressBarDialog = 0; keyDispatcher().setEnabled(true); } } } if(msg->what == MessageType_KeyDown) { if(mProgressBarDialog) { //5E= bool status = mProgressBarDialog->handleMessage(msg); if(status) return status; } } return NativeHandlerPublicC10::handleMessage(msg); } bool NativeHandlerRunningC10::onPlayPause() { SystemManager &sysManager = systemManager(); UltraPlayer *player = NULL; player = sysManager.obtainMainPlayer(); if(player){ player->pause(); player->onPause(); } sysManager.releaseMainPlayer(player); return true; } bool NativeHandlerRunningC10::onLeft(Message *msg) { SystemManager &sysManager = systemManager(); UltraPlayer *player = NULL; player = sysManager.obtainMainPlayer(); if(player){ if(1 == business().getKeyCtrl() && STRM_STATE_PAUSE != player->mCurrentStatus) msg->arg1 = EIS_IRKEY_VOLUME_DOWN; } sysManager.releaseMainPlayer(player); return false; } bool NativeHandlerRunningC10::onRight(Message *msg) { SystemManager &sysManager = systemManager(); UltraPlayer *player = NULL; player = sysManager.obtainMainPlayer(); if(player){ if(1 == business().getKeyCtrl() && STRM_STATE_PAUSE != player->mCurrentStatus) msg->arg1 = EIS_IRKEY_VOLUME_DOWN; } sysManager.releaseMainPlayer(player); return false; } #if defined (LIAONING_SD) bool NativeHandlerRunningC10::doSwitch()//no play openconfig { int keymod = NativeHandlerGetState(); SystemManager &sysManager = systemManager(); UltraPlayer *player = sysManager.obtainMainPlayer(); bool ret = false; if(player == NULL){ webchannelFlagSet(0); NativeHandlerPublicC10::doOpenConfigPage(); ret = true; }else if(keymod == 2 && player->mDisplayMode != 0){ ret = false; }else{ webchannelFlagSet(0); NativeHandlerPublicC10::doOpenConfigPage(); ret = true; } sysManager.releaseMainPlayer(player); return ret; } #endif #ifdef Liaoning bool NativeHandlerRunningC10::doBack(){ SystemManager &sysManager = systemManager(); UltraPlayer *player = sysManager.obtainMainPlayer(); int x = 0, y = 0, w = 0, h = 0; bool ret = false; if(player != NULL){ if( session().getPlatform() == PLATFORM_ZTE && !TAKIN_browser_editingEnabled((int *)(epgBrowserAgentGetHandle()), &x, &y, &w, &h) && APP_TYPE_VOD == player->getMediaType() && 1 == player->mDisplayMode){ sendMessageToNativeHandler(MessageType_Unknow, VK_FINAL, 0, 0); ret = true; } } sysManager.releaseMainPlayer(player); return ret; } #endif bool NativeHandlerRunningC10::doMenu() { #if defined(Jiangsu) if(PLATFORM_ZTE == session().getPlatform()) return false; #endif return NativeHandlerPublicC10::doMenu(); } } // namespace Hippo
[ "lidong8@le.com" ]
lidong8@le.com
88d0fe1f72a5af76ead4c7a35da4234b181c81d1
8e9ca33cbfecf4d4b16343af8f594dc6a7058b18
/kdservice/src/include/Debugger/States/InitialState.h
5abd92389f48f44448b4f788d777a6456a3e1312
[]
no_license
tuxford/wkd
4864fc2cdf378d58372d011f56068f6344491e29
1c23e827cc67c91c6ddf2b06b9de243cbb954657
refs/heads/master
2021-01-01T06:26:40.249520
2013-07-07T21:02:50
2013-07-07T21:02:50
8,139,242
2
0
null
null
null
null
UTF-8
C++
false
false
1,110
h
/* * InitialState.h * * Created on: Feb 18, 2013 * Author: Roman Luchyshyn */ #ifndef Debugger_States_InitialState_H_ #define Debugger_States_InitialState_H_ #include "Debugger/StateMachine.h" #include "Debugger/Events/EntryEvent.h" #include "Debugger/Events/ConnectEvent.h" #include <boost/statechart/state.hpp> #include <boost/statechart/custom_reaction.hpp> #include <boost/mpl/list.hpp> namespace Debugger { namespace States { class InitialState: public boost::statechart::state<InitialState, StateMachine> { public: typedef boost::mpl::list< boost::statechart::custom_reaction<Events::EntryEvent>, boost::statechart::custom_reaction<Events::ConnectEvent> > reactions; static const StateId STATE_ID; InitialState(my_context context); virtual ~InitialState(); boost::statechart::result react(const Events::EntryEvent& event); boost::statechart::result react(const Events::ConnectEvent& event); private: void updateContext(); }; } /* namespace States */ } /* namespace Debugger */ #endif /* Debugger_States_InitialState_H_ */
[ "romashka@dell-desktop.(none)" ]
romashka@dell-desktop.(none)
997a1339ec4e0b4f82168be63cff5d16d7d83ce2
ee2e3718b911a7bd22f953d0320a04cca2a23b5e
/LeetCode/May LeetCode Challenge/C++/1 - First Bad Version.cpp
c3a72bf6465b1f123e8a80bf4b1996241ba6d518
[]
no_license
PythonCodes1/Competitive-programming
57ce85284979e1424b7133fba89337f2f5bed6ea
5f3e0e2b2eefa137109b72084bd7d453e9a892e6
refs/heads/master
2022-11-10T22:27:05.270210
2020-06-28T15:23:10
2020-06-28T15:23:10
259,029,974
0
0
null
null
null
null
UTF-8
C++
false
false
893
cpp
/* You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad. Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, which causes all the following ones to be bad. You are given an API bool isBadVersion(version) which will return whether version is bad. Implement a function to find the first bad version. You should minimize the number of calls to the API. */ class Solution { public: int firstBadVersion(int n) { int s = 1, e = n; while(s<e){ int mid = s + (e-s)/2; if(isBadVersion(mid)) e = mid; else s = mid+1; } return s; } };
[ "noreply@github.com" ]
noreply@github.com
87aff66782dbe185690012bee0ac08849fcd30ef
56dbf20f50eca7c844ebef3861f777eaeb76220d
/baselibc/hc_utils/src/hc_condition.cpp
015f1ec148ab70a1867664860732c5e7d78c002c
[]
no_license
joliny/ricabin
b4e6d8270e741a12ffca7ca62ce18f234fa023b3
8407580e8d91a24f198d3d69b4db477e5ab59e41
refs/heads/master
2020-04-06T04:14:48.324760
2014-06-12T15:19:46
2014-06-12T15:19:46
null
0
0
null
null
null
null
GB18030
C++
false
false
8,197
cpp
#include "hc_condition.h" #ifdef WIN32 #define NOMINMAX #define _WIN32_WINNT 0x0500 #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <process.h> #else #include <pthread.h> #endif #include <assert.h> #ifndef _MULTI_THREAD //! @一个空条件锁 class condition_impl { friend class conditionc; condition_impl(int& status) { } ~condition_impl() { } int lock() { return 0; } int unlock() { return 0; } int wait() { return 0; } int timed_wait(int msec) { return 0; } int signal() { return 0; } int broadcast() { return 0; } }; #else #ifdef WIN32 class condition_impl { friend class conditionc; condition_impl(int & status) : m_sema_(NULL) , m_waiters_done_(NULL) , m_mutex_(NULL) { m_waiters_count_ = 0; m_was_broadcast_ = 0; ::InitializeCriticalSection( &m_waiters_count_lock_); m_sema_ = ::CreateSemaphore( NULL, // no security 0, // initially 0 0x7fffffff, // max count NULL); // unnamed m_waiters_done_ = CreateEvent ( NULL, // no security FALSE, // auto-reset FALSE, // non-signaled initially NULL); // unnamed m_mutex_ = ::CreateMutex( NULL, // no security FALSE, // notinitial owner NULL); // unnamed if (m_sema_ == NULL || m_waiters_done_ == NULL || m_mutex_ == NULL) status = -1; } ~condition_impl() { if (m_mutex_ != NULL) ::CloseHandle(m_mutex_); if (m_waiters_done_ != NULL) ::CloseHandle(m_waiters_done_); if (m_sema_ != NULL) ::CloseHandle(m_sema_); ::DeleteCriticalSection(&m_waiters_count_lock_); } int lock() { return ::WaitForSingleObject(m_mutex_, INFINITE) == WAIT_OBJECT_0 ? 0 : -1; } int unlock() { return ::ReleaseMutex(m_mutex_) ? 0 : -1; } int wait() { return timed_wait(INFINITE); } int timed_wait(int msec) { // Avoid race conditions. ::EnterCriticalSection (&m_waiters_count_lock_); m_waiters_count_++; ::LeaveCriticalSection (&m_waiters_count_lock_); // This call atomically releases the mutex and waits on the // semaphore until <pthread_cond_signal> or <pthread_cond_broadcast> // are called by another thread. // 假设等待信号的操作时间比较长,其他的获取锁的操作应该都比较短 ::SignalObjectAndWait (m_mutex_, m_sema_, msec, FALSE); // Reacquire lock to avoid race conditions. ::EnterCriticalSection (&m_waiters_count_lock_); // We're no longer waiting... m_waiters_count_--; // Check to see if we're the last waiter after <pthread_cond_broadcast>. int last_waiter = m_was_broadcast_ && m_waiters_count_ == 0; ::LeaveCriticalSection (&m_waiters_count_lock_); // If we're the last waiter thread during this particular broadcast // then let all the other threads proceed. if (last_waiter) // This call atomically signals the <waiters_done_> event and waits until // it can acquire the <external_mutex>. This is required to ensure fairness. ::SignalObjectAndWait (m_waiters_done_, m_mutex_, INFINITE, FALSE); else // Always regain the external mutex since that's the guarantee we // give to our callers. ::WaitForSingleObject (m_mutex_, INFINITE); return 0; } int signal() { EnterCriticalSection (&m_waiters_count_lock_); int have_waiters = m_waiters_count_ > 0; LeaveCriticalSection (&m_waiters_count_lock_); // If there aren't any waiters, then this is a no-op. if (have_waiters) ReleaseSemaphore (m_sema_, 1, 0); return 0; } int broadcast() { // This is needed to ensure that <waiters_count_> and <was_broadcast_> are // consistent relative to each other. EnterCriticalSection (&m_waiters_count_lock_); int have_waiters = 0; if (m_waiters_count_ > 0) { // We are broadcasting, even if there is just one waiter... // Record that we are broadcasting, which helps optimize // <pthread_cond_wait> for the non-broadcast case. m_was_broadcast_ = 1; have_waiters = 1; } if (have_waiters) { // Wake up all the waiters atomically. ReleaseSemaphore (m_sema_, m_waiters_count_, 0); LeaveCriticalSection (&m_waiters_count_lock_); // Wait for all the awakened threads to acquire the counting // semaphore. WaitForSingleObject(m_waiters_done_, INFINITE); // This assignment is okay, even without the <waiters_count_lock_> held // because no other waiter threads can wake up to access it. m_was_broadcast_ = 0; } else LeaveCriticalSection (&m_waiters_count_lock_); return 0; } int m_waiters_count_; // Number of waiting threads. CRITICAL_SECTION m_waiters_count_lock_; // Serialize access to <waiters_count_>. HANDLE m_sema_; // Semaphore used to queue up threads waiting for the condition to // become signaled. HANDLE m_waiters_done_; // An auto-reset event used by the broadcast/signal thread to wait // for all the waiting thread(s) to wake up and be released from the // semaphore. size_t m_was_broadcast_; // Keeps track of whether we were broadcasting or signaling. This // allows us to optimize the code if we're just signaling. HANDLE m_mutex_; }; #else class condition_impl { friend class conditionc; condition_impl(int & status) : m_init_status_(0) { if (::pthread_mutex_init(&m_mutex_, NULL) == 0) m_init_status_ |= 1; if (::pthread_cond_init(&m_thread_cond_, NULL) == 0) m_init_status_ |= 2; if (m_init_status_ != 3) status = -1; } ~condition_impl() { if (m_init_status_ & 2) ::pthread_cond_destroy(&m_thread_cond_); if (m_init_status_ & 1) ::pthread_mutex_destroy(&m_mutex_); } int lock() { return ::pthread_mutex_lock(&m_mutex_); } int unlock() { return ::pthread_mutex_unlock(&m_mutex_); } int wait() { return ::pthread_cond_wait(&m_thread_cond_, &m_mutex_); } int timed_wait(int msec) { struct timespec ts; // 这里clock_gettime从rt库导出,链接时需要指定“-l rt” clock_gettime(CLOCK_REALTIME, &ts); ts.tv_sec += msec / 1000; ts.tv_nsec += (msec % 1000) * 1000 * 1000; if (ts.tv_nsec >= 1000 * 1000 * 1000) { ts.tv_sec++; ts.tv_nsec -= 1000 * 1000 * 1000; } return ::pthread_cond_timedwait(&m_thread_cond_, &m_mutex_, &ts); } int signal() { return ::pthread_cond_signal(&m_thread_cond_); } int broadcast() { return ::pthread_cond_broadcast(&m_thread_cond_); } pthread_mutex_t m_mutex_; pthread_cond_t m_thread_cond_; int m_init_status_; }; #endif #endif conditionc::conditionc() : m_condition_impl_(NULL) { } conditionc::~conditionc() { if (m_condition_impl_) delete m_condition_impl_; } int conditionc::init() { int status = 0; m_condition_impl_ = new condition_impl(status); assert(m_condition_impl_); return status; } int conditionc::lock() { return m_condition_impl_->lock(); } int conditionc::unlock() { return m_condition_impl_->unlock(); } int conditionc::wait() { return m_condition_impl_->wait(); } int conditionc::timed_wait(int msec) { return m_condition_impl_->timed_wait(msec); } int conditionc::signal() { return m_condition_impl_->signal(); } int conditionc::broadcast() { return m_condition_impl_->broadcast(); }
[ "x.m.wang7075@gmail.com" ]
x.m.wang7075@gmail.com
ef6c18a08fcf7a0d681b61b3e8ec42ebda1c1a43
3fb1cbf8352dad0d7396e9c06b1524dfb42b7a9b
/UnivGraphicsLib/Hardware_ks0108.cxx
8b7a04cd70f8166b8a8cbc61f1c882fe44f6bc46
[]
no_license
chandana1972/thirdpartylibraries
b24ad571ab9182cc15b505810bc9bf07650e6479
4b40788cb7a46a1800f2bd3b9100127983848dc8
refs/heads/master
2020-05-20T02:11:51.845597
2017-10-17T11:47:06
2017-10-17T11:47:06
null
0
0
null
null
null
null
UTF-8
C++
false
false
12,086
cxx
//******************************************************************************* //* //* ks0108 Arduino drivers //* //* (C) by Mark Sproul //* This code is derived from other works. Credit is given below //* This is open source like the rest of the arduino source code //* //* this code is derived from the ks0108.cpp Arduino library //* //******************************************************************************* //* ks0108.cpp - Arduino library support for ks0108 and compatable graphic LCDs //* Copyright (c)2008 Michael Margolis All right reserved //* mailto:memargolis@hotmail.com?subject=KS0108_Library //* //* The high level functions of this library are based on version 1.1 of ks0108 graphics routines //* written and copyright by Fabian Maximilian Thiele. His sitelink is dead but //* you can obtain a copy of his original work here: //* http://www.scienceprog.com/wp-content/uploads/2007/07/glcd_ks0108.zip //* //* Code changes include conversion to an Arduino C++ library, rewriting the low level routines //* to read busy status flag and support a wider range of displays, adding more flexibility //* in port addressing and improvements in I/O speed. The interface has been made more Arduino friendly //* and some convenience functions added. //* //* This library is distributed in the hope that it will be useful, //* but WITHOUT ANY WARRANTY; without even the implied warranty of //* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. //* //* Version: 1.0 - May 8 2008 - first release //* Version: 1.1 - Nov 7 2008 - restructured low level code to adapt to panel speed //* - moved chip and panel configuration into seperate header files //* - added fixed width system font //* Version: 2 - May 26 2009 - second release //* - added support for Mega and Sanguino, improved panel speed tolerance, added bitmap support //* //******************************************************************************* //* <MLS> is Mark Sproul msproul -at- jove.rutgers.edu //* http://coewww.rutgers.edu/~msproul/ //******************************************************************************* //* Detailed edit history //******************************************************************************* //* Jan 28, 2010 <MLS> Started on UnivGraphicsLib //* Jun 20, 2011 <MLS> UGL working on KS0108 board on mega //******************************************************************************* #include <string.h> #include <stdio.h> #include <stdlib.h> #if defined(__AVR__) #include <avr/pgmspace.h> #endif #include "HardwareSerial.h" #include "UnivGraphicsHW_Defs.h" #include "UnivGraphicsLib.h" #include "UnivGraphicsHardware.h" //* this is the routines that the implementer provides #ifdef _GRAPHICS_HW_KS0108_ //* this slows down the drawing so you can debug things. //#define GLCD_DEBUG #define ksSOURCE #include "ks0108.h" //******************************************************************************* //* private globals for ks0108 static lcdCoord gCoord; static boolean gInverted; #pragma mark - #pragma mark ks0108 private routines #ifndef __MWERKS__ #define EN_DELAY() asm volatile( "ldi r24, %0 \n\t" "subi r24, 0x1 \n\t" "and r24, r24 \n\t" "brne .-6 \n\t" ::"M" (EN_DELAY_VALUE) : "r24" ) #endif static void KS0108_WriteCommand(uint8_t cmd, uint8_t chip); void KS0108_WriteData(uint8_t data); //*********************************************************************************** __inline__ void KS0108_SelectChip(uint8_t chip) { //static uint8_t prevchip; if (gChipSelect[chip] & 1) { fastWriteHigh(CSEL1); } else { fastWriteLow(CSEL1); } if (gChipSelect[chip] & 2) { fastWriteHigh(CSEL2); } else { fastWriteLow(CSEL2); } } //*********************************************************************************** void KS0108_WaitReady( uint8_t chip) { // wait until LCD busy bit goes to zero KS0108_SelectChip(chip); lcdDataDir(0x00); fastWriteLow(D_I); fastWriteHigh(R_W); fastWriteHigh(EN); EN_DELAY(); while(LCD_DATA_IN_HIGH & LCD_BUSY_FLAG) { ; //do nothin } fastWriteLow(EN); } //*********************************************************************************** __inline__ void KS0108_Enable(void) { EN_DELAY(); fastWriteHigh(EN); // EN high level width min 450 ns EN_DELAY(); fastWriteLow(EN); //EN_DELAY(); // some displays may need this delay at the end of the enable pulse } //*********************************************************************************** void KS0108_GotoXY(uint8_t x, uint8_t y) { uint8_t chip, cmd; if ( (x > DISPLAY_WIDTH-1) || (y > DISPLAY_HEIGHT-1) ) // exit if coordinates are not legal return; gCoord.x = x; // save new coordinates gCoord.y = y; if (y/8 != gCoord.page) { gCoord.page = y/8; cmd = LCD_SET_PAGE | gCoord.page; // set y address on all chips for (chip=0; chip < DISPLAY_WIDTH/CHIP_WIDTH; chip++) { KS0108_WriteCommand(cmd, chip); } } chip = gCoord.x/CHIP_WIDTH; x = x % CHIP_WIDTH; cmd = LCD_SET_ADD | x; KS0108_WriteCommand(cmd, chip); // set x address on active chip } //*********************************************************************************** uint8_t KS0108_DoReadData(uint8_t first) { uint8_t data, chip; chip = gCoord.x / CHIP_WIDTH; KS0108_WaitReady(chip); if (first) { if (gCoord.x % CHIP_WIDTH == 0 && chip > 0) { // todo , remove this test and call GotoXY always? KS0108_GotoXY(gCoord.x, gCoord.y); KS0108_WaitReady(chip); } } fastWriteHigh(D_I); // D/I = 1 fastWriteHigh(R_W); // R/W = 1 fastWriteHigh(EN); // EN high level width: min. 450ns EN_DELAY(); #ifdef LCD_DATA_NIBBLES data = (LCD_DATA_IN_LOW & 0x0F) | (LCD_DATA_IN_HIGH & 0xF0); #else data = LCD_DATA_IN_LOW; // low and high nibbles on same port so read all 8 bits at once #endif fastWriteLow(EN); if (first == 0) { KS0108_GotoXY(gCoord.x, gCoord.y); } if (gInverted) { data = ~data; } return data; } //*********************************************************************************** inline uint8_t KS0108_ReadData(void) { KS0108_DoReadData(1); // dummy read return KS0108_DoReadData(0); // "real" read gCoord.x++; } //*********************************************************************************** static void KS0108_WriteCommand(uint8_t cmd, uint8_t chip) { if (gCoord.x % CHIP_WIDTH == 0 && chip > 0) { // todo , ignore address 0??? EN_DELAY(); } KS0108_WaitReady(chip); fastWriteLow(D_I); // D/I = 0 fastWriteLow(R_W); // R/W = 0 lcdDataDir(0xFF); EN_DELAY(); lcdDataOut(cmd); KS0108_Enable(); // enable EN_DELAY(); EN_DELAY(); lcdDataOut(0x00); } //*********************************************************************************** void KS0108_WriteData(uint8_t data) { uint8_t displayData, yOffset, chip; //showHex("wrData",data); //showXY("wr", this->Coord.x,this->Coord.y); #ifdef LCD_CMD_PORT uint8_t cmdPort; #endif #ifdef GLCD_DEBUG volatile uint16_t i; for (i=0; i<5000; i++); #endif if (gCoord.x >= DISPLAY_WIDTH) return; chip = gCoord.x/CHIP_WIDTH; KS0108_WaitReady(chip); if (gCoord.x % CHIP_WIDTH == 0 && chip > 0) { // todo , ignore address 0??? KS0108_GotoXY(gCoord.x, gCoord.y); } fastWriteHigh(D_I); // D/I = 1 fastWriteLow(R_W); // R/W = 0 lcdDataDir(0xFF); // data port is output yOffset = gCoord.y%8; if (yOffset != 0) { // first page #ifdef LCD_CMD_PORT cmdPort = LCD_CMD_PORT; // save command port #endif displayData = KS0108_ReadData(); #ifdef LCD_CMD_PORT LCD_CMD_PORT = cmdPort; // restore command port #else fastWriteHigh(D_I); // D/I = 1 fastWriteLow(R_W); // R/W = 0 SelectChip(chip); #endif lcdDataDir(0xFF); // data port is output displayData |= data << yOffset; if (gInverted) displayData = ~displayData; lcdDataOut( displayData); // write data KS0108_Enable(); // enable // second page KS0108_GotoXY(gCoord.x, gCoord.y+8); displayData = KS0108_ReadData(); #ifdef LCD_CMD_PORT LCD_CMD_PORT = cmdPort; // restore command port #else fastWriteHigh(D_I); // D/I = 1 fastWriteLow(R_W); // R/W = 0 SelectChip(chip); #endif lcdDataDir(0xFF); // data port is output displayData |= data >> (8-yOffset); if (gInverted) displayData = ~displayData; lcdDataOut(displayData); // write data KS0108_Enable(); // enable KS0108_GotoXY(gCoord.x + 1, gCoord.y - 8); } else { // just this code gets executed if the write is on a single page if (gInverted) { data = ~data; } EN_DELAY(); lcdDataOut(data); // write data KS0108_Enable(); // enable gCoord.x++; //showXY("WrData",gCoord.x, gCoord.y); } } //*********************************************************************************** void KS0108_ClearPage(uint8_t page, uint8_t color) { for (uint8_t x=0; x < DISPLAY_WIDTH; x++) { KS0108_GotoXY(x, page * 8); KS0108_WriteData(color); } } //*********************************************************************************** void KS0108_ClearScreen(uint8_t color) { uint8_t page; for ( page = 0; page < 8; page++) { KS0108_GotoXY(0, page * 8); KS0108_ClearPage(page, color); } } //*********************************************************************************** void KS0108_SetDot(uint8_t xLoc, uint8_t yLoc, uint8_t color) { if ((xLoc >= 0) && (xLoc < gWidth) && (yLoc >= 0) && (yLoc < gHeight)) { uint8_t data; KS0108_GotoXY(xLoc, yLoc - yLoc % 8); // read data from display memory data = KS0108_ReadData(); if (color == BLACK) { data |= 0x01 << (yLoc % 8); // set dot } else { data &= ~(0x01 << (yLoc % 8)); // clear dot } KS0108_WriteData(data); // write data back to display } } #pragma mark - #pragma mark Graphics Hardware Routines //******************************************************************************* //* returns TRUE if succesfull boolean GrahicsHW_CheckIfPresent(void) { return(true); } //******************************************************************************* boolean GrahicsHW_Init(void) { #ifdef _DEBUG_VIA_SERIAL_ Serial.println("KS0108_Init"); #if defined(__AVR_ATmega1280__) Serial.println("__AVR_ATmega1280__"); #endif #endif pinMode(D_I, OUTPUT); pinMode(R_W, OUTPUT); pinMode(EN, OUTPUT); pinMode(CSEL1, OUTPUT); pinMode(CSEL2, OUTPUT); delay(10); fastWriteLow(D_I); fastWriteLow(R_W); fastWriteLow(EN); gCoord.x = 0; gCoord.y = 0; gCoord.page = 0; gInverted = false; for (uint8_t chip=0; chip < DISPLAY_WIDTH/CHIP_WIDTH; chip++) { delay(10); KS0108_WriteCommand(LCD_ON, chip); // power on delay(2); KS0108_WriteCommand(LCD_DISP_START, chip); // display start line = 0 } // delay(50); delay(150); #ifdef _MONOCHROME_BLACK_ON_WHITE_ KS0108_ClearScreen(WHITE); #else KS0108_ClearScreen(BLACK); #endif KS0108_GotoXY(0, 0); gWidth = DISPLAY_WIDTH; gHeight = DISPLAY_HEIGHT; return(true); } //******************************************************************************* void GrahicsHW_EraseScreen(void) { #ifdef _MONOCHROME_BLACK_ON_WHITE_ KS0108_ClearScreen(WHITE); #else KS0108_ClearScreen(BLACK); #endif } //******************************************************************************* void GrahicsHW_Reset(void) { } //******************************************************************************* void GrahicsHW_SetPixel(short xLoc, short yLoc, unsigned char theColorByte) { uint8_t pixelColor; if ((xLoc > gWidth) || (yLoc > gHeight)) { return; } if ((xLoc < 0) || (yLoc < 0)) { return; } pixelColor = (theColorByte ? BLACK : WHITE); KS0108_SetDot(xLoc, yLoc, pixelColor); } //******************************************************************************* short GrahicsHW_GetWidth(void) { return(gWidth); } //******************************************************************************* short GrahicsHW_GetHeight(void) { return(gHeight); } #endif // _GRAPHICS_HW_KS0108_
[ "msproul@skychariot.com" ]
msproul@skychariot.com
75b07cfad73f9a48a016513b0411b021cfd2efe1
766a66bd08d163f8c1cb8648d3d38e0f598390cf
/Code/sortFunc.h
1c0be551437d1f80a91137ef9764915f9163e90c
[]
no_license
dhelms1/cpp_practice
ab640dec1096397f3d0badd52a7f4ecd350287b7
e5321d55087a64ab4f5216c8895067bc8704708b
refs/heads/main
2023-07-15T20:12:30.323946
2021-08-20T23:14:41
2021-08-20T23:14:41
390,189,407
0
0
null
null
null
null
UTF-8
C++
false
false
2,347
h
#ifndef SORTFUNC_H #define SORTFUNC_H #include <iostream> #include <vector> #include <stdlib.h> #include <time.h> #include <numeric> #include <algorithm> #include <random> #include <string> #include <chrono> struct Timer { std::chrono::time_point<std::chrono::steady_clock> start, end; std::chrono::duration<float> duration; Timer() { // constructor start = std::chrono::high_resolution_clock::now(); } ~Timer() { // destructor end = std::chrono::high_resolution_clock::now(); duration = end - start; float ms = duration.count() * 1000.0f; // convert sec to ms std::cout << "Sorted in " << ms << "ms." << std::endl; } }; void vectorPrint(std::vector<int> *vals, int n) { for (int i = 0; i < n; i++) std::cout << (*vals).at(i) << " "; std::cout << std::endl; } void bubbleSort(std::vector<int> *vals, int n) { int num_its = 0; Timer timer; // create timer (destructor prints time in ms) do { for (int i = 0; i < n - 1; i++) { num_its++; if ((*vals)[i] > (*vals)[i+1]) { int tmp = (*vals)[i+1]; (*vals)[i+1] = (*vals)[i]; (*vals)[i] = tmp; } } } while (!std::is_sorted((*vals).begin(), (*vals).end())); std::cout << "Bubble Sort: " << num_its << " iterations" << std::endl; } void selectionSort(std::vector<int> *vals, int n) { int num_its = 0; Timer timer; for (int i = 0; i < n-1; i++) { int current_min = (*vals)[i]; int min_idx = i; num_its++; for (int j = i+1; j < (*vals).size(); j++) { if ((*vals)[j] < current_min) { current_min = (*vals)[j]; min_idx = j; } num_its++; } int tmp = (*vals)[i]; // get current head value (*vals)[i] = current_min; // move min to head (*vals)[min_idx] = tmp; // set original min idx to old head value } std::cout << "Selection Sort: " << num_its << " iterations" << std::endl; } void insertionSort(std::vector<int> *vals, int n) { int num_its = 0; Timer timer; for (int i = 1; i < n; i++) { num_its++; // to be filled in } std::cout << "Insertion Sort: " << num_its << " iterations" << std::endl; } #endif
[ "derek.helms4@gmail.com" ]
derek.helms4@gmail.com
b4a3685bdcbc0756e384ced4d323385ef9d2cdca
f298165c28590e5fa8643241424f385c38940d2e
/SDK/PUBG_OptionTitleWidget_functions.cpp
83f271886abff3801cd1edefe72778cb8b8227e1
[]
no_license
ZoondEngine/Core
2d35cc0121c7eb37b3744609e69f02a07fa36ac1
03cce9e7939c9654dc4da16e753eb62cbd9b1450
refs/heads/master
2020-03-14T01:16:16.972475
2018-04-28T04:49:50
2018-04-28T04:49:50
131,373,903
0
0
null
null
null
null
UTF-8
C++
false
false
941
cpp
// PLAYERUNKNOWN'S BATTLEGROUNDS (3.7.27.27) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "../SDK.hpp" namespace Classes { //--------------------------------------------------------------------------- //Functions //--------------------------------------------------------------------------- // Function OptionTitleWidget.OptionTitleWidget_C.GetText_1 // (Public, HasOutParms, BlueprintCallable, BlueprintEvent, BlueprintPure) // Parameters: // struct FText ReturnValue (Parm, OutParm, ReturnParm) struct FText UOptionTitleWidget_C::GetText_1() { static auto fn = UObject::FindObject<UFunction>("Function OptionTitleWidget.OptionTitleWidget_C.GetText_1"); UOptionTitleWidget_C_GetText_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "mango.kamchatka.1997@gmail.com" ]
mango.kamchatka.1997@gmail.com
393966444b80ffcbe11b8527cfa215a28ad778db
8ecfdda5391631c1ab6ea71a06d67d1a29290edc
/December_6.cpp
dbe792d69b216b4cc9506cd46d1ab6959b4fe98b
[]
no_license
Freezecoke/UVA
de9ba28646adf7466fab1ba74f023db67646839a
708f3dd58ad49455761db260d9be8c8e83e6d6df
refs/heads/master
2021-07-08T17:54:08.450395
2019-03-21T18:40:22
2019-03-21T18:40:22
146,403,159
0
0
null
null
null
null
UTF-8
C++
false
false
1,040
cpp
#include<iostream> #include<fstream> #include<string> #include "math.h" using namespace std; string input_path = "/Users/jason/Desktop/UVA/input_1206.txt"; int main(){ ifstream input(input_path); string storage; bool check = false; int x[50]; int y[50]; int x_length; int y_length; int cnt=0; while( getline(input, storage) ){ cout << storage << endl; x_length = 0; y_length = 0; for(int i=0; i<storage.length(); i++){ if(storage[i] != ',') x_length++; else{ y_length = storage.length() - x_length -2;//, and space break; } } //initialize x[cnt] = 0; y[cnt] = 0; for(int i=0; i<x_length; i++){ x[cnt] += (storage[i]-48) * pow(10, x_length-i-1); } for(int i=0; i<y_length; i++){ y[cnt] += (storage[i+x_length+2]-48) * pow(10, y_length-i-1); } //cout << "x[cnt]= " << x[cnt] << " y[cnt]=" << y[cnt] << endl; //cout << "x_length= " << x_length << " y_length= " << y_length << endl; cnt++; } }
[ "gtopopjason@gmail.com" ]
gtopopjason@gmail.com
220d599fdf0869e79bca37bca1d496d061482f0f
c79755ea5e07ba05fac7105768a53dd1f78d6c8a
/s_fractal_scenario.cpp
5755e8288645c6abd359dfbb2148b7b1427b19d1
[ "MIT" ]
permissive
Ludorg/s_fractal_cpp
7625d40dcc7c7733653e17b938800fbec32200a2
308dc45d5e587005b9dc273ffe8bf623c5c85c85
refs/heads/master
2021-09-08T22:05:26.124611
2021-08-30T22:44:31
2021-08-30T22:44:31
250,845,306
1
0
MIT
2021-08-30T22:55:05
2020-03-28T16:44:04
C++
UTF-8
C++
false
false
8,928
cpp
// Sofia (Sofia_aleph) // // Sofia, my way for developing knowledge // // (c) 2004 Ludovic LIEVRE aka Ludorg // fractal generator : XML scenario for fractal generator // // 0.0.1 2004/07/10 : file creation #include <iostream> #include "s_fractal_scenario.h" #include "s_xml_doc.h" #include "s_xml_element.h" SOFIA_NS_BEGIN void Dump(const MandelbrotParams &params); void Dump(const JuliaParams &params); FractalScenario::FractalScenario() : isLoaded_(false) { } FractalScenario::FractalScenario(const char *fileName) : isLoaded_(false) { load(fileName); } bool FractalScenario::load(const char *fileName) { if (true == isLoaded_) return true; XMLDoc doc; doc.parse(fileName); XMLElement root(doc.getRootNode()); std::vector<XMLElement *> images = root.getElementsByPath("Scenario/Image"); for (std::vector<XMLElement *>::const_iterator it = images.begin(); it != images.end(); it++) { std::string type = (*(*it))["Type"]->toString(); std::string paramsId = (*(*it))["ParamsId"]->toString(); std::cout << "Image/Type : " << type << std::endl; std::cout << "Image/ParamsId : " << paramsId << std::endl; if ('M' == type[0]) // Mandelbrot { std::vector<XMLElement *> mandelbrot = root.getElementsByPath("MandelbrotParams"); for (std::vector<XMLElement *>::const_iterator itParams = mandelbrot.begin(); itParams != mandelbrot.end(); itParams++) { if (paramsId == (*(*itParams)).getAttribute("id")) { MandelbrotParams params; params.width_ = (*(*itParams))["width"]->toUInt(); params.height_ = (*(*itParams))["height"]->toUInt(); params.maxIterations_ = (*(*itParams))["maxIterations"]->toUInt(); params.minC_.real((*(*itParams))["minC/real"]->toDouble()); params.minC_.imag((*(*itParams))["minC/imag"]->toDouble()); params.maxC_.real((*(*itParams))["maxC/real"]->toDouble()); params.maxC_.imag((*(*itParams))["maxC/imag"]->toDouble()); params.minColor_.r_ = (*(*itParams))["minColor/red"]->toByte(); params.minColor_.g_ = (*(*itParams))["minColor/green"]->toByte(); params.minColor_.b_ = (*(*itParams))["minColor/blue"]->toByte(); params.maxColor_.r_ = (*(*itParams))["maxColor/red"]->toByte(); params.maxColor_.g_ = (*(*itParams))["maxColor/green"]->toByte(); params.maxColor_.b_ = (*(*itParams))["maxColor/blue"]->toByte(); params.outputFile_ = (*(*itParams))["outputFile"]->toString().c_str(); Dump(params); mandelbrotParams_.push_back(params); } } } else if ('J' == type[0]) // Julia { std::vector<XMLElement *> julia = root.getElementsByPath("JuliaParams"); for (std::vector<XMLElement *>::const_iterator itParams = julia.begin(); itParams != julia.end(); itParams++) { if (paramsId == (*(*itParams)).getAttribute("id")) { JuliaParams params; params.width_ = (*(*itParams))["width"]->toUInt(); params.height_ = (*(*itParams))["height"]->toUInt(); params.maxIterations_ = (*(*itParams))["maxIterations"]->toUInt(); params.minZ_.real((*(*itParams))["minZ/real"]->toDouble()); params.minZ_.imag((*(*itParams))["minZ/imag"]->toDouble()); params.maxZ_.real((*(*itParams))["maxZ/real"]->toDouble()); params.maxZ_.imag((*(*itParams))["maxZ/imag"]->toDouble()); params.c_.real((*(*itParams))["c/real"]->toDouble()); params.c_.imag((*(*itParams))["c/imag"]->toDouble()); params.minColor_.r_ = (*(*itParams))["minColor/red"]->toByte(); params.minColor_.g_ = (*(*itParams))["minColor/green"]->toByte(); params.minColor_.b_ = (*(*itParams))["minColor/blue"]->toByte(); params.maxColor_.r_ = (*(*itParams))["maxColor/red"]->toByte(); params.maxColor_.g_ = (*(*itParams))["maxColor/green"]->toByte(); params.maxColor_.b_ = (*(*itParams))["maxColor/blue"]->toByte(); params.outputFile_ = (*(*itParams))["outputFile"]->toString().c_str(); Dump(params); juliaParams_.push_back(params); } } } else { return isLoaded_; } } isLoaded_ = true; return isLoaded_; } void FractalScenario::run() { for (std::list<MandelbrotParams>::const_iterator it = mandelbrotParams_.begin(); it != mandelbrotParams_.end(); it++) { std::cout << "Processing " << it->outputFile_.c_str() << std::endl; ImageData *img; img = Mandelbrot(*it); img->writeTGA(it->outputFile_.c_str()); delete img; std::cout << "Completed " << std::endl; } for (std::list<JuliaParams>::const_iterator it = juliaParams_.begin(); it != juliaParams_.end(); it++) { std::cout << "Processing " << it->outputFile_.c_str() << std::endl; ImageData *img; img = Julia(*it); img->writeTGA(it->outputFile_.c_str()); delete img; std::cout << "Completed " << std::endl; } } void Dump(const MandelbrotParams &params) { std::cout << "MandelbrotParams" << std::endl; std::cout << "\t width " << params.width_ << std::endl; std::cout << "\t height " << params.height_ << std::endl; std::cout << "\t maxIterations " << params.maxIterations_ << std::endl; std::cout << "\t minC" << std::endl; std::cout << "\t\t real " << params.minC_.real() << std::endl; std::cout << "\t\t imag " << params.minC_.imag() << std::endl; std::cout << "\t maxC" << std::endl; std::cout << "\t\t real " << params.maxC_.real() << std::endl; std::cout << "\t\t imag " << params.maxC_.imag() << std::endl; std::cout << "\t minColor" << std::endl; std::cout << "\t\t red " << (uint)params.minColor_.r_ << std::endl; std::cout << "\t\t green " << (uint)params.minColor_.g_ << std::endl; std::cout << "\t\t blue " << (uint)params.minColor_.b_ << std::endl; std::cout << "\t maxColor" << std::endl; std::cout << "\t\t red " << (uint)params.maxColor_.r_ << std::endl; std::cout << "\t\t green " << (uint)params.maxColor_.g_ << std::endl; std::cout << "\t\t blue " << (uint)params.maxColor_.b_ << std::endl; std::cout << "\t fileName " << params.outputFile_ << std::endl; } void Dump(const JuliaParams &params) { std::cout << "JuliaParams" << std::endl; std::cout << "\t width " << params.width_ << std::endl; std::cout << "\t height " << params.height_ << std::endl; std::cout << "\t maxIterations " << params.maxIterations_ << std::endl; std::cout << "\t minZ" << std::endl; std::cout << "\t\t real " << params.minZ_.real() << std::endl; std::cout << "\t\t imag " << params.minZ_.imag() << std::endl; std::cout << "\t maxZ" << std::endl; std::cout << "\t\t real " << params.maxZ_.real() << std::endl; std::cout << "\t\t imag " << params.maxZ_.imag() << std::endl; std::cout << "\t c" << std::endl; std::cout << "\t\t real " << params.c_.real() << std::endl; std::cout << "\t\t imag " << params.c_.imag() << std::endl; std::cout << "\t minColor" << std::endl; std::cout << "\t\t red " << (uint)params.minColor_.r_ << std::endl; std::cout << "\t\t green " << (uint)params.minColor_.g_ << std::endl; std::cout << "\t\t blue " << (uint)params.minColor_.b_ << std::endl; std::cout << "\t maxColor" << std::endl; std::cout << "\t\t red " << (uint)params.maxColor_.r_ << std::endl; std::cout << "\t\t green " << (uint)params.maxColor_.g_ << std::endl; std::cout << "\t\t blue " << (uint)params.maxColor_.b_ << std::endl; std::cout << "\t fileName " << params.outputFile_ << std::endl; } SOFIA_NS_END
[ "ludorg@ludorg.net" ]
ludorg@ludorg.net
3e865868446f6b4487f06c36c3ad49b32b927b5f
b7e97047616d9343be5b9bbe03fc0d79ba5a6143
/src/protocols/frag_picker/scores/DihedralConstraintsScore.cc
4144b65b243ab1426cb1a70fe7223affae2c0fbc
[]
no_license
achitturi/ROSETTA-main-source
2772623a78e33e7883a453f051d53ea6cc53ffa5
fe11c7e7cb68644f404f4c0629b64da4bb73b8f9
refs/heads/master
2021-05-09T15:04:34.006421
2018-01-26T17:10:33
2018-01-26T17:10:33
119,081,547
1
3
null
null
null
null
UTF-8
C++
false
false
9,648
cc
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*- // vi: set ts=2 noet: // // (c) Copyright Rosetta Commons Member Institutions. // (c) This file is part of the Rosetta software suite and is made available under license. // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons. // (c) For more information, see http://www.rosettacommons.org. Questions about this can be // (c) addressed to University of Washington CoMotion, email: license@uw.edu. /// @file protocols/frag_picker/scores/DihedralConstraintsScore.cc /// @brief Calculates a score based on how close are dihdral angles in a Vall chunk to their target values /// @author Dominik Gront (dgront@chem.uw.edu.pl) #include <protocols/frag_picker/scores/DihedralConstraintsScore.hh> #include <protocols/frag_picker/scores/FourAtomsConstraintData.hh> // package headers #include <protocols/frag_picker/FragmentCandidate.hh> #include <protocols/frag_picker/scores/CachingScoringMethod.hh> #include <protocols/frag_picker/scores/FragmentScoreMap.hh> #include <protocols/frag_picker/FragmentPicker.hh> // mini headers #include <core/scoring/func/Func.hh> #include <core/scoring/func/FuncFactory.hh> #include <core/scoring/func/PeriodicFunc.hh> #include <basic/Tracer.hh> #include <utility/vector1.hh> #include <numeric/xyzVector.hh> #include <numeric/xyz.functions.hh> #include <utility/io/izstream.hh> // option key includes #include <basic/options/option.hh> #include <basic/options/keys/OptionKeys.hh> #include <basic/options/keys/constraints.OptionKeys.gen.hh> #include <basic/prof.hh> namespace protocols { namespace frag_picker { namespace scores { static THREAD_LOCAL basic::Tracer trDihedralConstraintsScore( "fragment.picking.scores.DihedralConstraintsScore"); DihedralConstraintsScore::DihedralConstraintsScore(core::Size priority, core::Real lowest_acceptable_value, bool use_lowest, std::string constraints_file_name, core::Size query_size, utility::vector1<std::string> constrainable_atoms) : AtomBasedConstraintsScore(priority, lowest_acceptable_value, use_lowest, query_size, constrainable_atoms, "DihedralConstraintsScore") { using core::scoring::func::FuncOP; factory_.add_type("PERIODIC", FuncOP( new core::scoring::func::PeriodicFunc( 0, 0, 0, 0) )); data_.resize(get_query_size()); read_constraints(constraints_file_name); } DihedralConstraintsScore::DihedralConstraintsScore(core::Size priority, core::Real lowest_acceptable_value, bool use_lowest, std::string constraints_file_name, core::Size query_size) : AtomBasedConstraintsScore(priority, lowest_acceptable_value, use_lowest, query_size, "DihedralConstraintsScore") { using core::scoring::func::FuncOP; factory_.add_type("PERIODIC", FuncOP( new core::scoring::func::PeriodicFunc( 0, 0, 0, 0) )); data_.resize(get_query_size()); read_constraints(constraints_file_name); } bool DihedralConstraintsScore::cached_score(FragmentCandidateOP fragment, FragmentScoreMapOP scores) { PROF_START( basic::FRAGMENTPICKING_DIHEDRALCONSTR_SCORE ); core::Size frag_len = fragment->get_length(); core::Size vi = fragment->get_first_index_in_vall(); core::Size qi = fragment->get_first_index_in_query(); core::Real total_score = 0; for ( core::Size i = 0; i < frag_len; ++i ) { for ( core::Size c = 1; c <= data_[i + qi].size(); ++c ) { core::Size firstQueryResidueIndex = qi + i; core::Size firstVallResidueIndex = vi + i; FourAtomsConstraintDataOP r = data_[firstQueryResidueIndex][c]; if ( r->get_second_offset() >= frag_len - i ) { continue; } if ( r->get_third_offset() >= frag_len - i ) { continue; } if ( r->get_fourth_offset() >= frag_len - i ) { continue; } core::Size secondVallResidueIndex = firstVallResidueIndex + r->get_second_offset(); core::Size thirdVallResidueIndex = firstVallResidueIndex + r->get_third_offset(); core::Size fourthVallResidueIndex = firstVallResidueIndex + r->get_fourth_offset(); if ( !has_atom(firstVallResidueIndex, r->get_first_atom()) ) { continue; } if ( !has_atom(secondVallResidueIndex, r->get_second_atom()) ) { continue; } if ( !has_atom(thirdVallResidueIndex, r->get_third_atom()) ) { continue; } if ( !has_atom(fourthVallResidueIndex, r->get_fourth_atom()) ) { continue; } numeric::xyzVector<core::Real> v1 = get_atom_coordinates( firstVallResidueIndex, r->get_first_atom()); numeric::xyzVector<core::Real> v2 = get_atom_coordinates( secondVallResidueIndex, r->get_second_atom()); numeric::xyzVector<core::Real> v3 = get_atom_coordinates( thirdVallResidueIndex, r->get_third_atom()); numeric::xyzVector<core::Real> v4 = get_atom_coordinates( fourthVallResidueIndex, r->get_fourth_atom()); double torsion = dihedral_degrees(v1, v2, v3, v4); total_score += r->get_function()->func(torsion); } } total_score /= (core::Real) frag_len; scores->set_score_component(total_score, id_); PROF_STOP( basic::FRAGMENTPICKING_DIHEDRALCONSTR_SCORE ); if ( (total_score > lowest_acceptable_value_) && (use_lowest_ == true) ) { trDihedralConstraintsScore.Debug << "Trashing a fragment: " << *fragment << " because its score is: " << total_score << std::endl; return false; } return true; } void DihedralConstraintsScore::read_constraints( std::string constraints_file_name) { utility::io::izstream data(constraints_file_name.c_str()); trDihedralConstraintsScore.Info << "read constraints from " << constraints_file_name << std::endl; if ( !data ) { utility_exit_with_message("[ERROR] Unable to open constraints file: " + constraints_file_name); } std::string line; getline(data, line); // header line std::string tag; core::Size n_constr = 0; while ( !data.fail() ) { char c = data.peek(); if ( c == '#' || c == '\n' ) { getline(data, line); //comment continue; } data >> tag; if ( data.fail() ) { trDihedralConstraintsScore.Debug << constraints_file_name << " end of file reached" << std::endl; break; } if ( tag == "Dihedral" ) { core::Size res1, res2, res3, res4; std::string name1, name2, name3, name4; std::string func_type; //std::string type; data >> name1 >> res1 >> name2 >> res2 >> name3 >> res3 >> name4 >> res4 >> func_type; trDihedralConstraintsScore.Debug << "read: " << name1 << " " << name2 << " " << name3 << " " << name4 << " " << res1 << " " << res2 << " " << res3 << " " << res4 << " func: " << func_type << std::endl; core::scoring::func::FuncOP func = factory_.new_func( func_type); func->read_data(data); std::map<std::string, core::Size> constr_atoms = get_constrainable_atoms_map(); std::map<std::string, core::Size>::iterator it = constr_atoms.find(name1); if ( it == constr_atoms.end() ) { trDihedralConstraintsScore.Warning << "Unknown atom: " << name1 << "\nThe following constraint will NOT be used:\n" << line << std::endl; continue; } core::Size a1 = it->second; it = constr_atoms.find(name2); if ( it == constr_atoms.end() ) { trDihedralConstraintsScore.Warning << "Unknown atom: " << name2 << "\nThe following constraint will NOT be used:\n" << line << std::endl; continue; } core::Size a2 = it->second; it = constr_atoms.find(name3); if ( it == constr_atoms.end() ) { trDihedralConstraintsScore.Warning << "Unknown atom: " << name3 << "\nThe following constraint will NOT be used:\n" << line << std::endl; continue; } core::Size a3 = it->second; it = constr_atoms.find(name4); if ( it == constr_atoms.end() ) { trDihedralConstraintsScore.Warning << "Unknown atom: " << name4 << "\nThe following constraint will NOT be used:\n" << line << std::endl; continue; } core::Size a4 = it->second; core::Size o2 = res2 - res1; core::Size o3 = res3 - res1; core::Size o4 = res4 - res1; if ( (res2 < res1) || (res3 < res1) || (res4 < res1) ) { trDihedralConstraintsScore.Warning << "The residue of the first constrained atoms must precede all the other three.\n\t\t" << "Check residue indexes && redefine the constraint if necessary.\n\t\t" << "The following constraint will NOT be used:\n" << line << std::endl; continue; } FourAtomsConstraintDataOP dat; dat = FourAtomsConstraintDataOP( new FourAtomsConstraintData(func, a1, o2, a2, o3, a3, o4, a4) ); if ( res1 > data_.size() ) { trDihedralConstraintsScore.Warning << "Skipping a constraint that involves residue " << res1 << " that does not exist in a query" << std::endl; continue; } data_[res1].push_back(dat); n_constr++; } } trDihedralConstraintsScore << n_constr << " constraints loaded from a file" << std::endl; } FragmentScoringMethodOP MakeDihedralConstraintsScore::make(core::Size priority, core::Real lowest_acceptable_value, bool use_lowest, FragmentPickerOP picker, std::string) { using namespace basic::options; using namespace basic::options::OptionKeys; if ( option[constraints::cst_file].user() ) { trDihedralConstraintsScore << "Constraints loaded from: " << option[constraints::cst_file]()[1] << std::endl; return (FragmentScoringMethodOP) FragmentScoringMethodOP( new DihedralConstraintsScore(priority, lowest_acceptable_value, use_lowest, option[constraints::cst_file]()[1], picker->size_of_query()) ); } utility_exit_with_message( "Can't read a constraints file. Provide it with constraints::cst_file flag"); return NULL; } } } // frag_picker } // protocols
[ "achitturi17059@gmail.com" ]
achitturi17059@gmail.com
e149e8937a68ff82b2523b58a6ffb1c3ca84f363
96b728a53d54c5a08a2a3cf5cf9aa6ab331f89c6
/CRSrvBase/inc/CREventDepot.h
1046013df62924f16b27d55b932faa28eabf77c8
[]
no_license
rwang82/HMNWC
b42a782a96916afb53a8ec4f86fc4202c84ca338
20738378cbbb3706ebaa005f94e7b8633031ed09
refs/heads/master
2021-01-16T19:31:06.817775
2015-03-30T08:32:56
2015-03-30T08:32:56
27,456,968
3
0
null
null
null
null
UTF-8
C++
false
false
2,495
h
#ifndef __CREVENTDEPOT_H__ #define __CREVENTDEPOT_H__ #include "hmcmn_event_ex.h" #include "HMTSHelper.h" #include "hm_cmn_envcfg.h" #include <map> #include <functional> class CRSRV_API CREventDepot { public: typedef std::function< void() > arg0event_handler_type; typedef hmcmn::hmcmn_event_arg0_ex< void > arg0event_obj_type; typedef std::map< unsigned int, arg0event_obj_type* > arg0evtid2obj_map_type; typedef std::function< void( void*, void* ) > arg2event_handler_type; typedef hmcmn::hmcmn_event_arg2_ex< void, void*, void* > arg2event_obj_type; typedef std::map< unsigned int, arg2event_obj_type* > arg2evtid2obj_map_type; typedef std::function< void( void*, void*, void*, void* ) > arg4event_handler_type; typedef hmcmn::hmcmn_event_arg4_ex< void, void*, void*, void*, void* > arg4event_obj_type; typedef std::map< unsigned int, arg4event_obj_type* > arg4evtid2obj_map_type; public: CREventDepot(); ~CREventDepot(); public: // arg0 bool bind( unsigned int uEventId, arg0event_handler_type* pEventHandler ); void unbind( unsigned int uEventId, const arg0event_handler_type* pEventHandler ); void fire( unsigned int uEventId ); // arg2 bool bind( unsigned int uEventId, arg2event_handler_type* pEventHandler ); void unbind( unsigned int uEventId, const arg2event_handler_type* pEventHandler ); void fire( unsigned int uEventId, void* pEventParam1, void* pEventParam2 ); // arg4 bool bind( unsigned int uEventId, arg4event_handler_type* pEventHandler ); void unbind( unsigned int uEventId, const arg4event_handler_type* pEventHandler ); void fire( unsigned int uEventId, void* pEventParam1, void* pEventParam2, void* pEventParam3, void* pEventParam4 ); private: void _init(); void _unInit(); void _deleteAllEventObj(); // arg0event_obj_type* _findArg0EventObj( unsigned int uEventId ) const; arg0event_obj_type* _createArg0EventObj( unsigned int uEventId ); void _deleteAllArg0EventObj(); // arg2event_obj_type* _findArg2EventObj( unsigned int uEventId ) const; arg2event_obj_type* _createArg2EventObj( unsigned int uEventId ); void _deleteAllArg2EventObj(); // arg4event_obj_type* _findArg4EventObj( unsigned int uEventId ) const; arg4event_obj_type* _createArg4EventObj( unsigned int uEventId ); void _deleteAllArg4EventObj(); private: HMTSHelper* m_pTSObj; arg0evtid2obj_map_type* m_pMapArg0EvtId2Obj; arg2evtid2obj_map_type* m_pMapArg2EvtId2Obj; arg4evtid2obj_map_type* m_pMapArg4EvtId2Obj; }; #endif // !__CREVENTDEPOT_H__
[ "rwang82@gmail.com" ]
rwang82@gmail.com
ccd54e78aac56632c2d1789897353aedba8e4118
a520c1e7fa4862862a44f3f27fd04ed609391664
/FaceDetection_ver1.0/Lib/KSClass/Include/KScSequenceBlock_2.h
5b871e3b85637798f3591daebb8444e6e3be471d
[]
no_license
mmhasan023/Face-Recognition
2e51b58df78a2fdd1fdef76fecedaec15594645f
8189331d1bad0e9cd29e5d02e39cb59a63ddd8a2
refs/heads/master
2020-03-19T09:14:37.656734
2018-06-06T04:27:14
2018-06-06T04:27:14
136,271,498
0
0
null
null
null
null
UTF-8
C++
false
false
1,077
h
#ifndef __KSC_SEQUENCE_BLOCK_H__ #define __KSC_SEQUENCE_BLOCK_H__ #include "KScObject.h" class KS_CLASS KScSequenceBlock : public KScObject { // attribute public: unsigned long start, current; // start, current index in current stream unsigned long length; // stream length void *stream; // real stream or frame buffer // methods public: KScSequenceBlock(void); KScSequenceBlock(char *name); virtual ~KScSequenceBlock(void); KScSequenceBlock& operator=(KScSequenceBlock& source); // Get/Set start/current/end unsigned long GetStart(void); void SetStart(unsigned long index); unsigned long GetCurrent(void); void SetCurrent(unsigned long index); unsigned long GetLength(void); void SetLength(unsigned long index); // Get/Set the point of Stream void *GetStream(void); void SetStream(void *pStream); /* // File virtual /*BOOL* / Open(FILE *fp); virtual void Close(void); virtual /*BOOL* / Save(FILE *fp); virtual /*BOOL* / Save(FILE *fp, unsigned long strat, unsigned long end); */ }; #endif
[ "36214486+mmhasan023@users.noreply.github.com" ]
36214486+mmhasan023@users.noreply.github.com
9cd85b1aff8f1fb74e69296bb0bae0574732721f
c66a91d5e9724e446f868fe5993d9d650af74675
/src/Devices/CPU/CPUKernelAgent.hh
f98670a9fd145e82cb6946c8c8b2f46e44ab1ad7
[ "MIT" ]
permissive
HSAFoundation/phsa-runtime
4b6beda274bda8ca912dcfeab0712a00033c9500
b37cd9bd8085632e89b02861da193bbd0fa25c5b
refs/heads/master
2020-04-11T06:27:33.366428
2018-09-25T15:07:32
2018-09-25T15:07:32
40,970,752
8
4
MIT
2018-02-12T06:34:01
2015-08-18T12:31:14
C
UTF-8
C++
false
false
5,257
hh
/* Copyright (c) 2016-2018 General Processor Tech. 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. */ /** * @author tomi.aijo@parmance.com and pekka.jaaskelainen@parmance.com * for General Processor Tech. */ #ifndef HSA_RUNTIME_CPUAGENT_HH #define HSA_RUNTIME_CPUAGENT_HH #include <atomic> #include <cassert> #include <thread> #include <cfenv> #include "Agent.hh" #include "Queue.hh" namespace phsa { class CPUKernelAgent : public KernelDispatchAgent { public: CPUKernelAgent(MemoryRegion &QueueMemRegion); ~CPUKernelAgent(); virtual Queue *createQueue(uint32_t Size, hsa_queue_type_t Type, Queue::QueueCallback CB) override; virtual std::string getName() const override { return "phsa generic CPU agent"; } virtual std::string getVendor() const override { return "UNKNOWN"; } virtual hsa_default_float_rounding_mode_t getFloatRoundingMode() const override { switch (fegetround()) { case FE_TONEAREST: { return HSA_DEFAULT_FLOAT_ROUNDING_MODE_NEAR; } case FE_TOWARDZERO: { return HSA_DEFAULT_FLOAT_ROUNDING_MODE_ZERO; } case FE_UPWARD: case FE_DOWNWARD: default: { break; } } assert(false && "Unsupported float rounding mode"); } virtual hsa_profile_t getProfile() const override { return HSA_PROFILE_BASE; } virtual uint32_t getQueuesMax() const override { return 1024; } virtual uint32_t getQueueMinSize() const override { return 1; } virtual uint32_t getQueueMaxSize() const override { return 16; } virtual bool IsSupportedQueueType(hsa_queue_type_t t) const { return true; } virtual hsa_queue_type_t getQueueType() const override { return HSA_QUEUE_TYPE_MULTI; } virtual uint32_t getNUMAId() const override { // TODO: probe using libhwloc or similar. return 0; } virtual hsa_device_type_t getDeviceType() const override { return HSA_DEVICE_TYPE_CPU; } virtual std::array<uint32_t, 4> getCacheSize() const override { // TODO: probe using libhwloc or similar. return {16 * 1024, 0, 0, 0}; } virtual const std::string getISA() const override { return AgentISA; } virtual Version getVersion() const override { return {1, 0}; } virtual bool hasFastF16Operation() const override { // TODO: validate if this is true return false; } virtual uint32_t getWavefrontSize() const override { return 1; } virtual std::array<uint16_t, 3> getWorkGroupMaxDim() const override { // hcc assumes at least 512 local size can be used. Otherwise // we would use the minimum maximum of 256 here to hint small // local sizes (with possibly many work-groups) are preferable // for CPU/DSP Agents. return {std::numeric_limits<uint16_t>::max(), std::numeric_limits<uint16_t>::max(), std::numeric_limits<uint16_t>::max()}; } virtual uint32_t getWorkGroupMaxSize() const override { return std::numeric_limits<uint32_t>::max() / 4; } virtual hsa_dim3_t getGridMaxDim() const override { return {std::numeric_limits<uint32_t>::max(), std::numeric_limits<uint32_t>::max(), std::numeric_limits<uint32_t>::max()}; } virtual uint32_t getGridMaxSize() const override { return std::numeric_limits<uint32_t>::max(); } virtual uint32_t getFBarrierMaxSize() const override { return 32; } virtual void terminateQueue(Queue *Q) override; virtual void shutDown() override; private: // GCCBrig only uses the two of the first arguments. The third // one is a shortcut for kernels finalized elsewhere and that // prefer a simpler access to the argument buffer address. using GCCBrigKernelSignature = void(void *, void *, void *); using GCCBrigKernel = std::function<GCCBrigKernelSignature>; bool AreDimensionsvalid(hsa_kernel_dispatch_packet_t &KernelPacket); bool IsPacketTypeValid(uint16_t Header); void Execute(); std::thread Worker; MemoryRegion &QueueRegion; std::string AgentISA; // The currently executed queue. std::atomic<Queue *> RunningQueue; // Set to true in case the agent is being interrupted by the client program. std::atomic<bool> InterruptingTheQueue; }; } // namespace phsa #endif // HSA_RUNTIME_CPUAGENT_HH
[ "pekka.jaaskelainen@parmance.com" ]
pekka.jaaskelainen@parmance.com
d8352ec2f6f580d4ab299ea6d7727c0e6b44b691
df41a278559b5028c14586a6c8fa2561ff5a6626
/src/stitcher/stitcher.cpp
6bb0acb69dade5a5fd10eff6f8d6403db7f81147
[ "MIT" ]
permissive
Foued70/torchlab
af672e5067dd2905fa7689d5a2dc3ad2fd0f3852
d438b8ed2187d734aba625ec6a849f21f6debf87
refs/heads/master
2021-01-20T03:04:25.424616
2015-09-21T13:57:44
2015-09-21T13:57:44
null
0
0
null
null
null
null
UTF-8
C++
false
false
146
cpp
#include <iostream> #include "opencv2/core/core.hpp" #include "opencv2/core/mat.hpp" using namespace cv; using namespace std; extern "C" { }
[ "sonia@floored.com" ]
sonia@floored.com
21d103f73ce31ff76c91aaf3b9acbdc268591ec1
6c2335c7d54817eaa2e028bbac6c9e13fa21b908
/PluginProcessor.cpp
7b1de2cb37332e2aa1241133801868552d845bf9
[]
no_license
skilzer00/EECS-4462-Digital-Audio
fc39f988c2ae886c6d4c59b17efe47afa2387918
89b00354be75059c13cc2ba70743daf8414b76de
refs/heads/main
2022-12-30T13:54:02.460321
2020-10-20T17:29:29
2020-10-20T17:29:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
9,719
cpp
/* ============================================================================== This file contains the basic framework code for a JUCE plugin processor. ============================================================================== */ #include "PluginProcessor.h" #include "PluginEditor.h" //============================================================================== A1StarterAudioProcessor::A1StarterAudioProcessor() #ifndef JucePlugin_PreferredChannelConfigurations : AudioProcessor(BusesProperties() #if ! JucePlugin_IsMidiEffect #if ! JucePlugin_IsSynth .withInput("Input", juce::AudioChannelSet::stereo(), true) #endif .withOutput("Output", juce::AudioChannelSet::stereo(), true) #endif ) #endif { } A1StarterAudioProcessor::~A1StarterAudioProcessor() { } //============================================================================== const juce::String A1StarterAudioProcessor::getName() const { return JucePlugin_Name; } bool A1StarterAudioProcessor::acceptsMidi() const { #if JucePlugin_WantsMidiInput return true; #else return false; #endif } bool A1StarterAudioProcessor::producesMidi() const { #if JucePlugin_ProducesMidiOutput return true; #else return false; #endif } bool A1StarterAudioProcessor::isMidiEffect() const { #if JucePlugin_IsMidiEffect return true; #else return false; #endif } double A1StarterAudioProcessor::getTailLengthSeconds() const { return 0.0; } int A1StarterAudioProcessor::getNumPrograms() { return 1; // NB: some hosts don't cope very well if you tell them there are 0 programs, // so this should be at least 1, even if you're not really implementing programs. } int A1StarterAudioProcessor::getCurrentProgram() { return 0; } void A1StarterAudioProcessor::setCurrentProgram(int index) { } const juce::String A1StarterAudioProcessor::getProgramName(int index) { return {}; } void A1StarterAudioProcessor::changeProgramName(int index, const juce::String& newName) { } //============================================================================== void A1StarterAudioProcessor::prepareToPlay(double sampleRate, int samplesPerBlock) { notes.clear(); // [1] currentNote = 0; // [2] lastNoteValue = -1; // [3] time = 0; // [4] rate = static_cast<float> (sampleRate); // [5] arpSpeed = 0.5; std::cout << arpSpeed; } void A1StarterAudioProcessor::releaseResources() { // When playback stops, you can use this as an opportunity to free up any // spare memory, etc. } #ifndef JucePlugin_PreferredChannelConfigurations bool A1StarterAudioProcessor::isBusesLayoutSupported(const BusesLayout& layouts) const { #if JucePlugin_IsMidiEffect juce::ignoreUnused(layouts); return true; #else // This is the place where you check if the layout is supported. // In this template code we only support mono or stereo. if (layouts.getMainOutputChannelSet() != juce::AudioChannelSet::mono() && layouts.getMainOutputChannelSet() != juce::AudioChannelSet::stereo()) return false; // This checks if the input layout matches the output layout #if ! JucePlugin_IsSynth if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet()) return false; #endif return true; #endif } #endif void A1StarterAudioProcessor::processBlock(juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midi) { // We use the audio buffer to get timing information auto numSamples = buffer.getNumSamples(); // [7] // get note duration auto noteDuration = static_cast<int> (std::ceil(rate * 0.25f * (0.1f + (1.0f - (arpSpeed))))); // [8] for (const auto metadata : midi) // [9] { const auto msg = metadata.getMessage(); for (int i = 0; i <= octave; i++) { if (mode == 2) { if (msg.isNoteOn()) { notes.add(msg.getNoteNumber() + (i * -12)); } else if (msg.isNoteOff()) { notes.removeValue(msg.getNoteNumber() + (i * -12)); } } else { if (msg.isNoteOn()) { notes.add(msg.getNoteNumber() + (i * 12)); } else if (msg.isNoteOff()) { notes.removeValue(msg.getNoteNumber() + (i * 12)); } } } } midi.clear(); // [10] if (lastNoteValue == notes.getLast()) { noteDuration = noteDuration * duration; } if ((time + numSamples) >= noteDuration) // [11] { auto offset = juce::jmax(0, juce::jmin((int)(noteDuration - time), numSamples - 1)); // [12] if (lastNoteValue > 0) // [13] { midi.addEvent(juce::MidiMessage::noteOff(1, lastNoteValue), offset); lastNoteValue = -1; } if (notes.size() > 0) // [14] { if (mode == 1) { /* Ascending Order*/ currentNote = (currentNote + 1) % notes.size(); lastNoteValue = notes[currentNote]; midi.addEvent(juce::MidiMessage::noteOn(1, lastNoteValue, (juce::uint8) 127), offset); } else if (mode == 2) { /*Descending Order*/ currentNote = (currentNote - 1) % notes.size(); if (currentNote < 0) { currentNote = notes.size() - 1; } lastNoteValue = notes[currentNote]; midi.addEvent(juce::MidiMessage::noteOn(1, lastNoteValue, (juce::uint8) 127), offset); } else if (mode == 3) { firstNote = notes.getFirst(); if (repeat == true) { lastNoteValue = firstNote; midi.addEvent(juce::MidiMessage::noteOn(1, lastNoteValue, (juce::uint8) 127), offset); repeat = false; } else { currentNote = (currentNote + 1) % notes.size(); if (currentNote == 0) { currentNote = 1; } lastNoteValue = notes[currentNote]; midi.addEvent(juce::MidiMessage::noteOn(1, lastNoteValue, (juce::uint8) 127), offset); repeat = true; } } else if (mode == 4) { currentNote = (currentNote + 1) % notes.size(); notebeforelast = notes.size()-2; if (notes[currentNote] == notes[firstNote]) { lastNoteValue = notes[notebeforelast]; midi.addEvent(juce::MidiMessage::noteOn(1, lastNoteValue, (juce::uint8) 127), offset); } else if (notes[currentNote] == notes[notebeforelast]) { lastNoteValue = notes[firstNote]; midi.addEvent(juce::MidiMessage::noteOn(1, lastNoteValue, (juce::uint8) 127), offset); } else { lastNoteValue = notes[currentNote]; midi.addEvent(juce::MidiMessage::noteOn(1, lastNoteValue, (juce::uint8) 127), offset); } } } } time = (time + numSamples) % noteDuration; // [15] } //============================================================================== bool A1StarterAudioProcessor::hasEditor() const { return true; // (change this to false if you choose to not supply an editor) } juce::AudioProcessorEditor* A1StarterAudioProcessor::createEditor() { return new A1StarterAudioProcessorEditor(*this); } //============================================================================== void A1StarterAudioProcessor::getStateInformation(juce::MemoryBlock& destData) { // You should use this method to store your parameters in the memory block. // You could do that either as raw data, or use the XML or ValueTree classes // as intermediaries to make it easy to save and load complex data. } void A1StarterAudioProcessor::setStateInformation(const void* data, int sizeInBytes) { // You should use this method to restore your parameters from this memory block, // whose contents will have been created by the getStateInformation() call. } //============================================================================== // This creates new instances of the plugin.. juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter() { return new A1StarterAudioProcessor(); }
[ "noreply@github.com" ]
noreply@github.com
5ba06c7ea71d7b9d71465d069d57927a06b3fb19
7fdb5ebbb296c82db3895310774495ba4f8f2f15
/DSA codes/Linked List/Nth-node-from-end.cpp
78c0ff7a2755dd5a2b9cca7e1d1b9535bb1de1cc
[]
no_license
mukherjeetejas/My-CodeForces
3f97eaa5f6cceb05858b4e39a3e7c5bcfa2bc72c
0571f8f2ba2ac92b846a85c187c12226e7b90ee4
refs/heads/master
2023-07-13T03:50:44.939980
2021-08-18T16:16:52
2021-08-18T16:16:52
302,736,882
0
0
null
null
null
null
UTF-8
C++
false
false
1,037
cpp
//Author Tejas Mukherjee //Nth element from last in a linked list in O(n) //Using two pointers separated by N nodes #include <iostream> using namespace std; struct Node { int data; Node *next; Node(int x) { data = x; next = NULL; } }; void printlist(Node *head) { if (head == NULL) { cout << '\n'; return; } else { cout << head->data << '\t'; printlist(head->next); } } int displayNLast(Node *head, int n) { Node *slow = head; Node *fast = head; for (int i = 0; i < n; i++) { fast = fast->next; } while (fast != NULL) { fast = fast->next; slow = slow->next; } return slow->data; } int main() { Node *head = new Node(0); head->next = new Node(2); head->next->next = new Node(5); head->next->next->next = new Node(10); printlist(head); int n; cout << "Enter value of N : "; cin >> n; cout << displayNLast(head, n) << '\n'; printlist(head); }
[ "mukherjeetejas21@gmail.com" ]
mukherjeetejas21@gmail.com
25951281efbc50c0f697f7fc3d995f0892988b67
026f6ae8c71a6dd41d6731f0981a03bb8ec09f03
/src/device/ds2408.cc
d490d9785f83ac9ebfb31e6b8bbf8ba58cb5e126
[ "MIT" ]
permissive
jjoschyy/W1Direct
5798cfa799f18e9abcb061d51b482e9634af29d4
085c4f89abde2efc91946651ef5585b8806e3456
refs/heads/master
2016-09-10T20:32:26.824970
2015-02-10T18:36:13
2015-02-10T18:36:13
30,491,110
3
2
null
2016-02-11T10:31:36
2015-02-08T13:00:36
C++
UTF-8
C++
false
false
4,103
cc
#include "ds2408.h" #include "../master/bus/bus.h" #include "../shared/v8_helper.h" #include "../shared/util.h" #include "../shared/match.h" #include "lib/usleep.h" #include <stdint.h> #include <string> #include <bitset> #include <cstring> #include <cstdlib> //COMMANDS #define CMD_PIO_READ 0xF0 #define CMD_CONDITIONAL_SREG_WRTIE 0xCC #define CMD_CHANNEL_ACCESS_WRITE 0x5A #define CMD_RESET_ACTIVITY_LATCHES 0xC3 //CACHE INDEXES #define PPC_WRITE_MLTB_SUCCEED 0 //RSTZ pin #define RSTZ_KEY "rstzPinMode" #define RSTZ_VAL_STRB "strobeOutput" #define RSTZ_VAL_RESET "resetInput" #define RSTZ_DBIT 2 //PIO #define PIO_INPUT_KEY "pioInput" #define PIO_ACTIVITY_KEY "pioActivity" #define PIO_OUTPUT_KEY "pioOutput" #define PIO_OUTPUT_PORT_KEY "pioOutputPort" //POWER SUPPLY #define POWER_SUPPLY_KEY "powerSupply" #define POWER_SUPPLY_DBIT 7 //DATA-BYTES #define DIX_PIO_INPUT 3 #define DIX_PIO_OUTPUT 4 #define DIX_PIO_ACTIVITY 5 #define DIX_STATUS_REG 8 #define DIX_CRC16_BYTE1 11 #define DIX_CRC16_BYTE2 12 using namespace v8; Ds2408::Ds2408(Bus* bus, uint64_t intDeviceId, std::string* strDeviceId) : Device(bus, intDeviceId, strDeviceId){ REGISTER_UPDATER(Ds2408::UpdateRstzPinMode, RSTZ_KEY, RSTZ_VAL_STRB "|" RSTZ_VAL_RESET); REGISTER_UPDATER(Ds2408::UpdatePioOutput, PIO_OUTPUT_KEY, MP_HEX_BYTE); REGISTER_UPDATER(Ds2408::UpdatePioOutputPort, PIO_OUTPUT_PORT_KEY, MP_PORT_VALUE); REGISTER_UPDATER(Ds2408::UpdatePioActivity, PIO_ACTIVITY_KEY, "0x00"); RegisterOverdriveUpdater(); } void Ds2408::ReadAllData(void){ Command(CMD_PIO_READ); //address (16bit) WriteByte(0x88); WriteByte(0x00); //needed for verify crc16 data[0] = CMD_PIO_READ; data[1] = 0x88; data[2] = 0x00; //read 8 PIO bytes + 2 CRC bytes ReadBytes(3, 10); //crc bytes are inverted data[DIX_CRC16_BYTE1] = ~data[DIX_CRC16_BYTE1]; data[DIX_CRC16_BYTE2] = ~data[DIX_CRC16_BYTE2]; } bool Ds2408::VerifyAllData(void){ return Crc16DataValidate(11, DIX_CRC16_BYTE1, DIX_CRC16_BYTE2); } void Ds2408::BuildValueData(Handle<Object> target){ BuildValue(target, PIO_INPUT_KEY, DIX_PIO_INPUT); BuildValue(target, PIO_OUTPUT_KEY, DIX_PIO_OUTPUT); BuildValue(target, PIO_ACTIVITY_KEY, DIX_PIO_ACTIVITY); } void Ds2408::BuildPropertyData(Handle<Object> target){ uint8_t srg = data[DIX_STATUS_REG]; V8Helper::AddPairToV8Object(target, RSTZ_KEY, Util::BitIsSet(srg, RSTZ_DBIT) ? RSTZ_VAL_STRB : RSTZ_VAL_RESET); V8Helper::AddPairToV8Object(target, POWER_SUPPLY_KEY, Util::BitIsSet(srg, POWER_SUPPLY_DBIT)); } bool Ds2408::UpdateRstzPinMode(const char* mode){ uint8_t byte = strcmp(mode, RSTZ_VAL_STRB) == 0 ? 0x04 : 0x00; Command(CMD_CONDITIONAL_SREG_WRTIE); WriteByte(0x8D); //16 bit address part 1 WriteByte(0x00); //16 bit address part 2 WriteByte(byte); //Validate by read written Command(CMD_PIO_READ); WriteByte(0x8D); WriteByte(0x00); return ReadByte() == (byte + 0x80); } bool Ds2408::UpdatePioOutput(const char* hexStr){ uint8_t byte = (uint8_t) strtol(hexStr+2, NULL, 16); return PiooWriteByte(byte); } bool Ds2408::UpdatePioOutputPort(const char* portStr){ bool success = false; uint8_t port = portStr[1]-48; uint8_t value = portStr[3]-48; ReadAllData(); if (VerifyAllData()){ Util::SetBit(&data[DIX_PIO_OUTPUT], port, value == 1); success = PiooWriteByte(data[DIX_PIO_OUTPUT]); } return success; } bool Ds2408::UpdatePioActivity(const char* value){ Command(CMD_RESET_ACTIVITY_LATCHES); return ReadByte() == 0xaa; } //private bool Ds2408::PiooWriteByte(uint8_t byte){ Command(CMD_CHANNEL_ACCESS_WRITE); WriteByte(byte); WriteByte(~byte); return ReadByte() == 0xaa; } void Ds2408::BuildValue(Handle<Object> target, const char* name, int dataIdx){ Handle<Object> value = Object::New(); V8Helper::AddPairToV8Object(value, "hex", "0x%02x", data[dataIdx]); V8Helper::AddPairToV8Object(value, "decimal", data[dataIdx]); V8Helper::AddPairToV8Object(value, "binary", std::bitset<8>(data[dataIdx]).to_string().c_str()); V8Helper::AddPairToV8Object(target, name, value); }
[ "joachim.schneider.privat@gmail.com" ]
joachim.schneider.privat@gmail.com
9dd5af82dc70432124035aeef8b48c32d88c2967
b65d70155068919f2223a0c13d668eecc5f1fbc5
/include/baulk/net/types.hpp
74ccf72f9cb04bbeb1164a5ac87b67fd58080c54
[ "Apache-2.0" ]
permissive
fcharlie/BelaUtils
421bce06eedc00d042b8894ff17db5811af5b060
1154eaae7758d8320e11c4bd030593bc1da0280c
refs/heads/master
2023-08-09T11:50:56.740385
2023-07-30T14:31:32
2023-07-30T14:31:32
214,827,230
33
1
null
null
null
null
UTF-8
C++
false
false
5,565
hpp
// #ifndef BAULK_DETAILS_NET_INTERNAL_HPP #define BAULK_DETAILS_NET_INTERNAL_HPP #include <bela/base.hpp> #include <bela/match.hpp> #include <bela/ascii.hpp> #include <bela/phmap.hpp> #include <bela/path.hpp> #include <memory> namespace baulk::net { namespace net_internal { // hasher struct StringCaseInsensitiveHash { using is_transparent = void; std::size_t operator()(std::wstring_view wsv) const noexcept { /// See Wikipedia /// https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function // _WIN64 Defined as 1 when the compilation target is 64-bit ARM or x64. Otherwise, undefined. #if defined(__x86_64) || defined(_WIN64) static_assert(sizeof(size_t) == 8, "This code is for 64-bit size_t."); constexpr size_t kFNVOffsetBasis = 14695981039346656037ULL; constexpr size_t kFNVPrime = 1099511628211ULL; #else static_assert(sizeof(size_t) == 4, "This code is for 32-bit size_t."); constexpr size_t kFNVOffsetBasis = 2166136261U; constexpr size_t kFNVPrime = 16777619U; #endif size_t val = kFNVOffsetBasis; std::string_view sv = {reinterpret_cast<const char *>(wsv.data()), wsv.size() * 2}; for (auto c : sv) { val ^= static_cast<size_t>(bela::ascii_tolower(c)); val *= kFNVPrime; } return val; } }; struct StringCaseInsensitiveEq { using is_transparent = void; bool operator()(std::wstring_view wlhs, std::wstring_view wrhs) const { return bela::EqualsIgnoreCase(wlhs, wrhs); } }; constexpr int hexval_table[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 0~0f -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10~1f -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20~2f 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, // 30~3f -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 40~4f -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 50~5f -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 60~6f -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 70~7f -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 80~8f -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 90~9f -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // a0~af -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // b0~bf -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // c0~cf -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // d0~df -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // e0~ef -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 // f0~ff }; constexpr int decode_byte_couple(uint8_t a, uint8_t b) { auto a1 = hexval_table[a]; auto b1 = hexval_table[b]; if (a1 < 0 || b1 < 0) { return -1; } return ((a1 << 4) | b1); } } // namespace net_internal constexpr bool hash_decode(const char *hash_text, size_t length, uint8_t *buffer, size_t size) { auto ms = (std::min)(length / 2, size); for (size_t i = 0; i < ms; i++) { auto b = net_internal::decode_byte_couple(static_cast<uint8_t>(hash_text[i * 2]), static_cast<uint8_t>(hash_text[i * 2 + 1])); if (b < 0) { return false; } buffer[i] = static_cast<uint8_t>(b); } return true; } constexpr bool hash_decode(const wchar_t *hash_text, size_t length, uint8_t *buffer, size_t size) { auto ms = (std::min)(length / 2, size); for (size_t i = 0; i < ms; i++) { auto b = net_internal::decode_byte_couple(static_cast<uint8_t>(hash_text[i * 2]), static_cast<uint8_t>(hash_text[i * 2 + 1])); if (b < 0) { return false; } buffer[i] = static_cast<uint8_t>(b); } return true; } constexpr bool hash_decode(std::string_view hash_text, uint8_t *buffer, size_t size) { return hash_decode(hash_text.data(), hash_text.size(), buffer, size); } constexpr bool hash_decode(std::wstring_view hash_text, uint8_t *buffer, size_t size) { return hash_decode(hash_text.data(), hash_text.size(), buffer, size); } template <size_t N> bool hash_decode(std::wstring_view hash_text, uint8_t (&buffer)[N]) { return hash_decode(hash_text.data(), hash_text.size(), buffer, N); } template <typename T, typename U, size_t N> bool bytes_equal(const T (&a)[N], const U (&b)[N]) { return std::equal(a, a + N, b); } using headers_t = bela::flat_hash_map<std::wstring, std::wstring, net_internal::StringCaseInsensitiveHash, net_internal::StringCaseInsensitiveEq>; enum class protocol_version { HTTP11, HTTP2, HTTP3 }; struct minimal_response { headers_t headers; unsigned long status_code{0}; protocol_version version{protocol_version::HTTP11}; std::wstring status_text; [[nodiscard]] bool IsSuccessStatusCode() const { return status_code >= 200 && status_code <= 299; } }; std::string url_decode(std::wstring_view str); inline std::wstring url_path_name(std::wstring_view urlpath) { std::vector<std::wstring_view> pv = bela::SplitPath(urlpath); if (pv.empty()) { return L"index.html"; } return std::wstring{pv.back()}; } inline std::wstring decoded_url_path_name(std::wstring_view urlpath) { std::vector<std::wstring_view> pv = bela::SplitPath(urlpath); if (pv.empty()) { return L"index.html"; } return bela::encode_into<char, wchar_t>(url_decode(pv.back())); } } // namespace baulk::net #endif
[ "charlieio@outlook.com" ]
charlieio@outlook.com
a7ffa1a6e38c5fd8a3ca38dcd491a7387cb4505d
50524659a8b70d0a9ed67e8644dbb63c6dfd8ae2
/src/levmarq.h
85907a13f437b673efd3091ea6e7a855a83428ca
[ "MIT" ]
permissive
Sepp62/BikePowerCalc
41816bd17590a53083363f507f66f2fe46592734
57da2b60c71faf11e9c261cfb3bbe7ff1017b742
refs/heads/main
2023-04-06T03:24:50.925685
2021-04-18T13:10:22
2021-04-18T13:10:22
359,144,791
0
0
null
null
null
null
UTF-8
C++
false
false
1,970
h
/* * levmarq.c * * This file contains an implementation of the Levenberg-Marquardt algorithm * for solving least-squares problems, together with some supporting routines * for Cholesky decomposition and inversion. No attempt has been made at * optimization. In particular, memory use in the matrix routines could be * cut in half with a little effort (and some loss of clarity). * * It is assumed that the compiler supports variable-length arrays as * specified by the C99 standard. * * Ron Babich, May 2008 * * levmarq.c, levmarq.h, and examples are provided under the MIT license. Copyright (c) 2008-2016 Ron Babich Modified for C++/std::library: Bernd Wokoeck see https://stackoverflow.com/questions/16004668/c-allocating-a-matrix-in-a-function/27366086#27366086 */ #include <vector> class LevMarq { public: struct point_t { point_t() { x = 0.0; y = 0.0; } point_t( double ax, double ay ) { x = ax; y = ay; } double x; double y; }; typedef std::vector<point_t> measurePoints; // cholesky typedef std::vector< std::vector<double> > Matrix; typedef std::vector<double> Vector; protected: typedef struct { int verbose; int max_it; double init_lambda; double up_factor; double down_factor; double target_derr; int final_it; double final_err; double final_derr; } LMstat; void levmarq_init(LMstat *lmstat); int levmarq( Vector & par, const measurePoints & points, double *dysq, double (*func)(Vector&, double, void *), void (*grad)(Vector&, Vector&, double, void *), void *fdata, LMstat *lmstat); double error_func(Vector& par, const measurePoints &points, double *dysq, double (*func)(Vector&, double, void *), void *fdata); void solve_axb_cholesky(int n, Matrix& l, Vector& x, Vector & b); int cholesky_decomp(int n, Matrix& l, Matrix& a ); };
[ "33748087+Sepp62@users.noreply.github.com" ]
33748087+Sepp62@users.noreply.github.com
a05e63914a1c48907dcfd4529518b150295f3812
dbfb9d1ef753d8807c14a7d675b37de720329ccd
/ray_tracing/source_files/ray_tracing.cpp
3b67729a76b11880597e12c79eec6cba822fdcdd
[]
no_license
jakbal/PWr_student_projects
da932ebee7f8d21f0ee2ed7c7a8a0bf4d21f16b1
27da4b7adc68dece62f688b13cc205ee8defa310
refs/heads/master
2022-02-09T04:48:21.489584
2019-06-05T22:47:00
2019-06-05T22:47:00
null
0
0
null
null
null
null
WINDOWS-1250
C++
false
false
16,843
cpp
#include <stdlib.h> #include <iostream> #include <math.h> #include <stdio.h> #include <glut.h> #include <GL/gl.h> #include <fstream> #include <string> using namespace std; #pragma region zmienne typedef float punkt[3]; //głębokość rekurencji #define MAX 1000 int step = 0; //rozmiary okna int horizontal = 0; int vertical = 0; float viewport_size = 18.0; //punkt początkowy punkt starting_point; punkt starting_directions = { 0.0, 0.0, -1.0 }; //pomocnicze struktury do pracy z typem definiowanyn struct punktSphereStruct { punkt pos; int sphere; int light; int status; }; struct punktStruct { punkt pos; }; //parametry świateł float light_position[5][3]; float light_specular[5][3]; float light_diffuse[5][3]; float light_ambient[5][3]; //kolor wypełnienia tła float background_color[3]; //parametry rozproszenia globalnego float global_a[3]; //parametry sfer float sphere_radius[9]; float sphere_position[9][3]; float sphere_specular[9][3]; float sphere_diffuse[9][3]; float sphere_ambient[9][3]; float sphere_shiness[9]; //bieżący kolor piksela - struktura GLubyte przechowuje info GLubyte pixel[1][1][3]; #pragma endregion #pragma region f_pomocnicze //funkcja licząca iloczyn skalarny dwóch wektorów float dotProduct(punkt p, punkt q) { return (p[0] * q[0] + p[1] * q[1] + p[2] * q[2]); } //pomocnicza funckja licząca długość wektora float vector_length(punktStruct v) { return (v.pos[0] * v.pos[0] + v.pos[1] * v.pos[1] + v.pos[2] * v.pos[2]); } #pragma endregion #pragma region f_normalizacyjne //funkcja normalizująca podany wektor v -- dzielenie wektora przez jego długość punktStruct Normalization(punkt v) { //wktor znormalizowany //inicjacja dla bezpieczeństwa punktStruct normalized_vec; normalized_vec.pos[0] = 0.0; normalized_vec.pos[1] = 0.0; normalized_vec.pos[2] = 0.0; //algorytm wg instrukcji laboratoryjnej float d = 0.0; int i; for (i = 0; i < 3; i++) d += v[i] * v[i]; d = sqrt(d); if (d > 0.0) for (i = 0; i < 3; i++) normalized_vec.pos[i] = v[i] / (d*1.0); return normalized_vec; } //funkcja licząca wektor normalny do powierzchni w podanym punkcie - q dla obiektu o numerze sphere punktStruct Normal(punkt v, int sphere_number) { punktStruct normal_vec; for (int i = 0; i < 3; i++) { normal_vec.pos[i] = (v[i] - sphere_position[sphere_number][i]) / sphere_radius[sphere_number]; } return normal_vec; } #pragma endregion #pragma region f_glowne //funkcja licząca wektor odbicia punktStruct Reflect(punkt p, punkt q, punkt n) { punktStruct reflect_vec; //wektor odbicia punkt direct_vec; //wektor kierunkowy direct_vec[0] = p[0] - q[0]; direct_vec[1] = p[1] - q[1]; direct_vec[2] = p[2] - q[2]; //pomocnicza konwersja punktStruct temp = Normalization(direct_vec); direct_vec[0] = temp.pos[0]; direct_vec[1] = temp.pos[1]; direct_vec[2] = temp.pos[2]; //obliczenie iloczynu skalaranego w celu podstawienia wartości do wzoru float r_dot_d; r_dot_d = dotProduct(direct_vec, n); //obliczenie wektora promienia odbitego reflect_vec.pos[0] = 2 * (r_dot_d)* n[0] - direct_vec[0]; reflect_vec.pos[1] = 2 * (r_dot_d)* n[1] - direct_vec[1]; reflect_vec.pos[2] = 2 * (r_dot_d)* n[2] - direct_vec[2]; //jeżeli wektor nie jest jednostkowy, to należy fo wpierw znormalizować if (vector_length(reflect_vec) > 1.0) return Normalization(reflect_vec.pos); else return reflect_vec; } //funkcja wyznaczająca punkt przecięcia (pierwszy na drodze) //śledzonego promienia oraz obiektu (tu sfery/światła/próżni) w który promień trafia punktSphereStruct Intersect(punkt p, punkt v) { //utworzenie obiektu definującego punkt przecięcia //struktura zawiera wszytsko co jednoznacznie pozwala //taki punkt wyświetlić w oknie punktSphereStruct intersected_vec; intersected_vec.pos[0] = 0.0; intersected_vec.pos[1] = 0.0; intersected_vec.pos[2] = 0.0; intersected_vec.sphere = 0; intersected_vec.light = 0; intersected_vec.status = 0; //zmienne pomocnicze do obliczeń float x, y, z; //określenie czy promien trafił w źródło for (int i = 0; i < 5; i++) { //wyliczenie wektora kierunkowego punkt -> źródło światł x = light_position[i][0] - p[0]; y = light_position[i][1] - p[1]; z = light_position[i][2] - p[2]; //sprawdzenie wektor powyższy jest tożsamy z aktualnym kierunkiem v promienia z punktu p if ((x / v[0]) == (y / v[1]) && (y / v[1]) == (z / v[2])) { //pozycja uderzonego źródła światła intersected_vec.pos[0] = light_position[i][0]; intersected_vec.pos[1] = light_position[i][1]; intersected_vec.pos[2] = light_position[i][2]; //które dokładnie źródło intersected_vec.light = i; intersected_vec.status = 1; return intersected_vec; } } //sprawdzenie czy promień trafił w którąkolwiek ze sfer float a, b, c, delta, u;//zestaw zmiennych do obliczeń testowych for (int i = 0; i < 9; i++) { //przeprowadzane poniżej obliczenia przebiegają zgodnie ze wzorami //podanymi w instrukcji laboratoryjnej //obliczenie parametrów funkcji kwadratowej a = v[0] * v[0] + v[1] * v[1] + v[2] * v[2]; b = 2 * ((p[0] - sphere_position[i][0])*v[0] + (p[1] - sphere_position[i][1])*v[1] + (p[2] - sphere_position[i][2])*v[2]); c = (p[0] * p[0] + p[1] * p[1] + p[2] * p[2]) + (sphere_position[i][0] * sphere_position[i][0] + sphere_position[i][1] * sphere_position[i][1] + sphere_position[i][2] * sphere_position[i][2]) - 2 * (p[0] * sphere_position[i][0] + p[1] * sphere_position[i][1] + p[2] * sphere_position[i][2]) - sphere_radius[i] * sphere_radius[i]; //wyliczenie delty delta = b * b - 4 * a*c; //jeżeli delta >= 0 to istnieją rozwiązanie/rozwiązania (należy wziąć to bliższe w przypadku istnienia dwóch) if (delta >= 0) { //brane jest rozwiązanie bliższe [jak wyżej opisano] u = (-b - sqrt(delta)) / (2 * a); if (u > 0) { //wyliczenie współrzędnych punktu, gdzie padł promień intersected_vec.pos[0] = p[0] + u * v[0]; intersected_vec.pos[1] = p[1] + u * v[1]; intersected_vec.pos[2] = p[2] + u * v[2]; //z zaznaczeniem, której to sfery dotyczy intersected_vec.sphere = i; intersected_vec.status = 3; break; } } } //jeżeli wartość status nie była modyfikowana, to znaczy to, //że promień zaginął w przestrzeni tj. nie dotarł do żadnego obiektu if (intersected_vec.status == 0) { intersected_vec.status = 2; } return intersected_vec; } //używając modelu Phonga funkcja oblicza oświetlenie danego punktu //q - obliczony punkt przecięcia //n - wektor normalny do płaszczyzny w punkcie q punktStruct Phong(punkt q, punkt n, int sphere) { //wyliczony zostanie kolor punktu //inicjalizacja dla bezpieczeństwa punktStruct color; color.pos[0] = 0.0; color.pos[1] = 0.0; color.pos[2] = 0.0; //pomocnicze zmienne punkt light_vec; //wektor skierowany ze zwrotem do źródła punkt reflection_vec; //wektor promienia odbitego punkt viewer_vec; //wektor skierowany do obserwatora viewer_vec[0] = 0.0; viewer_vec[1] = 0.0; viewer_vec[2] = 1.0; //odpowiednie iloczny skalarane float n_dot_l, v_dot_r; //współczynniki określające wpływ odległości źródła światła na oświetlenie punktu float a, b, c, scale; a = 1.0; b = 0.1; c = 0.01; scale = 1 / (a + b + c); //obliczenia oświetlenia danego punktu muszą zostać przeprowadzone dla każdego źródła światła for (int i = 0; i < 5; i++) { //wyliczenie kierunku wektora z punktu przecięcia w kierunku źródła światła light_vec[0] = light_position[i][0] - q[0]; light_vec[1] = light_position[i][1] - q[1]; light_vec[2] = light_position[i][2] - q[2]; //normalizacja wylicoznego wektora punktStruct temp = Normalization(light_vec); light_vec[0] = temp.pos[0]; light_vec[1] = temp.pos[1]; light_vec[2] = temp.pos[2]; //iloczyn skalarny n_dot_l = dotProduct(light_vec, n); //wg wzorów z instrukjci laboratoryjnej //następuje wyliczenie kierunku odbicia reflection_vec[0] = 2 * (n_dot_l)*n[0] - light_vec[0]; reflection_vec[1] = 2 * (n_dot_l)*n[1] - light_vec[1]; reflection_vec[2] = 2 * (n_dot_l)*n[2] - light_vec[2]; //następnie wektor odbica jest także normalizowany //zgodnie z wymogami modelu Phonga, gdzie każdy wektor musi taki być temp = Normalization(reflection_vec); reflection_vec[0] = temp.pos[0]; reflection_vec[1] = temp.pos[1]; reflection_vec[2] = temp.pos[2]; //iloczyn skalarany v_dot_r = dotProduct(reflection_vec, viewer_vec); //sprawdzenie, czy punkt jest w ogóle widoczny przez obserwatora if (v_dot_r < 0) v_dot_r = 0; //sprawdzenie czy punkt na powierzchni sfery jest oświetlany przez źródło if (n_dot_l > 0) { //punkt jest oświetlany dalej... //obliczenia wg modelu Phonga zdefiniowanego w instrukcji laboratoryjnej color.pos[0] += scale * (sphere_diffuse[sphere][0] * light_diffuse[i][0] * n_dot_l + sphere_specular[sphere][0] * light_specular[i][0] * pow(double(v_dot_r), double(sphere_shiness[sphere]))) + sphere_ambient[sphere][0] * light_ambient[i][0] + sphere_ambient[sphere][0] * global_a[0]; color.pos[1] += scale * (sphere_diffuse[sphere][1] * light_diffuse[i][1] * n_dot_l + sphere_specular[sphere][1] * light_specular[i][1] * pow(double(v_dot_r), double(sphere_shiness[sphere]))) + sphere_ambient[sphere][1] * light_ambient[i][1] + sphere_ambient[sphere][1] * global_a[1]; color.pos[2] += scale * (sphere_diffuse[sphere][2] * light_diffuse[i][2] * n_dot_l + sphere_specular[sphere][2] * light_specular[i][2] * pow(double(v_dot_r), double(sphere_shiness[sphere]))) + sphere_ambient[sphere][2] * light_ambient[i][2] + sphere_ambient[sphere][2] * global_a[2]; } else{ //w przeciwnym wypadku punkt nie jest oświetlany //jego oświetlenie wynika wyłącznie ze światła rozproszonego color.pos[0] += sphere_ambient[sphere][0] * global_a[0]; color.pos[1] += sphere_ambient[sphere][1] * global_a[1]; color.pos[2] += sphere_ambient[sphere][2] * global_a[2]; } } return color; } //funckja wylicza kolejne punkty przecięca dla śledzonego promienia //p - jest źródłem promienia //v - wskazuje jego kierunek punktStruct Trace(punkt p, punkt v, int next_step) { punkt q; //punkt przecięcia na powierzchni sfery punkt n; //wektor znormalizowany do powierzchni obiektu w punkcie q punkt r; //wektor odbicia //zmienne pomocnicze int status; //werykacja w co trafił promień int light_number; //numer zrodla swiatla int sphere_number; //numer sfery //oświetlenie lokalne punktu punktStruct local; local.pos[0] = 0.0; local.pos[1] = 0.0; local.pos[2] = 0.0; //oświetlenie punktu pochodzące z promieni odbitych punktStruct reflected; reflected.pos[0] = 0.0; reflected.pos[1] = 0.0; reflected.pos[2] = 0.0; //jeżeli osiągnięto pożądaną głębokość rekurencji dla danego promienia, a on nie trafił //w żaden obiekt na akualnym etapie, to miejsce to będzie kolorwane kolorem tła if (next_step > MAX) { local.pos[0] += background_color[0]; local.pos[1] += background_color[1]; local.pos[2] += background_color[2]; return local; } //wyliczenie punktu przecięcia dla skierowanego promienia //wychodzącego z punkty p //skierowanego według wektora v punktSphereStruct tempSS = Intersect(p, v); q[0] = tempSS.pos[0]; q[1] = tempSS.pos[1]; q[2] = tempSS.pos[2]; status = tempSS.status; light_number = tempSS.light; sphere_number = tempSS.sphere; //1 - promień trafił w zrodlo swiatla if (status == 1) { local.pos[0] += light_specular[light_number][0]; local.pos[1] += light_specular[light_number][1]; local.pos[2] += light_specular[light_number][2]; return local; } //2 - nic nie zostalo trafione przez promienie //piksel przyjmuje wartości barwy tła if (status == 2) { local.pos[0] += background_color[0]; local.pos[1] += background_color[1]; local.pos[2] += background_color[2]; return local; } //wyliczenie wektora znormalizowanego do powierzchni w punkcie q sfery sphere punktStruct tempS = Normal(q, sphere_number); n[0] = tempS.pos[0]; n[1] = tempS.pos[1]; n[2] = tempS.pos[2]; //wyliczenie kierunku promienia odbitego od powierzchni obiektu tempS = Reflect(p, q, n); r[0] = tempS.pos[0]; r[1] = tempS.pos[1]; r[2] = tempS.pos[2]; //oświetlenie lokalne wyliczane jest z modelu Phonga dla danej sfery w danym punkcie local = Phong(q, n, sphere_number); //dalsze obliczenia, czyli obliczenia mające uzysać poprzez rekurencję //całkowitą wartość oświetlenia w bieżącym punkcie reflected = Trace(q, r, next_step + 1); //wyliczenie całkowitego oświelenia w punkcie rysowanym local.pos[0] += reflected.pos[0]; local.pos[1] += reflected.pos[1]; local.pos[2] += reflected.pos[2]; return local; }; #pragma endregion #pragma region f_renderujaca //funkcja renderująca obraz sceny void RenderScene(void) { glClear(GL_COLOR_BUFFER_BIT); glFlush(); //zagnieżdżone pętle przetwarzają okno //przesuwając się głowicą od lewej do prawej krawędzi //schodząc z górnej do dolnej krawędzi //na bieżąco przetwarzany jest - obliczany jest kolor jednego piksela float pix_x, pix_y; //bieżące współrzędne piksela int horizontal_2 = horizontal / 2; //połowa rozmiaru okna int vertical_2 = vertical / 2; //pozwala określić kierunek przetwarzania okna punktStruct color; //pomocnicza zmmienna przechowująca kolor piksela - wynikową funkcji śledzenia for (int y = vertical_2; y > -vertical_2; y--) { for (int x = -horizontal_2; x < horizontal_2; x++) { //obliczenie pozycji kolejnego piksela w kontekście okna obserwatora pix_x = (float)x / (horizontal / viewport_size); pix_y = (float)y / (vertical / viewport_size); //punkt - piksel ten ma współrzędne x y z odpowiednio //wg instrukcji laboratoryjnej starting_point[0] = pix_x; starting_point[1] = pix_y; starting_point[2] = viewport_size; //wywołanie dla bieżącego piksela oraz promienia obserwacji funkcji rekurencyjej śledzącej jego przebieg //tym sposobem otrzymujemy trzy dane do przetworzenia w celu wys=łuskania koloru color = Trace(starting_point, starting_directions, step); //wyznaczanie koloru piksela //wg instrukcji laboratoryjnej if (color.pos[0] > 1) pixel[0][0][0] = 255; else pixel[0][0][0] = color.pos[0] * 255; if (color.pos[1] > 1) pixel[0][0][1] = 255; else pixel[0][0][1] = color.pos[1] * 255; if (color.pos[2] > 1) pixel[0][0][2] = 255; else pixel[0][0][2] = color.pos[2] * 255; //inkrementacja pozycji rastrowej glRasterPos3f(pix_x, pix_y, 0); glDrawPixels(1, 1, GL_RGB, GL_UNSIGNED_BYTE, pixel); } } glFlush(); } #pragma endregion #pragma region f_wczytujaca //funkcja wczytuje dane z pliku tekstowe //nazwa pliku: scena.txt void ReadFile(void) //odczytywanie danych z pliku { fstream infile; infile.open("scene.txt"); string tmp; if (infile.is_open() != true) { cout << "Nie udalo wczytac sie pliku"; } else { infile >> tmp; infile >> horizontal; infile >> vertical; infile >> tmp; for (int i = 0; i < 3; i++) infile >> background_color[i]; infile >> tmp; for (int i = 0; i < 3; i++) infile >> global_a[i]; for (int i = 0; i < 9; i++) { infile >> tmp; infile >> sphere_radius[i]; infile >> sphere_position[i][0]; infile >> sphere_position[i][1]; infile >> sphere_position[i][2]; infile >> sphere_specular[i][0]; infile >> sphere_specular[i][1]; infile >> sphere_specular[i][2]; infile >> sphere_diffuse[i][0]; infile >> sphere_diffuse[i][1]; infile >> sphere_diffuse[i][2]; infile >> sphere_ambient[i][0]; infile >> sphere_ambient[i][1]; infile >> sphere_ambient[i][2]; infile >> sphere_shiness[i]; } for (int i = 0; i < 5; i++) { infile >> tmp; infile >> light_position[i][0]; infile >> light_position[i][1]; infile >> light_position[i][2]; infile >> light_specular[i][0]; infile >> light_specular[i][1]; infile >> light_specular[i][2]; infile >> light_diffuse[i][0]; infile >> light_diffuse[i][1]; infile >> light_diffuse[i][2]; infile >> light_ambient[i][0]; infile >> light_ambient[i][1]; infile >> light_ambient[i][2]; } infile.close(); } } #pragma endregion #pragma region f_startowe //funkcja inicjacyjna void Myinit(void) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-viewport_size / 2, viewport_size / 2, -viewport_size / 2, viewport_size / 2, -viewport_size / 2, viewport_size / 2); glMatrixMode(GL_MODELVIEW); } //funkcja main int main(void) { ReadFile(); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA); glutInitWindowSize(horizontal, vertical); glutCreateWindow("MINIPROJEKT - Ray Tracing"); Myinit(); glutDisplayFunc(RenderScene); glutMainLoop(); } #pragma endregion
[ "jakubalcerzak@gmail.com" ]
jakubalcerzak@gmail.com
b13f20576ee1fa0ef547f2f7f4ccdde88902733d
b389f1f3075092f7cb25f45ee9bf910c55250735
/Codeforces/Rounds/Round448/A.cpp
79fe5c9645d24f4668b8d9270faa6bcb7c5e3809
[]
no_license
leostd/Competitive-Programming
7b3c4c671e799216c79aeefd2ca7d68c5d463fa6
4db01b81314f82c4ebb750310e5afb4894b582bd
refs/heads/master
2023-05-13T07:04:40.512100
2023-05-06T10:58:28
2023-05-06T10:58:28
87,685,033
0
1
null
null
null
null
UTF-8
C++
false
false
653
cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n; scanf("%d", &n); int a[400]; int acums[400]; acums[0] = 0; for(int i = 1; i <= n; i++){ scanf("%d", &a[i]); } for (int i = 0; i <= n; i++) acums[i] = acums[i-1] + a[i]; int min_diff = 0x3f3f3f3f; if (n == 0) printf("360\n"); else{ for(int i = 0; i <= n; i++){ for(int j = 0; j < i; j++){ int a = acums[i] - acums[j]; int b = 360 - a; min_diff = min(min_diff, abs(a-b)); } } printf("%d\n", min_diff); } return 0; }
[ "lsantella@mahisoft.com" ]
lsantella@mahisoft.com
347cb42813f3119ef53a6bbd957343c580a9bb8e
a01573fbc216ddf53eb85972d82a1ff2e71f4857
/src/rpcprotocol.cpp
f70562b0460cb95c8a8ec49c3cc13e175a11484e
[ "MIT" ]
permissive
bzcryptocoinalliance/BCCA
d19de6092967b879743c7ff1816fcab096abfc93
03be6fc114774d8a0a41479ad0ad805ef1983088
refs/heads/master
2020-03-11T13:52:16.639131
2018-04-27T07:46:53
2018-04-27T07:46:53
130,037,042
0
2
null
null
null
null
UTF-8
C++
false
false
7,726
cpp
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2013 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "rpcprotocol.h" #include "util.h" #include <stdint.h> #include <boost/algorithm/string.hpp> #include <boost/asio.hpp> #include <boost/asio/ssl.hpp> #include <boost/bind.hpp> #include <boost/filesystem.hpp> #include <boost/foreach.hpp> #include <boost/iostreams/concepts.hpp> #include <boost/iostreams/stream.hpp> #include <boost/lexical_cast.hpp> #include <boost/shared_ptr.hpp> #include "json/json_spirit_writer_template.h" using namespace std; using namespace boost; using namespace boost::asio; using namespace json_spirit; // // HTTP protocol // // This ain't Apache. We're just using HTTP header for the length field // and to be compatible with other JSON-RPC implementations. // string HTTPPost(const string& strMsg, const map<string,string>& mapRequestHeaders) { ostringstream s; s << "POST / HTTP/1.1\r\n" << "User-Agent: bcca-json-rpc/" << FormatFullVersion() << "\r\n" << "Host: 127.0.0.1\r\n" << "Content-Type: application/json\r\n" << "Content-Length: " << strMsg.size() << "\r\n" << "Connection: close\r\n" << "Accept: application/json\r\n"; BOOST_FOREACH(const PAIRTYPE(string, string)& item, mapRequestHeaders) s << item.first << ": " << item.second << "\r\n"; s << "\r\n" << strMsg; return s.str(); } static string rfc1123Time() { return DateTimeStrFormat("%a, %d %b %Y %H:%M:%S +0000", GetTime()); } string HTTPReply(int nStatus, const string& strMsg, bool keepalive) { if (nStatus == HTTP_UNAUTHORIZED) return strprintf("HTTP/1.0 401 Authorization Required\r\n" "Date: %s\r\n" "Server: bcca-json-rpc/%s\r\n" "WWW-Authenticate: Basic realm=\"jsonrpc\"\r\n" "Content-Type: text/html\r\n" "Content-Length: 296\r\n" "\r\n" "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n" "\"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\">\r\n" "<HTML>\r\n" "<HEAD>\r\n" "<TITLE>Error</TITLE>\r\n" "<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>\r\n" "</HEAD>\r\n" "<BODY><H1>401 Unauthorized.</H1></BODY>\r\n" "</HTML>\r\n", rfc1123Time(), FormatFullVersion()); const char *cStatus; if (nStatus == HTTP_OK) cStatus = "OK"; else if (nStatus == HTTP_BAD_REQUEST) cStatus = "Bad Request"; else if (nStatus == HTTP_FORBIDDEN) cStatus = "Forbidden"; else if (nStatus == HTTP_NOT_FOUND) cStatus = "Not Found"; else if (nStatus == HTTP_INTERNAL_SERVER_ERROR) cStatus = "Internal Server Error"; else cStatus = ""; return strprintf( "HTTP/1.1 %d %s\r\n" "Date: %s\r\n" "Connection: %s\r\n" "Content-Length: %u\r\n" "Content-Type: application/json\r\n" "Server: bcca-json-rpc/%s\r\n" "\r\n" "%s", nStatus, cStatus, rfc1123Time(), keepalive ? "keep-alive" : "close", strMsg.size(), FormatFullVersion(), strMsg); } bool ReadHTTPRequestLine(std::basic_istream<char>& stream, int &proto, string& http_method, string& http_uri) { string str; getline(stream, str); // HTTP request line is space-delimited vector<string> vWords; boost::split(vWords, str, boost::is_any_of(" ")); if (vWords.size() < 2) return false; // HTTP methods permitted: GET, POST http_method = vWords[0]; if (http_method != "GET" && http_method != "POST") return false; // HTTP URI must be an absolute path, relative to current host http_uri = vWords[1]; if (http_uri.size() == 0 || http_uri[0] != '/') return false; // parse proto, if present string strProto = ""; if (vWords.size() > 2) strProto = vWords[2]; proto = 0; const char *ver = strstr(strProto.c_str(), "HTTP/1."); if (ver != NULL) proto = atoi(ver+7); return true; } int ReadHTTPStatus(std::basic_istream<char>& stream, int &proto) { string str; getline(stream, str); vector<string> vWords; boost::split(vWords, str, boost::is_any_of(" ")); if (vWords.size() < 2) return HTTP_INTERNAL_SERVER_ERROR; proto = 0; const char *ver = strstr(str.c_str(), "HTTP/1."); if (ver != NULL) proto = atoi(ver+7); return atoi(vWords[1].c_str()); } int ReadHTTPHeaders(std::basic_istream<char>& stream, map<string, string>& mapHeadersRet) { int nLen = 0; while (true) { string str; std::getline(stream, str); if (str.empty() || str == "\r") break; string::size_type nColon = str.find(":"); if (nColon != string::npos) { string strHeader = str.substr(0, nColon); boost::trim(strHeader); boost::to_lower(strHeader); string strValue = str.substr(nColon+1); boost::trim(strValue); mapHeadersRet[strHeader] = strValue; if (strHeader == "content-length") nLen = atoi(strValue.c_str()); } } return nLen; } int ReadHTTPMessage(std::basic_istream<char>& stream, map<string, string>& mapHeadersRet, string& strMessageRet, int nProto) { mapHeadersRet.clear(); strMessageRet = ""; // Read header int nLen = ReadHTTPHeaders(stream, mapHeadersRet); if (nLen < 0 || nLen > (int)MAX_SIZE) return HTTP_INTERNAL_SERVER_ERROR; // Read message if (nLen > 0) { vector<char> vch(nLen); stream.read(&vch[0], nLen); strMessageRet = string(vch.begin(), vch.end()); } string sConHdr = mapHeadersRet["connection"]; if ((sConHdr != "close") && (sConHdr != "keep-alive")) { if (nProto >= 1) mapHeadersRet["connection"] = "keep-alive"; else mapHeadersRet["connection"] = "close"; } return HTTP_OK; } // // JSON-RPC protocol. Bitcoin speaks version 1.0 for maximum compatibility, // but uses JSON-RPC 1.1/2.0 standards for parts of the 1.0 standard that were // unspecified (HTTP errors and contents of 'error'). // // 1.0 spec: http://json-rpc.org/wiki/specification // 1.2 spec: http://groups.google.com/group/json-rpc/web/json-rpc-over-http // http://www.codeproject.com/KB/recipes/JSON_Spirit.aspx // string JSONRPCRequest(const string& strMethod, const Array& params, const Value& id) { Object request; request.push_back(Pair("method", strMethod)); request.push_back(Pair("params", params)); request.push_back(Pair("id", id)); return write_string(Value(request), false) + "\n"; } Object JSONRPCReplyObj(const Value& result, const Value& error, const Value& id) { Object reply; if (error.type() != null_type) reply.push_back(Pair("result", Value::null)); else reply.push_back(Pair("result", result)); reply.push_back(Pair("error", error)); reply.push_back(Pair("id", id)); return reply; } string JSONRPCReply(const Value& result, const Value& error, const Value& id) { Object reply = JSONRPCReplyObj(result, error, id); return write_string(Value(reply), false) + "\n"; } Object JSONRPCError(int code, const string& message) { Object error; error.push_back(Pair("code", code)); error.push_back(Pair("message", message)); return error; }
[ "ihor.chaban@inveritasoft.com" ]
ihor.chaban@inveritasoft.com
f86845a10a72c34af3620e40554a838d23de3a61
4ead7a22e929d9f2b58d52377df1b2d99079808c
/Algoritmos/Simulado 3/Exercício02.cpp
33d55896d6c66cf9e604877f8a961a1ca7cb1dc8
[ "MIT" ]
permissive
monteiroricardo/Documentos_FATEC
fa26998e1af09bab8d250526b344e70f8d62e038
9018f90cc19a3a4cb2815fbba4824bb7cc4304e6
refs/heads/main
2022-12-30T06:12:56.827529
2020-10-13T23:24:16
2020-10-13T23:24:16
305,404,675
1
0
MIT
2020-10-19T14:06:22
2020-10-19T14:06:21
null
ISO-8859-1
C++
false
false
411
cpp
#include <stdio.h> #include <stdlib.h> #include <locale.h> #include <time.h> main(){ srand(time(NULL)); int i, qd=0; float t[100], st=0, m; setlocale(LC_ALL,""); for(i=0;i<100;i++){ t[i]=rand()%26+15; printf("Temperatura dia %i: %.f\n",i+1,t[i]); st+=t[i]; } m=st/100; printf("\nMédia %.2f\n",m); for(i=0;i<100;i++){ if(t[i]<m) qd++; } printf("Quantidade de dias < média: %i\n",qd); }
[ "matheus_hoq.contato@outlook.com" ]
matheus_hoq.contato@outlook.com
6af263ed4f3e6d435663c9f314c82982288f18e9
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_1484496_0/C++/Fcdkbear/code.cpp
2a7544acc7c1d869edf29a9a54a0ef5281f72fa9
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
C++
false
false
2,674
cpp
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <algorithm> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <ctime> #include <memory.h> #define ABS(a) ((a>0)?a:-(a)) #define MIN(a,b) ((a<b)?(a):(b)) #define MAX(a,b) ((a<b)?(b):(a)) #define FOR(i,a,n) for (int i=(a);i<(n);++i) #define FI(i,n) for (int i=0; i<(n); ++i) #define pnt pair <int, int> #define mp make_pair #define PI 3.14159265358979 #define MEMS(a,b) memset(a,b,sizeof(a)) #define LL long long #define U unsigned using namespace std; int a[21]; vector<pnt > b,c; vector<int> res1,res2; vector<pnt > doit(int l) { vector<pnt > res; FOR(i,0,59049) { int sum1=0,sum2=0; int v=i; FOR(j,0,10) { int q=v%3; v/=3; if (q==1) sum1+=a[l+j]; if (q==2) sum2+=a[l+j]; } res.push_back(mp(sum2-sum1,i)); } return res; } int main() { freopen("in.txt","r",stdin); freopen("out.txt","w",stdout); int t; scanf("%d",&t); FOR(it,1,t+1) { int n; scanf("%d",&n); FOR(i,0,n) scanf("%d",&a[i]); b=doit(0); c=doit(10); res1.clear(); res2.clear(); sort(b.begin(),b.end()); sort(c.begin(),c.end()); printf("Case #%d:\n",it); bool f=false; FOR(i,0,b.size()) { int l=0,r=c.size()-1; int best=-1; while (l<=r) { int m=(l+r)/2; if (c[m].first>-b[i].first) r=m-1; else if (c[m].first<-b[i].first) l=m+1; else { if ((b[i].second==0) && (c[m].second==0)) l=m+1; else { best=m; break; } } } if (best!=-1) { int v=b[i].second; FOR(j,0,10) { int q=v%3; v/=3; if (q==1) res1.push_back(a[j]); if (q==2) res2.push_back(a[j]); } v=c[best].second; FOR(j,0,10) { int q=v%3; v/=3; if (q==1) res1.push_back(a[10+j]); if (q==2) res2.push_back(a[10+j]); } if ((res1.size()==0) || (res2.size()==0)) { res1.clear(); res2.clear(); continue; } f=true; int sum1=0,sum2=0; FOR(i,0,res1.size()) { if (i) printf(" "); sum1+=res1[i]; printf("%d",res1[i]); } printf("\n"); FOR(i,0,res2.size()) { if (i) printf(" "); sum2+=res2[i]; printf("%d",res2[i]); } printf("\n"); fprintf(stderr,"%d %d\n",sum1,sum2); break; } } if (!f) printf("Impossible\n"); } return 0; }
[ "eewestman@gmail.com" ]
eewestman@gmail.com
0ca8e0571bd9a08320d5df1a97d4184b4cc2d936
764636de968c0ea063a2022f9a877c751d5f6860
/MainMenu.h
f355fbf171b1f07e5f42c8351e12c43fcd0a59ea
[]
no_license
amvinson234/Pong2
71fd9a0de79447098f396ee68ee63be7582d61b0
bea448d234df6a90861784bc62450910084acd43
refs/heads/master
2020-04-21T22:05:34.065045
2019-02-12T07:55:12
2019-02-12T07:55:12
169,898,567
0
0
null
null
null
null
UTF-8
C++
false
false
509
h
#ifndef MAINMENU_H_INCLUDED #define MAINMENU_H_INCLUDED #include "SFML/Graphics.hpp" #include <list> class MainMenu { public: enum MenuResult {Nothing, Exit, Options, Play}; struct MenuItem { public: sf::FloatRect rect; MenuResult action; }; MenuResult Show(sf::RenderWindow& window); private: MenuResult GetMenuResponse(sf::RenderWindow& window); MenuResult HandleClick(int x, int y); std::list<MenuItem> _menuItems; }; #endif // MAINMENU_H_INCLUDED
[ "alec.m.vinson@gmail.com" ]
alec.m.vinson@gmail.com
83431bdf72bc8d35a540ab09a72dbce60532b690
56f687438c79bc7fa17b8028624703b5fca42493
/kiemtrachutrinhtrendothicohuongvoiBFS.cpp
60b4e6052f06a2e9a6599a2e26fd4e2da3b703f4
[]
no_license
Sudo248/Algorithm
e1ba175906251cf5155d31275bb006dfead12052
9298e5fa0e180f1c0d3712911a5ba9f2ce348be0
refs/heads/master
2023-06-19T03:09:33.953455
2021-07-21T16:54:57
2021-07-21T16:54:57
386,905,788
0
0
null
null
null
null
UTF-8
C++
false
false
915
cpp
#include<bits/stdc++.h> #define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define endl '\n' using namespace std; typedef long long ll; vector<vector<int> >G; vector<int>check; bool hasCycle; void DFS(int u){ check[u] = true; for(int &v:G[u]){ if(check[v]==0) { DFS(v); } else if(check[v] == 1){ hasCycle = true; } } check[u] = 2; } void solve(){ int V,E; cin>>V>>E; hasCycle = false; G.clear(); G.resize(V+1); check.clear(); check.resize(V+1,false); for(int i=0;i<E;i++){ int x,y; cin>>x>>y; G[x].push_back(y); } for(int i=1;i<=V;i++){ if(!check[i]) DFS(i); if(hasCycle) break; } if(hasCycle) cout<<"YES\n"; else cout<<"NO\n"; } int main(){ faster int t; cin>>t; while(t--) solve(); return 0; }
[ "hongduong080501@gmail.com" ]
hongduong080501@gmail.com
d44fea9b575676207c23243fcd09f864d1a0d8a4
cdb186ad49bba1406c81f634b936e73f8cb04009
/ABC/018/b.cpp
59cb00e103d4c356747b461fa94638e0d4f932b9
[]
no_license
ToshikiShimizu/AtCoder
9e46f5581f2c1f5149ce1394d61d652cda6256a3
41fe6408c20c59bbf1b5d7ee9db2e132f48ad1ac
refs/heads/master
2023-07-26T22:45:51.965088
2023-07-10T14:11:35
2023-07-10T14:11:35
148,154,815
0
0
null
null
null
null
UTF-8
C++
false
false
818
cpp
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(a) (a).begin(),(a).end() #define SUM(a) accumulate((a).begin(),(a).end(),0) #define SORT(a) sort(ALL(a)) #define REV(a) reverse(ALL(a)) #define dump(x) cerr << #x << " = " << (x) << endl; typedef long long ll; const int INTINF = 1<<29; const ll LLINF = 1LL<<61; const int MOD = (int)1e9 + 7; const double EPS = 1e-9; const int DX[8]={ 0, 1, 0,-1, 1, 1,-1,-1}; const int DY[8]={ 1, 0,-1, 0, 1,-1, 1,-1}; int main() { cin.tie(0); ios::sync_with_stdio(false); string s; string t; int n; int l, r; cin >> s; t = s; cin >> n; REP(i,n){ cin >> l >> r; FOR(i,l-1,r){ t[i] = s[r+l-i-2]; } s = t; //cout << s << endl; } cout << s << endl; }
[ "tamreff3290@gmail.com" ]
tamreff3290@gmail.com
d5524eb31c175ff7e5073708797691a216ce5c4a
2cd6edd02450849015bf535eb473a750dace67a8
/final-project/repositories/Deep_Learning_Inference_Accelerator_with_CNNIOT/MSOC_final-main/finalpool_hls/solution1/syn/systemc/load_cifm_data.cpp
997dfc90d82946a867403985edc27748d716d74c
[ "MIT" ]
permissive
prajwaltr/MSoC-HLS
fde436f7031cc7477a93f079a1b3407558988e07
d876b6bdfe45caba63811b16b273a9723e9baf65
refs/heads/main
2023-06-05T00:52:40.419332
2021-06-15T02:30:37
2021-06-15T02:30:37
null
0
0
null
null
null
null
UTF-8
C++
false
false
78,611
cpp
// ============================================================== // RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and OpenCL // Version: 2019.2 // Copyright (C) 1986-2019 Xilinx, Inc. All Rights Reserved. // // =========================================================== #include "load_cifm_data.h" #include "AESL_pkg.h" using namespace std; namespace ap_rtl { const sc_logic load_cifm_data::ap_const_logic_1 = sc_dt::Log_1; const sc_logic load_cifm_data::ap_const_logic_0 = sc_dt::Log_0; const sc_lv<5> load_cifm_data::ap_ST_fsm_state1 = "1"; const sc_lv<5> load_cifm_data::ap_ST_fsm_state2 = "10"; const sc_lv<5> load_cifm_data::ap_ST_fsm_state3 = "100"; const sc_lv<5> load_cifm_data::ap_ST_fsm_state4 = "1000"; const sc_lv<5> load_cifm_data::ap_ST_fsm_state5 = "10000"; const sc_lv<32> load_cifm_data::ap_const_lv32_0 = "00000000000000000000000000000000"; const sc_lv<32> load_cifm_data::ap_const_lv32_1 = "1"; const sc_lv<1> load_cifm_data::ap_const_lv1_0 = "0"; const sc_lv<32> load_cifm_data::ap_const_lv32_3 = "11"; const sc_lv<6> load_cifm_data::ap_const_lv6_0 = "000000"; const sc_lv<32> load_cifm_data::ap_const_lv32_2 = "10"; const sc_lv<32> load_cifm_data::ap_const_lv32_20 = "100000"; const sc_lv<32> load_cifm_data::ap_const_lv32_3F = "111111"; const sc_lv<32> load_cifm_data::ap_const_lv32_40 = "1000000"; const sc_lv<32> load_cifm_data::ap_const_lv32_5F = "1011111"; const sc_lv<32> load_cifm_data::ap_const_lv32_60 = "1100000"; const sc_lv<32> load_cifm_data::ap_const_lv32_7F = "1111111"; const sc_lv<32> load_cifm_data::ap_const_lv32_80 = "10000000"; const sc_lv<32> load_cifm_data::ap_const_lv32_9F = "10011111"; const sc_lv<32> load_cifm_data::ap_const_lv32_A0 = "10100000"; const sc_lv<32> load_cifm_data::ap_const_lv32_BF = "10111111"; const sc_lv<32> load_cifm_data::ap_const_lv32_C0 = "11000000"; const sc_lv<32> load_cifm_data::ap_const_lv32_DF = "11011111"; const sc_lv<32> load_cifm_data::ap_const_lv32_E0 = "11100000"; const sc_lv<32> load_cifm_data::ap_const_lv32_FF = "11111111"; const sc_lv<32> load_cifm_data::ap_const_lv32_100 = "100000000"; const sc_lv<32> load_cifm_data::ap_const_lv32_11F = "100011111"; const sc_lv<32> load_cifm_data::ap_const_lv32_120 = "100100000"; const sc_lv<32> load_cifm_data::ap_const_lv32_13F = "100111111"; const sc_lv<32> load_cifm_data::ap_const_lv32_140 = "101000000"; const sc_lv<32> load_cifm_data::ap_const_lv32_15F = "101011111"; const sc_lv<32> load_cifm_data::ap_const_lv32_160 = "101100000"; const sc_lv<32> load_cifm_data::ap_const_lv32_17F = "101111111"; const sc_lv<32> load_cifm_data::ap_const_lv32_180 = "110000000"; const sc_lv<32> load_cifm_data::ap_const_lv32_19F = "110011111"; const sc_lv<32> load_cifm_data::ap_const_lv32_1A0 = "110100000"; const sc_lv<32> load_cifm_data::ap_const_lv32_1BF = "110111111"; const sc_lv<32> load_cifm_data::ap_const_lv32_1C0 = "111000000"; const sc_lv<32> load_cifm_data::ap_const_lv32_1DF = "111011111"; const sc_lv<32> load_cifm_data::ap_const_lv32_1E0 = "111100000"; const sc_lv<32> load_cifm_data::ap_const_lv32_1FF = "111111111"; const sc_lv<6> load_cifm_data::ap_const_lv6_3A = "111010"; const sc_lv<6> load_cifm_data::ap_const_lv6_1 = "1"; const sc_lv<32> load_cifm_data::ap_const_lv32_4 = "100"; const sc_lv<1> load_cifm_data::ap_const_lv1_1 = "1"; const bool load_cifm_data::ap_const_boolean_1 = true; load_cifm_data::load_cifm_data(sc_module_name name) : sc_module(name), mVcdFile(0) { SC_METHOD(thread_ap_clk_no_reset_); dont_initialize(); sensitive << ( ap_clk.pos() ); SC_METHOD(thread_ap_CS_fsm_state1); sensitive << ( ap_CS_fsm ); SC_METHOD(thread_ap_CS_fsm_state2); sensitive << ( ap_CS_fsm ); SC_METHOD(thread_ap_CS_fsm_state3); sensitive << ( ap_CS_fsm ); SC_METHOD(thread_ap_CS_fsm_state4); sensitive << ( ap_CS_fsm ); SC_METHOD(thread_ap_CS_fsm_state5); sensitive << ( ap_CS_fsm ); SC_METHOD(thread_ap_block_state2); sensitive << ( cifm_TVALID ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ap_block_state4); sensitive << ( cifm_TVALID ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ap_done); sensitive << ( ap_start ); sensitive << ( ap_CS_fsm_state1 ); sensitive << ( ap_CS_fsm_state5 ); SC_METHOD(thread_ap_idle); sensitive << ( ap_start ); sensitive << ( ap_CS_fsm_state1 ); SC_METHOD(thread_ap_ready); sensitive << ( ap_CS_fsm_state5 ); SC_METHOD(thread_cifm_TDATA_blk_n); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_cifm_TREADY); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_grp_fu_610_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_grp_fu_620_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_grp_fu_630_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_grp_fu_640_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_grp_fu_650_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_grp_fu_660_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_grp_fu_670_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_grp_fu_680_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_grp_fu_690_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_grp_fu_700_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_grp_fu_710_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_grp_fu_720_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_grp_fu_730_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_grp_fu_740_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_grp_fu_750_p4); sensitive << ( cifm_TDATA ); SC_METHOD(thread_icmp_ln32_fu_876_p2); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); sensitive << ( j1_0_reg_599 ); SC_METHOD(thread_icmp_ln9_fu_760_p2); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); sensitive << ( cifm_counter_0_reg_588 ); SC_METHOD(thread_ifm_buff0_0_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_0_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_0_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( trunc_ln12_fu_792_p1 ); SC_METHOD(thread_ifm_buff0_0_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_10_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_10_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_10_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_700_p4 ); SC_METHOD(thread_ifm_buff0_10_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_11_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_11_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_11_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_710_p4 ); SC_METHOD(thread_ifm_buff0_11_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_12_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_12_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_12_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_720_p4 ); SC_METHOD(thread_ifm_buff0_12_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_13_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_13_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_13_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_730_p4 ); SC_METHOD(thread_ifm_buff0_13_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_14_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_14_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_14_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_740_p4 ); SC_METHOD(thread_ifm_buff0_14_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_15_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_15_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_15_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_750_p4 ); SC_METHOD(thread_ifm_buff0_15_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_1_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_1_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_1_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_610_p4 ); SC_METHOD(thread_ifm_buff0_1_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_2_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_2_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_2_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_620_p4 ); SC_METHOD(thread_ifm_buff0_2_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_3_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_3_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_3_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_630_p4 ); SC_METHOD(thread_ifm_buff0_3_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_4_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_4_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_4_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_640_p4 ); SC_METHOD(thread_ifm_buff0_4_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_5_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_5_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_5_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_650_p4 ); SC_METHOD(thread_ifm_buff0_5_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_6_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_6_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_6_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_660_p4 ); SC_METHOD(thread_ifm_buff0_6_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_7_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_7_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_7_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_670_p4 ); SC_METHOD(thread_ifm_buff0_7_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_8_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_8_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_8_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_680_p4 ); SC_METHOD(thread_ifm_buff0_8_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_9_address0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( zext_ln12_fu_772_p1 ); SC_METHOD(thread_ifm_buff0_9_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff0_9_d0); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( grp_fu_690_p4 ); SC_METHOD(thread_ifm_buff0_9_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); SC_METHOD(thread_ifm_buff1_0_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_0_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_0_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( trunc_ln35_fu_888_p1 ); SC_METHOD(thread_ifm_buff1_0_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_10_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_10_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_10_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_700_p4 ); SC_METHOD(thread_ifm_buff1_10_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_11_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_11_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_11_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_710_p4 ); SC_METHOD(thread_ifm_buff1_11_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_12_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_12_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_12_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_720_p4 ); SC_METHOD(thread_ifm_buff1_12_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_13_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_13_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_13_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_730_p4 ); SC_METHOD(thread_ifm_buff1_13_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_14_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_14_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_14_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_740_p4 ); SC_METHOD(thread_ifm_buff1_14_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_15_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_15_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_15_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_750_p4 ); SC_METHOD(thread_ifm_buff1_15_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_1_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_1_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_1_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_610_p4 ); SC_METHOD(thread_ifm_buff1_1_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_2_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_2_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_2_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_620_p4 ); SC_METHOD(thread_ifm_buff1_2_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_3_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_3_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_3_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_630_p4 ); SC_METHOD(thread_ifm_buff1_3_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_4_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_4_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_4_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_640_p4 ); SC_METHOD(thread_ifm_buff1_4_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_5_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_5_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_5_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_650_p4 ); SC_METHOD(thread_ifm_buff1_5_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_6_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_6_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_6_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_660_p4 ); SC_METHOD(thread_ifm_buff1_6_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_7_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_7_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_7_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_670_p4 ); SC_METHOD(thread_ifm_buff1_7_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_8_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_8_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_8_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_680_p4 ); SC_METHOD(thread_ifm_buff1_8_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_9_address0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( zext_ln35_fu_897_p1 ); SC_METHOD(thread_ifm_buff1_9_ce0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_ifm_buff1_9_d0); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( grp_fu_690_p4 ); SC_METHOD(thread_ifm_buff1_9_we0); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); SC_METHOD(thread_j_1_fu_882_p2); sensitive << ( j1_0_reg_599 ); SC_METHOD(thread_j_fu_766_p2); sensitive << ( cifm_counter_0_reg_588 ); SC_METHOD(thread_trunc_ln12_fu_792_p1); sensitive << ( cifm_TDATA ); SC_METHOD(thread_trunc_ln35_fu_888_p1); sensitive << ( cifm_TDATA ); SC_METHOD(thread_zext_ln12_fu_772_p1); sensitive << ( cifm_counter_0_reg_588 ); SC_METHOD(thread_zext_ln35_fu_897_p1); sensitive << ( j1_0_reg_599 ); SC_METHOD(thread_ap_NS_fsm); sensitive << ( ap_start ); sensitive << ( ap_CS_fsm ); sensitive << ( ap_CS_fsm_state1 ); sensitive << ( cifm_TVALID ); sensitive << ( ap_CS_fsm_state2 ); sensitive << ( icmp_ln9_fu_760_p2 ); sensitive << ( ap_CS_fsm_state4 ); sensitive << ( icmp_ln32_fu_876_p2 ); ap_CS_fsm = "00001"; static int apTFileNum = 0; stringstream apTFilenSS; apTFilenSS << "load_cifm_data_sc_trace_" << apTFileNum ++; string apTFn = apTFilenSS.str(); mVcdFile = sc_create_vcd_trace_file(apTFn.c_str()); mVcdFile->set_time_unit(1, SC_PS); if (1) { #ifdef __HLS_TRACE_LEVEL_PORT_HIER__ sc_trace(mVcdFile, ap_clk, "(port)ap_clk"); sc_trace(mVcdFile, ap_rst, "(port)ap_rst"); sc_trace(mVcdFile, ap_start, "(port)ap_start"); sc_trace(mVcdFile, ap_done, "(port)ap_done"); sc_trace(mVcdFile, ap_idle, "(port)ap_idle"); sc_trace(mVcdFile, ap_ready, "(port)ap_ready"); sc_trace(mVcdFile, cifm_TDATA, "(port)cifm_TDATA"); sc_trace(mVcdFile, cifm_TVALID, "(port)cifm_TVALID"); sc_trace(mVcdFile, cifm_TREADY, "(port)cifm_TREADY"); sc_trace(mVcdFile, ifm_buff0_0_address0, "(port)ifm_buff0_0_address0"); sc_trace(mVcdFile, ifm_buff0_0_ce0, "(port)ifm_buff0_0_ce0"); sc_trace(mVcdFile, ifm_buff0_0_we0, "(port)ifm_buff0_0_we0"); sc_trace(mVcdFile, ifm_buff0_0_d0, "(port)ifm_buff0_0_d0"); sc_trace(mVcdFile, ifm_buff0_1_address0, "(port)ifm_buff0_1_address0"); sc_trace(mVcdFile, ifm_buff0_1_ce0, "(port)ifm_buff0_1_ce0"); sc_trace(mVcdFile, ifm_buff0_1_we0, "(port)ifm_buff0_1_we0"); sc_trace(mVcdFile, ifm_buff0_1_d0, "(port)ifm_buff0_1_d0"); sc_trace(mVcdFile, ifm_buff0_2_address0, "(port)ifm_buff0_2_address0"); sc_trace(mVcdFile, ifm_buff0_2_ce0, "(port)ifm_buff0_2_ce0"); sc_trace(mVcdFile, ifm_buff0_2_we0, "(port)ifm_buff0_2_we0"); sc_trace(mVcdFile, ifm_buff0_2_d0, "(port)ifm_buff0_2_d0"); sc_trace(mVcdFile, ifm_buff0_3_address0, "(port)ifm_buff0_3_address0"); sc_trace(mVcdFile, ifm_buff0_3_ce0, "(port)ifm_buff0_3_ce0"); sc_trace(mVcdFile, ifm_buff0_3_we0, "(port)ifm_buff0_3_we0"); sc_trace(mVcdFile, ifm_buff0_3_d0, "(port)ifm_buff0_3_d0"); sc_trace(mVcdFile, ifm_buff0_4_address0, "(port)ifm_buff0_4_address0"); sc_trace(mVcdFile, ifm_buff0_4_ce0, "(port)ifm_buff0_4_ce0"); sc_trace(mVcdFile, ifm_buff0_4_we0, "(port)ifm_buff0_4_we0"); sc_trace(mVcdFile, ifm_buff0_4_d0, "(port)ifm_buff0_4_d0"); sc_trace(mVcdFile, ifm_buff0_5_address0, "(port)ifm_buff0_5_address0"); sc_trace(mVcdFile, ifm_buff0_5_ce0, "(port)ifm_buff0_5_ce0"); sc_trace(mVcdFile, ifm_buff0_5_we0, "(port)ifm_buff0_5_we0"); sc_trace(mVcdFile, ifm_buff0_5_d0, "(port)ifm_buff0_5_d0"); sc_trace(mVcdFile, ifm_buff0_6_address0, "(port)ifm_buff0_6_address0"); sc_trace(mVcdFile, ifm_buff0_6_ce0, "(port)ifm_buff0_6_ce0"); sc_trace(mVcdFile, ifm_buff0_6_we0, "(port)ifm_buff0_6_we0"); sc_trace(mVcdFile, ifm_buff0_6_d0, "(port)ifm_buff0_6_d0"); sc_trace(mVcdFile, ifm_buff0_7_address0, "(port)ifm_buff0_7_address0"); sc_trace(mVcdFile, ifm_buff0_7_ce0, "(port)ifm_buff0_7_ce0"); sc_trace(mVcdFile, ifm_buff0_7_we0, "(port)ifm_buff0_7_we0"); sc_trace(mVcdFile, ifm_buff0_7_d0, "(port)ifm_buff0_7_d0"); sc_trace(mVcdFile, ifm_buff0_8_address0, "(port)ifm_buff0_8_address0"); sc_trace(mVcdFile, ifm_buff0_8_ce0, "(port)ifm_buff0_8_ce0"); sc_trace(mVcdFile, ifm_buff0_8_we0, "(port)ifm_buff0_8_we0"); sc_trace(mVcdFile, ifm_buff0_8_d0, "(port)ifm_buff0_8_d0"); sc_trace(mVcdFile, ifm_buff0_9_address0, "(port)ifm_buff0_9_address0"); sc_trace(mVcdFile, ifm_buff0_9_ce0, "(port)ifm_buff0_9_ce0"); sc_trace(mVcdFile, ifm_buff0_9_we0, "(port)ifm_buff0_9_we0"); sc_trace(mVcdFile, ifm_buff0_9_d0, "(port)ifm_buff0_9_d0"); sc_trace(mVcdFile, ifm_buff0_10_address0, "(port)ifm_buff0_10_address0"); sc_trace(mVcdFile, ifm_buff0_10_ce0, "(port)ifm_buff0_10_ce0"); sc_trace(mVcdFile, ifm_buff0_10_we0, "(port)ifm_buff0_10_we0"); sc_trace(mVcdFile, ifm_buff0_10_d0, "(port)ifm_buff0_10_d0"); sc_trace(mVcdFile, ifm_buff0_11_address0, "(port)ifm_buff0_11_address0"); sc_trace(mVcdFile, ifm_buff0_11_ce0, "(port)ifm_buff0_11_ce0"); sc_trace(mVcdFile, ifm_buff0_11_we0, "(port)ifm_buff0_11_we0"); sc_trace(mVcdFile, ifm_buff0_11_d0, "(port)ifm_buff0_11_d0"); sc_trace(mVcdFile, ifm_buff0_12_address0, "(port)ifm_buff0_12_address0"); sc_trace(mVcdFile, ifm_buff0_12_ce0, "(port)ifm_buff0_12_ce0"); sc_trace(mVcdFile, ifm_buff0_12_we0, "(port)ifm_buff0_12_we0"); sc_trace(mVcdFile, ifm_buff0_12_d0, "(port)ifm_buff0_12_d0"); sc_trace(mVcdFile, ifm_buff0_13_address0, "(port)ifm_buff0_13_address0"); sc_trace(mVcdFile, ifm_buff0_13_ce0, "(port)ifm_buff0_13_ce0"); sc_trace(mVcdFile, ifm_buff0_13_we0, "(port)ifm_buff0_13_we0"); sc_trace(mVcdFile, ifm_buff0_13_d0, "(port)ifm_buff0_13_d0"); sc_trace(mVcdFile, ifm_buff0_14_address0, "(port)ifm_buff0_14_address0"); sc_trace(mVcdFile, ifm_buff0_14_ce0, "(port)ifm_buff0_14_ce0"); sc_trace(mVcdFile, ifm_buff0_14_we0, "(port)ifm_buff0_14_we0"); sc_trace(mVcdFile, ifm_buff0_14_d0, "(port)ifm_buff0_14_d0"); sc_trace(mVcdFile, ifm_buff0_15_address0, "(port)ifm_buff0_15_address0"); sc_trace(mVcdFile, ifm_buff0_15_ce0, "(port)ifm_buff0_15_ce0"); sc_trace(mVcdFile, ifm_buff0_15_we0, "(port)ifm_buff0_15_we0"); sc_trace(mVcdFile, ifm_buff0_15_d0, "(port)ifm_buff0_15_d0"); sc_trace(mVcdFile, ifm_buff1_0_address0, "(port)ifm_buff1_0_address0"); sc_trace(mVcdFile, ifm_buff1_0_ce0, "(port)ifm_buff1_0_ce0"); sc_trace(mVcdFile, ifm_buff1_0_we0, "(port)ifm_buff1_0_we0"); sc_trace(mVcdFile, ifm_buff1_0_d0, "(port)ifm_buff1_0_d0"); sc_trace(mVcdFile, ifm_buff1_1_address0, "(port)ifm_buff1_1_address0"); sc_trace(mVcdFile, ifm_buff1_1_ce0, "(port)ifm_buff1_1_ce0"); sc_trace(mVcdFile, ifm_buff1_1_we0, "(port)ifm_buff1_1_we0"); sc_trace(mVcdFile, ifm_buff1_1_d0, "(port)ifm_buff1_1_d0"); sc_trace(mVcdFile, ifm_buff1_2_address0, "(port)ifm_buff1_2_address0"); sc_trace(mVcdFile, ifm_buff1_2_ce0, "(port)ifm_buff1_2_ce0"); sc_trace(mVcdFile, ifm_buff1_2_we0, "(port)ifm_buff1_2_we0"); sc_trace(mVcdFile, ifm_buff1_2_d0, "(port)ifm_buff1_2_d0"); sc_trace(mVcdFile, ifm_buff1_3_address0, "(port)ifm_buff1_3_address0"); sc_trace(mVcdFile, ifm_buff1_3_ce0, "(port)ifm_buff1_3_ce0"); sc_trace(mVcdFile, ifm_buff1_3_we0, "(port)ifm_buff1_3_we0"); sc_trace(mVcdFile, ifm_buff1_3_d0, "(port)ifm_buff1_3_d0"); sc_trace(mVcdFile, ifm_buff1_4_address0, "(port)ifm_buff1_4_address0"); sc_trace(mVcdFile, ifm_buff1_4_ce0, "(port)ifm_buff1_4_ce0"); sc_trace(mVcdFile, ifm_buff1_4_we0, "(port)ifm_buff1_4_we0"); sc_trace(mVcdFile, ifm_buff1_4_d0, "(port)ifm_buff1_4_d0"); sc_trace(mVcdFile, ifm_buff1_5_address0, "(port)ifm_buff1_5_address0"); sc_trace(mVcdFile, ifm_buff1_5_ce0, "(port)ifm_buff1_5_ce0"); sc_trace(mVcdFile, ifm_buff1_5_we0, "(port)ifm_buff1_5_we0"); sc_trace(mVcdFile, ifm_buff1_5_d0, "(port)ifm_buff1_5_d0"); sc_trace(mVcdFile, ifm_buff1_6_address0, "(port)ifm_buff1_6_address0"); sc_trace(mVcdFile, ifm_buff1_6_ce0, "(port)ifm_buff1_6_ce0"); sc_trace(mVcdFile, ifm_buff1_6_we0, "(port)ifm_buff1_6_we0"); sc_trace(mVcdFile, ifm_buff1_6_d0, "(port)ifm_buff1_6_d0"); sc_trace(mVcdFile, ifm_buff1_7_address0, "(port)ifm_buff1_7_address0"); sc_trace(mVcdFile, ifm_buff1_7_ce0, "(port)ifm_buff1_7_ce0"); sc_trace(mVcdFile, ifm_buff1_7_we0, "(port)ifm_buff1_7_we0"); sc_trace(mVcdFile, ifm_buff1_7_d0, "(port)ifm_buff1_7_d0"); sc_trace(mVcdFile, ifm_buff1_8_address0, "(port)ifm_buff1_8_address0"); sc_trace(mVcdFile, ifm_buff1_8_ce0, "(port)ifm_buff1_8_ce0"); sc_trace(mVcdFile, ifm_buff1_8_we0, "(port)ifm_buff1_8_we0"); sc_trace(mVcdFile, ifm_buff1_8_d0, "(port)ifm_buff1_8_d0"); sc_trace(mVcdFile, ifm_buff1_9_address0, "(port)ifm_buff1_9_address0"); sc_trace(mVcdFile, ifm_buff1_9_ce0, "(port)ifm_buff1_9_ce0"); sc_trace(mVcdFile, ifm_buff1_9_we0, "(port)ifm_buff1_9_we0"); sc_trace(mVcdFile, ifm_buff1_9_d0, "(port)ifm_buff1_9_d0"); sc_trace(mVcdFile, ifm_buff1_10_address0, "(port)ifm_buff1_10_address0"); sc_trace(mVcdFile, ifm_buff1_10_ce0, "(port)ifm_buff1_10_ce0"); sc_trace(mVcdFile, ifm_buff1_10_we0, "(port)ifm_buff1_10_we0"); sc_trace(mVcdFile, ifm_buff1_10_d0, "(port)ifm_buff1_10_d0"); sc_trace(mVcdFile, ifm_buff1_11_address0, "(port)ifm_buff1_11_address0"); sc_trace(mVcdFile, ifm_buff1_11_ce0, "(port)ifm_buff1_11_ce0"); sc_trace(mVcdFile, ifm_buff1_11_we0, "(port)ifm_buff1_11_we0"); sc_trace(mVcdFile, ifm_buff1_11_d0, "(port)ifm_buff1_11_d0"); sc_trace(mVcdFile, ifm_buff1_12_address0, "(port)ifm_buff1_12_address0"); sc_trace(mVcdFile, ifm_buff1_12_ce0, "(port)ifm_buff1_12_ce0"); sc_trace(mVcdFile, ifm_buff1_12_we0, "(port)ifm_buff1_12_we0"); sc_trace(mVcdFile, ifm_buff1_12_d0, "(port)ifm_buff1_12_d0"); sc_trace(mVcdFile, ifm_buff1_13_address0, "(port)ifm_buff1_13_address0"); sc_trace(mVcdFile, ifm_buff1_13_ce0, "(port)ifm_buff1_13_ce0"); sc_trace(mVcdFile, ifm_buff1_13_we0, "(port)ifm_buff1_13_we0"); sc_trace(mVcdFile, ifm_buff1_13_d0, "(port)ifm_buff1_13_d0"); sc_trace(mVcdFile, ifm_buff1_14_address0, "(port)ifm_buff1_14_address0"); sc_trace(mVcdFile, ifm_buff1_14_ce0, "(port)ifm_buff1_14_ce0"); sc_trace(mVcdFile, ifm_buff1_14_we0, "(port)ifm_buff1_14_we0"); sc_trace(mVcdFile, ifm_buff1_14_d0, "(port)ifm_buff1_14_d0"); sc_trace(mVcdFile, ifm_buff1_15_address0, "(port)ifm_buff1_15_address0"); sc_trace(mVcdFile, ifm_buff1_15_ce0, "(port)ifm_buff1_15_ce0"); sc_trace(mVcdFile, ifm_buff1_15_we0, "(port)ifm_buff1_15_we0"); sc_trace(mVcdFile, ifm_buff1_15_d0, "(port)ifm_buff1_15_d0"); #endif #ifdef __HLS_TRACE_LEVEL_INT__ sc_trace(mVcdFile, ap_CS_fsm, "ap_CS_fsm"); sc_trace(mVcdFile, ap_CS_fsm_state1, "ap_CS_fsm_state1"); sc_trace(mVcdFile, cifm_TDATA_blk_n, "cifm_TDATA_blk_n"); sc_trace(mVcdFile, ap_CS_fsm_state2, "ap_CS_fsm_state2"); sc_trace(mVcdFile, icmp_ln9_fu_760_p2, "icmp_ln9_fu_760_p2"); sc_trace(mVcdFile, ap_CS_fsm_state4, "ap_CS_fsm_state4"); sc_trace(mVcdFile, icmp_ln32_fu_876_p2, "icmp_ln32_fu_876_p2"); sc_trace(mVcdFile, j_fu_766_p2, "j_fu_766_p2"); sc_trace(mVcdFile, ap_block_state2, "ap_block_state2"); sc_trace(mVcdFile, j_1_fu_882_p2, "j_1_fu_882_p2"); sc_trace(mVcdFile, ap_block_state4, "ap_block_state4"); sc_trace(mVcdFile, cifm_counter_0_reg_588, "cifm_counter_0_reg_588"); sc_trace(mVcdFile, j1_0_reg_599, "j1_0_reg_599"); sc_trace(mVcdFile, ap_CS_fsm_state3, "ap_CS_fsm_state3"); sc_trace(mVcdFile, zext_ln12_fu_772_p1, "zext_ln12_fu_772_p1"); sc_trace(mVcdFile, zext_ln35_fu_897_p1, "zext_ln35_fu_897_p1"); sc_trace(mVcdFile, trunc_ln12_fu_792_p1, "trunc_ln12_fu_792_p1"); sc_trace(mVcdFile, grp_fu_610_p4, "grp_fu_610_p4"); sc_trace(mVcdFile, grp_fu_620_p4, "grp_fu_620_p4"); sc_trace(mVcdFile, grp_fu_630_p4, "grp_fu_630_p4"); sc_trace(mVcdFile, grp_fu_640_p4, "grp_fu_640_p4"); sc_trace(mVcdFile, grp_fu_650_p4, "grp_fu_650_p4"); sc_trace(mVcdFile, grp_fu_660_p4, "grp_fu_660_p4"); sc_trace(mVcdFile, grp_fu_670_p4, "grp_fu_670_p4"); sc_trace(mVcdFile, grp_fu_680_p4, "grp_fu_680_p4"); sc_trace(mVcdFile, grp_fu_690_p4, "grp_fu_690_p4"); sc_trace(mVcdFile, grp_fu_700_p4, "grp_fu_700_p4"); sc_trace(mVcdFile, grp_fu_710_p4, "grp_fu_710_p4"); sc_trace(mVcdFile, grp_fu_720_p4, "grp_fu_720_p4"); sc_trace(mVcdFile, grp_fu_730_p4, "grp_fu_730_p4"); sc_trace(mVcdFile, grp_fu_740_p4, "grp_fu_740_p4"); sc_trace(mVcdFile, grp_fu_750_p4, "grp_fu_750_p4"); sc_trace(mVcdFile, trunc_ln35_fu_888_p1, "trunc_ln35_fu_888_p1"); sc_trace(mVcdFile, ap_CS_fsm_state5, "ap_CS_fsm_state5"); sc_trace(mVcdFile, ap_NS_fsm, "ap_NS_fsm"); #endif } } load_cifm_data::~load_cifm_data() { if (mVcdFile) sc_close_vcd_trace_file(mVcdFile); } void load_cifm_data::thread_ap_clk_no_reset_() { if ( ap_rst.read() == ap_const_logic_1) { ap_CS_fsm = ap_ST_fsm_state1; } else { ap_CS_fsm = ap_NS_fsm.read(); } if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { cifm_counter_0_reg_588 = j_fu_766_p2.read(); } else if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state1.read()) && esl_seteq<1,1,1>(ap_start.read(), ap_const_logic_1))) { cifm_counter_0_reg_588 = ap_const_lv6_0; } if (esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state3.read())) { j1_0_reg_599 = ap_const_lv6_0; } else if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { j1_0_reg_599 = j_1_fu_882_p2.read(); } } void load_cifm_data::thread_ap_CS_fsm_state1() { ap_CS_fsm_state1 = ap_CS_fsm.read()[0]; } void load_cifm_data::thread_ap_CS_fsm_state2() { ap_CS_fsm_state2 = ap_CS_fsm.read()[1]; } void load_cifm_data::thread_ap_CS_fsm_state3() { ap_CS_fsm_state3 = ap_CS_fsm.read()[2]; } void load_cifm_data::thread_ap_CS_fsm_state4() { ap_CS_fsm_state4 = ap_CS_fsm.read()[3]; } void load_cifm_data::thread_ap_CS_fsm_state5() { ap_CS_fsm_state5 = ap_CS_fsm.read()[4]; } void load_cifm_data::thread_ap_block_state2() { ap_block_state2 = (esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())); } void load_cifm_data::thread_ap_block_state4() { ap_block_state4 = (esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())); } void load_cifm_data::thread_ap_done() { if (((esl_seteq<1,1,1>(ap_const_logic_0, ap_start.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state1.read())) || esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state5.read()))) { ap_done = ap_const_logic_1; } else { ap_done = ap_const_logic_0; } } void load_cifm_data::thread_ap_idle() { if ((esl_seteq<1,1,1>(ap_const_logic_0, ap_start.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state1.read()))) { ap_idle = ap_const_logic_1; } else { ap_idle = ap_const_logic_0; } } void load_cifm_data::thread_ap_ready() { if (esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state5.read())) { ap_ready = ap_const_logic_1; } else { ap_ready = ap_const_logic_0; } } void load_cifm_data::thread_cifm_TDATA_blk_n() { if (((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read())))) { cifm_TDATA_blk_n = cifm_TVALID.read(); } else { cifm_TDATA_blk_n = ap_const_logic_1; } } void load_cifm_data::thread_cifm_TREADY() { if (((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read()))) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read()))))) { cifm_TREADY = ap_const_logic_1; } else { cifm_TREADY = ap_const_logic_0; } } void load_cifm_data::thread_grp_fu_610_p4() { grp_fu_610_p4 = cifm_TDATA.read().range(63, 32); } void load_cifm_data::thread_grp_fu_620_p4() { grp_fu_620_p4 = cifm_TDATA.read().range(95, 64); } void load_cifm_data::thread_grp_fu_630_p4() { grp_fu_630_p4 = cifm_TDATA.read().range(127, 96); } void load_cifm_data::thread_grp_fu_640_p4() { grp_fu_640_p4 = cifm_TDATA.read().range(159, 128); } void load_cifm_data::thread_grp_fu_650_p4() { grp_fu_650_p4 = cifm_TDATA.read().range(191, 160); } void load_cifm_data::thread_grp_fu_660_p4() { grp_fu_660_p4 = cifm_TDATA.read().range(223, 192); } void load_cifm_data::thread_grp_fu_670_p4() { grp_fu_670_p4 = cifm_TDATA.read().range(255, 224); } void load_cifm_data::thread_grp_fu_680_p4() { grp_fu_680_p4 = cifm_TDATA.read().range(287, 256); } void load_cifm_data::thread_grp_fu_690_p4() { grp_fu_690_p4 = cifm_TDATA.read().range(319, 288); } void load_cifm_data::thread_grp_fu_700_p4() { grp_fu_700_p4 = cifm_TDATA.read().range(351, 320); } void load_cifm_data::thread_grp_fu_710_p4() { grp_fu_710_p4 = cifm_TDATA.read().range(383, 352); } void load_cifm_data::thread_grp_fu_720_p4() { grp_fu_720_p4 = cifm_TDATA.read().range(415, 384); } void load_cifm_data::thread_grp_fu_730_p4() { grp_fu_730_p4 = cifm_TDATA.read().range(447, 416); } void load_cifm_data::thread_grp_fu_740_p4() { grp_fu_740_p4 = cifm_TDATA.read().range(479, 448); } void load_cifm_data::thread_grp_fu_750_p4() { grp_fu_750_p4 = cifm_TDATA.read().range(511, 480); } void load_cifm_data::thread_icmp_ln32_fu_876_p2() { icmp_ln32_fu_876_p2 = (!j1_0_reg_599.read().is_01() || !ap_const_lv6_3A.is_01())? sc_lv<1>(): sc_lv<1>(j1_0_reg_599.read() == ap_const_lv6_3A); } void load_cifm_data::thread_icmp_ln9_fu_760_p2() { icmp_ln9_fu_760_p2 = (!cifm_counter_0_reg_588.read().is_01() || !ap_const_lv6_3A.is_01())? sc_lv<1>(): sc_lv<1>(cifm_counter_0_reg_588.read() == ap_const_lv6_3A); } void load_cifm_data::thread_ifm_buff0_0_address0() { ifm_buff0_0_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_0_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_0_ce0 = ap_const_logic_1; } else { ifm_buff0_0_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_0_d0() { ifm_buff0_0_d0 = trunc_ln12_fu_792_p1.read(); } void load_cifm_data::thread_ifm_buff0_0_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_0_we0 = ap_const_logic_1; } else { ifm_buff0_0_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_10_address0() { ifm_buff0_10_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_10_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_10_ce0 = ap_const_logic_1; } else { ifm_buff0_10_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_10_d0() { ifm_buff0_10_d0 = grp_fu_700_p4.read(); } void load_cifm_data::thread_ifm_buff0_10_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_10_we0 = ap_const_logic_1; } else { ifm_buff0_10_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_11_address0() { ifm_buff0_11_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_11_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_11_ce0 = ap_const_logic_1; } else { ifm_buff0_11_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_11_d0() { ifm_buff0_11_d0 = grp_fu_710_p4.read(); } void load_cifm_data::thread_ifm_buff0_11_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_11_we0 = ap_const_logic_1; } else { ifm_buff0_11_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_12_address0() { ifm_buff0_12_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_12_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_12_ce0 = ap_const_logic_1; } else { ifm_buff0_12_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_12_d0() { ifm_buff0_12_d0 = grp_fu_720_p4.read(); } void load_cifm_data::thread_ifm_buff0_12_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_12_we0 = ap_const_logic_1; } else { ifm_buff0_12_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_13_address0() { ifm_buff0_13_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_13_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_13_ce0 = ap_const_logic_1; } else { ifm_buff0_13_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_13_d0() { ifm_buff0_13_d0 = grp_fu_730_p4.read(); } void load_cifm_data::thread_ifm_buff0_13_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_13_we0 = ap_const_logic_1; } else { ifm_buff0_13_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_14_address0() { ifm_buff0_14_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_14_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_14_ce0 = ap_const_logic_1; } else { ifm_buff0_14_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_14_d0() { ifm_buff0_14_d0 = grp_fu_740_p4.read(); } void load_cifm_data::thread_ifm_buff0_14_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_14_we0 = ap_const_logic_1; } else { ifm_buff0_14_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_15_address0() { ifm_buff0_15_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_15_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_15_ce0 = ap_const_logic_1; } else { ifm_buff0_15_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_15_d0() { ifm_buff0_15_d0 = grp_fu_750_p4.read(); } void load_cifm_data::thread_ifm_buff0_15_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_15_we0 = ap_const_logic_1; } else { ifm_buff0_15_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_1_address0() { ifm_buff0_1_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_1_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_1_ce0 = ap_const_logic_1; } else { ifm_buff0_1_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_1_d0() { ifm_buff0_1_d0 = grp_fu_610_p4.read(); } void load_cifm_data::thread_ifm_buff0_1_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_1_we0 = ap_const_logic_1; } else { ifm_buff0_1_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_2_address0() { ifm_buff0_2_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_2_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_2_ce0 = ap_const_logic_1; } else { ifm_buff0_2_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_2_d0() { ifm_buff0_2_d0 = grp_fu_620_p4.read(); } void load_cifm_data::thread_ifm_buff0_2_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_2_we0 = ap_const_logic_1; } else { ifm_buff0_2_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_3_address0() { ifm_buff0_3_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_3_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_3_ce0 = ap_const_logic_1; } else { ifm_buff0_3_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_3_d0() { ifm_buff0_3_d0 = grp_fu_630_p4.read(); } void load_cifm_data::thread_ifm_buff0_3_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_3_we0 = ap_const_logic_1; } else { ifm_buff0_3_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_4_address0() { ifm_buff0_4_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_4_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_4_ce0 = ap_const_logic_1; } else { ifm_buff0_4_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_4_d0() { ifm_buff0_4_d0 = grp_fu_640_p4.read(); } void load_cifm_data::thread_ifm_buff0_4_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_4_we0 = ap_const_logic_1; } else { ifm_buff0_4_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_5_address0() { ifm_buff0_5_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_5_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_5_ce0 = ap_const_logic_1; } else { ifm_buff0_5_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_5_d0() { ifm_buff0_5_d0 = grp_fu_650_p4.read(); } void load_cifm_data::thread_ifm_buff0_5_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_5_we0 = ap_const_logic_1; } else { ifm_buff0_5_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_6_address0() { ifm_buff0_6_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_6_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_6_ce0 = ap_const_logic_1; } else { ifm_buff0_6_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_6_d0() { ifm_buff0_6_d0 = grp_fu_660_p4.read(); } void load_cifm_data::thread_ifm_buff0_6_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_6_we0 = ap_const_logic_1; } else { ifm_buff0_6_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_7_address0() { ifm_buff0_7_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_7_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_7_ce0 = ap_const_logic_1; } else { ifm_buff0_7_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_7_d0() { ifm_buff0_7_d0 = grp_fu_670_p4.read(); } void load_cifm_data::thread_ifm_buff0_7_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_7_we0 = ap_const_logic_1; } else { ifm_buff0_7_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_8_address0() { ifm_buff0_8_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_8_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_8_ce0 = ap_const_logic_1; } else { ifm_buff0_8_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_8_d0() { ifm_buff0_8_d0 = grp_fu_680_p4.read(); } void load_cifm_data::thread_ifm_buff0_8_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_8_we0 = ap_const_logic_1; } else { ifm_buff0_8_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_9_address0() { ifm_buff0_9_address0 = (sc_lv<6>) (zext_ln12_fu_772_p1.read()); } void load_cifm_data::thread_ifm_buff0_9_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_9_ce0 = ap_const_logic_1; } else { ifm_buff0_9_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff0_9_d0() { ifm_buff0_9_d0 = grp_fu_690_p4.read(); } void load_cifm_data::thread_ifm_buff0_9_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff0_9_we0 = ap_const_logic_1; } else { ifm_buff0_9_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_0_address0() { ifm_buff1_0_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_0_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_0_ce0 = ap_const_logic_1; } else { ifm_buff1_0_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_0_d0() { ifm_buff1_0_d0 = trunc_ln35_fu_888_p1.read(); } void load_cifm_data::thread_ifm_buff1_0_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_0_we0 = ap_const_logic_1; } else { ifm_buff1_0_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_10_address0() { ifm_buff1_10_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_10_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_10_ce0 = ap_const_logic_1; } else { ifm_buff1_10_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_10_d0() { ifm_buff1_10_d0 = grp_fu_700_p4.read(); } void load_cifm_data::thread_ifm_buff1_10_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_10_we0 = ap_const_logic_1; } else { ifm_buff1_10_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_11_address0() { ifm_buff1_11_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_11_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_11_ce0 = ap_const_logic_1; } else { ifm_buff1_11_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_11_d0() { ifm_buff1_11_d0 = grp_fu_710_p4.read(); } void load_cifm_data::thread_ifm_buff1_11_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_11_we0 = ap_const_logic_1; } else { ifm_buff1_11_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_12_address0() { ifm_buff1_12_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_12_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_12_ce0 = ap_const_logic_1; } else { ifm_buff1_12_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_12_d0() { ifm_buff1_12_d0 = grp_fu_720_p4.read(); } void load_cifm_data::thread_ifm_buff1_12_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_12_we0 = ap_const_logic_1; } else { ifm_buff1_12_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_13_address0() { ifm_buff1_13_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_13_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_13_ce0 = ap_const_logic_1; } else { ifm_buff1_13_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_13_d0() { ifm_buff1_13_d0 = grp_fu_730_p4.read(); } void load_cifm_data::thread_ifm_buff1_13_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_13_we0 = ap_const_logic_1; } else { ifm_buff1_13_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_14_address0() { ifm_buff1_14_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_14_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_14_ce0 = ap_const_logic_1; } else { ifm_buff1_14_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_14_d0() { ifm_buff1_14_d0 = grp_fu_740_p4.read(); } void load_cifm_data::thread_ifm_buff1_14_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_14_we0 = ap_const_logic_1; } else { ifm_buff1_14_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_15_address0() { ifm_buff1_15_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_15_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_15_ce0 = ap_const_logic_1; } else { ifm_buff1_15_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_15_d0() { ifm_buff1_15_d0 = grp_fu_750_p4.read(); } void load_cifm_data::thread_ifm_buff1_15_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_15_we0 = ap_const_logic_1; } else { ifm_buff1_15_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_1_address0() { ifm_buff1_1_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_1_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_1_ce0 = ap_const_logic_1; } else { ifm_buff1_1_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_1_d0() { ifm_buff1_1_d0 = grp_fu_610_p4.read(); } void load_cifm_data::thread_ifm_buff1_1_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_1_we0 = ap_const_logic_1; } else { ifm_buff1_1_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_2_address0() { ifm_buff1_2_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_2_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_2_ce0 = ap_const_logic_1; } else { ifm_buff1_2_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_2_d0() { ifm_buff1_2_d0 = grp_fu_620_p4.read(); } void load_cifm_data::thread_ifm_buff1_2_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_2_we0 = ap_const_logic_1; } else { ifm_buff1_2_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_3_address0() { ifm_buff1_3_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_3_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_3_ce0 = ap_const_logic_1; } else { ifm_buff1_3_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_3_d0() { ifm_buff1_3_d0 = grp_fu_630_p4.read(); } void load_cifm_data::thread_ifm_buff1_3_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_3_we0 = ap_const_logic_1; } else { ifm_buff1_3_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_4_address0() { ifm_buff1_4_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_4_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_4_ce0 = ap_const_logic_1; } else { ifm_buff1_4_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_4_d0() { ifm_buff1_4_d0 = grp_fu_640_p4.read(); } void load_cifm_data::thread_ifm_buff1_4_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_4_we0 = ap_const_logic_1; } else { ifm_buff1_4_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_5_address0() { ifm_buff1_5_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_5_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_5_ce0 = ap_const_logic_1; } else { ifm_buff1_5_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_5_d0() { ifm_buff1_5_d0 = grp_fu_650_p4.read(); } void load_cifm_data::thread_ifm_buff1_5_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_5_we0 = ap_const_logic_1; } else { ifm_buff1_5_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_6_address0() { ifm_buff1_6_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_6_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_6_ce0 = ap_const_logic_1; } else { ifm_buff1_6_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_6_d0() { ifm_buff1_6_d0 = grp_fu_660_p4.read(); } void load_cifm_data::thread_ifm_buff1_6_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_6_we0 = ap_const_logic_1; } else { ifm_buff1_6_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_7_address0() { ifm_buff1_7_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_7_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_7_ce0 = ap_const_logic_1; } else { ifm_buff1_7_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_7_d0() { ifm_buff1_7_d0 = grp_fu_670_p4.read(); } void load_cifm_data::thread_ifm_buff1_7_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_7_we0 = ap_const_logic_1; } else { ifm_buff1_7_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_8_address0() { ifm_buff1_8_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_8_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_8_ce0 = ap_const_logic_1; } else { ifm_buff1_8_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_8_d0() { ifm_buff1_8_d0 = grp_fu_680_p4.read(); } void load_cifm_data::thread_ifm_buff1_8_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_8_we0 = ap_const_logic_1; } else { ifm_buff1_8_we0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_9_address0() { ifm_buff1_9_address0 = (sc_lv<6>) (zext_ln35_fu_897_p1.read()); } void load_cifm_data::thread_ifm_buff1_9_ce0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_9_ce0 = ap_const_logic_1; } else { ifm_buff1_9_ce0 = ap_const_logic_0; } } void load_cifm_data::thread_ifm_buff1_9_d0() { ifm_buff1_9_d0 = grp_fu_690_p4.read(); } void load_cifm_data::thread_ifm_buff1_9_we0() { if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ifm_buff1_9_we0 = ap_const_logic_1; } else { ifm_buff1_9_we0 = ap_const_logic_0; } } void load_cifm_data::thread_j_1_fu_882_p2() { j_1_fu_882_p2 = (!j1_0_reg_599.read().is_01() || !ap_const_lv6_1.is_01())? sc_lv<6>(): (sc_biguint<6>(j1_0_reg_599.read()) + sc_biguint<6>(ap_const_lv6_1)); } void load_cifm_data::thread_j_fu_766_p2() { j_fu_766_p2 = (!cifm_counter_0_reg_588.read().is_01() || !ap_const_lv6_1.is_01())? sc_lv<6>(): (sc_biguint<6>(cifm_counter_0_reg_588.read()) + sc_biguint<6>(ap_const_lv6_1)); } void load_cifm_data::thread_trunc_ln12_fu_792_p1() { trunc_ln12_fu_792_p1 = cifm_TDATA.read().range(32-1, 0); } void load_cifm_data::thread_trunc_ln35_fu_888_p1() { trunc_ln35_fu_888_p1 = cifm_TDATA.read().range(32-1, 0); } void load_cifm_data::thread_zext_ln12_fu_772_p1() { zext_ln12_fu_772_p1 = esl_zext<64,6>(cifm_counter_0_reg_588.read()); } void load_cifm_data::thread_zext_ln35_fu_897_p1() { zext_ln35_fu_897_p1 = esl_zext<64,6>(j1_0_reg_599.read()); } void load_cifm_data::thread_ap_NS_fsm() { switch (ap_CS_fsm.read().to_uint64()) { case 1 : if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state1.read()) && esl_seteq<1,1,1>(ap_start.read(), ap_const_logic_1))) { ap_NS_fsm = ap_ST_fsm_state2; } else { ap_NS_fsm = ap_ST_fsm_state1; } break; case 2 : if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ap_NS_fsm = ap_ST_fsm_state2; } else if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())) && esl_seteq<1,1,1>(icmp_ln9_fu_760_p2.read(), ap_const_lv1_1))) { ap_NS_fsm = ap_ST_fsm_state3; } else { ap_NS_fsm = ap_ST_fsm_state2; } break; case 4 : ap_NS_fsm = ap_ST_fsm_state4; break; case 8 : if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) { ap_NS_fsm = ap_ST_fsm_state4; } else if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state4.read()) && !(esl_seteq<1,1,1>(ap_const_lv1_0, icmp_ln32_fu_876_p2.read()) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())) && esl_seteq<1,1,1>(icmp_ln32_fu_876_p2.read(), ap_const_lv1_1))) { ap_NS_fsm = ap_ST_fsm_state5; } else { ap_NS_fsm = ap_ST_fsm_state4; } break; case 16 : ap_NS_fsm = ap_ST_fsm_state1; break; default : ap_NS_fsm = "XXXXX"; break; } } }
[ "es921088@gmail.com" ]
es921088@gmail.com
6f2b89a7db418741cc1e266e8f5e4f0081712dd7
de383bdb4ac00eafe3fe70d4a58f158dd082a98c
/src/AsteroidManager.cpp
4db041f2468cd8ade440481d23ff438601d0328a
[]
no_license
kenhoff/asteroids
3e9b93bd5884a4362ff3ce95962792eaaf3f3fd7
5da86600ebaf40cfc5032121d8c32b735868ec26
refs/heads/master
2016-09-06T13:01:00.198143
2014-10-12T00:15:33
2014-10-12T00:15:33
null
0
0
null
null
null
null
UTF-8
C++
false
false
870
cpp
#include "AsteroidManager.h" #include <vector> #include "asteroid.h" #include <iostream> void AsteroidManager::add_asteroid(asteroid* new_asteroid) { AsteroidVec.push_back(new_asteroid); } void AsteroidManager::delete_asteroid() { //return AsteroidVec.erase(deleted_asteroid); } void AsteroidManager::cull_asteroids() { std::vector<asteroid*>::iterator it; for (it = AsteroidVec.begin(); it != AsteroidVec.end(); it++) { a = *it; if ((a->life <= 0) || (a->size < 1)) { if (*it == *AsteroidVec.end()) { AsteroidVec.pop_back(); break; } else { it = AsteroidVec.erase(it); break; } } } } void AsteroidManager::draw_asteroids() { std::vector<asteroid*>::iterator it; for (it = AsteroidVec.begin(); it != AsteroidVec.end(); it++) { a = *it; a->draw(); } //std::cout << AsteroidVec.size() << std::endl; }
[ "thekenhoff@gmail.com" ]
thekenhoff@gmail.com
290954658837270db53b8c94740956847fe4af98
573a66e4f4753cc0f145de8d60340b4dd6206607
/JS-CS-Detection-byExample/Dataset (ALERT 5 GB)/362764/shogun-1.1.0/shogun-1.1.0/examples/undocumented/libshogun/modelselection_apply_parameter_tree.cpp
b60825205142c403bb96d6069afaa825f7b3d4fe
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
mkaouer/Code-Smells-Detection-in-JavaScript
3919ec0d445637a7f7c5f570c724082d42248e1b
7130351703e19347884f95ce6d6ab1fb4f5cfbff
refs/heads/master
2023-03-09T18:04:26.971934
2022-03-23T22:04:28
2022-03-23T22:04:28
73,915,037
8
3
null
2023-02-28T23:00:07
2016-11-16T11:47:44
null
UTF-8
C++
false
false
3,963
cpp
/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * Written (W) 2011 Heiko Strathmann * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society */ #include <shogun/base/init.h> #include <shogun/modelselection/ModelSelectionParameters.h> #include <shogun/modelselection/ParameterCombination.h> #include <shogun/kernel/GaussianKernel.h> #include <shogun/features/Labels.h> #include <shogun/features/SimpleFeatures.h> #include <shogun/classifier/svm/LibSVM.h> using namespace shogun; void print_message(FILE* target, const char* str) { fprintf(target, "%s", str); } CModelSelectionParameters* create_param_tree() { CModelSelectionParameters* root=new CModelSelectionParameters(); CModelSelectionParameters* c=new CModelSelectionParameters("C1"); root->append_child(c); c->build_values(1.0, 2.0, R_EXP); CGaussianKernel* gaussian_kernel=new CGaussianKernel(); CModelSelectionParameters* param_gaussian_kernel= new CModelSelectionParameters("kernel", gaussian_kernel); root->append_child(param_gaussian_kernel); CModelSelectionParameters* param_gaussian_kernel_width= new CModelSelectionParameters("width"); param_gaussian_kernel_width->build_values(1.0, 2.0, R_EXP); param_gaussian_kernel->append_child(param_gaussian_kernel_width); return root; } void apply_parameter_tree(CDynamicObjectArray<CParameterCombination>* combinations) { /* create some data */ float64_t* matrix=SG_MALLOC(float64_t, 6); for (index_t i=0; i<6; i++) matrix[i]=i; /* create three 2-dimensional vectors * to avoid deleting these, REF now and UNREF when finished */ CSimpleFeatures<float64_t>* features=new CSimpleFeatures<float64_t> (); SG_REF(features); features->set_feature_matrix(matrix, 2, 3); /* create three labels, will be handed to svm and automaticall deleted */ CLabels* labels=new CLabels(3); SG_REF(labels); labels->set_label(0, -1); labels->set_label(1, +1); labels->set_label(2, -1); /* create libsvm with C=10 and train */ CLibSVM* svm=new CLibSVM(); SG_REF(svm); svm->set_labels(labels); for (index_t i=0; i<combinations->get_num_elements(); ++i) { SG_SPRINT("applying:\n"); CParameterCombination* current_combination=combinations->get_element(i); current_combination->print_tree(); Parameter* current_parameters=svm->m_parameters; current_combination->apply_to_modsel_parameter(current_parameters); SG_UNREF(current_combination); /* get kernel to set features, get_kernel SG_REF's the kernel */ CKernel* kernel=svm->get_kernel(); kernel->init(features, features); svm->train(); /* classify on training examples */ for (index_t i=0; i<3; i++) SG_SPRINT("output[%d]=%f\n", i, svm->apply(i)); /* unset features and SG_UNREF kernel */ kernel->cleanup(); SG_UNREF(kernel); SG_SPRINT("----------------\n\n"); } /* free up memory */ SG_UNREF(features); SG_UNREF(labels); SG_UNREF(svm); } int main(int argc, char **argv) { init_shogun(&print_message, &print_message, &print_message); /* create example tree */ CModelSelectionParameters* tree=create_param_tree(); tree->print_tree(); SG_SPRINT("----------------------------------\n"); /* build combinations of parameter trees */ CDynamicObjectArray<CParameterCombination>* combinations=tree->get_combinations(); apply_parameter_tree(combinations); /* print and directly delete them all */ for (index_t i=0; i<combinations->get_num_elements(); ++i) { CParameterCombination* combination=combinations->get_element(i); SG_UNREF(combination); } SG_UNREF(combinations); /* delete example tree (after processing of combinations because CSGObject * (namely the kernel) of the tree is SG_UNREF'ed (and not REF'ed anywhere * else) */ SG_UNREF(tree); exit_shogun(); return 0; }
[ "mmkaouer@umich.edu" ]
mmkaouer@umich.edu
4add20a0bbe138ee2f7d7cb95e1de5e385ab62b9
9782706c86bae780f7f19626f26f5b3c053c2bf8
/toolsrc/src/vcpkg-test/binarycaching.cpp
cb0d7cb99d5d58495890b99088dde812958e2421
[ "MIT", "BSL-1.0" ]
permissive
peterbygrave/vcpkg
af59098cdddb60f7ac11edbd360595d32beb371c
4a8c4886efcc31761e7e58f111c061c1c3b74843
refs/heads/master
2021-01-26T00:39:09.325458
2020-12-03T10:37:38
2020-12-03T10:37:38
243,243,465
1
0
NOASSERTION
2020-02-26T11:11:43
2020-02-26T11:11:42
null
UTF-8
C++
false
false
10,739
cpp
#include <catch2/catch.hpp> #include <vcpkg/base/files.h> #include <vcpkg/binarycaching.h> #include <vcpkg/binarycaching.private.h> #include <vcpkg/dependencies.h> #include <vcpkg/paragraphs.h> #include <vcpkg/sourceparagraph.h> #include <vcpkg/vcpkgcmdarguments.h> #include <string> #include <vcpkg-test/util.h> using namespace vcpkg; #define REQUIRE_EQUAL_TEXT(lhs, rhs) \ { \ auto lhs_lines = Strings::split((lhs), '\n'); \ auto rhs_lines = Strings::split((rhs), '\n'); \ for (size_t i = 0; i < lhs_lines.size() && i < rhs_lines.size(); ++i) \ { \ INFO("on line: " << i); \ REQUIRE(lhs_lines[i] == rhs_lines[i]); \ } \ REQUIRE(lhs_lines.size() == rhs_lines.size()); \ } TEST_CASE ("reformat_version semver-ish", "[reformat_version]") { REQUIRE(reformat_version("0.0.0", "abitag") == "0.0.0-abitag"); REQUIRE(reformat_version("1.0.1", "abitag") == "1.0.1-abitag"); REQUIRE(reformat_version("1.01.000", "abitag") == "1.1.0-abitag"); REQUIRE(reformat_version("1.2", "abitag") == "1.2.0-abitag"); REQUIRE(reformat_version("v52", "abitag") == "52.0.0-abitag"); REQUIRE(reformat_version("v09.01.02", "abitag") == "9.1.2-abitag"); REQUIRE(reformat_version("1.1.1q", "abitag") == "1.1.1-abitag"); REQUIRE(reformat_version("1", "abitag") == "1.0.0-abitag"); } TEST_CASE ("reformat_version date", "[reformat_version]") { REQUIRE(reformat_version("2020-06-26", "abitag") == "2020.6.26-abitag"); REQUIRE(reformat_version("20-06-26", "abitag") == "0.0.0-abitag"); REQUIRE(reformat_version("2020-06-26-release", "abitag") == "2020.6.26-abitag"); REQUIRE(reformat_version("2020-06-26000", "abitag") == "2020.6.26-abitag"); } TEST_CASE ("reformat_version generic", "[reformat_version]") { REQUIRE(reformat_version("apr", "abitag") == "0.0.0-abitag"); REQUIRE(reformat_version("", "abitag") == "0.0.0-abitag"); } TEST_CASE ("generate_nuspec", "[generate_nuspec]") { auto& fsWrapper = Files::get_real_filesystem(); VcpkgCmdArguments args = VcpkgCmdArguments::create_from_arg_sequence(nullptr, nullptr); args.packages_root_dir = std::make_unique<std::string>("/"); VcpkgPaths paths(fsWrapper, args); auto pghs = Paragraphs::parse_paragraphs(R"( Source: zlib2 Version: 1.5 Build-Depends: zlib Description: a spiffy compression library wrapper Feature: a Description: a feature Feature: b Description: enable bzip capabilities Build-Depends: bzip )", "<testdata>"); REQUIRE(pghs.has_value()); auto maybe_scf = SourceControlFile::parse_control_file(fs::u8string(fs::path()), std::move(*pghs.get())); REQUIRE(maybe_scf.has_value()); SourceControlFileLocation scfl{std::move(*maybe_scf.get()), fs::path()}; Dependencies::InstallPlanAction ipa(PackageSpec{"zlib2", Test::X64_WINDOWS}, scfl, Dependencies::RequestType::USER_REQUESTED, {{"a", {}}, {"b", {}}}); ipa.abi_info = Build::AbiInfo{}; ipa.abi_info.get()->package_abi = "packageabi"; std::string tripletabi("tripletabi"); ipa.abi_info.get()->triplet_abi = tripletabi; Build::CompilerInfo compiler_info; compiler_info.hash = "compilerhash"; compiler_info.id = "compilerid"; compiler_info.version = "compilerversion"; ipa.abi_info.get()->compiler_info = compiler_info; NugetReference ref(ipa); REQUIRE(ref.nupkg_filename() == "zlib2_x64-windows.1.5.0-packageabi.nupkg"); { auto nuspec = generate_nuspec(paths, ipa, ref, {}); #ifdef _WIN32 #define PKGPATH "C:\\zlib2_x64-windows\\**" #else #define PKGPATH "/zlib2_x64-windows/**" #endif std::string expected = R"(<package> <metadata> <id>zlib2_x64-windows</id> <version>1.5.0-packageabi</version> <authors>vcpkg</authors> <description>NOT FOR DIRECT USE. Automatically generated cache package. a spiffy compression library wrapper Version: 1.5 Triplet: x64-windows CXX Compiler id: compilerid CXX Compiler version: compilerversion Triplet/Compiler hash: tripletabi Features: a, b Dependencies: </description> <packageTypes><packageType name="vcpkg"/></packageTypes> </metadata> <files><file src=")" PKGPATH R"(" target=""/></files> </package> )"; REQUIRE_EQUAL_TEXT(nuspec, expected); } { auto nuspec = generate_nuspec(paths, ipa, ref, {"urlvalue"}); #ifdef _WIN32 #define PKGPATH "C:\\zlib2_x64-windows\\**" #else #define PKGPATH "/zlib2_x64-windows/**" #endif std::string expected = R"(<package> <metadata> <id>zlib2_x64-windows</id> <version>1.5.0-packageabi</version> <authors>vcpkg</authors> <description>NOT FOR DIRECT USE. Automatically generated cache package. a spiffy compression library wrapper Version: 1.5 Triplet: x64-windows CXX Compiler id: compilerid CXX Compiler version: compilerversion Triplet/Compiler hash: tripletabi Features: a, b Dependencies: </description> <packageTypes><packageType name="vcpkg"/></packageTypes> <repository type="git" url="urlvalue"/> </metadata> <files><file src=")" PKGPATH R"(" target=""/></files> </package> )"; REQUIRE_EQUAL_TEXT(nuspec, expected); } { auto nuspec = generate_nuspec(paths, ipa, ref, {"urlvalue", "branchvalue", "commitvalue"}); #ifdef _WIN32 #define PKGPATH "C:\\zlib2_x64-windows\\**" #else #define PKGPATH "/zlib2_x64-windows/**" #endif std::string expected = R"(<package> <metadata> <id>zlib2_x64-windows</id> <version>1.5.0-packageabi</version> <authors>vcpkg</authors> <description>NOT FOR DIRECT USE. Automatically generated cache package. a spiffy compression library wrapper Version: 1.5 Triplet: x64-windows CXX Compiler id: compilerid CXX Compiler version: compilerversion Triplet/Compiler hash: tripletabi Features: a, b Dependencies: </description> <packageTypes><packageType name="vcpkg"/></packageTypes> <repository type="git" url="urlvalue" branch="branchvalue" commit="commitvalue"/> </metadata> <files><file src=")" PKGPATH R"(" target=""/></files> </package> )"; REQUIRE_EQUAL_TEXT(nuspec, expected); } } TEST_CASE ("XmlSerializer", "[XmlSerializer]") { XmlSerializer xml; xml.open_tag("a"); xml.open_tag("b"); xml.simple_tag("c", "d"); xml.close_tag("b"); xml.text("escaping: & < > \" '"); REQUIRE(xml.buf == R"(<a><b><c>d</c></b>escaping: &amp; &lt; &gt; &quot; &apos;)"); xml = XmlSerializer(); xml.emit_declaration(); xml.start_complex_open_tag("a") .text_attr("b", "<") .text_attr("c", " ") .finish_self_closing_complex_tag() .line_break(); xml.simple_tag("d", "e"); REQUIRE(xml.buf == R"(<?xml version="1.0" encoding="utf-8"?><a b="&lt;" c=" "/>)" "\n<d>e</d>"); xml = XmlSerializer(); xml.start_complex_open_tag("a").finish_complex_open_tag(); REQUIRE(xml.buf == R"(<a>)"); xml = XmlSerializer(); xml.line_break(); xml.open_tag("a").line_break().line_break(); xml.close_tag("a").line_break().line_break(); REQUIRE(xml.buf == "\n<a>\n\n</a>\n\n"); xml = XmlSerializer(); xml.start_complex_open_tag("a") .text_attr("b", "<") .line_break() .text_attr("c", " ") .finish_complex_open_tag() .line_break(); xml.simple_tag("d", "e").line_break(); REQUIRE(xml.buf == "<a b=\"&lt;\"\n c=\" \">\n <d>e</d>\n"); } TEST_CASE ("generate_nuget_packages_config", "[generate_nuget_packages_config]") { Dependencies::ActionPlan plan; auto packageconfig = generate_nuget_packages_config(plan); REQUIRE(packageconfig == R"(<?xml version="1.0" encoding="utf-8"?> <packages> </packages> )"); auto pghs = Paragraphs::parse_paragraphs(R"( Source: zlib Version: 1.5 Description: a spiffy compression library wrapper )", "<testdata>"); REQUIRE(pghs.has_value()); auto maybe_scf = SourceControlFile::parse_control_file(fs::u8string(fs::path()), std::move(*pghs.get())); REQUIRE(maybe_scf.has_value()); SourceControlFileLocation scfl{std::move(*maybe_scf.get()), fs::path()}; plan.install_actions.push_back(Dependencies::InstallPlanAction()); plan.install_actions[0].spec = PackageSpec("zlib", Test::X64_ANDROID); plan.install_actions[0].source_control_file_location = scfl; plan.install_actions[0].abi_info = Build::AbiInfo{}; plan.install_actions[0].abi_info.get()->package_abi = "packageabi"; packageconfig = generate_nuget_packages_config(plan); REQUIRE(packageconfig == R"(<?xml version="1.0" encoding="utf-8"?> <packages> <package id="zlib_x64-android" version="1.5.0-packageabi"/> </packages> )"); auto pghs2 = Paragraphs::parse_paragraphs(R"( Source: zlib2 Version: 1.52 Description: a spiffy compression library wrapper )", "<testdata>"); REQUIRE(pghs2.has_value()); auto maybe_scf2 = SourceControlFile::parse_control_file(fs::u8string(fs::path()), std::move(*pghs2.get())); REQUIRE(maybe_scf2.has_value()); SourceControlFileLocation scfl2{std::move(*maybe_scf2.get()), fs::path()}; plan.install_actions.push_back(Dependencies::InstallPlanAction()); plan.install_actions[1].spec = PackageSpec("zlib2", Test::X64_ANDROID); plan.install_actions[1].source_control_file_location = scfl2; plan.install_actions[1].abi_info = Build::AbiInfo{}; plan.install_actions[1].abi_info.get()->package_abi = "packageabi2"; packageconfig = generate_nuget_packages_config(plan); REQUIRE(packageconfig == R"(<?xml version="1.0" encoding="utf-8"?> <packages> <package id="zlib_x64-android" version="1.5.0-packageabi"/> <package id="zlib2_x64-android" version="1.52.0-packageabi2"/> </packages> )"); }
[ "noreply@github.com" ]
noreply@github.com
5354427331f02775e06b565d40580435fdfa0cf4
18e4b5ca2d2d0b98f2aa1611766ffcebd6ff1007
/D1-Arrays/leetcode_medium/lc119.cpp
b54582b64f90f4466e1e010fdbf6274c4e098056
[]
no_license
webdeveloper13/Leetcode_practiceForSDE
3cb4b2575825ced624daa13b0cd7a46a536cb88a
04131f2bcf9cf4dd946419275a47e937472d0757
refs/heads/master
2023-08-23T06:53:26.743144
2021-10-13T15:04:23
2021-10-13T15:04:23
274,382,785
3
1
null
null
null
null
UTF-8
C++
false
false
862
cpp
/*119. Pascal's Triangle II Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle. Note that the row index starts from 0. In Pascal's triangle, each number is the sum of the two numbers directly above it. Example: Input: 3 Output: [1,3,3,1] Follow up: Could you optimize your algorithm to use only O(k) extra space? */ auto i1 = []() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); return 0; } (); class Solution { public: vector<int> getRow(int rowIndex) { vector<int> pas(rowIndex+1,0); pas[0] = 1; for(int i=1;i<rowIndex+1;i++) { for(int j=i;j>=1;j--) pas[j] += pas[j-1]; } return pas; } };
[ "suryanshsharma132@gmail.com" ]
suryanshsharma132@gmail.com
553eefaa781ebe463f4a829dd581cf31d3ac7709
225e82d7a70bfeb544d758c4a01321701ff06a61
/root/root_v4.04.02g/geom/src/TGeoPolygon.cxx
f0b704e4cbaca297a1656906c742c5295c4a5125
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
govoni/learn
9760494d592ba09a98e08939818415857d015371
cb02b6621af73efdbf1e64e5fc39ecd9e72516af
refs/heads/master
2021-01-19T18:51:14.476573
2019-07-22T09:05:26
2019-07-22T09:05:26
101,170,943
0
0
null
null
null
null
UTF-8
C++
false
false
10,574
cxx
// @(#)root/geom:$Name: v4-04-02g $:$Id: TGeoPolygon.cxx,v 1.3 2004/04/22 14:07:14 brun Exp $ // Author: Mihaela Gheata 5/01/04 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ //____________________________________________________________________________ // TGeoPolygon - Arbitrary polygon class //____________________________________________________________________________ // // A polygon is a 2D shape defined by vertices in the XY plane. It is used by // TGeoXtru class for computing Contains() and Safety(). Only the pointers to // the actual lists of XY values are used - these are not owned by the class. // // To check if a point in XY plane is contained by a polygon, this is splitted // into an outscribed convex polygon and the remaining polygons of its subtracton // from the outscribed one. A point is INSIDE if it is // contained by the outscribed polygon but NOT by the remaining ones. Since these // can also be arbitrary polygons at their turn, a tree structure is formed: // // P = Pconvex - (Pconvex-P) where (-) means 'subtraction' // Pconvex-P = P1 + P2 + ... where (+) means 'union' // // *Note that P1, P2, ... do not intersect each other and they are defined // by subsets of the list of vertices of P. They can be splitted in the same // way as P* // // Therefore, if C(P) represents the Boolean : 'does P contains a given point?', // then: // // C(P) = C(Pconvex) .and. not(C(P1) | C(P2) | ...) // // For creating a polygon without TGeoXtru class, one has to call the constructor // TGeoPolygon(nvert) and then SetXY(Double_t *x, Double_t *y) providing the // arrays of X and Y vertex positions (defined clockwise) that have to 'live' longer // than the polygon they will describe. This complication is due to efficiency reasons. // At the end one has to call the FinishPolygon() method. #include "TObjArray.h" #include "TGeoPolygon.h" ClassImp(TGeoPolygon) //_____________________________________________________________________________ TGeoPolygon::TGeoPolygon() { // Dummy constructor. fNvert = 0; fNconvex = 0; fInd = 0; fIndc = 0; fX = 0; fY = 0; fDaughters = 0; SetConvex(kFALSE); TObject::SetBit(kGeoFinishPolygon, kFALSE); } //_____________________________________________________________________________ TGeoPolygon::TGeoPolygon(Int_t nvert) { // Default constructor. if (nvert<3) { Fatal("Ctor", "Invalid number of vertices %i", nvert); return; } fNvert = nvert; fNconvex = 0; fInd = new Int_t[nvert]; fIndc = 0; fX = 0; fY = 0; fDaughters = 0; SetConvex(kFALSE); TObject::SetBit(kGeoFinishPolygon, kFALSE); SetNextIndex(); // printf("=== Polygon with %i vertices\n", fNvert); } //_____________________________________________________________________________ TGeoPolygon::~TGeoPolygon() { // Destructor if (fInd) delete [] fInd; if (fIndc) delete [] fIndc; if (fDaughters) { fDaughters->Delete(); delete fDaughters; } } //_____________________________________________________________________________ Bool_t TGeoPolygon::Contains(Double_t *point) const { // Check if a point given by X = point[0], Y = point[1] is inside the polygon. Int_t i; TGeoPolygon *poly; for (i=0; i<fNconvex; i++) if (!IsRightSided(point, fIndc[i], fIndc[(i+1)%fNconvex])) return kFALSE; if (!fDaughters) return kTRUE; Int_t nd = fDaughters->GetEntriesFast(); for (i=0; i<nd; i++) { poly = (TGeoPolygon*)fDaughters->UncheckedAt(i); if (poly->Contains(point)) return kFALSE; } return kTRUE; } //_____________________________________________________________________________ void TGeoPolygon::ConvexCheck() { // Check polygon convexity. if (fNvert==3) { SetConvex(); return; } Int_t j,k; Double_t point[2]; for (Int_t i=0; i<fNvert; i++) { j = (i+1)%fNvert; k = (i+2)%fNvert; point[0] = fX[fInd[k]]; point[1] = fY[fInd[k]]; if (!IsRightSided(point, fInd[i], fInd[j])) return; } SetConvex(); } //_____________________________________________________________________________ void TGeoPolygon::FinishPolygon() { TObject::SetBit(kGeoFinishPolygon); // check convexity ConvexCheck(); // find outscribed convex polygon indices OutscribedConvex(); if (IsConvex()) { // printf(" -> polygon convex -> same indices\n"); memcpy(fIndc, fInd, fNvert*sizeof(Int_t)); return; } // printf(" -> polygon NOT convex\n"); // printf("Convex indices:\n"); // for (Int_t i=0; i<fNconvex; i++) printf(" %i ",fInd[fIndc[i]]); // printf("\n"); // make daughters if necessary if (IsConvex()) return; // ... algorithm here if (!fDaughters) fDaughters = new TObjArray(); TGeoPolygon *poly = 0; Int_t indconv = 0; Int_t indnext, indback; Int_t nskip; while (indconv < fNconvex) { indnext = (indconv+1)%fNconvex; nskip = fIndc[indnext]-fIndc[indconv]; if (nskip<0) nskip+=fNvert; if (nskip==1) { indconv++; continue; } // gap -> make polygon // printf(" making daughter with %i vertices\n", nskip+1); poly = new TGeoPolygon(nskip+1); poly->SetXY(fX,fY); poly->SetNextIndex(fInd[fIndc[indconv]]); poly->SetNextIndex(fInd[fIndc[indnext]]); indback = fIndc[indnext]-1; if (indback < 0) indback+=fNvert; while (indback != fIndc[indconv]) { poly->SetNextIndex(fInd[indback]); indback--; if (indback < 0) indback+=fNvert; } poly->FinishPolygon(); fDaughters->Add(poly); indconv++; } for (indconv=0; indconv<fNconvex; indconv++) fIndc[indconv] = fInd[fIndc[indconv]]; } //_____________________________________________________________________________ Bool_t TGeoPolygon::IsRightSided(Double_t *point, Int_t ind1, Int_t ind2) const { // Check if POINT is right-sided with respect to the segment defined by IND1 and IND2. Double_t dot = (point[0]-fX[ind1])*(fY[ind2]-fY[ind1]) - (point[1]-fY[ind1])*(fX[ind2]-fX[ind1]); if (dot<0) return kFALSE; return kTRUE; } //_____________________________________________________________________________ Bool_t TGeoPolygon::IsSegConvex(Int_t i1, Int_t i2) const { // Check if a segment [0..fNvert-1] belongs to the outscribed convex pgon. if (i2<0) i2=(i1+1)%fNvert; Double_t point[2]; for (Int_t i=0; i<fNvert; i++) { if (i==i1 || i==i2) continue; point[0] = fX[fInd[i]]; point[1] = fY[fInd[i]]; if (!IsRightSided(point, fInd[i1], fInd[i2])) return kFALSE; } return kTRUE; } //_____________________________________________________________________________ void TGeoPolygon::OutscribedConvex() { // Compute indices for the outscribed convex polygon. fNconvex = 0; Int_t iseg = 0; Int_t ivnew; Bool_t conv; Int_t *indconv = new Int_t[fNvert]; memset(indconv, 0, fNvert*sizeof(Int_t)); while (iseg<fNvert) { if (!IsSegConvex(iseg)) { if (iseg+2 > fNvert) break; ivnew = (iseg+2)%fNvert; conv = kFALSE; // check iseg with next vertices while (ivnew) { if (IsSegConvex(iseg, ivnew)) { conv = kTRUE; break; } ivnew = (ivnew+1)%fNvert; } if (!conv) { iseg++; continue; } } else { ivnew = (iseg+1)%fNvert; } // segment belonging to convex outscribed poligon if (!fNconvex) indconv[fNconvex++] = iseg; else if (indconv[fNconvex-1] != iseg) indconv[fNconvex++] = iseg; if (iseg<fNvert-1) indconv[fNconvex++] = ivnew; if (ivnew<iseg) break; iseg = ivnew; } if (!fNconvex) { Fatal("OutscribedConvex","cannot build outscribed convex"); return; } fIndc = new Int_t[fNconvex]; memcpy(fIndc, indconv, fNconvex*sizeof(Int_t)); // does not contain real indices yet delete [] indconv; } //_____________________________________________________________________________ Double_t TGeoPolygon::Safety(Double_t *point, Int_t &isegment) const { // Compute minimum distance from POINT to any segment. Returns segment index. Int_t i1, i2; Double_t p1[2], p2[3]; Double_t lsq, ssq, dx, dy, dpx, dpy, u; Double_t safe=1E30; Int_t isegmin=0; for (i1=0; i1<fNvert; i1++) { if (safe==0.) { isegment = isegmin; return 0.; } i2 = (i1+1)%fNvert; p1[0] = fX[i1]; p1[1] = fY[i1]; p2[0] = fX[i2]; p2[1] = fY[i2]; dx = p2[0] - p1[0]; dy = p2[1] - p1[1]; dpx = point[0] - p1[0]; dpy = point[1] - p1[1]; lsq = dx*dx + dy*dy; if (lsq==0) { ssq = dpx*dpx + dpy*dpy; if (ssq < safe) { safe = ssq; isegmin = i1; } continue; } u = (dpx*dx + dpy*dy)/lsq; if (u>1) { dpx = point[0]-p2[0]; dpy = point[1]-p2[1]; } else { if (u>=0) { dpx -= u*dx; dpy -= u*dy; } } ssq = dpx*dpx + dpy*dpy; if (ssq < safe) { safe = ssq; isegmin = i1; } } isegment = isegmin; safe = TMath::Sqrt(safe); // printf("== segment %d: (%f, %f) - (%f, %f) safe=%f\n", isegment, fX[isegment],fY[isegment],fX[(isegment+1)%fNvert],fY[(isegment+1)%fNvert],safe); return safe; } //_____________________________________________________________________________ void TGeoPolygon::SetNextIndex(Int_t index) { // Sets the next polygone index. If index<0 sets all indices consecutive // in increasing order. if (index <0) { for (Int_t i=0; i<fNvert; i++) fInd[i] = i; return; } if (fNconvex >= fNvert) { Error("SetNextIndex", "all indices already set"); return; } fInd[fNconvex++] = index; // printf(" %i ", index); // if (fNconvex == fNvert) printf ("\n"); }
[ "pietro.govoni@gmail.com" ]
pietro.govoni@gmail.com
6a48f302b60c9f3d751e0f243b84c3860e6fad6f
bd59528f92dec745c93329bace7169b0f6f87be5
/Trie/dictionary.h
3466ba8f60d03f1820dd5cb82d3039c5215bb722
[]
no_license
Zarrie/DataStrPog-course-2017-2018
153e11acaa699390e684fa5b5f973ed8d4fe0b06
fd858ab62c63f6a8575e8716edb03dc1fefb5747
refs/heads/master
2021-09-09T01:54:05.446904
2018-03-13T08:10:50
2018-03-13T08:10:50
106,185,663
0
0
null
null
null
null
UTF-8
C++
false
false
2,969
h
#pragma once #include <vector> #include <string> #include <unordered_map> #include <exception> #include <iostream> using word = std::string; class dictionary{ private: class node{ public: bool final; std::unordered_map <char, node *> transitions; node() : final(false){} }; node *root; void allWords(const node *currNode, word currWord, std::vector<word> &result) const{ if(currNode == nullptr) return; if(currNode->final) result.push_back(currWord); for(auto it : currNode->transitions) allWords(it.second, currWord + it.first, result); } void removeDictionary(node *&currNode){ if(currNode == nullptr) return; for(auto it : currNode->transitions) removeDictionary(it.second); delete currNode; } public: dictionary() : root(new node()) {} dictionary(const dictionary &rhs) : root(new node()){ std::vector<word> wordsToInsert; allWords(rhs.root, std::string(), wordsToInsert); for(auto it : wordsToInsert) this->insert(it); } dictionary& operator=(const dictionary &rhs){ if(this == &rhs) return *this; std::vector<word> wordsToInsert; allWords(rhs.root, std::string(), wordsToInsert); for(auto it : wordsToInsert) this->insert(it); return *this; } void insert(const word &newWord){ if(newWord.empty()) return; node *currNode = root; uint wordPos = 0; while(wordPos < newWord.length() && currNode->transitions.find(newWord[wordPos]) != currNode->transitions.end()){ currNode = currNode->transitions.at(newWord[wordPos]); wordPos++; } while(wordPos < newWord.length()){ currNode->transitions[newWord[wordPos]] = new node(); currNode = currNode->transitions[newWord[wordPos]]; ++wordPos; } currNode->final = true; } void remove(const word &removeWord){ node *currNode = root; uint wordPos = 0; while(wordPos < removeWord.length() && currNode->transitions.find(removeWord[wordPos]) != currNode->transitions.end()){ currNode = currNode->transitions.at(removeWord[wordPos]); ++wordPos; } if(wordPos < removeWord.length()) throw std::invalid_argument("Given word for removal is not in the Trie!"); else currNode->final = false; } bool find(const word &searchingWord) const{ if(searchingWord.empty()) return false; uint wordPos = 0; node *currNode = root; while(wordPos < searchingWord.length() && currNode->transitions.find(searchingWord[wordPos]) != currNode->transitions.end()){ currNode = currNode->transitions.at(searchingWord[wordPos]); ++wordPos; } if(wordPos < searchingWord.length()) return false; else return currNode->final; } // utility functions void print(const node *currNode, word currWord) const{ if(!currNode) return; if(currNode->final) std::cout << currWord << std::endl; for(auto it : currNode->transitions) print(it.second, currWord + it.first); } void printTree() const{ print(root, std::string()); } ~dictionary(){ removeDictionary(root); } };
[ "noreply@github.com" ]
noreply@github.com
3d4bcad27a94dfbd6a6c74d06f9224155c14aa09
0b935c82a4e7439d95668d66e82772dbbf02120c
/datalogger_corriente/json_respuesta.ino
7e682584bf230414bbbeca5fb1d597bd4341a59a
[]
no_license
alonso651/datalogger_corriente
f6fe5fb0d9160554bf2e0d470a1a251f09b7adcd
b423e4d27553bd4d371ec6d85ad6c470127ad89a
refs/heads/master
2021-04-02T20:59:05.354308
2020-03-18T20:15:54
2020-03-18T20:15:54
248,321,109
0
0
null
null
null
null
UTF-8
C++
false
false
1,323
ino
void json_respuesta(String dato) { //parse JSON int longitud = dato.length(); longitud += 1; char jsonChar[longitud]; dato.toCharArray(jsonChar, sizeof(jsonChar)); StaticJsonBuffer<250> jsonBuffer; JsonObject& root1 = jsonBuffer.parseObject(jsonChar); // Test if parsing succeeds. if (!root1.success()) { Serial.println("parseObject() failed"); return; } const char* comando = root1["comando"]; const char* valorComando = root1["valor"]; String respuesta; if (String(comando) == "loopTime") { loopTime = atoi(valorComando); respuesta = "loopTime : "; respuesta += String(loopTime); }else if (String(comando) == "chipId") { respuesta = "ESP ChipId : "; respuesta += String(ESP.getChipId()); }else if (String(comando) == "start") { respuesta = "Inicio : OK"; record = true; }else if (String(comando) == "stop") { respuesta = "Fin : OK"; record = false; } else { respuesta = "Comando desconocido"; } //Construcción del Objeto JSON StaticJsonBuffer<200> doc1; JsonObject& root2 = doc1.createObject(); root2[comando] = respuesta; String output; root2.printTo(output); client.publish("corriente_up1", respuesta.c_str()); Serial.print("Publish message: "); Serial.print("[corriente_up1] "); Serial.println(respuesta); }
[ "alonso.651@gmail.com" ]
alonso.651@gmail.com
a2b7991377d98d3b4a966c2f5fee1ad3c44a9a52
5145550a86e135711ddca85b105dbefdc7d135dd
/kernel/lib/instrumentation/vmo.cc
c684e0fdf47c3eeb43b0ad809dd7cf26dd119c7a
[ "MIT", "BSD-3-Clause" ]
permissive
SkrShadow/Zircon
b949deaae212320593c27544fd454eea73d9eea7
7dc278a9cc8b09d46152c92dfe12aa8e43833f0e
refs/heads/master
2022-10-13T22:05:34.428454
2020-06-12T03:28:30
2020-06-12T03:28:30
271,699,434
0
0
null
null
null
null
UTF-8
C++
false
false
6,102
cc
// Copyright 2019 The Fuchsia Authors // // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT #include <lib/instrumentation/vmo.h> #include <lib/version.h> #include <stdio.h> #include <string.h> #include <ktl/iterator.h> #include <object/vm_object_dispatcher.h> #include <vm/vm_object_paged.h> namespace { // These are defined by the linker script. When there is no such // instrumentation data in this kernel build, they're equal. extern "C" const uint8_t __llvm_profile_start[], __llvm_profile_end[]; extern "C" const uint8_t __llvm_profile_vmo_end[]; extern "C" const uint8_t __sancov_pc_table[], __sancov_pc_table_end[]; extern "C" const uint8_t __sancov_pc_table_vmo_end[]; extern "C" const uint8_t __sancov_pc_counts[], __sancov_pc_counts_end[]; extern "C" const uint8_t __sancov_pc_counts_vmo_end[]; constexpr struct Kind { const char* announce; const char* sink_name; const char* vmo_name; const uint8_t* start; const uint8_t* end; const uint8_t* vmo_end; size_t scale; const char* units; constexpr size_t content_size() const { return end - start; } } kKinds[] = { // LLVM profile data. When not compiled in, this will be a zero-length // anonymous VMO and userland will just ignore it. But it's simpler to // keep the number of VMOs fixed in the ABI with userboot because the // way the build works, the userboot build is independent of different // kernel variants that might have things enabled or disabled. {"LLVM Profile", "llvm-profile", "data/zircon.elf.profraw", // Linker-generated symbols. __llvm_profile_start, __llvm_profile_end, __llvm_profile_vmo_end, // Units. 1, "bytes"}, // -fsanitizer-coverage=trace-pc-guard data. Same story. {"SanitizerCoverage", "sancov", // The sancov tool matches "<binaryname>" to "<binaryname>.%u.sancov". "data/zircon.elf.1.sancov", // Linker-generated symbols. __sancov_pc_table, __sancov_pc_table_end, __sancov_pc_table_vmo_end, // Units. sizeof(uintptr_t), "PCs"}, {"SanitizerCoverage Counts", "sancov-counts", // This follows the sancov PCs file name just for consistency. "data/zircon.elf.1.sancov-counts", // Linker-generated symbols. __sancov_pc_counts, __sancov_pc_counts_end, __sancov_pc_counts_vmo_end, // Units. sizeof(uint64_t), "counters"}, // NOTE! This element must be last. This file contains logging text // with symbolizer markup that describes all the other data files. {{}, {}, "data/symbolizer.log", {}, {}, {}, {}, {}}, }; void PrintDumpfile(FILE* f, const Kind& k) { fprintf(f, "%s: {{{dumpfile:%s:%s}}} maximum %zu %s.\n", k.announce, k.sink_name, k.vmo_name, (k.end - k.start) / k.scale, k.units); } } // namespace decltype(InstrumentationData::instances_) InstrumentationData::instances_; zx_status_t InstrumentationData::Create() { const auto& k = kKinds[which()]; return VmObjectPaged::CreateFromWiredPages(k.start, k.vmo_end - k.start, false, &vmo_); } zx_status_t InstrumentationData::GetVmo(Handle** handle) { zx_rights_t rights; KernelHandle<VmObjectDispatcher> new_handle; zx_status_t status = VmObjectDispatcher::Create(vmo_, &new_handle, &rights); if (status == ZX_OK) { new_handle.dispatcher()->SetContentSize(kKinds[which()].content_size()); *handle = Handle::Make(ktl::move(new_handle), rights & ~ZX_RIGHT_WRITE).release(); } return status; } bool InstrumentationData::Publish(FILE* symbolizer) { if (vmo_->size() == 0) { return false; } const auto& k = kKinds[which()]; // Set the name to expose the meaning of the VMO to userland. vmo_->set_name(k.vmo_name, strlen(k.vmo_name)); if (symbolizer) { // Log the name that goes with the VMO. PrintDumpfile(stdout, k); PrintDumpfile(symbolizer, k); } return true; } zx_status_t InstrumentationData::GetVmos(Handle* handles[]) { // This object facilitates doing fprintf directly into the VMO representing // the symbolizer markup data file. This gets the symbolizer context for the // kernel and then a dumpfile element for each VMO published. struct SymbolizerFile { fbl::RefPtr<VmObject>& vmo_ = instances_[kSymbolizer].vmo_; size_t pos_ = 0; FILE stream_{this}; zx_status_t Create() { return VmObjectPaged::Create(PMM_ALLOC_FLAG_ANY, 0, PAGE_SIZE, &vmo_); } int Write(ktl::string_view str) { zx_status_t status = vmo_->Write(str.data(), pos_, str.size()); ZX_ASSERT(status == ZX_OK); pos_ += str.size(); return static_cast<int>(str.size()); } } symbolizer; zx_status_t status = symbolizer.Create(); if (status != ZX_OK) { return status; } PrintSymbolizerContext(&symbolizer.stream_); bool any_published = false; for (auto& instance : instances_) { bool published = false; if (instance.which() == kSymbolizer) { // This is the last iteration, so everything has been published now. static_assert(kSymbolizer == ktl::size(instances_) - 1); if (any_published) { // Publish the symbolizer file. published = instance.Publish(nullptr); } } else { status = instance.Create(); published = instance.Publish(&symbolizer.stream_); } if (status == ZX_OK) { status = instance.GetVmo(&handles[instance.which()]); } if (published) { any_published = true; } else { // The empty VMO doesn't need to be kept alive. instance.vmo_.reset(); } if (status != ZX_OK) { return status; } } if (any_published) { // Finalize the official size of the symbolizer file. auto* dispatcher = handles[kSymbolizer]->dispatcher().get(); auto vmo = DownCastDispatcher<VmObjectDispatcher>(dispatcher); vmo->SetContentSize(symbolizer.pos_); } // There's no need to keep the symbolizer file VMO alive if userland drops // it. Its memory is not special and isn't used by the kernel directly. symbolizer.vmo_.reset(); return ZX_OK; }
[ "2937306076@qq.com" ]
2937306076@qq.com
ecc935cfbe22414c2386644fd675370940bc8f79
eea0650512fbd3f2a69ed0f9185a62b6ff99807f
/main.cpp
42e0f14b2e398952a5763f42fc9149cb6cdf6db0
[]
no_license
Treefold/OOP-T3-Payment_List
ee379fa319203c56095f817ed9fb744b4523c000
40960c07b35783a1029fa7d30775da08b2a3fda3
refs/heads/master
2020-05-30T09:50:43.800296
2019-05-31T20:42:48
2019-05-31T20:42:48
189,655,985
0
0
null
null
null
null
UTF-8
C++
false
false
12,138
cpp
/** Cerinte comune tuturor temelor: 1. tratarea exceptiilor 2. utilizarea variabilelor și functiilor statice 3. utilizarea conceptelor de Dynamic_Cast și Static_Cast 4. utilizarea sabloanelor 5. citirea informațiilor complete a n obiecte, memorarea și afisarea acestora Cerinte generale aplicate fiecarei teme din acest fisier: - să se identifice și să se implementeze ierarhia de clase - clasele sa conțină constructori, destructori, =, funcție prietena de citire a datelor - clasa de baza sa conțină funcție virtuala de afisare, rescrisa în clasele derivate - clasele derivate trebuie sa contina constructori parametrizati prin care sa se evidentieze transmiterea parametrilor către constructorul din clasa de baza Tema 1. Firma X are un domeniu de business unde este necesar să se urmărească modul în care clientii plătesc (numerar, cec sau card de credit). Indiferent de modul de plata, firma X știe în ce data s-a efectuat plata și ce suma a fost primita. Dacă se plătește cu cardul, atunci se cunoaște și numărul cardului de credit. Pentru cash, nu e necesara identificarea clientului care a făcut plata. Cerinta suplimentara: - Sa se construiasca clasa template Gestiune care sa conțină numărul total de plati (incrementat automat la adaugarea unei noi chitante) și un vector de pointeri la obiecte de tip Plata, alocat dinamic. Sa se supraincarce operatorul += pentru inserarea unei plati în lista, indiferent de tipul acesteia - Sa se construiasca o specializare pentru tipul char* care sa stocheze numarul de clienti, impreuna cu numele acestora Plata: data, suma - Anonima = numerar: adresa - Client: nume, prenume - Cec: cnp - Card: id, cvv */ #include <iostream> #include <fstream> #include <cstring> #include <typeinfo> using namespace std; struct Date { int year = 2019, month = 5, day = 5; ///, hour 20, minute = 41, second = 47 Date (int y, int m, int d); ~Date(); Date & operator= (const Date & other); friend istream & operator>> (istream & in, Date & d); friend ostream & operator<< (ostream & out, const Date & d); void test(); }; Date::Date (int y = 2019, int m = 5, int d = 7): year (y), month (m), day (d) { test(); } Date::~Date() {} Date & Date:: operator= (const Date & other) { year = other.year; month = other.month; day = other.day; return *this; } void Date::test () { try { if (year <= 0 || month <= 0 || day <= 0) throw '1'; if (month > 12) throw 1.0; if (month == 4 || month == 6 || month == 9 || month == 1) {if (day > 30) throw 1;} else if (month != 2) {if (day > 31) throw 1;} else if(day > 28 + (year%4 == 0 && year % 100 != 0)) throw 1; } catch (char c) {cout << "Negative values...\n";} catch (double d) {cout << "It's a new year...\n";} catch (int i) {cout << "It's a new month...\n";} catch (...) {cout << "Unknown Error\n";} } istream & operator>> (istream & in, Date & d) { in >> d.year >> d.month >> d.day; d.test(); return in; } ostream & operator<< (ostream & out, const Date & d) { return (out << d.year << " " << d.month << " " << d.day); } template <class TS, class TD> class Plata; template <class TS, class TD> istream & operator>> (istream & in, Plata <TS, TD> & p) { return (in >> p.sum >> p.date); } template <class TS, class TD> class Plata { TS sum; TD date; public: Plata (TS s, TD d): sum (s), date (d) {}; virtual ~Plata () {}; Plata <TS, TD> & operator= (const Plata <TS, TD> & other); friend istream & operator>> <TS, TD> (istream & in, Plata <TS, TD> & p); virtual void print (ostream & out, Plata <TS, TD> & p) = 0; TS getS (); TD getD (); }; template <class TS, class TD> Plata <TS, TD> & Plata<TS, TD>:: operator= (const Plata <TS, TD> & other) { sum = other.sum; date = other.date; return *this; } template <class TS, class TD> TS Plata<TS, TD>:: getS () { return sum; } template <class TS, class TD> TD Plata<TS, TD>:: getD () { return date; } template <> class Plata <int, char*> { int sum; char* date;/// max: yyyy/mm/dd public: Plata (int s, char* d); ~Plata (); Plata <int, char*> & operator= (const Plata <int, char*> & other); friend istream & operator>> <int, char*> (istream & in, Plata <int, char*> & p); virtual void print (ostream & out, Plata <int, char*> & p) = 0; }; Plata <int, char*>:: Plata (int s, char* d) { sum = s; date = new char [17]; strcpy(date, "asedf"); } Plata <int, char*>:: ~Plata () { delete date; } Plata <int, char*> & Plata <int, char*>:: operator= (const Plata <int, char*> & other) { sum = other.sum; strcpy(date,other.date); return *this; } template <class TS, class TD> class Anonym; template <class TS, class TD> istream & operator>> (istream & in, Anonym <TS, TD> & p) { return (in >> (static_cast <Plata <TS, TD> &> (p)) >> p.location.first >> p.location.second); } template <class TS, class TD> class Anonym: public Plata <TS, TD> { pair <int, int> location; public: Anonym (TS s, TD d, pair <int, int> l = {0, 0}): Plata <TS, TD> (s, d), location (l){} ~Anonym () {} Anonym <TS, TD> & operator= (const Anonym <TS, TD> & other); friend istream & operator>> <TS, TD> (istream & in, Anonym <TS, TD> & p); virtual void print (ostream & out, Plata <TS, TD> & p); }; template <class TS, class TD> Anonym <TS, TD> & Anonym <TS, TD>:: operator= (const Anonym <TS, TD> & other) { static_cast <Plata <TS, TD> &> (*this) = other; location = other.location; return *this; } template <class TS, class TD> void Anonym <TS, TD>:: print (ostream & out, Plata <TS, TD> & p) { Anonym *a = dynamic_cast <Anonym*> (&p); out << a->getS() << "$ payed on " << a->getD() << " at location: " << a->location.first << " " << a->location.second << "\n"; } template <class TS, class TD> class ByPerson; template <class TS, class TD> istream & operator>> (istream & in, ByPerson <TS, TD> & p) { return (in >> (static_cast <Plata <TS, TD> &> (p)) >> p.surname >> p.name); } template <class TS, class TD> class ByPerson: public Plata <TS, TD> { string name, surname; public: ByPerson (TS s, TD d, string nam = "", string sur = ""): Plata <TS, TD> (s, d) {name = nam; surname = sur;} ~ByPerson () {} ByPerson <TS, TD> & operator= (const ByPerson <TS, TD> & other) {static_cast <Plata <TS, TD> &> (*this) = other; name = other.name; surname = other.surname; return *this;} friend istream & operator>> <TS, TD> (istream & in, ByPerson <TS, TD> & p); virtual void print (ostream & out, Plata <TS, TD> & p) = 0; string getName() {return name;} string getSurname() {return surname;} }; template <class TS, class TD> class Cec; template <class TS, class TD> istream & operator>> (istream & in, Cec <TS, TD> & p) { return (in >> (static_cast <ByPerson <TS, TD> &> (p)) >> p.cnp); } template <class TS, class TD> class Cec: public ByPerson <TS, TD> { string cnp; public: Cec (TS s, TD d, string nam = "", string sur = "", string c = ""): ByPerson <TS, TD> (s, d, nam, sur), cnp (c) {} ~Cec () {} Cec <TS, TD> & operator= (const Cec <TS, TD> & other); friend istream & operator>> <TS, TD> (istream & in, Cec <TS, TD> & p); virtual void print (ostream & out, Plata <TS, TD> & p); }; template <class TS, class TD> Cec <TS, TD> & Cec <TS, TD>:: operator= (const Cec <TS, TD> & other) { static_cast <ByPerson <TS, TD> &> (*this) = other; cnp = other.cnp; return *this; } template <class TS, class TD> void Cec <TS, TD>:: print (ostream & out, Plata <TS, TD> & p) { Cec *c = dynamic_cast <Cec*> (&p); out << c->getS() << "$ payed on " << c->getD() << " by: " << c->getSurname() << " " << c->getName() << " with CNP: " << c->cnp << "\n"; } template <class TS, class TD> class Card; template <class TS, class TD> istream & operator>> (istream & in, Card <TS, TD> & p) { return (in >> (static_cast <ByPerson <TS, TD> &> (p)) >> p.id >> p.cvv); } template <class TS, class TD> class Card: public ByPerson <TS, TD> { string id; int cvv; public: Card (TS s, TD d, string nam = "", string sur = "", string i = "", int c = 0): ByPerson <TS, TD> (s, d, nam, sur) {id = i; cvv = c;} ~Card () {} Card <TS, TD> & operator= (const Card <TS, TD> & other); friend istream & operator>> <TS, TD> (istream & in, Card <TS, TD> & p); virtual void print (ostream & out, Plata <TS, TD> & p); }; template <class TS, class TD> Card <TS, TD> & Card <TS, TD>:: operator= (const Card <TS, TD> & other) {static_cast <ByPerson <TS, TD> &> (*this) = other; id = other.id; cvv = other.cvv; return *this;} template <class TS, class TD> void Card <TS, TD>:: print (ostream & out, Plata <TS, TD> & p) { Card *c = dynamic_cast <Card*> (&p); out << c->getS() << "$ payed on " << c->getD() << " by: " << c->getSurname() << " " << c->getName() << " with card ID: " << c->id << " and CVV: " << c->cvv << "\n"; } class Lista { Plata <int, Date> * info; Lista *next; static int objCount; public: static void add(int n); static int get(); Lista (Plata <int, Date> * i, Lista *n); ~Lista (); Lista& operator+= (Plata <int, Date> *p); void af(); }; void Lista:: add(int n = 1) { objCount += n; } int Lista:: get() { return objCount; } Lista:: Lista (Plata <int, Date> * i = NULL, Lista *n = NULL): info(i), next(n) { add(1); } Lista:: ~Lista () { add(-1); delete info; delete next; } int Lista:: objCount = -1; Lista& Lista:: operator+= (Plata <int, Date> *p) { Lista *i = this; while (i->next != NULL) {i = i->next;} i->next = new Lista (p); return *this; } void Lista:: af() { Lista* i = this->next; Date d; Anonym <int, Date> obop1 (0, d); Cec <int, Date> obop2 (0, d); Card <int, Date> obop3 (0, d); while (i != NULL) { if (typeid(*i->info) == typeid(obop1)) {obop1.print(cout, *i->info);} else if (typeid(*i->info) == typeid(obop2)) {obop2.print(cout, *i->info);} else if (typeid(*i->info) == typeid(obop3)) {obop3.print(cout, *i->info);} else {cout << "Unknown\n";} i = i->next; } } int main() { ifstream in ("date.in"); Date d; int n, i, option; Lista *l = new Lista; /// that's why I add 1 when I print the nr of objects at the end Anonym <int, Date> *obop1; Cec <int, Date> *obop2; Card <int, Date> *obop3; in >> n; cout << "\nnr of objects in list: " << Lista::get() << "\n"; for (i = 0; i < n; ++i) { in >> option; switch (option) { case 1: obop1 = new Anonym <int, Date>(0, d); in >> (*obop1); (*l) += static_cast <Plata <int, Date> *> (obop1); break; case 2: obop2 = new Cec <int, Date>(0, d); in >> (*obop2); (*l) += static_cast <Plata <int, Date> *> (obop2); break; case 3: obop3 = new Card <int, Date>(0, d); in >> (*obop3); (*l) += static_cast <Plata <int, Date> *> (obop3); break; default: cout << "Unkown type of payment"; delete l; return 0; } } cout << "\nnr of objects in list: " << Lista::get() << "\n"; l->af(); delete l; cout << "\nnr of objects in list: " << Lista::get() + 1 << "\n"; return 0; }
[ "noreply@github.com" ]
noreply@github.com
a9a8da10894284ba427d9bcfcd433c6108ed25f2
327ee79a73ecfe0017977b34a07633bf7442d7dc
/myd3d/Physics/RigidBody/RBPolygon.cpp
8fc02f6823cb66aa579b46079a33300e916a9343
[]
no_license
IdiotCoderCodie/myd3d
cdd12368375c2c1fa4ab99f1d62057ed72450f45
ba73f0570f9fc725ee50caabaafb05149e6c3378
refs/heads/master
2020-06-01T18:18:16.820237
2014-05-10T14:41:13
2014-05-10T14:41:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,557
cpp
#include "RBPolygon.h" RBPolygon::RBPolygon(void) { } RBPolygon::RBPolygon(std::vector<glm::vec2>& vertices) : m_vertices(vertices) { } RBPolygon::~RBPolygon(void) { } void RBPolygon::CollisionWithCircle(Circle& circle, ContactManifold& ContactManifold) { // TODO: Complete. } void RBPolygon::CollisionWithAABB(AABB& aabb, ContactManifold& contactManifold) { // TODO: Complete. } void RBPolygon::CollisionWithPolygon(RBPolygon& polygon, ContactManifold& ContactManifold) { // TODO: Complete. } bool RBPolygon::Intersect(RBPolygon& A, RBPolygon& B, glm::vec2& MTD) { // Potential separation axes. std::vector<glm::vec2> Axes; int j, i; // Check all axis from A edges. // Start with 1st vertex, and last to get first edge. for(j = A.GetNumVertices() - 1, i = 0; i < A.GetNumVertices(); j = i, i++) { glm::vec2 E = A[i] - A[j]; glm::vec2 N(-E.y, E.x); Axes.push_back(N); if(RBPolygon::AxisSeparatePolygons(N, A, B)) { return false; } } // Check all axis from B edges. for(j = B.GetNumVertices() - 1, i = 0; i < B.GetNumVertices(); j = i, i++) { glm::vec2 E = B[i] - B[j]; glm::vec2 N(-E.y, E.x); Axes.push_back(N); if(RBPolygon::AxisSeparatePolygons(N, A, B)) { return false; } } // Now find the MTD among the separation vecs. MTD = FindMTD(Axes); } bool RBPolygon::AxisSeparatePolygons(const glm::vec2& axis, const RBPolygon& A, const RBPolygon& B) { float mina, maxa; float minb, maxb; CalculateInterval(axis, A, mina, maxa); CalculateInterval(axis, B, minb, maxb); if(mina > maxb || minb > maxa) return true; return false; } void RBPolygon::CalculateInterval(const glm::vec2& axis, const RBPolygon& P, float& min, float& max) { // Projects the polygon onto the axis, getting minimum and maximum of the interval. float d = glm::dot(axis, P[0]); min = max = d; for(int i = 0; i < P.GetNumVertices(); i++) { float d2 = glm::dot(P[i], axis); if(d2 < min) { min = d2; } else if(d2 > max) { max = d2; } } } glm::vec2 RBPolygon::FindMTD(std::vector<glm::vec2>& vectors) { glm::vec2 MTD = vectors[0]; float minDist2 = glm::dot(vectors[0], vectors[0]); for (int i = 1; i < vectors.size(); i++) { // float dist2 = glm::cross(vectors[i], vectors[i]); } return glm::vec2(0.0f); }
[ "c.j.collinge@live.co.uk" ]
c.j.collinge@live.co.uk
79aee13a4da092247e7092898831c64867970dff
9b86e1e4c7767626aae543c845d2d81c09c4c269
/Qt-4.8.4/include/Qsci/qscilexerruby.h
c16caef6ec71bc4a94c5629ad18ca381e257cc8d
[]
no_license
mantidproject/3rdpartyincludes
9ab6a044a13462da4170c254dc1fac4ad2141aba
e8ad512effbb75bf15f4006412c2ff66d8bf0396
refs/heads/master
2016-09-15T21:37:04.900403
2015-06-29T13:56:07
2015-06-29T13:56:07
2,578,375
0
1
null
null
null
null
UTF-8
C++
false
false
7,173
h
// This defines the interface to the QsciLexerRuby class. // // Copyright (c) 2011 Riverbank Computing Limited <info@riverbankcomputing.com> // // This file is part of QScintilla. // // This file may be used under the terms of the GNU General Public // License versions 2.0 or 3.0 as published by the Free Software // Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 // included in the packaging of this file. Alternatively you may (at // your option) use any later version of the GNU General Public // License if such license has been publicly approved by Riverbank // Computing Limited (or its successors, if any) and the KDE Free Qt // Foundation. In addition, as a special exception, Riverbank gives you // certain additional rights. These rights are described in the Riverbank // GPL Exception version 1.1, which can be found in the file // GPL_EXCEPTION.txt in this package. // // If you are unsure which license is appropriate for your use, please // contact the sales department at sales@riverbankcomputing.com. // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. #ifndef QSCILEXERRUBY_H #define QSCILEXERRUBY_H #ifdef __APPLE__ extern "C++" { #endif #include <qobject.h> #include <Qsci/qsciglobal.h> #include <Qsci/qscilexer.h> //! \brief The QsciLexerRuby class encapsulates the Scintilla Ruby lexer. class QSCINTILLA_EXPORT QsciLexerRuby : public QsciLexer { Q_OBJECT public: //! This enum defines the meanings of the different styles used by the //! Ruby lexer. enum { //! The default. Default = 0, //! An error. Error = 1, //! A comment. Comment = 2, //! A POD. POD = 3, //! A number. Number = 4, //! A keyword. Keyword = 5, //! A double-quoted string. DoubleQuotedString = 6, //! A single-quoted string. SingleQuotedString = 7, //! The name of a class. ClassName = 8, //! The name of a function or method. FunctionMethodName = 9, //! An operator. Operator = 10, //! An identifier Identifier = 11, //! A regular expression. Regex = 12, //! A global. Global = 13, //! A symbol. Symbol = 14, //! The name of a module. ModuleName = 15, //! An instance variable. InstanceVariable = 16, //! A class variable. ClassVariable = 17, //! Backticks. Backticks = 18, //! A data section. DataSection = 19, //! A here document delimiter. HereDocumentDelimiter = 20, //! A here document. HereDocument = 21, //! A %q string. PercentStringq = 24, //! A %Q string. PercentStringQ = 25, //! A %x string. PercentStringx = 26, //! A %r string. PercentStringr = 27, //! A %w string. PercentStringw = 28, //! A demoted keyword. DemotedKeyword = 29, //! stdin. Stdin = 30, //! stdout. Stdout = 31, //! stderr. Stderr = 40 }; //! Construct a QsciLexerRuby with parent \a parent. \a parent is //! typically the QsciScintilla instance. QsciLexerRuby(QObject *parent = 0); //! Destroys the QsciLexerRuby instance. virtual ~QsciLexerRuby(); //! Returns the name of the language. const char *language() const; //! Returns the name of the lexer. Some lexers support a number of //! languages. const char *lexer() const; //! \internal Returns a space separated list of words or characters in //! a particular style that define the end of a block for //! auto-indentation. The style is returned via \a style. const char *blockEnd(int *style = 0) const; //! \internal Returns a space separated list of words or characters in //! a particular style that define the start of a block for //! auto-indentation. The styles is returned via \a style. const char *blockStart(int *style = 0) const; //! \internal Returns a space separated list of keywords in a //! particular style that define the start of a block for //! auto-indentation. The style is returned via \a style. const char *blockStartKeyword(int *style = 0) const; //! \internal Returns the style used for braces for brace matching. int braceStyle() const; //! Returns the foreground colour of the text for style number \a style. //! //! \sa defaultpaper() QColor defaultColor(int style) const; //! Returns the end-of-line fill for style number \a style. bool defaultEolFill(int style) const; //! Returns the font for style number \a style. QFont defaultFont(int style) const; //! Returns the background colour of the text for style number \a style. //! //! \sa defaultColor() QColor defaultPaper(int style) const; //! Returns the set of keywords for the keyword set \a set recognised //! by the lexer as a space separated string. const char *keywords(int set) const; //! Returns the descriptive name for style number \a style. If the style //! is invalid for this language then an empty QString is returned. This //! is intended to be used in user preference dialogs. QString description(int style) const; //! Causes all properties to be refreshed by emitting the //! propertyChanged() signal as required. void refreshProperties(); //! If \a fold is true then multi-line comment blocks can be folded. //! The default is false. //! //! \sa foldComments() void setFoldComments(bool fold); //! Returns true if multi-line comment blocks can be folded. //! //! \sa setFoldComments() bool foldComments() const {return fold_comments;} //! If \a fold is true then trailing blank lines are included in a fold //! block. The default is true. //! //! \sa foldCompact() void setFoldCompact(bool fold); //! Returns true if trailing blank lines are included in a fold block. //! //! \sa setFoldCompact() bool foldCompact() const {return fold_compact;} protected: //! The lexer's properties are read from the settings \a qs. \a prefix //! (which has a trailing '/') should be used as a prefix to the key of //! each setting. true is returned if there is no error. //! bool readProperties(QSettings &qs, const QString &prefix); //! The lexer's properties are written to the settings \a qs. //! \a prefix (which has a trailing '/') should be used as a prefix to //! the key of each setting. true is returned if there is no error. //! bool writeProperties(QSettings &qs, const QString &prefix) const; private: void setCommentProp(); void setCompactProp(); bool fold_comments; bool fold_compact; QsciLexerRuby(const QsciLexerRuby &); QsciLexerRuby &operator=(const QsciLexerRuby &); }; #ifdef __APPLE__ } #endif #endif
[ "martyn.gigg@stfc.ac.uk" ]
martyn.gigg@stfc.ac.uk
c37dcb4effe7203456b0215e0e4fac3e3c96dfd6
b5f6d2410a794a9acba9a0f010f941a1d35e46ce
/game/server/filters.cpp
d9ee2b347a1527b33a308008c9f78b39125c8073
[]
no_license
chrizonix/RCBot2
0a58591101e4537b166a672821ea28bc3aa486c6
ef0572f45c9542268923d500e64bb4cd037077eb
refs/heads/master
2021-01-19T12:55:49.003814
2018-08-27T08:48:55
2018-08-27T08:48:55
44,916,746
4
0
null
null
null
null
WINDOWS-1252
C++
false
false
18,136
cpp
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: // //=============================================================================// #include "cbase.h" #include "filters.h" #include "entitylist.h" #include "ai_squad.h" #include "ai_basenpc.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" // ################################################################### // > BaseFilter // ################################################################### LINK_ENTITY_TO_CLASS(filter_base, CBaseFilter); BEGIN_DATADESC( CBaseFilter ) DEFINE_KEYFIELD(m_bNegated, FIELD_BOOLEAN, "Negated"), // Inputs DEFINE_INPUTFUNC( FIELD_INPUT, "TestActivator", InputTestActivator ), // Outputs DEFINE_OUTPUT( m_OnPass, "OnPass"), DEFINE_OUTPUT( m_OnFail, "OnFail"), END_DATADESC() //----------------------------------------------------------------------------- bool CBaseFilter::PassesFilterImpl( CBaseEntity *pCaller, CBaseEntity *pEntity ) { return true; } bool CBaseFilter::PassesFilter( CBaseEntity *pCaller, CBaseEntity *pEntity ) { bool baseResult = PassesFilterImpl( pCaller, pEntity ); return (m_bNegated) ? !baseResult : baseResult; } bool CBaseFilter::PassesDamageFilter(const CTakeDamageInfo &info) { bool baseResult = PassesDamageFilterImpl(info); return (m_bNegated) ? !baseResult : baseResult; } bool CBaseFilter::PassesDamageFilterImpl( const CTakeDamageInfo &info ) { return PassesFilterImpl( NULL, info.GetAttacker() ); } //----------------------------------------------------------------------------- // Purpose: Input handler for testing the activator. If the activator passes the // filter test, the OnPass output is fired. If not, the OnFail output is fired. //----------------------------------------------------------------------------- void CBaseFilter::InputTestActivator( inputdata_t &inputdata ) { if ( PassesFilter( inputdata.pCaller, inputdata.pActivator ) ) { m_OnPass.FireOutput( inputdata.pActivator, this ); } else { m_OnFail.FireOutput( inputdata.pActivator, this ); } } // ################################################################### // > FilterMultiple // // Allows one to filter through mutiple filters // ################################################################### #define MAX_FILTERS 5 enum filter_t { FILTER_AND, FILTER_OR, }; class CFilterMultiple : public CBaseFilter { DECLARE_CLASS( CFilterMultiple, CBaseFilter ); DECLARE_DATADESC(); filter_t m_nFilterType; string_t m_iFilterName[MAX_FILTERS]; EHANDLE m_hFilter[MAX_FILTERS]; bool PassesFilterImpl( CBaseEntity *pCaller, CBaseEntity *pEntity ); bool PassesDamageFilterImpl(const CTakeDamageInfo &info); void Activate(void); }; LINK_ENTITY_TO_CLASS(filter_multi, CFilterMultiple); BEGIN_DATADESC( CFilterMultiple ) // Keys DEFINE_KEYFIELD(m_nFilterType, FIELD_INTEGER, "FilterType"), // Silence, Classcheck! // DEFINE_ARRAY( m_iFilterName, FIELD_STRING, MAX_FILTERS ), DEFINE_KEYFIELD(m_iFilterName[0], FIELD_STRING, "Filter01"), DEFINE_KEYFIELD(m_iFilterName[1], FIELD_STRING, "Filter02"), DEFINE_KEYFIELD(m_iFilterName[2], FIELD_STRING, "Filter03"), DEFINE_KEYFIELD(m_iFilterName[3], FIELD_STRING, "Filter04"), DEFINE_KEYFIELD(m_iFilterName[4], FIELD_STRING, "Filter05"), DEFINE_ARRAY( m_hFilter, FIELD_EHANDLE, MAX_FILTERS ), END_DATADESC() //------------------------------------------------------------------------------ // Purpose : Called after all entities have been loaded //------------------------------------------------------------------------------ void CFilterMultiple::Activate( void ) { BaseClass::Activate(); // We may reject an entity specified in the array of names, but we want the array of valid filters to be contiguous! int nNextFilter = 0; // Get handles to my filter entities for ( int i = 0; i < MAX_FILTERS; i++ ) { if ( m_iFilterName[i] != NULL_STRING ) { CBaseEntity *pEntity = gEntList.FindEntityByName( NULL, m_iFilterName[i] ); CBaseFilter *pFilter = dynamic_cast<CBaseFilter *>(pEntity); if ( pFilter == NULL ) { Warning("filter_multi: Tried to add entity (%s) which is not a filter entity!\n", STRING( m_iFilterName[i] ) ); continue; } // Take this entity and increment out array pointer m_hFilter[nNextFilter] = pFilter; nNextFilter++; } } } //----------------------------------------------------------------------------- // Purpose: Returns true if the entity passes our filter, false if not. // Input : pEntity - Entity to test. //----------------------------------------------------------------------------- bool CFilterMultiple::PassesFilterImpl( CBaseEntity *pCaller, CBaseEntity *pEntity ) { // Test against each filter if (m_nFilterType == FILTER_AND) { for (int i=0;i<MAX_FILTERS;i++) { if (m_hFilter[i] != NULL) { CBaseFilter* pFilter = (CBaseFilter *)(m_hFilter[i].Get()); if (!pFilter->PassesFilter( pCaller, pEntity ) ) { return false; } } } return true; } else // m_nFilterType == FILTER_OR { for (int i=0;i<MAX_FILTERS;i++) { if (m_hFilter[i] != NULL) { CBaseFilter* pFilter = (CBaseFilter *)(m_hFilter[i].Get()); if (pFilter->PassesFilter( pCaller, pEntity ) ) { return true; } } } return false; } } //----------------------------------------------------------------------------- // Purpose: Returns true if the entity passes our filter, false if not. // Input : pEntity - Entity to test. //----------------------------------------------------------------------------- bool CFilterMultiple::PassesDamageFilterImpl(const CTakeDamageInfo &info) { // Test against each filter if (m_nFilterType == FILTER_AND) { for (int i=0;i<MAX_FILTERS;i++) { if (m_hFilter[i] != NULL) { CBaseFilter* pFilter = (CBaseFilter *)(m_hFilter[i].Get()); if (!pFilter->PassesDamageFilter(info)) { return false; } } } return true; } else // m_nFilterType == FILTER_OR { for (int i=0;i<MAX_FILTERS;i++) { if (m_hFilter[i] != NULL) { CBaseFilter* pFilter = (CBaseFilter *)(m_hFilter[i].Get()); if (pFilter->PassesDamageFilter(info)) { return true; } } } return false; } } // ################################################################### // > FilterName // ################################################################### class CFilterName : public CBaseFilter { DECLARE_CLASS( CFilterName, CBaseFilter ); DECLARE_DATADESC(); public: string_t m_iFilterName; bool PassesFilterImpl( CBaseEntity *pCaller, CBaseEntity *pEntity ) { // special check for !player as GetEntityName for player won't return "!player" as a name if (FStrEq(STRING(m_iFilterName), "!player")) { return pEntity->IsPlayer(); } else { return pEntity->NameMatches( STRING(m_iFilterName) ); } } }; LINK_ENTITY_TO_CLASS( filter_activator_name, CFilterName ); BEGIN_DATADESC( CFilterName ) // Keyfields DEFINE_KEYFIELD( m_iFilterName, FIELD_STRING, "filtername" ), END_DATADESC() // ################################################################### // > FilterClass // ################################################################### class CFilterClass : public CBaseFilter { DECLARE_CLASS( CFilterClass, CBaseFilter ); DECLARE_DATADESC(); public: string_t m_iFilterClass; bool PassesFilterImpl( CBaseEntity *pCaller, CBaseEntity *pEntity ) { return pEntity->ClassMatches( STRING(m_iFilterClass) ); } }; LINK_ENTITY_TO_CLASS( filter_activator_class, CFilterClass ); BEGIN_DATADESC( CFilterClass ) // Keyfields DEFINE_KEYFIELD( m_iFilterClass, FIELD_STRING, "filterclass" ), END_DATADESC() // ################################################################### // > FilterTeam // ################################################################### class FilterTeam : public CBaseFilter { DECLARE_CLASS( FilterTeam, CBaseFilter ); DECLARE_DATADESC(); public: int m_iFilterTeam; bool PassesFilterImpl( CBaseEntity *pCaller, CBaseEntity *pEntity ) { return ( pEntity->GetTeamNumber() == m_iFilterTeam ); } }; LINK_ENTITY_TO_CLASS( filter_activator_team, FilterTeam ); BEGIN_DATADESC( FilterTeam ) // Keyfields DEFINE_KEYFIELD( m_iFilterTeam, FIELD_INTEGER, "filterteam" ), END_DATADESC() // ################################################################### // > FilterMassGreater // ################################################################### class CFilterMassGreater : public CBaseFilter { DECLARE_CLASS( CFilterMassGreater, CBaseFilter ); DECLARE_DATADESC(); public: float m_fFilterMass; bool PassesFilterImpl( CBaseEntity *pCaller, CBaseEntity *pEntity ) { if ( pEntity->VPhysicsGetObject() == NULL ) return false; return ( pEntity->VPhysicsGetObject()->GetMass() > m_fFilterMass ); } }; LINK_ENTITY_TO_CLASS( filter_activator_mass_greater, CFilterMassGreater ); BEGIN_DATADESC( CFilterMassGreater ) // Keyfields DEFINE_KEYFIELD( m_fFilterMass, FIELD_FLOAT, "filtermass" ), END_DATADESC() // ################################################################### // > FilterDamageType // ################################################################### class FilterDamageType : public CBaseFilter { DECLARE_CLASS( FilterDamageType, CBaseFilter ); DECLARE_DATADESC(); protected: bool PassesFilterImpl(CBaseEntity *pCaller, CBaseEntity *pEntity ) { ASSERT( false ); return true; } bool PassesDamageFilterImpl(const CTakeDamageInfo &info) { return info.GetDamageType() == m_iDamageType; } int m_iDamageType; }; LINK_ENTITY_TO_CLASS( filter_damage_type, FilterDamageType ); BEGIN_DATADESC( FilterDamageType ) // Keyfields DEFINE_KEYFIELD( m_iDamageType, FIELD_INTEGER, "damagetype" ), END_DATADESC() // ################################################################### // > CFilterEnemy // ################################################################### #define SF_FILTER_ENEMY_NO_LOSE_AQUIRED (1<<0) class CFilterEnemy : public CBaseFilter { DECLARE_CLASS( CFilterEnemy, CBaseFilter ); // NOT SAVED // m_iszPlayerName DECLARE_DATADESC(); public: virtual bool PassesFilterImpl( CBaseEntity *pCaller, CBaseEntity *pEntity ); virtual bool PassesDamageFilterImpl( const CTakeDamageInfo &info ); private: bool PassesNameFilter( CBaseEntity *pCaller ); bool PassesProximityFilter( CBaseEntity *pCaller, CBaseEntity *pEnemy ); bool PassesMobbedFilter( CBaseEntity *pCaller, CBaseEntity *pEnemy ); string_t m_iszEnemyName; // Name or classname float m_flRadius; // Radius (enemies are acquired at this range) float m_flOuterRadius; // Outer radius (enemies are LOST at this range) int m_nMaxSquadmatesPerEnemy; // Maximum number of squadmates who may share the same enemy string_t m_iszPlayerName; // "!player" }; //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- bool CFilterEnemy::PassesFilterImpl( CBaseEntity *pCaller, CBaseEntity *pEntity ) { if ( pCaller == NULL || pEntity == NULL ) return false; // If asked to, we'll never fail to pass an already acquired enemy // This allows us to use test criteria to initially pick an enemy, then disregard the test until a new enemy comes along if ( HasSpawnFlags( SF_FILTER_ENEMY_NO_LOSE_AQUIRED ) && ( pEntity == pCaller->GetEnemy() ) ) return true; // This is a little weird, but it's saying that if we're not the entity we're excluding the filter to, then just pass it throughZ if ( PassesNameFilter( pEntity ) == false ) return true; if ( PassesProximityFilter( pCaller, pEntity ) == false ) return false; // NOTE: This can result in some weird NPC behavior if used improperly if ( PassesMobbedFilter( pCaller, pEntity ) == false ) return false; // The filter has been passed, meaning: // - If we wanted all criteria to fail, they have // - If we wanted all criteria to succeed, they have return true; } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- bool CFilterEnemy::PassesDamageFilterImpl( const CTakeDamageInfo &info ) { // NOTE: This function has no meaning to this implementation of the filter class! Assert( 0 ); return false; } //----------------------------------------------------------------------------- // Purpose: Tests the enemy's name or classname // Input : *pEnemy - Entity being assessed // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- bool CFilterEnemy::PassesNameFilter( CBaseEntity *pEnemy ) { // If there is no name specified, we're not using it if ( m_iszEnemyName == NULL_STRING ) return true; // Cache off the special case player name if ( m_iszPlayerName == NULL_STRING ) { m_iszPlayerName = FindPooledString( "!player" ); } if ( m_iszEnemyName == m_iszPlayerName ) { if ( pEnemy->IsPlayer() ) { if ( m_bNegated ) return false; return true; } } // May be either a targetname or classname bool bNameOrClassnameMatches = ( m_iszEnemyName == pEnemy->GetEntityName() || m_iszEnemyName == pEnemy->m_iClassname ); // We only leave this code block in a state meaning we've "succeeded" in any context if ( m_bNegated ) { // We wanted the names to not match, but they did if ( bNameOrClassnameMatches ) return false; } else { // We wanted them to be the same, but they weren't if ( bNameOrClassnameMatches == false ) return false; } return true; } //----------------------------------------------------------------------------- // Purpose: Tests the enemy's proximity to the caller's position // Input : *pCaller - Entity assessing the target // *pEnemy - Entity being assessed // Output : Returns true if potential enemy passes this filter stage //----------------------------------------------------------------------------- bool CFilterEnemy::PassesProximityFilter( CBaseEntity *pCaller, CBaseEntity *pEnemy ) { // If there is no radius specified, we're not testing it if ( m_flRadius <= 0.0f ) return true; // We test the proximity differently when we've already picked up this enemy before bool bAlreadyEnemy = ( pCaller->GetEnemy() == pEnemy ); // Get our squared length to the enemy from the caller float flDistToEnemySqr = ( pCaller->GetAbsOrigin() - pEnemy->GetAbsOrigin() ).LengthSqr(); // Two radii are used to control oscillation between true/false cases // The larger radius is either specified or defaulted to be double or half the size of the inner radius float flLargerRadius = m_flOuterRadius; if ( flLargerRadius == 0 ) { flLargerRadius = ( m_bNegated ) ? (m_flRadius*0.5f) : (m_flRadius*2.0f); } float flSmallerRadius = m_flRadius; if ( flSmallerRadius > flLargerRadius ) { swap( flLargerRadius, flSmallerRadius ); } float flDist; if ( bAlreadyEnemy ) { flDist = ( m_bNegated ) ? flSmallerRadius : flLargerRadius; } else { flDist = ( m_bNegated ) ? flLargerRadius : flSmallerRadius; } // Test for success if ( flDistToEnemySqr <= (flDist*flDist) ) { // We wanted to fail but didn't if ( m_bNegated ) return false; return true; } // We wanted to succeed but didn't if ( m_bNegated == false ) return false; return true; } //----------------------------------------------------------------------------- // Purpose: Attempt to govern how many squad members can target any given entity // Input : *pCaller - Entity assessing the target // *pEnemy - Entity being assessed // Output : Returns true if potential enemy passes this filter stage //----------------------------------------------------------------------------- bool CFilterEnemy::PassesMobbedFilter( CBaseEntity *pCaller, CBaseEntity *pEnemy ) { // Must be a valid candidate CAI_BaseNPC *pNPC = pCaller->MyNPCPointer(); if ( pNPC == NULL || pNPC->GetSquad() == NULL ) return true; // Make sure we're checking for this if ( m_nMaxSquadmatesPerEnemy <= 0 ) return true; AISquadIter_t iter; int nNumMatchingSquadmates = 0; // Look through our squad members to see how many of them are already mobbing this entity for ( CAI_BaseNPC *pSquadMember = pNPC->GetSquad()->GetFirstMember( &iter ); pSquadMember != NULL; pSquadMember = pNPC->GetSquad()->GetNextMember( &iter ) ) { // Disregard ourself if ( pSquadMember == pNPC ) continue; // If the enemies match, count it if ( pSquadMember->GetEnemy() == pEnemy ) { nNumMatchingSquadmates++; // If we're at or passed the max we stop if ( nNumMatchingSquadmates >= m_nMaxSquadmatesPerEnemy ) { // We wanted to find more than allowed and we did if ( m_bNegated ) return true; // We wanted to be less but we're not return false; } } } // We wanted to find more than the allowed amount but we didn't if ( m_bNegated ) return false; return true; } LINK_ENTITY_TO_CLASS( filter_enemy, CFilterEnemy ); BEGIN_DATADESC( CFilterEnemy ) DEFINE_KEYFIELD( m_iszEnemyName, FIELD_STRING, "filtername" ), DEFINE_KEYFIELD( m_flRadius, FIELD_FLOAT, "filter_radius" ), DEFINE_KEYFIELD( m_flOuterRadius, FIELD_FLOAT, "filter_outer_radius" ), DEFINE_KEYFIELD( m_nMaxSquadmatesPerEnemy, FIELD_INTEGER, "filter_max_per_enemy" ), DEFINE_FIELD( m_iszPlayerName, FIELD_STRING ), END_DATADESC()
[ "christian.pichler.msc@gmail.com" ]
christian.pichler.msc@gmail.com
2887a02e24f13eae90fdf0eaf51d2466225a6886
caed08477a7a2fb9b8ac250b4399806b93ca8805
/tabs/WindGeneratorTab.h
5973e0633c802b035f3bc2a29c650137404ebd3d
[]
no_license
EfanovIvan/Wind_farm_model
e12237e1ce49f0f3f050dbf78e750944030ec06b
678266aecb77501fd9f04555823ffa72a375b7dc
refs/heads/main
2023-06-16T16:12:28.933433
2021-07-10T13:42:31
2021-07-10T13:42:31
384,706,969
0
0
null
null
null
null
UTF-8
C++
false
false
1,260
h
#ifndef WINDGENERATORTAB_H #define WINDGENERATORTAB_H #include <QWidget> #include <array> #include <memory> #include "models/WGProxyModel.h" #include "utils/CheckSelection.h" #include "utils/LoadDataFromFile.h" #include "tabs/LineTab.h" #include "windows/SpeedPowerWindow.h" namespace Ui { class WindGenerator; } class WindGeneratorTab : public QWidget, public CheckSelection, public LoadDataFromFile { Q_OBJECT public: explicit WindGeneratorTab(QWidget *parent = nullptr); ~WindGeneratorTab(); WGProxyModel::DataWG getDataWG1(); WGProxyModel::DataWG getDataWG2(); std::shared_ptr<QMessageBox> check() override; void loadDataFromFile(const QString path) override; void saveInFile(QJsonObject & root) override; void sumPowerWG(); signals: void changeModelValidIcon(TabIndices, bool ); void changePower(double); void changePower(double power, LineTab::NumberLine line); public slots: void changeMarkWG1(int); void changeMarkWG2(int); void setSpeedPowerWG1(); void setSpeedPowerWG2(); void OnSpeedPowerWindow(SpeedPowerModel::Dependence wg); private: Ui::WindGenerator * ui; SpeedPowerWindow mSpeedPowerWindow; std::array<bool, 2> mValidWG; }; #endif // WINDGENERATORTAB_H
[ "efanovivan@mail.ru" ]
efanovivan@mail.ru
924dc4b4cd2a2fc70b1a64ced0e77e9cfb3f5e80
e82c548855b83d2298b2952f2e5ed67c5da4f57b
/webcam/face-recognition/real-time/real_time_face_recognition.cpp
6dded93fc8b0e29cb5496e53a9fac514cf2c98d6
[]
no_license
YongBig/raspberry-pi
62ef1958a4a935169651e658239c15f788990cea
0494ec766adb5b3c44c7ced197c5ce6bb6997b72
refs/heads/master
2023-03-17T15:06:46.311075
2021-02-07T18:07:39
2021-02-07T18:07:39
null
0
0
null
null
null
null
UTF-8
C++
false
false
8,986
cpp
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> #include <unistd.h> #include <string> #include <iostream> #include <rapidjson/document.h> // rapidjson's DOM-style API #include "curl/curl.h" #include "curl/easy.h" #include "opencv.hpp" /** * A program to verify the face in front of an USB camera when motion is detected. * * @author Darran Zhang @ codelast.com */ using namespace rapidjson; using namespace std; size_t writeFunc(char *data, size_t size, size_t nmemb, string *writerData) { if (writerData == NULL) { return 0; } size_t len = size * nmemb; writerData->append(data, len); return len; } string getImageFileFaceId(string apiKey, string apiSecret, string localImageFilePath, string remoteImageFileName) { string retData; // the data returned by Face++ service CURL *curl = curl_easy_init(); CURLcode res; struct curl_httppost *firstItem = NULL; struct curl_httppost *lastItem = NULL; curl_formadd(&firstItem, &lastItem, CURLFORM_COPYNAME, "api_key", CURLFORM_COPYCONTENTS, apiKey.c_str(), CURLFORM_END); curl_formadd(&firstItem, &lastItem, CURLFORM_COPYNAME, "api_secret", CURLFORM_COPYCONTENTS, apiSecret.c_str(), CURLFORM_END); char* imageFileData = NULL; long imageFileSize = 0; FILE* fp = fopen(localImageFilePath.c_str(), "rb"); if (fp) { fseek(fp, 0, SEEK_END); imageFileSize = ftell(fp); fseek(fp, 0, SEEK_SET); imageFileData = new char[imageFileSize + 1]; fread(imageFileData, 1, imageFileSize, fp); fclose(fp); } curl_formadd(&firstItem, &lastItem, CURLFORM_COPYNAME, "img", CURLFORM_BUFFER, remoteImageFileName.c_str(), CURLFORM_BUFFERPTR, imageFileData, CURLFORM_BUFFERLENGTH, imageFileSize, CURLFORM_CONTENTTYPE, "image/jpeg", CURLFORM_END); if(curl) { char errorMsg[512]; memset(errorMsg, 0, sizeof(errorMsg)); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorMsg); curl_easy_setopt(curl, CURLOPT_URL, "https://apicn.faceplusplus.com/v2/detection/detect"); // Face++ service URL curl_easy_setopt(curl, CURLOPT_VERBOSE, 0); curl_easy_setopt(curl, CURLOPT_HTTPPOST, firstItem); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &retData); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeFunc); res = curl_easy_perform(curl); if(CURLE_OK != res) { cout << "Error occurred: " << errorMsg << ", error code: " << res << endl; } } /* resource cleanup */ curl_formfree(firstItem); curl_easy_cleanup(curl); curl = NULL; if(imageFileData != NULL) { delete [] imageFileData; imageFileData = NULL; } /* parse the JSON data returned by Face++ serivce */ Document document; if (document.Parse(retData.c_str()).HasParseError()) { cout << "Failed to parse the Face++ returned data: [" << retData << "]" << endl; return ""; } const Value& faces = document["face"]; if (0 == faces.Size()) { // maybe no face was detected in the image cout << "No face was detected in the image" << endl; return ""; } return faces[0]["face_id"].GetString(); } bool verifyFaceId(string apiKey, string apiSecret, string personName, string faceId2Verify) { string retData; // the data returned by Face++ service string faceplsuplusURL= "https://apicn.faceplusplus.com/v2/recognition/verify"; CURL *curl = curl_easy_init(); CURLcode res; struct curl_httppost *firstItem = NULL; struct curl_httppost *lastItem = NULL; curl_formadd(&firstItem, &lastItem, CURLFORM_COPYNAME, "api_key", CURLFORM_COPYCONTENTS, apiKey.c_str(), CURLFORM_END); curl_formadd(&firstItem, &lastItem, CURLFORM_COPYNAME, "api_secret", CURLFORM_COPYCONTENTS, apiSecret.c_str(), CURLFORM_END); curl_formadd(&firstItem, &lastItem, CURLFORM_COPYNAME, "person_name", CURLFORM_COPYCONTENTS, personName.c_str(), CURLFORM_END); curl_formadd(&firstItem, &lastItem, CURLFORM_COPYNAME, "face_id", CURLFORM_COPYCONTENTS, faceId2Verify.c_str(), CURLFORM_END); if(curl) { char errorMsg[512]; memset(errorMsg, 0, sizeof(errorMsg)); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorMsg); curl_easy_setopt(curl, CURLOPT_URL, faceplsuplusURL.c_str()); // Face++ service URL curl_easy_setopt(curl, CURLOPT_VERBOSE, 0); curl_easy_setopt(curl, CURLOPT_HTTPPOST, firstItem); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &retData); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeFunc); res = curl_easy_perform(curl); if(CURLE_OK != res) { cout << "Error occurred: " << errorMsg << ", error code: " << res << endl; } } cout << retData << endl; /* resource cleanup */ curl_formfree(firstItem); curl_easy_cleanup(curl); curl = NULL; /* parse the JSON data returned by Face++ serivce */ Document document; if (document.Parse(retData.c_str()).HasParseError()) { cout << "Failed to parse the Face++ returned data: [" << retData << "]" << endl; return false; } return document["is_same_person"].GetBool(); } int main(int argc, char **argv) { if (argc < 7) { cout << "Usage : ./real_time_face_recognition [motion_detect_threshold] [your_faceplusplus_api_key] [your_faceplusplus_api_secret] [person_name] [usb_wbcam_captured_local_image_file_path] [remote_image_file_name]"; return 1; } int detectThreshold = atoi(argv[1]); string apiKey = argv[2]; string apiSecret = argv[3]; string personName = argv[4]; string localImageFilePath = argv[5]; string remoteImageFileName = argv[6]; string retData; // the data returned by Face++ service /* init camera */ CvCapture* pCapture = cvCreateCameraCapture(0); cvSetCaptureProperty(pCapture, CV_CAP_PROP_FRAME_WIDTH, 640); cvSetCaptureProperty(pCapture, CV_CAP_PROP_FRAME_HEIGHT, 480); cvSetCaptureProperty(pCapture, CV_CAP_PROP_BRIGHTNESS, 20); cvSetCaptureProperty(pCapture, CV_CAP_PROP_CONTRAST, 10); if (NULL == pCapture) { cout << "Can't initialize webcam!" << endl; return 1; } curl_global_init(CURL_GLOBAL_ALL); IplImage *pFrame = cvQueryFrame(pCapture); IplImage *pFrameA = NULL; IplImage *pFrameB = cvCreateImage(cvSize(pFrame->width, pFrame->height), pFrame->depth, pFrame->nChannels); IplImage *pFrameSub = cvCloneImage(pFrameB); int nDims = 256; float hRangesArr[] = {0, 255}; float* hRanges = hRangesArr; IplImage *pGrayscaleImage = NULL; CvHistogram *pHist = cvCreateHist(1, &nDims, CV_HIST_ARRAY, &hRanges, 1); float fMaxValue = 0.0; time_t ts = 0; // used to record current timestamp & prevent triggering the monition detection for multi times in a time peroid while(true) { pFrameA = cvQueryFrame(pCapture); if(!pFrameA) { cout << "Can't grab images!" << endl; break; } cvAbsDiff(pFrameB, pFrameA, pFrameSub); // calculate the diff of two images cvCopy(pFrameA, pFrameB); // copy image, the 1st param is source & the 2nd is dest pGrayscaleImage = cvCreateImage(cvGetSize(pFrameSub), IPL_DEPTH_8U, 1); cvCvtColor(pFrameSub, pGrayscaleImage, CV_BGR2GRAY); cvCalcHist(&pGrayscaleImage, pHist, 0, 0); fMaxValue = 0.0; cvGetMinMaxHistValue(pHist, 0, &fMaxValue, 0, 0); cvConvertScale(pHist->bins, pHist->bins, (fMaxValue ? (255.0 / fMaxValue) : 0.0), 0); double dRealtimeVal = cvGetReal1D(pHist->bins, 10); if (dRealtimeVal > detectThreshold) { // triggered time_t currentTimestamp = time(NULL); if (currentTimestamp - ts >= 3) { ts = currentTimestamp; cout << endl << "Motion detected @ " << ctime(&currentTimestamp); sleep(1); // sleep for a while to wait for a stable position of the person in front of the USB webcam pFrame = cvQueryFrame(pCapture); // capture an image cvSaveImage(localImageFilePath.c_str(), pFrame); // save the image file // invoke Face++ service to get the face_id of the image file string faceId = getImageFileFaceId(apiKey, apiSecret, localImageFilePath, remoteImageFileName); if (faceId.empty()) { continue; } // invoke Face++ service to verify the face_id cout << "Face detected! will verify face_id [" << faceId << "] ..." << endl; if (verifyFaceId(apiKey, apiSecret, personName, faceId)) { cout << "+++ Verification OK!" << endl; } else { cout << "--- WARNING: Verification failed!" << endl; } } } cvReleaseImage(&pGrayscaleImage); // free memory pGrayscaleImage = NULL; cvWaitKey(10); // wait for N milliseconds } cvReleaseCapture(&pCapture); // stop capturing images & release resources cvReleaseHist(&pHist); cvReleaseImage(&pFrameB); cvReleaseImage(&pFrameSub); pCapture = NULL; pHist = NULL; pFrameB = NULL; pFrameSub = NULL; pFrame = NULL; pFrameA = NULL; curl_global_cleanup(); return 0; }
[ "lhcsdn@gmail.com" ]
lhcsdn@gmail.com
bba4fa9d1395636a5411d134dea32d782436531f
78336cfb921519edb08eefdf297f810426fa467a
/app/src/main/cpp/dalvik/Allocc.cpp
d74f80031eaaf134dbed0b38ced93058b4405dd2
[]
no_license
fengjixuchui/CustomAppVMP
61f77aa6a803a30a4f5d5779c5535d84edc5fa91
2ecb3d3b0e5c5b45c449cf5e22163cd212793b77
refs/heads/master
2020-07-27T14:15:40.280932
2018-09-05T05:24:10
2018-09-05T05:24:10
null
0
0
null
null
null
null
UTF-8
C++
false
false
876
cpp
// // Created by liu meng on 2018/9/5. // #include "Allocc.h" dvmReleaseTrackedAlloc_func dvmReleaseTrackedAllocHook; dvmAddTrackedAlloc_func dvmAddTrackedAllocHook; dvmAllocObject_func dvmAllocObjectHook; bool initAllocFuction(void *dvm_hand,int apilevel){ if (dvm_hand) { dvmAllocObjectHook = (dvmAllocObject_func)dlsym(dvm_hand,"dvmAllocObject"); if (!dvmAllocObjectHook) { return JNI_FALSE; } dvmAddTrackedAllocHook = (dvmAddTrackedAlloc_func)dlsym(dvm_hand,"dvmAddTrackedAlloc"); if (!dvmAddTrackedAllocHook) { return JNI_FALSE; } dvmReleaseTrackedAllocHook= (dvmReleaseTrackedAlloc_func)dlsym(dvm_hand,"dvmReleaseTrackedAlloc"); if (!dvmReleaseTrackedAllocHook) { return JNI_FALSE; } return JNI_TRUE; } else { return JNI_FALSE; } }
[ "admeng.liu@qunar.com" ]
admeng.liu@qunar.com
d070ba8400579851f97a280393ccc8a693993b24
84ea1d2a1dd316505c214f92d492f9a4526ab019
/nasteroid-seq-alt.cpp
09d58cca133dbe6d4c1b4c5080ba0392851ac99e
[]
no_license
Napster653/uc3m-arquitectura_de_computadores-p2
cdef34f5bffe276c5bcf709b9215e1bc865e1dc8
5b1d0f089a80e9ce80ac947420445ab6ccd3de3e
refs/heads/master
2021-08-19T21:16:00.784529
2017-11-27T12:23:59
2017-11-27T12:23:59
111,582,551
0
0
null
null
null
null
UTF-8
C++
false
false
12,211
cpp
#include <iostream> #include <random> #include <stdlib.h> #include <math.h> using namespace std; /** * Clases: * Asteroide * Planeta * Rayo */ class Asteroide { double pos_x, pos_y, vel_x, vel_y, acc_x, acc_y, fue_x, fue_y, ast_m; public: // Constructor vacío Asteroide() { pos_x = 0; // Coordenada x pos_y = 0; // Coordenada y vel_x = 0; // Velocidad x vel_y = 0; // Velocidad y acc_x = 0; // Aceleración x acc_y = 0; // Aceleración y fue_x = 0; // Fuerza x fue_y = 0; // Fuerza y ast_m = 0; // Masa } // Setters void set_pos_x(double n){pos_x = n;} void set_pos_y(double n){pos_y = n;} void set_vel_x(double n){vel_x = n;} void set_vel_y(double n){vel_y = n;} void set_acc_x(double n){acc_x = n;} void set_acc_y(double n){acc_y = n;} void set_fue_x(double n){fue_x = n;} void set_fue_y(double n){fue_y = n;} void set_m(double n){ast_m = n;} // Getters double get_pos_x(){return pos_x;} double get_pos_y(){return pos_y;} double get_vel_x(){return vel_x;} double get_vel_y(){return vel_y;} double get_acc_x(){return acc_x;} double get_acc_y(){return acc_y;} double get_fue_x(){return fue_x;} double get_fue_y(){return fue_y;} double get_m(){return ast_m;} }; class Planeta { double pos_x, pos_y, pla_m; public: // Constructor vacío Planeta() { pos_x = 0; // Coordenada x pos_y = 0; // Coordenada y pla_m = 0; // Masa } // Setters void set_pos_x(double n){pos_x = n;} void set_pos_y(double n){pos_y = n;} void set_m(double n){pla_m = n;} // Getters double get_pos_x(){return pos_x;} double get_pos_y(){return pos_y;} double get_m(){return pla_m;} }; class Rayo { double pos_x, pos_y; public: // Constructor no vacío Rayo(double x, double y) { pos_x = x; // Coordenada x (0) pos_y = y; // Coordenada y } // Setters void set_pos_x(double n){pos_x = n;} void set_pos_y(double n){pos_y = n;} // Getters double get_pos_x(){return pos_x;} double get_pos_y(){return pos_y;} }; /** * Función: checkArgs * Comprueba la validez de los argumentos de entrada del programa. * Debe haber 6 argumentos en total (1 + 5). * Deben ser convertibles a int con la función stoi. * Retorna 0 en caso positivo o detiene el programa en caso negativo. */ int checkArgs(int argc, char *argv[]) { if (argc != 6) { cout << "\nnasteroids-seq: Wrong arguments.\n"; cout << "Correct use:\n"; cout << "nasteroids-seq num_asteroides num_iteraciones num_planetas pos_rayo semilla\n\n"; exit (-1); } for (int i = 1; i < argc; ++i) { try { stoi(argv[i]); } catch (invalid_argument& e) { cout << "\nnasteroids-seq: Wrong arguments.\n"; cout << "Correct use:\n"; cout << "nasteroids-seq num_asteroides num_iteraciones num_planetas pos_rayo semilla\n\n"; exit(-1); } } return 0; } /** * main */ int main(int argc, char *argv[]) { checkArgs(argc, argv); // Se validan los argumentos antes de nada // Se almacenan los argumentos en variables con nombres más cómodos int num_asteroides = stoi(argv[1]); int num_iteraciones = stoi(argv[2]); int num_planetas = stoi(argv[3]); double pos_rayo = stod(argv[4]); int semilla = stoi(argv[5]); // Se definen las constantes del problema const double gravity = 6.674e-5; const double delta_t = 0.1; const double dmin = 2.0; const double width = 200; const double height = 200; const double ray_width = 4; const double mass = 1000; const double sdm = 50; // Función generadora de distribuciones aleatorias default_random_engine re{semilla}; uniform_real_distribution<double>xdist{0.0,std::nextafter(width, std::numeric_limits<double>::max())}; uniform_real_distribution<double>ydist{0.0,std::nextafter(height, std::numeric_limits<double>::max())}; normal_distribution<double>mdist{mass,sdm}; // Vector que almacena instancias de la clase Asteroide vector <Asteroide> vec_ast; for (int i = 0; i < num_asteroides; ++i) { vec_ast.push_back(Asteroide()); // Creación del objeto Asteroide vec_ast[i].set_pos_x(xdist(re)); // Asignación de la coordenada x vec_ast[i].set_pos_y(ydist(re)); // Asignación de la coordenada y vec_ast[i].set_m(mdist(re)); // Asignación de la masa } // Vector que almacena instancias de la clase Planeta vector <Planeta> vec_pla; for (int i = 0; i < num_planetas; ++i) { switch (i%4) // Hay 4 formas de crear los Planetas. Se distinguen mediante la operación módulo 4. { case 0: vec_pla.push_back(Planeta()); // Creación del objeto Planeta vec_pla[i].set_pos_x(0); // Asignación de la coordenada x vec_pla[i].set_pos_y(ydist(re)); // Asignación de la coordenada y vec_pla[i].set_m(mdist(re) * 10); // Asignación de la masa break; case 1: vec_pla.push_back(Planeta()); vec_pla[i].set_pos_x(xdist(re)); vec_pla[i].set_pos_y(0); vec_pla[i].set_m(mdist(re) * 10); break; case 2: vec_pla.push_back(Planeta()); vec_pla[i].set_pos_x(width); vec_pla[i].set_pos_y(ydist(re)); vec_pla[i].set_m(mdist(re) * 10); break; case 3: vec_pla.push_back(Planeta()); vec_pla[i].set_pos_x(xdist(re)); vec_pla[i].set_pos_y(height); vec_pla[i].set_m(mdist(re) * 10); break; } } Rayo death_star(0, pos_rayo); // Creación del objeto Rayo y asignación de las coordenadas // Se almacenan los datos generados en el fichero init_conf.txt FILE * initFile; initFile = fopen("init_conf-alt.txt", "w"); fprintf(initFile, "%d %d %d %.3f %d\n", num_asteroides, num_iteraciones, num_planetas, pos_rayo, semilla); // Argumentos introducidos for (unsigned int i = 0; i < vec_ast.size(); ++i) { fprintf(initFile, "%.3f %.3f %.3f\n", vec_ast[i].get_pos_x(), vec_ast[i].get_pos_y(), vec_ast[i].get_m()); // Vector de Asteroides } for (unsigned int i = 0; i < vec_pla.size(); ++i) { fprintf(initFile, "%.3f %.3f %.3f\n", vec_pla[i].get_pos_x(), vec_pla[i].get_pos_y(), vec_pla[i].get_m()); // Vector de Planetas } fprintf(initFile, "%.3f %.3f\n", death_star.get_pos_x(), death_star.get_pos_y()); // Rayo fclose(initFile); // Bucle para el número de iteraciones // Variables temporales utilizadas en los cálculos, sólo se declaran una vez. double distancia_no_sqrt, distancia_real; double pendiente, angulo, temp_fuer, temp_fuer_x, temp_fuer_y, ast1_pos_x, ast1_pos_y, ast1_mas, ast2_pos_x, ast2_pos_y, ast2_mas, pla1_pos_x, pla1_pos_y, pla1_mas; for (int i = 0; i < num_iteraciones; ++i) { for (unsigned int j = 0; j < vec_ast.size(); ++j) // Iterador principal de Asteroides { // Se extraen los datos del asteroide j ast1_pos_x = vec_ast[j].get_pos_x(); // Asteroide j, coordenada x ast1_pos_y = vec_ast[j].get_pos_y(); // Asteroide j, coordenada y ast1_mas = vec_ast[j].get_m(); // Asteroide j, masa //Cálculo de fuerzas Asteroide -> Asteroide for (unsigned int k = 0; k < vec_ast.size(); ++k) // Iterador secundario de Asteroides { // Se extraen los datos del asteroide k ast2_pos_x = vec_ast[k].get_pos_x(); // Asteroide k, coordenada x ast2_pos_y = vec_ast[k].get_pos_y(); // Asteroide k, coordenada y ast2_mas = vec_ast[k].get_m(); // Asteroide k, masa // Distancia sin aplicar la raíz cuadrada, para más precisión en el cálculo de la fuerza, ya que se evita hacer la raíz y después elevar al cuadrado distancia_no_sqrt = ((ast1_pos_x - ast2_pos_x) * (ast1_pos_x - ast2_pos_x)) + ((ast1_pos_y - ast2_pos_y) * (ast1_pos_y - ast2_pos_y)); distancia_real = sqrt(distancia_no_sqrt); if (distancia_real > dmin) { pendiente = (ast2_pos_y - ast1_pos_y) / (ast2_pos_x - ast1_pos_x); // Cálculo de la pendiente if (!isinf(pendiente) && (pendiente > 1 || pendiente < -1)) { pendiente -= trunc(pendiente); // Truncado de la pendiente } angulo = atan(pendiente); // Cálculo del ángulo de efecto temp_fuer = gravity * ast1_mas * ast2_mas / distancia_no_sqrt; // Fuerza total if (temp_fuer > 200) { temp_fuer = 200; // Truncado de la fuerza } temp_fuer_x = temp_fuer * cos(angulo); // Componente x de la fuerza total temp_fuer_y = temp_fuer * sin(angulo); // Componente y de la fuerza total // vec_ast[j].set_fue_x(vec_ast[j].get_fue_x() - temp_fuer_x); // Al asteroide j se le suma // vec_ast[j].set_fue_y(vec_ast[j].get_fue_y() - temp_fuer_y); vec_ast[k].set_fue_x(vec_ast[k].get_fue_x() + temp_fuer_x); // Al asteroide k se le resta vec_ast[k].set_fue_y(vec_ast[k].get_fue_y() + temp_fuer_y); } } } for (unsigned int j = 0; j < vec_pla.size(); ++j) { pla1_pos_x = vec_pla[j].get_pos_x(); pla1_pos_y = vec_pla[j].get_pos_y(); pla1_mas = vec_pla[j].get_m(); // Cálculo de fuerzas Planeta -> Asteroide for (unsigned int k = 0; k < vec_ast.size(); ++k) // Iterador de Planetas { // Acumulación de fuerzas en las variables fuerza_x y fuerza_y ast2_pos_x = vec_ast[k].get_pos_x(); ast2_pos_y = vec_ast[k].get_pos_y(); ast2_mas = vec_ast[k].get_m(); distancia_no_sqrt = ((pla1_pos_x - ast2_pos_x) * (pla1_pos_x - ast2_pos_x)) + ((pla1_pos_y - ast2_pos_y) * (pla1_pos_y - ast2_pos_y)); pendiente = (ast2_pos_y - pla1_pos_y) / (ast2_pos_x - pla1_pos_x); if (!isinf(pendiente) && (pendiente > 1 || pendiente < -1)) { pendiente -= trunc(pendiente); } angulo = atan(pendiente); temp_fuer = gravity * pla1_mas * ast2_mas / distancia_no_sqrt; if (temp_fuer > 200) { temp_fuer = 200; } temp_fuer_x = temp_fuer * cos(angulo); temp_fuer_y = temp_fuer * sin(angulo); vec_ast[k].set_fue_x(vec_ast[k].get_fue_x() + temp_fuer_x); vec_ast[k].set_fue_y(vec_ast[k].get_fue_y() + temp_fuer_y); } } // Aplicación de las aceleraciones para obtener las nuevas posiciones y velocidades for (unsigned int j = 0; j < vec_ast.size(); ++j) { // Se calculan y aplican las aceleraciones vec_ast[j].set_acc_x(vec_ast[j].get_fue_x() / vec_ast[j].get_m()); vec_ast[j].set_acc_y(vec_ast[j].get_fue_y() / vec_ast[j].get_m()); // Se calculan y aplican las velocidades vec_ast[j].set_vel_x(vec_ast[j].get_vel_x() + vec_ast[j].get_acc_x() * delta_t); vec_ast[j].set_vel_y(vec_ast[j].get_vel_y() + vec_ast[j].get_acc_y() * delta_t); // Se calculan y aplican las nuevas posiciones vec_ast[j].set_pos_x(vec_ast[j].get_pos_x() + vec_ast[j].get_vel_x() * delta_t); vec_ast[j].set_pos_y(vec_ast[j].get_pos_y() + vec_ast[j].get_vel_y() * delta_t); // Se ponen las fuerzas a 0 para la siguiente iteración. vec_ast[j].set_fue_x(0); vec_ast[j].set_fue_y(0); // El efecto rebote se aplica después de los cálculos, para asegurar que no se guardan valores erróneos en out.txt if (vec_ast[j].get_pos_x() <= 0) // Efecto rebote x <= 0 { vec_ast[j].set_pos_x(2); vec_ast[j].set_vel_x(-vec_ast[j].get_vel_x()); } if (vec_ast[j].get_pos_y() <= 0) // Efecto rebote y <= 0 { vec_ast[j].set_pos_y(2); vec_ast[j].set_vel_y(-vec_ast[j].get_vel_y()); } if (vec_ast[j].get_pos_x() >= width) // Efecto rebote x >= width { vec_ast[j].set_pos_x(width - 2); vec_ast[j].set_vel_x(-vec_ast[j].get_vel_x()); } if (vec_ast[j].get_pos_y() >= height) // Efecto rebote y >= height { vec_ast[j].set_pos_y(height - 2); vec_ast[j].set_vel_y(-vec_ast[j].get_vel_y()); } } // Ejecución del rayo destructor // Bucle que recorre el vector de asteroides y elimina los que deban ser destruidos con erase() // Credit: https://stackoverflow.com/a/23383451 if(!vec_ast.empty()) { for(int j = vec_ast.size() - 1; j >= 0; j--) { if(abs(vec_ast.at(j).get_pos_y() - death_star.get_pos_y()) <= ray_width/2) { vec_ast.erase(vec_ast.begin() + j); } } } } // Se almacenan los resultados en el fichero out.txt FILE * outFile; outFile = fopen("out-alt.txt", "w"); for (unsigned int i = 0; i < vec_ast.size(); ++i) { fprintf(outFile, "%.3f %.3f %.3f %.3f %.3f\n", vec_ast[i].get_pos_x(), vec_ast[i].get_pos_y(), vec_ast[i].get_vel_x(), vec_ast[i].get_vel_y(), vec_ast[i].get_m()); } fclose(outFile); return 0; }
[ "31384686+PabloNapster@users.noreply.github.com" ]
31384686+PabloNapster@users.noreply.github.com
c2842c2268fc99cf844479cd5f19c2ff74544d83
c00ce35c4eacee2ccc86eb967f868fcd3be07146
/Exceptions/ExceptionBase.h
77095db196a0a2a34733b62327801fb6b6ceb7c7
[]
no_license
vkochano1/RoeLang
acc024103d4f7995f2067148f2ee9ca8bef13305
59058e7be5cd8908552526703bce249be5c2ed50
refs/heads/master
2022-08-11T02:42:04.906874
2022-08-03T04:07:23
2022-08-03T04:07:23
131,551,794
0
0
null
null
null
null
UTF-8
C++
false
false
706
h
#pragma once #include <exception> #include <iostream> #include <sstream> #include <string> namespace roe { class ExceptionBase : public std::exception { public: ExceptionBase(const std::string& text = "") { if (text.length()) ostrm_ << text; } ExceptionBase(const ExceptionBase& exception) { ostrm_ << exception.ostrm_.str(); } template<typename T> ExceptionBase& operator<<(const T& val) { ostrm_ << val; return *this; } const char* what() const noexcept override { out_ = ostrm_.str().c_str(); return out_.c_str(); } private: std::ostringstream ostrm_; mutable std::string out_; }; }
[ "vladimir.kochanov.g@gmail.com" ]
vladimir.kochanov.g@gmail.com
1d445b0c1752bf3d8e82d332c118acc6661f1de4
f202a89cba0f6cd05393a02103a1a887decb2561
/Chapter4/chapter4.4/chapter4.4/chapter4.4.cpp
366882afbd384663eab93a824fbd224b1f8d4579
[]
no_license
Twice22/acceleratedcpp
380fbca687a3ae940ede2135fe6df339abfb5d7f
1165ffcc7e54ec36807db3d38fe04187dc38f0bf
refs/heads/master
2021-01-22T12:17:53.231559
2017-05-31T08:42:45
2017-05-31T08:42:45
92,711,421
0
0
null
null
null
null
ISO-8859-1
C++
false
false
1,351
cpp
// chapter4.4.cpp : définit le point d'entrée pour l'application console. // #include "stdafx.h" #include <iostream> #include <string> #include <iomanip> #include <algorithm> using namespace std; int digits(double n, int nb_decimal) { int result = nb_decimal + 1; // nb decimal + floating point if (n < 0) { result++; // add space for negative sign } while (n >= 1) { ++result; n /= 10; } return result; } int digits(int n) { int result = 0; if (n < 0) { result++; // add space for negative sign } while (n >= 1) { ++result; n /= 10; } return result; } int main() { cout << "Program that computes the square of the integers in range [a,b)\n" "lower bound a: "; double a; cin >> a; cout << "upper bound b: "; double b; cin >> b; double square = 0; int pad = 1; int accuracy = 2; int max_single = max(digits(a, accuracy), digits(b, accuracy)); int max_square = max(digits(a * a, accuracy), digits(b * b, accuracy)); int single_accuracy = max(digits(a), digits(b)) + accuracy; int square_accuracy = max(digits(a * a), digits(b * b)) + accuracy; for (double i = a; i < b; i += 1) { square = i * i; cout << setprecision(single_accuracy) << setw(max_single + pad) << i << setprecision(square_accuracy) << setw(max_square + pad) << square << endl; } system("pause"); return 0; }
[ "victor.busa@gmail.com" ]
victor.busa@gmail.com
8721e9cf46ec6f09959eb44c02e83b0460309e94
560d6f11bd9f006dcd65c445708562f513359a08
/str2int/main.cpp
cc06f469ad6ff3cd57809b1f212c70b7722b949d
[]
no_license
caoh8/string
54c9e77b2fd9ee4fcbb103eb147b91d3041bec56
ecaa370aa933ef09410e417783ad908c86c2c380
refs/heads/master
2020-03-27T20:40:05.101102
2018-09-10T08:56:53
2018-09-10T08:56:53
147,084,711
0
0
null
null
null
null
UTF-8
C++
false
false
1,828
cpp
#include <iostream> using namespace std; // 1判断正负 // 2判断溢出 bool str2int(char* s, int &result) { bool ret = true; static const int MAX_INT = (int)((unsigned)~0 >> 1); static const int MIN_INT = -(int)((unsigned)~0 >> 1) -1;//边界 int n = 0; int sign = 1; if(s!=NULL) { if(*s) { if(*s == '-') { sign = -1; s++; } if(*s == '+') { // sign = 1; s++; } while(*s) { if(*s>='0' || *s<='9') { int c = *s - '0'; if(sign>0 && (n > MAX_INT/10 || (n == MAX_INT/10 && c > MAX_INT%10))) { cout << "out range in str2int" << endl; ret = false; break; } else if(sign<0 && (n < MIN_INT/10 || (n == MIN_INT/10 && -c < MIN_INT%10))) { cout << "out range in str2int" << endl; ret = false; break; } n = n*10+sign*c; s++; } else { ret = false; break; } } } else { ret = false; } } else { ret = false; } if(ret) result = n; return ret; } int main() { cout << "Hello World!" << endl; char *s = "147483647"; int n = 0; cout << str2int(s, n) << endl; cout << n << endl; int MAX = -(int)((unsigned)~0>>1)-1; cout << MAX << endl; return 0; }
[ "34362005+caoh8@users.noreply.github.com" ]
34362005+caoh8@users.noreply.github.com
fc3a4c2cfacc8d02478e401bbf66f099a9c79bd6
c8e5db1b480007358485e38654faf046ff465b93
/privatechatdlg.h
0f08855a11c71d9fb21ae16e8e5c35280f8c8883
[]
no_license
hk029/LetChat
836adc02a55e7af9ed4a98ddfeaf16970f1fa4f5
578afb7c6f58ee18dd3da7dc29360389fdba80cb
refs/heads/master
2021-01-21T14:09:17.478971
2016-06-23T11:57:01
2016-06-23T11:57:01
58,214,306
0
2
null
2016-05-23T11:29:13
2016-05-06T14:50:18
Groff
UTF-8
C++
false
false
1,153
h
#ifndef PRIVATECHATDLG_H #define PRIVATECHATDLG_H #include <QDialog> #include "allsetting.h" namespace Ui { class PrivateChatDlg; } class PrivateChatDlg : public QDialog { Q_OBJECT public: explicit PrivateChatDlg(QWidget *parent = 0); PrivateChatDlg(QUdpSocket *s); ~PrivateChatDlg(); void setSocket(QUdpSocket *s); void setName(QString n,QString oth); void refreshtext(); QString getName(); bool setHostIP(QString); QString MakeMsg(QString str,int type); int ResolveMsg(QByteArray bytes); int SendMsg(QString str,QHostAddress host); QUdpSocket *socket; signals: void closedlg(); protected: void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); void paintEvent(QPaintEvent *event); private slots: void on_icon_close_clicked(); void processPendingDatagram(); void on_icon_mini_clicked(); void on_sendMsg_textChanged(); void on_sendButton_clicked(); private: Ui::PrivateChatDlg *ui; QString name; QString OtherName; QHostAddress *hostIP; QPoint dPos; QPixmap bkg; }; #endif // PRIVATECHATDLG_H
[ "hk2291976@hotmail.com" ]
hk2291976@hotmail.com
f83aca584e416fcb8e21120f56d3cb77c6ae9b36
4d6c849c141576f11ac744852b3f83effcf3d7ac
/Framework/Framework.cpp
9c54fedc0b6886c8947750514d8fd811d7a0a75d
[]
no_license
minjun3021/Minjun-want-to-sleep
7be4706f1c9eeb932e8fc626bd33351f09ac73fe
8cae45b43490bd13198b464216004558c6b2c250
refs/heads/master
2020-09-19T16:45:21.906129
2019-11-26T17:25:24
2019-11-26T17:25:24
224,246,554
0
0
null
null
null
null
UTF-8
C++
false
false
1,461
cpp
#include "stdafx.h" #include "Framework.h" #include "TimeManager.h" #include "Audio.h" Framework::Framework() { } void Framework::Run(Scene* startScene, const wchar_t* title, int width, int height, bool isFullScreen) { if (SUCCEEDED(CoInitialize(NULL))) { if (winApp.Initialize(title, width, height, isFullScreen)) { if (d2dApp.Initialize()) { bool audioInitialized=Audio::GetInstance()->Initialize(); Scene::currentScene = startScene; Scene::currentScene->Initialize(); StartGameLoop(); SAFE_DELETE(Scene::currentScene); SAFE_DELETE(Scene::nextScene); if (audioInitialized) Audio::GetInstance()->Uninitialize(); d2dApp.Uninitialize(); } } CoUninitialize(); } } void Framework::StartGameLoop() { MSG msg; ZeroMemory(&msg, sizeof(MSG)); d2dApp.LoadBitmapFromFile(L"a.png", 400, 0, &d2dApp.example); while (msg.message != WM_QUIT) { if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } //Check Input InputManager:: UpdateKeyState(); TimeManager::UpdateTime(); //Update World Scene::currentScene->Update(); Scene::currentScene->Render(); //Change Scene Scene::SwapScene(); } } Framework& Framework::GetInstance() { static Framework f; return f; } WinApp& Framework::GetWinApp() { return winApp; } D2DApp& Framework::GetD2DApp() { return d2dApp; } InputManager& Framework::GetInputManager() { return inputManager; }
[ "minjun3021@naver.com" ]
minjun3021@naver.com
d57af50cfc33852781ebfb8aef6024a327961844
e23df89e27ae7182f4d900fad1b9969758345298
/src/Input.h
6738e961f13e6ede3da3fe69f0b935576abf2d71
[]
no_license
S-Erase/TSP-Solver
1b24e4250f097917b70d285019266363937bf18a
8cb9a0ff9fe7260cc5dcf1a3d9bbf1b9f713dbfe
refs/heads/main
2023-01-29T18:04:50.353371
2020-12-14T18:21:23
2020-12-14T18:21:23
289,690,788
0
0
null
2020-11-18T12:33:40
2020-08-23T13:23:46
C++
UTF-8
C++
false
false
1,401
h
#pragma once #include <SDL.h> #include <SDL_image.h> #include <algorithm> #include "Selection.h" #include "Vertex.h" class Input { private: //Mouse variables static int mx0, my0, mx1, my1; static SDL_Rect mrect; static int mx, my; static bool mousedown; //Keyboard variables static bool shiftpressed; static bool ctrlpressed; static bool altpressed; static bool shiftpressed2; static bool ctrlpressed2; static bool altpressed2; public: static inline int GetMouseX() { return mx; } static inline int GetMouseY() { return my; } static inline bool IsMousePressed() { return mousedown; } static inline int GetMouseXAtMousePress() { return mx0; } static inline int GetMouseYAtMousePress() { return my0; } static inline SDL_Rect* GetMouseRectanglePointer() { return &mrect; } static inline bool IsShiftPressed() { return shiftpressed; } static inline bool IsCtrlPressed() { return ctrlpressed; } static inline bool IsAltPressed() { return altpressed; } static inline bool WasShiftPressedAtMousePress() { return shiftpressed2; } static inline bool WasCtrlPressedAtMousePress() { return ctrlpressed2; } static inline bool WasAltPressedAtMousePress() { return altpressed2; } static void Update(SDL_Event& EV); static bool IsMouseInRectangle(SDL_Rect rect); static bool IsVertexInMouseRectangle(Vertex<int> v); static bool IsMouseInRoundedRectangle(SDL_Rect rect, double p); };
[ "campbellsimon666@gmail.com" ]
campbellsimon666@gmail.com
fdd1010dde08051b3ae4fd5c61edc15602a211a8
9f44962b463e4bb8fe7c22c3996ee7a2993bde7d
/pnt/labelchild.cpp
6979f87eafcbcf7fd231ce1809b693845d6ef6d6
[]
no_license
vertil/pnt
37ae9f08b45a29586ea8c5e94347aaeef0b0d321
f02d2e5f24b80584f3b761fe5d963d508b2626b9
refs/heads/master
2020-05-25T12:36:40.417278
2019-06-24T11:37:30
2019-06-24T11:37:30
187,802,660
0
0
null
null
null
null
UTF-8
C++
false
false
2,946
cpp
#include "labelchild.h" labelchild::labelchild(QWidget *parent) { } labelchild::~labelchild() { } void labelchild::mousePressEvent(QMouseEvent *event) { x=event->x(); y=event->y(); move=true; } void labelchild::mouseMoveEvent(QMouseEvent *event) { x1=event->x(); y1=event->y(); update(); } void labelchild::paintEvent(QPaintEvent *event) { setTool(); QPainter paint(&image); QPainter paintthis(this); paint.setPen(QPen(QBrush(QColor(mian->getColor())),mian->getPenSize())); paintthis.setPen(QPen(QBrush(QColor(mian->getColor())),mian->getPenSize())); paintthis.drawPixmap(0,0,image); if(x!=NULL) switch (tool) { case 0: ; if(move==true) { paintthis.drawLine(x,y,x1,y1); }else{ paint.drawLine(x,y,x2,y2); paintthis.drawPixmap(0,0,image); nullXY(); } break; case 1: if(move==true) { paintthis.drawEllipse(x,y,x1,x1); }else{ paint.drawEllipse(x,y,x2,x2); paintthis.drawPixmap(0,0,image); nullXY(); } break; case 2: if(move==true) { paintthis.drawRect(x,y,x1,y1); }else{ paint.drawRect(x,y,x2,y2); paintthis.drawPixmap(0,0,image); nullXY(); } break; case 3: if(move==true) { paintthis.drawEllipse(x,y,x1,y1); }else{ paint.drawEllipse(x,y,x2,y2); paintthis.drawPixmap(0,0,image); nullXY(); } break; } } void labelchild::mouseReleaseEvent(QMouseEvent *event) { move =false; x2=event->x(); y2=event->y(); update(); } void labelchild::nullXY() { x=NULL; y=NULL; x1=NULL; y1=NULL; x2=NULL; y2=NULL; } /*void labelchild::addline() { QPainter p(this); p.drawLine(x,y,x1,y1); p.end(); this->update(); }*/ void labelchild::setimage_(QPixmap *r) { image=*r; this->setPixmap(image); this->setSizeIncrement(image.size()); //after setpixmap i write qpainter to draw pixmap and not work, but in paint event; } void labelchild::saveimage() { QFile file(QFileDialog::getSaveFileName(this, tr("Save File"), "/home/jana/untitled.png", tr("Images (*.png *.xpm *.jpg)"))); file.open(QIODevice::WriteOnly); image.save(&file); } void labelchild::setsize(int a, int b) { this->resize(a,b); } void labelchild::setTool() { tool=mian->getTool(); }
[ "vertil98@gmail.com" ]
vertil98@gmail.com
059f75c61c79a05053eaa290e32d3bff0bd7b785
3a60ecb48b1a045fc86f80231371e1d038721d21
/Source/Gui/Oscilloscope/Mask/MenuMask.h
49efc046be3162814522896eed2212b3cdef650c
[]
no_license
jagdeepsingh02/DS203
4ba749ac3a8906f6138894cd9ad871b3fa16336f
d4164dba6d68aa794e674e6a7eee7f17d406a860
refs/heads/master
2021-01-19T10:18:03.481253
2012-12-15T18:19:10
2012-12-15T18:19:10
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,281
h
#ifndef __MENUMASK_H__ #define __MENUMASK_H__ #include <Source/Core/Controls.h> #include <Source/Core/ListItems.h> #include <Source/Core/Settings.h> #include <Source/Gui/Oscilloscope/Controls/GraphOsc.h> #include "../Disp/ItemDisp.h" class CMIButton : public CWndMenuItem { public: virtual void Create(const char* pszId, ui16 clr, CWnd *pParent) { CWndMenuItem::Create( pszId, clr, 2, pParent); } virtual void OnPaint() { CWndMenuItem::OnPaint(); } virtual void OnKey(ui16 nKey) { if ( nKey & ( BIOS::KEY::KeyEnter | BIOS::KEY::KeyLeft | BIOS::KEY::KeyRight ) ) SendMessage( GetParent(), CWnd::WmKey, nKey ); CWnd::OnKey( nKey ); } }; class CWndMenuMask : public CWnd { public: enum EAction { ActionNone = 0, ActionBeep = 1, ActionBeepStop = 2, ActionStop = 3, ActionMax = ActionStop }; static const char* const m_ppszTextAction[]; public: // Menu items CMIButton m_btnSource; CMIButton m_btnReset; CMIButton m_btnCollect; CMIButton m_btnStop; //CMIButton m_btnAction; CMIButton m_btnExpand; CMIButton m_btnBlur; CMPItem m_itmAction; CProviderEnum m_proAction; EAction m_Action; virtual void Create(CWnd *pParent, ui16 dwFlags); virtual void OnMessage(CWnd* pSender, ui16 code, ui32 data); }; #endif
[ "gabonator@inmail.sk" ]
gabonator@inmail.sk
8f304afb07492c5171f4dee2bd6badfadbab529f
0ca3d403b5794f55ef3999a4f9c5bb44fa4c602d
/src/xtd.core/include/xtd/net/cookie_exception.h
b42860d793a24b885c30ca01831bc8c1905dfa36
[ "MIT" ]
permissive
ExternalRepositories/xtd
3bf26ff9bced18263f4d1a9bd551addd9976e115
5889d69900ad22a00fcb640d7850a1d599cf593a
refs/heads/master
2023-07-15T16:52:14.008306
2021-08-26T20:25:22
2021-08-26T20:25:22
375,167,847
0
0
null
null
null
null
UTF-8
C++
false
false
7,935
h
/// @file /// @brief Contains xtd::net::cookie_exception exception. /// @copyright Copyright (c) 2021 Gammasoft. All rights reserved. #pragma once #include "../format_exception.h" /// @brief The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more. namespace xtd { /// @brief The xtd::net namespace provides a simple programming interface for many of the protocols used on networks today. The xtd::net::web_request and xtd::net::web_response classes form the basis of what are called pluggable protocols, an implementation of network services that enables you to develop applications that use Internet resources without worrying about the specific details of the individual protocols. namespace net { /// @brief The exception that is thrown when an error is made adding a xtd::net::cookie to a xtd::net::cookie_container. /// @par Library /// xtd.core /// @ingroup xtd_core exceptions /// @par Examples /// The following example demonstrates how to throw and catch an cookie_exception. /// @include cookie_exception.cpp class cookie_exception : public format_exception { public: /// @brief Create a new instance of class cookie_exception /// @param information (optional) Conatains current information about memeber name, file path and line number in the file where the exception is occurred. Typically #current_stack_frame_. /// @remarks Message is set with the default message associate to the exception. cookie_exception(const xtd::diagnostics::stack_frame& info = xtd::diagnostics::stack_frame::empty()) : format_exception(default_message(), info) {} /// @brief Create a new instance of class cookie_exception /// @param message Message string associate to the exception. /// @param information (optional) Conatains current information about memeber name, file path and line number in the file where the exception is occurred. Typically #current_stack_frame_. explicit cookie_exception(const xtd::ustring& message, const xtd::diagnostics::stack_frame& info = xtd::diagnostics::stack_frame::empty()) : format_exception(message, info) {} /// @brief Create a new instance of class cookie_exception /// @param message Message string associate to the exception. /// @param error Error code associate to the exception. /// @param information (optional) Conatains current information about memeber name, file path and line number in the file where the exception is occurred. Typically #current_stack_frame_. explicit cookie_exception(const xtd::ustring& message, const std::error_code& error, const xtd::diagnostics::stack_frame& info = xtd::diagnostics::stack_frame::empty()) : format_exception(message, error, info) {} /// @brief Create a new instance of class cookie_exception /// @param message Message string associate to the exception. /// @param help_link Help link string associate to the exception. /// @param information (optional) Conatains current information about memeber name, file path and line number in the file where the exception is occurred. Typically #current_stack_frame_. explicit cookie_exception(const xtd::ustring& message, const xtd::ustring& help_link, const xtd::diagnostics::stack_frame& info = xtd::diagnostics::stack_frame::empty()) : format_exception(message, help_link, info) {} /// @brief Create a new instance of class cookie_exception /// @param message Message string associate to the exception. /// @param error Error code associate to the exception. /// @param help_link Help link string associate to the exception. explicit cookie_exception(const xtd::ustring& message, const std::error_code& error, const xtd::ustring& help_link, const xtd::diagnostics::stack_frame& info = xtd::diagnostics::stack_frame::empty()) : format_exception(message, error, help_link, info) {} /// @brief Create a new instance of class cookie_exception /// @param inner_exception The exception that is the cause of the current exception. /// @param information (optional) Conatains current information about memeber name, file path and line number in the file where the exception is occurred. Typically #current_stack_frame_. /// @remarks Message is set with the default message associate to the exception. cookie_exception(const std::exception& inner_exception, const xtd::diagnostics::stack_frame& info = xtd::diagnostics::stack_frame::empty()) : format_exception(default_message(), inner_exception, info) {} /// @brief Create a new instance of class cookie_exception /// @param message Message string associate to the exception. /// @param inner_exception The exception that is the cause of the current exception. /// @param information (optional) Conatains current information about memeber name, file path and line number in the file where the exception is occurred. Typically #current_stack_frame_. explicit cookie_exception(const xtd::ustring& message, const std::exception& inner_exception, const xtd::diagnostics::stack_frame& info = xtd::diagnostics::stack_frame::empty()) : format_exception(message, inner_exception, info) {} /// @brief Create a new instance of class cookie_exception /// @param message Message string associate to the exception. /// @param inner_exception The exception that is the cause of the current exception. /// @param error Error code associate to the exception. /// @param information (optional) Conatains current information about memeber name, file path and line number in the file where the exception is occurred. Typically #current_stack_frame_. explicit cookie_exception(const xtd::ustring& message, const std::exception& inner_exception, const std::error_code& error, const xtd::diagnostics::stack_frame& info = xtd::diagnostics::stack_frame::empty()) : format_exception(message, inner_exception, error, info) {} /// @brief Create a new instance of class cookie_exception /// @param message Message string associate to the exception. /// @param inner_exception The exception that is the cause of the current exception. /// @param help_link Help link string associate to the exception. /// @param information (optional) Conatains current information about memeber name, file path and line number in the file where the exception is occurred. Typically #current_stack_frame_. explicit cookie_exception(const xtd::ustring& message, const std::exception& inner_exception, const xtd::ustring& help_link, const xtd::diagnostics::stack_frame& info = xtd::diagnostics::stack_frame::empty()) : format_exception(message, inner_exception, help_link, info) {} /// @brief Create a new instance of class cookie_exception /// @param message Message string associate to the exception. /// @param inner_exception The exception that is the cause of the current exception. /// @param error Error code associate to the exception. /// @param help_link Help link string associate to the exception. /// @param information (optional) Conatains current information about memeber name, file path and line number in the file where the exception is occurred. Typically #current_stack_frame_. explicit cookie_exception(const xtd::ustring& message, const std::exception& inner_exception, const std::error_code& error, const xtd::ustring& help_link, const xtd::diagnostics::stack_frame& info = xtd::diagnostics::stack_frame::empty()) : format_exception(message, inner_exception, error, help_link, info) {} /// @cond cookie_exception(const cookie_exception&) = default; cookie_exception& operator=(const cookie_exception&) = default; /// @endcond private: const char* default_message() const {return "One of identified items is an invalid format."_t;} }; } }
[ "gammasoft71@gmail.com" ]
gammasoft71@gmail.com
7d4884a384dbfe268fd21be76de7f834fd897aa3
cf8ddfc720bf6451c4ef4fa01684327431db1919
/SDK/ARKSurvivalEvolved_DinoColorSet_Quetz_Bionic_parameters.hpp
c64d264073869db0cde551a7f28ae6c99b4b87eb
[ "MIT" ]
permissive
git-Charlie/ARK-SDK
75337684b11e7b9f668da1f15e8054052a3b600f
c38ca9925309516b2093ad8c3a70ed9489e1d573
refs/heads/master
2023-06-20T06:30:33.550123
2021-07-11T13:41:45
2021-07-11T13:41:45
null
0
0
null
null
null
null
UTF-8
C++
false
false
752
hpp
#pragma once // ARKSurvivalEvolved (329.9) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "ARKSurvivalEvolved_DinoColorSet_Quetz_Bionic_classes.hpp" namespace sdk { //--------------------------------------------------------------------------- //Parameters //--------------------------------------------------------------------------- // Function DinoColorSet_Quetz_Bionic.DinoColorSet_Quetz_Bionic_C.ExecuteUbergraph_DinoColorSet_Quetz_Bionic struct UDinoColorSet_Quetz_Bionic_C_ExecuteUbergraph_DinoColorSet_Quetz_Bionic_Params { int EntryPoint; // (Parm, ZeroConstructor, IsPlainOldData) }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "sergey.2bite@gmail.com" ]
sergey.2bite@gmail.com
ec11bcc8225a33b0946e2a535f2d0a243d40a2ea
ba9084a829d22f7788e8fd7088f833e6d48a3c81
/module_04/ex02/ISquad.hpp
a62038e7ea0b2bd98917353c9106ab82321cee70
[]
no_license
Kwevan/piscine_cpp
3f86246ced4361c3bbd2de696c82947b94e6e536
923b1784486d7d80de6ae4f8703be75c48090d9c
refs/heads/master
2023-03-01T06:32:02.519665
2021-02-11T09:20:45
2021-02-11T09:20:45
320,617,065
0
0
null
null
null
null
UTF-8
C++
false
false
246
hpp
#ifndef ISQUAD_HPP #define ISQUAD_HPP # include "ISpaceMarine.hpp" class ISquad { public: virtual ~ISquad(){} virtual int getCount() const = 0; virtual ISpaceMarine* getUnit(int) const = 0; virtual int push(ISpaceMarine*) = 0; }; #endif
[ "kyg972@msn.com" ]
kyg972@msn.com
8fbd05b0b0fa12b1a95622d1a58e2533ddec41ca
1038fd8f34b8f978daf9ac8687b949caabb7b74d
/src/test/search/SCRDetectorTest.cpp
4a9ada40e20a43caefc3592ab35f453c1a3e894d
[ "MIT" ]
permissive
play3577/sunfish4
14dca0c345e621f26480a83a238090c8067561df
a512c031f360a0e31dab5d39227fc4d91a93058f
refs/heads/master
2021-07-01T21:07:39.259850
2017-09-17T15:33:36
2017-09-17T15:33:36
null
0
0
null
null
null
null
UTF-8
C++
false
false
16,650
cpp
/* SCRDetectorTest.cpp * * Kubo Ryosuke */ #include "test/Test.hpp" #include "core/util/PositionUtil.hpp" #include "search/tree/Tree.hpp" #include "search/shek/SCRDetector.hpp" using namespace sunfish; namespace { const char* PosStrBlackNoCheck = "P1-KY-KE-GI-KI-OU-KI-GI-KE-KY\n" "P2 * -HI * * * * * -KA * \n" "P3-FU-FU-FU-FU-FU-FU-FU-FU-FU\n" "P4 * * * * * * * * * \n" "P5 * * * * * * * * * \n" "P6 * * +FU * * * * * * \n" "P7+FU+FU * +FU+FU+FU+FU+FU+FU\n" "P8 * +KA * * * * * +HI * \n" "P9+KY+KE+GI+KI+OU+KI+GI+KE+KY\n" "P+\n" "P-\n" "-\n"; const char* PosStrBlackCheck = "P1-KY-KE-GI-KI-OU-KI-GI-KE-KY\n" "P2 * -HI * * * * * -KA * \n" "P3-FU-FU-FU-FU * -FU+UM-FU-FU\n" "P4 * * * * -FU * -FU * * \n" "P5 * * * * * * * * * \n" "P6 * * +FU * +FU * * * * \n" "P7+FU+FU * +FU * +FU+FU+FU+FU\n" "P8 * * * * * * * +HI * \n" "P9+KY+KE+GI+KI+OU+KI+GI+KE+KY\n" "P+\n" "P-\n" "-\n"; const char* PosStrBlackCheck2 = "P1-KY-KE-GI-KI-OU-KI-GI-KE-KY\n" "P2 * -HI * * * * * * * \n" "P3-FU-FU-FU-FU-FU-FU * -FU-FU\n" "P4 * * * * * * -FU * * \n" "P5 * * * * * * * * * \n" "P6 * * +FU-UM+FU * * * * \n" "P7+FU+FU * +FU * +FU+FU+FU+FU\n" "P8 * * * * * * * +HI * \n" "P9+KY+KE+GI+KI+OU+KI+GI+KE+KY\n" "P+\n" "P-00KA\n" "-\n"; const char* PosStrWhiteNoCheck = "P1-KY-KE-GI-KI-OU-KI-GI-KE-KY\n" "P2 * -HI * * * * * -KA * \n" "P3-FU-FU-FU-FU-FU-FU * -FU-FU\n" "P4 * * * * * * -FU * * \n" "P5 * * * * * * * * * \n" "P6 * * +FU * * * * * * \n" "P7+FU+FU * +FU+FU+FU+FU+FU+FU\n" "P8 * +KA * * * * * +HI * \n" "P9+KY+KE+GI+KI+OU+KI+GI+KE+KY\n" "P+\n" "P-\n" "+\n"; const char* PosStrWhiteCheck = "P1-KY-KE-GI-KI-OU-KI-GI-KE-KY\n" "P2 * -HI * * * * * * * \n" "P3-FU-FU-FU-FU-FU-FU * -FU-FU\n" "P4 * * * * * * -FU * * \n" "P5 * * * * * * * * * \n" "P6 * * +FU * +FU * * * * \n" "P7+FU+FU-UM+FU * +FU+FU+FU+FU\n" "P8 * * * * * * * +HI * \n" "P9+KY+KE+GI+KI+OU+KI+GI+KE+KY\n" "P+\n" "P-00KA\n" "+\n"; const char* PosStrWhiteCheck2 = "P1-KY-KE-GI-KI-OU-KI-GI-KE-KY\n" "P2 * -HI * * * * * -KA * \n" "P3-FU-FU-FU-FU * -FU * -FU-FU\n" "P4 * * * * -FU+UM-FU * * \n" "P5 * * * * * * * * * \n" "P6 * * +FU * +FU * * * * \n" "P7+FU+FU * +FU * +FU+FU+FU+FU\n" "P8 * * * * * * * +HI * \n" "P9+KY+KE+GI+KI+OU+KI+GI+KE+KY\n" "P+\n" "P-\n" "+\n"; }; TEST(SCRDetectorTest, testBlack) { { SCRDetector scr; scr.clear(); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrBlackNoCheck); tree.ply = 2; tree.nodes[0].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[0].hash = 0LLU; ASSERT_EQ(SCRState::None, scr.detect(tree)); } { SCRDetector scr; scr.clear(); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrBlackNoCheck); tree.ply = 6; tree.nodes[0].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[0].hash = tree.position.getHash(); tree.nodes[1].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[1].hash = 0LLU; tree.nodes[2].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[2].hash = tree.position.getHash(); tree.nodes[3].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[3].hash = 0LLU; tree.nodes[4].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[4].hash = tree.position.getHash(); tree.nodes[5].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[5].hash = 0LLU; ASSERT_EQ(SCRState::Draw, scr.detect(tree)); } { SCRDetector scr; scr.clear(); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrBlackCheck); tree.ply = 6; tree.nodes[0].checkState = { Square::s73(), Square::invalid() }; tree.nodes[0].hash = tree.position.getHash(); tree.nodes[1].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[1].hash = 0LLU; tree.nodes[2].checkState = { Square::s73(), Square::invalid() }; tree.nodes[2].hash = tree.position.getHash(); tree.nodes[3].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[3].hash = 0LLU; tree.nodes[4].checkState = { Square::s73(), Square::invalid() }; tree.nodes[4].hash = tree.position.getHash(); tree.nodes[5].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[5].hash = 0LLU; ASSERT_EQ(SCRState::Win, scr.detect(tree)); } { SCRDetector scr; scr.clear(); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrBlackCheck); tree.ply = 6; tree.nodes[0].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[0].hash = tree.position.getHash(); tree.nodes[1].checkState = { Square::s58(), Square::invalid() }; tree.nodes[1].hash = 0LLU; tree.nodes[2].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[2].hash = tree.position.getHash(); tree.nodes[3].checkState = { Square::s58(), Square::invalid() }; tree.nodes[3].hash = 0LLU; tree.nodes[4].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[4].hash = tree.position.getHash(); tree.nodes[5].checkState = { Square::s58(), Square::invalid() }; tree.nodes[5].hash = 0LLU; ASSERT_EQ(SCRState::Lose, scr.detect(tree)); } { SCRDetector scr; scr.clear(); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrBlackCheck); tree.ply = 8; tree.nodes[0].checkState = { Square::s73(), Square::invalid() }; tree.nodes[0].hash = tree.position.getHash(); tree.nodes[1].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[1].hash = 0LLU; tree.nodes[2].checkState = { Square::s73(), Square::invalid() }; tree.nodes[2].hash = tree.position.getHash(); tree.nodes[3].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[3].hash = 0LLU; tree.nodes[4].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[4].hash = 0LLU; tree.nodes[5].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[5].hash = 0LLU; tree.nodes[6].checkState = { Square::s73(), Square::invalid() }; tree.nodes[6].hash = tree.position.getHash(); tree.nodes[7].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[7].hash = 0LLU; ASSERT_EQ(SCRState::Draw, scr.detect(tree)); } { Record record; record.initialPosition = PositionUtil::createPositionFromCsaString(PosStrBlackNoCheck); record.moveList.push_back(Move(Square::s51(), Square::s62(), false)); record.moveList.push_back(Move(Square::s59(), Square::s68(), false)); record.moveList.push_back(Move(Square::s62(), Square::s51(), false)); record.moveList.push_back(Move(Square::s68(), Square::s59(), false)); record.moveList.push_back(Move(Square::s51(), Square::s62(), false)); record.moveList.push_back(Move(Square::s59(), Square::s68(), false)); record.moveList.push_back(Move(Square::s62(), Square::s51(), false)); record.moveList.push_back(Move(Square::s68(), Square::s59(), false)); SCRDetector scr; scr.registerRecord(record); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrBlackNoCheck); tree.ply = 2; tree.nodes[0].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[0].hash = tree.position.getHash(); tree.nodes[1].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[1].hash = 0LLU; ASSERT_EQ(SCRState::Draw, scr.detect(tree)); } { Record record; record.initialPosition = PositionUtil::createPositionFromCsaString(PosStrBlackCheck); record.moveList.push_back(Move(Square::s51(), Square::s62(), false)); record.moveList.push_back(Move(Square::s33(), Square::s44(), false)); record.moveList.push_back(Move(Square::s62(), Square::s51(), false)); record.moveList.push_back(Move(Square::s44(), Square::s33(), false)); record.moveList.push_back(Move(Square::s51(), Square::s62(), false)); record.moveList.push_back(Move(Square::s33(), Square::s44(), false)); record.moveList.push_back(Move(Square::s62(), Square::s51(), false)); record.moveList.push_back(Move(Square::s44(), Square::s33(), false)); SCRDetector scr; scr.registerRecord(record); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrBlackCheck); tree.ply = 2; tree.nodes[0].checkState = { Square::s33(), Square::invalid() }; tree.nodes[0].hash = tree.position.getHash(); tree.nodes[1].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[1].hash = 0LLU; ASSERT_EQ(SCRState::Win, scr.detect(tree)); } { Record record; record.initialPosition = PositionUtil::createPositionFromCsaString(PosStrBlackCheck2); record.moveList.push_back(Move(Square::s66(), Square::s77(), false)); record.moveList.push_back(Move(Square::s59(), Square::s48(), false)); record.moveList.push_back(Move(Square::s77(), Square::s66(), false)); record.moveList.push_back(Move(Square::s48(), Square::s59(), false)); record.moveList.push_back(Move(Square::s66(), Square::s77(), false)); record.moveList.push_back(Move(Square::s59(), Square::s48(), false)); record.moveList.push_back(Move(Square::s77(), Square::s66(), false)); record.moveList.push_back(Move(Square::s48(), Square::s59(), false)); SCRDetector scr; scr.registerRecord(record); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrBlackCheck2); tree.ply = 2; tree.nodes[0].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[0].hash = 0LLU; tree.nodes[1].checkState = { Square::s77(), Square::invalid() }; tree.nodes[1].hash = tree.position.getHash(); ASSERT_EQ(SCRState::Lose, scr.detect(tree)); } } TEST(SCRDetectorTest, testWhite) { { SCRDetector scr; scr.clear(); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrWhiteNoCheck); tree.ply = 2; tree.nodes[0].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[0].hash = 0LLU; ASSERT_EQ(SCRState::None, scr.detect(tree)); } { SCRDetector scr; scr.clear(); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrWhiteNoCheck); tree.ply = 6; tree.nodes[0].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[0].hash = tree.position.getHash(); tree.nodes[1].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[1].hash = 0LLU; tree.nodes[2].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[2].hash = tree.position.getHash(); tree.nodes[3].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[3].hash = 0LLU; tree.nodes[4].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[4].hash = tree.position.getHash(); tree.nodes[5].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[5].hash = 0LLU; ASSERT_EQ(SCRState::Draw, scr.detect(tree)); } { SCRDetector scr; scr.clear(); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrWhiteCheck); tree.ply = 6; tree.nodes[0].checkState = { Square::s73(), Square::invalid() }; tree.nodes[0].hash = tree.position.getHash(); tree.nodes[1].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[1].hash = 0LLU; tree.nodes[2].checkState = { Square::s73(), Square::invalid() }; tree.nodes[2].hash = tree.position.getHash(); tree.nodes[3].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[3].hash = 0LLU; tree.nodes[4].checkState = { Square::s73(), Square::invalid() }; tree.nodes[4].hash = tree.position.getHash(); tree.nodes[5].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[5].hash = 0LLU; ASSERT_EQ(SCRState::Win, scr.detect(tree)); } { SCRDetector scr; scr.clear(); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrWhiteCheck); tree.ply = 6; tree.nodes[0].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[0].hash = tree.position.getHash(); tree.nodes[1].checkState = { Square::s58(), Square::invalid() }; tree.nodes[1].hash = 0LLU; tree.nodes[2].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[2].hash = tree.position.getHash(); tree.nodes[3].checkState = { Square::s58(), Square::invalid() }; tree.nodes[3].hash = 0LLU; tree.nodes[4].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[4].hash = tree.position.getHash(); tree.nodes[5].checkState = { Square::s58(), Square::invalid() }; tree.nodes[5].hash = 0LLU; ASSERT_EQ(SCRState::Lose, scr.detect(tree)); } { SCRDetector scr; scr.clear(); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrWhiteCheck); tree.ply = 8; tree.nodes[0].checkState = { Square::s73(), Square::invalid() }; tree.nodes[0].hash = tree.position.getHash(); tree.nodes[1].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[1].hash = 0LLU; tree.nodes[2].checkState = { Square::s73(), Square::invalid() }; tree.nodes[2].hash = tree.position.getHash(); tree.nodes[3].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[3].hash = 0LLU; tree.nodes[4].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[4].hash = 0LLU; tree.nodes[5].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[5].hash = 0LLU; tree.nodes[6].checkState = { Square::s73(), Square::invalid() }; tree.nodes[6].hash = tree.position.getHash(); tree.nodes[7].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[7].hash = 0LLU; ASSERT_EQ(SCRState::Draw, scr.detect(tree)); } { Record record; record.initialPosition = PositionUtil::createPositionFromCsaString(PosStrWhiteCheck); record.moveList.push_back(Move(Square::s59(), Square::s48(), false)); record.moveList.push_back(Move(Square::s77(), Square::s66(), false)); record.moveList.push_back(Move(Square::s48(), Square::s59(), false)); record.moveList.push_back(Move(Square::s66(), Square::s77(), false)); record.moveList.push_back(Move(Square::s59(), Square::s48(), false)); record.moveList.push_back(Move(Square::s77(), Square::s66(), false)); record.moveList.push_back(Move(Square::s48(), Square::s59(), false)); record.moveList.push_back(Move(Square::s66(), Square::s77(), false)); SCRDetector scr; scr.registerRecord(record); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrWhiteCheck); tree.ply = 2; tree.nodes[0].checkState = { Square::s77(), Square::invalid() }; tree.nodes[0].hash = tree.position.getHash(); tree.nodes[1].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[1].hash = 0LLU; ASSERT_EQ(SCRState::Win, scr.detect(tree)); } { Record record; record.initialPosition = PositionUtil::createPositionFromCsaString(PosStrWhiteCheck2); record.moveList.push_back(Move(Square::s44(), Square::s33(), false)); record.moveList.push_back(Move(Square::s51(), Square::s62(), false)); record.moveList.push_back(Move(Square::s33(), Square::s44(), false)); record.moveList.push_back(Move(Square::s62(), Square::s51(), false)); record.moveList.push_back(Move(Square::s44(), Square::s33(), false)); record.moveList.push_back(Move(Square::s51(), Square::s62(), false)); record.moveList.push_back(Move(Square::s33(), Square::s44(), false)); record.moveList.push_back(Move(Square::s62(), Square::s51(), false)); SCRDetector scr; scr.registerRecord(record); Tree tree; tree.position = PositionUtil::createPositionFromCsaString(PosStrWhiteCheck2); tree.ply = 2; tree.nodes[0].checkState = { Square::invalid(), Square::invalid() }; tree.nodes[0].hash = 0LLU; tree.nodes[1].checkState = { Square::s33(), Square::invalid() }; tree.nodes[1].hash = tree.position.getHash(); ASSERT_EQ(SCRState::Lose, scr.detect(tree)); } }
[ "sunfish.shogi@gmail.com" ]
sunfish.shogi@gmail.com
2740840dde3e62d405e6b87da3fc3b1f47cbd707
1f07512e696462f1f0168b7d6f7ed7b79083b81c
/Student news/main.cpp
9073a3507c96324bbddf47648b6c7076df546b01
[]
no_license
20161104583/Student-news
63da95e6d50f9228176765fe2482da8112558600
68a12764dde3d564669e6d685249590feb0b626f
refs/heads/master
2021-08-28T01:21:41.529177
2017-12-11T02:10:40
2017-12-11T02:17:10
113,253,402
0
0
null
null
null
null
UTF-8
C++
false
false
847
cpp
// // main.cpp // Student news // // Created by 龙龙 on 2017/12/11. // Copyright © 2017年 龙龙. All rights reserved. // //#include "stdafx.h" #include <iostream> using namespace std; struct Student { char name[50]; char num[20]; int age; struct Student *next; }; int main(int argc, const char * argv[]) // insert code here... { struct Student *p,*q,*head; int i=1; head=new Student; q=head; strcpy(head->name,"wang"); strcpy(head->num,"20161104583"); head->age=20; while(cout<<"1or0?",cin>>i,i==1) { p=new Student; q->next=p; q=p; cin>>p->name; cin>>p->num; cin>>p->age; p->next=NULL; } p=head; while(p!=NULL) { cout<<p->name<<" "<<p->num<<" "<<p->age<<endl; p=p->next; } return 0; }
[ "Student news" ]
Student news
9c875b0f1f1431d92a000ba47bcc28ed4ba49752
00a26e0b22c1bc21f1ef9bfc6f5a9662da6ab48f
/gb2020/b.cpp
562cf17ae6c8d98cf20182dee535117ad0967507
[]
no_license
poleioleiq/algorithm-icpc
93fcb6c9a14b95fc348cc75ae9b711ad1d5192a0
d4fd1ac6643f1033689d190bdf08df4a36c99fa6
refs/heads/master
2023-05-29T06:01:03.424594
2021-06-03T06:17:03
2021-06-03T06:17:03
373,396,744
1
0
null
null
null
null
GB18030
C++
false
false
2,765
cpp
//#pragma GCC optimize(2) #include <iostream> #include <cstdio> #include <cmath> #include <cstring> #include <climits> #include <queue> #include <vector> #include <stack> #include <algorithm> #include <cctype> #define FAST_IO std::ios::sync_with_stdio(false), std::cin.tie(0), std::cout.tie(0) #define mem(a, b) memset(a,b,sizeof(a)) #define int long long #define rint register int using namespace std; template<class T>void tomax(T &a, T b) { a = max(a, b); } template<class T>void tomin(T &a, T b) { a = min(a, b); } typedef long long ll; typedef pair<int, int> pii; // #define DEBUG 1 struct IO { #define MAXSIZE (1 << 20) #define isdigit(x) (x >= '0' && x <= '9') char buf[MAXSIZE], *p1, *p2; char pbuf[MAXSIZE], *pp; #if DEBUG #else IO() : p1(buf), p2(buf), pp(pbuf) {} ~IO() { fwrite(pbuf, 1, pp - pbuf, stdout); } #endif inline char gc() { #if DEBUG return getchar(); #endif if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, stdin); return p1 == p2 ? ' ' : *p1++; } inline bool blank(char ch) { return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t'; } template <class T> inline void read(T &x) { register double tmp = 1; register bool sign = 0; x = 0; register char ch = gc(); for (; !isdigit(ch); ch = gc()) if (ch == '-') sign = 1; for (; isdigit(ch); ch = gc()) x = x * 10 + (ch - '0'); if (ch == '.') for (ch = gc(); isdigit(ch); ch = gc()) tmp /= 10.0, x += tmp * (ch - '0'); if (sign) x = -x; } inline void read(char *s) { register char ch = gc(); for (; blank(ch); ch = gc()) ; for (; !blank(ch); ch = gc()) *s++ = ch; *s = 0; } inline void read(char &c) { for (c = gc(); blank(c); c = gc()) ; } inline void push(const char &c) { #if DEBUG putchar(c); #else if (pp - pbuf == MAXSIZE) fwrite(pbuf, 1, MAXSIZE, stdout), pp = pbuf; *pp++ = c; #endif } template <class T> inline void write(T x) { if (x < 0) x = -x, push('-'); // 负数输出 static T sta[35]; T top = 0; do { sta[top++] = x % 10, x /= 10; } while (x); while (top) push(sta[--top] + '0'); } template <class T> inline void write(T x, char lastChar) { write(x), push(lastChar); } } io; using namespace std; const int MAXN=10005; bool met[MAXN * 2];int a[MAXN]; int n,ans; // 初始化 met 数组为 0; signed main(){ memset(met, 0, sizeof(met)); for (int i = 0; i < n; ++i) { if (met[MAXN - a[i]]) ++ans; // 为了避免负数下标 met[a[i] + MAXN] = 1; } }
[ "1049330067@qq.com" ]
1049330067@qq.com
c041e41f4c3980d5e2b4b048ef6a2efa538c0a9b
2238c7e62b9eac2c10cd22c94e56b4199ab04639
/llvm/tools/llvm-jitlink/llvm-jitlink-elf.cpp
3f222af3222daa7963e58e0031d858a5ee033705
[ "NCSA", "LLVM-exception", "Apache-2.0" ]
permissive
sshyran/llvm-project
ba3ee96c709f12f92152525a9b54a9a915cb74b7
eae3b2a715d7fd1aea0ce1c78ac7a04957b72728
refs/heads/main
2023-04-16T02:33:32.595711
2021-03-30T17:33:10
2021-03-30T17:33:10
353,088,163
1
0
null
2023-04-03T23:16:14
2021-03-30T17:37:16
null
UTF-8
C++
false
false
6,377
cpp
//===---- llvm-jitlink-elf.cpp -- ELF parsing support for llvm-jitlink ----===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // ELF parsing support for llvm-jitlink. // //===----------------------------------------------------------------------===// #include "llvm-jitlink.h" #include "llvm/Support/Error.h" #include "llvm/Support/Path.h" #define DEBUG_TYPE "llvm_jitlink" using namespace llvm; using namespace llvm::jitlink; static bool isELFGOTSection(Section &S) { return S.getName() == "$__GOT"; } static bool isELFStubsSection(Section &S) { return S.getName() == "$__STUBS"; } static Expected<Edge &> getFirstRelocationEdge(LinkGraph &G, Block &B) { auto EItr = std::find_if(B.edges().begin(), B.edges().end(), [](Edge &E) { return E.isRelocation(); }); if (EItr == B.edges().end()) return make_error<StringError>("GOT entry in " + G.getName() + ", \"" + B.getSection().getName() + "\" has no relocations", inconvertibleErrorCode()); return *EItr; } static Expected<Symbol &> getELFGOTTarget(LinkGraph &G, Block &B) { auto E = getFirstRelocationEdge(G, B); if (!E) return E.takeError(); auto &TargetSym = E->getTarget(); if (!TargetSym.hasName()) return make_error<StringError>( "GOT entry in " + G.getName() + ", \"" + TargetSym.getBlock().getSection().getName() + "\" points to anonymous " "symbol", inconvertibleErrorCode()); return TargetSym; } static Expected<Symbol &> getELFStubTarget(LinkGraph &G, Block &B) { auto E = getFirstRelocationEdge(G, B); if (!E) return E.takeError(); auto &GOTSym = E->getTarget(); if (!GOTSym.isDefined() || !isELFGOTSection(GOTSym.getBlock().getSection())) return make_error<StringError>( "Stubs entry in " + G.getName() + ", \"" + GOTSym.getBlock().getSection().getName() + "\" does not point to GOT entry", inconvertibleErrorCode()); return getELFGOTTarget(G, GOTSym.getBlock()); } namespace llvm { Error registerELFGraphInfo(Session &S, LinkGraph &G) { auto FileName = sys::path::filename(G.getName()); if (S.FileInfos.count(FileName)) { return make_error<StringError>("When -check is passed, file names must be " "distinct (duplicate: \"" + FileName + "\")", inconvertibleErrorCode()); } auto &FileInfo = S.FileInfos[FileName]; LLVM_DEBUG({ dbgs() << "Registering ELF file info for \"" << FileName << "\"\n"; }); for (auto &Sec : G.sections()) { LLVM_DEBUG({ dbgs() << " Section \"" << Sec.getName() << "\": " << (llvm::empty(Sec.symbols()) ? "empty. skipping." : "processing...") << "\n"; }); // Skip empty sections. if (llvm::empty(Sec.symbols())) continue; if (FileInfo.SectionInfos.count(Sec.getName())) return make_error<StringError>("Encountered duplicate section name \"" + Sec.getName() + "\" in \"" + FileName + "\"", inconvertibleErrorCode()); bool isGOTSection = isELFGOTSection(Sec); bool isStubsSection = isELFStubsSection(Sec); bool SectionContainsContent = false; bool SectionContainsZeroFill = false; auto *FirstSym = *Sec.symbols().begin(); auto *LastSym = FirstSym; for (auto *Sym : Sec.symbols()) { if (Sym->getAddress() < FirstSym->getAddress()) FirstSym = Sym; if (Sym->getAddress() > LastSym->getAddress()) LastSym = Sym; if (isGOTSection) { if (Sym->isSymbolZeroFill()) return make_error<StringError>("zero-fill atom in GOT section", inconvertibleErrorCode()); // If this is a GOT symbol with size (i.e. not the GOT start symbol) // then add it to the GOT entry info table. if (Sym->getSize() != 0) { if (auto TS = getELFGOTTarget(G, Sym->getBlock())) FileInfo.GOTEntryInfos[TS->getName()] = {Sym->getSymbolContent(), Sym->getAddress()}; else return TS.takeError(); } SectionContainsContent = true; } else if (isStubsSection) { if (Sym->isSymbolZeroFill()) return make_error<StringError>("zero-fill atom in Stub section", inconvertibleErrorCode()); if (auto TS = getELFStubTarget(G, Sym->getBlock())) FileInfo.StubInfos[TS->getName()] = {Sym->getSymbolContent(), Sym->getAddress()}; else return TS.takeError(); SectionContainsContent = true; } if (Sym->hasName()) { if (Sym->isSymbolZeroFill()) { S.SymbolInfos[Sym->getName()] = {Sym->getSize(), Sym->getAddress()}; SectionContainsZeroFill = true; } else { S.SymbolInfos[Sym->getName()] = {Sym->getSymbolContent(), Sym->getAddress()}; SectionContainsContent = true; } } } JITTargetAddress SecAddr = FirstSym->getAddress(); uint64_t SecSize = (LastSym->getBlock().getAddress() + LastSym->getBlock().getSize()) - SecAddr; if (SectionContainsZeroFill && SectionContainsContent) return make_error<StringError>("Mixed zero-fill and content sections not " "supported yet", inconvertibleErrorCode()); if (SectionContainsZeroFill) FileInfo.SectionInfos[Sec.getName()] = {SecSize, SecAddr}; else FileInfo.SectionInfos[Sec.getName()] = { StringRef(FirstSym->getBlock().getContent().data(), SecSize), SecAddr}; } return Error::success(); } } // end namespace llvm
[ "lhames@gmail.com" ]
lhames@gmail.com
419f52db3e2fb9cc6749a6122ff4bc0e9a22d27f
f371a1e57b354cc1b985dbfc17f057c186d9f7a0
/acmicpc.net/source/2739.cpp
6011931d335a30a88377a96b9dca7b5295ceee11
[ "MIT" ]
permissive
tdm1223/Algorithm
7ea3d79eaa7244a1cfe8a420e25d89b783465e8f
c773ab0338e5a606ad0fc7d8989b0ee7cc1bf3fa
refs/heads/master
2022-11-14T01:34:08.955376
2022-10-30T11:00:54
2022-10-30T11:00:54
143,304,153
8
9
null
2019-08-06T02:41:24
2018-08-02T14:16:00
C++
UTF-8
C++
false
false
235
cpp
// 2739. 구구단 // 2019.05.20 // 출력 #include<iostream> using namespace std; int main() { int n; cin >> n; // n단 출력 for (int i = 1; i < 10; i++) { cout << n << " * " << i << " = " << n * i << endl; } return 0; }
[ "tdm1223@naver.com" ]
tdm1223@naver.com
c7c1fb6da5a020a0be55bc7a6c10abfee0fac1e8
13a32b92b1ba8ffb07e810dcc8ccdf1b8b1671ab
/home--tommy--mypy/mypy/lib/python2.7/site-packages/pystan/stan/lib/stan_math/stan/math/rev/scal/fun/log_sum_exp.hpp
10d8dfca1760fc197149ad6833ed684aeba0c562
[ "Unlicense", "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
tommybutler/mlearnpy2
8ec52bcd03208c9771d8d02ede8eaa91a95bda30
9e5d377d0242ac5eb1e82a357e6701095a8ca1ff
refs/heads/master
2022-10-24T23:30:18.705329
2022-10-17T15:41:37
2022-10-17T15:41:37
118,529,175
0
2
Unlicense
2022-10-15T23:32:18
2018-01-22T23:27:10
Python
UTF-8
C++
false
false
1,941
hpp
#ifndef STAN_MATH_REV_SCAL_FUN_LOG_SUM_EXP_HPP #define STAN_MATH_REV_SCAL_FUN_LOG_SUM_EXP_HPP #include <stan/math/rev/core.hpp> #include <stan/math/rev/scal/fun/calculate_chain.hpp> #include <stan/math/prim/scal/fun/log_sum_exp.hpp> namespace stan { namespace math { namespace { class log_sum_exp_vv_vari : public op_vv_vari { public: log_sum_exp_vv_vari(vari* avi, vari* bvi) : op_vv_vari(log_sum_exp(avi->val_, bvi->val_), avi, bvi) { } void chain() { avi_->adj_ += adj_ * calculate_chain(avi_->val_, val_); bvi_->adj_ += adj_ * calculate_chain(bvi_->val_, val_); } }; class log_sum_exp_vd_vari : public op_vd_vari { public: log_sum_exp_vd_vari(vari* avi, double b) : op_vd_vari(log_sum_exp(avi->val_, b), avi, b) { } void chain() { avi_->adj_ += adj_ * calculate_chain(avi_->val_, val_); } }; class log_sum_exp_dv_vari : public op_dv_vari { public: log_sum_exp_dv_vari(double a, vari* bvi) : op_dv_vari(log_sum_exp(a, bvi->val_), a, bvi) { } void chain() { bvi_->adj_ += adj_ * calculate_chain(bvi_->val_, val_); } }; } /** * Returns the log sum of exponentials. */ inline var log_sum_exp(const var& a, const var& b) { return var(new log_sum_exp_vv_vari(a.vi_, b.vi_)); } /** * Returns the log sum of exponentials. */ inline var log_sum_exp(const var& a, double b) { return var(new log_sum_exp_vd_vari(a.vi_, b)); } /** * Returns the log sum of exponentials. */ inline var log_sum_exp(double a, const var& b) { return var(new log_sum_exp_dv_vari(a, b.vi_)); } } } #endif
[ "tbutler.github@internetalias.net" ]
tbutler.github@internetalias.net
dcf286ad2cbcb3c610225e44ddd4f5278ee6d8aa
7c785e161ae4f6b1b92d70c1ab988d0e20f6c23c
/labs/lab9/lab9.cpp
42e2254e49ded4d06b4c7a15c5d3d6f69f5d6a7c
[]
no_license
farhiya-osman/CS162-coursework
6d756563a9dab20302cd2c8d59ded722ffc98fab
c85f7bc5f1750dec2c8eb03777f9ec464f37c86d
refs/heads/master
2022-10-10T10:07:54.024450
2020-06-13T21:03:41
2020-06-13T21:03:41
null
0
0
null
null
null
null
UTF-8
C++
false
false
593
cpp
#include "lab9.h" int main(){ lab9 l; cout << " Please enter the desired length of the array. " << endl; int option; cin >> option; int* arr = new int[option]; if (option >=0 && option <=20 ){ l.populate_arr(option, arr); l.msort2(arr,0, option-1); for(int i = 0; i<option; i++){ cout << "Sorted array: " << arr[i] << " "; } cout << endl; l.primenumber(arr,option); // perform merge sort } else{ cout<< "Invalid size entry please enter a length between 0 and 20 " << endl; cin >> option; } }
[ "noreply@github.com" ]
noreply@github.com
4432e198e0600c76b7eaf8aff2b994a450335e64
4bcc9806152542ab43fc2cf47c499424f200896c
/tensorflow/compiler/mlir/tensorflow/transforms/xla_call_module_serialization.cc
a75bf4c75d80330d95bbf67533577e388d01ab15
[ "Apache-2.0", "LicenseRef-scancode-generic-cla", "BSD-2-Clause" ]
permissive
tensorflow/tensorflow
906276dbafcc70a941026aa5dc50425ef71ee282
a7f3934a67900720af3d3b15389551483bee50b8
refs/heads/master
2023-08-25T04:24:41.611870
2023-08-25T04:06:24
2023-08-25T04:14:08
45,717,250
208,740
109,943
Apache-2.0
2023-09-14T20:55:50
2015-11-07T01:19:20
C++
UTF-8
C++
false
false
9,654
cc
/* Copyright 2023 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include <memory> #include <string> #include <utility> #include "llvm/ADT/StringRef.h" #include "mlir/Dialect/Func/IR/FuncOps.h" // from @llvm-project #include "mlir/IR/BuiltinAttributes.h" // from @llvm-project #include "mlir/IR/BuiltinOps.h" // from @llvm-project #include "mlir/IR/OwningOpRef.h" // from @llvm-project #include "mlir/IR/SymbolTable.h" // from @llvm-project #include "mlir/Pass/PassManager.h" // from @llvm-project #include "stablehlo/api/PortableApi.h" // from @stablehlo #include "stablehlo/dialect/Serialization.h" // from @stablehlo #include "stablehlo/dialect/StablehloOps.h" // from @stablehlo // IWYU pragma: keep #include "stablehlo/dialect/VhloOps.h" // from @stablehlo // IWYU pragma: keep #include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops.h" #include "tensorflow/compiler/mlir/tensorflow/transforms/passes.h" #include "tensorflow/compiler/mlir/tensorflow/utils/stablehlo_custom_call.h" #include "tensorflow/compiler/mlir/tensorflow/utils/visitor.h" #include "tensorflow/compiler/mlir/tensorflow/utils/xla_call_module_attrs.h" namespace mlir { namespace TF { namespace { #define GEN_PASS_DEF_XLACALLMODULESERIALIZATIONPASS #include "tensorflow/compiler/mlir/tensorflow/transforms/tf_passes.h.inc" // IWYU pragma: keep // `tf.backend_config` is a DictionaryAttr, JAX2TF sets the value of its // i64 attribute `called_index` to the TF function's name. constexpr llvm::StringRef kTfBackendConfigAttrName = "tf.backend_config"; constexpr llvm::StringRef kCalledIndexAttrName = "called_index"; constexpr llvm::StringRef kCalledFuncAttrName = "called_func"; // Converts `called_func` attributes in custom call ops back to `called_index`. FailureOr<ArrayAttr> DesymbolizeCustomCallCalledIndex(ModuleOp module) { Builder builder(module.getContext()); SmallVector<Attribute> function_list; llvm::DenseMap<SymbolRefAttr, int> called_indexes; WalkResult result = module.walk([&](stablehlo::CustomCallOp op) { if (!IsTfFuncCustomCall(op)) { return WalkResult::advance(); } auto backend_config = op->getAttrOfType<DictionaryAttr>(kTfBackendConfigAttrName); if (!backend_config) { op->emitOpError() << "is missing attribute '" << kTfBackendConfigAttrName << "'"; return WalkResult::interrupt(); } auto called_func = backend_config.get(kCalledFuncAttrName) .dyn_cast_or_null<SymbolRefAttr>(); if (!called_func) { op->emitOpError() << "is missing attribute '" << kCalledFuncAttrName << "'"; return WalkResult::interrupt(); } llvm::SmallVector<NamedAttribute> new_config; // Copy the attributes in the current config except `called_func`. for (auto attr : backend_config) { if (attr.getName() != kCalledFuncAttrName) { new_config.push_back(attr); } } auto [it, inserted] = called_indexes.insert({called_func, called_indexes.size()}); if (inserted) { function_list.push_back(called_func); } // Set the `called_index` attribute to the TF function's name. new_config.push_back(builder.getNamedAttr( kCalledIndexAttrName, builder.getI64IntegerAttr(it->second))); // Set the `tf.backend_config` attribute to the `new_config`. op->setAttr(kTfBackendConfigAttrName, builder.getDictionaryAttr(new_config)); return WalkResult::advance(); }); if (result.wasInterrupted()) { return failure(); } return builder.getArrayAttr(function_list); } // Creates a pruned module containing the XlaCallModule's entry function and // other functions transitively called by the entry function. FailureOr<OwningOpRef<ModuleOp>> PruneStablehloModule( SymbolTableCollection& symbol_table, ModuleOp module, XlaCallModuleOp op) { auto entry_func_symbol = op->getAttrOfType<FlatSymbolRefAttr>(kStablehloEntryFunctionAttrName); if (!entry_func_symbol) { return op.emitOpError() << "does not have " << kStablehloEntryFunctionAttrName << " attribute"; } auto entry_func = symbol_table.lookupSymbolIn<func::FuncOp>(module, entry_func_symbol); if (!entry_func) { return op.emitOpError() << "references an unknown entry function " << entry_func_symbol; } OpBuilder builder(module.getContext()); OwningOpRef<ModuleOp> stablehlo_module = builder.create<ModuleOp>(op.getLoc()); builder.setInsertionPointToEnd(stablehlo_module->getBody()); // Copy all referenced StableHLO functions to the new module. WalkResult result = WalkReachableFunctions( entry_func, [&](func::FuncOp f) -> WalkResult { if (!f->hasAttr(kFromXlaCallModuleAttrName)) { return WalkResult::advance(); } auto cloned = llvm::cast<func::FuncOp>(builder.clone(*f)); cloned->removeAttr(kFromXlaCallModuleAttrName); if (f == entry_func) { // Entry function must be public and has symbol name "@main". cloned.setPublic(); cloned.setName(kStablehloMainFunctionName); } else { cloned.setPrivate(); } return WalkResult::advance(); }, &symbol_table); if (result.wasInterrupted()) { return failure(); } // Rewrite `custom_call`'s `called_func` attribute to `called_index`. auto function_list = DesymbolizeCustomCallCalledIndex(*stablehlo_module); if (failed(function_list)) return failure(); op.setFunctionListAttr(*function_list); // Restore the deserialized stablehlo module's attributes to the reconstructed // stablehlo module. The stablehlo module's attributes can contain important // information such as SPMD num_replicas and num_partitions. auto original_stablehlo_module_attrs = op->getAttrOfType<DictionaryAttr>(kStablehloModuleAttrsAttrName); if (original_stablehlo_module_attrs) { (*stablehlo_module)->setAttrs(original_stablehlo_module_attrs); // Now, remove the attribute because later passes may not know how to handle // it, we may encounter errors such as: // "Unhandled attribute kind for attribute '_stablehlo_module_attrs'". op->removeAttr(kStablehloModuleAttrsAttrName); } return stablehlo_module; } // Serializes the stablehlo module into bytecode. FailureOr<std::string> SerializeStablehlo(ModuleOp stablehlo_module) { std::string bytecode; llvm::raw_string_ostream os(bytecode); if (mlir::failed(stablehlo::serializePortableArtifact( stablehlo_module, stablehlo::getCurrentVersion(), os))) { return stablehlo_module.emitError() << "failed to serialize the pruned stablehlo module"; } return bytecode; } // Serializes the stablehlo functions called by XlaCallModuleOp to bytecode // and embeds the bytecode in XlaCallModuleOp's `module` attribute. // // The stablehlo functions include the function referred by XlaCallModuleOp's // `_entry_function` attribute, and any stablehlo functions called transitively // from the entry function. LogicalResult SerializeXlaCallModule(SymbolTableCollection& symbol_table, ModuleOp module, XlaCallModuleOp op) { auto stablehlo_module = PruneStablehloModule(symbol_table, module, op); if (failed(stablehlo_module)) { return failure(); } auto bytecode = SerializeStablehlo(**stablehlo_module); if (failed(bytecode)) { return failure(); } op.setModule(*bytecode); op->removeAttr(kStablehloEntryFunctionAttrName); return success(); } // Removes the serialized stablehlo functions, because `XlaCallModuleOp` no // longer has `_entry_function` attribute referencing the stablehlo main // function, so all stablehlo functions are of no use in the top-level module. // // Walk the module to find functions with `_from_xla_call_module` attribute, // and remove them. void RemoveSerializedStablehloFunctions(ModuleOp module) { module.walk([&](func::FuncOp f) { if (f->hasAttr(kFromXlaCallModuleAttrName)) { f->erase(); } }); } class XlaCallModuleSerializationPass : public impl::XlaCallModuleSerializationPassBase< XlaCallModuleSerializationPass> { public: void runOnOperation() override { mlir::ModuleOp module = getOperation(); mlir::SymbolTableCollection symbol_table; mlir::WalkResult result = module.walk([&](mlir::TF::XlaCallModuleOp xla_call_module) { if (failed(SerializeXlaCallModule(symbol_table, module, xla_call_module))) { return mlir::WalkResult::interrupt(); } return mlir::WalkResult::advance(); }); if (result.wasInterrupted()) { return signalPassFailure(); } RemoveSerializedStablehloFunctions(module); } }; } // namespace std::unique_ptr<OperationPass<ModuleOp>> CreateXlaCallModuleSerializationPass() { return std::make_unique<XlaCallModuleSerializationPass>(); } } // namespace TF } // namespace mlir
[ "gardener@tensorflow.org" ]
gardener@tensorflow.org
7431c5f28681664cbef482991a41ef1ca2cf8ffb
ec26b4389ecc483ff4fd464e0e0f237095a27675
/src/camera/usbcam/src/usbcam_node.cpp
c621c0f4d490e982e82089c5fbff10be54c342db
[]
no_license
jucic/Macaca_linux_reconstructure
2d7b78ffa2e8c91a9f648086120b0938677e212d
2beafed6dcfb1f06580768e9b2ef92074f2b89a2
refs/heads/master
2020-03-20T19:28:23.864892
2018-06-17T08:20:45
2018-06-17T08:20:45
137,639,274
0
0
null
null
null
null
UTF-8
C++
false
false
2,013
cpp
#include <iostream> #include <ros/ros.h> #include <image_transport/image_transport.h> #include <camera_info_manager/camera_info_manager.h> #include <sensor_msgs/CameraInfo.h> #include <opencv2/opencv.hpp> #include <cv_bridge/cv_bridge.h> #include <boost/shared_ptr.hpp> #include <string> using namespace std; int main(int argc, char** argv) { ros::init(argc, argv, "usbcam_node"); cout << "init ros node" << endl; ros::NodeHandle nh("~"); image_transport::ImageTransport it(nh); int camera_id = 0; std::string url = ""; std::string camera_name = "camera"; nh.getParam("camera_id", camera_id);//ros参数服务器 nh.getParam("camera_info_url", url); nh.getParam("camera_name", camera_name); const std::string image_topic_name = "image_raw"; boost::shared_ptr<image_transport::CameraPublisher> pub(new image_transport::CameraPublisher(it.advertiseCamera(image_topic_name, 5))); cv::VideoCapture frame(camera_id); frame.set(CV_CAP_PROP_FOURCC, CV_FOURCC('M', 'J', 'P', 'G')); if(frame.isOpened()) { cout << "Camera " << camera_id << " is Opened.\nTopic: " << image_topic_name << endl; } else { cerr << "Camera " << camera_id << " is not found" << endl; return -1; } cv::Mat image; sensor_msgs::ImagePtr msg; camera_info_manager::CameraInfoManager cinfo(nh); if (cinfo.validateURL(url)) cinfo.loadCameraInfo(url); else { cout << "Invalid camera calibration URL: " << url << endl; return -1; } sensor_msgs::CameraInfoPtr info(new sensor_msgs::CameraInfo(cinfo.getCameraInfo())); std_msgs::Header header; header.frame_id = ros::names::resolve(ros::this_node::getNamespace() ,camera_name) + "/camera_link"; info->header.frame_id = header.frame_id; while (nh.ok()) { frame >> image; if (image.empty()) continue; ros::Time time = ros::Time::now(); header.stamp = time; info->header.stamp = time; msg = cv_bridge::CvImage(header, "bgr8", image).toImageMsg(); pub->publish(msg, info); } return 0; }
[ "2726089241@qq.com" ]
2726089241@qq.com
08503d0aaa9ac683deaa0521340614c399196735
73f88b9d8055c1bc5ed408319ffed9fa72af628b
/src/RenderSystem.Direct3D11/GraphicsContextDirect3D11.cpp
db257b5b96ea17715f44dd5137c8a3d6a00cdc60
[ "MIT" ]
permissive
Mourtz/pomdog
3841c015012f0bb8f4e45c3524a66ced11abd448
b3f678033b2b41ec5bbf9c5079810b1082aa293d
refs/heads/master
2020-12-25T04:01:47.810430
2015-09-10T11:57:25
2015-09-10T11:57:25
38,495,875
1
0
null
2015-07-07T09:48:00
2015-07-03T14:12:26
C++
UTF-8
C++
false
false
21,228
cpp
// Copyright (c) 2013-2015 mogemimi. // Distributed under the MIT license. See LICENSE.md file for details. #include "GraphicsContextDirect3D11.hpp" #include "BufferDirect3D11.hpp" #include "PipelineStateDirect3D11.hpp" #include "RenderTarget2DDirect3D11.hpp" #include "SamplerStateDirect3D11.hpp" #include "Texture2DDirect3D11.hpp" #include "../RenderSystem.DXGI/DXGIFormatHelper.hpp" #include "../RenderSystem/GraphicsCapabilities.hpp" #include "Pomdog/Math/Color.hpp" #include "Pomdog/Math/Vector4.hpp" #include "Pomdog/Math/Rectangle.hpp" #include "Pomdog/Graphics/ClearOptions.hpp" #include "Pomdog/Graphics/IndexBuffer.hpp" #include "Pomdog/Graphics/PresentationParameters.hpp" #include "Pomdog/Graphics/PrimitiveTopology.hpp" #include "Pomdog/Graphics/RenderTarget2D.hpp" #include "Pomdog/Graphics/Texture2D.hpp" #include "Pomdog/Graphics/VertexBuffer.hpp" #include "Pomdog/Graphics/VertexBufferBinding.hpp" #include "Pomdog/Graphics/Viewport.hpp" #include "Pomdog/Utility/Assert.hpp" #include "Pomdog/Utility/Exception.hpp" #include "Pomdog/Logging/Log.hpp" #include "Pomdog/Utility/StringHelper.hpp" #include <algorithm> namespace Pomdog { namespace Detail { namespace Direct3D11 { namespace { using DXGI::DXGIFormatHelper; static D3D11_PRIMITIVE_TOPOLOGY ToD3D11PrimitiveTopology(PrimitiveTopology primitiveTopology) noexcept { switch (primitiveTopology) { case PrimitiveTopology::TriangleStrip: return D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP; case PrimitiveTopology::TriangleList: return D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST; case PrimitiveTopology::LineList: return D3D11_PRIMITIVE_TOPOLOGY_LINELIST; case PrimitiveTopology::LineStrip: return D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP; } return D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED; } //----------------------------------------------------------------------- static void ChooseMultiSampleSetting( ID3D11Device* device, DXGI_FORMAT backBufferFormat, int preferredMultiSampleCount, DXGI_SAMPLE_DESC & sampleDesc) { POMDOG_ASSERT(device != nullptr); POMDOG_ASSERT(preferredMultiSampleCount >= 1); POMDOG_ASSERT(preferredMultiSampleCount <= 32); const auto maxSampleCount = std::min( preferredMultiSampleCount, D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT); for (int sampleCount = maxSampleCount; sampleCount >= 1; --sampleCount) { UINT qualityLevels = 0; auto hr = device->CheckMultisampleQualityLevels( backBufferFormat, sampleCount, &qualityLevels); if (SUCCEEDED(hr) && (0 < qualityLevels)) { sampleDesc.Count = sampleCount; sampleDesc.Quality = qualityLevels - 1; return; } } } } // unnamed namespace //----------------------------------------------------------------------- GraphicsContextDirect3D11::GraphicsContextDirect3D11( HWND windowHandle, Microsoft::WRL::ComPtr<IDXGIFactory1> const& dxgiFactory, Microsoft::WRL::ComPtr<ID3D11Device> const& device, Microsoft::WRL::ComPtr<ID3D11DeviceContext> const& deviceContextIn, PresentationParameters const& presentationParameters) : deviceContext(deviceContextIn) , blendFactor({1.0f, 1.0f, 1.0f, 1.0f}) , preferredBackBufferWidth(1) , preferredBackBufferHeight(1) , backBufferCount(2) , backBufferFormat(DXGIFormatHelper::ToDXGIFormat(presentationParameters.BackBufferFormat)) , backBufferDepthFormat(presentationParameters.DepthStencilFormat) , needToApplyPipelineState(true) { using Microsoft::WRL::ComPtr; POMDOG_ASSERT(device); POMDOG_ASSERT(deviceContext); DXGI_SAMPLE_DESC sampleDesc; sampleDesc.Count = 1; sampleDesc.Quality = 0; if (presentationParameters.MultiSampleCount > 1) { ChooseMultiSampleSetting( device.Get(), backBufferFormat, presentationParameters.MultiSampleCount, sampleDesc); } #if defined(DEBUG) && !defined(NDEBUG) Log::Internal(StringHelper::Format( "DXGI_SAMPLE_DESC.Count : %d\n" "DXGI_SAMPLE_DESC.Quality: %d", sampleDesc.Count, sampleDesc.Quality)); #endif { RECT rect; ::GetClientRect(windowHandle, &rect); auto const windowWidth = rect.right - rect.left; auto const windowHeight = rect.bottom - rect.top; preferredBackBufferWidth = std::max<int>(preferredBackBufferWidth, windowWidth); preferredBackBufferHeight = std::max<int>(preferredBackBufferHeight, windowHeight); } { DXGI_SWAP_CHAIN_DESC swapChainDesc; ZeroMemory(&swapChainDesc, sizeof(swapChainDesc)); swapChainDesc.BufferCount = backBufferCount; swapChainDesc.BufferDesc.Width = preferredBackBufferWidth; swapChainDesc.BufferDesc.Height = preferredBackBufferHeight; swapChainDesc.BufferDesc.Format = backBufferFormat; swapChainDesc.BufferDesc.RefreshRate.Numerator = 60; swapChainDesc.BufferDesc.RefreshRate.Denominator = 1; swapChainDesc.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; swapChainDesc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; swapChainDesc.OutputWindow = windowHandle; swapChainDesc.Windowed = (!presentationParameters.IsFullScreen ? TRUE : FALSE); swapChainDesc.SampleDesc.Count = sampleDesc.Count; swapChainDesc.SampleDesc.Quality = sampleDesc.Quality; POMDOG_ASSERT(dxgiFactory); HRESULT hr = dxgiFactory->CreateSwapChain(device.Get(), &swapChainDesc, &swapChain); if (FAILED(hr)) { // FUS RO DAH! POMDOG_THROW_EXCEPTION(std::runtime_error, "Failed to create SwapChain"); } } { ///@todo MSAA is not implemented yet constexpr int multiSampleCount = 1; backBuffer = std::make_shared<RenderTarget2DDirect3D11>( device.Get(), swapChain.Get(), preferredBackBufferWidth, preferredBackBufferHeight, backBufferDepthFormat, multiSampleCount); renderTargets.reserve(D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT); renderTargets.push_back(backBuffer); } SetRenderTarget(); textureResourceViews.fill(nullptr); } //----------------------------------------------------------------------- GraphicsContextDirect3D11::~GraphicsContextDirect3D11() { textureResourceViews.fill(nullptr); renderTargets.clear(); backBuffer.reset(); swapChain.Reset(); deviceContext.Reset(); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::Present() { POMDOG_ASSERT(swapChain); swapChain->Present(0, 0); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::Clear(ClearOptions options, Color const& color, float depth, std::uint8_t stencil) { POMDOG_ASSERT(stencil <= std::numeric_limits<UINT8>::max()); POMDOG_ASSERT(stencil >= 0); auto const fillColor = color.ToVector4(); UINT mask = 0; if ((options | ClearOptions::DepthBuffer) == options) { mask |= D3D11_CLEAR_DEPTH; } if ((options | ClearOptions::Stencil) == options) { mask |= D3D11_CLEAR_STENCIL; } for (auto & renderTarget : renderTargets) { POMDOG_ASSERT(renderTarget); if ((options | ClearOptions::RenderTarget) == options) { deviceContext->ClearRenderTargetView( renderTarget->GetRenderTargetView(), fillColor.Data()); } auto depthStencilView = renderTarget->GetDepthStencilView(); if (depthStencilView != nullptr) { deviceContext->ClearDepthStencilView( depthStencilView, mask, depth, stencil); } } } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::ApplyPipelineState() { POMDOG_ASSERT(pipelineState); if (needToApplyPipelineState) { pipelineState->Apply(deviceContext.Get(), blendFactor.data()); needToApplyPipelineState = false; } } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::Draw(std::size_t vertexCount) { POMDOG_ASSERT(deviceContext); ApplyPipelineState(); deviceContext->Draw(vertexCount, 0); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::DrawIndexed(std::size_t indexCount) { POMDOG_ASSERT(deviceContext); ApplyPipelineState(); deviceContext->DrawIndexed(indexCount, 0, 0); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::DrawInstanced( std::size_t vertexCount, std::size_t instanceCount) { POMDOG_ASSERT(deviceContext); ApplyPipelineState(); deviceContext->DrawInstanced(vertexCount, instanceCount, 0, 0); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::DrawIndexedInstanced( std::size_t indexCount, std::size_t instanceCount) { POMDOG_ASSERT(deviceContext); ApplyPipelineState(); deviceContext->DrawIndexedInstanced(indexCount, instanceCount, 0, 0, 0); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::SetIndexBuffer(std::shared_ptr<IndexBuffer> const& indexBuffer) { POMDOG_ASSERT(indexBuffer); auto nativeIndexBuffer = static_cast<BufferDirect3D11*>( indexBuffer->NativeIndexBuffer()); POMDOG_ASSERT(nativeIndexBuffer != nullptr); POMDOG_ASSERT(nativeIndexBuffer == dynamic_cast<BufferDirect3D11*>( indexBuffer->NativeIndexBuffer())); deviceContext->IASetIndexBuffer(nativeIndexBuffer->GetBuffer(), DXGIFormatHelper::ToDXGIFormat(indexBuffer->ElementSize()), 0); } //----------------------------------------------------------------------- GraphicsCapabilities GraphicsContextDirect3D11::GetCapabilities() const { GraphicsCapabilities caps; caps.SamplerSlotCount = D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT; caps.ConstantBufferSlotCount = D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT; return std::move(caps); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::SetViewport(Viewport const& viewportIn) { POMDOG_ASSERT(0 < viewportIn.Width); POMDOG_ASSERT(0 < viewportIn.Height); POMDOG_ASSERT(D3D11_VIEWPORT_BOUNDS_MAX >= viewportIn.TopLeftX + viewportIn.Width); POMDOG_ASSERT(D3D11_VIEWPORT_BOUNDS_MAX >= viewportIn.TopLeftY + viewportIn.Height); D3D11_VIEWPORT viewport; viewport.Width = static_cast<FLOAT>(viewportIn.Width); viewport.Height = static_cast<FLOAT>(viewportIn.Height); viewport.MinDepth = viewportIn.MinDepth; viewport.MaxDepth = viewportIn.MaxDepth; viewport.TopLeftX = static_cast<FLOAT>(viewportIn.TopLeftX); viewport.TopLeftY = static_cast<FLOAT>(viewportIn.TopLeftY); POMDOG_ASSERT(deviceContext); deviceContext->RSSetViewports(1, &viewport); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::SetScissorRectangle(Rectangle const& rectangle) { POMDOG_ASSERT(deviceContext); std::vector<D3D11_RECT> rects; rects.resize(std::max<std::size_t>(1, renderTargets.size())); D3D11_RECT rect; rect.bottom = rectangle.GetBottom(); rect.left = rectangle.GetLeft(); rect.right = rectangle.GetRight(); rect.top = rectangle.GetTop(); std::fill(std::begin(rects), std::end(rects), rect); POMDOG_ASSERT(!rects.empty()); deviceContext->RSSetScissorRects(rects.size(), rects.data()); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::SetPrimitiveTopology(PrimitiveTopology primitiveTopology) { deviceContext->IASetPrimitiveTopology( ToD3D11PrimitiveTopology(primitiveTopology)); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::SetBlendFactor(Color const& blendFactorIn) { auto vec = blendFactorIn.ToVector4(); blendFactor[0] = vec.X; blendFactor[1] = vec.Y; blendFactor[2] = vec.Z; blendFactor[3] = vec.W; needToApplyPipelineState = true; } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::SetVertexBuffers( std::vector<VertexBufferBinding> const& vertexBuffersIn) { POMDOG_ASSERT(!vertexBuffersIn.empty()); std::vector<UINT> strides; strides.reserve(vertexBuffersIn.size()); std::vector<UINT> offsets; offsets.reserve(vertexBuffersIn.size()); std::vector<ID3D11Buffer*> vertexBuffers; vertexBuffers.reserve(vertexBuffersIn.size()); for (auto & binding: vertexBuffersIn) { auto & vertexBuffer = binding.VertexBuffer; POMDOG_ASSERT(vertexBuffer); POMDOG_ASSERT(vertexBuffer->NativeVertexBuffer()); auto nativeVertexBuffer = static_cast<BufferDirect3D11*>( vertexBuffer->NativeVertexBuffer()); POMDOG_ASSERT(nativeVertexBuffer != nullptr); POMDOG_ASSERT(nativeVertexBuffer == dynamic_cast<BufferDirect3D11*>( vertexBuffer->NativeVertexBuffer())); vertexBuffers.push_back(nativeVertexBuffer->GetBuffer()); strides.push_back(vertexBuffer->StrideBytes()); offsets.push_back(binding.VertexOffset); } POMDOG_ASSERT(deviceContext); deviceContext->IASetVertexBuffers(0, vertexBuffers.size(), vertexBuffers.data(), strides.data(), offsets.data()); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::SetPipelineState(std::shared_ptr<NativePipelineState> const& pipelineStateIn) { POMDOG_ASSERT(deviceContext); POMDOG_ASSERT(pipelineStateIn); if (pipelineState != pipelineStateIn) { pipelineState = std::dynamic_pointer_cast<PipelineStateDirect3D11>(pipelineStateIn); POMDOG_ASSERT(pipelineState); needToApplyPipelineState = true; } } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::SetConstantBuffer( int index, std::shared_ptr<NativeBuffer> const& constantBufferIn) { POMDOG_ASSERT(index >= 0); POMDOG_ASSERT(index < D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT); POMDOG_ASSERT(dynamic_cast<BufferDirect3D11*>(constantBufferIn.get())); auto & constantBuffer = static_cast<BufferDirect3D11&>(*constantBufferIn); auto buffer = constantBuffer.GetBuffer(); POMDOG_ASSERT(buffer != nullptr); POMDOG_ASSERT(deviceContext); deviceContext->VSSetConstantBuffers(index, 1, &buffer); deviceContext->PSSetConstantBuffers(index, 1, &buffer); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::SetSampler(int index, NativeSamplerState* samplerIn) { POMDOG_ASSERT(index >= 0); POMDOG_ASSERT(index < D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT); POMDOG_ASSERT(samplerIn != nullptr); auto sampler = static_cast<SamplerStateDirect3D11*>(samplerIn); POMDOG_ASSERT(sampler != nullptr); POMDOG_ASSERT(sampler == dynamic_cast<SamplerStateDirect3D11*>(samplerIn)); POMDOG_ASSERT(sampler->GetSamplerState() != nullptr); std::array<ID3D11SamplerState*, 1> const states = { sampler->GetSamplerState() }; POMDOG_ASSERT(deviceContext); deviceContext->PSSetSamplers(index, states.size(), states.data()); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::SetTexture(int index) { POMDOG_ASSERT(index >= 0); POMDOG_ASSERT(index < D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT); POMDOG_ASSERT(index < static_cast<int>(textureResourceViews.size())); textureResourceViews[index] = nullptr; POMDOG_ASSERT(deviceContext); deviceContext->PSSetShaderResources(index, 1, &textureResourceViews[index]); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::SetTexture(int index, Texture2D & textureIn) { POMDOG_ASSERT(index >= 0); POMDOG_ASSERT(index < D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT); POMDOG_ASSERT(index < static_cast<int>(textureResourceViews.size())); POMDOG_ASSERT(textureIn.NativeTexture2D() != nullptr); auto texture = static_cast<Texture2DDirect3D11*>(textureIn.NativeTexture2D()); POMDOG_ASSERT(texture != nullptr); POMDOG_ASSERT(texture == dynamic_cast<Texture2DDirect3D11*>(textureIn.NativeTexture2D())); textureResourceViews[index] = texture->GetShaderResourceView(); POMDOG_ASSERT(deviceContext); deviceContext->PSSetShaderResources(0, 1, &textureResourceViews[index]); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::SetTexture(int index, RenderTarget2D & textureIn) { POMDOG_ASSERT(index >= 0); POMDOG_ASSERT(index < D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT); POMDOG_ASSERT(index < static_cast<int>(textureResourceViews.size())); POMDOG_ASSERT(textureIn.NativeRenderTarget2D() != nullptr); auto texture = static_cast<RenderTarget2DDirect3D11*>(textureIn.NativeRenderTarget2D()); POMDOG_ASSERT(texture != nullptr); POMDOG_ASSERT(texture == dynamic_cast<RenderTarget2DDirect3D11*>(textureIn.NativeRenderTarget2D())); textureResourceViews[index] = texture->GetShaderResourceView(); POMDOG_ASSERT(deviceContext); deviceContext->PSSetShaderResources(0, 1, &textureResourceViews[index]); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::SetRenderTarget() { renderTargets.clear(); renderTargets.push_back(backBuffer); std::array<ID3D11RenderTargetView*, 1> renderTargetViews = { backBuffer->GetRenderTargetView() }; deviceContext->OMSetRenderTargets( renderTargetViews.size(), renderTargetViews.data(), renderTargets.front()->GetDepthStencilView()); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::SetRenderTargets(std::vector<std::shared_ptr<RenderTarget2D>> const& renderTargetsIn) { POMDOG_ASSERT(!renderTargetsIn.empty()); POMDOG_ASSERT(renderTargetsIn.size() <= D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT); POMDOG_ASSERT(renderTargetsIn.size() <= renderTargets.capacity()); renderTargets.clear(); std::array<ID3D11RenderTargetView*, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT> renderTargetViews; POMDOG_ASSERT(renderTargetViews.size() <= D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT); POMDOG_ASSERT(renderTargetViews.size() >= renderTargetsIn.size()); for (std::size_t i = 0; i < renderTargetsIn.size(); ++i) { POMDOG_ASSERT(renderTargetsIn[i]); auto renderTarget = static_cast<RenderTarget2DDirect3D11*>(renderTargetsIn[i]->NativeRenderTarget2D()); POMDOG_ASSERT(renderTarget != nullptr); POMDOG_ASSERT(renderTarget == dynamic_cast<RenderTarget2DDirect3D11*>(renderTargetsIn[i]->NativeRenderTarget2D())); renderTargets.emplace_back(renderTargetsIn[i], renderTarget); renderTargetViews[i] = renderTarget->GetRenderTargetView(); POMDOG_ASSERT(renderTargetViews[i] != nullptr); } deviceContext->OMSetRenderTargets( renderTargetsIn.size(), renderTargetViews.data(), renderTargets.front()->GetDepthStencilView()); } //----------------------------------------------------------------------- void GraphicsContextDirect3D11::ResizeBackBuffers(ID3D11Device* device, int backBufferWidthIn, int backBufferHeightIn) { POMDOG_ASSERT(device != nullptr); POMDOG_ASSERT(backBufferWidthIn > 0); POMDOG_ASSERT(backBufferHeightIn > 0); preferredBackBufferWidth = backBufferWidthIn; preferredBackBufferHeight = backBufferHeightIn; bool isBackBufferActive = false; if (!renderTargets.empty()) { isBackBufferActive = (backBuffer == renderTargets.front()); } POMDOG_ASSERT(backBuffer); backBuffer->ResetBackBuffer(); POMDOG_ASSERT(swapChain); auto hr = swapChain->ResizeBuffers( backBufferCount, preferredBackBufferWidth, preferredBackBufferHeight, backBufferFormat, 0); if (FAILED(hr)) { POMDOG_THROW_EXCEPTION(std::runtime_error, "Failed to resize back buffer"); } backBuffer->ResetBackBuffer( device, swapChain.Get(), preferredBackBufferWidth, preferredBackBufferHeight, backBufferDepthFormat); if (isBackBufferActive) { SetRenderTarget(); } } //----------------------------------------------------------------------- ID3D11DeviceContext* GraphicsContextDirect3D11::GetDeviceContext() { POMDOG_ASSERT(deviceContext); return deviceContext.Get(); } //----------------------------------------------------------------------- } // namespace Direct3D11 } // namespace Detail } // namespace Pomdog
[ "mogemimi@enginetrouble.net" ]
mogemimi@enginetrouble.net
9cefd76b7fd91484901554bf8f47c3ad7ad307a3
59d26f54e985df3a0df505827b25da0c5ff586e8
/OJ_UVA/completed/544 - Heavy Cargo_AC.cpp
d513914a44051aafca2cac25a4451f0dec1d31de
[]
no_license
minhaz1217/My-C-Journey
820f7b284e221eff2595611b2e86dc9e32f90278
3c8d998ede172e9855dc6bd02cb468d744a9cad6
refs/heads/master
2022-12-06T06:12:30.823678
2022-11-27T12:09:03
2022-11-27T12:09:03
160,788,252
2
1
null
null
null
null
UTF-8
C++
false
false
3,392
cpp
#include<bits/stdc++.h> //#include<iostream> using namespace std; #define check(a) cout << a << endl; #define cc(a) cout << a << endl; #define msg(a,b) cout << a << " : " << b << endl; #define msg2(a,b,c) cout << a << " : " << b << " : " << c << endl; #define INF 5000000 struct edge{ int u,v,w; edge(int uu, int vv, int ww){ u = uu; v = vv; w = ww; } }; class disjoint_set{ vector<int>p,rt; public: disjoint_set(int n){ n = n+1; p.assign(n, 0); rt.assign(n, 0); for(int i=0;i<n;i++){ p[i] = i; } } int findSet(int x){ if(p[x] == x){ return x; }else{ p[x] = findSet(p[x]); return p[x]; } } int isSameSet(int x, int y){ return (findSet(x) == findSet(y)); } int unionSet(int x, int y){ if(!isSameSet(x,y)){ int a,b; a = findSet(x); b = findSet(y); if(rt[a] > rt[b]){ p[b] = a; }else{ p[a] = b; if(rt[a] == rt[b]){ rt[b]++; } } } } }; bool operator<(edge a, edge b){ return a.w < b.w; } int main(){ int n,m,s,d,city,i,cost,sz,u,v,w,ww,caseCounter = 1; string city1, city2; while(1){ scanf("%d%d", &n, &m); if(n == 0 && m == 0){ break; } //msg(n,m) city = 1; vector<edge>edges; vector<int>visited; queue<pair<int, int> > q; map<string, int>mp; vector<pair<int,int> > vec[n+4]; pair<int, int> f; disjoint_set dj(n); //cc("HI") while(m--){ cin >> city1 >> city2 >> w; //scanf("%s %s %d", &city1, &city2, &w); //msg2(city1, city2, w) if(!mp[city1]){ mp[city1] = city++; } if(!mp[city2]){ mp[city2] = city++; } edges.push_back(edge(mp[city1], mp[city2], w)); } sort(edges.begin(), edges.end()); reverse(edges.begin(), edges.end()); cost =0; sz = edges.size(); for(i=0;i<sz;i++){ u = edges[i].u; v = edges[i].v; w = edges[i].w; if(!dj.isSameSet(u,v)){ dj.unionSet(u,v); vec[u].push_back(make_pair(v,w)); vec[v].push_back(make_pair(u,w)); } } cin >> city1 >> city2; //scanf("%s%s", &city1, &city2); s = mp[city1]; d = mp[city2]; q.push(make_pair(s,INF)); visited.assign(n+1, 0); visited[s] = 1; while(!q.empty()){ f = q.front(); u = f.first; w = f.second; q.pop(); if(u == d){ cost = w; break; } for(i = 0; i< vec[u].size();i++){ v = vec[u][i].first; ww = vec[u][i].second; if(!visited[v]){ q.push(make_pair(v,min(w,ww))); visited[v] = 1; } } } printf("Scenario #%d\n%d tons\n", caseCounter++, cost); if(caseCounter>1){ printf("\n"); } } return 0; }
[ "minhaz1217@gmail.com" ]
minhaz1217@gmail.com
e3adb17fd49dfd1c0fa6caa454e3dabc95867588
0150323b8715b4194456415a94fe303bfd625263
/prototypes/camera_smoothing_demo/SmoothCam/Test.cpp
6f9258254e0e3420b04bea0b9776bf2391de735e
[]
no_license
Chris112/sep
a3d16499ea5c74b5687ed10300cc8072942802b2
a173ca381a5b0119a3d379686dce1f9bc2f74f74
refs/heads/master
2021-01-21T08:12:02.178475
2015-03-19T02:47:58
2015-03-19T02:47:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,104
cpp
#include <iostream> #include <cmath> #include <SFML/Graphics.hpp> #define PI 3.14159265 using namespace std; sf::Vector2i Extrapolation(sf::Vector2f circlePoint, sf::Vector2i posArray[7]) { double diffX; double diffY; double sumX = 0; double sumY = 0; for (int i = 6; i > 0; i--) { diffX = posArray[i].x - circlePoint.x; diffY = posArray[i].y - circlePoint.y; sumX += diffX; sumY += diffY; cout << diffX << endl; } sf::Vector2i prediction; prediction.x = posArray[6].x + (sumX/10); prediction.y = posArray[6].y + (sumY/10); return prediction; } double Lerp(double y1, double y2, double mu) { return (y1 * (1-mu) + y2*mu); } double Cerp(double y1, double y2, double mu) { double mu2; mu2 = (1-cos(mu*PI))/2; return (y1 * (1-mu2) + y2*mu2); } void Render() { sf::RenderWindow window(sf::VideoMode(1400, 800), "SmoothCam"); window.setFramerateLimit(30); sf::CircleShape circle(20.0f); circle.setFillColor(sf::Color(250,250,50)); circle.setPosition(400,400); sf::RectangleShape rectangle(sf::Vector2f(500, 500)); rectangle.setFillColor(sf::Color(0,0,250,80)); rectangle.setPosition(200,200); sf::Clock clock; sf::Time duration; sf::Clock clock2; sf::Time duration2; sf::Vector2i posArray[7]; posArray[0] = sf::Mouse::getPosition(window); posArray[1] = posArray[0]; posArray[2] = posArray[1]; posArray[3] = posArray[2]; posArray[4] = posArray[3]; posArray[5] = posArray[4]; posArray[6] = posArray[5]; sf::Vector2i predPos; sf::Vector2i actualPos; while (window.isOpen()) { sf::Event event; while (window.pollEvent(event)) { if (event.type == sf::Event::Closed) window.close(); } duration = clock.getElapsedTime(); if (duration.asSeconds() > 0.05) { clock.restart(); sf::Vector2i locPos = sf::Mouse::getPosition(window); if ((locPos.x > 0) && (locPos.x < 1400) && (locPos.y > 0) && (locPos.y < 800)) { for (int i = 0; i < 7; i++) { if (i == 6) { posArray[6] = locPos; } else { posArray[i] = posArray[i+1]; } } } } double counter = 0.25; duration2 = clock2.getElapsedTime(); if (duration2.asSeconds() > 0.01) { predPos = Extrapolation(circle.getPosition(), posArray); if ((circle.getPosition().x != predPos.x) || (circle.getPosition().y != predPos.y)) { actualPos.x = Cerp(circle.getPosition().x, predPos.x, counter); actualPos.y = Cerp(circle.getPosition().y, predPos.y, counter); counter = counter + 0.25; if (counter >= 1) { counter = 0; clock2.restart(); } circle.setPosition(actualPos.x, actualPos.y); } } rectangle.setPosition(circle.getPosition().x - 230, circle.getPosition().y - 230); window.clear(); window.draw(circle); window.draw(rectangle); window.display(); sf::sleep(sf::milliseconds(1)); } } int main() { Render(); return 1; }
[ "declanw@concap.com.au" ]
declanw@concap.com.au
7c2f2fb87e38e92c1a06c3f5d4487139e32db314
fc91ba45e3ad86fd0993f7f5180f1f37b4cb6bf6
/src/diffuse.cpp
8bbc7c243ca1c4bb05ae7ce3551a5603bbb28ec0
[]
no_license
mcihanozer/Nori_Based_Path_Tracer
77062e9f5e34b28dc079e708e980bc6d3b44febb
bbaaabfb121cb8c2c99a02e6e202e8639f0137e4
refs/heads/master
2021-01-25T04:35:59.822486
2017-06-05T23:05:44
2017-06-05T23:05:44
93,453,891
1
0
null
null
null
null
UTF-8
C++
false
false
2,828
cpp
/* This file is part of Nori, a simple educational ray tracer Copyright (c) 2012 by Wenzel Jakob and Steve Marschner. Nori is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation. Nori is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <nori/bsdf.h> #include <nori/frame.h> NORI_NAMESPACE_BEGIN /** * \brief Diffuse / Lambertian BRDF model */ class Diffuse : public BSDF { public: Diffuse(const PropertyList &propList) { m_albedo = propList.getColor("albedo", Color3f(0.5f)); } /// Evaluate the BRDF model Color3f eval(const BSDFQueryRecord &bRec) const { /* This is a smooth BRDF -- return zero if the measure is wrong, or when queried for illumination on the backside */ /*if (bRec.measure != ESolidAngle || Frame::cosTheta(bRec.wi) <= 0 || Frame::cosTheta(bRec.wo) <= 0) return Color3f(0.0f);*/ /* The BRDF is simply the albedo / pi */ return m_albedo * INV_PI; } /// Compute the density of \ref sample() wrt. solid angles float pdf(const BSDFQueryRecord &bRec) const { /* This is a smooth BRDF -- return zero if the measure is wrong, or when queried for illumination on the backside */ if (bRec.measure != ESolidAngle || Frame::cosTheta(bRec.wi) <= 0 || Frame::cosTheta(bRec.wo) <= 0) return 0.0f; /* Importance sampling density wrt. solid angles: cos(theta) / pi. Note that the directions in 'bRec' are in local coordinates, so Frame::cosTheta() actually just returns the 'z' component. */ return INV_PI * Frame::cosTheta(bRec.wo); } /// Draw a a sample from the BRDF model Color3f sample(BSDFQueryRecord &bRec, const Point2f &sample) const { if (Frame::cosTheta(bRec.wi) <= 0) return Color3f(0.0f); bRec.measure = ESolidAngle; /* Warp a uniformly distributed sample on [0,1]^2 to a direction on a cosine-weighted hemisphere */ bRec.wo = squareToCosineHemisphere(sample); /* eval() / pdf() * cos(theta) = albedo. There is no need to call these functions. */ return m_albedo; } Color3f getAlbedo() const { return m_albedo; } /// Return a human-readable summary QString toString() const { return QString( "Diffuse[\n" " albedo = %1\n" "]").arg(m_albedo.toString()); } EClassType getClassType() const { return EBSDF; } private: Color3f m_albedo; }; NORI_REGISTER_CLASS(Diffuse, "diffuse"); NORI_NAMESPACE_END
[ "mco@mcihanozer.com" ]
mco@mcihanozer.com
9f0905520ebe395c5e3b4af99a0c3237c9de44bd
1ef9f7cf178dae8c4c5fde529d281184012df9c3
/engine/source/public/engine/ecs/component_view.hpp
51a82e32dfeb2fe3789a1babe6ca66f6fe5219a0
[ "MIT" ]
permissive
kociap/GameEngine
a5d976f125786f3339e2c289cf68dbdd469fbe27
ff5f1ca589df5b44887c3383919a73bbe0ab05a0
refs/heads/master
2021-07-16T14:17:17.215078
2020-05-18T12:48:06
2020-05-18T12:48:06
158,875,033
15
1
MIT
2020-04-17T14:05:18
2018-11-23T20:24:40
C++
UTF-8
C++
false
false
7,564
hpp
#ifndef ENGINE_ECS_COMPONENT_VIEW_HPP_INCLUDE #define ENGINE_ECS_COMPONENT_VIEW_HPP_INCLUDE #include <core/math/math.hpp> #include <core/atl/utility.hpp> #include <engine/ecs/component_container.hpp> #include <core/atl/tuple.hpp> namespace anton_engine { template <typename... Components> class Component_View { static_assert(sizeof...(Components) > 0, "Why would you do this?"); friend class ECS; Component_View(Component_Container<Components>*... c): _containers(c...) {} public: using size_type = Component_Container_Base::size_type; class iterator { friend class Component_View; using underlying_iterator_t = typename Component_Container_Base::iterator; // begin and end are iterators into the smallest container iterator(atl::Tuple<Component_Container<Components>*...> c, underlying_iterator_t b, underlying_iterator_t e): _containers(c), _begin(b), _end(e) {} public: using value_type = typename atl::Iterator_Traits<underlying_iterator_t>::value_type; using reference = typename atl::Iterator_Traits<underlying_iterator_t>::reference; using pointer = typename atl::Iterator_Traits<underlying_iterator_t>::pointer; using difference_type = typename atl::Iterator_Traits<underlying_iterator_t>::difference_type; using iterator_category = atl::Forward_Iterator_Tag; iterator& operator++() { ANTON_ASSERT(_begin != _end, "Cannot advance end iterator"); do { ++_begin; } while(_begin != _end && !has_all_components(*_begin)); return *this; } iterator& operator+=(i64 rhs) { ANTON_VERIFY(rhs >= 0, "Forward iterator may not be moved backwards."); for (; rhs > 0; --rhs) { ++(*this); } } underlying_iterator_t operator->() { return _begin; } reference operator*() { return *_begin; } [[nodiscard]] friend iterator operator+(iterator lhs, i64 const rhs) { lhs += rhs; return lhs; } [[nodiscard]] friend bool operator==(iterator const& a, iterator const& b) { return a._begin == b._begin; } [[nodiscard]] friend bool operator!=(iterator const& a, iterator const& b) { return a._begin != b._begin; } private: bool has_all_components(Entity entity) { return (... && atl::get<Component_Container<Components>*>(_containers)->has(entity)); } private: atl::Tuple<Component_Container<Components>*...> _containers; underlying_iterator_t _begin; underlying_iterator_t _end; }; public: [[nodiscard]] size_type size() const { i64 sizes[] = {atl::get<Component_Container<Components>*>(_containers)->size()...}; i64 min = sizes[0]; for(i64 i = 1; i < atl::size(sizes); ++i) { min = math::min(min, sizes[i]); } return min; } [[nodiscard]] iterator begin() { auto c = find_smallest_container(); return iterator(_containers, c->begin(), c->end()); } [[nodiscard]] iterator end() { auto c = find_smallest_container(); return iterator(_containers, c->end(), c->end()); } template <typename... Ts> [[nodiscard]] decltype(auto) get(Entity const entity) { if constexpr (sizeof...(Ts) == 1) { return (..., atl::get<Component_Container<Ts>*>(_containers)->get(entity)); } else { return atl::Tuple<Ts&...>(get<Ts>(entity)...); } } // Provides a convenient way to iterate over all entities and their components. // Requires a callable of form void(Components&...) or void(Entity, Components&...) // May be less efficient than range-based for loop or other alternatives because it prefetches all components // template <typename Callable> void each(Callable&& callable) { static_assert(atl::is_invocable<Callable, Entity, Components&...> || atl::is_invocable<Callable, Components&...>); auto smallest_container = find_smallest_container(); for (Entity const entity: *smallest_container) { if (has_all_components(entity)) { if constexpr (atl::is_invocable<Callable, Components&...>) { callable(get<Components>(entity)...); } else { callable(entity, get<Components>(entity)...); } } } } private: bool has_all_components(Entity entity) { return (... && atl::get<Component_Container<Components>*>(_containers)->has(entity)); } // TODO add const support Component_Container_Base* find_smallest_container() { Component_Container_Base* conts[] = {static_cast<Component_Container_Base*>(atl::get<Component_Container<Components>*>(_containers))...}; i64 min = conts[0]->size(); i64 smallest_cont = 0; for(i64 i = 1; i < atl::size(conts); ++i) { i64 const size = conts[i]->size(); if(size < min) { min = size; smallest_cont = i; } } return conts[smallest_cont]; } private: atl::Tuple<Component_Container<Components>*...> _containers; }; // Specialization of Component_View for single component type. // Avoids unnecessary checks. template <typename Component> class Component_View<Component> { friend class ECS; Component_View(Component_Container<Component>* c): _container(c) {} public: using size_type = Component_Container_Base::size_type; using iterator = Component_Container_Base::iterator; [[nodiscard]] size_type size() const { return _container->size(); } [[nodiscard]] iterator begin() { return _container->Component_Container_Base::begin(); } [[nodiscard]] iterator end() { return _container->Component_Container_Base::end(); } [[nodiscard]] Component& get(Entity const entity) { return _container->get(entity); } // Provides a convenient way to iterate over all entities and their components. // Requires a callable of form void(Component&) or void(Entity, Component&) // template <typename Callable> void each(Callable&& callable) { static_assert(atl::is_invocable<Callable, Entity, Component&> || atl::is_invocable<Callable, Component&>); for (Entity entity: *static_cast<Component_Container_Base*>(_container)) { if constexpr (atl::is_invocable<Callable, Component&>) { callable(get(entity)); } else { callable(entity, get(entity)); } } } private: Component_Container<Component>* _container; }; } // namespace anton_engine #endif // !ENGINE_ECS_COMPONENT_VIEW_HPP_INCLUDE
[ "p.kocia@wp.pl" ]
p.kocia@wp.pl
8f545bdd7cb629c43717758649e3ad48019bd06d
08b8cf38e1936e8cec27f84af0d3727321cec9c4
/data/crawl/tar/hunk_414.cpp
f88827ff9b57c8bb57b6c0f7bfd36b4e929e2fb4
[]
no_license
ccdxc/logSurvey
eaf28e9c2d6307140b17986d5c05106d1fd8e943
6b80226e1667c1e0760ab39160893ee19b0e9fb1
refs/heads/master
2022-01-07T21:31:55.446839
2018-04-21T14:12:43
2018-04-21T14:12:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
20,159
cpp
+/* Copyright (C) 1989, 1997, 1998, 1999 Aladdin Enterprises. All rights reserved. */ + +/*$Id: ansi2knr.c $*/ +/* Convert ANSI C function definitions to K&R ("traditional C") syntax */ + +/* +ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY. No author or distributor accepts responsibility to anyone for the +consequences of using it or for whether it serves any particular purpose or +works at all, unless he says so in writing. Refer to the GNU General Public +License (the "GPL") for full details. + +Everyone is granted permission to copy, modify and redistribute ansi2knr, +but only under the conditions described in the GPL. A copy of this license +is supposed to have been given to you along with ansi2knr so you can know +your rights and responsibilities. It should be in a file named COPYLEFT, +or, if there is no file named COPYLEFT, a file named COPYING. Among other +things, the copyright notice and this notice must be preserved on all +copies. + +We explicitly state here what we believe is already implied by the GPL: if +the ansi2knr program is distributed as a separate set of sources and a +separate executable file which are aggregated on a storage medium together +with another program, this in itself does not bring the other program under +the GPL, nor does the mere fact that such a program or the procedures for +constructing it invoke the ansi2knr executable bring any other part of the +program under the GPL. +*/ + +/* + * Usage: + ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]] + * --filename provides the file name for the #line directive in the output, + * overriding input_file (if present). + * If no input_file is supplied, input is read from stdin. + * If no output_file is supplied, output goes to stdout. + * There are no error messages. + * + * ansi2knr recognizes function definitions by seeing a non-keyword + * identifier at the left margin, followed by a left parenthesis, with a + * right parenthesis as the last character on the line, and with a left + * brace as the first token on the following line (ignoring possible + * intervening comments and/or preprocessor directives), except that a line + * consisting of only + * identifier1(identifier2) + * will not be considered a function definition unless identifier2 is + * the word "void", and a line consisting of + * identifier1(identifier2, <<arbitrary>>) + * will not be considered a function definition. + * ansi2knr will recognize a multi-line header provided that no intervening + * line ends with a left or right brace or a semicolon. These algorithms + * ignore whitespace, comments, and preprocessor directives, except that + * the function name must be the first thing on the line. The following + * constructs will confuse it: + * - Any other construct that starts at the left margin and + * follows the above syntax (such as a macro or function call). + * - Some macros that tinker with the syntax of function headers. + */ + +/* + * The original and principal author of ansi2knr is L. Peter Deutsch + * <ghost@aladdin.com>. Other authors are noted in the change history + * that follows (in reverse chronological order): + lpd 1999-08-17 added code to allow preprocessor directives + wherever comments are allowed + lpd 1999-04-12 added minor fixes from Pavel Roskin + <pavel_roskin@geocities.com> for clean compilation with + gcc -W -Wall + lpd 1999-03-22 added hack to recognize lines consisting of + identifier1(identifier2, xxx) as *not* being procedures + lpd 1999-02-03 made indentation of preprocessor commands consistent + lpd 1999-01-28 fixed two bugs: a '/' in an argument list caused an + endless loop; quoted strings within an argument list + confused the parser + lpd 1999-01-24 added a check for write errors on the output, + suggested by Jim Meyering <meyering@ascend.com> + lpd 1998-11-09 added further hack to recognize identifier(void) + as being a procedure + lpd 1998-10-23 added hack to recognize lines consisting of + identifier1(identifier2) as *not* being procedures + lpd 1997-12-08 made input_file optional; only closes input and/or + output file if not stdin or stdout respectively; prints + usage message on stderr rather than stdout; adds + --filename switch (changes suggested by + <ceder@lysator.liu.se>) + lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with + compilers that don't understand void, as suggested by + Tom Lane + lpd 1996-01-15 changed to require that the first non-comment token + on the line following a function header be a left brace, + to reduce sensitivity to macros, as suggested by Tom Lane + <tgl@sss.pgh.pa.us> + lpd 1995-06-22 removed #ifndefs whose sole purpose was to define + undefined preprocessor symbols as 0; changed all #ifdefs + for configuration symbols to #ifs + lpd 1995-04-05 changed copyright notice to make it clear that + including ansi2knr in a program does not bring the entire + program under the GPL + lpd 1994-12-18 added conditionals for systems where ctype macros + don't handle 8-bit characters properly, suggested by + Francois Pinard <pinard@iro.umontreal.ca>; + removed --varargs switch (this is now the default) + lpd 1994-10-10 removed CONFIG_BROKETS conditional + lpd 1994-07-16 added some conditionals to help GNU `configure', + suggested by Francois Pinard <pinard@iro.umontreal.ca>; + properly erase prototype args in function parameters, + contributed by Jim Avera <jima@netcom.com>; + correct error in writeblanks (it shouldn't erase EOLs) + lpd 1989-xx-xx original version + */ + +/* Most of the conditionals here are to make ansi2knr work with */ +/* or without the GNU configure machinery. */ + +#if HAVE_CONFIG_H +# include <config.h> +#endif + +#include <stdio.h> +#include <ctype.h> + +#if HAVE_CONFIG_H + +/* + For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h). + This will define HAVE_CONFIG_H and so, activate the following lines. + */ + +# if STDC_HEADERS || HAVE_STRING_H +# include <string.h> +# else +# include <strings.h> +# endif + +#else /* not HAVE_CONFIG_H */ + +/* Otherwise do it the hard way */ + +# ifdef BSD +# include <strings.h> +# else +# ifdef VMS + extern int strlen(), strncmp(); +# else +# include <string.h> +# endif +# endif + +#endif /* not HAVE_CONFIG_H */ + +#if STDC_HEADERS +# include <stdlib.h> +#else +/* + malloc and free should be declared in stdlib.h, + but if you've got a K&R compiler, they probably aren't. + */ +# ifdef MSDOS +# include <malloc.h> +# else +# ifdef VMS + extern char *malloc(); + extern void free(); +# else + extern char *malloc(); + extern int free(); +# endif +# endif + +#endif + +/* Define NULL (for *very* old compilers). */ +#ifndef NULL +# define NULL (0) +#endif + +/* + * The ctype macros don't always handle 8-bit characters correctly. + * Compensate for this here. + */ +#ifdef isascii +# undef HAVE_ISASCII /* just in case */ +# define HAVE_ISASCII 1 +#else +#endif +#if STDC_HEADERS || !HAVE_ISASCII +# define is_ascii(c) 1 +#else +# define is_ascii(c) isascii(c) +#endif + +#define is_space(c) (is_ascii(c) && isspace(c)) +#define is_alpha(c) (is_ascii(c) && isalpha(c)) +#define is_alnum(c) (is_ascii(c) && isalnum(c)) + +/* Scanning macros */ +#define isidchar(ch) (is_alnum(ch) || (ch) == '_') +#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_') + +/* Forward references */ +char *ppdirforward(); +char *ppdirbackward(); +char *skipspace(); +char *scanstring(); +int writeblanks(); +int test1(); +int convert1(); + +/* The main program */ +int +main(argc, argv) + int argc; + char *argv[]; +{ FILE *in = stdin; + FILE *out = stdout; + char *filename = 0; + char *program_name = argv[0]; + char *output_name = 0; +#define bufsize 5000 /* arbitrary size */ + char *buf; + char *line; + char *more; + char *usage = + "Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n"; + /* + * In previous versions, ansi2knr recognized a --varargs switch. + * If this switch was supplied, ansi2knr would attempt to convert + * a ... argument to va_alist and va_dcl; if this switch was not + * supplied, ansi2knr would simply drop any such arguments. + * Now, ansi2knr always does this conversion, and we only + * check for this switch for backward compatibility. + */ + int convert_varargs = 1; + int output_error; + + while ( argc > 1 && argv[1][0] == '-' ) { + if ( !strcmp(argv[1], "--varargs") ) { + convert_varargs = 1; + argc--; + argv++; + continue; + } + if ( !strcmp(argv[1], "--filename") && argc > 2 ) { + filename = argv[2]; + argc -= 2; + argv += 2; + continue; + } + fprintf(stderr, "%s: Unrecognized switch: %s\n", program_name, + argv[1]); + fprintf(stderr, usage); + exit(1); + } + switch ( argc ) + { + default: + fprintf(stderr, usage); + exit(0); + case 3: + output_name = argv[2]; + out = fopen(output_name, "w"); + if ( out == NULL ) { + fprintf(stderr, "%s: Cannot open output file %s\n", + program_name, output_name); + exit(1); + } + /* falls through */ + case 2: + in = fopen(argv[1], "r"); + if ( in == NULL ) { + fprintf(stderr, "%s: Cannot open input file %s\n", + program_name, argv[1]); + exit(1); + } + if ( filename == 0 ) + filename = argv[1]; + /* falls through */ + case 1: + break; + } + if ( filename ) + fprintf(out, "#line 1 \"%s\"\n", filename); + buf = malloc(bufsize); + if ( buf == NULL ) + { + fprintf(stderr, "Unable to allocate read buffer!\n"); + exit(1); + } + line = buf; + while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL ) + { +test: line += strlen(line); + switch ( test1(buf) ) + { + case 2: /* a function header */ + convert1(buf, out, 1, convert_varargs); + break; + case 1: /* a function */ + /* Check for a { at the start of the next line. */ + more = ++line; +f: if ( line >= buf + (bufsize - 1) ) /* overflow check */ + goto wl; + if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL ) + goto wl; + switch ( *skipspace(ppdirforward(more), 1) ) + { + case '{': + /* Definitely a function header. */ + convert1(buf, out, 0, convert_varargs); + fputs(more, out); + break; + case 0: + /* The next line was blank or a comment: */ + /* keep scanning for a non-comment. */ + line += strlen(line); + goto f; + default: + /* buf isn't a function header, but */ + /* more might be. */ + fputs(buf, out); + strcpy(buf, more); + line = buf; + goto test; + } + break; + case -1: /* maybe the start of a function */ + if ( line != buf + (bufsize - 1) ) /* overflow check */ + continue; + /* falls through */ + default: /* not a function */ +wl: fputs(buf, out); + break; + } + line = buf; + } + if ( line != buf ) + fputs(buf, out); + free(buf); + if ( output_name ) { + output_error = ferror(out); + output_error |= fclose(out); + } else { /* out == stdout */ + fflush(out); + output_error = ferror(out); + } + if ( output_error ) { + fprintf(stderr, "%s: error writing to %s\n", program_name, + (output_name ? output_name : "stdout")); + exit(1); + } + if ( in != stdin ) + fclose(in); + return 0; +} + +/* + * Skip forward or backward over one or more preprocessor directives. + */ +char * +ppdirforward(p) + char *p; +{ + for (; *p == '#'; ++p) { + for (; *p != '\r' && *p != '\n'; ++p) + if (*p == 0) + return p; + if (*p == '\r' && p[1] == '\n') + ++p; + } + return p; +} +char * +ppdirbackward(p, limit) + char *p; + char *limit; +{ + char *np = p; + + for (;; p = --np) { + if (*np == '\n' && np[-1] == '\r') + --np; + for (; np > limit && np[-1] != '\r' && np[-1] != '\n'; --np) + if (np[-1] == 0) + return np; + if (*np != '#') + return p; + } +} + +/* + * Skip over whitespace, comments, and preprocessor directives, + * in either direction. + */ +char * +skipspace(p, dir) + char *p; + int dir; /* 1 for forward, -1 for backward */ +{ + for ( ; ; ) { + while ( is_space(*p) ) + p += dir; + if ( !(*p == '/' && p[dir] == '*') ) + break; + p += dir; p += dir; + while ( !(*p == '*' && p[dir] == '/') ) { + if ( *p == 0 ) + return p; /* multi-line comment?? */ + p += dir; + } + p += dir; p += dir; + } + return p; +} + +/* Scan over a quoted string, in either direction. */ +char * +scanstring(p, dir) + char *p; + int dir; +{ + for (p += dir; ; p += dir) + if (*p == '"' && p[-dir] != '\\') + return p + dir; +} + +/* + * Write blanks over part of a string. + * Don't overwrite end-of-line characters. + */ +int +writeblanks(start, end) + char *start; + char *end; +{ char *p; + for ( p = start; p < end; p++ ) + if ( *p != '\r' && *p != '\n' ) + *p = ' '; + return 0; +} + +/* + * Test whether the string in buf is a function definition. + * The string may contain and/or end with a newline. + * Return as follows: + * 0 - definitely not a function definition; + * 1 - definitely a function definition; + * 2 - definitely a function prototype (NOT USED); + * -1 - may be the beginning of a function definition, + * append another line and look again. + * The reason we don't attempt to convert function prototypes is that + * Ghostscript's declaration-generating macros look too much like + * prototypes, and confuse the algorithms. + */ +int +test1(buf) + char *buf; +{ char *p = buf; + char *bend; + char *endfn; + int contin; + + if ( !isidfirstchar(*p) ) + return 0; /* no name at left margin */ + bend = skipspace(ppdirbackward(buf + strlen(buf) - 1, buf), -1); + switch ( *bend ) + { + case ';': contin = 0 /*2*/; break; + case ')': contin = 1; break; + case '{': return 0; /* not a function */ + case '}': return 0; /* not a function */ + default: contin = -1; + } + while ( isidchar(*p) ) + p++; + endfn = p; + p = skipspace(p, 1); + if ( *p++ != '(' ) + return 0; /* not a function */ + p = skipspace(p, 1); + if ( *p == ')' ) + return 0; /* no parameters */ + /* Check that the apparent function name isn't a keyword. */ + /* We only need to check for keywords that could be followed */ + /* by a left parenthesis (which, unfortunately, is most of them). */ + { static char *words[] = + { "asm", "auto", "case", "char", "const", "double", + "extern", "float", "for", "if", "int", "long", + "register", "return", "short", "signed", "sizeof", + "static", "switch", "typedef", "unsigned", + "void", "volatile", "while", 0 + }; + char **key = words; + char *kp; + unsigned len = endfn - buf; + + while ( (kp = *key) != 0 ) + { if ( strlen(kp) == len && !strncmp(kp, buf, len) ) + return 0; /* name is a keyword */ + key++; + } + } + { + char *id = p; + int len; + /* + * Check for identifier1(identifier2) and not + * identifier1(void), or identifier1(identifier2, xxxx). + */ + + while ( isidchar(*p) ) + p++; + len = p - id; + p = skipspace(p, 1); + if (*p == ',' || + (*p == ')' && (len != 4 || strncmp(id, "void", 4))) + ) + return 0; /* not a function */ + } + /* + * If the last significant character was a ), we need to count + * parentheses, because it might be part of a formal parameter + * that is a procedure. + */ + if (contin > 0) { + int level = 0; + + for (p = skipspace(buf, 1); *p; p = skipspace(p + 1, 1)) + level += (*p == '(' ? 1 : *p == ')' ? -1 : 0); + if (level > 0) + contin = -1; + } + return contin; +} + +/* Convert a recognized function definition or header to K&R syntax. */ +int +convert1(buf, out, header, convert_varargs) + char *buf; + FILE *out; + int header; /* Boolean */ + int convert_varargs; /* Boolean */ +{ char *endfn; + char *p; + /* + * The breaks table contains pointers to the beginning and end + * of each argument. + */ + char **breaks; + unsigned num_breaks = 2; /* for testing */ + char **btop; + char **bp; + char **ap; + char *vararg = 0; + + /* Pre-ANSI implementations don't agree on whether strchr */ + /* is called strchr or index, so we open-code it here. */ + for ( endfn = buf; *(endfn++) != '('; ) + ; +top: p = endfn; + breaks = (char **)malloc(sizeof(char *) * num_breaks * 2); + if ( breaks == NULL ) + { /* Couldn't allocate break table, give up */ + fprintf(stderr, "Unable to allocate break table!\n"); + fputs(buf, out); + return -1; + } + btop = breaks + num_breaks * 2 - 2; + bp = breaks; + /* Parse the argument list */ + do + { int level = 0; + char *lp = NULL; + char *rp = NULL; + char *end = NULL; + + if ( bp >= btop ) + { /* Filled up break table. */ + /* Allocate a bigger one and start over. */ + free((char *)breaks); + num_breaks <<= 1; + goto top; + } + *bp++ = p; + /* Find the end of the argument */ + for ( ; end == NULL; p++ ) + { switch(*p) + { + case ',': + if ( !level ) end = p; + break; + case '(': + if ( !level ) lp = p; + level++; + break; + case ')': + if ( --level < 0 ) end = p; + else rp = p; + break; + case '/': + if (p[1] == '*') + p = skipspace(p, 1) - 1; + break; + case '"': + p = scanstring(p, 1) - 1; + break; + default: + ; + } + } + /* Erase any embedded prototype parameters. */ + if ( lp && rp ) + writeblanks(lp + 1, rp); + p--; /* back up over terminator */ + /* Find the name being declared. */ + /* This is complicated because of procedure and */ + /* array modifiers. */ + for ( ; ; ) + { p = skipspace(p - 1, -1); + switch ( *p ) + { + case ']': /* skip array dimension(s) */ + case ')': /* skip procedure args OR name */ + { int level = 1; + while ( level ) + switch ( *--p ) + { + case ']': case ')': + level++; + break; + case '[': case '(': + level--; + break; + case '/': + if (p > buf && p[-1] == '*') + p = skipspace(p, -1) + 1; + break; + case '"': + p = scanstring(p, -1) + 1; + break; + default: ; + } + } + if ( *p == '(' && *skipspace(p + 1, 1) == '*' ) + { /* We found the name being declared */ + while ( !isidfirstchar(*p) ) + p = skipspace(p, 1) + 1; + goto found; + } + break; + default: + goto found; + } + } +found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' ) + { if ( convert_varargs ) + { *bp++ = "va_alist"; + vararg = p-2; + } + else + { p++; + if ( bp == breaks + 1 ) /* sole argument */ + writeblanks(breaks[0], p); + else + writeblanks(bp[-1] - 1, p); + bp--; + } + } + else + { while ( isidchar(*p) ) p--; + *bp++ = p+1; + } + p = end; + } + while ( *p++ == ',' ); + *bp = p; + /* Make a special check for 'void' arglist */ + if ( bp == breaks+2 ) + { p = skipspace(breaks[0], 1); + if ( !strncmp(p, "void", 4) ) + { p = skipspace(p+4, 1); + if ( p == breaks[2] - 1 ) + { bp = breaks; /* yup, pretend arglist is empty */ + writeblanks(breaks[0], p + 1); + } + } + } + /* Put out the function name and left parenthesis. */ + p = buf; + while ( p != endfn ) putc(*p, out), p++; + /* Put out the declaration. */ + if ( header ) + { fputs(");", out); + for ( p = breaks[0]; *p; p++ ) + if ( *p == '\r' || *p == '\n' ) + putc(*p, out); + } + else + { for ( ap = breaks+1; ap < bp; ap += 2 ) + { p = *ap; + while ( isidchar(*p) ) + putc(*p, out), p++; + if ( ap < bp - 1 ) + fputs(", ", out); + } + fputs(") ", out); + /* Put out the argument declarations */ + for ( ap = breaks+2; ap <= bp; ap += 2 ) + (*ap)[-1] = ';'; + if ( vararg != 0 ) + { *vararg = 0; + fputs(breaks[0], out); /* any prior args */ + fputs("va_dcl", out); /* the final arg */ + fputs(bp[0], out); + } + else + fputs(breaks[0], out); + } + free((char *)breaks); + return 0; +}
[ "993273596@qq.com" ]
993273596@qq.com
458b3c2ea7811c82745306237b9e798ce08c616a
48d66432cb9c501f4ed9dec9ee35ae2c9f88a932
/LeetCode/LeetCode1266:访问所有点的最小时间.cpp
5f94d935f1b5e4625a0704d9ac00be7df58563de
[]
no_license
SaberSE/ACM_Coding_Plan
85b7e52b6d4f466831393e339f5e5cfeed26b350
f26cb9d453bcce4e22e6a2f503d8f7c064a2c046
refs/heads/master
2022-03-25T19:50:07.334434
2019-12-19T08:33:09
2019-12-19T08:33:09
277,805,215
1
0
null
2020-07-07T12:04:40
2020-07-07T12:04:40
null
UTF-8
C++
false
false
388
cpp
/* 思路:切比雪夫距离,两点间的距离为max(abs(x1-x2), abs(y1-y2)). */ class Solution { public: int minTimeToVisitAllPoints(vector<vector<int>>& points) { int dis = 0; for(int i = 0; i < points.size() - 1; ++i) { dis += max(abs(points[i][0] - points[i + 1][0]), abs(points[i][1] - points[i + 1][1])); } return dis; } };
[ "maxmalmap@qq.com" ]
maxmalmap@qq.com
7056d2fc3b987425771891f16c2e04b133106e88
c8e6f194669663e0e2748dbc56a7172b9ea008f7
/.localhistory/c/Users/Alfa-Dozent/Documents/Visual Studio 2015/Projects/GUI/GUI/1471946280$DrawingPanel.h
71c3753dfbfbf7333c64d3e37c56a7e64aa75244
[]
no_license
itreppert/GUI
1922e781d804d17cb8008197fdbfa11576077618
9ca4ea0531eb45a4462a4d8278aec67f8c2705ef
refs/heads/master
2020-04-17T20:29:10.965471
2016-09-06T13:18:01
2016-09-06T13:18:01
67,501,677
0
0
null
null
null
null
UTF-8
C++
false
false
2,016
h
#pragma once public ref class DrawingPanel :public System::Windows::Forms::Panel { public: DrawingPanel() { } virtual ~DrawingPanel() { } void drawHouse(System::Graphics^ graphics, int startPositionX, int startPositionY, double scaleFactorX, double scaleFactorY) { System::Drawing::Pen^ penBlue = gcnew System::Drawing::Pen(System::Drawing::Color::Blue); drawSpecialLine(graphics, penBlue, startPositionX, startPositionY, 0, 300, 0, 100, scaleFactorX, scaleFactorY); drawSpecialLine(graphics, penBlue, startPositionX, startPositionY, 0, 100, 200, 100, scaleFactorX, scaleFactorY); drawSpecialLine(graphics, penBlue, startPositionX, startPositionY, 200, 100, 200, 300, scaleFactorX, scaleFactorY); drawSpecialLine(graphics, penBlue, startPositionX, startPositionY, 200, 300, 0, 300, scaleFactorX, scaleFactorY); drawSpecialLine(graphics, penBlue, startPositionX, startPositionY, 0, 100, 100, 20, scaleFactorX, scaleFactorY); drawSpecialLine(graphics, penBlue, startPositionX, startPositionY, 100, 20, 200, 100, scaleFactorX, scaleFactorY); drawSpecialLine(graphics, penBlue, startPositionX, startPositionY, 100, 20, 300, 20, scaleFactorX, scaleFactorY); drawSpecialLine(graphics, penBlue, startPositionX, startPositionY, 300, 20, 400, 100, scaleFactorX, scaleFactorY); drawSpecialLine(graphics, penBlue, startPositionX, startPositionY, 400, 100, 200, 100, scaleFactorX, scaleFactorY); drawSpecialLine(graphics, penBlue, startPositionX, startPositionY, 400, 300, 400, 100, scaleFactorX, scaleFactorY); drawSpecialLine(graphics, penBlue, startPositionX, startPositionY, 200, 300, 400, 300, scaleFactorX, scaleFactorY); } void drawSpecialLine(Graphics^ graphics, Pen^ pen, float startPositionX, float startPositionY, float x1, float y1, float x2, float y2, float scaleFactorX, float scaleFactorY) { graphics->DrawLine(pen, startPositionX + x1 * scaleFactorX, startPositionY + y1 * scaleFactorY, startPositionX + x2 * scaleFactorX, startPositionY + y2 * scaleFactorY); } };
[ "Alfa-Dozent@SB-U03-001" ]
Alfa-Dozent@SB-U03-001
e6d03d86572062c7f9089a4bd1c1d1b9ba72b149
f29aa1948839b80f9a7bfada004011c4602a79d5
/src/HDPenReg/lars/Lars.h
35b9330c36dc5a1275ab379e19950dbe2460723e
[]
no_license
Ivis4ml/HDPenReg
8b502a865d5451a91e7693d83b7370c8486d33c2
6d4064a508aadda5396a3c36ffb256fe5766e80e
refs/heads/master
2021-04-28T13:34:36.527008
2018-01-19T16:06:10
2018-01-19T16:06:10
null
0
0
null
null
null
null
UTF-8
C++
false
false
10,546
h
/*--------------------------------------------------------------------*/ /* Copyright (C) 2013-2013 Serge Iovleff, Quentin Grimonprez This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact : quentin.grimonprez@inria.fr */ /* * Project: MPAGenomics:: * created on: 12 févr. 2013 * Author: Quentin Grimonprez **/ /** @file Lars.h * @brief In this file, we define the class @c Lars. **/ #ifndef LARS_H_ #define LARS_H_ #include "Path.h" /** @namespace HD * The namespace HD contains all the lars class and methods. **/ namespace HD { /** * Class for running the LARS algorithm. * * Let \f$ X\f$ a matrix of size \f$ n\times p\f$, \f$ y\f$ a vector of length \f$ n\f$ and \f$\lambda\f$ a positive real. * * The lasso problem is to find \f$ \hat{\beta}\f$ such that * * \f$ \hat{\beta}=argmin_{\beta} \|\mathbf{y}-\mathbf{X}\mathbf{\beta}\|_2^2 + \lambda\|\beta\|_1\f$ * * * The LARS algorithm solves the lasso problem for all values of lambda. * */ class Lars { public: //constructors /** * Constructor * @param X matrix of data, a row=a individual * @param y response * @param intercept if true there is an intercept in the model */ Lars(STK::CArrayXX const& X, STK::CVectorX const& y, bool intercept = true); /** * Constructor * @param X matrix of data, a row=a individual * @param y response * @param maxSteps number of maximum step to do * @param intercept if true there is an intercept in the model * @param eps epsilon (for 0) */ Lars( STK::CArrayXX const& X, STK::CVectorX const& y, int maxSteps , bool intercept=true, STK::Real eps =STK::Arithmetic<STK::Real>::epsilon()); //getters /**@return path of the coefficients*/ inline Path const& path() const {return path_;} /** * @param i step * @return the Pathstate object : the state of the path at the step i */ inline PathState const& path(int i) const {return path_.states(i);} /** * @param i index of the step * @param j index of the coefficients * @return the value of the j-th coefficient at the step i */ inline STK::Real coefficient(int i,int j) const {return path_.varCoeff(i,j);} /** * @param i index of the step * @param j index of the coefficients * @return the value of the j-th coefficient at the step i */ inline int varIdx(int i,int j) const {return path_.varIdx(i,j);} /** * @param i index of the step * @return the value of l1norm at the i-th step */ inline STK::Real l1norm(int i) const {return path_.l1norm(i);} /** @return the vector of l1norm*/ inline STK::Array2DVector<STK::Real> const l1norm() const {return path_.l1norm();} /** @return the vector of lambda*/ inline std::vector<STK::Real> const lambda() const {return path_.lambda();} /** @return the historic of add and drop variable*/ inline std::vector< std::pair<std::vector<int> ,std::vector<int> > > evolution() const {return path_.evolution();} /**@return Number of step of the algorithm*/ inline int step() const {return step_;} /** @return the intercept of the solution*/ inline STK::Real mu() const {return mu_;} /** @return the ignored variable*/ inline std::vector<bool> toIgnore() const {return toIgnore_;} /** @return msg_error_*/ inline std::string msg_error() const {return msg_error_;} /**@return muX_*/ inline STK::CVectorX muX() const {return muX_;} /**@return muX_[i]*/ inline STK::Real muX(int i) const {return muX_[i];} //methods /** run lars algorithm*/ void run(); /** * predict the path for a ratio fraction = l1norm/l1normmax * @param X new data for predict the response * @param index index (lambda or fraction) where the response is estimated. * @param lambdaMode if TRUE, index corresponds to a value of lambda, if FALSE, index is a real between 0 and 1 * corresponding to ratio between the l1 norm of estimates to calculate and l1 norm max of solution * @param yPred container for the predicted response (will be modified) */ void predict(STK::CArrayXX const& X, STK::Real index, bool lambdaMode, STK::CVectorX &yPred); protected: /** * initialization of algorithm */ void initialization(); /** * search non active variable with the greatest correlation * @param Cmax correlation max * @param newId a vector containing the index of variable to potentially add */ void computeAddSet(STK::Real Cmax, std::vector<int>& newId) const; /** * update the QR decomposition of Xi * @param idxVar index of active variable to add * @param signC sign of correlation of active variable * @param action a pair with first element is a bool (true for addcase, false for dropcase) and second the idx variable to drop/add */ void updateR(int idxVar, STK::Array2DVector<int> &signC, std::pair<bool,std::vector<int> > &action); /** * compute inv(Xi'*Xi)*1 from qr decomposition * @param Gi1 for stock inv(Xi'*Xi)*1 * @param signC sign of correlation of active variable */ void computeGi1(STK::Array2DVector<STK::Real> &Gi1, STK::Array2DVector<int> const& signC) const; /** * compute Cmax * @return Cmax the correlation max */ STK::Real computeCmax(); /** * add Cmax to the vector of lambda * @return Cmax the correlation max of the step */ inline void addCmax(STK::Real const& Cmax) {path_.addLambda(Cmax);}; /** dropStep * downdate qr decomposition, X and signC * @param idxVar index of active variable to drop * @param signC sign of correlation of active variable */ void dropStep(std::vector<int> const& idxVar, STK::Array2DVector<int> &signC); /** * Compute gammahat for the update of coefficient in add case * @param Aa norm of the inverse of G * @param a X' * equiangular vector * @param Cmax correlation max * @return gammaHat a real */ STK::Real computeGamHat(STK::Real const& Aa, STK::CVectorX const& a, STK::Real Cmax) const; /** * Compute gammaTilde for the update of coefficient in drop case * @param w Aa*Gi1 @see computeGi1 * @param idxMin we stock the index (in the activeVariable vector) of the variable with the min value * @return gammatilde a real */ STK::Real computeGamTilde(STK::Array2DVector<STK::Real> const& w, std::vector<int> &idxMin) const; /** * Update the coefficient of the path * @param gamma gammaHat or gammaTilde * @param w Aa*Gi1 @see computeGi1 * @param action a pair with first element is a bool (true for addcase, false for dropcase) and second the idx variable to drop/add * @param isAddCase true if we add a variable * @param dropId id top potentially drop */ void updateBeta(STK::Real gamma, STK::Array2DVector<STK::Real> const& w, std::pair<bool,std::vector<int> > action, bool isAddCase, std::vector<int> dropId); /** * first step * @param Cmax correlation max * @param newId vector of index of active variable to add * @param signC sign of correlation of active variable * @param action a pair with first element is a bool (true for addcase, false for dropcase) and second the idx variable to drop/add * @param Aa norm of the inverse of G * @param Gi1 for stock inv(Xi'*Xi)*1 * @param w Aa*Gi1 * @param u unit vector making equal angles with the column of Xi * @param a X' * equiangular vector * @param Gi1 * @param gam the step for update coefficients * @return */ bool firstStep(STK::Real &Cmax, std::vector<int> &newId, STK::Array2DVector<int> &signC, std::pair<bool,std::vector<int> > &action, STK::Real &Aa, STK::Array2DVector<STK::Real> &Gi1, STK::Array2DVector<STK::Real> &w, STK::CVectorX &u, STK::CVectorX &a, STK::Real &gam); /** * updateR only for the first step * @see updateR */ void firstUpdateR(int idxVar, STK::Array2DVector<int> &signC, std::pair<bool,std::vector<int> > &action); private: ///number of individuals int n_; ///number of variables int p_; /// maximal number of steps int maxSteps_; ///covariate size n*p STK::CArrayXX X_; ///response size p*1 STK::CVectorX y_; ///mean of each covariate of X STK::CVectorX muX_; /// path solution Path path_; /// current active variable (non zero coefficient) std::vector<bool> isActive_; ///index of variables to ignore because it causes singularity std::vector<bool> toIgnore_; ///number of active variables int nbActiveVariable_; ///number of ignored variables int nbIgnoreVariable_; ///index of active variables STK::Array2DVector<int> activeVariables_; ///current step int step_; /// Beta_0 STK::Real mu_; ///eps for zero approximation STK::Real eps_; ///qr decomposition of Xi STK::lapack::Qr qrX_; ///X reduced to covariates of active Set STK::Array2D<STK::Real> Xi_; /// vector of correlation (size p*1) STK::CVectorX c_; /// if true, there is an intercept in the model bool intercept_; ///last error message std::string msg_error_; }; }//end namespace #endif /* LARS_H_ */
[ "csardi.gabor+cran@gmail.com" ]
csardi.gabor+cran@gmail.com
62aabcb139f1b906860821cf8810a358b2c93aa2
487f88955f150fc034baae5a727994c29636398b
/opensplice/install/HDE/x86_64.linux/include/dcps/C++/isocpp/dds/core/xtypes/detail/PrimitiveTypes.hpp
a7f06cc34a57c023b6dc99f9e57c1d1b57c8ee60
[ "Apache-2.0" ]
permissive
itfanr/opensplice-cpp-cmake
6ddb8767509904c8b2a3cd3d3fafc3b460202ea0
d9a3eac9d7e91d3a5f114c914a449a9911d1d1ea
refs/heads/master
2020-04-01T22:32:35.124459
2018-10-19T05:34:14
2018-10-19T05:34:14
153,714,000
1
1
null
null
null
null
UTF-8
C++
false
false
1,012
hpp
/* * OpenSplice DDS * * This software and documentation are Copyright 2006 to PrismTech * Limited, its affiliated companies and licensors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef OSPL_DDS_CORE_XTYPES_DETAIL_PRIMITIVETYPES_HPP_ #define OSPL_DDS_CORE_XTYPES_DETAIL_PRIMITIVETYPES_HPP_ /** * @file */ // Implementation // End of implementation #endif /* OSPL_DDS_CORE_XTYPES_DETAIL_PRIMITIVETYPES_HPP_ */
[ "bjq1016@126.com" ]
bjq1016@126.com
46d5b6753d8a04af63fda8d915644e67aa2ac6a1
4503b4ec29e9a30d26c433bac376f2bddaefd9e5
/XtreamToolkit/v16.4.0/Source/CommandBars/XTPCommandBars.cpp
a6aa688e4e96f528f49278fb441e35f092740f97
[]
no_license
SwunZH/ecocommlibs
0a872e0bbecbb843a0584fb787cf0c5e8a2a270b
4cff09ff1e479f5f519f207262a61ee85f543b3a
refs/heads/master
2021-01-25T12:02:39.067444
2018-02-23T07:04:43
2018-02-23T07:04:43
123,447,012
1
0
null
2018-03-01T14:37:53
2018-03-01T14:37:53
null
UTF-8
C++
false
false
58,177
cpp
// XTPCommandBars.cpp : implementation of the CXTPCommandBars class. // // This file is a part of the XTREME COMMANDBARS MFC class library. // (c)1998-2013 Codejock Software, All Rights Reserved. // // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN // CONSENT OF CODEJOCK SOFTWARE. // // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A // SINGLE COMPUTER. // // CONTACT INFORMATION: // support@codejock.com // http://www.codejock.com // ///////////////////////////////////////////////////////////////////////////// #include "StdAfx.h" #include <Common/XTPResourceManager.h> #include <Common/XTPResourceImage.h> #include <Common/XTPColorManager.h> #include <Common/XTPImageManager.h> #include <Common/XTPIntel80Helpers.h> #include <Common/XTPPropExchange.h> #include <Common/XTPToolTipContext.h> #include <Common/XTPHookManager.h> #include <Common/XTPSystemHelpers.h> #include <Common/XTPDrawHelpers.h> #include <Common/ScrollBar/XTPScrollInfo.h> #include <Common/Hook/XTPWinEventHook.h> #include <TabManager/Includes.h> #include <CommandBars/Resource.h> #include <CommandBars/XTPCommandBarsDefines.h> #include <CommandBars/XTPControl.h> #include <CommandBars/XTPControlButton.h> #include <CommandBars/XTPControlPopup.h> #include <CommandBars/XTPControls.h> #include <CommandBars/XTPCommandBar.h> #include <CommandBars/XTPToolBar.h> #include <CommandBars/XTPPopupBar.h> #include <CommandBars/XTPMenuBar.h> #include <CommandBars/XTPDockBar.h> #include <CommandBars/XTPShortcutManager.h> #include <CommandBars/XTPPaintManager.h> #include <CommandBars/XTPKeyboardManager.h> #include <CommandBars/XTPMouseManager.h> #include <CommandBars/XTPControlEdit.h> #include <CommandBars/Customize/XTPCustomizeTools.h> #include <CommandBars/XTPCommandBars.h> #include <CommandBars/XTPControlExt.h> #include <CommandBars/XTPTabClientWnd.h> #include <CommandBars/XTPReBar.h> #include <CommandBars/Frame/XTPFrameHook.h> #include <CommandBars/XTPCommandBarList.h> #include <CommandBars/XTPCommandBarsContextMenus.h> #include <CommandBars/XTPCommandBarsOptions.h> #include <CommandBars/XTPCommandBarKeyboardTip.h> #include <Common/ScrollBar/XTPScrollBase.h> #include <CommandBars/XTPControlGallery.h> #ifdef _XTP_ACTIVEX // Recent File List #include <CommandBars/XTPRecentFileList.h> #endif #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif CRuntimeClass* CXTPCommandBars::m_pToolBarClass = RUNTIME_CLASS(CXTPToolBar); CRuntimeClass* CXTPCommandBars::m_pMenuBarClass = RUNTIME_CLASS(CXTPMenuBar); CRuntimeClass* CXTPCommandBars::m_pPopupBarClass = RUNTIME_CLASS(CXTPPopupBar); CRuntimeClass* CXTPCommandBars::m_pPopupToolBarClass = RUNTIME_CLASS(CXTPPopupToolBar); CRuntimeClass* CXTPCommandBars::m_pDockBarClass = RUNTIME_CLASS(CXTPDockBar); ////////////////////////////////////////////////////////////////////////// CXTPCommandBarsContextMenus::CXTPCommandBarsContextMenus(CXTPCommandBars* pCommandBars) : CXTPCommandBarList(pCommandBars) { #ifdef _XTP_ACTIVEX EnableAutomation(); EnableTypeLib(); #endif } CXTPCommandBar* CXTPCommandBarsContextMenus::Add(CXTPCommandBar* pPopupBar) { ASSERT_KINDOF(CXTPPopupBar, pPopupBar); m_arrBars.Add(pPopupBar); ((CXTPPopupBar*)pPopupBar)->m_bContextMenu = TRUE; return pPopupBar; } CXTPCommandBar* CXTPCommandBarsContextMenus::Add(UINT nIDBar, LPCTSTR strCaption, CMenu* pSubMenu) { CXTPPopupBar* pPopupBar = CXTPPopupBar::CreatePopupBar(m_pCommandBars); m_arrBars.Add(pPopupBar); pPopupBar->LoadMenu(pSubMenu); pPopupBar->SetBarID(nIDBar); pPopupBar->SetTitle(strCaption); pPopupBar->GetControls()->CreateOriginalControls(); pPopupBar->m_bContextMenu = TRUE; return pPopupBar; } CXTPCommandBar* CXTPCommandBarsContextMenus::Add(UINT nIDBar) { return Add(nIDBar, nIDBar, 0); } CXTPCommandBar* CXTPCommandBarsContextMenus::Add(UINT nIDBar, UINT nIDMenuResource, int nSubMenu) { CXTPPopupBar* pPopupBar = CXTPPopupBar::CreatePopupBar(m_pCommandBars); m_arrBars.Add(pPopupBar); CMenu menu; if (!menu.LoadMenu(nIDMenuResource)) return pPopupBar; CMenu* pSubMenu = menu.GetSubMenu(nSubMenu); if (!pSubMenu) return pPopupBar; pPopupBar->LoadMenu(pSubMenu); pPopupBar->SetBarID(nIDBar); CString strCaption; XTPResourceManager()->GetMenuLocaleString(&menu, nSubMenu, strCaption, MF_BYPOSITION); CXTPDrawHelpers::StripMnemonics(strCaption); pPopupBar->SetTitle(strCaption); pPopupBar->GetControls()->CreateOriginalControls(); pPopupBar->m_bContextMenu = TRUE; return pPopupBar; } CXTPCommandBars* CXTPCommandBars::CreateCommandBars() { CXTPCommandBars* pCommandBars = (CXTPCommandBars*)CXTPCommandBars::CreateObject(); return pCommandBars; } // CXTPCommandBars IMPLEMENT_DYNCREATE(CXTPCommandBars, CCmdTarget) CXTPCommandBars::CXTPCommandBars() : m_pFrame (0) , m_nDefaultMenuID(0) , m_bAllCaps(FALSE) { m_bBeingDestructed = FALSE; ZeroMemory(m_pDocks, 4 * sizeof(CXTPDockBar*)); m_pDragSelected = NULL; m_bQuickCustomizeMode = m_bCustomizeMode = FALSE; m_bCustomizeAvail = FALSE; m_pDropSource = new CXTPCustomizeDropSource(this); m_bDefaultResetCustomizedToolbarChoiceEnabled = FALSE; m_bDefaultResetCustomizedToolbarChoice = FALSE; m_pPaintManager = NULL; m_pImageManager = NULL; m_pMouseManager = NULL; m_pKeyboardManager = NULL; m_pOptions = new CXTPCommandBarsOptions; m_pOptions->m_pCommandBars = this; m_pDesignerControls = NULL; m_bIgnoreShiftMenuKey = FALSE; EnableAutomation(); m_bRecalcLayout = FALSE; m_bRightToLeft = FALSE; m_pToolTipContext = new CXTPToolTipContext; m_pToolTipContext->ModifyToolTipStyle(TTS_NOPREFIX, 0); m_bUseKeyboardCues = FALSE; m_bKeyboardCuesVisible = TRUE; m_pShortcutManager = new CXTPShortcutManager(this); m_nIDHelpTracking = 0; m_bDesignerMode = FALSE; m_keyboardTips.pBar = NULL; m_keyboardTips.nLevel = 0; m_keyboardTips.nKey = 0; m_bPreviewMode = FALSE; m_pActions = new CXTPControlActions(this); m_bEnableActions = FALSE; m_pContextMenus = new CXTPCommandBarsContextMenus(this); m_pFrameHook = NULL; CXTPSoundManager* pSoundManager = XTPSoundManager(); // Create singleton. UNREFERENCED_PARAMETER(pSoundManager); #ifdef _XTP_ACTIVEX if (m_pDesignerControls == NULL) { CXTPControls* pControls = new CXTPControls(); pControls->SetCommandBars(this); m_pDesignerControls = pControls; } m_pRecentFileList = new CXTPRecentFileList(0, _T("Recent File List"), _T("File%d"), 16); #endif m_pOptions->ShowKeyboardCues(xtpKeyboardCuesShowWindowsDefault); } CXTPCommandBars::~CXTPCommandBars() { m_bBeingDestructed = TRUE; CMDTARGET_RELEASE(m_pDragSelected); CMDTARGET_RELEASE(m_pDesignerControls); m_pContextMenus->RemoveAll(); CMDTARGET_RELEASE(m_pContextMenus); RemoveAll(); for (int i = 0; i < 4; i++) { if (m_pDocks[i]) { m_pDocks[i]->DestroyWindow(); delete m_pDocks[i]; } } delete m_pDropSource; CMDTARGET_RELEASE(m_pPaintManager); CMDTARGET_RELEASE(m_pImageManager); CMDTARGET_RELEASE(m_pToolTipContext); CMDTARGET_RELEASE(m_pShortcutManager); CMDTARGET_RELEASE(m_pOptions); XTPSoundManager()->StopThread(); if (m_pActions) { m_pActions->RemoveAll(); CMDTARGET_RELEASE(m_pActions); } #ifdef _XTP_ACTIVEX if (m_pRecentFileList) m_pRecentFileList->InternalRelease(); #endif SAFE_DELETE(m_pFrameHook); } BOOL IsToolBarVisible(CXTPToolBar* pCommandBar) { return pCommandBar&& pCommandBar->IsWindowVisible(); } void CXTPCommandBars::EnableActions(BOOL bEnableActions) { m_bEnableActions = bEnableActions; } CXTPControlAction* CXTPCommandBars::CreateAction(int nId) { return m_pActions->Add(nId); } CXTPControlAction* CXTPCommandBars::FindAction(int nId) const { return this == NULL ? NULL : m_pActions->FindAction(nId); } CXTPMenuBar* CXTPCommandBars::GetMenuBar() const { return DYNAMIC_DOWNCAST(CXTPMenuBar, GetToolBar(XTP_IDR_MENUBAR)); } CXTPMenuBar* CXTPCommandBars::SetMenu(LPCTSTR strName, UINT nID) { CXTPMenuBar* pMenuBar = (CXTPMenuBar*) m_pMenuBarClass->CreateObject(); ASSERT(pMenuBar); if (!pMenuBar) return NULL; pMenuBar->m_pCommandBars = this; pMenuBar->SetTitle(strName); pMenuBar->m_nBarID = XTP_IDR_MENUBAR; if (!pMenuBar->SetPosition(xtpBarTop) || !pMenuBar->LoadMenuBar(nID)) { delete pMenuBar; return NULL; } if (nID > 0) { pMenuBar->m_pControls->CreateOriginalControls(); m_nDefaultMenuID = nID; } m_arrBars.Add(pMenuBar); return pMenuBar; } void CXTPCommandBars::RecalcFrameLayout(BOOL bDelay) { if (m_bRecalcLayout) return; if (!m_pFrame->GetSafeHwnd()) return; CFrameWnd* pFrame = m_pFrame->IsFrameWnd() ? (CFrameWnd*)m_pFrame : NULL; if (pFrame) { if (bDelay) pFrame->DelayRecalcLayout(FALSE); else pFrame->RecalcLayout(FALSE); } else { CXTPClientRect rc(m_pFrame); m_pFrame->SendMessage(WM_SIZE, 0, MAKELPARAM(rc.Width(), rc.Height())); } } void CXTPCommandBars::IdleRecalcLayout() { CFrameWnd* pFrame = DYNAMIC_DOWNCAST(CFrameWnd, GetSite()); if (pFrame) { if (pFrame->m_nIdleFlags & CFrameWnd::idleLayout) { pFrame->RecalcLayout(FALSE); pFrame->m_nIdleFlags &= ~CFrameWnd::idleLayout; } } } void CXTPCommandBars::OnToolBarAdded(CXTPToolBar* pToolBar) { ASSERT(pToolBar); CXTPReBar* pReBar = GetFrameReBar(); if (pReBar) { pReBar->AddToolBar(pToolBar, RBBS_GRIPPERALWAYS | RBBS_BREAK); } } void CXTPCommandBars::OnToolBarRemoved(CXTPToolBar* pToolBar) { ASSERT(pToolBar); CXTPReBar* pReBar = GetFrameReBar(); if (pReBar) { pReBar->DeleteToolBar(pToolBar); } } CXTPReBar* CXTPCommandBars::GetFrameReBar() const { if (!m_pFrame->GetSafeHwnd()) return NULL; return DYNAMIC_DOWNCAST(CXTPReBar, m_pFrame->GetDlgItem(AFX_IDW_REBAR)); } CXTPToolBar* CXTPCommandBars::AddCustomBar(LPCTSTR lpcstrCaption, UINT nID, BOOL bTearOffBar) { ASSERT(nID != 0); CXTPToolBar* pCommandBar = (CXTPToolBar*) m_pToolBarClass->CreateObject(); pCommandBar->m_pCommandBars = this; XTP_COMMANDBARS_CREATEBAR cs; ZeroMemory(&cs, sizeof(cs)); cs.bCustomBar = TRUE; cs.bTearOffBar = bTearOffBar; cs.lpcstrCaption = lpcstrCaption; cs.pCommandBar = pCommandBar; cs.nID = nID; m_pFrame->SendMessage(WM_XTP_CREATECOMMANDBAR, 0, (LPARAM)&cs); ASSERT(pCommandBar == cs.pCommandBar); ASSERT(pCommandBar); pCommandBar->m_strTitle = lpcstrCaption; if (!pCommandBar->SetPosition(bTearOffBar ? xtpBarFloating : xtpBarTop)) { delete pCommandBar; return NULL; } m_arrBars.Add(pCommandBar); pCommandBar->SetBarID(nID); pCommandBar->m_bBuiltIn = FALSE; pCommandBar->m_bTearOff = bTearOffBar; if (!bTearOffBar) RecalcFrameLayout(); OnToolBarAdded(pCommandBar); return pCommandBar; } CXTPShortcutManager* CXTPCommandBars::GetShortcutManager() const { return m_pShortcutManager; } void CXTPCommandBars::SetShortcutManager(CXTPShortcutManager* pShortcutManager) { CMDTARGET_RELEASE(m_pShortcutManager); m_pShortcutManager = pShortcutManager; } CXTPToolBar* CXTPCommandBars::Add(LPCTSTR strName, XTPBarPosition nBarPosition, CRuntimeClass* pToolbarClass) { if (!pToolbarClass) pToolbarClass = m_pToolBarClass; ASSERT(pToolbarClass && pToolbarClass->IsDerivedFrom(RUNTIME_CLASS(CXTPToolBar))); if (!pToolbarClass) return NULL; CXTPToolBar* pCommandBar = (CXTPToolBar*) pToolbarClass->CreateObject(); ASSERT(pCommandBar); if (!pCommandBar) return NULL; return Add(pCommandBar, strName, nBarPosition); } CXTPToolBar* CXTPCommandBars::Add(CXTPToolBar* pCommandBar, LPCTSTR strName, XTPBarPosition nBarPosition) { ASSERT(pCommandBar); if (!pCommandBar) return NULL; ASSERT(IsDockingPosition(nBarPosition) || nBarPosition == xtpBarFloating); pCommandBar->m_pCommandBars = this; pCommandBar->m_strTitle = strName; if (!pCommandBar->SetPosition(nBarPosition)) { delete pCommandBar; return NULL; } m_arrBars.Add(pCommandBar); return pCommandBar; } void CXTPCommandBars::EnableDocking() { const DWORD dwDockBarMap[4][2] = { { AFX_IDW_DOCKBAR_TOP, CBRS_TOP }, { AFX_IDW_DOCKBAR_BOTTOM, CBRS_BOTTOM }, { AFX_IDW_DOCKBAR_LEFT, CBRS_LEFT }, { AFX_IDW_DOCKBAR_RIGHT, CBRS_RIGHT }, }; CWnd* pParentFrame = GetSite(); ASSERT(pParentFrame); for (int i = 0; i < 4; i++) { ASSERT(!m_pDocks[i]); CXTPDockBar* pDockBar = (CXTPDockBar*)m_pDockBarClass->CreateObject(); pDockBar->m_pCommandBars = this; if (!pDockBar->Create(pParentFrame, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CHILD | WS_VISIBLE | dwDockBarMap[i][1], dwDockBarMap[i][0])) { AfxThrowResourceException(); } m_pDocks[i] = pDockBar; } } CXTPDockBar* CXTPCommandBars::CanDock(CPoint pt, CXTPDockBar* pMainDock) const { CRect rc; if (pMainDock) { pMainDock->GetWindowRect(&rc); if (pMainDock->m_dwStyle & CBRS_ORIENT_HORZ && rc.top - 20 < pt.y && rc.bottom + 20 > pt.y && rc.left - 20 < pt.x && rc.right + 20 > pt.x) return pMainDock; if (pMainDock->m_dwStyle & CBRS_ORIENT_VERT && rc.left - 20 < pt.x && rc.right + 20 > pt.x && rc.top - 20 < pt.y && rc.bottom + 20 > pt.y) return pMainDock; } for (int i = 0; i < 4; i++) { m_pDocks[i]->GetWindowRect(&rc); if (m_pDocks[i]->m_dwStyle & CBRS_ORIENT_HORZ && rc.top - 20 < pt.y && rc.bottom + 20 > pt.y && rc.left - 20 < pt.x && rc.right + 20 > pt.x) return m_pDocks[i]; if (m_pDocks[i]->m_dwStyle & CBRS_ORIENT_VERT && rc.left - 20 < pt.x && rc.right + 20 > pt.x && rc.top - 20 < pt.y && rc.bottom + 20 > pt.y) return m_pDocks[i]; } return NULL; } BOOL CXTPCommandBars::DockCommandBar(CXTPToolBar* pBar, LPRECT lpRect, CXTPDockBar* pDockBar) { ASSERT(pDockBar); if (!pDockBar) return FALSE; if (!pBar->Create(m_pFrame, FALSE)) return FALSE; pDockBar->DockCommandBar(pBar, lpRect); pBar->m_barPosition = pDockBar->GetPosition(); return TRUE; } BOOL CXTPCommandBars::DockCommandBar(CXTPToolBar* pBar, XTPBarPosition xtpPosition) { CXTPDockBar* pDockBar = GetDockBar(xtpPosition); ASSERT(pDockBar); return DockCommandBar(pBar, NULL, pDockBar); } BOOL CXTPCommandBars::FloatCommandBar(CXTPToolBar* pBar) { if (!pBar->Create(m_pFrame, TRUE)) { return FALSE; } if (pBar->m_pDockBar != NULL) { pBar->m_pDockBar->RemoveCommandBar(pBar); pBar->m_pDockBar = NULL; } pBar->m_barPosition = xtpBarFloating; return TRUE; } void CXTPCommandBars::DelayRedrawCommandBars() { for (int i = 0; i < GetCount(); i++) { CXTPToolBar* pBar = GetAt(i); if (pBar->IsVisible() && pBar->GetSafeHwnd()) { pBar->DelayRedraw(); } } } void CXTPCommandBars::InvalidateCommandBars() { for (int i = 0; i < GetCount(); i++) { CXTPToolBar* pBar = GetAt(i); if (pBar->IsVisible() && pBar->GetSafeHwnd()) { pBar->Redraw(); } } } void CXTPCommandBars::RedrawCommandBars() { m_bRecalcLayout = TRUE; for (int i = 0; i < GetCount(); i++) { CXTPToolBar* pBar = GetAt(i); for (int j = 0; j < pBar->GetControlCount(); j++) { pBar->GetControl(j)->OnThemeChanged(); } if (pBar->IsVisible()) { pBar->OnRecalcLayout(); } } CWnd* pSite = GetSite(); CMDIFrameWnd* pMDIFrame = DYNAMIC_DOWNCAST(CMDIFrameWnd, pSite); if (pMDIFrame) { CXTPTabClientWnd* pClient = DYNAMIC_DOWNCAST(CXTPTabClientWnd, CWnd::FromHandle(pMDIFrame->m_hWndMDIClient)); if (pClient) pClient->Refresh(); } for (HWND hWndChild = ::GetTopWindow(pSite->m_hWnd); hWndChild != NULL; hWndChild = GetWindow(hWndChild, GW_HWNDNEXT)) { CWnd* pWnd = CWnd::FromHandlePermanent(hWndChild); if (pWnd != NULL) pWnd->Invalidate(FALSE); } m_bRecalcLayout = FALSE; RecalcFrameLayout(); pSite->SetWindowPos(0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED); pSite->SendMessage(WM_NCPAINT); } BOOL CXTPCommandBar::IsKeyboardCuesVisible() const { CXTPCommandBars* pCommandBars = GetCommandBars(); if (!pCommandBars) return TRUE; return pCommandBars->m_bKeyboardCuesVisible; } CXTPCommandBarKeyboardTip::CXTPCommandBarKeyboardTip(CXTPCommandBars* pCommandBars, CCmdTarget* pOwner, LPCTSTR lpszCaption, CPoint pt, DWORD dwAlign, BOOL bEnabled) { m_pOwner = pOwner; m_strCaption = lpszCaption; m_pCommandBars = pCommandBars; m_pt = pt; m_strTip.Empty(); m_bEnabled = bEnabled; m_dwAlign = dwAlign; m_bVisible = TRUE; m_bExplicit = FALSE; } BEGIN_MESSAGE_MAP(CXTPCommandBarKeyboardTip, CWnd) ON_WM_PAINT() ON_WM_NCHITTEST_EX() END_MESSAGE_MAP() LRESULT CXTPCommandBarKeyboardTip::OnNcHitTest(CPoint /*point*/) { return (LRESULT)HTTRANSPARENT; } void CXTPCommandBarKeyboardTip::OnPaint() { CPaintDC dc(this); m_pCommandBars->GetPaintManager()->DrawKeyboardTip(&dc, this, FALSE); } BOOL CXTPCommandBar::IsKeyboardTipsVisible() const { CXTPCommandBars* pCommandBars = GetCommandBars(); if (pCommandBars && pCommandBars->m_keyboardTips.pBar == this && pCommandBars->m_keyboardTips.nLevel > 0) return pCommandBars->m_keyboardTips.nLevel; return FALSE; } void CXTPCommandBar::CreateKeyboardTips() { CXTPCommandBars* pCommandBars = GetCommandBars(); if (!pCommandBars) return; for (int i = 0; i < GetControlCount(); i++) { CXTPControl* pControl = GetControl(i); if (!pControl->IsVisible() || pControl->GetCaption().IsEmpty() || (pControl->GetFlags() & xtpFlagSkipFocus)) continue; if (pControl->GetType() == xtpControlGallery) continue; CPoint pt(pControl->GetRect().left + 12, pControl->GetRect().bottom - 11); CXTPCommandBarKeyboardTip* pWnd = new CXTPCommandBarKeyboardTip(pCommandBars, pControl, pControl->GetCaption(), pt, DT_TOP, pControl->GetEnabled()); if (!pControl->GetKeyboardTip().IsEmpty()) { pWnd->m_strTip = pControl->GetKeyboardTip(); } pCommandBars->m_keyboardTips.arr.Add(pWnd); } if (GetParentCommandBar() == 0) { for (int j = 0; j < pCommandBars->GetCount(); j++) { CXTPToolBar* pToolBar = pCommandBars->GetAt(j); if (pToolBar == this || !IsToolBarVisible(pToolBar)) continue; CXTPWindowRect rc(pToolBar); CPoint pt(rc.left, rc.top); CXTPCommandBarKeyboardTip* pWnd = new CXTPCommandBarKeyboardTip(pCommandBars, pToolBar, pToolBar->GetTitle(), pt, DT_TOP | DT_LEFT, TRUE); pCommandBars->m_keyboardTips.arr.Add(pWnd); } } } #ifndef LWA_ALPHA #define LWA_ALPHA 0x00000002 #endif #ifndef WS_EX_LAYERED #define WS_EX_LAYERED 0x00080000 #endif typedef BOOL (WINAPI *PFNSETLAYEREDWINDOWATTRIBUTES) (HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags); void CXTPCommandBars::CreateKeyboardTips(CXTPCommandBar* pCommandBar) { pCommandBar->CreateKeyboardTips(); } void CXTPCommandBars::ShowKeyboardTips(CXTPCommandBar* pCommandBar, int nLevel) { HideKeyboardTips(); if (!m_pOptions->bShowKeyboardTips) return; if (!pCommandBar->GetSafeHwnd()) return; GetToolTipContext()->CancelToolTips(); pCommandBar->UpdateWindow(); m_keyboardTips.pBar = pCommandBar; m_keyboardTips.nLevel = nLevel; m_keyboardTips.nKey = 0; CreateKeyboardTips(pCommandBar); if (m_keyboardTips.arr.GetSize() == 0) { m_keyboardTips.pBar = NULL; return; } CXTPPaintManager* pPaintManager = GetPaintManager(); CClientDC dc(pCommandBar); CXTPFontDC font(&dc, &pPaintManager->m_fontToolTip); int i; for (i = (int)m_keyboardTips.arr.GetSize() - 1; i >= 0; i--) { CXTPCommandBarKeyboardTip* pWnd = m_keyboardTips.arr[i]; pWnd->m_bExplicit = !pWnd->m_strTip.IsEmpty(); if (pWnd->m_bExplicit) continue; CString& strCaption = pWnd->m_strCaption; if (strCaption.IsEmpty()) { pWnd->DestroyWindow(); delete pWnd; m_keyboardTips.arr.RemoveAt(i); continue; } strCaption.MakeUpper(); int nAmdIndex = CXTPShortcutManager::FindAccelPos(strCaption); if (pWnd->m_strPrefix.IsEmpty()) { pWnd->m_strTip = strCaption.GetAt(nAmdIndex + 1); // nAmdIndex can be -1. if (XTPSystemVersion()->GetMaxCharSize() > 1 && _istlead(pWnd->m_strTip[0])) pWnd->m_strTip += strCaption.GetAt(nAmdIndex + 2); } else pWnd->m_strTip = pWnd->m_strPrefix; } int nCount = (int)m_keyboardTips.arr.GetSize(); for (i = 0; i < nCount; i++) { CXTPCommandBarKeyboardTip* pWndBase = m_keyboardTips.arr[i]; CString strTip = pWndBase->m_strTip; CArray<CXTPCommandBarKeyboardTip*, CXTPCommandBarKeyboardTip*> arr; arr.Add(pWndBase); int j; CString strUsed = _T("& "); for ( j = i + 1; j < nCount; j++) { CXTPCommandBarKeyboardTip* pWnd = m_keyboardTips.arr[j]; if (pWnd->m_strTip[0] == strTip[0]) { arr.Add(pWnd); if (pWnd->m_strTip.GetLength() == 2) { strUsed += pWnd->m_strTip[1]; } } } if (arr.GetSize() < 2) continue; int k = 1; for (j = 0; j < (int)arr.GetSize(); j++) { CXTPCommandBarKeyboardTip* pWnd = arr[j]; if (pWnd->m_strTip.GetLength() > 1) continue; TCHAR chAccel = 0; CString& strCaption = pWnd->m_strCaption; int n; for (n = 0; n < strCaption.GetLength() - 1; n++) { if ((strCaption[n] == ' ') && (strUsed.Find(strCaption[n + 1]) == -1)) { chAccel = strCaption[n + 1]; strUsed += chAccel; break; } } if (chAccel == 0) { int nStart = strCaption[0] == _T('&') ? 1 : 0; if (strCaption[nStart] == pWnd->m_strTip[0]) nStart++; for (n = nStart; n < strCaption.GetLength(); n++) { if (strUsed.Find(strCaption[n]) == -1) { chAccel = pWnd->m_strCaption[n]; strUsed += chAccel; break; } } } if (chAccel == 0) { CString str; str.Format(_T("%i"), k); chAccel = str[0]; k++; } pWnd->m_strTip += chAccel; } } BOOL bLayoutRTL = IsLayoutRTL(); for (i = 0; i < nCount; i++) { CXTPCommandBarKeyboardTip* pWnd = m_keyboardTips.arr[i]; if (!pWnd->m_bVisible) continue; CSize sz = dc.GetTextExtent(pWnd->m_strTip); sz = CSize(max(sz.cx + 6, 16), max(sz.cy + 2, 15)); CPoint pt = pWnd->m_pt; if (DYNAMIC_DOWNCAST(CWnd, pWnd->m_pOwner) == 0) pCommandBar->ClientToScreen(&pt); CRect rc(CPoint(pt.x - (pWnd->m_dwAlign & DT_CENTER ? sz.cx / 2 : bLayoutRTL || (pWnd->m_dwAlign & DT_RIGHT) ? sz.cx : 0), pt.y - (pWnd->m_dwAlign & DT_VCENTER ? sz.cy / 2 : pWnd->m_dwAlign & DT_BOTTOM ? sz.cy : 0)), sz); BOOL bLayered = pPaintManager->m_pfnSetLayeredWindowAttributes && !pWnd->m_bEnabled; pWnd->CreateEx((bLayered ? WS_EX_LAYERED : 0) | WS_EX_TOOLWINDOW, AfxRegisterWndClass(CS_SAVEBITS), 0, WS_POPUP, rc, pCommandBar, 0); pWnd->SetWindowPos(&CWnd::wndTop, rc.left, rc.top, rc.Width(), rc.Height(), SWP_NOACTIVATE | SWP_NOOWNERZORDER); pPaintManager->DrawKeyboardTip(0, pWnd, TRUE); if (bLayered) { ((PFNSETLAYEREDWINDOWATTRIBUTES)pPaintManager->m_pfnSetLayeredWindowAttributes)(pWnd->m_hWnd, 0x00, 150, LWA_ALPHA); } } for (i = 0; i < nCount; i++) { CXTPCommandBarKeyboardTip* pWnd = m_keyboardTips.arr[i]; if (pWnd->m_bVisible) pWnd->SetWindowPos(0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER); } } void CXTPCommandBars::HideKeyboardTips() { if (m_keyboardTips.arr.GetSize() == 0) return; for (int i = 0; i < (int)m_keyboardTips.arr.GetSize(); i++) { m_keyboardTips.arr[i]->DestroyWindow(); delete m_keyboardTips.arr[i]; } m_keyboardTips.arr.RemoveAll(); m_keyboardTips.pBar = 0; m_keyboardTips.nLevel = 0; m_keyboardTips.nKey = 0; } void CXTPCommandBars::ShowKeyboardCues(BOOL bShow) { if (m_bCustomizeMode) bShow = TRUE; if (m_bUseKeyboardCues && m_bKeyboardCuesVisible != bShow) { m_bKeyboardCuesVisible = bShow; InvalidateCommandBars(); } } void CXTPCommandBars::OnTrackingModeChanged(CXTPCommandBar* pCommandBar, int bMode) { pCommandBar; CXTPMouseManager* pMouseManager = GetMouseManager(); if (bMode == FALSE && m_bUseKeyboardCues && !pMouseManager->IsTrackedLock(0)) { ShowKeyboardCues(FALSE); } if (m_keyboardTips.nLevel > 0 && m_pOptions->bShowKeyboardTips) { HideKeyboardTips(); if (pMouseManager->IsTrackedLock(0)) { CXTPCommandBar* pCommandBarTop = pMouseManager->GetTrackArray().GetAt(pMouseManager->GetTrackArray().GetSize() - 1); if (pCommandBarTop->m_bKeyboardSelect) { pCommandBarTop->PostMessage(WM_TIMER, XTP_TID_SHOWKEYBOARDTIPS); } } } GetToolTipContext()->CancelToolTips(); #ifdef _XTP_ACTIVEX pCommandBar->OleFireTrackingModeChanged(bMode); #endif } CXTPMouseManager* CXTPCommandBars::GetMouseManager() const { if (this == NULL) return XTPMouseManager(); if (m_pMouseManager != NULL) return m_pMouseManager; return m_pMouseManager = XTPMouseManager(); } CXTPKeyboardManager* CXTPCommandBars::GetKeyboardManager() const { if (this == NULL) return XTPKeyboardManager(); if (m_pKeyboardManager != NULL) return m_pKeyboardManager; return m_pKeyboardManager = XTPKeyboardManager(); } CXTPControl* CXTPCommandBars::_GetNextControl(CXTPControls*& pControls, int nIndex) const { int nNextIndex = pControls->GetNext(nIndex, +1); if (m_pOptions->keyboardCuesUse & xtpKeyboardCuesUseAll && nNextIndex <= nIndex) { CXTPToolBar* pToolBar = (CXTPToolBar*)pControls->GetParent(); CXTPToolBar* pStartBar = pToolBar; for (;;) { pToolBar = GetAt(GetNextVisible(FindIndex(pToolBar), +1)); ASSERT(pToolBar); pControls = pToolBar->GetControls(); nNextIndex = pControls->GetNext(-1, +1); if (nNextIndex != -1) break; if (pToolBar == pStartBar) return NULL; } } return pControls->GetAt(nNextIndex); } CXTPControl* CXTPCommandBars::FindAccel(CXTPCommandBar* pCommandBar, UINT chAccel, BOOL& bSelectOnly) const { ASSERT(pCommandBar->IsVisible()); CXTPControls* pControls = pCommandBar->GetControls(); CXTPControl* pControl = _GetNextControl(pControls, pCommandBar->m_nSelected); if (pControl == NULL) return NULL; bSelectOnly = FALSE; CXTPControl* pStart = pControl, *pAmpCondidate = NULL, *pCondidate = NULL; do { ASSERT(pControl); CString strCaption = pControl->IsCaptionVisible() ? pControl->GetCaption() : _T(""); if (!strCaption.IsEmpty() && pControl->GetEnabled() && pControl->GetRibbonGroup() == NULL) { int nAmpIndex = CXTPShortcutManager::FindAccelPos(strCaption); BOOL bFound = nAmpIndex > -1 && nAmpIndex < strCaption.GetLength() - 1; if (CXTPShortcutManager::CompareAccelKey(strCaption[bFound ? nAmpIndex + 1 : 0], chAccel) && (bFound || ((m_pOptions->keyboardCuesUse & xtpKeyboardCuesUseAmpersandOnly) == 0))) { if (bFound) { if (pAmpCondidate == NULL) pAmpCondidate = pControl; else { bSelectOnly = TRUE; return pAmpCondidate; } } else if (pControl->GetParent()->GetType() == xtpBarTypeMenuBar || pControl->GetParent()->IsTrackingMode()) { if (pCondidate == NULL) pCondidate = pControl; else { bSelectOnly = TRUE; } } } } pControl = _GetNextControl(pControls, pControl->GetIndex()); ASSERT(pControl != 0); if (pControl == NULL) break; } while (pControl != pStart); return pAmpCondidate ? pAmpCondidate : pCondidate; } void CXTPCommandBars::ClosePopups() const { CXTPMouseManager* pMouseManage = this == NULL ? XTPMouseManager() : GetMouseManager(); pMouseManage->SendTrackLost(); } BOOL CXTPCommandBars::OnFrameAccel(UINT chAccel) { if (m_pOptions->keyboardCuesUse == xtpKeyboardCuesUseNone) return FALSE; if ((chAccel >= VK_NUMPAD0 && chAccel <= VK_NUMPAD9) && !m_pOptions->bUseAltNumPadKeys) return FALSE; if (MapVirtualKey(chAccel, 2) == 0) return FALSE; CXTPToolBar* pMenuBar = GetMenuBar(); CXTPToolBar* pCommandBar = IsToolBarVisible(pMenuBar) ? pMenuBar : NULL; for (int i = 0; i < GetCount(); i++) { CXTPToolBar* pToolBar = GetAt(i); if (pToolBar->IsTrackingMode()) { pCommandBar = pToolBar; break; } if (m_pOptions->keyboardCuesUse & xtpKeyboardCuesUseAll && pCommandBar == NULL && IsToolBarVisible(pToolBar)) pCommandBar = pToolBar; } if (!pCommandBar) return FALSE; if (IsToolBarVisible(pCommandBar)) { if (pCommandBar->PreviewAccel(chAccel)) { return TRUE; } BOOL bSelectOnly; CXTPControl* pControl = FindAccel(pCommandBar, chAccel, bSelectOnly); if (pControl) { int nIndex = pControl->GetIndex(); pCommandBar = (CXTPToolBar*)pControl->GetParent(); if (!pCommandBar->IsTrackingMode()) ClosePopups(); ShowKeyboardCues(TRUE); m_keyboardTips.nLevel = 1; pCommandBar->SetTrackingMode(TRUE, FALSE, TRUE); pCommandBar->SetSelected(nIndex, TRUE); if (!bSelectOnly) { pControl->OnUnderlineActivate(); } return TRUE; } } return FALSE; } BOOL CXTPCommandBars::PreTranslateFrameMessage(MSG* pMsg) { if ((pMsg->message == WM_SYSKEYDOWN) && (HIWORD(pMsg->lParam) & KF_ALTDOWN) && !GetMouseManager()->IsMouseLocked() && !GetMouseManager()->IsTrackedLock(0) && GetMouseManager()->IsTopParentActive(m_pFrame->GetSafeHwnd())) { if (pMsg->wParam == VK_MENU) { ShowKeyboardCues(TRUE); return FALSE; } if ((!m_bIgnoreShiftMenuKey || !(::GetKeyState(VK_SHIFT) & 0x8000))) { UINT chAccel = (UINT)pMsg->wParam; if (chAccel) { if (OnFrameAccel(chAccel)) return TRUE; } } } if ((pMsg->message == WM_SYSKEYUP || pMsg->message == WM_KEYUP) && m_bUseKeyboardCues && m_bKeyboardCuesVisible && !GetMouseManager()->IsTrackedLock(0)) { ShowKeyboardCues(FALSE); } if ((pMsg->message == WM_CONTEXTMENU || pMsg->message == WM_SYSKEYUP) && GetMouseManager()->IsTrackedLock(0)) { XTPKeyboardManager()->ProcessKeyboardHooks(WM_CONTEXTMENU, pMsg->wParam, pMsg->lParam); return TRUE; } if (pMsg->message == WM_MOUSEWHEEL) { if (XTPKeyboardManager()->IsKeyboardHooked()) { return XTPKeyboardManager()->ProcessKeyboardHooks(WM_MOUSEWHEEL, pMsg->wParam, pMsg->lParam); } else { CXTPMenuBar* pMenuBar = GetMenuBar(); if (pMenuBar && pMenuBar->GetType() == xtpBarTypeRibbon && pMenuBar->OnFrameMouseWheel((short)HIWORD(pMsg->wParam) <= 0)) { return TRUE; } } } #ifndef _XTP_ACTIVEX if (pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) { if (GetShortcutManager()->TranslateAccelerator(pMsg)) return TRUE; } #endif return FALSE; } void CXTPCommandBars::UpdateCommandBars() const { for (int i = 0; i < GetCount(); i++) { CXTPCommandBar* pBar = GetAt(i); pBar->OnIdleUpdateCmdUI(TRUE, TRUE); } } // the function is based on the original idea provided by Alex Fedotov // at http://forums.codeguru.com/showthread.php?p=375934 BOOL IsWorkstationLocked() { const TCHAR szDefaultDesktopName[] = _T("Default"); BOOL bLocked = FALSE; HDESK hDesktop = ::OpenInputDesktop(0, FALSE, GENERIC_READ); if (hDesktop) { TCHAR szName[128]; ZeroMemory(szName, sizeof(szName)); DWORD dwLen = 0; if (::GetUserObjectInformation (hDesktop, UOI_NAME, szName, sizeof(szName), &dwLen)) { bLocked = (_tcsicmp(szName, szDefaultDesktopName) != 0); } else { if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { const UINT uCharsRequired = dwLen/sizeof(TCHAR) + 1; TCHAR *szNameDynamic = new TCHAR[uCharsRequired]; ZeroMemory(szNameDynamic, uCharsRequired * sizeof(TCHAR)); if (::GetUserObjectInformation (hDesktop, UOI_NAME, szNameDynamic, uCharsRequired * sizeof(TCHAR), &dwLen)) { bLocked = (_tcsicmp(szNameDynamic, szDefaultDesktopName) != 0); } else { // unable to check } delete [] szNameDynamic; } } ::CloseDesktop (hDesktop); } else { bLocked = TRUE; } return bLocked; } BOOL CXTPCommandBars::OnFrameWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult) { if (message == WM_IDLEUPDATECMDUI) { for (int i = 0; i < GetCount(); i++) { CXTPCommandBar* pBar = GetAt(i); if (pBar->GetPosition() == xtpBarFloating) { pBar->OnIdleUpdateCmdUI(TRUE, TRUE); } } } if (message == WM_SYSCOLORCHANGE) { XTPColorManager()->RefreshColors(); GetPaintManager()->RefreshMetrics(); GetImageManager()->RefreshAll(); RedrawCommandBars(); } if (message == WM_SETTINGCHANGE) { GetPaintManager()->RefreshMetrics(); // Problem: when the workstation is locked a WM_SETTINGCHANGE message is sent by the operating system. // RedrawCommandBars is called which causes a full recalculation of the layout. // When the window is redrawn GetClientRect() always returns 0,0,0,0 when the workstation is locked. // Solution: IsWorkstationLocked function // Works on Windows XP SP3 x86 & Vista x86 // Seems like Windows 7 is not sending WM_SETTINGCHANGE on workstation lock if (!IsWorkstationLocked()) RedrawCommandBars(); } if (message == WM_CLOSE) { if (m_pDropSource->m_pSheet != NULL) { return TRUE; } } if (message == WM_COMMAND) { CWnd* pWnd = CWnd::GetFocus(); if (pWnd && pWnd->IsKindOf(RUNTIME_CLASS(CXTPCommandBarEditCtrl)) && ((CXTPCommandBarEditCtrl*)pWnd)->OnCommand(wParam, lParam)) { if (pResult != NULL) *pResult = 1; return TRUE; } if (LOWORD(wParam) == ID_HELP && GetHelpTrackingId() > 0) { AFX_CMDHANDLERINFO info; info.pTarget = NULL; if (GetSite()->OnCmdMsg(ID_HELP, CN_COMMAND, NULL, &info)) { GetSite()->SendMessage(WM_COMMANDHELP, 0, HID_BASE_COMMAND + GetHelpTrackingId()); return TRUE; } } } if (message == WM_CANCELMODE) { ClosePopups(); } if (message == WM_ACTIVATEAPP) { if (!wParam) ClosePopups(); } if (message == WM_SYSCOMMAND) { if ((wParam == 0 || LOWORD(wParam) != 0) && wParam != SC_KEYMENU && !IsCustomizeMode()) ClosePopups(); } return FALSE; } void CXTPCommandBars::SetLayoutRTL(CWnd* pWnd, BOOL bRTLLayout) { DWORD dwRTLStyle = WS_EX_LAYOUTRTL; if (pWnd->IsKindOf(RUNTIME_CLASS(CXTPCommandBarEditCtrl))) { pWnd->ModifyStyleEx(0, dwRTLStyle); return; } pWnd->ModifyStyleEx(bRTLLayout ? 0 : dwRTLStyle, !bRTLLayout ? 0 : dwRTLStyle); // walk through HWNDs to avoid creating temporary CWnd objects // unless we need to call this function recursively for (CWnd* pChild = pWnd->GetWindow(GW_CHILD); pChild != NULL; pChild = pChild->GetWindow(GW_HWNDNEXT)) { // send to child windows after parent SetLayoutRTL(pChild, bRTLLayout); } } void CXTPCommandBars::SetLayoutRTL(BOOL bRightToLeft) { if (!XTPSystemVersion()->IsLayoutRTLSupported()) return; if (m_bRightToLeft == bRightToLeft) return; m_bRightToLeft = bRightToLeft; int i; for (i = 0; i < 4; i++) { if (m_pDocks[i]) { SetLayoutRTL(m_pDocks[i], m_bRightToLeft); } } for (i = 0; i < GetCount(); i++) { CXTPToolBar* pToolBar = GetAt(i); if (pToolBar->GetPosition() == xtpBarFloating) { SetLayoutRTL(pToolBar, m_bRightToLeft); } } CWnd* pStatusBar = GetSite()->GetDlgItem(AFX_IDW_STATUS_BAR); if (pStatusBar) { SetLayoutRTL(pStatusBar, m_bRightToLeft); } GetImageManager()->DrawReverted(2); RedrawCommandBars(); } BOOL CXTPCommandBars::IsLayoutRTL() const { if (GetSite()->GetExStyle() & WS_EX_LAYOUTRTL) return TRUE; return m_bRightToLeft; } CXTPControl* CXTPCommandBars::FindControl(XTPControlType type, UINT nId, BOOL bVisible, BOOL bRecursive) const { for (int i = GetCount() - 1; i >= 0; i--) { CXTPToolBar* pBar = GetAt(i); if (!bVisible || pBar->IsVisible()) { CXTPControl* pControl = pBar->GetControls()->FindControl(type, nId, bVisible, bRecursive); if (pControl != NULL) return pControl; } } return NULL; } void CXTPPopupBar::PumpMessage() { CXTPMouseManager* pMouseManager = XTPMouseManager(); CWinThread* pThread = XTPGetThread(); while (IsTrackingMode()) { MSG msg; if (::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) { if (pMouseManager->PreviewTackLost(this, &msg)) { SetTrackingMode(FALSE); break; } if (!::GetMessage(&msg, NULL, 0, 0)) break; if (!IsTrackingMode()) { ::PostMessage(msg.hwnd, msg.message, msg.wParam, msg.lParam); break; } if (msg.message != WM_KICKIDLE && !pThread->PreTranslateMessage(&msg)) { // process this message ::TranslateMessage(&msg); ::DispatchMessage(&msg); } } else { WaitMessage(); } } } BOOL CXTPCommandBars::TrackPopupMenu(UINT nBarID, UINT nFlags, int x, int y, LPCRECT rcExclude) { CXTPPopupBar* pPopup = (CXTPPopupBar*)m_pContextMenus->FindCommandBar(nBarID); if (!pPopup) return FALSE; return TrackPopupMenu(pPopup, nFlags, x, y, GetSite(), rcExclude); } BOOL CXTPCommandBars::TrackPopupMenu(CXTPPopupBar* pPopup, UINT nFlags, int x, int y, CWnd* pWnd, LPCRECT rcExclude, CWnd* pWndOwner) { ASSERT(pPopup); if (!pPopup) { return FALSE; } const MSG& msg = AfxGetThreadState()->m_lastSentMsg; if (msg.message == WM_CONTEXTMENU && msg.lParam == MAKELPARAM(-1, -1) && pPopup->GetCommandBars()) pPopup->GetCommandBars()->ShowKeyboardCues(TRUE); if (!pWnd) pWnd = pPopup->GetSite(); pPopup->m_pSite = pWnd ; pPopup->m_pOwner = pWndOwner; if (pWnd && pWnd->GetExStyle() & (WS_EX_LAYOUTRTL | WS_EX_RIGHT)) nFlags |= TPM_RIGHTALIGN; UINT nReturn = TRUE; pPopup->m_pReturnCmd = NULL; if (nFlags & TPM_RETURNCMD) { pPopup->m_pReturnCmd = &nReturn; nReturn = 0; } pPopup->m_bExecOnRButton = nFlags & TPM_RIGHTBUTTON; pPopup->m_bIgnoreUpdateHandler = nFlags & TPM_NONOTIFY; pPopup->m_popupFlags = 0; if (nFlags & TPM_RIGHTALIGN) pPopup->m_popupFlags |= xtpPopupLeft; if (nFlags & TPM_BOTTOMALIGN) pPopup->m_popupFlags |= xtpPopupUp; else pPopup->m_popupFlags |= xtpPopupDown; BOOL bRecurse = nFlags & TPM_RECURSE; pPopup->m_bRecursePopup = bRecurse; CXTPMouseManager* pMouseManager = XTPMouseManager(); if (!bRecurse) { pMouseManager->SendTrackLost(); ReleaseCapture(); } else { pMouseManager->SendTrackLostRecurse(); pMouseManager->LockTrackRecurse(TRUE); } pMouseManager->IgnoreLButtonUp(); if (!pPopup->Popup(x, y, rcExclude)) { return FALSE; } pPopup->PumpMessage(); if (bRecurse) { pMouseManager->LockTrackRecurse(FALSE); } return nReturn; } BOOL CXTPCommandBars::TrackPopupMenuEx(CMenu* pMenu, UINT nFlags, int x, int y, CWnd* pWndOwner, LPTPMPARAMS lptpm) { CXTPPopupBar* pPopup = CXTPPopupBar::CreatePopupBar(this); pPopup->m_pSite = GetSite(); pPopup->m_pCommandBars = this; CRect rcExclude; rcExclude.SetRectEmpty(); if (lptpm) rcExclude = lptpm->rcExclude; if (!pPopup->LoadMenu(pMenu)) { pPopup->InternalRelease(); return FALSE; } BOOL bResult = TrackPopupMenu(pPopup, nFlags, x, y, GetSite(), rcExclude, pWndOwner); pPopup->InternalRelease(); return bResult; } BOOL CXTPCommandBars::TrackPopupMenu(CMenu* pMenu, UINT nFlags, int x, int y, CWnd* pWnd, LPCRECT rcExclude, CWnd* pWndOwner, CXTPCommandBars* pCommandBars) { CXTPPopupBar* pPopup = CXTPPopupBar::CreatePopupBar(pCommandBars); pPopup->m_pSite = pWnd; pPopup->m_pOwner = pWndOwner; pPopup->m_pCommandBars = pCommandBars; if (!pPopup->LoadMenu(pMenu)) { pPopup->InternalRelease(); return FALSE; } if (pCommandBars) { const MSG& msg = AfxGetThreadState()->m_lastSentMsg; if (msg.message == WM_CONTEXTMENU && msg.lParam == MAKELPARAM(-1, -1)) pCommandBars->ShowKeyboardCues(TRUE); } BOOL bResult = TrackPopupMenu(pPopup, nFlags, x, y, pWnd, rcExclude, pWndOwner); pPopup->InternalRelease(); return bResult; } CXTPPopupBar* CXTPCommandBars::GetToolbarsPopup() { CXTPPopupBar* pPopup = CXTPPopupBar::CreatePopupBar(this); CXTPControlToolbars::CreateToolbarMenu(pPopup, 0, ID_VIEW_TOOLBAR, TRUE); return pPopup; } void CXTPCommandBars::ContextMenu(CXTPToolBar* pToolBar, CPoint point) { if (IsCustomizeMode()) return; CXTPPopupBar* pPopup = GetToolbarsPopup(); GetSite()->SendMessage(WM_XTP_TOOLBARCONTEXTMENU, (WPARAM)pToolBar, (LPARAM)pPopup); if (pPopup && pPopup->GetControlCount() > 0) { pPopup->m_popupFlags = IsLayoutRTL() ? xtpPopupLeft : xtpPopupRight; ClosePopups(); pPopup->Popup(point.x, point.y, NULL); pPopup->PumpMessage(); } CMDTARGET_RELEASE(pPopup); } CXTPToolBar* CXTPCommandBars::GetAt(int nIndex) const { if (nIndex >= 0 && nIndex < GetCount()) return m_arrBars.GetAt(nIndex); return 0; } void CXTPCommandBars::ToggleVisible(int nIndex) { ASSERT(nIndex >= 0 && nIndex < GetCount()); CXTPToolBar* pBar = GetAt(nIndex); if (pBar) { pBar->SetVisible(!pBar->IsVisible()); } m_pOptions->bDirtyState = TRUE; } CXTPToolBar* CXTPCommandBars::GetToolBar(UINT nID) const { if (nID == 0) return NULL; for (int i = 0; i < GetCount(); i++) { CXTPToolBar* pBar = GetAt(i); ASSERT(pBar != NULL); if (pBar && (pBar->m_nBarID == nID)) return pBar; } return NULL; } void CXTPToolBar::_GetHiddenControls(CXTPCommandBar* pExpandBar) { for (int j = 0; j < GetControlCount(); j++) { CXTPControl* pControl = GetControl(j); if (pControl->GetHideFlags() == xtpHideWrap) { CXTPControl* pControlClone = pExpandBar->GetControls()->AddClone(pControl); pControlClone->SetHideFlags(0); pControlClone->SetBeginGroup(FALSE); } } } void CXTPCommandBars::GetHiddenControls(CXTPToolBar* pToolBar, CXTPCommandBar* pExpandBar) { if (pToolBar->m_pDockBar == 0) return; CXTPDockBar* pDock = pToolBar->m_pDockBar; int nPos = pDock->FindBar(pToolBar); if (nPos == -1) return; CXTPDockBar::CToolBarArray arrBars; pDock->GetVisibleToolbars(nPos, arrBars); for (int i = 0; i < arrBars.GetSize(); i++) { CXTPToolBar* pToolBarRow = arrBars[i]; pToolBarRow->_GetHiddenControls(pExpandBar); } } void CXTPCommandBars::_GetAddOrRemovePopup(CXTPToolBar* pToolBar, CXTPCommandBar* pExpandBar) { CXTPControlPopup* pButton = (CXTPControlPopup*)pExpandBar->GetControls()->Add(xtpControlPopup, 0); pButton->SetFlags(xtpFlagManualUpdate); pButton->SetCaption(CXTPControlWindowList::ConstructCaption(pToolBar->GetTitle(), 0)); BOOL bEnabled = m_bCustomizeAvail && pToolBar->m_bBuiltIn && pToolBar->m_bCustomizable; pButton->SetEnabled(bEnabled); if (bEnabled) { pToolBar->BuildCustomizePopup(pButton->GetCommandBar()); ASSERT_KINDOF(CXTPPopupBar, pButton->GetCommandBar()); ((CXTPPopupBar*)pButton->GetCommandBar())->SetDoubleGripper(); } } void CXTPCommandBars::GetAddOrRemovePopup(CXTPToolBar* pToolBar, CXTPCommandBar* pExpandBar) { if (pToolBar->m_pDockBar == 0) { _GetAddOrRemovePopup(pToolBar, pExpandBar); } else { CXTPDockBar* pDock = pToolBar->m_pDockBar; int nPos = pDock->FindBar(pToolBar); if (nPos == -1) { _GetAddOrRemovePopup(pToolBar, pExpandBar); } else { CXTPDockBar::CToolBarArray arrBars; pDock->GetVisibleToolbars(nPos, arrBars); for (int i = 0; i < arrBars.GetSize(); i++) { _GetAddOrRemovePopup(arrBars[i], pExpandBar); } } } if (m_bCustomizeAvail) { CXTPControl* pControlCustomize = pExpandBar->GetControls()->Add(xtpControlButton, XTP_ID_CUSTOMIZE); pControlCustomize->SetBeginGroup(TRUE); } } void CXTPCommandBars::SetQuickCustomizeMode(BOOL bMode) { m_pOptions->bDirtyState = TRUE; m_bCustomizeMode = m_bQuickCustomizeMode = bMode; SetDragControl(NULL); ShowKeyboardCues(m_bCustomizeMode); } void CXTPCommandBars::SetCustomizeMode(BOOL bMode) { m_pOptions->bDirtyState = TRUE; m_bCustomizeMode = bMode; SetDragControl(NULL); for (int i = 0; i < GetCount(); i++) { CXTPToolBar* pBar = GetAt(i); pBar->DelayRedraw(); pBar->OnIdleUpdateCmdUI(TRUE, TRUE); } RecalcFrameLayout(); ShowKeyboardCues(m_bCustomizeMode); } CCmdTarget* CXTPCommandBars::GetDragControl() const { return m_pDragSelected; } void CXTPCommandBars::SetDragControl(CCmdTarget* pControl) { if (m_pDragSelected != pControl) { CCmdTarget* pDragSelected = m_pDragSelected; m_pDragSelected = pControl; if (pDragSelected != NULL) { pDragSelected->OnCmdMsg(XTP_CN_REDRAWPARENT, CN_EVENT, NULL, NULL); pDragSelected->InternalRelease(); } if (m_pDragSelected) { m_pDragSelected->OnCmdMsg(XTP_CN_REDRAWPARENT, CN_EVENT, NULL, NULL); m_pDragSelected->InternalAddRef(); } CWnd* pWnd = m_pDropSource->m_pSheet ? (CWnd*)m_pDropSource->m_pSheet : m_pFrame; if (pWnd && pWnd->GetSafeHwnd()) { pWnd->SendMessage(WM_XTP_DRAGCONTROLCHANGED); } } } void CXTPCommandBars::RemoveAll() { m_bRecalcLayout = TRUE; for (int i = 0; i < GetCount(); i++) { CXTPToolBar* pToolBar = GetAt(i); if (pToolBar->GetSafeHwnd()) { pToolBar->ShowWindow(SW_HIDE); pToolBar->m_bVisible = FALSE; } if (pToolBar->m_pDockBar != NULL) { pToolBar->m_pDockBar->RemoveCommandBar(pToolBar); pToolBar->m_pDockBar = NULL; } OnToolBarRemoved(pToolBar); pToolBar->OnRemoved(); pToolBar->InternalRelease(); } m_arrBars.RemoveAll(); m_bRecalcLayout = FALSE; RecalcFrameLayout(TRUE); } void CXTPCommandBars::Remove(CXTPToolBar* pToolBar) { ASSERT(pToolBar); if (!pToolBar) return; int i = FindIndex(pToolBar); if (i == -1) return; if (pToolBar->GetSafeHwnd()) { pToolBar->ShowWindow(SW_HIDE); } pToolBar->m_bVisible = FALSE; if (pToolBar->m_pDockBar != NULL) { pToolBar->m_pDockBar->RemoveCommandBar(pToolBar); pToolBar->m_pDockBar = NULL; RecalcFrameLayout(); } OnToolBarRemoved(pToolBar); pToolBar->OnRemoved(); m_arrBars.RemoveAt(i); pToolBar->InternalRelease(); } void CXTPCommandBars::SetSite(CWnd* pFrame) { m_pFrame = pFrame; if (pFrame->GetSafeHwnd()) { AFX_CMDHANDLERINFO info; info.pTarget = NULL; m_bCustomizeAvail = pFrame->CWnd::OnCmdMsg(XTP_ID_CUSTOMIZE, CN_COMMAND, this, &info); } m_bRightToLeft = m_pFrame->GetExStyle() & WS_EX_LAYOUTRTL; } void CXTPCommandBars::HideCommands(const UINT* pCommands, int nCount) { ASSERT(pCommands); if (!pCommands) return; for (int i = 0; i < nCount; i++) HideCommand(pCommands[i]); } void CXTPCommandBars::HideCommand(UINT nCommand) { m_pOptions->m_mapHiddenCommands.SetAt(nCommand, TRUE); } BOOL CXTPCommandBars::IsControlHidden(CXTPControl* pControl) { BOOL bCommandHidden = IsCommandHidden(pControl->GetID()); if (m_pOptions->bAutoHideUnusedPopups && !bCommandHidden && IsPopupControlType(pControl->GetType())) { CXTPCommandBar* pCommandBar = pControl->GetCommandBar(); if (!pCommandBar) return FALSE; int nCount = pCommandBar->GetControlCount(); if (nCount == 0) return FALSE; for (int i = 0; i < nCount; i++) { if (!IsControlHidden(pCommandBar->GetControl(i))) return FALSE; } return TRUE; } return bCommandHidden; } BOOL CXTPCommandBars::IsCommandHidden(UINT nCommand) { BOOL bCommand; if (!m_pOptions->m_mapHiddenCommands.Lookup(nCommand, bCommand)) return FALSE; if (m_pOptions->m_mapUsedCommands.Lookup(nCommand, bCommand)) return FALSE; return TRUE; } void CXTPCommandBars::SetCommandUsed(UINT nCommand) { if (IsCommandHidden(nCommand)) { m_pOptions->m_mapUsedCommands.SetAt(nCommand, TRUE); m_pOptions->bDirtyState = TRUE; } } void CXTPCommandBars::ResetUsageData() { m_pOptions->m_mapUsedCommands.RemoveAll(); m_pOptions->bDirtyState = TRUE; } void CXTPCommandBars::SaveOptions(LPCTSTR lpszProfileName) { TCHAR szSection[256]; wsprintf(szSection, _xtpCommandBarOptionsSection, lpszProfileName); CXTPPropExchangeSection px(FALSE, szSection); px->EmptySection(); m_pOptions->DoPropExchange(&px, TRUE); } void CXTPCommandBars::LoadOptions(LPCTSTR lpszProfileName) { TCHAR szSection[256]; wsprintf(szSection, _xtpCommandBarOptionsSection, lpszProfileName); CXTPPropExchangeSection px(TRUE, szSection); m_pOptions->DoPropExchange(&px, TRUE); } void CXTPCommandBars::SetTheme(XTPPaintTheme paintTheme) { SetPaintManager(CXTPPaintManager::CreateTheme(paintTheme)); } void CXTPCommandBars::SetPaintManager(CXTPPaintManager *pPaintManager) { if (m_pPaintManager) m_pPaintManager->InternalRelease(); m_pPaintManager = pPaintManager; if (m_pPaintManager) { m_pPaintManager->RefreshMetrics(); } for (int i = 0; i < GetCount(); i++) { GetAt(i)->OnPaintManagerChanged(); } GetImageManager()->RefreshAll(); if (!pPaintManager->RequiresResourceImages() || XTPResourceImages()->IsValid()) { RedrawCommandBars(); } } void CXTPCommandBars::SetImageManager(CXTPImageManager* pImageManager) { ASSERT(m_pImageManager == NULL); m_pImageManager = pImageManager; GetImageManager()->RefreshAll(); } CXTPPaintManager* CXTPCommandBars::GetPaintManager() const { if (m_pPaintManager) return m_pPaintManager; return XTPPaintManager(); } CXTPImageManager* CXTPCommandBars::GetImageManager() const { if (m_pImageManager) return m_pImageManager; return XTPImageManager(); } void CXTPCommandBars::LoadDesignerBars(CArchive& ar) { CXTPPropExchangeArchive px(ar); LoadDesignerBars(&px); } void CXTPCommandBars::LoadDesignerBars(CXTPPropExchange* pPX) { try { RemoveAll(); ////////////////////////////////////////////////////////////////////////// // Load Docking Position and Controls XTP_COMMANDBARS_PROPEXCHANGE_PARAM param; param.bSerializeControls = TRUE; param.bSerializeDesignerControls = TRUE; param.bSerializeImages = TRUE; param.bSerializeOptions = TRUE; param.bSerializeActions = TRUE; DoPropExchange(pPX, &param); } catch (CMemoryException* pEx) { pEx->Delete (); } catch (CArchiveException* pEx) { pEx->Delete (); } } CDocTemplate* CXTPCommandBars::FindDocTemplate(CMDIChildWnd* pChild) { USES_PROTECTED_ACCESS(CXTPCommandBars, CMDIChildWnd, HMENU, m_hMenuShared) CMultiDocTemplate* pTemplate = DYNAMIC_DOWNCAST(CMultiDocTemplate, pChild->GetActiveDocument()->GetDocTemplate()); if (!pTemplate) return NULL; HMENU hMenuShared = PROTECTED_ACCESS(CMDIChildWnd, pChild, m_hMenuShared); if ((hMenuShared == 0) || (pTemplate->m_hMenuShared == hMenuShared)) return pTemplate; POSITION pos = AfxGetApp()->GetFirstDocTemplatePosition(); while (pos) { pTemplate = DYNAMIC_DOWNCAST(CMultiDocTemplate, AfxGetApp()->GetNextDocTemplate(pos)); if (pTemplate && pTemplate->m_hMenuShared == hMenuShared) return pTemplate; } return NULL; } UINT CXTPCommandBars::GetActiveDocTemplate() { #ifndef _XTP_ACTIVEX #pragma warning(disable:4510) #pragma warning(disable:4610) USES_PROTECTED_ACCESS(CXTPCommandBars, CDocTemplate, UINT, m_nIDResource) USES_PROTECTED_ACCESS(CXTPCommandBars, CFrameWnd, UINT, m_nIDHelp) CMDIFrameWnd* pFrame = DYNAMIC_DOWNCAST(CMDIFrameWnd, GetSite()); if (!pFrame) return 0; UINT nIDResource = (WORD)m_nDefaultMenuID; CMDIChildWnd* pChild = pFrame->MDIGetActive(); if (pChild) { if (pChild->GetActiveDocument()) { CDocTemplate* pDocTemplate = FindDocTemplate(pChild); if (!pDocTemplate) return 0; nIDResource = PROTECTED_ACCESS(CDocTemplate, pDocTemplate, m_nIDResource); } else { nIDResource = PROTECTED_ACCESS(CFrameWnd, pChild, m_nIDHelp); } } #else UINT nIDResource = 1; #endif return nIDResource; } void CXTPCommandBars::OnSetPreviewMode(BOOL bPreview) { if (m_bPreviewMode == bPreview) return; m_bPreviewMode = bPreview; GetShortcutManager()->DisableShortcuts(bPreview); int nCount = GetCount(); for (int i = 0; i < nCount; i++) { CXTPToolBar* pBar = GetAt(i); pBar->OnSetPreviewMode(bPreview); } } CXTPToolTipContext* CXTPCommandBars::GetToolTipContext() const { return m_pToolTipContext; } int CXTPCommandBars::FindIndex(CXTPToolBar* pToolBar) const { int nCount = GetCount(); for (int i = 0; i < nCount; i++) { CXTPToolBar* pBar = GetAt(i); if (pBar == pToolBar) return i; } return -1; } int CXTPCommandBars::GetNextVisible(long nIndex, int nDirection) const { ASSERT(nDirection == +1 || nDirection == -1); if (GetCount() == 0) return -1; long nNext = nIndex + nDirection; if (nDirection == -1 && nIndex == -1) { nNext = GetCount() - 1; } BOOL bCircle = FALSE; while (nNext != nIndex) { if (nNext >= GetCount()) { if ((nIndex == -1 && nDirection == +1) || bCircle) return -1; nNext = 0; bCircle = TRUE; } if (nNext < 0) { if ((nIndex == -1 && nDirection == -1) || bCircle) return -1; nNext = GetCount() - 1; bCircle = TRUE; } if (GetAt(nNext)->IsWindowVisible()) return nNext; nNext += nDirection; } return nNext; } BOOL CXTPCommandBars::SetToolBarFocus(CXTPToolBar* pCommandBar, BOOL bNext /*= FALSE*/) { if (!pCommandBar) return FALSE; if (bNext) { if (GetCount() < 2) return FALSE; int nIndex = FindIndex(pCommandBar); int nNextIndex = GetNextVisible(nIndex, bNext); if (nIndex == nNextIndex || nNextIndex == -1) return FALSE; pCommandBar = GetAt(nNextIndex); } ClosePopups(); ShowKeyboardCues(TRUE); m_keyboardTips.nLevel = 1; pCommandBar->SetTrackingMode(TRUE, FALSE, TRUE); pCommandBar->SetSelected(pCommandBar->GetControls()->GetNext(-1, +1, TRUE, pCommandBar->GetType() == xtpBarTypeMenuBar), TRUE_KEYBOARD_NEXT); return TRUE; } BOOL CXTPCommandBars::IsEnableFrameTheme() { if (m_pFrameHook) return TRUE; else return FALSE; } void CXTPCommandBars::EnableFrameTheme(BOOL bEnable) { CXTPCommandBarsFrameHook* pFrameHook = m_pFrameHook; if (!bEnable) { if (pFrameHook) { m_pFrameHook = NULL; if (!m_bBeingDestructed) { pFrameHook->DisableFrameTheme(); } SAFE_DELETE(pFrameHook); } } else { if (!pFrameHook) { m_pFrameHook = new CXTPCommandBarsFrameHook(); m_pFrameHook->EnableOffice2007Frame(this); } } RecalcFrameLayout(); } void CXTPCommandBars::EnableToolbarComposition(BOOL bEnable) { if (bEnable) EnableFrameTheme(TRUE); if (m_pFrameHook) { m_pFrameHook->m_bToolBarComposition = bEnable; m_pFrameHook->DelayRecalcFrameLayout(); } } BOOL CXTPCommandBars::IsDwmEnabled() const { if (m_pFrameHook && m_pFrameHook->m_bToolBarComposition && m_pFrameHook->IsDwmEnabled()) return TRUE; return FALSE; } #ifdef _XTP_ACTIVEX BEGIN_DISPATCH_MAP(CXTPCommandBarsContextMenus, CCmdTarget) DISP_FUNCTION_ID(CXTPCommandBarsContextMenus, "Count", 1, OleGetItemCount, VT_I4, VTS_NONE) DISP_FUNCTION_ID(CXTPCommandBarsContextMenus, "Item", DISPID_VALUE, OleItem, VT_DISPATCH, VTS_I4) DISP_FUNCTION_ID(CXTPCommandBarsContextMenus, "_NewEnum", DISPID_NEWENUM, OleNewEnum, VT_UNKNOWN, VTS_NONE) DISP_FUNCTION_ID(CXTPCommandBarsContextMenus, "Add", 2, OleAdd, VT_DISPATCH, VTS_I4 VTS_BSTR) DISP_FUNCTION_ID(CXTPCommandBarsContextMenus, "Find", 4, OleFind, VT_DISPATCH, VTS_I4) DISP_FUNCTION_ID(CXTPCommandBarsContextMenus, "DeleteAll", 5, RemoveAll, VT_EMPTY, VTS_NONE) DISP_FUNCTION_ID(CXTPCommandBarsContextMenus, "AddPopup", 6, OleAddPopup, VT_EMPTY, VTS_DISPATCH) END_DISPATCH_MAP() // {777CBB00-0690-4528-8656-E33E61F39377} static const IID IID_ICommandBarsContextMenus = { 0x777cbb00, 0x690, 0x4528, { 0x86, 0x56, 0xe3, 0x3e, 0x61, 0xf3, 0x93, 0x77 } }; IMPLEMENT_OLETYPELIB_EX(CXTPCommandBarsContextMenus, IID_ICommandBarsContextMenus) long CXTPCommandBarsContextMenus::OleGetItemCount() { return (long)GetCount(); } LPDISPATCH CXTPCommandBarsContextMenus::OleItem(long nIndex) { return OleGetItem(nIndex - 1); } LPDISPATCH CXTPCommandBarsContextMenus::OleGetItem(long nIndex) { if (nIndex >= 0 && nIndex < GetCount()) { CXTPCommandBar* pItem = GetAt(nIndex); return pItem->GetIDispatch(TRUE); } AfxThrowOleException(E_INVALIDARG); return 0; } LPDISPATCH CXTPCommandBarsContextMenus::OleFind(int nId) { return XTPGetDispatch(FindCommandBar(nId)); } LPDISPATCH CXTPCommandBarsContextMenus::OleAdd(int nId, LPCTSTR strCaption) { CXTPPopupBar* pPopupBar = CXTPPopupBar::CreatePopupBar(m_pCommandBars); Add(pPopupBar); pPopupBar->SetBarID(nId); pPopupBar->SetTitle(strCaption); return XTPGetDispatch(pPopupBar); } void CXTPCommandBarsContextMenus::OleAddPopup(LPDISPATCH lpDispatch) { CXTPCommandBar* pCommandBar = CXTPCommandBar::FromDispatch(lpDispatch); if (!pCommandBar) return; Add(pCommandBar); pCommandBar->InternalAddRef(); } IMPLEMENT_ENUM_VARIANT(CXTPCommandBarsContextMenus) #endif
[ "kwkang@3e9e098e-e079-49b3-9d2b-ee27db7392fb" ]
kwkang@3e9e098e-e079-49b3-9d2b-ee27db7392fb
43efbc66ecad085dfecd87a4a651f22c94341239
2bb9c2f4bf0ce6006efe049e706098f11e1061fc
/Metal/Client/Client/BossBody.cpp
5b92df81b4bf1f7a145434c8f86d64a7f6178ed5
[]
no_license
loveforyui/MyCode
4fe5467368aaff6b001d9d19d6916deebcefd23a
9c6e2b33073efc81c2ee3ef76bdd6f596f28767d
refs/heads/master
2021-01-16T21:41:53.473181
2017-11-06T01:02:16
2017-11-06T01:02:16
100,230,465
0
0
null
null
null
null
UHC
C++
false
false
7,934
cpp
#include "stdafx.h" #include "BossBody.h" #include "Monster.h" CBossBody::CBossBody() { } CBossBody::~CBossBody() { } void CBossBody:: Init () { char buf[256] = ""; sprintf_s(buf, "%s%s", IMG_PATH, "monster/stage01/body/"); IMG_LOAD(L"monster/stage01/body/", buf); dynamic_cast<CMonster*>(m_pObj)->InsertImage(L"monster/stage01/body/", IMG_GET_V(L"monster/stage01/body/")); m_mImage = &(m_pObj->GetImgv()); sprintf_s(buf, "%s%s", IMG_PATH, "sfx/explosion/"); IMG_LOAD(L"sfx/explosion/", buf); dynamic_cast<CMonster*>(m_pObj)->InsertImage(L"sfx/explosion/", IMG_GET_V(L"sfx/explosion/")); m_mImage = &(m_pObj->GetImgv()); sprintf_s(buf, "%s%s", IMG_PATH, "sfx/heos/"); IMG_LOAD(L"sfx/heos/", buf); dynamic_cast<CMonster*>(m_pObj)->InsertImage(L"sfx/heos/", IMG_GET_V(L"sfx/heos/")); m_mImage = &(m_pObj->GetImgv()); sprintf_s(buf, "%s%s", IMG_PATH, "monster/stage01/right_broken/"); IMG_LOAD(L"monster/stage01/right_broken/", buf); iter_begin = m_mImage->find(L"monster/stage01/body/")->second->begin(); iter_end = m_mImage->find(L"monster/stage01/body/")->second->end(); m_pObj->SetCurState(OBJ_A_STND); m_pObj->SetHp(15); INFO info; info.fX = m_pObj->GetInfo().fX; info.fY = m_pObj->GetInfo().fY; info.curState = OBJ_A_STND; info.m_eKind = eKMOB::MOB_K_BOSSLEFT; info.fSpeed = m_pObj->GetInfo().fSpeed; // tower m_left = CAbstractFactory<CMonster>::CreateObj(info); CObjManager::GetInst()->AddObj(m_left, OBJ_SUBMON); info.fX = m_pObj->GetInfo().fX; info.fY = m_pObj->GetInfo().fY; info.m_eKind = eKMOB::MOB_K_BOSSRIGHT; m_right = CAbstractFactory<CMonster>::CreateObj(info); CObjManager::GetInst()->AddObj(m_right, OBJ_SUBMON); info.fX = m_pObj->GetInfo().fX; info.fY = m_pObj->GetInfo().fY; info.m_eKind = eKMOB::MOB_K_BOSSTOP; m_top = CAbstractFactory<CMonster>::CreateObj(info); CObjManager::GetInst()->AddObj(m_top, OBJ_SUBMON); rotateX = FLOAT(m_pObj->GetInfo().fX - (*iter_begin)->image->GetWidth() / 2.f); rotateY = FLOAT(m_pObj->GetInfo().fY - (*iter_begin)->image->GetHeight() / 2.f); rotateW = FLOAT((*iter_begin)->image->GetWidth()); rotateH = FLOAT((*iter_begin)->image->GetHeight()); } void CBossBody:: Render (HDC hdc) { if (m_pObj->GetInfo().iHP <= 0) { IMG_DRAW_A(hdc , (*iter_begin)->image , rotateX , rotateY , rotateW , rotateH , rotate *= 1.2f ); } else { if (STATE_SAME(m_pObj->GetInfo().curState, OBJ_A_STND)) { IMG_DRAW_I(hdc , (*iter_begin)->image , FLOAT(m_pObj->GetInfo().fX - (*iter_begin)->image->GetWidth() / 2.f) , FLOAT(m_pObj->GetInfo().fY - (*iter_begin)->image->GetHeight() / 2.f) , FLOAT((*iter_begin)->image->GetWidth())//m_pObj->GetInfo().rect.right , FLOAT((*iter_begin)->image->GetHeight())//m_pObj->GetInfo().rect.bottom ); } } } void CBossBody:: Release () { } int CBossBody:: Update () { RECT rc = { LONG(m_pObj->GetInfo().fX - m_pObj->GetInfo().fCX/2)// m_pObj->GetInfo().fCX / 2 , LONG(m_pObj->GetInfo().fY - m_pObj->GetInfo().fCY/2) , LONG(m_pObj->GetInfo().fX + m_pObj->GetInfo().fCX/2) , LONG(m_pObj->GetInfo().fY + m_pObj->GetInfo().fCY/2) }; m_pObj->SetRect(rc); if (STATE_SAME(m_pObj->GetInfo().curState, OBJ_A_DIE)) { rotateW += rotateW * 0.1f; rotateH += rotateH * 0.1f; rotateX = m_pObj->GetInfo().fX - rotateW / 2; rotateY = m_pObj->GetInfo().fY - rotateH / 2; CSoundMgr::GetInstance()->StopSoundAll(); if(700.f <= rotateW) CSceneMgr::GetInstance()->SceneChange(CSceneMgr::ENDING); } else BothDeath(); switch (stance) { case CBossBody::WAIT: Wait(); break; case CBossBody::STAY: Stay(); break; case CBossBody::PATROL: Patrol(); break; } return 0; } void CBossBody:: Wait () { CObj* player = CObjManager::GetInst()->GetObjlst(OBJ_PLAYER).back(); float dist = _Distance<float>( player->GetInfo().fX , player->GetInfo().fY , m_pObj->GetInfo().fX , m_pObj->GetInfo().fY ); if (dist < 150.f) { stance = STAY; } } void CBossBody:: Patrol () { CObj* player = CObjManager::GetInst()->GetObjlst(OBJ_PLAYER).back(); float dist_l = abs(m_pObj->GetInfo().fX - 90.f); float dist_r = abs(m_pObj->GetInfo().fX + 90.f); POINT pt; pt.x = LONG(m_pObj->GetInfo().fX); pt.y = LONG(m_pObj->GetInfo().fY); if (dist_l <= player->GetInfo().fX && player->GetInfo().fX <= m_pObj->GetInfo().fX) { //왼쪽이 -> 오른쪽으로 pt = CPattern::GetInstance()->AngleLine(m_pObj, 0.f); } else if (m_pObj->GetInfo().fX <= player->GetInfo().fX && player->GetInfo().fX <= dist_r) { //오른쪽이 -> 왼쪽으로 pt = CPattern::GetInstance()->AngleLine(m_pObj, 180.f); } else if (dist_r < player->GetInfo().fX) { pt = CPattern::GetInstance()->AngleLine(m_pObj, 0.f); } else if (player->GetInfo().fX < dist_l) { pt = CPattern::GetInstance()->AngleLine(m_pObj, 180.f); } //화면 밖나갈때 처리 if (3820 <= (m_pObj->GetInfo().fX)) { pt = CPattern::GetInstance()->AngleLine(m_pObj, 180.f); } if ((m_pObj->GetInfo().fX) <= 3823 - 390) { pt = CPattern::GetInstance()->AngleLine(m_pObj, 0.f); } m_pObj->SetPos(FLOAT(pt.x), FLOAT(pt.y)); m_left->SetPos(FLOAT(pt.x), FLOAT(pt.y)); m_right->SetPos(FLOAT(pt.x), FLOAT(pt.y)); m_top->SetPos(FLOAT(pt.x), FLOAT(pt.y)); } void CBossBody:: Stay () { if (FLOAT(m_pObj->GetInfo().iMaxHp * 0.7f) < FLOAT(m_pObj->GetInfo().iHP) && FLOAT(m_pObj->GetInfo().iHP) <= FLOAT(m_pObj->GetInfo().iMaxHp * 1.0f)) { m_top->SetCurState(OBJ_A_MOVE); } if (FLOAT(m_pObj->GetInfo().iMaxHp * 0.3f) < FLOAT(m_pObj->GetInfo().iHP) && FLOAT(m_pObj->GetInfo().iHP) <= FLOAT(m_pObj->GetInfo().iMaxHp * 0.7f)) { iter_begin = m_mImage->find(L"monster/stage01/body/")->second->begin() + 1; stance = PATROL; m_top->SetCurState(OBJ_A_DIE); m_right->SetCurState(OBJ_A_ATTK); m_left->SetCurState(OBJ_A_ATTK); } if (FLOAT(m_pObj->GetInfo().iMaxHp * 0.0f) < FLOAT(m_pObj->GetInfo().iHP) && FLOAT(m_pObj->GetInfo().iHP) <= FLOAT(m_pObj->GetInfo().iMaxHp * 0.3f)) { iter_begin = m_mImage->find(L"monster/stage01/body/")->second->begin() + 2; } } void CBossBody:: BothDeath () { if (m_pObj->GetInfo().iHP <= 0) { iter_begin = m_mImage->find(L"monster/stage01/body/")->second->begin() + 4; if (rotateW <= 5.f) { iter_begin = m_mImage->find(L"sfx/heos/")->second->begin(); rotateW = (*iter_begin)->image->GetWidth() * 0.001f; rotateH = (*iter_begin)->image->GetHeight() * 0.001f; //rotateX = m_pObj->GetInfo().fX - rotateW / 2; //rotateY = m_pObj->GetInfo().fY - rotateH / 2; m_pObj->SetCurState(OBJ_A_DIE); } else { rotateW -= rotateW * 0.1f; rotateH -= rotateH * 0.1f; rotateX = m_pObj->GetInfo().fX - rotateW / 2; rotateY = m_pObj->GetInfo().fY - rotateH / 2; } if (nullptr != m_left) m_left->SetCurState(OBJ_A_DIE); if (nullptr != m_right) m_right->SetCurState(OBJ_A_DIE); if (nullptr != m_top) m_top->SetCurState(OBJ_A_DIE); } }
[ "horonomail@gmail.com" ]
horonomail@gmail.com
3dd78f755e90c632b6a141172e0519675f0142a0
dbd4be4155fa227e1268b091147c4437a2f215be
/C++/MFTI/LOSH/olymp/taskC.cpp
3c9edd04646d30e342fadd19646991b3d560880e
[]
no_license
pshpis/School_olymp
5bdf8e885050f80e68c8407940c7289d3d413592
723b6121cc1a0746d0911c5a79076d9589a75839
refs/heads/main
2023-03-24T08:34:47.600204
2021-03-17T08:20:39
2021-03-17T08:20:39
348,629,219
0
0
null
null
null
null
UTF-8
C++
false
false
996
cpp
#include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <set> #include <map> #define watch(x) cout << (#x) << " is " << (x) << endl #define pb(x) push_back(x) #define pow2(x) ((x)*(x)) #define max3(a, b, c) max(a, max(b, c)) #define min3(a, b, c) min(a, min(b, c)) #define fr(i, n) for (int (i)=0; i<int(n); i++) typedef long long lint; using namespace std; template<typename type> type next() {type x;cin>>x;return x;} int next() {int x;cin>>x;return x;} lint lnext() {lint x;cin>>x;return x;} int main() { ios::sync_with_stdio(false); lint n=lnext(); lint ans=0; if (n==2){ cout<<0; return 0; } for (lint i=1; pow2(i)<n; i++){ if (n%i==0){ // if (i==2){ // ans++; // continue; // } // if (pow2(i)==n){ // ans++; // continue; // } // ans+=2; ans++; } } cout<<ans; }
[ "51034972+pshpis@users.noreply.github.com" ]
51034972+pshpis@users.noreply.github.com
93462264e2c42302033fad58c841c2691150ce22
d3a1e7ddd23f27e67a6915a1e4a2ae7636900ea1
/BEv1.0/cmake-build-debug/report.pb.h
760d7413c551f35b1b8208191a17cc6356c9c102
[]
no_license
TaliShiva/Samples
e28426c3e89e2abb0d39d405bb338f86aada3898
50c3a9054b6500cff7608284ae91cce951f8a01e
refs/heads/master
2020-04-23T22:56:49.485572
2019-02-19T17:34:07
2019-02-19T17:34:07
171,514,587
0
0
null
null
null
null
UTF-8
C++
false
true
39,219
h
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: report.proto #ifndef PROTOBUF_report_2eproto__INCLUDED #define PROTOBUF_report_2eproto__INCLUDED #include <string> #include <google/protobuf/stubs/common.h> #if GOOGLE_PROTOBUF_VERSION < 3001000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif #if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_util.h> #include <google/protobuf/metadata.h> #include <google/protobuf/message.h> #include <google/protobuf/repeated_field.h> #include <google/protobuf/extension_set.h> #include <google/protobuf/generated_enum_reflection.h> #include <google/protobuf/unknown_field_set.h> // @@protoc_insertion_point(includes) namespace gorynych { namespace protobuf { // Internal implementation detail -- do not call these. void protobuf_AddDesc_report_2eproto(); void protobuf_InitDefaults_report_2eproto(); void protobuf_AssignDesc_report_2eproto(); void protobuf_ShutdownFile_report_2eproto(); class Report; class Report_Report_Start; class Report_Report_Statistics; class Report_Report_Stop; enum Report_Report_Type { Report_Report_Type_REPORT_START = 0, Report_Report_Type_REPORT_STOP = 1, Report_Report_Type_REPORT_STATISTICS = 2 }; bool Report_Report_Type_IsValid(int value); const Report_Report_Type Report_Report_Type_Report_Type_MIN = Report_Report_Type_REPORT_START; const Report_Report_Type Report_Report_Type_Report_Type_MAX = Report_Report_Type_REPORT_STATISTICS; const int Report_Report_Type_Report_Type_ARRAYSIZE = Report_Report_Type_Report_Type_MAX + 1; const ::google::protobuf::EnumDescriptor* Report_Report_Type_descriptor(); inline const ::std::string& Report_Report_Type_Name(Report_Report_Type value) { return ::google::protobuf::internal::NameOfEnum( Report_Report_Type_descriptor(), value); } inline bool Report_Report_Type_Parse( const ::std::string& name, Report_Report_Type* value) { return ::google::protobuf::internal::ParseNamedEnum<Report_Report_Type>( Report_Report_Type_descriptor(), name, value); } // =================================================================== class Report_Report_Statistics : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:gorynych.protobuf.Report.Report_Statistics) */ { public: Report_Report_Statistics(); virtual ~Report_Report_Statistics(); Report_Report_Statistics(const Report_Report_Statistics& from); inline Report_Report_Statistics& operator=(const Report_Report_Statistics& from) { CopyFrom(from); return *this; } inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const ::google::protobuf::Descriptor* descriptor(); static const Report_Report_Statistics& default_instance(); static const Report_Report_Statistics* internal_default_instance(); void Swap(Report_Report_Statistics* other); // implements Message ---------------------------------------------- inline Report_Report_Statistics* New() const { return New(NULL); } Report_Report_Statistics* New(::google::protobuf::Arena* arena) const; void CopyFrom(const ::google::protobuf::Message& from); void MergeFrom(const ::google::protobuf::Message& from); void CopyFrom(const Report_Report_Statistics& from); void MergeFrom(const Report_Report_Statistics& from); void Clear(); bool IsInitialized() const; size_t ByteSizeLong() const; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input); void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const; ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* output) const; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { return InternalSerializeWithCachedSizesToArray(false, output); } int GetCachedSize() const { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(Report_Report_Statistics* other); void UnsafeMergeFrom(const Report_Report_Statistics& from); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { return _internal_metadata_.raw_arena_ptr(); } public: ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // required fixed32 sd_count = 1; bool has_sd_count() const; void clear_sd_count(); static const int kSdCountFieldNumber = 1; ::google::protobuf::uint32 sd_count() const; void set_sd_count(::google::protobuf::uint32 value); // required fixed32 sd_chain_count = 2; bool has_sd_chain_count() const; void clear_sd_chain_count(); static const int kSdChainCountFieldNumber = 2; ::google::protobuf::uint32 sd_chain_count() const; void set_sd_chain_count(::google::protobuf::uint32 value); // required fixed64 average_size_sd = 3; bool has_average_size_sd() const; void clear_average_size_sd(); static const int kAverageSizeSdFieldNumber = 3; ::google::protobuf::uint64 average_size_sd() const; void set_average_size_sd(::google::protobuf::uint64 value); // required fixed64 average_size_sd_chain = 4; bool has_average_size_sd_chain() const; void clear_average_size_sd_chain(); static const int kAverageSizeSdChainFieldNumber = 4; ::google::protobuf::uint64 average_size_sd_chain() const; void set_average_size_sd_chain(::google::protobuf::uint64 value); // required fixed64 average_latency_sd = 5; bool has_average_latency_sd() const; void clear_average_latency_sd(); static const int kAverageLatencySdFieldNumber = 5; ::google::protobuf::uint64 average_latency_sd() const; void set_average_latency_sd(::google::protobuf::uint64 value); // required fixed64 average_latency_sd_chain = 6; bool has_average_latency_sd_chain() const; void clear_average_latency_sd_chain(); static const int kAverageLatencySdChainFieldNumber = 6; ::google::protobuf::uint64 average_latency_sd_chain() const; void set_average_latency_sd_chain(::google::protobuf::uint64 value); // required fixed64 timestamp = 7; bool has_timestamp() const; void clear_timestamp(); static const int kTimestampFieldNumber = 7; ::google::protobuf::uint64 timestamp() const; void set_timestamp(::google::protobuf::uint64 value); // @@protoc_insertion_point(class_scope:gorynych.protobuf.Report.Report_Statistics) private: inline void set_has_sd_count(); inline void clear_has_sd_count(); inline void set_has_sd_chain_count(); inline void clear_has_sd_chain_count(); inline void set_has_average_size_sd(); inline void clear_has_average_size_sd(); inline void set_has_average_size_sd_chain(); inline void clear_has_average_size_sd_chain(); inline void set_has_average_latency_sd(); inline void clear_has_average_latency_sd(); inline void set_has_average_latency_sd_chain(); inline void clear_has_average_latency_sd_chain(); inline void set_has_timestamp(); inline void clear_has_timestamp(); // helper for ByteSizeLong() size_t RequiredFieldsByteSizeFallback() const; ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::uint32 sd_count_; ::google::protobuf::uint32 sd_chain_count_; ::google::protobuf::uint64 average_size_sd_; ::google::protobuf::uint64 average_size_sd_chain_; ::google::protobuf::uint64 average_latency_sd_; ::google::protobuf::uint64 average_latency_sd_chain_; ::google::protobuf::uint64 timestamp_; friend void protobuf_InitDefaults_report_2eproto_impl(); friend void protobuf_AddDesc_report_2eproto_impl(); friend void protobuf_AssignDesc_report_2eproto(); friend void protobuf_ShutdownFile_report_2eproto(); void InitAsDefaultInstance(); }; extern ::google::protobuf::internal::ExplicitlyConstructed<Report_Report_Statistics> Report_Report_Statistics_default_instance_; // ------------------------------------------------------------------- class Report_Report_Start : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:gorynych.protobuf.Report.Report_Start) */ { public: Report_Report_Start(); virtual ~Report_Report_Start(); Report_Report_Start(const Report_Report_Start& from); inline Report_Report_Start& operator=(const Report_Report_Start& from) { CopyFrom(from); return *this; } inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const ::google::protobuf::Descriptor* descriptor(); static const Report_Report_Start& default_instance(); static const Report_Report_Start* internal_default_instance(); void Swap(Report_Report_Start* other); // implements Message ---------------------------------------------- inline Report_Report_Start* New() const { return New(NULL); } Report_Report_Start* New(::google::protobuf::Arena* arena) const; void CopyFrom(const ::google::protobuf::Message& from); void MergeFrom(const ::google::protobuf::Message& from); void CopyFrom(const Report_Report_Start& from); void MergeFrom(const Report_Report_Start& from); void Clear(); bool IsInitialized() const; size_t ByteSizeLong() const; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input); void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const; ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* output) const; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { return InternalSerializeWithCachedSizesToArray(false, output); } int GetCachedSize() const { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(Report_Report_Start* other); void UnsafeMergeFrom(const Report_Report_Start& from); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { return _internal_metadata_.raw_arena_ptr(); } public: ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // required fixed64 start_time = 1; bool has_start_time() const; void clear_start_time(); static const int kStartTimeFieldNumber = 1; ::google::protobuf::uint64 start_time() const; void set_start_time(::google::protobuf::uint64 value); // @@protoc_insertion_point(class_scope:gorynych.protobuf.Report.Report_Start) private: inline void set_has_start_time(); inline void clear_has_start_time(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::uint64 start_time_; friend void protobuf_InitDefaults_report_2eproto_impl(); friend void protobuf_AddDesc_report_2eproto_impl(); friend void protobuf_AssignDesc_report_2eproto(); friend void protobuf_ShutdownFile_report_2eproto(); void InitAsDefaultInstance(); }; extern ::google::protobuf::internal::ExplicitlyConstructed<Report_Report_Start> Report_Report_Start_default_instance_; // ------------------------------------------------------------------- class Report_Report_Stop : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:gorynych.protobuf.Report.Report_Stop) */ { public: Report_Report_Stop(); virtual ~Report_Report_Stop(); Report_Report_Stop(const Report_Report_Stop& from); inline Report_Report_Stop& operator=(const Report_Report_Stop& from) { CopyFrom(from); return *this; } inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const ::google::protobuf::Descriptor* descriptor(); static const Report_Report_Stop& default_instance(); static const Report_Report_Stop* internal_default_instance(); void Swap(Report_Report_Stop* other); // implements Message ---------------------------------------------- inline Report_Report_Stop* New() const { return New(NULL); } Report_Report_Stop* New(::google::protobuf::Arena* arena) const; void CopyFrom(const ::google::protobuf::Message& from); void MergeFrom(const ::google::protobuf::Message& from); void CopyFrom(const Report_Report_Stop& from); void MergeFrom(const Report_Report_Stop& from); void Clear(); bool IsInitialized() const; size_t ByteSizeLong() const; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input); void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const; ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* output) const; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { return InternalSerializeWithCachedSizesToArray(false, output); } int GetCachedSize() const { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(Report_Report_Stop* other); void UnsafeMergeFrom(const Report_Report_Stop& from); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { return _internal_metadata_.raw_arena_ptr(); } public: ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // required fixed64 stop_time = 1; bool has_stop_time() const; void clear_stop_time(); static const int kStopTimeFieldNumber = 1; ::google::protobuf::uint64 stop_time() const; void set_stop_time(::google::protobuf::uint64 value); // @@protoc_insertion_point(class_scope:gorynych.protobuf.Report.Report_Stop) private: inline void set_has_stop_time(); inline void clear_has_stop_time(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::uint64 stop_time_; friend void protobuf_InitDefaults_report_2eproto_impl(); friend void protobuf_AddDesc_report_2eproto_impl(); friend void protobuf_AssignDesc_report_2eproto(); friend void protobuf_ShutdownFile_report_2eproto(); void InitAsDefaultInstance(); }; extern ::google::protobuf::internal::ExplicitlyConstructed<Report_Report_Stop> Report_Report_Stop_default_instance_; // ------------------------------------------------------------------- class Report : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:gorynych.protobuf.Report) */ { public: Report(); virtual ~Report(); Report(const Report& from); inline Report& operator=(const Report& from) { CopyFrom(from); return *this; } inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const ::google::protobuf::Descriptor* descriptor(); static const Report& default_instance(); static const Report* internal_default_instance(); void Swap(Report* other); // implements Message ---------------------------------------------- inline Report* New() const { return New(NULL); } Report* New(::google::protobuf::Arena* arena) const; void CopyFrom(const ::google::protobuf::Message& from); void MergeFrom(const ::google::protobuf::Message& from); void CopyFrom(const Report& from); void MergeFrom(const Report& from); void Clear(); bool IsInitialized() const; size_t ByteSizeLong() const; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input); void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const; ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* output) const; ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { return InternalSerializeWithCachedSizesToArray(false, output); } int GetCachedSize() const { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(Report* other); void UnsafeMergeFrom(const Report& from); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { return _internal_metadata_.raw_arena_ptr(); } public: ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- typedef Report_Report_Statistics Report_Statistics; typedef Report_Report_Start Report_Start; typedef Report_Report_Stop Report_Stop; typedef Report_Report_Type Report_Type; static const Report_Type REPORT_START = Report_Report_Type_REPORT_START; static const Report_Type REPORT_STOP = Report_Report_Type_REPORT_STOP; static const Report_Type REPORT_STATISTICS = Report_Report_Type_REPORT_STATISTICS; static inline bool Report_Type_IsValid(int value) { return Report_Report_Type_IsValid(value); } static const Report_Type Report_Type_MIN = Report_Report_Type_Report_Type_MIN; static const Report_Type Report_Type_MAX = Report_Report_Type_Report_Type_MAX; static const int Report_Type_ARRAYSIZE = Report_Report_Type_Report_Type_ARRAYSIZE; static inline const ::google::protobuf::EnumDescriptor* Report_Type_descriptor() { return Report_Report_Type_descriptor(); } static inline const ::std::string& Report_Type_Name(Report_Type value) { return Report_Report_Type_Name(value); } static inline bool Report_Type_Parse(const ::std::string& name, Report_Type* value) { return Report_Report_Type_Parse(name, value); } // accessors ------------------------------------------------------- // required .gorynych.protobuf.Report.Report_Type type = 1; bool has_type() const; void clear_type(); static const int kTypeFieldNumber = 1; ::gorynych::protobuf::Report_Report_Type type() const; void set_type(::gorynych::protobuf::Report_Report_Type value); // optional .gorynych.protobuf.Report.Report_Statistics report_statistics = 2; bool has_report_statistics() const; void clear_report_statistics(); static const int kReportStatisticsFieldNumber = 2; const ::gorynych::protobuf::Report_Report_Statistics& report_statistics() const; ::gorynych::protobuf::Report_Report_Statistics* mutable_report_statistics(); ::gorynych::protobuf::Report_Report_Statistics* release_report_statistics(); void set_allocated_report_statistics(::gorynych::protobuf::Report_Report_Statistics* report_statistics); // optional .gorynych.protobuf.Report.Report_Start report_start = 3; bool has_report_start() const; void clear_report_start(); static const int kReportStartFieldNumber = 3; const ::gorynych::protobuf::Report_Report_Start& report_start() const; ::gorynych::protobuf::Report_Report_Start* mutable_report_start(); ::gorynych::protobuf::Report_Report_Start* release_report_start(); void set_allocated_report_start(::gorynych::protobuf::Report_Report_Start* report_start); // optional .gorynych.protobuf.Report.Report_Stop report_stop = 4; bool has_report_stop() const; void clear_report_stop(); static const int kReportStopFieldNumber = 4; const ::gorynych::protobuf::Report_Report_Stop& report_stop() const; ::gorynych::protobuf::Report_Report_Stop* mutable_report_stop(); ::gorynych::protobuf::Report_Report_Stop* release_report_stop(); void set_allocated_report_stop(::gorynych::protobuf::Report_Report_Stop* report_stop); // @@protoc_insertion_point(class_scope:gorynych.protobuf.Report) private: inline void set_has_type(); inline void clear_has_type(); inline void set_has_report_statistics(); inline void clear_has_report_statistics(); inline void set_has_report_start(); inline void clear_has_report_start(); inline void set_has_report_stop(); inline void clear_has_report_stop(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::gorynych::protobuf::Report_Report_Statistics* report_statistics_; ::gorynych::protobuf::Report_Report_Start* report_start_; ::gorynych::protobuf::Report_Report_Stop* report_stop_; int type_; friend void protobuf_InitDefaults_report_2eproto_impl(); friend void protobuf_AddDesc_report_2eproto_impl(); friend void protobuf_AssignDesc_report_2eproto(); friend void protobuf_ShutdownFile_report_2eproto(); void InitAsDefaultInstance(); }; extern ::google::protobuf::internal::ExplicitlyConstructed<Report> Report_default_instance_; // =================================================================== // =================================================================== #if !PROTOBUF_INLINE_NOT_IN_HEADERS // Report_Report_Statistics // required fixed32 sd_count = 1; inline bool Report_Report_Statistics::has_sd_count() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void Report_Report_Statistics::set_has_sd_count() { _has_bits_[0] |= 0x00000001u; } inline void Report_Report_Statistics::clear_has_sd_count() { _has_bits_[0] &= ~0x00000001u; } inline void Report_Report_Statistics::clear_sd_count() { sd_count_ = 0u; clear_has_sd_count(); } inline ::google::protobuf::uint32 Report_Report_Statistics::sd_count() const { // @@protoc_insertion_point(field_get:gorynych.protobuf.Report.Report_Statistics.sd_count) return sd_count_; } inline void Report_Report_Statistics::set_sd_count(::google::protobuf::uint32 value) { set_has_sd_count(); sd_count_ = value; // @@protoc_insertion_point(field_set:gorynych.protobuf.Report.Report_Statistics.sd_count) } // required fixed32 sd_chain_count = 2; inline bool Report_Report_Statistics::has_sd_chain_count() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void Report_Report_Statistics::set_has_sd_chain_count() { _has_bits_[0] |= 0x00000002u; } inline void Report_Report_Statistics::clear_has_sd_chain_count() { _has_bits_[0] &= ~0x00000002u; } inline void Report_Report_Statistics::clear_sd_chain_count() { sd_chain_count_ = 0u; clear_has_sd_chain_count(); } inline ::google::protobuf::uint32 Report_Report_Statistics::sd_chain_count() const { // @@protoc_insertion_point(field_get:gorynych.protobuf.Report.Report_Statistics.sd_chain_count) return sd_chain_count_; } inline void Report_Report_Statistics::set_sd_chain_count(::google::protobuf::uint32 value) { set_has_sd_chain_count(); sd_chain_count_ = value; // @@protoc_insertion_point(field_set:gorynych.protobuf.Report.Report_Statistics.sd_chain_count) } // required fixed64 average_size_sd = 3; inline bool Report_Report_Statistics::has_average_size_sd() const { return (_has_bits_[0] & 0x00000004u) != 0; } inline void Report_Report_Statistics::set_has_average_size_sd() { _has_bits_[0] |= 0x00000004u; } inline void Report_Report_Statistics::clear_has_average_size_sd() { _has_bits_[0] &= ~0x00000004u; } inline void Report_Report_Statistics::clear_average_size_sd() { average_size_sd_ = GOOGLE_ULONGLONG(0); clear_has_average_size_sd(); } inline ::google::protobuf::uint64 Report_Report_Statistics::average_size_sd() const { // @@protoc_insertion_point(field_get:gorynych.protobuf.Report.Report_Statistics.average_size_sd) return average_size_sd_; } inline void Report_Report_Statistics::set_average_size_sd(::google::protobuf::uint64 value) { set_has_average_size_sd(); average_size_sd_ = value; // @@protoc_insertion_point(field_set:gorynych.protobuf.Report.Report_Statistics.average_size_sd) } // required fixed64 average_size_sd_chain = 4; inline bool Report_Report_Statistics::has_average_size_sd_chain() const { return (_has_bits_[0] & 0x00000008u) != 0; } inline void Report_Report_Statistics::set_has_average_size_sd_chain() { _has_bits_[0] |= 0x00000008u; } inline void Report_Report_Statistics::clear_has_average_size_sd_chain() { _has_bits_[0] &= ~0x00000008u; } inline void Report_Report_Statistics::clear_average_size_sd_chain() { average_size_sd_chain_ = GOOGLE_ULONGLONG(0); clear_has_average_size_sd_chain(); } inline ::google::protobuf::uint64 Report_Report_Statistics::average_size_sd_chain() const { // @@protoc_insertion_point(field_get:gorynych.protobuf.Report.Report_Statistics.average_size_sd_chain) return average_size_sd_chain_; } inline void Report_Report_Statistics::set_average_size_sd_chain(::google::protobuf::uint64 value) { set_has_average_size_sd_chain(); average_size_sd_chain_ = value; // @@protoc_insertion_point(field_set:gorynych.protobuf.Report.Report_Statistics.average_size_sd_chain) } // required fixed64 average_latency_sd = 5; inline bool Report_Report_Statistics::has_average_latency_sd() const { return (_has_bits_[0] & 0x00000010u) != 0; } inline void Report_Report_Statistics::set_has_average_latency_sd() { _has_bits_[0] |= 0x00000010u; } inline void Report_Report_Statistics::clear_has_average_latency_sd() { _has_bits_[0] &= ~0x00000010u; } inline void Report_Report_Statistics::clear_average_latency_sd() { average_latency_sd_ = GOOGLE_ULONGLONG(0); clear_has_average_latency_sd(); } inline ::google::protobuf::uint64 Report_Report_Statistics::average_latency_sd() const { // @@protoc_insertion_point(field_get:gorynych.protobuf.Report.Report_Statistics.average_latency_sd) return average_latency_sd_; } inline void Report_Report_Statistics::set_average_latency_sd(::google::protobuf::uint64 value) { set_has_average_latency_sd(); average_latency_sd_ = value; // @@protoc_insertion_point(field_set:gorynych.protobuf.Report.Report_Statistics.average_latency_sd) } // required fixed64 average_latency_sd_chain = 6; inline bool Report_Report_Statistics::has_average_latency_sd_chain() const { return (_has_bits_[0] & 0x00000020u) != 0; } inline void Report_Report_Statistics::set_has_average_latency_sd_chain() { _has_bits_[0] |= 0x00000020u; } inline void Report_Report_Statistics::clear_has_average_latency_sd_chain() { _has_bits_[0] &= ~0x00000020u; } inline void Report_Report_Statistics::clear_average_latency_sd_chain() { average_latency_sd_chain_ = GOOGLE_ULONGLONG(0); clear_has_average_latency_sd_chain(); } inline ::google::protobuf::uint64 Report_Report_Statistics::average_latency_sd_chain() const { // @@protoc_insertion_point(field_get:gorynych.protobuf.Report.Report_Statistics.average_latency_sd_chain) return average_latency_sd_chain_; } inline void Report_Report_Statistics::set_average_latency_sd_chain(::google::protobuf::uint64 value) { set_has_average_latency_sd_chain(); average_latency_sd_chain_ = value; // @@protoc_insertion_point(field_set:gorynych.protobuf.Report.Report_Statistics.average_latency_sd_chain) } // required fixed64 timestamp = 7; inline bool Report_Report_Statistics::has_timestamp() const { return (_has_bits_[0] & 0x00000040u) != 0; } inline void Report_Report_Statistics::set_has_timestamp() { _has_bits_[0] |= 0x00000040u; } inline void Report_Report_Statistics::clear_has_timestamp() { _has_bits_[0] &= ~0x00000040u; } inline void Report_Report_Statistics::clear_timestamp() { timestamp_ = GOOGLE_ULONGLONG(0); clear_has_timestamp(); } inline ::google::protobuf::uint64 Report_Report_Statistics::timestamp() const { // @@protoc_insertion_point(field_get:gorynych.protobuf.Report.Report_Statistics.timestamp) return timestamp_; } inline void Report_Report_Statistics::set_timestamp(::google::protobuf::uint64 value) { set_has_timestamp(); timestamp_ = value; // @@protoc_insertion_point(field_set:gorynych.protobuf.Report.Report_Statistics.timestamp) } inline const Report_Report_Statistics* Report_Report_Statistics::internal_default_instance() { return &Report_Report_Statistics_default_instance_.get(); } // ------------------------------------------------------------------- // Report_Report_Start // required fixed64 start_time = 1; inline bool Report_Report_Start::has_start_time() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void Report_Report_Start::set_has_start_time() { _has_bits_[0] |= 0x00000001u; } inline void Report_Report_Start::clear_has_start_time() { _has_bits_[0] &= ~0x00000001u; } inline void Report_Report_Start::clear_start_time() { start_time_ = GOOGLE_ULONGLONG(0); clear_has_start_time(); } inline ::google::protobuf::uint64 Report_Report_Start::start_time() const { // @@protoc_insertion_point(field_get:gorynych.protobuf.Report.Report_Start.start_time) return start_time_; } inline void Report_Report_Start::set_start_time(::google::protobuf::uint64 value) { set_has_start_time(); start_time_ = value; // @@protoc_insertion_point(field_set:gorynych.protobuf.Report.Report_Start.start_time) } inline const Report_Report_Start* Report_Report_Start::internal_default_instance() { return &Report_Report_Start_default_instance_.get(); } // ------------------------------------------------------------------- // Report_Report_Stop // required fixed64 stop_time = 1; inline bool Report_Report_Stop::has_stop_time() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void Report_Report_Stop::set_has_stop_time() { _has_bits_[0] |= 0x00000001u; } inline void Report_Report_Stop::clear_has_stop_time() { _has_bits_[0] &= ~0x00000001u; } inline void Report_Report_Stop::clear_stop_time() { stop_time_ = GOOGLE_ULONGLONG(0); clear_has_stop_time(); } inline ::google::protobuf::uint64 Report_Report_Stop::stop_time() const { // @@protoc_insertion_point(field_get:gorynych.protobuf.Report.Report_Stop.stop_time) return stop_time_; } inline void Report_Report_Stop::set_stop_time(::google::protobuf::uint64 value) { set_has_stop_time(); stop_time_ = value; // @@protoc_insertion_point(field_set:gorynych.protobuf.Report.Report_Stop.stop_time) } inline const Report_Report_Stop* Report_Report_Stop::internal_default_instance() { return &Report_Report_Stop_default_instance_.get(); } // ------------------------------------------------------------------- // Report // required .gorynych.protobuf.Report.Report_Type type = 1; inline bool Report::has_type() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void Report::set_has_type() { _has_bits_[0] |= 0x00000001u; } inline void Report::clear_has_type() { _has_bits_[0] &= ~0x00000001u; } inline void Report::clear_type() { type_ = 0; clear_has_type(); } inline ::gorynych::protobuf::Report_Report_Type Report::type() const { // @@protoc_insertion_point(field_get:gorynych.protobuf.Report.type) return static_cast< ::gorynych::protobuf::Report_Report_Type >(type_); } inline void Report::set_type(::gorynych::protobuf::Report_Report_Type value) { assert(::gorynych::protobuf::Report_Report_Type_IsValid(value)); set_has_type(); type_ = value; // @@protoc_insertion_point(field_set:gorynych.protobuf.Report.type) } // optional .gorynych.protobuf.Report.Report_Statistics report_statistics = 2; inline bool Report::has_report_statistics() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void Report::set_has_report_statistics() { _has_bits_[0] |= 0x00000002u; } inline void Report::clear_has_report_statistics() { _has_bits_[0] &= ~0x00000002u; } inline void Report::clear_report_statistics() { if (report_statistics_ != NULL) report_statistics_->::gorynych::protobuf::Report_Report_Statistics::Clear(); clear_has_report_statistics(); } inline const ::gorynych::protobuf::Report_Report_Statistics& Report::report_statistics() const { // @@protoc_insertion_point(field_get:gorynych.protobuf.Report.report_statistics) return report_statistics_ != NULL ? *report_statistics_ : *::gorynych::protobuf::Report_Report_Statistics::internal_default_instance(); } inline ::gorynych::protobuf::Report_Report_Statistics* Report::mutable_report_statistics() { set_has_report_statistics(); if (report_statistics_ == NULL) { report_statistics_ = new ::gorynych::protobuf::Report_Report_Statistics; } // @@protoc_insertion_point(field_mutable:gorynych.protobuf.Report.report_statistics) return report_statistics_; } inline ::gorynych::protobuf::Report_Report_Statistics* Report::release_report_statistics() { // @@protoc_insertion_point(field_release:gorynych.protobuf.Report.report_statistics) clear_has_report_statistics(); ::gorynych::protobuf::Report_Report_Statistics* temp = report_statistics_; report_statistics_ = NULL; return temp; } inline void Report::set_allocated_report_statistics(::gorynych::protobuf::Report_Report_Statistics* report_statistics) { delete report_statistics_; report_statistics_ = report_statistics; if (report_statistics) { set_has_report_statistics(); } else { clear_has_report_statistics(); } // @@protoc_insertion_point(field_set_allocated:gorynych.protobuf.Report.report_statistics) } // optional .gorynych.protobuf.Report.Report_Start report_start = 3; inline bool Report::has_report_start() const { return (_has_bits_[0] & 0x00000004u) != 0; } inline void Report::set_has_report_start() { _has_bits_[0] |= 0x00000004u; } inline void Report::clear_has_report_start() { _has_bits_[0] &= ~0x00000004u; } inline void Report::clear_report_start() { if (report_start_ != NULL) report_start_->::gorynych::protobuf::Report_Report_Start::Clear(); clear_has_report_start(); } inline const ::gorynych::protobuf::Report_Report_Start& Report::report_start() const { // @@protoc_insertion_point(field_get:gorynych.protobuf.Report.report_start) return report_start_ != NULL ? *report_start_ : *::gorynych::protobuf::Report_Report_Start::internal_default_instance(); } inline ::gorynych::protobuf::Report_Report_Start* Report::mutable_report_start() { set_has_report_start(); if (report_start_ == NULL) { report_start_ = new ::gorynych::protobuf::Report_Report_Start; } // @@protoc_insertion_point(field_mutable:gorynych.protobuf.Report.report_start) return report_start_; } inline ::gorynych::protobuf::Report_Report_Start* Report::release_report_start() { // @@protoc_insertion_point(field_release:gorynych.protobuf.Report.report_start) clear_has_report_start(); ::gorynych::protobuf::Report_Report_Start* temp = report_start_; report_start_ = NULL; return temp; } inline void Report::set_allocated_report_start(::gorynych::protobuf::Report_Report_Start* report_start) { delete report_start_; report_start_ = report_start; if (report_start) { set_has_report_start(); } else { clear_has_report_start(); } // @@protoc_insertion_point(field_set_allocated:gorynych.protobuf.Report.report_start) } // optional .gorynych.protobuf.Report.Report_Stop report_stop = 4; inline bool Report::has_report_stop() const { return (_has_bits_[0] & 0x00000008u) != 0; } inline void Report::set_has_report_stop() { _has_bits_[0] |= 0x00000008u; } inline void Report::clear_has_report_stop() { _has_bits_[0] &= ~0x00000008u; } inline void Report::clear_report_stop() { if (report_stop_ != NULL) report_stop_->::gorynych::protobuf::Report_Report_Stop::Clear(); clear_has_report_stop(); } inline const ::gorynych::protobuf::Report_Report_Stop& Report::report_stop() const { // @@protoc_insertion_point(field_get:gorynych.protobuf.Report.report_stop) return report_stop_ != NULL ? *report_stop_ : *::gorynych::protobuf::Report_Report_Stop::internal_default_instance(); } inline ::gorynych::protobuf::Report_Report_Stop* Report::mutable_report_stop() { set_has_report_stop(); if (report_stop_ == NULL) { report_stop_ = new ::gorynych::protobuf::Report_Report_Stop; } // @@protoc_insertion_point(field_mutable:gorynych.protobuf.Report.report_stop) return report_stop_; } inline ::gorynych::protobuf::Report_Report_Stop* Report::release_report_stop() { // @@protoc_insertion_point(field_release:gorynych.protobuf.Report.report_stop) clear_has_report_stop(); ::gorynych::protobuf::Report_Report_Stop* temp = report_stop_; report_stop_ = NULL; return temp; } inline void Report::set_allocated_report_stop(::gorynych::protobuf::Report_Report_Stop* report_stop) { delete report_stop_; report_stop_ = report_stop; if (report_stop) { set_has_report_stop(); } else { clear_has_report_stop(); } // @@protoc_insertion_point(field_set_allocated:gorynych.protobuf.Report.report_stop) } inline const Report* Report::internal_default_instance() { return &Report_default_instance_.get(); } #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // @@protoc_insertion_point(namespace_scope) } // namespace protobuf } // namespace gorynych #ifndef SWIG namespace google { namespace protobuf { template <> struct is_proto_enum< ::gorynych::protobuf::Report_Report_Type> : ::google::protobuf::internal::true_type {}; template <> inline const EnumDescriptor* GetEnumDescriptor< ::gorynych::protobuf::Report_Report_Type>() { return ::gorynych::protobuf::Report_Report_Type_descriptor(); } } // namespace protobuf } // namespace google #endif // SWIG // @@protoc_insertion_point(global_scope) #endif // PROTOBUF_report_2eproto__INCLUDED
[ "talishiva@mail.ru" ]
talishiva@mail.ru
1082689d06995e04ee2f799f8c05162a1dc20342
b8c72b879744e9eab3f447032a6265c5336fff6c
/CodeBlocks/Chapter02/filter_1/filter_1.cpp
5e8aea19fe44ceb572317ab7cc891c90944b2206
[]
no_license
mobilenjoy/learning_cpp_functional_programming_kor
3f722236af31b1eb2f79111d84f94c94573d6151
8b962a89ad1682179489ab725ba0a62500dff698
refs/heads/master
2020-04-29T06:57:47.965280
2019-01-20T07:18:52
2019-01-20T07:18:52
null
0
0
null
null
null
null
UHC
C++
false
false
1,097
cpp
/* filter_1.cpp */ #include <vector> #include <algorithm> #include <iterator> #include <iostream> using namespace std; auto main() -> int { cout << "[filter_1.cpp]" << endl; // 몇 개의 정수를 벡터에 추가한다. vector<int> numbers; for (int i = 0; i < 20; ++i) numbers.push_back(i); // 벡터 numbers를 출력한다. cout << "The original numbers: " << endl; copy( begin(numbers), end(numbers), ostream_iterator<int>(cout, " ")); cout << endl; // int를 원소로 가지는 벡터 primes를 선언한다. vector<int> primes; // 벡터 numbers에서 소수(prime number)만 필터링해서 // 벡터 primes에 추가한다. copy_if( begin(numbers), end(numbers), back_inserter(primes), [](int n) { if (n < 2) { return (n != 0) ? true : false; } else { for (int j = 2; j < n; ++j) { if (n % j == 0) { return false; } } return true; }}); // 벡터 primes를 출력한다. cout << "The primes numbers: " << endl; copy( begin(primes), end(primes), ostream_iterator<int>(cout, " ")); cout << endl; return 0; }
[ "nnhope@hotmail.com" ]
nnhope@hotmail.com
4749ee6cfd0b4d028d5ee2ac9973c3fb4bea15f3
11b4a03bac502ef894a1bccc6074737aecbea7bf
/public/src/ystexturemanager/src/null/ystexturemanager_null.cpp
0bc577be46fce891acda3f44cecf648450ffb59a
[]
no_license
beefeater1994/Advanced-Engineering-Computation
0006e746a425f6c74abdae98f18b605571969959
0d90f4023f72ce45689da0738bb6e0e58b686045
refs/heads/master
2020-05-24T19:42:27.625311
2017-03-13T21:15:41
2017-03-13T21:15:41
84,874,784
0
0
null
null
null
null
UTF-8
C++
false
false
777
cpp
#include "ystexturemanager_nownd.h" YSRESULT YsTextureManager::Unit::Bind(int) const { return YSERR; } YSRESULT YsTextureManager::Unit::BindFrameBuffer(void) const { return YSERR; } /* static */ YsTextureManager::ActualTexture *YsTextureManager::Alloc(void) { return nullptr; } /* static */ void YsTextureManager::Delete(YsTextureManager::ActualTexture *texPtr) { } /* static */ YSRESULT YsTextureManager::CreateDepthMapRenderTarget(ActualTexture *texPtr,int wid,int hei) { return YSOK; } /* static */ YSRESULT YsTextureManager::TransferRGBABitmap(YsTextureManager::ActualTexture *texPtr,int wid,int hei,const unsigned char rgba[]) { return YSOK; } /* static */ YSBOOL YsTextureManager::IsTextureReady(YsTextureManager::ActualTexture *texPtr) { return YSTRUE; }
[ "ruihanf2016@gmail.com" ]
ruihanf2016@gmail.com
459d24c995d60247ffb1c76fa82ce58e5d77a365
bd80b66911386716f4f98c0a894c17eafaba2487
/CS450.HW1/HW1/Ball.h
f2bd866251da2890a9f0bf09c4b1d9a53c3cb2c7
[]
no_license
nartpullif/CS450
e39c0145483c5ee4c788eb01bea6decfc8e61a20
844a56b676699abaa3ec7114dc260b7ae371ebdd
refs/heads/master
2021-05-29T13:12:06.628943
2015-08-20T11:15:07
2015-08-20T11:15:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,431
h
#if !defined(BALL_H) #include "settings.h" class Ball { public: Ball(); Ball(GLfloatPoint2D pos); void resetBall(void); void setColor3f(GLfloatColor3f&); void setRandomVecterSpeed2f(GLfloatPoint2D&); void toggleMovement(void); inline void toggleFill(void){fillToggle = !fillToggle;} inline void increaseRadius(void){radius += 0.02f;} inline void decreaseRadius(void){radius = ((radius - 0.02f) > 0) ? radius - 0.02f : 0.0f;} void increaseSpeed(void); void decreaseSpeed(void); inline void setSpeed(GLfloatPoint2D newSpeed){ballSpeed = newSpeed;} inline float getRadius(void){return radius;} void update(void); void collidedWith(Ball&); inline bool hasCollided(Ball& other){return hasCollided(other.getPosition(), other.getRadius());} bool hasCollided(GLfloatPoint2D&, float); inline bool hasBallStop(void){return stopBall;} inline bool isFill(void){return fillToggle;} inline GLfloatPoint2D getPosition(void){return ballPosition;} inline GLfloatPoint2D getSpeed(void){return ballSpeed;} inline GLfloatColor3f getColor(void){return ballColor;} inline void setMovement(void){stopBall = !stopBall;} private: GLfloatPoint2D ballPosition; GLfloatColor3f ballColor; GLfloatPoint2D ballSpeed; float speedScalar; float radius; bool fillToggle; bool stopBall; }; #define BALL_H #endif
[ "phil10tran@gmail.com" ]
phil10tran@gmail.com
7dc2b96a715b50491c6924800720c2758dcf080f
0150d34d5ced4266b6606c87fbc389f23ed19a45
/Cpp/SDK/BP_MapMarker_Frontline_classes.h
4143a56b5803276ecdcc936b49dae96ad0d2553b
[ "Apache-2.0" ]
permissive
joey00186/Squad-SDK
9aa1b6424d4e5b0a743e105407934edea87cbfeb
742feb5991ae43d6f0cedd2d6b32b949923ca4f9
refs/heads/master
2023-02-05T19:00:05.452463
2021-01-03T19:03:34
2021-01-03T19:03:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,191
h
#pragma once // Name: S, Version: b #ifdef _MSC_VER #pragma pack(push, 0x01) #endif /*!!HELPER_DEF!!*/ /*!!DEFINE!!*/ namespace UFT { //--------------------------------------------------------------------------- // Classes //--------------------------------------------------------------------------- // WidgetBlueprintGeneratedClass BP_MapMarker_Frontline.BP_MapMarker_Frontline_C // 0x0028 (FullSize[0x0350] - InheritedSize[0x0328]) class UBP_MapMarker_Frontline_C : public UBP_MapMarker_Selectable_C { public: struct FPointerToUberGraphFrame UberGraphFrame; // 0x0328(0x0008) (ZeroConstructor, Transient, DuplicateTransient) class UWidgetAnimation* In; // 0x0330(0x0008) (BlueprintVisible, BlueprintReadOnly, ZeroConstructor, Transient, IsPlainOldData, RepSkip, NoDestructor, HasGetValueTypeHash) class UImage* Arrows; // 0x0338(0x0008) (BlueprintVisible, ExportObject, ZeroConstructor, InstancedReference, IsPlainOldData, RepSkip, NoDestructor, PersistentInstance, HasGetValueTypeHash) class USizeBox* SizeBox_1; // 0x0340(0x0008) (BlueprintVisible, ExportObject, ZeroConstructor, InstancedReference, IsPlainOldData, RepSkip, NoDestructor, PersistentInstance, HasGetValueTypeHash) class UMaterialInstanceDynamic* MI_Arrows; // 0x0348(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash) static UClass* StaticClass() { static auto ptr = UObject::FindClass("WidgetBlueprintGeneratedClass BP_MapMarker_Frontline.BP_MapMarker_Frontline_C"); return ptr; } void InitDirectorMarker(); void RefreshVisibility(); void Construct(); void OnMapZoom(); void OnMapCoreChanged(); void OnHasFadedChanged(); void ExecuteUbergraph_BP_MapMarker_Frontline(int EntryPoint); }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "tahmaniak@gmail.com" ]
tahmaniak@gmail.com
8eabd74d196a682a1bf0c82193a3fb912cf3ed7b
d217d87eda5567d220bab15e49094d688c77eb08
/src/menu/TextButton.cpp
dda9c360319fefb168276927c972592f77caf62d
[]
no_license
TheNinthFox/icw
daf9fcc87631686b45059ee20faa76432f87aed1
ec4f9c1dc80b1b993f36ae23de9bf927dbe361d4
refs/heads/master
2020-04-15T04:40:22.306440
2014-10-19T19:59:11
2014-10-19T19:59:11
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,384
cpp
#include <lib/menu/Menu.hpp> #include "lib/menu/TextButton.hpp" TextButton::TextButton() : mFont() , mText() , mTextColor() , mHighlightTextColor() , mBackgroundColor() , mShape() , mClickFunction() , mHighlighted( false ) { } void TextButton::update( sf::Vector2u windowSize, sf::Time dt ) { if( this->isHighlighted() ) { mText.setColor( mHighlightTextColor ); } else { mText.setColor( mTextColor ); } mShape.setPosition( this->getPosition() ); mShape.setSize( this->getSize() ); mShape.setFillColor( this->mBackgroundColor ); sf::Vector2f textPos; textPos.x = this->getPosition().x + this->getSize().x / 2.f - mText.getGlobalBounds().width / 2.f; textPos.y = this->getPosition().y + this->getSize().y / 2.f - mText.getGlobalBounds().height / 2.f; mText.setPosition( textPos ); } void TextButton::render( sf::RenderTarget& target, sf::Time dt ) { target.draw( mShape ); target.draw( mText ); } void TextButton::onHover( Menu* menu, bool active ) { if( active ) { mHighlighted = true; } else { mHighlighted = false; } } bool TextButton::onClick( Menu* menu, Game* game ) { if ( mClickFunction ) { this->mClickFunction( menu, game ); return true; } return false; }
[ "adrian.cieluch@gmail.com" ]
adrian.cieluch@gmail.com
89e86b030731cf3e8785aaf8e1f6a9f6f86997ef
fc056b2e63f559087240fed1a77461eb72b2bf8e
/src/Core/GCAddEffectToTile.h
7e652840760516a0dbf460b385fe0cfee231f27e
[]
no_license
opendarkeden/server
0bd3c59b837b1bd6e8c52c32ed6199ceb9fbee38
3c2054f5d9e16196fc32db70b237141d4a9738d1
refs/heads/master
2023-02-18T20:21:30.398896
2023-02-15T16:42:07
2023-02-15T16:42:07
42,562,951
48
37
null
2023-02-15T16:42:10
2015-09-16T03:42:35
C++
UHC
C++
false
false
2,766
h
////////////////////////////////////////////////////////////////////////////// // Filename : GCAddEffectToTile.h // Written By : elca@ewestsoft.com // Description : // 기술이 성공했을때 보내는 패킷을 위한 클래스 정의 ////////////////////////////////////////////////////////////////////////////// #ifndef __GC_ADD_EFFECT_TO_TILE_H__ #define __GC_ADD_EFFECT_TO_TILE_H__ #include "Types.h" #include "Exception.h" #include "Packet.h" #include "PacketFactory.h" ////////////////////////////////////////////////////////////////////////////// // class GCAddEffectToTile; // 게임서버에서 클라이언트로 자신의 기술이 성공을 알려주기 위한 클래스 ////////////////////////////////////////////////////////////////////////////// class GCAddEffectToTile : public Packet { public: GCAddEffectToTile() ; ~GCAddEffectToTile() ; public: void read(SocketInputStream & iStream) ; void write(SocketOutputStream & oStream) const ; void execute(Player* pPlayer) ; PacketID_t getPacketID() const { return PACKET_GC_ADD_EFFECT_TO_TILE; } PacketSize_t getPacketSize() const { return szObjectID + szCoord*2 + szEffectID + szDuration; } string getPacketName() const { return "GCAddEffectToTile"; } string toString() const ; public: EffectID_t getEffectID() const { return m_EffectID; } void setEffectID(EffectID_t e) { m_EffectID = e; } Duration_t getDuration() const { return m_Duration; } void setDuration(Duration_t d) { m_Duration = d; } ObjectID_t getObjectID() const { return m_ObjectID; } void setObjectID(ObjectID_t d) { m_ObjectID = d; } Coord_t getX() const { return m_X;} Coord_t getY() const { return m_Y;} void setXY(Coord_t x, Coord_t y) { m_X = x; m_Y = y;} private: Coord_t m_X; Coord_t m_Y; ObjectID_t m_ObjectID; EffectID_t m_EffectID; Duration_t m_Duration; }; ////////////////////////////////////////////////////////////////////////////// // class GCAddEffectToTileFactory; ////////////////////////////////////////////////////////////////////////////// class GCAddEffectToTileFactory : public PacketFactory { public: Packet* createPacket() { return new GCAddEffectToTile(); } string getPacketName() const { return "GCAddEffectToTile"; } PacketID_t getPacketID() const { return Packet::PACKET_GC_ADD_EFFECT_TO_TILE; } PacketSize_t getPacketMaxSize() const { return szObjectID + szCoord*2 + szEffectID + szDuration; } }; ////////////////////////////////////////////////////////////////////////////// // class GCAddEffectToTileHandler; ////////////////////////////////////////////////////////////////////////////// class GCAddEffectToTileHandler { public: static void execute(GCAddEffectToTile* pGCAddEffectToTile, Player* pPlayer) ; }; #endif
[ "tiancaiamao@gmail.com" ]
tiancaiamao@gmail.com
28bf4c337d3094f8ed6132391336a09c1e33fdac
6736351193d21906f41b911b96556d3a333f360e
/struktura.hpp
8d408c131baaa3c257e103b3d7d33e98c3c35cfe
[]
no_license
Aspectrus/3-darbas
06ac883eb992f4501a4ca8aa96f05a60ac1c8339
bb8b9d179ecd30d680780bb165034beca42b80ba
refs/heads/master
2020-03-10T06:00:18.439584
2018-05-31T06:10:24
2018-05-31T06:10:24
129,229,707
0
0
null
null
null
null
UTF-8
C++
false
false
5,004
hpp
#ifndef STRUKTURA_HPP #define STRUKTURA_HPP #include <algorithm> using std::cout; using std::cin; template <typename T> void spausdintifaila(const T kiet, const T varg, int i) { std::ofstream out("output"+std::to_string(i)+".txt"); out<<std::left<<std::setw(15)<<"Pavarde"<<std::left<<std::setw(15) <<"Vardas"<<std::left<<std::setw(20) <<"Galutinis-Vidurkis"<<std::left<<std::setw(15) <<"Galutine-Mediana\n"; if(kiet.size()!=0) {out<<"Kieti\n"; for(auto i:kiet) { out<<std::setw(15)<<i.pavarde<<std::left<<std::setw(15)<<i.vardas<<std::left<<std::setw(20); out<<std::setprecision(3)<<i.galvid<<std::left<<std::setw(15); out<<std::setprecision(3)<<i.galmed<<"\n"; } } if(varg.size()!=0) {out<<"Vargsai\n"; for(auto i:varg) { out<<std::setw(15)<<i.pavarde<<std::left<<std::setw(15)<<i.vardas<<std::left<<std::setw(20); out<<std::setprecision(3)<<i.galvid<<std::left<<std::setw(15); out<<std::setprecision(3)<<i.galmed<<"\n"; } } out.close(); } template<typename Container> void budas1read(std::string name) { Container z, a, b; std::ifstream in (name); std::string eil; mokinys temp; while(std::getline(in, eil)) { std::istringstream ss(eil); ss>>temp.vardas; ss>>temp.pavarde; int num; while(ss>>num) temp.pazymiai.push_back(num); int egzaminas=temp.pazymiai[temp.pazymiai.size()-1]; temp.pazymiai.pop_back(); temp.galmed=0.6*egzaminas+mediana(temp.pazymiai)*0.4; temp.galvid=0.6*egzaminas+vidurkis(temp.pazymiai)*0.4; z.push_back(mokinys(temp)); temp.pazymiai.clear(); } in.close(); float galBalas; int g=0; for(auto i:z) { galBalas=vidurkis(i.pazymiai); if(galBalas>=6) a.push_back(i); else b.push_back(i); } // temp.sorting(a); // temp.sorting(b); cout<<z.size()<<" - "; z.clear(); a.clear(); b.clear(); } template<typename Container> void budas2read(std::string name) { int g=0; Container z, a; std::ifstream in (name); std::string eil; mokinys temp; while(std::getline(in, eil)) { std::istringstream ss(eil); ss>>temp.vardas; ss>>temp.pavarde; int num; while(ss>>num) temp.pazymiai.push_back(num); int egzaminas=temp.pazymiai[temp.pazymiai.size()-1]; temp.pazymiai.pop_back(); temp.galmed=0.6*egzaminas+mediana(temp.pazymiai)*0.4; temp.galvid=0.6*egzaminas+vidurkis(temp.pazymiai)*0.4; z.push_back(mokinys(temp)); temp.pazymiai.clear(); } in.close(); auto it = std::partition(z.begin(), z.end(), [](const mokinys& g) { float galBalas=vidurkis(g.pazymiai); // float galBalas=g.galmed; return(galBalas>=6); }); auto e=z.end(); e--; for(e; e!=it;) { a.push_back(*e); e--; z.pop_back(); } a.push_back(*it); z.pop_back(); // temp.sorting(z); // temp.sorting(a); cout<<z.size()+a.size()<<" - "; z.clear(); a.clear(); } template<typename Container> void budas3read(Container& varg, Container& kiet, std::string name) { std::ifstream in (name); std::string eil; mokinys temp; while(std::getline(in, eil)) { std::istringstream ss(eil); ss>>temp.vardas; ss>>temp.pavarde; int num; std::vector<int> vtemp; while(ss>>num) vtemp.push_back(num); int egzaminas=vtemp[vtemp.size()-1]; vtemp.pop_back(); temp.galmed=0.6*egzaminas+mediana(vtemp)*0.4; temp.galvid=0.6*egzaminas+vidurkis(vtemp)*0.4; if(vidurkis(vtemp)>=6) kiet.push_back(mokinys(temp)); else varg.push_back(mokinys(temp)); } in.close(); //temp.sorting(varg); //temp.sorting(kiet); } template<typename Container> void budas1 (std::string name) { cout<<name<<'\n'; for(int i=1; i<=n; i++) { s(); checkfile(std::to_string(i)+"irasas.txt"); budas1read<Container>(std::to_string(i)+"irasas.txt"); e(); } } template<typename Container> void budas2(std::string name) { cout<<name<<'\n'; for(int i=1; i<=n; i++) { s(); checkfile(std::to_string(i)+"irasas.txt"); budas2read<Container>(std::to_string(i)+"irasas.txt"); e(); } } template <typename Container> void budas3(Container& varg, Container& kiet, std::string name) { cout<<name<<'\n'; for(int i=1; i<=n; i++) {s(); checkfile(std::to_string(i)+"irasas.txt"); budas3read(varg, kiet, std::to_string(i)+"irasas.txt"); cout<<varg.size()+kiet.size()<<" - "; varg.clear(); kiet.clear(); e(); } } #endif
[ "36190109+Aspectrus@users.noreply.github.com" ]
36190109+Aspectrus@users.noreply.github.com
9ac777d902f21f973999098cf7ba9f30a385c9f3
dc2e0d49f99951bc40e323fb92ea4ddd5d9644a0
/Cecily/SDK/ThirdLibrary/include/activemq-cpp/decaf/lang/Runtime.h
6fa73382ee7a8115a76565a56a2142c00ae14018
[]
no_license
wenyu826/CecilySolution
8696290d1723fdfe6e41ce63e07c7c25a9295ded
14c4ba9adbb937d0ae236040b2752e2c7337b048
refs/heads/master
2020-07-03T06:26:07.875201
2016-11-19T07:04:29
2016-11-19T07:04:29
74,192,785
0
1
null
null
null
null
UTF-8
C++
false
false
2,636
h
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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. */ #ifndef _DECAF_LANG_RUNTIME_H_ #define _DECAF_LANG_RUNTIME_H_ #include <decaf/util/Config.h> namespace decaf { namespace lang { class DECAF_API Runtime { private: Runtime(const Runtime&); Runtime& operator= (const Runtime&); protected: Runtime(); public: virtual ~Runtime(); /** * Gets the single instance of the Decaf Runtime for this Process. * * @returns pointer to the single Decaf Runtime instance that exists * for this process */ static Runtime* getRuntime(); /** * Initialize the Decaf Library passing it the args that were passed * to the application at startup. * * @param argc - The number of args passed * @param argv - Array of char* values passed to the Process on start. * * @throws runtime_error if the library is already initialized or an * error occurs during initialization. */ static void initializeRuntime(int argc, char **argv); /** * Initialize the Decaf Library * * @throws runtime_error if the library is already initialized or an * error occurs during initialization. */ static void initializeRuntime(); /** * Shutdown the Decaf Library, this call should take places after all * objects that were created from the Decaf library have been deallocated. * * @throws runtime_error if the library has not already been initialized or an * error occurs during shutdown. */ static void shutdownRuntime(); }; }} #endif /*_DECAF_LANG_RUNTIME_H_*/
[ "626955115@qq.com" ]
626955115@qq.com
bbbac3113dd9bb8f1c73ba5dbf5320d20aed3560
ece46d54db148fcd1717ae33e9c277e156067155
/SDK/arxsdk2011/samples/database/ARXDBG/TransDbClones/ArxDbgUiTdmTransDbClones.cpp
56e5a7da879ef9fa2f276d4ebdac67c5d5e9821f
[]
no_license
15831944/ObjectArx
ffb3675875681b1478930aeac596cff6f4187ffd
8c15611148264593730ff5b6213214cebd647d23
refs/heads/main
2023-06-16T07:36:01.588122
2021-07-09T10:17:27
2021-07-09T10:17:27
384,473,453
0
1
null
2021-07-09T15:08:56
2021-07-09T15:08:56
null
UTF-8
C++
false
false
4,800
cpp
// // (C) Copyright 1998-2006 by Autodesk, Inc. // // Permission to use, copy, modify, and distribute this software in // object code form for any purpose and without fee is hereby granted, // provided that the above copyright notice appears in all copies and // that both that copyright notice and the limited warranty and // restricted rights notice below appear in all supporting // documentation. // // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE // UNINTERRUPTED OR ERROR FREE. // // Use, duplication, or disclosure by the U.S. Government is subject to // restrictions set forth in FAR 52.227-19 (Commercial Computer // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) // (Rights in Technical Data and Computer Software), as applicable. // // #include "StdAfx.h" #if defined(_DEBUG) && !defined(AC_FULL_DEBUG) #error _DEBUG should not be defined except in internal Adesk debug builds #endif #include "ArxDbgUiTdmTransDbClones.h" #include "ArxDbgUiTdcCloneSet.h" #include "ArxDbgUiTdcWblockClone.h" #include "ArxDbgUiTdcInsert.h" #include "ArxDbgApp.h" #include "ArxDbgSelSet.h" #include "ArxDbgUiPrompts.h" #include "ArxDbgUtils.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif /**************************************************************************** ** ** ArxDbgUiTdmTransDbClones::ArxDbgUiTdmTransDbClones ** ** **jma ** *************************************/ ArxDbgUiTdmTransDbClones::ArxDbgUiTdmTransDbClones(CWnd* parent, const TCHAR* winTitle) : CAcUiTabMainDialog(ArxDbgUiTdmTransDbClones::IDD, parent, ArxDbgApp::getApp()->dllInstance()) { SetDialogName(_T("ArxDbg-TransDbClones")); if (winTitle != NULL) m_winTitle = winTitle; m_tdcCloneSet = new ArxDbgUiTdcCloneSet; m_tdcWblockClone = new ArxDbgUiTdcWblockClone; m_tdcInsert = new ArxDbgUiTdcInsert; //{{AFX_DATA_INIT(ArxDbgUiTdmTransDbClones) //}}AFX_DATA_INIT } /**************************************************************************** ** ** ArxDbgUiTdmTransDbClones::~ArxDbgUiTdmTransDbClones ** ** **jma ** *************************************/ ArxDbgUiTdmTransDbClones::~ArxDbgUiTdmTransDbClones() { delete m_tdcCloneSet; delete m_tdcWblockClone; delete m_tdcInsert; } /**************************************************************************** ** ** ArxDbgUiTdmTransDbClones::DoDataExchange ** ** **jma ** *************************************/ void ArxDbgUiTdmTransDbClones::DoDataExchange(CDataExchange* pDX) { CAcUiTabMainDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(ArxDbgUiTdmTransDbClones) DDX_Control(pDX, ARXDBG_TAB_1, m_tabCtrl); //}}AFX_DATA_MAP } ///////////////////////////////////////////////////////////////////////////// // ArxDbgUiTdmTransDbClones message map BEGIN_MESSAGE_MAP(ArxDbgUiTdmTransDbClones, CAcUiTabMainDialog) //{{AFX_MSG_MAP(ArxDbgUiTdmTransDbClones) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // ArxDbgUiTdmTransDbClones message handlers /**************************************************************************** ** ** ArxDbgUiTdmTransDbClones::OnInitDialog ** ** **jma ** *************************************/ BOOL ArxDbgUiTdmTransDbClones::OnInitDialog() { CAcUiTabMainDialog::OnInitDialog(); if (m_winTitle.IsEmpty() == FALSE) SetWindowText(m_winTitle); SetAcadTabPointer(&m_tabCtrl); AddTab(0, _T("Clone Set"), ArxDbgUiTdcCloneSet::IDD, m_tdcCloneSet); AddTab(1, _T("Wblock Clone"), ArxDbgUiTdcWblockClone::IDD, m_tdcWblockClone); AddTab(2, _T("Insert"), ArxDbgUiTdcInsert::IDD, m_tdcInsert); return TRUE; } /**************************************************************************** ** ** ArxDbgUiTdmTransDbClones::addToCloneSet ** ** **jma ** *************************************/ void ArxDbgUiTdmTransDbClones::addToCloneSet(ArxDbgCloneSet& cloneSet) { BeginEditorCommand(); ArxDbgSelSet ss; if (ss.userSelect() != ArxDbgSelSet::kSelected) { CompleteEditorCommand(); return; } AcDbObjectIdArray objIds; ss.asArray(objIds); cloneSet.addObjects(objIds); CompleteEditorCommand(); } /**************************************************************************** ** ** ArxDbgUiTdmTransDbClones::getBasePoint ** ** **jma ** *************************************/ void ArxDbgUiTdmTransDbClones::getBasePoint(AcGePoint3d& basePt) { BeginEditorCommand(); ArxDbgUiPrPoint prPt(_T("Base point"), NULL); if (prPt.go() == ArxDbgUiPrPoint::kOk) basePt = ArxDbgUtils::ucsToWcs(prPt.value()); CompleteEditorCommand(); }
[ "zhangsensen@zwcad.com" ]
zhangsensen@zwcad.com
710e6580a21bf0c779df8450fbe33b4d167d07ee
fb8024d329b647e8b2dbab1c477f5dfad995440e
/TestApp.cpp
d541b5be0261852d9ba3f55dbc9129f167a95a01
[]
no_license
hamdav01/MittHanoiGame
bb9e942bf1172bb2d8df46dcae6a34442edef166
32e939ae67e5382ddae9909107293b7774a0e8d3
refs/heads/master
2021-01-10T11:33:37.980527
2016-03-29T13:13:51
2016-03-29T13:13:51
54,900,892
0
0
null
null
null
null
ISO-8859-1
C++
false
false
6,942
cpp
//------------------------------------------------------------------------------ // Fil: TestApp.cpp // Author: Hampus Davidsson // Datum: 2016-02-17 //------------------------------------------------------------------------------ #include "TestApp.h" #include <iostream> #include <string> #include "Replay.h" //------------------------------------------------------------------------------ // Konstruktor //------------------------------------------------------------------------------ TestApp::TestApp(){ m_commandMgr = new CommandManager(); } //------------------------------------------------------------------------------ // Destruktor //------------------------------------------------------------------------------ TestApp::~TestApp() { delete m_commandMgr; } //------------------------------------------------------------------------------ // startMenu //------------------------------------------------------------------------------ // Uppgift: Visar upp startmenyn. // Indata : (void) // Utdata : (void) //------------------------------------------------------------------------------ void TestApp::startMenu() { int choice = 0; int maxSize = sizeof(startMenuitems) / sizeof(startMenuitems[0]); do { system("cls"); cout << " \n /**** HANOI GAME ****/\n\n 1. Start newgame\n 2. Replay\n 0. Exit " << endl; choice = getMenuOption(0, maxSize-1); doMenuChoice(startMenuitems[choice]); } while (startMenuitems[choice] != menu::EXIT); } //------------------------------------------------------------------------------ // createNewGame //------------------------------------------------------------------------------ // Uppgift: Startar upp ett nytt spel. // Indata : (void) // Utdata : (void) //------------------------------------------------------------------------------ void TestApp::createNewGame() { system("cls"); cout << endl << " Hur många discs vill du ha? "; int input = 0; cin >> input; cin.get(); m_commandMgr->doCommand(new ResetCommand(m_hannoiEngine,m_commandMgr,input)); system("cls"); } //------------------------------------------------------------------------------ // gamePlayMenu //------------------------------------------------------------------------------ // Uppgift: Visar upp gameplay menyn. // Indata : (void) // Utdata : (void) //------------------------------------------------------------------------------ void TestApp::gamePlayMenu() { int choice = 0; int maxSize = sizeof(gamePlayMenuItems) / sizeof(gamePlayMenuItems[0]); do { system("cls"); m_commandMgr->doCommand(new ShowCommand(m_hannoiEngine)); cout << endl << endl << " 1. Move\n 2. Undo\n 3. Redo\n 4. Reset\n 0. Exit " << endl; choice = getMenuOption(0, maxSize - 1); doMenuChoice(gamePlayMenuItems[choice]); } while (gamePlayMenuItems[choice] != menu::EXIT); } //------------------------------------------------------------------------------ // getMenuOption //------------------------------------------------------------------------------ // Uppgift: Tar emot användarens input om val. // Indata : (int p_iMin) - Minimum int man kan välja // (int p_iMax) - Max int man kan välja // Utdata : (int) - Valet man gjort //------------------------------------------------------------------------------ int TestApp::getMenuOption(int p_iMin, int p_iMax) { int input = 0; while (!(cin >> input) || input <p_iMin || input >p_iMax) { cin.clear(); cin.ignore(cin.rdbuf()->in_avail()); } cin.get(); return input; } //------------------------------------------------------------------------------ // startMove //------------------------------------------------------------------------------ // Uppgift: Funktion som hanterar hur man flyttar i mellan två torn i hanoi. // Indata : (void) // Utdata : (void) //------------------------------------------------------------------------------ void TestApp::startMove() { int move1 = 0; int move2 = 0; do { system("cls"); m_commandMgr->doCommand(new ShowCommand(m_hannoiEngine)); if (move1 != 0) { cout << endl << endl << " Du kan inte flytta i mellan dessa torn " << endl << endl; } move1; cout << endl << "Från vilket torn vill du flytta?(1-3 är de torn som existerar)" << endl; while (!(cin >> move1) || move1 < 1 || move1 >3) { cin.clear(); cin.ignore(cin.rdbuf()->in_avail()); } move2; cout << "Till vilket torn vill du flytta?(1-3 är de torn som existerar)" << endl; while (!(cin >> move2) || move2 < 1 || move2 > 3) { cin.clear(); cin.ignore(cin.rdbuf()->in_avail()); } } while (!m_commandMgr->doCommand(new MoveCommand(m_hannoiEngine, move1, move2))); } //------------------------------------------------------------------------------ // doMenuChoice //------------------------------------------------------------------------------ // Uppgift: Meny som agerar på användarens val. // Indata : (const menu&) - en referens till menu objekt som håller i vilket // val användern gjort. // Utdata : (void) //------------------------------------------------------------------------------ void TestApp::doMenuChoice(const menu& p_menuChoice) { switch (p_menuChoice) { case menu::EXIT: // EXIT break; case menu::NEWGAME: std::remove(REPLAYFILENAME.c_str()); // remove log file createNewGame(); gamePlayMenu(); break; case menu::REPLAY: startReplay(); break; case menu::REDO: if (m_commandMgr->canRedo()) { m_commandMgr->redo(); } break; case menu::MOVE: startMove(); break; case menu::RESET: createNewGame(); break; case menu::UNDO: if (m_commandMgr->canUndo()) { m_commandMgr->undo(); } break; } } //------------------------------------------------------------------------------ // startReplay //------------------------------------------------------------------------------ // Uppgift: Startar upp replay för hanoispelet // Indata : (void) // Utdata : (void) //------------------------------------------------------------------------------ void TestApp::startReplay() { Replay replay{m_hannoiEngine}; replay.doReplay(); cout << endl << endl << " Replay är avslutad tryck på enter för att återgå till menyn!" << endl; cin.get(); } //------------------------------------------------------------------------------ // run //------------------------------------------------------------------------------ // Uppgift: Funktion som startar igång programmet genom att visa upp menyn. // Indata : (void) // Utdata : (void) //------------------------------------------------------------------------------ void TestApp::run() { startMenu(); } //------------------------------------------------------------------------------ // main //------------------------------------------------------------------------------ // Uppgift: Main start för programmet. // Indata : (void) // Utdata : (void) //------------------------------------------------------------------------------ int main() { TestApp testApp; testApp.run(); system("pause"); }
[ "hampus.davidsson@gmail.com" ]
hampus.davidsson@gmail.com
b7adb7a410fac08b875a2df1a727191af940687d
dabebba085c243610b5dae1d3026859445ca18c8
/BlairAnderson_PROG2400_Assignment03/Source.cpp
d0d679a0faf061c2cbbc752d19c8ff153a55c896
[]
no_license
blairlanderson/Sort-Comparison
2c272ce6a81f9aa379edf5a8a11883b11a11066d
dd1c835c91fb1c3518d76754bddc34c8a79d81b0
refs/heads/master
2021-03-19T07:13:18.100382
2015-05-14T00:26:52
2015-05-14T00:26:52
35,580,019
0
0
null
null
null
null
UTF-8
C++
false
false
4,820
cpp
#include <conio.h> #include <iostream> #include <cstdlib> #include <time.h> #include <string> #include <fstream> #include "Sorts.h" using namespace std; void printArray(int a[], int size); void printArray(string a[], int size); void fillArray(); //properties const int ARRAY_SIZE = 50000; int theArray[ARRAY_SIZE]; int temp[ARRAY_SIZE]; int main() { int testArray[] = { 4, 21, 9, 2, 6, 4, 10, 8, 1, 18}; //int size = sizeof(testArray) / sizeof(testArray[0]); int size = sizeof(theArray) / sizeof(theArray[0]); //fire up the randomizer time_t seconds; time(&seconds); srand((unsigned int)seconds); //clocks for time tracking clock_t timeStart; clock_t timeStop; int difference; ////fill array with randm numbers fillArray(); //test the sort //cout << "Unsorted list: " << endl; //printArray(extArray, size); //printArray(theArray, size); //printArray(theArray, size); //BUBBLE SORT cout << "***** Bubble Sort *****" << endl; timeStart = clock(); Sorts::bubbleSort(theArray, size); //stop the timer ad calc the difference timeStop = clock(); difference = timeStop - timeStart; //display results cout << endl << "Sorted list: " << endl; cout << "It took " << (timeStop - timeStart) << " ticks to complete the sort." << endl << endl; fillArray(); //SELECTION SORT cout << "***** Selection Sort *****" << endl; timeStart = clock(); Sorts::selectionSort(theArray, size); //stop the timer ad calc the difference timeStop = clock(); difference = timeStop - timeStart; //display results cout << "Sorted list: " << endl; cout << "It took " << (timeStop - timeStart) << " ticks to complete the sort." << endl << endl; fillArray(); //INSERTION SORT cout << "***** Insertion Sort *****" << endl; timeStart = clock(); Sorts::insertionSort(theArray, size); //stop the timer ad calc the difference timeStop = clock(); difference = timeStop - timeStart; //display results cout << "Sorted list: " << endl; cout << "It took " << (timeStop - timeStart) << " ticks to complete the sort." << endl << endl; fillArray(); //SHELL SORT cout << "***** Shell Sort *****" << endl; timeStart = clock(); Sorts::shellSort(theArray, size); //stop the timer ad calc the difference timeStop = clock(); difference = timeStop - timeStart; //display results cout << "Sorted list: " << endl; cout << "It took " << (timeStop - timeStart) << " ticks to complete the sort." << endl << endl; fillArray(); //MERGE SORT cout << "***** Merge Sort *****" << endl; timeStart = clock(); Sorts::mergeSort(theArray, 0, size - 1); //stop the timer ad calc the difference timeStop = clock(); difference = timeStop - timeStart; //display results cout << "Sorted list: " << endl; cout << "It took " << (timeStop - timeStart) << " ticks to complete the sort." << endl << endl; fillArray(); //QUICK SORT cout << "***** Quick Sort *****" << endl; timeStart = clock(); Sorts::quickSort(theArray, 0, size - 1); //stop the timer ad calc the difference timeStop = clock(); difference = timeStop - timeStart; //display results cout << "Sorted list: " << endl; cout << "It took " << (timeStop - timeStart) << " ticks to complete the sort." << endl << endl; //print sorted array to file //printArray(extArray, size); //printArray(testArray, size); printArray(theArray, size); _getch(); return 0; } //PRINT ARRAY - print entire array, one element per line void printArray(int a[], int size) { fstream outFile; outFile.open("output.txt"); for (int i = 0; i < size; i++) { //cout << i+1 << ": " << a[i] << endl; outFile << i+1 << ": " << a[i] << endl; } } void printArray(string a[], int size) { for (int i = 0; i < size; i++) { cout << i + 1 << ": " << a[i] << endl; } } void fillArray() { //fill array with randm numbers for (int i = 0; i < ARRAY_SIZE; i++) { temp[i] = rand(); //cout << theArray[i] << endl; } std::copy(&temp[0], &temp[ARRAY_SIZE - 1], theArray); } ////quick sort ////divide array into high and low based on a pivot point, then recursively call //void quickSort(int a[], int left, int right) //{ // if (left < right) // { // int pivotIndex = partition(a, left, right); //Calling Procedure to Find Pivot // // quickSort(a, left, pivotIndex - 1); // Subsort left (Recursion) // quickSort(a, pivotIndex + 1, right); // Subsort right (Recursion) // } //} ////find partition point in array //int partition(int a[], int left, int right) //{ // int p = left, pivot = a[left], location; // // for (location = left + 1; location <= right; location++) // { // //compare remaining elements to pivot // if (pivot > a[location]) // { // //move pivot to final place // a[p] = a[location]; // a[location] = a[p + 1]; // a[p + 1] = pivot; // // p++; // } // } // return p; //}
[ "blair.l.anderson@gmail.com" ]
blair.l.anderson@gmail.com
969f4a294278d9224b78abbd87632cc7ecbf8477
e1c6bed59e725e9e7f28f17e88357c3424dba491
/est/speech_tools/include/EST_Wagon.h
a60d7e8f78ec376e0680c8aaa71a811a5f094cc8
[ "MIT", "LicenseRef-scancode-proprietary-license", "BSD-3-Clause", "GPL-1.0-or-later", "LicenseRef-scancode-other-permissive", "MIT-Festival" ]
permissive
shashankrnr32/WaveCLI
87a398809263a97da4c072617b3ed3e0aa396287
b2addcfb90b9dbef8ce6035e01dbf639285ec20f
refs/heads/master
2020-05-07T09:17:19.010465
2019-05-21T07:59:04
2019-05-21T07:59:04
180,370,062
1
2
MIT
2019-04-20T08:48:39
2019-04-09T13:13:02
Python
UTF-8
C++
false
false
12,067
h
/*************************************************************************/ /* */ /* Centre for Speech Technology Research */ /* University of Edinburgh, UK */ /* Copyright (c) 1996,1997 */ /* All Rights Reserved. */ /* */ /* Permission is hereby granted, free of charge, to use and distribute */ /* this software and its documentation without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of this work, and to */ /* permit persons to whom this work is furnished to do so, subject to */ /* the following conditions: */ /* 1. The code must retain the above copyright notice, this list of */ /* conditions and the following disclaimer. */ /* 2. Any modifications must be clearly marked as such. */ /* 3. Original authors' names are not deleted. */ /* 4. The authors' names are not used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK */ /* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */ /* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */ /* SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE */ /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */ /* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */ /* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */ /* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */ /* THIS SOFTWARE. */ /* */ /*************************************************************************/ /* Author : Alan W Black */ /* Date : May 1996 */ /*-----------------------------------------------------------------------*/ /* */ /* Public declarations for Wagon (CART builder) */ /* */ /*=======================================================================*/ #ifndef __WAGON_H__ #define __WAGON_H__ #include "EST_String.h" #include "EST_Val.h" #include "EST_TVector.h" #include "EST_TList.h" #include "EST_simplestats.h" /* For EST_SuffStats class */ #include "EST_Track.h" #include "siod.h" // When set to one wagon supports using multiple threads if // --omp_nthreads X is used (works for most gccs) // #define OMP_WAGON 1 #ifdef OMP_WAGON #include "omp.h" #endif #define wagon_error(WMESS) (cerr << WMESS << endl,exit(-1)) // I get floating point exceptions of Alphas when I do any comparisons // with HUGE_VAL or FLT_MAX so I'll make my own #define WGN_HUGE_VAL 1.0e20 class WVector : public EST_FVector { public: WVector(int n) : EST_FVector(n) {} int get_int_val(int n) const { return (int)a_no_check(n); } float get_flt_val(int n) const { return a_no_check(n); } void set_int_val(int n,int i) { a_check(n) = (int)i; } void set_flt_val(int n,float f) { a_check(n) = f; } }; typedef EST_TList<WVector *> WVectorList; typedef EST_TVector<WVector *> WVectorVector; /* Different types of feature */ enum wn_dtype {/* for predictees and predictors */ wndt_binary, wndt_float, wndt_class, /* for predictees only */ wndt_cluster, wndt_vector, wndt_matrix, wndt_trajectory, wndt_ols, /* for ignored features */ wndt_ignore}; class WDataSet : public WVectorList { private: int dlength; EST_IVector p_type; EST_IVector p_ignore; EST_StrVector p_name; public: void load_description(const EST_String& descfname,LISP ignores); void ignore_non_numbers(); int ftype(const int &i) const {return p_type(i);} int ignore(int i) const {return p_ignore(i); } void set_ignore(int i,int value) { p_ignore[i] = value; } const EST_String &feat_name(const int &i) const {return p_name(i);} int samples(void) const {return length();} int width(void) const {return dlength;} }; enum wn_oper {wnop_equal, wnop_binary, wnop_greaterthan, wnop_lessthan, wnop_is, wnop_in, wnop_matches}; class WQuestion { private: int feature_pos; wn_oper op; int yes; int no; EST_Val operand1; EST_IList operandl; float score; public: WQuestion() {;} WQuestion(const WQuestion &s) { feature_pos=s.feature_pos; op=s.op; yes=s.yes; no=s.no; operand1=s.operand1; operandl = s.operandl; score=s.score;} ~WQuestion() {;} WQuestion(int fp, wn_oper o,EST_Val a) { feature_pos=fp; op=o; operand1=a; } void set_fp(const int &fp) {feature_pos=fp;} void set_oper(const wn_oper &o) {op=o;} void set_operand1(const EST_Val &a) {operand1 = a;} void set_yes(const int &y) {yes=y;} void set_no(const int &n) {no=n;} int get_yes(void) const {return yes;} int get_no(void) const {return no;} const int get_fp(void) const {return feature_pos;} const wn_oper get_op(void) const {return op;} const EST_Val get_operand1(void) const {return operand1;} const EST_IList &get_operandl(void) const {return operandl;} const float get_score(void) const {return score;} void set_score(const float &f) {score=f;} const int ask(const WVector &w) const; friend ostream& operator<<(ostream& s, const WQuestion &q); }; enum wnim_type {wnim_unset, wnim_float, wnim_class, wnim_cluster, wnim_vector, wnim_matrix, wnim_ols, wnim_trajectory}; // Impurity measure for cumulating impurities from set of data class WImpurity { private: wnim_type t; EST_SuffStats a; EST_DiscreteProbDistribution p; float cluster_impurity(); float cluster_member_mean(int i); float vector_impurity(); float trajectory_impurity(); float ols_impurity(); public: EST_IList members; // Maybe there should be a cluster class EST_FList member_counts; // AUP: Implement counts for vectors EST_SuffStats **trajectory; const WVectorVector *data; // Needed for ols float score; int l,width; WImpurity() { t=wnim_unset; a.reset(); trajectory=0; l=0; width=0; data=0;} ~WImpurity(); WImpurity(const WVectorVector &ds); void copy(const WImpurity &s) { int i,j; t=s.t; a=s.a; p=s.p; members=s.members; member_counts = s.member_counts; l=s.l; width=s.width; score = s.score; data = s.data; if (s.trajectory) { trajectory = new EST_SuffStats *[l]; for (i=0; i<l; i++) { trajectory[i] = new EST_SuffStats[width]; for (j=0; j<width; j++) trajectory[i][j] = s.trajectory[i][j]; } } } WImpurity &operator = (const WImpurity &a) { copy(a); return *this; } float measure(void); double samples(void); wnim_type type(void) const { return t;} void cumulate(const float pv,double count=1.0); EST_Val value(void); EST_DiscreteProbDistribution &pd() { return p; } float cluster_distance(int i); // distance i from centre in sds int in_cluster(int i); // distance i from centre < most remote member float cluster_ranking(int i); // position in closeness to centre friend ostream& operator<<(ostream &s, WImpurity &imp); }; class WDlist { private: float p_score; WQuestion p_question; EST_String p_token; int p_freq; int p_samples; WDlist *next; public: WDlist() { next=0; } ~WDlist() { if (next != 0) delete next; } void set_score(float s) { p_score = s; } void set_question(const WQuestion &q) { p_question = q; } void set_best(const EST_String &t,int freq, int samples) { p_token = t; p_freq = freq; p_samples = samples;} float score() const {return p_score;} const EST_String &token(void) const {return p_token;} const WQuestion &question() const {return p_question;} EST_Val predict(const WVector &w); friend WDlist *add_to_dlist(WDlist *l,WDlist *a); friend ostream &operator<<(ostream &s, WDlist &d); }; class WNode { private: WVectorVector data; WQuestion question; WImpurity impurity; WNode *left; WNode *right; void print_out(ostream &s, int margin); int leaf(void) const { return ((left == 0) || (right == 0)); } int pure(void); public: WNode() { left = right = 0; } ~WNode() { if (left != 0) {delete left; left=0;} if (right != 0) {delete right; right=0;} } WVectorVector &get_data(void) { return data; } void set_subnodes(WNode *l,WNode *r) { left=l; right=r; } void set_impurity(const WImpurity &imp) {impurity=imp;} void set_question(const WQuestion &q) {question=q;} void prune(void); void held_out_prune(void); WImpurity &get_impurity(void) {return impurity;} WQuestion &get_question(void) {return question;} EST_Val predict(const WVector &w); WNode *predict_node(const WVector &d); int samples(void) const { return data.n(); } friend ostream& operator<<(ostream &s, WNode &n); }; extern Discretes wgn_discretes; extern WDataSet wgn_dataset; extern WDataSet wgn_test_dataset; extern EST_FMatrix wgn_DistMatrix; extern EST_Track wgn_VertexTrack; extern EST_Track wgn_UnitTrack; extern EST_Track wgn_VertexFeats; void wgn_load_datadescription(EST_String fname,LISP ignores); void wgn_load_dataset(WDataSet &ds,EST_String fname); WNode *wgn_build_tree(float &score); WNode *wgn_build_dlist(float &score,ostream *output); WNode *wagon_stepwise(float limit); float wgn_score_question(WQuestion &q, WVectorVector &ds); void wgn_find_split(WQuestion &q,WVectorVector &ds, WVectorVector &y,WVectorVector &n); float summary_results(WNode &tree,ostream *output); extern int wgn_min_cluster_size; extern int wgn_max_questions; extern int wgn_held_out; extern float wgn_dropout_feats; extern float wgn_dropout_samples; extern int wgn_cos; extern int wgn_prune; extern int wgn_quiet; extern int wgn_verbose; extern int wgn_predictee; extern int wgn_count_field; extern EST_String wgn_count_field_name; extern EST_String wgn_predictee_name; extern float wgn_float_range_split; extern float wgn_balance; extern EST_String wgn_opt_param; extern EST_String wgn_vertex_output; #define wgn_ques_feature(X) (get_c_string(car(X))) #define wgn_ques_oper_str(X) (get_c_string(car(cdr(X)))) #define wgn_ques_operand(X) (car(cdr(cdr(X)))) int wagon_ask_question(LISP question, LISP value); int stepwise_ols(const EST_FMatrix &X, const EST_FMatrix &Y, const EST_StrList &feat_names, float limit, EST_FMatrix &coeffs, const EST_FMatrix &Xtest, const EST_FMatrix &Ytest, EST_IVector &included, float &best_score); int robust_ols(const EST_FMatrix &X, const EST_FMatrix &Y, EST_IVector &included, EST_FMatrix &coeffs); int ols_apply(const EST_FMatrix &samples, const EST_FMatrix &coeffs, EST_FMatrix &res); int ols_test(const EST_FMatrix &real, const EST_FMatrix &predicted, float &correlation, float &rmse); #endif /* __WAGON_H__ */
[ "shashankrnr32@gmail.com" ]
shashankrnr32@gmail.com
126e1fac7bd7bd1560da1f16219114ef0c030bc8
1c9d2c8488dd76250e39e6875429edbbf24de784
/groups/bsl/bslmf/bslmf_voidtype.t.cpp
b47ad71d866dbb4a69975da096973ad695d87851
[ "Apache-2.0" ]
permissive
villevoutilainen/bde
9cc68889c1fac9beca068c9ca732c36fd81b33e9
b0f71ac6e3187ce752d2e8906c4562e3ec48b398
refs/heads/master
2020-05-15T03:43:36.725050
2019-10-03T12:28:54
2019-10-03T12:28:54
182,071,409
1
1
Apache-2.0
2019-10-03T12:28:55
2019-04-18T10:59:27
C++
UTF-8
C++
false
false
11,227
cpp
// bslmf_voidtype.t.cpp -*-C++-*- #include <bslmf_voidtype.h> #include <bslmf_issame.h> #include <bsls_bsltestutil.h> #include <stdio.h> // 'printf' #include <stdlib.h> // 'atoi' using namespace BloombergLP; //============================================================================= // TEST PLAN //----------------------------------------------------------------------------- // The metafunction defined in this component does no actual calculation; it // simply provides a 'void' type member. Testing it is trivial: simply // instantiate it with 0 to 14 parameters and verify that it compiles. The // usefulness of this component is demonstrated in the usage examples. //----------------------------------------------------------------------------- // [1] FULL TEST // [2] USAGE EXAMPLE //----------------------------------------------------------------------------- // ============================================================================ // STANDARD BSL ASSERT TEST FUNCTION // ---------------------------------------------------------------------------- namespace { int testStatus = 0; void aSsErT(bool condition, const char *message, int line) { if (condition) { printf("Error " __FILE__ "(%d): %s (failed)\n", line, message); if (0 <= testStatus && testStatus <= 100) { ++testStatus; } } } } // close unnamed namespace // ============================================================================ // STANDARD BSL TEST DRIVER MACRO ABBREVIATIONS // ---------------------------------------------------------------------------- #define ASSERT BSLS_BSLTESTUTIL_ASSERT #define ASSERTV BSLS_BSLTESTUTIL_ASSERTV #define LOOP_ASSERT BSLS_BSLTESTUTIL_LOOP_ASSERT #define LOOP0_ASSERT BSLS_BSLTESTUTIL_LOOP0_ASSERT #define LOOP1_ASSERT BSLS_BSLTESTUTIL_LOOP1_ASSERT #define LOOP2_ASSERT BSLS_BSLTESTUTIL_LOOP2_ASSERT #define LOOP3_ASSERT BSLS_BSLTESTUTIL_LOOP3_ASSERT #define LOOP4_ASSERT BSLS_BSLTESTUTIL_LOOP4_ASSERT #define LOOP5_ASSERT BSLS_BSLTESTUTIL_LOOP5_ASSERT #define LOOP6_ASSERT BSLS_BSLTESTUTIL_LOOP6_ASSERT #define Q BSLS_BSLTESTUTIL_Q // Quote identifier literally. #define P BSLS_BSLTESTUTIL_P // Print identifier and value. #define P_ BSLS_BSLTESTUTIL_P_ // P(X) without '\n'. #define T_ BSLS_BSLTESTUTIL_T_ // Print a tab (w/o newline). #define L_ BSLS_BSLTESTUTIL_L_ // current Line number //============================================================================= // GLOBAL TYPEDEFS/CONSTANTS FOR TESTING //----------------------------------------------------------------------------- struct MyStruct { int d_x; }; enum MyEnum { E0, E1 }; //============================================================================= // USAGE EXAMPLES //----------------------------------------------------------------------------- ///Usage Example 1 ///- - - - - - - - // In this example, we demonstrate the use of 'VoidType' to determine whether a // given type 'T' has a member type 'T::iterator'. Our goal is to create a // metafunction, 'HasIteratorType', such that 'HasIteratorType<T>::VALUE' is // 'true' if 'T::iterator' is a valid type and 'false' otherwise. This example // is adapted from the paper proposing 'std::void_t' for the C++ Standard, // N3911. // // First, we define the base-case metafunction that returns 'false': //.. template <class TYPE, class = void> struct HasIteratorType { enum { VALUE = false }; }; //.. // Now we create a partial specialization that uses 'VoidType' to probe for // 'T::iterator'. //.. template <class TYPE> struct HasIteratorType< TYPE, typename bslmf::VoidType<typename TYPE::iterator>::type> { enum { VALUE = true }; }; //.. // To see how this works, we define a class that has a 'iterator' member and // apply 'HasIteratorType' to it: //.. struct WithIterator { typedef short *iterator; }; int usageExample1() { ASSERT(true == HasIteratorType<WithIterator>::VALUE); //.. // Since 'WithIterator::iterator' is a valid type, // 'VoidType<WithIterator::iterator>::type' will be 'void' and the second // 'HasIteratorType' template will be more specialized than the primary // template and will thus get instantiated, yielding a 'VALUE' of 'true'. // // Conversely, if we try to instantiate 'HasIteratorType<int>', any use of // 'VoidType<int::iterator>::type' will result in a substitution failure. // Fortunately, the Substitution Failure Is Not An Error (SFINAE) rule applies, // so the code will compile, but the specialization is eliminated from // consideration, resulting in the primary template being instantiated and // yielding a 'VALUE' of 'false': //.. ASSERT(false == HasIteratorType<int>::VALUE); return 0; } //.. // ///Usage Example 2 ///- - - - - - - - // This example demonstrates the use of 'VoidType' to probe for more than one // type at once. As in the previous example, we are defining a metafunction. // We'll define 'IsTraversable<T>::VALUE' to be 'true' if 'T::iterator' and // 'T::value_type' both exist. As before, we start with a primary template // that always yields 'false': //.. template <class TYPE, class = void> struct IsTraversable { enum { VALUE = false }; }; //.. // This time, we create a partial specialization that uses 'VoidType' with two // parameters: //.. template <class TYPE> struct IsTraversable<TYPE, typename bslmf::VoidType<typename TYPE::iterator, typename TYPE::value_type >::type> { enum { VALUE = true }; }; //.. // Next, we define a type that meets the requirement for being traversable: //.. struct MyTraversable { typedef int value_type; typedef int *iterator; }; //.. // The 'IsTraversable' metafunction yields 'true' for 'Traversable' but not for // either 'WithIterator', which lacks 'value_type', or 'int', which lacks both // 'iterator' and 'value_type': //.. int usageExample2() { ASSERT(true == IsTraversable<MyTraversable>::VALUE); ASSERT(false == IsTraversable<WithIterator>::VALUE); ASSERT(false == IsTraversable<int>::VALUE); return 0; } //.. //============================================================================= // MAIN PROGRAM //----------------------------------------------------------------------------- int main(int argc, char *argv[]) { int test = argc > 1 ? atoi(argv[1]) : 0; int verbose = argc > 2; printf("TEST " __FILE__ " CASE %d\n", test); switch (test) { case 0: // Zero is always the leading case. case 2: { // -------------------------------------------------------------------- // USAGE EXAMPLE // // Concerns: //: 1 The usage example provided in the component header file compiles, //: links, and runs as shown. // // Plan: //: 1 Incorporate usage example from header into test driver, remove //: leading comment characters, and replace 'assert' with 'ASSERT'. //: (C-1) // // Testing: // USAGE EXAMPLE // -------------------------------------------------------------------- if (verbose) printf("\nUSAGE EXAMPLE" "\n=============\n"); usageExample1(); usageExample2(); } break; case 1: { // -------------------------------------------------------------------- // FULL TEST // // Concerns: //: 1 'bslmf::VoidType<T1, T2... TN>::type' is 'void' for N from 0 to //: 14. //: //: 2 The types used to instantiate 'bslmf::VoidType' can be any mix of //: fundamental types, pointers, enumerations, classes, references, //: or 'void'. // // Plan: //: 1 For concern 1, instantiate 'bslmf::VoidType<T1, T2... TN>::type' //: with 0 to 14 parameters and verify that the result is type //: 'void'. (C-1) //: //: 2 For concern 2, ensure that P-1 has a healthy mix of parameter //: types. (C-2) // // Testing: // FULL TEST // -------------------------------------------------------------------- if (verbose) printf("\nFULL TEST" "\n=========\n"); #define TEST(...) \ ASSERT((bsl::is_same<void, bslmf::VoidType<__VA_ARGS__>::type>::value)) TEST(); TEST(int); TEST(int,short*); TEST(int,short*,MyEnum); TEST(int,short*,MyEnum,MyStruct); TEST(int,short*,MyEnum,MyStruct,MyEnum&); TEST(int,short*,MyEnum,MyStruct,MyEnum&,MyStruct const&); TEST(int,short*,MyEnum,MyStruct,MyEnum&,MyStruct const&,void); TEST(int,short*,MyEnum,MyStruct,MyEnum&,MyStruct const&,void, const void); TEST(int,short*,MyEnum,MyStruct,MyEnum&,MyStruct const&,void, const void,volatile int); TEST(int,short*,MyEnum,MyStruct,MyEnum&,MyStruct const&,void, const void,volatile int,volatile char *const); TEST(int,short*,MyEnum,MyStruct,MyEnum&,MyStruct const&,void, const void,volatile int,volatile char *const,double); TEST(int,short*,MyEnum,MyStruct,MyEnum&,MyStruct const&,void, const void,volatile int,volatile char *const,double, unsigned); TEST(int,short*,MyEnum,MyStruct,MyEnum&,MyStruct const&,void, const void,volatile int,volatile char *const,double, unsigned,MyEnum *const*); TEST(int,short*,MyEnum,MyStruct,MyEnum&,MyStruct const&,void, const void,volatile int,volatile char *const,double, unsigned(&)(),MyEnum *const*,int MyStruct::*); #undef TEST } break; default: { fprintf(stderr, "WARNING: CASE `%d' NOT FOUND.\n", test); testStatus = -1; } } if (testStatus > 0) { fprintf(stderr, "Error, non-zero test status = %d.\n", testStatus); } return testStatus; } // ---------------------------------------------------------------------------- // Copyright 2016 Bloomberg Finance L.P. // // 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. // ----------------------------- END-OF-FILE ----------------------------------
[ "abeels@bloomberg.net" ]
abeels@bloomberg.net
3b3b080617e956573c26d8d61d6e0af8f55b6285
e27a5513fc4b8d8de1992c743c05b2a0e889e042
/c/sample/pagerank.cpp
8d87656dac09819cd605221029656e08fc2538a4
[]
no_license
stevealbertwong/Psets
cf8a453a7bd2540b0dcd1d00892499c3926a2cd3
1a8017e2d6620e091be4101cd22e0b6ca3704a8a
refs/heads/master
2021-01-23T21:30:56.186204
2017-05-21T20:33:34
2017-05-21T20:33:34
59,343,821
0
0
null
null
null
null
UTF-8
C++
false
false
5,171
cpp
/* Copyright (c) 2010-2011, Panos Louridas, GRNET S.A. 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 GRNET S.A, 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. */ /* Expected graph input format steven=>karen@@0.39 */ #include <iostream> #include <vector> #include <cstring> #include <cstdlib> using namespace std; #include "table.h" const char *TRACE_ARG = "-t"; const char *NUMERIC_ARG = "-n"; const char *ALPHA_ARG = "-a"; const char *CONVERGENCE_ARG = "-c"; const char *SIZE_ARG = "-s"; const char *DELIM_ARG = "-d"; const char *ITER_ARG = "-m"; void usage() { cerr << "pagerank [-tn] [-a alpha ] [-s size] [-d delim] " << "[-m max_iterations] <graph_file>" << endl << " -t enable tracing " << endl << " -n treat graph file as numeric; i.e. input comprises " << "integer vertex names" << endl << " -a alpha" << endl << " the dumping factor " << endl << " -c convergence" << endl << " the convergence criterion " << endl << " -s size" << endl << " hint for internal tables " << endl << " -d delim" << endl << " delimiter for separating vertex names in each input" << "line " << endl << " -m max_iterations" << endl << " maximum number of iterations to perform" << endl; } int check_inc(int i, int max) { if (i == max) { usage(); exit(1); } return i + 1; } int main(int argc, char **argv) { Table t; char *endptr; string input = "stdin"; int i = 1; while (i < argc) { if (!strcmp(argv[i], TRACE_ARG)) { t.set_trace(true); } else if (!strcmp(argv[i], NUMERIC_ARG)) { t.set_numeric(true); } else if (!strcmp(argv[i], ALPHA_ARG)) { i = check_inc(i, argc); double alpha = strtod(argv[i], &endptr); if ((alpha == 0 || alpha > 1) && endptr) { cerr << "Invalid alpha argument" << endl; exit(1); } t.set_alpha(alpha); } else if (!strcmp(argv[i], CONVERGENCE_ARG)) { i = check_inc(i, argc); double convergence = strtod(argv[i], &endptr); if (convergence == 0 && endptr) { cerr << "Invalid convergence argument" << endl; exit(1); } t.set_convergence(convergence); } else if (!strcmp(argv[i], SIZE_ARG)) { i = check_inc(i, argc); size_t size = strtol(argv[i], &endptr, 10); if (size == 0 && endptr) { cerr << "Invalid size argument" << endl; exit(1); } t.set_num_rows(size); } else if (!strcmp(argv[i], ITER_ARG)) { i = check_inc(i, argc); size_t iterations = strtol(argv[i], &endptr, 10); if (iterations == 0 && endptr) { cerr << "Invalid iterations argument" << endl; exit(1); } t.set_max_iterations(iterations); // if -d flag is set } else if (!strcmp(argv[i], DELIM_ARG)) { i = check_inc(i, argc); t.set_delim(argv[i]); } else if (i == argc-1) { input = argv[i]; } else { usage(); exit(1); } i++; } t.print_params(cerr); cerr << "Reading input from " << input << "..." << endl; if (!strcmp(input.c_str(), "stdin")) { t.read_file(""); } else { t.read_file(input); // READING INPUT } cerr << "Calculating pagerank..." << endl; t.pagerank(); cerr << "Done calculating!" << endl; t.print_pagerank_v(); }
[ "wongkwunkit@gmail.com" ]
wongkwunkit@gmail.com
86054ee964aa32da7e3f70ad09e0d06f236be434
094e599d1f7f6bd31ba1985a84d7f267d9f47c27
/ImageClassifier/tensors/layer14_variance.hpp
26365b1890024d075be4790ec90e2c7164bf1961
[]
no_license
fynv/RawNN
8f02ca15a7064b5a0fad5c491a47b7ed62819df0
51949c85e2365020eca33f9cb281bb431794f126
refs/heads/main
2023-01-06T06:36:31.606640
2020-11-09T02:53:58
2020-11-09T02:53:58
309,553,012
1
0
null
null
null
null
UTF-8
C++
false
false
1,510
hpp
const static size_t layer14_variance_size = 512; static unsigned layer14_variance[]={ 0x4001af6d,0x4020ea04,0x3fbdaae3,0x3ffc6c95,0x3fde9e57,0x40435e16,0x400aafb6,0x3fe247ab,0x406a230e,0x3fc803f5, 0x3fc86e9e,0x40367551,0x3ff2f726,0x4003121d,0x3fb59978,0x3fa5a8cf,0x3fea8f72,0x40071c0b,0x40395384,0x4010096d, 0x4009f488,0x40202ca5,0x4024c950,0x40440b6f,0x3f826d41,0x3fc10197,0x40057d3a,0x3ff7e025,0x404911f4,0x403f49fa, 0x407435c3,0x40530e0d,0x40006b5c,0x406e77f9,0x4025bccd,0x3ff00008,0x400476d6,0x3fe07b91,0x3ff6c98b,0x402e31d2, 0x3fe46acc,0x402ce035,0x401e2272,0x4004d8bb,0x3fedefc0,0x40219ed4,0x3ffcc441,0x400c14bd,0x402d6403,0x402ca47d, 0x4034176f,0x40561c70,0x3fcfdffa,0x4008acee,0x405c1c7a,0x401b02db,0x3ffadc2e,0x402f1211,0x4049cec8,0x4016eda0, 0x400909a6,0x400afcfe,0x4034bf32,0x400be001,0x3fe4d817,0x3ffad164,0x3fe1e605,0x40447c6a,0x40142db9,0x3fe36cb2, 0x4027479b,0x40122b31,0x3ff37191,0x4085f034,0x4017c805,0x40170377,0x401da2b9,0x3ff4cd8d,0x40042977,0x4004fb54, 0x40070db4,0x400223a8,0x400e4d24,0x402324b5,0x403d0f0e,0x4047de5e,0x40132bf7,0x4009dd51,0x401b2c65,0x405060a0, 0x3fd4dd60,0x3fa89de8,0x40998288,0x3fb3c8be,0x4045e56c,0x3ffbdc5c,0x3ff46dd2,0x40477b0e,0x401eaed0,0x4056fc43, 0x3feea3d4,0x4029ebef,0x40084850,0x400c4c0b,0x401909ad,0x400f8957,0x40012904,0x40236c33,0x3feffb32,0x40086e6b, 0x404966f7,0x40411d83,0x4038bc8f,0x4015d8c1,0x3fd6b1a8,0x40473205,0x406c23e0,0x402de15a,0x40667425,0x404af325, 0x40274744,0x3ff70ec5,0x3fb0c508,0x403961f7,0x40381175,0x4034f58f,0x401385b4,0x40173c3e,};
[ "feiy@nvidia.com" ]
feiy@nvidia.com
ae6549e285856b3a4ac38b5cfdf7c1936af7d7ed
451ff5a40071578341ca195908276992bd5396fa
/UVa/10227.cpp
dae7d175992d01df2fb1cf44209bdd96b76aab6a
[]
no_license
Tanjim131/Problem-Solving
ba31d31601798ba585a3f284bb169d67794af6c0
6dc9c0023058655ead7da7da08eed11bf48a0dfa
refs/heads/master
2023-05-02T06:38:34.014689
2021-05-14T18:26:15
2021-05-14T18:26:15
267,421,671
5
0
null
null
null
null
UTF-8
C++
false
false
1,274
cpp
#include <iostream> #include <cstdio> #include <cmath> #include <vector> #include <queue> #include <stack> #include <cstring> #include <algorithm> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <sstream> using namespace std; #define LL long long #define pb push_back #define mp make_pair #define pii pair < int , int > #define infile freopen("in.txt","r",stdin) #define outfile freopen("out.txt","w",stdout) //int dx[]={1,0,-1,0}; //int dy[]={0,1,0,-1}; //4 Direction //int dx[]={1,1,0,-1,-1,-1,0,1}; //int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction set < int > s[105]; int main(){ //infile; //outfile; int T; bool f = false; scanf("%d",&T); int p,t; getchar(); while(T--){ scanf("%d %d",&p,&t); for(int i = 0 ; i < 105 ; i++) s[i].clear(); string input; int a,b; getchar(); while(getline(cin,input) && input != ""){ stringstream ss(input); ss >> a >> b; s[a].insert(b); //cout << a << " " << b << endl; } set < set < int > > qq; for(int i = 1 ; i <= p ; i++){ qq.insert(s[i]); } printf("%d\n",qq.size()); if(T) printf("\n"); } return 0; }
[ "1505082.tbf@ugrad.cse.buet.ac.bd" ]
1505082.tbf@ugrad.cse.buet.ac.bd
459a4b388d419049e36474700e44ab2335e9168c
fbc094f92c6137c7341f7e37d104b2020022b3fb
/AdoAssist/AdoAssistDll/json/lib_json/json_value.cpp
9cff07e00a2821891cbaeba01e202aec541787d6
[]
no_license
adintr/AdoAssist
b4c3c05355fe096122aa79cd64a2606b2a56268c
b2916a878532d163129f60e3c24bd1f64571d410
refs/heads/master
2020-12-25T18:43:49.380301
2017-06-11T07:38:04
2017-06-11T07:38:04
93,988,944
1
3
null
null
null
null
UTF-8
C++
false
false
39,065
cpp
#include "stdafx.h" #include <iostream> #include <json/value.h> #include <json/writer.h> #include <utility> #include <stdexcept> #include <cstring> #include <cassert> #ifdef JSON_USE_CPPTL # include <cpptl/conststring.h> #endif #include <cstddef> // size_t #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR # include "json_batchallocator.h" #endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR #define JSON_ASSERT_UNREACHABLE assert( false ) #define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw #define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message ); namespace Json { const Value Value::null; const Int Value::minInt = Int( ~(UInt(-1)/2) ); const Int Value::maxInt = Int( UInt(-1)/2 ); const UInt Value::maxUInt = UInt(-1); // A "safe" implementation of strdup. Allow null pointer to be passed. // Also avoid warning on msvc80. // //inline char *safeStringDup( const char *czstring ) //{ // if ( czstring ) // { // const size_t length = (unsigned int)( strlen(czstring) + 1 ); // char *newString = static_cast<char *>( malloc( length ) ); // memcpy( newString, czstring, length ); // return newString; // } // return 0; //} // //inline char *safeStringDup( const std::string &str ) //{ // if ( !str.empty() ) // { // const size_t length = str.length(); // char *newString = static_cast<char *>( malloc( length + 1 ) ); // memcpy( newString, str.c_str(), length ); // newString[length] = 0; // return newString; // } // return 0; //} ValueAllocator::~ValueAllocator() { } class DefaultValueAllocator : public ValueAllocator { public: virtual ~DefaultValueAllocator() { } virtual char *makeMemberName( const char *memberName ) { return duplicateStringValue( memberName ); } virtual void releaseMemberName( char *memberName ) { releaseStringValue( memberName ); } virtual char *duplicateStringValue( const char *value, unsigned int length = unknown ) { //@todo invesgate this old optimization //if ( !value || value[0] == 0 ) // return 0; if ( length == unknown ) length = (unsigned int)strlen(value); char *newString = static_cast<char *>( malloc( length + 1 ) ); memcpy( newString, value, length ); newString[length] = 0; return newString; } virtual void releaseStringValue( char *value ) { if ( value ) free( value ); } }; static ValueAllocator *&valueAllocator() { static DefaultValueAllocator defaultAllocator; static ValueAllocator *valueAllocator = &defaultAllocator; return valueAllocator; } static struct DummyValueAllocatorInitializer { DummyValueAllocatorInitializer() { valueAllocator(); // ensure valueAllocator() statics are initialized before main(). } } dummyValueAllocatorInitializer; // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ValueInternals... // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// #ifdef JSON_VALUE_USE_INTERNAL_MAP # include "json_internalarray.inl" # include "json_internalmap.inl" #endif // JSON_VALUE_USE_INTERNAL_MAP # include "json_valueiterator.inl" // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class Value::CommentInfo // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// Value::CommentInfo::CommentInfo() : comment_( 0 ) { } Value::CommentInfo::~CommentInfo() { if ( comment_ ) valueAllocator()->releaseStringValue( comment_ ); } void Value::CommentInfo::setComment( const char *text ) { if ( comment_ ) valueAllocator()->releaseStringValue( comment_ ); JSON_ASSERT( text ); JSON_ASSERT_MESSAGE( text[0]=='\0' || text[0]=='/', "Comments must start with /"); // It seems that /**/ style comments are acceptable as well. comment_ = valueAllocator()->duplicateStringValue( text ); } // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class Value::CZString // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// # ifndef JSON_VALUE_USE_INTERNAL_MAP // Notes: index_ indicates if the string was allocated when // a string is stored. Value::CZString::CZString( int index ) : cstr_( 0 ) , index_( index ) { } Value::CZString::CZString( const char *cstr, DuplicationPolicy allocate ) : cstr_( allocate == duplicate ? valueAllocator()->makeMemberName(cstr) : cstr ) , index_( allocate ) { } Value::CZString::CZString( const CZString &other ) : cstr_( other.index_ != noDuplication && other.cstr_ != 0 ? valueAllocator()->makeMemberName( other.cstr_ ) : other.cstr_ ) , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate) : other.index_ ) { } Value::CZString::~CZString() { if ( cstr_ && index_ == duplicate ) valueAllocator()->releaseMemberName( const_cast<char *>( cstr_ ) ); } void Value::CZString::swap( CZString &other ) { std::swap( cstr_, other.cstr_ ); std::swap( index_, other.index_ ); } Value::CZString & Value::CZString::operator =( const CZString &other ) { CZString temp( other ); swap( temp ); return *this; } bool Value::CZString::operator<( const CZString &other ) const { if ( cstr_ ) return strcmp( cstr_, other.cstr_ ) < 0; return index_ < other.index_; } bool Value::CZString::operator==( const CZString &other ) const { if ( cstr_ ) return strcmp( cstr_, other.cstr_ ) == 0; return index_ == other.index_; } int Value::CZString::index() const { return index_; } const char * Value::CZString::c_str() const { return cstr_; } bool Value::CZString::isStaticString() const { return index_ == noDuplication; } #endif // ifndef JSON_VALUE_USE_INTERNAL_MAP // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class Value::Value // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// /*! \internal Default constructor initialization must be equivalent to: * memset( this, 0, sizeof(Value) ) * This optimization is used in ValueInternalMap fast allocator. */ Value::Value( ValueType type ) : type_( type ) , allocated_( 0 ) , comments_( 0 ) # ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_( 0 ) #endif { switch ( type ) { case nullValue: break; case intValue: case uintValue: value_.int_ = 0; break; case realValue: value_.real_ = 0.0; break; case stringValue: value_.string_ = 0; break; #ifndef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: case objectValue: value_.map_ = new ObjectValues(); break; #else case arrayValue: value_.array_ = arrayAllocator()->newArray(); break; case objectValue: value_.map_ = mapAllocator()->newMap(); break; #endif case booleanValue: value_.bool_ = false; break; default: JSON_ASSERT_UNREACHABLE; } } Value::Value( Int value ) : type_( intValue ) , comments_( 0 ) # ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_( 0 ) #endif { value_.int_ = value; } Value::Value( UInt value ) : type_( uintValue ) , comments_( 0 ) # ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_( 0 ) #endif { value_.uint_ = value; } Value::Value( double value ) : type_( realValue ) , comments_( 0 ) # ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_( 0 ) #endif { value_.real_ = value; } Value::Value( const char *value ) : type_( stringValue ) , allocated_( true ) , comments_( 0 ) # ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_( 0 ) #endif { value_.string_ = valueAllocator()->duplicateStringValue( value ); } Value::Value( const char *beginValue, const char *endValue ) : type_( stringValue ) , allocated_( true ) , comments_( 0 ) # ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_( 0 ) #endif { value_.string_ = valueAllocator()->duplicateStringValue( beginValue, UInt(endValue - beginValue) ); } Value::Value( const std::string &value ) : type_( stringValue ) , allocated_( true ) , comments_( 0 ) # ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_( 0 ) #endif { value_.string_ = valueAllocator()->duplicateStringValue( value.c_str(), (unsigned int)value.length() ); } Value::Value( const StaticString &value ) : type_( stringValue ) , allocated_( false ) , comments_( 0 ) # ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_( 0 ) #endif { value_.string_ = const_cast<char *>( value.c_str() ); } # ifdef JSON_USE_CPPTL Value::Value( const CppTL::ConstString &value ) : type_( stringValue ) , allocated_( true ) , comments_( 0 ) # ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_( 0 ) #endif { value_.string_ = valueAllocator()->duplicateStringValue( value, value.length() ); } # endif Value::Value( bool value ) : type_( booleanValue ) , comments_( 0 ) # ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_( 0 ) #endif { value_.bool_ = value; } Value::Value( const Value &other ) : type_( other.type_ ) , comments_( 0 ) # ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_( 0 ) #endif { switch ( type_ ) { case nullValue: case intValue: case uintValue: case realValue: case booleanValue: value_ = other.value_; break; case stringValue: if ( other.value_.string_ ) { value_.string_ = valueAllocator()->duplicateStringValue( other.value_.string_ ); allocated_ = true; } else value_.string_ = 0; break; #ifndef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: case objectValue: value_.map_ = new ObjectValues( *other.value_.map_ ); break; #else case arrayValue: value_.array_ = arrayAllocator()->newArrayCopy( *other.value_.array_ ); break; case objectValue: value_.map_ = mapAllocator()->newMapCopy( *other.value_.map_ ); break; #endif default: JSON_ASSERT_UNREACHABLE; } if ( other.comments_ ) { comments_ = new CommentInfo[numberOfCommentPlacement]; for ( int comment =0; comment < numberOfCommentPlacement; ++comment ) { const CommentInfo &otherComment = other.comments_[comment]; if ( otherComment.comment_ ) comments_[comment].setComment( otherComment.comment_ ); } } } Value::~Value() { switch ( type_ ) { case nullValue: case intValue: case uintValue: case realValue: case booleanValue: break; case stringValue: if ( allocated_ ) valueAllocator()->releaseStringValue( value_.string_ ); break; #ifndef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: case objectValue: delete value_.map_; break; #else case arrayValue: arrayAllocator()->destructArray( value_.array_ ); break; case objectValue: mapAllocator()->destructMap( value_.map_ ); break; #endif default: JSON_ASSERT_UNREACHABLE; } if ( comments_ ) delete[] comments_; } Value & Value::operator=( const Value &other ) { Value temp( other ); swap( temp ); return *this; } void Value::swap( Value &other ) { ValueType temp = type_; type_ = other.type_; other.type_ = temp; std::swap( value_, other.value_ ); int temp2 = allocated_; allocated_ = other.allocated_; other.allocated_ = temp2; } ValueType Value::type() const { return type_; } int Value::compare( const Value &other ) { /* int typeDelta = other.type_ - type_; switch ( type_ ) { case nullValue: return other.type_ == type_; case intValue: if ( other.type_.isNumeric() case uintValue: case realValue: case booleanValue: break; case stringValue, break; case arrayValue: delete value_.array_; break; case objectValue: delete value_.map_; default: JSON_ASSERT_UNREACHABLE; } */ return 0; // unreachable } bool Value::operator <( const Value &other ) const { int typeDelta = type_ - other.type_; if ( typeDelta ) return typeDelta < 0 ? true : false; switch ( type_ ) { case nullValue: return false; case intValue: return value_.int_ < other.value_.int_; case uintValue: return value_.uint_ < other.value_.uint_; case realValue: return value_.real_ < other.value_.real_; case booleanValue: return value_.bool_ < other.value_.bool_; case stringValue: return ( value_.string_ == 0 && other.value_.string_ ) || ( other.value_.string_ && value_.string_ && strcmp( value_.string_, other.value_.string_ ) < 0 ); #ifndef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: case objectValue: { int delta = int( value_.map_->size() - other.value_.map_->size() ); if ( delta ) return delta < 0; return (*value_.map_) < (*other.value_.map_); } #else case arrayValue: return value_.array_->compare( *(other.value_.array_) ) < 0; case objectValue: return value_.map_->compare( *(other.value_.map_) ) < 0; #endif default: JSON_ASSERT_UNREACHABLE; } return 0; // unreachable } bool Value::operator <=( const Value &other ) const { return !(other > *this); } bool Value::operator >=( const Value &other ) const { return !(*this < other); } bool Value::operator >( const Value &other ) const { return other < *this; } bool Value::operator ==( const Value &other ) const { //if ( type_ != other.type_ ) // GCC 2.95.3 says: // attempt to take address of bit-field structure member `Json::Value::type_' // Beats me, but a temp solves the problem. int temp = other.type_; if ( type_ != temp ) return false; switch ( type_ ) { case nullValue: return true; case intValue: return value_.int_ == other.value_.int_; case uintValue: return value_.uint_ == other.value_.uint_; case realValue: return value_.real_ == other.value_.real_; case booleanValue: return value_.bool_ == other.value_.bool_; case stringValue: return ( value_.string_ == other.value_.string_ ) || ( other.value_.string_ && value_.string_ && strcmp( value_.string_, other.value_.string_ ) == 0 ); #ifndef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: case objectValue: return value_.map_->size() == other.value_.map_->size() && (*value_.map_) == (*other.value_.map_); #else case arrayValue: return value_.array_->compare( *(other.value_.array_) ) == 0; case objectValue: return value_.map_->compare( *(other.value_.map_) ) == 0; #endif default: JSON_ASSERT_UNREACHABLE; } return 0; // unreachable } bool Value::operator !=( const Value &other ) const { return !( *this == other ); } const char * Value::asCString() const { JSON_ASSERT( type_ == stringValue ); return value_.string_; } std::string Value::asString() const { switch ( type_ ) { case nullValue: return ""; case stringValue: return value_.string_ ? value_.string_ : ""; case booleanValue: return value_.bool_ ? "true" : "false"; case intValue: case uintValue: case realValue: case arrayValue: case objectValue: JSON_ASSERT_MESSAGE( false, "Type is not convertible to string" ); default: JSON_ASSERT_UNREACHABLE; } return ""; // unreachable } # ifdef JSON_USE_CPPTL CppTL::ConstString Value::asConstString() const { return CppTL::ConstString( asString().c_str() ); } # endif Value::Int Value::asInt() const { switch ( type_ ) { case nullValue: return 0; case intValue: return value_.int_; case uintValue: JSON_ASSERT_MESSAGE( value_.uint_ < (unsigned)maxInt, "integer out of signed integer range" ); return value_.uint_; case realValue: JSON_ASSERT_MESSAGE( value_.real_ >= minInt && value_.real_ <= maxInt, "Real out of signed integer range" ); return Int( value_.real_ ); case booleanValue: return value_.bool_ ? 1 : 0; case stringValue: case arrayValue: case objectValue: JSON_ASSERT_MESSAGE( false, "Type is not convertible to int" ); default: JSON_ASSERT_UNREACHABLE; } return 0; // unreachable; } Value::UInt Value::asUInt() const { switch ( type_ ) { case nullValue: return 0; case intValue: JSON_ASSERT_MESSAGE( value_.int_ >= 0, "Negative integer can not be converted to unsigned integer" ); return value_.int_; case uintValue: return value_.uint_; case realValue: JSON_ASSERT_MESSAGE( value_.real_ >= 0 && value_.real_ <= maxUInt, "Real out of unsigned integer range" ); return UInt( value_.real_ ); case booleanValue: return value_.bool_ ? 1 : 0; case stringValue: case arrayValue: case objectValue: JSON_ASSERT_MESSAGE( false, "Type is not convertible to uint" ); default: JSON_ASSERT_UNREACHABLE; } return 0; // unreachable; } double Value::asDouble() const { switch ( type_ ) { case nullValue: return 0.0; case intValue: return value_.int_; case uintValue: return value_.uint_; case realValue: return value_.real_; case booleanValue: return value_.bool_ ? 1.0 : 0.0; case stringValue: case arrayValue: case objectValue: JSON_ASSERT_MESSAGE( false, "Type is not convertible to double" ); default: JSON_ASSERT_UNREACHABLE; } return 0; // unreachable; } bool Value::asBool() const { switch ( type_ ) { case nullValue: return false; case intValue: case uintValue: return value_.int_ != 0; case realValue: return value_.real_ != 0.0; case booleanValue: return value_.bool_; case stringValue: return value_.string_ && value_.string_[0] != 0; case arrayValue: case objectValue: return value_.map_->size() != 0; default: JSON_ASSERT_UNREACHABLE; } return false; // unreachable; } bool Value::isConvertibleTo( ValueType other ) const { switch ( type_ ) { case nullValue: return true; case intValue: return ( other == nullValue && value_.int_ == 0 ) || other == intValue || ( other == uintValue && value_.int_ >= 0 ) || other == realValue || other == stringValue || other == booleanValue; case uintValue: return ( other == nullValue && value_.uint_ == 0 ) || ( other == intValue && value_.uint_ <= (unsigned)maxInt ) || other == uintValue || other == realValue || other == stringValue || other == booleanValue; case realValue: return ( other == nullValue && value_.real_ == 0.0 ) || ( other == intValue && value_.real_ >= minInt && value_.real_ <= maxInt ) || ( other == uintValue && value_.real_ >= 0 && value_.real_ <= maxUInt ) || other == realValue || other == stringValue || other == booleanValue; case booleanValue: return ( other == nullValue && value_.bool_ == false ) || other == intValue || other == uintValue || other == realValue || other == stringValue || other == booleanValue; case stringValue: return other == stringValue || ( other == nullValue && (!value_.string_ || value_.string_[0] == 0) ); case arrayValue: return other == arrayValue || ( other == nullValue && value_.map_->size() == 0 ); case objectValue: return other == objectValue || ( other == nullValue && value_.map_->size() == 0 ); default: JSON_ASSERT_UNREACHABLE; } return false; // unreachable; } /// Number of values in array or object Value::UInt Value::size() const { switch ( type_ ) { case nullValue: case intValue: case uintValue: case realValue: case booleanValue: case stringValue: return 0; #ifndef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: // size of the array is highest index + 1 if ( !value_.map_->empty() ) { ObjectValues::const_iterator itLast = value_.map_->end(); --itLast; return (*itLast).first.index()+1; } return 0; case objectValue: return Int( value_.map_->size() ); #else case arrayValue: return Int( value_.array_->size() ); case objectValue: return Int( value_.map_->size() ); #endif default: JSON_ASSERT_UNREACHABLE; } return 0; // unreachable; } bool Value::empty() const { if ( isNull() || isArray() || isObject() ) return size() == 0u; else return false; } bool Value::operator!() const { return isNull(); } void Value::clear() { JSON_ASSERT( type_ == nullValue || type_ == arrayValue || type_ == objectValue ); switch ( type_ ) { #ifndef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: case objectValue: value_.map_->clear(); break; #else case arrayValue: value_.array_->clear(); break; case objectValue: value_.map_->clear(); break; #endif default: break; } } void Value::resize( UInt newSize ) { JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); if ( type_ == nullValue ) *this = Value( arrayValue ); #ifndef JSON_VALUE_USE_INTERNAL_MAP UInt oldSize = size(); if ( newSize == 0 ) clear(); else if ( newSize > oldSize ) (*this)[ newSize - 1 ]; else { for ( UInt index = newSize; index < oldSize; ++index ) value_.map_->erase( index ); assert( size() == newSize ); } #else value_.array_->resize( newSize ); #endif } Value & Value::operator[]( UInt index ) { JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); if ( type_ == nullValue ) *this = Value( arrayValue ); #ifndef JSON_VALUE_USE_INTERNAL_MAP CZString key( index ); ObjectValues::iterator it = value_.map_->lower_bound( key ); if ( it != value_.map_->end() && (*it).first == key ) return (*it).second; ObjectValues::value_type defaultValue( key, null ); it = value_.map_->insert( it, defaultValue ); return (*it).second; #else return value_.array_->resolveReference( index ); #endif } const Value & Value::operator[]( UInt index ) const { JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); if ( type_ == nullValue ) return null; #ifndef JSON_VALUE_USE_INTERNAL_MAP CZString key( index ); ObjectValues::const_iterator it = value_.map_->find( key ); if ( it == value_.map_->end() ) return null; return (*it).second; #else Value *value = value_.array_->find( index ); return value ? *value : null; #endif } Value & Value::operator[]( const char *key ) { return resolveReference( key, false ); } Value & Value::resolveReference( const char *key, bool isStatic ) { JSON_ASSERT( type_ == nullValue || type_ == objectValue ); if ( type_ == nullValue ) *this = Value( objectValue ); #ifndef JSON_VALUE_USE_INTERNAL_MAP CZString actualKey( key, isStatic ? CZString::noDuplication : CZString::duplicateOnCopy ); ObjectValues::iterator it = value_.map_->lower_bound( actualKey ); if ( it != value_.map_->end() && (*it).first == actualKey ) return (*it).second; ObjectValues::value_type defaultValue( actualKey, null ); it = value_.map_->insert( it, defaultValue ); Value &value = (*it).second; return value; #else return value_.map_->resolveReference( key, isStatic ); #endif } Value Value::get( UInt index, const Value &defaultValue ) const { const Value *value = &((*this)[index]); return value == &null ? defaultValue : *value; } bool Value::isValidIndex( UInt index ) const { return index < size(); } const Value & Value::operator[]( const char *key ) const { JSON_ASSERT( type_ == nullValue || type_ == objectValue ); if ( type_ == nullValue ) return null; #ifndef JSON_VALUE_USE_INTERNAL_MAP CZString actualKey( key, CZString::noDuplication ); ObjectValues::const_iterator it = value_.map_->find( actualKey ); if ( it == value_.map_->end() ) return null; return (*it).second; #else const Value *value = value_.map_->find( key ); return value ? *value : null; #endif } Value & Value::operator[]( const std::string &key ) { return (*this)[ key.c_str() ]; } const Value & Value::operator[]( const std::string &key ) const { return (*this)[ key.c_str() ]; } Value & Value::operator[]( const StaticString &key ) { return resolveReference( key, true ); } # ifdef JSON_USE_CPPTL Value & Value::operator[]( const CppTL::ConstString &key ) { return (*this)[ key.c_str() ]; } const Value & Value::operator[]( const CppTL::ConstString &key ) const { return (*this)[ key.c_str() ]; } # endif Value & Value::append( const Value &value ) { return (*this)[size()] = value; } Value Value::get( const char *key, const Value &defaultValue ) const { const Value *value = &((*this)[key]); return value == &null ? defaultValue : *value; } Value Value::get( const std::string &key, const Value &defaultValue ) const { return get( key.c_str(), defaultValue ); } Value Value::removeMember( const char* key ) { JSON_ASSERT( type_ == nullValue || type_ == objectValue ); if ( type_ == nullValue ) return null; #ifndef JSON_VALUE_USE_INTERNAL_MAP CZString actualKey( key, CZString::noDuplication ); ObjectValues::iterator it = value_.map_->find( actualKey ); if ( it == value_.map_->end() ) return null; Value old(it->second); value_.map_->erase(it); return old; #else Value *value = value_.map_->find( key ); if (value){ Value old(*value); value_.map_.remove( key ); return old; } else { return null; } #endif } Value Value::removeMember( const std::string &key ) { return removeMember( key.c_str() ); } # ifdef JSON_USE_CPPTL Value Value::get( const CppTL::ConstString &key, const Value &defaultValue ) const { return get( key.c_str(), defaultValue ); } # endif bool Value::isMember( const char *key ) const { const Value *value = &((*this)[key]); return value != &null; } bool Value::isMember( const std::string &key ) const { return isMember( key.c_str() ); } # ifdef JSON_USE_CPPTL bool Value::isMember( const CppTL::ConstString &key ) const { return isMember( key.c_str() ); } #endif Value::Members Value::getMemberNames() const { JSON_ASSERT( type_ == nullValue || type_ == objectValue ); if ( type_ == nullValue ) return Value::Members(); Members members; members.reserve( value_.map_->size() ); #ifndef JSON_VALUE_USE_INTERNAL_MAP ObjectValues::const_iterator it = value_.map_->begin(); ObjectValues::const_iterator itEnd = value_.map_->end(); for ( ; it != itEnd; ++it ) members.push_back( std::string( (*it).first.c_str() ) ); #else ValueInternalMap::IteratorState it; ValueInternalMap::IteratorState itEnd; value_.map_->makeBeginIterator( it ); value_.map_->makeEndIterator( itEnd ); for ( ; !ValueInternalMap::equals( it, itEnd ); ValueInternalMap::increment(it) ) members.push_back( std::string( ValueInternalMap::key( it ) ) ); #endif return members; } // //# ifdef JSON_USE_CPPTL //EnumMemberNames //Value::enumMemberNames() const //{ // if ( type_ == objectValue ) // { // return CppTL::Enum::any( CppTL::Enum::transform( // CppTL::Enum::keys( *(value_.map_), CppTL::Type<const CZString &>() ), // MemberNamesTransform() ) ); // } // return EnumMemberNames(); //} // // //EnumValues //Value::enumValues() const //{ // if ( type_ == objectValue || type_ == arrayValue ) // return CppTL::Enum::anyValues( *(value_.map_), // CppTL::Type<const Value &>() ); // return EnumValues(); //} // //# endif bool Value::isNull() const { return type_ == nullValue; } bool Value::isBool() const { return type_ == booleanValue; } bool Value::isInt() const { return type_ == intValue; } bool Value::isUInt() const { return type_ == uintValue; } bool Value::isIntegral() const { return type_ == intValue || type_ == uintValue || type_ == booleanValue; } bool Value::isDouble() const { return type_ == realValue; } bool Value::isNumeric() const { return isIntegral() || isDouble(); } bool Value::isString() const { return type_ == stringValue; } bool Value::isArray() const { return type_ == nullValue || type_ == arrayValue; } bool Value::isObject() const { return type_ == nullValue || type_ == objectValue; } void Value::setComment( const char *comment, CommentPlacement placement ) { if ( !comments_ ) comments_ = new CommentInfo[numberOfCommentPlacement]; comments_[placement].setComment( comment ); } void Value::setComment( const std::string &comment, CommentPlacement placement ) { setComment( comment.c_str(), placement ); } bool Value::hasComment( CommentPlacement placement ) const { return comments_ != 0 && comments_[placement].comment_ != 0; } std::string Value::getComment( CommentPlacement placement ) const { if ( hasComment(placement) ) return comments_[placement].comment_; return ""; } std::string Value::toStyledString() const { StyledWriter writer; return writer.write( *this ); } Value::const_iterator Value::begin() const { switch ( type_ ) { #ifdef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: if ( value_.array_ ) { ValueInternalArray::IteratorState it; value_.array_->makeBeginIterator( it ); return const_iterator( it ); } break; case objectValue: if ( value_.map_ ) { ValueInternalMap::IteratorState it; value_.map_->makeBeginIterator( it ); return const_iterator( it ); } break; #else case arrayValue: case objectValue: if ( value_.map_ ) return const_iterator( value_.map_->begin() ); break; #endif default: break; } return const_iterator(); } Value::const_iterator Value::end() const { switch ( type_ ) { #ifdef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: if ( value_.array_ ) { ValueInternalArray::IteratorState it; value_.array_->makeEndIterator( it ); return const_iterator( it ); } break; case objectValue: if ( value_.map_ ) { ValueInternalMap::IteratorState it; value_.map_->makeEndIterator( it ); return const_iterator( it ); } break; #else case arrayValue: case objectValue: if ( value_.map_ ) return const_iterator( value_.map_->end() ); break; #endif default: break; } return const_iterator(); } Value::iterator Value::begin() { switch ( type_ ) { #ifdef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: if ( value_.array_ ) { ValueInternalArray::IteratorState it; value_.array_->makeBeginIterator( it ); return iterator( it ); } break; case objectValue: if ( value_.map_ ) { ValueInternalMap::IteratorState it; value_.map_->makeBeginIterator( it ); return iterator( it ); } break; #else case arrayValue: case objectValue: if ( value_.map_ ) return iterator( value_.map_->begin() ); break; #endif default: break; } return iterator(); } Value::iterator Value::end() { switch ( type_ ) { #ifdef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: if ( value_.array_ ) { ValueInternalArray::IteratorState it; value_.array_->makeEndIterator( it ); return iterator( it ); } break; case objectValue: if ( value_.map_ ) { ValueInternalMap::IteratorState it; value_.map_->makeEndIterator( it ); return iterator( it ); } break; #else case arrayValue: case objectValue: if ( value_.map_ ) return iterator( value_.map_->end() ); break; #endif default: break; } return iterator(); } // class PathArgument // ////////////////////////////////////////////////////////////////// PathArgument::PathArgument() : kind_( kindNone ) { } PathArgument::PathArgument( Value::UInt index ) : index_( index ) , kind_( kindIndex ) { } PathArgument::PathArgument( const char *key ) : key_( key ) , kind_( kindKey ) { } PathArgument::PathArgument( const std::string &key ) : key_( key.c_str() ) , kind_( kindKey ) { } // class Path // ////////////////////////////////////////////////////////////////// Path::Path( const std::string &path, const PathArgument &a1, const PathArgument &a2, const PathArgument &a3, const PathArgument &a4, const PathArgument &a5 ) { InArgs in; in.push_back( &a1 ); in.push_back( &a2 ); in.push_back( &a3 ); in.push_back( &a4 ); in.push_back( &a5 ); makePath( path, in ); } void Path::makePath( const std::string &path, const InArgs &in ) { const char *current = path.c_str(); const char *end = current + path.length(); InArgs::const_iterator itInArg = in.begin(); while ( current != end ) { if ( *current == '[' ) { ++current; if ( *current == '%' ) addPathInArg( path, in, itInArg, PathArgument::kindIndex ); else { Value::UInt index = 0; for ( ; current != end && *current >= '0' && *current <= '9'; ++current ) index = index * 10 + Value::UInt(*current - '0'); args_.push_back( index ); } if ( current == end || *current++ != ']' ) invalidPath( path, int(current - path.c_str()) ); } else if ( *current == '%' ) { addPathInArg( path, in, itInArg, PathArgument::kindKey ); ++current; } else if ( *current == '.' ) { ++current; } else { const char *beginName = current; while ( current != end && !strchr( "[.", *current ) ) ++current; args_.push_back( std::string( beginName, current ) ); } } } void Path::addPathInArg( const std::string &path, const InArgs &in, InArgs::const_iterator &itInArg, PathArgument::Kind kind ) { if ( itInArg == in.end() ) { // Error: missing argument %d } else if ( (*itInArg)->kind_ != kind ) { // Error: bad argument type } else { args_.push_back( **itInArg ); } } void Path::invalidPath( const std::string &path, int location ) { // Error: invalid path. } const Value & Path::resolve( const Value &root ) const { const Value *node = &root; for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it ) { const PathArgument &arg = *it; if ( arg.kind_ == PathArgument::kindIndex ) { if ( !node->isArray() || node->isValidIndex( arg.index_ ) ) { // Error: unable to resolve path (array value expected at position... } node = &((*node)[arg.index_]); } else if ( arg.kind_ == PathArgument::kindKey ) { if ( !node->isObject() ) { // Error: unable to resolve path (object value expected at position...) } node = &((*node)[arg.key_]); if ( node == &Value::null ) { // Error: unable to resolve path (object has no member named '' at position...) } } } return *node; } Value Path::resolve( const Value &root, const Value &defaultValue ) const { const Value *node = &root; for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it ) { const PathArgument &arg = *it; if ( arg.kind_ == PathArgument::kindIndex ) { if ( !node->isArray() || node->isValidIndex( arg.index_ ) ) return defaultValue; node = &((*node)[arg.index_]); } else if ( arg.kind_ == PathArgument::kindKey ) { if ( !node->isObject() ) return defaultValue; node = &((*node)[arg.key_]); if ( node == &Value::null ) return defaultValue; } } return *node; } Value & Path::make( Value &root ) const { Value *node = &root; for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it ) { const PathArgument &arg = *it; if ( arg.kind_ == PathArgument::kindIndex ) { if ( !node->isArray() ) { // Error: node is not an array at position ... } node = &((*node)[arg.index_]); } else if ( arg.kind_ == PathArgument::kindKey ) { if ( !node->isObject() ) { // Error: node is not an object at position... } node = &((*node)[arg.key_]); } } return *node; } } // namespace Json
[ "webmaster@adintr.com" ]
webmaster@adintr.com
9e1c6e21168f3347d7e9d641c34efb815abae911
d8e7a11322f6d1b514c85b0c713bacca8f743ff5
/7.6.00.37/V76_00_37/MaxDB_ORG/sys/src/SAPDB/DBM/Cli/Eventing/Common/DBMCliEvtCm_Branding.cpp
a53fc4990983b9ebb127ff0c1aa440db9b20b538
[]
no_license
zhaonaiy/MaxDB_GPL_Releases
a224f86c0edf76e935d8951d1dd32f5376c04153
15821507c20bd1cd251cf4e7c60610ac9cabc06d
refs/heads/master
2022-11-08T21:14:22.774394
2020-07-07T00:52:44
2020-07-07T00:52:44
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,167
cpp
/*! @file DBMCliEvtCm_Branding.cpp @author MarcW @brief Branding strings \if EMIT_LICENCE ========== licence begin GPL Copyright (c) 2003-2005 SAP AG This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ========== licence end \endif */ #include "DBM/Cli/Eventing/Common/DBMCliEvtCm_Branding.hpp" const DBMCli_String DBMCliEvtCm_Branding::sProductName("MaxDB Eventing"); const DBMCli_String DBMCliEvtCm_Branding::sVersionLabel("Version");
[ "gunter.mueller@gmail.com" ]
gunter.mueller@gmail.com
31e4b8553136bd566a630bb86465ea08dd98d39b
df73ba3f412751939594300eeb32e72e914b9d4d
/main/get_distance.h
282445e25f57691d8e8890221185c230cd662e7b
[]
no_license
16pure/tukuba
d74517ddd0c88eac6d4a81328a7a739a68de8107
fb4aa4124e922ab031f62578a25d2b9118e0b0cf
refs/heads/master
2021-01-11T00:13:09.571998
2016-10-11T09:00:34
2016-10-11T09:00:34
70,575,044
0
0
null
null
null
null
UTF-8
C++
false
false
2,834
h
/*! \example get_distance.cpp Obtains distance data \author Satofumi KAMIMURA $Id: get_distance.cpp,v c5747add6615 2015/05/07 03:18:34 alexandr $ */ #include "Urg_driver.h" #include "Connection_information.h" #include "math_utilities.h" #include <stdio.h> #include <string> #include <sysexits.h> #include <math.h> #include <iostream> using namespace qrk; using namespace std; namespace{ void print_data(const Urg_driver& urg, const vector<long>& data, long time_stamp){ #if 1 // Shows only the front step int front_index = urg.step2index(0); cout << data[front_index] << " [mm], (" << time_stamp << " [msec])" << endl; #else // Prints the X-Y coordinates for all the measurement points long min_distance = urg.min_distance(); long max_distance = urg.max_distance(); size_t data_n = data.size(); for (size_t i = 0; i < data_n; ++i) { long l = data[i]; if ((l <= min_distance) || (l >= max_distance)) { continue; } double radian = urg.index2rad(i); long x = static_cast<long>(l * cos(radian)); long y = static_cast<long>(l * sin(radian)); cout << "(" << x << ", " << y << ")" << endl; } cout << endl; #endif } }; int Laser_Range_Scanner() { Urg_driver urg; vector<long> data; long time_stamp = 0; if(!urg.get_distance(data, &time_stamp)){ cout << "Urg_driver::get_distance(): " << urg.what() << endl; return 1; } //cout << data.size() << endl; short j; double angle = 180.0 / (data.size() - 1); for(j=0;j<data.size();j++){ if(data[j] <= 20) continue; double theta,pi,x,y; pi=3.14159265359; double now = angle * j - 90; theta = now * pi / 180.0; //cout << "distance " << data[j] << "[mm] , angle " << now <<"[deg]" << endl; x=-data[j]*sin(theta); y=data[j]*cos(theta); //cout << "x" << x << ", y" << y << endl; if(x<150 && y<150 && x > -150 && y > -150){; return 1; } } return 0; } int Laser_Range_Scanner(int argc, char *argv[]){ Connection_information information(argc, argv); // Connects to the sensor Urg_driver urg; if(!urg.open(information.device_or_ip_name(), information.baudrate_or_port_number(), information.connection_type())){ cout << "Urg_driver::open(): " << information.device_or_ip_name() << ": " << urg.what() << endl; return 1; } // Gets measurement data #if 1 // Case where the measurement range (start/end steps) is defined urg.set_scanning_parameter(urg.deg2step(-60), urg.deg2step(+60), 0); #endif enum{ Capture_times = 721 }; urg.start_measurement(Urg_driver::Distance, Urg_driver::Infinity_times, 0); while(1){ int return_value = Laser_Range_Scanner(); cout << return_value << endl; //print_data(urg, data, time_stamp); } #if defined(URG_MSC) getchar(); #endif return 0; }
[ "mmommo1206@gmail.com" ]
mmommo1206@gmail.com
1b5b6e7dc976375de2f33d8658b1960f8cbca031
e69070116b98535ab8fcb065fe74ef1560a41f18
/Myo Mapper/JuceLibraryCode/BinaryData.cpp
21e8f0d3133ecc30e1c726bd4152a0f341c8c751
[ "MIT" ]
permissive
zoonderkins/MyoMapper
c731a4960282fa3b5dbce10d01dc4d4278a3d900
ea11d13c11c2c38ebe6d74098cd6be8cab542c90
refs/heads/master
2023-07-06T03:16:57.732657
2017-04-25T23:50:33
2017-04-25T23:50:33
null
0
0
null
null
null
null
UTF-8
C++
false
false
240,538
cpp
/* ==================================== JUCER_BINARY_RESOURCE ==================================== This is an auto-generated file: Any edits you make may be overwritten! */ namespace BinaryData { //================== icon.png ================== static const unsigned char temp_binary_data_0[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,2,0,0,0,2,0,8,6,0,0,0,244,120,212,250,0,0,0,4,103,65,77,65,0,0,177,143,11,252,97,5,0,0,0,32,99,72,82,77,0,0,122,38,0,0,128,132,0,0,250,0,0,0,128,232,0,0,117,48,0,0,234,96,0,0,58,152,0,0,23,112,156,186, 81,60,0,0,1,213,105,84,88,116,88,77,76,58,99,111,109,46,97,100,111,98,101,46,120,109,112,0,0,0,0,0,60,120,58,120,109,112,109,101,116,97,32,120,109,108,110,115,58,120,61,34,97,100,111,98,101,58,110,115,58,109,101,116,97,47,34,32,120,58,120,109,112,116, 107,61,34,88,77,80,32,67,111,114,101,32,53,46,52,46,48,34,62,10,32,32,32,60,114,100,102,58,82,68,70,32,120,109,108,110,115,58,114,100,102,61,34,104,116,116,112,58,47,47,119,119,119,46,119,51,46,111,114,103,47,49,57,57,57,47,48,50,47,50,50,45,114,100, 102,45,115,121,110,116,97,120,45,110,115,35,34,62,10,32,32,32,32,32,32,60,114,100,102,58,68,101,115,99,114,105,112,116,105,111,110,32,114,100,102,58,97,98,111,117,116,61,34,34,10,32,32,32,32,32,32,32,32,32,32,32,32,120,109,108,110,115,58,116,105,102, 102,61,34,104,116,116,112,58,47,47,110,115,46,97,100,111,98,101,46,99,111,109,47,116,105,102,102,47,49,46,48,47,34,62,10,32,32,32,32,32,32,32,32,32,60,116,105,102,102,58,67,111,109,112,114,101,115,115,105,111,110,62,49,60,47,116,105,102,102,58,67,111, 109,112,114,101,115,115,105,111,110,62,10,32,32,32,32,32,32,32,32,32,60,116,105,102,102,58,79,114,105,101,110,116,97,116,105,111,110,62,49,60,47,116,105,102,102,58,79,114,105,101,110,116,97,116,105,111,110,62,10,32,32,32,32,32,32,32,32,32,60,116,105, 102,102,58,80,104,111,116,111,109,101,116,114,105,99,73,110,116,101,114,112,114,101,116,97,116,105,111,110,62,50,60,47,116,105,102,102,58,80,104,111,116,111,109,101,116,114,105,99,73,110,116,101,114,112,114,101,116,97,116,105,111,110,62,10,32,32,32,32, 32,32,60,47,114,100,102,58,68,101,115,99,114,105,112,116,105,111,110,62,10,32,32,32,60,47,114,100,102,58,82,68,70,62,10,60,47,120,58,120,109,112,109,101,116,97,62,10,2,216,128,5,0,0,64,0,73,68,65,84,120,1,236,125,7,96,92,213,149,246,153,81,239,150,187, 170,101,89,178,100,203,198,21,99,192,128,177,49,152,154,44,11,161,133,252,217,100,19,82,32,89,54,155,100,147,77,54,164,183,63,33,129,144,182,155,77,221,240,135,146,64,232,54,6,99,48,221,216,216,184,203,69,238,146,45,55,245,254,127,223,125,115,165,81, 25,105,222,104,212,70,231,218,211,222,187,245,187,79,247,156,123,238,41,34,154,20,1,69,64,17,80,4,20,1,69,96,212,33,224,233,199,136,251,83,54,80,179,126,117,222,232,41,185,177,36,170,230,184,120,247,175,93,219,44,194,87,71,154,116,249,191,77,76,138,159, 144,219,26,227,41,196,213,66,79,107,235,236,214,150,150,229,81,177,241,233,222,232,216,54,241,224,159,38,69,64,17,80,4,20,1,69,32,116,4,218,90,155,155,60,45,141,117,173,30,143,231,101,111,84,236,107,34,158,221,109,158,150,221,222,166,198,253,123,30,255, 202,81,84,221,137,54,21,92,121,87,28,155,43,77,62,214,44,15,63,220,26,122,211,1,75,182,5,188,227,242,198,240,35,146,247,220,227,93,186,86,188,107,215,222,211,9,212,188,15,223,59,38,182,33,118,86,171,180,45,20,105,155,135,201,152,1,20,166,96,188,227,189, 81,49,94,241,120,5,51,133,87,107,27,222,134,223,184,92,78,140,102,87,4,20,1,69,64,17,24,6,8,120,188,109,160,55,30,79,84,52,72,15,254,27,58,211,114,22,140,192,97,252,216,133,173,230,187,210,230,217,208,26,219,186,105,239,31,62,123,192,191,199,75,151,222, 19,189,118,194,204,54,121,248,3,100,4,194,70,184,253,219,232,207,247,225,65,40,65,244,101,235,76,143,148,108,107,147,123,238,105,231,152,138,110,190,63,179,201,211,118,9,224,95,14,144,207,195,64,11,189,209,113,113,30,111,148,180,181,145,206,147,224,183, 0,214,22,34,219,234,225,190,31,179,34,158,225,49,172,254,76,140,150,85,4,20,1,69,64,17,24,14,8,144,234,227,191,135,52,6,196,197,11,102,0,52,200,227,5,67,128,141,39,136,145,180,54,213,163,163,109,7,241,182,17,121,215,182,120,90,214,236,123,240,95,54,251, 245,222,35,55,62,228,237,74,227,252,238,15,201,215,161,165,148,36,252,216,237,139,223,110,255,156,219,127,152,84,219,20,191,28,48,95,15,92,47,245,68,121,115,61,209,144,168,144,224,183,24,130,207,169,160,116,0,23,218,176,243,55,212,30,179,96,136,255,144, 128,168,141,42,2,138,128,34,160,8,140,10,4,64,127,200,14,136,255,142,62,10,28,129,215,19,21,35,226,165,36,26,27,210,230,198,51,200,243,38,184,134,199,113,52,253,196,222,135,253,36,3,55,62,20,101,144,122,248,3,216,189,14,109,26,34,6,160,205,179,224,227, 191,142,222,240,235,59,154,236,240,11,110,186,111,154,68,201,77,160,243,55,65,214,114,14,118,250,160,239,0,178,5,89,248,197,1,156,253,37,177,231,75,147,34,160,8,40,2,138,128,34,48,212,8,88,134,128,76,1,105,84,52,143,11,40,33,104,107,195,161,117,115,227, 49,92,123,194,219,214,246,199,93,255,239,51,47,219,206,250,29,15,12,25,35,48,232,12,192,130,143,255,42,166,19,225,191,249,190,121,32,231,31,5,79,117,147,55,38,113,60,216,39,105,109,105,180,68,159,192,90,162,63,232,125,181,19,165,159,138,128,34,160,8, 40,2,138,64,144,8,144,17,176,204,64,20,37,3,124,181,54,214,66,65,77,158,241,72,219,175,74,155,95,126,26,10,130,134,240,59,52,241,227,144,106,227,16,123,144,211,224,17,213,27,111,140,90,122,188,196,99,149,251,10,111,125,96,46,54,246,159,198,160,111,137, 138,75,74,106,109,110,228,110,191,197,71,241,217,47,251,26,100,72,180,57,69,64,17,80,4,20,1,69,160,191,8,144,160,67,166,237,28,25,64,67,205,27,237,141,137,135,68,160,65,90,91,155,159,7,129,187,175,244,193,207,60,225,180,210,230,89,186,244,235,81,150, 62,246,183,229,96,203,15,6,3,0,113,255,175,218,197,253,211,110,126,32,199,227,109,189,27,59,254,143,130,240,167,182,54,53,80,153,143,71,1,86,180,63,24,125,10,22,31,205,167,8,40,2,138,128,34,160,8,132,3,1,74,5,176,235,247,196,120,99,19,160,56,88,71,254, 224,49,252,254,65,233,131,119,194,188,80,100,233,61,47,70,175,189,103,41,243,12,138,52,96,96,137,45,118,253,82,82,98,53,251,61,211,110,189,239,211,80,209,255,60,68,253,185,60,219,199,139,132,159,125,128,58,165,38,69,64,17,80,4,20,1,69,32,226,17,0,35, 0,69,118,143,55,54,42,38,65,90,26,107,201,9,252,10,222,4,190,83,250,240,103,142,155,209,195,124,208,95,57,126,160,16,25,48,6,192,40,56,248,180,251,243,111,190,127,161,215,35,223,135,131,158,101,164,247,173,205,13,60,251,32,55,4,181,73,77,138,128,34,160, 8,40,2,138,192,168,67,192,208,65,156,12,196,120,162,141,142,192,110,88,181,253,71,233,159,239,122,152,72,56,52,244,107,3,42,13,24,0,6,160,243,89,70,193,205,247,125,17,150,122,95,245,196,36,36,25,145,135,8,119,253,220,241,15,64,219,132,77,147,34,160,8, 40,2,138,128,34,48,98,16,160,89,59,248,128,184,40,227,219,166,165,229,55,94,79,236,191,239,122,240,142,19,144,12,192,127,192,195,94,56,18,34,179,16,246,20,94,34,236,39,242,47,186,253,254,169,205,205,114,63,68,28,87,27,113,191,115,206,79,251,71,53,225, 11,251,52,106,133,138,128,34,160,8,40,2,35,24,1,250,181,105,33,27,16,5,253,0,28,11,108,135,18,192,157,123,30,188,235,5,142,201,95,162,30,206,49,134,143,1,160,115,3,31,151,146,127,235,207,174,130,205,227,47,161,228,151,211,210,80,67,81,63,95,122,206,31, 206,153,211,186,20,1,69,64,17,80,4,34,12,1,58,14,144,86,40,9,70,183,52,213,99,215,223,246,197,61,15,126,230,71,28,100,87,19,250,112,12,60,44,12,128,63,119,82,120,235,253,159,133,225,195,189,16,103,120,112,214,15,219,62,156,243,107,96,158,112,204,149, 214,161,8,40,2,138,128,34,48,58,16,104,132,187,225,88,8,4,168,51,247,95,105,41,177,159,166,255,156,112,51,1,253,102,0,28,179,133,75,77,224,30,156,247,127,207,19,19,247,69,120,242,161,105,31,188,249,120,98,71,199,92,233,40,21,1,69,64,17,80,4,20,129,176, 34,64,125,185,152,168,216,36,105,105,170,121,166,81,170,111,59,240,231,47,157,10,39,19,208,47,6,160,19,241,191,229,254,7,188,49,9,159,106,109,70,80,132,182,54,211,241,176,66,161,149,41,2,138,128,34,160,8,40,2,163,11,1,163,252,135,227,244,168,150,134, 234,87,99,162,90,110,216,254,167,187,143,134,139,9,8,153,1,240,239,64,193,45,63,251,47,156,89,252,51,92,29,114,106,40,13,208,243,254,209,245,144,234,104,21,1,69,64,17,80,4,6,6,1,234,208,181,120,99,19,99,90,27,106,223,145,168,182,247,149,254,239,103,14, 249,211,224,80,155,13,73,35,159,59,127,235,207,31,196,255,55,62,226,79,207,69,228,86,148,248,135,58,27,90,78,17,80,4,20,1,69,64,17,232,140,0,66,12,74,52,54,216,77,81,113,137,243,165,197,243,248,140,15,222,155,97,117,2,58,103,117,247,203,53,3,96,20,254, 238,241,157,249,223,114,31,119,254,31,65,199,72,252,201,165,56,97,14,221,245,65,115,43,2,138,128,34,160,8,40,2,138,64,32,4,28,69,250,104,152,7,26,38,160,169,37,250,209,146,27,127,60,182,31,76,128,145,254,187,59,2,240,51,245,43,184,249,254,251,189,113, 9,119,182,54,214,41,241,15,52,105,122,93,17,80,4,20,1,69,64,17,8,31,2,164,183,205,81,56,14,0,51,176,186,57,46,249,186,253,191,251,167,250,16,142,3,72,251,219,130,151,0,220,115,79,187,55,34,248,244,255,38,118,254,36,254,144,76,232,206,63,124,115,171,53, 41,2,138,128,34,160,8,40,2,1,17,32,225,142,106,110,172,109,129,117,192,138,232,134,154,255,102,78,115,36,207,248,1,46,83,144,12,0,220,17,250,82,225,205,247,127,194,235,141,253,138,209,246,7,39,130,27,42,246,183,224,232,167,34,160,8,40,2,138,128,34,48, 176,8,32,180,14,20,238,26,107,218,188,177,241,183,21,220,114,255,119,77,115,140,189,195,141,186,139,20,20,241,94,186,212,19,189,255,119,247,180,64,236,191,20,78,125,254,236,241,122,163,16,208,88,77,253,92,0,173,89,21,1,69,64,17,80,4,20,129,48,33,64,66, 223,210,214,218,226,245,68,69,47,25,87,178,242,192,201,247,158,217,36,19,38,120,101,219,182,96,154,48,155,250,62,185,5,235,229,111,10,180,14,65,252,127,237,141,137,143,105,107,161,147,31,141,228,23,12,202,154,71,17,80,4,20,1,69,64,17,24,0,4,162,29,159, 59,134,150,223,95,112,219,125,139,229,225,135,91,64,179,131,218,216,179,63,189,51,0,16,39,172,245,133,244,141,105,137,250,9,20,15,10,91,155,234,177,243,247,104,24,223,1,152,77,173,82,17,80,4,20,1,69,64,17,112,129,0,54,228,141,141,140,182,43,173,158,95, 103,195,50,192,208,236,32,245,1,122,101,0,150,174,117,24,132,130,155,238,251,164,39,42,238,3,208,58,100,191,192,93,116,232,4,184,232,168,102,85,4,20,1,69,64,17,80,4,20,129,176,34,224,137,109,109,170,107,194,6,125,118,124,116,244,15,77,213,65,234,3,4, 100,0,104,86,64,78,162,232,131,63,47,2,27,240,13,83,105,91,27,189,252,5,44,19,214,49,105,101,138,128,34,160,8,40,2,138,128,34,16,12,2,81,220,160,123,188,49,31,41,184,245,190,219,88,192,110,224,123,43,220,51,49,135,232,223,122,250,107,105,105,253,150, 55,54,105,124,91,115,67,51,106,15,250,108,161,183,70,245,158,34,160,8,40,2,138,128,34,160,8,132,13,1,120,11,108,107,134,130,62,5,244,223,158,126,227,143,179,184,129,167,14,95,111,45,244,200,0,88,206,97,218,173,63,187,25,21,222,0,241,2,142,253,61,208, 52,80,209,127,111,96,234,61,69,64,17,80,4,20,1,69,96,72,16,240,120,162,16,132,151,49,3,166,180,196,196,124,133,125,112,116,248,2,211,237,110,12,128,213,250,207,189,245,231,233,158,182,182,47,123,162,160,239,215,214,70,173,127,221,253,15,201,172,106,163, 138,128,34,160,8,40,2,138,64,159,8,208,28,0,114,128,6,241,180,201,71,141,217,62,46,44,248,248,175,3,74,1,186,48,0,109,158,181,107,191,102,194,15,198,181,181,124,12,222,254,102,67,235,159,191,85,235,191,79,236,53,131,34,160,8,40,2,138,128,34,48,164,8, 68,195,55,64,19,35,7,66,102,255,121,246,196,28,231,211,141,127,15,169,51,3,112,227,195,248,237,105,155,118,243,3,57,112,241,123,23,42,34,63,65,223,195,198,208,176,135,242,122,73,17,80,4,20,1,69,64,17,80,4,134,15,2,94,231,216,222,123,85,254,77,247,93, 207,110,45,61,190,173,71,26,238,199,0,224,156,224,225,27,25,209,15,169,21,187,255,196,236,182,230,70,40,254,121,2,138,15,156,188,250,174,8,40,2,138,128,34,160,8,40,2,195,4,129,40,105,107,133,111,128,120,129,78,224,157,246,88,95,122,144,2,116,48,0,126, 187,127,136,14,62,218,214,210,196,64,63,61,114,13,195,100,144,218,13,69,64,17,80,4,20,1,69,64,17,232,134,128,39,186,213,152,5,70,95,122,40,115,252,213,221,110,251,46,116,48,0,190,11,30,111,219,237,112,247,155,9,6,160,21,212,191,219,253,64,21,233,117, 69,64,17,80,4,20,1,69,64,17,24,22,8,144,118,55,121,162,227,120,138,255,113,211,163,135,63,208,210,53,88,144,67,224,41,26,192,205,188,15,223,59,6,185,111,135,248,128,249,249,166,18,0,131,156,190,41,2,138,128,34,160,8,40,2,35,10,129,40,40,241,131,136,183, 173,204,191,229,129,37,166,231,91,103,118,162,233,134,1,88,144,126,202,124,198,212,71,189,31,145,133,138,91,155,25,232,79,119,255,35,106,170,181,179,138,128,34,160,8,40,2,138,64,59,2,56,204,111,107,109,134,62,31,194,7,183,125,208,92,126,248,3,62,61,63, 39,19,8,127,155,199,122,253,107,243,120,224,248,135,22,127,116,249,75,199,63,154,20,1,69,64,17,80,4,20,1,69,96,228,33,96,28,0,121,16,189,151,82,128,107,17,45,48,27,99,104,243,87,6,244,46,189,103,173,177,15,204,191,233,129,115,113,111,73,91,171,217,253, 51,159,50,0,35,111,198,181,199,138,128,34,160,8,40,2,138,128,69,0,12,64,147,120,162,98,51,61,173,98,148,1,253,77,2,189,107,229,37,35,18,240,70,181,94,237,69,72,65,112,11,180,251,119,116,3,108,21,250,169,8,40,2,138,128,34,160,8,40,2,35,13,1,56,5,148,22, 198,8,104,107,243,188,143,157,55,238,129,111,188,209,208,120,47,180,2,91,17,67,56,1,130,129,203,125,58,127,16,255,43,3,48,210,102,89,251,171,8,40,2,138,128,34,160,8,116,65,128,103,249,109,80,5,32,121,95,140,99,128,153,188,95,80,61,217,248,247,49,92,64, 92,84,220,60,92,155,75,81,1,146,138,254,137,130,38,69,64,17,80,4,20,1,69,96,228,35,224,53,122,0,81,177,233,240,235,187,204,127,56,134,1,240,120,90,47,134,237,127,2,184,4,30,7,244,232,51,216,191,144,126,87,4,20,1,69,64,17,80,4,20,129,145,128,128,81,232, 111,246,68,129,180,183,202,165,236,113,233,51,247,51,192,159,35,234,199,25,193,18,143,199,240,2,20,255,171,4,128,200,104,82,4,20,1,69,64,17,80,4,70,60,2,70,161,191,77,90,177,191,247,200,252,233,31,250,69,22,134,68,93,63,241,230,127,232,87,185,160,248, 115,205,25,129,18,255,17,63,213,58,0,69,64,17,80,4,20,1,69,160,11,2,94,90,248,121,196,147,215,214,216,52,215,222,243,122,90,90,74,196,227,205,66,4,65,94,83,241,191,69,70,63,21,1,69,64,17,80,4,20,129,200,64,0,12,64,107,43,142,250,97,224,239,93,96,135, 228,245,180,181,206,227,69,232,9,170,246,191,69,69,63,21,1,69,64,17,80,4,20,129,200,65,128,71,251,45,216,236,195,197,95,219,28,124,55,155,125,24,7,202,28,143,227,244,175,147,139,192,200,25,183,142,68,17,80,4,20,1,69,64,17,24,245,8,180,49,206,15,14,255, 139,179,174,255,126,6,209,160,230,223,244,182,214,22,126,87,229,63,162,160,73,17,80,4,20,1,69,64,17,136,60,4,112,12,0,65,127,155,100,199,122,61,83,57,60,200,3,218,114,124,10,128,198,12,32,242,198,172,35,82,4,20,1,69,64,17,80,4,70,61,2,96,0,120,10,224, 77,133,123,192,66,162,129,35,0,207,88,149,0,140,250,7,67,1,80,4,20,1,69,64,17,136,108,4,16,19,168,173,213,9,248,231,117,24,0,79,116,12,47,210,38,80,143,0,34,123,242,117,116,138,128,34,160,8,40,2,163,23,1,108,252,141,249,191,180,182,52,158,79,24,188,142, 3,32,195,0,140,94,88,116,228,138,128,34,160,8,40,2,138,64,132,35,0,14,192,232,1,96,207,127,17,135,74,155,0,240,4,12,24,164,2,128,8,159,123,29,158,34,160,8,40,2,138,192,104,70,0,100,30,167,0,18,21,155,96,116,254,24,35,208,7,135,113,23,56,154,161,209,177, 43,2,138,128,34,160,8,40,2,17,140,128,225,0,196,27,29,107,8,63,24,128,86,221,251,71,240,116,235,208,20,1,69,64,17,80,4,20,129,206,8,56,27,126,19,38,16,103,0,106,2,216,25,29,253,165,8,40,2,138,128,34,160,8,68,52,2,94,40,3,64,5,64,133,0,17,61,203,58,56, 69,64,17,80,4,20,1,69,160,11,2,216,249,235,217,127,23,76,244,167,34,160,8,40,2,138,128,34,16,241,8,168,232,63,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25,128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138, 128,34,160,8,116,71,64,25,128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25,128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25, 128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25,128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25,128,238,152,232,21,69,64, 17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25,128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25,128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17, 80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25,128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25,128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168, 8,40,2,138,128,34,160,8,116,71,64,25,128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25,128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8, 116,71,64,25,128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25,128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25,128,238,152, 232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25,128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25,128,238,152,232,21,69,64,17,80,4,20, 1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,64,25,128,238,152,232,21,69,64,17,80,4,20,1,69,32,226,17,80,6,32,226,167,88,7,168,8,40,2,138,128,34,160,8,116,71,32,186,251,37,189,162,8,132,31,129,54,191,42,61,126,223,71,251,87, 197,101,180,63,1,58,126,69,96,232,16,80,6,96,232,176,31,21,45,183,130,194,69,129,226,71,251,81,253,38,92,107,195,203,235,119,109,84,128,225,55,200,86,0,224,245,120,36,6,47,160,129,151,71,154,113,141,120,141,102,92,252,32,210,175,138,128,34,48,192,8,232, 17,192,0,3,60,154,171,39,89,75,141,241,74,50,94,76,36,117,36,110,99,98,189,146,4,142,128,196,110,52,38,142,59,37,38,202,96,227,1,241,39,46,252,76,1,78,124,141,86,92,70,227,179,160,99,86,4,134,18,1,149,0,12,37,250,17,220,54,105,123,60,168,253,166,83,245, 34,21,141,34,9,81,206,104,91,112,167,169,85,226,179,18,164,32,49,90,106,154,91,33,33,32,9,28,29,137,146,143,68,48,63,239,158,105,16,57,138,87,2,152,35,142,159,55,26,90,69,38,199,201,172,148,88,169,109,166,132,96,116,96,162,163,84,4,20,129,161,65,64,25, 128,161,193,61,226,91,37,241,223,122,186,65,110,154,49,78,110,249,204,44,73,75,73,144,22,108,109,73,236,203,142,84,202,125,79,190,39,239,224,254,236,228,24,195,4,80,28,30,233,137,76,81,2,136,255,123,103,26,229,170,188,84,249,167,59,102,201,248,177,41, 6,151,104,175,87,202,43,207,202,255,60,189,69,158,59,88,37,179,211,98,71,13,46,145,62,239,58,62,69,96,184,34,160,12,192,112,157,153,17,218,47,18,185,68,28,250,111,169,106,146,43,166,164,202,119,238,186,82,242,115,39,118,27,77,97,222,36,185,240,91,207, 200,25,72,3,146,163,189,210,0,201,64,36,243,0,118,231,191,171,182,89,102,167,199,201,15,238,186,66,74,10,179,187,225,82,60,45,67,14,124,251,73,217,95,215,36,121,9,148,144,168,36,160,27,72,122,65,17,80,4,194,130,128,234,0,132,5,70,173,196,34,192,7,202, 236,230,79,52,200,251,47,200,111,39,254,173,173,173,144,114,183,73,75,11,196,220,72,231,47,152,46,223,191,114,186,28,40,171,49,58,2,184,107,174,71,234,27,21,33,41,253,104,56,86,47,159,189,186,164,157,248,119,224,210,98,134,62,171,40,71,110,61,63,87,170, 14,215,73,34,245,1,34,28,151,72,157,111,29,151,34,48,18,16,80,6,96,36,204,210,8,233,35,73,56,9,93,19,181,216,240,37,47,123,156,233,57,137,156,23,34,110,170,186,121,163,188,134,9,160,192,255,138,37,51,69,198,199,201,161,154,38,40,5,70,174,242,27,113,137, 1,30,101,181,77,50,117,74,178,44,59,127,134,193,133,204,16,113,241,128,49,48,248,128,65,34,243,52,141,184,97,231,111,143,76,76,102,125,83,4,20,1,69,32,204,8,40,3,16,102,64,71,123,117,36,96,181,80,236,131,58,187,76,30,159,230,131,195,57,223,199,45,71, 227,157,95,144,138,11,178,228,43,203,243,229,8,118,197,241,228,28,34,52,113,100,113,208,137,56,133,113,254,203,21,69,50,53,199,57,18,241,118,210,242,163,29,128,147,50,38,0,183,164,40,169,193,241,72,12,10,219,235,17,10,143,14,75,17,80,4,134,8,1,101,0, 134,8,248,72,109,150,52,237,16,8,215,194,137,9,50,126,92,170,111,152,157,73,24,9,31,165,2,113,177,209,114,245,197,144,2,192,66,160,178,190,5,31,32,130,157,179,70,4,76,180,130,60,217,0,17,255,184,56,185,156,82,15,164,86,72,73,184,243,183,137,95,121,68, 194,52,145,184,141,143,151,35,40,19,27,161,152,216,113,235,167,34,160,8,12,29,2,202,0,12,29,246,17,215,50,201,25,25,128,230,58,40,186,101,166,64,243,63,209,25,163,31,161,235,24,180,67,252,206,153,57,69,238,188,40,71,246,85,54,24,98,103,68,4,29,153,70, 252,183,22,16,245,100,216,252,239,63,88,43,223,134,206,67,225,212,201,102,76,61,65,98,121,159,244,49,201,178,114,114,146,156,169,107,145,104,0,218,166,50,128,17,255,28,232,0,20,129,225,136,128,50,0,195,113,86,70,112,159,140,2,96,109,139,20,100,141,145, 164,132,56,51,18,135,212,119,30,148,35,5,104,147,196,248,88,249,135,101,37,80,28,104,147,122,28,29,68,154,200,59,22,4,252,108,35,118,255,73,209,114,213,197,37,18,133,51,127,103,167,223,29,21,123,37,21,38,147,69,153,144,2,0,71,104,8,0,56,123,167,51,134, 250,75,17,80,4,20,129,254,32,160,12,64,127,208,211,178,157,16,104,39,85,112,104,147,151,53,22,138,109,193,17,174,133,231,228,203,237,231,103,200,246,83,141,18,7,37,193,224,74,117,106,122,88,254,160,107,223,180,216,40,217,121,160,70,190,188,114,154,204, 40,200,52,253,164,164,191,39,9,128,61,18,72,140,143,147,188,12,232,1,0,71,199,101,240,176,28,158,118,74,17,80,4,70,56,2,202,0,140,240,9,28,78,221,39,81,107,166,5,0,52,250,179,39,141,49,93,11,180,219,229,77,18,60,222,79,77,78,144,155,46,159,37,2,6,160, 157,137,24,78,3,11,161,47,20,231,211,25,82,53,119,255,80,2,184,102,105,9,116,30,98,204,120,123,34,254,78,19,14,30,188,159,51,25,248,225,179,17,120,50,142,130,61,30,8,161,43,90,68,17,80,4,20,129,30,17,80,6,160,71,88,244,98,40,8,240,97,170,130,2,160,140, 139,149,73,62,11,128,64,187,93,214,79,66,199,251,76,139,231,78,147,107,22,77,132,235,224,6,120,203,131,152,220,185,60,98,223,121,246,159,138,221,255,182,35,181,114,215,242,41,50,187,56,199,140,133,12,143,221,233,119,29,156,131,135,51,242,140,137,96,0, 146,163,165,26,120,82,15,96,196,3,210,117,176,250,91,17,80,4,134,28,1,101,0,134,124,10,34,163,3,36,91,49,32,84,251,161,0,120,89,102,178,80,145,205,36,208,174,222,146,221,13,143,75,79,145,255,179,18,82,128,35,245,198,100,206,145,28,244,86,114,248,222, 35,22,102,247,223,132,221,63,254,191,111,233,76,73,78,140,247,237,254,123,7,196,50,62,180,4,152,10,171,129,253,144,32,68,3,36,123,125,248,142,90,123,166,8,40,2,35,13,1,101,0,70,218,140,13,211,254,114,39,79,6,64,170,155,165,36,59,77,82,146,226,77,79,123, 39,119,206,49,0,77,226,152,46,88,80,40,23,204,31,43,111,157,174,55,209,242,124,151,205,189,145,244,198,126,39,65,236,191,173,162,94,110,191,48,83,230,207,158,106,186,223,219,238,223,142,207,226,149,158,150,36,243,38,131,137,130,30,128,101,146,108,30, 253,84,4,20,1,69,32,28,8,40,3,16,14,20,181,14,131,64,148,97,0,96,1,144,157,46,9,208,238,15,54,89,2,151,57,49,93,62,126,37,44,2,14,58,142,129,70,162,249,27,89,153,56,252,85,213,195,147,31,181,248,111,88,62,67,210,83,147,204,238,223,241,134,216,7,42,62, 48,82,160,23,81,72,75,0,152,2,50,89,140,250,40,173,183,21,1,69,64,17,8,26,1,101,0,130,134,74,51,246,134,0,119,174,70,108,15,194,151,155,153,222,91,214,110,247,120,38,78,199,64,76,23,159,59,93,138,103,166,201,27,8,151,155,10,251,121,106,193,143,168,132, 238,210,146,97,43,34,254,93,61,127,130,156,63,175,208,116,63,216,35,13,43,1,136,141,137,150,60,226,8,29,0,150,213,63,212,17,245,20,104,103,21,129,17,129,128,174,43,35,98,154,134,127,39,185,249,55,187,222,148,104,201,152,224,111,1,16,100,223,125,91,220, 60,184,201,189,243,242,34,145,195,245,142,99,160,17,102,20,8,218,143,4,46,224,100,163,220,118,217,12,153,128,179,124,35,250,55,177,16,250,198,194,48,67,62,166,199,177,4,240,192,178,194,137,177,48,194,88,161,190,7,171,57,20,1,69,96,72,17,80,6,96,72,225, 143,140,198,73,175,232,178,246,112,125,179,100,101,192,5,48,98,220,51,241,122,32,141,247,174,35,167,3,161,22,72,1,184,3,94,118,126,177,36,228,38,202,182,170,70,39,82,224,8,161,124,236,38,29,255,108,169,110,146,115,139,210,228,226,69,96,100,144,12,3,96, 190,5,249,230,99,0,172,37,64,45,131,6,233,25,64,144,224,105,54,69,64,17,8,22,1,101,0,130,69,74,243,5,68,128,103,245,38,216,77,77,179,44,201,73,149,49,56,243,14,37,89,102,97,122,126,134,252,231,242,2,169,65,240,28,250,209,31,73,180,47,14,140,80,235,209, 122,185,99,229,76,201,154,60,214,192,96,199,229,22,19,50,82,179,39,32,38,64,35,25,0,183,165,53,191,34,160,8,40,2,189,35,160,12,64,239,248,232,221,32,16,224,206,215,88,0,84,53,75,17,93,0,39,58,46,128,131,40,218,41,11,119,185,212,5,160,187,220,43,46,66, 208,156,244,88,57,6,179,66,6,9,26,238,22,1,196,128,76,208,193,218,102,25,151,155,100,164,24,28,92,215,160,63,157,6,28,232,135,143,227,33,35,117,78,70,138,52,32,80,18,25,0,229,1,2,1,166,215,21,1,69,32,20,4,148,1,8,5,53,45,211,51,2,117,116,1,156,46,84, 96,51,41,20,138,229,35,126,37,211,179,229,223,151,230,201,225,227,13,134,185,24,238,59,96,42,43,38,67,92,81,177,191,86,254,243,170,25,66,93,6,166,80,164,23,22,54,198,82,152,158,13,125,138,246,152,0,166,74,125,83,4,20,1,69,32,44,8,40,3,16,22,24,71,119, 37,81,160,114,141,45,216,3,199,118,184,0,166,2,128,37,100,110,208,177,82,0,50,17,215,93,10,199,64,160,252,181,12,18,132,39,149,187,236,225,152,216,175,4,104,255,149,67,90,33,147,227,101,197,133,51,204,216,29,11,134,80,80,112,70,25,133,58,141,37,0,67, 9,163,154,208,107,26,142,168,105,159,20,1,69,96,168,17,80,6,96,168,103,96,132,183,79,226,71,197,183,83,244,121,111,92,0,195,118,29,137,34,251,80,207,190,109,185,57,8,21,252,201,139,115,100,231,9,122,7,28,190,143,42,221,254,166,128,249,41,43,171,65,200, 223,194,246,144,191,228,88,66,145,0,16,63,107,54,152,61,25,166,128,192,183,5,128,134,90,23,235,211,164,8,40,2,138,64,87,4,134,239,170,218,181,167,250,123,88,34,192,93,46,21,223,246,227,236,123,73,102,146,140,181,46,128,251,181,95,119,130,226,48,84,240, 13,151,65,10,80,221,34,176,134,31,150,182,240,24,190,36,98,167,126,156,187,255,49,177,178,18,186,11,209,81,240,95,0,130,29,108,52,196,110,19,11,74,207,122,153,76,76,5,212,91,3,41,136,254,177,58,152,232,187,34,160,8,132,7,1,93,83,194,131,227,168,174,197, 4,171,129,11,224,89,89,169,146,154,146,216,111,44,184,211,245,209,63,89,48,59,95,110,187,40,83,54,31,175,55,238,117,135,155,50,32,25,19,158,253,239,61,92,39,95,90,49,85,102,22,102,251,198,111,71,224,30,14,35,234,247,201,251,199,165,39,203,133,25,73,178, 23,138,128,196,57,244,90,221,247,67,75,40,2,138,64,100,35,160,12,64,100,207,239,160,140,206,208,42,184,172,205,207,132,5,0,20,215,156,228,163,96,33,246,192,150,78,75,73,144,91,46,159,45,82,209,104,194,226,218,235,33,86,27,214,98,220,165,243,236,255,36, 252,31,80,255,225,234,139,103,74,124,92,140,177,100,8,202,237,111,47,189,177,227,164,75,224,217,217,56,86,129,137,165,177,180,80,14,160,23,212,244,150,34,160,8,184,65,64,25,0,55,104,105,222,110,8,80,1,176,153,219,114,120,171,203,205,24,35,84,92,99,234, 239,121,53,245,0,172,123,224,243,24,42,120,201,36,121,27,82,128,84,16,90,158,185,15,135,196,94,36,68,123,164,20,253,162,174,2,117,22,194,157,24,83,129,177,21,4,38,150,196,122,120,140,60,220,163,212,250,20,1,69,96,40,16,80,6,96,40,80,143,144,54,73,140, 184,43,101,204,122,73,138,146,140,137,105,102,100,33,217,190,247,128,137,85,6,164,67,156,15,93,129,32,65,229,13,38,52,174,103,24,232,195,115,236,113,81,216,152,115,236,16,0,252,195,165,78,200,95,231,236,63,124,127,86,180,138,152,194,152,0,141,14,233, 183,146,129,30,224,210,75,138,128,34,160,8,184,66,32,124,43,149,171,102,53,115,36,32,64,77,117,50,0,101,48,83,75,31,31,47,19,199,58,22,0,29,39,248,253,27,165,191,20,224,252,249,133,114,209,252,113,242,214,201,122,73,27,38,82,128,88,88,38,236,56,221,40, 55,47,154,36,231,206,201,247,13,54,124,123,116,107,9,144,57,17,190,0,18,162,96,106,169,30,1,251,247,68,105,105,69,64,17,240,71,64,25,0,127,52,244,187,43,4,72,234,162,241,4,53,64,3,126,9,20,213,58,44,0,92,85,211,107,102,43,5,200,134,91,221,127,90,81,44, 114,172,193,120,197,27,106,223,248,48,124,112,76,245,206,52,201,205,43,74,140,251,99,227,243,63,76,230,138,28,183,101,37,38,34,160,144,76,138,151,227,96,180,200,112,217,235,189,2,167,55,21,1,69,64,17,232,3,1,101,0,250,0,72,111,7,70,128,162,120,35,146, 134,2,32,99,215,83,97,205,73,225,19,84,147,16,50,72,16,211,37,231,21,201,140,162,84,217,128,80,187,41,224,60,134,42,84,48,9,48,221,254,110,62,219,40,151,207,25,39,23,64,58,193,68,213,132,240,141,156,21,154,106,101,76,90,146,92,147,157,44,71,97,106,201, 160,75,195,68,5,194,233,156,190,43,2,138,192,136,69,64,25,128,17,59,117,67,223,113,208,64,199,71,63,206,167,167,66,1,144,10,107,76,160,217,97,77,118,183,159,159,59,73,238,88,14,98,91,209,96,218,176,215,195,218,88,144,149,145,16,203,145,122,249,48,116, 19,24,242,151,41,220,227,182,93,73,78,140,151,153,116,9,124,214,177,4,96,240,37,77,138,128,34,160,8,244,23,1,101,0,250,139,224,40,45,79,18,4,5,120,199,5,48,158,162,28,122,172,67,50,231,214,97,166,132,254,186,0,116,179,43,147,19,228,0,118,195,241,67,176, 27,230,184,25,156,104,19,118,255,115,75,198,180,135,252,13,151,226,163,1,209,190,249,24,41,154,22,78,69,140,5,19,19,32,204,204,149,109,74,63,21,1,69,96,244,33,160,12,192,232,155,243,240,140,24,148,48,10,34,128,42,120,168,131,39,156,118,11,0,115,14,30, 158,22,58,213,98,117,1,138,166,101,201,55,151,231,75,37,76,239,232,24,39,204,188,70,167,54,123,250,193,99,135,36,28,63,180,148,213,201,157,87,249,135,252,237,41,119,255,174,249,211,250,156,201,144,0,224,2,77,46,135,82,242,209,191,17,105,105,69,64,17, 24,78,8,40,3,48,156,102,99,4,245,133,59,97,74,193,15,32,6,192,12,88,0,88,49,248,64,13,193,74,1,200,116,92,125,9,76,2,19,162,165,26,109,51,72,208,96,37,186,59,72,6,241,223,85,213,40,19,11,83,100,233,121,80,74,68,26,144,221,63,234,229,152,173,37,192,228, 9,48,177,68,120,228,179,141,12,140,164,138,128,6,120,125,83,4,20,129,126,33,48,136,203,103,191,250,169,133,135,25,2,220,121,123,185,37,173,111,149,57,25,201,70,81,205,233,34,174,13,80,178,82,128,146,233,57,242,133,229,121,82,90,81,143,99,0,239,160,157, 136,211,237,111,34,56,142,83,7,234,228,203,43,139,100,106,174,19,242,119,128,134,107,170,181,12,192,184,244,20,153,157,145,32,187,97,113,65,5,68,85,4,28,72,212,181,110,69,96,116,32,160,12,192,232,152,231,176,143,178,157,204,195,71,125,97,86,154,80,81, 141,105,160,69,242,36,136,12,21,252,254,101,8,18,212,220,38,77,216,150,195,31,207,128,39,238,254,105,121,176,191,186,73,36,59,65,46,187,160,216,136,226,233,173,48,228,160,63,46,122,157,134,24,11,115,17,107,193,186,4,86,69,64,23,224,105,86,69,64,17,232, 17,1,101,0,122,132,69,47,246,133,0,54,161,216,15,131,42,66,36,157,151,145,46,49,209,150,12,183,179,6,125,85,225,250,190,17,137,251,74,157,51,99,138,124,98,249,20,121,239,104,173,9,197,59,24,38,129,241,96,0,202,17,244,231,155,151,77,147,233,249,153,190, 158,12,220,120,157,6,156,250,147,18,227,164,32,19,199,0,53,45,230,232,197,53,120,90,64,17,80,4,20,129,46,8,40,3,208,5,16,253,217,55,2,60,255,231,131,67,47,184,164,70,217,96,0,152,140,2,224,0,211,67,86,207,118,24,116,232,70,134,10,174,66,168,96,116,104, 32,21,227,88,127,34,76,30,142,214,98,247,159,22,35,43,151,204,52,12,207,96,236,254,173,68,133,82,143,41,48,181,148,166,54,19,11,97,32,199,107,38,83,223,20,1,69,32,226,17,80,6,32,226,167,120,96,6,72,2,84,75,11,128,212,24,49,10,106,104,198,158,87,15,76, 139,78,173,254,138,113,243,103,229,201,109,203,178,100,227,177,90,25,19,27,53,96,65,130,72,132,99,33,242,56,116,188,65,254,109,233,20,153,85,156,227,27,226,0,115,59,166,149,14,69,192,204,73,96,0,226,188,82,7,220,105,130,73,70,76,147,34,160,8,40,2,161, 34,160,12,64,168,200,141,242,114,60,2,216,15,45,252,197,147,18,101,60,20,212,156,52,24,4,209,209,142,103,123,99,82,147,228,166,203,96,17,112,170,217,120,5,100,180,188,112,39,18,89,42,221,85,81,220,129,207,235,150,150,72,124,172,13,249,27,254,246,186, 246,159,67,178,140,213,36,58,28,26,23,11,151,192,173,134,33,81,69,192,174,104,13,223,223,124,142,204,11,111,246,251,240,237,173,246,108,180,32,160,12,192,104,153,233,48,142,147,100,143,12,128,192,5,240,108,40,166,81,65,141,105,0,232,175,169,183,235,27, 165,0,237,161,130,231,76,147,107,47,152,36,239,28,175,27,144,32,65,28,38,205,238,118,159,108,144,143,93,152,37,243,32,117,112,18,239,12,78,34,193,96,26,11,70,107,233,228,68,169,168,87,143,128,14,34,195,243,221,18,120,126,242,41,161,185,44,153,72,58,144, 98,248,104,58,176,162,68,137,215,153,76,126,188,241,83,147,34,48,152,8,40,3,48,152,104,71,80,91,102,183,13,133,180,130,44,184,0,78,112,92,0,15,230,240,172,73,224,196,241,105,114,235,114,120,7,60,217,4,166,128,222,9,195,75,152,201,232,24,5,67,140,245, 6,232,28,208,218,129,59,242,193,208,252,183,120,218,17,145,209,42,206,128,20,160,182,197,97,192,66,136,60,192,241,132,242,98,31,134,138,64,177,93,182,63,92,251,109,113,97,255,200,44,210,81,212,24,68,172,76,199,139,186,35,45,80,34,169,132,180,108,55,188, 87,110,173,105,146,253,48,229,60,219,212,98,166,55,5,102,165,233,56,190,74,195,209,14,25,4,30,237,88,172,109,189,38,163,190,41,2,3,128,64,244,0,212,169,85,70,56,2,92,160,76,130,40,154,177,234,251,171,144,70,81,182,91,186,77,6,128,65,130,162,16,125,239, 194,133,133,114,193,236,119,229,213,242,90,153,155,30,7,103,57,36,144,237,189,180,189,117,253,201,5,152,187,181,205,216,253,223,112,222,36,89,228,11,249,27,74,127,93,55,238,87,192,50,59,84,124,156,74,75,128,134,50,159,226,163,95,166,94,190,114,28,220, 109,38,192,103,2,81,161,63,3,139,14,239,217,239,61,85,97,239,51,236,83,35,8,89,3,94,189,229,239,169,142,254,92,51,115,0,162,26,131,1,16,119,90,158,244,212,190,237,167,109,203,254,102,191,155,81,176,190,133,87,194,155,168,28,74,162,31,143,55,122,165,100, 170,2,97,223,126,26,202,162,167,240,130,143,12,220,52,138,163,9,73,209,50,21,206,171,98,193,28,212,226,249,44,133,249,172,156,110,16,65,52,73,42,118,74,50,172,104,224,232,169,8,249,200,64,160,164,49,113,37,230,228,188,194,240,56,155,254,233,155,34,224, 143,128,50,0,254,104,232,247,160,16,224,98,68,151,180,84,72,203,246,143,1,208,227,210,28,76,149,168,43,132,178,150,200,231,100,140,147,15,95,86,44,175,222,247,58,20,3,226,64,236,194,231,41,143,59,58,41,111,144,15,126,118,86,71,200,95,103,173,15,102,96, 237,121,250,203,52,88,169,67,46,241,6,92,198,255,1,250,65,186,214,91,119,136,44,197,124,124,189,91,81,231,16,28,31,177,106,239,92,95,95,88,9,232,211,88,196,96,200,136,139,194,201,15,221,17,247,85,168,255,247,137,89,28,8,255,81,132,65,62,89,94,111,252, 62,244,58,216,174,77,178,223,236,231,196,56,41,73,138,1,61,238,153,121,232,90,172,175,223,236,23,235,77,194,118,157,158,41,79,163,127,251,17,161,146,193,154,72,196,111,44,30,39,139,138,39,75,30,152,227,201,19,82,205,115,195,64,89,177,49,81,226,1,195, 218,218,210,34,13,141,205,82,91,223,40,149,167,170,229,104,197,25,41,61,88,41,47,111,43,151,53,165,167,205,209,154,140,5,51,144,18,3,29,91,175,137,183,81,235,195,124,16,96,239,107,248,122,63,130,16,80,6,32,130,38,115,176,134,66,2,123,6,187,24,25,31,39, 38,86,61,26,230,162,136,181,205,85,34,81,227,238,214,238,112,93,21,70,102,127,41,192,178,197,197,146,247,248,22,217,5,17,235,180,196,104,72,201,251,183,216,147,191,161,120,118,3,118,255,203,23,78,144,243,231,23,152,238,57,227,116,183,12,219,113,178,2, 255,239,166,194,32,222,56,78,234,60,240,51,115,34,36,0,9,81,198,2,35,14,59,250,22,67,141,122,174,132,116,138,59,127,102,217,113,186,81,238,186,40,71,46,152,147,107,28,41,145,137,104,39,166,189,125,103,54,212,113,228,248,25,249,175,213,59,229,93,184,65, 46,73,4,49,37,190,238,96,232,185,147,1,174,178,75,36,254,219,32,54,63,7,132,240,43,31,158,43,89,147,210,36,42,10,68,148,237,6,234,51,235,227,61,38,228,171,60,85,35,15,175,219,45,171,15,86,73,73,90,172,145,96,56,55,67,123,167,52,33,17,184,83,180,191,23, 207,218,73,68,166,196,15,249,232,185,25,114,197,226,105,82,82,152,37,153,147,210,37,21,199,53,150,65,13,166,165,230,102,48,57,103,170,229,224,145,74,121,103,235,1,249,251,107,123,229,201,205,149,134,241,154,54,33,94,198,197,69,67,88,208,98,24,111,30, 115,217,33,6,83,183,230,81,4,2,33,160,12,64,32,100,244,122,143,8,112,225,1,93,148,3,80,0,188,114,74,170,164,167,37,247,152,175,175,139,150,16,158,173,174,147,35,21,167,164,216,231,88,199,94,239,171,188,189,111,23,217,105,83,38,201,103,86,76,151,127,253, 237,38,137,154,26,35,94,16,168,254,44,146,44,77,2,36,135,234,229,163,255,188,24,140,14,8,47,146,91,162,199,56,1,212,23,40,63,113,70,106,235,26,101,106,206,4,83,143,219,113,218,177,80,231,33,109,108,156,28,131,85,194,52,76,4,37,201,129,250,68,126,140, 202,103,91,202,235,228,251,55,148,200,157,183,47,151,196,126,232,107,44,154,157,39,203,191,253,148,57,191,78,198,110,150,82,136,129,72,172,149,253,62,5,38,51,27,18,135,223,124,110,165,44,60,39,63,228,166,150,95,48,67,238,254,241,83,242,247,253,103,100, 22,152,137,80,142,3,216,39,50,82,227,65,136,121,196,244,118,105,181,8,8,243,119,111,157,45,43,46,44,150,162,252,140,118,111,152,254,29,229,60,219,100,190,241,13,143,21,121,24,155,200,216,69,195,145,22,159,49,190,22,204,206,151,235,175,88,32,155,119,28, 148,199,95,220,42,63,93,83,134,172,245,50,47,59,201,28,253,144,17,8,183,174,139,237,139,126,142,46,4,92,238,217,70,23,56,58,218,238,8,112,61,51,98,241,170,38,153,153,51,70,146,147,28,23,192,157,86,180,238,197,186,93,177,158,251,78,158,174,150,31,255, 97,157,156,58,83,99,242,248,173,151,221,202,244,116,193,238,142,121,239,10,56,232,161,8,246,20,68,178,246,76,182,167,50,125,93,99,223,82,65,224,222,196,25,237,130,185,233,178,228,220,233,166,136,221,133,247,85,222,222,231,88,44,113,94,253,202,86,121, 233,205,157,246,150,235,79,75,48,198,142,73,150,11,97,122,89,131,49,58,39,250,61,87,69,58,195,121,58,77,243,69,236,80,175,91,62,199,16,127,142,129,68,201,205,203,90,92,156,11,139,139,239,93,55,75,14,238,175,69,0,72,136,178,221,78,86,207,93,237,118,149, 99,53,162,255,35,117,242,165,107,102,182,19,127,55,125,182,121,89,121,62,98,54,220,66,69,81,212,71,237,123,183,137,124,14,149,243,198,197,71,201,219,240,57,177,11,145,40,191,125,219,44,217,242,253,235,229,11,31,91,41,11,102,77,109,87,14,37,195,103,219, 230,167,73,120,8,248,156,146,89,37,51,200,79,254,230,139,201,230,39,158,44,207,196,216,15,151,158,63,83,190,243,175,239,147,151,191,127,173,124,242,146,92,217,184,227,172,188,87,221,40,19,192,132,48,151,175,118,147,95,223,20,129,80,16,80,6,32,20,212, 70,117,25,248,222,231,194,85,221,34,211,16,163,158,177,234,153,220,47,171,14,136,117,56,7,253,175,103,203,228,221,237,101,206,133,16,222,237,66,90,4,41,194,55,46,47,144,50,44,244,52,183,178,235,175,219,42,185,176,58,187,255,58,185,227,138,98,161,142, 129,73,190,5,59,216,250,218,218,28,177,125,117,77,189,252,113,245,118,57,126,178,42,216,162,61,228,115,16,78,77,78,144,233,153,176,4,160,130,25,82,95,93,50,68,26,146,12,155,207,33,26,118,182,58,62,13,65,50,179,200,107,254,47,182,209,97,118,185,28,49, 16,100,114,188,148,67,52,207,35,136,129,32,66,100,92,78,130,193,225,17,211,242,243,209,30,18,21,62,59,39,255,62,118,124,119,158,5,254,118,146,37,194,77,16,177,131,242,218,203,65,127,242,136,133,103,253,100,28,222,218,113,70,254,177,100,156,188,242,221, 107,229,11,31,191,82,102,33,40,21,9,58,25,36,135,25,114,8,188,193,18,152,181,127,246,210,90,123,30,228,183,12,2,251,108,234,68,189,137,208,29,88,178,176,72,190,255,185,235,228,209,175,47,151,236,248,24,121,235,96,53,248,92,175,196,96,56,3,197,132,245, 210,101,189,21,65,8,40,3,16,65,147,57,24,67,193,178,230,44,58,88,143,115,125,46,128,67,105,215,46,197,148,0,72,69,163,60,249,210,118,105,108,106,54,11,170,93,180,131,175,151,196,30,140,9,8,210,53,112,212,131,213,90,106,177,243,133,50,181,235,196,5,149, 187,255,13,103,26,36,183,83,200,95,4,253,177,84,52,136,90,217,31,135,24,137,108,217,121,80,86,253,254,144,84,158,169,51,202,95,65,20,239,150,197,54,77,134,107,42,148,203,4,4,146,199,20,129,134,72,124,121,94,61,22,38,102,240,28,36,27,113,174,204,228,140, 193,234,94,56,196,221,214,77,186,207,239,157,95,118,167,234,204,24,143,90,190,181,178,80,14,28,168,145,84,224,220,155,14,130,105,208,229,27,241,167,22,124,217,161,90,249,198,138,2,153,54,101,178,169,193,127,215,236,16,205,174,253,116,126,51,179,211,127, 135,1,100,94,62,99,143,189,178,27,34,251,88,115,134,30,44,211,194,177,209,195,100,5,176,222,82,90,37,63,185,99,129,252,242,43,255,8,171,147,34,137,166,254,69,139,35,77,241,66,249,197,233,159,203,193,6,200,206,62,155,58,169,48,8,137,0,153,129,148,164, 4,185,126,229,185,178,230,187,55,200,167,150,230,202,219,91,207,24,41,87,34,176,10,247,28,4,232,150,94,142,64,4,2,173,31,17,56,84,29,82,56,16,192,186,103,136,171,140,9,221,5,176,63,113,44,63,113,22,90,218,49,242,163,87,15,202,214,93,135,76,23,221,50, 0,92,240,237,162,62,179,48,91,190,176,50,95,118,128,128,164,134,224,30,152,139,47,117,28,90,142,213,203,191,92,54,29,4,104,146,3,27,27,113,145,64,59,12,3,208,208,216,36,207,190,178,29,196,199,43,135,78,212,72,77,29,180,217,145,108,127,131,173,146,253, 178,184,228,50,38,0,42,128,154,3,8,79,224,186,64,159,28,130,159,26,13,9,196,54,169,168,60,107,250,100,235,9,182,109,230,179,237,71,67,9,239,138,11,33,78,79,142,150,211,80,64,8,119,56,102,30,221,208,213,49,39,225,202,139,102,26,66,235,244,215,29,254,78, 159,157,17,190,249,238,30,249,235,27,229,80,2,140,11,90,9,144,68,117,44,244,15,54,130,17,44,135,185,235,147,223,94,41,119,125,232,50,227,245,210,33,202,14,195,73,92,6,50,153,35,3,48,2,86,2,194,231,241,123,119,95,39,63,251,236,34,121,175,172,198,40,131, 166,128,97,85,38,96,32,103,33,114,235,86,6,32,114,231,54,236,35,35,81,163,40,116,47,22,254,233,136,77,63,126,172,227,2,216,18,59,55,13,218,133,243,8,76,160,160,86,13,211,167,102,121,14,132,146,59,64,238,126,220,18,41,46,195,44,19,7,55,189,239,187,20, 65,130,64,67,234,65,72,140,190,66,144,29,227,241,107,34,196,229,251,106,96,206,53,9,33,127,161,220,197,157,29,23,95,103,231,28,92,69,196,195,166,93,251,142,202,55,86,239,145,244,5,169,242,230,161,179,114,182,10,166,120,76,126,121,156,11,125,191,91,76, 50,38,130,1,128,77,57,149,217,204,113,76,160,162,0,165,1,92,64,9,76,35,159,126,231,184,188,246,14,118,193,72,150,152,7,42,214,211,117,210,57,219,254,12,104,186,255,203,178,41,178,243,8,152,44,16,234,112,17,31,214,147,6,166,109,43,234,189,19,145,30,217, 14,19,241,116,75,103,73,164,57,78,30,191,60,178,102,43,109,246,204,179,128,8,210,230,128,163,167,49,218,107,150,248,111,56,81,47,25,9,49,242,198,55,174,149,171,151,205,53,210,41,62,11,236,11,9,243,96,38,250,187,32,254,70,26,128,99,160,79,221,182,92,30, 250,247,165,178,23,209,41,79,54,52,195,98,37,202,72,124,6,183,87,131,137,128,182,53,16,8,40,3,48,16,168,70,104,157,116,32,195,179,241,250,234,38,89,148,211,225,2,216,237,112,45,129,172,111,104,146,67,21,144,0,160,206,2,156,247,254,244,197,82,41,221,127, 204,84,103,149,161,130,173,219,159,168,157,83,156,43,159,92,49,69,182,28,174,53,4,133,162,240,96,18,215,116,238,64,43,161,228,245,181,101,249,50,163,32,219,20,227,177,135,187,228,104,254,147,153,89,243,42,20,255,32,130,47,78,141,149,221,199,234,218,149, 29,29,130,234,174,86,155,155,166,151,121,192,171,18,218,224,189,17,70,246,154,142,123,226,169,193,150,20,37,15,173,217,102,218,39,86,236,155,219,100,49,166,67,162,171,47,134,20,0,76,86,13,250,64,71,56,238,107,235,222,58,153,25,227,95,2,22,38,215,45,157, 97,34,62,146,250,247,54,198,238,181,216,43,78,143,54,110,221,47,191,121,245,136,20,140,139,51,142,140,250,234,104,59,241,175,172,151,57,227,19,228,217,175,93,7,7,80,211,76,165,36,190,36,196,196,97,40,18,219,37,115,108,153,144,27,175,90,36,79,220,179, 66,14,157,108,52,150,9,100,198,130,125,214,135,162,255,218,230,240,67,64,25,128,225,55,39,195,182,71,92,82,141,118,61,66,240,78,207,78,151,36,184,197,13,37,241,236,154,169,166,174,65,202,42,160,3,128,167,48,51,41,86,142,237,171,145,117,111,238,50,247, 120,158,111,119,156,230,66,16,111,150,64,209,50,225,250,101,208,5,128,232,182,1,82,0,74,45,250,34,80,188,207,124,198,191,1,118,215,87,95,226,136,159,185,232,187,221,237,217,182,202,14,29,151,239,63,183,83,38,229,38,58,161,147,225,78,184,130,71,30,237, 201,230,108,191,208,199,23,135,240,48,8,210,194,204,20,57,5,73,76,95,127,192,148,92,212,64,31,162,100,66,130,252,121,253,81,121,107,243,94,211,6,175,135,138,47,43,152,95,146,39,55,47,158,44,91,193,220,36,129,240,132,194,80,248,15,214,217,253,123,101, 35,76,22,111,184,48,67,230,161,126,38,214,235,150,224,146,121,36,161,36,131,249,196,75,219,232,181,202,196,137,232,203,119,1,37,64,105,70,255,163,81,162,226,163,229,247,95,188,74,200,76,154,157,55,250,193,58,135,67,34,19,194,231,146,233,154,101,243,228, 111,159,191,84,246,31,172,53,14,131,232,163,160,191,115,49,28,198,168,125,24,28,4,134,199,19,61,56,99,213,86,250,137,128,33,63,164,89,141,112,1,140,115,232,24,216,46,51,133,186,33,58,91,85,43,59,43,96,254,135,179,86,18,0,42,105,253,233,133,157,114,232, 216,73,83,175,219,133,204,50,0,44,60,31,54,235,183,93,148,41,155,65,80,168,212,215,87,93,28,155,57,222,56,209,32,119,195,228,106,118,81,174,233,131,91,226,67,98,97,143,11,94,126,123,183,28,219,91,45,57,48,195,51,59,51,79,155,28,133,67,29,38,183,245,58, 101,76,81,99,122,57,61,11,126,9,192,80,112,215,220,219,126,148,247,232,1,47,17,68,90,98,61,242,55,216,149,87,213,212,153,246,221,50,0,78,31,28,198,129,230,136,255,184,20,26,250,213,205,134,240,4,195,100,57,189,239,249,157,227,224,35,192,152,14,55,44, 45,106,143,48,25,10,78,246,124,101,235,174,131,242,195,181,251,37,103,82,60,142,66,88,57,95,61,39,182,77,203,17,195,0,130,113,92,251,133,43,100,206,140,41,237,76,146,157,211,158,75,15,254,85,50,35,150,9,120,255,229,11,228,183,119,95,32,59,246,215,24, 197,87,30,123,5,30,233,224,247,85,91,28,190,8,40,3,48,124,231,102,216,245,140,206,71,234,169,89,6,23,192,89,140,77,143,20,18,17,241,141,140,182,255,27,113,206,154,13,207,118,116,167,58,127,92,188,188,180,241,164,188,177,113,143,201,97,207,61,125,217, 131,250,176,76,192,88,56,40,186,113,57,252,2,192,92,145,231,224,125,17,40,156,66,56,142,109,192,220,252,195,178,89,198,188,49,148,221,167,33,98,232,105,69,229,25,249,3,76,255,36,211,71,124,184,34,3,183,131,229,103,218,21,186,130,26,80,15,153,200,120, 229,195,4,147,94,128,130,97,190,72,92,233,188,102,86,70,162,252,114,205,1,121,119,91,153,169,213,98,213,67,19,1,47,249,151,161,119,196,11,103,166,203,150,179,141,142,50,96,136,84,135,204,31,189,46,190,3,191,11,139,102,143,145,243,231,57,94,23,29,81,119, 111,236,77,247,110,218,221,63,205,254,168,83,2,111,66,146,1,207,133,53,144,2,244,70,196,65,51,193,31,65,255,3,82,168,135,238,188,16,190,31,138,76,229,28,82,104,76,72,247,190,133,251,138,61,14,96,189,183,190,239,124,249,234,7,102,200,187,251,170,141,143, 134,112,183,165,245,69,38,2,202,0,68,230,188,134,125,84,36,108,177,160,146,39,104,159,61,33,78,38,141,135,45,58,18,25,0,55,11,164,127,126,250,65,23,184,168,165,169,21,119,104,134,152,141,141,145,135,94,216,38,149,52,15,244,213,111,190,4,249,198,190,216, 221,254,98,16,146,43,23,140,151,45,112,231,75,115,41,75,156,187,86,197,69,62,1,247,183,130,25,249,232,37,217,126,33,127,187,230,236,251,183,25,3,178,145,137,89,243,110,165,113,99,203,115,120,234,79,208,133,239,254,99,103,164,14,30,1,153,216,174,219,100, 25,46,19,131,161,205,25,107,95,36,146,247,217,7,35,5,192,247,199,94,216,42,244,191,224,16,115,183,61,232,32,136,89,147,199,202,135,150,193,73,82,37,199,211,102,156,229,184,175,141,42,32,62,41,198,241,70,249,208,210,66,201,205,26,111,170,233,141,96,7, 110,199,65,117,55,148,47,255,99,117,169,76,202,78,52,154,242,189,201,73,200,128,140,161,198,255,190,42,249,234,173,51,229,186,203,22,152,234,205,241,143,157,208,192,13,6,125,135,207,31,231,47,208,115,24,116,69,126,25,201,36,211,28,49,54,38,90,62,113, 203,69,178,226,156,113,198,125,117,114,47,207,187,95,113,253,58,202,17,80,6,96,148,63,0,193,14,223,40,0,98,155,116,24,14,96,150,101,36,201,216,49,142,5,64,176,229,253,243,89,134,225,24,207,195,177,227,102,196,61,46,219,103,240,125,62,180,239,31,122,249, 40,236,214,247,155,34,36,2,150,232,249,215,209,219,119,67,56,176,202,78,130,219,220,219,46,131,178,26,162,179,49,36,43,214,196,128,68,215,252,33,64,252,252,129,21,179,219,189,186,245,69,88,187,246,193,106,158,87,193,189,241,163,47,98,247,9,243,59,142, 149,210,103,52,207,208,130,178,243,88,181,17,193,155,178,188,230,42,117,244,40,99,2,142,0,210,162,97,60,193,35,135,190,43,161,244,230,52,164,0,51,115,18,229,71,207,237,109,55,185,36,125,115,75,144,12,147,229,59,131,94,186,184,72,98,97,17,82,14,105,68, 40,162,103,226,194,48,184,101,120,174,36,35,94,150,158,231,236,188,73,124,237,115,210,247,232,156,28,100,252,184,43,230,120,94,120,13,202,151,56,23,207,75,142,193,41,5,119,255,61,215,226,232,30,68,201,91,167,234,229,220,233,105,242,177,15,92,8,75,146, 104,35,94,239,239,153,63,159,91,142,195,188,12,200,118,194,121,221,222,179,215,122,238,95,48,87,169,47,195,250,50,39,166,203,215,62,114,177,239,88,38,52,63,24,193,180,167,121,34,7,1,101,0,34,103,46,7,124,36,140,124,70,145,250,140,172,84,161,71,186,80, 146,89,7,81,176,25,187,150,163,199,193,0,160,78,238,0,185,120,183,139,220,161,177,254,55,236,82,169,36,72,177,128,45,19,108,123,134,64,249,10,93,188,168,72,22,22,165,201,102,88,46,208,191,124,215,196,54,169,61,253,206,113,40,159,93,156,1,183,179,83,77, 22,22,119,75,128,44,123,177,17,34,246,223,191,126,84,10,17,154,152,254,242,89,23,95,217,208,69,88,127,162,195,18,192,230,239,218,167,64,191,13,177,246,221,164,171,216,121,147,19,141,73,38,21,51,131,33,35,236,75,34,245,54,64,16,255,254,226,123,66,49,185, 51,198,96,74,119,238,149,197,166,0,142,122,190,182,188,64,142,33,90,31,37,68,221,17,238,92,174,235,47,78,9,159,171,202,202,6,249,207,139,167,26,159,250,204,99,235,239,154,191,215,223,190,97,148,29,62,46,63,124,118,187,164,78,129,203,100,40,64,34,124, 80,192,98,100,140,204,221,163,104,255,214,243,218,189,62,134,212,190,175,21,75,248,57,95,100,34,204,139,237,248,189,172,125,63,63,45,51,16,176,147,65,220,96,91,76,139,231,21,202,119,111,42,145,237,56,10,8,197,15,134,83,139,190,143,22,4,148,1,24,45,51, 221,207,113,182,47,161,216,233,229,67,1,48,17,166,96,78,106,191,19,100,11,206,42,77,17,116,89,57,24,0,248,0,224,21,190,184,115,103,60,117,158,85,255,252,249,3,178,21,30,244,152,184,184,145,128,186,73,118,1,167,27,223,143,173,128,178,26,162,182,145,80, 118,127,224,17,136,133,13,192,27,225,109,151,207,18,234,14,48,217,5,53,216,54,185,136,115,161,103,152,215,103,94,198,238,31,12,14,207,181,41,122,103,93,212,217,166,75,89,198,127,63,209,238,18,24,191,93,38,91,130,209,230,230,102,167,73,51,34,210,25,95, 7,65,224,67,70,171,26,248,22,34,168,204,55,159,45,149,29,165,135,77,235,110,177,101,33,226,235,236,184,61,178,114,9,164,44,240,10,72,7,62,224,1,130,78,236,50,251,78,175,141,44,184,242,162,25,38,40,78,40,187,127,18,93,107,173,241,210,27,59,229,192,206, 42,41,78,137,53,103,255,129,230,210,136,254,113,252,180,241,80,141,124,250,218,124,185,100,49,198,129,20,74,251,166,160,41,139,249,198,167,35,61,128,5,6,152,216,253,176,6,217,176,101,175,188,244,250,54,89,253,202,22,121,229,173,29,178,25,174,175,143, 34,8,22,153,48,203,12,240,25,114,43,237,178,237,154,249,128,180,129,204,212,77,87,45,148,169,83,83,100,23,34,55,210,171,98,40,243,107,235,213,207,200,70,64,163,1,70,246,252,134,109,116,36,30,77,148,101,227,127,14,24,0,187,216,6,90,92,251,106,184,166, 182,94,74,143,193,55,62,24,0,238,76,45,221,0,221,148,88,104,171,11,52,230,159,90,183,77,230,35,208,10,35,165,57,11,163,205,213,87,237,62,2,101,136,178,71,24,13,46,245,111,91,228,40,156,13,209,53,110,35,174,51,145,0,164,227,247,91,216,149,95,126,222,4, 236,158,58,236,189,157,5,188,239,118,58,114,176,78,143,236,216,115,88,190,183,174,76,38,78,140,111,223,253,99,77,54,196,146,138,136,184,40,230,232,131,185,241,211,41,213,81,75,176,223,24,213,111,122,54,20,49,95,56,40,49,153,142,4,32,24,116,232,8,135, 140,9,14,198,229,169,151,182,74,73,145,227,207,158,248,90,166,41,216,62,216,246,232,125,241,238,229,121,114,239,170,125,178,32,55,9,193,152,2,139,220,253,235,102,121,98,242,46,116,47,62,118,65,150,49,185,51,247,67,120,168,72,228,88,236,104,197,105,249, 213,179,112,252,147,155,96,24,146,64,122,4,204,159,0,209,185,209,250,199,51,119,211,21,231,192,221,110,188,217,141,187,159,123,103,84,100,28,108,217,195,176,100,121,99,211,30,121,121,227,126,121,105,231,9,217,136,32,66,136,81,237,156,5,145,75,74,139, 145,203,115,82,228,162,153,147,101,201,130,124,19,80,40,197,39,85,115,152,73,139,174,63,98,189,127,183,243,55,53,103,162,252,199,251,102,203,63,127,239,21,41,158,147,14,38,168,185,87,41,72,239,181,234,221,72,70,160,251,134,40,146,71,171,99,11,9,1,46, 150,220,169,113,119,78,23,176,25,19,28,11,0,46,84,118,209,9,190,98,103,97,59,3,19,192,85,229,181,50,17,54,247,100,0,108,100,59,46,226,117,96,52,242,38,39,200,55,158,223,43,244,164,199,196,62,184,77,150,142,228,195,125,234,61,43,139,228,24,220,3,51,142, 187,143,254,27,137,3,105,50,124,189,202,135,46,159,41,147,125,227,114,59,38,103,39,236,216,95,155,179,231,138,122,153,98,52,207,49,46,223,58,206,54,13,49,66,167,14,211,251,33,146,105,39,148,129,161,44,149,191,166,24,75,0,202,22,130,79,132,145,10,151, 153,8,232,243,165,85,187,101,247,94,139,111,8,0,131,225,33,227,192,248,4,239,187,20,126,23,224,192,135,186,22,118,204,125,245,138,208,24,120,32,21,185,126,217,76,248,149,136,51,245,185,61,72,112,152,23,167,181,245,27,118,201,107,91,78,201,60,56,94,226, 115,228,131,191,91,87,56,90,154,253,237,170,168,147,79,94,154,43,243,102,230,249,242,184,199,129,237,243,69,226,95,139,29,255,35,207,188,41,55,125,245,97,249,199,175,175,145,159,60,183,79,54,194,186,97,26,162,84,206,154,146,36,115,242,147,165,36,39,9, 252,73,180,172,42,59,43,95,253,243,86,185,244,223,159,146,187,127,240,55,40,142,150,154,62,56,199,2,238,230,149,5,249,60,145,9,97,186,20,186,25,211,103,166,201,91,112,101,76,47,129,246,153,55,55,245,77,17,240,33,160,12,128,62,10,125,34,128,229,205,48, 0,123,96,1,144,141,24,232,244,68,199,196,235,110,18,105,157,37,202,38,8,16,108,238,39,64,251,154,59,114,123,157,245,209,27,28,181,178,105,33,176,122,61,196,233,72,92,20,185,200,186,73,102,65,68,25,18,129,43,224,87,30,206,221,77,148,57,122,51,228,238, 159,103,255,111,159,106,144,115,103,35,228,239,66,39,228,111,40,166,103,232,152,233,214,254,131,21,242,203,23,224,110,23,196,213,74,25,108,127,185,44,27,98,4,83,192,3,199,206,26,39,53,188,231,110,68,78,109,22,7,99,138,137,250,154,32,54,113,67,116,201, 112,77,68,72,89,1,241,91,181,30,142,114,144,72,188,108,189,78,43,125,191,115,206,236,148,208,102,254,182,165,89,178,9,126,23,210,130,8,18,196,113,147,0,111,2,113,188,106,225,68,191,144,191,29,207,72,223,61,112,114,176,15,156,107,62,83,127,90,133,221, 63,172,84,56,191,129,18,239,240,25,160,126,128,52,181,201,117,151,20,27,223,10,246,24,39,80,185,158,174,219,102,216,254,145,242,83,242,149,159,62,33,55,126,117,141,172,7,115,59,183,48,85,22,65,20,63,55,45,22,250,17,94,243,76,212,66,4,67,159,16,41,192, 136,102,175,139,166,167,74,113,86,2,188,21,30,150,197,159,251,155,252,246,145,151,205,49,18,231,195,18,243,158,218,13,124,205,97,121,242,32,5,248,20,98,89,180,30,174,247,41,217,6,198,35,112,93,122,39,210,17,80,6,32,210,103,56,44,227,163,162,30,42,194, 14,111,225,228,36,73,31,147,100,106,117,150,26,55,13,116,72,12,42,42,33,254,135,19,25,18,1,28,29,119,74,252,201,157,100,12,22,242,95,131,160,242,12,149,201,45,129,50,133,124,111,133,83,51,228,27,87,22,202,222,178,90,71,4,142,235,166,255,208,13,248,200, 101,69,216,77,135,102,122,198,62,89,177,239,250,13,165,178,11,49,219,23,193,247,126,21,136,139,63,81,182,132,130,190,0,246,87,84,73,53,142,64,76,106,191,225,235,104,31,31,36,52,54,25,70,108,34,152,26,88,79,184,209,192,231,73,142,49,75,4,190,191,88,189, 75,246,130,113,97,162,36,195,109,178,221,25,147,154,40,55,98,23,79,71,62,236,97,32,209,187,173,159,184,49,156,176,28,170,151,15,174,152,225,231,248,199,230,8,254,211,246,225,141,77,165,242,248,219,199,101,22,8,46,165,28,1,71,131,27,60,122,216,1,197,208, 139,139,199,200,57,51,114,77,99,189,148,8,216,25,142,131,115,114,224,200,9,249,212,247,30,147,123,31,47,149,5,37,105,50,15,10,160,181,96,204,42,234,155,141,15,6,50,132,196,157,125,226,49,76,61,222,78,193,42,227,56,238,179,252,185,57,201,82,0,135,69,31, 249,198,203,114,223,31,158,151,58,120,49,12,133,9,176,210,3,226,127,254,220,169,194,160,93,199,113,244,69,15,129,33,76,111,192,113,235,141,200,64,64,25,128,200,152,199,1,31,133,33,59,80,0,156,158,153,38,246,172,210,71,66,67,106,219,88,0,160,36,149,150, 122,90,120,169,60,55,19,1,92,182,237,169,130,123,96,152,116,33,133,180,75,5,57,226,34,77,231,57,87,93,2,49,53,44,12,232,116,136,190,7,182,128,0,100,76,73,150,101,126,49,231,253,9,172,105,180,143,55,214,205,84,126,226,140,252,241,121,72,43,50,124,154, 255,61,144,31,67,116,177,243,219,82,81,43,167,207,226,76,24,201,41,109,190,6,253,102,23,242,116,40,44,94,150,149,44,7,112,158,79,11,7,123,189,175,138,200,152,208,124,112,94,114,172,108,47,61,43,107,95,219,97,138,132,234,120,201,238,84,23,205,201,151, 203,206,157,32,111,227,76,63,13,210,149,64,187,112,246,147,202,105,239,193,129,16,197,212,23,44,40,52,237,135,114,164,100,203,84,153,160,63,144,102,64,167,36,26,220,42,137,172,121,102,123,0,131,227,55,9,230,161,215,45,154,34,25,48,159,99,234,139,105, 49,153,252,222,28,137,1,44,24,32,121,248,242,253,207,202,227,111,85,200,5,51,199,72,21,56,90,154,92,146,224,83,193,148,245,178,73,219,172,249,142,55,234,213,240,69,230,224,4,24,129,4,96,182,112,254,24,249,194,189,27,228,247,143,190,98,24,50,195,4,4,59, 177,126,125,227,87,50,189,183,207,159,36,251,224,7,131,241,32,186,240,217,93,114,235,207,209,136,128,50,0,163,113,214,93,142,153,187,127,46,102,210,136,179,249,204,49,18,143,136,123,76,88,187,92,37,187,142,81,83,254,32,28,226,72,66,207,187,18,86,203, 99,0,179,32,99,7,243,255,94,220,105,8,44,27,179,4,55,216,134,217,71,91,102,38,162,203,125,225,242,124,217,133,32,65,169,56,98,104,130,233,218,221,48,97,227,66,201,228,150,0,176,94,187,251,167,143,253,213,175,31,151,133,16,235,210,159,1,23,118,255,196, 95,24,146,228,128,241,216,131,99,135,147,167,33,1,65,234,156,203,92,10,250,141,74,107,37,57,240,7,80,5,75,0,76,82,79,140,84,160,202,28,215,196,184,139,160,66,191,123,126,135,28,58,90,105,178,134,38,5,112,70,65,66,122,235,50,216,241,195,161,15,137,108, 32,60,91,208,83,198,15,168,131,157,254,93,151,79,151,220,76,71,250,210,31,48,222,121,111,159,252,15,130,254,20,50,232,143,221,106,247,48,120,62,198,124,158,27,169,109,138,78,158,59,43,215,52,107,25,137,30,138,244,120,201,153,123,199,18,226,119,143,174, 151,255,93,117,80,22,67,156,95,129,221,54,155,231,252,7,59,183,204,199,252,213,144,26,81,111,225,28,48,1,159,252,241,235,96,204,156,227,25,222,183,207,112,143,157,233,114,209,50,177,233,105,73,178,228,28,4,180,130,164,141,207,30,199,173,73,17,240,71, 64,25,0,127,52,244,123,55,4,218,23,76,42,23,97,5,201,158,220,225,2,216,46,52,221,10,245,113,129,138,82,123,112,14,78,133,66,199,2,160,251,202,196,186,107,177,147,154,141,115,251,103,222,57,33,140,233,206,196,235,110,22,67,167,140,115,190,157,16,23,43, 215,44,133,152,26,196,231,16,76,164,72,252,86,66,55,128,173,115,23,235,118,60,196,134,233,44,28,255,60,130,72,123,140,101,96,24,37,231,114,231,119,52,66,166,38,5,59,49,46,200,230,8,4,57,220,182,105,42,245,193,149,16,31,43,211,50,177,123,133,111,134,246, 93,109,231,86,3,254,34,193,225,49,197,124,224,251,242,187,39,101,253,6,39,84,112,168,82,0,122,163,99,186,104,97,161,228,23,164,200,219,216,221,211,27,93,87,134,130,132,136,187,255,67,48,95,68,172,93,227,248,7,93,113,180,239,249,197,69,226,156,81,228, 77,113,249,147,12,250,131,62,80,255,160,175,160,63,148,58,29,134,20,168,24,230,144,83,178,39,184,104,177,35,171,101,102,223,194,115,249,111,127,222,34,197,197,41,16,245,27,25,79,208,132,191,163,54,231,27,165,5,116,89,108,2,110,193,133,244,183,254,248, 170,97,124,157,103,190,107,238,192,191,153,223,74,101,138,242,39,81,217,194,28,67,244,229,14,59,112,141,122,39,82,17,80,6,32,82,103,54,92,227,194,130,205,5,169,138,50,213,148,14,11,0,183,68,216,191,59,213,8,70,179,249,104,181,196,33,72,142,97,0,122,88, 247,121,137,162,209,120,16,11,186,208,125,108,237,14,161,229,128,179,24,90,210,235,95,107,224,239,164,43,182,191,115,103,78,145,59,151,230,202,158,23,79,201,55,86,20,72,113,129,19,115,222,45,33,38,1,176,221,126,23,54,221,191,95,119,88,206,129,130,36, 119,113,61,17,99,230,37,115,16,11,229,46,202,167,143,209,9,18,82,72,227,49,37,157,178,52,201,100,50,218,247,237,61,242,101,232,227,195,136,232,217,177,241,177,242,199,85,219,66,150,178,176,25,18,98,38,90,92,124,98,41,204,41,161,91,193,29,103,87,41,0, 165,20,134,1,64,28,251,175,46,203,111,151,190,152,194,33,190,209,95,196,255,93,91,38,83,96,57,194,29,116,111,137,189,36,161,61,123,86,169,149,83,0,0,64,0,73,68,65,84,182,73,86,20,143,111,87,104,229,51,18,108,178,162,127,70,27,252,203,179,155,80,140,14, 150,124,62,31,130,173,164,135,124,236,57,251,70,9,210,194,177,241,242,226,134,19,242,194,171,142,20,32,20,37,88,54,145,7,221,150,249,48,205,220,99,61,53,246,14,79,15,189,210,75,145,140,128,50,0,145,60,187,97,26,27,215,246,131,56,211,100,124,244,9,99, 67,115,1,108,8,166,111,145,101,16,160,237,208,64,207,163,24,30,68,62,208,218,75,226,193,32,54,37,208,170,255,159,151,15,9,9,45,83,40,68,211,234,15,164,36,37,200,181,23,195,49,80,121,179,92,9,199,51,212,13,112,43,254,117,96,117,148,191,26,155,154,229, 137,181,88,164,225,187,128,59,203,222,206,89,73,155,200,207,96,149,55,166,128,116,2,195,20,202,154,108,25,154,201,116,9,156,10,119,183,96,60,32,216,112,85,23,165,0,134,216,128,113,121,234,181,114,99,183,206,254,88,172,248,61,216,196,57,49,59,114,124, 174,184,0,248,194,236,173,28,231,218,198,205,179,111,128,124,6,104,123,127,178,1,110,127,225,22,249,138,11,139,124,110,119,121,148,18,232,41,232,185,7,14,17,134,5,132,13,250,3,139,145,73,216,233,82,106,212,87,85,70,20,14,169,73,81,238,56,161,20,197,125, 114,6,180,115,239,17,185,247,213,131,146,129,99,7,62,199,86,42,224,190,190,206,37,0,161,9,96,69,107,146,135,94,220,33,39,207,216,184,24,157,243,245,254,203,193,115,44,60,70,206,129,231,78,42,240,178,94,190,52,41,2,22,1,101,0,44,18,250,217,51,2,92,52, 72,162,235,33,142,207,76,150,49,56,87,116,146,219,149,164,131,204,157,56,133,243,111,40,96,49,56,77,111,27,54,182,64,101,192,36,216,49,147,178,62,181,110,187,49,159,11,133,1,96,159,45,209,156,3,41,192,3,127,90,42,69,211,236,238,223,25,145,155,119,91, 215,118,120,211,99,200,217,124,56,254,161,232,185,183,212,126,70,15,75,128,178,242,42,99,51,110,242,187,164,28,254,227,39,67,54,21,59,223,82,236,240,104,106,230,178,42,35,162,55,76,11,164,0,127,94,245,158,144,57,99,114,91,143,41,228,163,46,51,224,24, 232,243,23,77,145,195,112,239,75,233,145,37,58,68,135,86,31,165,144,14,252,243,133,89,50,187,56,215,20,115,199,182,248,138,248,62,24,244,231,43,171,74,37,51,136,160,63,44,194,103,202,204,18,230,42,115,34,152,39,147,122,159,55,95,38,39,39,128,177,122, 31,155,182,29,20,57,1,198,35,62,218,204,125,95,140,135,127,61,189,125,103,111,40,112,155,142,56,6,143,109,61,41,187,247,29,235,45,123,143,247,44,230,100,112,166,76,2,3,0,231,76,28,184,219,191,218,30,43,215,139,17,131,128,50,0,17,51,149,3,51,144,246,5, 3,4,166,0,10,128,201,137,241,166,33,187,192,184,105,149,132,139,201,88,0,96,1,230,14,180,175,165,151,121,40,5,40,194,2,255,131,213,251,140,167,61,214,225,16,65,126,11,62,217,133,123,226,56,4,125,185,233,18,227,249,141,165,109,191,130,173,137,196,223, 236,146,81,96,21,253,20,84,53,99,19,30,101,206,248,219,241,234,177,50,39,48,16,119,191,187,43,106,140,238,64,143,217,92,92,28,147,154,36,231,130,49,107,174,105,54,166,109,237,76,70,144,117,88,41,192,252,137,9,242,151,181,71,228,109,184,172,101,226,84, 89,38,39,200,170,140,184,159,59,115,6,211,185,102,41,220,234,66,192,209,192,51,109,83,23,143,63,28,235,3,18,163,247,65,10,195,120,18,22,203,96,219,96,62,167,140,99,245,240,252,171,176,96,128,82,103,78,31,65,127,108,253,28,23,119,235,18,239,245,139,104, 201,187,189,207,156,45,111,49,169,133,43,235,205,187,65,152,33,249,33,147,99,148,42,109,166,126,126,178,39,60,158,161,230,62,61,54,238,216,227,56,107,10,229,24,32,26,76,97,54,25,0,72,136,168,161,16,46,38,165,159,67,212,226,195,4,1,101,0,134,201,68,12, 215,110,112,193,48,68,5,231,146,121,80,56,99,228,177,254,36,18,136,195,229,176,0,192,46,216,16,255,62,56,0,46,134,148,2,164,209,49,16,206,109,87,33,198,123,135,179,158,62,10,247,208,81,238,108,73,4,40,250,15,53,89,197,182,189,101,229,242,139,23,247,72, 172,207,241,12,233,74,111,137,99,161,34,224,4,48,0,175,28,135,41,160,111,183,221,91,153,192,247,88,27,244,40,97,9,80,8,211,76,42,22,134,186,184,19,19,211,245,244,104,249,203,170,45,198,71,129,97,176,2,55,30,248,142,211,45,153,59,51,79,110,63,63,67,182, 195,226,129,246,254,172,159,159,219,160,28,184,114,206,56,161,201,32,147,37,168,230,71,144,111,236,47,211,254,67,21,242,157,103,118,200,216,188,190,131,254,56,37,28,50,111,172,4,48,7,169,201,14,51,203,234,248,76,4,147,124,77,203,89,232,163,236,56,140, 231,24,166,170,142,234,95,48,165,131,207,195,103,201,120,199,4,215,180,231,208,73,105,246,29,23,5,91,131,195,32,59,189,77,79,69,224,46,124,53,207,62,42,176,99,8,182,46,205,23,185,8,244,111,53,143,92,92,116,100,64,128,11,5,31,16,108,226,58,89,0,144,0, 186,221,53,163,6,147,234,27,26,101,63,45,0,96,143,223,174,132,102,111,6,248,228,46,149,26,235,217,185,137,242,197,231,118,203,190,3,142,227,26,75,8,2,20,235,241,178,93,232,67,33,60,172,144,229,168,41,207,180,238,173,93,178,15,81,215,102,128,8,216,160, 63,230,70,128,55,182,205,221,231,120,110,133,79,54,138,57,10,65,222,80,136,173,29,71,28,76,50,105,154,73,143,118,156,23,235,82,57,64,23,122,188,76,198,129,218,231,179,32,5,248,205,218,67,242,206,123,251,77,190,32,105,98,167,58,89,134,24,113,119,127,227, 114,88,92,84,194,161,13,46,26,221,7,230,196,184,111,134,169,224,68,132,106,102,242,120,220,45,65,172,219,234,11,172,69,208,159,242,210,42,153,6,127,6,244,176,103,49,49,21,7,120,227,113,150,121,238,48,7,222,40,135,9,12,101,156,213,240,59,176,227,36,156, 57,129,145,165,1,68,240,70,127,1,58,214,229,114,59,145,70,63,143,84,214,26,75,7,102,193,240,93,167,232,104,120,125,196,36,176,108,40,99,117,221,160,22,24,49,8,184,251,235,27,49,195,210,142,134,11,1,42,226,145,56,192,190,10,190,242,125,103,166,33,44,66, 118,225,170,174,109,144,221,190,32,64,220,13,7,155,104,17,64,37,47,138,123,95,120,221,113,92,19,138,72,212,182,23,42,3,99,119,255,12,58,67,255,4,146,30,99,142,50,140,88,217,86,30,224,147,139,47,232,180,209,24,151,186,86,104,221,251,124,1,144,114,89,128, 2,148,237,126,185,195,28,210,184,4,142,241,24,239,114,36,180,193,163,218,81,43,167,130,26,232,20,141,255,245,249,45,33,235,90,56,59,79,167,222,243,230,78,147,101,243,199,27,95,248,244,71,127,160,182,73,242,114,147,229,226,115,29,183,203,142,233,101,71, 31,130,249,102,97,58,130,72,122,191,122,6,202,151,190,160,63,193,16,127,214,207,124,100,214,32,142,104,151,2,133,130,23,119,228,21,56,154,74,32,97,13,166,227,110,243,216,74,49,159,180,54,176,102,125,161,204,46,153,68,68,3,26,16,73,133,219,97,105,254, 225,133,128,50,0,195,107,62,134,93,111,184,123,43,131,205,244,69,136,61,207,24,244,253,77,103,206,214,200,243,229,53,146,141,5,152,58,115,168,62,168,196,124,116,239,234,133,125,244,127,175,222,129,99,132,147,166,156,37,8,65,85,210,207,76,102,247,233, 163,52,116,252,179,106,99,165,156,3,59,250,106,48,72,93,205,221,2,53,69,6,130,214,2,20,173,80,23,130,71,34,76,110,199,193,110,176,63,76,147,184,155,30,19,11,47,188,45,142,75,96,75,60,204,221,224,222,88,132,132,177,96,124,188,252,244,165,3,237,22,23,182, 141,224,106,113,114,89,98,76,93,139,15,95,14,93,128,131,117,198,247,253,169,163,245,114,23,28,47,209,79,61,147,91,38,140,125,180,117,191,2,233,203,27,91,17,244,7,33,127,249,92,4,251,28,153,118,249,134,202,220,98,222,94,22,95,216,15,90,19,132,82,7,235, 233,51,217,1,161,159,157,113,178,55,250,172,161,61,131,97,90,9,158,65,201,125,249,246,138,244,75,196,33,160,12,64,196,77,105,120,7,68,241,59,21,145,74,96,74,68,177,46,147,93,132,131,109,169,125,237,65,1,186,77,133,19,116,227,143,223,238,166,131,173,135, 82,128,89,80,246,122,107,199,25,89,255,182,227,184,134,125,25,176,69,184,75,199,72,12,185,24,211,141,239,99,47,65,249,15,110,103,227,176,229,102,191,130,93,86,13,22,172,23,59,237,3,208,133,168,195,145,136,147,218,239,248,126,247,253,97,75,144,49,91,52, 41,65,142,192,212,139,49,1,66,73,44,69,41,134,9,21,12,125,143,39,214,110,245,197,170,239,238,204,167,175,250,137,145,101,108,150,192,49,208,180,25,105,178,137,226,242,177,177,178,226,194,25,6,43,206,125,103,194,214,87,173,152,103,226,140,186,43,79,85, 203,255,174,198,238,31,113,16,40,206,231,9,85,176,137,115,72,183,201,80,219,199,185,58,204,17,67,76,209,49,209,146,101,181,255,67,172,35,168,98,24,115,82,66,12,220,27,135,174,179,210,216,8,167,75,0,137,195,118,171,36,26,84,31,53,211,136,69,64,25,128, 17,59,117,3,223,113,18,5,99,51,93,211,34,133,217,233,176,153,142,11,173,81,46,246,190,146,21,39,112,254,15,147,194,80,188,146,57,18,3,212,4,177,251,95,214,108,55,209,223,72,16,218,218,220,144,128,80,135,208,65,176,54,239,56,32,191,125,233,176,204,130, 39,59,90,40,24,38,41,200,106,137,131,209,24,135,19,164,61,56,10,169,193,89,114,168,201,98,202,64,60,37,25,144,206,128,1,8,145,254,155,46,128,214,24,38,32,3,74,141,223,126,97,175,108,221,117,208,92,15,69,10,96,199,68,79,123,119,95,89,44,167,31,61,33,255, 121,217,52,153,158,159,105,110,217,190,219,124,193,124,98,170,77,122,29,97,115,255,190,225,184,148,32,228,175,81,232,11,166,176,47,15,153,38,35,129,129,180,196,173,98,29,171,176,76,87,42,252,73,20,143,79,164,88,10,245,133,159,176,182,227,3,139,137,156, 9,41,237,254,10,44,6,190,225,4,245,209,4,95,21,244,5,220,94,103,80,165,52,211,104,64,64,25,128,209,48,203,253,29,35,98,0,76,129,5,64,40,139,143,109,218,238,246,14,87,64,115,26,79,29,149,166,192,23,184,78,220,109,207,128,62,194,95,55,84,8,197,240,78,26, 248,165,141,125,229,24,120,30,251,244,203,216,253,35,133,226,253,141,227,110,2,39,147,6,233,193,235,199,106,228,12,220,8,135,156,124,19,146,4,211,204,124,90,2,128,88,56,253,12,173,70,50,15,244,164,151,5,230,68,42,27,229,57,159,197,5,149,30,221,74,107, 168,159,97,29,3,93,194,51,255,140,88,185,236,252,233,198,68,48,20,134,130,18,5,226,79,183,203,143,190,128,144,191,192,47,22,220,41,117,42,220,204,62,241,33,243,137,80,125,237,1,153,88,62,216,62,89,101,191,212,20,48,0,217,80,190,68,61,188,102,175,135, 134,124,231,82,252,179,32,227,109,148,21,161,220,56,45,103,156,81,124,116,250,24,220,104,153,215,254,205,157,56,93,107,254,230,56,108,243,124,116,110,78,127,141,98,4,148,1,24,197,147,223,215,208,249,112,88,155,233,204,73,240,57,143,20,236,66,105,50,119, 121,163,215,182,67,229,144,0,248,76,0,185,208,185,73,92,250,120,222,75,7,66,52,46,255,59,196,240,53,80,42,180,196,198,77,93,110,242,58,139,169,83,130,222,223,190,191,106,175,76,135,95,2,238,254,141,226,156,139,202,72,179,201,196,100,66,7,226,248,9,6, 5,114,188,188,113,177,118,139,173,37,5,180,245,206,101,140,6,96,67,233,130,145,218,184,232,147,127,86,246,129,253,75,205,136,151,175,175,70,120,227,189,142,13,186,161,28,254,25,93,124,207,131,20,224,191,126,114,137,20,79,115,118,255,14,158,182,247,46, 42,66,214,141,176,80,248,173,47,232,15,159,5,183,137,178,34,115,76,2,206,225,24,165,81,72,150,80,154,31,125,188,57,60,23,125,29,196,200,57,211,39,27,173,78,6,22,10,85,249,50,80,115,212,41,161,87,67,132,85,4,110,104,7,201,255,57,12,84,174,235,117,254, 205,29,164,217,45,254,102,200,164,12,188,172,172,107,15,244,247,112,70,64,25,128,225,60,59,67,220,55,138,74,43,65,228,60,240,114,103,98,207,163,63,92,114,221,44,152,28,2,119,29,76,12,2,180,143,12,0,108,176,121,22,233,126,249,118,118,123,140,165,62,21, 125,250,57,220,3,111,129,56,126,48,18,199,204,93,240,234,245,59,68,206,52,25,191,4,70,155,220,101,227,36,123,244,242,198,104,120,244,107,112,188,210,61,17,178,77,154,62,129,88,51,25,75,0,152,140,17,27,50,37,161,96,203,122,72,120,104,114,89,12,229,186, 186,178,26,89,131,80,193,156,63,58,62,114,47,5,112,150,151,164,196,56,185,245,218,197,237,74,164,110,77,255,140,36,1,207,98,29,156,239,252,157,65,127,48,230,52,68,85,172,7,225,13,141,141,192,64,97,53,113,132,210,40,151,137,152,51,238,2,211,156,25,57, 18,159,149,32,101,136,0,232,239,242,216,101,149,221,178,115,76,100,82,246,224,249,248,208,156,137,50,13,241,21,76,66,219,193,38,203,76,242,111,238,64,5,172,77,192,116,19,172,80,159,139,96,219,213,124,35,11,1,231,47,116,100,245,89,123,59,8,8,112,209,167, 168,244,8,60,204,93,155,157,210,225,2,56,164,21,196,41,68,241,237,78,120,192,243,96,247,107,153,2,183,67,225,26,88,139,133,127,2,20,176,168,156,248,28,8,50,253,241,27,2,229,91,152,221,214,217,87,126,219,215,253,7,43,228,155,171,118,201,100,248,35,168, 1,145,116,115,246,239,223,6,9,169,57,135,6,44,71,124,65,129,120,63,36,104,125,165,38,209,68,19,254,247,79,154,126,133,92,153,233,38,201,12,221,26,199,230,36,200,79,158,221,33,251,48,110,147,44,16,206,175,160,223,73,52,19,19,98,125,98,108,50,144,65,23, 245,101,116,10,188,135,160,63,63,126,113,191,113,125,92,71,227,251,16,201,191,209,193,64,96,171,173,251,43,141,211,35,183,189,177,22,31,5,121,25,242,133,37,121,114,6,146,28,50,93,238,199,213,115,203,124,14,200,31,50,160,210,245,151,206,128,199,74,199, 99,162,27,216,236,179,116,252,228,89,121,227,32,152,76,4,212,226,159,71,136,83,216,115,71,245,234,136,71,64,25,128,17,63,133,3,51,0,103,17,194,146,3,55,183,51,114,58,92,0,135,184,230,154,78,82,220,253,78,101,189,100,99,117,235,143,40,146,162,76,138,71, 51,51,19,228,30,40,171,209,31,252,64,37,238,164,172,227,153,151,222,220,37,103,15,214,72,38,252,17,80,76,222,159,100,22,98,88,2,80,60,75,6,198,164,126,84,57,110,76,138,92,58,49,17,174,233,169,8,232,134,84,116,31,133,35,5,104,145,121,208,181,216,179,227, 172,188,4,135,59,76,198,253,113,136,20,196,238,72,221,118,141,103,255,196,191,61,232,207,217,102,153,8,252,233,155,2,151,93,39,66,76,222,97,2,172,73,158,220,89,41,21,39,28,41,128,155,97,57,146,23,136,253,113,244,114,253,229,115,24,224,64,78,3,247,120, 116,168,31,83,104,254,180,200,156,164,67,186,177,161,188,78,254,241,226,76,185,104,81,177,25,35,251,199,118,131,77,86,39,97,255,161,19,178,251,80,173,76,7,195,204,227,60,23,85,4,219,148,230,27,193,8,40,3,48,130,39,111,32,187,78,1,189,89,96,97,1,48,45, 43,221,40,111,177,189,224,151,32,255,222,57,165,78,156,132,40,18,12,69,18,206,239,251,67,63,217,47,218,222,231,98,17,23,44,110,47,188,190,211,39,166,118,196,244,254,45,247,247,187,37,92,199,142,159,150,223,175,134,242,31,34,180,113,33,237,223,66,15,223, 241,4,32,25,150,0,71,206,118,4,5,10,169,179,14,182,105,41,137,50,35,211,23,245,141,245,132,54,81,237,61,176,76,150,76,73,144,251,159,222,42,135,143,245,207,239,130,27,226,213,222,9,191,47,212,69,248,234,115,165,146,11,169,4,231,62,170,31,3,164,114,221, 4,72,161,142,29,173,133,116,227,184,95,43,193,127,181,227,153,51,99,138,252,242,67,243,100,239,142,42,227,235,128,176,135,250,108,52,161,95,41,80,38,168,129,133,130,84,181,200,231,110,187,64,198,34,248,22,159,65,55,132,219,159,105,221,177,7,241,10,96, 214,153,12,166,219,48,0,193,15,81,115,142,2,4,148,1,24,5,147,28,202,16,185,11,52,103,190,88,209,178,39,59,10,128,161,212,227,236,92,156,146,70,233,10,34,106,158,111,186,61,79,238,218,54,85,154,40,134,79,130,56,254,167,207,237,148,178,195,190,133,60,212, 213,183,107,3,190,223,118,161,127,125,227,30,121,9,142,103,102,131,233,232,239,238,159,68,130,117,196,192,133,240,230,163,85,82,85,93,31,160,245,190,47,91,194,64,17,123,126,22,20,1,105,9,128,98,253,253,195,38,147,85,3,69,185,133,169,113,178,113,203,41, 121,25,142,119,152,184,27,183,76,145,185,48,128,111,124,70,108,123,207,191,10,230,235,88,157,100,36,197,152,221,191,29,183,219,230,137,61,117,48,140,37,0,198,242,198,230,50,115,166,111,219,9,182,62,62,23,214,215,193,45,208,111,248,228,63,76,147,215,183, 158,49,210,9,42,97,242,185,15,246,81,100,62,50,37,169,32,210,252,219,216,190,233,140,252,254,115,23,202,249,243,11,219,187,99,159,195,246,11,189,124,177,127,91,20,255,191,180,249,48,194,69,71,27,6,194,88,21,244,82,78,111,141,62,4,250,187,78,140,62,196, 70,193,136,185,32,49,16,25,149,193,120,174,108,93,0,59,11,63,151,80,55,201,49,71,226,130,120,164,2,103,145,88,224,120,118,78,5,110,183,53,249,183,138,106,204,78,144,182,224,123,182,159,149,87,124,142,129,220,46,228,254,117,118,253,238,184,170,245,200, 25,4,126,121,244,69,16,32,156,27,179,239,36,32,253,233,59,137,23,119,99,249,216,133,110,133,168,247,20,188,35,50,241,58,177,119,149,80,200,18,228,220,12,199,18,192,16,206,254,116,208,215,1,246,167,129,242,242,172,120,249,205,51,239,73,133,79,97,145,115, 57,40,201,215,14,119,233,95,71,208,159,137,83,146,164,218,232,56,244,111,112,20,190,24,25,14,52,236,255,250,214,65,57,226,243,42,105,9,103,176,99,227,179,70,38,128,14,178,190,250,137,43,228,150,165,89,242,234,230,83,134,144,115,199,205,191,33,182,101, 218,51,109,58,243,203,97,181,95,199,119,18,253,177,120,22,106,49,182,119,222,62,37,247,255,251,98,185,249,154,197,166,27,214,252,49,216,62,49,159,21,255,83,106,242,200,198,227,82,8,111,149,117,120,104,251,123,52,228,166,15,154,119,100,32,160,12,192,200, 152,167,65,237,37,23,248,56,108,99,118,66,187,121,78,38,93,0,39,155,246,121,157,68,193,77,178,196,130,30,239,14,146,1,128,166,122,72,132,174,135,70,185,160,81,19,92,114,226,229,119,207,109,3,129,114,127,158,219,67,181,221,46,109,220,186,95,254,244,198, 81,41,76,143,115,118,255,92,193,251,153,200,0,25,115,198,211,180,4,112,98,2,152,42,45,96,65,214,207,233,176,69,178,104,170,9,66,66,233,2,177,233,111,55,89,55,149,1,231,64,23,224,249,77,149,242,234,6,71,10,96,230,175,191,149,247,49,62,127,49,246,139,136, 253,112,106,111,181,76,129,244,133,132,204,229,35,216,173,37,246,159,38,132,51,81,223,134,210,179,178,105,107,153,201,19,10,102,150,9,200,152,56,70,126,242,249,235,228,139,55,23,35,164,242,25,121,183,170,209,120,28,28,131,231,157,59,123,134,246,141,65, 195,100,10,40,125,72,196,151,52,220,75,195,61,198,74,220,128,227,136,210,242,6,249,211,119,46,149,59,110,89,42,177,136,157,96,173,31,186,13,160,151,11,86,103,162,5,127,23,235,55,238,51,138,178,233,120,38,168,52,217,95,220,122,105,86,111,141,80,4,148, 1,24,161,19,55,144,221,230,238,40,150,17,239,112,94,63,63,59,85,120,190,236,164,80,86,125,167,76,117,77,29,76,0,97,243,78,115,36,36,75,180,156,122,67,123,231,130,198,40,112,243,198,196,201,154,119,78,200,27,155,246,152,138,194,65,160,156,133,20,102,117, 198,241,15,76,255,64,84,83,105,102,7,194,193,250,251,155,184,3,52,62,4,208,255,99,62,69,52,55,98,222,158,218,159,48,46,85,146,199,197,194,74,49,124,139,61,216,43,135,145,24,27,35,255,187,106,171,156,66,8,99,246,211,74,29,122,234,71,56,174,217,231,227, 72,249,41,249,229,179,219,196,131,179,255,58,156,253,135,3,123,78,31,153,164,4,82,99,60,143,127,91,187,221,72,121,204,184,90,57,98,119,137,125,226,243,194,8,135,95,251,244,213,242,232,119,86,200,121,227,18,100,51,152,150,119,142,212,202,38,48,3,148,92, 144,37,227,156,83,210,80,9,15,130,27,17,42,249,157,178,106,217,6,61,150,143,44,202,148,183,126,114,189,220,246,190,11,76,144,34,135,248,135,178,60,59,127,111,123,14,148,203,119,159,223,45,233,48,83,52,184,41,249,119,55,169,163,36,55,108,169,52,41,2,157, 17,224,18,66,247,166,144,177,75,1,188,157,37,38,88,23,192,238,41,159,179,28,193,116,30,254,243,183,156,128,71,50,44,184,36,126,225,74,172,202,212,55,62,86,30,122,126,155,92,114,222,12,35,146,229,34,107,69,161,161,181,197,154,113,30,91,122,88,126,184, 174,12,118,246,241,102,215,24,90,93,61,151,50,48,192,18,224,208,177,51,134,128,112,55,217,159,68,133,177,165,25,201,242,228,190,51,70,201,173,63,117,249,151,165,187,221,153,96,178,30,121,171,92,62,186,169,84,86,94,2,205,247,1,76,100,46,44,161,127,249, 173,157,242,246,246,211,50,183,48,213,57,251,15,83,187,36,246,100,30,103,192,159,196,111,215,29,150,219,175,222,39,151,158,95,130,218,29,230,198,13,51,198,188,236,47,153,128,132,248,88,185,254,138,133,178,24,145,16,215,67,98,178,118,195,126,121,113,87, 165,108,63,94,103,92,53,27,243,23,42,9,64,1,244,226,172,36,185,100,249,36,185,116,81,161,156,123,78,190,36,39,197,155,209,89,230,211,237,80,205,209,143,47,84,245,26,232,76,156,222,83,45,231,157,51,70,42,32,201,11,213,100,213,109,31,52,255,200,66,64,25, 128,145,53,95,131,210,91,42,216,153,29,24,148,192,166,100,164,183,135,77,181,139,178,155,78,88,146,198,32,64,101,39,27,36,23,81,235,104,234,100,175,187,169,43,80,94,158,83,207,132,174,194,159,94,63,42,31,133,167,184,165,139,17,129,174,31,201,46,192,45, 216,13,210,17,142,28,111,144,44,4,180,57,94,31,190,133,148,227,55,246,232,73,81,178,15,12,0,143,72,146,218,25,45,119,157,183,243,146,76,255,244,89,105,242,228,214,74,137,2,193,230,142,179,191,137,253,196,230,21,210,15,124,3,243,246,200,243,91,229,194, 5,211,37,5,231,222,161,239,82,123,239,21,159,61,50,67,180,26,249,227,42,56,254,65,108,2,170,54,114,111,30,174,231,134,245,240,248,104,92,28,150,64,140,235,207,207,108,150,249,179,166,26,105,151,213,253,232,189,151,221,239,154,227,0,116,158,124,28,61, 103,222,120,213,121,114,213,165,115,229,24,66,71,83,33,239,76,85,157,49,103,140,143,139,49,218,253,140,226,200,87,116,180,19,232,135,207,29,231,50,100,70,144,192,161,130,221,251,142,201,231,30,219,42,147,242,29,157,9,254,61,107,82,4,122,66,64,25,128, 158,80,25,197,215,72,50,232,214,148,98,67,250,91,207,194,217,38,83,40,34,95,103,61,114,22,159,227,52,1,132,68,33,5,225,102,141,9,92,152,214,36,86,131,141,28,54,84,232,52,118,86,79,192,83,220,226,249,5,18,15,87,173,14,33,15,165,33,162,224,49,14,112,126, 186,166,84,18,33,70,117,188,206,133,82,23,209,235,33,161,42,131,3,252,238,239,132,37,64,53,130,2,145,1,240,173,225,61,20,232,251,82,92,108,52,44,1,160,7,0,255,244,253,20,38,116,107,140,103,230,133,152,187,223,172,199,110,25,76,214,37,134,201,10,35,30, 126,45,90,134,230,117,72,27,158,218,120,66,74,160,252,231,54,232,143,95,117,1,191,114,87,76,251,253,5,208,115,249,239,103,246,203,85,23,110,147,127,192,238,221,250,59,112,35,5,176,141,24,61,2,60,62,12,80,197,242,156,83,122,242,107,247,230,103,51,250, 125,242,57,101,10,153,240,163,172,221,253,55,131,169,121,240,169,183,164,14,58,5,37,5,169,56,106,8,31,211,106,58,169,111,17,133,64,40,135,76,17,5,128,14,166,51,2,36,64,12,151,122,12,225,82,101,124,28,206,53,97,91,142,228,136,101,221,46,248,220,209,56, 101,142,209,227,29,136,8,3,184,224,35,172,123,18,246,153,196,52,103,92,156,252,248,229,3,178,117,231,33,223,160,156,133,213,247,35,168,15,142,147,4,128,233,149,183,118,203,161,93,85,50,27,150,6,180,136,8,39,81,37,42,196,33,23,110,145,215,150,215,154, 35,18,211,104,72,111,142,216,154,69,115,33,177,17,76,29,71,238,118,182,2,53,205,41,164,18,217,24,40,147,241,188,229,113,132,10,174,173,107,52,4,139,187,229,112,38,187,251,230,110,249,209,53,216,253,39,122,205,51,3,83,246,176,141,199,191,191,52,141,35, 3,41,208,49,248,207,63,191,41,101,135,28,115,210,80,24,94,91,47,241,226,51,196,103,159,196,157,10,121,28,23,235,180,47,254,54,47,243,188,121,250,69,252,81,69,123,122,245,237,157,242,181,71,118,72,73,94,50,60,77,187,139,84,217,94,137,126,25,53,8,40,3, 48,106,166,58,184,129,82,1,48,6,68,250,56,220,236,94,145,153,44,233,105,62,11,128,224,138,119,202,101,23,166,70,44,68,198,229,45,148,174,184,235,242,109,120,58,229,237,207,15,135,64,193,185,11,136,41,182,116,178,26,231,159,244,215,206,69,152,59,35,55, 201,102,167,227,159,223,210,241,79,118,188,163,248,55,0,228,135,125,163,227,23,57,213,40,39,78,57,150,0,28,139,237,67,176,253,102,25,155,168,141,78,115,197,250,48,41,204,217,122,41,70,166,223,133,2,120,95,188,247,133,253,178,101,231,1,223,45,223,113, 145,205,24,166,207,119,222,219,39,191,67,208,159,233,227,28,221,11,191,33,134,169,5,167,26,42,229,145,80,158,11,127,7,239,237,175,150,95,254,229,21,163,248,105,158,157,48,48,55,220,213,71,65,161,198,50,4,100,99,200,24,240,183,121,249,79,94,136,35,107, 133,180,129,146,135,67,112,214,244,213,255,121,25,1,132,162,33,197,115,24,237,16,171,212,98,163,4,1,101,0,70,201,68,187,25,166,81,24,66,12,128,98,120,150,163,141,51,83,104,11,176,67,124,25,144,164,172,28,4,142,59,72,36,99,131,109,190,133,239,141,68,147, 59,234,104,40,117,253,244,197,189,82,186,223,113,15,236,102,39,199,188,86,12,75,139,130,117,111,87,202,66,152,254,133,123,247,111,71,205,62,115,161,134,118,161,148,251,34,211,217,123,110,63,29,164,33,180,73,79,145,130,201,9,114,4,117,146,184,217,235, 110,235,235,154,159,116,138,49,24,198,153,24,12,45,242,20,142,90,26,26,25,131,161,67,250,208,181,140,219,223,220,17,147,40,214,34,232,207,147,12,250,3,128,24,244,199,152,176,133,246,0,246,217,5,226,99,143,2,230,97,215,252,189,135,118,202,99,171,54,152, 114,236,139,21,207,247,89,81,144,25,194,64,239,59,181,68,61,21,134,107,230,92,252,226,193,117,178,14,10,147,11,240,204,210,91,226,0,65,214,169,125,253,49,178,17,80,6,96,100,207,95,216,123,79,205,121,67,52,225,81,110,106,38,45,0,98,157,54,66,88,185,44, 241,169,130,9,224,110,4,1,98,64,146,129,242,70,70,58,202,69,111,94,106,140,28,131,249,213,58,248,237,103,226,226,24,44,19,96,251,75,199,63,15,81,252,60,9,10,139,3,36,122,102,223,216,158,129,21,146,145,195,229,167,121,201,119,100,98,123,98,46,185,122, 75,75,77,148,69,89,169,114,6,12,28,143,91,200,100,132,43,145,80,158,133,44,190,32,39,81,190,249,108,169,236,216,3,47,115,76,192,62,60,205,56,36,203,9,250,83,38,211,50,18,28,159,255,131,64,202,40,141,161,158,193,52,40,206,221,242,192,122,60,63,80,254, 228,208,56,182,112,130,104,106,13,207,27,25,38,62,223,76,127,122,236,85,249,206,35,59,101,110,94,146,227,192,43,60,77,104,45,17,142,128,50,0,17,62,193,110,134,199,69,156,18,105,163,112,133,149,47,7,49,230,157,51,252,208,180,246,157,229,28,82,121,216, 142,191,82,81,43,19,33,162,231,89,125,255,204,243,2,143,136,139,184,57,207,157,28,39,191,95,179,75,14,29,173,52,153,131,93,192,109,127,55,194,49,204,159,215,31,149,217,16,63,115,215,107,136,116,224,102,67,190,67,188,13,109,1,46,7,16,38,153,187,184,80, 147,237,59,77,54,139,16,188,137,62,28,232,97,46,156,137,181,113,55,110,164,0,56,106,121,102,221,86,115,190,237,40,190,245,143,5,176,10,155,12,140,244,204,203,96,190,160,48,58,30,65,118,6,18,127,127,108,248,156,115,108,41,112,192,67,229,215,75,190,191, 74,54,109,219,239,123,254,29,37,59,255,252,67,253,221,74,75,216,143,191,61,247,182,252,243,79,94,147,25,32,254,212,149,112,254,198,134,186,135,218,254,72,64,64,25,128,145,48,75,131,213,71,172,225,244,86,102,92,0,195,78,217,186,0,230,226,236,48,2,193, 119,132,132,205,150,161,9,32,207,185,199,195,220,138,14,88,6,138,160,114,135,122,6,43,224,185,32,220,235,55,86,202,235,62,199,64,20,229,246,197,4,240,62,251,219,208,216,36,79,64,201,13,161,221,6,68,95,193,31,65,135,1,192,59,24,128,189,199,58,130,2,25, 166,192,63,163,139,239,49,48,41,203,203,164,37,192,192,136,128,157,51,243,86,201,131,102,254,151,158,222,37,187,247,35,216,76,24,19,35,59,222,131,160,63,121,144,50,84,97,46,251,19,244,199,109,183,200,200,156,129,62,192,124,40,125,10,62,63,252,131,103, 100,243,142,3,230,185,224,189,112,31,7,184,237,159,205,79,177,63,159,105,166,39,215,108,148,235,127,180,86,166,34,38,6,117,119,200,196,176,175,154,20,129,96,16,80,6,32,24,148,70,73,30,18,36,158,73,239,195,249,241,180,9,241,50,17,158,229,152,120,221,125, 234,96,26,42,232,234,182,174,5,158,215,188,102,135,62,144,203,19,245,11,168,0,40,19,99,229,65,56,6,50,204,7,58,223,23,81,181,12,194,214,93,135,228,199,235,14,200,84,88,64,144,89,9,109,236,193,163,69,29,250,20,48,70,239,149,215,24,111,116,78,201,16,91, 245,13,210,4,111,138,113,34,14,14,4,45,160,73,224,120,42,92,86,212,203,170,87,176,91,71,34,209,177,24,58,99,8,254,157,229,168,75,64,9,206,170,245,80,188,172,104,144,73,48,143,28,172,221,191,127,79,201,68,158,194,243,191,0,254,243,223,61,81,39,87,126, 253,239,242,230,187,142,135,73,211,71,16,223,80,199,233,223,78,40,223,217,174,21,251,243,9,121,248,233,55,229,218,175,175,150,28,156,249,167,66,87,226,44,148,52,201,160,105,82,4,130,69,64,25,128,96,145,26,37,249,176,137,160,135,20,153,59,57,9,22,0,73, 102,212,161,44,41,62,90,100,118,77,71,42,206,152,195,84,50,23,92,228,7,50,25,41,0,22,194,249,19,18,228,175,47,31,19,106,147,51,245,166,172,230,16,32,199,98,96,245,122,156,253,226,252,156,202,103,131,17,62,149,112,140,131,63,248,157,112,146,116,146,146, 146,16,19,165,23,22,89,99,186,9,151,192,180,113,231,49,128,189,30,98,213,221,138,161,74,227,69,111,98,118,162,252,240,217,29,112,60,227,83,184,236,150,51,184,11,246,145,216,119,160,66,190,248,244,14,153,60,197,183,251,31,34,98,198,103,232,36,153,0,248, 61,56,82,219,36,231,125,237,9,121,234,197,77,230,217,181,59,239,193,148,6,112,254,72,248,57,199,108,191,10,62,35,126,241,167,23,228,3,223,195,206,31,86,25,12,36,68,201,5,165,119,225,158,235,224,102,80,115,141,84,4,148,1,24,169,51,55,0,253,110,95,111, 193,0,76,135,71,57,122,123,115,82,72,44,128,41,90,111,131,0,65,164,206,133,126,48,22,40,75,80,104,14,245,215,53,91,165,6,86,8,76,129,218,182,76,201,158,178,114,121,96,237,30,137,198,238,159,215,104,85,48,208,137,109,36,146,235,2,211,97,45,1,236,209,137, 219,182,237,184,199,194,116,115,73,118,178,236,133,41,39,125,58,216,235,110,235,235,45,63,207,153,179,176,75,63,180,167,74,222,219,229,40,3,242,41,113,187,59,118,152,47,231,249,98,208,159,166,178,90,201,70,189,38,230,66,111,29,24,224,123,150,9,96,156, 137,137,96,208,174,249,234,115,242,179,63,172,49,76,154,67,136,121,36,0,91,254,129,0,215,111,108,108,163,13,88,91,198,99,47,152,164,47,223,251,119,249,244,207,222,148,146,220,36,97,212,65,154,49,42,241,247,3,77,191,6,141,128,50,0,65,67,21,249,25,249, 48,24,162,215,216,38,185,147,210,16,145,140,142,34,67,59,179,183,180,147,38,93,38,8,16,20,171,104,1,16,10,43,225,22,121,238,80,105,17,80,50,41,65,126,185,246,160,108,193,57,174,77,93,9,20,127,91,77,234,117,111,238,148,131,176,5,159,237,139,58,199,122, 6,50,177,122,186,184,53,166,128,208,94,52,71,37,184,70,154,210,181,159,110,250,65,159,242,37,176,4,160,34,157,177,4,8,200,250,184,169,181,115,94,246,249,32,24,140,124,248,232,159,93,156,109,110,178,223,110,153,23,150,97,58,12,27,246,159,35,232,79,52, 28,242,144,248,15,52,246,78,171,189,191,27,105,18,164,40,147,112,220,65,199,58,159,253,245,6,185,227,91,143,202,235,27,119,227,152,201,57,135,231,209,7,191,147,80,135,43,113,238,13,115,97,219,0,24,213,181,13,242,248,234,13,114,217,151,30,150,159,173, 45,147,249,69,169,198,53,114,13,158,115,246,211,254,189,133,171,15,90,207,232,64,64,25,128,209,49,207,65,141,146,139,136,57,2,192,83,113,166,186,222,87,198,81,126,226,78,135,98,207,62,95,190,124,150,118,82,172,253,55,4,167,201,130,121,158,89,216,7,133, 5,48,14,235,12,241,99,115,180,89,111,106,166,123,92,219,171,14,56,236,14,142,81,231,30,124,17,166,131,16,157,51,151,241,211,223,145,109,192,190,145,225,226,2,46,9,94,217,92,122,76,26,217,79,44,248,118,119,217,13,111,59,15,246,211,111,78,232,126,150,137, 142,103,26,112,12,66,42,138,108,97,79,196,140,225,108,79,28,172,149,187,87,22,75,193,148,201,166,141,30,224,237,181,109,18,58,91,102,29,130,254,108,220,121,86,102,37,197,132,61,232,82,175,157,232,227,38,159,153,26,48,103,100,94,23,22,166,200,35,239,157, 144,243,255,237,113,249,209,111,86,153,64,81,156,31,50,144,220,161,115,60,14,51,0,221,17,124,15,54,49,47,95,206,92,119,136,250,89,103,29,24,104,50,28,95,190,247,113,121,255,151,87,201,97,196,163,88,144,157,100,206,251,105,173,211,211,51,29,108,187,154, 79,17,208,88,0,250,12,180,35,192,53,139,231,222,137,112,166,243,199,245,251,101,197,133,251,76,128,20,18,20,147,186,211,207,246,178,157,190,152,124,176,25,175,174,147,135,159,121,7,59,209,38,153,8,127,235,212,208,31,172,157,29,151,95,42,171,77,193,88, 190,245,194,62,185,249,170,163,82,50,61,219,49,91,243,141,135,139,174,93,64,223,122,119,47,66,10,87,202,188,226,84,99,5,97,136,114,167,65,13,220,15,198,25,160,210,229,143,95,57,40,75,230,110,148,247,195,31,125,84,148,227,52,169,71,126,201,206,131,253, 108,239,154,83,230,77,88,63,252,110,115,185,20,160,206,106,136,135,237,24,219,179,245,227,11,113,141,3,126,21,80,234,148,201,241,114,249,133,51,77,109,36,94,30,151,147,107,240,7,145,99,160,156,255,165,215,69,68,116,164,68,132,108,76,183,161,245,163,207, 253,45,202,97,33,46,22,244,2,160,91,2,39,75,117,96,174,190,248,63,155,228,139,207,238,146,31,95,93,44,151,46,46,146,194,188,201,146,148,24,231,48,115,190,6,13,97,231,119,130,22,32,89,6,136,146,19,231,187,51,114,50,206,84,72,125,114,221,54,249,193,51, 123,141,88,104,254,204,52,195,152,82,63,129,207,167,45,27,160,106,189,172,8,244,137,128,50,0,125,66,52,122,50,112,65,169,5,209,156,10,251,235,173,103,27,229,206,159,172,146,15,47,47,130,63,128,180,160,23,100,174,117,36,56,117,8,66,242,252,155,123,228, 1,16,181,98,16,97,198,67,119,73,31,250,5,60,151,81,50,51,233,80,230,43,131,182,250,99,107,222,149,25,133,89,237,145,215,76,229,190,21,180,242,84,53,98,221,191,39,130,152,247,236,35,119,255,131,197,0,176,159,144,50,27,162,74,87,198,215,63,240,178,124, 123,111,185,204,45,202,52,146,128,160,183,240,168,136,82,232,210,131,149,242,179,85,59,37,26,103,195,60,255,175,51,187,196,126,65,217,169,48,119,194,169,176,149,223,94,90,37,63,248,232,92,153,6,194,103,18,218,231,88,220,36,123,92,240,218,59,3,27,244, 199,77,159,2,229,229,216,248,184,208,66,32,14,76,203,121,197,105,178,187,186,81,254,245,55,27,97,136,191,85,62,181,40,83,150,159,155,47,51,11,50,37,99,210,88,68,21,76,64,126,159,199,139,32,128,33,3,69,162,127,16,190,43,54,109,63,40,207,188,190,87,30, 222,136,184,4,96,14,167,131,121,78,131,162,31,219,70,182,65,123,54,3,97,161,215,35,7,1,79,193,45,247,247,194,159,70,206,64,117,36,193,35,128,53,30,166,233,30,217,10,13,104,154,100,153,149,47,136,69,172,83,11,32,60,244,73,63,211,23,253,15,52,206,53,129, 232,84,95,8,63,248,96,195,26,206,232,53,236,62,219,36,191,190,125,190,92,190,164,68,98,17,53,143,187,50,46,232,244,250,247,151,167,55,200,215,158,220,37,231,96,199,92,131,126,187,29,106,8,93,235,86,132,11,59,49,167,29,247,190,99,56,126,241,137,240,205, 238,49,216,14,177,18,16,253,244,73,113,146,129,48,183,148,44,132,117,247,143,234,227,208,71,214,187,23,120,110,254,209,13,56,255,207,53,162,235,142,29,108,183,161,245,120,129,71,28,20,113,19,255,207,124,247,175,242,135,13,199,176,187,78,132,229,194,224, 50,138,61,118,174,143,139,128,193,40,255,165,128,201,138,5,222,212,133,40,135,21,135,64,119,6,1,41,228,131,211,199,202,194,162,73,146,147,49,70,38,35,220,239,184,244,100,137,131,62,77,20,124,52,112,204,45,45,45,70,18,85,135,128,74,21,144,126,48,80,214, 222,67,149,242,218,142,114,121,114,15,44,102,224,100,137,127,59,5,48,239,35,3,75,125,22,62,23,106,226,215,199,196,232,109,87,8,148,62,120,151,71,25,0,87,144,141,158,204,92,228,168,157,206,157,112,3,9,139,139,68,209,39,149,196,184,96,209,150,155,188,64, 176,52,204,69,51,65,101,37,51,67,239,134,212,90,223,115,162,65,198,194,190,123,214,152,120,208,85,136,154,113,111,61,60,20,130,162,201,12,104,254,147,230,114,164,67,213,87,246,135,4,150,47,158,239,178,47,110,18,251,77,130,212,132,65,215,227,220,154,12, 78,56,19,37,35,147,32,29,122,3,103,245,247,220,60,83,190,244,137,43,141,162,168,37,230,110,218,226,142,151,186,14,47,188,182,85,150,127,249,105,41,130,57,27,153,21,142,59,220,253,118,211,47,55,121,57,95,236,43,255,78,104,110,201,35,167,10,236,210,25, 72,139,158,24,205,131,15,235,23,136,76,12,67,54,14,187,248,36,48,13,167,145,231,36,196,62,199,235,144,231,12,152,108,186,175,140,69,69,41,49,146,3,11,136,244,88,175,249,219,161,206,140,113,236,131,39,114,164,96,226,6,63,205,59,180,8,144,1,208,35,128, 161,157,131,97,219,58,105,7,143,3,160,218,100,8,168,211,81,94,37,89,226,103,224,196,221,32,9,110,29,169,47,82,239,185,3,215,19,142,59,92,56,185,190,146,33,153,141,243,91,46,208,235,24,151,192,151,166,64,236,158,138,133,151,139,109,223,35,179,165,6,230, 19,93,52,4,144,71,23,208,177,195,162,31,8,57,255,158,118,124,39,65,162,86,184,57,67,15,84,52,196,174,115,42,19,113,246,127,130,68,11,187,211,171,46,158,233,35,254,36,228,62,29,145,32,235,182,196,159,230,153,79,172,133,35,33,84,78,71,54,39,160,224,54, 88,71,47,65,118,181,215,108,156,47,38,42,9,242,239,2,116,219,88,12,100,130,73,242,140,115,44,60,154,240,92,85,227,213,0,137,71,89,77,139,212,96,146,82,81,144,199,51,121,73,209,146,4,175,131,100,80,249,87,194,39,16,89,205,179,104,221,249,142,36,60,56, 10,77,35,11,1,101,0,70,214,124,13,106,111,185,190,113,105,131,84,214,151,248,139,201,126,58,191,2,189,135,153,6,5,106,166,207,235,236,7,215,232,54,172,174,227,64,104,38,96,39,102,147,93,112,57,162,225,208,95,75,243,169,116,214,251,249,191,255,28,116, 124,231,24,6,98,28,84,206,75,194,217,255,182,131,53,242,111,87,23,200,172,162,28,31,132,33,32,231,235,32,131,254,252,228,133,50,41,196,25,55,67,13,51,228,240,72,76,150,17,224,156,145,224,243,239,131,52,157,115,201,207,100,80,248,20,254,198,203,188,33, 139,147,139,207,101,27,189,14,155,35,5,94,99,98,62,91,167,185,160,111,138,192,0,33,160,12,192,0,1,27,73,213,142,204,101,185,243,12,112,12,228,99,232,222,151,201,127,177,53,23,134,217,219,112,194,156,187,255,4,236,254,79,65,177,147,219,213,107,151,206, 148,132,120,104,236,251,206,241,221,64,103,119,255,78,208,31,104,254,215,182,200,88,72,97,202,33,89,24,233,103,220,254,115,198,231,139,184,25,222,153,95,124,137,223,252,243,217,235,252,12,116,221,63,143,126,87,4,194,137,128,17,62,133,179,66,173,75,17, 24,9,8,112,177,213,5,55,248,153,162,94,66,41,116,40,238,184,40,27,166,161,121,193,23,236,154,211,7,250,174,189,71,229,235,207,238,150,124,4,177,97,136,225,209,34,234,214,103,174,235,3,161,191,135,18,1,101,0,134,18,125,109,91,17,24,230,8,112,199,10,189, 53,163,249,143,131,108,185,126,121,137,36,39,198,27,205,127,183,103,255,214,239,2,29,9,173,90,143,179,255,19,136,16,25,239,88,43,40,97,28,230,15,130,118,47,34,17,80,6,32,34,167,85,7,165,8,132,15,1,238,254,183,35,156,243,205,231,77,150,69,115,166,133, 92,177,149,132,211,159,253,231,158,222,41,153,8,250,227,248,135,80,242,31,50,168,90,80,17,232,7,2,202,0,244,3,60,45,170,8,68,58,2,237,11,196,169,38,185,245,138,89,50,38,53,17,103,219,161,122,253,115,8,253,11,175,226,236,255,80,173,100,194,228,141,38, 166,74,254,35,253,41,210,241,13,87,4,218,255,190,135,107,7,181,95,138,128,34,48,52,8,80,252,159,0,123,196,119,225,152,230,202,5,227,229,252,249,133,166,35,220,201,187,37,218,118,247,127,8,158,238,126,241,220,118,137,207,130,75,93,104,204,187,173,103, 104,144,208,86,21,129,200,68,64,25,128,200,156,87,29,149,34,208,111,4,72,180,233,88,8,17,104,228,159,174,156,45,227,211,105,204,6,226,239,146,106,59,103,255,78,119,214,189,185,75,54,237,62,43,69,8,250,227,152,204,57,215,245,93,17,80,4,6,31,1,101,0,6, 31,115,109,81,17,24,246,8,208,90,146,177,230,223,198,238,255,130,249,99,101,201,66,103,247,79,51,190,192,14,138,122,30,22,25,0,114,13,21,149,103,229,143,171,161,252,135,136,139,184,34,116,15,173,73,17,80,4,134,14,1,101,0,134,14,123,109,89,17,24,182,8, 208,43,93,2,148,255,228,96,157,220,113,101,137,100,76,76,55,125,117,189,251,71,41,203,48,188,254,206,110,121,246,221,19,82,2,239,119,141,112,17,173,73,17,80,4,134,22,1,101,0,134,22,127,109,93,17,24,118,8,208,76,143,17,255,222,56,221,32,179,103,141,145, 75,22,21,153,62,210,241,143,37,230,193,118,186,205,87,230,244,217,90,121,228,5,40,255,37,70,57,177,14,84,249,47,88,8,53,159,34,48,96,8,40,3,48,96,208,106,197,138,192,200,69,128,166,127,114,184,78,62,189,178,88,166,100,79,112,6,226,114,251,79,49,191,85, 23,220,176,101,175,252,241,213,35,82,140,232,144,70,249,207,101,93,78,7,244,93,17,80,4,194,137,128,50,0,225,68,83,235,82,4,70,56,2,220,253,167,96,247,191,241,108,163,100,228,167,200,165,139,139,205,136,140,219,95,151,68,155,187,127,70,252,171,169,69, 208,159,151,176,251,199,106,147,130,88,12,12,39,236,82,143,112,132,163,170,221,87,4,134,39,2,202,0,12,207,121,209,94,41,2,67,130,0,69,252,140,78,215,116,180,94,62,183,162,80,10,242,38,59,253,112,75,252,193,72,216,227,130,45,8,250,243,83,4,253,41,202, 80,199,63,67,50,169,218,168,34,16,0,1,101,0,2,0,163,151,21,129,209,134,0,53,255,25,219,190,172,6,65,127,38,197,203,21,75,102,34,42,157,71,90,184,147,119,205,0,56,202,127,12,250,243,244,58,104,254,215,183,200,24,4,253,97,124,123,221,253,143,182,39,75, 199,59,92,17,80,6,96,184,206,140,246,75,17,24,100,4,104,242,31,141,183,19,199,235,229,158,229,249,82,92,144,101,122,224,154,248,179,148,143,202,239,220,115,68,190,249,108,169,20,228,140,174,160,63,131,60,117,218,156,34,16,18,2,202,0,132,4,155,22,82,4, 34,11,1,42,236,209,233,207,153,70,88,231,39,68,203,53,151,148,72,52,66,0,135,162,249,207,56,184,100,26,232,51,224,185,87,176,251,71,28,129,177,26,244,39,178,30,24,29,77,68,32,160,12,64,68,76,163,14,66,17,232,31,2,220,176,199,66,252,191,23,187,255,207, 47,203,147,217,197,185,166,66,123,142,239,166,118,71,251,95,100,239,129,114,249,252,51,187,36,27,65,127,170,154,70,79,200,95,55,88,105,94,69,96,40,17,80,6,96,40,209,215,182,21,129,97,130,0,197,255,198,53,47,142,255,223,191,108,150,196,198,68,11,45,2, 220,50,0,54,228,47,135,245,60,131,254,28,169,149,73,144,40,52,82,193,64,147,34,160,8,12,43,4,148,1,24,86,211,161,157,81,4,6,31,1,210,230,36,168,254,111,45,175,147,79,45,203,149,185,51,167,152,78,248,142,241,93,117,200,184,253,69,137,131,71,42,229,231, 207,237,144,196,204,4,232,255,105,208,31,87,32,106,102,69,96,144,16,80,6,96,144,128,214,102,20,129,225,138,0,119,255,198,57,127,85,179,220,176,98,182,36,38,196,153,144,191,237,154,124,65,118,220,236,254,189,206,146,242,210,155,59,101,75,233,89,41,76, 138,150,38,221,253,7,137,160,102,83,4,6,23,1,101,0,6,23,111,109,77,17,24,86,8,180,64,204,159,22,235,149,141,229,181,242,161,101,217,50,127,214,255,103,239,59,0,227,188,170,116,143,109,245,94,45,171,186,73,114,145,107,92,18,215,196,61,189,67,66,32,148, 208,222,66,66,39,217,13,53,240,232,44,203,146,165,236,62,88,216,133,13,108,32,164,147,66,154,211,157,184,247,222,100,91,146,45,91,189,203,246,251,190,243,207,149,70,210,72,154,127,52,242,104,228,123,109,77,249,231,214,239,150,115,238,185,231,158,51,78, 235,135,199,16,255,187,171,170,217,253,87,84,214,200,31,94,128,248,31,78,127,200,68,88,179,255,238,112,180,177,45,2,23,10,1,203,0,92,40,164,109,57,22,129,33,136,192,40,80,121,18,123,169,110,151,219,87,79,151,228,196,56,173,165,123,226,79,134,193,225, 24,222,218,184,95,158,219,92,41,211,224,244,167,133,212,223,37,35,49,4,97,178,85,178,8,12,75,4,44,3,48,44,187,213,54,202,34,208,63,2,102,247,191,241,100,147,220,186,36,91,230,205,156,160,137,2,185,250,119,238,188,227,40,168,170,166,1,78,127,112,245,47, 30,78,127,34,70,168,242,159,165,255,253,247,133,141,97,17,8,5,2,150,1,8,5,234,182,76,139,192,16,64,32,2,59,118,61,158,63,211,38,239,91,57,85,50,82,19,181,86,102,39,239,111,21,189,53,255,55,108,63,36,255,243,86,153,76,205,140,145,134,118,247,222,3,253, 45,211,198,179,8,88,4,6,142,128,101,0,6,142,161,205,193,34,16,118,8,112,247,159,24,137,179,255,202,102,89,61,55,67,22,92,82,164,109,160,217,223,64,24,0,166,169,111,108,150,39,94,193,238,31,171,74,2,28,10,89,237,255,176,27,22,182,194,23,25,2,150,1,184, 200,58,220,54,215,34,192,35,255,72,168,254,147,9,160,149,190,59,87,78,145,236,209,41,10,140,107,179,191,200,195,48,12,219,119,151,202,131,47,30,145,41,57,52,251,123,86,168,95,96,131,69,192,34,48,116,17,176,12,192,208,237,27,91,51,139,192,160,32,64,186, 31,11,171,127,91,106,219,100,238,228,20,89,122,233,36,45,39,176,221,191,163,252,215,210,218,46,79,209,233,79,235,57,73,162,203,95,156,45,88,242,63,40,221,103,51,181,8,4,13,1,203,0,4,13,74,155,145,69,32,60,16,0,237,7,113,198,75,101,139,124,108,213,36, 41,200,201,208,138,187,222,253,35,149,217,228,211,233,207,119,224,244,167,168,32,94,253,9,216,221,127,120,140,5,91,203,139,27,1,203,0,92,220,253,111,91,127,145,33,64,241,63,157,254,28,111,106,151,236,188,120,89,185,112,170,34,16,136,230,63,239,15,82, 252,127,22,187,253,103,95,219,33,82,211,38,41,209,163,164,197,238,254,47,178,81,101,155,27,174,8,88,6,32,92,123,206,214,219,34,16,0,2,20,203,71,67,4,112,170,172,73,238,93,83,44,19,199,102,105,46,230,28,223,77,150,60,74,96,56,112,164,92,238,123,118,175, 228,23,196,73,189,117,250,227,128,98,95,45,2,97,128,128,101,0,194,160,147,108,21,45,2,193,66,0,138,255,114,166,5,46,127,211,162,101,205,146,18,205,150,110,123,221,50,0,142,217,95,231,148,255,69,58,253,41,111,150,76,184,252,181,102,127,131,213,83,54,31, 139,192,224,35,96,25,128,193,199,216,150,96,17,24,18,8,80,235,159,215,243,14,151,54,202,119,174,46,150,226,241,217,90,47,115,142,239,166,146,198,236,239,209,19,149,234,244,39,54,59,70,141,254,120,132,2,110,178,178,113,45,2,22,129,16,33,96,25,128,16,1, 111,139,181,8,92,72,4,72,152,163,113,246,95,195,221,63,28,244,92,115,121,137,140,26,53,114,0,78,127,156,221,255,218,117,123,100,251,129,58,41,70,158,116,249,235,60,189,144,45,179,101,89,4,44,2,129,34,96,25,128,64,145,179,233,44,2,97,132,0,119,255,188, 158,183,247,104,131,124,245,234,66,153,60,49,87,107,207,115,124,183,18,0,103,247,63,66,58,156,254,164,89,167,63,97,52,20,108,85,45,2,29,8,88,6,160,3,10,251,193,34,48,60,17,48,187,255,58,24,231,145,152,81,114,245,146,41,18,29,21,161,187,255,64,136,191, 209,23,120,115,227,62,121,126,203,105,153,150,18,5,171,127,214,233,207,240,28,61,182,85,195,25,1,203,0,12,231,222,181,109,179,8,0,129,115,216,230,199,69,140,148,93,117,109,178,112,92,162,140,205,115,238,253,211,240,15,3,119,244,254,254,157,5,161,39,3, 80,85,11,167,63,47,66,249,143,78,127,112,171,192,138,255,21,74,251,98,17,8,43,4,44,3,16,86,221,101,43,107,17,112,143,192,72,156,204,183,158,61,47,249,177,17,242,102,101,147,156,174,174,215,76,34,70,141,82,98,78,130,238,239,95,68,196,40,77,251,230,134, 125,242,16,156,254,76,27,29,171,87,255,220,26,17,114,223,10,155,194,34,96,17,8,54,2,150,1,8,54,162,54,63,139,192,16,67,128,98,254,38,48,0,233,16,255,11,148,0,255,253,207,111,203,193,163,39,165,173,253,172,156,61,203,191,115,126,255,181,182,181,203,219, 155,246,201,183,255,240,182,72,70,148,64,175,16,87,255,104,89,208,6,139,128,69,32,220,16,136,8,183,10,219,250,90,4,44,2,238,17,32,161,174,3,165,46,73,143,145,159,191,121,76,94,222,251,23,185,102,90,150,36,197,69,66,252,239,95,126,35,145,73,69,117,147, 60,184,190,12,9,206,203,180,132,72,187,251,247,15,58,27,203,34,48,36,17,176,12,192,144,236,22,91,41,139,64,240,17,224,46,157,78,122,166,167,71,203,177,198,54,249,209,179,7,177,125,231,53,0,63,203,34,167,0,41,194,248,140,104,213,41,104,108,63,15,9,128, 191,137,253,44,195,70,179,8,88,4,46,24,2,150,1,184,96,80,219,130,44,2,161,71,128,228,154,199,1,57,176,218,55,46,63,82,69,248,110,106,5,254,65,154,218,207,65,235,159,196,223,77,74,27,215,34,96,17,24,106,8,88,6,96,168,245,136,173,143,69,224,2,32,64,73, 0,255,32,201,119,130,33,230,230,187,169,3,159,123,63,195,119,62,50,209,77,52,251,110,17,176,8,132,31,2,150,1,8,191,62,179,53,182,8,12,24,129,14,2,222,241,193,147,101,247,239,124,236,235,217,128,107,96,51,176,8,88,4,66,141,128,189,5,16,234,30,176,229, 91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128, 69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160, 219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128, 69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44, 3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91, 4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69, 32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219, 34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69, 192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16, 234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44, 2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4, 8,88,6,32,4,160,219,34,45,2,22,1,139,128,69,192,34,16,106,4,44,3,16,234,30,176,229,91,4,44,2,22,1,139,128,69,32,4,8,68,132,160,204,144,23,121,238,124,215,42,140,24,33,130,255,23,125,56,15,92,188,161,177,184,92,244,67,194,2,96,17,176,8,12,99,4,46,42,6, 128,196,141,132,62,46,98,132,140,36,117,211,112,94,154,207,158,151,246,115,130,103,158,71,23,217,155,33,250,49,192,101,148,226,226,60,105,5,46,173,23,49,46,23,217,48,176,205,181,8,88,4,46,50,4,46,26,6,128,187,254,40,28,120,196,140,26,41,167,90,218,165, 170,253,60,136,157,72,36,8,94,110,204,40,137,198,111,13,120,118,177,49,1,220,245,3,18,48,69,35,165,170,229,172,84,182,157,83,92,200,2,228,3,151,132,200,145,82,143,103,23,27,46,23,217,58,96,155,107,17,176,8,92,132,8,92,20,12,0,137,63,232,24,118,179,231, 101,119,89,3,185,0,137,136,143,144,179,232,240,243,32,110,103,42,154,101,100,70,180,76,197,179,70,136,2,58,165,3,195,123,68,24,226,79,193,199,230,227,141,224,4,32,25,73,138,20,61,34,193,203,206,227,77,34,73,17,82,146,24,37,77,144,6,88,38,96,120,143,7, 219,58,139,128,69,224,226,66,96,216,51,0,220,201,146,248,147,168,29,108,104,151,159,124,96,166,44,95,48,73,34,35,70,225,25,137,218,8,217,115,176,92,126,240,240,122,89,87,213,34,211,193,4,52,92,4,76,0,113,225,206,159,34,255,93,104,247,255,189,121,138, 92,181,116,138,196,68,71,41,46,163,70,142,148,163,39,78,203,191,253,101,189,60,117,164,70,166,39,69,129,57,58,47,122,66,112,113,205,17,219,90,139,128,69,192,34,48,44,17,24,246,12,0,123,45,30,226,237,141,71,235,229,129,91,166,200,167,238,92,46,209,145, 93,155,61,181,40,79,146,147,98,101,197,3,207,74,35,206,2,120,76,208,130,29,239,112,38,118,220,253,39,226,76,100,67,105,131,124,97,245,120,249,236,135,87,74,66,92,116,151,65,62,165,48,87,82,147,227,229,169,7,158,146,74,28,15,164,71,143,82,38,192,74,2, 186,192,100,191,88,4,44,2,22,129,176,68,0,123,192,225,27,184,203,141,2,181,226,142,94,240,127,233,220,137,74,252,219,207,158,149,179,103,207,201,185,115,231,164,173,157,7,1,34,139,230,76,146,207,95,49,86,14,148,55,75,44,148,225,152,118,184,6,74,67,216, 198,51,205,104,59,152,157,247,174,153,165,196,191,11,46,109,237,218,252,18,48,71,119,149,100,74,217,153,86,137,166,210,196,176,70,102,184,246,184,109,151,69,192,34,96,17,232,137,192,240,102,0,64,232,40,254,47,5,161,139,30,29,35,163,211,147,20,129,17, 216,218,143,2,225,27,9,49,55,143,2,206,130,17,136,142,138,144,27,150,149,232,53,129,90,168,190,199,128,216,13,87,38,128,146,141,104,48,70,135,78,53,203,103,174,40,144,25,147,11,20,151,145,35,70,118,224,18,1,92,24,98,98,34,165,40,47,69,32,18,17,74,13, 136,157,13,22,1,139,128,69,192,34,16,254,8,12,107,6,128,221,195,51,238,70,16,175,43,178,226,36,45,37,193,103,143,141,240,88,1,184,100,218,120,185,107,81,174,236,59,211,162,146,3,159,145,195,252,33,153,26,74,69,168,236,72,169,200,141,203,166,74,108,12, 206,253,33,22,24,217,67,182,143,155,18,96,146,242,199,128,1,64,220,54,196,161,16,96,184,50,70,97,222,181,182,250,22,1,139,128,69,192,21,2,195,154,1,224,94,85,247,171,144,0,76,202,78,146,164,196,56,5,199,16,124,131,20,9,223,121,108,111,19,227,99,228,61, 43,33,5,104,56,43,237,248,14,41,249,176,11,108,18,25,128,221,80,252,251,224,130,108,153,51,125,130,207,54,114,167,79,166,128,33,55,11,12,64,204,72,189,9,16,97,37,0,62,241,178,15,45,2,22,1,139,64,184,33,48,172,25,0,110,104,149,134,181,156,147,241,57,41, 18,135,157,46,131,47,26,70,241,54,195,252,89,133,114,211,188,209,178,189,186,69,207,188,135,219,110,151,152,156,231,30,190,166,93,110,91,53,77,146,18,98,149,249,233,75,180,159,149,145,36,35,83,163,229,116,219,89,149,0,88,17,128,51,86,236,171,69,192,34, 96,17,8,103,4,134,45,3,64,194,77,98,215,238,217,197,22,100,167,106,63,113,167,239,139,3,32,83,192,223,210,160,245,254,129,53,211,68,42,90,32,1,232,46,43,8,231,174,118,68,247,212,109,216,90,213,42,215,205,29,45,151,206,46,116,48,193,171,47,166,200,180, 54,45,37,81,86,226,8,165,10,140,212,197,98,35,193,180,221,190,91,4,44,2,22,129,225,138,192,176,101,0,216,97,122,254,15,109,127,152,185,147,156,209,16,99,35,144,200,131,214,247,8,220,1,155,221,254,162,57,69,114,249,37,25,178,17,82,0,154,13,54,210,129, 30,137,194,237,1,26,72,241,191,148,53,203,7,175,44,145,116,143,78,132,47,60,216,52,35,21,160,148,96,82,14,20,40,113,148,194,184,125,49,11,225,6,137,173,175,69,192,34,96,17,184,88,17,24,230,12,128,168,105,219,113,233,209,146,233,185,1,208,87,71,27,66, 152,149,145,44,31,191,10,186,0,165,77,106,19,224,92,7,107,208,87,234,161,253,27,5,33,241,145,35,100,125,117,171,44,156,157,142,107,143,197,90,97,158,243,27,66,223,91,11,168,36,56,1,71,40,210,236,32,97,112,234,45,190,125,110,17,176,8,88,4,44,2,67,31,129, 97,205,0,112,167,90,139,27,0,115,178,19,36,53,37,222,211,27,189,147,47,18,66,163,248,182,100,94,177,148,76,75,145,119,106,90,36,17,119,9,105,53,48,156,3,207,253,99,105,250,15,76,205,39,175,154,42,217,30,137,72,95,187,121,149,138,120,218,173,71,40,96, 22,28,235,137,206,113,66,56,227,97,235,110,17,176,8,88,4,46,118,4,134,45,3,64,50,175,39,248,77,103,165,56,55,69,18,227,98,181,175,251,34,120,140,96,126,47,200,201,144,123,174,154,34,114,180,73,9,103,56,147,127,238,254,147,34,71,41,51,51,165,36,89,150, 206,159,164,88,208,16,82,127,187,127,195,247,228,232,77,128,81,106,33,209,234,1,40,124,246,197,34,96,17,176,8,132,53,2,195,156,1,64,223,64,108,205,27,0,145,32,128,254,4,71,10,0,189,1,132,101,151,77,150,204,137,9,178,189,182,53,172,165,0,220,253,211,138, 223,249,99,77,114,207,234,201,50,46,47,211,129,194,112,59,206,183,62,95,121,132,50,38,35,70,170,233,39,161,207,152,246,71,139,128,69,192,34,96,17,8,7,4,134,237,90,78,93,183,179,158,237,107,190,247,13,0,159,42,128,221,187,202,57,38,40,28,59,70,238,93, 85,44,13,39,154,64,64,9,85,239,199,7,221,115,24,42,223,185,251,79,4,243,179,179,174,85,18,198,37,200,50,56,66,98,224,238,223,159,157,188,225,17,232,19,96,65,78,130,156,132,68,133,216,218,96,17,176,8,88,4,44,2,225,141,192,176,101,0,72,163,232,194,22,212, 175,227,188,155,252,128,33,104,125,117,27,13,3,41,129,196,251,234,69,56,6,200,138,145,35,245,109,112,42,132,231,200,35,156,2,219,11,159,63,82,15,205,255,175,174,44,148,162,241,217,78,245,253,1,194,171,161,9,113,49,50,41,55,89,96,66,16,214,1,135,215,245, 72,175,102,218,143,22,1,139,128,69,224,162,65,96,216,50,0,188,2,88,10,5,192,217,99,98,37,35,53,49,128,14,117,182,185,83,138,114,229,107,203,198,203,201,147,205,240,43,0,194,23,70,187,95,50,43,177,16,253,31,7,209,150,244,40,89,3,102,134,166,125,233,251, 192,159,221,191,55,104,81,240,160,56,33,23,182,20,26,33,1,240,254,193,126,182,8,88,4,44,2,22,129,176,68,96,88,174,229,220,164,71,128,88,183,128,240,205,202,245,50,1,236,130,120,27,41,0,157,5,93,115,57,174,4,198,142,146,170,86,56,21,66,190,70,49,110,168, 247,56,170,170,76,75,89,101,139,252,211,21,227,101,106,113,158,86,185,63,197,191,174,237,98,123,29,177,135,30,165,224,35,25,11,23,80,118,205,206,126,179,8,88,4,44,2,22,129,33,129,192,176,100,0,136,108,4,91,86,215,14,79,118,169,18,23,219,213,207,189,223, 200,123,182,251,51,166,140,149,207,46,45,144,67,32,164,52,164,19,14,82,0,146,108,74,44,234,219,160,208,8,48,174,187,162,68,184,139,247,247,236,191,3,35,47,74,63,38,19,71,0,73,145,56,90,161,4,161,35,134,253,96,17,176,8,88,4,44,2,97,136,192,176,101,0,148, 62,225,6,192,184,156,84,61,179,14,164,111,40,38,167,93,128,216,232,72,185,105,57,204,3,195,77,176,241,136,23,72,126,23,50,13,219,79,105,197,190,211,205,242,233,37,121,50,115,234,88,167,120,151,220,11,243,49,18,15,30,165,76,203,142,149,163,176,8,72,9, 11,153,12,27,44,2,22,1,139,128,69,32,60,17,24,150,12,0,137,22,9,53,181,223,242,198,120,249,0,8,164,143,148,147,16,185,100,250,56,249,208,226,92,217,1,130,26,131,27,1,67,157,248,113,135,174,183,32,26,207,201,45,43,167,171,35,36,138,242,221,158,253,43, 100,30,12,232,77,113,78,94,146,52,53,180,171,36,196,48,6,129,192,106,211,88,4,44,2,22,1,139,64,104,17,24,118,12,0,9,51,119,167,213,216,173,75,102,180,140,238,98,2,216,67,201,92,96,206,20,36,156,137,241,177,114,251,106,72,1,206,180,169,248,219,125,78, 46,10,29,96,84,18,230,56,136,253,183,85,54,203,7,22,231,192,229,239,120,205,49,80,130,109,218,202,163,148,98,28,169,240,104,133,24,91,123,128,3,236,40,155,220,34,96,17,176,8,132,16,129,225,199,0,232,198,127,132,28,129,2,224,170,220,78,19,192,36,126,46, 165,223,218,45,142,57,92,167,135,230,207,156,40,55,46,204,146,77,32,172,9,106,30,56,132,61,215,87,209,160,205,80,254,23,57,213,42,239,3,211,66,103,62,148,227,7,210,126,239,98,34,32,249,24,139,35,21,40,1,88,37,64,111,96,236,103,139,128,69,192,34,16,134, 8,12,63,6,0,194,121,245,120,135,93,106,73,62,76,0,99,231,62,208,96,8,103,26,188,231,221,121,37,164,0,101,45,170,96,55,208,124,7,35,61,109,245,39,129,57,217,0,38,229,218,69,89,50,127,214,68,45,70,53,247,77,67,2,40,216,220,4,200,165,73,224,232,145,210, 6,27,11,1,29,39,4,80,182,77,98,17,176,8,88,4,44,2,193,71,96,216,49,0,132,72,141,246,213,183,75,33,196,213,49,240,100,167,193,200,177,157,111,174,94,189,205,3,47,152,93,36,203,230,103,200,187,208,5,72,134,142,129,177,54,232,42,195,65,141,60,194,17,207, 131,73,249,208,154,105,29,54,16,6,64,251,85,116,194,163,21,134,44,30,169,100,198,200,25,92,137,228,45,3,243,220,249,213,190,90,4,44,2,22,1,139,64,184,32,48,236,24,0,218,168,131,157,27,61,158,206,207,78,233,16,85,15,128,254,107,95,154,187,243,244,162, 247,145,53,83,69,78,52,43,161,29,74,54,241,200,140,144,41,33,115,178,116,110,186,44,152,83,168,117,247,199,233,79,95,3,86,177,227,25,10,66,42,164,32,203,114,227,245,136,69,253,11,88,14,160,47,232,236,111,22,1,139,128,69,96,200,34,48,172,24,0,210,34,72, 191,113,247,253,172,72,114,132,100,103,66,92,141,96,196,215,250,37,192,23,50,0,180,160,199,64,87,193,179,224,42,248,221,170,102,73,26,66,82,0,138,228,245,236,31,102,127,63,178,122,138,228,102,165,105,125,13,243,162,95,6,248,194,35,149,105,121,176,7,80, 215,230,145,0,88,14,96,128,144,218,228,22,1,139,128,69,32,36,8,12,47,6,0,180,40,10,20,240,32,238,169,23,102,199,73,70,154,99,2,152,12,64,48,136,160,57,243,166,55,189,79,172,12,162,91,110,0,0,64,0,73,68,65,84,130,83,157,242,22,37,184,230,121,72,122,208, 83,40,119,255,137,208,252,95,95,221,42,37,83,224,242,119,158,227,244,135,76,75,48,218,110,108,255,197,226,72,69,77,2,55,88,167,64,161,236,111,91,182,69,192,34,96,17,24,40,2,195,139,1,192,137,116,52,108,221,183,192,113,207,60,152,0,78,198,189,245,96,6, 111,41,192,114,184,10,78,27,27,47,219,177,19,118,156,4,133,118,39,76,223,7,122,51,15,62,11,62,185,178,88,38,20,140,214,166,7,139,57,49,58,4,52,145,92,48,6,146,21,52,247,44,52,11,131,149,127,48,251,201,230,101,17,176,8,88,4,44,2,253,35,48,204,24,0,163, 0,120,86,138,225,185,46,33,62,198,131,192,64,53,0,58,129,52,4,175,104,66,182,220,187,188,80,90,78,53,67,10,64,226,27,188,50,58,75,243,239,19,53,252,233,244,231,96,3,108,20,228,196,201,202,133,240,96,136,48,208,179,255,238,165,155,163,148,236,209,52,9, 28,161,102,134,35,209,236,208,178,62,221,107,105,191,91,4,44,2,22,1,139,128,63,8,12,43,6,96,36,21,0,73,141,96,4,136,247,213,105,251,158,33,152,180,153,82,0,99,79,255,202,165,80,6,76,142,146,74,28,57,168,147,32,45,237,194,191,112,231,175,198,143,224,171, 224,219,43,38,202,164,9,57,90,137,224,136,254,157,246,48,47,195,0,208,36,112,254,232,88,61,106,225,145,139,71,63,240,194,55,220,150,104,17,176,8,88,4,44,2,1,35,48,108,24,0,210,125,58,0,106,110,135,162,30,238,169,231,102,97,151,138,96,136,150,126,9,210, 139,33,172,83,139,242,228,254,229,227,165,20,82,128,72,16,194,80,200,0,216,110,218,61,168,193,181,60,152,255,147,171,150,150,136,241,100,104,234,25,164,102,119,100,147,146,28,47,243,115,18,164,21,38,129,157,171,128,86,6,208,1,142,253,96,17,176,8,88,4, 194,4,129,225,195,0,128,6,145,16,86,182,128,16,166,69,75,86,70,39,3,16,108,66,200,252,232,36,136,174,130,175,95,6,195,64,248,222,2,198,3,60,192,5,15,44,82,21,31,113,246,127,31,152,145,146,226,124,173,67,176,219,236,52,204,105,32,111,2,20,231,0,95,88, 91,228,241,135,13,22,1,139,128,69,192,34,16,126,8,12,31,6,0,39,209,220,141,150,193,76,237,82,220,0,72,199,125,117,134,193,218,155,26,186,55,99,114,129,220,179,188,64,118,129,0,211,254,254,133,22,135,83,252,79,171,124,2,190,231,70,120,44,140,138,28,165, 82,143,193,96,0,76,155,99,224,29,113,44,108,44,72,235,121,28,185,88,69,192,240,155,246,182,198,22,1,139,128,69,64,100,216,48,0,236,76,221,141,98,87,58,37,59,73,232,185,142,97,48,247,167,60,94,224,181,184,91,86,76,135,241,129,179,30,194,171,197,94,144, 23,18,223,4,48,29,59,42,154,228,31,192,132,204,152,82,160,229,14,22,211,67,52,205,145,74,46,111,2,68,140,192,145,203,121,190,13,26,163,117,65,128,180,133,88,4,44,2,22,129,139,16,129,97,195,0,56,39,240,32,125,205,231,100,2,196,211,241,113,193,191,1,224, 61,62,184,195,54,187,253,217,211,224,42,120,121,158,108,6,33,190,144,134,129,120,243,64,137,61,252,30,188,103,213,52,161,183,62,18,232,193,98,122,40,1,48,12,192,24,30,177,36,71,74,21,140,46,169,30,192,224,113,29,222,176,219,207,22,1,139,128,69,192,34, 16,36,4,134,13,3,64,5,192,86,94,1,192,255,2,136,167,71,81,54,142,96,196,214,65,194,171,75,54,38,111,122,219,187,13,4,152,174,130,71,160,252,11,113,37,208,152,253,221,84,222,40,31,88,150,39,151,76,27,175,117,35,83,50,24,226,127,211,112,195,244,208,200, 210,37,184,9,112,28,55,32,172,107,96,131,142,125,183,8,88,4,44,2,225,131,192,176,96,0,64,243,32,134,30,33,141,109,184,1,16,59,74,114,96,175,159,33,216,247,224,53,83,175,23,18,90,150,193,48,111,198,4,185,105,73,182,108,56,217,36,41,23,192,60,176,50,25, 108,120,85,59,152,143,146,14,163,71,134,41,209,74,13,194,139,201,63,37,41,94,74,178,97,105,17,12,192,176,24,68,131,128,149,205,210,34,96,17,176,8,12,101,4,134,197,218,205,93,41,119,161,199,112,255,63,37,61,90,70,211,99,29,2,233,227,96,7,179,219,230,142, 248,142,85,176,11,112,186,77,11,30,76,237,120,238,254,201,100,108,56,213,36,55,44,132,203,223,153,30,151,191,65,51,251,219,7,106,30,14,32,33,46,90,38,102,227,24,0,71,46,12,6,135,62,82,218,159,44,2,22,1,139,128,69,96,8,33,48,44,24,0,226,201,43,120,205, 184,2,184,104,76,188,164,165,58,55,0,156,67,128,193,69,219,91,10,176,240,146,66,89,62,39,93,54,192,27,95,18,188,18,145,80,15,70,160,180,67,179,6,179,113,199,202,41,29,12,207,133,32,194,6,211,8,92,129,212,155,0,80,2,108,71,101,66,113,5,114,48,176,181, 121,90,4,44,2,22,129,139,5,129,97,193,0,24,177,52,197,209,197,57,184,1,144,96,124,0,24,114,53,184,221,105,8,111,14,188,239,221,185,98,178,72,101,171,74,31,72,168,131,29,200,84,36,128,185,216,120,166,69,150,204,76,147,133,115,138,180,136,179,103,131,229, 244,167,239,26,59,12,143,195,216,232,77,0,72,34,90,112,13,145,18,143,193,97,119,250,174,79,127,191,178,78,100,150,168,30,66,236,186,254,241,153,243,27,227,93,108,129,109,238,196,197,193,130,248,120,84,105,46,54,56,186,180,215,96,227,224,227,141,205,121, 135,249,238,18,123,120,126,233,137,129,51,127,116,124,224,71,254,126,49,5,7,15,98,96,198,3,223,195,123,190,56,182,114,195,188,23,201,197,240,74,156,180,156,147,241,57,41,194,123,234,12,131,64,127,53,223,238,47,36,138,244,186,55,10,142,136,46,191,116, 146,76,43,222,38,155,106,91,101,102,98,20,188,230,210,107,94,240,24,129,206,221,127,171,124,232,206,75,36,47,59,93,171,67,235,127,23,46,112,42,140,16,115,19,160,6,186,23,25,209,163,156,21,225,66,86,195,211,96,214,134,171,145,190,179,102,168,3,171,65, 169,4,241,34,52,84,10,237,42,165,96,12,103,49,231,132,166,20,163,29,43,155,97,8,240,99,71,62,252,60,28,2,241,225,52,33,62,196,34,18,31,120,116,70,5,90,7,49,254,238,96,64,60,218,60,120,152,52,68,108,56,7,182,147,24,113,188,208,168,24,93,139,115,252,56, 12,62,127,241,44,252,192,133,10,199,102,172,16,23,98,26,238,129,45,52,125,173,24,160,81,188,225,195,207,252,51,1,77,215,185,194,241,1,1,160,50,140,250,51,94,188,162,153,232,97,253,110,48,97,251,105,238,61,18,107,188,51,95,216,44,182,150,235,6,108,177, 40,22,24,19,248,204,52,28,15,225,128,69,216,51,0,4,155,247,208,217,9,68,189,96,76,42,62,112,32,7,199,5,176,102,230,199,139,33,242,227,243,71,203,39,224,141,239,51,255,177,65,70,128,1,8,230,206,152,19,47,1,222,119,182,195,233,79,225,132,4,185,2,30,9,25, 12,243,225,71,53,131,26,37,29,62,1,150,140,142,147,215,78,54,202,232,24,48,0,131,28,216,215,12,156,88,250,135,23,210,46,18,119,46,84,206,98,237,244,61,39,100,35,86,167,10,152,72,174,228,172,132,126,72,199,106,229,157,17,103,54,164,24,212,169,200,192, 95,34,142,54,34,64,29,201,217,83,178,193,124,136,59,147,176,204,11,21,88,173,222,202,51,245,241,167,46,166,222,204,143,24,197,160,109,204,183,9,216,156,196,145,217,41,90,206,4,227,172,141,100,134,202,25,140,148,100,154,211,70,159,38,130,10,50,69,43,24, 92,226,65,162,199,60,25,122,171,159,243,235,224,189,246,133,13,9,24,151,2,127,130,193,134,237,32,35,68,108,248,222,138,241,114,6,184,148,18,23,226,67,42,199,192,130,233,253,10,227,164,48,38,66,143,249,56,246,56,70,136,13,25,72,83,118,168,176,113,42,234, 223,171,233,71,157,67,108,214,168,145,202,248,128,45,134,101,83,204,29,142,15,154,24,167,114,53,49,96,2,70,38,5,4,6,19,48,62,120,212,25,137,116,244,12,218,236,133,1,163,94,72,12,76,213,216,69,190,2,127,231,188,241,39,152,186,51,175,24,180,45,26,227,130, 99,226,20,36,204,39,240,167,99,130,29,205,178,24,9,88,100,98,3,148,137,57,147,132,63,254,208,132,248,173,192,195,68,243,167,220,80,196,9,123,6,128,160,145,248,18,112,137,27,37,217,94,62,0,140,104,222,45,176,129,48,15,142,104,252,28,236,240,143,148,85, 139,160,12,248,248,78,41,111,110,151,116,12,12,78,140,94,198,165,171,170,113,109,230,114,220,126,170,69,62,253,145,169,50,177,32,75,211,27,230,195,77,102,92,40,25,200,169,186,15,78,34,186,91,158,146,147,40,175,29,173,147,17,73,81,200,204,207,25,230,178, 64,230,202,105,69,2,70,12,200,84,113,222,81,234,211,128,133,105,55,24,34,124,192,31,38,103,19,167,28,66,12,82,36,69,226,56,40,66,102,36,197,72,1,234,151,28,27,1,226,62,82,70,97,1,99,11,218,193,53,182,182,99,145,131,251,232,93,85,205,178,191,170,85,164, 186,65,45,28,74,226,40,137,129,66,105,49,252,43,16,95,238,248,248,71,220,2,195,76,107,213,231,11,219,201,246,197,162,142,108,27,9,74,247,192,186,208,239,68,139,167,62,108,135,175,192,164,204,139,139,23,119,250,100,104,182,17,39,140,29,105,0,70,201,17, 146,60,58,70,86,228,37,74,78,82,180,99,65,18,25,53,183,180,201,105,24,211,218,117,166,89,118,158,104,20,169,1,174,209,200,40,61,74,38,1,67,50,4,172,23,177,32,93,32,22,189,213,193,87,189,6,250,140,94,47,89,166,90,191,244,145,89,20,118,3,152,110,88,15, 122,159,115,166,15,157,29,157,195,16,85,96,174,150,157,6,54,213,104,47,199,14,176,89,144,25,43,99,83,98,36,46,38,82,203,108,5,49,172,110,106,147,35,53,45,178,21,54,63,228,52,198,11,169,98,90,148,20,164,68,225,109,148,46,248,100,150,136,13,195,133,196, 198,41,177,255,87,182,159,21,51,82,14,142,169,122,180,109,119,77,179,211,38,88,248,4,39,44,73,192,224,138,236,4,201,140,143,148,120,48,60,163,48,46,219,32,209,172,3,86,135,171,91,100,19,148,144,21,3,54,22,227,41,37,53,74,198,98,190,56,12,99,167,4,137, 115,117,48,3,155,195,182,176,63,29,134,157,79,186,6,50,118,108,39,233,4,199,71,111,85,34,54,134,81,102,94,91,49,15,192,9,241,161,72,118,172,172,226,124,193,152,136,192,26,66,115,240,173,192,163,188,174,85,222,169,108,194,124,1,30,28,63,113,88,95,70,71, 203,140,132,40,157,119,92,255,135,106,24,38,12,0,214,53,12,194,226,140,24,201,76,115,110,0,12,4,240,64,25,7,147,174,24,174,130,191,187,170,80,238,255,227,118,201,30,151,160,187,131,129,212,135,105,57,132,56,200,79,115,71,2,194,180,102,9,152,12,4,245, 76,8,166,195,109,224,34,26,104,48,105,105,120,104,98,46,36,46,77,165,154,21,107,17,236,161,206,252,56,177,217,246,70,16,236,3,104,127,43,8,182,18,123,46,178,41,145,50,111,76,156,204,40,73,146,241,184,149,144,51,58,73,50,82,227,37,29,14,139,18,97,159, 33,30,183,21,34,225,21,146,199,66,81,216,221,179,143,76,63,113,167,195,73,220,210,218,46,77,205,45,82,223,208,34,149,85,117,114,228,248,105,217,117,168,82,158,221,94,46,91,246,214,234,132,30,139,177,149,230,97,230,184,219,67,117,130,26,184,240,96,125, 85,0,183,144,240,242,118,5,9,145,55,160,44,147,59,49,44,98,99,176,24,165,130,224,116,175,11,154,163,117,163,164,136,108,206,9,44,214,39,225,172,74,218,206,203,252,73,201,114,205,242,137,50,189,40,27,71,71,169,106,46,155,6,179,136,141,30,33,105,214,96, 138,218,218,165,177,169,85,206,84,215,75,249,169,26,217,117,176,66,214,110,61,33,79,238,58,67,209,129,224,188,71,166,39,68,170,11,234,6,244,9,215,183,96,227,209,29,92,20,1,56,70,200,182,42,44,198,176,183,193,235,190,93,2,177,97,227,137,91,102,148,76, 3,179,66,9,144,119,189,152,7,113,142,5,147,192,241,84,11,162,183,147,12,81,109,187,68,229,197,201,231,86,142,147,57,83,114,101,124,94,58,214,145,68,184,19,143,85,75,159,100,26,25,200,148,145,0,54,181,180,74,117,109,131,156,58,93,39,7,142,158,146,183, 182,31,151,223,238,56,37,71,143,162,223,210,34,101,50,60,132,114,103,76,38,164,5,125,53,152,55,130,180,98,46,94,216,6,179,171,109,66,223,109,37,211,75,60,97,212,235,230,201,208,41,42,201,150,201,227,71,171,98,113,26,204,169,115,254,208,171,42,149,126, 57,239,207,3,227,54,48,205,77,96,20,107,235,26,229,116,85,189,28,44,173,148,205,123,203,229,233,29,21,178,101,95,157,72,124,132,20,96,140,112,243,67,34,202,126,96,247,152,117,195,69,117,251,141,202,246,68,163,127,106,209,47,199,203,48,206,89,16,137,53, 59,219,4,62,227,206,29,99,102,50,152,26,254,196,165,131,143,77,224,208,33,195,156,128,221,60,29,202,109,230,28,196,156,185,101,110,150,172,122,127,129,76,157,152,45,217,184,94,206,53,37,22,243,101,4,198,15,199,210,121,48,123,205,88,63,26,26,155,165,170, 166,65,142,158,56,35,219,247,151,203,147,27,142,201,187,187,107,68,198,144,17,136,212,141,138,119,121,166,220,80,191,143,40,124,223,131,222,80,133,186,62,174,203,103,229,227,49,161,183,66,41,238,182,169,25,242,171,175,222,42,41,73,113,186,176,95,216, 115,113,167,234,36,40,44,119,203,174,35,50,235,11,143,72,17,184,98,14,44,174,219,3,9,76,158,140,129,189,241,112,189,124,251,182,169,242,79,255,231,106,213,57,8,68,90,209,165,30,204,216,229,200,228,192,231,12,35,33,253,223,167,222,150,219,191,183,86,102, 76,76,80,73,7,39,82,176,2,243,162,88,182,22,204,221,177,114,112,215,248,60,35,63,65,22,79,76,147,146,9,25,50,33,63,3,94,31,65,200,112,20,65,99,76,52,203,204,93,74,48,2,137,224,201,202,26,217,125,160,76,94,92,183,79,190,255,210,33,110,43,101,50,8,175, 89,112,130,181,176,19,50,30,99,145,144,238,175,105,149,111,93,93,44,87,204,47,146,232,168,8,37,58,221,187,103,207,193,114,249,214,35,155,165,26,199,26,163,177,200,114,55,206,56,220,229,83,122,192,93,242,6,236,74,32,227,151,72,212,247,235,87,76,144,197, 115,38,72,241,248,108,25,13,11,142,134,160,249,139,19,23,217,106,44,110,135,143,157,146,215,55,28,144,135,94,221,47,235,200,24,165,70,202,236,212,104,149,8,212,97,209,228,17,204,96,4,226,19,135,54,109,171,108,150,143,204,25,35,183,173,158,46,169,96,240, 88,47,239,18,57,30,79,158,174,149,223,61,181,69,30,217,119,70,102,164,68,75,61,234,197,126,34,182,200,66,45,117,82,148,123,148,227,9,216,125,122,113,158,172,94,80,36,37,69,185,146,131,177,196,49,228,54,212,53,52,75,89,69,149,172,223,126,88,30,123,117, 175,252,121,227,73,16,161,17,50,53,51,70,199,74,13,250,137,208,120,215,213,109,25,3,137,207,114,13,147,70,75,165,245,168,207,94,50,133,120,120,227,204,12,185,126,81,161,204,155,62,78,114,199,164,73,50,214,78,238,148,221,6,74,142,42,48,95,118,236,61,38, 47,191,123,64,126,252,58,54,5,96,214,50,199,64,138,2,134,160,30,115,152,82,43,142,17,246,103,48,130,89,31,120,84,113,14,249,254,240,150,25,208,191,202,213,117,169,59,7,208,210,218,38,107,223,221,47,95,127,122,175,76,198,154,76,60,88,15,182,148,250,46, 100,138,56,111,54,18,23,140,143,47,174,153,32,55,174,152,134,113,145,167,99,205,77,125,169,144,77,44,222,222,180,95,254,249,145,141,242,230,177,122,153,142,13,132,50,66,238,161,117,83,180,171,184,251,255,120,207,136,176,103,0,216,98,218,195,223,124,188, 65,190,118,125,177,124,253,238,107,177,192,185,119,136,99,8,233,209,19,149,114,26,98,224,217,83,199,6,164,71,96,242,33,1,249,230,131,79,201,247,158,216,43,115,32,5,168,194,32,13,100,98,153,30,229,226,197,177,179,27,78,135,54,254,244,86,153,93,50,46,32, 38,199,212,111,235,238,163,146,24,31,35,212,89,48,207,76,89,254,188,27,70,231,245,119,247,200,146,123,159,192,81,64,172,78,40,48,205,65,89,232,56,57,185,243,63,130,29,44,37,214,223,191,178,88,22,206,30,47,99,115,51,36,3,82,158,184,126,22,106,182,137, 193,243,230,84,202,121,164,207,187,188,16,88,214,219,51,57,141,132,192,196,97,95,238,220,119,92,254,252,220,38,249,238,163,123,101,68,70,148,92,130,29,38,207,137,131,197,4,144,137,221,114,188,81,126,124,199,12,185,231,131,43,85,36,111,202,247,245,254, 220,171,91,229,202,111,61,47,37,88,96,219,208,72,238,180,40,17,168,195,66,187,239,72,3,118,44,137,114,207,149,83,100,57,244,68,38,142,203,82,102,209,59,31,226,211,129,141,247,15,158,207,189,97,193,159,79,128,216,189,134,126,255,229,147,91,101,237,182, 42,201,206,139,149,220,184,72,197,131,233,60,48,250,200,213,253,35,18,249,100,180,107,19,136,255,29,211,51,229,199,95,184,22,59,49,71,207,167,183,220,246,29,46,151,219,31,120,76,182,64,164,93,130,221,23,9,48,143,46,40,218,221,116,12,71,60,32,252,223, 184,178,80,174,190,188,4,4,35,31,38,180,187,18,253,30,99,199,71,65,189,225,83,141,93,241,166,237,135,228,127,158,217,34,191,121,249,152,35,161,194,226,79,105,3,25,181,96,18,64,31,213,242,249,136,4,142,107,36,143,131,54,144,241,129,110,195,167,150,21, 200,123,192,72,205,156,50,214,39,129,211,241,193,220,122,155,51,248,169,55,12,56,95,118,239,63,46,207,190,182,83,238,123,118,47,110,69,181,200,180,130,120,213,175,168,198,78,61,24,140,34,171,197,53,145,42,25,59,32,197,121,234,190,229,144,110,205,102, 141,123,13,148,244,253,228,63,159,151,251,255,180,93,230,98,77,62,3,28,40,5,36,54,28,103,59,48,111,174,159,51,90,62,119,219,165,184,93,85,172,12,184,201,204,95,60,186,175,29,135,74,79,202,55,127,249,188,252,247,230,10,153,149,17,171,155,25,12,195,33, 17,200,0,140,74,155,126,245,55,135,68,109,2,172,4,177,164,56,175,28,131,224,195,171,138,100,142,199,36,46,179,235,222,25,125,21,193,197,144,241,183,237,46,149,95,63,246,174,92,185,104,178,50,18,186,203,48,35,189,175,12,58,126,99,141,48,209,193,132,36, 224,204,249,215,207,236,146,116,156,69,115,192,246,49,151,58,82,251,250,192,157,93,10,118,131,91,75,27,228,190,171,11,229,189,87,207,235,216,197,185,107,163,179,107,39,241,254,222,175,95,144,204,228,24,153,0,61,2,214,203,77,62,172,163,193,171,25,156, 245,191,189,190,71,224,133,64,119,159,228,202,7,26,152,5,251,148,187,134,102,192,249,204,23,86,202,157,55,46,84,226,79,189,3,186,97,102,48,147,146,117,233,25,28,81,63,219,229,230,207,59,31,147,45,251,114,76,102,138,44,153,91,40,139,138,146,228,141,45, 199,100,39,8,82,97,114,244,128,185,122,226,21,7,226,95,134,93,71,35,118,33,63,249,216,229,42,106,108,63,123,214,103,159,24,198,139,146,143,138,35,199,228,185,61,103,36,31,34,231,4,96,178,1,231,149,103,106,218,228,7,31,152,33,255,247,19,203,101,213,226, 105,42,29,33,227,105,176,242,110,31,37,85,125,97,131,31,157,142,70,34,98,193,63,198,167,24,116,90,113,158,172,185,116,130,76,25,19,41,15,109,44,147,19,144,192,21,194,13,55,137,28,119,87,76,26,140,192,242,184,51,43,59,220,32,223,188,107,126,23,163,87, 221,243,231,92,101,91,233,9,52,170,189,73,30,123,234,32,204,130,199,42,225,167,180,100,207,129,122,249,63,171,198,202,47,238,94,46,183,93,115,169,228,227,6,77,164,199,123,38,219,230,29,250,194,197,252,230,29,223,204,7,30,167,144,169,94,6,9,206,18,28, 185,28,63,90,41,111,238,168,146,92,28,219,113,76,55,3,159,129,108,4,188,203,244,231,51,215,14,30,93,145,89,221,189,183,78,222,191,48,91,126,118,247,229,242,225,155,23,170,68,200,72,60,56,174,186,98,224,156,153,155,182,246,246,238,93,7,147,158,243,37, 11,243,133,87,148,111,153,153,35,137,35,154,229,209,119,42,164,28,7,206,69,241,206,209,12,185,196,129,12,17,246,117,10,24,195,45,216,16,189,103,122,134,124,250,125,75,112,148,21,37,190,230,13,235,197,246,177,175,51,82,226,228,231,175,236,145,8,180,54, 6,243,46,30,243,134,18,198,125,71,26,229,159,239,154,45,95,251,228,26,184,84,207,211,245,181,59,38,236,183,222,112,224,115,239,192,249,198,144,154,156,32,133,185,41,242,203,151,247,72,20,162,208,99,44,165,193,93,99,123,167,188,112,159,207,108,127,230, 129,224,200,75,47,92,157,123,148,68,220,57,200,137,40,207,53,25,8,126,247,14,233,145,176,151,7,245,56,203,249,245,159,15,42,7,107,242,234,37,170,207,199,172,143,167,239,101,250,164,124,185,103,245,56,217,142,157,29,119,49,90,79,159,169,250,126,72,142, 153,103,137,116,249,123,195,242,18,229,76,205,0,235,59,101,215,95,57,105,24,246,29,46,147,159,61,186,95,106,235,33,238,66,224,96,116,126,209,175,254,189,48,17,66,26,6,248,85,217,241,234,19,0,235,155,251,124,156,108,186,188,50,107,238,254,75,97,86,249, 254,101,19,101,249,194,18,253,157,162,53,234,60,40,49,211,182,56,139,148,111,66,214,37,75,191,191,120,79,112,51,225,89,30,203,230,89,232,149,151,207,148,39,190,121,131,172,154,144,44,235,43,26,245,246,0,214,150,1,5,74,17,168,195,50,3,231,176,241,208, 171,96,192,82,227,25,195,158,119,196,97,221,216,86,214,135,11,247,117,139,139,213,242,100,10,22,248,245,135,234,228,138,220,68,121,245,187,215,202,151,62,186,70,25,59,230,99,240,66,98,37,60,222,237,227,239,125,5,246,131,137,79,44,248,199,178,77,158,220, 137,127,244,189,151,203,198,239,221,40,31,156,159,45,239,238,169,81,81,61,9,118,160,99,221,187,62,132,149,187,60,85,162,130,118,117,106,82,172,254,204,133,121,196,8,104,56,160,62,222,127,188,134,203,186,49,92,54,115,60,156,130,196,73,19,112,221,82,223, 42,165,208,27,121,232,254,203,229,135,95,188,17,102,187,39,122,22,120,140,39,29,71,212,97,232,154,151,102,210,207,139,119,217,166,95,88,55,214,129,210,181,171,174,152,37,191,255,198,205,242,157,15,78,151,173,96,96,170,32,5,32,209,10,6,54,253,84,77,231, 33,241,203,128,242,30,197,218,165,141,103,229,183,247,45,150,159,253,227,77,184,61,52,85,199,25,235,169,68,14,24,176,254,93,49,232,175,4,231,247,46,24,0,67,116,72,199,24,225,248,153,14,119,233,15,124,230,58,249,219,183,86,75,1,234,242,46,196,225,212, 13,32,225,241,64,239,95,65,221,98,177,109,42,73,192,177,92,94,26,152,60,207,166,160,107,27,156,250,56,207,156,12,40,65,252,252,194,60,57,10,125,129,209,177,145,178,3,138,177,135,171,91,229,209,111,172,148,207,126,120,149,234,126,40,46,62,48,233,86,133, 30,95,187,96,161,99,209,89,24,120,180,116,109,65,146,28,197,213,112,234,159,152,49,215,35,131,16,60,8,123,6,128,13,160,50,11,149,88,198,100,194,52,45,130,219,129,197,248,156,0,12,167,206,212,139,236,108,146,23,223,218,163,249,112,81,225,162,231,38,112, 30,48,13,149,228,110,90,14,39,65,80,76,226,53,146,64,68,95,20,223,113,129,223,6,38,226,83,171,199,234,132,98,93,88,37,14,56,127,3,235,195,182,48,188,250,206,62,145,119,161,196,196,182,34,104,62,204,208,69,48,37,39,36,196,200,148,92,224,14,45,124,106, 218,6,35,48,27,221,143,180,156,151,156,76,71,169,147,147,102,36,118,200,188,101,209,57,209,130,81,90,255,121,176,60,234,22,112,97,32,142,20,27,255,252,203,215,202,130,220,4,53,200,148,140,115,213,129,76,106,69,30,109,38,143,167,29,203,42,121,160,52,93, 108,144,101,93,76,87,241,24,104,222,204,84,121,229,205,74,249,236,149,227,229,191,190,126,179,44,153,63,89,199,50,25,22,214,181,3,175,254,155,233,87,12,150,207,60,89,65,150,193,192,122,252,244,222,27,229,135,31,153,37,155,119,215,233,153,42,197,170,65, 35,116,108,60,64,162,2,26,131,98,98,0,209,39,222,47,206,15,227,10,70,203,87,150,142,149,237,207,87,202,242,172,120,89,247,221,27,228,125,215,47,80,194,220,185,192,99,60,33,51,182,41,24,193,193,198,193,199,140,21,218,233,184,247,19,87,201,163,95,91,33, 199,32,157,217,4,29,15,238,200,7,50,94,250,171,43,199,7,25,167,84,140,203,119,15,212,202,202,113,73,178,30,76,218,135,111,93,34,84,236,211,246,3,75,246,35,215,189,96,181,159,245,34,146,102,140,112,252,241,138,114,76,84,164,50,67,47,124,231,22,185,107, 65,174,188,187,175,86,143,100,48,68,128,67,127,173,233,253,119,77,138,2,201,196,244,22,76,207,154,54,114,77,94,122,201,56,173,104,5,136,127,59,36,111,47,124,109,141,220,184,122,14,214,71,103,76,43,46,3,28,19,172,145,41,147,71,102,79,29,169,149,113,56, 54,228,245,91,142,185,161,18,28,138,48,84,106,227,178,30,4,153,157,182,31,226,173,75,161,9,78,101,176,192,130,51,128,56,144,142,159,132,230,230,37,177,242,187,181,7,228,192,145,114,205,174,175,1,230,171,60,118,60,7,63,3,23,199,15,195,91,223,150,50,56, 9,194,196,39,65,119,19,40,54,36,243,192,115,187,155,177,251,79,128,214,54,243,118,59,134,204,130,83,90,118,90,254,119,45,206,229,102,197,202,177,147,181,170,241,237,166,62,221,227,114,114,79,224,77,0,92,193,227,162,19,140,224,64,132,204,112,253,236,68, 101,157,78,112,157,52,46,177,11,70,93,188,243,112,8,159,179,171,46,26,55,70,30,252,236,42,85,127,47,135,102,124,44,86,51,119,61,219,153,115,23,216,186,124,233,140,227,235,19,137,203,53,151,228,202,39,110,157,32,223,198,46,171,32,39,93,177,226,120,37, 195,98,22,32,95,105,7,250,140,227,143,101,112,44,146,160,80,41,239,243,119,173,150,135,190,122,185,236,193,117,40,138,85,121,238,30,52,38,128,21,246,198,166,151,177,96,230,94,44,196,193,11,103,141,147,216,101,233,242,171,123,175,237,56,58,32,65,10,198, 2,223,31,126,206,88,113,8,10,149,46,73,96,222,250,222,245,50,17,87,234,104,42,60,21,107,65,80,177,241,84,136,180,144,132,149,12,216,122,104,228,127,238,170,137,242,59,48,134,230,104,180,163,253,88,87,6,59,176,47,140,84,134,227,164,8,74,168,63,250,226, 245,242,149,247,76,150,141,251,235,84,28,78,133,253,62,232,183,127,85,244,163,41,172,11,219,206,48,3,82,137,137,121,241,178,7,248,188,248,149,53,178,98,17,54,105,8,252,61,88,74,196,100,86,201,92,241,154,224,95,255,190,5,146,58,40,68,226,72,152,215,16, 253,168,174,214,231,66,188,132,53,3,64,128,120,199,153,187,207,25,121,201,146,236,49,1,204,71,110,130,89,75,26,155,91,229,224,9,48,0,80,106,218,10,145,234,107,235,177,83,70,48,11,157,155,60,205,66,196,27,9,183,174,152,42,82,15,37,32,116,62,9,186,191, 132,130,204,66,18,206,173,182,64,113,231,206,165,185,94,46,127,221,29,113,112,242,153,221,255,186,77,7,228,197,237,85,18,53,33,78,246,30,175,150,134,38,92,131,66,48,24,184,105,35,243,101,40,224,209,11,142,39,248,213,37,244,62,139,115,166,41,126,130,161, 145,253,168,99,227,0,234,232,179,128,1,60,100,191,26,238,107,206,244,9,242,95,31,154,39,101,32,120,144,236,169,88,115,0,89,119,73,218,23,142,90,7,196,102,85,222,127,237,60,249,214,221,87,119,236,108,249,204,72,179,186,100,56,72,95,88,151,17,216,73,82, 26,64,66,199,93,246,95,255,113,153,28,1,195,219,0,38,32,30,132,104,192,11,188,143,186,27,12,186,255,196,246,155,177,124,201,180,113,178,245,7,183,42,225,97,60,50,42,102,30,116,79,55,24,223,89,23,174,29,44,151,225,178,217,69,242,200,87,175,149,34,232, 142,108,0,65,160,36,128,76,0,162,5,37,112,62,146,248,19,243,141,123,106,229,235,183,77,145,7,238,185,6,55,101,210,28,198,16,191,95,200,246,155,70,121,51,206,148,64,220,255,201,43,229,123,56,22,217,180,171,70,235,202,141,131,191,107,162,201,179,251,187, 63,24,98,164,106,178,124,48,202,87,77,205,148,95,127,121,81,199,241,98,176,199,6,251,158,97,195,214,3,242,205,135,119,201,212,113,241,170,8,26,44,165,97,39,247,129,191,134,53,3,192,137,206,1,47,117,103,165,40,15,87,120,186,105,243,250,15,143,51,252,234, 27,154,100,127,69,189,26,244,128,89,56,249,195,139,187,85,227,153,249,24,98,231,111,158,92,160,204,174,155,222,250,110,188,108,180,108,193,89,28,119,69,230,121,95,121,177,70,29,187,127,48,15,100,34,184,203,98,61,122,91,252,122,203,207,212,253,52,238, 117,255,229,149,221,106,180,163,32,58,66,118,84,52,224,46,47,180,130,53,184,157,130,157,83,142,247,99,37,129,6,143,176,187,234,124,220,91,117,252,122,174,117,6,3,176,171,172,78,106,160,89,237,4,183,117,244,171,40,215,145,40,141,48,139,250,117,43,102, 201,205,243,179,100,11,148,224,120,190,23,172,26,246,149,143,89,92,136,81,33,36,17,89,184,218,199,93,63,23,90,183,99,195,117,227,125,36,96,151,123,19,186,155,214,204,149,191,128,9,56,112,188,73,199,58,181,207,251,106,143,143,44,251,125,196,185,223,91, 32,3,68,108,168,184,73,124,248,153,127,134,16,245,150,110,176,158,179,92,206,121,214,129,90,247,127,254,202,181,50,134,146,0,28,7,80,39,128,183,56,6,58,109,8,7,199,101,34,137,63,118,215,223,254,224,52,185,247,227,107,244,122,44,119,182,28,23,161,20,61, 179,124,234,109,144,81,164,24,254,158,59,87,200,87,238,152,42,27,15,214,41,6,3,197,190,143,225,208,145,53,239,238,51,80,95,224,110,40,13,190,247,154,249,250,221,204,29,253,18,132,23,230,199,246,214,214,55,201,127,60,250,46,239,176,234,117,80,240,195, 67,46,132,53,3,0,140,17,240,2,241,248,184,156,212,1,15,112,26,114,120,227,116,147,138,233,23,165,198,200,75,239,86,202,59,91,14,104,167,113,18,115,2,187,9,70,108,157,9,247,196,183,175,152,162,86,213,104,193,140,215,145,250,203,137,101,81,140,71,251,6, 215,206,205,148,203,102,77,212,162,185,144,184,89,228,153,143,137,191,121,199,97,249,223,87,79,200,124,88,56,227,181,177,29,200,251,76,53,12,119,4,16,136,189,105,3,93,33,23,224,58,90,57,142,98,168,231,96,158,7,144,109,71,18,206,149,92,156,97,190,5,69, 64,26,231,25,106,129,152,18,91,50,101,119,93,55,75,141,169,128,252,6,85,10,208,95,155,77,29,88,143,11,185,235,239,173,94,74,232,60,187,221,91,174,154,39,191,250,135,121,184,62,89,175,183,28,156,165,183,183,148,193,127,238,141,13,215,8,51,7,130,95,146, 127,57,114,45,224,188,96,95,145,9,120,248,139,43,177,113,105,199,21,197,179,58,207,131,113,28,64,93,148,13,135,234,229,243,215,77,148,207,125,104,165,42,250,145,224,114,215,207,249,26,234,192,58,144,81,100,157,104,96,232,139,31,89,41,119,93,145,47,239, 150,214,235,21,214,129,96,224,79,243,76,28,246,193,36,24,107,163,162,102,176,231,14,243,51,88,191,252,214,78,249,221,139,165,50,43,43,86,111,52,5,107,115,20,204,126,12,107,6,128,149,111,227,130,19,59,18,70,60,176,11,69,96,7,4,26,104,213,170,21,92,121, 42,8,175,14,198,140,72,121,248,197,157,106,225,201,201,219,93,206,92,116,204,160,94,60,183,88,150,76,75,149,173,212,4,197,36,232,171,154,108,1,21,234,212,20,108,117,155,188,143,46,127,177,203,35,201,117,203,197,179,28,214,131,98,244,199,95,217,165,88, 113,32,82,186,128,81,169,214,204,156,86,153,233,225,162,141,30,168,121,204,177,32,47,73,206,224,40,38,138,187,189,192,187,160,163,112,94,37,227,110,6,135,201,82,1,107,116,1,215,177,35,199,224,126,112,8,140,147,231,188,25,19,100,25,60,51,110,134,137,88, 26,46,10,66,243,253,174,44,235,193,191,161,18,200,4,152,179,214,59,111,90,36,255,248,222,73,74,148,120,230,205,35,173,11,89,83,131,205,80,129,71,153,0,207,224,88,50,111,178,252,233,115,139,229,32,172,7,146,105,230,124,15,116,220,240,136,133,150,7,215, 131,89,190,101,94,150,220,251,209,149,176,98,24,163,132,150,4,55,208,192,250,112,61,245,245,23,104,158,76,167,76,0,214,109,50,207,247,221,181,76,138,179,227,100,61,230,14,143,59,217,150,193,14,206,220,117,218,21,236,185,227,48,0,184,182,122,178,74,126, 242,151,13,34,89,49,176,58,8,61,153,193,110,84,128,249,7,62,58,2,44,48,88,201,56,78,56,105,212,52,46,204,59,142,198,46,219,4,183,157,106,226,211,138,152,224,186,12,9,15,13,247,204,134,163,155,63,174,61,33,155,119,30,214,172,185,144,184,101,48,12,193, 166,149,173,15,173,116,92,5,51,51,210,182,190,2,9,201,86,16,232,75,39,39,203,210,121,184,238,133,96,68,75,125,165,243,254,205,33,254,206,19,26,178,121,240,133,195,50,53,55,78,170,209,54,94,213,194,138,44,101,167,208,102,4,35,54,117,98,251,249,234,89, 205,227,99,99,100,114,30,24,48,152,84,117,164,27,3,155,197,204,150,140,19,153,9,112,65,114,188,162,90,43,228,111,29,217,110,95,139,86,111,207,252,108,109,143,104,134,176,112,236,221,186,8,18,26,92,45,162,50,160,63,71,60,61,50,27,70,15,184,227,36,19,64, 99,77,159,186,99,169,204,157,152,36,239,82,241,13,226,110,183,74,176,195,8,22,109,10,199,176,57,62,162,98,224,63,221,50,73,54,67,12,206,107,194,28,183,110,3,211,240,232,137,138,168,112,18,33,223,248,196,114,61,250,96,25,188,53,19,72,224,60,209,49,140, 119,174,141,190,254,204,145,70,32,249,51,141,195,12,157,87,91,4,255,242,209,69,106,44,136,155,57,8,49,2,102,132,220,212,197,180,201,77,154,254,226,18,55,50,192,12,79,190,180,69,94,133,145,172,217,176,209,65,205,127,207,82,217,95,22,23,252,247,192,70, 200,5,175,102,207,2,57,240,121,87,252,24,118,157,215,192,65,3,13,46,48,240,185,155,192,78,51,12,128,18,67,164,167,55,56,158,215,224,200,10,26,53,163,228,209,151,118,194,86,124,107,71,60,55,249,51,111,51,225,151,47,152,44,227,97,129,234,112,99,91,159, 202,128,44,150,226,100,58,110,249,232,170,201,29,46,127,77,61,253,47,223,105,91,59,68,110,207,192,42,23,137,41,9,20,108,162,64,44,136,252,209,78,222,122,160,39,175,64,130,25,212,52,176,49,142,55,1,26,141,134,171,249,37,144,92,157,52,148,0,168,194,12, 234,120,164,188,90,237,143,251,202,77,23,43,212,159,204,17,255,248,157,75,136,153,224,253,189,51,79,77,231,43,115,63,158,57,229,225,226,72,73,190,90,152,227,149,212,64,174,123,250,81,84,80,163,176,222,221,255,130,89,128,89,224,105,108,231,123,31,93,140, 227,175,54,117,224,195,57,27,216,104,11,102,237,250,206,171,59,46,206,247,190,211,184,249,85,165,36,152,147,209,184,65,243,177,91,23,202,204,66,48,72,112,174,227,175,126,80,151,178,48,213,136,105,25,36,9,15,127,114,161,218,30,225,239,58,238,187,68,244, 239,139,217,100,176,255,204,122,67,203,126,92,255,248,199,181,132,193,252,222,57,231,252,203,223,196,98,222,196,149,97,197,162,18,249,242,245,69,178,19,138,163,92,159,6,190,122,152,82,130,247,206,170,118,31,23,221,115,55,140,255,238,3,199,229,179,143, 108,149,132,28,72,97,144,144,107,217,80,13,225,203,0,96,25,161,87,52,158,163,77,197,238,147,34,175,64,130,103,12,170,67,24,94,139,163,109,73,102,203,64,75,116,83,97,73,236,193,151,14,171,141,107,62,99,95,154,129,203,239,254,4,51,145,104,33,236,115,171, 39,73,77,121,179,50,0,189,13,116,238,162,79,128,163,207,130,131,146,229,11,161,59,128,64,38,194,228,227,79,153,140,99,218,198,235,140,95,127,225,128,20,96,247,79,123,212,12,90,54,216,237,163,21,181,234,8,135,207,76,124,126,118,27,242,120,4,131,157,8, 143,45,200,91,12,52,176,46,154,13,28,226,28,192,205,12,58,219,96,224,206,146,139,14,241,96,63,16,19,238,170,204,31,191,119,199,137,139,86,27,23,49,56,113,169,111,108,209,155,15,92,212,24,76,122,54,62,144,126,53,152,81,179,120,1,164,53,219,96,131,159, 214,190,80,197,33,23,216,62,226,102,22,121,131,149,121,239,248,221,52,106,0,45,96,158,6,207,165,176,77,240,181,155,39,203,118,248,177,72,12,112,167,219,189,42,200,62,232,193,140,43,102,108,48,49,239,156,249,6,187,96,20,76,38,128,248,76,128,189,130,175, 223,62,87,61,206,145,128,248,163,31,100,202,167,52,133,55,9,54,30,109,144,187,175,155,32,215,44,155,169,63,5,182,86,56,12,52,231,17,3,245,161,104,230,251,223,255,248,178,124,253,103,79,202,151,126,248,87,249,242,143,30,149,239,252,226,105,245,255,65, 34,199,185,200,248,222,125,173,137,253,124,33,6,172,43,25,161,15,94,63,15,138,196,145,42,209,117,115,83,202,207,162,2,142,214,57,38,122,110,42,204,111,236,71,163,107,209,14,71,73,127,126,118,147,52,131,153,153,12,111,128,245,176,141,30,140,245,48,224, 6,244,147,48,172,189,1,42,176,184,127,62,1,166,22,105,130,83,131,235,133,129,43,245,8,37,48,71,78,66,217,76,253,57,51,39,76,136,243,112,49,137,197,156,44,220,223,94,221,33,179,112,167,159,87,157,204,194,166,229,249,241,194,9,194,193,194,201,178,122,49, 174,4,254,117,187,14,116,154,128,237,174,25,202,218,80,164,119,242,80,147,252,203,199,102,119,184,252,101,30,110,2,235,104,38,243,75,111,65,243,31,55,16,210,97,31,158,76,13,219,166,244,137,196,245,100,131,212,65,91,149,246,5,248,220,67,118,253,43,202, 179,200,179,110,212,68,231,205,9,42,53,209,63,56,149,12,221,213,184,103,145,92,224,82,18,35,229,15,48,119,123,255,201,106,56,121,138,247,40,52,49,231,206,220,185,16,53,193,123,29,173,56,242,198,64,117,109,35,148,27,27,244,189,170,182,73,78,227,175,25, 187,151,198,22,120,185,195,241,7,165,31,201,176,93,159,13,35,67,51,138,115,100,54,174,139,209,196,176,226,130,50,221,98,205,154,211,34,226,226,162,12,121,107,207,1,137,134,2,105,13,39,190,87,29,25,39,148,193,16,5,35,162,244,85,23,182,219,180,221,196, 55,223,125,197,239,239,153,89,224,105,65,241,61,107,102,201,183,95,57,36,7,97,149,47,7,22,225,232,69,144,187,200,64,3,186,9,117,13,52,117,215,116,156,155,12,206,124,241,157,169,55,54,156,91,44,223,204,175,174,185,249,247,141,117,103,185,204,119,217,194, 169,242,190,37,187,228,143,219,78,201,76,216,139,167,3,163,254,2,203,143,195,60,171,130,175,12,174,89,31,185,97,158,106,215,107,158,30,49,116,127,121,152,223,189,219,195,107,193,175,64,121,237,183,79,111,149,71,214,193,14,10,161,129,142,149,158,89,242, 51,215,143,198,29,112,151,28,45,223,189,122,146,188,247,170,57,50,113,108,150,182,195,172,113,38,95,127,222,205,248,154,10,167,59,223,189,170,88,238,127,104,187,92,50,30,30,84,61,125,226,79,30,131,17,199,193,132,107,40,247,200,190,199,132,247,120,25, 229,217,53,82,105,252,235,143,237,150,34,248,62,160,247,210,161,30,194,150,1,224,226,161,162,107,244,77,190,199,4,48,193,246,221,85,189,119,3,199,52,3,175,108,236,1,49,228,221,115,111,145,13,221,173,230,67,145,227,27,47,30,148,247,92,89,38,83,10,115, 149,1,48,3,215,73,221,255,171,89,172,138,198,143,113,6,250,239,183,201,188,226,36,57,141,9,236,189,16,210,185,5,245,15,232,99,124,205,18,199,4,46,119,6,222,113,250,47,13,243,22,105,88,199,99,48,252,243,155,23,96,248,7,19,150,187,115,103,72,82,57,17,243, 26,187,177,55,79,145,96,54,244,235,96,197,87,153,196,154,117,99,57,188,223,187,32,39,94,222,66,126,51,113,207,153,54,15,220,98,228,93,6,153,59,74,43,198,130,80,87,195,209,211,147,47,109,21,238,178,201,168,208,94,195,233,51,117,170,104,115,180,236,140, 28,62,126,70,237,5,236,62,81,43,107,97,158,87,206,192,19,30,76,132,210,54,1,140,126,83,227,81,143,59,40,161,80,241,14,59,157,147,147,174,99,97,109,240,206,43,243,229,171,31,95,161,231,145,174,153,0,130,128,64,211,188,19,243,210,80,105,56,11,194,51,207, 99,231,71,127,95,3,74,212,119,230,157,139,59,23,50,103,156,115,76,28,47,175,210,93,94,67,115,155,68,227,8,39,9,22,29,179,96,73,51,15,186,42,180,227,110,24,5,50,2,230,115,223,37,249,254,213,140,129,105,147,10,228,199,215,78,150,47,253,110,179,20,76,72, 116,61,158,123,228,30,36,172,188,219,71,103,49,199,203,207,232,156,225,205,147,186,6,30,251,65,25,53,62,90,221,140,231,142,73,85,143,129,220,177,242,249,64,153,36,135,65,194,77,18,48,182,31,185,110,182,252,241,237,103,164,61,141,14,131,116,207,209,163, 201,222,15,168,88,150,128,126,123,7,250,3,180,192,200,155,5,38,184,129,134,227,131,129,196,236,24,218,254,211,255,122,89,254,249,247,216,48,140,139,149,153,19,18,180,159,188,105,49,243,230,220,164,115,163,251,127,179,69,126,252,242,1,121,228,243,43,212, 188,48,243,112,187,86,113,124,24,198,225,154,43,166,201,253,79,236,134,222,47,54,17,120,238,17,86,106,253,46,228,139,25,19,172,27,119,246,101,167,170,165,244,196,105,172,55,213,24,19,205,234,26,57,35,53,65,61,145,210,204,111,42,214,62,226,114,240,104, 133,252,232,15,111,40,67,198,227,28,154,126,30,106,247,254,187,227,24,150,12,0,135,44,9,101,29,15,179,225,218,177,211,4,48,127,97,87,248,31,76,108,138,188,54,66,81,105,12,25,0,29,241,206,47,220,201,166,227,206,124,233,9,88,141,122,115,183,50,0,156,184, 134,192,250,95,146,67,148,169,32,117,213,210,18,185,255,175,187,164,22,132,158,34,63,195,112,240,188,40,13,101,189,3,87,171,223,190,163,164,195,128,137,155,50,24,215,187,110,111,108,216,47,27,246,213,200,116,112,213,116,212,194,192,197,139,204,64,14, 8,227,1,232,25,84,226,246,195,64,3,221,241,206,192,77,128,183,14,213,74,84,26,174,215,180,13,52,71,146,98,218,129,63,39,69,184,70,115,223,19,187,96,21,176,30,110,128,51,229,224,241,42,121,105,103,133,188,115,4,245,198,45,9,37,234,137,112,16,68,63,228, 216,93,38,143,141,87,5,66,195,52,113,141,163,204,131,239,100,128,216,179,92,196,248,59,25,247,223,191,80,42,165,85,79,201,31,190,113,139,186,68,117,118,102,254,213,159,121,153,144,59,6,199,32,200,144,87,61,3,154,248,78,247,152,236,6,252,110,198,1,251, 155,146,17,138,116,31,95,187,91,254,223,182,147,170,176,168,202,32,108,0,203,37,32,112,239,187,170,48,89,174,158,87,32,43,160,175,66,59,238,14,145,114,152,57,67,204,221,84,76,23,81,48,17,28,247,171,23,225,56,235,241,93,170,176,70,123,240,170,28,229,13, 160,155,140,89,231,64,211,34,41,177,209,102,163,94,60,34,218,176,245,160,60,181,118,135,60,188,254,152,236,133,72,157,202,192,93,2,116,129,74,198,38,200,141,179,115,100,213,194,73,106,89,144,76,159,230,131,188,2,193,198,59,127,250,39,184,21,26,252,127, 217,125,90,102,192,169,82,67,31,138,99,156,198,188,34,124,24,166,108,5,46,135,175,92,58,181,195,14,131,91,102,141,115,130,132,251,200,241,74,249,244,15,158,144,167,223,170,144,203,230,167,169,255,5,26,114,114,102,142,119,77,157,207,17,192,109,225,140, 84,121,19,107,230,178,47,62,41,207,127,255,172,172,90,50,93,231,148,25,119,61,83,245,242,196,211,143,180,20,248,153,197,249,242,179,23,14,203,28,236,160,7,234,65,181,151,210,250,124,108,136,63,35,109,221,117,84,158,123,125,167,60,254,206,81,121,227,32, 142,135,161,199,162,129,3,135,4,40,51,90,222,95,146,33,75,103,230,43,83,240,8,92,65,255,237,64,13,164,56,49,112,213,61,244,137,63,219,18,158,12,0,70,109,52,140,57,108,193,121,235,116,156,209,27,19,192,28,120,142,88,70,187,169,223,23,14,126,51,113,245, 174,57,136,73,106,126,164,35,190,246,12,74,18,103,114,219,146,17,45,255,249,210,94,185,110,197,76,245,74,71,78,215,205,34,207,114,12,97,161,20,225,254,43,39,194,181,236,30,153,15,5,160,147,144,2,80,113,140,202,60,228,172,105,56,130,174,74,205,113,131, 219,117,206,193,97,36,220,26,195,240,207,203,224,230,147,34,244,198,4,23,21,174,243,28,191,20,175,243,172,154,11,221,73,152,219,101,96,29,93,79,94,207,42,76,227,30,19,213,36,240,145,142,50,52,211,1,188,176,221,220,168,67,210,41,83,160,77,251,175,47,29, 17,121,100,191,26,29,146,148,72,153,12,201,76,98,126,188,150,135,53,92,251,141,76,14,157,199,52,226,143,253,235,29,188,113,228,79,252,35,113,92,54,59,77,94,126,165,66,158,90,178,69,62,121,199,50,29,67,126,227,224,133,89,58,174,53,177,239,40,250,227,46, 46,88,174,145,189,219,224,239,103,179,171,98,252,45,59,143,200,79,254,240,154,252,247,43,199,85,156,155,3,207,116,89,197,137,202,124,154,252,56,158,201,80,255,189,180,86,254,190,113,163,200,163,59,228,193,247,204,144,59,174,187,84,165,59,196,195,111, 76,76,166,158,119,195,136,77,154,152,35,247,93,62,86,126,240,204,126,201,130,180,104,196,136,110,29,212,45,93,223,95,181,247,250,142,210,203,175,108,7,3,235,197,93,221,175,255,252,186,138,109,41,53,26,1,73,217,116,48,144,49,152,27,102,188,48,58,149,59, 183,99,189,217,241,215,61,242,157,199,246,202,23,174,158,40,159,124,175,227,81,143,121,5,138,13,199,31,7,42,175,210,222,6,91,33,127,121,237,37,137,72,143,65,217,125,99,67,227,74,39,161,75,244,181,91,38,227,78,123,14,171,224,58,152,49,194,205,207,215, 126,254,172,60,189,241,148,44,129,111,137,19,141,237,58,119,184,86,244,22,184,126,28,7,3,50,63,53,90,182,163,46,171,191,255,130,108,206,72,82,73,132,91,44,76,49,177,56,198,93,117,233,68,249,217,95,247,43,246,56,144,234,173,248,30,207,251,70,171,71,116, 159,15,12,241,39,179,252,208,19,111,203,167,254,184,69,111,39,72,86,180,76,29,19,35,241,96,74,76,141,184,129,58,133,117,251,127,54,86,200,255,188,140,121,69,174,12,74,127,51,65,39,232,146,219,140,121,159,5,13,161,135,225,201,0,0,64,238,156,105,2,120, 246,148,12,207,249,109,32,168,118,114,238,21,149,224,240,96,80,136,90,168,180,99,110,58,154,19,148,4,101,38,206,162,55,97,103,254,250,250,189,202,0,112,71,227,122,160,35,47,166,137,134,107,223,107,175,40,145,239,62,185,15,103,242,103,37,6,109,105,66, 25,233,176,21,189,238,64,157,220,7,141,88,158,137,49,112,241,113,195,212,56,40,56,181,223,176,237,144,252,101,125,5,174,232,197,233,78,90,23,27,68,224,175,40,206,185,102,135,2,202,112,207,158,19,200,48,0,78,30,254,189,154,60,121,183,183,32,27,59,96,100, 172,11,75,7,130,254,229,211,91,44,230,207,186,50,187,57,104,199,168,124,167,109,74,232,177,40,159,134,51,15,50,104,124,202,37,219,212,71,99,57,81,123,100,205,199,230,143,82,151,51,60,46,40,142,151,71,223,60,40,55,95,57,71,197,189,196,221,228,213,35,3, 175,7,204,199,28,131,208,77,46,157,82,213,96,252,112,135,219,202,93,92,47,117,240,202,162,243,163,155,184,157,169,122,124,226,24,51,99,230,133,215,183,203,170,31,252,93,231,202,172,194,68,237,115,50,40,92,164,184,102,57,251,96,135,24,82,236,122,9,164, 55,145,56,135,46,197,226,126,207,191,188,35,239,236,42,147,111,127,122,13,198,124,166,142,93,183,99,158,149,51,204,47,117,1,86,93,86,36,63,120,124,159,50,107,148,190,104,223,246,104,129,63,15,2,3,139,245,103,96,157,246,30,42,147,47,252,244,25,121,250, 205,10,41,44,76,208,249,215,140,62,107,4,55,217,128,113,229,96,227,144,33,242,202,51,19,163,36,38,133,11,252,89,249,201,83,251,229,183,27,79,200,147,95,94,45,139,230,78,210,252,6,130,13,151,51,218,147,24,95,248,174,28,2,246,212,147,160,235,224,238,173, 100,245,121,69,88,143,9,33,193,91,181,160,88,189,84,26,226,229,15,114,140,227,61,70,30,121,118,189,252,254,201,35,178,112,126,58,136,122,187,142,89,246,141,131,84,239,57,82,89,143,155,151,25,96,206,223,62,93,39,191,122,248,45,249,225,151,178,58,204,82, 251,43,141,48,227,131,99,118,106,81,174,164,78,76,80,12,198,16,3,63,231,80,119,156,122,175,181,239,95,28,102,104,164,84,84,214,200,183,126,249,172,252,226,47,7,36,119,114,130,228,141,78,198,113,38,198,132,103,173,49,243,133,155,191,36,28,161,206,37,35, 155,227,32,69,129,180,67,252,125,151,49,20,159,58,7,131,67,177,102,253,212,137,187,66,218,215,167,175,229,120,85,96,99,2,119,195,192,179,22,120,206,121,192,0,32,79,218,22,32,81,48,129,57,242,24,64,119,251,41,17,242,48,252,58,171,189,0,60,55,139,137,137, 219,223,187,55,129,157,62,25,174,130,87,142,149,157,240,242,71,205,104,78,166,58,238,254,49,243,174,187,98,170,42,53,58,11,74,127,185,118,253,221,89,8,160,212,8,101,158,167,95,195,238,31,249,242,172,144,76,140,55,58,29,103,117,88,68,120,251,161,185,197, 17,111,185,109,19,49,55,105,178,49,89,120,109,146,10,94,116,242,209,137,98,215,58,186,253,198,122,147,88,157,1,131,86,137,5,135,156,55,149,13,185,195,70,243,84,122,66,226,79,70,128,125,199,184,76,67,130,70,92,41,89,225,162,201,119,170,3,48,13,235,198, 93,12,133,156,172,111,49,76,179,62,183,191,90,202,177,35,100,64,82,215,245,79,128,117,179,105,240,248,85,6,226,26,208,85,64,86,106,128,65,199,140,39,143,181,235,118,201,170,175,61,67,128,100,1,174,159,146,176,113,193,166,232,157,129,56,112,92,243,143, 120,209,36,45,207,45,79,130,248,165,227,40,236,178,89,41,242,251,215,142,203,167,126,240,164,158,139,59,227,87,147,186,127,97,1,8,148,126,205,43,74,146,157,184,10,235,70,227,221,73,221,249,202,254,9,36,56,115,106,132,28,62,118,74,62,241,131,167,228,233, 45,149,178,96,6,148,136,65,225,43,112,243,134,196,157,211,191,19,27,231,51,199,20,23,247,10,224,199,153,116,25,218,80,133,248,139,191,250,148,188,185,1,58,54,158,192,180,110,131,105,11,221,43,191,127,94,158,84,85,52,75,92,47,38,195,153,61,237,99,28,168, 107,147,107,166,166,201,100,72,85,24,92,21,139,200,166,158,7,142,84,200,199,255,180,89,178,167,36,42,83,97,230,15,231,6,63,147,65,235,252,243,126,118,190,227,140,190,18,227,101,26,156,235,252,234,185,35,242,206,102,72,232,16,188,215,58,125,224,231,75, 102,122,178,220,6,59,253,167,161,199,163,183,105,252,109,89,128,227,129,213,50,107,102,21,116,161,30,248,5,136,255,99,7,229,210,57,169,122,244,123,18,125,76,113,62,167,76,231,152,112,10,35,115,114,26,138,197,167,177,46,157,6,245,15,55,226,207,182,147, 140,134,93,224,98,175,231,244,88,184,199,98,215,25,5,2,199,96,38,146,255,13,114,166,13,175,135,29,173,128,24,28,90,241,190,2,197,57,36,18,211,33,154,123,226,221,147,178,30,231,133,12,129,12,114,147,134,202,108,55,128,208,83,81,141,98,127,46,184,188,7, 251,15,203,10,100,134,71,161,199,44,86,190,234,228,235,153,211,26,103,112,238,216,91,42,63,91,123,84,38,64,116,69,238,181,83,160,217,153,82,23,1,180,249,16,218,222,232,185,102,215,249,171,127,159,136,185,97,0,50,211,146,36,22,103,146,199,177,32,4,203, 34,160,119,45,184,43,97,95,24,162,197,223,184,72,177,197,241,88,48,233,251,124,52,164,40,196,146,55,44,200,173,83,25,177,1,139,58,25,6,138,113,241,95,153,2,186,74,101,220,44,164,161,194,14,13,177,72,21,172,14,210,24,148,9,10,144,249,210,255,251,40,28, 75,37,65,135,131,43,166,226,210,127,146,160,199,208,42,163,112,238,110,175,253,231,23,244,248,231,82,136,105,41,214,229,66,78,198,132,117,243,21,248,216,193,22,76,17,136,29,23,246,133,197,201,242,183,245,39,229,123,191,126,65,21,160,184,75,227,110,201, 109,48,69,242,182,200,13,115,242,229,252,233,214,46,71,16,110,243,115,217,53,154,189,217,37,83,145,235,135,255,249,146,172,221,118,70,22,194,72,209,73,72,128,156,99,27,92,39,237,13,28,228,64,2,64,252,184,35,36,179,48,31,235,1,57,202,155,126,244,188,236, 3,222,206,220,38,75,25,88,224,58,182,112,214,56,85,78,237,96,208,187,101,197,57,160,243,13,70,183,86,3,71,154,25,103,232,171,222,221,178,208,121,97,36,68,239,108,193,90,6,131,99,83,112,115,133,243,96,76,28,230,16,230,207,104,206,37,157,79,252,108,254, 188,158,97,238,240,121,22,222,233,207,32,27,18,82,129,30,206,186,173,71,212,102,135,131,69,247,146,251,248,238,25,32,52,207,59,171,56,11,231,237,84,142,238,35,126,247,159,220,15,73,205,129,88,82,82,193,155,68,20,251,255,18,59,255,5,51,83,212,88,26,153, 65,179,214,248,170,10,135,10,127,103,61,73,57,92,213,183,123,253,67,244,61,236,142,0,216,207,20,199,113,49,167,198,126,87,19,192,190,186,169,127,100,235,177,32,28,36,3,128,193,79,206,183,123,96,174,188,150,66,145,15,153,132,199,215,238,146,197,243,38, 169,163,13,46,42,28,236,254,6,198,53,105,230,76,31,47,119,46,202,145,223,111,170,144,75,97,14,147,91,218,27,151,77,237,176,81,77,231,25,110,130,113,65,217,134,187,168,127,127,99,15,183,44,146,137,187,255,92,172,186,239,72,185,231,227,57,22,219,188,19, 78,129,106,224,20,200,232,82,184,41,211,59,46,111,2,172,200,78,144,167,246,195,219,32,238,244,214,235,254,218,127,108,188,243,234,235,51,123,136,200,112,135,192,157,125,51,198,194,86,156,207,170,146,78,125,59,88,122,252,200,173,126,44,250,139,202,58, 88,216,116,118,146,141,7,35,160,218,255,188,1,192,190,230,21,167,164,72,153,141,115,113,246,45,199,2,131,179,128,177,36,255,3,157,140,164,2,79,114,25,46,134,132,239,2,220,21,173,121,152,51,93,74,115,126,243,200,219,82,15,233,210,66,216,38,224,89,173, 30,153,249,46,201,231,83,18,20,86,225,20,9,221,164,100,249,197,163,7,161,244,181,81,222,127,195,66,119,58,18,94,185,115,177,229,81,209,236,41,185,152,192,219,148,113,11,254,232,240,42,208,235,163,89,232,249,232,153,151,183,200,47,31,63,40,115,167,39, 171,68,137,13,117,67,64,217,183,163,80,123,74,163,46,133,194,215,58,56,223,249,197,159,222,144,239,126,254,122,189,13,98,250,193,171,248,62,63,58,107,130,115,108,83,56,118,52,220,107,198,203,113,48,108,233,88,111,84,114,231,1,137,253,193,126,228,51,74, 117,102,78,118,142,9,13,99,211,103,33,94,63,50,31,102,201,57,255,239,127,219,46,242,82,189,188,4,102,143,71,160,1,5,38,131,228,79,118,53,201,87,98,246,201,7,111,90,160,183,73,48,193,240,131,127,61,236,29,107,108,118,26,41,171,50,90,36,176,131,25,56,46, 136,63,69,255,127,120,5,210,11,220,126,0,239,171,24,15,37,123,4,131,133,65,248,49,0,24,83,220,93,150,115,192,82,153,201,195,1,59,19,60,176,193,66,165,143,55,112,125,44,25,4,131,26,220,142,64,180,43,228,28,136,220,169,79,3,161,254,143,87,142,201,7,175, 61,26,240,217,159,33,46,188,215,126,235,242,41,242,251,245,229,178,14,118,188,239,88,152,45,115,113,14,200,48,144,246,80,172,247,213,23,246,75,14,206,204,121,239,159,139,85,247,192,39,60,71,31,135,179,234,237,149,205,184,18,198,155,0,88,124,124,196,237, 158,182,183,239,137,241,177,82,156,131,29,201,214,74,87,11,106,111,249,121,63,231,82,194,64,122,78,113,45,23,217,173,85,112,101,12,243,187,36,220,115,177,83,189,244,146,108,41,202,79,211,251,253,41,137,177,146,132,191,136,81,163,84,67,151,152,243,74, 79,123,123,187,30,143,84,195,54,192,73,156,91,30,41,175,145,237,71,206,200,75,39,208,254,87,79,75,221,103,140,119,68,167,60,55,175,17,96,0,18,200,36,98,104,58,18,23,255,23,64,55,229,248,138,235,44,100,206,47,155,118,28,150,31,66,81,141,215,184,72,164, 120,172,21,72,96,42,242,136,100,182,147,225,62,250,155,127,222,36,139,230,20,201,184,60,71,31,128,152,250,29,24,215,195,92,143,205,77,87,155,17,156,79,180,201,64,122,54,216,193,44,244,199,43,206,200,207,159,132,114,23,20,182,88,44,231,64,119,230,216, 223,186,112,157,168,133,232,183,4,4,251,167,127,59,40,215,44,221,43,43,225,91,94,155,138,76,92,160,131,216,206,88,201,128,20,237,142,162,84,121,8,155,130,220,108,220,37,63,219,222,101,254,82,2,64,9,91,33,214,161,2,92,139,29,72,104,63,123,86,110,191,188, 72,110,89,56,94,21,142,217,215,129,6,14,177,179,232,72,152,78,81,130,202,124,220,140,15,179,38,242,61,29,87,236,168,75,195,29,120,36,118,231,236,163,254,177,236,63,70,95,109,227,230,41,206,35,73,230,38,144,56,15,0,142,190,138,26,82,191,133,31,3,128,110, 225,160,224,206,100,121,126,162,164,113,176,32,184,237,44,179,32,48,109,21,140,198,212,224,58,203,100,120,180,83,3,54,62,198,18,31,81,10,144,12,169,3,228,69,242,244,171,187,148,88,243,78,48,137,145,187,181,176,83,10,176,0,11,234,13,37,91,229,241,39,143, 201,109,159,187,28,6,101,28,151,191,254,42,208,176,254,12,222,12,195,43,235,176,251,135,105,208,124,156,109,250,218,253,51,62,235,203,182,210,131,24,175,210,157,194,189,122,6,78,100,111,108,244,97,127,47,158,198,211,29,243,184,28,40,2,98,39,161,245,113, 3,74,31,101,160,154,42,245,225,142,159,196,104,243,9,220,245,135,216,246,218,57,153,114,237,251,102,193,252,105,174,46,134,52,7,205,171,89,70,188,217,71,150,29,63,53,183,182,169,33,164,51,184,10,185,229,195,165,184,219,139,250,7,24,72,204,162,168,156, 226,33,116,1,102,227,36,243,49,6,251,203,143,139,167,74,127,112,93,149,129,70,172,106,193,0,12,100,23,197,46,164,45,140,241,176,199,176,25,10,170,47,191,189,91,62,114,107,166,138,77,221,140,19,54,135,27,69,190,103,101,164,200,53,133,41,242,244,161,106, 153,1,209,51,143,27,130,52,84,144,123,207,224,204,13,244,11,194,198,109,135,229,213,205,103,100,206,228,36,156,237,6,168,171,225,41,130,117,230,53,85,30,61,145,51,125,252,229,157,114,217,236,66,181,85,161,82,62,172,83,254,7,34,3,97,20,20,73,103,23,102, 202,67,184,177,17,1,65,137,119,96,12,206,207,90,40,234,189,183,100,116,135,248,223,13,161,101,126,70,218,193,181,230,147,183,95,193,71,157,193,169,134,243,221,123,81,229,115,239,239,157,41,156,78,229,111,29,113,156,136,110,235,101,198,19,157,4,141,135, 54,253,33,92,147,46,129,100,129,227,175,191,241,97,148,243,188,171,229,230,51,235,170,181,166,68,0,9,123,107,170,155,60,195,33,110,216,49,0,4,85,7,48,174,175,77,198,110,51,57,129,22,220,156,177,167,31,92,188,152,1,122,146,196,15,103,106,241,249,35,117, 81,240,158,3,222,217,113,167,192,93,75,49,174,158,125,239,249,3,114,251,213,101,50,3,119,165,251,27,156,222,121,152,207,20,239,115,192,243,220,252,166,37,69,242,56,238,143,146,25,96,48,19,193,196,245,231,157,52,135,245,160,145,151,95,62,191,91,70,22, 192,236,111,47,187,127,147,31,119,94,209,36,88,136,167,183,32,248,3,51,113,73,192,184,19,50,117,206,231,93,120,172,82,156,180,228,162,89,70,111,120,154,122,244,245,206,244,60,207,39,246,155,33,37,225,49,201,231,86,140,149,27,151,79,147,105,197,121,125, 30,91,176,78,61,154,130,202,176,62,166,239,99,192,192,197,164,69,106,63,240,154,154,73,67,24,76,156,190,234,231,253,27,199,101,20,234,202,109,51,211,95,200,0,152,180,93,13,48,117,188,243,104,149,158,253,179,15,124,233,126,184,173,23,79,78,180,61,201, 17,242,204,219,7,229,134,149,179,59,174,6,186,193,200,64,66,179,221,147,114,147,229,233,109,149,18,149,62,2,71,69,78,221,221,212,203,13,190,102,110,16,163,163,240,43,193,254,161,191,143,179,173,129,239,254,77,93,217,38,50,165,185,184,19,254,111,239,28, 151,143,65,250,230,109,148,199,196,235,239,221,180,135,71,36,249,100,66,1,58,78,23,209,167,6,53,39,7,179,246,21,231,165,122,41,63,247,151,187,239,223,251,237,187,174,69,247,221,73,38,174,190,155,47,190,203,237,239,41,111,73,101,66,183,128,183,33,156, 157,184,25,221,189,167,28,88,137,78,190,156,251,157,33,24,57,118,230,54,84,63,133,29,3,192,9,160,29,133,93,230,4,40,0,198,65,243,154,161,223,193,220,173,7,188,135,84,57,61,226,225,1,69,165,84,190,233,107,199,68,41,128,114,252,48,10,241,252,235,187,100, 218,164,124,101,72,88,39,55,117,224,132,231,206,150,195,236,138,203,38,201,51,25,137,74,132,2,106,11,202,54,187,222,55,55,238,151,173,219,171,101,238,180,100,104,245,246,189,179,210,235,115,172,0,118,47,199,224,19,128,187,71,158,99,115,30,152,5,169,27, 108,62,191,106,91,148,232,141,112,140,50,37,70,232,85,202,4,156,189,159,85,234,225,51,89,191,15,169,224,71,23,161,100,186,14,149,54,202,7,150,230,202,255,185,101,158,204,153,62,161,211,244,51,114,49,68,219,100,104,234,206,254,48,159,205,111,236,119,54, 208,76,118,182,85,3,112,224,216,114,211,135,158,148,29,111,76,171,11,180,201,179,227,151,190,63,184,140,222,119,102,248,149,70,90,56,158,217,181,193,10,212,23,201,134,94,199,159,97,150,249,31,161,65,79,125,143,64,235,29,133,5,62,47,51,17,54,40,120,95, 154,85,101,78,238,106,235,42,133,87,214,218,191,252,30,36,124,216,223,180,88,153,3,130,117,252,96,131,236,218,127,66,25,0,74,240,220,174,9,38,126,70,26,164,154,56,214,162,116,1,66,28,93,39,216,143,218,12,54,28,12,123,54,240,243,106,22,127,118,29,152, 149,153,7,174,19,247,145,128,76,75,247,121,215,71,244,30,63,17,187,120,140,145,142,134,251,213,210,129,162,129,106,4,33,139,30,141,25,226,15,220,200,168,66,222,20,14,88,114,132,60,19,98,200,7,3,208,193,16,232,19,23,47,78,22,210,2,167,48,199,42,106,116, 194,113,81,240,60,238,53,35,50,7,20,89,102,231,227,76,244,249,189,114,232,40,172,170,33,116,16,146,94,83,246,252,193,169,187,232,29,235,43,47,119,28,121,48,150,91,34,100,202,62,3,195,63,15,189,176,83,36,27,166,120,13,119,209,179,216,142,39,28,239,10, 37,140,215,28,86,167,64,80,164,211,208,31,10,158,104,94,111,166,14,148,104,76,130,98,212,17,136,239,184,107,119,159,147,147,41,137,63,181,139,183,195,118,252,33,92,9,250,205,231,22,200,191,221,127,179,234,93,208,239,3,23,46,50,107,102,1,35,3,100,254, 136,95,111,24,178,205,230,119,190,155,52,102,28,153,252,188,154,230,234,99,32,237,13,230,186,131,38,117,98,30,164,140,153,167,50,190,208,23,161,153,229,195,199,42,21,19,131,153,43,128,16,153,233,70,167,131,200,241,30,39,2,9,134,235,16,8,208,90,22,94, 2,76,219,91,29,201,72,43,3,14,155,252,187,14,157,82,199,98,140,107,230,68,111,233,188,159,115,44,154,248,212,13,130,74,190,234,239,120,207,33,246,3,199,60,169,171,183,238,19,17,12,36,48,21,251,34,216,127,172,231,64,194,40,232,237,196,241,104,18,18,44, 39,47,63,58,108,64,70,165,6,82,219,240,78,27,86,12,0,161,230,221,110,94,201,163,197,181,156,209,206,121,45,23,237,222,22,252,222,187,199,25,84,77,184,47,127,176,28,18,0,156,53,81,249,195,159,177,75,226,154,13,142,191,225,88,131,232,121,59,10,225,2,16, 8,241,240,158,44,126,12,115,159,205,49,121,172,135,225,159,199,113,77,113,58,140,149,116,191,247,239,43,33,23,94,42,61,210,132,238,238,178,58,104,192,7,174,0,103,234,192,243,187,153,184,9,128,10,40,179,230,171,220,254,158,145,248,211,119,252,38,184,72, 141,131,68,226,149,111,95,45,119,189,103,169,26,124,226,217,170,46,130,200,132,11,151,33,230,253,229,233,207,239,193,204,203,159,242,6,35,142,51,134,2,29,73,190,107,196,57,193,97,66,229,91,114,140,100,152,89,130,251,57,215,153,127,50,124,15,112,178,153, 190,236,252,197,207,79,254,76,84,79,86,222,81,29,105,131,159,101,248,25,141,249,235,141,26,172,33,251,142,195,115,101,147,115,147,196,61,167,225,244,91,28,116,105,98,19,34,228,12,214,57,21,129,123,186,147,229,176,31,160,4,37,177,176,188,105,130,153,123, 230,123,184,191,115,142,55,99,147,133,9,238,97,138,188,123,176,151,214,81,251,208,6,215,8,132,21,3,64,230,151,71,214,199,160,188,147,141,59,184,163,205,13,0,215,205,102,2,103,192,240,78,240,246,114,156,66,130,8,242,126,175,63,187,17,206,65,221,97,195, 20,237,239,94,216,173,78,105,152,99,32,12,0,211,49,40,19,227,124,116,245,202,5,148,11,113,35,188,225,61,6,37,36,50,50,36,140,186,179,239,39,39,46,28,108,71,1,152,153,215,203,29,47,122,78,146,64,38,147,147,134,231,187,133,57,48,8,132,107,118,196,201,237, 226,68,226,207,59,249,27,107,90,37,15,138,103,47,127,253,90,185,252,82,199,37,50,181,248,41,30,52,132,191,159,230,93,196,63,7,210,127,125,195,197,241,73,220,73,145,232,109,177,29,26,218,12,156,147,110,130,137,30,67,17,47,178,99,122,183,99,68,203,51,25, 249,81,120,215,168,40,52,200,240,112,205,208,249,6,9,73,121,77,147,180,120,140,106,249,81,53,159,81,232,156,41,15,59,224,26,100,170,152,123,197,226,252,224,145,29,207,201,135,107,104,195,77,157,26,40,121,243,170,35,251,206,175,238,242,43,210,112,69,44, 240,118,133,21,3,192,102,114,66,180,66,188,60,127,76,188,158,67,242,153,219,190,215,65,229,73,84,13,59,216,91,42,154,164,16,218,253,189,221,0,96,25,221,3,227,78,199,153,232,235,59,171,96,9,12,247,71,17,72,136,187,46,54,221,83,245,254,61,224,221,148,103, 5,222,182,251,168,252,242,141,99,50,1,142,68,88,55,127,234,65,8,200,0,208,40,14,204,89,201,105,143,83,32,46,200,110,153,25,179,136,211,220,235,56,154,4,6,7,79,230,4,66,99,191,3,170,162,119,251,207,240,138,39,210,63,252,229,53,50,103,218,120,164,167,66, 20,118,67,228,254,6,16,8,21,219,229,129,108,0,57,13,189,164,158,225,60,104,21,235,24,79,96,0,234,113,179,128,87,200,220,7,29,88,154,108,84,4,8,24,22,120,115,51,192,109,94,102,188,249,147,174,7,54,29,141,241,39,181,127,113,116,103,142,246,112,236,182, 226,88,209,9,61,74,246,43,51,50,185,177,188,146,70,37,64,175,44,248,81,79,77,32,1,136,195,49,216,112,11,102,94,54,193,219,39,143,254,82,161,0,225,56,102,243,163,165,38,177,31,81,109,148,78,4,6,182,162,118,230,115,65,62,117,76,6,76,178,34,220,0,80,219, 235,44,185,227,7,63,171,225,53,88,212,9,80,85,43,142,220,120,4,224,31,51,193,137,200,83,8,94,251,162,163,157,63,191,188,75,93,171,42,3,64,213,221,11,20,72,96,185,88,208,155,217,179,80,72,164,216,157,187,103,18,117,175,117,163,207,218,48,15,189,9,208, 116,78,202,233,15,1,33,16,102,132,105,120,29,146,33,207,227,21,143,18,21,98,228,239,122,75,56,105,174,247,232,145,6,121,248,211,139,101,193,37,206,173,8,66,202,118,186,13,236,102,214,137,204,131,195,208,152,154,56,186,3,122,156,128,223,221,50,59,110, 235,113,225,227,155,118,14,66,201,200,154,202,178,129,140,17,239,218,40,233,106,82,112,0,0,64,0,73,68,65,84,230,36,112,120,56,136,181,213,34,189,243,247,119,94,120,215,213,159,207,154,47,10,162,241,152,206,93,187,119,201,254,228,226,196,97,42,157,75, 62,192,209,89,128,129,77,203,117,12,129,149,224,48,194,58,55,144,23,215,0,243,199,126,225,103,190,123,255,153,223,205,187,249,205,251,123,127,159,245,119,206,71,79,222,166,124,45,19,237,49,99,138,206,137,154,79,54,195,84,131,103,45,27,172,78,83,4,47, 238,23,247,171,106,8,241,98,101,57,88,120,207,124,124,78,106,135,24,44,144,241,97,6,155,18,61,94,7,194,196,245,208,47,255,90,136,66,121,205,106,18,204,172,254,239,59,21,66,199,59,78,8,164,54,254,21,217,61,150,98,129,135,123,15,158,144,7,214,30,146,68, 92,69,162,136,208,77,59,184,128,104,141,177,123,57,113,18,103,187,196,23,193,121,213,143,46,94,156,84,99,224,79,94,149,152,192,81,1,86,191,2,245,47,82,33,66,221,8,23,191,159,191,177,80,174,89,54,75,211,145,72,171,130,149,95,185,116,70,210,5,20,173,112, 148,252,112,25,14,12,74,247,63,61,78,240,16,51,179,8,153,246,119,230,20,30,159,186,246,151,159,160,187,104,154,30,141,177,16,140,249,164,248,40,189,45,226,34,185,39,170,115,92,197,47,109,220,37,35,47,229,221,187,86,222,175,108,61,195,212,175,184,222, 145,180,168,32,195,3,82,233,232,187,64,106,149,9,159,18,180,13,50,144,112,22,183,113,120,243,69,245,138,188,50,98,221,49,77,33,182,131,115,26,207,49,67,32,77,225,24,231,92,208,185,193,119,175,63,125,142,239,61,230,138,87,28,198,55,191,155,180,38,157, 249,205,215,115,125,230,97,144,52,126,151,207,56,218,195,119,30,201,62,189,22,71,153,60,230,128,196,143,170,0,129,180,209,11,182,0,63,6,48,40,3,44,41,148,201,194,230,32,201,12,126,238,188,185,106,168,231,57,124,52,131,57,16,16,201,137,30,231,13,128,104, 247,67,140,41,200,0,164,65,243,151,35,244,73,24,6,226,61,254,120,40,231,56,68,107,112,121,43,182,155,30,9,25,94,89,183,87,206,31,107,148,98,143,113,19,204,35,191,3,163,162,25,234,98,247,112,89,141,58,5,162,49,29,229,0,92,228,227,93,96,70,90,162,204,29, 29,43,235,171,155,101,58,143,23,250,9,92,204,227,33,238,163,227,13,24,245,151,15,92,59,71,168,8,21,40,142,222,233,90,90,225,172,163,170,78,255,184,184,240,59,143,41,146,160,132,150,12,23,172,212,184,166,241,21,179,160,177,170,172,15,134,88,24,7,118,104, 112,3,199,148,154,201,6,119,153,137,254,53,199,49,129,226,212,208,236,56,159,162,157,2,214,214,53,220,46,18,244,136,26,124,120,28,105,32,140,83,21,100,198,67,65,15,243,103,0,161,9,99,244,40,54,57,99,64,4,245,204,223,43,47,189,162,140,69,176,13,113,76, 112,131,159,89,47,43,207,212,74,89,69,21,250,145,232,240,207,128,226,253,217,148,192,119,239,231,230,115,247,119,239,248,254,127,230,124,35,241,175,169,111,150,199,94,218,46,63,120,238,128,148,140,137,211,171,196,110,214,50,255,75,180,49,13,2,97,195, 0,176,194,228,32,155,32,238,166,194,94,246,128,110,0,56,205,167,205,244,195,158,27,0,126,159,53,25,228,240,206,225,79,207,106,227,225,112,135,142,119,222,127,77,169,204,159,89,232,249,197,43,226,32,124,52,19,249,232,137,74,249,239,151,247,193,188,26, 24,15,76,36,50,53,125,217,49,232,89,21,220,4,96,66,106,48,151,213,170,153,92,101,0,122,70,244,227,9,17,17,245,109,94,146,157,40,235,203,27,100,36,244,36,250,11,84,23,164,182,255,142,195,245,242,149,155,39,73,73,113,126,127,73,124,254,78,76,24,184,179, 111,196,57,226,187,155,15,200,139,235,246,201,43,59,202,229,181,227,80,244,164,159,0,30,162,114,27,5,45,235,89,96,82,230,143,75,145,89,69,89,50,173,40,71,138,39,100,171,45,6,46,70,54,116,34,64,84,41,218,166,195,28,250,223,24,151,155,166,63,82,202,18, 40,86,84,36,100,32,3,225,244,154,126,245,255,133,137,252,236,38,23,81,253,47,223,43,38,243,215,33,3,239,164,83,198,166,119,26,232,113,193,29,105,29,61,241,27,232,143,2,126,60,146,70,199,40,115,110,178,97,28,85,131,193,24,174,173,247,186,177,227,162,129, 102,221,216,125,176,76,150,124,236,17,145,49,184,77,64,38,157,231,159,161,12,236,75,24,99,195,25,32,136,127,172,94,59,117,209,44,191,199,130,255,77,244,115,112,249,159,225,144,140,25,102,12,128,200,73,200,132,74,224,113,142,247,205,3,13,102,135,215,0, 15,120,251,112,253,13,212,71,137,160,153,104,254,230,203,248,13,96,72,232,81,238,80,93,131,58,224,153,93,50,94,197,163,3,89,28,251,43,159,147,216,156,137,191,189,233,0,60,112,157,145,185,37,48,252,131,219,17,238,136,191,179,0,147,1,224,181,198,23,203, 26,164,22,126,17,50,82,97,164,37,128,241,111,240,139,139,197,77,0,88,122,147,55,143,35,27,254,235,125,113,225,47,49,88,213,106,161,216,73,171,39,203,230,23,234,209,142,131,95,255,210,3,131,149,41,129,59,249,210,19,167,229,103,127,88,43,63,134,223,121, 109,71,122,148,76,132,195,159,56,40,72,146,246,83,226,193,171,164,155,107,90,100,243,107,199,224,29,230,136,58,14,162,231,187,223,254,211,117,82,60,62,123,64,146,37,83,167,11,249,222,181,187,186,126,27,104,61,56,95,200,0,108,1,81,154,10,43,152,227,243, 71,107,150,20,125,7,50,80,218,33,226,62,14,23,212,52,118,99,250,205,109,29,205,88,243,39,157,55,26,250,217,251,129,63,25,244,17,135,245,87,230,136,178,106,16,210,169,133,217,186,81,49,132,182,143,164,93,127,2,200,28,187,12,149,84,198,173,131,101,210, 220,145,234,98,214,84,151,253,192,77,16,67,121,165,99,186,155,105,28,198,215,196,210,159,123,125,49,120,231,192,245,112,33,214,140,253,112,203,92,66,199,93,168,191,27,76,123,45,32,192,31,216,182,36,204,79,58,59,170,69,93,88,79,255,90,228,41,208,52,44, 192,242,123,38,115,93,131,158,89,132,193,147,176,97,0,56,24,200,101,215,67,204,54,171,48,77,82,112,223,92,67,32,163,214,51,178,106,176,11,121,30,158,240,114,225,4,200,95,5,192,238,125,74,17,38,137,9,29,239,208,1,207,205,171,203,213,231,121,247,120,193, 252,110,22,23,42,48,254,233,69,40,255,101,70,233,132,113,191,251,119,38,25,69,187,105,80,30,44,131,247,56,26,19,154,80,144,229,110,242,117,52,142,192,58,138,127,227,160,163,193,179,74,254,99,191,81,200,224,43,112,226,71,67,12,185,185,182,85,22,21,194, 136,16,118,225,12,110,137,139,241,132,72,83,200,255,240,253,199,229,233,215,203,101,22,172,33,210,113,16,109,34,240,184,166,25,149,96,121,172,37,109,246,207,128,251,210,104,216,76,32,211,212,132,107,109,111,174,61,37,213,159,118,118,166,90,7,198,245, 140,21,126,31,202,129,240,118,86,149,223,130,23,136,1,251,16,118,178,229,230,203,199,75,190,199,9,141,33,88,254,150,100,234,72,201,219,17,24,158,162,212,137,146,183,206,122,251,155,19,198,135,139,190,49,229,50,119,69,70,95,252,47,171,175,152,156,115, 201,80,32,222,120,166,69,174,40,73,149,41,48,39,205,160,76,122,128,131,71,93,82,99,188,146,177,224,17,128,97,234,89,109,182,155,71,150,39,96,189,148,138,128,230,24,144,101,250,19,200,142,51,80,130,122,213,212,76,121,240,245,82,137,77,198,113,219,121, 255,153,109,127,202,9,36,14,141,77,53,120,244,134,92,143,9,215,9,250,171,97,208,51,236,175,192,144,252,30,250,94,119,209,108,181,107,14,31,0,69,121,41,122,214,206,164,110,187,73,23,14,79,153,36,118,188,254,198,9,220,253,172,205,223,106,41,83,2,6,32,159, 162,110,152,171,125,249,109,56,226,65,160,104,212,225,204,253,205,201,191,120,134,248,51,246,166,237,135,229,81,16,186,75,50,99,213,135,129,89,40,252,203,169,51,22,137,51,137,176,64,132,217,225,19,0,63,187,173,63,215,59,93,160,144,54,47,11,12,0,242,164, 212,184,175,62,98,26,253,29,226,249,5,69,25,146,225,177,237,96,22,170,206,90,246,254,73,23,91,224,205,235,87,191,250,223,215,149,248,47,185,36,77,189,254,150,193,173,42,61,182,241,102,132,169,27,215,80,126,231,174,135,222,242,78,225,15,213,20,41,138, 235,170,220,214,87,197,123,175,78,72,126,233,90,213,174,223,6,82,33,98,69,66,68,151,203,228,134,174,92,60,217,35,225,162,25,95,119,229,152,216,85,181,13,178,238,112,181,196,194,218,29,23,125,151,217,104,115,2,73,51,16,28,122,75,171,138,109,108,216,201, 22,121,31,60,235,229,142,113,142,71,92,51,71,158,193,73,230,104,127,233,25,72,37,29,233,8,241,247,14,186,55,198,17,232,78,120,176,172,195,153,57,131,25,215,222,241,122,251,108,36,6,60,230,187,98,206,120,248,4,110,215,185,64,67,70,156,19,161,252,67,241, 14,163,217,91,229,251,124,110,70,87,159,145,236,143,221,16,8,27,6,128,221,171,147,30,87,221,120,3,192,40,33,117,107,143,31,95,59,167,148,114,218,144,40,112,129,115,51,137,186,23,66,119,187,52,15,28,11,7,60,15,62,183,91,120,46,207,48,144,60,187,151,97, 190,51,79,78,226,6,88,48,124,148,134,127,146,80,58,192,225,78,36,208,192,148,138,45,70,195,137,83,80,138,212,239,129,77,40,83,141,172,76,28,1,164,70,169,116,164,47,66,193,1,200,137,143,149,71,198,231,166,10,157,243,48,104,125,244,83,255,47,166,204,237, 123,74,229,59,79,238,147,105,16,109,158,194,56,225,53,68,246,45,254,247,96,66,216,58,62,39,211,68,222,71,45,185,129,185,236,194,244,4,14,105,255,149,30,212,24,193,169,56,49,226,184,162,79,135,93,144,14,125,233,202,137,29,238,170,93,19,56,175,246,82,74, 179,253,80,189,20,226,232,205,49,190,229,245,227,32,124,100,59,58,3,176,233,250,160,243,39,151,159,184,105,72,2,54,235,97,177,114,230,148,100,185,114,233,52,205,129,74,168,110,241,49,69,115,83,242,250,158,83,58,119,136,141,247,2,205,94,197,35,25,3,220, 254,116,176,26,204,122,181,39,153,255,253,205,121,101,230,11,149,150,23,65,106,177,21,71,59,177,60,27,243,64,67,120,130,245,199,178,116,115,229,71,222,6,131,128,222,77,163,2,74,124,241,38,242,30,95,67,26,5,14,92,85,212,195,106,157,55,6,187,75,132,46, 139,181,139,218,155,201,89,134,107,111,156,97,58,41,92,164,239,30,149,233,169,32,53,45,41,74,118,239,172,145,215,215,227,236,25,33,216,82,0,142,113,150,197,64,98,247,203,151,142,202,52,104,203,214,129,249,8,116,247,239,228,230,33,194,177,35,165,20,55, 1,232,20,104,160,129,206,98,174,128,63,243,195,56,219,39,129,69,213,123,4,62,227,111,218,175,120,31,67,251,240,8,236,87,211,71,250,160,143,23,179,251,103,148,141,59,143,130,145,112,124,16,48,79,18,120,95,229,250,202,78,113,69,252,46,212,65,191,251,138, 61,244,158,153,118,178,202,29,216,225,161,121,238,182,198,204,167,13,253,144,134,171,153,91,113,60,35,176,188,249,241,91,23,232,21,55,234,103,116,148,225,111,198,94,125,186,231,80,133,50,124,52,45,28,104,253,220,164,243,142,171,146,37,60,240,126,230, 111,19,188,227,145,49,138,197,49,146,174,65,199,155,229,59,31,188,76,10,114,51,92,141,93,147,31,178,234,192,243,68,197,25,121,125,95,141,76,133,116,164,145,150,47,205,132,247,68,230,184,78,163,210,222,169,102,56,200,2,163,160,193,221,64,53,89,102,227, 186,238,151,222,51,71,228,112,163,218,223,224,243,129,226,226,169,144,50,245,156,127,188,218,59,6,250,69,241,184,209,160,140,190,137,16,236,119,119,16,248,81,122,176,144,240,163,168,16,70,9,27,6,128,21,173,167,24,50,37,202,241,56,135,239,236,34,215,11, 145,7,108,18,185,82,158,67,66,171,57,24,93,205,122,208,123,151,228,197,200,127,63,191,83,78,209,197,48,2,39,119,240,130,179,240,210,240,207,51,175,98,247,143,154,115,17,229,174,96,160,65,185,116,236,44,232,23,129,102,133,3,13,102,113,225,213,186,146, 92,40,106,194,119,57,109,44,244,22,24,31,251,110,118,164,196,241,250,33,66,32,152,17,147,210,50,236,136,176,35,35,28,174,33,97,130,222,171,201,106,249,21,130,144,133,95,229,116,143,100,202,85,98,194,31,65,36,76,95,184,193,195,196,229,152,202,136,142, 192,17,201,89,105,57,214,36,127,255,194,114,189,37,193,172,77,190,252,236,54,240,42,230,107,155,75,69,224,130,153,82,23,150,23,72,48,237,117,149,214,20,6,157,31,111,3,85,230,177,63,121,49,46,9,89,28,116,75,226,177,107,222,188,169,90,126,250,233,185,178, 102,0,206,188,56,90,205,58,182,101,247,113,85,0,76,192,177,164,222,206,241,170,20,219,76,93,165,40,94,255,197,255,245,219,75,197,49,143,237,238,184,145,101,25,137,225,154,165,211,229,203,119,76,150,119,177,113,201,2,161,102,112,131,135,38,240,188,48, 157,73,155,132,241,71,161,194,134,210,122,121,123,115,53,152,200,54,152,6,9,112,110,122,23,210,219,103,83,112,111,191,187,126,30,208,8,115,93,74,168,19,132,5,3,192,190,37,17,57,136,197,104,113,78,167,9,224,142,209,230,2,69,51,78,26,33,66,63,196,43,128, 88,12,204,100,112,145,77,143,168,28,46,205,152,157,51,161,80,243,220,198,74,121,103,203,1,141,195,197,50,16,130,214,163,0,60,48,249,236,59,84,38,15,188,116,80,198,226,186,76,19,86,234,129,14,85,166,39,239,18,3,44,118,192,47,66,157,199,41,144,41,207,87, 93,250,123,22,3,98,62,17,62,203,121,245,142,187,252,222,3,1,194,175,140,99,40,75,159,241,123,203,169,243,140,191,183,24,253,62,239,206,168,152,193,210,111,194,206,8,1,36,233,76,236,253,201,101,70,38,58,23,247,242,218,22,56,190,111,82,5,200,4,236,188, 98,208,46,143,132,87,137,23,9,152,175,63,230,193,190,138,193,75,6,24,227,245,85,205,114,4,122,45,143,127,103,181,172,92,228,136,183,221,72,103,186,52,199,83,193,67,165,39,229,63,55,148,203,4,48,242,56,245,9,56,4,50,54,57,188,232,253,83,94,3,115,142,12, 168,251,195,182,2,34,13,190,48,241,126,198,104,60,82,74,197,85,53,42,149,190,187,174,74,190,119,247,37,242,241,219,46,151,8,72,3,2,21,253,155,182,208,2,222,51,235,14,234,149,94,231,104,196,83,49,47,148,88,31,13,184,213,242,212,198,99,48,222,85,165,95, 221,174,97,148,44,80,146,67,93,128,207,127,104,185,220,184,56,91,222,216,83,35,163,209,239,180,198,201,98,88,150,41,206,41,180,231,171,119,60,142,49,50,69,60,22,217,12,243,234,59,143,55,201,103,86,140,149,159,222,51,71,214,228,37,202,150,147,77,202,4, 48,151,254,242,237,89,210,133,126,50,244,107,24,12,68,194,227,22,0,250,130,215,67,72,76,102,204,78,86,195,45,108,188,161,23,174,128,96,191,34,43,238,68,118,227,6,64,4,6,188,25,232,61,167,155,171,156,61,131,26,185,164,68,200,95,94,220,33,75,231,79,150, 68,56,199,9,72,100,218,173,104,111,81,247,11,111,66,243,31,202,139,169,227,19,245,140,189,91,212,128,190,114,45,206,1,215,190,185,178,89,170,112,14,153,231,81,102,10,40,51,36,34,150,99,179,193,0,224,38,64,95,65,219,197,142,68,180,243,228,66,24,60,125, 228,124,241,239,149,46,68,105,220,71,59,19,73,88,126,223,37,59,249,50,14,251,95,221,143,226,30,50,23,241,144,5,86,218,4,239,207,230,89,31,239,38,58,49,248,246,71,151,194,159,250,235,242,248,219,16,181,167,68,74,1,152,210,100,44,202,113,156,67,8,36,56, 108,37,177,103,251,249,152,4,129,191,82,18,68,253,137,29,7,234,96,27,33,89,126,254,149,171,116,28,227,39,29,199,129,220,251,247,30,187,239,108,57,132,251,222,216,13,194,101,116,19,36,122,166,222,204,127,176,2,203,96,155,57,204,110,88,49,83,202,126,84, 47,63,132,174,8,185,157,180,244,104,120,207,118,24,1,207,48,116,240,241,96,195,180,60,94,227,111,28,39,60,234,219,0,163,91,28,97,255,245,157,203,229,182,107,47,245,28,139,56,142,170,220,182,193,212,139,233,246,130,177,127,100,195,41,153,134,27,69,142, 248,191,103,110,172,7,37,141,83,112,68,176,110,95,173,108,219,93,10,183,232,233,61,142,10,122,166,236,249,68,37,1,104,20,111,4,252,235,151,174,147,248,7,159,145,255,249,123,169,76,158,148,168,227,133,183,131,120,131,134,130,87,95,178,26,142,25,50,79, 81,32,250,196,136,18,29,234,19,72,105,147,188,127,101,158,220,125,219,101,50,125,114,129,42,108,223,180,230,180,124,237,223,158,145,255,94,87,38,243,10,18,228,52,198,24,219,98,67,104,17,8,11,6,128,139,148,138,145,113,55,182,16,187,202,192,13,213,16,108, 230,54,66,137,220,134,211,77,50,22,98,111,78,236,96,4,102,67,45,90,154,7,254,221,91,101,114,215,142,195,178,4,76,128,41,115,32,101,112,17,229,132,165,130,225,127,190,132,197,203,152,253,69,166,193,152,71,230,76,147,6,72,204,241,69,160,19,212,212,53,39, 11,38,129,225,182,217,40,51,249,130,153,207,148,46,161,125,13,48,222,195,224,170,92,68,54,229,21,143,203,84,67,63,254,224,193,56,92,224,184,136,101,97,12,188,177,183,86,110,92,152,37,99,113,142,107,130,171,122,152,68,33,122,231,216,48,56,92,6,31,10,191, 197,117,180,215,215,239,133,133,202,221,242,255,54,150,11,140,68,232,241,8,239,222,227,202,135,238,124,83,64,0,41,2,164,215,185,6,110,199,161,16,203,191,17,144,44,253,248,163,179,229,189,87,205,237,184,242,199,241,17,8,241,39,28,166,94,101,39,171,229, 143,175,236,133,62,1,175,173,194,158,61,126,243,167,175,152,71,247,224,166,111,136,13,3,235,65,27,6,223,250,204,117,114,227,242,67,242,55,28,163,253,215,186,82,217,1,223,19,10,4,54,3,52,68,51,18,226,253,116,96,195,163,246,38,96,115,134,198,163,64,176, 120,156,69,155,33,159,93,62,78,62,116,195,60,153,93,50,78,243,245,182,60,169,15,92,189,116,30,235,61,251,26,24,123,224,18,137,178,155,80,166,47,108,248,140,55,39,210,209,135,20,235,60,253,250,30,101,208,232,133,211,109,61,12,134,196,165,0,87,59,255,245, 222,27,100,214,196,55,229,203,15,109,213,22,164,162,159,242,97,227,36,10,204,99,247,192,122,240,70,2,153,184,253,192,165,17,76,29,199,206,226,169,169,242,233,187,46,19,30,45,208,53,184,9,204,255,129,79,173,145,35,167,31,147,181,71,107,101,110,86,28,246, 48,148,14,250,106,165,73,229,226,61,40,249,120,215,197,251,179,139,122,132,89,212,176,96,0,20,83,165,174,231,101,44,110,0,152,9,29,24,214,78,199,170,19,32,236,248,226,192,73,7,107,207,199,156,201,0,80,4,134,213,70,158,194,2,51,127,150,183,97,155,192, 6,149,89,64,217,222,55,160,96,184,25,156,255,140,9,9,186,16,4,134,65,207,84,132,23,235,158,30,50,150,153,155,0,88,130,208,12,87,4,153,125,67,98,193,150,210,88,83,36,92,38,87,66,17,48,21,118,6,244,202,151,87,209,140,3,184,184,17,227,186,39,167,170,176, 16,35,120,19,51,125,208,199,139,201,131,243,127,214,212,2,201,47,136,151,227,48,41,156,139,133,186,10,229,170,228,168,91,122,182,169,29,5,178,159,120,150,251,198,222,26,153,95,156,34,223,191,123,141,100,226,26,34,241,14,156,52,117,43,236,2,126,117,112, 99,129,240,171,128,197,247,186,21,179,101,249,130,169,114,247,145,114,217,185,191,76,182,239,47,151,125,39,106,100,255,169,70,57,0,3,48,229,48,55,203,14,136,5,225,91,10,133,205,153,5,41,50,191,36,15,214,44,199,75,17,140,33,105,183,40,22,142,132,32,144, 166,48,185,153,175,111,110,220,39,47,193,104,213,52,142,93,42,25,12,32,56,249,186,203,192,140,43,186,210,165,163,169,121,51,38,200,135,111,170,148,93,251,79,0,155,50,217,83,90,37,251,43,234,229,96,93,171,156,32,54,80,174,37,23,48,27,182,34,102,64,159, 101,238,228,49,114,25,176,153,54,41,95,98,60,222,248,220,26,172,234,94,99,51,183,233,207,227,155,127,223,175,199,122,220,117,19,251,222,2,175,67,55,226,184,177,8,140,218,47,214,150,202,7,96,129,212,113,156,213,87,42,223,185,25,76,216,142,116,24,0,251, 194,93,171,101,201,220,137,242,200,223,183,202,143,222,46,149,170,131,184,42,205,64,198,81,39,42,62,179,235,200,48,242,15,243,39,49,59,86,254,97,73,190,172,186,116,162,92,54,187,176,139,149,86,207,240,209,68,227,242,96,119,224,11,107,100,225,215,30,151, 245,48,194,53,27,74,211,213,30,165,221,129,141,6,102,63,224,28,60,13,195,219,69,20,194,130,1,224,184,83,5,59,24,14,201,241,50,1,236,182,159,188,23,141,114,24,210,160,108,139,4,162,59,97,114,155,175,119,124,150,161,150,245,50,162,229,135,107,143,200,237, 87,29,243,236,20,56,64,221,79,80,230,205,69,130,150,255,184,51,127,248,229,221,34,201,17,42,17,161,82,36,119,176,193,8,206,252,65,94,144,233,209,63,66,7,86,250,131,203,50,60,77,165,177,166,171,113,246,247,248,222,42,181,150,168,11,91,183,172,176,132, 56,109,64,185,101,176,110,70,229,204,72,152,5,118,19,12,4,5,57,25,242,163,247,207,149,219,239,254,187,20,92,158,46,153,80,106,170,1,19,192,234,240,143,129,60,78,156,18,254,17,176,222,216,38,21,208,184,254,200,117,227,228,171,31,95,9,3,72,163,61,196,159, 68,75,163,135,221,11,235,125,254,124,39,19,22,31,7,226,53,101,172,254,17,219,58,152,144,229,31,77,37,243,206,185,74,126,64,204,146,19,227,36,21,55,55,140,34,38,27,238,28,93,117,18,240,64,192,56,119,222,49,86,115,242,116,173,252,254,185,237,24,187,145, 58,231,40,74,31,216,216,13,108,62,25,130,199,182,68,96,156,77,28,155,165,127,87,47,159,37,245,56,22,164,37,76,234,7,53,97,119,74,188,162,161,39,64,175,163,169,201,9,192,40,182,3,2,195,228,6,42,21,97,70,102,94,19,231,39,94,218,166,71,35,169,144,30,210, 62,69,95,129,125,204,35,130,76,236,206,185,134,61,242,194,86,92,67,28,27,176,255,12,98,194,60,29,102,102,132,92,138,77,203,172,169,227,228,195,55,130,113,220,119,66,246,29,173,148,163,80,152,174,109,132,20,9,235,65,36,124,105,140,78,137,149,252,209,73, 144,168,164,203,68,204,27,222,128,160,31,20,19,204,216,49,248,112,25,97,123,167,79,42,144,103,238,5,147,113,255,83,82,25,213,14,125,138,8,8,29,157,155,59,102,142,154,60,46,252,187,247,164,15,108,124,93,248,58,15,172,196,33,207,0,176,27,168,120,115,138, 187,57,216,220,231,14,205,4,14,92,119,193,17,183,49,207,19,52,69,138,124,153,7,39,115,176,2,197,217,84,204,227,14,180,12,74,48,47,190,181,91,39,39,9,184,153,96,110,202,50,59,4,166,217,176,237,160,60,182,254,148,148,140,197,25,33,38,190,251,246,247,94, 114,7,2,16,45,210,74,91,83,75,171,18,3,62,119,139,178,73,144,0,226,51,5,70,155,30,199,185,102,228,104,72,19,40,74,53,63,122,170,210,1,61,21,16,143,84,233,2,204,157,136,119,187,123,175,181,243,11,113,48,241,111,88,61,71,126,250,205,58,249,220,119,215, 169,97,159,105,88,80,105,228,136,67,133,165,83,81,115,43,118,31,130,171,91,50,54,94,126,243,149,197,114,243,154,57,234,20,136,121,48,4,19,87,205,240,2,191,176,173,104,49,215,106,197,197,96,67,198,138,215,51,249,215,107,64,34,37,110,200,196,44,222,189, 198,237,231,7,150,107,44,213,61,247,234,54,121,252,205,10,153,13,135,85,36,112,3,35,254,44,216,245,168,236,168,173,233,95,214,207,96,195,250,240,230,10,255,250,10,70,209,111,224,245,119,250,134,117,217,184,253,144,252,211,99,187,116,247,223,134,181,163, 231,44,233,89,163,8,164,171,193,238,121,38,36,94,255,252,232,126,185,122,241,62,89,190,176,68,199,174,105,83,207,84,125,63,97,127,27,76,40,37,153,90,148,167,127,188,105,64,187,35,52,225,204,192,120,244,120,216,253,40,214,164,29,49,194,241,236,231,93, 26,219,105,152,166,197,115,39,201,19,247,53,202,245,95,125,94,18,255,127,123,103,2,101,101,117,229,251,125,135,42,106,96,44,100,84,4,75,64,68,65,17,204,235,116,58,75,18,147,245,242,210,89,47,233,181,130,137,218,118,236,213,62,93,137,162,157,164,211,47, 177,125,157,114,165,51,217,29,19,167,56,36,70,141,81,80,162,130,67,130,81,20,16,177,69,101,144,65,170,168,130,2,41,138,177,40,10,170,168,225,14,239,255,63,223,61,183,190,186,212,173,186,99,213,189,183,246,89,80,119,250,190,243,157,243,59,195,222,103, 159,115,246,57,191,220,88,225,56,149,144,22,211,212,171,131,59,153,67,238,125,238,43,0,104,164,60,22,242,32,230,153,190,50,115,140,57,104,134,165,132,175,77,167,158,76,137,217,123,218,49,250,161,70,203,249,62,214,27,234,219,153,172,63,108,8,84,226,61, 56,160,231,129,55,234,228,203,159,59,36,51,166,77,100,170,147,126,18,227,162,242,192,209,201,203,152,207,229,8,189,12,163,18,122,176,203,216,252,89,36,101,166,235,129,169,175,14,102,208,83,216,9,96,70,131,22,26,174,73,52,88,150,236,36,42,225,220,7,7, 38,80,215,138,27,184,240,108,20,20,166,231,235,79,200,157,152,39,166,2,144,108,48,29,12,70,82,116,36,244,205,107,63,35,51,166,142,147,223,190,180,89,94,216,140,189,210,240,112,104,246,74,50,13,35,253,178,16,230,254,171,174,186,68,174,252,228,133,209, 173,109,182,99,183,194,33,217,231,231,226,245,232,115,17,28,37,151,53,207,40,186,96,29,191,22,58,215,166,43,248,45,11,214,93,242,228,174,149,31,60,187,73,138,207,41,69,26,56,203,212,237,222,214,94,59,24,175,76,155,45,111,71,120,177,133,146,78,207,254, 192,225,197,107,41,252,104,67,74,63,88,55,190,167,112,30,201,163,203,55,192,108,24,196,188,126,9,132,122,226,62,249,105,105,228,41,154,220,82,249,171,103,54,96,193,221,20,51,237,102,235,114,42,169,180,76,88,87,76,223,131,76,211,233,90,60,197,136,215, 56,130,221,81,24,45,207,222,158,77,1,111,215,41,112,122,234,49,44,54,254,199,159,174,147,75,102,99,170,16,29,4,116,128,164,251,244,232,115,156,98,139,126,76,237,141,59,146,62,58,172,212,34,207,201,187,114,95,1,0,54,51,143,139,69,38,23,78,25,45,92,236, 146,122,112,154,50,27,221,158,195,216,10,4,5,192,4,231,235,212,163,141,185,147,21,157,206,121,22,140,26,38,239,109,107,150,183,222,171,49,10,0,59,15,219,41,198,220,210,235,71,247,181,219,106,62,150,7,48,223,119,1,230,253,50,51,130,58,243,145,104,203, 152,171,247,202,123,152,35,110,62,209,38,227,199,194,155,95,154,193,56,109,2,102,174,16,238,77,195,167,98,192,169,129,105,80,0,182,236,58,137,185,234,3,102,142,53,89,86,76,38,5,23,173,44,60,238,247,139,159,185,212,204,139,254,219,190,195,194,197,103, 237,176,104,208,116,201,133,137,83,49,85,48,254,172,238,188,217,78,41,205,172,230,244,237,236,206,76,231,76,41,54,0,193,50,165,57,253,225,103,215,75,195,193,54,185,124,218,8,227,118,153,163,215,244,67,102,27,173,35,248,152,170,76,164,173,239,220,81,96, 90,203,200,138,215,54,202,67,43,247,226,124,147,225,142,159,147,36,30,207,1,0,21,134,5,112,5,254,210,134,67,242,244,139,239,202,173,223,248,188,81,82,82,177,54,186,83,109,218,42,226,103,159,96,21,71,254,222,77,221,81,136,40,177,147,25,136,176,93,219, 186,113,237,151,255,26,7,31,181,202,247,126,183,5,249,199,142,38,76,23,165,60,24,75,130,155,59,159,61,223,187,35,233,206,105,207,107,10,235,83,206,43,0,196,109,250,139,211,112,21,139,5,128,28,85,70,191,51,239,18,255,195,34,101,224,33,64,91,33,228,188, 88,152,198,149,172,217,40,106,198,106,220,203,78,42,145,39,94,223,9,55,161,115,32,124,198,36,169,0,56,66,173,19,163,131,87,223,198,232,31,171,108,71,99,193,214,33,44,114,203,76,39,234,240,176,127,57,58,27,131,17,197,238,99,157,104,152,39,101,166,56,7, 243,216,223,19,126,53,29,135,51,250,155,56,14,83,54,112,9,124,18,29,21,140,23,230,52,94,119,51,99,156,28,201,140,66,89,208,39,195,218,141,245,242,197,133,151,24,69,207,173,0,37,250,108,163,4,160,215,98,7,198,133,112,243,231,156,23,247,214,238,121,202, 204,140,234,226,62,104,136,253,224,8,31,135,233,114,8,184,95,44,171,145,249,56,152,137,139,50,51,85,111,33,126,242,146,42,235,180,237,112,62,216,186,71,254,254,55,239,226,32,177,82,99,160,138,167,36,247,149,81,42,208,167,208,63,204,198,194,202,127,126, 108,147,204,153,57,57,50,21,128,199,224,89,125,141,200,251,138,215,254,198,190,215,176,54,157,176,253,54,189,87,42,1,156,86,224,148,20,125,40,236,133,63,150,251,223,218,39,151,70,188,154,166,23,123,58,119,91,9,145,78,28,249,117,111,206,247,124,236,200, 57,47,198,21,168,214,5,112,170,136,109,151,113,12,166,167,122,108,139,58,7,163,93,10,61,251,125,170,241,246,118,159,213,206,47,135,11,213,181,239,31,147,119,113,54,61,131,29,217,246,118,207,25,223,69,18,86,91,223,40,85,127,169,147,169,83,224,246,23,130, 52,25,141,251,140,56,251,248,130,166,120,186,55,165,162,193,69,91,12,169,116,32,76,182,233,232,240,58,118,244,8,185,100,114,153,212,64,105,225,9,124,236,255,98,3,203,152,103,41,76,199,142,129,7,112,60,239,142,90,120,67,51,33,181,146,97,124,124,62,5,145, 77,135,125,166,251,123,42,11,169,228,207,198,165,175,103,18,32,95,43,43,222,122,111,167,92,251,235,245,114,254,140,225,216,46,70,83,241,153,215,167,252,77,106,85,35,229,199,101,234,70,142,166,89,239,120,100,245,15,30,90,133,104,177,15,31,214,175,147, 105,204,129,163,75,128,35,34,143,148,99,225,241,117,247,189,41,180,22,178,94,179,44,98,235,127,166,242,145,110,60,156,86,160,18,192,133,149,95,253,252,28,51,50,96,31,96,157,16,37,29,127,38,235,150,121,120,158,86,176,36,193,229,180,2,192,50,229,2,64,46, 118,129,3,236,110,23,192,166,147,73,190,128,108,103,127,228,24,204,255,88,83,64,175,85,102,148,158,124,84,9,99,54,241,79,40,150,37,175,109,23,122,250,98,64,242,251,13,108,184,20,100,12,230,132,193,198,211,198,85,231,105,52,154,108,36,151,113,82,207,50, 211,45,120,182,89,36,137,239,108,71,194,116,164,18,70,98,117,249,60,186,4,134,19,39,199,247,251,153,153,231,179,185,170,185,130,171,154,177,223,122,249,170,173,210,209,217,21,53,233,167,242,92,166,155,29,45,213,59,219,17,218,206,48,81,193,223,155,2,145, 74,90,146,187,39,27,165,155,92,10,82,189,218,242,37,251,173,59,247,201,149,119,253,197,88,117,70,96,205,10,167,121,76,113,164,26,121,204,125,103,214,162,152,11,114,240,163,157,247,231,0,164,234,193,87,229,181,237,77,242,9,152,239,143,165,105,25,33,215, 83,88,96,59,11,91,154,15,224,96,162,127,254,213,171,178,175,225,104,116,176,97,203,37,151,144,184,211,100,251,229,92,74,223,80,73,75,110,43,0,104,229,212,8,235,48,34,93,48,169,12,163,201,238,195,98,146,45,32,86,56,91,209,14,30,229,22,64,44,46,164,41, 10,207,200,86,151,203,134,201,181,0,243,208,200,151,173,107,148,77,219,235,77,178,41,215,221,13,160,183,188,88,37,129,142,127,238,255,75,181,12,199,202,255,214,52,70,9,189,61,35,246,59,206,191,153,78,26,182,250,253,56,40,137,199,235,50,216,180,152,15, 9,255,113,168,114,27,218,244,179,225,16,40,226,18,56,94,199,77,171,6,247,4,207,193,202,252,159,190,80,35,239,96,207,56,67,34,172,250,74,18,239,103,185,187,255,247,117,61,127,99,217,240,191,85,20,250,43,171,254,226,75,238,247,120,132,146,139,101,160,175, 166,178,196,64,206,180,224,220,244,95,127,150,46,88,125,46,131,23,194,19,48,81,155,122,149,201,68,165,86,41,51,153,130,132,227,98,253,225,188,55,231,253,155,78,156,146,159,62,242,170,252,110,205,126,185,28,158,60,121,214,66,38,166,69,200,247,56,124,23, 208,193,206,170,218,102,249,151,95,253,201,56,13,163,197,145,193,204,227,39,156,226,236,94,104,219,23,173,0,156,106,124,102,229,22,227,103,160,12,3,178,76,110,201,78,62,23,78,159,229,220,151,159,237,48,217,60,231,182,2,0,243,24,189,98,65,189,53,142,56, 70,141,44,75,54,127,209,235,109,127,193,189,189,13,220,2,136,193,38,173,221,25,53,75,70,159,214,253,198,62,87,70,96,149,251,170,109,102,255,181,85,68,186,175,234,249,206,10,31,126,75,199,63,59,171,91,228,130,242,34,51,138,114,87,209,158,119,165,255,41, 154,86,108,5,172,63,116,82,90,219,176,93,206,132,228,27,3,5,47,3,231,249,166,78,130,2,64,19,48,96,59,251,46,156,223,220,127,121,57,215,2,152,233,13,172,106,254,225,99,235,100,255,193,38,35,80,6,178,243,98,26,173,178,112,240,72,179,240,120,86,126,30,88, 37,192,77,38,183,223,179,102,56,139,186,28,37,107,243,14,248,190,248,209,139,242,206,129,83,178,0,238,126,57,239,159,157,41,171,108,182,132,204,49,183,138,17,5,241,225,99,39,228,223,239,251,147,252,98,69,173,44,168,28,97,216,100,82,49,98,155,107,2,239, 203,207,46,151,101,27,15,201,205,63,127,81,106,235,15,154,250,75,107,34,203,41,218,198,51,151,197,132,99,226,179,153,6,182,39,242,248,24,199,66,223,113,207,43,242,235,181,251,100,46,166,74,91,209,71,164,26,82,191,211,253,68,119,44,249,81,191,220,169, 79,229,125,78,43,0,204,144,73,32,182,145,157,63,121,20,28,93,88,71,19,169,20,142,83,184,92,149,188,207,236,0,112,156,205,112,212,155,205,192,70,201,61,251,179,198,99,126,27,171,248,121,140,47,67,95,13,209,254,70,237,248,169,215,225,30,116,226,48,227, 97,48,149,92,39,151,55,8,105,222,128,221,17,213,135,91,229,4,156,162,48,216,244,152,15,9,255,233,22,154,198,37,48,22,47,114,30,216,56,73,140,19,7,5,5,71,139,11,176,119,127,109,117,179,252,242,137,55,205,153,13,28,57,113,190,48,155,66,152,113,91,65,198, 228,213,237,61,36,95,185,253,89,89,255,129,99,137,224,119,217,124,62,227,239,17,220,125,81,143,31,114,231,3,133,91,152,74,93,100,148,249,198,250,237,242,217,59,95,148,173,77,167,101,193,120,186,122,205,222,122,149,172,153,237,50,132,215,93,159,40,240, 170,225,233,239,182,159,175,144,7,94,171,151,5,51,70,152,105,205,76,23,49,251,7,246,55,244,179,79,127,251,47,87,31,151,175,221,185,60,106,77,99,57,57,233,202,244,147,251,135,102,234,10,218,152,173,43,155,119,212,203,255,249,241,114,121,120,245,62,76, 17,150,99,10,16,117,137,233,239,63,170,51,175,200,84,118,50,21,207,153,41,204,217,111,114,90,1,160,64,224,168,144,53,131,46,128,173,135,56,86,242,84,67,11,188,160,213,29,134,123,75,236,119,103,212,38,242,84,35,75,240,62,78,51,148,112,191,46,30,248,167, 181,219,133,71,215,210,188,28,79,160,216,252,189,183,101,183,188,178,233,168,92,12,51,42,93,12,103,63,224,104,97,60,103,2,44,0,27,143,225,80,32,152,43,25,108,122,146,121,62,239,177,249,27,79,231,77,56,187,224,16,70,39,92,211,209,151,66,193,50,111,198, 170,166,203,166,14,151,187,95,170,149,123,159,88,101,44,17,52,23,102,171,243,114,58,39,103,129,38,243,248,246,251,213,114,253,143,87,200,187,175,28,148,149,235,107,140,18,226,88,1,250,39,144,70,213,236,25,121,26,17,57,156,178,167,48,209,34,99,149,37, 214,99,122,22,124,244,217,181,114,229,237,127,50,190,225,47,171,40,137,248,121,239,153,165,140,126,74,163,57,56,35,225,52,34,232,35,35,150,189,29,229,178,61,173,122,123,187,124,225,142,23,100,233,150,195,178,224,188,225,166,126,179,57,167,81,196,113, 83,192,56,217,246,168,4,204,199,150,225,141,80,198,254,250,246,23,229,233,21,239,8,183,63,179,188,248,159,12,172,117,34,110,100,25,248,193,62,199,62,151,86,197,165,47,253,183,204,251,254,11,242,42,252,126,44,152,54,220,76,147,178,52,82,229,145,74,255, 20,155,53,163,126,244,72,64,118,234,71,236,115,7,251,115,206,110,3,36,126,76,9,153,131,100,56,129,56,190,194,153,255,231,66,26,187,202,59,113,120,206,254,112,14,84,216,89,173,57,114,90,70,67,200,113,213,187,217,226,146,120,68,41,93,201,188,80,145,153, 132,85,186,119,190,185,71,174,250,194,1,227,97,139,157,5,59,10,119,96,163,100,99,57,133,134,178,124,245,14,248,173,229,185,218,56,28,196,164,213,125,101,230,223,51,41,76,103,5,134,233,135,26,219,97,254,238,94,180,200,180,38,19,152,47,179,226,25,55,113, 234,230,211,88,7,241,22,204,194,231,96,197,179,99,103,232,153,111,119,220,124,18,221,28,207,59,127,132,220,241,212,54,57,213,222,101,142,44,53,138,4,126,163,53,192,195,142,44,134,157,59,142,254,222,243,25,97,212,37,6,59,42,105,198,246,208,231,95,125, 95,254,233,17,56,102,25,14,127,241,95,24,39,15,188,190,87,254,254,75,251,141,143,115,42,139,177,24,220,249,100,92,192,55,168,193,214,41,91,175,216,94,248,62,29,86,54,67,142,192,136,140,226,34,236,55,99,93,203,125,75,215,203,239,86,193,71,197,121,229, 56,100,200,139,115,135,178,101,246,183,41,73,237,213,178,177,229,109,234,17,242,65,62,145,236,164,22,49,238,98,93,167,53,132,138,170,101,207,149,254,79,191,180,65,190,255,244,86,41,66,219,159,143,117,76,199,185,100,31,33,221,231,153,72,226,252,97,203, 98,252,92,19,112,41,206,49,104,65,121,92,251,179,53,114,227,166,189,242,173,175,125,82,230,206,154,26,173,243,20,208,12,14,131,248,109,210,92,148,224,31,114,54,109,31,137,176,172,57,232,217,130,81,255,111,159,223,0,191,7,245,114,206,185,101,198,149,49, 211,72,201,159,202,147,237,61,108,115,150,57,219,167,105,130,177,13,53,78,218,157,254,150,107,159,144,86,166,130,113,197,185,182,16,191,206,89,5,128,133,192,41,33,158,103,206,149,122,7,225,39,158,129,230,96,219,144,205,23,9,252,97,93,160,223,111,134, 61,31,31,21,57,220,46,83,160,137,247,230,155,62,129,232,146,190,132,121,225,137,120,19,176,202,189,113,247,73,227,30,152,110,54,217,56,98,243,98,13,97,31,126,180,87,30,89,223,32,149,56,174,212,90,65,178,93,51,153,78,122,235,29,205,99,208,208,18,54,125, 180,95,174,196,57,240,118,244,109,27,89,162,0,172,179,147,46,152,245,247,226,128,21,63,86,131,155,198,218,79,70,152,14,244,23,102,209,227,101,112,16,242,179,229,53,82,189,191,89,126,112,253,167,177,175,191,210,164,135,105,112,119,94,108,182,253,117,170, 100,237,244,11,142,226,101,59,39,46,118,228,158,236,135,159,219,32,79,188,182,79,102,224,153,60,39,30,235,55,77,88,1,63,237,11,112,112,12,207,124,143,45,47,94,224,199,81,196,12,60,171,97,245,158,102,25,134,179,238,59,168,164,244,147,79,115,83,6,255,48, 111,44,35,250,179,111,239,12,192,145,211,200,168,195,25,43,188,187,57,165,194,139,37,3,11,14,254,214,225,128,161,149,107,182,201,226,165,31,178,114,203,124,152,181,105,198,229,162,215,236,204,249,247,4,213,95,89,247,188,26,181,25,112,200,166,3,231,31, 112,33,222,196,113,99,162,245,136,191,57,124,28,126,221,140,98,99,113,62,219,58,68,14,78,133,162,160,3,27,174,87,66,56,124,244,132,113,254,117,215,31,55,202,134,237,199,229,98,212,39,14,62,40,236,120,217,64,5,62,171,5,10,7,149,178,203,102,142,148,71, 222,250,88,30,121,191,81,126,245,213,139,225,151,228,34,56,39,155,20,21,208,76,83,207,246,100,89,244,157,90,178,99,176,76,200,142,44,108,29,224,121,19,213,117,7,140,229,243,246,63,98,64,131,218,195,180,112,177,31,157,24,165,202,131,194,154,253,55,125, 140,172,223,125,92,142,29,63,101,166,136,125,54,194,4,43,136,149,11,60,30,254,13,76,123,142,199,249,33,180,182,14,116,219,53,16,7,225,143,175,98,206,23,171,6,225,185,9,61,146,149,138,150,243,67,152,147,110,106,108,150,75,42,199,154,147,166,146,21,68, 182,46,124,136,173,73,63,251,253,58,217,133,133,128,19,49,39,13,43,89,202,21,48,161,12,184,46,162,70,204,125,240,135,208,73,236,199,137,108,127,251,137,243,204,200,152,163,16,74,46,230,149,163,53,10,19,106,203,143,254,113,189,172,221,122,68,42,199,149, 96,52,204,206,203,21,89,54,223,34,29,148,123,195,49,2,94,246,209,17,153,55,22,238,124,113,216,135,21,114,201,60,154,229,196,117,4,75,95,217,32,207,190,219,32,23,67,153,225,41,102,137,228,133,215,80,89,96,99,172,196,232,233,141,189,45,242,155,215,170, 101,116,231,41,25,59,170,76,120,208,16,21,12,62,195,249,239,116,242,228,216,219,127,166,187,251,90,231,30,90,89,184,51,227,177,231,214,203,63,220,191,94,182,52,158,146,203,43,71,26,197,147,231,57,116,33,162,9,56,188,230,133,173,71,177,176,170,76,166, 195,157,179,233,232,123,129,192,5,94,191,121,118,157,44,223,124,72,230,192,4,206,109,89,182,47,234,229,242,232,87,72,174,57,171,224,32,132,232,120,56,67,186,230,202,217,200,219,112,228,129,247,39,87,232,86,200,237,217,119,72,110,253,175,151,101,24,206, 60,228,46,140,242,178,146,232,200,212,50,96,71,204,144,40,43,222,199,245,51,59,209,153,63,183,242,125,185,241,161,181,178,116,229,30,57,31,39,193,85,86,12,147,102,8,126,246,199,137,228,217,60,56,193,63,140,143,28,142,192,111,199,55,62,63,67,206,59,119, 66,228,206,254,21,24,247,35,44,27,154,193,127,252,208,74,8,165,6,25,51,178,84,202,192,135,158,35,45,23,231,181,239,186,196,98,233,121,61,182,19,163,205,214,239,63,34,175,175,219,38,63,126,124,173,252,232,137,15,165,161,88,228,19,83,56,191,29,26,208,190, 198,157,111,166,149,3,41,182,163,243,80,47,225,107,75,150,252,165,94,126,247,126,173,148,157,106,65,187,22,83,63,120,186,97,108,158,200,172,183,250,97,191,227,115,98,239,225,103,246,117,141,88,64,203,41,204,199,151,255,183,92,251,208,122,89,181,161,81, 102,157,83,38,83,177,190,167,5,117,133,105,74,167,174,48,95,204,211,84,8,236,141,13,173,50,214,219,33,179,167,79,114,173,19,115,83,136,255,158,105,165,226,254,228,242,119,113,82,37,92,182,35,125,92,140,152,78,218,226,63,45,183,126,105,218,246,231,59, 61,211,175,190,207,233,9,114,43,109,209,212,80,8,112,123,200,182,150,78,185,8,174,117,191,254,87,231,202,196,49,229,232,190,18,75,54,43,43,181,194,163,45,237,242,251,117,123,100,71,83,187,240,128,24,10,162,129,46,100,212,89,227,187,123,243,222,83,114, 223,13,243,229,230,235,174,132,166,121,102,216,176,165,78,254,199,191,191,36,103,99,157,2,143,209,29,232,180,178,81,112,212,192,57,251,99,109,1,249,238,21,83,101,214,148,10,135,57,177,247,150,104,119,54,112,13,59,130,14,40,90,239,237,60,36,79,108,58, 36,211,49,42,38,111,10,137,254,110,119,71,197,247,156,170,169,192,148,77,19,52,182,61,251,160,165,227,0,148,219,174,168,148,79,93,86,137,99,107,39,202,89,56,59,128,157,120,127,129,249,226,153,10,13,216,93,176,189,166,65,86,127,176,71,30,88,183,223,248, 132,184,0,219,15,185,95,157,171,168,217,185,48,141,204,42,215,44,112,123,98,35,18,126,199,167,167,225,192,22,28,23,204,74,25,9,156,138,104,199,239,171,183,236,151,231,182,29,147,11,177,214,1,179,23,9,214,78,71,201,225,177,196,155,97,33,185,120,120,145, 188,244,147,175,202,180,41,19,140,50,104,45,40,246,89,253,189,58,230,76,143,212,236,110,144,11,174,121,210,244,252,159,188,180,66,254,215,188,179,229,242,139,167,200,116,156,124,71,23,200,35,202,75,77,30,19,137,239,196,169,54,105,104,108,146,154,61,7, 141,151,198,123,160,200,201,161,118,41,62,187,212,28,231,202,206,156,39,117,218,17,95,127,113,38,243,59,41,115,26,208,15,198,219,113,44,237,170,187,190,40,159,253,212,28,163,28,177,132,88,78,137,6,142,110,105,241,57,137,252,124,235,71,203,228,15,119, 213,201,244,107,38,200,223,94,60,94,62,53,247,92,153,117,254,36,153,60,177,194,156,138,72,75,79,34,129,243,217,220,41,82,7,119,211,239,109,221,43,79,191,179,15,167,231,97,135,17,124,150,44,192,162,95,160,129,176,203,157,233,16,182,35,182,235,145,176, 240,85,163,63,109,62,112,26,103,99,20,201,245,11,38,202,103,46,67,27,175,156,40,83,224,38,123,236,152,225,9,181,39,203,136,3,23,182,43,178,216,219,112,76,62,172,110,144,149,31,124,44,171,62,58,110,70,19,211,38,151,26,31,38,244,231,194,145,127,166,234, 10,235,7,75,138,134,151,157,71,219,229,235,151,140,151,191,153,51,89,134,65,171,97,91,143,91,63,120,35,238,225,250,140,38,200,133,13,213,135,101,69,117,147,92,0,69,150,77,155,63,15,133,80,187,100,177,39,231,21,0,22,4,11,133,74,192,46,8,163,142,195,216, 154,70,41,146,76,64,101,96,45,41,129,167,185,25,152,131,30,44,13,143,201,128,140,49,211,1,187,219,130,114,223,87,231,64,136,157,111,22,55,50,71,236,207,234,225,192,227,129,231,55,202,202,253,39,101,14,28,123,12,86,90,217,128,232,21,144,166,236,90,76, 153,96,24,131,4,38,209,227,154,242,65,174,208,193,204,194,200,159,86,5,68,149,124,20,38,30,202,50,231,224,147,82,148,227,102,28,227,27,56,130,122,0,193,121,197,244,145,242,87,51,206,146,153,83,207,130,89,119,164,84,140,44,151,34,156,100,198,5,163,204, 67,0,29,112,235,233,118,156,7,208,34,123,26,154,112,230,123,147,60,83,211,36,237,236,252,74,189,50,13,91,213,120,108,48,207,87,160,147,165,216,61,217,172,123,156,14,224,154,132,125,7,113,143,153,179,236,133,195,152,34,185,24,29,8,207,185,231,61,137,162, 226,181,86,1,184,8,10,192,203,25,81,0,14,200,223,124,255,143,114,22,248,124,132,54,35,71,193,10,66,116,10,60,50,126,182,114,140,204,158,90,33,83,176,53,115,124,197,8,40,3,37,230,140,4,10,199,174,64,64,130,80,218,90,78,181,195,17,212,9,249,248,80,179, 108,175,111,146,165,187,208,145,31,65,29,128,37,238,44,228,113,90,57,205,164,244,113,129,253,253,73,10,226,72,113,38,244,2,52,25,87,0,56,61,242,131,187,87,200,175,49,34,157,13,165,116,71,3,118,186,112,56,10,43,211,223,85,142,150,57,211,42,228,60,28,96, 53,1,211,39,99,176,118,133,117,137,214,47,90,234,2,224,115,26,7,137,53,194,143,8,143,204,222,245,241,113,121,125,215,49,169,219,143,181,50,76,44,4,255,165,56,227,158,230,126,154,183,217,222,129,61,167,2,147,73,69,96,4,234,134,81,242,225,171,97,95,19, 234,7,118,90,113,171,242,103,207,27,41,243,43,81,63,38,140,146,179,199,143,194,225,66,195,141,251,117,31,218,19,219,20,183,81,179,142,176,174,52,53,183,97,106,182,197,28,227,93,131,41,186,87,118,55,75,243,97,180,17,246,207,176,156,205,194,226,229,17, 28,192,160,109,181,130,31,5,127,166,113,144,49,245,53,42,234,219,176,112,25,166,40,228,48,193,167,240,50,106,16,232,163,102,99,80,200,169,86,246,83,9,222,141,43,243,59,80,1,232,127,216,148,3,121,100,35,162,73,118,38,132,119,81,101,145,233,96,147,73,22, 43,61,181,68,22,240,64,143,166,221,233,164,80,128,18,108,188,237,85,150,249,100,241,227,27,69,158,220,108,188,165,153,235,216,112,32,220,100,108,177,204,134,48,24,44,225,207,180,208,236,74,230,60,137,241,178,115,202,13,115,114,76,180,113,240,90,219,249, 209,129,81,58,194,159,233,49,11,33,209,81,115,43,225,69,240,137,224,3,31,142,62,215,28,108,149,53,117,39,224,65,16,219,245,248,64,174,95,64,231,102,36,7,19,193,97,24,70,245,166,147,231,112,18,54,208,10,220,59,29,190,211,121,76,48,231,17,233,140,133,253, 64,172,240,231,115,25,37,175,25,142,185,40,238,76,160,192,118,115,176,249,228,43,93,153,154,14,36,81,72,124,64,150,194,17,228,169,4,137,191,28,139,192,2,16,74,60,110,117,31,190,123,98,227,65,108,115,192,40,158,66,143,141,130,188,248,159,25,37,43,46,2, 161,9,131,117,145,28,81,79,199,67,224,143,199,106,237,97,224,199,181,44,156,203,166,5,46,83,35,185,212,16,144,120,106,160,59,153,63,176,168,128,226,55,15,101,202,126,129,199,141,191,0,197,208,156,30,73,237,38,182,46,145,7,191,231,189,150,29,234,82,49, 216,208,180,93,134,250,129,95,76,29,176,167,29,38,170,4,166,150,255,212,238,34,49,214,243,86,148,115,43,20,56,42,159,243,161,24,146,1,149,150,55,176,80,247,141,93,104,79,204,43,43,59,235,0,235,137,109,83,204,59,235,9,121,240,61,91,3,231,105,193,98,20, 234,202,5,152,42,35,11,6,167,109,5,140,146,216,91,219,50,23,165,249,135,140,153,20,42,222,116,184,6,109,222,36,59,209,154,193,98,102,46,56,0,96,249,37,122,95,154,201,206,153,219,243,66,1,32,45,22,12,5,162,199,3,211,125,10,248,88,200,172,207,44,240,193, 12,124,62,251,16,106,172,115,209,240,40,100,157,69,39,200,35,126,43,199,162,22,166,149,141,39,23,210,202,180,241,127,58,204,153,47,254,79,55,88,30,92,104,198,248,232,37,114,46,166,133,60,248,207,102,204,142,128,29,25,77,123,16,249,166,206,80,72,177,63, 42,194,43,167,37,24,104,25,96,158,204,122,4,124,102,255,214,87,224,115,105,186,228,255,222,56,184,235,86,63,81,245,245,152,244,127,115,63,28,239,201,227,36,52,78,246,229,84,118,206,135,2,237,133,242,196,64,1,110,100,25,89,129,7,59,63,118,210,204,43,95, 157,62,220,137,48,202,171,131,57,117,218,80,230,199,114,38,234,36,254,184,51,155,196,109,184,52,82,13,164,29,253,9,167,124,104,225,25,135,41,166,137,116,69,93,193,184,92,117,9,89,38,31,24,238,162,139,219,184,46,217,214,37,206,147,83,103,58,129,58,137, 183,134,223,224,42,70,76,127,255,193,182,37,182,1,250,41,225,52,203,112,8,249,185,197,108,79,206,253,198,130,134,250,193,186,65,5,62,8,46,134,131,173,39,184,199,157,87,115,61,24,176,125,226,54,195,217,253,123,255,169,74,237,10,214,4,60,46,186,168,48, 153,154,193,188,217,114,75,230,190,212,82,154,123,119,229,141,2,64,116,182,210,178,176,83,9,246,254,84,238,205,228,61,236,128,216,105,4,209,67,179,225,25,255,251,145,7,24,1,198,198,147,201,7,166,17,151,77,71,46,49,183,229,104,133,50,211,200,239,156,87, 8,49,116,232,142,152,115,50,206,6,222,142,63,236,172,217,224,77,111,129,139,109,60,206,85,125,255,101,220,12,241,56,36,19,151,19,83,54,255,58,169,180,60,168,52,27,69,142,95,71,20,104,214,65,42,51,92,31,227,139,169,109,20,120,24,28,26,69,201,196,100,238, 75,142,87,54,115,199,184,173,16,79,231,57,44,51,254,167,162,20,224,104,22,108,28,102,174,186,132,47,176,60,46,250,24,214,161,118,92,26,91,151,120,69,38,210,20,125,208,0,189,113,234,45,23,238,161,141,184,24,156,193,1,146,191,7,7,164,143,125,85,103,164, 77,225,246,104,187,178,247,14,80,22,162,143,113,242,18,191,141,70,47,116,189,201,215,114,115,101,33,173,183,121,165,0,164,149,211,28,187,153,21,143,141,134,29,179,59,240,123,13,137,17,112,179,34,70,167,19,234,201,211,198,100,175,53,175,246,131,253,49, 71,94,179,153,44,119,190,73,8,253,182,177,146,152,55,189,228,223,166,197,125,95,47,151,13,218,87,20,192,118,20,158,137,68,184,133,119,33,212,165,84,152,184,25,176,142,80,49,226,107,127,117,132,151,228,106,61,97,218,52,196,39,160,10,64,124,54,3,242,139, 237,104,7,228,97,5,254,144,124,103,105,58,219,1,44,163,124,230,149,73,225,223,27,242,124,102,211,91,126,82,253,78,57,164,74,46,63,238,235,109,74,51,63,82,174,169,84,2,74,64,9,40,1,37,160,4,82,38,160,10,64,202,232,244,70,37,144,171,4,116,220,150,171,37, 163,233,82,2,185,68,64,21,128,92,42,13,77,139,18,200,8,129,129,158,76,200,72,162,147,138,164,240,115,152,20,14,189,88,9,164,68,64,21,128,148,176,233,77,74,32,11,4,220,82,205,253,62,11,143,210,40,149,128,18,80,2,170,0,104,29,80,2,185,72,64,173,248,125, 151,138,42,72,125,243,209,95,149,64,2,4,84,1,72,0,146,94,162,4,242,130,128,10,197,188,40,38,77,164,18,200,21,2,170,0,228,74,73,104,58,134,44,129,140,201,237,168,213,32,250,102,200,50,213,140,43,1,37,208,63,1,85,0,250,103,164,87,40,129,60,35,144,49,149, 34,135,243,61,20,242,152,195,248,53,105,5,65,64,21,128,130,40,70,205,68,62,19,208,241,122,10,165,231,118,91,151,194,237,122,139,18,80,2,142,59,112,229,160,4,148,64,65,17,80,149,162,160,138,83,51,163,4,178,68,64,45,0,89,2,171,209,42,129,164,9,100,76,110, 23,190,121,28,231,246,164,29,50,16,69,218,105,208,8,148,192,96,18,80,5,96,48,233,235,179,149,128,155,128,74,36,55,141,62,223,243,56,227,148,67,228,214,140,233,91,41,39,68,111,84,2,131,75,64,21,128,193,229,175,79,87,2,89,32,160,162,173,79,168,138,167, 79,60,250,227,208,33,160,10,192,208,41,107,205,233,144,33,144,198,232,56,79,24,101,251,52,192,60,193,160,201,84,2,105,17,80,5,32,45,124,122,179,18,80,2,131,65,32,156,1,29,39,3,81,12,70,214,245,153,74,32,99,4,84,1,200,24,74,141,72,9,40,129,124,34,160, 51,1,249,84,90,154,214,108,16,80,5,32,27,84,53,78,37,48,24,4,116,72,59,24,212,245,153,74,32,111,9,168,2,144,183,69,167,9,87,2,49,4,162,67,218,232,155,152,11,10,231,163,250,1,42,156,178,212,156,12,30,1,85,0,6,143,189,62,89,9,100,137,64,225,155,2,50,177, 6,32,75,240,53,90,37,144,55,4,84,1,200,155,162,210,132,42,1,37,16,37,80,248,70,142,104,86,245,141,18,200,22,1,85,0,178,69,86,227,85,2,74,64,9,40,1,37,144,195,4,84,1,200,225,194,209,164,13,49,2,238,81,109,42,86,252,84,238,201,87,196,58,7,144,175,37,167, 233,206,33,2,170,0,228,80,97,104,82,134,56,1,183,0,119,43,3,137,98,73,229,158,68,227,206,181,235,116,21,96,174,149,136,166,39,15,9,168,2,144,135,133,166,73,86,2,189,18,112,43,16,189,94,80,56,95,102,226,48,160,194,161,161,57,81,2,169,17,80,5,32,53,110, 122,151,18,200,61,2,67,200,2,144,214,97,64,185,87,114,154,34,37,48,40,4,84,1,24,20,236,250,80,37,160,4,210,35,48,132,180,157,244,64,233,221,74,32,46,1,85,0,226,162,209,31,148,128,18,200,85,2,186,4,32,87,75,70,211,149,79,4,84,1,200,167,210,210,180,42, 129,132,8,20,254,232,120,8,45,119,72,168,196,245,34,37,144,10,1,85,0,82,161,166,247,40,1,37,48,184,4,84,3,24,92,254,250,244,130,32,160,10,64,65,20,163,102,66,9,184,9,12,1,233,88,248,70,14,119,129,234,123,37,144,21,2,170,0,100,5,171,70,170,4,82,32,144, 174,80,27,2,114,63,74,53,157,188,70,238,77,39,138,104,58,244,141,18,200,99,2,170,0,228,113,225,105,210,11,131,128,21,68,198,185,157,253,144,74,214,220,10,68,58,241,164,242,236,129,184,199,149,39,93,4,56,16,192,245,25,133,78,64,21,128,66,47,97,205,95, 206,19,176,114,219,207,214,152,142,100,115,9,72,241,122,196,253,49,231,33,244,145,64,163,24,1,146,199,197,38,157,188,217,120,44,247,62,30,173,63,41,129,130,38,224,47,232,220,105,230,148,64,30,16,160,48,243,65,96,55,118,132,36,16,12,153,20,135,66,97,200, 240,110,119,55,253,9,43,10,201,112,68,82,154,151,206,144,12,43,241,65,9,72,71,84,14,46,60,230,25,24,164,212,135,119,93,97,233,8,4,77,130,76,62,153,73,151,66,208,95,74,13,79,40,88,164,209,17,0,99,68,153,191,100,250,203,173,254,174,4,18,35,160,22,128,196, 56,233,85,74,32,43,4,40,195,218,33,244,47,44,245,203,145,195,237,178,105,251,94,243,156,34,191,207,140,120,189,184,128,255,57,106,237,235,191,23,10,132,207,231,52,231,154,250,195,34,205,93,50,102,152,79,160,7,80,214,229,109,8,64,208,251,145,55,41,243, 201,186,77,245,210,209,25,16,175,215,107,254,247,197,35,246,55,63,120,50,52,30,110,150,87,234,142,75,197,152,98,105,135,34,0,170,121,203,70,19,174,4,210,37,160,22,128,116,9,234,253,74,32,13,2,20,63,93,16,210,126,180,196,209,99,139,229,251,79,189,39,165, 165,197,242,201,203,102,72,17,231,4,98,135,169,86,94,197,124,31,130,160,108,239,232,146,15,119,126,44,63,95,186,65,138,39,149,72,71,48,230,162,52,210,57,88,183,82,249,105,233,10,202,133,147,75,229,199,175,214,202,164,179,214,200,87,62,55,79,70,14,47, 141,88,60,34,41,35,151,56,217,165,197,160,11,194,126,223,129,163,242,155,231,222,149,163,167,186,100,238,216,97,210,10,171,2,117,11,13,74,96,168,18,240,76,191,250,190,56,205,102,168,34,209,124,43,129,129,39,64,83,119,9,76,221,141,237,1,57,222,18,144, 43,207,31,41,147,70,14,147,32,126,128,12,140,31,216,122,241,123,0,215,237,110,106,151,247,247,157,146,162,81,69,50,3,22,133,118,40,0,133,32,224,104,237,167,113,131,140,106,143,180,203,220,201,229,114,241,132,114,100,28,95,68,242,31,31,16,46,193,53,135, 91,187,100,85,125,139,8,226,153,61,122,152,116,144,107,95,55,233,111,74,160,192,9,212,46,89,236,81,11,64,129,23,178,102,47,63,8,80,80,115,196,62,169,196,143,255,62,89,213,216,42,178,247,100,226,246,123,220,239,43,246,202,236,137,37,200,176,199,196,85, 8,194,159,165,71,5,136,75,35,104,16,153,51,177,84,106,79,117,202,135,71,79,39,87,176,69,94,153,62,186,216,40,89,84,140,84,248,39,135,79,175,46,76,2,170,0,20,102,185,106,174,242,144,0,5,29,71,166,126,188,206,25,81,212,247,200,191,151,252,209,226,79,75, 64,16,67,222,62,173,6,189,220,155,235,95,49,63,1,228,47,132,76,158,87,230,23,95,121,114,93,23,173,7,228,66,225,175,65,9,40,1,135,64,114,173,72,169,41,1,37,144,85,2,28,153,82,70,181,165,40,168,120,127,161,6,230,141,226,59,85,33,94,200,108,10,181,204,53, 95,217,37,160,10,64,118,249,106,236,74,32,37,2,42,172,226,99,83,54,241,217,232,47,74,32,25,2,152,85,211,160,4,148,128,18,80,2,74,64,9,12,53,2,170,0,12,181,18,215,252,42,1,37,160,4,148,128,18,0,1,175,179,90,72,23,198,104,109,80,2,74,64,9,40,1,37,48,148, 8,192,207,6,102,212,84,254,15,165,50,215,188,42,1,37,160,4,148,192,144,38,0,63,227,8,94,143,215,184,200,84,21,96,72,87,6,205,188,18,80,2,74,64,9,12,9,2,30,129,87,13,199,21,6,166,0,160,0,20,206,193,97,67,162,252,52,147,74,64,9,40,1,37,160,4,82,32,16,244, 120,139,188,225,96,87,3,239,245,26,63,153,142,50,160,86,128,20,104,234,45,74,64,9,40,1,37,160,4,242,132,64,208,235,47,198,184,223,247,54,211,235,13,135,105,13,160,135,108,13,74,64,9,40,1,37,160,4,148,64,1,19,176,246,254,3,204,163,55,28,194,33,219,142, 223,80,181,0,20,112,169,107,214,148,128,18,80,2,74,96,72,19,160,140,199,160,63,200,117,255,142,2,128,119,77,30,175,159,95,168,2,48,164,235,134,102,94,9,40,1,37,160,4,10,152,0,15,9,241,133,3,157,200,162,103,23,243,9,211,127,120,63,119,2,96,51,160,153, 11,40,224,204,107,214,148,128,18,80,2,74,64,9,12,81,2,225,144,51,216,15,53,251,66,225,61,132,64,63,0,213,145,173,128,67,20,138,102,91,9,40,1,37,160,4,148,64,161,19,240,64,1,192,174,191,144,236,237,44,13,238,101,110,189,97,9,109,13,227,152,76,4,61,99, 131,20,52,40,1,37,160,4,148,128,18,40,60,2,24,239,99,227,159,39,188,163,254,241,111,55,51,123,222,176,199,179,41,212,213,14,241,239,225,201,128,58,13,80,120,133,174,57,82,2,74,64,9,40,129,161,77,128,178,221,31,14,5,49,235,239,217,104,81,120,195,190,208, 118,9,133,26,188,190,34,126,135,95,53,40,1,37,160,4,148,128,18,80,2,5,68,128,230,127,79,40,208,209,9,83,255,251,54,95,222,221,191,191,109,31,62,108,226,226,0,4,221,9,96,201,232,171,18,80,2,74,64,9,40,129,194,32,16,246,56,131,252,58,175,167,99,155,205, 82,196,1,80,120,93,196,33,16,181,0,85,2,44,29,125,85,2,74,64,9,40,1,37,144,223,4,40,211,35,39,255,202,123,53,75,254,229,168,205,142,163,0,248,100,77,168,179,189,13,86,0,126,214,105,0,75,71,95,149,128,18,80,2,74,64,9,228,55,129,144,179,255,191,11,158, 255,195,111,50,43,243,111,124,216,204,249,27,5,32,80,212,180,25,223,109,138,152,8,212,2,144,223,133,173,169,87,2,74,64,9,40,1,37,96,9,132,205,20,127,40,208,88,36,69,171,249,229,136,154,70,35,231,189,82,85,229,173,127,188,170,29,11,3,94,141,88,255,117, 55,128,197,166,175,74,64,9,40,1,37,160,4,242,151,0,5,61,118,255,193,219,175,71,214,238,92,250,205,122,102,101,245,234,31,26,75,191,119,254,129,73,240,12,64,209,31,126,25,219,1,91,60,62,63,253,1,232,118,64,66,209,160,4,148,128,18,80,2,74,32,127,9,64,1, 128,251,223,32,221,255,202,115,252,179,176,234,77,12,242,61,142,5,224,131,71,110,12,240,203,218,165,183,110,130,26,176,6,103,5,115,21,32,149,0,115,1,127,211,160,4,148,128,18,80,2,74,64,9,228,23,1,8,241,176,215,15,153,30,10,238,128,204,135,149,31,163, 127,44,249,179,185,192,26,0,79,216,46,8,128,212,95,66,77,193,3,141,1,23,168,2,96,41,233,171,18,80,2,74,64,9,40,129,188,34,224,129,213,31,1,226,28,7,254,46,173,125,234,214,22,78,249,227,127,84,182,155,69,128,31,28,127,221,104,4,45,254,142,23,67,161,192, 135,94,127,49,111,139,106,9,252,160,65,9,40,1,37,160,4,148,128,18,200,15,2,152,214,15,97,74,223,23,234,58,125,44,228,245,46,49,169,222,62,187,135,117,223,40,0,178,108,89,80,22,61,235,59,244,228,247,90,161,51,60,30,57,21,128,191,69,53,133,252,200,178, 166,82,9,40,1,37,160,4,148,128,18,128,164,15,121,253,195,104,228,95,90,247,135,155,107,13,145,103,23,245,24,216,59,10,128,139,149,215,83,252,100,168,171,99,55,172,0,252,77,125,2,184,216,232,91,37,160,4,148,128,18,80,2,121,64,32,128,149,255,69,193,142, 214,86,216,242,31,101,122,23,46,172,242,99,46,160,199,160,190,91,1,88,118,85,136,243,3,53,75,110,58,138,137,131,7,157,101,0,186,24,48,15,10,90,147,168,4,148,128,18,80,2,74,192,77,32,236,45,194,232,95,194,75,156,5,254,88,252,183,240,204,105,253,110,5, 128,230,126,103,126,64,138,78,123,30,11,118,181,85,123,139,74,184,24,208,236,18,112,199,172,239,149,128,18,80,2,74,64,9,40,129,28,36,16,14,7,48,247,95,20,236,108,59,41,62,239,131,76,161,89,232,95,85,213,195,252,207,239,221,10,128,72,196,10,176,243,133, 91,142,65,29,248,5,252,6,242,26,117,12,68,10,26,148,128,18,80,2,74,64,9,228,54,129,48,151,252,123,124,88,200,31,10,63,81,251,135,91,204,209,191,31,76,110,236,117,58,191,167,2,224,178,2,148,4,155,158,192,209,129,107,188,197,101,88,75,16,86,43,64,110,23, 186,166,78,9,40,1,37,160,4,148,64,0,235,247,252,24,253,55,122,189,190,95,18,71,188,209,63,127,139,85,0,104,5,8,242,134,237,203,170,58,189,158,240,127,132,58,219,130,88,76,192,125,129,170,4,144,152,6,37,160,4,148,128,18,80,2,185,71,128,38,126,122,249, 227,191,187,107,158,254,214,110,46,252,251,224,145,155,186,226,37,245,76,5,0,87,90,115,65,205,211,183,190,142,45,4,15,121,184,149,192,196,170,219,2,227,129,212,239,149,128,18,80,2,74,64,9,12,34,129,160,183,168,212,131,93,124,111,143,30,94,124,15,211, 177,122,220,236,30,171,254,99,211,214,171,2,128,221,0,161,133,85,216,50,192,208,37,119,194,10,80,131,21,133,186,32,48,150,158,126,86,2,74,64,9,40,1,37,48,200,4,32,229,97,169,247,21,193,233,79,71,88,66,255,202,81,191,49,253,195,162,223,87,210,122,87,0, 112,199,234,170,170,0,35,168,93,118,235,17,9,133,254,53,20,192,97,2,60,40,64,125,3,244,197,83,127,83,2,74,64,9,40,1,37,48,112,4,224,242,143,70,127,15,102,234,161,8,252,168,110,233,109,235,185,165,31,74,64,191,211,246,113,21,0,166,62,114,80,144,167,246, 153,219,86,192,171,224,221,216,22,104,51,213,167,89,193,94,164,175,74,64,9,40,1,37,160,4,148,64,22,9,120,164,203,87,92,238,133,165,126,101,221,146,91,126,98,158,20,227,242,55,222,211,251,84,0,160,84,132,225,34,216,92,211,30,8,220,17,234,104,123,27,187, 2,48,21,16,142,187,168,32,222,131,244,123,37,160,4,148,128,18,80,2,74,32,147,4,194,157,112,247,91,28,236,108,221,239,243,123,190,69,153,109,60,254,245,99,250,183,41,232,71,1,192,101,136,136,17,238,95,246,157,211,94,143,220,0,37,224,160,215,95,130,93, 1,97,115,192,176,141,72,95,149,128,18,80,2,74,64,9,40,129,1,35,208,197,29,122,216,174,31,10,135,228,198,234,39,23,239,161,172,94,189,186,170,95,211,191,77,97,255,10,0,174,100,132,140,184,102,201,226,157,94,111,248,58,172,50,236,128,163,1,110,13,84,75, 128,37,169,175,74,64,9,40,1,37,160,4,6,128,0,23,253,97,214,191,8,11,255,48,230,15,127,187,238,153,197,127,230,188,255,234,213,63,236,115,209,95,108,210,18,82,0,120,147,137,152,103,5,112,107,160,55,252,79,225,16,158,143,85,135,248,73,149,128,88,170,250, 89,9,40,1,37,160,4,148,64,118,8,4,49,57,239,229,154,188,80,176,243,151,187,150,222,122,175,121,140,153,247,239,121,216,79,127,143,79,88,1,48,235,1,76,108,97,79,237,211,183,62,133,69,129,55,27,151,131,84,2,224,123,184,191,7,233,239,74,64,9,40,1,37,160, 4,148,64,90,4,140,63,127,223,176,50,79,168,243,244,239,107,159,94,252,29,198,150,204,188,191,251,233,73,40,0,184,141,135,9,84,221,137,29,7,34,181,75,22,255,58,28,12,126,23,102,0,90,2,252,170,4,184,177,234,123,37,160,4,148,128,18,80,2,25,37,64,225,31, 246,13,43,247,225,152,223,21,163,70,20,223,192,216,23,194,103,79,50,243,254,238,20,25,97,238,254,34,161,247,139,158,245,113,113,32,175,157,113,245,253,223,19,159,255,46,88,4,240,47,200,233,0,78,11,104,80,2,74,64,9,40,1,37,160,4,50,67,192,200,91,10,255, 80,71,235,43,173,167,138,175,58,240,210,77,109,244,213,211,151,171,223,254,30,157,156,5,192,198,70,225,79,37,0,97,215,146,91,254,51,28,12,192,18,128,19,136,116,77,128,37,164,175,74,64,9,40,1,37,160,4,50,65,128,83,236,94,110,193,15,180,183,62,127,58,208, 181,40,19,194,159,9,75,77,1,224,157,46,37,160,118,201,45,119,67,9,184,57,140,227,131,61,190,34,88,0,116,139,32,17,105,80,2,74,64,9,40,1,37,144,6,129,46,250,248,243,22,195,199,127,71,219,163,117,179,142,45,226,150,252,116,71,254,54,61,169,77,1,216,187, 249,234,154,14,152,126,205,189,215,74,200,243,40,206,13,24,22,10,180,211,119,48,167,3,210,127,134,251,121,250,94,9,40,1,37,160,238,46,114,108,0,0,5,25,73,68,65,84,4,148,64,65,19,224,106,254,112,151,199,199,147,120,61,18,14,118,253,20,235,238,110,103, 150,51,37,252,25,87,234,22,0,222,205,64,75,0,182,7,34,177,102,119,0,252,4,124,41,216,213,113,208,91,92,94,140,28,112,209,66,82,251,18,77,156,250,71,9,40,1,37,160,4,148,192,208,36,0,185,25,14,96,155,95,49,44,235,237,225,80,215,13,86,248,47,172,122,179, 207,227,125,147,197,149,185,209,185,81,2,240,120,236,20,152,121,245,125,179,66,97,249,173,119,88,217,167,66,93,237,200,75,136,139,3,121,186,96,230,158,151,108,78,245,122,37,160,4,148,128,18,80,2,57,75,0,163,126,227,96,199,227,247,21,151,73,160,179,181, 218,39,190,27,106,150,220,188,206,36,217,101,109,207,84,22,50,44,144,195,158,133,11,239,244,113,75,194,57,139,238,46,45,241,251,255,3,43,3,191,3,111,133,2,239,129,180,4,240,16,33,231,152,225,76,229,64,227,81,2,74,64,9,40,1,37,144,223,4,40,31,67,102,13, 29,22,212,67,250,47,13,249,253,183,213,61,249,205,195,142,133,29,191,114,27,126,134,67,134,21,0,39,117,110,127,196,211,191,118,207,151,177,126,241,46,172,96,156,25,14,116,64,193,49,231,10,83,9,72,127,250,33,195,48,52,58,37,160,4,148,128,18,80,2,3,72, 192,204,245,99,160,92,236,45,42,149,80,103,235,81,79,216,243,255,118,45,93,252,16,211,224,200,82,186,247,77,206,195,95,162,233,207,138,2,96,30,238,152,43,140,227,130,233,139,238,29,39,126,79,21,190,191,137,91,25,112,108,33,45,1,216,218,224,129,34,192, 163,140,53,40,1,37,160,4,148,128,18,24,66,4,232,65,23,163,125,204,245,251,49,215,15,183,190,129,231,125,30,249,55,158,185,67,10,238,129,116,182,168,100,89,248,134,61,243,111,124,36,186,104,97,230,53,247,126,46,20,246,220,129,227,11,175,96,198,177,62, 192,78,11,208,167,64,150,211,146,45,132,26,175,18,80,2,74,64,9,40,129,132,8,112,240,11,175,121,225,176,199,95,236,135,201,31,163,254,182,29,24,224,255,196,184,216,199,143,70,240,47,196,53,89,48,249,199,166,112,64,132,238,66,186,42,172,114,142,40,188, 104,81,85,113,187,175,226,27,16,247,223,245,21,149,93,128,253,13,130,89,1,90,10,248,31,211,2,156,0,81,171,64,108,65,233,103,37,160,4,148,128,18,200,91,2,88,23,239,8,54,8,125,31,125,230,5,59,219,14,226,187,251,75,2,165,15,110,95,118,67,19,115,150,201, 45,126,137,144,26,16,5,192,36,4,187,4,230,31,152,228,179,110,11,103,253,221,253,99,187,74,195,255,136,153,141,111,194,111,64,37,151,7,226,100,35,42,70,65,106,0,184,135,107,4,98,214,9,112,30,68,149,131,68,10,86,175,81,2,74,64,9,40,129,65,37,64,57,70,43, 55,131,31,35,126,12,111,125,176,124,159,62,130,31,30,43,10,7,30,220,185,244,219,245,252,209,140,250,199,109,15,203,178,101,246,122,126,157,245,48,112,10,128,205,10,215,6,92,180,35,108,205,27,51,175,126,248,172,80,184,243,186,176,39,124,189,215,235,159, 235,241,21,155,93,131,152,19,33,60,186,64,100,26,117,138,192,242,211,87,37,160,4,148,128,18,200,85,2,86,232,243,213,231,241,250,189,52,243,99,241,59,140,221,129,221,24,224,62,229,47,146,199,170,159,92,188,199,201,64,247,206,185,193,200,208,192,43,0,78, 46,61,240,32,232,117,43,2,19,174,251,207,242,145,129,97,255,27,199,28,95,141,81,254,21,88,24,49,146,178,159,46,4,0,142,211,3,110,101,32,198,50,48,24,232,244,153,74,64,9,40,1,37,160,4,204,156,126,8,195,123,202,41,8,125,159,143,3,89,6,172,115,131,35,156, 208,59,16,180,207,96,201,223,243,181,203,110,61,98,126,160,37,123,209,50,175,44,91,132,123,178,179,194,223,121,78,223,127,7,75,1,176,169,114,20,1,126,138,156,46,200,183,211,191,126,239,60,28,45,244,37,168,80,255,19,31,231,121,139,75,202,60,56,118,152, 90,148,57,112,144,171,39,157,105,2,94,78,101,128,249,192,127,190,232,20,1,32,104,80,2,74,64,9,40,129,204,18,128,163,30,68,136,245,235,156,171,134,192,231,103,136,42,143,89,204,7,183,189,16,63,97,154,248,225,248,46,252,33,46,124,45,236,149,151,235,158, 90,252,118,52,25,180,128,51,12,178,224,183,233,25,108,5,192,166,3,103,10,44,242,205,31,243,57,175,93,35,192,31,166,93,95,85,226,239,170,184,20,179,40,87,128,251,167,65,250,82,248,20,56,27,214,1,48,167,117,32,24,249,15,125,0,224,81,24,40,14,188,9,71,22, 18,154,220,229,78,22,187,51,171,239,148,128,18,80,2,74,32,167,9,64,146,96,56,201,81,189,25,90,66,186,120,41,120,48,194,231,201,183,230,63,127,163,107,27,12,78,15,227,237,22,92,185,14,119,173,245,181,181,125,80,253,226,255,61,201,223,25,204,226,190,227, 99,66,238,129,174,243,203,224,254,205,65,233,24,217,58,56,185,145,103,12,24,248,22,81,229,63,220,115,174,39,232,189,8,50,126,30,64,207,69,129,204,196,235,57,40,157,10,204,181,248,104,37,64,1,65,17,136,40,6,84,10,24,236,171,243,73,255,42,1,37,160,4,148, 128,18,136,79,192,227,197,48,18,129,163,122,202,21,134,80,40,98,129,14,181,224,83,3,254,239,130,104,161,208,223,132,37,126,91,235,58,198,237,233,33,224,237,194,247,94,100,25,163,203,133,240,255,1,68,98,42,73,104,191,162,208,0,0,0,0,73,69,78,68,174,66, 96,130,0,0 }; const char* icon_png = (const char*) temp_binary_data_0; const char* getNamedResource (const char*, int&) throw(); const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw() { unsigned int hash = 0; if (resourceNameUTF8 != 0) while (*resourceNameUTF8 != 0) hash = 31 * hash + (unsigned int) *resourceNameUTF8++; switch (hash) { case 0xd4093963: numBytes = 67487; return icon_png; default: break; } numBytes = 0; return 0; } const char* namedResourceList[] = { "icon_png" }; }
[ "balandino.didonato@mail.bcu.ac.uk" ]
balandino.didonato@mail.bcu.ac.uk
35f7262344b3b8a9748d88640ad24d9a087c8c7e
edb8f2b2199ed160fb0aec8f67825bee8a718e9e
/_23_SoftwareRenderer_BezierConnectingTheDots3D/src/Vector4f.cpp
56dbc791d2f7a684a1ba64981bb6c7571f9a9024
[]
no_license
aalekhm/Dream3D_SoftwareRendering
ee8c637de2e8882660e961d514e3db8999539e57
0eaab58645f649c1fb6d2db593de8559a9635946
refs/heads/master
2021-02-26T02:41:43.300739
2020-05-17T08:52:21
2020-05-17T08:52:21
245,489,277
1
0
null
null
null
null
UTF-8
C++
false
false
3,859
cpp
#include "Vector4f.h" #include "Quaternion.h" Vector4f::Vector4f() { x = 0; y = 0; z = 0; w = 0; } Vector4f::Vector4f(float x, float y, float z, float w) { this->x = x; this->y = y; this->z = z; this->w = w; } Vector4f::Vector4f(float x, float y, float z) { this->x = x; this->y = y; this->z = z; this->w = 0.0f; } float Vector4f::length() { return (float)sqrt(x * x + y * y + z * z + w * w); } float Vector4f::max_() { return fmax( fmax(x, y), fmax(z, w)); } float Vector4f::dot(Vector4f r) { return x * r.getX() + y * r.getY() + z * r.getZ() + w * r.getW(); } Vector4f Vector4f::cross(Vector4f r) { float x_ = y * r.getZ() - z * r.getY(); float y_ = z * r.getX() - x * r.getZ(); float z_ = x * r.getY() - y * r.getX(); return Vector4f(x_, y_, z_, 0); } Vector4f Vector4f::normalized() { float fLength = length(); return Vector4f(x / fLength, y / fLength, z / fLength, w / fLength); } Vector4f Vector4f::rotate(Vector4f axis, float angle) { float sinAngle = (float)sin(-angle); float cosAngle = (float)cos(-angle); return cross( axis.mul(sinAngle)).add( //Rotation on local X (mul(cosAngle)).add( //Rotation on local Z axis.mul(dot(axis.mul(1 - cosAngle))))); //Rotation on local Y } Vector4f Vector4f::rotate(Quaternion* rotation) { Quaternion conjugate = rotation->conjugate(); Quaternion w = rotation->mul(*this).mul(conjugate); return Vector4f(w.getX(), w.getY(), w.getZ()); } Vector4f Vector4f::lerp(Vector4f dest, float lerpFactor) { return dest.sub(*this).mul(lerpFactor).add(*this); } Vector4f Vector4f::add(Vector4f r) { return Vector4f(x + r.getX(), y + r.getY(), z + r.getZ(), w + r.getW()); } Vector4f Vector4f::add(float r) { return Vector4f(x + r, y + r, z + r, w + r); } Vector4f Vector4f::sub(Vector4f r) { return Vector4f(x - r.getX(), y - r.getY(), z - r.getZ(), w - r.getW()); } Vector4f Vector4f::sub(float r) { return Vector4f(x - r, y - r, z - r, w - r); } Vector4f Vector4f::mul(Vector4f r) { return Vector4f(x * r.getX(), y * r.getY(), z * r.getZ(), w * r.getW()); } Vector4f Vector4f::mul(float r) { return Vector4f(x * r, y * r, z * r, w * r); } Vector4f Vector4f::div(Vector4f r) { return Vector4f(x / r.getX(), y / r.getY(), z / r.getZ(), w / r.getW()); } Vector4f Vector4f::div(float r) { return Vector4f(x / r, y / r, z / r, w / r); } Vector4f Vector4f::abs_() { return Vector4f(abs(x), abs(y), abs(z), abs(w)); } std::string Vector4f::toString() { char str[255]; snprintf(str, 255, "( x = %0.6f, y = %0.6f, z = %0.6f, w = %0.6f", x, y, z, w); return std::string(str); } float Vector4f::getX() { return x; } float Vector4f::getY() { return y; } float Vector4f::getZ() { return z; } float Vector4f::getW() { return w; } bool Vector4f::equals(Vector4f r) { return (x == r.getX() && y == r.getY() && z == r.getZ() && w == r.getW()); } //// just in case you need that function also //static Quaternion CreateFromAxisAngle(Vector3 axis, float angle) //{ // float halfAngle = angle * .5f; // float s = (float)sin(halfAngle); // Quaternion q(axis.x * s, axis.y * s, axis.z * s, (float)cos(halfAngle)); // //q.x = axis.x * s; // //q.y = axis.y * s; // //q.z = axis.z * s; // //q.w = (float)cos(halfAngle); // return q; //} // //static Quaternion LookAt(Vector3 sourcePoint, Vector3 destPoint) //{ // Vector3 forwardVector = (destPoint - sourcePoint).normalize(); // // float _dot = Vector3.Dot(Vector3.forward, forwardVector); // // if (abs(_dot - (-1.0f)) < 0.000001f) // { // return Quaternion(Vector3.up.x, Vector3.up.y, Vector3.up.z, 3.1415926535897932f); // } // if (abs(_dot - (1.0f)) < 0.000001f) // { // return Quaternion(); // } // // float rotAngle = (float)acos(_dot); // Vector3 rotAxis = Vector3.Cross(Vector3.forward, forwardVector); // rotAxis = rotAxis.normalize(); // return CreateFromAxisAngle(rotAxis, rotAngle); //}
[ "aalekhm@gmail.com" ]
aalekhm@gmail.com
2fae402635d5dcd2dbbddbdf359f57b3c4d6a383
c8b39acfd4a857dc15ed3375e0d93e75fa3f1f64
/Engine/Source/ThirdParty/OSVRClientKit/include/osvr/RenderKit/RGBPointMeshTypes.h
75a90867fdfbf825a9c1c553480b78c79756a8c3
[ "MIT", "LicenseRef-scancode-proprietary-license" ]
permissive
windystrife/UnrealEngine_NVIDIAGameWorks
c3c7863083653caf1bc67d3ef104fb4b9f302e2a
b50e6338a7c5b26374d66306ebc7807541ff815e
refs/heads/4.18-GameWorks
2023-03-11T02:50:08.471040
2022-01-13T20:50:29
2022-01-13T20:50:29
124,100,479
262
179
MIT
2022-12-16T05:36:38
2018-03-06T15:44:09
C++
UTF-8
C++
false
false
1,406
h
/** @file @brief Header @date 2015 @author Sensics, Inc. <http://sensics.com/osvr> */ // Copyright 2015 Sensics, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef INCLUDED_RGBPointMeshTypes_h_GUID_33CEDC76_9C34_4F8A_935B_652409FE6B30 #define INCLUDED_RGBPointMeshTypes_h_GUID_33CEDC76_9C34_4F8A_935B_652409FE6B30 // Internal Includes // - none // Library/third-party includes // - none // Standard includes #include <array> #include <vector> #include "MonoPointMeshTypes.h" namespace osvr { namespace renderkit { typedef std::array< //!< One mapping per color red, green, blue std::vector< //!< One mapping per eye MonoPointDistortionMeshDescription>, 3> RGBPointDistortionMeshDescriptions; } // namespace renderkit } // namespace osvr #endif // INCLUDED_RGBPointMeshTypes_h_GUID_33CEDC76_9C34_4F8A_935B_652409FE6B30
[ "tungnt.rec@gmail.com" ]
tungnt.rec@gmail.com