blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
5
140
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
986 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
23 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
145 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
10.4M
extension
stringclasses
122 values
content
stringlengths
3
10.4M
authors
sequencelengths
1
1
author_id
stringlengths
0
158
0132b4e54d47f8e57b1ed9ddaf10024ee5f74a0b
7a310d01d1a4361fd06b40a74a2afc8ddc23b4d3
/src/option/PluginDialog.cpp
a56512faac0978d517410b49dc109cd77cf3c2f8
[]
no_license
plus7/DonutG
b6fec6111d25b60f9a9ae5798e0ab21bb2fa28f6
2d204c36f366d6162eaf02f4b2e1b8bc7b403f6b
refs/heads/master
2020-06-01T15:30:31.747022
2010-08-21T18:51:01
2010-08-21T18:51:01
767,753
1
2
null
null
null
null
SHIFT_JIS
C++
false
false
6,682
cpp
/** * @file PluginDialog.cpp * @brief donutのオプション : プラグイン */ #include "stdafx.h" #include "PluginDialog.h" #include "../IniFile.h" #include "../DonutPFunc.h" #include "../PluginManager.h" #if defined USE_ATLDBGMEM #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif using namespace MTL; // Constructor CPluginPropertyPage::CPluginPropertyPage() { } CPluginPropertyPage::~CPluginPropertyPage() { m_listview.Detach(); //memory leak bug fixed (release13) int nCount = m_mapPlaginInfo.GetSize(); for (int i = 0; i < nCount; i++) { delete m_mapPlaginInfo.GetValueAt(i); m_mapPlaginInfo.GetValueAt(i) = NULL; //+++ 念のためクリア. } } // Overrides BOOL CPluginPropertyPage::OnSetActive() { if (NULL == m_listview.m_hWnd) { m_listview.SubclassWindow( GetDlgItem(IDC_LIST_PLUGIN) ); _SetData(); } return DoDataExchange(FALSE); } BOOL CPluginPropertyPage::OnKillActive() { return DoDataExchange(TRUE); } BOOL CPluginPropertyPage::OnApply() { if ( DoDataExchange(TRUE) ) { _GetData(); return TRUE; } else { return FALSE; } } void CPluginPropertyPage::OnBtnSetting(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/) { int nIndex = m_listview.GetSelectedIndex(); if (nIndex < 0) return; CString strFile; m_listview.GetItemText( nIndex, 0, strFile ); //+++ HINSTANCE hLib = ::LoadLibrary( _T("Plugin\\") + strFile ); HINSTANCE hLib = ::LoadLibrary( CPluginManager::PluginDir() + strFile ); if (!hLib) return; void (WINAPI * __PluginSetting)(); //+++ = NULL; //+++ __PluginSetting = ( void (WINAPI *)() )GetProcAddress( hLib, _T("PluginSetting") ); __PluginSetting = ( void (WINAPI *)() )GetProcAddress( hLib, "PluginSetting" ); if (__PluginSetting) __PluginSetting(); ::FreeLibrary( hLib ); } void CPluginPropertyPage::_GetData() { CSimpleMap<int , CSimpleArray<CString>*> map; for (int nType = PLT_TOOLBAR/*1*/; nType <= PLUGIN_TYPECNT; nType++) { CSimpleArray<CString>*pAry = new CSimpleArray<CString>; map.Add( nType, pAry ); } int nIndex; for (nIndex = 0; nIndex < m_listview.GetItemCount(); nIndex++) { CString strFile; m_listview.GetItemText( nIndex, 0, strFile ); if ( FALSE == m_listview.GetCheckState( nIndex ) ) continue; int nType = int( m_listview.GetItemData( nIndex ) ); CSimpleArray<CString>* pAry = NULL; pAry = map.Lookup( nType ); if (NULL == pAry) continue; pAry->Add( strFile ); } for (nIndex = 0; nIndex < map.GetSize(); nIndex++) { CSimpleArray<CString>*pAry = NULL; pAry = map.GetValueAt( nIndex ); int nType = map.GetKeyAt( nIndex ); CString strKey; strKey.Format( _T("Plugin%02d"), nType ); CIniFileO pr( g_szIniFileName, strKey ); pr.SetValue( pAry->GetSize(), _T("Count") ); for (int nNo = 0; nNo < pAry->GetSize(); nNo++) { strKey.Format(_T("%02d"), nNo); pr.SetString( (*pAry)[nNo], strKey ); } delete pAry; } } void CPluginPropertyPage::_SetData() { TCHAR titles[] = _T("ファイル名"); LVCOLUMN col; col.mask = LVCF_TEXT | LVCF_WIDTH; col.pszText = titles; col.cx = 150; m_listview.InsertColumn(0, &col); // List Item InitListItem(); DoCheckListItem(); ::EnableWindow( GetDlgItem( IDC_BTN_SETTING ), FALSE ); } LRESULT CPluginPropertyPage::OnListPluginSelectchange(LPNMHDR) { int nIndex = m_listview.GetSelectedIndex(); if (-1 == nIndex) { ::EnableWindow( GetDlgItem(IDC_BTN_SETTING), FALSE ); m_strPluginName = _T(""); m_strPluginKind = _T(""); m_strPluginVer = _T(""); m_strPluginDate = _T(""); m_strPluginComment = _T(""); m_strAuthuorName = _T(""); m_strAuthuorURL = _T(""); m_strAuthuorEMail = _T(""); } else { ::EnableWindow( GetDlgItem(IDC_BTN_SETTING), TRUE ); CString strItemSelect; m_listview.GetItemText( nIndex, 0, strItemSelect ); PLUGININFO *pstPluginInfo = m_mapPlaginInfo.Lookup( strItemSelect ); if (pstPluginInfo) { m_strPluginName = pstPluginInfo->name; static LPCTSTR PluginType[] = { _T("Toolbar"), _T("Explorerbar"), _T("Statusbar"), _T("Operation"), _T("Docking") }; m_strPluginKind = PluginType[(pstPluginInfo->type & 0xF) - 1]; m_strPluginVer = pstPluginInfo->version; m_strPluginDate = pstPluginInfo->versionDate; m_strPluginComment = pstPluginInfo->comment; m_strAuthuorName = pstPluginInfo->authorName; m_strAuthuorURL = pstPluginInfo->authorUrl; m_strAuthuorEMail = pstPluginInfo->authorEmail; } } DoDataExchange( FALSE ); return S_OK; } void CPluginPropertyPage::InitListItem() { CFindFile finder; CString strPathMatch = Misc::GetExeDirectory() + CPluginManager::PluginDir() + _T("*.dll"); if ( finder.FindFile( strPathMatch ) ) { do { PLUGININFO *pstPluginInfo = new PLUGININFO; memset( pstPluginInfo, 0, sizeof (PLUGININFO) ); CString strFile = finder.GetFileName(); HINSTANCE hLib = ::LoadLibrary( CPluginManager::PluginDir() + strFile ); if (!hLib) { DWORD errNum = ::GetLastError(); } void (WINAPI * __GetPluginInfo)(PLUGININFO * pstPlugin); //+++ = NULL; __GetPluginInfo = ( void (WINAPI *)(PLUGININFO *) )GetProcAddress(hLib, "GetPluginInfo"); if (__GetPluginInfo) { __GetPluginInfo( pstPluginInfo ); m_mapPlaginInfo.Add( strFile, pstPluginInfo ); // List Add int nIndex = m_listview.InsertItem( m_listview.GetItemCount(), strFile ); m_listview.SetItemData( nIndex, pstPluginInfo->type ); } else { delete pstPluginInfo; } ::FreeLibrary( hLib ); } while ( finder.FindNextFile() ); } } void CPluginPropertyPage::DoCheckListItem() { for (int nType = PLT_TOOLBAR/*1*/; nType <= PLUGIN_TYPECNT; nType++) { CString strKey; strKey.Format( _T("Plugin%02d"), /*PLT_TOOLBAR +*/ nType ); //+++ 余分に足しすぎ. CIniFileI pr( g_szIniFileName, strKey ); DWORD dwCount = 0; pr.QueryValue( dwCount, _T("Count") ); for (int nNo = 0; nNo < (int) dwCount; nNo++) { strKey.Format(_T("%02d"), nNo); CString szFile = pr.GetString( strKey ); //+++ 手抜きで元の名前のままCString化(ネーミングルール破壊になるが...) for (int nIndex = 0; nIndex < m_listview.GetItemCount(); nIndex++) { CString strItem; m_listview.GetItemText( nIndex, 0, strItem ); if (strItem != szFile) continue; m_listview.SetCheckState( nIndex, TRUE ); break; } } } }
6828e28a524392bcc7d3d020fb4d1457ed09c669
22204cffab84e7e6907f013a2d45b116ccb0c66d
/src/libzerocoin/Params.h
33b01d81ba5c3c2f9ef19da753f6f959927b9540
[ "MIT" ]
permissive
LordSoylent/PrimeStone-2
bf24751d40d02e14b778e6e29eb2d9a3f9f1ca3f
6ae3719a45a3ff105a1fe7ca0eb74a979be44def
refs/heads/master
2020-04-18T21:34:06.721912
2019-01-26T19:14:49
2019-01-26T19:14:49
167,768,307
1
0
MIT
2019-01-27T04:15:02
2019-01-27T04:15:02
null
UTF-8
C++
false
false
6,100
h
/** * @file Params.h * * @brief Parameter classes for Zerocoin. * * @author Ian Miers, Christina Garman and Matthew Green * @date June 2013 * * @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green * @license This project is released under the MIT license. **/ // Copyright (c) 2017 The PrimeStone developers #ifndef PARAMS_H_ #define PARAMS_H_ #include "bignum.h" #include "ZerocoinDefines.h" namespace libzerocoin { class IntegerGroupParams { public: /** @brief Integer group class, default constructor * * Allocates an empty (uninitialized) set of parameters. **/ IntegerGroupParams(); /** * Generates a random group element * @return a random element in the group. */ CBigNum randomElement() const; bool initialized; /** * A generator for the group. */ CBigNum g; /** * A second generator for the group. * Note log_g(h) and log_h(g) must * be unknown. */ CBigNum h; /** * The modulus for the group. */ CBigNum modulus; /** * The order of the group */ CBigNum groupOrder; ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(initialized); READWRITE(g); READWRITE(h); READWRITE(modulus); READWRITE(groupOrder); } }; class AccumulatorAndProofParams { public: /** @brief Construct a set of Zerocoin parameters from a modulus "N". * @param N A trusted RSA modulus * @param securityLevel A security level expressed in symmetric bits (default 80) * * Allocates and derives a set of Zerocoin parameters from * a trustworthy RSA modulus "N". This routine calculates all * of the remaining parameters (group descriptions etc.) from N * using a verifiable, deterministic procedure. * * Note: this constructor makes the fundamental assumption that "N" * encodes a valid RSA-style modulus of the form "e1 * e2" where * "e1" and "e2" are safe primes. The factors "e1", "e2" MUST NOT * be known to any party, or the security of Zerocoin is * compromised. The integer "N" must be a MINIMUM of 1024 * in length. 3072 bits is strongly recommended. **/ AccumulatorAndProofParams(); //AccumulatorAndProofParams(CBigNum accumulatorModulus); bool initialized; /** * Modulus used for the accumulator. * Product of two safe primes who's factorization is unknown. */ CBigNum accumulatorModulus; /** * The initial value for the accumulator * A random Quadratic residue mod n thats not 1 */ CBigNum accumulatorBase; /** * Lower bound on the value for committed coin. * Required by the accumulator proof. */ CBigNum minCoinValue; /** * Upper bound on the value for a comitted coin. * Required by the accumulator proof. */ CBigNum maxCoinValue; /** * The second of two groups used to form a commitment to * a coin (which it self is a commitment to a serial number). * This one differs from serialNumberSokCommitment due to * restrictions from Camenisch and Lysyanskaya's paper. */ IntegerGroupParams accumulatorPoKCommitmentGroup; /** * Hidden order quadratic residue group mod N. * Used in the accumulator proof. */ IntegerGroupParams accumulatorQRNCommitmentGroup; /** * Security parameter. * Bit length of the challenges used in the accumulator proof. */ uint32_t k_prime; /** * Security parameter. * The statistical zero-knowledgeness of the accumulator proof. */ uint32_t k_dprime; ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(initialized); READWRITE(accumulatorModulus); READWRITE(accumulatorBase); READWRITE(accumulatorPoKCommitmentGroup); READWRITE(accumulatorQRNCommitmentGroup); READWRITE(minCoinValue); READWRITE(maxCoinValue); READWRITE(k_prime); READWRITE(k_dprime); } }; class ZerocoinParams { public: /** @brief Construct a set of Zerocoin parameters from a modulus "N". * @param N A trusted RSA modulus * @param securityLevel A security level expressed in symmetric bits (default 80) * * Allocates and derives a set of Zerocoin parameters from * a trustworthy RSA modulus "N". This routine calculates all * of the remaining parameters (group descriptions etc.) from N * using a verifiable, deterministic procedure. * * Note: this constructor makes the fundamental assumption that "N" * encodes a valid RSA-style modulus of the form "e1 * e2" where * "e1" and "e2" are safe primes. The factors "e1", "e2" MUST NOT * be known to any party, or the security of Zerocoin is * compromised. The integer "N" must be a MINIMUM of 1024 * in length. 3072 bits is strongly recommended. **/ ZerocoinParams(CBigNum accumulatorModulus, uint32_t securityLevel = ZEROCOIN_DEFAULT_SECURITYLEVEL); bool initialized; AccumulatorAndProofParams accumulatorParams; /** * The Quadratic Residue group from which we form * a coin as a commitment to a serial number. */ IntegerGroupParams coinCommitmentGroup; /** * One of two groups used to form a commitment to * a coin (which it self is a commitment to a serial number). * This is the one used in the serial number poof. * It's order must be equal to the modulus of coinCommitmentGroup. */ IntegerGroupParams serialNumberSoKCommitmentGroup; /** * The number of iterations to use in the serial * number proof. */ uint32_t zkp_iterations; /** * The amount of the hash function we use for * proofs. */ uint32_t zkp_hash_len; ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(initialized); READWRITE(accumulatorParams); READWRITE(coinCommitmentGroup); READWRITE(serialNumberSoKCommitmentGroup); READWRITE(zkp_iterations); READWRITE(zkp_hash_len); } }; } /* namespace libzerocoin */ #endif /* PARAMS_H_ */
5575515ef47d9b72356020c24f27c19bd721b0ae
4a83dcb782625c9fbb02c21ff933f90c455bad66
/B2068BackendControllingSoftware/B2068BackendControllingSoftware/chiefwidget.h
e235918f0bf2a85c6e5f729106f93e3536666a48
[ "Apache-2.0" ]
permissive
cymurs/VS2015For32QtProject
a8f28db59bc1aad0bfddc9ab38e5d5325d9cf4c2
bb53f4ef8d9f34a094169474cb6d18864a62b121
refs/heads/master
2020-03-26T08:36:57.528351
2018-09-30T09:08:41
2018-09-30T09:08:41
144,711,285
0
0
null
null
null
null
GB18030
C++
false
false
961
h
#pragma once #include <QWidget> class CommWidget; class SignInWidget; class MainTab; class CentralWidget; class ChiefWidget : public QWidget { Q_OBJECT public: ChiefWidget(QWidget *parent = Q_NULLPTR); ~ChiefWidget(); protected: void closeEvent(QCloseEvent *event) override; bool isQuit(); private: void connectSlots(); void queryMasterBoardInfo(); void queryNetBoardInfo(); void queryDisplayBoardInfo(); void queryReceiverBoardInfo(); void queryBoardInfo(); void loadConfig(); void storeConfig(); private slots: void slotOnConnect(); void slotOnSignIn(bool signin); void slotOnLoginTimeout(); void slotOnMainFadeOut(); void slotOnAnimationFinished(); void slotOnGoHome(); void slotOnChangeParams(); private: CommWidget *m_comm; SignInWidget *m_signIn; MainTab *m_main; CentralWidget *m_center; QStackedLayout *m_baseLayout; QPropertyAnimation *m_animation; bool m_firstTime; bool m_loginChange; // 更改参数 确认 };
9fece1e7527c03467d580b3092bece7006534e37
3e824026c12e258ccb369d80f7cbe951701ed9a5
/libglrender0/src/main/jni/librender/egl_core.cpp
118d99242273d7aa4819aaabb0bf7eee681e7645
[]
no_license
zhangkx123/JniDe
ef97eb8edb4f92452750655e1bdcd4f5cf4dca57
c41c45bc687e95ae0d17f16be9127ff86c071176
refs/heads/master
2022-01-07T00:52:29.194378
2018-10-29T01:23:11
2018-10-29T01:23:11
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,744
cpp
// // Created by zengp on 2018/9/22. // #include "./include/egl_core.h" #include "./libutils/my_log.h" #define LOG_TAG "EGLCore" EGLCore::EGLCore() { MY_LOGD(LOG_TAG, "EGLCore constructor"); egl_presentation_time_android = 0; display = EGL_NO_DISPLAY; context = EGL_NO_CONTEXT; } EGLCore::~EGLCore() { MY_LOGD(LOG_TAG, "EGLCore destructor"); } bool EGLCore::init() { return this->init(NULL); } bool EGLCore::init(EGLContext shareContext) { MY_LOGD(LOG_TAG, "EGLCore init start , shareContext = %p", shareContext); // 1.寻找显示设备 if ((display = eglGetDisplay(EGL_DEFAULT_DISPLAY)) == EGL_NO_DISPLAY) { MY_LOGE(LOG_TAG, "eglGetDisplay() return error : %d", eglGetError()); return false; } // 2.初始化显示设备 if (!eglInitialize(display, 0, 0)) { MY_LOGE(LOG_TAG, "eglInitialize() return error : %d", eglGetError()); return false; } // 3.android平台配置选项 EGLint numConfigs; const EGLint attribs[] = { EGL_BUFFER_SIZE, 32, EGL_ALPHA_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_RED_SIZE, 8, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_NONE }; if (!eglChooseConfig(display, attribs, &config, 1, &numConfigs)) { MY_LOGE(LOG_TAG, "eglChooseConfig() return error : %d", eglGetError()); release(); return false; } // 4.创建opengl上下文 EGLint contextAttributes[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE}; if (!(context = eglCreateContext(display, config, shareContext, contextAttributes))) { MY_LOGE(LOG_TAG, "eglCreateContext() return error : %d", eglGetError()); release(); return false; } egl_presentation_time_android = (EGL_PRESENTATION_TIME_ANDROID_PROC) eglGetProcAddress( "egl_presentation_time_android"); if (!egl_presentation_time_android) { MY_LOGE(LOG_TAG, "egl_presentation_time_android is not available!"); } MY_LOGD(LOG_TAG, "EGLCore init success !"); return true; } void EGLCore::release() { MY_LOGD(LOG_TAG, "EGLCore release"); eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglDestroyContext(display, context); display = EGL_NO_DISPLAY; context = EGL_NO_CONTEXT; } EGLSurface EGLCore::createWindowSurface(ANativeWindow *_window) { MY_LOGD(LOG_TAG, "EGLCore createWindowSurface"); // create EGLSurface,使opengl的输出可以渲染到设备屏幕上 EGLSurface surface = NULL; EGLint format; if (!(eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format))) { MY_LOGE(LOG_TAG, "eglGetConfigAttrib() return error : %d", eglGetError()); release(); return NULL; } ANativeWindow_setBuffersGeometry(_window, 0, 0, format); if (!(surface = eglCreateWindowSurface(display, config, _window, 0))) { MY_LOGE(LOG_TAG, "eglCreateWindowSurface() return error : %d", eglGetError()); } return surface; } EGLSurface EGLCore::createOffScreenSurface(int width, int height) { MY_LOGD(LOG_TAG, "EGLCore createOffScreenSurface"); // 离线渲染 EGLSurface surface = NULL; EGLint pBufferAttributes[] = { EGL_WIDTH, width, EGL_HEIGHT, height, EGL_NONE, EGL_NONE}; if (!(surface = eglCreatePbufferSurface(display, config, pBufferAttributes))) { MY_LOGE(LOG_TAG, "eglCreatePbufferSurface() return error : %d", eglGetError()); } return surface; } bool EGLCore::makeCurrent(EGLSurface eglSurface) { // 为线程绑定surface和context MY_LOGD(LOG_TAG, "EGLCore makeCurrent"); return (bool) eglMakeCurrent(display, eglSurface, eglSurface, context); } bool EGLCore::swapBuffers(EGLSurface eglSurface) { MY_LOGD(LOG_TAG, "EGLCore swapBuffers"); return (bool) eglSwapBuffers(display, eglSurface); } void EGLCore::releaseSurface(EGLSurface eglSurface) { MY_LOGD(LOG_TAG, "EGLCore releaseSurface"); eglDestroySurface(display, eglSurface); eglSurface = EGL_NO_SURFACE; } int EGLCore::querySurface(EGLSurface eglSurface, int what) { MY_LOGD(LOG_TAG, "EGLCore querySurface"); int value = -1; eglQuerySurface(display, eglSurface, what, &value); return value; } void EGLCore::setPresentationTime(EGLSurface eglSurface, khronos_stime_nanoseconds_t nanoseconds) { // 设置时间戳 egl_presentation_time_android(display, eglSurface, nanoseconds); } EGLContext EGLCore::getContext() { return context; } EGLDisplay EGLCore::getDisplay() { return display; } EGLConfig EGLCore::getConfig() { return config; }
efc52f3feb911928ab18884eff630e3110b2db4d
80336ed644f60375d1706a1319d1fa29c6709371
/FBullCowGame.cpp
5b87f4a3dc43859d89233a3eec266e98021cdba3
[]
no_license
JohnTenoso/Bull-Cow-Game
5e2c7778723ce89d6997e885a9c865ee1493806f
b0fd3a64e6c9cfdab0fa2b2b5476e93366e0accc
refs/heads/main
2023-07-31T05:14:59.905996
2021-09-17T11:28:56
2021-09-17T11:28:56
407,509,098
0
0
null
null
null
null
UTF-8
C++
false
false
2,939
cpp
#pragma once #include "FBullCowGame.h" #include <map> #define TMap std::map // to make syntax Unreal friendly using int32 = int; // default constructor FBullCowGame::FBullCowGame() { Reset(); } //Receives a VALID Guess, Incriments turn, and returns count Bull_Cow_Count FBullCowGame::Submit_Valid_Guess(Fstring Guess) { My_Current_try++; Bull_Cow_Count BCCount; int32 Word_Length = My_Hidden_Word.length(); // Assuming same Length as Guess // loop through all letters in the Hidden Word for (int32 MHWChar = 0; MHWChar < Word_Length; MHWChar++) { // compare letters against the Guess word for (int32 GChar = 0; GChar < Word_Length; GChar++) { // if they match then if (Guess[GChar] == My_Hidden_Word[MHWChar]) { if (MHWChar == GChar) // if they're in the same place { BCCount.Bulls++; // incriment bulls } else { BCCount.Cows++; // must be a cow } } } } if (BCCount.Bulls == Word_Length) { b_Game_is_won = true; } else { b_Game_is_won = false; } return BCCount; } E_Word_Status FBullCowGame::Check_Guess_Validity(Fstring Guess) const { if (!Is_Isogram(Guess)) // if the guess isn't an isogram { return E_Word_Status::Not_Isogram; } else if (!Is_Lower_case(Guess)) // if the guess isn't all lowercase { return E_Word_Status::Not_Lowercase; } else if (Guess.length() != Get_Hidden_Word_Length()) // if the guess length is wrong { return E_Word_Status::Wrong_Length; } else { return E_Word_Status::Ok; } } int32 FBullCowGame::Get_Current_Try()const { return My_Current_try; } int32 FBullCowGame::Get_Hidden_Word_Length() const { return My_Hidden_Word.length(); } int32 FBullCowGame::Get_Max_Tries() const { TMap <int32, int32> Word_Length_to_Max_tries { {3,5}, {4,5}, {5,3}, {6,3} }; return Word_Length_to_Max_tries[My_Hidden_Word.length()]; } bool FBullCowGame::Is_Game_Won() const { return b_Game_is_won; } bool FBullCowGame::Is_Lower_case(Fstring Word) const { for (auto Letter : Word) { if (!islower(Letter)) { return false; } } return true; } bool FBullCowGame::Is_Isogram(Fstring Word) const { //Treat 0 and 1 letter words as Isogram if (Word.length() <= 1) { return true; } TMap <char, bool> Letter_Seen; //Setup map for (auto Letter : Word) //For all letters of the word { Letter = tolower(Letter); //Handle mixes case if (Letter_Seen[Letter]) //If the letter is in the map { return false; //Do Not have an Isogram } else { Letter_Seen[Letter] = true; //Add the letter to the map } } return true; //For Example in case where /0 is entered } void FBullCowGame::Reset() { const Fstring Hidden_Word = "planet"; // this MUST be an isogram My_Hidden_Word = Hidden_Word; My_Current_try = 1; b_Game_is_won = false; return; }
3d9b78d7a2a78b9b14e255ebe2e4f2dcdfc145ba
dc1541e6cd6b090bc936d91a20bb073cea21404e
/uri/uri1050.cpp
08b77dc62cfd4b369022144990458bf7ac0b2bac
[]
no_license
lvirgili/programming_challenges
f9a92b5beefd08ccfc34b85d6a0c14cf00c40f0b
2bed6d73c27b09da9c5e80973c881249ece008a8
refs/heads/master
2021-05-16T02:57:04.560437
2017-11-05T00:41:51
2017-11-05T00:41:51
4,745,914
4
0
null
null
null
null
UTF-8
C++
false
false
612
cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; if (n == 61) { cout << "Brasilia\n"; } else if (n == 71) { cout << "Salvador\n"; } else if (n == 11) { cout << "Sao Paulo\n"; } else if (n == 21) { cout << "Rio de Janeiro\n"; } else if (n == 32) { cout << "Juiz de Fora\n"; } else if (n == 19) { cout << "Campinas\n"; } else if (n == 27) { cout << "Vitoria\n"; } else if (n == 31) { cout << "Belo Horizonte\n"; } else { cout << "DDD nao cadastrado\n"; } return 0; }
cd9a1bf59fba3ccfb6b5257a3f68195dda0da48f
91a882547e393d4c4946a6c2c99186b5f72122dd
/Source/XPSP1/NT/multimedia/dshow/filters/sbe/dvrfilters/shared/dvrdsseek.cpp
bf561b593be35d86df9ad902ba75781cf53579bf
[]
no_license
IAmAnubhavSaini/cryptoAlgorithm-nt5src
94f9b46f101b983954ac6e453d0cf8d02aa76fc7
d9e1cdeec650b9d6d3ce63f9f0abe50dabfaf9e2
refs/heads/master
2023-09-02T10:14:14.795579
2021-11-20T13:47:06
2021-11-20T13:47:06
null
0
0
null
null
null
null
UTF-8
C++
false
false
54,036
cpp
/*++ Copyright (c) 2001 Microsoft Corporation. All Rights Reserved. Module Name: dvrdsseek.h Abstract: This module contains the IMediaSeeking-related code. Author: Matthijs Gates (mgates) Revision History: 10-Apr-2001 mgates created Notes: --*/ #include "dvrall.h" #include "dvrprof.h" #include "dvrdsseek.h" #include "dvrpins.h" #include "dvrdsread.h" CVarSpeedTimeline::CVarSpeedTimeline ( ) : m_pCurRateSegment (NULL) { InitializeListHead (& m_leRateSegmentList) ; Reset_ () ; } CVarSpeedTimeline::~CVarSpeedTimeline ( ) { Reset_ () ; } void CVarSpeedTimeline::Reset_ ( ) { RATE_SEGMENT * pRateSegment ; while (!IsListEmpty (& m_leRateSegmentList)) { pRateSegment = RATE_SEGMENT::Recover (m_leRateSegmentList.Flink) ; RATE_SEGMENT::Disconnect (pRateSegment) ; RecycleSegment_ ( pRateSegment) ; } m_pCurRateSegment = NULL ; } void CVarSpeedTimeline::UpdateQueue_ ( IN REFERENCE_TIME rtRuntimeNow ) { RATE_SEGMENT * pRateSegment ; LIST_ENTRY * pCurListEntry ; ASSERT (!IsListEmpty (& m_leRateSegmentList)) ; ASSERT (m_pCurRateSegment) ; ASSERT (& m_pCurRateSegment -> ListEntry == m_leRateSegmentList.Flink) ; for (pCurListEntry = m_pCurRateSegment -> ListEntry.Flink; pCurListEntry != & m_leRateSegmentList; pCurListEntry = pCurListEntry -> Flink) { pRateSegment = RATE_SEGMENT::Recover (pCurListEntry) ; if (pRateSegment -> rtRuntimeStart <= rtRuntimeNow) { // first in list has become stale; remove it RATE_SEGMENT::Disconnect (m_pCurRateSegment) ; TRACE_4 (LOG_AREA_SEEKING_AND_TRICK, 1, TEXT ("CVarSpeedTimeline::UpdateQueue_ () -- OUT : segment (runtime start = %I64d ms, base = %I64d ms, rate = %2.1f); now = %I64d ms"), DShowTimeToMilliseconds (m_pCurRateSegment -> rtRuntimeStart), DShowTimeToMilliseconds (m_pCurRateSegment -> rtBasetime), m_pCurRateSegment -> dRate, DShowTimeToMilliseconds (rtRuntimeNow) ) ; // recycle RecycleSegment_ (m_pCurRateSegment) ; // replace m_pCurRateSegment = pRateSegment ; TRACE_4 (LOG_AREA_SEEKING_AND_TRICK, 1, TEXT ("CVarSpeedTimeline::UpdateQueue_ () -- IN : segment (runtime start = %I64d ms, base = %I64d ms, rate = %2.1f); now = %I64d ms"), DShowTimeToMilliseconds (m_pCurRateSegment -> rtRuntimeStart), DShowTimeToMilliseconds (m_pCurRateSegment -> rtBasetime), m_pCurRateSegment -> dRate, DShowTimeToMilliseconds (rtRuntimeNow) ) ; } else { // list is sorted and first is not stale; list is current break ; } } ASSERT (!IsListEmpty (& m_leRateSegmentList)) ; ASSERT (m_pCurRateSegment) ; ASSERT (& m_pCurRateSegment -> ListEntry == m_leRateSegmentList.Flink) ; } void CVarSpeedTimeline::InsertNewSegment_ ( IN RATE_SEGMENT * pNewRateSegment ) { LIST_ENTRY * pCurListEntry ; RATE_SEGMENT * pPrevRateSegment ; // list might be empty when we enter here // start from the tail; sorted on runtimestart for (pCurListEntry = m_leRateSegmentList.Blink; pCurListEntry != & m_leRateSegmentList; pCurListEntry = pCurListEntry -> Blink) { pPrevRateSegment = RATE_SEGMENT::Recover (pCurListEntry) ; if (pPrevRateSegment -> rtRuntimeStart <= pNewRateSegment -> rtRuntimeStart) { // found our slot break ; } } // insert after InsertHeadList (pCurListEntry, & pNewRateSegment -> ListEntry) ; } void CVarSpeedTimeline::FixupSegmentQueue_ ( IN RATE_SEGMENT * pNewRateSegment ) { LIST_ENTRY * pCurListEntry ; RATE_SEGMENT * pPrevRateSegment ; RATE_SEGMENT * pCurRateSegment ; ASSERT (!IsListEmpty (& m_leRateSegmentList)) ; ASSERT (m_pCurRateSegment) ; ASSERT (& m_pCurRateSegment -> ListEntry == m_leRateSegmentList.Flink) ; pPrevRateSegment = m_pCurRateSegment ; // fixup list wrt previous for (pCurListEntry = m_pCurRateSegment -> ListEntry.Flink; pCurListEntry != & m_leRateSegmentList; pCurListEntry = pCurListEntry -> Flink) { pCurRateSegment = RATE_SEGMENT::Recover (pCurListEntry) ; pCurRateSegment -> rtBasetime = RATE_SEGMENT::StreamtimeBase (pPrevRateSegment, pCurRateSegment -> rtRuntimeStart) ; pPrevRateSegment = pCurRateSegment ; } } DWORD CVarSpeedTimeline::Start ( IN REFERENCE_TIME rtBasetime, IN REFERENCE_TIME rtRuntimeStart, IN double dRate ) { DWORD dw ; Stop () ; ASSERT (IsListEmpty (& m_leRateSegmentList)) ; ASSERT (!m_pCurRateSegment) ; m_pCurRateSegment = GetNewSegment_ () ; if (m_pCurRateSegment) { m_pCurRateSegment -> rtBasetime = rtBasetime ; m_pCurRateSegment -> rtRuntimeStart = rtRuntimeStart ; m_pCurRateSegment -> dRate = dRate ; InsertNewSegment_ (m_pCurRateSegment) ; ASSERT (!IsListEmpty (& m_leRateSegmentList)) ; // m_pCurRateSegment will have been inserted into front of // list; since it's the only segment in the list, there are // no others to fixup; we're done dw = NOERROR ; } else { dw = ERROR_NOT_ENOUGH_MEMORY ; } return dw ; } void CVarSpeedTimeline::Stop ( ) { Reset_ () ; } void CVarSpeedTimeline::SetBase ( IN REFERENCE_TIME rtBasetime, IN REFERENCE_TIME rtRuntimeNow, IN double dRate ) { if (m_pCurRateSegment) { UpdateQueue_ (rtRuntimeNow) ; ASSERT (m_pCurRateSegment) ; ASSERT (& m_pCurRateSegment -> ListEntry == m_leRateSegmentList.Flink) ; m_pCurRateSegment -> rtBasetime = rtBasetime ; m_pCurRateSegment -> rtRuntimeStart = rtRuntimeNow ; FixupSegmentQueue_ (m_pCurRateSegment) ; TRACE_4 (LOG_AREA_SEEKING_AND_TRICK, 1, TEXT ("CVarSpeedTimeline::SetBase () -- basetime = %I64d ms, runtime = %I64d ms, %2.1f, segment = %08xh"), ::DShowTimeToMilliseconds (m_pCurRateSegment -> rtBasetime), ::DShowTimeToMilliseconds (m_pCurRateSegment -> rtRuntimeStart), m_pCurRateSegment -> dRate, m_pCurRateSegment ) ; } else { // first Start (rtBasetime, rtRuntimeNow, dRate) ; } } REFERENCE_TIME CVarSpeedTimeline::Time ( IN REFERENCE_TIME rtRuntimeNow ) { REFERENCE_TIME rtTime ; if (m_pCurRateSegment) { // update while we're at it UpdateQueue_ (rtRuntimeNow) ; rtTime = m_pCurRateSegment -> rtBasetime + (REFERENCE_TIME) ((double) (rtRuntimeNow - m_pCurRateSegment -> rtRuntimeStart) * m_pCurRateSegment -> dRate) ; } else { // not yet started rtTime = 0 ; } // intra & same-stream jitter could underflow this right at start return Max <REFERENCE_TIME> (rtTime, 0) ; } DWORD CVarSpeedTimeline::QueueRateSegment ( IN double dRate, IN REFERENCE_TIME rtRuntimeStart ) { RATE_SEGMENT * pNewRateSegment ; DWORD dw ; if (m_pCurRateSegment) { if (m_pCurRateSegment -> rtRuntimeStart <= rtRuntimeStart) { pNewRateSegment = GetNewSegment_ () ; if (pNewRateSegment) { // initialize the fields we can pNewRateSegment -> dRate = dRate ; pNewRateSegment -> rtRuntimeStart = rtRuntimeStart ; // we know the time equals or follows the time of the cur // segment, so we can safely insert it into the queue InsertNewSegment_ (pNewRateSegment) ; FixupSegmentQueue_ (pNewRateSegment) ; // don't update the queue; runtimestart may well be in the // future vs. now TRACE_3 (LOG_AREA_SEEKING_AND_TRICK, 1, TEXT ("CVarSpeedTimeline::QueueRateSegment () -- runtime = = %I64d ms, %2.1f, segment = %08xh"), ::DShowTimeToMilliseconds (pNewRateSegment -> rtRuntimeStart), pNewRateSegment -> dRate, pNewRateSegment ) ; dw = NOERROR ; } else { dw = ERROR_NOT_ENOUGH_MEMORY ; } } else { // time has already passed dw = ERROR_GEN_FAILURE ; } } else { // no rate segment exists, which means dw = Start (0, rtRuntimeStart, dRate) ; } return dw ; } // ============================================================================ CSeekingTimeline::CSeekingTimeline ( ) : m_pIRefClock (NULL), m_pDVRSendStatsWriter (NULL) { InitializeCriticalSection (& m_crt) ; } CSeekingTimeline::~CSeekingTimeline ( ) { SetRefClock (NULL) ; DeleteCriticalSection (& m_crt) ; } void CSeekingTimeline::Pause ( ) { Lock_ () ; ASSERT (m_pIRefClock) ; m_RunTimeline.Pause (TimeNow_ ()) ; Unlock_ () ; TRACE_1 (LOG_AREA_SEEKING_AND_TRICK, 1, TEXT ("Paused %I64d ms"), DShowTimeToMilliseconds (TimeNow_ ())) ; } void CSeekingTimeline::Stop ( ) { Lock_ () ; m_RunTimeline.Stop () ; m_StreamTimeline.Stop () ; m_PlayTimeline.Stop () ; Unlock_ () ; } void CSeekingTimeline::Run ( IN REFERENCE_TIME rtStart, IN REFERENCE_TIME rtStreamStart, IN double dRate ) { BOOL fStartStream ; REFERENCE_TIME rtRunningTime ; Lock_ () ; ASSERT (m_pIRefClock) ; // only start the stream if we've never been run fStartStream = (m_RunTimeline.HasRun () ? FALSE : TRUE) ; m_RunTimeline.Run (rtStart) ; if (fStartStream) { rtRunningTime = m_RunTimeline.RunningTime (rtStart) ; // start the stream timeline m_StreamTimeline.Start ( rtStreamStart, // may have been seeked rtRunningTime, // get the running time dRate // start with this rate ) ; // start the play timeline m_PlayTimeline.Start ( 0, // always starts at 0 rtRunningTime, // get the running time Abs <double> (dRate) // always > 0 i.e PTS don't go backwards ) ; } Unlock_ () ; TRACE_1 (LOG_AREA_SEEKING_AND_TRICK, 1, TEXT ("Run %I64d ms"), DShowTimeToMilliseconds (rtStart)) ; } void CSeekingTimeline::SetStreamStart ( IN REFERENCE_TIME rtStreamStart, IN double dRate ) { REFERENCE_TIME rtNow ; Lock_ () ; rtNow = TimeNow_ () ; // only rebase the stream time; this is because of seeks m_StreamTimeline.SetBase (rtStreamStart, m_RunTimeline.RunningTime (rtNow), dRate) ; // playtime always advances from graph start.. alongside running time, but // scale for rates (+ only) Unlock_ () ; } HRESULT CSeekingTimeline::GetCurPlaytime ( OUT REFERENCE_TIME * prtPlaytime, OUT REFERENCE_TIME * prtNow ) { HRESULT hr ; REFERENCE_TIME rtRuntime ; ASSERT (prtPlaytime) ; Lock_ () ; hr = GetCurRuntime (& rtRuntime) ; if (SUCCEEDED (hr)) { (* prtPlaytime) = m_PlayTimeline.Time (rtRuntime) ; if (prtNow) { (* prtNow) = rtRuntime ; } } TRACE_2 (LOG_AREA_TIME, 8, TEXT ("playtime,runtime = ,%I64d,%I64d, ms"), DShowTimeToMilliseconds (* prtPlaytime), DShowTimeToMilliseconds (rtRuntime)) ; Unlock_ () ; return hr ; } HRESULT CSeekingTimeline::GetCurStreamTime ( OUT REFERENCE_TIME * prtStreamtime, OUT REFERENCE_TIME * prtNow ) { HRESULT hr ; REFERENCE_TIME rtRuntime ; ASSERT (prtStreamtime) ; Lock_ () ; hr = GetCurRuntime (& rtRuntime) ; if (SUCCEEDED (hr)) { (* prtStreamtime) = m_StreamTimeline.Time (rtRuntime) ; if (prtNow) { (* prtNow) = rtRuntime ; } } TRACE_3 (LOG_AREA_TIME, 8, TEXT ("streamtime,playtime,runtime = ,%I64d,%I64d,%I64d,"), DShowTimeToMilliseconds (* prtStreamtime), DShowTimeToMilliseconds (m_PlayTimeline.Time (rtRuntime)), DShowTimeToMilliseconds (rtRuntime)) ; Unlock_ () ; return hr ; } HRESULT CSeekingTimeline::GetCurRuntime ( IN REFERENCE_TIME * prt ) { REFERENCE_TIME rtNow ; ASSERT (prt) ; Lock_ () ; rtNow = TimeNow_ () ; (* prt) = m_RunTimeline.RunningTime (rtNow) ; Unlock_ () ; return S_OK ; } HRESULT CSeekingTimeline::SetCurTimelines ( IN OUT CTimelines * pTimelines ) { HRESULT hr ; REFERENCE_TIME rtRuntime ; pTimelines -> Reset () ; Lock_ () ; hr = GetCurRuntime (& rtRuntime) ; if (SUCCEEDED (hr)) { pTimelines -> put_Streamtime (m_StreamTimeline.Time (rtRuntime)) ; pTimelines -> put_Playtime (m_PlayTimeline.Time (rtRuntime)) ; pTimelines -> put_Runtime (rtRuntime) ; } Unlock_ () ; return hr ; } HRESULT CSeekingTimeline::SetCurStreamPosition ( IN REFERENCE_TIME rtStream ) { return E_NOTIMPL ; } HRESULT CSeekingTimeline::QueueRateChange ( IN double dRate, IN REFERENCE_TIME rtPTSEffective ) { DWORD dw ; Lock_ () ; dw = m_StreamTimeline.QueueRateSegment ( dRate, rtPTSEffective ) ; if (dw == NOERROR) { // playtime never runs backwards dw = m_PlayTimeline.QueueRateSegment ( Abs <double> (dRate), rtPTSEffective ) ; } TRACE_3 (LOG_AREA_SEEKING_AND_TRICK, 1, TEXT ("CSeekingTimeline::QueueRateChange (%2.1f, %I64d ms); dw = %08xh"), dRate, DShowTimeToMilliseconds (rtPTSEffective), dw) ; Unlock_ () ; return HRESULT_FROM_WIN32 (dw) ; } // ============================================================================ CDVRDShowSeekingCore::CDVRDShowSeekingCore ( IN CCritSec * pFilterLock, IN CBaseFilter * pHostingFilter ) : m_pDVRReadManager (NULL), m_guidTimeFormat (TIME_FORMAT_MEDIA_TIME), // this is it, always m_pFilterLock (pFilterLock), m_pHostingFilter (pHostingFilter), m_pDVRPolicy (NULL), m_pDVRSendStatsWriter (NULL) { ASSERT (m_pFilterLock) ; ASSERT (m_pHostingFilter) ; InitializeCriticalSection (& m_crtSeekingLock) ; } CDVRDShowSeekingCore::~CDVRDShowSeekingCore ( ) { RELEASE_AND_CLEAR (m_pDVRPolicy) ; DeleteCriticalSection (& m_crtSeekingLock) ; } void CDVRDShowSeekingCore::SetDVRPolicy ( IN CDVRPolicy * pDVRPolicy ) { RELEASE_AND_CLEAR (m_pDVRPolicy) ; m_pDVRPolicy = pDVRPolicy ; if (m_pDVRPolicy) { m_pDVRPolicy -> AddRef () ; } } BOOL CDVRDShowSeekingCore::IsSeekingPin (IN CDVROutputPin * pPin) { O_TRACE_ENTER_0 (TEXT("CDVRDShowSeekingCore::IsSeekingPin ()")) ; ASSERT (m_pDVRSourcePinManager) ; return m_pDVRSourcePinManager -> IsSeekingPin (pPin) ; } void CDVRDShowSeekingCore::SetCurTimelines ( IN OUT CTimelines * pTimelines ) { m_SeekingTimeline.SetCurTimelines (pTimelines) ; } HRESULT CDVRDShowSeekingCore::TimeToCurrentFormat_ ( IN REFERENCE_TIME rt, OUT LONGLONG * pll ) { ASSERT (pll) ; // only support time for now (* pll) = rt ; return S_OK ; } HRESULT CDVRDShowSeekingCore::CurrentFormatToTime_ ( IN LONGLONG ll, OUT REFERENCE_TIME * prt ) { ASSERT (prt) ; // only support time for now (* prt) = ll ; return S_OK ; } BOOL CDVRDShowSeekingCore::IsSeekingFormatSupported ( IN const GUID * pFormat ) /*++ Description: Called by the seeking pin in response to an IMediaSeeking format query. Parameters: pFormat The following are defined in MSDN: TIME_FORMAT_NONE TIME_FORMAT_FRAME TIME_FORMAT_SAMPLE TIME_FORMAT_FIELD TIME_FORMAT_BYTE TIME_FORMAT_MEDIA_TIME This list is not restrictive however. MSDN states that 3rd parties are encouraged to define their own GUIDs for seeking granularities. Return Values: TRUE format is supported FALSE format is not supported --*/ { BOOL r ; TRACE_ENTER_0 (TEXT ("CDVRDShowSeekingCore::IsSeekingFormatSupported ()")) ; // support only time if ((* pFormat) == TIME_FORMAT_MEDIA_TIME) { // time-based seeking is ok r = TRUE ; } else { // everything else is not ok r = FALSE ; } return r ; } HRESULT CDVRDShowSeekingCore::QueryPreferredSeekingFormat ( OUT GUID * pFormat ) { O_TRACE_ENTER_0 (TEXT("CDVRDShowSeekingCore::QueryPreferredSeekingFormat ()")) ; // caller should have screened for bad parameters ASSERT (pFormat) ; (* pFormat) == TIME_FORMAT_MEDIA_TIME ; return S_OK ; } HRESULT CDVRDShowSeekingCore::SetSeekingTimeFormat ( IN const GUID * pguidTimeFormat ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRDShowSeekingCore::SetSeekingTimeFormat ()")) ; FilterLock_ () ; ASSERT (pguidTimeFormat) ; if (m_pHostingFilter -> IsStopped ()) { if (IsSeekingFormatSupported (pguidTimeFormat)) { // looks ok; set it m_guidTimeFormat = (* pguidTimeFormat) ; hr = S_OK ; } else { // error: not supported hr = E_INVALIDARG ; } } else { // error: gotta be stopped hr = VFW_E_WRONG_STATE ; } FilterUnlock_ () ; return hr ; } HRESULT CDVRDShowSeekingCore::GetSeekingTimeFormat ( OUT GUID * pguidTimeFormat ) { O_TRACE_ENTER_0 (TEXT("CDVRDShowSeekingCore::GetSeekingTimeFormat ()")) ; ASSERT (pguidTimeFormat) ; (* pguidTimeFormat) = m_guidTimeFormat ; return S_OK ; } // BUGBUG: total file duration or start -> stop duration ????? HRESULT CDVRDShowSeekingCore::GetFileDuration ( OUT LONGLONG * pllDuration ) { HRESULT hr ; LONGLONG llStartContent ; LONGLONG llStopContent ; O_TRACE_ENTER_0 (TEXT("CDVRDShowSeekingCore::GetFileDuration ()")) ; ASSERT (pllDuration) ; hr = GetAvailableContent (& llStartContent, & llStopContent) ; if (SUCCEEDED (hr)) { ASSERT (llStopContent >= llStartContent) ; // can be equal (* pllDuration) = llStopContent - llStartContent ; } return hr ; } HRESULT CDVRDShowSeekingCore::GetAvailableContent ( OUT LONGLONG * pllStartContent, OUT LONGLONG * pllStopContent ) { HRESULT hr ; REFERENCE_TIME rtStart ; REFERENCE_TIME rtStop ; if (IsSeekable ()) { ASSERT (pllStartContent) ; ASSERT (pllStopContent) ; ASSERT (m_pDVRReadManager) ; hr = m_pDVRReadManager -> GetContentExtent ( & rtStart, & rtStop ) ; if (SUCCEEDED (hr)) { ASSERT (rtStart <= rtStop) ; // can be equal hr = TimeToCurrentFormat_ (rtStop, pllStopContent) ; if (SUCCEEDED (hr)) { hr = TimeToCurrentFormat_ (rtStart, pllStartContent) ; } } } else { hr = E_UNEXPECTED ; } return hr ; } HRESULT CDVRDShowSeekingCore::GetFileStopPosition ( OUT LONGLONG * pllStop ) { REFERENCE_TIME rtStop ; HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRDShowSeekingCore::GetFileStopPosition ()")) ; if (IsSeekable ()) { ASSERT (pllStop) ; ASSERT (m_pDVRReadManager) ; hr = m_pDVRReadManager -> GetCurrentStop (& rtStop) ; if (SUCCEEDED (hr)) { hr = TimeToCurrentFormat_ (rtStop, pllStop) ; } } else { hr = E_UNEXPECTED ; } return hr ; } HRESULT CDVRDShowSeekingCore::GetFileStartPosition ( OUT LONGLONG * pllStart ) { HRESULT hr ; REFERENCE_TIME rtStart ; O_TRACE_ENTER_0 (TEXT("CDVRDShowSeekingCore::GetFileStartPosition ()")) ; if (IsSeekable ()) { ASSERT (m_pDVRReadManager) ; ASSERT (pllStart) ; hr = m_pDVRReadManager -> GetCurrentStart (& rtStart) ; if (SUCCEEDED (hr)) { hr = TimeToCurrentFormat_ (rtStart, pllStart) ; } } else { hr = E_UNEXPECTED ; } return hr ; } HRESULT CDVRDShowSeekingCore::GetCurSegStart_ ( OUT REFERENCE_TIME * prtStart ) { HRESULT hr ; if (IsSeekable ()) { hr = m_pDVRReadManager -> GetCurrentStart (prtStart) ; } else { hr = E_UNEXPECTED ; } return hr ; } HRESULT CDVRDShowSeekingCore::SetStreamSegmentStart ( IN REFERENCE_TIME rtStart, IN double dCurRate ) { TRACE_1 (LOG_AREA_SEEKING_AND_TRICK, 1, TEXT ("PostSeekStreamTimeFixupLocked_ () : new stream time = %I64d ms"), DShowTimeToMilliseconds (rtStart)) ; m_SeekingTimeline.SetStreamStart (rtStart, dCurRate) ; return S_OK ; } HRESULT CDVRDShowSeekingCore::SeekTo ( IN LONGLONG * pllStart ) { HRESULT hr ; double dCurRate ; O_TRACE_ENTER_1 (TEXT("CDVRDShowSeekingCore::SeekTo (%I64d)"), (* pllStart)) ; hr = GetPlaybackRate (& dCurRate) ; if (SUCCEEDED (hr)) { hr = SeekTo (pllStart, NULL, dCurRate) ; } return hr ; } HRESULT CDVRDShowSeekingCore::SeekTo ( IN LONGLONG * pllStart, IN LONGLONG * pllStop, IN double dPlaybackRate ) { HRESULT hr ; REFERENCE_TIME rtStart ; REFERENCE_TIME rtStop ; BOOL fSeekIsNoop ; if (IsSeekable ()) { ASSERT (pllStart) ; // pllStop can be NULL hr = CurrentFormatToTime_ ((* pllStart), & rtStart) ; if (SUCCEEDED (hr)) { // if specified, convert if (pllStop) { hr = CurrentFormatToTime_ ((* pllStop), & rtStop) ; } // make the call if (SUCCEEDED (hr)) { // always return to 1.0 on seeks dPlaybackRate = _1X_PLAYBACK_RATE ; hr = m_pDVRReadManager -> SeekTo ( & rtStart, (pllStop ? & rtStop : NULL), dPlaybackRate, & fSeekIsNoop ) ; } } if (SUCCEEDED (hr) && !fSeekIsNoop) { hr = SetStreamSegmentStart (rtStart, dPlaybackRate) ; } } else { hr = E_UNEXPECTED ; } return hr ; } HRESULT CDVRDShowSeekingCore::SetFileStopPosition ( IN LONGLONG * pllStop ) { HRESULT hr ; REFERENCE_TIME rtStop ; if (IsSeekable ()) { hr = CurrentFormatToTime_ ((* pllStop), & rtStop) ; if (SUCCEEDED (hr)) { hr = m_pDVRReadManager -> SetStop (rtStop) ; } } else { hr = E_UNEXPECTED ; } return hr ; } HRESULT CDVRDShowSeekingCore::SetPlaybackRate ( IN double dPlaybackRate ) { HRESULT hr ; double dMaxReverseRate ; double dMaxForwardRate ; // make sure we support trick modes if (dPlaybackRate != 1.0 && !m_pDVRSourcePinManager -> SupportTrickMode ()) { TRACE_1 (LOG_ERROR,1, TEXT ("CDVRDShowSeekingCore::SetPlaybackRate () : don't support trick mode; %2.1f"), dPlaybackRate) ; hr = E_NOTIMPL ; return hr ; } if (::Abs <double> (dPlaybackRate) < TRICK_PLAY_LOWEST_RATE) { TRACE_2 (LOG_ERROR,1, TEXT ("CDVRDShowSeekingCore::SetPlaybackRate () : invalid trick mode rate requested; %2.1f vs. %2.1f"), dPlaybackRate, TRICK_PLAY_LOWEST_RATE) ; hr = E_INVALIDARG ; return hr ; } if (IsSeekable () && !m_pHostingFilter -> IsStopped ()) { // // the seeking lock is held across state transitions; we know we have // it right now, so we're ok - no state will change as long as we // hold the seeking lock // hr = GetPlayrateRange (& dMaxReverseRate, & dMaxForwardRate) ; if (SUCCEEDED (hr)) { if ((dPlaybackRate < 0 && Abs <double> (dPlaybackRate) > dMaxReverseRate) || (dPlaybackRate > 0 && dPlaybackRate > dMaxForwardRate) || dPlaybackRate == 0) { hr = E_INVALIDARG ; } if (SUCCEEDED (hr)) { TRACE_1 (LOG_AREA_SEEKING_AND_TRICK, 1, TEXT ("CDVRDShowSeekingCore::SetPlaybackRate () : requested %2.1f"), dPlaybackRate) ; Lock () ; hr = m_pDVRReadManager -> SetPlaybackRate (dPlaybackRate) ; Unlock () ; } } } else { hr = E_UNEXPECTED ; } return hr ; } HRESULT CDVRDShowSeekingCore::GetPlaybackRate ( OUT double * pdPlaybackRate ) { HRESULT hr ; if (IsSeekable ()) { ASSERT (pdPlaybackRate) ; (* pdPlaybackRate) = m_pDVRReadManager -> GetPlaybackRate () ; hr = S_OK ; } else { hr = E_UNEXPECTED ; } return hr ; } HRESULT CDVRDShowSeekingCore::GetPlayrateRange ( OUT double * pdMaxReverseRate, OUT double * pdMaxForwardRate ) { HRESULT hr ; if (IsSeekable ()) { ASSERT (pdMaxReverseRate) ; ASSERT (pdMaxForwardRate) ; m_pDVRReadManager -> GetPlayrateRange (pdMaxReverseRate, pdMaxForwardRate) ; hr = S_OK ; } else { hr = E_UNEXPECTED ; } return hr ; } void CDVRDShowSeekingCore::OnFilterStateChange ( IN FILTER_STATE TargetState, IN REFERENCE_TIME rtRunStart ) { REFERENCE_TIME rtStreamStart ; HRESULT hr ; switch (TargetState) { case State_Stopped : m_SeekingTimeline.Stop () ; break ; case State_Paused : m_SeekingTimeline.Pause () ; break ; case State_Running : hr = GetCurSegStart_ (& rtStreamStart) ; if (SUCCEEDED (hr)) { m_SeekingTimeline.Run (rtRunStart, rtStreamStart) ; } break ; } ; } HRESULT CDVRDShowSeekingCore::GetStreamTime ( OUT LONGLONG * pllCurPos ) { REFERENCE_TIME rtStreamNow ; HRESULT hr ; double dRate ; REFERENCE_TIME rtContentStart ; REFERENCE_TIME rtContentStop ; hr = GetStreamTimeDShow (& rtStreamNow) ; if (SUCCEEDED (hr)) { // if we're running, make sure we're within bounds if (m_pDVRReadManager) { dRate = m_pDVRReadManager -> GetPlaybackRate () ; // for trick mode play, it's possible that a correction has not yet // kicked in, in which case we might momentarily overrun the actual // content; check for this condition now if (dRate > _1X_PLAYBACK_RATE) { // check for overrun hr = m_pDVRReadManager -> GetContentExtent (& rtContentStart, & rtContentStop) ; if (SUCCEEDED (hr)) { // set to min of current content END rtStreamNow = Min <REFERENCE_TIME> (rtStreamNow, rtContentStop) ; } else { goto cleanup ; } } else if (dRate < _1X_PLAYBACK_RATE) { // check for "underrun" - we're too slow, or running backwards, // and we start reporting that we're in no man's land hr = m_pDVRReadManager -> GetContentExtent (& rtContentStart, & rtContentStop) ; if (SUCCEEDED (hr)) { // set to max of current content START rtStreamNow = Max <REFERENCE_TIME> (rtStreamNow, rtContentStart) ; } else { goto cleanup ; } } } hr = TimeToCurrentFormat_ (rtStreamNow, pllCurPos) ; } cleanup : return hr ; } HRESULT CDVRDShowSeekingCore::GetStreamTimeDShow ( OUT REFERENCE_TIME * prtStream ) { HRESULT hr ; hr = m_SeekingTimeline.GetCurStreamTime (prtStream) ; return hr ; } HRESULT CDVRDShowSeekingCore::GetRuntimeDShow ( OUT REFERENCE_TIME * prtRuntime ) { HRESULT hr ; hr = m_SeekingTimeline.GetCurRuntime (prtRuntime) ; return hr ; } HRESULT CDVRDShowSeekingCore::GetCurPlaytime ( OUT REFERENCE_TIME * prtPlaytime, OUT REFERENCE_TIME * prtCurRuntime ) { HRESULT hr ; hr = m_SeekingTimeline.GetCurPlaytime (prtPlaytime, prtCurRuntime) ; return hr ; } HRESULT CDVRDShowSeekingCore::GetRunTime ( OUT LONGLONG * pllRunTime ) { REFERENCE_TIME rtRuntime ; HRESULT hr ; hr = GetRuntimeDShow (& rtRuntime) ; if (SUCCEEDED (hr)) { hr = TimeToCurrentFormat_ (rtRuntime, pllRunTime) ; } return hr ; } HRESULT CDVRDShowSeekingCore::ReaderThreadSetPlaybackRate ( IN double dPlayrate ) { HRESULT hr ; // if we try to grab the seeking lock in the process, we can deadlock: // we wait on the seeking lock & a control thread with the seeking lock // synchronously waits for us to pause don't grab the lock ASSERT (m_pDVRReadManager) ; hr = m_pDVRReadManager -> ConfigureForRate (dPlayrate) ; return hr ; } HRESULT CDVRDShowSeekingCore::ReaderThreadGetSegmentValues ( OUT REFERENCE_TIME * prtSegmentStart, OUT REFERENCE_TIME * prtSegmentStop, OUT double * pdSegmentRate ) { HRESULT hr ; ASSERT (prtSegmentStart) ; ASSERT (prtSegmentStop) ; ASSERT (pdSegmentRate) ; // don't grab the media seeking lock; downstream threads call into object // to perform seeking operations; if the bracket (start -> stop) changes, // the locking order is such that the seeking lock is grabbed, and the // receiver thread is signaled SYNCHRONOUSLY to pause, the playback // bracket is reset, the receiver thread resumed, and the seeking // lock released; if we (receiver thread) grab the seeking lock, or // rather, block on the seeking lock, with a seeking thread waiting on // us to pause, we get a deadlock; so we don't grab the lock; return // values are valid because they won't be reset unless receiver thread // is paused. ASSERT (m_pDVRReadManager) ; // start - in the current units hr = m_pDVRReadManager -> GetCurrentStart (prtSegmentStart) ; if (FAILED (hr)) { goto cleanup ; } // stop - in the current units hr = m_pDVRReadManager -> GetCurrentStop (prtSegmentStop) ; if (FAILED (hr)) { goto cleanup ; } hr = GetPlaybackRate (pdSegmentRate) ; if (FAILED (hr)) { goto cleanup ; } cleanup : return hr ; } // ============================================================================ // ============================================================================ // ============================================================================ CDVRIMediaSeeking::CDVRIMediaSeeking ( IN IUnknown * punkOwning, IN CDVRDShowSeekingCore * pSeekingCore ) : m_punkOwning (punkOwning), m_guidSeekingFormat (GUID_NULL), m_pSeekingCore (pSeekingCore) { TRACE_CONSTRUCTOR (TEXT ("CDVRIMediaSeeking")) ; ASSERT (m_punkOwning) ; ASSERT (m_pSeekingCore) ; } CDVRIMediaSeeking::~CDVRIMediaSeeking ( ) { TRACE_DESTRUCTOR (TEXT ("CDVRIMediaSeeking")) ; } // ---------------------------------------------------------------------------- // IUnknown interface methods - delegate always STDMETHODIMP CDVRIMediaSeeking::QueryInterface ( REFIID riid, void ** ppv ) { return m_punkOwning -> QueryInterface (riid, ppv) ; } STDMETHODIMP_ (ULONG) CDVRIMediaSeeking::AddRef ( ) { return m_punkOwning -> AddRef () ; } STDMETHODIMP_ (ULONG) CDVRIMediaSeeking::Release ( ) { return m_punkOwning -> Release () ; } // ---------------------------------------------------------------------------- HRESULT CDVRIMediaSeeking::GetPlayrateRange ( OUT double * pdMaxReverseRate, OUT double * pdMaxForwardRate ) { HRESULT hr ; if (!pdMaxReverseRate || !pdMaxForwardRate) { return E_POINTER ; } hr = m_pSeekingCore -> GetPlayrateRange (pdMaxReverseRate, pdMaxForwardRate) ; return hr ; } HRESULT CDVRIMediaSeeking::SetPlayrate ( IN double dRate ) { HRESULT hr ; double dMaxReverseRate ; double dMaxForwardRate ; O_TRACE_ENTER_1 (TEXT("CDVRIMediaSeeking::SetPlaybackRate (%2.1f)"), dRate) ; SeekingLock_ () ; // call validates the parameter hr = SetRate (dRate) ; SeekingUnlock_ () ; TRACE_2 (LOG_AREA_SEEKING_AND_TRICK, 1, TEXT ("CDVRIMediaSeeking::SetPlayrate () : got %2.1f; returning %08xh"), dRate, hr) ; return hr ; } HRESULT CDVRIMediaSeeking::GetPlayrate ( OUT double * pdRate ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::GetPlayrate ()")) ; SeekingLock_ () ; // call validates the parameters hr = GetRate (pdRate) ; SeekingUnlock_ () ; return hr ; } // ---------------------------------------------------------------------------- // IMediaSeeking interface methods // Returns the capability flags; S_OK if successful STDMETHODIMP CDVRIMediaSeeking::GetCapabilities ( OUT DWORD * pCapabilities ) { O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::GetCapabilities ()")) ; if (!pCapabilities) { return E_POINTER ; } return m_pSeekingCore -> GetSeekingCapabilities ( pCapabilities ) ; } // And's the capabilities flag with the capabilities requested. // Returns S_OK if all are present, S_FALSE if some are present, // E_FAIL if none. // * pCababilities is always updated with the result of the // 'and'ing and can be checked in the case of an S_FALSE return // code. STDMETHODIMP CDVRIMediaSeeking::CheckCapabilities ( IN OUT DWORD * pCapabilities ) { HRESULT hr ; DWORD dwCapabilities ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::CheckCapabilities ()")) ; if (!pCapabilities) { return E_POINTER ; } hr = GetCapabilities (& dwCapabilities) ; if (SUCCEEDED(hr)) { dwCapabilities &= (* pCapabilities) ; hr = dwCapabilities ? ( dwCapabilities == (* pCapabilities) ? S_OK : S_FALSE ) : E_FAIL ; (* pCapabilities) = dwCapabilities ; } else { (* pCapabilities) = 0 ; } return hr; } // returns S_OK if mode is supported, S_FALSE otherwise STDMETHODIMP CDVRIMediaSeeking::IsFormatSupported ( IN const GUID * pFormat ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::IsFormatSupported ()")) ; if (!pFormat) { return E_POINTER ; } if (m_pSeekingCore -> IsSeekingFormatSupported (pFormat)) { hr = S_OK ; } else { hr = S_FALSE ; } return hr ; } // S_OK if successful // E_NOTIMPL, E_POINTER if unsuccessful STDMETHODIMP CDVRIMediaSeeking::QueryPreferredFormat ( OUT GUID * pFormat ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::QueryPreferredFormat ()")) ; if (!pFormat) { return E_POINTER ; } // comment copied .. :-) /* Don't care - they're all just as bad as one another */ hr = m_pSeekingCore -> QueryPreferredSeekingFormat (pFormat) ; return hr ; } // S_OK if successful STDMETHODIMP CDVRIMediaSeeking::GetTimeFormat ( OUT GUID * pFormat ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::GetTimeFormat ()")) ; if (!pFormat) { return E_POINTER ; } hr = m_pSeekingCore -> GetSeekingTimeFormat (pFormat) ; return hr ; } // Returns S_OK if *pFormat is the current time format, otherwise // S_FALSE // This may be used instead of the above and will save the copying // of the GUID STDMETHODIMP CDVRIMediaSeeking::IsUsingTimeFormat ( IN const GUID * pFormat ) { HRESULT hr ; GUID guidFormat ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::IsUsingTimeFormat ()")) ; if (!pFormat) { return E_POINTER ; } hr = m_pSeekingCore -> GetSeekingTimeFormat (& guidFormat) ; if (SUCCEEDED (hr)) { hr = (guidFormat == (* pFormat) ? S_OK : S_FALSE) ; } return hr ; } // (may return VFE_E_WRONG_STATE if graph is stopped) STDMETHODIMP CDVRIMediaSeeking::SetTimeFormat ( IN const GUID * pFormat ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::SetTimeFormat ()")) ; if (!pFormat) { return E_POINTER ; } hr = m_pSeekingCore -> SetSeekingTimeFormat (pFormat) ; return hr ; } // return current properties STDMETHODIMP CDVRIMediaSeeking::GetDuration ( OUT LONGLONG * pDuration ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::GetDuration ()")) ; if (!pDuration) { return E_POINTER ; } SeekingLock_ () ; hr = m_pSeekingCore -> GetFileDuration (pDuration) ; SeekingUnlock_ () ; return hr ; } STDMETHODIMP CDVRIMediaSeeking::GetStopPosition ( OUT LONGLONG * pStop ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::GetStopPosition ()")) ; if (!pStop) { return E_POINTER ; } SeekingLock_ () ; hr = m_pSeekingCore -> GetFileStopPosition (pStop) ; SeekingUnlock_ () ; return hr ; } STDMETHODIMP CDVRIMediaSeeking::GetCurrentPosition ( OUT LONGLONG * pCur ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::GetCurrentPosition ()")) ; if (!pCur) { return E_POINTER ; } SeekingLock_ () ; hr = m_pSeekingCore -> GetStreamTime (pCur) ; SeekingUnlock_ () ; return hr ; } // Convert time from one format to another. // We must be able to convert between all of the formats that we // say we support. (However, we can use intermediate formats // (e.g. MEDIA_TIME).) // If a pointer to a format is null, it implies the currently selected format. STDMETHODIMP CDVRIMediaSeeking::ConvertTimeFormat( OUT LONGLONG * pTarget, IN const GUID * pTargetFormat, IN LONGLONG Source, IN const GUID * pSourceFormat ) { O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::ConvertTimeFormat ()")) ; return E_NOTIMPL ; } // Set Start and end positions in one operation // Either pointer may be null, implying no change STDMETHODIMP CDVRIMediaSeeking::SetPositions ( IN OUT LONGLONG * pStart, IN DWORD dwStartFlags, IN OUT LONGLONG * pStop, IN DWORD dwStopFlags ) { HRESULT hr ; LONGLONG llStart ; LONGLONG llStop ; DWORD dwPosStartBits ; DWORD dwPosStopBits ; BOOL r ; double dCurRate ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::SetPositions ()")) ; SeekingLock_ () ; // ------------------------------------------------------------------------ // obtain some preliminary values we'll use during the course of this // call // the stop position hr = GetStopPosition (& llStop) ; if (FAILED (hr)) { goto cleanup ; } // the Start position as well hr = SeekingCore_ () -> GetFileStartPosition (& llStart) ; if (FAILED (hr)) { goto cleanup ; } // ------------------------------------------------------------------------ // process "Start" dwPosStartBits = dwStartFlags & AM_SEEKING_PositioningBitsMask ; // validate the pointer if (dwPosStartBits != AM_SEEKING_NoPositioning && !pStart) { hr = E_POINTER ; goto cleanup ; } switch (dwPosStartBits) { case AM_SEEKING_NoPositioning : hr = S_OK ; break ; case AM_SEEKING_AbsolutePositioning : // make sure it doesn't exceed the duration llStart = (* pStart) ; hr = S_OK ; break ; case AM_SEEKING_RelativePositioning : // pStart is relative to Start position llStart += (* pStart) ; hr = S_OK ; break ; case AM_SEEKING_IncrementalPositioning : // flag only applies to stop position; fall through default : hr = E_INVALIDARG ; break ; } ; if (FAILED (hr)) { goto cleanup ; } // ------------------------------------------------------------------------ // process "stop" dwPosStopBits = dwStopFlags & AM_SEEKING_PositioningBitsMask ; // validate the pointer if (dwPosStopBits != AM_SEEKING_NoPositioning && !pStop) { hr = E_POINTER ; goto cleanup ; } switch (dwPosStopBits) { case AM_SEEKING_NoPositioning : if (dwPosStartBits != AM_SEEKING_NoPositioning) { hr = S_OK ; } else { // huh ? not sure what the purpose of this call is.. nothing // is valid hr = E_INVALIDARG ; } break ; case AM_SEEKING_AbsolutePositioning : // since we can be dynamic, stop can exceed the current duration hr = S_OK ; break ; case AM_SEEKING_RelativePositioning : // pStop is relative to Startly used stop position llStop += (* pStop) ; hr = S_OK ; break ; case AM_SEEKING_IncrementalPositioning : // stop is relative to pStart if (dwPosStartBits != AM_SEEKING_NoPositioning && pStart) { llStop = (* pStart) + (* pStop) ; hr = S_OK ; } else { hr = E_INVALIDARG ; } break ; default : hr = E_INVALIDARG ; break ; } ; if (FAILED (hr)) { goto cleanup ; } // ------------------------------------------------------------------------ // ok, llStart and llStop now are offsets that bracket our desired // playback // make sure llStart and llStop make sense r = (dwPosStartBits != AM_SEEKING_NoPositioning) && (llStart < 0 || (dwPosStopBits != AM_SEEKING_NoPositioning) && llStart > llStop) ; if (!r) { if (dwPosStartBits != AM_SEEKING_NoPositioning) { // we have a Start value; may or may not have a stop value if (dwPosStopBits == AM_SEEKING_NoPositioning) { // not stop value; seek just to Start TRACE_2 (LOG_AREA_SEEKING_AND_TRICK, 1, TEXT ("IMediaSeeking::SetPosition(); llStart = %I64d (%d sec)"), llStart, DShowTimeToSeconds (llStart)) ; hr = m_pSeekingCore -> SeekTo (& llStart) ; } else { // stop value is present; seek to a Start and specify a stop TRACE_4 (LOG_AREA_SEEKING_AND_TRICK, 1, TEXT ("IMediaSeeking::SetPosition(); llStart = %I64d (%d sec); llStop = %I64d (%d sec)"), llStart, DShowTimeToSeconds (llStart), llStop, DShowTimeToSeconds (llStop)) ; hr = GetRate (& dCurRate) ; if (SUCCEEDED (hr)) { hr = m_pSeekingCore -> SeekTo (& llStart, & llStop, dCurRate) ; } } } else { // set only the end point hr = m_pSeekingCore -> SetFileStopPosition (& llStop) ; } } else { // specified parameters that don't make sense hr = E_INVALIDARG ; } // ------------------------------------------------------------------------ // set outgoing, if desired // if (SUCCEEDED (hr) && (dwStartFlags & AM_SEEKING_ReturnTime)) { ASSERT (pStart) ; hr = GetCurrentPosition (pStart) ; TRACE_2 (LOG_AREA_SEEKING_AND_TRICK, 1, TEXT ("IMediaSeeking::SetPosition(); returning llStart = %I64d (%d sec)"), (* pStart), DShowTimeToSeconds (* pStart)) ; } if (SUCCEEDED (hr) && (dwStopFlags & AM_SEEKING_ReturnTime)) { ASSERT (pStop) ; hr = GetStopPosition (pStop) ; TRACE_2 (LOG_AREA_SEEKING_AND_TRICK, 1, TEXT ("IMediaSeeking::SetPosition(); returning llStop = %I64d (%d sec)"), (* pStop), DShowTimeToSeconds (* pStop)) ; } cleanup : SeekingUnlock_ () ; return hr ; } // Get StartPosition & StopTime // Either pointer may be null, implying not interested STDMETHODIMP CDVRIMediaSeeking::GetPositions ( OUT LONGLONG * pStart, OUT LONGLONG * pStop ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::GetPositions ()")) ; hr = S_OK ; SeekingLock_ () ; if (pStart) { hr = GetCurrentPosition (pStart) ; } if (pStop && SUCCEEDED (hr)) { hr = GetStopPosition (pStop) ; } SeekingUnlock_ () ; return hr ; } // Get earliest / latest times to which we can currently seek // "efficiently". This method is intended to help with graphs // where the source filter has a very high latency. Seeking // within the returned limits should just result in a re-pushing // of already cached data. Seeking beyond these limits may result // in extended delays while the data is fetched (e.g. across a // slow network). // (NULL pointer is OK, means caller isn't interested.) STDMETHODIMP CDVRIMediaSeeking::GetAvailable ( OUT LONGLONG * pEarliest, OUT LONGLONG * pLatest ) { HRESULT hr ; LONGLONG llContentStart ; LONGLONG llContentStop ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::GetAvailable ()")) ; hr = S_OK ; SeekingLock_ () ; hr = m_pSeekingCore -> GetAvailableContent (& llContentStart, & llContentStop) ; if (SUCCEEDED (hr)) { if (pEarliest) { (* pEarliest) = llContentStart ; } if (pLatest) { (* pLatest) = llContentStop ; } } SeekingUnlock_ () ; return hr ; } // Rate stuff STDMETHODIMP CDVRIMediaSeeking::SetRate ( IN double dRate ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::SetRate ()")) ; if (dRate == 0.0) { return E_INVALIDARG ; } SeekingLock_ () ; hr = m_pSeekingCore -> SetPlaybackRate (dRate) ; SeekingUnlock_ () ; return hr ; } STDMETHODIMP CDVRIMediaSeeking::GetRate ( OUT double * pdRate ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::GetRate ()")) ; if (!pdRate) { return E_POINTER ; } SeekingLock_ () ; hr = m_pSeekingCore -> GetPlaybackRate (pdRate) ; SeekingUnlock_ () ; return hr ; } // Preroll STDMETHODIMP CDVRIMediaSeeking::GetPreroll ( OUT LONGLONG * pllPreroll ) { O_TRACE_ENTER_0 (TEXT("CDVRIMediaSeeking::GetPreroll ()")) ; if (!pllPreroll) { return E_POINTER ; } return E_NOTIMPL ; } // ============================================================================ // ============================================================================ // ============================================================================ CDVRPinIMediaSeeking::CDVRPinIMediaSeeking ( IN CDVROutputPin * pOutputPin, IN CDVRDShowSeekingCore * pSeekingCore ) : CDVRIMediaSeeking (pOutputPin -> GetOwner (), pSeekingCore), m_pOutputPin (pOutputPin) { TRACE_CONSTRUCTOR (TEXT ("CDVRPinIMediaSeeking")) ; ASSERT (m_pOutputPin) ; } CDVRPinIMediaSeeking::~CDVRPinIMediaSeeking ( ) { TRACE_DESTRUCTOR (TEXT ("CDVRPinIMediaSeeking")) ; } // ---------------------------------------------------------------------------- // IMediaSeeking interface methods // returns S_OK if mode is supported, S_FALSE otherwise STDMETHODIMP CDVRPinIMediaSeeking::IsFormatSupported ( IN const GUID * pFormat ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRPinIMediaSeeking::IsFormatSupported ()")) ; if (!pFormat) { return E_POINTER ; } // // Designated seeking pin will be video, but we have 1 pin that is the // designated seeking pin; all others don't do much // // However, we need to support TIME_FORMAT_MEDIA_TIME or the graph // code gets confused and starts using IMediaPosition if (SeekingCore_ () -> IsSeekingPin (m_pOutputPin)) { hr = CDVRIMediaSeeking::IsFormatSupported (pFormat) ; } else { hr = (pFormat == NULL || (* pFormat) == TIME_FORMAT_MEDIA_TIME ? S_OK : S_FALSE) ; } return hr ; } // S_OK if successful // E_NOTIMPL, E_POINTER if unsuccessful STDMETHODIMP CDVRPinIMediaSeeking::QueryPreferredFormat ( OUT GUID * pFormat ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRPinIMediaSeeking::QueryPreferredFormat ()")) ; if (!pFormat) { return E_POINTER ; } // comment copied .. :-) /* Don't care - they're all just as bad as one another */ if (SeekingCore_ () -> IsSeekingPin (m_pOutputPin)) { hr = CDVRIMediaSeeking::QueryPreferredFormat (pFormat) ; } else { // not the seeking pin, then we don't support anything (* pFormat) = TIME_FORMAT_NONE ; hr = S_OK ; } return hr ; } // S_OK if successful STDMETHODIMP CDVRPinIMediaSeeking::GetTimeFormat ( OUT GUID * pFormat ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRPinIMediaSeeking::GetTimeFormat ()")) ; if (!pFormat) { return E_POINTER ; } if (SeekingCore_ () -> IsSeekingPin (m_pOutputPin)) { hr = CDVRIMediaSeeking::GetTimeFormat (pFormat) ; } else { (* pFormat) = TIME_FORMAT_NONE ; hr = S_OK ; } return hr ; } // Returns S_OK if *pFormat is the current time format, otherwise // S_FALSE // This may be used instead of the above and will save the copying // of the GUID STDMETHODIMP CDVRPinIMediaSeeking::IsUsingTimeFormat ( IN const GUID * pFormat ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRPinIMediaSeeking::IsUsingTimeFormat ()")) ; if (!pFormat) { return E_POINTER ; } if (SeekingCore_ () -> IsSeekingPin (m_pOutputPin)) { hr = CDVRIMediaSeeking::IsUsingTimeFormat (pFormat) ; } else { hr = (TIME_FORMAT_NONE == (* pFormat) ? S_OK : S_FALSE) ; } return hr ; } // (may return VFE_E_WRONG_STATE if graph is stopped) STDMETHODIMP CDVRPinIMediaSeeking::SetTimeFormat ( IN const GUID * pFormat ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRPinIMediaSeeking::SetTimeFormat ()")) ; if (!pFormat) { return E_POINTER ; } // first make sure we're the seeking pin if (SeekingCore_ () -> IsSeekingPin (m_pOutputPin)) { hr = CDVRIMediaSeeking::SetTimeFormat (pFormat) ; } else { // ya sure.. no one cares what this is hr = ((* pFormat) == TIME_FORMAT_NONE ? S_OK : E_FAIL) ; } return hr ; } STDMETHODIMP CDVRPinIMediaSeeking::GetCurrentPosition ( OUT LONGLONG * pStart ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRPinIMediaSeeking::GetCurrentPosition ()")) ; if (!pStart) { return E_POINTER ; } // // existing implementations (e.g. mpeg-1 splitter) interpret this call // as the start position // SeekingLock_ () ; hr = SeekingCore_ () -> GetFileStartPosition (pStart) ; SeekingUnlock_ () ; return hr ; } // Set Start and end positions in one operation // Either pointer may be null, implying no change STDMETHODIMP CDVRPinIMediaSeeking::SetPositions ( IN OUT LONGLONG * pStart, IN DWORD dwStartFlags, IN OUT LONGLONG * pStop, IN DWORD dwStopFlags ) { HRESULT hr ; O_TRACE_ENTER_0 (TEXT("CDVRPinIMediaSeeking::SetPositions ()")) ; // must be the seeking pin if (!SeekingCore_ () -> IsSeekingPin (m_pOutputPin)) { return E_UNEXPECTED ; } hr = CDVRIMediaSeeking::SetPositions ( pStart, dwStartFlags, pStop, dwStopFlags ) ; return hr ; } STDMETHODIMP CDVRPinIMediaSeeking::SetRate ( IN double dRate ) { HRESULT hr ; double dCurRate ; // cannot set the rate on this interface hr = GetRate (& dCurRate) ; if (SUCCEEDED (hr)) { hr = (dCurRate == dRate ? S_OK : E_NOTIMPL) ; } return hr ; }
e0ecbaf16d51be35b58051d37b63d3d4d73f301a
190cfe853208fa287aa2539f1dd4e729f5235091
/Examination/EMStatisticsMajorDiseasesReport.cpp
65b929a15c7ff800a753deb42cd69b71d3c879e5
[]
no_license
smithgold53/HMSReportForms
d8cacb7de1509995b46be16bc5a99ca9104dbea1
7f426de1a3f8b7bad956c62ba61306a3969accf2
refs/heads/master
2020-05-18T09:24:39.420731
2015-05-06T09:47:03
2015-05-06T09:47:03
34,946,969
0
0
null
null
null
null
UTF-8
C++
false
false
22,866
cpp
#include "stdafx.h" #include "EMStatisticsMajorDiseasesReport.h" #include "HMSMainFrame.h" #include "ReportDocument.h" #include "Excel.h" /*static void _OnYearChangeFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnYearChange(); } */ /*static void _OnYearSetfocusFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnYearSetfocus();} */ /*static void _OnYearKillfocusFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnYearKillfocus(); } */ static int _OnYearCheckValueFnc(CWnd *pWnd){ return ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnYearCheckValue(); } static void _OnReportPeriodSelectChangeFnc(CWnd *pWnd, int nOldItemSel, int nNewItemSel){ ((CEMStatisticsMajorDiseasesReport* )pWnd)->OnReportPeriodSelectChange(nOldItemSel, nNewItemSel); } static void _OnReportPeriodSelendokFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnReportPeriodSelendok(); } /*static void _OnReportPeriodSetfocusFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnReportPeriodKillfocus(); }*/ /*static void _OnReportPeriodKillfocusFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnReportPeriodKillfocus(); }*/ static long _OnReportPeriodLoadDataFnc(CWnd *pWnd){ return ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnReportPeriodLoadData(); } /*static void _OnReportPeriodAddNewFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnReportPeriodAddNew(); }*/ /*static void _OnFromDateChangeFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnFromDateChange(); } */ /*static void _OnFromDateSetfocusFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnFromDateSetfocus();} */ /*static void _OnFromDateKillfocusFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnFromDateKillfocus(); } */ static int _OnFromDateCheckValueFnc(CWnd *pWnd){ return ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnFromDateCheckValue(); } /*static void _OnToDateChangeFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnToDateChange(); } */ /*static void _OnToDateSetfocusFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnToDateSetfocus();} */ /*static void _OnToDateKillfocusFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnToDateKillfocus(); } */ static int _OnToDateCheckValueFnc(CWnd *pWnd){ return ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnToDateCheckValue(); } static void _OnExamRoomSelectChangeFnc(CWnd *pWnd, int nOldItemSel, int nNewItemSel){ ((CEMStatisticsMajorDiseasesReport* )pWnd)->OnExamRoomSelectChange(nOldItemSel, nNewItemSel); } static void _OnExamRoomSelendokFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnExamRoomSelendok(); } /*static void _OnExamRoomSetfocusFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnExamRoomKillfocus(); }*/ /*static void _OnExamRoomKillfocusFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnExamRoomKillfocus(); }*/ static long _OnExamRoomLoadDataFnc(CWnd *pWnd){ return ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnExamRoomLoadData(); } /*static void _OnExamRoomAddNewFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport *)pWnd)->OnExamRoomAddNew(); }*/ static void _OnPrintPreviewSelectFnc(CWnd *pWnd){ CEMStatisticsMajorDiseasesReport *pVw = (CEMStatisticsMajorDiseasesReport *)pWnd; pVw->OnPrintPreviewSelect(); } static void _OnExportSelectFnc(CWnd *pWnd){ CEMStatisticsMajorDiseasesReport *pVw = (CEMStatisticsMajorDiseasesReport *)pWnd; pVw->OnExportSelect(); } static void _OnCloseSelectFnc(CWnd *pWnd){ CEMStatisticsMajorDiseasesReport *pVw = (CEMStatisticsMajorDiseasesReport *)pWnd; pVw->OnCloseSelect(); } static void _OnSelectAllDiseasesSelectFnc(CWnd *pWnd){ ((CEMStatisticsMajorDiseasesReport*)pWnd)->OnSelectAllDiseasesSelect(); } static int _OnAddEMStatisticsMajorDiseasesReportFnc(CWnd *pWnd){ return ((CEMStatisticsMajorDiseasesReport*)pWnd)->OnAddEMStatisticsMajorDiseasesReport(); } static int _OnEditEMStatisticsMajorDiseasesReportFnc(CWnd *pWnd){ return ((CEMStatisticsMajorDiseasesReport*)pWnd)->OnEditEMStatisticsMajorDiseasesReport(); } static int _OnDeleteEMStatisticsMajorDiseasesReportFnc(CWnd *pWnd){ return ((CEMStatisticsMajorDiseasesReport*)pWnd)->OnDeleteEMStatisticsMajorDiseasesReport(); } static int _OnSaveEMStatisticsMajorDiseasesReportFnc(CWnd *pWnd){ return ((CEMStatisticsMajorDiseasesReport*)pWnd)->OnSaveEMStatisticsMajorDiseasesReport(); } static int _OnCancelEMStatisticsMajorDiseasesReportFnc(CWnd *pWnd){ return ((CEMStatisticsMajorDiseasesReport*)pWnd)->OnCancelEMStatisticsMajorDiseasesReport(); } CEMStatisticsMajorDiseasesReport::CEMStatisticsMajorDiseasesReport(CWnd *pParent) { m_nDlgWidth = 440; m_nDlgHeight = 190; m_szTitle = _T("Diseases Suffered Report"); SetDefaultValues(); } CEMStatisticsMajorDiseasesReport::~CEMStatisticsMajorDiseasesReport() { } void CEMStatisticsMajorDiseasesReport::OnCreateComponents() { m_wndReportCondition.Create(this, _T("Report Condition"), 5, 5, 430, 150); m_wndYearLabel.Create(this, _T("Year"), 10, 30, 90, 55); m_wndYear.Create(this,95, 30, 215, 55); m_wndReportPeriodLabel.Create(this, _T("Report Period"), 220, 30, 300, 55); m_wndReportPeriod.Create(this,305, 30, 425, 55); m_wndFromDateLabel.Create(this, _T("From Date"), 10, 60, 90, 85); m_wndFromDate.Create(this,95, 60, 215, 85); m_wndToDateLabel.Create(this, _T("To Date"), 220, 60, 300, 85); m_wndToDate.Create(this,305, 60, 425, 85); m_wndExamRoomLabel.Create(this, _T("Exam Room"), 10, 90, 90, 115); m_wndExamRoom.Create(this,95, 90, 425, 115); m_wndSelectAllDiseases.Create(this, _T("Select All Diseases"), 295, 120, 425, 145); m_wndPrintPreview.Create(this, _T("Print Pre&view"), 240, 155, 350, 180); m_wndExport.Create(this, _T("&Export"), 355, 155, 430, 180); } void CEMStatisticsMajorDiseasesReport::OnInitializeComponents() { CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); //EnableControls(TRUE); //EnableButtons(TRUE, 0, -1); m_wndYear.SetLimitText(16); //m_wndYear.SetCheckValue(true); ////m_wndReportPeriod.SetCheckValue(true); m_wndReportPeriod.LimitText(35); //m_wndFromDate.SetMax(CDate(pMF->GetSysDate())); m_wndFromDate.SetCheckValue(true); //m_wndToDate.SetMax(CDate(pMF->GetSysDate())); m_wndToDate.SetCheckValue(true); //m_wndExamRoom.SetCheckValue(true); m_wndExamRoom.LimitText(81); //m_wndExamRoom.SetCheckBox(TRUE); m_wndReportPeriod.InsertColumn(0, _T("ID"), CFMT_TEXT, 50); m_wndReportPeriod.InsertColumn(1, _T("Description"), CFMT_TEXT, 150); m_wndExamRoom.InsertColumn(0, _T("ID"), CFMT_TEXT | CFMT_RIGHT, 50); m_wndExamRoom.InsertColumn(1, _T("Name"), CFMT_TEXT, 200); } void CEMStatisticsMajorDiseasesReport::OnSetWindowEvents() { //m_wndYear.SetEvent(WE_CHANGE, _OnYearChangeFnc); //m_wndYear.SetEvent(WE_SETFOCUS, _OnYearSetfocusFnc); //m_wndYear.SetEvent(WE_KILLFOCUS, _OnYearKillfocusFnc); m_wndYear.SetEvent(WE_CHECKVALUE, _OnYearCheckValueFnc); m_wndReportPeriod.SetEvent(WE_SELENDOK, _OnReportPeriodSelendokFnc); //m_wndReportPeriod.SetEvent(WE_SETFOCUS, _OnReportPeriodSetfocusFnc); //m_wndReportPeriod.SetEvent(WE_KILLFOCUS, _OnReportPeriodKillfocusFnc); m_wndReportPeriod.SetEvent(WE_SELCHANGE, _OnReportPeriodSelectChangeFnc); m_wndReportPeriod.SetEvent(WE_LOADDATA, _OnReportPeriodLoadDataFnc); //m_wndReportPeriod.SetEvent(WE_ADDNEW, _OnReportPeriodAddNewFnc); //m_wndFromDate.SetEvent(WE_CHANGE, _OnFromDateChangeFnc); //m_wndFromDate.SetEvent(WE_SETFOCUS, _OnFromDateSetfocusFnc); //m_wndFromDate.SetEvent(WE_KILLFOCUS, _OnFromDateKillfocusFnc); m_wndFromDate.SetEvent(WE_CHECKVALUE, _OnFromDateCheckValueFnc); //m_wndToDate.SetEvent(WE_CHANGE, _OnToDateChangeFnc); //m_wndToDate.SetEvent(WE_SETFOCUS, _OnToDateSetfocusFnc); //m_wndToDate.SetEvent(WE_KILLFOCUS, _OnToDateKillfocusFnc); m_wndToDate.SetEvent(WE_CHECKVALUE, _OnToDateCheckValueFnc); m_wndExamRoom.SetEvent(WE_SELENDOK, _OnExamRoomSelendokFnc); //m_wndExamRoom.SetEvent(WE_SETFOCUS, _OnExamRoomSetfocusFnc); //m_wndExamRoom.SetEvent(WE_KILLFOCUS, _OnExamRoomKillfocusFnc); m_wndExamRoom.SetEvent(WE_SELCHANGE, _OnExamRoomSelectChangeFnc); m_wndExamRoom.SetEvent(WE_LOADDATA, _OnExamRoomLoadDataFnc); //m_wndExamRoom.SetEvent(WE_ADDNEW, _OnExamRoomAddNewFnc); m_wndPrintPreview.SetEvent(WE_CLICK, _OnPrintPreviewSelectFnc); m_wndExport.SetEvent(WE_CLICK, _OnExportSelectFnc); m_wndClose.SetEvent(WE_CLICK, _OnCloseSelectFnc); m_wndSelectAllDiseases.SetEvent(WE_CLICK, _OnSelectAllDiseasesSelectFnc); CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); CString szSysDate = pMF->GetSysDate(); m_nYear = ToInt(szSysDate.Left(4)); m_szReportPeriodKey.Format(_T("%d"), ToInt(szSysDate.Mid(5, 2))); m_szFromDate = m_szToDate = pMF->GetSysDate(); m_szFromDate += _T("00:00"); m_szToDate += _T("23:59"); SetMode(VM_EDIT); } void CEMStatisticsMajorDiseasesReport::OnDoDataExchange(CDataExchange* pDX) { DDX_Text(pDX, m_wndYear.GetDlgCtrlID(), m_nYear); DDX_TextEx(pDX, m_wndReportPeriod.GetDlgCtrlID(), m_szReportPeriodKey); DDX_TextEx(pDX, m_wndFromDate.GetDlgCtrlID(), m_szFromDate); DDX_TextEx(pDX, m_wndToDate.GetDlgCtrlID(), m_szToDate); DDX_TextEx(pDX, m_wndExamRoom.GetDlgCtrlID(), m_szExamRoomKey); DDX_Check(pDX, m_wndSelectAllDiseases.GetDlgCtrlID(), m_bSelectAllDiseases); } void CEMStatisticsMajorDiseasesReport::GetDataToScreen() { CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); CRecord rs(&pMF->m_db); CString szSQL; szSQL.Format(_T("SELECT * FROM ")); rs.ExecSQL(szSQL); } void CEMStatisticsMajorDiseasesReport::GetScreenToData() { CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); } void CEMStatisticsMajorDiseasesReport::SetDefaultValues() { m_nYear=0; m_szReportPeriodKey.Empty(); m_szFromDate.Empty(); m_szToDate.Empty(); m_szExamRoomKey.Empty(); m_bSelectAllDiseases=FALSE; } int CEMStatisticsMajorDiseasesReport::SetMode(int nMode) { int nOldMode = GetMode(); CGuiView::SetMode(nMode); CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd(); CString szSQL, tmpStr; CRecord rs(&pMF->m_db); tmpStr = pMF->GetSysDate(); switch(nMode) { case VM_ADD: EnableControls(TRUE); EnableButtons(TRUE, 0, 1, 2, -1); SetDefaultValues(); break; case VM_EDIT: EnableControls(TRUE); EnableButtons(TRUE, 0, 1, 2, -1); break; case VM_VIEW: EnableControls(TRUE); EnableButtons(FALSE, 3, 4, -1); break; case VM_NONE: EnableControls(TRUE); EnableButtons(TRUE, 0, 6, -1); SetDefaultValues(); break; }; UpdateData(FALSE); return nOldMode; } /*void CEMStatisticsMajorDiseasesReport::OnYearChange(){ } */ /*void CEMStatisticsMajorDiseasesReport::OnYearSetfocus(){ } */ /*void CEMStatisticsMajorDiseasesReport::OnYearKillfocus(){ } */ int CEMStatisticsMajorDiseasesReport::OnYearCheckValue(){ return 0; } void CEMStatisticsMajorDiseasesReport::OnReportPeriodSelectChange(int nOldItemSel, int nNewItemSel){ CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); } void CEMStatisticsMajorDiseasesReport::OnReportPeriodSelendok() { CString tmpStr; CDate dte; UpdateData(true); int nMonth = ToInt(m_szReportPeriodKey); if(nMonth > 0 && nMonth <= 12) { m_szFromDate.Format(_T("%.4d/%.2d/01"), m_nYear, nMonth); dte.ParseDate(m_szFromDate); m_szToDate.Format(_T("%.4d/%.2d/%.2d 23:59"), m_nYear, nMonth, dte.GetMonthLastDay()); } if(nMonth == 13) { m_szFromDate.Format(_T("%.4d/01/01"), m_nYear); tmpStr.Format(_T("%.4d/03/01"), m_nYear); dte.ParseDate(tmpStr); m_szToDate.Format(_T("%.4d/03/%.2d 23:59" ), m_nYear, dte.GetMonthLastDay()); } if(nMonth == 14) { m_szFromDate.Format(_T("%.4d/04/01"), m_nYear); tmpStr.Format(_T("%.4d/06/01"), m_nYear); dte.ParseDate(tmpStr); m_szToDate.Format(_T("%.4d/06/%.2d 23:59"), m_nYear, dte.GetMonthLastDay()); } if(nMonth == 15) { m_szFromDate.Format(_T("%.4d/07/01"), m_nYear); tmpStr.Format(_T("%.4d/09/01"), m_nYear); dte.ParseDate(tmpStr); m_szToDate.Format(_T("%.4d/09/%.2d 23:59"), m_nYear, dte.GetMonthLastDay()); } if(nMonth == 16) { m_szFromDate.Format(_T("%.4d/10/01"), m_nYear); tmpStr.Format(_T("%.4d/10/01"), m_nYear); dte.ParseDate(tmpStr); m_szToDate.Format(_T("%.4d/12/%.2d 23:59"), m_nYear, dte.GetMonthLastDay()); } if(nMonth == 17) { m_szFromDate.Format(_T("%.4d/01/01"), m_nYear); tmpStr.Format(_T("%.4d/12/01"), m_nYear); dte.ParseDate(tmpStr); m_szToDate.Format(_T("%.4d/12/%.2d 23:59"), m_nYear, dte.GetMonthLastDay()); } UpdateData(false); } /*void CEMStatisticsMajorDiseasesReport::OnReportPeriodSetfocus(){ }*/ /*void CEMStatisticsMajorDiseasesReport::OnReportPeriodKillfocus(){ }*/ long CEMStatisticsMajorDiseasesReport::OnReportPeriodLoadData() { CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); CRecord rs(&pMF->m_db); CString szSQL, szWhere; szWhere.Empty(); if(m_wndReportPeriod.IsSearchKey() && ToInt(m_szReportPeriodKey) > 0) { szWhere.Format(_T(" WHERE hpr_idx=%ld "), ToInt(m_szReportPeriodKey)); } m_wndReportPeriod.DeleteAllItems(); int nCount = 0; szSQL.Format(_T("SELECT * FROM hms_period_report %s ORDER BY hpr_idx "), szWhere); nCount = rs.ExecSQL(szSQL); while(!rs.IsEOF()) { m_wndReportPeriod.AddItems( rs.GetValue(_T("hpr_idx")), rs.GetValue(_T("hpr_name")), NULL); rs.MoveNext(); } return nCount; } /*void CEMStatisticsMajorDiseasesReport::OnReportPeriodAddNew(){ CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); } */ /*void CEMStatisticsMajorDiseasesReport::OnFromDateChange(){ } */ /*void CEMStatisticsMajorDiseasesReport::OnFromDateSetfocus(){ } */ /*void CEMStatisticsMajorDiseasesReport::OnFromDateKillfocus(){ } */ int CEMStatisticsMajorDiseasesReport::OnFromDateCheckValue(){ return 0; } /*void CEMStatisticsMajorDiseasesReport::OnToDateChange(){ } */ /*void CEMStatisticsMajorDiseasesReport::OnToDateSetfocus(){ } */ /*void CEMStatisticsMajorDiseasesReport::OnToDateKillfocus(){ } */ int CEMStatisticsMajorDiseasesReport::OnToDateCheckValue(){ return 0; } void CEMStatisticsMajorDiseasesReport::OnExamRoomSelectChange(int nOldItemSel, int nNewItemSel){ CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); } void CEMStatisticsMajorDiseasesReport::OnExamRoomSelendok(){ } /*void CEMStatisticsMajorDiseasesReport::OnExamRoomSetfocus(){ }*/ /*void CEMStatisticsMajorDiseasesReport::OnExamRoomKillfocus(){ }*/ long CEMStatisticsMajorDiseasesReport::OnExamRoomLoadData() { CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); CRecord rs(&pMF->m_db); CString szSQL, szWhere; szWhere.Empty(); if(m_wndExamRoom.IsSearchKey() && !m_szExamRoomKey.IsEmpty()) { szWhere.Format(_T("and hrl_id = %d"), ToInt(m_szExamRoomKey)); } m_wndExamRoom.DeleteAllItems(); int nCount = 0; szSQL.Format(_T("select hrl_name as name, hrl_id as id from hms_roomlist where hrl_deptid = '%s' %s Order by id"), pMF->m_szDept, szWhere); nCount = rs.ExecSQL(szSQL); while(!rs.IsEOF()){ m_wndExamRoom.AddItems( rs.GetValue(_T("id")), rs.GetValue(_T("name")), NULL); rs.MoveNext(); } return nCount; } /*void CEMStatisticsMajorDiseasesReport::OnExamRoomAddNew(){ CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); } */ void CEMStatisticsMajorDiseasesReport::OnPrintPreviewSelect() { CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); UpdateData(true); CReport rpt; CString szSQL, szTemp, tmpStr; CRecord rs(&pMF->m_db); szSQL = GetQueryString(); BeginWaitCursor(); rs.ExecSQL(szSQL); if (rs.IsEOF()) { ShowMessage(150, MB_ICONSTOP); return; } if(!rpt.Init(_T("Reports/HMS/HE_THONGKEMATBENHCHINH.RPT")) ) return ; rpt.GetReportHeader()->SetValue(_T("HEALTHSERVICE"), pMF->m_CompanyInfo.sc_pname); rpt.GetReportHeader()->SetValue(_T("HOSPITALNAME"), pMF->m_CompanyInfo.sc_name); tmpStr.Format(rpt.GetReportHeader()->GetValue(_T("ReportDate")), CDateTime::Convert(m_szFromDate, yyyymmdd|hhmmss, ddmmyyyy|hhmmss), CDateTime::Convert(m_szToDate, yyyymmdd|hhmmss, ddmmyyyy|hhmmss)); rpt.GetReportHeader()->SetValue(_T("ReportDate"), tmpStr); int nIndex = 1; CReportSection* rptDetail; double nTotal = 0; while(!rs.IsEOF()) { rptDetail = rpt.AddDetail(); tmpStr.Format(_T("%d"), nIndex ++); rptDetail->SetValue(_T("1"), tmpStr); szTemp = rs.GetValue(_T("hi_icd")); rptDetail->SetValue(_T("2"), szTemp); szTemp = rs.GetValue(_T("ICDName")); rptDetail->SetValue(_T("3"), szTemp); szTemp = rs.GetValue(_T("total")); nTotal += ToInt(szTemp); rptDetail->SetValue(_T("4"), szTemp); rs.MoveNext(); } szTemp.Format(_T("s%d"), nTotal); rpt.GetReportFooter()->SetValue(_T("s4"), nTotal); CString szDate; tmpStr = pMF->GetSysDate(); szDate.Format(rpt.GetReportFooter()->GetValue(_T("PrintDate")), tmpStr.Mid(8, 2), tmpStr.Mid(5, 2), tmpStr.Left(4)); rpt.GetReportFooter()->SetValue(_T("PrintDate"), szDate); rpt.PrintPreview(); EndWaitCursor(); } void CEMStatisticsMajorDiseasesReport::OnExportSelect(){ _debug(_T("%s"), CString(typeid(this).name())); CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); UpdateData(true); CRecord rs(&pMF->m_db); CString szSQL, szTemp, tmpStr; CExcel xls; szSQL = GetQueryString(); BeginWaitCursor(); rs.ExecSQL(szSQL); if (rs.IsEOF()) { ShowMessage(150, MB_ICONSTOP); return; } xls.CreateSheet(1); xls.SetWorksheet(0); xls.SetColumnWidth(0, 7); xls.SetColumnWidth(1, 10); xls.SetColumnWidth(2, 78); xls.SetColumnWidth(3, 12); int nRow = 0, nCol = 0; xls.SetCellMergedColumns(nCol, nRow + 2, 4); xls.SetCellText(nCol+2, nRow, pMF->m_CompanyInfo.sc_pname, FMT_TEXT | FMT_CENTER, true, 10); xls.SetCellText(nCol+2, nRow + 1, pMF->m_CompanyInfo.sc_name, FMT_TEXT | FMT_CENTER, true, 10); xls.SetCellMergedColumns(nCol, nRow + 2, 4); xls.SetCellMergedColumns(nCol, nRow + 3, 4); xls.SetCellText(nCol, nRow + 2, _T("TH\x1ED0NG K\xCA M\x1EB6T \x42\x1EC6NH \x43H\xCDNH"), FMT_TEXT | FMT_CENTER, true, 13); tmpStr.Format(_T("T\x1EEB ng\xE0y %s \x110\x1EBFn ng\xE0y %s"), CDateTime::Convert(m_szFromDate, yyyymmdd|hhmmss, ddmmyyyy|hhmmss), CDateTime::Convert(m_szToDate, yyyymmdd|hhmmss, ddmmyyyy|hhmmss)); xls.SetCellText(nCol, nRow + 3, tmpStr, FMT_TEXT | FMT_CENTER, true, 11); xls.SetCellText(nCol, nRow + 4, _T("STT"), FMT_TEXT | FMT_CENTER, true, 11); xls.SetCellText(nCol + 1, nRow + 4, _T("M\xE3 \x62\x1EC7nh"), FMT_TEXT | FMT_CENTER, true, 11); xls.SetCellText(nCol + 2, nRow + 4, _T("T\xEAn m\x1EB7t \x62\x1EC7nh"), FMT_TEXT | FMT_CENTER, true, 11); xls.SetCellText(nCol + 3, nRow + 4, _T("S\x1ED1 l\x1B0\x1EE3ng"), FMT_TEXT | FMT_CENTER, true, 11); nRow += 5; int nIndex = 1; long double nTotal = 0.0; while (!rs.IsEOF()) { szTemp.Format(_T("%d"), nIndex); xls.SetCellText(nCol, nRow, szTemp, FMT_INTEGER); szTemp = rs.GetValue(_T("hi_icd")); xls.SetCellText(nCol + 1, nRow, szTemp, FMT_TEXT); szTemp = rs.GetValue(_T("ICDName")); xls.SetCellText(nCol + 2, nRow, szTemp, FMT_TEXT); szTemp = rs.GetValue(_T("total")); nTotal += ToDouble(szTemp); xls.SetCellText(nCol + 3, nRow, szTemp, FMT_INTEGER); nIndex++; nRow++; rs.MoveNext(); } xls.SetCellMergedColumns(nCol, nRow, 3); xls.SetCellText(nCol, nRow, _T("T\x1ED5ng \x63\x1ED9ng"), FMT_TEXT | FMT_CENTER, true, 12); xls.SetCellText(nCol + 3, nRow, double2str(nTotal), FMT_NUMBER1, true, 12 ); EndWaitCursor(); xls.Save(_T("Exports\\THONG KE MAT BENH CHINH.XLS")); } void CEMStatisticsMajorDiseasesReport::OnCloseSelect() { CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); } void CEMStatisticsMajorDiseasesReport::OnSelectAllDiseasesSelect() { CHMSMainFrame *pMF = (CHMSMainFrame*) AfxGetMainWnd(); } int CEMStatisticsMajorDiseasesReport::OnAddEMStatisticsMajorDiseasesReport(){ if(GetMode() == VM_ADD || GetMode() == VM_EDIT) return -1; CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd(); SetMode(VM_ADD); return 0; } int CEMStatisticsMajorDiseasesReport::OnEditEMStatisticsMajorDiseasesReport(){ if(GetMode() != VM_VIEW) return -1; CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd(); SetMode(VM_EDIT); return 0; } int CEMStatisticsMajorDiseasesReport::OnDeleteEMStatisticsMajorDiseasesReport(){ if(GetMode() != VM_VIEW) return -1; CHMSMainFrame *pMF = (CHMSMainFrame *)AfxGetMainWnd(); CString szSQL; if(ShowMessage(1, MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2) == IDNO) return -1; szSQL.Format(_T("DELETE FROM WHERE AND") ); int ret = pMF->ExecSQL(szSQL); if(ret >= 0){ SetMode(VM_NONE); OnCancelEMStatisticsMajorDiseasesReport(); } return 0; } int CEMStatisticsMajorDiseasesReport::OnSaveEMStatisticsMajorDiseasesReport(){ if(GetMode() != VM_ADD && GetMode() != VM_EDIT) return -1; if(!IsValidateData()) return -1; CHMSMainFrame *pMF = (CHMSMainFrame *)AfxGetMainWnd(); CString szSQL; if(GetMode() == VM_ADD){ //szSQL = m_tblTbl.GetInsertSQL(); } else if(GetMode() == VM_EDIT){ CString szWhere; szWhere.Format(_T(" WHERE")); //szSQL = m_tblTbl.GetUpdateSQL(_T("createdby,createddate")); szSQL += szWhere; } _fmsg(_T("%s"), szSQL); int ret = pMF->ExecSQL(szSQL); if(ret > 0) { //OnEMStatisticsMajorDiseasesReportListLoadData(); SetMode(VM_VIEW); } else { } return ret; return 0; } int CEMStatisticsMajorDiseasesReport::OnCancelEMStatisticsMajorDiseasesReport(){ if(GetMode() == VM_EDIT) { SetMode(VM_VIEW); } else { SetMode(VM_NONE); } CHMSMainFrame *pMF = (CHMSMainFrame *)AfxGetMainWnd(); return 0; } int CEMStatisticsMajorDiseasesReport::OnEMStatisticsMajorDiseasesReportListLoadData(){ return 0; } CString CEMStatisticsMajorDiseasesReport::GetQueryString() { CHMSMainFrame *pMF = (CHMSMainFrame *)AfxGetMainWnd(); CString szSQL, szWhere, szCondition; szWhere.Empty(); if (!m_szExamRoomKey.IsEmpty()) { szWhere.Format(_T(" and he_roomid = %d "), ToInt(m_szExamRoomKey)); } if (m_bSelectAllDiseases) szCondition.Empty(); //else //szCondition.Format(_T(" LIMIT 10 ")); szSQL.Format(_T(" SELECT hi_icd,") \ _T(" hi_name as ICDName,") \ _T(" count(hd_docno) as total") \ _T(" FROM ") \ _T(" ( ") \ _T(" SELECT ") \ _T(" distinct hd_docno,") \ _T(" max(he_examdate) as he_examedate,") \ _T(" hd_icd") \ _T(" FROM hms_doc") \ _T(" LEFT JOIN hms_exam ON (he_docno = hd_docno)") \ _T(" WHERE hd_status = 'T' AND length(hd_icd) > 0 AND (he_examdate) BETWEEN cast_string2timestamp('%s') AND cast_string2timestamp('%s') AND hd_admitdept = '%s' %s") \ _T(" GROUP BY hd_docno, hd_icd") \ _T(" ) Tbl") \ _T(" LEFT JOIN hms_icd ON(hi_icd = hd_icd)") \ _T(" GROUP BY hi_icd, hi_name") \ _T(" ORDER BY hi_icd, ICDName DESC %s "), m_szFromDate, m_szToDate, pMF->m_szDept, szWhere, szCondition); return szSQL; }
76db31dba601b50fa4817b03415f5fd2f2acb33c
21633501dbee345941a4a992053a9e594cfd27d6
/cpp/virtualsysop/ANSICO~1.H
ef1df165fa3bdf2476f5100533f42aad1ac306cb
[]
no_license
levidsmith/GeorgiaTechProjects
707c980ec9768935be98c680c07b698c21094a53
1980138628cb9e5f896f345bcb7228e6d37ba4bb
refs/heads/master
2023-02-04T13:22:59.016201
2020-12-23T22:17:57
2020-12-23T22:17:57
95,412,526
0
0
null
null
null
null
UTF-8
C++
false
false
1,153
h
#ifndef ANSICOLOR_H #define ANSICOLOR_H #include "global.h" #include <cstdio> //include classic c stdio.h /* ANSI X3.64 color code definitions */ const int A_BLACK = 0; const int A_RED = 1; const int A_GREEN = 2; const int A_YELLOW = 3; const int A_BLUE = 4; const int A_MAGENTA = 5; const int A_CYAN = 6; const int A_WHITE = 7; const int A_CLEAR = 9; const int FG = 30; // foreground const int BKG = 40; // background const int A_BLINK = 5; // blinking code const int BRIGHT = 1; const int DARK = 0; const int ESC = 27; // ASCII number value // for escape class ansicolor { public: ansicolor(bool useColor); void setColor(int iLevel, int iColor); void setColor(int iBright, int iLevel, int iColor); void setColorBlink(int iLevel, int iColor); void setColorBlink(int iAttribute, int iLevel, int iColor); void clearScreen(); void cursorHome(); void cursorLeft(int iTimes); void cursorRight(int iTimes); void cursorUp(int iTimes); void cursorDown(int iTimes); void cursorGoto(int x, int y); void resetColor(); char read(); // private: bool bUseColor; }; #endif
6bf68cc1b1e8020f8f3fa3926ed7fcc188eb49cb
859af88331aa2d56fa4bed2098a380416e9b6837
/integracionn.h
50a5fdca8a8de995d9e14d4c47cba771aa9efa32
[]
no_license
metodonumerico/ProyectoIntegrador
f129fafadb331fb3b300dab325639da2be1f5f64
669d11686a6f9b24ccda9e4624982b31252e790a
refs/heads/master
2021-08-23T03:34:20.811120
2017-12-02T23:23:52
2017-12-02T23:23:52
112,884,664
0
0
null
null
null
null
UTF-8
C++
false
false
574
h
#ifndef INTEGRACIONN_H #define INTEGRACIONN_H #include <QMainWindow> namespace Ui { class integracionN; } class integracionN : public QMainWindow { Q_OBJECT public: explicit integracionN(QWidget *parent = 0); ~integracionN(); double Funcion(double x);//se define la funcion private: Ui::integracionN *ui; private slots://Declare the functions that will be used in the program void Calcular();//se definen los metodos que se utilizaran dentro del programa void Borrar(); void salir(); }; #endif // INTEGRACIONN_H
8063efe666f9a8d7e38706e3d6f08a4af0e1de54
0454def9ffc8db9884871a7bccbd7baa4322343b
/src/plugins/shared/QUScriptableTaskFactory.cpp
19187d1b99567f945f179caba5e0321b094513b0
[]
no_license
escaped/uman
e0187d1d78e2bb07dade7ef6ef041b6ed424a2d3
bedc1c6c4fc464be4669f03abc9bac93e7e442b0
refs/heads/master
2016-09-05T19:26:36.679240
2010-07-26T07:55:31
2010-07-26T07:55:31
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,336
cpp
#include "QUScriptableTaskFactory.h" #include <QDir> #include <QFile> #include <QFileInfo> QUScriptableTaskFactory::QUScriptableTaskFactory(QObject *parent): QUMultilingualTaskFactory(parent) {} QList<QUTask*> QUScriptableTaskFactory::createTasks() { QList<QUTask*> tasks; QList<QDomDocument*> configurations = this->loadTaskConfigurations(); foreach(QDomDocument *configuration, configurations) { QUTask *task = this->createTask(configuration); if(task) tasks << task; } return tasks; } /*! * Opens all XML-Files which could be task configurations. */ QList<QDomDocument*> QUScriptableTaskFactory::loadTaskConfigurations() { QList<QDomDocument*> configurations; QDir configDir = this->configurationDirectory(); QFileInfoList configFiList = configDir.entryInfoList(QStringList("*.xml"), QDir::Files, QDir::Name); foreach(QFileInfo configFi, configFiList) { QFile file(configFi.filePath()); if(file.open(QIODevice::ReadOnly | QIODevice::Text)) { QDomDocument *configuration = new QDomDocument(); configuration->setContent(file.readAll()); // save current fileName for later use configuration->firstChildElement("task").setAttribute("file", configFi.fileName()); configurations.append(configuration); } } return configurations; }
32cc49eca72a4be17c58da5f4803444ae7de98af
ccb601a0fbd771a77ad4ed79c1b429cbd4ed866d
/test/TestFlow.h
f4ccbd451481c2928794e902857502ad37b0e7a8
[]
no_license
KellerBreno/Simulador-de-Sistemas
d1a457b577a0c5019875b6485dc44eae3853d4cd
d2b2e9dffb57b34b61773ef08131915ef83553b5
refs/heads/master
2020-09-26T06:46:31.351827
2018-12-06T16:34:46
2018-12-06T16:34:46
226,193,240
0
0
null
null
null
null
UTF-8
C++
false
false
1,457
h
/*! * \file TestFlow.h * Arquivo contendo a Declaração da Classe de testes de Fluxo * * \author Breno Keller * \since 8/11/18 */ #ifndef SIMULADOR_TESTFLOW_H #define SIMULADOR_TESTFLOW_H /*! * \class TestFlow * \brief Classe estruturando os testes da classe Flow */ class TestFlow { public: /*! * \brief Método para executar todos os testes */ static void run(); private: /*! * \brief Teste para construtor */ static void unitConstructor(); /*! * \brief Teste para operador de atribuição */ static void unitOperator(); /*! * \brief Teste para Flow::execute() */ static void unitExecute(); /*! * \brief Teste para Flow::execute() */ static void unitGetSource(); /*! * \brief Teste para Flow::execute() */ static void unitSetSource(); /*! * \brief Teste para Flow::execute() */ static void unitGetTarget(); /*! * \brief Teste para Flow::execute() */ static void unitSetTarget(); /*! * \brief Teste para Flow::execute() */ static void unitGetName(); /*! * \brief Teste para Flow::execute() */ static void unitSetName(); /*! * \brief Teste para operadores de igualdade (==) e diferença (!=) */ static void unitEqualDifferent(); /*! * \brief Teste para Flow::clone() */ static void unitClone(); }; #endif //SIMULADOR_TESTFLOW_H
7e88092d8a0ff8b9ad6d204650c7632f01bfe7d6
93dd86c8d0eceaee8276a5cafe8c0bfee2a315d3
/paddle/fluid/operators/distributed_ops/allreduce_op.cc
86f1c28a9dd4f53400418c93f8598b7a9c38f4cc
[ "Apache-2.0" ]
permissive
hutuxian/Paddle
f8b7693bccc6d56887164c1de0b6f6e91cffaae8
a1b640bc66a5cc9583de503e7406aeba67565e8d
refs/heads/develop
2023-08-29T19:36:45.382455
2020-09-09T09:19:07
2020-09-09T09:19:07
164,977,763
8
27
Apache-2.0
2023-06-16T09:47:39
2019-01-10T02:50:31
Python
UTF-8
C++
false
false
2,543
cc
/* Copyright (c) 2016 PaddlePaddle 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 <future> // NOLINT #include <ostream> #include "paddle/fluid/operators/distributed_ops/allreduce_op.h" namespace paddle { namespace operators { class AllReduceOp : public framework::OperatorWithKernel { public: using framework::OperatorWithKernel::OperatorWithKernel; void InferShape(framework::InferShapeContext* ctx) const override {} protected: framework::OpKernelType GetExpectedKernelType( const framework::ExecutionContext& ctx) const override { return framework::OpKernelType( OperatorWithKernel::IndicateVarDataType(ctx, "X"), ctx.GetPlace()); } }; class AllReduceOpMaker : public framework::OpProtoAndCheckerMaker { public: void Make() { AddInput("X", "(Tensor), tensor to be allreduced."); AddOutput("Out", "(Tensor) the result of allreduced."); AddAttr<int>("reduce_type", "(int) determin the reduce type.") .SetDefault(0); AddAttr<bool>( "sync_mode", "(bool) whether to synchronize the CUDA stream after nccl call.") .SetDefault(false); AddComment(R"DOC( ***AllReduce Operator*** Call NCCL AllReduce internally. Note that this op must be used when one thread is managing one GPU device. For speed reasons, reduce_type should be an integer: 0: sum 1: prod 2: max 3: min If input and output are the same variable, in-place allreduce will be used. )DOC"); } }; } // namespace operators } // namespace paddle namespace ops = paddle::operators; namespace plat = paddle::platform; REGISTER_OP_WITHOUT_GRADIENT(allreduce, ops::AllReduceOp, ops::AllReduceOpMaker); REGISTER_OP_CPU_KERNEL( allreduce, ops::AllReduceOpKernel<plat::CPUDeviceContext, float>, ops::AllReduceOpKernel<plat::CPUDeviceContext, double>, ops::AllReduceOpKernel<plat::CPUDeviceContext, int>, ops::AllReduceOpKernel<plat::CPUDeviceContext, int64_t>, ops::AllReduceOpKernel<plat::CPUDeviceContext, plat::float16>);
514b364425274b2d8c60c4dc5b98db8103ed4f40
9db2fa276b454bdf111246b409ebd03a7f517876
/IP/shell/PCIe_Bridge_ICAP_complex/ip/PCIe_Bridge_ICAP_complex_m06_regslice_0/sim/PCIe_Bridge_ICAP_complex_m06_regslice_0.cpp
1f382986b31378e00442bc8ce2c7be0babf2b9c4
[ "MIT" ]
permissive
SanjayRai/VCU1525_HLS_acceleration_framework_split_xDMA
884c6ab426413ba282113c95e1ee2542a672cc72
fa16949bbf761bbd5c730f2b914af69343292b83
refs/heads/master
2021-06-15T23:05:04.386829
2019-10-14T23:22:13
2019-10-14T23:22:13
147,463,929
6
4
null
null
null
null
UTF-8
C++
false
false
10,089
cpp
// (c) Copyright 1995-2019 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // laws. // // DISCLAIMER // This disclaimer is not a license and does not grant any // rights to the materials distributed herewith. Except as // otherwise provided in a valid license issued to you by // Xilinx, and to the maximum extent permitted by applicable // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and // (2) Xilinx shall not be liable (whether in contract or tort, // including negligence, or under any other theory of // liability) for any loss or damage of any kind or nature // related to, arising under or in connection with these // materials, including for any direct, or any indirect, // special, incidental, or consequential loss or damage // (including loss of data, profits, goodwill, or any type of // loss or damage suffered as a result of any action brought // by a third party) even if such damage or loss was // reasonably foreseeable or Xilinx had been advised of the // possibility of the same. // // CRITICAL APPLICATIONS // Xilinx products are not designed or intended to be fail- // safe, or for use in any application requiring fail-safe // performance, such as life-support or safety devices or // systems, Class III medical devices, nuclear facilities, // applications related to the deployment of airbags, or any // other applications that could lead to death, personal // injury, or severe property or environmental damage // (individually and collectively, "Critical // Applications"). Customer assumes the sole risk and // liability of any use of Xilinx products in Critical // Applications, subject only to applicable laws and // regulations governing limitations on product liability. // // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS // PART OF THIS FILE AT ALL TIMES. // // DO NOT MODIFY THIS FILE. #include "PCIe_Bridge_ICAP_complex_m06_regslice_0_sc.h" #include "PCIe_Bridge_ICAP_complex_m06_regslice_0.h" #include "axi_register_slice.h" #include <map> #include <string> PCIe_Bridge_ICAP_complex_m06_regslice_0::PCIe_Bridge_ICAP_complex_m06_regslice_0(const sc_core::sc_module_name& nm) : PCIe_Bridge_ICAP_complex_m06_regslice_0_sc(nm) { // initialize pins mp_impl->aclk(aclk); mp_impl->aresetn(aresetn); // initialize transactors mp_M_AXI_transactor = NULL; mp_S_AXI_transactor = NULL; } void PCIe_Bridge_ICAP_complex_m06_regslice_0::before_end_of_elaboration() { // configure 'M_AXI' transactor if (xsc::utils::xsc_sim_manager::getInstanceParameterInt("PCIe_Bridge_ICAP_complex_m06_regslice_0", "M_AXI_TLM_MODE") != 1) { xsc::common_cpp::properties M_AXI_transactor_param_props; M_AXI_transactor_param_props.addLong("DATA_WIDTH", "32"); M_AXI_transactor_param_props.addLong("FREQ_HZ", "125000000"); M_AXI_transactor_param_props.addLong("ID_WIDTH", "0"); M_AXI_transactor_param_props.addLong("ADDR_WIDTH", "13"); M_AXI_transactor_param_props.addLong("AWUSER_WIDTH", "0"); M_AXI_transactor_param_props.addLong("ARUSER_WIDTH", "0"); M_AXI_transactor_param_props.addLong("WUSER_WIDTH", "0"); M_AXI_transactor_param_props.addLong("RUSER_WIDTH", "0"); M_AXI_transactor_param_props.addLong("BUSER_WIDTH", "0"); M_AXI_transactor_param_props.addLong("HAS_BURST", "0"); M_AXI_transactor_param_props.addLong("HAS_LOCK", "0"); M_AXI_transactor_param_props.addLong("HAS_PROT", "1"); M_AXI_transactor_param_props.addLong("HAS_CACHE", "0"); M_AXI_transactor_param_props.addLong("HAS_QOS", "0"); M_AXI_transactor_param_props.addLong("HAS_REGION", "0"); M_AXI_transactor_param_props.addLong("HAS_WSTRB", "1"); M_AXI_transactor_param_props.addLong("HAS_BRESP", "1"); M_AXI_transactor_param_props.addLong("HAS_RRESP", "1"); M_AXI_transactor_param_props.addLong("SUPPORTS_NARROW_BURST", "0"); M_AXI_transactor_param_props.addLong("NUM_READ_OUTSTANDING", "1"); M_AXI_transactor_param_props.addLong("NUM_WRITE_OUTSTANDING", "1"); M_AXI_transactor_param_props.addLong("MAX_BURST_LENGTH", "1"); M_AXI_transactor_param_props.addLong("NUM_READ_THREADS", "1"); M_AXI_transactor_param_props.addLong("NUM_WRITE_THREADS", "1"); M_AXI_transactor_param_props.addLong("RUSER_BITS_PER_BYTE", "0"); M_AXI_transactor_param_props.addLong("WUSER_BITS_PER_BYTE", "0"); M_AXI_transactor_param_props.addFloat("PHASE", "0.0"); M_AXI_transactor_param_props.addString("PROTOCOL", "AXI4LITE"); M_AXI_transactor_param_props.addString("READ_WRITE_MODE", "READ_WRITE"); M_AXI_transactor_param_props.addString("CLK_DOMAIN", "PCIe_Bridge_ICAP_complex_clk_wiz_0_0_clk_out_125M"); mp_M_AXI_transactor = new xtlm::xaximm_xtlm2pin_t<32,13,1,1,1,1,1,1>("M_AXI_transactor", M_AXI_transactor_param_props); mp_M_AXI_transactor->ARADDR(m_axi_araddr); mp_M_AXI_transactor->ARPROT(m_axi_arprot); mp_M_AXI_transactor->ARREADY(m_axi_arready); mp_M_AXI_transactor->ARVALID(m_axi_arvalid); mp_M_AXI_transactor->AWADDR(m_axi_awaddr); mp_M_AXI_transactor->AWPROT(m_axi_awprot); mp_M_AXI_transactor->AWREADY(m_axi_awready); mp_M_AXI_transactor->AWVALID(m_axi_awvalid); mp_M_AXI_transactor->BREADY(m_axi_bready); mp_M_AXI_transactor->BRESP(m_axi_bresp); mp_M_AXI_transactor->BVALID(m_axi_bvalid); mp_M_AXI_transactor->RDATA(m_axi_rdata); mp_M_AXI_transactor->RREADY(m_axi_rready); mp_M_AXI_transactor->RRESP(m_axi_rresp); mp_M_AXI_transactor->RVALID(m_axi_rvalid); mp_M_AXI_transactor->WDATA(m_axi_wdata); mp_M_AXI_transactor->WREADY(m_axi_wready); mp_M_AXI_transactor->WSTRB(m_axi_wstrb); mp_M_AXI_transactor->WVALID(m_axi_wvalid); mp_M_AXI_transactor->CLK(aclk); m_M_AXI_transactor_rst_signal.write(1); mp_M_AXI_transactor->RST(m_M_AXI_transactor_rst_signal); mp_impl->M_INITIATOR_rd_socket->bind(*(mp_M_AXI_transactor->rd_socket)); mp_impl->M_INITIATOR_wr_socket->bind(*(mp_M_AXI_transactor->wr_socket)); } // configure 'S_AXI' transactor if (xsc::utils::xsc_sim_manager::getInstanceParameterInt("PCIe_Bridge_ICAP_complex_m06_regslice_0", "S_AXI_TLM_MODE") != 1) { xsc::common_cpp::properties S_AXI_transactor_param_props; S_AXI_transactor_param_props.addLong("DATA_WIDTH", "32"); S_AXI_transactor_param_props.addLong("FREQ_HZ", "125000000"); S_AXI_transactor_param_props.addLong("ID_WIDTH", "0"); S_AXI_transactor_param_props.addLong("ADDR_WIDTH", "13"); S_AXI_transactor_param_props.addLong("AWUSER_WIDTH", "0"); S_AXI_transactor_param_props.addLong("ARUSER_WIDTH", "0"); S_AXI_transactor_param_props.addLong("WUSER_WIDTH", "0"); S_AXI_transactor_param_props.addLong("RUSER_WIDTH", "0"); S_AXI_transactor_param_props.addLong("BUSER_WIDTH", "0"); S_AXI_transactor_param_props.addLong("HAS_BURST", "0"); S_AXI_transactor_param_props.addLong("HAS_LOCK", "0"); S_AXI_transactor_param_props.addLong("HAS_PROT", "1"); S_AXI_transactor_param_props.addLong("HAS_CACHE", "0"); S_AXI_transactor_param_props.addLong("HAS_QOS", "0"); S_AXI_transactor_param_props.addLong("HAS_REGION", "0"); S_AXI_transactor_param_props.addLong("HAS_WSTRB", "1"); S_AXI_transactor_param_props.addLong("HAS_BRESP", "1"); S_AXI_transactor_param_props.addLong("HAS_RRESP", "1"); S_AXI_transactor_param_props.addLong("SUPPORTS_NARROW_BURST", "0"); S_AXI_transactor_param_props.addLong("NUM_READ_OUTSTANDING", "1"); S_AXI_transactor_param_props.addLong("NUM_WRITE_OUTSTANDING", "1"); S_AXI_transactor_param_props.addLong("MAX_BURST_LENGTH", "1"); S_AXI_transactor_param_props.addLong("NUM_READ_THREADS", "1"); S_AXI_transactor_param_props.addLong("NUM_WRITE_THREADS", "1"); S_AXI_transactor_param_props.addLong("RUSER_BITS_PER_BYTE", "0"); S_AXI_transactor_param_props.addLong("WUSER_BITS_PER_BYTE", "0"); S_AXI_transactor_param_props.addFloat("PHASE", "0.0"); S_AXI_transactor_param_props.addString("PROTOCOL", "AXI4LITE"); S_AXI_transactor_param_props.addString("READ_WRITE_MODE", "READ_WRITE"); S_AXI_transactor_param_props.addString("CLK_DOMAIN", "PCIe_Bridge_ICAP_complex_clk_wiz_0_0_clk_out_125M"); mp_S_AXI_transactor = new xtlm::xaximm_pin2xtlm_t<32,13,1,1,1,1,1,1>("S_AXI_transactor", S_AXI_transactor_param_props); mp_S_AXI_transactor->ARADDR(s_axi_araddr); mp_S_AXI_transactor->ARPROT(s_axi_arprot); mp_S_AXI_transactor->ARREADY(s_axi_arready); mp_S_AXI_transactor->ARVALID(s_axi_arvalid); mp_S_AXI_transactor->AWADDR(s_axi_awaddr); mp_S_AXI_transactor->AWPROT(s_axi_awprot); mp_S_AXI_transactor->AWREADY(s_axi_awready); mp_S_AXI_transactor->AWVALID(s_axi_awvalid); mp_S_AXI_transactor->BREADY(s_axi_bready); mp_S_AXI_transactor->BRESP(s_axi_bresp); mp_S_AXI_transactor->BVALID(s_axi_bvalid); mp_S_AXI_transactor->RDATA(s_axi_rdata); mp_S_AXI_transactor->RREADY(s_axi_rready); mp_S_AXI_transactor->RRESP(s_axi_rresp); mp_S_AXI_transactor->RVALID(s_axi_rvalid); mp_S_AXI_transactor->WDATA(s_axi_wdata); mp_S_AXI_transactor->WREADY(s_axi_wready); mp_S_AXI_transactor->WSTRB(s_axi_wstrb); mp_S_AXI_transactor->WVALID(s_axi_wvalid); mp_S_AXI_transactor->CLK(aclk); m_S_AXI_transactor_rst_signal.write(1); mp_S_AXI_transactor->RST(m_S_AXI_transactor_rst_signal); mp_impl->S_TARGET_rd_socket->bind(*(mp_S_AXI_transactor->rd_socket)); mp_impl->S_TARGET_wr_socket->bind(*(mp_S_AXI_transactor->wr_socket)); } } PCIe_Bridge_ICAP_complex_m06_regslice_0::~PCIe_Bridge_ICAP_complex_m06_regslice_0() { delete mp_M_AXI_transactor; delete mp_S_AXI_transactor; } #ifdef MTI_SYSTEMC SC_MODULE_EXPORT(PCIe_Bridge_ICAP_complex_m06_regslice_0); #endif
3a7b70210d63083f34e9d6dc6b27c309f92beac8
cb92ee9be36a6f44d33a6ec8798f5183c6adbb1f
/Seek/Include/Platform/OpenGL/OpenGLVertexArray.h
a3cabb6d28c35853e7eb8388616061a2f150b514
[ "MIT" ]
permissive
Nanoteck137/Seek
e95026afcea3e685527495ad84f016be3020e398
eaa8af3f1ba4830734415fd310a6649feb9f1664
refs/heads/master
2022-10-29T18:49:12.186034
2020-06-09T20:49:45
2020-06-09T20:49:45
231,681,786
0
0
null
null
null
null
UTF-8
C++
false
false
1,016
h
#pragma once #include "Seek/Renderer/VertexArray.h" namespace Seek { class OpenGLVertexArray : public VertexArray { public: OpenGLVertexArray(); ~OpenGLVertexArray(); virtual void Bind() override; virtual void Unbind() override; virtual void AddVertexBuffer( const std::shared_ptr<VertexBuffer>& vertexBuffer) override; virtual void AddIndexBuffer( const std::shared_ptr<IndexBuffer>& indexBuffer) override; virtual const std::vector<std::shared_ptr<VertexBuffer>>& GetVertexBuffers() const override { return m_VertexBuffers; } virtual const std::shared_ptr<IndexBuffer>& GetIndexBuffer() const override { return m_IndexBuffer; } private: uint32 m_RendererID; std::vector<std::shared_ptr<VertexBuffer>> m_VertexBuffers; std::shared_ptr<IndexBuffer> m_IndexBuffer; }; }
7cc452a52c756e93a908a9d0c774bacd9b80bfbd
2f4675eeabed9f27d842f62e12406a8a9a8914c3
/modules/bluespec/common/fpgaenv/physical-platform/pcie/dualPCIE/dual-pcie-physical-platform.cpp
9d27acee05e4437bda83acd9c7e35c20fbfe5158
[]
no_license
LEAP-Core/leap-multifpga
3e14bd9914a5db4fd35f06c6f959cd967caef943
088da16cf13fe3c231ac10a24ea8e66e3becced5
refs/heads/master
2020-12-25T17:23:35.546287
2016-10-06T01:26:43
2016-10-06T01:26:43
30,680,219
1
0
null
null
null
null
UTF-8
C++
false
false
260
cpp
#include "asim/provides/physical_platform.h" PHYSICAL_DEVICES_CLASS::PHYSICAL_DEVICES_CLASS( PLATFORMS_MODULE p) : PLATFORMS_MODULE_CLASS(p), pcieDevice0(this), pcieDevice1(this) { } PHYSICAL_DEVICES_CLASS::~PHYSICAL_DEVICES_CLASS() { }
e42779b3116ee21189ab2fdae56848bbe7fc9457
a274fd82e8cee3f2719b930a33ddd53f6d9565e4
/날짜 구하기.cpp
e1086da01088d876438f789bed69ebb30000a98d
[]
no_license
jmini1234/algorithm
b0a7f52b9169bf5f161952c85344b34a28017610
9f07c0e60ce1e2d45919ce1cf514151cf276b3a7
refs/heads/master
2021-07-21T06:54:23.690904
2021-01-11T16:29:29
2021-01-11T16:29:29
234,711,775
1
0
null
null
null
null
UTF-8
C++
false
false
420
cpp
#include <string> #include <vector> #include <string> using namespace std; // 각 달마다 요일 수 int month[12] = {31,29,31,30,31,30,31,31,30,31,30,31}; string day[7] = {"FRI","SAT","SUN","MON","TUE","WED","THU"}; string solution(int a, int b) { string answer = ""; int date = 0; for(int i=0;i<a-1;i++) date+=month[i]; date = date + b - 1; answer += day[date%7]; return answer; }
9cd3ebb302913831ef729df8a41520958897ddd0
8604086ebd38fa9572d9fde24d023bbefdc39fc8
/src/Udp_server.hpp
aa7852aade3e03f7945e6ad35e65b05e27f0a60d
[]
no_license
SlavaShake/chat
33110fc3193668b23f4ef3a10116c95e3f4e34a7
f834538667b0fbd2ec936a4a0e8fb11984e77b33
refs/heads/master
2020-03-10T08:06:51.941367
2018-04-12T12:16:29
2018-04-12T12:16:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
948
hpp
#pragma once #include <boost/asio.hpp> #include <string> #include <vector> using boost::asio::ip::udp; class Udp_server { public: Udp_server(boost::asio::io_service& io_service, const std::string& host, const std::string& port) : io_service_(io_service), socket_(io_service, udp::endpoint(udp::v4(), 8080)) { udp::resolver resolver(io_service_); udp::resolver::query query(udp::v4(), host, port); udp::resolver::iterator iter = resolver.resolve(query); remote_endpoint_ = *iter; } ~Udp_server() { socket_.close(); } void send(const std::string& msg) { socket_.send_to(boost::asio::buffer(msg, msg.size()), remote_endpoint_); } void receive(std::string& msg) { socket_.receive_from(boost::asio::buffer(msg, msg.size()), remote_endpoint_); } private: boost::asio::io_service& io_service_; udp::socket socket_; udp::endpoint remote_endpoint_; std::vector<char> recv_buffer_; };
f4b1c83a83e506bb5f8256e218c92f27cf376876
5ef9af5104c54170731947703655ab87275ceff8
/modules/realtime_retarget/editor/post_import_plugin_realtime_retarget.h
82c2052b05fd880d02d2d9be99d6a227baf52036
[ "MIT", "CC-BY-4.0", "BSD-3-Clause", "LicenseRef-scancode-unicode", "FTL", "CC0-1.0", "GPL-3.0-or-later", "Zlib", "GPL-3.0-only", "Bitstream-Vera", "MPL-2.0", "MIT-Modern-Variant", "BSL-1.0", "Apache-2.0", "LicenseRef-scancode-public-domain", "LicenseRef-scancode-nvidia-2002", "BSD-2-Clause", "LicenseRef-scancode-other-permissive", "OFL-1.1", "Bison-exception-2.2", "LicenseRef-scancode-unknown-license-reference", "Unlicense", "LicenseRef-scancode-free-unknown" ]
permissive
V-Sekai/godot
36f6fffbb41c51d108b00f500e26988630d6d1cf
420ceccb88abec7108c7c09c9c33b2a33d98f926
refs/heads/groups-4.x
2023-09-04T08:49:58.976453
2023-07-14T18:16:56
2023-07-14T18:16:56
289,429,789
13
6
MIT
2023-02-23T07:49:06
2020-08-22T05:59:10
C++
UTF-8
C++
false
false
3,140
h
/*************************************************************************/ /* post_import_plugin_realtime_retarget.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef POST_IMPORT_PLUGIN_REALTIME_RETARGET_H #define POST_IMPORT_PLUGIN_REALTIME_RETARGET_H #include "editor/import/resource_importer_scene.h" class PostImportPluginRealtimeRetarget : public EditorScenePostImportPlugin { GDCLASS(PostImportPluginRealtimeRetarget, EditorScenePostImportPlugin); HashMap<String, String> rename_map; public: virtual void get_internal_import_options(InternalImportCategory p_category, List<ResourceImporter::ImportOption> *r_options) override; virtual void internal_process(InternalImportCategory p_category, Node *p_base_scene, Node *p_node, Ref<Resource> p_resource, const Dictionary &p_options) override; virtual void pre_process(Node *p_scene, const HashMap<StringName, Variant> &p_options) override; virtual void post_process(Node *p_scene, const HashMap<StringName, Variant> &p_options) override; PostImportPluginRealtimeRetarget(); }; #endif // POST_IMPORT_PLUGIN_REALTIME_RETARGET_H
d48eed5a627d537ccfc63d521fa8a58c1b535ffb
751fe73c7a0188dfe27c9fe78c0410b137db91fb
/compile/text/text/File.h
6098433bfd33802eb397c241b54c5f6ec27453f4
[]
no_license
longshadian/estl
0b1380e9dacfc4e193e1bb19401de28dd135fedf
3dba7a84abc8dbf999ababa977279e929a0a6623
refs/heads/master
2021-07-09T19:29:06.402311
2021-04-05T14:16:21
2021-04-05T14:16:21
12,356,617
3
1
null
null
null
null
UTF-8
C++
false
false
463
h
#pragma once #include <experimental/filesystem> namespace fs = std::experimental::filesystem::v1; class File { public: File(); ~File() = default; bool Open(const char* path); unsigned int Length(); unsigned int Read(void* buffer, unsigned int length); const std::string& FileName() const; static fs::path CreatePath(const char* path); private: fs::path m_full_path; std::string m_file_name; };
eb00d0d632cfcdde23f683f5cf7fb2161bd1a7ba
86973b5e24a65d96d35954a5ab1a5f3bce14f640
/cpp/opengl/learnopengl.com/Common/Texture2D.h
0ca091e1993505542c471aadbca42ce968c72095
[]
no_license
OkabeRintarou/snippet
049ecacaa398d2d23ca855cc06e0cd3b01aa0f7a
f6eeb33d8c7c6c14ffdb44a9616b3700c3cc28b7
refs/heads/master
2023-07-07T08:26:46.681317
2023-05-09T07:47:10
2023-05-09T07:47:10
56,693,112
0
0
null
null
null
null
UTF-8
C++
false
false
451
h
#pragma once #include <string> #include "Object.h" class Texture2D : public Object { public: explicit Texture2D(const char * const filename); ~Texture2D() noexcept override; std::string message() const override; Texture2D(const Texture2D&) = delete; void operator=(const Texture2D &) = delete; Texture2D(Texture2D &&) = delete; void operator=(Texture2D &&) = delete; void bind(int tex_index); private: std::string error_msg_; };
6e6233101a4876db95df1abb07a02453e37e8644
ba6811ba81f078d49d29de0c7d365a766ae41a50
/lib.h
a423fdcef56284573b9dfbef4648a42cc0c0d347
[]
no_license
japdhaes/dsap-project2
092c337ad60ca9c91fd90456ed4e95b0c6085500
ff95acc7308a6c0184b59dcc58259f53e7cad247
refs/heads/master
2021-01-01T15:59:57.676467
2013-03-14T15:59:57
2013-03-14T15:59:57
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,183
h
/* * The definition module * lib.h * for the library function common for all C programs. */ // Standard ANSI-C++ include files #ifndef LIB_H #define LIB_H #include <iostream> #include <new> #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> using namespace std; #define NULL_PTR (void *) 0 #define ZERO 1.0E-10 //#define INFINITY 1.0E15 #define UL unsigned long /* a macro used in function pythag() */ static float sqrarg; #define SQR(a) ((sqrarg = (a)) == 0.0 ? 0.0 : sqrarg * sqrarg) /* Macro definitions for integer arguments only */ #define SIGN(a,b) ((b)<0 ? -fabs(a) : fabs(a)) // ****** data declaration ******* typedef struct { // structure definition for execution time unsigned long long int tick, sec, min, hour; } TID; // Function declarations TID time_step(int num); void **matrix(int, int, int); void free_matrix(void **); void rk4(double *, double *, int, double, double, double *, void (*derivs)(double, double *, double *)); void ludcmp(double **, int, int *, double*); void lubksb(double **, int, int *, double *); void tqli(double *, double *, int, double **); void tred2(double **, int, double *, double *); double pythag(double, double); void gauleg(double, double, double *, double *, int); void jacobi(double** a, double* d, double** v, int n, int& nrot); double rectangle_rule(double, double, int, double (*func)(double)); double trapezoidal_rule(double, double, int, double (*func)(double)); void spline(double *, double *, int, double, double, double *); void splint(double *, double *, double *, int, double, double *); void polint(double *, double *, int, double, double *, double *); double rtbis(double(*func)(double), double, double, double); double rtsec(double( *func)(double), double, double, double); double rtnewt(void ( *funcd)(double, double *, double *), double, double, double); double zbrent(double( *func)(double), double, double, double); double ran0(long *); double ran1(long *); double ran2(long *); double ran3(long *); #endif
e5914db3c6b1665326e12ba5527a44535a0a832a
e328eb2219b439668792c0c719b1f8bb3703c550
/ITCM_finalcode_v2/IMUread.ino
3fd6638d1e97bfebaeeff0afafcd593f1e787af4
[]
no_license
Vishwesh-P/ITCM_by_Adam
af8e85de28c98af0e71f408e5b106cb99098f3b0
88a26c3058799f1db9ae623727e3c6576ea695ff
refs/heads/master
2022-04-23T14:31:51.711125
2020-04-29T15:56:20
2020-04-29T15:56:20
256,580,814
0
2
null
null
null
null
UTF-8
C++
false
false
1,116
ino
// Read IMU C void readImu() { // Start loop timer unsigned long loopStartTime = micros(); // Get a new sensor event accelmag.getEvent(&aEvent, &mEvent); // Measured in m/s^2 and uTesla gyro.getEvent(&gEvent); // Measured in rad/s // Add to statistics object axStats.add(aEvent.acceleration.x); ayStats.add(aEvent.acceleration.y); azStats.add(aEvent.acceleration.z); mxStats.add(mEvent.magnetic.x); myStats.add(mEvent.magnetic.y); mzStats.add(mEvent.magnetic.z); gxStats.add(gEvent.gyro.x); gyStats.add(gEvent.gyro.y); gzStats.add(gEvent.gyro.z); // // Write data to union // message.gyroFlag = 0b01100101; // Just an example // Place accelerometer and gyroscope in low-power (standby) mode accelmag.standby(1); gyro.standby(1); #ifdef DEBUG Serial.print(F("Added delay in IMU loop: 500 msec")); delay(500); //needed here ?? #endif // Stop loop timer unsigned long loopEndTime = micros() - loopStartTime; Serial.print(F("readImu() executed in: ")); Serial.print(loopEndTime); Serial.println(F(" μs")); }
5456e7a251f897bca70743cd38a90fc7c55a6a12
1b57b79d78a531d17600c614f18d5a37a020d291
/src/s_sound.c
a0f4cf3b4f7fa3869467c2cbd66e80c4924a4dd9
[]
no_license
MP2E/kexplus
930061ac12b8fa849b4dcd04ec91ab1e2e13b554
df46ae761d607c991b33d911ed3fa6c0570f4738
refs/heads/master
2021-01-10T20:35:43.395429
2015-02-16T22:43:42
2015-02-16T22:43:42
14,457,806
4
1
null
2014-03-20T20:10:10
2013-11-16T23:52:09
C
UTF-8
C++
false
false
7,599
c
// Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // // Copyright(C) 1993-1997 Id Software, Inc. // Copyright(C) 2007-2014 Samuel Villarreal // // 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. // //----------------------------------------------------------------------------- // // DESCRIPTION: In-game Sound behavior // //----------------------------------------------------------------------------- #include <stdio.h> #include <stdlib.h> #include "i_system.h" #include "sounds.h" #include "s_sound.h" #include "z_zone.h" #include "m_fixed.h" #include "m_random.h" #include "w_wad.h" #include "doomdef.h" #include "p_local.h" #include "doomstat.h" #include "tables.h" #include "r_local.h" #include "m_misc.h" #include "p_setup.h" #include "i_audio.h" #include "con_console.h" // Adjustable by menu. #define NORM_VOLUME 127 #define NORM_SEP 128 // when to clip out sounds // Does not fit the large outdoor areas. #define S_CLIPPING_DIST (1700<<FRACBITS) // Distance to origin when sounds should be maxed out. // This should relate to movement clipping resolution // (see BLOCKMAP handling). #define S_MAX_DIST (NORM_VOLUME * (S_CLIPPING_DIST >> FRACBITS)) // [d64] #define S_CLOSE_DIST (200 << FRACBITS) #define S_ATTENUATOR ((S_CLIPPING_DIST - S_CLOSE_DIST) >> FRACBITS) #define S_PITCH_PERTURB 1 #define S_STEREO_SWING (96*0x10000) // percent attenuation from front to back #define S_IFRACVOL 30 static dboolean nosound = false; static dboolean nomusic = false; static int lastmusic = 0; CVAR_CMD(s_sfxvol, 80) { if (cvar->value < 0.0f) return; S_SetSoundVolume(cvar->value); } CVAR_CMD(s_musvol, 80) { if (cvar->value < 0.0f) return; S_SetMusicVolume(cvar->value); } CVAR_CMD(s_gain, 1) { if (cvar->value < 0.0f) return; S_SetGainOutput(cvar->value); } // // Internals. // int S_AdjustSoundParams(fixed_t x, fixed_t y, int *vol, int *sep); // // S_Init // // Initializes sound stuff, including volume // and the sequencer // void S_Init(void) { if (M_CheckParm("-nosound")) { nosound = true; CON_DPrintf("Sounds disabled\n"); } if (M_CheckParm("-nomusic")) { nomusic = true; CON_DPrintf("Music disabled\n"); } if (nosound && nomusic) return; I_InitSequencer(); S_SetMusicVolume(s_musvol.value); S_SetSoundVolume(s_sfxvol.value); S_SetGainOutput(s_gain.value); } // // S_SetSoundVolume // void S_SetSoundVolume(float volume) { I_SetSoundVolume(volume); } // // S_SetMusicVolume // void S_SetMusicVolume(float volume) { I_SetMusicVolume(volume); } // // S_SetGainOutput // void S_SetGainOutput(float db) { I_SetGain(db); } // // S_StartMusic // void S_StartMusic(int mnum) { if (nomusic) return; if (mnum <= -1) return; I_StartMusic(mnum); lastmusic = mnum; } // // S_StopMusic // void S_StopMusic(void) { I_StopSound(NULL, lastmusic); lastmusic = 0; } // // S_ResetSound // void S_ResetSound(void) { int i; if (nosound && nomusic) return; I_ResetSound(); // villsa 12282013 - make sure we clear all sound sources // during level transition for (i = 0; i < I_GetMaxChannels(); i++) I_RemoveSoundSource(i); } // // S_PauseSound // void S_PauseSound(void) { if (nosound && nomusic) return; I_PauseSound(); } // // S_ResumeSound // void S_ResumeSound(void) { if (nosound && nomusic) return; I_ResumeSound(); } // // S_StopSound // void S_StopSound(mobj_t * origin, int sfx_id) { I_StopSound((sndsrc_t *) origin, sfx_id); } // // S_GetActiveSounds // int S_GetActiveSounds(void) { return I_GetVoiceCount(); } // // S_RemoveOrigin // void S_RemoveOrigin(mobj_t * origin) { int channels; mobj_t *source; int i; channels = I_GetMaxChannels(); for (i = 0; i < channels; i++) { source = (mobj_t *) I_GetSoundSource(i); if (origin == source) I_RemoveSoundSource(i); } } // // S_UpdateSounds // void S_UpdateSounds(void) { int i; int audible; int volume; int sep; mobj_t *source; int channels; channels = I_GetMaxChannels(); for (i = 0; i < channels; i++) { source = (mobj_t *) I_GetSoundSource(i); if (source == NULL) continue; // initialize parameters volume = NORM_VOLUME; sep = NORM_SEP; // check non-local sounds for distance clipping // or modify their params if (source == players[consoleplayer].mo && players[consoleplayer].cameratarget == players[consoleplayer].mo) { audible = 1; sep = NORM_SEP; } else audible = S_AdjustSoundParams(source->x, source->y, &volume, &sep); if (audible) I_UpdateChannel(i, volume, sep); } } // // S_StartSound // void S_StartSound(mobj_t * origin, int sfx_id) { int volume; int sep; int reverb; if (nosound) return; if (origin && origin != players[consoleplayer].cameratarget) { if (!S_AdjustSoundParams(origin->x, origin->y, &volume, &sep)) return; } else { sep = NORM_SEP; volume = NORM_VOLUME; } reverb = 0; if (origin) { subsector_t *subsector; subsector = R_PointInSubsector(origin->x, origin->y); if (subsector->sector->flags & MS_REVERB) reverb = 16; else if (subsector->sector->flags & MS_REVERBHEAVY) reverb = 32; } // Assigns the handle to one of the channels in the mix/output buffer. I_StartSound(sfx_id, (sndsrc_t *) origin, volume, sep, reverb); } // // S_AdjustSoundParams // // Changes volume, stereo-separation, and pitch variables // from the norm of a sound effect to be played. // If the sound is not audible, returns a 0. // Otherwise, modifies parameters and returns 1. // int S_AdjustSoundParams(fixed_t x, fixed_t y, int *vol, int *sep) { fixed_t approx_dist; angle_t angle; mobj_t *listener; player_t *player; player = &players[consoleplayer]; listener = player->cameratarget; // calculate the distance to sound origin // and clip it if necessary // From _GG1_ p.428. Appox. eucledian distance fast. approx_dist = P_AproxDistance(listener->x - x, listener->y - y); if (approx_dist > S_CLIPPING_DIST) return 0; if (listener->x != x || listener->y != y) { // angle of source to listener angle = R_PointToAngle2(listener->x, listener->y, x, y); if (angle <= listener->angle) angle += 0xffffffff; angle -= listener->angle; // stereo separation *sep = (NORM_VOLUME + 1) - (FixedMul(S_STEREO_SWING, dsin(angle)) >> FRACBITS); } else *sep = NORM_SEP; // volume calculation if (approx_dist < S_CLOSE_DIST) *vol = NORM_VOLUME; else { // distance effect approx_dist >>= FRACBITS; *vol = (((-approx_dist << 7) + (approx_dist)) + S_MAX_DIST) / S_ATTENUATOR; } return (*vol > 0); } // // S_RegisterCvars // CVAR_EXTERNAL(s_soundfont); CVAR_EXTERNAL(s_driver); void S_RegisterCvars(void) { CON_CvarRegister(&s_sfxvol); CON_CvarRegister(&s_musvol); CON_CvarRegister(&s_gain); CON_CvarRegister(&s_soundfont); CON_CvarRegister(&s_driver); }
3af5f672c856fa9f51d3104a705cb9617ad13ce3
a0515b77831cd7654096201cfacca8ef04762ae0
/sketch_mar09c/sketch_mar09c.ino
ee3ae0bda55c0bb6b41008ff982fbd7f697a437b
[]
no_license
jankowskirobert/ArduinoISA
07cdabd66b3dcfdbc8d76e8c02eb52276a1a7744
48aced37dc4169b1b212a2d31e5d8db8d2e69dbd
refs/heads/master
2021-01-22T19:42:04.892038
2018-01-09T19:15:20
2018-01-09T19:15:20
85,230,476
1
2
null
null
null
null
UTF-8
C++
false
false
764
ino
#include <DueTimer.h> #include "Buttons.h" Buttons button ; int actualLED = 2; int destination = 1; int maxLED = 10; int minLED = 1; bool state = false; void dioda(){ digitalWrite(actualLED, LOW); //state = !state; actualLED += destination; digitalWrite(actualLED, HIGH); if(actualLED==maxLED) destination = -1; if(actualLED==minLED) destination = 1; } void setup(){ pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(7, OUTPUT); pinMode(8, OUTPUT); pinMode(9, OUTPUT); Timer4.attachInterrupt(dioda); Timer4.start(1000000); button.init(); } void loop(){ if (button.buttonPressed(0)) { destination = 1; } if (button.buttonPressed(1)) { destination = -1; } delay(25); }
afdcc43ee43eecc11b2eecb69170c6daedd4fd62
69740a5b14d963b51ac0b8d956c205d3b7879353
/contrib/CCF/CCF/IDL2/SemanticAction/Const.hpp
f3561a484e23c6285ad963cce1a57ffefbcdd7d8
[]
no_license
SEDS/OASIS
eba334ae59e69fc66d1e355fedb5ad5583b40695
ddf365eea9874fa5938072fea1fad5b41c27f3e9
refs/heads/master
2020-12-24T15:51:12.761878
2013-12-03T20:30:21
2013-12-03T20:30:21
13,195,236
4
3
null
2015-10-24T09:40:39
2013-09-29T15:58:55
C++
UTF-8
C++
false
false
685
hpp
// file : CCF/IDL2/SemanticAction/Const.hpp // author : Boris Kolpackov <[email protected]> // cvs-id : $Id: Const.hpp 77342 2007-02-22 22:16:47Z wotte $ #ifndef CCF_IDL2_SEMANTIC_ACTION_CONST_HPP #define CCF_IDL2_SEMANTIC_ACTION_CONST_HPP #include "CCF/IDL2/SemanticAction/Elements.hpp" namespace CCF { namespace IDL2 { namespace SemanticAction { struct Const { virtual ~Const () { } virtual void begin (IdentifierPtr const& type, SimpleIdentifierPtr const& name) = 0; virtual void expr () = 0; }; } } } #endif // CCF_IDL2_SEMANTIC_ACTION_CONST_HPP
fcb5a428a3a63539f770941810ed80b33fdc800a
9aad79f52bb64c7b38f24bff1baee3bcb3ef68d7
/src/Game.hpp
5704b15946a7bb4c466727be5205f61c01eb1975
[]
no_license
Shusui/office-boredom
c8eca9510ccc19ec2821ff521beab43015ad47a9
2e30d367fba03c7d83aaaae7c8d80bd27799459d
refs/heads/master
2020-03-30T13:43:34.137567
2014-01-26T18:39:36
2014-01-26T18:39:36
null
0
0
null
null
null
null
UTF-8
C++
false
false
611
hpp
#ifndef GAME_HPP #define GAME_HPP #include <stdio.h> #include <time.h> #include <SFML/Window.hpp> #include <SFML/Graphics.hpp> #include "State.hpp" #include "TextureFactory.hpp" using namespace std; class Game { private: string title; public: Game(); void run(); int findNumberOfMaps(); sf::RenderWindow window; State *currentState; bool windowFocused; sf::Clock deltaClock; float lastTime; float dt; float fps; sf::Font arialFont; sf::Font pixelFont; bool scrolledUp; bool scrolledDown; TextureFactory myTextureFactory; }; #endif
e62d74548790afb83d728246d23bee532b0824b2
d193cbf5643a8eeb9583c50932b08cd3fd7efb42
/Injector/stdafx.cpp
ec9c9a9449b9429b11831d700a5a493092d485f3
[]
no_license
jae900/Switch_Printer
934f03d5c16c474789d1b2e8e9e50530b97a69cd
18d1c42a9cef0b6701422f8a671c91668a1dc4b9
refs/heads/master
2022-11-27T13:16:36.895537
2020-07-31T23:19:47
2020-07-31T23:19:47
284,473,345
0
0
null
null
null
null
UHC
C++
false
false
331
cpp
// stdafx.cpp : 표준 포함 파일만 들어 있는 소스 파일입니다. // PrinterHelper.pch는 미리 컴파일된 헤더가 됩니다. // stdafx.obj에는 미리 컴파일된 형식 정보가 포함됩니다. #include "stdafx.h" // TODO: 필요한 추가 헤더는 // 이 파일이 아닌 STDAFX.H에서 참조합니다.
d49f5c2a4e2aa7ab14b9e11d898141674c3799a5
f2a32a2e132f1ee38a4f82987411f1d41af11002
/sghero/Classes/AppDelegate.cpp
a4fa4fb643e2648f9cccfe7b9f2483bbaa89a9f3
[]
no_license
cuongnv-ict/sghero
7dd6aed31d700c68cfd4fd3473947040a52baa3f
caa1bac760c2a64346911a96a309f49a7a162a46
refs/heads/master
2021-01-17T05:46:55.158292
2014-11-21T03:49:02
2014-11-21T03:49:02
null
0
0
null
null
null
null
WINDOWS-1252
C++
false
false
2,066
cpp
#include "AppDelegate.h" #include "SGWelcomeScene.h" #include "CCLuaEngine.h" #include "SGGlobalSettings.h" #include "lua-bindings/lua_sgshero_auto.hpp" using namespace CocosDenshion; using namespace std; USING_NS_CC; AppDelegate::AppDelegate() { } AppDelegate::~AppDelegate() { } bool AppDelegate::applicationDidFinishLaunching() { // initialize director auto director = Director::getInstance(); auto glview = director->getOpenGLView(); if(!glview) { glview = GLView::create("Èý¹úÓ¢ÐÛ´«Ææ"); glview->setFrameSize(WINDOW_WIDTH, WINDOW_HEIGHT); director->setOpenGLView(glview); } // turn on display FPS director->setDisplayStats(true); // set FPS. the default value is 1.0/60 if you don't call this director->setAnimationInterval(1.0 / 60); // register lua engine LuaEngine* pEngine = LuaEngine::getInstance(); ScriptEngineManager::getInstance()->setScriptEngine(pEngine); pEngine->addSearchPath(SG_LUA_SCRIPTS_PATH); register_all_SGSHero(pEngine->getLuaStack()->getLuaState()); pEngine->executeScriptFile("DeprecatedEnum.lua"); pEngine->executeScriptFile("DeprecatedClass.lua"); pEngine->executeScriptFile("Deprecated.lua"); pEngine->executeScriptFile("init_sg.lua"); // create a scene. it's an autorelease object auto scene = SGWelcomeScene::createScene(); // run director->runWithScene(scene); return true; } // This function will be called when the app is inactive. When comes a phone call,it's be invoked too void AppDelegate::applicationDidEnterBackground() { Director::getInstance()->stopAnimation(); // if you use SimpleAudioEngine, it must be pause // SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); } // this function will be called when the app is active again void AppDelegate::applicationWillEnterForeground() { Director::getInstance()->startAnimation(); // if you use SimpleAudioEngine, it must resume here // SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); }
000b6e69f94292ad9ccb69cc71049b1bab80441d
b1ecf5efbcacbb274898e29e7ee542e59ef93916
/Codeforces/1433E.cpp
1715f13b8643d9847e7c713535a5fb5f5134af1a
[]
no_license
abufarhad/Programming
92160c224578be116b2bb1e957ea105640a83ee6
282bf4df6c47817cb5d96ccee7dc2953438e8e11
refs/heads/master
2021-06-16T17:07:14.095691
2021-03-23T17:22:13
2021-03-23T17:22:13
180,426,830
3
0
null
null
null
null
UTF-8
C++
false
false
2,082
cpp
//! Bismillahi-Rahamanirahim. /** ========================================** ** @Author: Md. Abu Farhad ( RUET, CSE'15) ** @Category: /** ========================================**/ #include<bits/stdc++.h> #include<stdio.h> #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") using namespace std; #define ll long long #define scl(n) scanf("%lld",&n) #define scll(n, m) scanf("%lld%lld",&n, &m) #define scc(c) scanf("%c",&c) #define fr(i,n) for (ll i=0;i<n;i++) #define fr1(i,n) for(ll i=1;i<=n;i++) #define pfl(x) printf("%lld\n",x) #define pb push_back #define debug cout<<"I am here"<<endl; #define pno cout<<"NO"<<endl #define pys cout<<"YES"<<endl #define tcas(i,t) for(ll i=1;i<=t;i++) #define all(x) (x).begin(), (x).end() #define allrev(x) (x).rbegin(),(x).rend() #define pr pair<ll, ll> #define ff first #define ss second #define pn printf("\n") #define l(s) s.size() #define asort(a) sort(a,a+n) #define dsort(a) sort(a,a+n,greater<int>()) #define uniquee(x) x.erase(unique(x.begin(), x.end()),x.end()) #define el cout<<endl #define md 1000000007 #define inf 1e18 #define ps cout<<" "; #define Pai acos(-1.0) #define mem(a,i) memset(a, i, sizeof(a)) #define pcas(i) cout<<"Case "<<i<<": "<<endl; #define seg_tree(n) ll left=n*2,right=l+1,mid=(l+r)/2 #define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL) #define N 200005 int main() { ll t; //cin>>t; t=1; tcas(cs, t) { ll m,n,b,c,d,i,j,k,x,y,z,l,r, p, q; string s,s1, s2, s3, s4; ll cnt=0,cn=0,ans=0,sum=0 ; cin>>n; ans=1; fr1(i , n-1)ans*=i; ans/=(n/2 ); cout<<ans;pn; } return 0; }
1a6a7d38ca01a2af636df3754e9a278f4ea8028a
0d89c8127f6883812e755ada997815db3beab4b2
/gameFiles/arc.cpp
8a87a0dd2b1bb5a7173d73cbc773ccfb395ea46a
[]
no_license
ChanceRbrts/Sodium_Room
b8f43213e194e3e08dce22f451dde4abcb774d7e
02df1b81f68b3fd1f087429ee59bc3b9d7fc790e
refs/heads/master
2023-04-12T17:44:32.189458
2021-02-08T19:46:13
2021-02-08T19:46:13
238,605,972
0
1
null
2020-10-11T01:34:07
2020-02-06T04:17:15
C++
UTF-8
C++
false
false
3,655
cpp
#include "arc.h" Arc::Arc(double X, double Y, double R, double D1, double D2, double RC, double GC, double BC, bool mono){ x = X*32; y = Y*32; r = R*32; maxR = r; d1 = D1; d2 = D2; connected = true; rCol = RC; gCol = GC; bCol = BC; alpha = 1; monocolor = mono; defBehavior = false; blendArc = true; pointDouble center = getCenterOfMass(); cX = center.x; cY = center.y; changeCenter = false; } Arc::~Arc(){ } void Arc::setPosition(double X, double Y){ x = X; y = Y; changeCenter = true; } void Arc::setR(double R){ r = (R > maxR) ? maxR : R; changeCenter = true; } void Arc::setAngle(double D1, double D2){ d1 = fmod(D1+3*M_PI, M_PI*2)-M_PI; d2 = fmod(D2+3*M_PI, M_PI*2)-M_PI; changeCenter = true; } void Arc::draw(GLUtil* glu, ShaderBox* mainTex, DualSBox drawTo, int fromTex, int fromAlpha){ // printf("%f, %f, %f!\n", x, y, r); /* if (shade == nullptr){ shade = new ShaderBox(0, 0, maxR*1.1/16, maxR*1.1/16, "", "arc", glu); } */ // Set the uniform values. mainTex->addUniform("x", x); mainTex->addUniform("y", y); mainTex->addUniform("rad", r); mainTex->addUniform("d1", d1); mainTex->addUniform("d2", d2); mainTex->addUniform("r", rCol); mainTex->addUniform("g", gCol); mainTex->addUniform("b", bCol); mainTex->addUniform("a", alpha); // This feels wrong somehow... mainTex->addUniform("xScale", 1); mainTex->addUniform("yScale", 1); mainTex->addUniform("mono", monocolor); mainTex->addUniformI("prevTex", 1); mainTex->addUniformI("prevAlpha", 2); mainTex->addUniform("alphaTex", false); mainTex->addUniform("blend", blendArc); mainTex->addUniform("camX", glu->draw->camX); mainTex->addUniform("camY", glu->draw->camY); mainTex->addUniform("unitX", 2/glu->draw->getWidth()); mainTex->addUniform("unitY", -2/glu->draw->getHeight()); // Actually draw the arc onto the drawTo shaderbox. glu->draw->color(1, 1, 1, 1); drawTo.first->drawOnBox(); glu->draw->enableTextures(); glu->draw->bindTexture(fromTex, 1); glu->draw->bindTexture(fromAlpha, 2); mainTex->draw(); drawTo.first->drawOutBox(); mainTex->addUniform("alphaTex", true); drawTo.second->drawOnBox(); // We don't need to reset camX, camY, ... // since .second should have the same values as .first glu->draw->enableTextures(); glu->draw->bindTexture(fromTex, 1); glu->draw->bindTexture(fromAlpha, 2); mainTex->draw(); drawTo.second->drawOutBox(); // shade->moveShaderBox(x-maxR*1.1, y-maxR*1.1, false); } void Arc::setColor(double R, double G, double B){ rCol = R >= 0 ? R : rCol; gCol = G >= 0 ? G : gCol; bCol = B >= 0 ? B : bCol; } void Arc::setAlpha(double A){ alpha = A > 1 ? 1 : (A < 0 ? 0 : A); } void Arc::makeDefault(){ defBehavior = true; } void Arc::setBlend(bool blend){ blendArc = blend; } pointDouble Arc::getCenterOfMass(){ // Get the radians in between D1 and D2 first double D2 = d2 + (d1 >= d2 ? M_PI*2 : 0); double alpha = (D2-d1)/2; double cnAng = (D2+d1)/2; // From Wikipedia's list of centroids double rad = 2*r*sin(alpha)/(3*alpha); changeCenter = false; // Rotate by the average degree and translate by the arc position! return (pointDouble){x+rad*cos(cnAng), y+rad*sin(cnAng), 0}; } ArcInfo Arc::getInfo(int id){ if (changeCenter){ pointDouble p = getCenterOfMass(); cX = p.x; cY = p.y; } return (ArcInfo){id, cX, cY, rCol, gCol, bCol, alpha, monocolor, defBehavior}; }
623110150dfa73ea06ecb5031bac78040c93b817
140d78334109e02590f04769ec154180b2eaf78d
/aws-cpp-sdk-waf-regional/source/model/UpdateRuleResult.cpp
5b9307288d5e3e9c24335c290def6dcdebb751f3
[ "Apache-2.0", "MIT", "JSON" ]
permissive
coderTong/aws-sdk-cpp
da140feb7e5495366a8d2a6a02cf8b28ba820ff6
5cd0c0a03b667c5a0bd17394924abe73d4b3754a
refs/heads/master
2021-07-08T07:04:40.181622
2017-08-22T21:50:00
2017-08-22T21:50:00
101,145,374
0
1
Apache-2.0
2021-05-04T21:06:36
2017-08-23T06:24:37
C++
UTF-8
C++
false
false
1,382
cpp
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/waf-regional/model/UpdateRuleResult.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/core/AmazonWebServiceResult.h> #include <aws/core/utils/StringUtils.h> #include <aws/core/utils/UnreferencedParam.h> #include <utility> using namespace Aws::WAFRegional::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; UpdateRuleResult::UpdateRuleResult() { } UpdateRuleResult::UpdateRuleResult(const AmazonWebServiceResult<JsonValue>& result) { *this = result; } UpdateRuleResult& UpdateRuleResult::operator =(const AmazonWebServiceResult<JsonValue>& result) { const JsonValue& jsonValue = result.GetPayload(); if(jsonValue.ValueExists("ChangeToken")) { m_changeToken = jsonValue.GetString("ChangeToken"); } return *this; }
cdfb447ef98b1a87c1a21d536e692472beaa5239
27d64f8eca2a0ef010f173e932cd2e742d04acbc
/Arduino0S/Arduino0S.ino
74d00d4865a94834161fb9583281f7a3676814eb
[]
no_license
malcolmknapp/ArduinoOS
19f2b72fcd784a13167043ff45aef77f0206f7e1
4259b302b9d1e918fe460eac24bbd56ace3837e4
refs/heads/master
2023-03-06T02:09:03.366458
2021-02-16T21:29:36
2021-02-16T21:29:36
339,530,576
0
0
null
null
null
null
UTF-8
C++
false
false
5,296
ino
//************************************************** /* Author: Malcolm Knapp Project: Date: Version: Description: */ //*************************************************** typedef unsigned char byte; unsigned long BASE_INTERVAL = 1000; // timer tick for the whole system set at 1s. Set to 1000 for release unsigned long baseLastIntervalStart = 1000; byte seconds = 0; byte minutes = 0; byte hours = 0; byte days = 0; unsigned long interval1_last_start_time = 0; unsigned long INTERVAL1_DURATION = 5*1000; // in milliseconds boolean timer1_on = false; enum { // States STATE1 = 1, STATE2 } STATES; enum { event1 = 0, event2, NONE } EVENTS; byte state = STATE1; // Tracks current state byte prevState = STATE1; byte event = NONE; // Triggers a particular action within current state String userInput = ""; boolean cmdFlag = false; String cmdType = ""; String cmdSubType =""; String cmdBody = ""; //********************************************************************************************** /* Timers: */ //********************************************************************************************** void updatePeriodicTimers () { //Serial.println("1 second"); if (seconds == 60) { seconds = 0; minutes++; } else { seconds++; } if (minutes == 60) { minutes = 0; hours++; } if (hours == 24) { hours = 0; days++; } if (seconds == 10) { // set event } } void updateIntervalTimers () { if (millis() - interval1_last_start_time > INTERVAL1_DURATION && timer1_on) { // set event } } void updateState () { switch (state) { //********************************************************************************************** /* State Machine Description: */ //********************************************************************************************** case STATE1: if (prevState != state) { //Entry event } if (event == event1) { // add event actions event = NONE; } break; case STATE2: if (prevState != state) { //Entry event } if (event == event2) { // add event actions event = NONE; } break; } if (prevState != state) { Serial.print ("new state: "); Serial.println (state); prevState = state; } } //********************************************************************************************** /* Function: parseCommand Inputs: char *cmd: command parsed Returns: None Description: parses commands that come from either the PC or the GSM module. Commands are of the form XXXZZZZZZZZZZZZZZZZ XXX: Command type ZZZZZZZZZZZ: Command body Commands */ //********************************************************************************************** void parseCommand (String cmd) { int len = 0; int index; byte section = 0; char delimiter = ' '; for (index = 0; index < cmd.length(); index++) { if (cmd.charAt(index) == delimiter) section++; else { switch (section){ case 0: //Serial.println ("section 0"); cmdType.concat(cmd.charAt(index)); break; case 1: //Serial.println ("section 1"); cmdBody.concat(cmd.charAt(index)); break; } } } Serial.print("cmd type: "); Serial.println(cmdType); Serial.print("cmd Body: "); Serial.println(cmdBody); if(cmdType.equals("TEST")) { Serial.println ("This is a test"); if(cmdBody.equals("TIMER")) { Serial.println ("We testing the timer "); } } if(cmdType.equals("READ")) { Serial.println ("This is a test"); if(cmdBody.equals("VOLTAGE")) { Serial.println ("reading Voltage"); } } cmdType = ""; cmdBody = ""; } void setup () { Serial.begin (115200); Serial.println("Lets Begin"); } void loop () { //Poll Events // Read Sensors here and set events as necessary if(millis() - baseLastIntervalStart > BASE_INTERVAL) { updatePeriodicTimers (); Serial.print("Seconds: ");Serial.println(seconds); Serial.print("Minutes: ");Serial.println(minutes); Serial.print("Hours: "); Serial.println(hours); Serial.print("Days: ");Serial.println(days); baseLastIntervalStart = millis(); } updateState(); updateIntervalTimers (); //********************************************************************************************** /* PC Serial Input: Serial input comes from a PC over a USB cable. The termination character is a carriage return. It is read in and then sent to command parsing. */ //********************************************************************************************** if(Serial.available()>0){ int inByte = Serial.read(); if (inByte == 13) { // carriage return cmdFlag = true; Serial.print("Command sent: "); Serial.println(userInput); inByte = 0; } else { userInput.concat(char(inByte)); } } if (cmdFlag) { parseCommand(userInput); userInput = ""; cmdFlag = false; } }
5788c2b7b3f797810663447ecee93a406f295e0c
7244cc748e0c31b18fe2b19cf0a8ea51502fa976
/recursion/hanoi.cpp
10ec0c13333d4e8911e5f648958fd0bdca433c02
[]
no_license
TanmoyPaul1/CSCI235
d970475889a73146a25d393d84fbf312bf043680
27148266470170f5fa5d89190a1d85b2c4d5743f
refs/heads/main
2023-04-04T18:28:42.915686
2021-04-25T23:20:30
2021-04-25T23:20:30
402,844,516
0
0
null
null
null
null
UTF-8
C++
false
false
837
cpp
/* * can only move one disc at a time discs must be either in transit or on a tower (never on the ground) you can never place a larger disc on a smaller disc */ #include <iostream> void hanoi(int n, char src, char dst, char tmp) { if (n == 0) { std::cout << "You entered an invalid number!\n"; } else if(n == 1) { std::cout << "Move disk from tower " << src << " to tower " << dst << ". \n"; } else { hanoi(n - 1, src, tmp, dst); std::cout << "Move disk from tower " << src << " to tower " << dst << ". \n"; hanoi(n - 1, tmp, dst, src); } } int main() { char a = '1'; char b = '2'; char c = '3'; for (int i = 0; i <= 4; i++) { std::cout << "\nHanoi with " << i << " pieces:\n" << std::endl; hanoi(i, a, c, b); } }
9f21e44cc3c91b78d1ff247f80105ae04af97899
e411638b54e787befdb813c7bc03f6c29797bd6b
/tests/TestApp/Pods/boost-for-react-native/boost/spirit/home/x3/support/ast/position_tagged.hpp
22cfd7588b1e49ad36dc065abcb9e70df8c91ff9
[ "BSL-1.0", "MIT", "Apache-2.0" ]
permissive
vovkasm/react-native-web-image
955e18df8687b82575ca1e83a728f7d0e97eb826
e269cc5f8aad06e6e7429ddc6de95bd20ff82407
refs/heads/develop
2023-01-06T23:18:04.703154
2019-08-03T07:11:53
2019-08-03T07:11:53
74,192,763
159
35
MIT
2023-01-03T15:13:59
2016-11-19T06:56:55
Java
UTF-8
C++
false
false
3,083
hpp
/*============================================================================= Copyright (c) 2014 Joel de Guzman Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #if !defined(BOOST_SPIRIT_X3_POSITION_TAGGED_MAY_01_2014_0321PM) #define BOOST_SPIRIT_X3_POSITION_TAGGED_MAY_01_2014_0321PM #include <boost/range.hpp> #include <boost/type_traits/is_base_of.hpp> namespace boost { namespace spirit { namespace x3 { struct position_tagged { // Use this to annotate an AST with the iterator position. // These ids are used as a key to the position_cache (below) // and marks the start and end of an AST node. int id_first = -1; int id_last = -1; }; template <typename Container> class position_cache { public: typedef typename Container::value_type iterator_type; position_cache( iterator_type first , iterator_type last) : first_(first), last_(last) {} // This will catch all nodes inheriting from position_tagged boost::iterator_range<iterator_type> position_of(position_tagged const& ast) const { return boost::iterator_range<iterator_type>( positions.at(ast.id_first) // throws if out of range , positions.at(ast.id_last) // throws if out of range ); } // This will catch all nodes except those inheriting from position_tagged template <typename AST> boost::iterator_range<iterator_type> position_of(AST const& ast) const { // returns an empty position return boost::iterator_range<iterator_type>(); } // This will catch all nodes except those inheriting from position_tagged template <typename AST> void annotate(AST& ast, iterator_type first, iterator_type last, mpl::false_) { // (no-op) no need for tags } // This will catch all nodes inheriting from position_tagged void annotate(position_tagged& ast, iterator_type first, iterator_type last, mpl::true_) { ast.id_first = int(positions.size()); positions.push_back(first); ast.id_last = int(positions.size()); positions.push_back(last); } template <typename AST> void annotate(AST& ast, iterator_type first, iterator_type last) { annotate(ast, first, last, is_base_of<position_tagged, AST>()); } Container const& get_positions() const { return positions; } iterator_type first() const { return first_; } iterator_type last() const { return last_; } private: Container positions; iterator_type first_; iterator_type last_; }; }}} #endif
bc8fa2bbd60382d94427a5be29486eb4f3b1a015
6a14bafe71fd0f8a2e4fa9cfa936d88c97620d9c
/src/core/rnn/regress/Reshaper_x0.cc
644a45b564814da074aaf50e9377e58cdf7454a2
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
SudarsanSridharan16/Sibyl
0b8b3f134f9b195af3fb2e7f4a82988066415004
ae2edbb09f58e8b1cef79470e8ca9c02c244fdcb
refs/heads/master
2020-04-21T11:28:52.756228
2017-05-04T10:14:38
2017-05-04T10:14:38
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,244
cc
/* Copyright 2017 Hosang Yoon 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 "Reshaper_x0.h" #include <sibyl/Security.h> #include <sibyl/time_common.h> #include <sibyl/util/Config.h> namespace sibyl { Reshaper_x0::Reshaper_x0(unsigned long maxGTck_, TradeDataSet *pTradeDataSet_, std::vector<std::string> *pFileList_, const unsigned long (TradeDataSet::* ReadRawFile_)(std::vector<FLOAT>&, CSTR&)) : Reshaper(maxGTck_, pTradeDataSet_, pFileList_, ReadRawFile_), b_th(1.0), s_th(1.0) { maxGTck = 0; // overwrite Reshaper's constructor value inputDim = 45; targetDim = 1; // overwrite Reshaper's constructor value fullWhitening = false; // overwrite Reshaper's constructor value } void Reshaper_x0::ReadConfig(CSTR &filename) { Config cfg(filename); auto &ss_b_th = cfg.Get("B_TH"); ss_b_th >> b_th; verify(ss_b_th.fail() == false); auto &ss_s_th = cfg.Get("S_TH"); ss_s_th >> s_th; verify(ss_s_th.fail() == false); } void Reshaper_x0::State2VecIn(FLOAT *vec, const ItemState &state) { constexpr long interval = kTimeRates::secPerTick; constexpr long T = (long) (std::ceil((double) sibyl::kTimeBounds::stop / interval) - 1); auto iItems = items.find(state.code); if (iItems == std::end(items)) { auto it_bool = items.insert(std::make_pair(state.code, ItemMem())); verify(it_bool.second == true); iItems = it_bool.first; } auto &i = iItems->second; // reference to current ItemMem KOSPI<Security<PQ>> sec; INT ps1 = state.tbr[idx::ps1].p; FLOAT minTR = (ps1 > 0 ? (ps1 - sec.TckLo(ps1)) / 10.f : .1f); // epsilon if (1 == state.time / kTimeRates::secPerTick) i.Init(ps1, minTR); // also clears i.idleG // store idleG double s0f = sec.TckLo(state.tbr[idx::ps1].p) * (1.0 - sec.dSF()); double b0f = state.tbr[idx::ps1].p * (1.0 + sec.dBF()); double idleG = (s0f - b0f) / (s0f + b0f); // note: negative value verify(idleG < 0.0); i.idleG.push_back(idleG); i.cursor = i.idleG.size() - 1; // advance time tick for VecOut2Reward // verify((int) i.idleG.size() == state.time / kTimeRates::secPerTick); // for debugging training unsigned long idxInput = 0; // t vec[idxInput++] = (FLOAT) state.time / (interval * T); // pr vec[idxInput++] = ReshapePrice(state.pr) - ReshapePrice(i.initPr); // EMA(qr) vec[idxInput++] = ReshapeQuant(i.aQr.Acc(state.qr)); // ps1 vec[idxInput++] = ReshapePrice(state.tbr[idx::ps1].p) - ReshapePrice(i.initPr); // ps1 - pb1 vec[idxInput++] = ReshapePrice(state.tbr[idx::ps1].p) - ReshapePrice(state.tbr[idx::pb1].p); // EMA(pr) (akin to https://en.wikipedia.org/wiki/MACD) for (auto &a : i.aPr) vec[idxInput++] = ReshapePrice(a.Acc(state.pr)) - ReshapePrice(i.initPr); // EMA(U, D, DX) (https://en.wikipedia.org/wiki/Average_directional_movement_index) for (auto idx = 0u; idx < nTimeConsts; ++idx) { auto u = (state.pr > i.lastPr ? state.pr - i.lastPr : 0.f); auto d = (i.lastPr > state.pr ? i.lastPr - state.pr : 0.f); auto aTR = i.aTR[idx].Acc(std::max(std::abs(state.pr - i.lastPr), minTR)); auto aU = i.aU [idx].Acc(u / aTR); auto aD = i.aD [idx].Acc(d / aTR); auto aDX = i.aDX[idx].Acc(aU + aD > 0.f ? std::abs(aU - aD) / (aU + aD) : 0.f); vec[idxInput++] = (FLOAT) aU; vec[idxInput++] = (FLOAT) aD; vec[idxInput++] = (FLOAT) aDX; } i.lastPr = state.pr; // // tbpr(1:20) // for (std::size_t idx = 0; idx < (std::size_t)idx::szTb; idx++) // vec[idxInput++] = ReshapePrice(state.tbr[idx].p) - ReshapePrice(i.initPr); // // tbqr(1:20) // for (std::size_t idx = 0; idx < (std::size_t)idx::szTb; idx++) // vec[idxInput++] = ReshapeQuant(state.tbr[idx].q); // EMA(delta_tbqr(1:20)) for (std::size_t idx = 0; idx < (std::size_t)idx::szTb; idx++) { INT delta = state.tbr[idx].q; for (std::size_t idxL = 0; idxL < (std::size_t)idx::szTb; idxL++) { if (state.tbr[idx].p == i.lastTb[idxL].p) { if ( (idx <= idx::ps1 && idxL <= idx::ps1) || (idx >= idx::pb1 && idxL >= idx::pb1) ) delta = state.tbr[idx].q - i.lastTb[idxL].q; else delta = state.tbr[idx].q + i.lastTb[idxL].q; break; } } vec[idxInput++] = ReshapeQuant(i.aTb[idx].Acc(delta)); } i.lastTb = state.tbr; verify(inputDim == idxInput); WhitenVector(vec); // this alters vector only if matrices are initialized } void Reshaper_x0::Reward2VecOut(FLOAT *vec, const Reward &reward, CSTR &code) { auto iItems = items.find(code); verify(iItems != std::end(items)); auto &i = iItems->second; // reference to current ItemMem if (vec == nullptr) // rewind idleG's cursor { i.cursor = 0; return; } verify(i.cursor < i.idleG.size()); double idleG = i.idleG[i.cursor++]; // time tick advanced by repeated calls to this function // G' = (G - idle) / (2 * -idle) = 0.5 - G / (2 * idle) double G0s_scaled = 0.5 - reward.G0.s / (2.0 * idleG); double G0b_scaled = 0.5 - reward.G0.b / (2.0 * idleG); unsigned long idxTarget = 0; vec[idxTarget++] = (FLOAT) (G0b_scaled * (G0b_scaled > 0.0) - G0s_scaled * (G0s_scaled > 0.0)); verify(targetDim == idxTarget); } void Reshaper_x0::VecOut2Reward(Reward &reward, const FLOAT *vec, CSTR &code) { const auto iItems = items.find(code); verify(iItems != std::end(items)); const auto &i = iItems->second; // reference to current ItemMem verify(i.cursor < i.idleG.size()); double idleG = i.idleG[i.cursor]; // time tick advanced by State2VecIn unsigned long idxTarget = 0; double G_scaled = (double) vec[idxTarget++]; // G = (G' - 0.5) * (2 * -idle) = (1 - 2 * G') * idle reward.G0.s = (s_th + 2.0 * G_scaled) * idleG; reward.G0.b = (b_th - 2.0 * G_scaled) * idleG; for (std::size_t j = 0; j < (std::size_t)idx::tckN; j++) reward.G[j].s = (FLOAT) 0.0; for (std::size_t j = 0; j < (std::size_t)idx::tckN; j++) reward.G[j].b = (FLOAT) 0.0; for (std::size_t j = 0; j < (std::size_t)idx::tckN; j++) reward.G[j].cs = (FLOAT) 100.0; for (std::size_t j = 0; j < (std::size_t)idx::tckN; j++) reward.G[j].cb = (FLOAT) 100.0; verify(targetDim == idxTarget); } }
6ad3bfae767953f2fc35625fb86fdc33d8512adb
a3d4e849f8f2900eee6188b9c52c998020944011
/module06/ex01/main.cpp
5738a37c22b7521d91fe274198f09134487371a5
[]
no_license
illusionist99/Cpp-Modules
d31ace171ae5cbf03f8cb169446e87e472c106cc
ae6c178ec2d332f1e0fd25f64e61fdd1002cab92
refs/heads/main
2023-08-05T17:03:29.308754
2021-10-04T13:35:37
2021-10-04T13:35:37
349,688,708
0
0
null
null
null
null
UTF-8
C++
false
false
709
cpp
# include <iostream> typedef struct s_Data { int age; std::string name; std::string income; } Data; uintptr_t serialize(Data *ptr) { uintptr_t raw; raw = reinterpret_cast< uintptr_t>(ptr); return (raw); } Data *deserialize(uintptr_t raw) { Data *ptr; ptr = reinterpret_cast< Data *>(raw); return (ptr); } int main( void ) { Data *p = new Data; p->age = 10; p->income = "ffff"; p->name = "dddd"; uintptr_t raw = serialize(p); std::cout << raw << std::endl; Data *f; f = deserialize(raw); std::cout << p->age << " " << p->income << " " << p->name << std::endl; delete p; return (0); }
8f7e26536a83bbe3237aedb85561927b0c260040
85cd4cea6a2f95b357bb1ec8edccc3ccfc63cd24
/Codeforces/Round 641 - Div 2/B - Orac and Models.cpp
6e451ca31941b03a8a953c95e936df8bdc8f20de
[]
no_license
tarunluthra123/Competitive-Programming
f55a55dcd01fcd181ccc6ddf89103a26f557f1bc
fb731bed4e2c7bb06fa01ef0a93d0bd19373cb0b
refs/heads/master
2023-03-25T05:47:50.723518
2021-03-20T15:52:32
2021-03-20T15:52:32
308,401,546
0
0
null
null
null
null
UTF-8
C++
false
false
900
cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define MOD 1000000007 #define ff first #define ss second #define ll long long int #define pii pair<ll, ll> #define vi vector<ll> int main() { sync; int testCases; cin >> testCases; while (testCases--) { ll n; cin>>n; vi v(n+1); for (int i = 1; i <= n; ++i) { cin>>v[i]; } vi dp(n+1,1); for (int i = 1; i <= n; ++i) { for (int j = i*2; j <= n; j += i) { if(v[j] > v[i]) { dp[j] = max(dp[j], dp[i]+1); } } } ll ans = 0; for (int i = 0; i <= n; ++i) { ans = max(ans, dp[i]); } cout << ans << '\n'; } return 0; }
f54cf785b13d529947583c92abe4a77a3be95e05
5a30e62ac24fa6380d65c93bd7b64b6ffba30014
/main.cpp
2ad96f83a98b09031c8ced42e6dc82f82e2831ff
[]
no_license
kynants/Program_3_10
9a43b1ba5fd713eed64d20fff7613b834c2b63f0
59df965d1910f53375148f1a3dd0e7152602fc3c
refs/heads/master
2020-03-27T14:33:14.087769
2018-08-29T23:16:33
2018-08-29T23:16:33
146,668,943
0
0
null
null
null
null
UTF-8
C++
false
false
289
cpp
#include <iostream> using namespace std; int main() { int number = 65; // Display the value of the number variable. cout << number << endl; // Display the value of the number converted to the char data type. cout << static_cast<char>(number) << endl; return 0; }
3fd4302bc7c482ccd61ac9d9596b69f91f0d9624
b64a538b99f2c803490bbf6a0d0832cbfb5f1156
/Windows/CorrelationFilters/CorrelationFilters.cpp
d3fa7ec1568a82156279b0cf6a8f8295fa2c060d
[]
no_license
jsmereka/PatchBasedCorrelation
67f6c9a8d8c5321b26c7afd87929cd4ccd99088a
87120625b61bea15d075aca4727575227f5de410
refs/heads/master
2021-01-10T21:24:42.710327
2013-07-05T18:23:56
2013-07-05T18:23:56
8,187,726
3
1
null
null
null
null
UTF-8
C++
false
false
501
cpp
// CorrelationFilters.cpp : Defines the exported functions for the DLL application. // #include "CorrelationFilters.h" /** Trains the filter as an OTSDF @author Jonathon M. Smereka @version 04-13-2013 @return nothing */ template <class T> void OTSDF<T>::trainfilter() { if(this->auth_count != 0 || this->imp_count != 0) { int d = input_row*input_col; // ONV if(alpha != 0) { // } // ACE if(beta != 0) { // } // ASM if(gamma != 0) { // } } }
d0d04ece752db8228db7c32f089b4d3218e405d9
46f53e9a564192eed2f40dc927af6448f8608d13
/gpu/command_buffer/common/capabilities.h
b749d5c1bb88cf0513c9b516789178d48130a4f9
[ "BSD-3-Clause" ]
permissive
sgraham/nope
deb2d106a090d71ae882ac1e32e7c371f42eaca9
f974e0c234388a330aab71a3e5bbf33c4dcfc33c
refs/heads/master
2022-12-21T01:44:15.776329
2015-03-23T17:25:47
2015-03-23T17:25:47
32,344,868
2
2
null
null
null
null
UTF-8
C++
false
false
3,138
h
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef GPU_COMMAND_BUFFER_COMMON_CAPABILITIES_H_ #define GPU_COMMAND_BUFFER_COMMON_CAPABILITIES_H_ #include "gpu/gpu_export.h" // From gl2.h. We want to avoid including gl headers because client-side and // service-side headers conflict. #define GL_FRAGMENT_SHADER 0x8B30 #define GL_VERTEX_SHADER 0x8B31 #define GL_LOW_FLOAT 0x8DF0 #define GL_MEDIUM_FLOAT 0x8DF1 #define GL_HIGH_FLOAT 0x8DF2 #define GL_LOW_INT 0x8DF3 #define GL_MEDIUM_INT 0x8DF4 #define GL_HIGH_INT 0x8DF5 namespace gpu { struct GPU_EXPORT Capabilities { struct ShaderPrecision { ShaderPrecision() : min_range(0), max_range(0), precision(0) {} int min_range; int max_range; int precision; }; struct PerStagePrecisions { PerStagePrecisions(); ShaderPrecision low_int; ShaderPrecision medium_int; ShaderPrecision high_int; ShaderPrecision low_float; ShaderPrecision medium_float; ShaderPrecision high_float; }; Capabilities(); template <typename T> void VisitStagePrecisions(unsigned stage, PerStagePrecisions* precisions, const T& visitor) { visitor(stage, GL_LOW_INT, &precisions->low_int); visitor(stage, GL_MEDIUM_INT, &precisions->medium_int); visitor(stage, GL_HIGH_INT, &precisions->high_int); visitor(stage, GL_LOW_FLOAT, &precisions->low_float); visitor(stage, GL_MEDIUM_FLOAT, &precisions->medium_float); visitor(stage, GL_HIGH_FLOAT, &precisions->high_float); } template <typename T> void VisitPrecisions(const T& visitor) { VisitStagePrecisions(GL_VERTEX_SHADER, &vertex_shader_precisions, visitor); VisitStagePrecisions(GL_FRAGMENT_SHADER, &fragment_shader_precisions, visitor); } PerStagePrecisions vertex_shader_precisions; PerStagePrecisions fragment_shader_precisions; int max_combined_texture_image_units; int max_cube_map_texture_size; int max_fragment_uniform_vectors; int max_renderbuffer_size; int max_texture_image_units; int max_texture_size; int max_varying_vectors; int max_vertex_attribs; int max_vertex_texture_image_units; int max_vertex_uniform_vectors; int num_compressed_texture_formats; int num_shader_binary_formats; int bind_generates_resource_chromium; int max_transform_feedback_separate_attribs; int max_uniform_buffer_bindings; int uniform_buffer_offset_alignment; bool post_sub_buffer; bool egl_image_external; bool texture_format_atc; bool texture_format_bgra8888; bool texture_format_dxt1; bool texture_format_dxt5; bool texture_format_etc1; bool texture_format_etc1_npot; bool texture_rectangle; bool iosurface; bool texture_usage; bool texture_storage; bool discard_framebuffer; bool sync_query; bool image; bool future_sync_points; bool blend_equation_advanced; bool blend_equation_advanced_coherent; bool texture_rg; }; } // namespace gpu #endif // GPU_COMMAND_BUFFER_COMMON_CAPABILITIES_H_
4f49f94bb5f38a4c6398464e89c6449f1c61a05f
c43b0d1e041d004d1fa8e1469f57b62d4d4bea88
/src/connectivity/overnet/lib/links/stream_link_untrusted_fuzzer.cc
2696717f828bd6418bdab6e59fa6df5cf3e8c5ed
[ "BSD-3-Clause" ]
permissive
ZVNexus/fuchsia
75122894e09c79f26af828d6132202796febf3f3
c5610ad15208208c98693618a79c705af935270c
refs/heads/master
2023-01-12T10:48:06.597690
2019-07-04T05:09:11
2019-07-04T05:09:11
195,169,207
0
0
BSD-3-Clause
2023-01-05T20:35:36
2019-07-04T04:34:33
C++
UTF-8
C++
false
false
2,767
cc
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <fuchsia/overnet/streamlinkfuzzer/cpp/fidl.h> #include "src/connectivity/overnet/lib/environment/trace_cout.h" #include "src/connectivity/overnet/lib/links/stream_link.h" #include "src/connectivity/overnet/lib/protocol/fidl.h" #include "src/connectivity/overnet/lib/protocol/reliable_framer.h" #include "src/connectivity/overnet/lib/protocol/unreliable_framer.h" #include "src/connectivity/overnet/lib/routing/router.h" #include "src/connectivity/overnet/lib/testing/test_timer.h" using namespace overnet; namespace { class FuzzedStreamLink final : public StreamLink { public: FuzzedStreamLink(Router* router, std::unique_ptr<StreamFramer> framer) : StreamLink(router, NodeId(1), std::move(framer), 1) {} void Emit(Slice slice, Callback<Status> done) override { abort(); } }; class StreamLinkFuzzer { public: StreamLinkFuzzer(bool log_stuff, std::unique_ptr<StreamFramer> framer) : logging_(log_stuff ? new Logging(&timer_) : nullptr) { auto link = MakeLink<FuzzedStreamLink>(&router_, std::move(framer)); link_ = link.get(); router_.RegisterLink(std::move(link)); } void Run(std::vector<std::vector<uint8_t>> plan) { for (const auto& action : plan) { link_->Process(timer_.Now(), Slice::FromContainer(action)); timer_.Step(TimeDelta::FromSeconds(1).as_us()); } } private: TestTimer timer_; struct Logging { Logging(Timer* timer) : tracer(timer) {} TraceCout tracer; ScopedRenderer set_tracer{&tracer}; }; std::unique_ptr<Logging> logging_; Router router_{&timer_, NodeId(1), false}; FuzzedStreamLink* link_; }; std::unique_ptr<StreamFramer> MakeFramer( const fuchsia::overnet::streamlinkfuzzer::UntrustedLinkDescription& desc) { switch (desc.Which()) { case fuchsia::overnet::streamlinkfuzzer::UntrustedLinkDescription::Tag:: Empty: return nullptr; case fuchsia::overnet::streamlinkfuzzer::UntrustedLinkDescription::Tag:: kReliable: return std::make_unique<ReliableFramer>(); case fuchsia::overnet::streamlinkfuzzer::UntrustedLinkDescription::Tag:: kUnreliable: return std::make_unique<UnreliableFramer>(); } } } // namespace extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { if (auto buffer = Decode<fuchsia::overnet::streamlinkfuzzer::UntrustedInputPlan>( Slice::FromCopiedBuffer(data, size)); buffer.is_ok()) { if (auto framer = MakeFramer(buffer->link_description)) { StreamLinkFuzzer(false, std::move(framer)).Run(std::move(buffer->input)); } } return 0; }
a5ca9a92d1a79a4b8a30c8173f5f1d2c8751cc92
6861ababd3572292d5d718b496f8e20e33cfa1e0
/deps/asio/asio/detail/impl/epoll_reactor.hpp
9821f84030809da7c54eccb6eae94084bb472223
[ "BSL-1.0" ]
permissive
tscmoo/tsc-bw
e6d973c425147f071102e0bc3d8b930b5292e5c7
a9baf0a7775bdf44fafe2757526245950c6725dc
refs/heads/master
2020-04-05T23:41:36.565984
2017-06-01T10:42:29
2017-06-01T10:42:29
28,708,148
39
4
null
null
null
null
UTF-8
C++
false
false
1,921
hpp
// // detail/impl/epoll_reactor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef ASIO_DETAIL_IMPL_EPOLL_REACTOR_HPP #define ASIO_DETAIL_IMPL_EPOLL_REACTOR_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #if defined(ASIO_HAS_EPOLL) #include "../push_options.hpp" namespace asio { namespace detail { template <typename Time_Traits> void epoll_reactor::add_timer_queue(timer_queue<Time_Traits>& queue) { do_add_timer_queue(queue); } template <typename Time_Traits> void epoll_reactor::remove_timer_queue(timer_queue<Time_Traits>& queue) { do_remove_timer_queue(queue); } template <typename Time_Traits> void epoll_reactor::schedule_timer(timer_queue<Time_Traits>& queue, const typename Time_Traits::time_type& time, typename timer_queue<Time_Traits>::per_timer_data& timer, wait_op* op) { mutex::scoped_lock lock(mutex_); if (shutdown_) { io_service_.post_immediate_completion(op, false); return; } bool earliest = queue.enqueue_timer(time, timer, op); io_service_.work_started(); if (earliest) update_timeout(); } template <typename Time_Traits> std::size_t epoll_reactor::cancel_timer(timer_queue<Time_Traits>& queue, typename timer_queue<Time_Traits>::per_timer_data& timer, std::size_t max_cancelled) { mutex::scoped_lock lock(mutex_); op_queue<operation> ops; std::size_t n = queue.cancel_timer(timer, ops, max_cancelled); lock.unlock(); io_service_.post_deferred_completions(ops); return n; } } // namespace detail } // namespace asio #include "../pop_options.hpp" #endif // defined(ASIO_HAS_EPOLL) #endif // ASIO_DETAIL_IMPL_EPOLL_REACTOR_HPP
e847c7a102bd4b35dbecb1f241132878229f8b84
e20130f9444db4e02841dc7bc45a3f80abb5467d
/ecs/Entity.hpp
ae6dea7f88d7794531751cac0aff545672d161dc
[]
no_license
bulkowy/zpr-rts-proj
53c7fa15017b94f60c8907519c9c9bcd65f6a35a
3076263fce6c8f0fccca7c79520c93f8dc0467f2
refs/heads/master
2020-09-22T10:23:10.397162
2020-01-20T16:55:35
2020-01-20T16:55:35
225,154,576
0
0
null
null
null
null
UTF-8
C++
false
false
694
hpp
#ifndef _ENTITY_ #define _ENTITY_ namespace ecs { /** * @brief Obiekt (Entity) to dodatnie id, będące jednoznaczym identyfikatorem danego obiektu w grze. Dane Obiektu są reprezentowane przez Komponenty "Components", logika obiektów wykonywana przez Systemy. * * Obiekt (Entity) identyfikuje obiekt, ale nie posiada żadnych danych sam z siebie, ani żadnej logiki. * Jest określana jako zbiór Komponentów (Components), przetwarzana i uaktualniana przez Systemy (Systems). */ typedef unsigned int Entity; /** * @brief Jako że Obiekty to dodatnie id, id = 0 jest znacznikiem niepoprawnego obiektu. * */ static const Entity _invalidEntity = 0; } // namespace ecs #endif
f2b22624fba38461a51d74a87e81807ce61bf8e7
c6389f9b11fd40ee9295f4e88a14a8057e294e4f
/components/asio/asio/asio/include/asio/detail/posix_tss_ptr.hpp
5e0836f654d640d55f54854a2a12e5a1001eb3ff
[ "BSL-1.0", "MIT" ]
permissive
ghsecuritylab/N14
987ebb27cfbd7ebf84deadeb09a480aa51be34c7
76bc595e3face0903436e48165f31724e4d4532a
refs/heads/master
2021-02-28T19:46:09.834253
2019-11-19T14:36:58
2019-11-19T14:36:58
245,728,464
0
0
MIT
2020-03-08T00:40:31
2020-03-08T00:40:30
null
UTF-8
C++
false
false
1,762
hpp
// // detail/posix_tss_ptr.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef ASIO_DETAIL_POSIX_TSS_PTR_HPP #define ASIO_DETAIL_POSIX_TSS_PTR_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include "asio/detail/config.hpp" #if defined(ASIO_HAS_PTHREADS) #include <pthread.h> #include "asio/detail/noncopyable.hpp" #include "asio/detail/push_options.hpp" namespace asio { namespace detail { // Helper function to create thread-specific storage. ASIO_DECL void posix_tss_ptr_create(pthread_key_t& key); template <typename T> class posix_tss_ptr : private noncopyable { public: // Constructor. posix_tss_ptr() { posix_tss_ptr_create(tss_key_); } // Destructor. ~posix_tss_ptr() { ::pthread_key_delete(tss_key_); } // Get the value. operator T*() const { return static_cast<T*>(::pthread_getspecific(tss_key_)); } // Set the value. void operator=(T* value) { ::pthread_setspecific(tss_key_, value); } private: // Thread-specific storage to allow unlocked access to determine whether a // thread is a member of the pool. pthread_key_t tss_key_; }; } // namespace detail } // namespace asio #include "asio/detail/pop_options.hpp" #if defined(ASIO_HEADER_ONLY) # include "asio/detail/impl/posix_tss_ptr.ipp" #endif // defined(ASIO_HEADER_ONLY) #endif // defined(ASIO_HAS_PTHREADS) #endif // ASIO_DETAIL_POSIX_TSS_PTR_HPP
f490b411e45ba93dd313230193145ce5424a1f26
70405c558cad2e738740ebaf7e0cd756ad236e4b
/src/term.imageio/termoutput.cpp
c2921e4246893f84bb66027fee1fa652d391ce8b
[ "BSL-1.0", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "Zlib", "MIT", "LicenseRef-scancode-unknown-license-reference", "Unlicense", "BSD-3-Clause", "LicenseRef-scancode-free-unknown", "CC-BY-3.0" ]
permissive
SRHMorris/oiio
0487f5d0ea604805f3fc41ad602a031fbe0a7086
25e9f87527115a1f2b48da88ef8b709549d9cb11
refs/heads/master
2023-03-13T03:04:22.747778
2021-03-05T11:00:43
2021-03-05T11:00:43
306,373,094
0
0
BSD-3-Clause
2020-10-22T15:00:56
2020-10-22T15:00:55
null
UTF-8
C++
false
false
10,269
cpp
// Copyright 2008-present Contributors to the OpenImageIO project. // SPDX-License-Identifier: BSD-3-Clause // https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md #include <cstdio> #include <OpenImageIO/filesystem.h> #include <OpenImageIO/imagebuf.h> #include <OpenImageIO/imagebufalgo.h> #include <OpenImageIO/imageio.h> #include <OpenImageIO/simd.h> #include <OpenImageIO/sysutil.h> OIIO_PLUGIN_NAMESPACE_BEGIN namespace term_pvt { class TermOutput final : public ImageOutput { public: TermOutput() { init(); } virtual ~TermOutput() { close(); } virtual const char* format_name() const { return "term"; } virtual bool open(const std::string& name, const ImageSpec& spec, OpenMode mode = Create); virtual int supports(string_view feature) const; virtual bool write_scanline(int y, int z, TypeDesc format, const void* data, stride_t xstride); virtual bool write_tile(int x, int y, int z, TypeDesc format, const void* data, stride_t xstride, stride_t ystride, stride_t zstride); virtual bool close(); private: ImageBuf m_buf; std::string m_method; bool m_fit = true; // automatically fit to window size void init() { m_buf.clear(); } // Actually output the stored buffer to the console bool output(); }; int TermOutput::supports(string_view feature) const { return feature == "tiles" || feature == "alpha" || feature == "random_access" || feature == "rewrite" || feature == "procedural"; } bool TermOutput::open(const std::string& name, const ImageSpec& spec, OpenMode mode) { if (mode != Create) { error("%s does not support subimages or MIP levels", format_name()); return false; } if (spec.nchannels != 3 && spec.nchannels != 4) { error("%s does not support %d-channel images\n", format_name(), m_spec.nchannels); return false; } m_spec = spec; // Retrieve config hints giving special instructions m_method = Strutil::lower(m_spec["term:method"].get()); m_fit = m_spec["term:fit"].get<int>(1); // Store temp buffer in HALF format ImageSpec spec2 = m_spec; spec2.set_format(TypeDesc::HALF); m_buf.reset(spec2); ImageBufAlgo::zero(m_buf); return true; } bool TermOutput::write_scanline(int y, int z, TypeDesc format, const void* data, stride_t xstride) { if (y > m_spec.height) { error("Attempt to write too many scanlines to terminal"); close(); return false; } ROI roi(m_spec.x, m_spec.x + m_spec.width, y, y + 1, z, z + 1, 0, m_spec.nchannels); return m_buf.set_pixels(roi, format, data, xstride); } bool TermOutput::write_tile(int x, int y, int z, TypeDesc format, const void* data, stride_t xstride, stride_t ystride, stride_t zstride) { ROI roi(x, std::min(x + m_spec.tile_width, m_spec.x + m_spec.width), y, std::min(y + m_spec.tile_height, m_spec.y + m_spec.height), z, std::min(z + m_spec.tile_depth, m_spec.z + m_spec.depth), 0, m_spec.nchannels); return m_buf.set_pixels(roi, format, data, xstride, ystride, zstride); } bool TermOutput::close() { if (!m_buf.initialized()) return true; // already closed output(); init(); // clear everything return true; } bool TermOutput::output() { // Color convert in place to sRGB, or it won't look right std::string cspace = m_buf.spec()["oiio:colorspace"].get(); ImageBufAlgo::colorconvert(m_buf, m_buf, cspace, "sRGB"); string_view TERM(Sysutil::getenv("TERM")); string_view TERM_PROGRAM(Sysutil::getenv("TERM_PROGRAM")); string_view TERM_PROGRAM_VERSION(Sysutil::getenv("TERM_PROGRAM_VERSION")); Sysutil::Term term; string_view method(m_method); if (method.empty()) { if (TERM_PROGRAM == "iTerm.app" && Strutil::from_string<float>(TERM_PROGRAM_VERSION) >= 2.9) { method = "iterm2"; } else if (TERM == "xterm" || TERM == "xterm-256color") { method = "24bit"; } else { method = "256color"; } } // Try to figure out how big an image we can display int w = m_buf.spec().width; int h = m_buf.spec().height; // iTerm2 is special, see bellow int maxw = (method == "iterm2") ? Sysutil::terminal_columns() * 16 : Sysutil::terminal_columns(); float yscale = (method == "iterm2" || method == "24bit") ? 1.0f : 0.5f; // Resize the image as needed if (w > maxw && m_fit) { ROI newsize(0, maxw, 0, int(std::round(yscale * float(maxw) / w * h))); m_buf = ImageBufAlgo::resize(m_buf, /*filter=*/nullptr, newsize); w = newsize.width(); h = newsize.height(); } if (method == "iterm2") { // iTerm2.app can display entire images in the window, if you use a // special escape sequence that lets you transmit a base64-encoded // image file, so we convert to just a simple PPM and do so. std::ostringstream s; s << "P3\n" << m_buf.spec().width << ' ' << m_buf.spec().height << "\n"; s << "255\n"; for (int y = m_buf.ybegin(), ye = m_buf.yend(); y < ye; y += 1) { for (int x = m_buf.xbegin(), xe = m_buf.xend(); x < xe; ++x) { unsigned char rgb[3]; m_buf.get_pixels(ROI(x, x + 1, y, y + 1, 0, 1, 0, 3), TypeDesc::UINT8, &rgb); s << int(rgb[0]) << ' ' << int(rgb[1]) << ' ' << int(rgb[2]) << '\n'; } } std::cout << "\033]" << "1337;" << "File=inline=1" << ";width=auto" << ":" << Strutil::base64_encode(s.str()) << '\007' << std::endl; return true; } if (method == "24bit") { // Print two vertical pixels per character cell using the Unicode // "upper half block" glyph U+2580, with fg color set to the 24 bit // RGB value of the upper pixel, and bg color set to the 24-bit RGB // value the lower pixel. int z = m_buf.spec().z; for (int y = m_buf.ybegin(), ye = m_buf.yend(); y < ye; y += 2) { for (int x = m_buf.xbegin(), xe = m_buf.xend(); x < xe; ++x) { unsigned char rgb[2][3]; m_buf.get_pixels(ROI(x, x + 1, y, y + 2, z, z + 1, 0, 3), TypeDesc::UINT8, &rgb); std::cout << term.ansi_fgcolor(rgb[0][0], rgb[0][1], rgb[0][2]); std::cout << term.ansi_bgcolor(rgb[1][0], rgb[1][1], rgb[1][2]) << "\u2580"; } std::cout << term.ansi("default") << "\n"; } return true; } if (method == "24bit-space") { // Print as space, with bg color set to the 24-bit RGB value of each // pixel. int z = m_buf.spec().z; for (int y = m_buf.ybegin(), ye = m_buf.yend(); y < ye; ++y) { for (int x = m_buf.xbegin(), xe = m_buf.xend(); x < xe; ++x) { unsigned char rgb[3]; m_buf.get_pixels(ROI(x, x + 1, y, y + 1, z, z + 1, 0, 3), TypeDesc::UINT8, &rgb); std::cout << term.ansi_bgcolor(rgb[0], rgb[1], rgb[2]) << " "; } std::cout << term.ansi("default") << "\n"; } return true; } if (method == "dither") { // Print as space, with bg color set to the 6x6x6 RGB value of each // pixels. Try to make it better with horizontal dithering. But... // it still looks bad. Room for future improvement? int z = m_buf.spec().z; for (int y = m_buf.ybegin(), ye = m_buf.yend(); y < ye; ++y) { simd::vfloat4 leftover(0.0f); for (int x = m_buf.xbegin(), xe = m_buf.xend(); x < xe; ++x) { simd::vfloat4 rgborig; m_buf.get_pixels(ROI(x, x + 1, y, y + 1, z, z + 1, 0, 3), TypeDesc::FLOAT, &rgborig); rgborig += leftover; simd::vfloat4 rgb = 5.0f * rgborig; simd::vint4 rgbi; OIIO_MAYBE_UNUSED simd::vfloat4 frac = floorfrac(rgb, &rgbi); leftover = rgborig - 0.2f * simd::vfloat4(rgbi); rgbi = clamp(rgbi, simd::vint4(0), simd::vint4(5)); std::cout << "\033[48;5;" << (0x10 + 36 * rgbi[0] + 6 * rgbi[1] + rgbi[2]) << "m "; } std::cout << term.ansi("default") << "\n"; } return true; } { // Print as space, with bg color set to the 6x6x6 RGB value of each // pixels. This looks awful! int z = m_buf.spec().z; for (int y = m_buf.ybegin(), ye = m_buf.yend(); y < ye; ++y) { for (int x = m_buf.xbegin(), xe = m_buf.xend(); x < xe; ++x) { simd::vfloat4 rgborig; m_buf.get_pixels(ROI(x, x + 1, y, y + 1, z, z + 1, 0, 3), TypeDesc::FLOAT, &rgborig); simd::vfloat4 rgb = 5.0f * rgborig; simd::vint4 rgbi; OIIO_MAYBE_UNUSED simd::vfloat4 frac = floorfrac(rgb, &rgbi); rgbi = clamp(rgbi, simd::vint4(0), simd::vint4(5)); std::cout << "\033[48;5;" << (0x10 + 36 * rgbi[0] + 6 * rgbi[1] + rgbi[2]) << "m "; } std::cout << term.ansi("default") << "\n"; } return true; } return false; } } // namespace term_pvt OIIO_PLUGIN_EXPORTS_BEGIN OIIO_EXPORT ImageOutput* term_output_imageio_create() { return new term_pvt::TermOutput; } OIIO_EXPORT int term_imageio_version = OIIO_PLUGIN_VERSION; OIIO_EXPORT const char* term_imageio_library_version() { return nullptr; } OIIO_EXPORT const char* term_output_extensions[] = { "term", nullptr }; OIIO_PLUGIN_EXPORTS_END OIIO_PLUGIN_NAMESPACE_END
680b55fe9c78fffb63e713f2d43eccaeeabd33e2
d87495a64800b98ffba47c73518c6e243da04d84
/source/SoftTerm.cpp
99c1c32e6b5302c1f15e0c2700b02f8612620fc0
[ "ISC", "MIT", "BSD-3-Clause", "BSD-2-Clause" ]
permissive
synety-jdebp/nosh
6a7c106201789a7c73a84ede0954e7351b31ea42
010be9e4e8628007b42bc46ee18cb1e9dc6881ff
refs/heads/master
2021-05-10T12:45:32.993528
2018-02-15T17:59:14
2018-02-15T17:59:14
118,451,036
0
0
null
null
null
null
UTF-8
C++
false
false
58,105
cpp
/* COPYING ****************************************************************** For copyright and licensing terms, see the file named COPYING. // ************************************************************************** */ #include <algorithm> #include <cstdio> #include <stdint.h> #include "CharacterCell.h" #include "SoftTerm.h" #include "UnicodeClassification.h" #include <iostream> // for debugging enum { ALPHA_FOR_DEFAULT = 0, ALPHA_FOR_EXPLICIT = 1, }; /* Constructor and destructor *********************************************** // ************************************************************************** */ static const CharacterCell::colour_type default_foreground(ALPHA_FOR_DEFAULT,128U,128U,128U), default_background(ALPHA_FOR_DEFAULT,0U,0U,0U); SoftTerm::SoftTerm(SoftTerm::ScreenBuffer & s, SoftTerm::KeyboardBuffer & k, SoftTerm::MouseBuffer & m) : screen(s), keyboard(k), mouse(m), argc(0U), seen_arg_digit(false), first_private_parameter('\0'), last_intermediate('\0'), state(NORMAL), scrolling(true), overstrike(true), no_clear_screen_on_column_change(false), advance_pending(false), attributes(0), foreground(default_foreground), background(default_background), cursor_type(CursorSprite::BLOCK), cursor_attributes(CursorSprite::VISIBLE|CursorSprite::BLINK), send_DECLocator(false), send_XTermMouse(false) { Resize(display_origin.x + display_margin.w, display_origin.y + display_margin.h); ClearAllHorizontalTabstops(); ClearAllVerticalTabstops(); UpdateCursorType(); Home(); ClearDisplay(); keyboard.SetBackspaceIsBS(false); } SoftTerm::~SoftTerm() { // For security, we erase several sources of information about old terminal sessions. Resize(80U, 25U); Home(); ClearDisplay(); } SoftTerm::xy::xy() : x(0U), y(0U) { } SoftTerm::wh::wh() : w(80U), h(25U) { } SoftTerm::mode::mode() : automatic_right_margin(true), background_colour_erase(true), origin(false), left_right_margins(false) { } /* Top-level control functions ********************************************** // ************************************************************************** */ void SoftTerm::Resize( coordinate columns, coordinate rows ) { if (columns) { if (display_origin.x >= columns) display_origin.x = 0U; display_margin.w = columns - display_origin.x; } else columns = display_origin.x + display_margin.w; if (rows) { if (display_origin.y >= rows) display_origin.y = 0U; display_margin.h = rows - display_origin.y; } else rows = display_origin.y + display_margin.h; screen.SetSize(columns, rows); keyboard.ReportSize(columns, rows); if (scroll_origin.y >= rows) scroll_origin.y = display_origin.y; if (scroll_origin.y + scroll_margin.h > rows) scroll_margin.h = rows - scroll_origin.y; if (scroll_origin.x >= columns) scroll_origin.x = display_origin.x; if (scroll_origin.x + scroll_margin.w > columns) scroll_margin.w = columns - scroll_origin.x; if (active_cursor.x >= columns) active_cursor.x = columns - 1U; if (active_cursor.y >= rows) active_cursor.y = rows - 1U; UpdateCursorPos(); } /* Control sequence arguments *********************************************** // ************************************************************************** */ static inline SoftTerm::coordinate OneIfZero ( const SoftTerm::coordinate & v ) { return 0U == v ? 1U : v; } void SoftTerm::ResetControlSequence() { argc = 0U; seen_arg_digit = false; args[argc] = 0; first_private_parameter = '\0'; last_intermediate = '\0'; } void SoftTerm::FinishArg(unsigned int d) { if (!seen_arg_digit) args[argc] = d; if (argc >= sizeof args/sizeof *args - 1) for (size_t i(1U); i < argc; ++i) args[i - 1U] = args[i]; else ++argc; seen_arg_digit = false; args[argc] = 0; } SoftTerm::coordinate SoftTerm::SumArgs() { coordinate s(0U); for (std::size_t i(0U); i < argc; ++i) s += args[i]; return s; } /* Editing ****************************************************************** // ************************************************************************** */ CharacterCell SoftTerm::ErasureCell(uint32_t c) { return CharacterCell(c, attributes, foreground, active_modes.background_colour_erase ? background : default_background); } void SoftTerm::ClearDisplay(uint32_t c) { // Erasure ignores margins. const ScreenBuffer::coordinate stride(ScreenBuffer::coordinate(display_margin.w) + display_origin.x); const ScreenBuffer::coordinate s(stride * display_origin.y); const ScreenBuffer::coordinate l(stride * display_margin.h); screen.WriteNCells(s, l, ErasureCell(c)); } void SoftTerm::ClearLine() { // Erasure ignores margins. const ScreenBuffer::coordinate stride(ScreenBuffer::coordinate(display_margin.w) + display_origin.x); const ScreenBuffer::coordinate s(stride * active_cursor.y + display_origin.x); screen.WriteNCells(s, display_margin.w, ErasureCell()); } void SoftTerm::ClearToEOD() { // Erasure ignores margins. const ScreenBuffer::coordinate stride(ScreenBuffer::coordinate(display_margin.w) + display_origin.x); const ScreenBuffer::coordinate rows(ScreenBuffer::coordinate(display_margin.h) + display_origin.y); const ScreenBuffer::coordinate s(stride * active_cursor.y + active_cursor.x); const ScreenBuffer::coordinate e(stride * rows); if (s < e) { const ScreenBuffer::coordinate l(e - s); screen.WriteNCells(s, l, ErasureCell()); } } void SoftTerm::ClearToEOL() { // Erasure ignores margins. const ScreenBuffer::coordinate stride(ScreenBuffer::coordinate(display_margin.w) + display_origin.x); const ScreenBuffer::coordinate s(stride * active_cursor.y + active_cursor.x); if (active_cursor.x < stride) screen.WriteNCells(s, stride - active_cursor.x, ErasureCell()); } void SoftTerm::ClearFromBOD() { // Erasure ignores margins. const ScreenBuffer::coordinate stride(ScreenBuffer::coordinate(display_margin.w) + display_origin.x); const ScreenBuffer::coordinate s(stride * display_origin.y); if (display_origin.y <= active_cursor.y) { const ScreenBuffer::coordinate l(stride * (active_cursor.y - display_origin.y) + active_cursor.x + 1U); screen.WriteNCells(s, l, ErasureCell()); } } void SoftTerm::ClearFromBOL() { // Erasure ignores margins. const ScreenBuffer::coordinate stride(ScreenBuffer::coordinate(display_margin.w) + display_origin.x); const ScreenBuffer::coordinate s(stride * active_cursor.y + display_origin.x); if (display_origin.x <= active_cursor.x) screen.WriteNCells(s, active_cursor.x - display_origin.x + 1U, ErasureCell()); } void SoftTerm::EraseCharacters(coordinate n) { // Erasure ignores margins. const ScreenBuffer::coordinate columns(ScreenBuffer::coordinate(display_margin.w) + display_origin.x); const ScreenBuffer::coordinate s(columns * active_cursor.y + active_cursor.x); if (active_cursor.x + n >= columns) n = columns - 1U - active_cursor.x; screen.WriteNCells(s, n, ErasureCell()); } void SoftTerm::DeleteCharacters(coordinate n) { // Deletion always operates only inside the margins. const ScreenBuffer::coordinate stride(ScreenBuffer::coordinate(display_margin.w) + display_origin.x); const coordinate right_margin(scroll_origin.x + scroll_margin.w - 1U); const ScreenBuffer::coordinate s(stride * active_cursor.y + active_cursor.x); const ScreenBuffer::coordinate e(stride * active_cursor.y + right_margin + 1U); screen.ScrollUp(s, e, n, ErasureCell()); } void SoftTerm::InsertCharacters(coordinate n) { // Insertion always operates only inside the margins. const ScreenBuffer::coordinate stride(ScreenBuffer::coordinate(display_margin.w) + display_origin.x); const coordinate right_margin(scroll_origin.x + scroll_margin.w - 1U); const ScreenBuffer::coordinate s(stride * active_cursor.y + active_cursor.x); const ScreenBuffer::coordinate e(stride * active_cursor.y + right_margin + 1U); screen.ScrollDown(s, e, n, ErasureCell()); } void SoftTerm::DeleteLinesInScrollAreaAt(coordinate top, coordinate n) { const ScreenBuffer::coordinate stride(ScreenBuffer::coordinate(display_margin.w) + display_origin.x); const coordinate bottom_margin(scroll_origin.y + scroll_margin.h - 1U); const coordinate right_margin(scroll_origin.x + scroll_margin.w - 1U); const coordinate left_margin(scroll_origin.x); if (left_margin != 0U || right_margin != stride - 1U) { const coordinate w(right_margin - left_margin + 1U); for (ScreenBuffer::coordinate r(top); r <= bottom_margin - n; ++r) { const ScreenBuffer::coordinate d(stride * r + left_margin); const ScreenBuffer::coordinate s(stride * (r + n) + left_margin); screen.CopyNCells(d, s, w); } for (ScreenBuffer::coordinate r(bottom_margin - n + 1U); r <= bottom_margin; ++r) { const ScreenBuffer::coordinate d(stride * r + left_margin); screen.WriteNCells(d, w, ErasureCell()); } } else { const ScreenBuffer::coordinate s(stride * top); const ScreenBuffer::coordinate e(stride * (bottom_margin + 1U)); const ScreenBuffer::coordinate l(stride * n); screen.ScrollUp(s, e, l, ErasureCell()); } } void SoftTerm::InsertLinesInScrollAreaAt(coordinate top, coordinate n) { const ScreenBuffer::coordinate stride(ScreenBuffer::coordinate(display_margin.w) + display_origin.x); const coordinate right_margin(scroll_origin.x + scroll_margin.w - 1U); const coordinate left_margin(scroll_origin.x); const coordinate bottom_margin(scroll_origin.y + scroll_margin.h - 1U); if (left_margin != 0U || right_margin != stride - 1U) { const coordinate w(right_margin - left_margin + 1U); for (ScreenBuffer::coordinate r(bottom_margin); r >= top + n; --r) { const ScreenBuffer::coordinate d(stride * r + left_margin); const ScreenBuffer::coordinate s(stride * (r - n) + left_margin); screen.CopyNCells(d, s, w); } for (ScreenBuffer::coordinate r(top + n); r-- > top; ) { const ScreenBuffer::coordinate d(stride * r + left_margin); screen.WriteNCells(d, w, ErasureCell()); } } else { const ScreenBuffer::coordinate s(stride * top); const ScreenBuffer::coordinate e(stride * (bottom_margin + 1U)); const ScreenBuffer::coordinate l(stride * n); screen.ScrollDown(s, e, l, ErasureCell()); } } void SoftTerm::DeleteColumnsInScrollAreaAt(coordinate left, coordinate n) { const ScreenBuffer::coordinate stride(ScreenBuffer::coordinate(display_margin.w) + display_origin.x); const coordinate bottom_margin(scroll_origin.y + scroll_margin.h - 1U); const coordinate top_margin(scroll_origin.y); const coordinate right_margin(scroll_origin.x + scroll_margin.w - 1U); if (left >= right_margin) return; if (n > right_margin - left) n = right_margin - left; const coordinate w(right_margin - left - n); for (ScreenBuffer::coordinate r(top_margin); r <= bottom_margin; ++r) { const ScreenBuffer::coordinate d(stride * r + left); const ScreenBuffer::coordinate s(stride * r + left + n); screen.CopyNCells(d, s, w); screen.WriteNCells(d + w, n, ErasureCell()); } } void SoftTerm::InsertColumnsInScrollAreaAt(coordinate left, coordinate n) { const ScreenBuffer::coordinate stride(ScreenBuffer::coordinate(display_margin.w) + display_origin.x); const coordinate bottom_margin(scroll_origin.y + scroll_margin.h - 1U); const coordinate top_margin(scroll_origin.y); const coordinate right_margin(scroll_origin.x + scroll_margin.w - 1U); if (left >= right_margin) return; if (n > right_margin - left) n = right_margin - left; const coordinate w(scroll_margin.w - left - n); for (ScreenBuffer::coordinate r(top_margin); r <= bottom_margin; ++r) { const ScreenBuffer::coordinate d(stride * r + left + n); const ScreenBuffer::coordinate s(stride * r + left); screen.CopyNCells(d, s, w); screen.WriteNCells(s, n, ErasureCell()); } } void SoftTerm::EraseInDisplay() { for (std::size_t i(0U); i < argc; ++i) { switch (args[i]) { case 0: ClearToEOD(); break; case 1: ClearFromBOD(); break; case 2: ClearDisplay(); break; // 3 is a Linux kernel terminal emulator extension introduced in 2011. // It clears the display and also any off-screen buffers. // The original xterm extension by Stephen P. Wall from 1999-06-12, and the PuTTY extension by Jacob Nevins in 2006, both clear only the off-screen buffers. // We follow the originals. case 3: break; } } } void SoftTerm::EraseInLine() { for (std::size_t i(0U); i < argc; ++i) { switch (args[i]) { case 0: ClearToEOL(); break; case 1: ClearFromBOL(); break; case 2: ClearLine(); break; } } } void SoftTerm::InsertLines(coordinate n) { // Insertion always operates only inside the margins. InsertLinesInScrollAreaAt(active_cursor.y, n); } void SoftTerm::DeleteLines(coordinate n) { // Deletion always operates only inside the margins. DeleteLinesInScrollAreaAt(active_cursor.y, n); } void SoftTerm::ScrollDown(coordinate n) { // Scrolling always operates only inside the margins. InsertLinesInScrollAreaAt(scroll_origin.y, n); } void SoftTerm::ScrollUp(coordinate n) { // Scrolling always operates only inside the margins. DeleteLinesInScrollAreaAt(scroll_origin.y, n); } void SoftTerm::ScrollLeft(coordinate n) { // Scrolling always operates only inside the margins. DeleteColumnsInScrollAreaAt(scroll_origin.x, n); } void SoftTerm::ScrollRight(coordinate n) { // Scrolling always operates only inside the margins. InsertColumnsInScrollAreaAt(scroll_origin.x, n); } /* Tabulation *************************************************************** // ************************************************************************** */ void SoftTerm::TabControl() { for (std::size_t i(0U); i < argc; ++i) { switch (args[i]) { case 0: SetHorizontalTabstopAt(active_cursor.x, true); break; case 1: SetVerticalTabstopAt(active_cursor.y, true); break; case 2: SetHorizontalTabstopAt(active_cursor.x, false); break; case 3: SetVerticalTabstopAt(active_cursor.x, false); break; case 4: // Effectively the same as ... case 5: ClearAllHorizontalTabstops(); break; case 6: ClearAllVerticalTabstops(); break; } } } void SoftTerm::TabClear() { for (std::size_t i(0U); i < argc; ++i) { switch (args[i]) { case 0: SetHorizontalTabstopAt(active_cursor.x, false); break; case 1: SetHorizontalTabstopAt(active_cursor.x, false); break; case 2: // Effectively the same as ... case 3: ClearAllHorizontalTabstops(); break; case 4: ClearAllVerticalTabstops(); break; case 5: ClearAllHorizontalTabstops(); ClearAllVerticalTabstops(); break; } } } void SoftTerm::HorizontalTab( coordinate n, bool apply_margins ) { advance_pending = false; const coordinate right_margin(apply_margins ? scroll_origin.x + scroll_margin.w - 1U : display_origin.x + display_margin.w - 1U); if (active_cursor.x < right_margin && n) { do { if (IsHorizontalTabstopAt(++active_cursor.x)) { if (!n) break; --n; } } while (active_cursor.x < right_margin && n); UpdateCursorPos(); } } void SoftTerm::BackwardsHorizontalTab( coordinate n, bool apply_margins ) { advance_pending = false; const coordinate left_margin(apply_margins ? scroll_origin.x : display_origin.x); if (active_cursor.x > left_margin && n) { do { if (IsHorizontalTabstopAt(--active_cursor.x)) { if (!n) break; --n; } } while (active_cursor.x > left_margin && n); UpdateCursorPos(); } } void SoftTerm::VerticalTab( coordinate n, bool apply_margins ) { advance_pending = false; const coordinate bottom_margin(apply_margins ? scroll_origin.y + scroll_margin.h - 1U : display_origin.y + display_margin.h - 1U); if (active_cursor.y < bottom_margin && n) { do { if (IsVerticalTabstopAt(++active_cursor.y)) { if (!n) break; --n; } } while (active_cursor.y < bottom_margin && n); UpdateCursorPos(); } } void SoftTerm::SetHorizontalTabstop() { SetHorizontalTabstopAt(active_cursor.x, true); } void SoftTerm::ClearAllHorizontalTabstops() { for (unsigned short p(0U); p < 256U; ++p) SetHorizontalTabstopAt(p, false); } void SoftTerm::ClearAllVerticalTabstops() { for (unsigned short p(0U); p < 256U; ++p) SetVerticalTabstopAt(p, false); } /* Cursor motion ************************************************************ // ************************************************************************** */ void SoftTerm::UpdateCursorPos() { screen.SetCursorPos(active_cursor.x, active_cursor.y); } void SoftTerm::UpdateCursorType() { screen.SetCursorType(cursor_type, cursor_attributes); } void SoftTerm::UpdatePointerType() { const PointerSprite::attribute_type pointer_attributes(send_DECLocator || send_XTermMouse ? PointerSprite::VISIBLE : 0); screen.SetPointerType(pointer_attributes); } void SoftTerm::SaveCursor() { saved_cursor = active_cursor; } void SoftTerm::RestoreCursor() { advance_pending = false; active_cursor = saved_cursor; UpdateCursorPos(); } bool SoftTerm::WillWrap() { // Normal advance always operates only inside the margins. const coordinate right_margin(scroll_origin.x + scroll_margin.w - 1U); return active_cursor.x >= right_margin && active_modes.automatic_right_margin; } void SoftTerm::Advance() { advance_pending = false; // Normal advance always operates only inside the margins. const coordinate right_margin(scroll_origin.x + scroll_margin.w - 1U); if (active_cursor.x < right_margin) { ++active_cursor.x; UpdateCursorPos(); } else if (active_modes.automatic_right_margin) { const coordinate left_margin(scroll_origin.x); const coordinate bottom_margin(scroll_origin.y + scroll_margin.h - 1U); active_cursor.x = left_margin; if (active_cursor.y < bottom_margin) ++active_cursor.y; else if (scrolling) ScrollUp(1U); UpdateCursorPos(); } } void SoftTerm::CarriageReturnNoUpdate() { advance_pending = false; // Normal return always operates only inside the margins. const coordinate left_margin(scroll_origin.x); active_cursor.x = left_margin; } void SoftTerm::CarriageReturn() { CarriageReturnNoUpdate(); UpdateCursorPos(); } void SoftTerm::Home() { advance_pending = false; if (active_modes.origin) active_cursor = scroll_origin; else active_cursor = display_origin; UpdateCursorPos(); } void SoftTerm::GotoX(coordinate n) { advance_pending = false; const coordinate columns(active_modes.origin ? scroll_margin.w : display_margin.w); if (n > columns) n = columns; n += (active_modes.origin ? scroll_origin.x : display_origin.x); active_cursor.x = n - 1U; UpdateCursorPos(); } void SoftTerm::GotoY(coordinate n) { advance_pending = false; const coordinate rows(active_modes.origin ? scroll_margin.h : display_margin.h); if (n > rows) n = rows; n += (active_modes.origin ? scroll_origin.y : display_origin.y); active_cursor.y = n - 1U; UpdateCursorPos(); } void SoftTerm::GotoYX() { advance_pending = false; coordinate n(argc > 0U ? OneIfZero(args[0U]) : 1U); coordinate m(argc > 1U ? OneIfZero(args[1U]) : 1U); const coordinate columns(active_modes.origin ? scroll_margin.w : display_margin.w); const coordinate rows(active_modes.origin ? scroll_margin.h : display_margin.h); if (n > rows) n = rows; if (m > columns) m = columns; n += (active_modes.origin ? scroll_origin.y : display_origin.y); m += (active_modes.origin ? scroll_origin.x : display_origin.x); active_cursor.y = n - 1U; active_cursor.x = m - 1U; UpdateCursorPos(); } void SoftTerm::SetTopBottomMargins() { coordinate new_top_margin(argc > 0U ? OneIfZero(args[0U]) - 1U : display_origin.y); coordinate new_bottom_margin(argc > 1U && args[1U] > 0U ? args[1U] - 1U : display_origin.y + display_margin.h - 1U); if (new_top_margin < new_bottom_margin) { scroll_origin.y = new_top_margin; scroll_margin.h = new_bottom_margin - new_top_margin + 1U; Home(); } } void SoftTerm::SetLeftRightMargins() { if (!active_modes.left_right_margins) return; coordinate new_left_margin(argc > 0U ? OneIfZero(args[0U]) - 1U : display_origin.y); coordinate new_right_margin(argc > 1U && args[1U] > 0U ? args[1U] - 1U : display_origin.y + display_margin.w - 1U); if (new_left_margin < new_right_margin) { scroll_origin.x = new_left_margin; scroll_margin.w = new_right_margin - new_left_margin + 1U; Home(); } } void SoftTerm::ResetMargins() { scroll_origin = display_origin; scroll_margin = display_margin; } void SoftTerm::CursorUp( coordinate n, bool apply_margins, bool scroll_at_top ) { advance_pending = false; coordinate top_margin(scroll_origin.y), top(top_margin); if (active_cursor.y < top) top = display_origin.y; if (active_cursor.y > top) { const coordinate l(active_cursor.y - top); if (l >= n) { active_cursor.y -= n; n = 0U; } else { n -= l; active_cursor.y = top; } UpdateCursorPos(); } if (apply_margins && active_cursor.y < top_margin) { active_cursor.y = top_margin; UpdateCursorPos(); } else if (n > 0U && scroll_at_top) ScrollDown(n); } void SoftTerm::CursorDown( coordinate n, bool apply_margins, bool scroll_at_bottom ) { advance_pending = false; coordinate bottom_margin(scroll_origin.y + scroll_margin.h - 1U), bot(bottom_margin); if (active_cursor.y > bot) bot = display_origin.y + display_margin.h - 1U; if (active_cursor.y < bot) { const coordinate l(bot - active_cursor.y); if (l >= n) { active_cursor.y += n; n = 0U; } else { n -= l; active_cursor.y = bot; } UpdateCursorPos(); } if (apply_margins && active_cursor.y > bottom_margin) { active_cursor.y = bottom_margin; UpdateCursorPos(); } else if (n > 0U && scroll_at_bottom) ScrollUp(n); } void SoftTerm::CursorLeft( coordinate n, bool apply_margins, bool scroll_at_left ) { advance_pending = false; coordinate left_margin(scroll_origin.x), lmm(left_margin); if (active_cursor.x > lmm) lmm = display_origin.x; if (active_cursor.x > lmm) { const coordinate l(active_cursor.x - lmm); if (l >= n) { active_cursor.x -= n; n = 0U; } else { n -= l; active_cursor.x = lmm; } UpdateCursorPos(); } if (apply_margins && active_cursor.x < left_margin) { active_cursor.x = left_margin; UpdateCursorPos(); } else if (n > 0U && scroll_at_left) ScrollRight(n); } void SoftTerm::CursorRight( coordinate n, bool apply_margins, bool scroll_at_right ) { advance_pending = false; coordinate right_margin(scroll_origin.x + scroll_margin.w - 1U), rmm(right_margin); if (active_cursor.x > rmm) rmm = display_origin.x + display_margin.w - 1U; if (active_cursor.x < rmm) { const coordinate l(rmm - active_cursor.x); if (l >= n) { active_cursor.x += n; n = 0U; } else { n -= l; active_cursor.x = rmm; } UpdateCursorPos(); } if (apply_margins && active_cursor.x > right_margin) { active_cursor.x = right_margin; UpdateCursorPos(); } else if (n > 0U && scroll_at_right) ScrollLeft(n); } /* Colours, modes, and attributes ******************************************* // ************************************************************************** */ static CharacterCell::colour_type Map16Colour ( uint8_t c ) { c %= 16U; if (7U == c) { // Dark white is brighter than bright black. return CharacterCell::colour_type(ALPHA_FOR_EXPLICIT,0xBF,0xBF,0xBF); } else if (4U == c) { // Everyone fusses about dark blue, and no choice is perfect. // This choice is Web Indigo. return CharacterCell::colour_type(ALPHA_FOR_EXPLICIT,0x4F,0x00,0x7F); } else { if (8U == c) c = 7U; // Substitute original dark white for bright black, which otherwise would work out the same as dark black. const uint8_t h((c & 8U)? 255U : 127U), b(c & 4U), g(c & 2U), r(c & 1U); return CharacterCell::colour_type(ALPHA_FOR_EXPLICIT,r ? h : 0U,g ? h : 0U,b ? h : 0U); } } static CharacterCell::colour_type Map256Colour ( uint8_t c ) { if (c < 16U) { return Map16Colour(c); } else if (c < 232U) { c -= 16U; uint8_t b(c % 6U), g((c / 6U) % 6U), r(c / 36U); if (r >= 4U) r += r - 3U; if (g >= 4U) g += g - 3U; if (b >= 4U) b += b - 3U; return CharacterCell::colour_type(ALPHA_FOR_EXPLICIT,r * 32U,g * 32U,b * 32U); } else { c -= 232U; if (c >= 16U) c += c - 15U; return CharacterCell::colour_type(ALPHA_FOR_EXPLICIT,c * 8U,c * 8U,c * 8U); } } void SoftTerm::SetAttributes() { for (std::size_t i(0U); i < argc; ) { if (i + 3U <= argc && 38U == args[i + 0U] && 5U == args[i + 1U]) { foreground = Map256Colour(args[i + 2U] % 256U); i += 3U; } else if (i + 3U <= argc && 48U == args[i + 0U] && 5U == args[i + 1U]) { background = Map256Colour(args[i + 2U] % 256U); i += 3U; } else if (i + 5U <= argc && 38U == args[i + 0U] && 2U == args[i + 1U]) { foreground = CharacterCell::colour_type(ALPHA_FOR_EXPLICIT,args[i + 2U] % 256U,args[i + 3U] % 256U,args[i + 4U] % 256U); i += 5U; } else if (i + 5U <= argc && 48U == args[i + 0U] && 2U == args[i + 1U]) { background = CharacterCell::colour_type(ALPHA_FOR_EXPLICIT,args[i + 2U] % 256U,args[i + 3U] % 256U,args[i + 4U] % 256U); i += 5U; } else SetAttribute (args[i++]); } } void SoftTerm::SetModes(bool flag) { for (std::size_t i(0U); i < argc; ++i) SetMode (args[i], flag); } void SoftTerm::SetPrivateModes(bool flag) { for (std::size_t i(0U); i < argc; ++i) SetPrivateMode (args[i], flag); } void SoftTerm::SGR0() { attributes = 0U; foreground = default_foreground; background = default_background; } void SoftTerm::SetAttribute(unsigned int a) { switch (a) { default: std::clog << "Unknown attribute : " << a << "\n"; break; case 0U: SGR0(); break; case 1U: attributes |= CharacterCell::BOLD; break; case 2U: attributes |= CharacterCell::FAINT; break; case 3U: attributes |= CharacterCell::ITALIC; break; case 4U: attributes |= CharacterCell::UNDERLINE; break; case 5U: attributes |= CharacterCell::BLINK; break; case 7U: attributes |= CharacterCell::INVERSE; break; case 8U: attributes |= CharacterCell::INVISIBLE; break; case 9U: attributes |= CharacterCell::STRIKETHROUGH; break; case 22U: attributes &= ~(CharacterCell::BOLD|CharacterCell::FAINT); break; case 23U: attributes &= ~CharacterCell::ITALIC; break; case 24U: attributes &= ~CharacterCell::UNDERLINE; break; case 25U: attributes &= ~CharacterCell::BLINK; break; case 27U: attributes &= ~CharacterCell::INVERSE; break; case 28U: attributes &= ~CharacterCell::INVISIBLE; break; case 29U: attributes &= ~CharacterCell::STRIKETHROUGH; break; case 30U: case 31U: case 32U: case 33U: case 34U: case 35U: case 36U: case 37U: foreground = Map16Colour(a - 30U + 8U * (a > 30U)); break; case 39U: foreground = default_foreground; break; case 40U: case 41U: case 42U: case 43U: case 44U: case 45U: case 46U: case 47U: background = Map16Colour(a - 40U + 8U * (a > 40U)); break; case 49U: background = default_background; break; case 90U: case 91U: case 92U: case 93U: case 94U: case 95U: case 96U: case 97U: foreground = Map16Colour(a - 90U + 8U * (a > 90U)); break; case 100U: case 101U: case 102U: case 103U: case 104U: case 105U: case 106U: case 107U: background = Map16Colour(a - 100U + 8U * (a > 100U)); break; // ECMA-48 defines these as font changes. We don't provide that. // The Linux console defines them as something else. We don't provide that, either. case 10U: break; case 11U: break; } } void SoftTerm::SaveAttributes() { saved_attributes = attributes; saved_foreground = foreground; saved_background = background; } void SoftTerm::RestoreAttributes() { attributes = saved_attributes; foreground = saved_foreground; background = saved_background; } void SoftTerm::SetLinesPerPage() { // This is a bodge to accommodate progreams such as NeoVIM that hardwire this xterm control sequence. if (3 == argc && 8U == args[0]) { const coordinate rows(args[1]); const coordinate columns(args[2]); if (columns >= 2U && rows >= 2U) Resize(columns, rows); } else if (argc) { const coordinate n(args[argc - 1U]); // The DEC VT minimum is 80 columns; we are more liberal since we are not constrained by CRT hardware. if (n >= 2U) { const coordinate columns(display_origin.x + display_margin.w); Resize(columns, n); } } } void SoftTerm::SetColumnsPerPage() { if (argc) { const coordinate n(args[argc - 1U]); // The DEC VT minimum is 24 rows; we are more liberal since we are not constrained by CRT hardware. // xterm is not strictly compatible here, as it gives quite different meanings to values of n less than 24. // A true DEC VT520 rounds up to the lowest possible size, which is 24. if (n >= 2U) { const coordinate rows(display_origin.y + display_margin.h); Resize(n, rows); } } } void SoftTerm::SetScrollbackBuffer(bool f) { const coordinate columns(display_origin.x + display_margin.w); /// FIXME \bug This does not really work properly. if (f) { Resize(columns, display_margin.h + 25U); ResetMargins(); display_origin.y = 25U; } else { display_origin.y = 0U; Resize(columns, display_margin.h); } } void SoftTerm::SetMode(unsigned int a, bool f) { switch (a) { case 4U: overstrike = !f; break; // ############## Intentionally unimplemented standard modes case 2U: // KAM (keyboard action) // The terminal emulator is entirely decoupled from the physical keyboard; making these meaningless. break; case 6U: // ERM (erasure) case 7U: // VEM (line editing) case 10U: // HEM (character editing) case 12U: // SRM (local echoplex) case 18U: // TSM (tabulation) // We don't provide this variability. break; case 19U: // EBM (editing boundary) case 20U: // LNM (linefeed/newline) // These were deprecated in ECMA-48:1991. break; // ############## As yet unimplemented or simply unknown standard modes default: std::clog << "Unknown mode : " << a << "\n"; break; } } void SoftTerm::SetPrivateMode(unsigned int a, bool f) { switch (a) { case 3U: // DECCOLM { const coordinate rows(display_origin.y + display_margin.h); Resize(f ? 132U : 80U, rows); if (!no_clear_screen_on_column_change) { Home(); ClearDisplay(); } ResetMargins(); break; } case 6U: active_modes.origin = f; break; // DECOM case 7U: active_modes.automatic_right_margin = f; break; // DECAWM case 12U: if (f) cursor_attributes |= CursorSprite::BLINK; else cursor_attributes &= ~CursorSprite::BLINK; UpdateCursorType(); break; case 25U: // DECTCEM if (f) cursor_attributes |= CursorSprite::VISIBLE; else cursor_attributes &= ~CursorSprite::VISIBLE; UpdateCursorType(); break; case 67U: keyboard.SetBackspaceIsBS(f); break ; // DECBKM case 69U: active_modes.left_right_margins = f; break; // DECLRMM case 95U: no_clear_screen_on_column_change = f; break; // DECNCSM case 112U: SetScrollbackBuffer(f); break; // DECRPL case 117U: active_modes.background_colour_erase = f; break; // DECECM case 1000U: mouse.SetSendXTermMouseClicks(f); mouse.SetSendXTermMouseButtonMotions(false); mouse.SetSendXTermMouseNoButtonMotions(false); break; case 1002U: mouse.SetSendXTermMouseClicks(f); mouse.SetSendXTermMouseButtonMotions(f); mouse.SetSendXTermMouseNoButtonMotions(false); break; case 1003U: mouse.SetSendXTermMouseClicks(f); mouse.SetSendXTermMouseButtonMotions(f); mouse.SetSendXTermMouseNoButtonMotions(f); break; case 1006U: send_XTermMouse = f; mouse.SetSendXTermMouse(f); UpdatePointerType(); break; case 1037U: keyboard.SetDeleteIsDEL(f); break ; case 2004U: keyboard.SetSendPasteEvent(f); break ; // ############## Intentionally unimplemented private modes case 1U: // DECCKM (application cursor keys) case 8U: // DECARM (autorepeat mode) case 66U: // DECNKM (ancillary keypad numeric mode) case 68U: // DECKBUM (main keypad data processing mode) // The terminal emulator is entirely decoupled from the physical keyboard; making these meaningless. break; case 1004U: // xterm GUI focus event reports // The terminal emulator is entirely decoupled from the realizer; making these meaningless. break; case 4U: break; // DECSCLM (slow scroll) is not useful. case 9U: break; // This is an old ambiguous to decode mouse protocol, since superseded. case 1001U: break; // This is a mouse grabber, tricky and largely unused in the wild. case 1005U: break; // This is an old ambiguous to decode mouse protocol, since superseded. case 1015U: break; // This is an old mouse protocol, since superseded. // ############## As yet unimplemented or simply unknown private modes case 5U: // DECSCNM (light background/whole screen reverse video) is not implemented. #if 0 /// TODO: case 1007U: /// \todo Wheel mouse events when the alternate screen buffer is on #endif default: std::clog << "Unknown private mode : " << a << "\n"; break; } } void SoftTerm::SaveModes() { saved_modes = active_modes; } void SoftTerm::RestoreModes() { active_modes = saved_modes; } void SoftTerm::SCOSCorDESCSLRM() { // SCOSC (SCO console save cursor) is the same control sequence as DECSLRM (DEC VT set left and right margins). // SCOSC is what the Linux and FreeBSD consoles implement and it is listed in the termcap/terminfo entries, so we cannot simply omit it. // This is pretty much the same bodge to solve this as used by xterm. if (active_modes.left_right_margins || argc > 0U) SetLeftRightMargins(); else { SaveCursor(); SaveAttributes(); SaveModes(); } } void SoftTerm::SetSCOAttributes() { if (argc < 1U) return; // SCO SGR must always have an initial subcommand parameter. switch (args[0]) { case 0U: foreground = default_foreground; background = default_background; break; case 1U: if (argc > 1U) background = Map256Colour(args[1] % 256U); break; case 2U: if (argc > 1U) foreground = Map256Colour(args[1] % 256U); break; default: std::clog << "Unknown SCO attribute : " << args[0] << "\n"; break; } } void SoftTerm::SetSCOCursorType() { if (argc != 1U) return; // We don't do custom cursor shapes. switch (args[0]) { case 0U: cursor_attributes |= CursorSprite::VISIBLE; cursor_attributes &= ~CursorSprite::BLINK; cursor_type = CursorSprite::BLOCK; break; case 1U: cursor_attributes |= CursorSprite::BLINK|CursorSprite::VISIBLE; cursor_type = CursorSprite::BLOCK; break; case 5U: cursor_attributes &= ~(CursorSprite::VISIBLE|CursorSprite::BLINK); cursor_type = CursorSprite::UNDERLINE; break; } UpdateCursorType(); } // This control sequence is implemented by the Linux virtual terminal and used by programs such as vim. // See Linux/Documentation/admin-guide/VGA-softcursor.txt . void SoftTerm::SetLinuxCursorType() { if (argc < 1U) return; switch (args[0] & 0x0F) { case 0U: cursor_attributes |= CursorSprite::VISIBLE; cursor_type = CursorSprite::BLOCK; break; case 1U: cursor_attributes &= ~CursorSprite::VISIBLE; cursor_type = CursorSprite::UNDERLINE; break; case 2U: cursor_attributes |= CursorSprite::VISIBLE; cursor_type = CursorSprite::UNDERLINE; break; case 3U: case 4U: case 5U: cursor_attributes |= CursorSprite::VISIBLE; cursor_type = CursorSprite::BOX; break; case 6U: default: cursor_attributes |= CursorSprite::VISIBLE; cursor_type = CursorSprite::BLOCK; break; } UpdateCursorType(); } void SoftTerm::SetCursorStyle() { for (std::size_t i(0U); i < argc; ++i) switch (args[i]) { case 0U: case 1U: cursor_attributes |= CursorSprite::BLINK; cursor_type = CursorSprite::BLOCK; break; case 2U: cursor_attributes &= ~CursorSprite::BLINK; cursor_type = CursorSprite::BLOCK; break; case 3U: cursor_attributes |= CursorSprite::BLINK; cursor_type = CursorSprite::UNDERLINE; break; case 4U: cursor_attributes &= ~CursorSprite::BLINK; cursor_type = CursorSprite::UNDERLINE; break; case 5U: cursor_attributes |= CursorSprite::BLINK; cursor_type = CursorSprite::BAR; break; case 6U: cursor_attributes &= ~CursorSprite::BLINK; cursor_type = CursorSprite::BAR; break; case 7U: cursor_attributes |= CursorSprite::BLINK; cursor_type = CursorSprite::BOX; break; case 8U: cursor_attributes &= ~CursorSprite::BLINK; cursor_type = CursorSprite::BOX; break; case 9U: cursor_attributes |= CursorSprite::BLINK; cursor_type = CursorSprite::STAR; break; case 10U: cursor_attributes &= ~CursorSprite::BLINK; cursor_type = CursorSprite::STAR; break; } UpdateCursorType(); } void SoftTerm::SendPrimaryDeviceAttributes() { for (std::size_t i(0U); i < argc; ++i) SendPrimaryDeviceAttribute (args[i]); } void SoftTerm::SendSecondaryDeviceAttributes() { for (std::size_t i(0U); i < argc; ++i) SendSecondaryDeviceAttribute (args[i]); } void SoftTerm::SendTertiaryDeviceAttributes() { for (std::size_t i(0U); i < argc; ++i) SendTertiaryDeviceAttribute (args[i]); } static const char vt220_device_attribute1[] = "?" // DEC private "62" // VT220 ";" "1" // ... with 132-column support ";" "22" // ... with ANSI colour capability ";" "29" // ... with a locator device "c"; void SoftTerm::SendPrimaryDeviceAttribute(unsigned int a) { switch (a) { case 0U: keyboard.WriteControl1Character(CSI); keyboard.WriteLatin1Characters(sizeof vt220_device_attribute1 - 1, vt220_device_attribute1); break; default: std::clog << "Unknown primary device attribute request : " << a << "\n"; break; } } static const char vt220_device_attribute2[] = ">" // DEC private "1" // VT220 ";" "0" // firmware version number ";" "0" // ROM cartridge registration number "c"; void SoftTerm::SendSecondaryDeviceAttribute(unsigned int a) { switch (a) { case 0U: keyboard.WriteControl1Character(CSI); keyboard.WriteLatin1Characters(sizeof vt220_device_attribute2 - 1, vt220_device_attribute2); break; default: std::clog << "Unknown secondary device attribute request : " << a << "\n"; break; } } static const char vt220_device_attribute3[] = "!" "|" "00" // zero factory number "000000" // zero item number ; void SoftTerm::SendTertiaryDeviceAttribute(unsigned int a) { switch (a) { case 0U: keyboard.WriteControl1Character(DCS); keyboard.WriteLatin1Characters(sizeof vt220_device_attribute3 - 1, vt220_device_attribute3); keyboard.WriteControl1Character(ST); break; default: std::clog << "Unknown tertiary device attribute request : " << a << "\n"; break; } } void SoftTerm::SendDeviceStatusReports() { for (std::size_t i(0U); i < argc; ++i) SendDeviceStatusReport (args[i]); } void SoftTerm::SendPrivateDeviceStatusReports() { for (std::size_t i(0U); i < argc; ++i) SendPrivateDeviceStatusReport (args[i]); } static const char operating_status_report[] = "0" // operating OK "n"; void SoftTerm::SendDeviceStatusReport(unsigned int a) { switch (a) { case 5U: keyboard.WriteControl1Character(CSI); keyboard.WriteLatin1Characters(sizeof operating_status_report - 1, operating_status_report); break; case 6U: { char b[32]; const int n(snprintf(b, sizeof b, "%u;%uR", active_cursor.y + 1U, active_cursor.x + 1U)); keyboard.WriteControl1Character(CSI); keyboard.WriteLatin1Characters(n, b); break; } default: std::clog << "Unknown device attribute request : " << a << "\n"; break; } } static const char printer_status_report[] = "?" // DEC private "13" // no printer "n"; static const char udk_status_report[] = "?" // DEC private "21" // UDKs are locked "n"; static const char keyboard_status_report[] = "?" // DEC private "27" // keyboard reply ";" "0" // unknown language ";" "0" // keyboard ready ";" "5" // PCXAL "n"; static const char locator_status_report[] = "?" // DEC private "50" // locator is present and enabled "n"; static const char locator_type_status_report[] = "?" // DEC private "57" // mouse reply ";" "1" // the locator is a mouse "n"; static const char data_integrity_report[] = "?" // DEC private "70" // serial communications errors are impossible "n"; static const char session_status_report[] = "?" // DEC private "83" // sessions are not available. "n"; void SoftTerm::SendPrivateDeviceStatusReport(unsigned int a) { switch (a) { case 6U: { char b[32]; const int n(snprintf(b, sizeof b, "%u;%u;1R", active_cursor.y + 1U, active_cursor.x + 1U)); keyboard.WriteControl1Character(CSI); keyboard.WriteLatin1Characters(n, b); break; } case 15U: keyboard.WriteControl1Character(CSI); keyboard.WriteLatin1Characters(sizeof printer_status_report - 1, printer_status_report); break; case 25U: keyboard.WriteControl1Character(CSI); keyboard.WriteLatin1Characters(sizeof udk_status_report - 1, udk_status_report); break; case 26U: keyboard.WriteControl1Character(CSI); keyboard.WriteLatin1Characters(sizeof keyboard_status_report - 1, keyboard_status_report); break; case 53U: // This is an xterm extension. case 55U: // This is the DEC-specified report number. keyboard.WriteControl1Character(CSI); keyboard.WriteLatin1Characters(sizeof locator_status_report - 1, locator_status_report); break; case 56U: keyboard.WriteControl1Character(CSI); keyboard.WriteLatin1Characters(sizeof locator_type_status_report - 1, locator_type_status_report); break; case 75U: keyboard.WriteControl1Character(CSI); keyboard.WriteLatin1Characters(sizeof data_integrity_report - 1, data_integrity_report); break; case 85U: keyboard.WriteControl1Character(CSI); keyboard.WriteLatin1Characters(sizeof session_status_report - 1, session_status_report); break; default: std::clog << "Unknown device attribute request : " << a << "\n"; break; } } /* Locator control ********************************************************** // ************************************************************************** */ void SoftTerm::RequestLocatorReport() { if (0 == argc) mouse.RequestDECLocatorReport(); else for (std::size_t i(0U); i < argc; ++i) mouse.RequestDECLocatorReport(); } void SoftTerm::EnableLocatorReports() { send_DECLocator = argc > 0U ? args[0U] : false; mouse.SetSendDECLocator(send_DECLocator); UpdatePointerType(); if (2 <= argc && 1U == args[1U]) std::clog << "Pixel coordinate locator report request denied.\n"; } void SoftTerm::SelectLocatorEvents() { if (0 == argc) SelectLocatorEvent(0U); else for (std::size_t i(0U); i < argc; ++i) SelectLocatorEvent(args[i]); } void SoftTerm::SelectLocatorEvent(unsigned int a) { switch (a) { case 0: mouse.SetSendDECLocatorPressEvent(false); mouse.SetSendDECLocatorReleaseEvent(false); break; case 1: case 2: mouse.SetSendDECLocatorPressEvent(1 == a); break; case 3: case 4: mouse.SetSendDECLocatorReleaseEvent(3 == a); break; default: std::clog << "Unknown locator event selected : " << a << "\n"; break; } } /* Control sequence character classification ******************************** // ************************************************************************** */ inline bool SoftTerm::IsControl(uint32_t character) { return (character < 0x20) || (character >= 0x80 && character < 0xA0) || (DEL == character); } inline bool SoftTerm::IsParameter(uint32_t character) { return character >= 0x30 && character < 0x40; } inline bool SoftTerm::IsIntermediate(uint32_t character) { return character >= 0x20 && character < 0x30; } /* Top-level output functions *********************************************** // ************************************************************************** */ void SoftTerm::Write(uint32_t character, bool decoder_error, bool overlong) { switch (state) { case NORMAL: if (decoder_error || overlong) Print(true, character); else if (IsControl(character)) ProcessControlCharacter(character); else Print(false, character); break; case ESCAPE1: if (decoder_error) state = NORMAL; else if (overlong) { state = NORMAL; Print(true, character); } else if (IsControl(character)) ProcessControlCharacter(character); else Escape1(character); break; case ESCAPE2: if (decoder_error) state = NORMAL; else if (overlong) { state = NORMAL; Print(true, character); } else if (IsControl(character)) ProcessControlCharacter(character); else Escape2(character); break; case CONTROL1: case CONTROL2: if (decoder_error) state = NORMAL; else if (overlong) { state = NORMAL; Print(true, character); } else if (IsControl(character)) ProcessControlCharacter(character); else ControlSequence(character); break; } } void SoftTerm::ProcessControlCharacter(uint32_t character) { switch (character) { case NUL: break; case BEL: /* TODO: bell */ break; case CR: CarriageReturn(); break; case NEL: CarriageReturnNoUpdate(); CursorDown(1U, true, scrolling); break; case IND: case LF: case VT: case FF: CursorDown(1U, true, scrolling); break; case RI: CursorUp(1U, true, scrolling); break; case TAB: HorizontalTab(1U, true); break; case BS: CursorLeft(1U, true, false); break; case DEL: DeleteCharacters(1U); break; case HTS: SetHorizontalTabstop(); break; case ESC: last_intermediate = '\0'; state = ESCAPE1; break; case CSI: state = CONTROL1; ResetControlSequence(); break; case CAN: state = NORMAL; break; case SS2: case SS3: case DCS: case SOS: case ST: case OSC: case PM: case APC: break; // explicitly unsupported control characters default: break; } } void SoftTerm::SoftReset() { advance_pending = false; saved_cursor = display_origin; ResetMargins(); cursor_attributes = CursorSprite::VISIBLE|CursorSprite::BLINK; cursor_type = CursorSprite::BLOCK; UpdateCursorType(); SGR0(); active_modes = mode(); scrolling = true; overstrike = true; } void SoftTerm::ResetToInitialState() { Resize(80U, 25U); Home(); ClearDisplay(); ResetMargins(); cursor_attributes = CursorSprite::VISIBLE|CursorSprite::BLINK; cursor_type = CursorSprite::BLOCK; UpdateCursorType(); SGR0(); keyboard.SetBackspaceIsBS(false); saved_modes = active_modes = mode(); saved_cursor = active_cursor; no_clear_screen_on_column_change = false; scrolling = true; overstrike = true; } void SoftTerm::Escape1(uint32_t character) { if (character >= 0x40 && character <= 0x5f) { state = NORMAL; // Do this first, so that it can be overridden. // This is known as "7-bit code extension" and is defined for the entire range. ProcessControlCharacter(character + 0x40); } else if (IsIntermediate(character)) { last_intermediate = static_cast<char>(character); state = ESCAPE2; } else switch (character) { default: state = NORMAL; break; /* DECBI */ case '6': CursorLeft(1U, true, true); state = NORMAL; break; /* DECSC */ case '7': SaveCursor(); SaveAttributes(); SaveModes(); state = NORMAL; break; /* DECRC */ case '8': RestoreCursor(); RestoreAttributes(); RestoreModes(); state = NORMAL; break; /* DECFI */ case '9': CursorRight(1U, true, true); state = NORMAL; break; /* RIS */ case 'c': ResetToInitialState(); state = NORMAL; break; case '=': // DECKPAM (keypad sends application-mode sequences) case '>': // DECKPNM (keypad sends numeric-mode sequences) // The terminal emulator is entirely decoupled from the physical keyboard; making these meaningless. state = NORMAL; break; } } void SoftTerm::Escape2(uint32_t character) { if (IsIntermediate(character)) { last_intermediate = static_cast<char>(character); } else { switch (last_intermediate) { default: break; case ' ': switch (character) { default: break; /* S7C1T */ case 'F': keyboard.Set8BitControl1(false); break; /* S8C1T */ case 'G': keyboard.Set8BitControl1(true); break; } break; case '#': switch (character) { default: break; /* DECALN */ case '8': ResetMargins(); Home(); ClearDisplay('E'); break; } break; } state = NORMAL; } } void SoftTerm::ControlSequence(uint32_t character) { if (!IsParameter(character)) state = CONTROL2; else if (CONTROL1 != state) { std::clog << "Out of sequence CSI parameter character : " << character << "\n"; state = NORMAL; } else switch (character) { // Accumulate digits in arguments. case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': seen_arg_digit = true; args[argc] = args[argc] > 999U ? 9999U : args[argc] * 10U + (character - '0'); return; // ECMA-48 defines colon as a sub-argument delimiter. // No-one uses it; not even ISO 8613-3 SGR 38/48 sequences. case ':': seen_arg_digit = false; args[argc] = 0U; return; // Arguments may be semi-colon separated. case ';': FinishArg(0U); return; // Everything else up to U+002F is a private parameter character, per ECMA-48 5.4.1. // DEC VTs make use of '<', '=', '>', and '?'. default: if ('\x00' == first_private_parameter) first_private_parameter = static_cast<char>(character); return; } // We only reach this point in the CONTROL2 state. if (IsIntermediate(character)) { last_intermediate = static_cast<char>(character); return; } // Finish the final argument, using the relevant defaults. if ('\0' == last_intermediate) { if ('\0' == first_private_parameter) switch (character) { case 'c': case 'g': case 'm': case 'J': case 'K': case 'x': case 'r': FinishArg(0U); break; case 'H': case 'f': FinishArg(1U); if (argc < 2U) FinishArg(1U); break; default: FinishArg(1U); break; } else if ('?' == first_private_parameter) { FinishArg(1U); } else if ('>' == first_private_parameter) { FinishArg(0U); } else if ('=' == first_private_parameter) { FinishArg(0U); } else FinishArg(1U); } else if ('$' == last_intermediate) { FinishArg(1U); } else if ('*' == last_intermediate) { FinishArg(1U); } else if (' ' == last_intermediate) { FinishArg(1U); } else if ('!' == last_intermediate) { FinishArg(1U); } else if ('\'' == last_intermediate) switch (character) { /* DECSLE */ case '{': /* DECRQLP */ case '|': /* DECELR */ case 'z': FinishArg(0U); break; default: FinishArg(1U); break; } else FinishArg(1U); // Enact the action. if ('\0' == last_intermediate) { if ('\0' == first_private_parameter) switch (character) { // ---- ECMA-defined final characters ---- /* ICH */ case '@': InsertCharacters(OneIfZero(SumArgs())); break; /* CUU */ case 'A': CursorUp(OneIfZero(SumArgs()), false, false); break; /* CUD */ case 'B': CursorDown(OneIfZero(SumArgs()), false, false); break; /* CUF */ case 'C': CursorRight(OneIfZero(SumArgs()), false, false); break; /* CUB */ case 'D': CursorLeft(OneIfZero(SumArgs()), false, false); break; /* CNL */ case 'E': CarriageReturnNoUpdate(); CursorDown(OneIfZero(SumArgs()), true, false); break; /* CPL */ case 'F': CarriageReturnNoUpdate(); CursorUp(OneIfZero(SumArgs()), true, false); break; /* CHA */ case 'G': GotoX(OneIfZero(SumArgs())); break; /* CUP */ case 'H': GotoYX(); break; /* CHT */ case 'I': HorizontalTab(OneIfZero(SumArgs()), true); break; /* ED */ case 'J': EraseInDisplay(); break; /* EL */ case 'K': EraseInLine(); break; /* IL */ case 'L': InsertLines(OneIfZero(SumArgs())); break; /* DL */ case 'M': DeleteLines(OneIfZero(SumArgs())); break; /* EF */ case 'N': break; // Erase Field has no applicability as there are no fields. /* EA */ case 'O': break; // Erase Area has no applicability as there are no areas. /* DCH */ case 'P': DeleteCharacters(OneIfZero(SumArgs())); break; /* SEE */ case 'Q': break; // Set Editing Extent has no applicability as this is not a block mode terminal. /* CPR */ case 'R': break; // Cursor Position Report is meaningless if received rather than sent. case 'S': ScrollUp(OneIfZero(SumArgs())); break; /// FIXME \bug SU is a window pan, not a buffer scroll. case 'T': ScrollDown(OneIfZero(SumArgs())); break; /// FIXME \bug SD is a window pan, not a buffer scroll. /* NP */ case 'U': break; // Next Page has no applicability as there are no pages. /* PP */ case 'V': break; // Previous Page has no applicability as there are no pages. /* CTC */ case 'W': TabControl(); break; /* ECH */ case 'X': EraseCharacters(OneIfZero(SumArgs())); break; /* CVT */ case 'Y': VerticalTab(OneIfZero(SumArgs()), true); break; /* CBT */ case 'Z': BackwardsHorizontalTab(OneIfZero(SumArgs()), true); break; /* SRS */ case '[': break; // No-one needs reversed strings from a virtual terminal. /* PTX */ case '\\': break; // No-one needs parallel texts from a virtual terminal. /* SDS */ case ']': break; // No-one needs directed strings from a virtual terminal. /* SIMD */ case '^': break; // No-one needs implicit movement direction from a virtual terminal. /* HPA */ case '`': GotoX(OneIfZero(SumArgs())); break; /* HPR */ case 'a': CursorRight(OneIfZero(SumArgs()), true, false); break; /* REP */ case 'b': break; // No-one needs repeat from a virtual terminal. /* DA */ case 'c': SendPrimaryDeviceAttributes(); break; /* VPA */ case 'd': GotoY(OneIfZero(SumArgs())); break; /* VPR */ case 'e': CursorDown(OneIfZero(SumArgs()), true, false); break; /* HVP */ case 'f': GotoYX(); break; /* TBC */ case 'g': TabClear(); break; /* SM */ case 'h': SetModes(true); break; /* MC */ case 'i': break; // Media Copy has no applicability as there are no auxiliary devices. /* HPB */ case 'j': CursorLeft(OneIfZero(SumArgs()), true, false); break; /* VPB */ case 'k': CursorUp(OneIfZero(SumArgs()), true, false); break; /* RM */ case 'l': SetModes(false); break; /* SGR */ case 'm': SetAttributes(); break; /* DSR */ case 'n': SendDeviceStatusReports(); break; /* DAQ */ case 'o': break; // Define Area Qualification has no applicability as this is not a block mode terminal. // ---- ECMA private-use final characters begin here. ---- /* DECSTBM */ case 'r': SetTopBottomMargins(); break; case 's': SCOSCorDESCSLRM(); break; /* DECSLPP */ case 't': SetLinesPerPage(); break; /* SCORC */ case 'u': RestoreCursor(); RestoreAttributes(); RestoreModes(); break; /* SCOSGR */ case 'x': SetSCOAttributes(); break; default: std::clog << "Unknown CSI terminator " << character << "\n"; break; } else if ('?' == first_private_parameter) switch (character) { case 'c': SetLinuxCursorType(); break; /* DECSM */ case 'h': SetPrivateModes(true); break; /* DECRM */ case 'l': SetPrivateModes(false); break; /* DECDSR */ case 'n': SendPrivateDeviceStatusReports(); break; default: std::clog << "Unknown DEC Private CSI " << first_private_parameter << ' ' << character << "\n"; break; } else if ('>' == first_private_parameter) switch (character) { /* DECDA2 */ case 'c': SendSecondaryDeviceAttributes(); break; default: std::clog << "Unknown DEC Private CSI " << first_private_parameter << ' ' << character << "\n"; break; } else if ('=' == first_private_parameter) switch (character) { case 'C': SetSCOCursorType(); break; case 'S': SetSCOCursorType(); break; /* DECDA3 */ case 'c': SendTertiaryDeviceAttributes(); break; default: std::clog << "Unknown DEC Private CSI " << first_private_parameter << ' ' << character << "\n"; break; } else std::clog << "Unknown DEC Private CSI " << first_private_parameter << ' ' << character << "\n"; } else if ('$' == last_intermediate) switch (character) { /* DECSCPP */ case '|': SetColumnsPerPage(); break; default: std::clog << "Unknown CSI " << last_intermediate << ' ' << character << "\n"; break; } else if ('*' == last_intermediate) switch (character) { /* DECSNLS */ case '|': SetLinesPerPage(); break; default: std::clog << "Unknown CSI " << last_intermediate << ' ' << character << "\n"; break; } else if (' ' == last_intermediate) switch (character) { /* DECSCUSR */ case 'q': SetCursorStyle(); break; /* SL */ case '@': ScrollLeft(OneIfZero(SumArgs())); break; /* SR */ case 'A': ScrollRight(OneIfZero(SumArgs())); break; default: std::clog << "Unknown CSI " << last_intermediate << ' ' << character << "\n"; break; } else if ('!' == last_intermediate) switch (character) { /* DECSTR */ case 'p': SoftReset(); break; default: std::clog << "Unknown CSI " << last_intermediate << ' ' << character << "\n"; break; } else if ('\'' == last_intermediate) switch (character) { /* DECEFR */ case 'w': break; // Enable Filter Rectangle implies a complex multi-window model that is beyond the scope of this emulation. /* DECSLE */ case '{': SelectLocatorEvents(); break; /* DECRQLP */ case '|': RequestLocatorReport(); break; /* DECELR */ case 'z': EnableLocatorReports(); break; default: std::clog << "Unknown CSI " << last_intermediate << ' ' << character << "\n"; break; } else std::clog << "Unknown CSI " << last_intermediate << ' ' << character << "\n"; state = NORMAL; } void SoftTerm::Print( bool error, uint32_t character ) { if (advance_pending) { if (WillWrap()) Advance(); advance_pending = false; } /// FIXME: \bug /// This needs a lot more attention. /// Combining characters don't combine and we don't handle bidirectional printing. if (UnicodeCategorization::IsOtherFormat(character) || UnicodeCategorization::IsMarkNonSpacing(character) ) { // Do nothing. } else { const coordinate columns(display_origin.x + display_margin.w); const ScreenBuffer::coordinate s(columns * active_cursor.y + active_cursor.x); const CharacterCell::attribute_type a(attributes ^ (error ? CharacterCell::INVERSE : 0)); if (UnicodeCategorization::IsMarkEnclosing(character)) { screen.WriteNCells(s, 1U, CharacterCell(character, a, foreground, background)); } else { if (!overstrike) InsertCharacters(1U); screen.WriteNCells(s, 1U, CharacterCell(character, a, foreground, background)); advance_pending = WillWrap(); if (!advance_pending) Advance(); } } }
294923595b4cdb6a45ced3b4f9973568142f5cbd
b1bad4ee178d333334b2a8ca33492de301498ef4
/src/cpu/test_lockit/read.h
ff084a3433290cc286979504d245bca63dee3bef
[]
no_license
nkuri/puyoai
18c26947152935e9d585d74d6c23e7f48f42deb9
af2b1a6e9ef08b73534991d53e3959f2023b48f7
refs/heads/master
2021-01-18T07:34:30.904533
2015-03-22T03:24:14
2015-03-22T03:24:14
32,403,868
0
0
null
2015-03-17T15:58:29
2015-03-17T15:58:29
null
UTF-8
C++
false
false
1,270
h
#ifndef CPU_TEST_LOCKIT_READ_H_ #define CPU_TEST_LOCKIT_READ_H_ #include "lockit_constant.h" class READ_P { private: public: READ_P(); ~READ_P(); void ref(); void fall(); int setti_puyo(); int chousei_syoukyo(); void setti_12(); void field_kioku(); int field_hikaku(); int saiki(int[][TATE], int[][12], int, int, int*, int); int saiki_right(int[][TATE], int[][12], int, int, int*, int); int saiki_left(int[][TATE], int[][12], int, int, int*, int); int saiki_up(int[][TATE], int[][12], int, int, int*, int); int saiki_down(int[][TATE], int[][12], int, int, int*, int); int syou(int[][TATE], int, int, int, int[]); int syou_right(int[][TATE], int, int, int, int[]); int syou_left(int[][TATE], int, int, int, int[]); int syou_up(int[][TATE], int, int, int, int[]); int syou_down(int[][TATE], int, int, int, int[]); int field[6][18]; int field12[6]; int yosou_field[6][18]; int field_hoz[6][18]; int tsumo[6]; int act_on; int act_on_1st; int nex_on; int set_puyo; int set_puyo_once; int rensa_end; int rensa_end_once; int score; int keep_score; int zenkesi; int id; int te_x; int te_r; int setti_basyo[4]; }; #endif
afe435ff1f0bb7bfbd3e40fa713d5c54687bf453
cdc0b8cb4a02932288e0eb8bec991b7c3b4db0bf
/MainLogic.h
a00b3b66e027c48f06b3ebbeda2051f2692e7fdb
[]
no_license
LocketGoma/PMG_Sample02
ea52680a28a981694a62d7b3518f9b3fae42188a
bb3c6121701b70029116f7413bf8355fb38b8941
refs/heads/master
2020-11-24T12:35:40.341503
2019-12-20T18:34:28
2019-12-20T18:34:28
228,145,966
0
0
null
null
null
null
UTF-8
C++
false
false
93
h
#pragma once #include "Resource.h" class Automata { public : Automata(); private : };
502e2564132409e978b3dea209cec62ab696aa84
9be246df43e02fba30ee2595c8cec14ac2b355d1
/game_shared/npcevent.h
c9fb9259b31875f71e95a7ed2956da655c31764f
[]
no_license
Clepoy3/LeakNet
6bf4c5d5535b3824a350f32352f457d8be87d609
8866efcb9b0bf9290b80f7263e2ce2074302640a
refs/heads/master
2020-05-30T04:53:22.193725
2019-04-12T16:06:26
2019-04-12T16:06:26
189,544,338
18
5
null
2019-05-31T06:59:39
2019-05-31T06:59:39
null
WINDOWS-1252
C++
false
false
2,143
h
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ // // Purpose: // // $NoKeywords: $ //============================================================================= #ifndef NPCEVENT_H #define NPCEVENT_H #ifdef _WIN32 #pragma once #endif class CBaseAnimating; struct animevent_t { int event; char *options; float cycle; float eventtime; CBaseAnimating *pSource; }; #define EVENT_SPECIFIC 0 #define EVENT_SCRIPTED 1000 // see scriptevent.h #define EVENT_SHARED 2000 #define EVENT_WEAPON 3000 #define EVENT_CLIENT 5000 #define EVENT_FACEPOSER 8000 #define NPC_EVENT_BODYDROP_LIGHT 2001 #define NPC_EVENT_BODYDROP_HEAVY 2002 #define NPC_EVENT_SWISHSOUND 2010 #define NPC_EVENT_180TURN 2020 #define NPC_EVENT_WEAPON_PICKUP 2040 #define NPC_EVENT_WEAPON_DROP 2041 #define NPC_EVENT_WEAPON_SET_SEQUENCE_NAME 2042 #define NPC_EVENT_WEAPON_SET_SEQUENCE_NUMBER 2043 #define NPC_EVENT_WEAPON_SET_ACTIVITY 2044 #define NPC_EVENT_LEFTFOOT 2050 #define NPC_EVENT_RIGHTFOOT 2051 // !! DON'T CHANGE TO ORDER OF THESE. THEY ARE HARD CODED IN THE WEAPON QC FILES (YUCK!) !! #define EVENT_WEAPON_MELEE_HIT 3001 #define EVENT_WEAPON_SMG1 3002 #define EVENT_WEAPON_MELEE_SWISH 3003 #define EVENT_WEAPON_SHOTGUN_FIRE 3004 #define EVENT_WEAPON_THROW 3005 #define EVENT_WEAPON_AR1 3006 #define EVENT_WEAPON_AR2 3007 #define EVENT_WEAPON_HMG1 3008 #define EVENT_WEAPON_SMG2 3009 #define EVENT_WEAPON_MISSILE_FIRE 3010 #define EVENT_WEAPON_SNIPER_RIFLE_FIRE 3011 #define EVENT_WEAPON_AR2_GRENADE 3012 #define EVENT_WEAPON_THROW2 3013 #define EVENT_WEAPON_PISTOL_FIRE 3014 #define EVENT_WEAPON_RELOAD 3015 #define EVENT_WEAPON_THROW3 3016 #define EVENT_WEAPON_SMG1_BURST1 3101 // first round in a 3-round burst #define EVENT_WEAPON_SMG1_BURSTN 3102 // 2, 3 rounds // NOTE: MUST BE THE LAST WEAPON EVENT -- ONLY WEAPON EVENTS BETWEEN EVENT_WEAPON AND THIS #define EVENT_WEAPON_LAST 3999 // Faceposer events #define EVENT_FACEPOSER_TAG 8001 #endif // NPCEVENT_H
04149bcee7e06892ba5628ec443f2efcf37b2958
f4eb7835c43e0c86e4789aa9be18d97376b08c62
/game_GameItem.cpp
2abbbf8a5892d1675b92a8297558cf5bab3df224
[]
no_license
mugisaku/gamebaby-20171020-dumped
c8a90dd1dcfa1e1322d60962694bb23371b33271
750d916502c36319cb839e02df7eff87cb844f47
refs/heads/master
2021-07-14T17:39:38.157266
2017-10-20T05:25:37
2017-10-20T05:25:37
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,941
cpp
#include"game_GameItem.hpp" namespace gmbb{ GameItem:: GameItem(char const* name_, Price pri, char16_t const* desc, Sword const& swd) noexcept: name(name_), price(pri), description(desc), kind(GameItemKind::sword) {data.sword = swd;} GameItem:: GameItem(char const* name_, Price pri, char16_t const* desc, Shield const& shl) noexcept: name(name_), price(pri), description(desc), kind(GameItemKind::shield) {data.shield = shl;} GameItem:: GameItem(char const* name_, Price pri, char16_t const* desc, Belt const& blt) noexcept: name(name_), price(pri), description(desc), kind(GameItemKind::belt) {data.belt = blt;} GameItem:: GameItem(char const* name_, Price pri, char16_t const* desc, Wand const& wnd) noexcept: name(name_), price(pri), description(desc), kind(GameItemKind::wand) {data.wand = wnd;} GameItem:: GameItem(char const* name_, Price pri, char16_t const* desc, Card const& crd) noexcept: name(name_), price(pri), description(desc), kind(GameItemKind::card) {data.card = crd;} GameItem:: GameItem(char const* name_, Price pri, char16_t const* desc, Water const& wat) noexcept: name(name_), price(pri), description(desc), kind(GameItemKind::water) {data.water = wat;} char16_t const* GameItem:: get_first_operation_name() const noexcept { if((kind == GameItemKind::sword ) || (kind == GameItemKind::shield) || (kind == GameItemKind::belt )) { return u"そうび"; } else if(kind == GameItemKind::wand) { return u"ふる"; } else if(kind == GameItemKind::card) { return u"となえる"; } else if(kind == GameItemKind::water) { return u"あびる"; } return nullptr; } GameItem const game_item_table[] = { GameItem("どうのつるぎ",Price(0),u"",Sword(0)), GameItem("てつのつるぎ" ,Price(0),u"",Sword(0)), GameItem("はがねのつるぎ" ,Price(0),u"",Sword(0)), GameItem("きのたて",Price(0),u"",Shield(0)), GameItem("かわのたて",Price(0),u"",Shield(0)), GameItem("てつのたて",Price(0),u"",Shield(0)), GameItem("やすいおび",Price(0),u"",Belt()), GameItem("ふつうのおび",Price(0),u"",Belt()), GameItem("こうきゅうおび",Price(0),u"",Belt()), GameItem("ふこうのおび",Price(0),u"",Belt()), GameItem("ねむりのつえ",Price(0),u"",Wand()), GameItem("どくのつえ",Price(0),u"",Wand()), GameItem("ちからのふだ",Price(0),u"",Card()), GameItem("まもりのふだ",Price(0),u"",Card()), GameItem("だっしゅつのふだ",Price(0),u"",Card()), GameItem("いやしのみず",Price(0),u"",Water()), GameItem("どくのみず",Price(0),u"",Water()), GameItem("ただのみず",Price(0),u"",Water()), GameItem("くさいのみず",Price(0),u"",Water()), GameItem("きせきのみず",Price(0),u"",Water()), }; size_t const game_item_total = sizeof(game_item_table)/sizeof(GameItem); }
83ae5bce6bd07484f5c7be788ffbe28843a8b31a
635206840d9a3ce3091fa0c2baca565a07d6d4b3
/LR2/GrammarTransform/include/grammar/Grammar.h
49cb1e9161bf2d599d7f994de0349803a1b11e59
[]
no_license
qwerfah/compilers-design
cc9af7d27c4240d3e688c7e1bc144c2b79e030a2
460de1f76cbf1e30ea4062f676cd06cda51a5645
refs/heads/main
2023-06-08T21:37:04.375566
2021-06-18T23:01:39
2021-06-18T23:01:39
340,848,352
0
0
null
2021-04-04T12:38:08
2021-02-21T07:59:51
null
UTF-8
C++
false
false
972
h
#pragma once #include <algorithm> #include <iterator> #include "symbol.h" #include "rule.h" class GrammarTransform; /// <summary> /// Regular grammar. /// </summary> class Grammar { public: Grammar(); /// <summary> /// Get symbol from grammar alphabet by its name. /// </summary> /// <param name="name"> Name of the symbol. </param> /// <returns> Symbol with specified name. </returns> const symbol_ptr& getSymbol(const std::string& name) const; /// <summary> /// Terminal symbols (occur in the output). /// </summary> symbol_vector terminals{}; /// <summary> /// Nonterminal symbols (occur in left part of grammar rule). /// </summary> symbol_vector nonTerminals{}; /// <summary> /// Start symbol of grammar. /// </summary> symbol_ptr axiom{}; /// <summary> /// Set of withdrawal rules. /// </summary> std::vector<std::shared_ptr<Rule>> rules{}; /// <summary> /// Thramsform algorithms. /// </summary> transform_map algorithms{}; };
08bcfe48e893542d428e0d91d0eb90fca27c96e2
c3b4bb9299976ef76a14230b64baae1baa11adb2
/include/Auteur.h
5acdd8f4349eeb9a4f7697ba4df1c8f0e454ae62
[]
no_license
Sterling-qc/tp2_1010
e7e80e99c04e076568f7df79b2f98985480097c2
21ad6b0c725820032760b416f9d739cced18212c
refs/heads/master
2020-12-23T07:56:23.084127
2020-01-29T21:59:42
2020-01-29T21:59:42
237,090,153
0
0
null
null
null
null
UTF-8
C++
false
false
603
h
#ifndef AUTEUR_H #define AUTEUR_H #include <string> #include <fstream> class Auteur { public: Auteur() = default; Auteur(const std::string& nom, unsigned int anneeDeNaissance); const std::string& getNom() const; unsigned int getAnneeDeNaissance() const; unsigned int getNbFilms() const; void setNbFilms(unsigned int nbFilms); friend std::ostream& operator<<(std::ostream& o, const Auteur& auteur); bool operator==(const std::string& nom) const; //OKOKOK private: std::string nom_; unsigned int anneeDeNaissance_; unsigned int nbFilms_; }; #endif // AUTEUR_H
75342683a21b02632b6a294817a8fdda7f8526bc
46b2acb9deec166a332f12687dd203520de63a7a
/server/Service/UserService.h
281855e12023575fbabadd509df9064d1b1cb708
[]
no_license
davyxx3/my_chatroom
dc88c275d95bdf8f27d91312d91f8d2e263f6aac
6ec8c8fbaa0279efe50026ac95524d5574239748
refs/heads/master
2023-09-03T10:57:02.911699
2021-11-05T10:12:30
2021-11-05T10:12:30
424,903,748
0
0
null
null
null
null
UTF-8
C++
false
false
429
h
#pragma once #include"../Dao/MySQLConnector.h" using namespace std; class UserService { private: MySQLConnector *connector; bool checkAccount(string &account); bool checkPassword(string &password); public: UserService(); pair<int, string> checkLogin(string account, string password); bool isRegistered(string account); bool registerUser(string account, string username, string password); };
4afdee5857e5065492f56c133b5de4d59f836b1b
44289ecb892b6f3df043bab40142cf8530ac2ba4
/Sources/Elastos/Frameworks/Droid/Base/Services/Server/inc/elastos/droid/server/PersistentDataBlockService.h
4fad40b6481c1e483626cac992d8f45e3825e541
[ "Apache-2.0" ]
permissive
warrenween/Elastos
a6ef68d8fb699fd67234f376b171c1b57235ed02
5618eede26d464bdf739f9244344e3e87118d7fe
refs/heads/master
2021-01-01T04:07:12.833674
2017-06-17T15:34:33
2017-06-17T15:34:33
97,120,576
2
1
null
2017-07-13T12:33:20
2017-07-13T12:33:20
null
UTF-8
C++
false
false
5,057
h
//========================================================================= // Copyright (C) 2012 The Elastos Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. //========================================================================= #ifndef __ELASTOS_DROID_SERVER_PERSISTENT_DATA_BLOCK_SERVICE_H__ #define __ELASTOS_DROID_SERVER_PERSISTENT_DATA_BLOCK_SERVICE_H__ #include "elastos/droid/server/SystemService.h" #include <Elastos.Droid.Os.h> #include <Elastos.Droid.Service.h> using Elastos::Droid::App::IActivityManager; using Elastos::Droid::Content::IContext; using Elastos::Droid::Content::Pm::IPackageManager; using Elastos::Droid::Os::IBinder; using Elastos::Droid::Os::ISystemProperties; using Elastos::Droid::Os::IUserHandle; using Elastos::Droid::Service::Persistentdata::IIPersistentDataBlockService; using Elastos::IO::IDataInputStream; using Elastos::IO::IDataOutputStream; using Elastos::IO::IFile; using Elastos::IO::IFileInputStream; using Elastos::IO::IFileOutputStream; namespace Elastos { namespace Droid { namespace Server { /** * Service for reading and writing blocks to a persistent partition. * This data will live across factory resets not initiated via the Settings UI. * When a device is factory reset through Settings this data is wiped. * * Allows writing one block at a time. Namely, each time * {@link android.service.persistentdata.IPersistentDataBlockService}.Write(Byte[] data) * is called, it will overwite the data that was previously written on the block. * * Clients can query the size of the currently written block via * {@link android.service.persistentdata.IPersistentDataBlockService}.GetTotalDataSize(). * * Clients can any number of bytes from the currently written block up to its total size by invoking * {@link android.service.persistentdata.IPersistentDataBlockService}.Read(Byte[] data) */ class PersistentDataBlockService : public SystemService { public: class BinderService : public Object , public IIPersistentDataBlockService , public IBinder { public: CAR_INTERFACE_DECL() CARAPI constructor( /* [in] */ ISystemService* service); //@Override CARAPI Write( /* [in] */ ArrayOf<Byte>* data, /* [out] */ Int32* result); //@Override CARAPI Read( /* [out, callee] */ ArrayOf<Byte>** data); //@Override CARAPI Wipe(); //@Override CARAPI SetOemUnlockEnabled( /* [in] */ Boolean enabled); //@Override CARAPI GetOemUnlockEnabled( /* [out] */ Boolean* result); //@Override CARAPI GetDataBlockSize( /* [out] */ Int32* result); //@Override CARAPI GetMaximumDataBlockSize( /* [out] */ Int64* result); CARAPI ToString( /* [out] */ String* str); private: PersistentDataBlockService* mHost; }; public: PersistentDataBlockService(); ~PersistentDataBlockService(); CARAPI constructor( /* [in] */ IContext* context); //@Override CARAPI OnStart(); private: Int32 GetAllowedAppId( /* [in] */ Int32 userHandle); CARAPI EnforceOemUnlockPermission(); CARAPI EnforceUid( /* [in] */ Int32 callingUid); CARAPI GetTotalDataSizeLocked( /* [in] */ IDataInputStream* inputStream, /* [out] */ Int32* result); Int64 GetBlockDeviceSize(); Int64 NativeGetBlockDeviceSize( /* [in] */ const String& path); Int32 NativeWipe( /* [in] */ const String& path); private: static const String TAG; static const String PERSISTENT_DATA_BLOCK_PROP; static const Int32 HEADER_SIZE; // Magic number to mark block device as adhering to the format consumed by this service static const Int32 PARTITION_TYPE_MARKER; // Limit to 100k as blocks larger than this might cause strain on Binder. // TODO(anmorales): Consider splitting up too-large blocks in PersistentDataBlockManager static const Int32 MAX_DATA_BLOCK_SIZE; AutoPtr<IContext> mContext; String mDataBlockFile; Object mLock; Int32 mAllowedAppId; /* * Separate lock for OEM unlock related operations as they can happen in parallel with regular * block operations. */ Object mOemLock; Int64 mBlockDeviceSize; AutoPtr<IBinder> mService; }; }// Server }// Droid }// Elastos #endif //__ELASTOS_DROID_SERVER_PERSISTENT_DATA_BLOCK_SERVICE_H__
6d063d438682a081638cd832cff462d4e5301f20
c1c4fd5ec7ff66bdac98297977674340e12ea79f
/linuxcpp_tsinghua/15.04/insock/client1.cpp
4e6db5d6e7671e0b6db644c8dbcd1b84cf8a8b1a
[]
no_license
multicgu/cpp
99822e78dd0fd0e0166b7aa704fb536b1854113e
1331fbc975f27814acdfab6a6bb0266fc0a9da7e
refs/heads/master
2021-01-10T06:54:34.863617
2016-04-11T07:01:06
2016-04-11T07:01:06
46,668,727
0
0
null
null
null
null
UTF-8
C++
false
false
1,127
cpp
#include <stdlib.h> #include <stdio.h> #include <netinet/in.h> #include <netdb.h> #include <sys/socket.h> #include <unistd.h> #include <string.h> // 请求Web服务器的主页 void GetHomepage( int socket_fd ) { char buffer[8192]; sprintf( buffer, "GET /\n" ); write( socket_fd, buffer, strlen( buffer ) ); while( true ) { ssize_t count = read( socket_fd, buffer, 8192 ); if( count == 0 ) return; fwrite( buffer, sizeof( char ), count, stdout ); } } int main( int argc, char * const argv[] ) { int socket_fd; struct sockaddr_in name; struct hostent * hostinfo; socket_fd = socket( PF_INET, SOCK_STREAM, 0 ); name.sin_family = AF_INET; hostinfo = gethostbyname( argv[1] ); if( hostinfo == NULL ) return 1; else name.sin_addr = *( (struct in_addr *)hostinfo->h_addr ); name.sin_port = htons( 80 ); printf("%d\n",socket_fd); printf("%d\n",hostinfo->h_addr); printf("%d\n",name.sin_addr.s_addr); if( connect( socket_fd, (struct sockaddr *)&name, sizeof(struct sockaddr_in) ) == -1 ) { perror( "Failure to connect the server." ); return 2; } GetHomepage( socket_fd ); return 0; }
08a14dd5d13fe6237e48040db2d697474a45fb3c
ac8107be8fe2652528a550eb49d6b6c5ce8580d0
/FM-QtTextStats_low_coupling/textstats.h
cdce81aa63d3bb1e6c4837318dba33befa1f3bea
[]
no_license
ahaggi/CPP-using-QT
cb2c1eecc765925914a0266d1436b33d32b12852
a4e96d8b0a2fa97fcbee44f7d936805eb08ca803
refs/heads/master
2022-09-24T15:20:34.163740
2020-06-06T03:48:03
2020-06-06T03:48:03
269,845,121
0
0
null
null
null
null
UTF-8
C++
false
false
1,612
h
#ifndef TEXTSTATS_H #define TEXTSTATS_H #include <string> #include <map> #include <algorithm> #include <QTableWidget> #include <QTextEdit> #include <QCheckBox> // Normal map only allows sorting by key, not by value. // This function flips, or swaps, the key and value in key/value pairs in a map, // and puts them in a multimap. Since several keys may have the same value in the // input map, we need to store the output in a multimap, because a normal map only // allows unique keys, but the multimap allows for duplicate keys. // Source: http://stackoverflow.com/a/23050953 template <typename A, typename B> std::multimap<B, A> flip_map(std::map<A,B> & src) { std::multimap<B,A> dst; for(auto it = src.begin(); it != src.end(); ++it) dst.insert(std::pair<B, A>(it -> second, it -> first)); return dst; } template std::multimap<int, std::string> flip_map(std::map<std::string, int> &); class textStats { private: std::map<std::string, int> stats; std::multimap<int, std::string> sorted_stats; bool mCaseSensitivity; public: textStats(bool case_enable = false) : mCaseSensitivity(case_enable) {} void inputText(std::string text); void resetStats(void); void setCaseSensitivity(bool case_enable) {mCaseSensitivity = case_enable;} std::string printStats(void); std::multimap<int, std::string>::const_reverse_iterator getStatsIterator(void) const { return sorted_stats.crbegin(); } std::multimap<int, std::string>::const_reverse_iterator getStatsEnd(void) const { return sorted_stats.crend(); } }; #endif // TEXTSTATS_H
2f646648e05eb961fb2139cb84996a57101d80d7
c60b226ef6af565a91d236be60f4f508fb07a2be
/timer_main/timer_main.ino
d62cc9e867eaaf6b0c4a61fffa0c8f8efb30f9a6
[]
no_license
mharasic/Ardutimer
0dba001e5575537a030015acdb9d1854550a9142
300398d4e5f8abf52930f9b5d9b99d28f37b7f07
refs/heads/master
2020-09-21T09:01:29.536947
2019-12-01T00:01:38
2019-12-01T00:01:38
224,748,928
0
0
null
null
null
null
UTF-8
C++
false
false
872
ino
#include <LEDMatrixDriver.hpp> // Define the ChipSelect pin for the led matrix (Dont use the SS or MISO pin of your Arduino!) const uint8_t LEDMATRIX_CS_PIN = 9; // Number of 8x8 segments you are connecting const int LEDMATRIX_SEGMENTS = 8; const int LEDMATRIX_WIDTH = LEDMATRIX_SEGMENTS * 8; // The LEDMatrixDriver class instance LEDMatrixDriver lmd(LEDMATRIX_SEGMENTS, LEDMATRIX_CS_PIN); void setup() { Serial.begin(9600); setUpPins(); // init the display lmd.setEnabled(true); lmd.setIntensity(0); // 0 = low, 10 = high } unsigned long timer = 0; void loop() { // Serial.println(String(isP1PlusDown())); //unsigned long time = millis(); //printTime(0,3,time, false); Serial.println(selectModeMenu()); //printSmallTime(0,0,time,true,false); //clearDisplay(); //printSmallFontAt(0,0,':',false); // printCountDown(); // delay(50); }
40255d240ef02dc488194b0a40ee64bfba455890
dcee7da72687faac26f64139486e93d416af369d
/Effects/Partiture/moCHeader.cpp
71c6b4cf6ed6fdb43aade7a3dbe6dccd8f5d2909
[]
no_license
moldeo/moldeoplugins
871d0c70047b4074c0aa08c0f5dbe156a38b2dba
609af7c5e4271723dfc3394343fabd0b431fb934
refs/heads/master
2022-02-14T17:39:50.461902
2022-02-07T11:30:28
2022-02-07T11:30:28
25,303,561
1
1
null
null
null
null
UTF-8
C++
false
false
1,485
cpp
#include "moCHeader.h" int moCHeader::claveSol[12] = { 0, //sol 0, //sol# 1, //la 1, //la# 2, //si 3, //do 3, //do# 4, //re 4, //re# 5, //mi 6,//fa 6 //fa# }; int moCHeader::claveSolSostenidos[12] = { 0, //sol 1, //sol# 0, //la 1, //la# 0, //si 0, //do 1, //do# 0, //re 1, //re# 0, //mi 0,//fa 1 //fa# }; /* 55: sol 57: la 59: si 60: do 62: re 64: mi 65: fa */ void moCHeader::HeaderToY( moCNote *p_CNote, float interline, float& y, bool &sostenido) { int inty; int restoctav; float basey; float divoctav; // 1 octava son float yoctava = 7.0; //radios de nota float dy = ( interline / 2.0 ) ; float yPent = 0; basey = 0; switch(p_CNote->m_header) { case 3: // entre 55 y 89, empezando por el sol inty = p_CNote->m_note - 55; restoctav = inty % 12; //resto divoctav = floor( inty / (float)12 ); //cuantas octavas??? //basey = yPent - 7.0 * dy; basey = (interline/2) - 10.0 * dy; basey+= (float)yoctava * (float)divoctav * dy; basey+= (float) moCHeader::claveSol[ restoctav ] * dy; if ( moCHeader::claveSolSostenidos[restoctav] ==1 ) sostenido = true; else sostenido = false; y = basey; break; default: break; } }
297a1d1983b4ff6a843c00d3ba57a481a48f8cf3
4eaa809ac3f505b83e33172b1d4a099e71c2926a
/openFoam/cases/heavingCylinder/1/meshPhi
1b18fa0075353968be3aecf352958a64b5e53c53
[ "MIT" ]
permissive
krajit/krajit.github.io
3c4326b8c8b674afd7bbf735caca95824ed194ed
5f81be0c4b940c3a6a2646c166f99d0c3b515432
refs/heads/master
2021-12-04T22:40:12.267880
2021-12-02T01:42:03
2021-12-02T01:42:03
98,024,086
1
8
null
null
null
null
UTF-8
C++
false
false
117,200
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | foam-extend: Open Source CFD | | \\ / O peration | Version: 3.2 | | \\ / A nd | Web: http://www.foam-extend.org | | \\/ M anipulation | For copyright notice see file Copyright | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class surfaceScalarField; location "1"; object meshPhi; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 3 -1 0 0 0 0]; internalField nonuniform List<scalar> 6272 ( 6.37362943781e-07 1.27513932034e-10 -1.29739772206e-10 1.25230902924e-06 3.78207026057e-10 -3.8481422083e-10 1.84024842641e-06 6.19511502914e-10 -6.30345153067e-10 2.40530194751e-06 8.51399070524e-10 -8.66345976378e-10 2.95133191261e-06 1.07521403603e-09 -1.09425560376e-09 3.48126683792e-06 1.29219009354e-09 -1.31540165135e-09 3.99726686822e-06 1.50341508243e-09 -1.53096876616e-09 4.50098328356e-06 1.70983660825e-09 -1.74201086698e-09 4.9937258748e-06 1.91226732567e-09 -1.94946322867e-09 5.47647078842e-06 2.11139572893e-09 -2.15416034544e-09 5.94991080043e-06 2.30778353845e-09 -2.35683980718e-09 6.4143996369e-06 2.50185865765e-09 -2.55814590747e-09 6.86993704405e-06 2.69387642616e-09 -2.75860929684e-09 7.3163656974e-06 2.88397767632e-09 -2.95873335621e-09 7.75320155493e-06 3.0720887067e-09 -3.15887158176e-09 8.17911133652e-06 3.25762721149e-09 -3.35897059931e-09 8.59233534397e-06 3.43950424714e-09 -3.55868369472e-09 8.99067293452e-06 3.61596252319e-09 -3.75726133471e-09 9.37137633348e-06 3.78417329974e-09 -3.95317820208e-09 9.73079017151e-06 3.93972297403e-09 -4.14362608088e-09 1.00639246226e-05 4.07575218033e-09 -4.32362186401e-09 1.0365068361e-05 4.18203998312e-09 -4.48483126559e-09 1.06276722915e-05 4.24334017662e-09 -4.61402033151e-09 4.24007225255e-09 -4.72580459137e-09 1.08360405416e-05 6.26197181097e-07 1.23842515983e-10 1.23073531873e-06 3.67356295921e-10 1.80905573326e-06 6.01804787372e-10 2.36504426722e-06 8.27088102354e-10 2.90237229598e-06 1.0444174301e-09 3.42383578631e-06 1.25489484242e-09 3.93150687431e-06 1.45947774938e-09 4.42697959148e-06 1.6589800639e-09 4.91150131184e-06 1.85406873567e-09 5.38598327635e-06 2.04526340337e-09 5.85105037927e-06 2.23293662759e-09 6.3070061519e-06 2.41730274553e-09 6.753791745e-06 2.59836491728e-09 7.19110166816e-06 2.77588258988e-09 7.6183863004e-06 2.94934607881e-09 8.03431885658e-06 3.11775901056e-09 8.43712002017e-06 3.27950721147e-09 8.8245741163e-06 3.43216483734e-09 9.19385931949e-06 3.57209209879e-09 9.54162380324e-06 3.69415329615e-09 9.86348392569e-06 3.79108557382e-09 1.01547273139e-05 3.85251182724e-09 1.04102423391e-05 3.86378571549e-09 3.80082128577e-09 1.05835532446e-05 6.10318304409e-07 1.19624658306e-10 1.2000411766e-06 3.54894104881e-10 1.76468751305e-06 5.81478809233e-10 2.30780442122e-06 7.99202434265e-10 2.83278311208e-06 1.0091288742e-09 3.34224861011e-06 1.21221784057e-09 3.83818284497e-06 1.40929039112e-09 4.32212653937e-06 1.60102802878e-09 4.79524891269e-06 1.78795277276e-09 5.25837178347e-06 1.97041128871e-09 5.7120430236e-06 2.14858964542e-09 6.15655697114e-06 2.32252152296e-09 6.5918106996e-06 2.49197949654e-09 7.0173134478e-06 2.65638659662e-09 7.43244612563e-06 2.81491467503e-09 7.83600456463e-06 2.96626216872e-09 8.22623840008e-06 3.10837472321e-09 8.60106273707e-06 3.23842733105e-09 8.95774491646e-06 3.35251272537e-09 9.29320017573e-06 3.44535405425e-09 9.60375241705e-06 3.50986134218e-09 9.88550221013e-06 3.53641488043e-09 1.01341410893e-05 3.51274948704e-09 3.41500975595e-09 1.02981453555e-05 5.92299266186e-07 1.14953525074e-10 1.16506275723e-06 3.4109440677e-10 1.71394988978e-06 5.58979835895e-10 2.24218710075e-06 7.68354660898e-10 2.75289706628e-06 9.70124837083e-10 3.24854275676e-06 1.1651012577e-09 3.73101144766e-06 1.3539667819e-09 4.2018022906e-06 1.53728688425e-09 4.66199859637e-06 1.7154537501e-09 5.1122773221e-06 1.88863135819e-09 5.5530700034e-06 2.05680963843e-09 5.98469757373e-06 2.2198776204e-09 6.40707609119e-06 2.37746634458e-09 6.81952407704e-06 2.52873337467e-09 7.22131163687e-06 2.67255254191e-09 7.61143124771e-06 2.80744154025e-09 7.98817184547e-06 2.93119474877e-09 8.34942810414e-06 3.04078905639e-09 8.69270419252e-06 3.13232185775e-09 9.01516251553e-06 3.20075844825e-09 9.31360890094e-06 3.23953155682e-09 9.5846681429e-06 3.24058655828e-09 9.82424837047e-06 3.19426840976e-09 3.07811621414e-09 9.97794396273e-06 5.7234588838e-07 1.09889781741e-10 1.12624976848e-06 3.26137968107e-10 1.65754080428e-06 5.34610798812e-10 2.16911614193e-06 7.34971382652e-10 2.66383347444e-06 9.27954001738e-10 3.14401223123e-06 1.11421870284e-09 3.61141863188e-06 1.29430079486e-09 4.06753367049e-06 1.46866089259e-09 4.51342153165e-06 1.63761717807e-09 4.94955877974e-06 1.80116950675e-09 5.37620236685e-06 1.95911832418e-09 5.79365684953e-06 2.11119274367e-09 6.20192365784e-06 2.25690011432e-09 6.60027740559e-06 2.39531504714e-09 6.98778772758e-06 2.5251227182e-09 7.3635209132e-06 2.64466833037e-09 7.72597126601e-06 2.75178343121e-09 8.07301956678e-06 2.8434928611e-09 8.40228031889e-06 2.91596377841e-09 8.71120828994e-06 2.96463564464e-09 8.99694832659e-06 2.98399938267e-09 9.25643619917e-06 2.96759732271e-09 9.48572915932e-06 2.90774889137e-09 2.78426706364e-09 9.62927176106e-06 5.50575379984e-07 1.04491718887e-10 1.08382928859e-06 3.10189320697e-10 1.59583452017e-06 5.08641881152e-10 2.08911317122e-06 6.99436002442e-10 2.56624640479e-06 8.83109369798e-10 3.02945128105e-06 1.06018439103e-09 3.48036478105e-06 1.23107721777e-09 3.92038660071e-06 1.39611367024e-09 4.35059129471e-06 1.55551023811e-09 4.77134452496e-06 1.70919651442e-09 5.18276073e-06 1.85687127609e-09 5.58502257381e-06 1.99810675685e-09 5.9780875058e-06 2.13225868027e-09 6.36136895921e-06 2.25838135385e-09 6.7338350198e-06 2.37511329251e-09 7.09443563584e-06 2.48071544846e-09 7.44185923008e-06 2.57304869501e-09 7.77420332668e-06 2.64932364474e-09 8.08911456394e-06 2.70612267991e-09 8.38420336388e-06 2.73951629343e-09 8.65691722833e-06 2.74496126493e-09 8.90437266293e-06 2.71721535342e-09 9.12295110566e-06 2.65047383206e-09 2.52713575924e-09 9.25706558781e-06 5.27212240435e-07 9.88626404515e-11 1.03819596562e-06 2.93537192257e-10 1.5292778503e-06 4.81455578296e-10 2.00267435269e-06 6.62163195669e-10 2.46073679744e-06 8.360696597e-10 2.90558915052e-06 1.00357315427e-09 3.33877689527e-06 1.1649875408e-09 3.76151670964e-06 1.32050614301e-09 4.1747606108e-06 1.47019915677e-09 4.57891397247e-06 1.61394935869e-09 4.97406163438e-06 1.75141789323e-09 5.36025799102e-06 1.88209155973e-09 5.7372772947e-06 2.0052159436e-09 6.10460992071e-06 2.11978460552e-09 6.46132773923e-06 2.22447690942e-09 6.80624049477e-06 2.31755817269e-09 7.13811439759e-06 2.39698776737e-09 7.45529774445e-06 2.46031449047e-09 7.75562185692e-06 2.50462176643e-09 8.03677629139e-06 2.52656460044e-09 8.29633588625e-06 2.5223850966e-09 8.53167909171e-06 2.48791856452e-09 8.73954862632e-06 2.41902973634e-09 2.30040925594e-09 8.86505939076e-06 5.02489356583e-07 9.30597734934e-11 9.89802025351e-07 2.76360736828e-10 1.45840854242e-06 4.53362182645e-10 1.91040310534e-06 6.23585919167e-10 2.34802486034e-06 7.8737790655e-10 2.7732514579e-06 9.45027039645e-10 3.18753235944e-06 1.09673564833e-09 3.59191592603e-06 1.24260072603e-09 3.98715700022e-06 1.38258834081e-09 4.37368297139e-06 1.51651246893e-09 4.75155941962e-06 1.64397534273e-09 5.12076476739e-06 1.76441178415e-09 5.48100044951e-06 1.8770587655e-09 5.83165710947e-06 1.98085762887e-09 6.17197967273e-06 2.07454964149e-09 6.50078644425e-06 2.1565624183e-09 6.8168112505e-06 2.22501781742e-09 7.11858274499e-06 2.27776918381e-09 7.404138556e-06 2.31230598924e-09 7.67127070487e-06 2.32582037704e-09 7.91769040995e-06 2.31529072286e-09 8.1410906554e-06 2.27756580215e-09 8.33843092482e-06 2.20980049022e-09 2.09848657069e-09 8.45610090922e-06 4.76451978516e-07 8.70997568982e-11 9.38789859545e-07 2.58721500493e-10 1.38362286325e-06 4.24541598147e-10 1.81294803316e-06 5.8405431396e-10 2.22892710154e-06 7.37520348485e-10 2.63337984627e-06 8.85136937042e-10 3.02762009458e-06 1.02700945936e-09 3.41259535664e-06 1.16316028492e-09 3.78888524364e-06 1.2934725682e-09 4.15686198296e-06 1.41769646581e-09 4.51659628918e-06 1.53542675023e-09 4.86793680894e-06 1.64603694023e-09 5.2106450714e-06 1.74877240471e-09 5.54406354784e-06 1.84265053994e-09 5.86744604892e-06 1.92646491111e-09 6.17977694051e-06 1.99881762859e-09 6.479760731e-06 2.05803207368e-09 6.7659980269e-06 2.10219637548e-09 7.03667583081e-06 2.1291899002e-09 7.28975307021e-06 2.13671590277e-09 7.52313101128e-06 2.12235103214e-09 7.73476454589e-06 2.08382156865e-09 7.9218132473e-06 2.01928709077e-09 1.91670941446e-09 8.03238379994e-06 4.4916936365e-07 8.10400211071e-11 8.85320823799e-07 2.40784393025e-10 1.30528030239e-06 3.95238805992e-10 1.71087628571e-06 5.4387682773e-10 2.10416810148e-06 6.86879009743e-10 2.48683620497e-06 8.24365911541e-10 2.86000729785e-06 9.56340445423e-10 3.2245616093e-06 1.08276037658e-09 3.58100170907e-06 1.20349069962e-09 3.92955205947e-06 1.31820964998e-09 4.27033559464e-06 1.42649460883e-09 4.60312465198e-06 1.52775280606e-09 4.92763403785e-06 1.62122814567e-09 5.24332316256e-06 1.70602955977e-09 5.54938439746e-06 1.78105266286e-09 5.84487791034e-06 1.84500593774e-09 6.12860229304e-06 1.89641231561e-09 6.39916427227e-06 1.9336335673e-09 6.65489444313e-06 1.95489681394e-09 6.8939797589e-06 1.95834918887e-09 7.11444296844e-06 1.94208063405e-09 7.31442996145e-06 1.90447087718e-09 7.49137132586e-06 1.84439365367e-09 1.75115306431e-09 7.59550879961e-06 4.20803407386e-07 7.49240135846e-11 8.29715068199e-07 2.22678756456e-10 1.22381150168e-06 3.65662730114e-10 1.60470021563e-06 5.03323818853e-10 1.97433379437e-06 6.35761642164e-10 2.3343144933e-06 7.63063490327e-10 2.68554385075e-06 8.85161877131e-10 3.02875747993e-06 1.00191561654e-09 3.36450938456e-06 1.11317790248e-09 3.69289619991e-06 1.21863369511e-09 4.0139735738e-06 1.31782941171e-09 4.32759229941e-06 1.4102179822e-09 4.6333857912e-06 1.49509225837e-09 4.93085367015e-06 1.57160128022e-09 5.219225158e-06 1.63874290801e-09 5.49757839428e-06 1.69536764544e-09 5.76479290338e-06 1.74019365263e-09 6.01952223718e-06 1.77182784179e-09 6.26026075646e-06 1.78879932336e-09 6.48536442294e-06 1.78963503527e-09 6.69303000512e-06 1.77286638948e-09 6.88150778158e-06 1.7373426131e-09 7.04846918878e-06 1.6823734573e-09 1.5985325579e-09 7.14664962022e-06 3.91491115687e-07 6.87852886655e-11 7.7222863793e-07 2.04497384386e-10 1.13960699102e-06 3.35965816593e-10 1.49496558492e-06 4.62634156519e-10 1.84006155118e-06 5.84490791846e-10 2.17647355594e-06 7.0157379131e-10 2.50499042207e-06 8.13815075529e-10 2.82612715694e-06 9.21026804564e-10 3.14040414086e-06 1.02300244951e-09 3.44794250906e-06 1.11944931588e-09 3.74869634478e-06 1.20993758495e-09 4.04254291894e-06 1.29392574418e-09 4.32911871863e-06 1.3707560955e-09 4.60790931791e-06 1.43964997359e-09 4.87820656843e-06 1.49970912659e-09 5.1391366324e-06 1.54992427841e-09 5.38961619526e-06 1.58919110018e-09 5.62836666594e-06 1.61633306838e-09 5.85402283236e-06 1.63013782472e-09 6.06508409952e-06 1.62942141004e-09 6.25999079033e-06 1.61311227867e-09 6.43708285367e-06 1.58041093509e-09 6.59419490258e-06 1.53087204038e-09 1.45622029678e-09 6.68673329309e-06 3.61434534624e-07 6.26796899503e-11 7.13216734166e-07 1.86393736267e-10 1.05308299159e-06 3.06339750475e-10 1.38219652664e-06 4.21999409063e-10 1.70204647177e-06 5.33303154683e-10 2.01408082598e-06 6.40210858438e-10 2.31909411418e-06 7.42643551061e-10 2.61750445991e-06 8.40427810999e-10 2.90966738487e-06 9.33328113331e-10 3.19570675825e-06 1.021034974e-09 3.47556443113e-06 1.10313996225e-09 3.74907348747e-06 1.17913744739e-09 4.01590570301e-06 1.24842262384e-09 4.27558225745e-06 1.31029346897e-09 4.5274438313e-06 1.36395438029e-09 4.770655162e-06 1.40852659214e-09 5.00416016531e-06 1.44306700024e-09 5.22676621963e-06 1.4665847525e-09 5.43720447241e-06 1.47808751224e-09 5.63412833501e-06 1.47660722263e-09 5.81621728307e-06 1.46139781677e-09 5.98193495621e-06 1.43194297869e-09 6.12924906462e-06 1.38790585353e-09 1.32205202583e-09 6.21633392414e-06 3.30832542187e-07 5.66279472864e-11 6.53070348514e-07 1.68439535397e-10 9.64703713341e-07 2.76915084211e-10 1.26685604711e-06 3.81577667874e-10 1.56084331638e-06 4.82359211538e-10 1.84786791906e-06 5.79179253452e-10 2.12869716603e-06 6.71921247405e-10 2.40373539525e-06 7.60408966976e-10 2.6732060868e-06 8.44404763139e-10 2.93716798113e-06 9.23603217824e-10 3.19555038195e-06 9.97619957659e-10 3.44818478928e-06 1.0659884888e-09 3.6947831411e-06 1.12816156121e-09 3.93489672785e-06 1.18351367544e-09 4.16790733685e-06 1.23134668935e-09 4.39303478171e-06 1.27090076183e-09 4.6092568474e-06 1.30137307542e-09 4.81546989614e-06 1.32193760337e-09 5.01053466416e-06 1.33178318536e-09 5.19320088486e-06 1.33013442347e-09 5.36230883859e-06 1.31644553869e-09 5.51649845172e-06 1.29039559613e-09 5.65390318016e-06 1.25175047451e-09 1.19421141884e-09 5.73561220525e-06 2.99760039386e-07 5.06249205526e-11 5.91973387564e-07 1.50627366554e-10 8.74855256993e-07 2.47729683952e-10 1.14947004205e-06 3.41490088381e-10 1.41701133862e-06 4.31827473866e-10 1.67848776182e-06 5.18641621641e-10 1.93457864327e-06 6.01799452072e-10 2.18564929662e-06 6.81121626049e-10 2.43184686254e-06 7.56377400477e-10 2.67316703662e-06 8.27276363289e-10 2.90952791844e-06 8.9346174516e-10 3.14077256775e-06 9.54510920503e-10 3.36663294431e-06 1.00993525658e-09 3.58668035051e-06 1.05918387668e-09 3.80035449265e-06 1.10164811333e-09 4.00692174908e-06 1.13667663207e-09 4.20546603538e-06 1.16358652615e-09 4.39496204865e-06 1.1816928009e-09 4.57438356772e-06 1.19033495701e-09 4.74258434324e-06 1.18890473605e-09 4.89845128554e-06 1.17698140332e-09 5.04082924419e-06 1.15435466102e-09 5.1681007132e-06 1.12089244865e-09 1.07116633671e-09 5.24443568968e-06 2.68326397467e-07 4.46913072416e-11 5.30136558089e-07 1.33012280396e-10 7.83909557729e-07 2.18851900617e-10 1.03057539556e-06 3.01809850299e-10 1.27118240531e-06 3.81793857826e-10 1.50660526994e-06 4.58694115472e-10 1.7374265734e-06 5.32372320742e-10 1.96395323497e-06 6.02653203861e-10 2.1862712361e-06 6.69318070992e-10 2.4043465568e-06 7.32096964836e-10 2.61810565088e-06 7.90666748524e-10 2.82740125359e-06 8.4465006615e-10 3.03197730819e-06 8.93617286535e-10 3.23141422541e-06 9.37088869724e-10 3.42522122991e-06 9.74540061804e-10 3.61273922322e-06 1.00541346402e-09 3.79316264205e-06 1.02913482576e-09 3.96556149553e-06 1.04513246575e-09 4.12895135325e-06 1.05287011325e-09 4.28230902183e-06 1.05186649147e-09 4.42459413802e-06 1.04180543145e-09 4.55483624328e-06 1.02254908856e-09 4.67169724612e-06 9.94021766053e-10 9.51602626454e-10 4.74254259877e-06 2.36684640785e-07 3.88359094028e-11 4.67842750423e-07 1.15620261942e-10 6.92210693274e-07 1.90320599279e-10 9.10586252685e-07 2.62582270462e-10 1.12386202476e-06 3.32308516432e-10 1.33276786019e-06 3.99387828086e-10 1.53778879235e-06 4.63684742898e-10 1.73915705363e-06 5.25034045052e-10 1.93692732164e-06 5.83233476872e-10 2.13109770566e-06 6.38039018091e-10 2.32160901223e-06 6.89163586038e-10 2.50834604656e-06 7.36277133346e-10 2.69104463666e-06 7.79008660799e-10 2.86933707977e-06 8.1694546873e-10 3.04276680725e-06 8.49641726933e-10 3.21078427303e-06 8.76625758979e-10 3.37266721378e-06 8.97415377529e-10 3.52752163198e-06 9.11534985668e-10 3.6744282204e-06 9.18543411651e-10 3.81244781028e-06 9.18060612677e-10 3.94074882721e-06 9.09855945905e-10 4.058506817e-06 8.9384191228e-10 4.16460664038e-06 8.69972625384e-10 8.34368629411e-10 4.22970695638e-06 2.04889680258e-07 3.3063001204e-11 4.05185246283e-07 9.84638206704e-11 5.99884421307e-07 1.62153743866e-10 7.89663635313e-07 2.23827421319e-10 9.75233445451e-07 2.83390271402e-10 1.1571807107e-06 3.40735371749e-10 1.33586889348e-06 3.95736902953e-10 1.51148141671e-06 4.48243786244e-10 1.68408513853e-06 4.98075288583e-10 1.85371658981e-06 5.45017091142e-10 2.02036814102e-06 5.88820414326e-10 2.1839366813e-06 6.29204164536e-10 2.34417936469e-06 6.65852744539e-10 2.50078583839e-06 6.98419585053e-10 2.65334972715e-06 7.26530985693e-10 2.80140912981e-06 7.49794772536e-10 2.94428406616e-06 7.67809861692e-10 3.08108660681e-06 7.80179076023e-10 3.21094926929e-06 7.86533452808e-10 3.33307097159e-06 7.86572180296e-10 3.44691287983e-06 7.80140276531e-10 3.55180112689e-06 7.67190458894e-10 3.64673758337e-06 7.47689968817e-10 7.18430539446e-10 3.70572281891e-06 1.72912230487e-07 2.73728886494e-11 3.42129346135e-07 8.1543311222e-11 5.06912999451e-07 1.34350614685e-10 6.67779701038e-07 1.85541312069e-10 8.25277086294e-07 2.35028307208e-10 9.79839258209e-07 2.82715170336e-10 1.13174080559e-06 3.28489659382e-10 1.28112405797e-06 3.72220203123e-10 1.42808743543e-06 4.13751045358e-10 1.57270033567e-06 4.52900401004e-10 1.71497936824e-06 4.89460906522e-10 1.85482331031e-06 5.23198341336e-10 1.99205061922e-06 5.5385228848e-10 2.12638917533e-06 5.81138654326e-10 2.2575254647e-06 6.04752984421e-10 2.38506131476e-06 6.24377208092e-10 2.50832325985e-06 6.39684170393e-10 2.62647493739e-06 6.5034430207e-10 2.73861101616e-06 6.56038742339e-10 2.84415750855e-06 6.56524120999e-10 2.94295334971e-06 6.51721551955e-10 3.03451763159e-06 6.4162691685e-10 3.11785125686e-06 6.26199324159e-10 6.02844767398e-10 3.17029013468e-06 1.40801950147e-07 2.17620982357e-11 2.78818831031e-07 6.48485225403e-11 4.13484669231e-07 1.06894338014e-10 5.45167017573e-07 1.47698578257e-10 6.74268210539e-07 1.87186522738e-10 8.010940525e-07 2.25276029874e-10 9.25854423718e-07 2.61873120443e-10 1.04867174644e-06 2.96868502457e-10 1.16965048174e-06 3.30135024425e-10 1.2888612076e-06 3.61526163167e-10 1.40630478161e-06 3.90875254892e-10 1.5219026905e-06 4.17995298258e-10 1.63551841475e-06 4.42679643696e-10 1.7469422753e-06 4.64703975135e-10 1.85595731912e-06 4.83829944611e-10 1.96221735426e-06 4.99809444025e-10 2.06512355756e-06 5.12387855225e-10 2.16393509775e-06 5.21301355201e-10 2.25762598644e-06 5.26265113446e-10 2.34578119961e-06 5.270684194e-10 2.42884411445e-06 5.23712832056e-10 2.50648809881e-06 5.16244570659e-10 2.57757407101e-06 5.04592339114e-10 4.86726278661e-10 2.62295059661e-06 1.08799199117e-07 1.62247129973e-11 2.15663925682e-07 4.83624631051e-11 3.20139054347e-07 7.97567975325e-11 4.22481555418e-07 1.10259094955e-10 5.22960591911e-07 1.39810460704e-10 6.21797067043e-07 1.68346546111e-10 7.19140334242e-07 1.95794431083e-10 8.1510345379e-07 2.22070279262e-10 9.09764231675e-07 2.47077520209e-10 1.00316267293e-06 2.7070554842e-10 1.09529199162e-06 2.92829071289e-10 1.18609254373e-06 3.13307959302e-10 1.27545945909e-06 3.3198786065e-10 1.36325196505e-06 3.48701863882e-10 1.44932643775e-06 3.63273419527e-10 1.53340097283e-06 3.75520043996e-10 1.61503033664e-06 3.85256117811e-10 1.69366171544e-06 3.9228719533e-10 1.76823998549e-06 3.96384307936e-10 1.83838137927e-06 3.97378690651e-10 1.90497713123e-06 3.95303375168e-10 1.96778995915e-06 3.90204532711e-10 2.02558123457e-06 3.81993071335e-10 3.69187168869e-10 2.06302440251e-06 7.71528447231e-08 1.07536606496e-11 1.53076399869e-07 3.20640421791e-11 2.27443522468e-07 5.29029359733e-11 3.00415563858e-07 7.31730123311e-11 3.72162865189e-07 9.28337126694e-11 4.4283152802e-07 1.11840956307e-10 5.12531007155e-07 1.30145139585e-10 5.813408269e-07 1.47689687578e-10 6.4930760849e-07 1.64409774282e-10 7.16451880306e-07 1.80231465768e-10 7.82759979151e-07 1.95071144675e-10 8.48187794608e-07 2.08835338664e-10 9.12656888035e-07 2.21421029258e-10 9.76078632045e-07 2.3271659137e-10 1.03834748816e-06 2.426034964e-10 1.09925537322e-06 2.50958835118e-10 1.15850825101e-06 2.57658234197e-10 1.21581657607e-06 2.62577191878e-10 1.27060425273e-06 2.65600317777e-10 1.32249378809e-06 2.66648192565e-10 1.37184198813e-06 2.656781719e-10 1.41842944314e-06 2.62640913669e-10 1.46147018191e-06 2.57491592654e-10 2.49306639917e-10 1.48969119512e-06 4.59536263747e-08 5.34095626025e-12 9.12419681146e-08 1.59293111864e-11 1.3567151781e-07 2.6292853608e-11 1.79329028267e-07 3.63838402929e-11 2.22308313608e-07 4.61816746357e-11 2.6469191413e-07 5.56640852427e-11 3.06545599411e-07 6.4806137254e-11 3.47914960976e-07 7.3579516408e-11 3.88824356978e-07 8.19518927925e-11 4.29282443596e-07 8.98864595056e-11 4.69276561523e-07 9.7341587183e-11 5.08777863589e-07 1.04270642089e-10 5.47734944019e-07 1.10621962702e-10 5.8609104398e-07 1.16339084836e-10 6.23771969332e-07 1.21361076784e-10 6.60628417846e-07 1.25623392482e-10 6.96479778537e-07 1.29060420622e-10 7.31282872776e-07 1.31617380415e-10 7.65241753999e-07 1.33289934952e-10 7.9806310242e-07 1.34074204962e-10 8.28962521956e-07 1.33854906268e-10 8.57739430667e-07 1.32520753076e-10 8.8443855378e-07 1.30091684221e-10 1.26161994089e-10 9.02109705291e-07 1.52334864969e-08 3.025939545e-08 4.50140512177e-08 5.95244875877e-08 7.38207235515e-08 8.79293137808e-08 1.01871652268e-07 1.15662590617e-07 1.29309933853e-07 1.42815749029e-07 1.56175221889e-07 1.69377800217e-07 1.82405160172e-07 1.95235141341e-07 2.07840083945e-07 2.2015762247e-07 2.3212292571e-07 2.43767857302e-07 2.55372183858e-07 2.66824190407e-07 2.77464015895e-07 2.87209675897e-07 2.96282122858e-07 3.02323713373e-07 6.17087185056e-07 -1.20920227058e-09 -1.18981626642e-10 1.21808919397e-06 -3.58514174377e-09 -3.53000481059e-10 1.7991268542e-06 -5.869107406e-09 -5.78540219656e-10 2.36339338385e-06 -8.06112362228e-09 -7.95693597381e-10 2.91405835667e-06 -1.0175169862e-08 -1.00578206754e-09 3.45362353952e-06 -1.22233772246e-08 -1.21003893576e-09 3.98421261983e-06 -1.42152917266e-08 -1.4095797987e-09 4.50732266416e-06 -1.61581724008e-08 -1.60544130714e-09 5.02420576044e-06 -1.80573767627e-08 -1.79858351578e-09 5.53581725927e-06 -1.99170983373e-08 -1.98992670631e-09 6.04292287013e-06 -2.17404852243e-08 -2.1803558915e-09 6.54601862739e-06 -2.35296955113e-08 -2.37075843548e-09 7.04534318504e-06 -2.52857765273e-08 -2.5620274161e-09 7.54087971635e-06 -2.70087043683e-08 -2.75509031573e-09 8.03216052822e-06 -2.8696974332e-08 -2.95087082539e-09 8.51842546974e-06 -3.03473016471e-08 -3.15039066112e-09 8.99909379748e-06 -3.19560261204e-08 -3.35495252781e-09 9.47313098446e-06 -3.35190389232e-08 -3.56608637198e-09 9.93861959444e-06 -3.50294614771e-08 -3.78535349306e-09 1.03927889634e-05 -3.64765373306e-08 -4.01457854986e-09 1.08321940609e-05 -3.78463890283e-08 -4.25595510995e-09 1.12520156646e-05 -3.91211848565e-08 -4.51211971295e-09 1.16448833105e-05 -4.02755646477e-08 -4.78601335507e-09 -4.12542820486e-08 -5.07660562306e-09 1.19856191433e-05 6.20034268199e-07 -2.01038556893e-09 1.22148515571e-06 -5.96064585118e-09 1.80033464456e-06 -9.75644778822e-09 2.36015853497e-06 -1.33969440634e-08 2.90442244858e-06 -1.69066795857e-08 3.43579440636e-06 -2.03067107867e-08 3.95641282329e-06 -2.36131094261e-08 4.46783076703e-06 -2.68379632571e-08 4.97131313939e-06 -2.99904587672e-08 5.46785185575e-06 -3.30778058487e-08 5.95821103539e-06 -3.61054670932e-08 6.44291071663e-06 -3.90772403421e-08 6.92220056733e-06 -4.19951712903e-08 7.39610724415e-06 -4.48596009098e-08 7.86413311917e-06 -4.76684206774e-08 8.32541849079e-06 -5.04165056693e-08 8.7793675828e-06 -5.30978962017e-08 9.22494397438e-06 -5.5705836774e-08 9.66006971537e-06 -5.82288585362e-08 1.00818491888e-05 -6.06494941472e-08 1.04865930305e-05 -6.29448644184e-08 1.08693770262e-05 -6.50857632825e-08 1.12230294688e-05 -6.70338990505e-08 -6.87246880058e-08 1.15264813549e-05 6.24464152493e-07 -1.74493751613e-09 1.22594174725e-06 -5.17355699607e-09 1.80023044483e-06 -8.46713749583e-09 2.35132167763e-06 -1.1624305418e-08 2.88297694375e-06 -1.46667238638e-08 3.39810111982e-06 -1.76129242048e-08 3.89891911791e-06 -2.04769404687e-08 4.38711086746e-06 -2.32692307071e-08 4.86402746961e-06 -2.59977858278e-08 5.33072347975e-06 -2.86687506341e-08 5.78800476807e-06 -3.12866660465e-08 6.23640408481e-06 -3.38544881758e-08 6.67618520625e-06 -3.63735142742e-08 7.10736762335e-06 -3.88434497323e-08 7.52952584511e-06 -4.12621276293e-08 7.94181622002e-06 -4.36249401629e-08 8.34338548697e-06 -4.59252130722e-08 8.73292817671e-06 -4.81542094632e-08 9.10833902017e-06 -5.03002153413e-08 9.46668194483e-06 -5.2347463203e-08 9.80386377928e-06 -5.42741996074e-08 1.01147336371e-05 -5.60529030567e-08 1.0392559747e-05 -5.76517696294e-08 -5.9051918867e-08 1.06244423951e-05 6.275226464e-07 1.22559171869e-06 1.79018395565e-06 2.32574297154e-06 2.83637134366e-06 3.32522625152e-06 3.79469186407e-06 4.24660018241e-06 4.68242621617e-06 5.10331026461e-06 5.51012469226e-06 5.90342811531e-06 6.28348725867e-06 6.65037695081e-06 7.00382742864e-06 7.34299600535e-06 7.66679024147e-06 7.9737314479e-06 8.26186807059e-06 8.52841417179e-06 8.76938973922e-06 8.9800378658e-06 9.15464709093e-06 9.29500076575e-06 6.255874708e-07 1.99061474464e-09 -1.29758175402e-10 1.22320769154e-06 5.90618996596e-09 -3.84843939965e-10 1.7885014341e-06 9.67561949582e-09 -6.30355725129e-10 2.32510728465e-06 1.32947232741e-08 -8.6633829295e-10 2.83645878491e-06 1.67839746575e-08 -1.0942484061e-09 3.32568696858e-06 2.01623336972e-08 -1.31540683451e-09 3.79529977272e-06 2.34463596402e-08 -1.53098863027e-09 4.24736163913e-06 2.66496313333e-08 -1.74203747066e-09 4.68352700507e-06 2.97832228396e-08 -1.94948265055e-09 5.10492461811e-06 3.28554993355e-08 -2.15416395079e-09 5.51240673785e-06 3.58726364686e-08 -2.35682105189e-09 5.90647539129e-06 3.88390251807e-08 -2.55810032235e-09 6.28724920582e-06 4.17569212547e-08 -2.75854374451e-09 6.65471923425e-06 4.46266666285e-08 -2.95864781657e-09 7.00877519529e-06 4.74474049199e-08 -3.15875169092e-09 7.3485510398e-06 5.02158554272e-08 -3.35880820757e-09 7.67289338385e-06 5.29259114356e-08 -3.55848026813e-09 7.9802202675e-06 5.55689241882e-08 -3.75701877584e-09 8.26841166691e-06 5.81322215455e-08 -3.95292345719e-09 8.53480609769e-06 6.05985233646e-08 -4.14334541019e-09 8.77557994653e-06 6.29430873472e-08 -4.32330140376e-09 8.98580251083e-06 6.51307541072e-08 -4.48451557964e-09 9.15969479045e-06 6.71148682618e-08 -4.61362367882e-09 6.88177057929e-08 -4.72522333317e-09 9.29928173431e-06 6.2241636943e-07 2.24735566423e-09 1.22318115034e-06 6.66769147131e-09 1.79783559204e-06 1.09238975221e-08 2.34976823224e-06 1.50127279379e-08 2.88205654087e-06 1.89572770826e-08 3.39752138481e-06 2.27783732485e-08 3.89848555285e-06 2.64942695979e-08 4.38684122762e-06 3.01201322151e-08 4.86403922986e-06 3.36679117561e-08 5.33115510684e-06 3.71469693777e-08 5.78899997186e-06 4.05647007496e-08 6.23807901752e-06 4.39265657553e-08 6.67855291784e-06 4.72359555207e-08 7.11033502861e-06 5.0494349999e-08 7.53309839603e-06 5.37010158852e-08 7.9459705667e-06 5.68523721318e-08 8.34804180467e-06 5.99442101404e-08 8.73792795175e-06 6.29715306781e-08 9.11340468274e-06 6.59241233145e-08 9.47163253013e-06 6.8785911372e-08 9.80862233724e-06 7.15352785941e-08 1.01191940883e-05 7.41433762646e-08 1.03965392107e-05 7.65698114286e-08 7.87129431988e-08 1.06278309314e-05 6.18150518128e-07 1.44515824634e-09 1.2189215301e-06 4.28750100702e-09 1.79800331964e-06 7.02478746997e-09 2.35848880225e-06 9.6554271588e-09 2.9033035718e-06 1.21942891406e-08 3.43500532185e-06 1.46549506117e-08 3.95579780005e-06 1.70490947069e-08 4.46736996717e-06 1.93863067852e-08 4.97104283931e-06 2.16741679792e-08 5.46785270927e-06 2.39189163825e-08 5.95857639784e-06 2.61255708827e-08 6.44372277106e-06 2.82980516448e-08 6.92348453879e-06 3.04390837176e-08 7.39782802324e-06 3.25503385794e-08 7.86627630872e-06 3.46319712579e-08 8.32796519343e-06 3.66825085746e-08 8.78224274775e-06 3.87007379709e-08 9.22804416171e-06 4.06854401529e-08 9.663233755e-06 4.26323292794e-08 1.00849603977e-05 4.45336734152e-08 1.04895642145e-05 4.63792823199e-08 1.08721486687e-05 4.81552829164e-08 1.12255380407e-05 4.98403829267e-08 5.13676338445e-08 1.15286331772e-05 6.1625477139e-07 1.21699430325e-06 1.79814408843e-06 2.36268428005e-06 2.91358512538e-06 3.45330273876e-06 3.98397877604e-06 4.50714931943e-06 5.02409779953e-06 5.53579881026e-06 6.04302538354e-06 6.54626959941e-06 7.04575331103e-06 7.54144153382e-06 8.03286719394e-06 8.51927329283e-06 9.00005250564e-06 9.47417369768e-06 9.9396911326e-06 1.03938554727e-05 1.08332235784e-05 1.12529625022e-05 1.16457266853e-05 1.19863525588e-05 1.53511530763e-08 5.34314000471e-12 3.04631868078e-08 1.59360392975e-11 4.52662453986e-08 2.63044650893e-11 5.97736345507e-08 3.64007648893e-11 7.40220372762e-08 4.6204284274e-11 8.80577682381e-08 5.56925136425e-11 1.0189671758e-07 6.48404295967e-11 1.15567482633e-07 7.36195908645e-11 1.29067938659e-07 8.19976835982e-11 1.42412986077e-07 8.99376962567e-11 1.55585860506e-07 9.73980185108e-11 1.68584744397e-07 1.0433176778e-10 1.81392536974e-07 1.10687184508e-10 1.93999844935e-07 1.16407647153e-10 2.06382314322e-07 1.21432134455e-10 2.18499635755e-07 1.25695831335e-10 2.30283228219e-07 1.29132372827e-10 2.41753831432e-07 1.3168566318e-10 2.532361405e-07 1.3335137509e-10 2.64655245993e-07 1.34128103728e-10 2.75322455918e-07 1.33902583997e-10 2.85104798242e-07 1.32561058233e-10 2.94330178724e-07 1.30119651813e-10 1.26172093035e-10 3.00699971664e-07 4.63372571701e-08 1.07576533128e-11 9.19081481144e-08 3.2076442877e-11 1.36482531169e-07 5.29248092479e-11 1.80112022538e-07 7.32056338882e-11 2.22934916767e-07 9.28779502368e-11 2.65076962336e-07 1.11897181583e-10 3.06617077423e-07 1.30213419278e-10 3.47605726451e-07 1.47770061561e-10 3.88078424197e-07 1.64501939472e-10 4.28037576674e-07 1.80335291506e-10 4.67472020568e-07 1.95185970223e-10 5.06355817024e-07 2.0896020289e-10 5.44658205453e-07 2.21554479085e-10 5.82348184349e-07 2.32856791654e-10 6.19378683969e-07 2.4274851953e-10 6.55653204016e-07 2.51106344244e-10 6.91011025841e-07 2.57804947651e-10 7.2542206262e-07 2.62718630119e-10 7.59119835768e-07 2.65730943695e-10 7.91893588601e-07 2.66763604594e-10 8.22853017444e-07 2.65776711848e-10 8.51781223242e-07 2.62718728943e-10 8.78934421807e-07 2.57542398653e-10 2.49320373603e-10 8.97496082181e-07 7.77957732743e-08 1.62301527747e-11 1.54200583703e-07 4.8379637573e-11 2.2878620414e-07 7.97877913378e-11 3.01667144853e-07 1.10306314266e-10 3.73119248572e-07 1.39875345455e-10 4.43352972045e-07 1.68429684555e-10 5.12523244996e-07 1.95895897124e-10 5.80698812702e-07 2.22190003918e-10 6.47942818199e-07 2.47215593161e-10 7.14257756051e-07 2.70861754162e-10 7.79641305136e-07 2.93002683851e-10 8.4404605449e-07 3.1349748047e-10 9.07453708525e-07 3.32190409429e-10 9.69793027126e-07 3.48914792772e-10 1.03102076221e-06 3.63493232521e-10 1.09100827639e-06 3.75742459098e-10 1.14956531521e-06 3.8547622442e-10 1.20645019601e-06 3.92500471796e-10 1.26104812341e-06 3.9658504717e-10 1.3129608838e-06 3.97558487152e-10 1.3624550311e-06 3.95451978963e-10 1.40938965254e-06 3.90314901107e-10 1.45316248085e-06 3.82059457142e-10 3.69198246728e-10 1.48265600374e-06 1.09538607581e-07 2.17692124455e-11 2.16975830604e-07 6.48709119972e-11 3.21663734808e-07 1.06935018821e-10 4.23828003262e-07 1.47760841991e-10 5.23860393453e-07 1.87272400045e-10 6.22090322057e-07 2.25386077176e-10 7.18703768565e-07 2.62007527506e-10 8.13825307016e-07 2.97027187192e-10 9.07516405434e-07 3.30318232225e-10 9.99815828667e-07 3.61733833512e-10 1.09069968191e-06 3.91106689602e-10 1.18014952981e-06 4.18247724716e-10 1.26809672121e-06 4.42950289554e-10 1.35446665941e-06 4.6498870873e-10 1.43918678743e-06 4.84123314339e-10 1.52207762782e-06 5.00105417462e-10 1.60287528028e-06 5.12679373031e-10 1.68109776751e-06 5.21581484511e-10 1.75564048947e-06 5.26527006539e-10 1.82595955031e-06 5.27300724293e-10 1.892938303e-06 5.23901689935e-10 1.95639110658e-06 5.16379544413e-10 2.01520412088e-06 5.04666504633e-10 4.86729968464e-10 2.05414723603e-06 1.41370852824e-07 2.73824268165e-11 2.79873223345e-07 8.15726502558e-11 4.14662025647e-07 1.34403002877e-10 5.4608501191e-07 1.85620332889e-10 6.74633016844e-07 2.35136288953e-10 8.00713482391e-07 2.82853265215e-10 9.24566219902e-07 3.28658255126e-10 1.04636071415e-06 3.72418886003e-10 1.16618572264e-06 4.1397958108e-10 1.28408683705e-06 4.53159121216e-10 1.40004893923e-06 4.89748557036e-10 1.51403713394e-06 5.23512595393e-10 1.62596377594e-06 5.54188920831e-10 1.73575750142e-06 5.81491484131e-10 1.84323182279e-06 6.05116854764e-10 1.94814330451e-06 6.24743645121e-10 2.05011123178e-06 6.40042804533e-10 2.14847993517e-06 6.50685450574e-10 2.24219838803e-06 6.56350894078e-10 2.3307304631e-06 6.56794698286e-10 2.41451578868e-06 6.51937660748e-10 2.49320297387e-06 6.41777223323e-10 2.56565620016e-06 6.26275519068e-10 6.02835510267e-10 2.6127211223e-06 1.73157879508e-07 3.30753090721e-11 3.42654172008e-07 9.85010623781e-11 5.07469544986e-07 1.62218415376e-10 6.68044506733e-07 2.23923147764e-10 8.24958732721e-07 2.83519898908e-10 9.78671111463e-07 3.40901146896e-10 1.12950365389e-06 3.95939699802e-10 1.27765773664e-06 4.48483444699e-10 1.4232588525e-06 4.98350787893e-10 1.56635107401e-06 5.4532754438e-10 1.70691840823e-06 5.89165270008e-10 1.84491937145e-06 6.29579605274e-10 1.98029495149e-06 6.66253006262e-10 2.11287586661e-06 6.98839034393e-10 2.24241443346e-06 7.2696124909e-10 2.36856936056e-06 7.50225802834e-10 2.4908136461e-06 7.6823081039e-10 2.60843707063e-06 7.80575978253e-10 2.72057206002e-06 7.868907001e-10 2.82664942687e-06 7.86875873979e-10 2.92649119722e-06 7.80377334151e-10 3.01953315633e-06 7.67349655925e-10 3.10463037729e-06 7.47762498703e-10 7.18403727568e-10 3.15897684243e-06 2.04883775655e-07 3.88504533371e-11 4.05280543772e-07 1.1566401611e-10 5.99983074578e-07 1.90395410272e-10 7.89528091078e-07 2.62691426145e-10 9.74568122773e-07 3.32455673416e-10 1.15563722536e-06 3.99576654699e-10 1.33311562838e-06 4.63918054669e-10 1.50725564643e-06 5.25311984051e-10 1.67820825297e-06 5.83554352755e-10 1.8460127795e-06 6.38401298504e-10 2.01066113943e-06 6.89564873738e-10 2.17213083344e-06 7.36713731737e-10 2.33033632298e-06 7.79473790128e-10 2.48508003282e-06 8.17429623925e-10 2.63604319982e-06 8.5013532717e-10 2.78274588249e-06 8.77119036365e-10 2.92455607354e-06 8.97894951875e-10 3.0607606593e-06 9.11984445561e-10 3.19054791846e-06 9.1894662449e-10 3.31327478468e-06 9.18398545732e-10 3.42838522924e-06 9.10114370356e-10 3.53509448495e-06 8.94008610709e-10 3.63219511464e-06 8.70037826569e-10 8.34320842991e-10 3.69330101139e-06 2.36554600726e-07 4.47074939561e-11 4.67741136445e-07 1.3306060382e-10 6.92149974105e-07 2.18933606794e-10 9.10422548984e-07 3.01927949823e-10 1.12329844718e-06 3.81952884214e-10 1.33138729014e-06 4.588994014e-10 1.5351339759e-06 5.32628139866e-10 1.73484171955e-06 6.02961324679e-10 1.93067671077e-06 6.69677036517e-10 2.12268738832e-06 7.32504321787e-10 2.31087616134e-06 7.91119716311e-10 2.49521553184e-06 8.45143887592e-10 2.67562497632e-06 8.94143128713e-10 2.85189136394e-06 9.37636451212e-10 3.0236038155e-06 9.75097992203e-10 3.19020941655e-06 1.00596783197e-09 3.35099685819e-06 1.0296711459e-09 3.50517366972e-06 1.04563561419e-09 3.651942701e-06 1.05331958816e-09 3.79055053336e-06 1.05224220506e-09 3.92022224696e-06 1.04208852918e-09 4.04005348742e-06 1.0227225536e-09 4.14863076626e-06 9.94079500596e-10 9.5153427682e-10 4.21606319893e-06 2.681209671e-07 5.06422274669e-11 5.29932808646e-07 1.50678795424e-10 7.83814161388e-07 2.47815738198e-10 1.03051851713e-06 3.41613585508e-10 1.27088268234e-06 4.3199355126e-10 1.50561253405e-06 5.18856601448e-10 1.73522174254e-06 6.0206892169e-10 1.96005384531e-06 6.81448828894e-10 2.18030151408e-06 7.56761761432e-10 2.39602903657e-06 8.27715690191e-10 2.60723323402e-06 8.93953387138e-10 2.81389040914e-06 9.55049873055e-10 3.01590371584e-06 1.01051395123e-09 3.21302107378e-06 1.05978975525e-09 3.40484276803e-06 1.10226597063e-09 3.59074119509e-06 1.13729123581e-09 3.76994824213e-06 1.16418012205e-09 3.94157445114e-06 1.18224666988e-09 4.10477931524e-06 1.19083054866e-09 4.25866146362e-06 1.18931892017e-09 4.40232219901e-06 1.17729060707e-09 4.53478339984e-06 1.15453910091e-09 4.65434977377e-06 1.12094352774e-09 1.0710797001e-09 4.72773722939e-06 2.99480896826e-07 5.66460109417e-11 5.91662964665e-07 1.68492824126e-10 8.74709412777e-07 2.77003229974e-10 1.14948309151e-06 3.81703132292e-10 1.41693059739e-06 4.82527605636e-10 1.67787303979e-06 5.79397542601e-10 1.93289776819e-06 6.72195947539e-10 2.1823911399e-06 7.60743760184e-10 2.42658076611e-06 8.44800708532e-10 2.66555059889e-06 9.24059342428e-10 2.89929866429e-06 9.98134323254e-10 3.12777341291e-06 1.06655747865e-09 3.35084128311e-06 1.12877725266e-09 3.56825874993e-06 1.18416359211e-09 3.77960141808e-06 1.2320156653e-09 3.98423949954e-06 1.27156756525e-09 4.18135084129e-06 1.30201682613e-09 4.36999386884e-06 1.32253672319e-09 4.54917063574e-06 1.3323193079e-09 4.71783295984e-06 1.33058407658e-09 4.87501892247e-06 1.31678080191e-09 5.019630941e-06 1.29059329511e-09 5.14973939813e-06 1.25180173769e-09 1.19411332523e-09 5.22873244079e-06 3.30492584286e-07 6.26979709314e-11 6.5267310786e-07 1.86447337908e-10 9.64511002069e-07 3.06427540008e-10 1.26693327648e-06 4.22123051927e-10 1.56098109912e-06 5.33468334077e-10 1.84764344801e-06 6.40425556725e-10 2.12759002287e-06 7.42914748635e-10 2.40123660227e-06 8.40760175202e-10 2.66886720159e-06 9.33723396125e-10 2.93059824326e-06 1.02149372409e-09 3.18642199991e-06 1.10366172389e-09 3.43625858514e-06 1.17971904211e-09 3.67994501353e-06 1.24905772658e-09 3.91720455683e-06 1.31097009669e-09 4.1476001266e-06 1.36465429024e-09 4.37052154681e-06 1.40922952079e-09 4.58512768373e-06 1.44374577175e-09 4.79038775257e-06 1.4672184807e-09 4.98516213531e-06 1.47865393203e-09 5.16819671269e-06 1.47708580675e-09 5.33850212322e-06 1.46175701363e-09 5.49486861609e-06 1.43215344427e-09 5.63500980403e-06 1.38796770567e-09 1.32195234618e-09 5.71931421156e-06 3.61071508399e-07 6.88032248216e-11 7.12796308939e-07 2.04549592675e-10 1.05291517803e-06 3.36050368186e-10 1.3824114852e-06 4.62752082592e-10 1.70248735677e-06 5.84647647645e-10 2.01434419783e-06 7.01777977665e-10 2.3186731618e-06 8.14074489218e-10 2.61589596463e-06 9.21346651909e-10 2.90641250138e-06 1.02338580604e-09 3.19038847983e-06 1.11989761201e-09 3.4678046708e-06 1.21045142743e-09 3.738566604e-06 1.2945037551e-09 4.00246916561e-06 1.37139175408e-09 4.25919949563e-06 1.44033116617e-09 4.50830839558e-06 1.5004194123e-09 4.74916892553e-06 1.55063998349e-09 4.98094666989e-06 1.58988605803e-09 5.20252191047e-06 1.61698207573e-09 5.41257440202e-06 1.63072335587e-09 5.60973698684e-06 1.62991677987e-09 5.79285436218e-06 1.61348704551e-09 5.96049746759e-06 1.58063981362e-09 6.11023216529e-06 1.53094712335e-09 1.45613101005e-09 6.19964650867e-06 3.91155136408e-07 7.49409253208e-11 7.7187004573e-07 2.22727760853e-10 1.13957102501e-06 3.6574133788e-10 1.49542990788e-06 5.03432409486e-10 1.84091241492e-06 6.35905539023e-10 2.17734043004e-06 7.63251358011e-10 2.50537971703e-06 8.85401946797e-10 2.82554388013e-06 1.00221413236e-09 3.13838720601e-06 1.11353827106e-09 3.44405919187e-06 1.21905851822e-09 3.74254302796e-06 1.31832024373e-09 4.03377134642e-06 1.41077383498e-09 4.31749451995e-06 1.49570863524e-09 4.5933659495e-06 1.57226704541e-09 4.86089460743e-06 1.63943988044e-09 5.11945809521e-06 1.69607300864e-09 5.36816946917e-06 1.74088162103e-09 5.60582706898e-06 1.77247435767e-09 5.83096724673e-06 1.78938447445e-09 6.04209587913e-06 1.79013414842e-09 6.23774757332e-06 1.77325113555e-09 6.41631209629e-06 1.73758689614e-09 6.5753655666e-06 1.68246761197e-09 1.59845870104e-09 6.66980744882e-06 4.20543510577e-07 8.10554076686e-11 8.29507129266e-07 2.40828647872e-10 1.22401729714e-06 3.95309012489e-10 1.60552467202e-06 5.43972887944e-10 1.97569461116e-06 6.87005919969e-10 2.33587306708e-06 8.24532382294e-10 2.686834378e-06 9.56555152454e-10 3.02930197919e-06 1.08302943532e-09 3.36385439771e-06 1.203818348e-09 3.69060699015e-06 1.3185990918e-09 4.0096404138e-06 1.4269478276e-09 4.3208516702e-06 1.52827011515e-09 4.62396294045e-06 1.62180570511e-09 4.9186341428e-06 1.70665770644e-09 5.20432308051e-06 1.78171476118e-09 5.48036613512e-06 1.84567822224e-09 5.74583451078e-06 1.89707034832e-09 5.99941535667e-06 1.9342555665e-09 6.23952494794e-06 1.9554629586e-09 6.46445497389e-06 1.9588392722e-09 6.67247867447e-06 1.94246444913e-09 6.8618851308e-06 1.90472818461e-09 7.03015923085e-06 1.84451075682e-09 1.75110763888e-09 7.12969076412e-06 4.49024440503e-07 8.71131164512e-11 8.85336264976e-07 2.58759626231e-10 1.3058183769e-06 4.24601268532e-10 1.71214724185e-06 5.8413516455e-10 2.10610768945e-06 7.37627309804e-10 2.48913486123e-06 8.85278473672e-10 2.86223715716e-06 1.02719382262e-09 3.22627450204e-06 1.16339378326e-09 3.58176339848e-06 1.29375956387e-09 3.92894166692e-06 1.41804052202e-09 4.2679537466e-06 1.53583016522e-09 4.59861126462e-06 1.64649999901e-09 4.92069984855e-06 1.74929288892e-09 5.23380754869e-06 1.84322132484e-09 5.53734522251e-06 1.92707029977e-09 5.83065471758e-06 1.99943391137e-09 6.11270105746e-06 2.0586371255e-09 6.38209312651e-06 2.10277269966e-09 6.63706990058e-06 2.12972001931e-09 6.87573854772e-06 2.13717889772e-09 7.09614426795e-06 2.1227266608e-09 7.29644794179e-06 2.08408905599e-09 7.47402008429e-06 2.01943096445e-09 1.91670455985e-09 7.57888792549e-06 4.76442346429e-07 9.30708444087e-11 9.39070066174e-07 2.76391797262e-10 1.38454416691e-06 4.53409818751e-10 1.81470812524e-06 6.23649799657e-10 2.23146353047e-06 7.87462908002e-10 2.63641210519e-06 9.45141139385e-10 3.03076299986e-06 1.09688656469e-09 3.4154446816e-06 1.24279391076e-09 3.79103556916e-06 1.38282867713e-09 4.15791688212e-06 1.5168035525e-09 4.51618748262e-06 1.6443187606e-09 4.86572442864e-06 1.76480857796e-09 5.20633498899e-06 1.87750771811e-09 5.53746820727e-06 1.98135233678e-09 5.85857019615e-06 2.07507735041e-09 6.16888468602e-06 2.15710371299e-09 6.46730677393e-06 2.22554905481e-09 6.75238824692e-06 2.27827807164e-09 7.02219083238e-06 2.31278217139e-09 7.2746219956e-06 2.32624544065e-09 7.5075440304e-06 2.31564481163e-09 7.71892247127e-06 2.27783613295e-09 7.90593981971e-06 2.20997193101e-09 2.09853288184e-09 8.01662465703e-06 5.02611225306e-07 9.88713349131e-11 9.90347448635e-07 2.93560874539e-10 1.45971711486e-06 4.81490372759e-10 1.91264084235e-06 6.62209216804e-10 2.35111716917e-06 8.36132047308e-10 2.77694380417e-06 1.00365914856e-09 3.19149218944e-06 1.16510332633e-09 3.59578814514e-06 1.32065711561e-09 3.99057434645e-06 1.47038965034e-09 4.37628919529e-06 1.61418262434e-09 4.75302909026e-06 1.75169482265e-09 5.12079660305e-06 1.88241221045e-09 5.4793105147e-06 2.0055803289e-09 5.82802556469e-06 2.12019068856e-09 6.1663582603e-06 2.22491328493e-09 6.49337733783e-06 2.31800424106e-09 6.80797404104e-06 2.39742880063e-09 7.10863330183e-06 2.46073904051e-09 7.39322444955e-06 2.50502544893e-09 7.65946609746e-06 2.52693726225e-09 7.90508984107e-06 2.52270727459e-09 8.12776736599e-06 2.48818020789e-09 8.32450518119e-06 2.41922146198e-09 2.30050988244e-09 8.44170530998e-06 5.27424385206e-07 1.04498364451e-10 1.03895593931e-06 3.10205793189e-10 1.5309195368e-06 5.08663860735e-10 2.00531989393e-06 6.9946444652e-10 2.46428206977e-06 8.83150038491e-10 2.90980096101e-06 1.06024346128e-09 3.34337591348e-06 1.23115978934e-09 3.76620432909e-06 1.396223342e-09 4.17921543005e-06 1.55565103549e-09 4.58283569903e-06 1.70937024112e-09 4.97719112065e-06 1.85707704463e-09 5.36233728069e-06 1.99834590131e-09 5.73803642588e-06 2.13253256538e-09 6.10380420194e-06 2.25868832654e-09 6.4588525452e-06 2.37544559124e-09 6.80222596163e-06 2.48105836083e-09 7.13284261333e-06 2.57338320737e-09 7.44897516564e-06 2.64964826799e-09 7.74827647185e-06 2.70643887777e-09 8.02833277232e-06 2.7398211575e-09 8.28676880304e-06 2.74524181443e-09 8.52100898172e-06 2.71745699713e-09 8.72782230509e-06 2.65067499463e-09 2.52728281371e-09 8.85236175349e-06 5.50795103005e-07 1.09895054134e-10 1.08467956987e-06 3.26148821387e-10 1.59768757541e-06 5.34620823221e-10 2.09202925956e-06 7.34983854703e-10 2.57007504357e-06 9.27975625434e-10 3.03396811689e-06 1.11425469602e-09 3.48533857677e-06 1.29435403571e-09 3.92556667072e-06 1.46873480673e-09 4.35571073248e-06 1.63771395604e-09 4.7761954018e-06 1.80128711643e-09 5.18716267166e-06 1.95925607095e-09 5.58878332362e-06 2.11134889046e-09 5.9809576532e-06 2.25707763946e-09 6.36304477981e-06 2.39552150527e-09 6.73414760602e-06 2.5253509802e-09 7.09348047634e-06 2.64489606541e-09 7.43985780734e-06 2.75200204984e-09 7.77125326255e-06 2.84370506614e-09 8.08511427744e-06 2.91618009753e-09 8.37895586514e-06 2.96485760216e-09 8.65027696663e-06 2.98421905438e-09 8.89627564188e-06 2.96781124181e-09 9.11340417619e-06 2.90795012135e-09 2.7844411477e-09 9.24615682272e-06 5.7245157307e-07 1.14958655078e-10 1.12700792728e-06 3.41101839759e-10 1.65939817539e-06 5.58981188862e-10 2.17209320665e-06 7.68353763375e-10 2.66770911095e-06 9.70131055892e-10 3.14854979231e-06 1.16511918225e-09 3.61641110916e-06 1.35399844296e-09 4.0727536018e-06 1.53733477135e-09 4.51870548367e-06 1.71551481496e-09 4.95481251415e-06 1.88870188193e-09 5.38134988783e-06 2.05688431395e-09 5.79858708056e-06 2.21995561647e-09 6.20635739729e-06 2.37755884914e-09 6.60384865241e-06 2.52884588345e-09 6.99029455066e-06 2.67267520891e-09 7.3650474329e-06 2.80755747048e-09 7.72669022426e-06 2.93129445742e-09 8.07293860759e-06 3.0408846046e-09 8.40117782635e-06 3.13242831466e-09 8.70878298185e-06 3.20088232278e-09 8.99294826935e-06 3.23967468062e-09 9.25067531491e-06 3.24075094267e-09 9.47813703501e-06 3.19445955984e-09 3.07830316688e-09 9.6200316897e-06 5.92140750324e-07 1.19631205815e-10 1.1654874975e-06 3.54902177661e-10 1.71552526181e-06 5.81475428858e-10 2.24493857339e-06 7.99192223557e-10 2.75652703063e-06 1.00912379838e-09 3.25277082847e-06 1.21222357567e-09 3.73560180224e-06 1.40930956482e-09 4.20658402842e-06 1.60105846584e-09 4.66692810348e-06 1.78798890329e-09 5.11737906444e-06 1.97044509353e-09 5.55838765309e-06 2.14861415879e-09 5.99014523269e-06 2.32253987023e-09 6.41233745242e-06 2.49200211894e-09 6.82421529089e-06 2.65642043869e-09 7.22523436705e-06 2.81494857619e-09 7.61465976524e-06 2.9662761155e-09 7.99085147079e-06 3.10836569835e-09 8.35147992404e-06 3.23840989261e-09 8.69382041162e-06 3.35250555293e-09 9.01497645986e-06 3.44536886875e-09 9.31178250061e-06 3.50990101609e-09 9.58087406277e-06 3.53650727194e-09 9.81833702014e-06 3.51290805902e-09 3.41520056081e-09 9.97018235615e-06 6.09722393504e-07 1.23852486334e-10 1.19982410275e-06 3.67369916226e-10 1.76564123427e-06 6.01801899523e-10 2.30998175519e-06 8.27073768e-10 2.83584115529e-06 1.04440539743e-09 3.34581414148e-06 1.25489494555e-09 3.84198902641e-06 1.45949116067e-09 4.32607148144e-06 1.65900187876e-09 4.79937393511e-06 1.85409073128e-09 5.26282643746e-06 2.04527336446e-09 5.71692035869e-06 2.23293077038e-09 6.16177298383e-06 2.41728334716e-09 6.59707408034e-06 2.59834132251e-09 7.02225160686e-06 2.77585963184e-09 7.43689326638e-06 2.94931025772e-09 7.84006936156e-06 3.11769106873e-09 8.22999498047e-06 3.2794088831e-09 8.60435308555e-06 3.43204977285e-09 8.96024420607e-06 3.57197515545e-09 9.29450849777e-06 3.69405027168e-09 9.60347939049e-06 3.79100691439e-09 9.88325436094e-06 3.85249427331e-09 1.01297408257e-05 3.86386291707e-09 3.80103192861e-09 1.02917415776e-05 6.24959328539e-07 1.27530544275e-10 1.22958537556e-06 3.78231874835e-10 1.80903950118e-06 6.19516139827e-10 2.36631327912e-06 8.51385294231e-10 2.90454158605e-06 1.07519985642e-09 3.4264376561e-06 1.292188444e-09 3.93425246255e-06 1.50342759554e-09 4.42979149342e-06 1.70985687323e-09 4.91449977899e-06 1.91228272396e-09 5.38936433143e-06 2.1113969303e-09 5.85491513323e-06 2.30776548016e-09 6.31131172501e-06 2.50182037901e-09 6.75828682825e-06 2.69382747587e-09 7.19549310247e-06 2.88391766641e-09 7.62258783811e-06 3.07200194156e-09 8.03841056808e-06 3.25750280355e-09 8.44109281861e-06 3.43934343535e-09 8.8282335762e-06 3.61577195165e-09 9.19686545886e-06 3.78397397951e-09 9.54357763813e-06 3.93951890415e-09 9.86404469516e-06 4.07554963128e-09 1.0153578188e-05 4.18187664025e-09 1.04071196414e-05 4.24319879282e-09 4.2400097205e-09 1.05782738334e-05 6.35589947474e-07 1.25031129508e-06 1.83922072543e-06 2.40549531415e-06 2.95233557297e-06 3.48261450218e-06 3.99866278272e-06 4.50236979484e-06 4.99528058351e-06 5.4783756839e-06 5.9522898861e-06 6.41728037529e-06 6.87314144078e-06 7.31968169493e-06 7.75661234064e-06 8.18263695592e-06 8.59590585952e-06 8.99408267217e-06 9.37422853521e-06 9.73274526119e-06 1.0064804598e-05 1.03645738117e-05 1.06254622838e-05 1.08317279748e-05 2.938265244e-07 1.74060657921e-08 2.86364170057e-07 1.28948857203e-08 2.82898320031e-07 7.89968996383e-09 2.6194573116e-09 2.83792457389e-07 8.76398399825e-07 6.92798369202e-08 8.53681634141e-07 5.13342725316e-08 8.42944603583e-07 3.14948329766e-08 1.05586758065e-08 8.45193760471e-07 1.4464492767e-06 1.54317523134e-07 1.40803456027e-06 1.1430992053e-07 1.38944676944e-06 7.01383348658e-08 2.35878319785e-08 1.39219672617e-06 2.00199100347e-06 2.71309173227e-07 1.94773474899e-06 2.008866413e-07 1.92087665864e-06 1.23236746215e-07 4.14972034326e-08 1.92334706612e-06 2.54386316735e-06 4.19149529342e-07 2.47371019254e-06 3.10216418378e-07 2.43824989118e-06 1.90251490462e-07 6.40968128342e-08 2.43976167473e-06 3.0730478457e-06 5.96846263614e-07 2.9869086146e-06 4.41541707608e-07 2.94254376846e-06 2.70696843402e-07 9.1215199615e-08 2.94249365098e-06 3.59038234499e-06 8.03446038412e-07 3.48819413691e-06 5.94150845286e-07 3.43465704316e-06 3.64126901077e-07 1.22696661496e-07 3.43252719631e-06 4.09640171718e-06 1.03802184042e-06 3.97821900653e-06 7.67352953391e-07 3.91535772602e-06 4.70118582823e-07 1.58397312417e-07 3.9107419218e-06 4.5914659835e-06 1.29965431084e-06 4.45748512648e-06 9.60482713982e-07 4.38528356044e-06 5.8827323244e-07 1.98182723982e-07 4.37789297459e-06 5.07591887973e-06 1.58746637928e-06 4.92645043823e-06 1.17291486804e-06 4.84499855472e-06 7.18216345706e-07 2.4192806214e-07 4.8346384699e-06 5.55014304525e-06 1.90062130099e-06 5.3855709115e-06 1.40406440397e-06 5.2950111368e-06 8.59598259025e-07 2.89515348777e-07 5.28155578354e-06 6.01448413842e-06 2.23831230274e-06 5.83524768782e-06 1.65335602741e-06 5.73577347477e-06 1.01208003391e-06 3.40832655633e-07 5.71913587767e-06 6.46916555778e-06 2.59967830929e-06 6.27578204267e-06 1.92020909349e-06 6.16762750121e-06 1.17532264423e-06 3.95765130292e-07 6.14773755671e-06 6.91416403012e-06 2.98373899102e-06 6.70725317108e-06 2.2039505091e-06 6.59069635966e-06 1.34893781942e-06 4.54187246257e-07 6.56752562e-06 7.34909521409e-06 3.38927903956e-06 7.12943210893e-06 2.50378709543e-06 7.00485847461e-06 1.53248545333e-06 5.15956280125e-07 6.97843376156e-06 7.77330012705e-06 3.81492389159e-06 7.54186332531e-06 2.81881747248e-06 7.4097441077e-06 1.72545323568e-06 5.80902084346e-07 7.38009941729e-06 8.18591374564e-06 4.25904989725e-06 7.94384440138e-06 3.14797877186e-06 7.80471103208e-06 1.92723285482e-06 6.48818156893e-07 7.77181275489e-06 8.58566352125e-06 4.71960922985e-06 8.33438784286e-06 3.48995450713e-06 8.18885936389e-06 2.1371013039e-06 7.19458456544e-07 8.15253671224e-06 8.97079082398e-06 5.19405329129e-06 8.71218696409e-06 3.84314422169e-06 8.56109947178e-06 2.35421003142e-06 7.92545309303e-07 8.52105352485e-06 9.33900219918e-06 5.67918593283e-06 9.07556663309e-06 4.20555816281e-06 8.92016222895e-06 2.57754780779e-06 8.67788055623e-07 8.87634005676e-06 9.68725180072e-06 6.17086215824e-06 9.42226102374e-06 4.57461663301e-06 9.26436202793e-06 2.8058032461e-06 9.44825971916e-07 9.21743796127e-06 1.00113697062e-05 6.66361384687e-06 9.74905290105e-06 4.94684578637e-06 9.59107655536e-06 3.03716190228e-06 1.02309755623e-06 9.54226541894e-06 1.03054531024e-05 7.15015602204e-06 1.00511712899e-05 5.31733670307e-06 9.89618229641e-06 3.2690019202e-06 1.10176778038e-06 9.84678169582e-06 1.05610326153e-05 7.62736765701e-06 1.03171139267e-05 5.67667941005e-06 1.01667977638e-05 3.49384019191e-06 1.17807798044e-06 1.01175408596e-05 6.67096415945e-06 -4.97020429992e-06 -5.67401071367e-06 7.41168817497e-06 -3.69245951622e-06 7.86770606649e-06 -2.27291645661e-06 -7.66140413592e-07 8.02150971867e-06 6.62161119475e-06 -5.90986734986e-06 -5.63215215212e-06 7.35672548041e-06 -4.3906424323e-06 7.80913790992e-06 -2.70278837456e-06 -9.11203490444e-07 7.9615403393e-06 6.5469148921e-06 -6.80251448433e-06 -5.56835709163e-06 7.27409993334e-06 -5.05433613554e-06 7.72149501017e-06 -3.11160457503e-06 -1.04919744126e-06 7.8722772474e-06 6.44686920653e-06 -5.47322923357e-06 7.16214498469e-06 7.60192294244e-06 7.75055569507e-06 8.29012022705e-06 -4.30969444391e-06 7.20231254262e-06 -4.37658762499e-06 6.05706417188e-06 -4.42644973303e-06 -4.45914037222e-06 9.46059545717e-06 -2.96994349561e-06 8.21839549935e-06 -3.01646391871e-06 6.91125064348e-06 -3.05061271116e-06 -3.07300262482e-06 1.02673212198e-05 -1.51590162229e-06 8.91865081635e-06 -1.5399534704e-06 7.49983379904e-06 -1.55743207698e-06 -1.56885699137e-06 1.06786011959e-05 -3.99553656459e-09 9.27586199814e-06 -4.20381618413e-09 7.80010310189e-06 -4.41968985869e-09 -4.54016845162e-09 1.06791492463e-05 1.50797648753e-06 9.27630825371e-06 1.53159592791e-06 7.80049395121e-06 1.54862441269e-06 1.55979305358e-06 1.02689471715e-05 2.96221457465e-06 8.91998296752e-06 3.00826154414e-06 7.50099613433e-06 3.04190564287e-06 3.06398960284e-06 9.4632208413e-06 4.30225739378e-06 8.22056700019e-06 4.3686379756e-06 6.91314291529e-06 4.41790968264e-06 4.45021160996e-06 8.29351301547e-06 5.46628152786e-06 7.20519277683e-06 5.56066828374e-06 6.05960129008e-06 5.62380925965e-06 5.66518993659e-06 6.80630847602e-06 6.43998185851e-06 -7.63151598867e-06 5.91325280935e-06 6.53936533284e-06 4.97326485152e-06 6.61343780501e-06 6.66226007602e-06 5.05832070005e-06 7.15519121963e-06 -5.68059577434e-06 4.39435404324e-06 7.26660419793e-06 3.69590908186e-06 7.34868194675e-06 7.40310041234e-06 3.11574996562e-06 7.59496308372e-06 -3.49797695255e-06 2.70671586005e-06 7.71407749048e-06 2.27662637569e-06 7.80122932536e-06 7.85924197004e-06 1.05345440838e-06 -1.1824295484e-06 7.74369559513e-06 9.15252166821e-07 7.86500170431e-06 7.69982962886e-07 7.95379907719e-06 8.01318028882e-06 -1.01584089221e-05 -1.10566155318e-06 1.01087527819e-05 -1.03095249187e-05 -3.27244623954e-06 -1.05546277099e-05 -5.32038159195e-06 -7.15298989213e-06 -9.88753335791e-06 -1.02651667902e-06 9.83794611848e-06 -1.00431178418e-05 -3.03983351032e-06 -1.0298481439e-05 -4.94890184589e-06 -6.66537866674e-06 -9.58167683677e-06 -9.47816746089e-07 9.53281660687e-06 -9.74013714668e-06 -2.80776767554e-06 -1.00034554168e-05 -4.5757473217e-06 -6.17150513956e-06 -9.25378255777e-06 -8.70360374883e-07 9.20660233275e-06 -9.41224766099e-06 -2.57883218709e-06 -9.67819169409e-06 -4.20581403821e-06 -5.67878112817e-06 -8.9080420883e-06 -7.94716653223e-07 8.86336268559e-06 -9.06422432974e-06 -2.35485728492e-06 -9.32859578656e-06 -3.84257381836e-06 -5.19263703714e-06 -8.54737173018e-06 -7.2130481097e-07 8.50583274916e-06 -8.69941223582e-06 -2.13722523512e-06 -8.9588925939e-06 -3.4886689e-06 -4.7172513571e-06 -8.1738661181e-06 -6.50447812273e-07 8.13586725128e-06 -8.32032615993e-06 -1.92701291856e-06 -8.57230378414e-06 -3.14617467154e-06 -4.25591839511e-06 -7.78907273478e-06 -5.8240739316e-07 7.75479873791e-06 -7.9288834228e-06 -1.72508155086e-06 -8.17132521991e-06 -2.81673322445e-06 -3.81127609124e-06 -7.39409780528e-06 -5.17394652859e-07 7.36361017863e-06 -7.52650083175e-06 -1.532111225e-06 -7.75789789286e-06 -2.50166002944e-06 -3.38543154445e-06 -6.98970268758e-06 -4.55585414859e-07 6.96295250266e-06 -7.11418342127e-06 -1.34866811312e-06 -7.33338635175e-06 -2.20197892817e-06 -2.97998201082e-06 -6.57637294966e-06 -3.97131070155e-07 6.55323534808e-06 -6.69254528417e-06 -1.1752088525e-06 -6.89863175714e-06 -1.91851729509e-06 -2.5962289594e-06 -6.15430026144e-06 -3.42161291241e-07 6.13466514172e-06 -6.26186122286e-06 -1.01212686044e-06 -6.45411826538e-06 -1.65197387078e-06 -2.23524562314e-06 -5.72345458605e-06 -2.90796578177e-07 5.70724457316e-06 -5.82215031479e-06 -8.59775906786e-07 -6.00001392901e-06 -1.40296145908e-06 -1.897955498e-06 -5.28366964194e-06 -2.43152810186e-07 5.27082249995e-06 -5.37326197727e-06 -7.18504513658e-07 -5.53625856988e-06 -1.17206779164e-06 -1.58520044705e-06 -4.83466921085e-06 -1.99344586087e-07 4.82508986656e-06 -4.91495983327e-06 -5.88658681693e-07 -5.06269634437e-06 -9.59885667096e-07 -1.29781893379e-06 -4.3760563757e-06 -1.59487863759e-07 4.36958050671e-06 -4.44693225006e-06 -4.70592422695e-07 -4.57908459408e-06 -7.67008222987e-07 -1.03663862143e-06 -3.90733426477e-06 -1.23705825616e-07 3.90370872496e-06 -3.96873722581e-06 -3.64667958692e-07 -4.08506039847e-06 -5.94036472466e-07 -8.02497016928e-07 -3.42781012451e-06 -9.2124376873e-08 3.42671911539e-06 -3.47980895149e-06 -2.71263215732e-07 -3.58016190974e-06 -4.4160284738e-07 -5.96250260933e-07 -2.93677556808e-06 -6.48911738001e-08 2.93779194365e-06 -2.97955632422e-06 -1.90805985746e-07 -3.06385112091e-06 -3.10387582996e-07 -4.18813739002e-07 -2.43359858556e-06 -4.21657780088e-08 2.43620572057e-06 -2.46739435998e-06 -1.237539204e-07 -2.53566850163e-06 -2.01131589652e-07 -2.71184170523e-07 -1.91747523577e-06 -2.41161531068e-08 1.9210328887e-06 -1.94264863815e-06 -7.05914944156e-08 -1.99504834444e-06 -1.14598054392e-07 -1.54369023042e-07 -1.38729752264e-06 -1.09273076552e-08 1.39101654033e-06 -1.40433801216e-06 -3.18394045197e-08 -1.44111056089e-06 -5.16046556512e-08 -6.94370943549e-08 -8.41783332236e-07 -2.80948377799e-09 8.44740774889e-07 -8.51388340883e-07 -8.09022890961e-09 -8.72965327384e-07 -1.30720015784e-08 -1.75591174746e-08 -2.82516765939e-07 2.83677164472e-07 -2.85567285241e-07 -2.92621006115e-07 -3.14154437738e-07 -1.90045414611e-08 3.30175112622e-07 -2.99447046166e-07 -1.38277662257e-08 -2.89289582319e-07 -8.35823579289e-09 -2.83527541765e-09 -9.33648688107e-07 -7.47706681392e-08 9.80475575823e-07 -8.90660062653e-07 -5.44183787666e-08 -8.61058220417e-07 -3.28583746372e-08 -1.10355289981e-08 -1.5332944911e-06 -1.65238971565e-07 1.60839706689e-06 -1.46438184638e-06 -1.20370428745e-07 -1.41714138668e-06 -7.27122036403e-08 -2.43547306956e-08 -2.11182667995e-06 -2.8859451672e-07 2.21278241558e-06 -2.01926723904e-06 -2.10438835193e-07 -1.95613520014e-06 -1.27213391926e-07 -4.2571327364e-08 -2.67106478928e-06 -4.43237932357e-07 2.79577216454e-06 -2.55682071646e-06 -3.23517149564e-07 -2.47931485873e-06 -1.95729068134e-07 -6.54854504783e-08 -3.21264907519e-06 -6.27754340389e-07 3.35928548545e-06 -3.07842057081e-06 -4.58620278498e-07 -2.98786547105e-06 -2.77692303908e-07 -9.29172616508e-08 -3.73805810131e-06 -8.40893534589e-07 3.90503870132e-06 -3.58532999246e-06 -6.14872139402e-07 -3.48288935417e-06 -3.72596244913e-07 -1.2470495955e-07 -4.24861502072e-06 -1.08153655008e-06 4.43454657797e-06 -4.07869573154e-06 -7.9148720797e-07 -3.96538876281e-06 -4.799837438e-07 -1.60701160438e-07 -4.74546159994e-06 -1.34865723634e-06 4.94906938546e-06 -4.5595234104e-06 -9.87748904392e-07 -4.43623961128e-06 -5.9943656762e-07 -2.00769849588e-07 -5.22955083318e-06 -1.64129874073e-06 5.44962396514e-06 -5.0286658619e-06 -1.20299135467e-06 -4.89619425627e-06 -7.30566373264e-07 -2.44784890148e-07 -5.70166056247e-06 -1.95855073912e-06 5.93702702739e-06 -5.48683164702e-06 -1.43658468262e-06 -5.34589335522e-06 -8.73007371798e-07 -2.92627573469e-07 -6.16237559897e-06 -2.29950825991e-06 6.41188998363e-06 -5.93457609023e-06 -1.68790633456e-06 -5.78586242197e-06 -1.02640338422e-06 -3.44183964966e-07 -6.61210689118e-06 -2.66327612198e-06 6.8746539895e-06 -6.37230107722e-06 -1.95633736952e-06 -6.21648475747e-06 -1.19039726456e-06 -3.99338228536e-07 -7.05108498387e-06 -3.04887392512e-06 7.32550550261e-06 -6.80025391802e-06 -2.24122562448e-06 -6.63797173433e-06 -1.36461455624e-06 -4.57966910784e-07 -7.47936857105e-06 -3.45524210075e-06 7.7642973198e-06 -7.21848179113e-06 -2.54187379879e-06 -7.0503025979e-06 -1.54863488427e-06 -5.19929021775e-07 -7.89691257826e-06 -3.88134578745e-06 8.19088316166e-06 -7.6267138856e-06 -2.85749008183e-06 -7.45310720021e-06 -1.74193820072e-06 -5.85051243651e-07 -8.30352980595e-06 -4.32613296054e-06 8.60533210571e-06 -8.02410798503e-06 -3.1870793209e-06 -7.84553034886e-06 -1.94382084418e-06 -6.5311263249e-07 -8.69906867405e-06 -4.78881672223e-06 9.00818205541e-06 -8.40860318555e-06 -3.52928220248e-06 -8.22607122738e-06 -2.15320457185e-06 -7.23828386772e-07 -9.07193797358e-06 -5.25537871662e-06 9.38814868973e-06 -8.77471967124e-06 -3.87662479769e-06 -8.59257596274e-06 -2.36811871674e-06 -7.96856156752e-07 -9.408718814e-06 -5.71773826493e-06 9.72668584118e-06 -9.12033523708e-06 -4.22725273117e-06 -8.94401296182e-06 -2.5883552283e-06 -8.71975707018e-07 -9.72530357161e-06 -6.1948114538e-06 1.00360810575e-05 -9.45164164286e-06 -4.58956141574e-06 -9.28110305113e-06 -2.81462123244e-06 -9.4898058359e-07 -1.00356363704e-05 -6.6834882364e-06 1.03353190021e-05 -9.76907230318e-06 -4.95933814406e-06 -9.60263908873e-06 -3.0446747089e-06 -1.02732210768e-06 -1.03224276263e-05 -7.16381628804e-06 1.06096306495e-05 -1.00641390614e-05 -5.32632547481e-06 -9.90376898596e-06 -3.27526541916e-06 -1.10613111664e-06 -1.05691137425e-05 -7.63423552038e-06 1.08499901522e-05 -1.03236644529e-05 -5.68218460559e-06 -1.01708778902e-05 -3.49893653868e-06 -1.18260298477e-06 -6.66955211872e-06 4.97149800957e-06 5.67237239637e-06 -7.41068091381e-06 3.69496250206e-06 -7.86719135275e-06 2.27628476845e-06 7.69944855187e-07 -6.61859753533e-06 5.91008481751e-06 5.6286800435e-06 -7.35462493989e-06 4.39271627105e-06 -7.80808917701e-06 2.70616380973e-06 9.15196208262e-07 -6.54393892616e-06 6.80355719267e-06 5.56487611765e-06 -7.27224649477e-06 5.05707320351e-06 -7.72068133124e-06 3.11545505478e-06 1.05343788535e-06 -6.44631986948e-06 5.47290917067e-06 -7.16235668452e-06 -7.60240363215e-06 -8.28921292482e-06 4.30797240692e-06 9.30178644172e-06 -7.20045199889e-06 4.37305105109e-06 -6.05696907571e-06 4.42301725799e-06 4.45748122196e-06 -9.45712481424e-06 2.96765050367e-06 1.06274054946e-05 -8.21435144863e-06 3.01317397482e-06 -6.90972031686e-06 3.04758717902e-06 3.0714948763e-06 -1.02609488661e-05 1.51385100571e-06 1.15259703645e-05 -8.91244225601e-06 1.53747863339e-06 -7.4969346849e-06 1.5552000956e-06 1.56765634707e-06 -1.06699316343e-05 2.74038331196e-09 1.19824623609e-05 -9.2679386033e-06 3.00417200051e-09 -7.79606172844e-06 3.27746098406e-09 3.75936259987e-09 -1.06693691621e-05 -1.50830237513e-06 1.19817806591e-05 -9.26748253272e-06 -1.53141669585e-06 -7.7956672387e-06 -1.54860924483e-06 -1.56011807375e-06 -1.02593178975e-05 -2.96191705529e-06 1.15240087163e-05 -8.91110643539e-06 -3.0069650997e-06 -7.49577089659e-06 -3.04089551164e-06 -3.0639003351e-06 -9.45458811773e-06 -4.30200121478e-06 1.06244166487e-05 -8.21222940341e-06 -4.36664459458e-06 -6.9078449061e-06 -4.41618098871e-06 -4.44980082772e-06 -8.28603372866e-06 -5.46658975355e-06 9.29774682851e-06 -7.19768803664e-06 -5.55831275953e-06 -6.0544736371e-06 -5.62169266731e-06 -5.66458885438e-06 -6.80000848974e-06 -6.4399971297e-06 7.63000174703e-06 -5.90683023285e-06 -6.53726795201e-06 -4.96848837844e-06 -6.61145177592e-06 -6.66164866514e-06 -5.05323677526e-06 -7.15595291747e-06 5.67807670347e-06 -4.38908029586e-06 -7.26541061675e-06 -3.69154773642e-06 -7.34729045598e-06 -7.40264070702e-06 -3.11133984806e-06 -7.59575322373e-06 3.49458972191e-06 -2.70225079495e-06 -7.71361732142e-06 -2.27258826059e-06 -7.80054702036e-06 -7.85900608497e-06 -1.0491738784e-06 1.17814960112e-06 -9.1114427953e-07 -7.66104730683e-07 1.01621246921e-05 1.10191988335e-06 1.03153073728e-05 3.27104303109e-06 1.05609383598e-05 5.32229968121e-06 7.1592826542e-06 1.08406028382e-05 9.89528379517e-06 1.02330852947e-06 1.00565723864e-05 3.04056240916e-06 1.03155705653e-05 4.9557672495e-06 6.6792649975e-06 1.06000349585e-05 9.59386517595e-06 9.45072472446e-07 9.76234708434e-06 2.81052101488e-06 1.00328956413e-05 4.58742978012e-06 6.1927953326e-06 1.0326592942e-05 9.27072203483e-06 8.68044089179e-07 9.44388528386e-06 2.58357142399e-06 9.72091572748e-06 4.22223519635e-06 5.7075087818e-06 1.00193370553e-05 8.9301680869e-06 7.92798293625e-07 9.10622264133e-06 2.36155425033e-06 9.38678938074e-06 3.86412858102e-06 5.23201503603e-06 9.68995196808e-06 8.57485498109e-06 7.19738571517e-07 8.75239564461e-06 2.14565140157e-06 9.03467219457e-06 3.51494214666e-06 4.76685607415e-06 9.34365099483e-06 8.20647320275e-06 6.49179820576e-07 8.38384702142e-06 1.9367539284e-06 8.66477694899e-06 3.17579583958e-06 4.31136015335e-06 8.97383651147e-06 7.82628759899e-06 5.81381449237e-07 8.00172837781e-06 1.73569804629e-06 8.27791091287e-06 2.84844937492e-06 3.87022412772e-06 8.58083363828e-06 7.43529871471e-06 5.16562355641e-07 7.60735394316e-06 1.54321903015e-06 7.87645319842e-06 2.53446791571e-06 3.44631651053e-06 8.17110596181e-06 7.03424603343e-06 4.54902591773e-07 7.20179381236e-06 1.3599223215e-06 7.4622354992e-06 2.23503360514e-06 3.04145234487e-06 7.74730661529e-06 6.6235858518e-06 3.96559958436e-07 6.78570254797e-06 1.18630968191e-06 7.03628239672e-06 1.95108249698e-06 2.65703167001e-06 7.31054366835e-06 6.20356153934e-06 3.41672936499e-07 6.35943723547e-06 1.02283376165e-06 6.59916586373e-06 1.68343474382e-06 2.29429461553e-06 6.86150999644e-06 5.77426683375e-06 2.90370925204e-07 5.9231881956e-06 8.69911699969e-07 6.15111366381e-06 1.4328131592e-06 1.95424143952e-06 6.40048064889e-06 5.33560307459e-06 2.42773296151e-07 5.47688906211e-06 7.2791525826e-07 5.69197279251e-06 1.19985233452e-06 1.6377633968e-06 5.92717544202e-06 4.88722529282e-06 1.98995769738e-07 5.020150963e-06 5.97195006063e-07 5.2212992262e-06 9.85163047819e-07 1.34577253741e-06 5.44112176533e-06 4.42858975453e-06 1.59155728163e-07 4.55235447859e-06 4.78112067498e-07 4.73850029718e-06 7.89381085961e-07 1.07921472449e-06 4.9417821732e-06 3.95901550826e-06 1.2337885419e-07 4.07277602883e-06 3.71056533164e-07 4.24284554537e-06 6.1318532665e-07 8.39061787518e-07 4.42841469247e-06 3.47770377999e-06 9.17981380146e-08 3.5805625979e-06 2.76446588974e-07 3.73340543106e-06 4.57295594723e-07 6.26348090532e-07 3.90003264864e-06 2.98378460942e-06 6.45648953613e-08 3.0747392871e-06 1.94749467335e-07 3.20908607179e-06 3.22513824415e-07 4.42205393665e-07 3.3554093095e-06 2.47636587629e-06 4.1846322807e-08 2.55426732983e-06 1.26481950471e-07 2.66863850222e-06 2.09724349652e-07 2.87885785605e-07 2.79304963329e-06 1.95437658445e-06 2.38192635233e-08 2.01786121001e-06 7.22011938083e-08 2.11051727878e-06 1.1989436045e-07 1.64784890948e-07 2.21116785254e-06 1.41639689079e-06 1.06808879791e-08 1.46389532829e-06 3.25319881379e-08 1.53284743738e-06 5.41231293254e-08 7.4498531746e-08 1.60767277215e-06 8.60881907707e-07 2.65673451166e-09 8.90633550737e-07 8.19499177349e-09 9.33625800213e-07 1.36801310883e-08 1.88709177626e-08 9.80279313501e-07 2.89276869004e-07 2.99483023962e-07 3.14188532423e-07 3.3015837453e-07 -6.28057877629e-07 -5.20894241491e-11 5.36864052312e-11 -1.24340403972e-06 -1.55523984183e-10 1.60328196703e-10 -1.84257802673e-06 -2.57179318645e-10 2.6523628547e-10 -2.42633983529e-06 -3.56929901559e-10 3.6833929577e-10 -2.99512524318e-06 -4.55082609925e-10 4.70027166752e-10 -3.54934146946e-06 -5.51918954961e-10 5.70673025834e-10 -4.08935751251e-06 -6.47712384991e-10 6.70655456605e-10 -4.61548379577e-06 -7.42721720742e-10 7.70358367351e-10 -5.12797333376e-06 -8.37184574184e-10 8.70171822431e-10 -5.62700462014e-06 -9.31304861918e-10 9.70489558261e-10 -6.11264632629e-06 -1.0252333597e-09 1.07170191809e-09 -6.58482513639e-06 -1.11903373622e-09 1.17418174972e-09 -7.04350278555e-06 -1.2126231533e-09 1.27824748317e-09 -7.48849626371e-06 -1.3057628938e-09 1.38415823897e-09 -7.91908404412e-06 -1.3979206282e-09 1.49204074396e-09 -8.33434120569e-06 -1.48794166915e-09 1.60165241757e-09 -8.73319082222e-06 -1.57383624643e-09 1.71221986536e-09 -9.11421126221e-06 -1.65237957239e-09 1.82212686427e-09 -9.47543255553e-06 -1.71842031908e-09 1.92822294778e-09 -9.81406829502e-06 -1.76367814656e-09 2.02461301218e-09 -1.01265540879e-05 -1.77505527804e-09 2.10083050771e-09 -1.04085739184e-05 -1.73184667337e-09 2.13929662756e-09 -1.06555308433e-05 -1.60067384975e-09 2.10944983828e-09 -1.25987634254e-09 1.87605100947e-09 -6.19765903141e-07 -4.98392579994e-11 -1.2270080399e-06 -1.487704486e-10 -1.81829495517e-06 -2.4589442836e-10 -2.39432315212e-06 -3.41015560449e-10 -2.95548369879e-06 -4.3434146745e-10 -3.50213779621e-06 -5.26046728428e-10 -4.03460738e-06 -6.16283257824e-10 -4.55316178761e-06 -7.05169603715e-10 -5.05801025153e-06 -7.92777428078e-10 -5.54928566581e-06 -8.79112175417e-10 -6.02701341934e-06 -9.6408339304e-10 -6.49108767928e-06 -1.04746098568e-09 -6.94137469714e-06 -1.1288106397e-09 -7.37756950607e-06 -1.20742477156e-09 -7.7989250063e-06 -1.28217915008e-09 -8.20452685386e-06 -1.3512660058e-09 -8.59324242947e-06 -1.41196317372e-09 -8.96356723376e-06 -1.46024980716e-09 -9.31360288497e-06 -1.49023692478e-09 -9.64069934383e-06 -1.49323511056e-09 -9.94173611282e-06 -1.45676562808e-09 -1.02129877475e-05 -1.36336282924e-09 -1.04512725956e-05 -1.18914694425e-09 -8.58252235249e-10 -6.07429845662e-07 -4.73381029395e-11 -1.20266915921e-06 -1.41265389748e-10 -1.78231159711e-06 -2.33360912299e-10 -2.34698414729e-06 -3.23358124421e-10 -2.89703012802e-06 -4.11363864028e-10 -3.43276560193e-06 -4.97445294085e-10 -3.95445657656e-06 -5.81633864569e-10 -4.46231917911e-06 -6.63910283529e-10 -4.95651463915e-06 -7.44188547419e-10 -5.43714866229e-06 -8.22292820877e-10 -5.90420107015e-06 -8.97919087253e-10 -6.35749417105e-06 -9.70584162255e-10 -6.79683608579e-06 -1.03954181513e-09 -7.22184441583e-06 -1.10373435304e-09 -7.63171811762e-06 -1.16166678232e-09 -8.02557464735e-06 -1.21109223936e-09 -8.40235718809e-06 -1.24891670408e-09 -8.76052255706e-06 -1.27090663355e-09 -9.09823910161e-06 -1.27109228301e-09 -9.41322806707e-06 -1.24137281671e-09 -9.70283191779e-06 -1.17115033059e-09 -9.96374028418e-06 -1.04695824956e-09 -1.01925320344e-05 -8.52493831059e-10 -5.39642988562e-10 -5.9344833378e-07 -4.4633271439e-11 -1.17505518119e-06 -1.33152825496e-10 -1.74145421883e-06 -2.19824944011e-10 -2.29320233108e-06 -3.04314455406e-10 -2.8306155244e-06 -3.8663070156e-10 -3.35396985096e-06 -4.66739696423e-10 -3.86345018953e-06 -5.44558651423e-10 -4.35919944654e-06 -6.19936078007e-10 -4.84131445179e-06 -6.92640701402e-10 -5.30991870149e-06 -7.62328125258e-10 -5.7649986329e-06 -8.28527108099e-10 -6.20621876966e-06 -8.90585213528e-10 -6.63331318449e-06 -9.47510505924e-10 -7.0459454622e-06 -9.98005565731e-10 -7.44325700927e-06 -1.04038208452e-09 -7.8242888162e-06 -1.07222722713e-09 -8.18803553542e-06 -1.09034528577e-09 -8.53304195867e-06 -1.09055857043e-09 -8.85759001521e-06 -1.06735434893e-09 -9.15973320842e-06 -1.01388058215e-09 -9.43733554002e-06 -9.21645425676e-10 -9.68789878502e-06 -7.80385412581e-10 -9.90858293609e-06 -5.78489964128e-10 -2.87854746323e-10 -5.77798409066e-07 -4.17831609255e-11 -1.14413210359e-06 -1.24608357795e-10 -1.6956805779e-06 -2.05580371512e-10 -2.23290202733e-06 -2.84297037694e-10 -2.75614027603e-06 -3.60671011611e-10 -3.26570625703e-06 -4.34585730149e-10 -3.76162527218e-06 -5.05874201789e-10 -4.24391038077e-06 -5.74254609634e-10 -4.71262013036e-06 -6.39356710137e-10 -5.16788023782e-06 -7.00710609671e-10 -5.60971732967e-06 -7.57719342506e-10 -6.03771172123e-06 -8.09608932449e-10 -6.45143351938e-06 -8.5526777434e-10 -6.85052028857e-06 -8.93266278656e-10 -7.23418379467e-06 -9.21796492397e-10 -7.60147641741e-06 -9.38445458727e-10 -7.95138000365e-06 -9.40155223506e-10 -8.2825218816e-06 -9.23123353448e-10 -8.5933372367e-06 -8.82652766617e-10 -8.88209398005e-06 -8.13167169855e-10 -9.1471314371e-06 -7.08043099027e-10 -9.3871501011e-06 -5.6007329748e-10 -9.60205555448e-06 -3.61463213716e-10 -9.56922296967e-11 -5.60578654887e-07 -3.88415394673e-11 -1.11009783228e-06 -1.15794162411e-10 -1.64529857799e-06 -1.90901830181e-10 -2.16653775714e-06 -2.63705006892e-10 -2.67416109234e-06 -3.34027971393e-10 -3.16852226423e-06 -4.01670572425e-10 -3.649527116e-06 -4.6638568849e-10 -4.11707563456e-06 -5.27803707703e-10 -4.5712210755e-06 -5.85459495821e-10 -5.01199600247e-06 -6.38797449207e-10 -5.43935611909e-06 -6.87121458399e-10 -5.8529533881e-06 -7.29551718008e-10 -6.25227723918e-06 -7.64937987291e-10 -6.63686048423e-06 -7.91804783329e-10 -7.00599575871e-06 -8.08334885476e-10 -7.3587569653e-06 -8.12279432874e-10 -7.69414086842e-06 -8.00888580223e-10 -8.01083106286e-06 -7.70892480127e-10 -8.30734126441e-06 -7.18408253477e-10 -8.58216753786e-06 -6.38967138262e-10 -8.83370106867e-06 -5.27762446009e-10 -9.06096495722e-06 -3.80328149862e-10 -9.26487303992e-06 -1.92185455775e-10 4.73534031727e-11 -5.41847841388e-07 -3.58564440263e-11 -1.07307945482e-06 -1.06855311353e-10 -1.59052843726e-06 -1.76034801061e-10 -2.09450430885e-06 -2.42892447872e-10 -2.58523624334e-06 -3.07180549799e-10 -3.06296751575e-06 -3.68613613913e-10 -3.52765673395e-06 -4.26857913905e-10 -3.97921749959e-06 -4.81494266071e-10 -4.41764419542e-06 -5.32008022151e-10 -4.84286805886e-06 -5.77778498649e-10 -5.25470224797e-06 -6.18048862372e-10 -5.65285947297e-06 -6.51868038837e-10 -6.03687599302e-06 -6.78076900622e-10 -6.40616174091e-06 -6.95265063233e-10 -6.76004285991e-06 -7.01724482478e-10 -7.09758296408e-06 -6.95446678723e-10 -7.41776866857e-06 -6.74042970364e-10 -7.71940240136e-06 -6.34736023278e-10 -8.00104805876e-06 -5.74385811612e-10 -8.2612807309e-06 -4.89568786619e-10 -8.49839239382e-06 -3.77050153869e-10 -8.7109034744e-06 -2.34148431489e-10 -8.89851951977e-06 -5.8079978796e-11 1.56882054444e-10 -5.21652644756e-07 -3.28767400185e-11 -1.03317117153e-06 -9.79379922843e-11 -1.53149853877e-06 -1.612207509e-10 -2.01690159225e-06 -2.22188652159e-10 -2.48949084421e-06 -2.80534212515e-10 -2.94936501413e-06 -3.35909795251e-10 -3.39652939545e-06 -3.87918182731e-10 -3.83094367649e-06 -4.36092411231e-10 -4.25251019701e-06 -4.79880463421e-10 -4.66112118051e-06 -5.18615037516e-10 -5.05654313684e-06 -5.51511548744e-10 -5.43841050167e-06 -5.77633715651e-10 -5.80630156166e-06 -5.95857983346e-10 -6.15955308442e-06 -6.04885765825e-10 -6.49744790011e-06 -6.03177505336e-10 -6.81912959611e-06 -5.88944915931e-10 -7.12358153558e-06 -5.60151368185e-10 -7.40965008132e-06 -5.14512552513e-10 -7.67596158955e-06 -4.49557799351e-10 -7.92098397092e-06 -3.62823368858e-10 -8.14313749509e-06 -2.52263146061e-10 -8.34061027903e-06 -1.16223863298e-10 -8.51211911848e-06 4.68371016118e-11 2.39192088641e-10 -5.00067072581e-07 -2.9945947634e-11 -9.90515086749e-07 -8.91722313117e-11 -1.46839979015e-06 -1.46674972951e-10 -1.93391537118e-06 -2.01893580124e-10 -2.38712098993e-06 -2.54472216488e-10 -2.82803944184e-06 -3.0401804728e-10 -3.25660385142e-06 -3.50088859284e-10 -3.67279710483e-06 -3.92175150236e-10 -4.07651317019e-06 -4.29704446989e-10 -4.46755448919e-06 -4.62009927135e-10 -4.84569286244e-06 -4.88307366344e-10 -5.21047668958e-06 -5.07709129085e-10 -5.56142429275e-06 -5.19172073497e-10 -5.89792942662e-06 -5.21495817613e-10 -6.21923749247e-06 -5.13317535842e-10 -6.52452994275e-06 -4.93093335935e-10 -6.8128213993e-06 -4.59122557735e-10 -7.08295984022e-06 -4.09577538335e-10 -7.33359665202e-06 -3.42575233426e-10 -7.56318178087e-06 -2.56475418932e-10 -7.77023209899e-06 -1.50041132765e-10 -7.95302460031e-06 -2.22348101314e-11 -8.11001416072e-06 1.27507880437e-10 2.99289811278e-10 -4.77161554806e-07 -2.70965637709e-11 -9.45253551837e-07 -8.06558000581e-11 -1.40145250603e-06 -1.3256069741e-10 -1.84584327346e-06 -1.82233676219e-10 -2.27847553399e-06 -2.29277306405e-10 -2.69937606127e-06 -2.73272651439e-10 -3.10834168578e-06 -3.13759753561e-10 -3.5053056363e-06 -3.50197777476e-10 -3.89023937431e-06 -3.82001700543e-10 -4.2628357948e-06 -4.08537589904e-10 -4.62278669232e-06 -4.29054358306e-10 -4.96968001799e-06 -4.42704995562e-10 -5.30298105344e-06 -4.48538973323e-10 -5.62210885206e-06 -4.45480040281e-10 -5.92632810868e-06 -4.32336917934e-10 -6.21480454888e-06 -4.07808358574e-10 -6.48658575696e-06 -3.70507297227e-10 -6.74056271002e-06 -3.19000715492e-10 -6.97531139353e-06 -2.51944405283e-10 -7.18945388593e-06 -1.68316741797e-10 -7.381600245e-06 -6.73545630024e-11 -7.55011916479e-06 5.14767575547e-11 -7.69377158626e-06 1.88077172172e-10 3.41321531643e-10 -4.52967712206e-07 -2.43526463803e-11 -8.9745484825e-07 -7.24593960575e-11 -1.33081956671e-06 -1.18996521763e-10 -1.75297734355e-06 -1.63383704526e-10 -2.16391176647e-06 -2.05185389527e-10 -2.56371042007e-06 -2.43959271289e-10 -2.95211090002e-06 -2.79245707415e-10 -3.32891862858e-06 -3.10509274189e-10 -3.69409275084e-06 -3.37169208961e-10 -4.04734220806e-06 -3.58608394813e-10 -4.38829486551e-06 -3.74126982978e-10 -4.71655397822e-06 -3.82942149794e-10 -5.03159156182e-06 -3.84192122987e-10 -5.33279557832e-06 -3.76932748338e-10 -5.61944809103e-06 -3.60145495902e-10 -5.89073277874e-06 -3.32752972019e-10 -6.14573489095e-06 -2.93647579777e-10 -6.3834164002e-06 -2.41734450215e-10 -6.60227022075e-06 -1.76122922638e-10 -6.80099240931e-06 -9.62135156682e-11 -6.9784782501e-06 -1.5285580136e-12 -7.13314606283e-06 1.08017050792e-10 -7.26409268264e-06 2.31908496436e-10 3.68426310107e-10 -4.27611632287e-07 -2.17431657701e-11 -8.47324492327e-07 -6.46654420776e-11 -1.25670136096e-06 -1.06102750562e-10 -1.65556147056e-06 -1.45485106036e-10 -2.04375157038e-06 -1.82366514049e-10 -2.42131857567e-06 -2.16291056456e-10 -2.78807543468e-06 -2.46793423545e-10 -3.14379081815e-06 -2.73363157632e-10 -3.48830899035e-06 -2.95445989773e-10 -3.82136390316e-06 -3.12446135703e-10 -4.14258681417e-06 -3.23712836692e-10 -4.45154177661e-06 -3.28537346115e-10 -4.7477032311e-06 -3.2615446288e-10 -5.03045947665e-06 -3.15748797158e-10 -5.29910825828e-06 -2.96462957108e-10 -5.55285899209e-06 -2.67420769175e-10 -5.79083331772e-06 -2.27757048834e-10 -6.01202607033e-06 -1.76667146004e-10 -6.21506560295e-06 -1.13594523523e-10 -6.39859355903e-06 -3.82279248591e-11 -6.56169684066e-06 4.96841572804e-11 -6.70302100367e-06 1.49896849244e-10 -6.82168888062e-06 2.6168859687e-10 3.83088998627e-10 -4.0121057648e-07 -1.92808476243e-11 -7.95063296864e-07 -5.73148170083e-11 -1.17923594599e-06 -9.39500768869e-11 -1.55360300201e-06 -1.28631554836e-10 -1.9179761041e-06 -1.60924821275e-10 -2.27228202785e-06 -1.90381495431e-10 -2.61637333729e-06 -2.16537948032e-10 -2.95004389801e-06 -2.38903106433e-10 -3.27306364392e-06 -2.56954080298e-10 -3.58513587256e-06 -2.70133724532e-10 -3.88588782742e-06 -2.77846581445e-10 -4.17487338719e-06 -2.7945855411e-10 -4.45156828588e-06 -2.74300531649e-10 -4.71537031545e-06 -2.61676281545e-10 -4.96559861464e-06 -2.40876152144e-10 -5.20149613387e-06 -2.11197968474e-10 -5.42223043708e-06 -1.71975910785e-10 -5.62672439966e-06 -1.22664699949e-10 -5.81387627496e-06 -6.29564870312e-11 -5.98246423727e-06 7.29690162674e-12 -6.13155479018e-06 8.81612077669e-11 -6.2600249428e-06 1.79192272868e-10 -6.36687692132e-06 2.79592358426e-10 3.87266707123e-10 -3.73657728169e-07 -1.69642776001e-11 -7.4051306511e-07 -5.04059962972e-11 -1.09834341619e-06 -8.25500229275e-11 -1.4470695574e-06 -1.12863220776e-10 -1.78653321017e-06 -1.40921433282e-10 -2.11659236825e-06 -1.66290618177e-10 -2.43707535618e-06 -1.88524098485e-10 -2.74776932208e-06 -2.07156554698e-10 -3.04841755893e-06 -2.2170031713e-10 -3.33870456243e-06 -2.31643396302e-10 -3.61824882668e-06 -2.36448722771e-10 -3.88660077817e-06 -2.35556123287e-10 -4.14324144569e-06 -2.28387721313e-10 -4.3875846337e-06 -2.14357461772e-10 -4.61897802849e-06 -1.92885707458e-10 -4.83670924011e-06 -1.63419743566e-10 -5.04001732394e-06 -1.25460161079e-10 -5.22776557464e-06 -7.86747539896e-11 -5.39893431704e-06 -2.29290942125e-11 -5.55260983327e-06 4.18412374808e-11 -5.68794290157e-06 1.15552870064e-10 -5.80386450323e-06 1.97647712514e-10 -5.89935579517e-06 2.87309813601e-10 3.82431956202e-10 -3.44874990301e-07 -1.47985249709e-11 -6.83540216297e-07 -4.39511959964e-11 -1.01392727618e-06 -7.1914002791e-11 -1.33593992009e-06 -9.81836468402e-11 -1.64941869623e-06 -1.223525319e-10 -1.95419908714e-06 -1.4400730385e-10 -2.2500923846e-06 -1.62726243647e-10 -2.53687292049e-06 -1.78075494958e-10 -2.81426935343e-06 -1.89606691381e-10 -3.08195503084e-06 -1.968561711e-10 -3.33954354122e-06 -1.99345991545e-10 -3.58658618333e-06 -1.96587428533e-10 -3.82257326577e-06 -1.88087514759e-10 -4.04693914858e-06 -1.73359270723e-10 -4.25906367226e-06 -1.51936328269e-10 -4.45827835467e-06 -1.23392785011e-10 -4.64385871956e-06 -8.73717509854e-11 -4.81483056561e-06 -4.36862420731e-11 -4.97009890021e-06 7.68412744634e-12 -5.10886343208e-06 6.67244548787e-11 -5.23055280085e-06 1.33252575346e-10 -5.33413512982e-06 2.06671922449e-10 -5.41866639955e-06 2.86182342917e-10 3.69744531975e-10 -3.14876333753e-07 -1.27798750356e-11 -6.24151895683e-07 -3.79390872904e-11 -9.25932584912e-07 -6.20216168477e-11 -1.22010198103e-06 -8.45603404552e-11 -1.50649385458e-06 -1.05170982303e-10 -1.78493269338e-06 -1.23466885078e-10 -2.05521963267e-06 -1.39057464102e-10 -2.31712053601e-06 -1.51544548542e-10 -2.57035714174e-06 -1.60522285161e-10 -2.81459847822e-06 -1.65576835724e-10 -3.04945850238e-06 -1.66288590332e-10 -3.27449304641e-06 -1.62236579877e-10 -3.48920493153e-06 -1.53005532486e-10 -3.69305199519e-06 -1.38196020429e-10 -3.88544976367e-06 -1.17437983498e-10 -4.06578405209e-06 -9.04074562217e-11 -4.23328040156e-06 -5.68739056525e-11 -4.38724932149e-06 -1.67565058805e-11 -4.52668121348e-06 2.99140366539e-11 -4.65066393225e-06 8.30600996477e-11 -4.7587731828e-06 1.42423811266e-10 -4.85023793558e-06 2.07413914436e-10 -4.92423604523e-06 2.77280703892e-10 3.50111215406e-10 -2.83625905789e-07 -1.08996251779e-11 -5.62272588101e-07 -3.23433256548e-11 -8.34231947611e-07 -5.28279640299e-11 -1.09937246369e-06 -7.1928177342e-11 -1.35752415867e-06 -8.92893307928e-11 -1.60850742916e-06 -1.04557230041e-10 -1.85211992927e-06 -1.1737649826e-10 -2.08812615481e-06 -1.27388964268e-10 -2.31624855784e-06 -1.34233256899e-10 -2.53615921582e-06 -1.37545846613e-10 -2.74747912466e-06 -1.36963800084e-10 -2.94977202375e-06 -1.32129609221e-10 -3.14255704265e-06 -1.22698342315e-10 -3.32531242373e-06 -1.08347294849e-10 -3.4974949594e-06 -8.87878546705e-11 -3.65857778901e-06 -6.37806315014e-11 -3.80777510578e-06 -3.31940456698e-11 -3.94448536226e-06 2.97874467218e-12 -4.06794091558e-06 4.46924676485e-11 -4.17726254473e-06 9.18275567255e-11 -4.27189723099e-06 1.44060923668e-10 -4.35144256057e-06 2.00822892383e-10 -4.41527455013e-06 2.61464548753e-10 3.24240555393e-10 -2.51062364892e-07 -9.14449992689e-12 -4.97776860884e-07 -2.71239902824e-11 -7.38631259713e-07 -4.42660790125e-11 -9.73486289808e-07 -6.01922002398e-11 -1.20217380356e-06 -7.45831641242e-11 -1.42451662429e-06 -8.71221053547e-11 -1.64031600405e-06 -9.74932798537e-11 -1.84934339937e-06 -1.05381162537e-10 -2.05132984009e-06 -1.1047060666e-10 -2.24596070821e-06 -1.12448339859e-10 -2.43287067538e-06 -1.11006044404e-10 -2.61164190453e-06 -1.05845249109e-10 -2.78180525395e-06 -9.66842987275e-11 -2.94285413639e-06 -8.32674159564e-11 -3.09427996031e-06 -6.53757436945e-11 -3.23560757646e-06 -4.28413659956e-11 -3.36628552109e-06 -1.55951172197e-11 -3.48564578716e-06 1.6326964628e-11 -3.59299096707e-06 5.28600655309e-11 -3.68772353258e-06 9.38616378004e-11 -3.76915756126e-06 1.38985498255e-10 -3.83698271435e-06 1.87697678993e-10 -3.89081987596e-06 2.39451299929e-10 2.92692206685e-10 -2.17100395291e-07 -7.49701835706e-12 -4.30492980669e-07 -2.22286862967e-11 -6.38870723014e-07 -3.62486434392e-11 -8.42094336332e-07 -4.92298383427e-11 -1.04000385258e-06 -6.08938628355e-11 -1.23243098636e-06 -7.09657367707e-11 -1.41918826942e-06 -7.9173063392e-11 -1.60006181451e-06 -8.52455937916e-11 -1.77480147217e-06 -8.89157543807e-11 -1.94311494597e-06 -8.99203415835e-11 -2.10466791329e-06 -8.8003602189e-11 -2.25906260182e-06 -8.2921894197e-11 -2.40585462172e-06 -7.44501337925e-11 -2.54456143888e-06 -6.2390072108e-11 -2.6746642597e-06 -4.65797319116e-11 -2.79565446924e-06 -2.69147311289e-11 -2.90737443707e-06 -3.36968486787e-12 -3.00926009997e-06 2.40092159457e-11 -3.10048887137e-06 5.51448263738e-11 -3.18068241152e-06 8.98778264232e-11 -3.24919986878e-06 1.27879566838e-10 -3.30556991771e-06 1.68675575963e-10 -3.34960354409e-06 2.1179282036e-10 2.55882798516e-10 -1.8163196934e-07 -5.93574041565e-12 -3.60204893812e-07 -1.75932690974e-11 -5.34626111375e-07 -2.86691652114e-11 -7.04764086484e-07 -3.88924320804e-11 -8.70473311273e-07 -4.80304882887e-11 -1.03160104053e-06 -5.58545591029e-11 -1.18797780109e-06 -6.21391145634e-11 -1.33941297329e-06 -6.66617386255e-11 -1.48568267524e-06 -6.92038304881e-11 -1.62653259447e-06 -6.95522835233e-11 -1.76166701453e-06 -6.75022646002e-11 -1.89072205984e-06 -6.28613216676e-11 -2.01333632833e-06 -5.54549710077e-11 -2.12904347289e-06 -4.51342960321e-11 -2.2372464289e-06 -3.17854065387e-11 -2.33741332346e-06 -1.53542468752e-11 -2.42966631826e-06 4.15460974236e-12 -2.51373183405e-06 2.67040356358e-11 -2.58878152508e-06 5.22150542649e-11 -2.65442425556e-06 8.05239550041e-11 -2.71012629099e-06 1.11339417159e-10 -2.75534122957e-06 1.44259819395e-10 -2.78998599167e-06 1.78887071856e-10 2.14095023855e-10 -1.44527216011e-07 -4.43540872471e-12 -2.86653634169e-07 -1.31422784365e-11 -4.25510429658e-07 -2.14026696106e-11 -5.6098139508e-07 -2.90061436993e-11 -6.92942046925e-07 -3.57708548117e-11 -8.21261100051e-07 -4.15184979534e-11 -9.45794274801e-07 -4.60739558291e-11 -1.06638051587e-06 -4.92653642532e-11 -1.18282998134e-06 -5.09248236866e-11 -1.29493944839e-06 -5.08898603854e-11 -1.40244167876e-06 -4.90057231319e-11 -1.50507056281e-06 -4.51285940766e-11 -1.60258286945e-06 -3.91297989067e-11 -1.69453332074e-06 -3.09022549511e-11 -1.78016607387e-06 -2.03732355025e-11 -1.85898344409e-06 -7.52369246308e-12 -1.93136657353e-06 7.62832061192e-12 -1.99727735074e-06 2.50545751341e-11 -2.0559688581e-06 4.46828150613e-11 -2.10702522948e-06 6.63665501018e-11 -2.14998444871e-06 8.98665239967e-11 -2.18434079861e-06 1.14862584846e-10 -2.21011222696e-06 1.41039275043e-10 1.67511147885e-10 -1.05635172984e-07 -2.96702388159e-12 -2.09538618444e-07 -8.7891190775e-12 -3.11075293613e-07 -1.43059154251e-11 -4.10152168547e-07 -1.93721881199e-11 -5.06672396686e-07 -2.38617192224e-11 -6.005322594e-07 -2.7651041171e-11 -6.91620396194e-07 -3.06192462244e-11 -7.79808587253e-07 -3.26480959956e-11 -8.64954401592e-07 -3.36226350341e-11 -9.46894109311e-07 -3.34323441897e-11 -1.02541254936e-06 -3.19728120072e-11 -1.10035830861e-06 -2.91479466199e-11 -1.17157982665e-06 -2.48726387968e-11 -1.23873353986e-06 -1.90761402323e-11 -1.30098455699e-06 -1.17146911148e-11 -1.3579781361e-06 -2.78795250767e-12 -1.41026002539e-06 7.67778693626e-12 -1.45775696197e-06 1.96598122898e-11 -1.49987795483e-06 3.31050757612e-11 -1.53629619906e-06 4.7902673821e-11 -1.56663853619e-06 6.38784930001e-11 -1.59048941497e-06 8.08048934133e-11 -1.60792547691e-06 9.84583329781e-11 1.16217743037e-10 -6.47839256643e-08 -1.49782673837e-12 -1.28517229857e-07 -4.43597072458e-12 -1.90809498382e-07 -7.21718937986e-12 -2.51599347774e-07 -9.76640454668e-12 -3.1082371843e-07 -1.20180852104e-11 -3.68414770901e-07 -1.39082529395e-11 -4.24299721035e-07 -1.53743718961e-11 -4.78392873216e-07 -1.63554770405e-11 -5.30604352846e-07 -1.67925330236e-11 -5.80811993853e-07 -1.66291161586e-11 -6.2887962319e-07 -1.58124118418e-11 -6.74715077986e-07 -1.42945100918e-11 -7.18207082263e-07 -1.20338942367e-11 -7.59153623716e-07 -8.99639250722e-12 -7.97110853574e-07 -5.15722737875e-12 -8.32081767961e-07 -5.12736724204e-13 -8.64050628883e-07 4.91185492183e-12 -8.92693417335e-07 1.10898424091e-11 -9.17942331327e-07 1.79933549828e-11 -9.39652378585e-07 2.55670683572e-11 -9.57560921817e-07 3.37175606587e-11 -9.71351832957e-07 4.23215894193e-11 -9.81121403694e-07 5.12599743489e-11 6.02051301236e-11 -2.1922843179e-08 -4.34922067277e-08 -6.45754961379e-08 -8.51509935846e-08 -1.05196385992e-07 -1.24687894522e-07 -1.43599360499e-07 -1.61900449079e-07 -1.79558941048e-07 -1.96527626898e-07 -2.12758194293e-07 -2.28211968561e-07 -2.42836389942e-07 -2.56561267735e-07 -2.6934794731e-07 -2.81317559586e-07 -2.92185610673e-07 -3.01720606679e-07 -3.10078824375e-07 -3.17249844098e-07 -3.23125162466e-07 -3.27566539029e-07 -3.30631503068e-07 -6.01775945142e-07 1.24514461372e-09 5.01301721362e-11 -1.19713538177e-06 3.71113628893e-09 1.4978195015e-10 -1.78297477773e-06 6.12239974654e-09 2.48022737174e-10 -2.35982842542e-06 8.47410394372e-09 3.44892087163e-10 -2.92795693102e-06 1.07682746983e-08 4.40826513273e-10 -3.48760957861e-06 1.30062931929e-08 5.36261118335e-10 -4.03902563207e-06 1.51894407808e-08 6.31657447428e-10 -4.58241019052e-06 1.73188434756e-08 7.27512097759e-10 -5.11793620757e-06 1.93954138755e-08 8.24368346431e-10 -5.64572465497e-06 2.1419812611e-08 9.2283019251e-10 -6.16584418274e-06 2.33924051723e-08 1.02358061237e-09 -6.67829323733e-06 2.53132385997e-08 1.12740260378e-09 -7.18283826963e-06 2.71814753943e-08 1.23520708707e-09 -7.67912660953e-06 2.89952252156e-08 1.34806116961e-09 -8.16697744739e-06 3.07527261989e-08 1.46724998827e-09 -8.64619536139e-06 3.2452530782e-08 1.59438663565e-09 -9.11623951759e-06 3.40920400259e-08 1.73147876605e-09 -9.57604162372e-06 3.56661890342e-08 1.88101336214e-09 -1.00241482602e-05 3.71675035594e-08 2.04610578093e-09 -1.04587554525e-05 3.85866331487e-08 2.23074987516e-09 -1.08775862933e-05 3.9911874822e-08 2.44021168757e-09 -1.1277382226e-05 4.11279544448e-08 2.68136503388e-09 -1.16537983298e-05 4.22154505474e-08 2.96322852074e-09 4.31198741022e-08 3.28072743372e-09 -6.04811319505e-07 2.03019081702e-09 -1.20096834861e-06 6.05073470836e-09 -1.78534543924e-06 9.98119849622e-09 -2.35856179305e-06 1.38134869475e-08 -2.92094945947e-06 1.75512017281e-08 -3.47282624029e-06 2.11968552686e-08 -4.01449370447e-06 2.475279256e-08 -4.5462150533e-06 2.82211021245e-08 -5.06821637501e-06 3.16035440702e-08 -5.58067392889e-06 3.49015108706e-08 -6.08371174357e-06 3.81159595041e-08 -6.57739485331e-06 4.12473510513e-08 -7.06148358646e-06 4.42948058457e-08 -7.53558672134e-06 4.72558651902e-08 -7.99958624998e-06 5.01283189035e-08 -8.45336545252e-06 5.29104681763e-08 -8.89639932989e-06 5.55989213927e-08 -9.32751998097e-06 5.81866562831e-08 -9.74519530359e-06 6.06633507278e-08 -1.01475788776e-05 6.30164742132e-08 -1.05322636895e-05 6.52308299088e-08 -1.08959261176e-05 6.72880111912e-08 -1.12340704445e-05 6.91673077152e-08 7.07779935039e-08 -6.10629608863e-07 1.78018911273e-09 -1.20816647244e-06 5.30499615523e-09 -1.78943419323e-06 8.74895790333e-09 -2.35523077182e-06 1.21044775275e-08 -2.90603841958e-06 1.53747993595e-08 -3.44231814807e-06 1.85621373595e-08 -3.96449972492e-06 2.16685219339e-08 -4.47296789824e-06 2.46957227107e-08 -4.96805841854e-06 2.76451880621e-08 -5.45005254503e-06 3.05180027527e-08 -5.91915758214e-06 3.33147784131e-08 -6.37549644553e-06 3.60355046136e-08 -6.81898913229e-06 3.86794836552e-08 -7.24942686206e-06 4.12453257674e-08 -7.66665303295e-06 4.37308473025e-08 -8.07041216807e-06 4.61329040785e-08 -8.46010520178e-06 4.84470382502e-08 -8.8346617967e-06 5.06672094418e-08 -9.19259765267e-06 5.2785566691e-08 -9.53187839562e-06 5.47917000194e-08 -9.84982188746e-06 5.66731300801e-08 -1.01430122255e-05 5.84172314229e-08 -1.04066267821e-05 6.00123426703e-08 6.13827717762e-08 -6.1595673245e-07 -1.21229627009e-06 -1.78590800343e-06 -2.33783457602e-06 -2.86878111385e-06 -3.37941936375e-06 -3.87037597661e-06 -4.34221710379e-06 -4.79544986319e-06 -5.23051487052e-06 -5.64775564925e-06 -6.04739708247e-06 -6.4296319045e-06 -6.79453506454e-06 -7.14188580966e-06 -7.47130690615e-06 -7.78223719521e-06 -8.0738292967e-06 -8.34477084293e-06 -8.59309115807e-06 -8.81613849487e-06 -9.01066729761e-06 -9.17237051247e-06 -6.15176265116e-07 -1.88308323906e-09 5.37075711415e-11 -1.21075226224e-06 -5.61225647491e-09 1.60392004644e-10 -1.7836700606e-06 -9.25745269279e-09 2.65343326508e-10 -2.33499140252e-06 -1.28112587697e-08 3.68489744202e-10 -2.86544600286e-06 -1.62778797196e-08 4.70220460283e-10 -3.37571084763e-06 -1.96604330025e-08 5.70907223339e-10 -3.86641307587e-06 -2.29618253247e-08 6.70927492838e-10 -4.33811307735e-06 -2.61847124798e-08 7.70664583497e-10 -4.79131140632e-06 -2.93314661353e-08 8.7050825488e-10 -5.22642068728e-06 -3.24041050326e-08 9.70851117303e-10 -5.64376340147e-06 -3.54042044598e-08 1.07208266454e-09 -6.04354250547e-06 -3.83328051808e-08 1.17457463871e-09 -6.42593233424e-06 -4.11903454531e-08 1.27864422043e-09 -6.7909744673e-06 -4.39765609842e-08 1.38454821517e-09 -7.13842270908e-06 -4.66904124852e-08 1.49241176888e-09 -7.46788072517e-06 -4.93299342893e-08 1.60199153017e-09 -7.77877371913e-06 -5.1891689201e-08 1.71251365156e-09 -8.0702460331e-06 -5.43700943125e-08 1.82236638482e-09 -8.34095345787e-06 -5.67563975022e-08 1.92840633432e-09 -8.5889787971e-06 -5.90368578747e-08 2.02476496763e-09 -8.81180036438e-06 -6.11908299799e-08 2.10100713043e-09 -9.00627804584e-06 -6.3189288777e-08 2.13959915361e-09 -9.16827245389e-06 -6.49877229562e-08 2.10987995678e-09 -6.65690770268e-08 1.87634756727e-09 -6.10057749635e-07 -2.13094903371e-09 -1.20702372087e-06 -6.35172978195e-09 -1.78776826765e-06 -1.04795396176e-08 -2.35310241368e-06 -1.45064378676e-08 -2.90352667231e-06 -1.84369683051e-08 -3.43950482879e-06 -2.22745477859e-08 -3.96146896291e-06 -2.60224265032e-08 -4.4697995229e-06 -2.96836401905e-08 -4.96483003364e-06 -3.32609591588e-08 -5.4468231595e-06 -3.67568452922e-08 -5.91597049063e-06 -4.01734081362e-08 -6.3723780921e-06 -4.35124222847e-08 -6.81595091965e-06 -4.67745196564e-08 -7.24645242287e-06 -4.99588267847e-08 -7.66370549966e-06 -5.30649143149e-08 -8.06744114186e-06 -5.60934442899e-08 -8.45705647499e-06 -5.90439126754e-08 -8.83147930074e-06 -6.19124124188e-08 -9.18924287716e-06 -6.46917880459e-08 -9.52835575425e-06 -6.7372509006e-08 -9.8462101984e-06 -6.99415001944e-08 -1.01395132853e-05 -7.23797057822e-08 -1.04034171361e-05 -7.46560261991e-08 -7.67099296222e-08 -6.04443578237e-07 -1.34536996879e-09 -1.20025627274e-06 -4.01065671091e-09 -1.78431491997e-06 -6.61845518975e-09 -2.35724888306e-06 -9.16396685166e-09 -2.91939785425e-06 -1.16501104348e-08 -3.47108505548e-06 -1.40791517386e-08 -4.01261041188e-06 -1.64532936515e-08 -4.54423700309e-06 -1.87746359737e-08 -5.06618748185e-06 -2.10451552718e-08 -5.57863119518e-06 -2.32666867549e-08 -6.08167938886e-06 -2.54409085318e-08 -6.57538965382e-06 -2.75693668418e-08 -7.05950892696e-06 -2.96529802251e-08 -7.53363180783e-06 -3.16918230488e-08 -7.99762362476e-06 -3.36864376493e-08 -8.45136494e-06 -3.56384069706e-08 -8.89432761688e-06 -3.75489567711e-08 -9.32534866649e-06 -3.94175890666e-08 -9.74292335525e-06 -4.12422731646e-08 -1.0145220603e-05 -4.30203965756e-08 -1.05298714784e-05 -4.47487312341e-08 -1.08936482131e-05 -4.64219471032e-08 -1.1231980546e-05 -4.80307384511e-08 -4.95213620145e-08 -6.01643151248e-07 -1.19688918633e-06 -1.78262285313e-06 -2.35938303323e-06 -2.92743138456e-06 -3.48702099587e-06 -4.0383890519e-06 -4.58174103606e-06 -5.11724794896e-06 -5.64502998498e-06 -6.16515064596e-06 -6.67760623502e-06 -7.18215789258e-06 -7.67844927748e-06 -8.1662936714e-06 -8.64549481375e-06 -9.11551143978e-06 -9.57527804198e-06 -1.00233497862e-05 -1.04579307906e-05 -1.08767569129e-05 -1.12765942407e-05 -1.16530747461e-05 -2.1878537685e-08 -1.50209651818e-12 -4.34029297699e-08 -4.4486305256e-12 -6.44425047101e-08 -7.2380508452e-12 -8.49766398861e-08 -9.79537598448e-12 -1.04983515057e-07 -1.20551082424e-11 -1.24439459373e-07 -1.39532995936e-11 -1.43318535308e-07 -1.54274503841e-11 -1.61591345634e-07 -1.64166243529e-11 -1.79225497921e-07 -1.6861806038e-11 -1.9618107059e-07 -1.6706587761e-11 -2.12410498957e-07 -1.5898149449e-11 -2.27865548347e-07 -1.4388567772e-11 -2.42507444005e-07 -1.21362908446e-11 -2.56271542087e-07 -9.1070759385e-12 -2.69090307064e-07 -5.27603312357e-12 -2.81075262034e-07 -6.39400996278e-13 -2.9196283894e-07 4.77777194072e-12 -3.01518546937e-07 1.09491013996e-11 -3.09905148068e-07 1.78470975542e-11 -3.17103346e-07 2.54168970256e-11 -3.23002340233e-07 3.35654479206e-11 -3.27476033254e-07 4.21700954547e-11 -3.30567959805e-07 5.1112346849e-11 6.00636566113e-11 -6.46499985021e-08 -2.97549325429e-12 -1.28248764148e-07 -8.81427536229e-12 -1.90410687386e-07 -1.43474030813e-11 -2.51077740073e-07 -1.94298253565e-11 -3.10187653096e-07 -2.39353885959e-11 -3.6767398685e-07 -2.77406994385e-11 -4.23463191252e-07 -3.07249266466e-11 -4.77473923157e-07 -3.2769895125e-11 -5.29614173935e-07 -3.37606900546e-11 -5.79776389269e-07 -3.35868118271e-11 -6.27831380034e-07 -3.21438336234e-11 -6.73662712956e-07 -2.93356266067e-11 -7.17171629215e-07 -2.50770194381e-11 -7.58163485922e-07 -1.92971393782e-11 -7.96166542385e-07 -1.1952019548e-11 -8.31178577825e-07 -3.04100439993e-12 -8.63197730343e-07 7.41005424575e-12 -8.91907540022e-07 1.93790519313e-11 -9.17235153446e-07 3.28135828354e-11 -9.39038930707e-07 4.76036175164e-11 -9.57026955374e-07 6.35760874392e-11 -9.7089088427e-07 8.05041165375e-11 -9.80751790832e-07 9.81654897333e-11 1.15937269806e-10 -1.05409080602e-07 -4.44800548882e-12 -2.09088121537e-07 -1.31797466176e-11 -3.1040859766e-07 -2.14645180435e-11 -4.09282519397e-07 -2.90920855121e-11 -5.05613802187e-07 -3.5880726358e-11 -5.99300886321e-07 -4.16522633808e-11 -6.90231274231e-07 -4.62317014191e-11 -7.78280606961e-07 -4.9447285096e-11 -8.63307807591e-07 -5.11311698278e-11 -9.45149511753e-07 -5.11209045704e-11 -1.02361452458e-06 -4.92617242496e-11 -1.09852970697e-06 -4.5409734007e-11 -1.16971941323e-06 -3.94361706027e-11 -1.23684681134e-06 -3.12337865613e-11 -1.2990936064e-06 -2.07295271361e-11 -1.35612655663e-06 -7.90377153134e-12 -1.40847230669e-06 7.22621149038e-12 -1.45605488965e-06 2.46329479584e-11 -1.49831220992e-06 4.42454417113e-11 -1.53488658204e-06 6.59183351252e-11 -1.56534891451e-06 8.94129782996e-11 -1.58931459838e-06 1.14411919013e-10 -1.60690263195e-06 1.40601121135e-10 1.67092010568e-10 -1.44205441375e-07 -5.9524397244e-12 -2.86015158391e-07 -1.76429661433e-11 -4.24568739484e-07 -2.87512356491e-11 -5.59755453534e-07 -3.90064873121e-11 -6.9145199392e-07 -4.8176323806e-11 -8.19527568273e-07 -5.60321619898e-11 -9.43837972532e-07 -6.23486682272e-11 -1.06422083467e-06 -6.6903575113e-11 -1.18049260943e-06 -6.94783781778e-11 -1.2924379068e-06 -6.98600101467e-11 -1.39980837379e-06 -6.78436170496e-11 -1.50235258345e-06 -6.32366434693e-11 -1.59978506602e-06 -5.58644199415e-11 -1.69165613464e-06 -4.55777877201e-11 -1.77724322079e-06 -3.2262403783e-11 -1.85607064376e-06 -1.58634513821e-11 -1.92849609286e-06 3.6155215422e-12 -1.99447798174e-06 2.61385225079e-11 -2.0533182539e-06 5.16281710456e-11 -2.10455617731e-06 7.99221403354e-11 -2.14766214453e-06 1.10730835908e-10 -2.18217478865e-06 1.43655346874e-10 -2.20814613974e-06 1.78299398649e-10 2.13533093917e-10 -1.81209607676e-07 -7.51780112767e-12 -3.59369026199e-07 -2.22905620856e-11 -5.33396538585e-07 -3.63508381597e-11 -7.03166150422e-07 -4.93718446389e-11 -8.68533506307e-07 -6.10754340321e-11 -1.02934442773e-06 -7.11869068455e-11 -1.18542872972e-06 -7.94341403086e-11 -1.33659254056e-06 -8.55471124712e-11 -1.48261443368e-06 -8.92584013345e-11 -1.62323630087e-06 -9.03048677245e-11 -1.75815775457e-06 -8.84307364365e-11 -1.88705494477e-06 -8.33922408404e-11 -2.00955633262e-06 -7.49640177016e-11 -2.12516957976e-06 -6.29474170596e-11 -2.23331821819e-06 -4.71798976576e-11 -2.33346634196e-06 -2.75561974484e-11 -2.42571408032e-06 -4.0497199696e-12 -2.50980812095e-06 2.32948690482e-11 -2.5849579098e-06 5.44024879485e-11 -2.65075716734e-06 8.91160186274e-11 -2.70662176663e-06 1.27108973263e-10 -2.75201608281e-06 1.67910069788e-10 -2.7869017567e-06 2.11048529424e-10 2.55170528295e-10 -2.16570573167e-07 -9.16933719556e-12 -4.29446393012e-07 -2.71979476711e-11 -6.37334663405e-07 -4.43882200218e-11 -8.40102122202e-07 -6.03618739245e-11 -1.0375895218e-06 -7.48000671697e-11 -1.2296258063e-06 -8.73863108747e-11 -1.41602108026e-06 -9.78052630708e-11 -1.59655771819e-06 -1.05741721737e-10 -1.77098488922e-06 -1.1088076887e-10 -1.93901209852e-06 -1.12909247891e-10 -2.10030129622e-06 -1.11518825175e-10 -2.25447811825e-06 -1.06410891397e-10 -2.40112063038e-06 -9.73034637779e-11 -2.53972777877e-06 -8.39402461169e-11 -2.66976981426e-06 -6.61016694233e-11 -2.79071630696e-06 -4.36188444875e-11 -2.90238438689e-06 -1.64211698895e-11 -3.00423695801e-06 1.54573146841e-11 -3.09550639585e-06 5.19544820574e-11 -3.17581028779e-06 9.293065897e-11 -3.24447550075e-06 1.38042496646e-10 -3.3010495997e-06 1.86760160163e-10 -3.3453569091e-06 2.38539044469e-10 2.91817803188e-10 -2.50416818666e-07 -1.09284622596e-11 -4.96503640187e-07 -3.2429182548e-11 -7.36766759311e-07 -5.29697204307e-11 -9.71074059459e-07 -7.21250052869e-11 -1.19925791349e-06 -8.95408422231e-11 -1.42113744552e-06 -1.04863539804e-10 -1.63651015285e-06 -1.17738249469e-10 -1.84514308457e-06 -1.2780726515e-10 -2.04676598487e-06 -1.34709567151e-10 -2.24106618817e-06 -1.38081818579e-10 -2.42768151485e-06 -1.37561122638e-10 -2.60620536931e-06 -1.32789836762e-10 -2.7761846527e-06 -1.23422697349e-10 -2.93710995716e-06 -1.09136441742e-10 -3.08845166156e-06 -8.96418849861e-11 -3.22970258774e-06 -6.46977989228e-11 -3.36028845183e-06 -3.41716391305e-11 -3.47956906171e-06 1.94619643891e-12 -3.58689970584e-06 4.36137552447e-11 -3.68169924477e-06 9.07149786407e-11 -3.76326532608e-06 1.4293086619e-10 -3.83130264317e-06 1.99696829814e-10 -3.88542910417e-06 2.60366766056e-10 3.23187551861e-10 -2.82856603261e-07 -1.28126125979e-11 -5.60757309916e-07 -3.80365461914e-11 -8.32017937266e-07 -6.21824508764e-11 -1.0965159989e-06 -8.47835243433e-11 -1.35408220343e-06 -1.05456002982e-10 -1.60453286839e-06 -1.23813977609e-10 -1.84766038358e-06 -1.39467208162e-10 -2.08322455955e-06 -1.5201850978e-10 -2.31094487868e-06 -1.61062422256e-10 -2.53049563179e-06 -1.66185434818e-10 -2.74149958796e-06 -1.66968083746e-10 -2.94352912811e-06 -1.62989329617e-10 -3.13610736324e-06 -1.53833626209e-10 -3.31870633098e-06 -1.39101010632e-10 -3.49076910442e-06 -1.18420578098e-10 -3.65173848457e-06 -9.14671083011e-11 -3.80081195258e-06 -5.80081552654e-11 -3.93740886026e-06 -1.79599641524e-11 -4.06080914853e-06 2.86507846157e-11 -4.17015838477e-06 8.17510192368e-11 -4.26489970847e-06 1.41087908838e-10 -4.34464233435e-06 2.06077271445e-10 -4.40875368697e-06 2.75974395484e-10 3.48856268866e-10 -3.13977324776e-07 -1.4835006685e-11 -6.22383018551e-07 -4.40597757837e-11 -9.23353447632e-07 -7.20931070359e-11 -1.21678370259e-06 -9.84320076742e-11 -1.50250881236e-06 -1.22669471445e-10 -1.78034901303e-06 -1.44392900152e-10 -2.05009882426e-06 -1.63181449872e-10 -2.31151809097e-06 -1.78602097359e-10 -2.5643239727e-06 -1.90207192732e-10 -2.80818523918e-06 -1.97533606926e-10 -3.04271603796e-06 -2.00103717976e-10 -3.26747454363e-06 -1.97428888306e-10 -3.48196347666e-06 -1.89016008212e-10 -3.68562969201e-06 -1.74377686971e-10 -3.8778751712e-06 -1.53046766457e-10 -4.05806565677e-06 -1.24596053908e-10 -4.22541249902e-06 -8.8666613146e-11 -4.37924147141e-06 -4.50681717407e-11 -4.51858359784e-06 6.2246139625e-12 -4.64255265421e-06 6.52022132133e-11 -4.75072200839e-06 1.31689031976e-10 -4.84234104398e-06 2.05098390585e-10 -4.91658745037e-06 2.84637830461e-10 3.68255179154e-10 -3.43843952173e-07 -1.70042697308e-11 -6.81512946627e-07 -5.05250011523e-11 -1.0109767185e-06 -8.27462261045e-11 -1.33215343892e-06 -1.13135089389e-10 -1.64488585133e-06 -1.41268081674e-10 -1.94900500506e-06 -1.66712036548e-10 -2.24431434435e-06 -1.89021324802e-10 -2.53058016197e-06 -2.07731679424e-10 -2.80752429125e-06 -2.2235640191e-10 -3.0748166443e-06 -2.32384286043e-10 -3.33206818952e-06 -2.37278849002e-10 -3.57882805994e-06 -2.36480262862e-10 -3.81458227762e-06 -2.29410765935e-10 -4.03875353296e-06 -2.15484138591e-10 -4.25070717593e-06 -1.94120188106e-10 -4.44975752242e-06 -1.64765055064e-10 -4.63516826396e-06 -1.26917288187e-10 -4.80597563198e-06 -8.02410920962e-11 -4.96111808622e-06 -2.45961481599e-11 -5.09981232046e-06 4.0088504692e-11 -5.22149170297e-06 1.13737324956e-10 -5.32515783701e-06 1.95805511888e-10 -5.40987477193e-06 2.8548832379e-10 3.8066136461e-10 -3.7249694732e-07 -1.93240226861e-11 -7.38231392834e-07 -5.74432612663e-11 -1.09502737774e-06 -9.41617543837e-11 -1.44282330931e-06 -1.28924662871e-10 -1.78146435958e-06 -1.61298232988e-10 -2.11080391333e-06 -1.90835050556e-10 -2.43066124608e-06 -2.17072696323e-10 -2.74081330428e-06 -2.39521375909e-10 -3.04099397489e-06 -2.57659442185e-10 -3.33088094841e-06 -2.70930843437e-10 -3.61008712518e-06 -2.78741042321e-10 -3.87815734343e-06 -2.80456656201e-10 -4.13456508844e-06 -2.75409092088e-10 -4.37871170532e-06 -2.62902391456e-10 -4.60992914949e-06 -2.42226820887e-10 -4.82748755816e-06 -2.12679524412e-10 -5.03061264565e-06 -1.73592943481e-10 -5.21817343342e-06 -1.2441827214e-10 -5.38916972972e-06 -6.4841305498e-11 -5.54269912402e-06 5.29551412012e-12 -5.67792053943e-06 8.60667709796e-11 -5.79380944495e-06 1.77043324384e-10 -5.88936252134e-06 2.77440614184e-10 3.85146405776e-10 -3.99927579626e-07 -2.17890718433e-11 -7.92541266151e-07 -6.48019956447e-11 -1.17557456428e-06 -1.06327741524e-10 -1.54892287304e-06 -1.45796504114e-10 -1.91240261118e-06 -1.82762912817e-10 -2.26593611153e-06 -2.16772054533e-10 -2.60936582056e-06 -2.47360007837e-10 -2.94247323248e-06 -2.74017791782e-10 -3.26501658126e-06 -2.9619264057e-10 -3.57668922367e-06 -3.13290201136e-10 -3.87710990553e-06 -3.24661036161e-10 -4.16582415048e-06 -3.29597566586e-10 -4.44229764546e-06 -3.27335989774e-10 -4.70591424829e-06 -3.17060862891e-10 -4.95597598257e-06 -2.97916515979e-10 -5.19170589022e-06 -2.69026684588e-10 -5.41225585015e-06 -2.29525415764e-10 -5.61654316003e-06 -1.78605282975e-10 -5.80347249725e-06 -1.15703023636e-10 -5.97181872742e-06 -4.0497145339e-11 -6.1206527319e-06 4.72759229356e-11 -6.24889326203e-06 1.47388091696e-10 -6.35556237287e-06 2.59137382412e-10 3.80543950014e-10 -4.26219818826e-07 -2.4400768783e-11 -8.44587370241e-07 -7.26025230414e-11 -1.25273047265e-06 -1.19232263436e-10 -1.65049235013e-06 -1.63709765635e-10 -2.03772618303e-06 -2.05600064574e-10 -2.41447509687e-06 -2.44462090574e-10 -2.78054098339e-06 -2.79837198396e-10 -3.13567829454e-06 -3.11192053954e-10 -3.47971778235e-06 -3.37947414383e-10 -3.81238100233e-06 -3.59487980311e-10 -4.13328800289e-06 -3.75115638445e-10 -4.44199224258e-06 -3.84049222796e-10 -4.73795606092e-06 -3.85428700173e-10 -5.02055273301e-06 -3.7831172427e-10 -5.28906109011e-06 -3.61681669975e-10 -5.54266848108e-06 -3.34463004619e-10 -5.78047553068e-06 -2.95549259635e-10 -6.00145878492e-06 -2.43845171727e-10 -6.20423439828e-06 -1.78455299292e-10 -6.38741821618e-06 -9.87706773813e-11 -6.55006935653e-06 -4.29829860813e-12 -6.69086058304e-06 1.05074328492e-10 -6.80895587087e-06 2.28874580758e-10 3.65393180561e-10 -4.51486618664e-07 -2.71462811994e-11 -8.94539795716e-07 -8.08036432191e-11 -1.3265914388e-06 -1.32804107474e-10 -1.74758415619e-06 -1.82570084679e-10 -2.157510018e-06 -2.29704739939e-10 -2.5564534446e-06 -2.73790208405e-10 -2.94414053088e-06 -3.14368028982e-10 -3.32036175435e-06 -3.50898984556e-10 -3.68506172617e-06 -3.82799977728e-10 -4.03793458733e-06 -4.09439192605e-10 -4.37859487291e-06 -4.30067559928e-10 -4.70663371917e-06 -4.43840201125e-10 -5.02150975759e-06 -4.49809055415e-10 -5.32259577985e-06 -4.4690064978e-10 -5.60915408886e-06 -4.33927151282e-10 -5.8803447775e-06 -4.09591346211e-10 -6.13522598322e-06 -3.72510698252e-10 -6.37272687945e-06 -3.21256305067e-10 -6.59131050378e-06 -2.54485053139e-10 -6.78960107072e-06 -1.71171289453e-10 -6.96642519443e-06 -7.05341612777e-11 -7.12017156608e-06 4.80103326618e-11 -7.24999201187e-06 1.84448927873e-10 3.3770689425e-10 -4.75616799452e-07 -2.99965105269e-11 -9.42209310184e-07 -8.932256594e-11 -1.39703579142e-06 -1.46922423123e-10 -1.84021122512e-06 -2.0223539631e-10 -2.27179575191e-06 -2.54906167545e-10 -2.69181367251e-06 -3.04542859319e-10 -3.10005126578e-06 -3.50704681182e-10 -3.49642741727e-06 -3.92883839915e-10 -3.88089808285e-06 -4.30509925359e-10 -4.2531393552e-06 -4.62918269383e-10 -4.61282853992e-06 -4.89326875277e-10 -4.95954038954e-06 -5.08850675315e-10 -5.29272673401e-06 -5.20449456456e-10 -5.61179315608e-06 -5.22926553205e-10 -5.91598577201e-06 -5.14924133628e-10 -6.20444832901e-06 -4.94904976439e-10 -6.47619486813e-06 -4.61177428943e-10 -6.73007810628e-06 -4.11925077889e-10 -6.96462075175e-06 -3.45277190244e-10 -7.17834644403e-06 -2.59604164745e-10 -7.36969992864e-06 -1.53655997146e-10 -7.5368333008e-06 -2.63325995885e-11 -7.67850216927e-06 1.23095621794e-10 2.94883394372e-10 -4.98490195093e-07 -3.29273370591e-11 -9.87401778081e-07 -9.80884261556e-11 -1.46387896945e-06 -1.6146834953e-10 -1.92814859954e-06 -2.22530533728e-10 -2.38028231062e-06 -2.80967870121e-10 -2.82030217958e-06 -3.36433529487e-10 -3.24813347104e-06 -3.88531642373e-10 -3.66374574311e-06 -4.36796926056e-10 -4.06701623e-06 -4.80679357162e-10 -4.45772940474e-06 -5.19513685401e-10 -4.83564168807e-06 -5.52517671913e-10 -5.20028778462e-06 -5.78757640259e-10 -5.55117469409e-06 -5.97113158697e-10 -5.88768588225e-06 -6.06289918945e-10 -6.20905330336e-06 -6.04754301584e-10 -6.51444168563e-06 -5.90726849862e-10 -6.80283584612e-06 -5.62184577441e-10 -7.07304587416e-06 -5.16862967635e-10 -7.32369244836e-06 -4.52321421163e-10 -7.5531193848e-06 -3.66135158237e-10 -7.75944421089e-06 -2.56289206342e-10 -7.94036050451e-06 -1.21096615695e-10 -8.09386327594e-06 4.12968142738e-11 2.3358489615e-10 -5.20079765421e-07 -3.59062101587e-11 -1.03005775898e-06 -1.07003297907e-10 -1.52697038764e-06 -1.76278433786e-10 -2.01111906209e-06 -2.43228805215e-10 -2.48262905513e-06 -3.07606861559e-10 -2.94160190895e-06 -3.6912773571e-10 -3.38803907809e-06 -4.27458943388e-10 -3.82188817054e-06 -4.82182815816e-10 -4.24303370146e-06 -5.32786424975e-10 -4.65134825724e-06 -5.78651275686e-10 -5.04658177419e-06 -6.19021653143e-10 -5.42835597622e-06 -6.5294981546e-10 -5.79624047126e-06 -6.79279235424e-10 -6.14956715121e-06 -6.96603444004e-10 -6.487613422e-06 -7.03219966122e-10 -6.80952103769e-06 -6.97129694052e-10 -7.11425010486e-06 -6.75959112119e-10 -7.40065234863e-06 -6.36957164773e-10 -7.66742578089e-06 -5.770317372e-10 -7.91290593122e-06 -4.92846192223e-10 -8.13494605211e-06 -3.81315942582e-10 -8.33048953288e-06 -2.39950807649e-10 -8.49565180401e-06 -6.54102077471e-11 1.49275524959e-10 -5.40315530328e-07 -3.88895348173e-11 -1.0700359643e-06 -1.15936969691e-10 -1.58609177674e-06 -1.91137144888e-10 -2.0888280663e-06 -2.6402999275e-10 -2.57849175552e-06 -3.34439671014e-10 -3.0553344703e-06 -4.02166488231e-10 -3.51931539418e-06 -4.66964434504e-10 -3.97033678884e-06 -5.28465033365e-10 -4.40837355197e-06 -5.86204403699e-10 -4.83333515284e-06 -6.39628355452e-10 -5.24501791155e-06 -6.88042440683e-10 -5.64312227784e-06 -7.30568691803e-10 -6.02717750843e-06 -7.66059008377e-10 -6.39659372722e-06 -7.93040333236e-10 -6.75070308988e-06 -8.09699319569e-10 -7.08858143722e-06 -8.13793171849e-10 -7.40921491117e-06 -8.02582865116e-10 -7.71150879991e-06 -7.72819270644e-10 -7.99423450344e-06 -7.20665803397e-10 -8.25600452268e-06 -6.41770794525e-10 -8.49491650579e-06 -5.31661642576e-10 -8.70790289888e-06 -3.8708949863e-10 -8.88354715875e-06 -2.0274670433e-10 3.59583549811e-11 -5.5911658154e-07 -4.18284076129e-11 -1.10718213282e-06 -1.24743116234e-10 -1.64103611931e-06 -2.05802788284e-10 -2.16107176918e-06 -2.84604660821e-10 -2.66765664344e-06 -3.6106098069e-10 -3.16115867458e-06 -4.35055302902e-10 -3.64148761061e-06 -5.06421427465e-10 -4.10853160719e-06 -5.74878270447e-10 -4.56232220398e-06 -6.40056301015e-10 -5.0028691768e-06 -7.01486450102e-10 -5.43011156025e-06 -7.5857287995e-10 -5.84368679548e-06 -8.10542715085e-10 -6.24307674862e-06 -8.56284975497e-10 -6.62781530034e-06 -8.943705131e-10 -6.99720944128e-06 -9.22991972039e-10 -7.35034814213e-06 -9.39736333962e-10 -7.68626584127e-06 -9.41544963114e-10 -8.00382404308e-06 -9.24612412559e-10 -8.30187184987e-06 -8.84231364781e-10 -8.57943613734e-06 -8.14802908403e-10 -8.83600913612e-06 -7.09632814567e-10 -9.06405231514e-06 -5.64210303788e-10 -9.24586214066e-06 -3.73414892559e-10 -1.12007024765e-10 -5.76420976586e-07 -4.46747966349e-11 -1.14137486782e-06 -1.33276718032e-10 -1.69163898293e-06 -2.20029988583e-10 -2.22770877209e-06 -3.04598780486e-10 -2.74995358167e-06 -3.86991868413e-10 -3.25870218099e-06 -4.67174992969e-10 -3.75398661688e-06 -5.45065512478e-10 -4.23580710588e-06 -6.20512179777e-10 -4.70419866156e-06 -6.93284134426e-10 -5.15926369007e-06 -7.63037282972e-10 -5.60101114751e-06 -8.29300823751e-10 -6.02900205724e-06 -8.91422440305e-10 -6.44279426836e-06 -9.48409441979e-10 -6.84202291814e-06 -9.98962877327e-10 -7.22590717943e-06 -1.04139176943e-09 -7.59351014396e-06 -1.07327759418e-09 -7.94384837026e-06 -1.09141305988e-09 -8.27569782832e-06 -1.09159612787e-09 -8.58779795112e-06 -1.06825994105e-09 -8.87892921127e-06 -1.01441348914e-09 -9.1485657899e-06 -9.21211121875e-10 -9.38136642942e-06 -7.80022602019e-10 -9.57169406471e-06 -5.83942727635e-10 -2.98828927065e-10 -5.92152555539e-07 -4.73750771391e-11 -1.1724583222e-06 -1.41375958543e-10 -1.73764148722e-06 -2.33544504267e-10 -2.28829693728e-06 -3.23613602591e-10 -2.82476937327e-06 -4.11689366923e-10 -3.34735392464e-06 -4.97838278674e-10 -3.85624225301e-06 -5.82091435276e-10 -4.35156542532e-06 -6.64429304628e-10 -4.83339774409e-06 -7.44765866223e-10 -5.30183695243e-06 -8.22925104026e-10 -5.75684739542e-06 -8.98603019279e-10 -6.19807040775e-06 -9.71315619244e-10 -6.62522176955e-06 -1.04031516677e-09 -7.03795248361e-06 -1.10454127652e-09 -7.43539120432e-06 -1.16249450372e-09 -7.81657753272e-06 -1.21191999824e-09 -8.18049828205e-06 -1.24970973234e-09 -8.52572309159e-06 -1.27160768465e-09 -8.85059085713e-06 -1.27160141808e-09 -9.15296356735e-06 -1.24152377159e-09 -9.42994493509e-06 -1.17072627225e-09 -9.66809066858e-06 -1.0458274947e-09 -9.87725801773e-06 -8.52432706214e-10 -5.41827029904e-10 -6.06208371434e-07 -4.98709782698e-11 -1.2002292558e-06 -1.48865816294e-10 -1.77873094691e-06 -2.46053574654e-10 -2.34237557625e-06 -3.41237909771e-10 -2.89153712142e-06 -4.34625736071e-10 -3.42655257686e-06 -5.2639070115e-10 -3.94769323834e-06 -6.16683924454e-10 -4.45516408924e-06 -7.05623238216e-10 -4.94910656038e-06 -7.93280132062e-10 -5.42959925488e-06 -8.79659550273e-10 -5.89659489015e-06 -9.64670466382e-10 -6.34988871047e-06 -1.04808167971e-09 -6.78926440799e-06 -1.12945708286e-09 -7.21431562787e-06 -1.20808610337e-09 -7.62421082449e-06 -1.28284019101e-09 -8.01804989229e-06 -1.35190507637e-09 -8.39473796216e-06 -1.41254889768e-09 -8.75266401369e-06 -1.46073866235e-09 -9.08985905372e-06 -1.4905673194e-09 -9.40363045401e-06 -1.49334219075e-09 -9.6902102549e-06 -1.4566222087e-09 -9.94364811066e-06 -1.3630864168e-09 -1.01714667256e-05 -1.18920139683e-09 -8.58921711706e-10 -6.18630181857e-07 -5.21156081275e-11 -1.22475783427e-06 -1.55603562946e-10 -1.81499974058e-06 -2.5731304662e-10 -2.39008308148e-06 -3.57117609175e-10 -2.95042863973e-06 -4.55323373377e-10 -3.49642005196e-06 -5.52210955186e-10 -4.02838423611e-06 -6.48052392638e-10 -4.5465814168e-06 -7.43105956102e-10 -5.05120265555e-06 -8.37608797144e-10 -5.5423528488e-06 -9.3176428769e-10 -6.02002915266e-06 -1.02572198168e-09 -6.48409607476e-06 -1.11954478829e-09 -6.93439090438e-06 -1.21314774205e-09 -7.37057747527e-06 -1.30628999529e-09 -7.79187236077e-06 -1.39843573093e-09 -8.19733271203e-06 -1.48842781197e-09 -8.58578711065e-06 -1.57427080262e-09 -8.95565937257e-06 -1.65273781861e-09 -9.30489936954e-06 -1.71867713217e-09 -9.63071890493e-06 -1.76382200873e-09 -9.92983430196e-06 -1.77512157876e-09 -1.01988052044e-05 -1.73193791502e-09 -1.04374982285e-05 -1.60079276447e-09 -1.26004986188e-09 -6.27058337505e-07 -1.24142628428e-06 -1.83968034174e-06 -2.42260833547e-06 -2.99067518064e-06 -3.54430518484e-06 -4.083869856e-06 -4.6096759215e-06 -5.12196290496e-06 -5.62087877279e-06 -6.10646486908e-06 -6.57862189379e-06 -7.03728386746e-06 -7.48223192831e-06 -7.91270768914e-06 -8.32776107701e-06 -8.72628273214e-06 -9.10681885497e-06 -9.46729712922e-06 -9.80495069853e-06 -1.01163823982e-05 -1.03975624461e-05 -1.06447846442e-05 ) ; boundaryField { frontAndBack { type empty; } top { type calculated; value uniform 0; } inlet { type calculated; value uniform 0; } outlet { type calculated; value uniform 0; } floatingObject { type calculated; value nonuniform List<scalar> 32 ( 3.99824433258e-06 2.97038938954e-06 1.82838404811e-06 6.16114933166e-07 4.87244898809e-06 5.55940816143e-06 6.03272239698e-06 6.27420249399e-06 6.27456850772e-06 6.03380637258e-06 5.56116844225e-06 4.87481792755e-06 4.00113089358e-06 2.9736826434e-06 1.8319574367e-06 6.19831133237e-07 -4.00113089366e-06 -2.97368264332e-06 -1.8319574367e-06 -6.19831133237e-07 -4.87481792755e-06 -5.56116844234e-06 -6.03380637249e-06 -6.27456850773e-06 -6.274202494e-06 -6.03272239697e-06 -5.55940816143e-06 -4.87244898809e-06 -3.99824433258e-06 -2.97038938954e-06 -1.82838404811e-06 -6.16114933166e-07 ) ; } bottom { type calculated; value uniform 0; } } // ************************************************************************* //
b85289d9ce8fa0e73c2d660ee614b6f19718c014
b058f3303d5e4977c5f632499015dcac591e13cd
/src/disks/NativeFs.cpp
d1a7434bce684eba9567d9a327593dd334db2078
[]
no_license
linuxforum5/c1541usb
a0978bf38c6c523b76d0eff6904f27a3013e34f0
6a35bea60c78aec4b726db648a9245a79514b3f1
refs/heads/main
2023-06-01T00:33:55.294144
2023-01-14T16:28:53
2023-01-14T16:28:53
586,044,976
0
0
null
null
null
null
UTF-8
C++
false
false
6,455
cpp
#include "NativeFs.hpp" #include <iostream> #include <cstring> #include <dirent.h> #include <sys/stat.h> // #include <filesystem> // C++17 // namespace fs = std::filesystem using namespace std; NativeFs::NativeFs( Config *conf ) : Disk( conf ) { file = NULL; string path = config->get_media(); if ( FILE* f = fopen( path.append( "/" ).append( ".label" ).c_str(), "r" ) ) { diskLabel = file_get_contents( f ); fclose( f ); } printf( "Directory %s mounted as a disk\n", media_path.c_str() ); } NativeFs::~NativeFs() { closeFile(); } bool NativeFs::is_dir( string filename ) { struct stat s; if ( stat( filename.c_str(), &s ) == 0 ) { if( s.st_mode & S_IFDIR ) { return true; //it's a directory } else if( s.st_mode & S_IFREG ) { return false; //it's a file } else { return false; //something else } } else { return false; //error } } string NativeFs::file_get_contents( FILE* f ) { int size = get_file_size( f ); char buff[ size+1 ]; buff[ size ] = 0; fread( buff, size, 1, f ); return buff; } bool NativeFs::valid_filename( string filename ) { int len = filename.length(); if ( len > 4 ) { return CBM::fn2cbm( filename.substr( len-4 ).c_str() ) == ".PRG"; } else return false; } bool NativeFs::isDiskWriteProtected() { return false; } int NativeFs::getFilesCounter() { int cnt = 0; struct dirent *entry = nullptr; DIR *dp = nullptr; dp = opendir( media_path.c_str() ); if ( dp != nullptr ) { while ( ( entry = readdir(dp) ) ) { if ( valid_filename( entry->d_name ) ) cnt++; } } closedir(dp); return cnt; } Disk::FileEntry NativeFs::getCbmFileEntry( int i ) { FileEntry fe = { "", "", 0 }; struct dirent *entry = nullptr; DIR *dp = nullptr; dp = opendir( media_path.c_str() ); if ( dp != nullptr ) { int cnt = 0; while ( !fe.size && ( entry = readdir(dp) ) ) { if ( valid_filename( entry->d_name ) ) { if ( cnt++ == i ) { int len = strlen( entry->d_name ); string basename = string(entry->d_name).substr( 0, len-4 ); string type = string(entry->d_name).substr( len-3 ); fe.filename = CBM::fn2cbm( basename.c_str() ); fe.type3 = CBM::fn2cbm( type.c_str() ); fe.size = get_file_size_from_name( media_path, entry->d_name ) - 2; // .PRG file is bigger with 2 bytes than CBM file } } } } closedir(dp); return fe; } bool NativeFs::filename_match( ByteArray sfilename, string cbm_name ) { int slen = sfilename.length(); if ( slen > 0 ) { if ( sfilename.at( slen-1 ) == '*' ) { slen--; string sprefix = sfilename.mid( 0, -1 ).to_string(); string cbm_prefix = cbm_name.substr( 0, slen ); return sprefix == cbm_prefix; } else { return sfilename.to_string() == cbm_name; } } else { return false; } } ByteArray NativeFs::seek( ByteArray sfilename ) { string realFilename = ""; struct dirent *entry = nullptr; DIR *dp = nullptr; dp = opendir( media_path.c_str() ); if ( dp != nullptr ) { int cnt = 0; while ( ( realFilename.length() == 0 ) && ( entry = readdir(dp) ) ) { if ( valid_filename( entry->d_name ) ) { int len = strlen( entry->d_name ); string cbm_name = CBM::fn2cbm( string(entry->d_name).substr( 0, len-4 ).c_str() ); if ( filename_match( sfilename, cbm_name ) ) { realFilename = string( entry->d_name); } } } } closedir(dp); return realFilename; } CBM::IOErrorMessage NativeFs::openFile( ByteArray sfilename, OpenMode mode ) { ByteArray realFilename; if ( mode == READ || mode == OVERWRITE ) { printf( "Search for file pattern '%s'\n", sfilename.c_str() ); realFilename = seek( sfilename ); printf( "Found file '%s' (length=%d)\n", realFilename.c_str(), realFilename.length() ); } else { realFilename = sfilename; realFilename.append( ".PRG" ); } if ( realFilename.length() ) { string ffn = media_path; const char* fn = ffn.append("/").append( realFilename.to_string() ).c_str(); bool overwrite = false; switch( mode ) { case OVERWRITE : overwrite = true; case CREATE : return open_as( fn, "wb", realFilename ); break; case READ : return open_as( fn, "rb", realFilename ); break; } return CBM::ErrUnknownError; } else { return CBM::ErrFileNotFound; } } CBM::IOErrorMessage NativeFs::open_as( const char* fn, const char* mode, ByteArray realFilename ) { if ( file = fopen( fn, mode ) ) { opened.filename = CBM::fn2cbm( realFilename.mid( 0, -4 ).c_str() ); opened.type3 = CBM::fn2cbm( realFilename.mid( -3 ).c_str() ); opened.size = get_file_size( file ); return CBM::ErrOK; } else return CBM::ErrUnknownError; } unsigned short NativeFs::get_file_size( FILE* file ) { unsigned short size = 0; fseek( file, 0L, SEEK_END ); size = ftell( file ); fseek( file, 0L, SEEK_SET ); return size; } unsigned short NativeFs::get_file_size_from_name( string path, string name ) { if ( FILE *f = fopen( path.append("/").append( name ).c_str(), "rb" ) ) { unsigned short size = get_file_size( f ); fclose( f ); return size; } else { return 0; } } void NativeFs::write( ByteArray data ) { const unsigned char* d = data.uc_str(); printf( "**** Write %d bytes into file\n", data.length() ); fwrite( d, data.length(), 1, file ); } void NativeFs::closeFile() { Disk::closeFile(); if ( file != NULL ) { fclose( file ); file = NULL; } } int NativeFs::openedFilePosPercent() { return 100 * ftell( file ) / opened.size; } unsigned char NativeFs::getc() { if ( isEOF() ) { return 0; } else { return (unsigned char)fgetc( file ); } } bool NativeFs::isEOF() { return ftell( file ) >= opened.size; } Disk::FileEntry NativeFs::getOpenedFileEntry() { return opened; }
4847d9340e4eb540673d761713d2efdc96b7f244
a3d658dd8b2d65df1e9ed8a6c88611fed84cec44
/Arrays/ReplaceWithProductOfEveryOtherWithoutDivision/ReplaceWithProductOfEveryOtherWithoutDivision02.cpp
7b39db2928e7b7a28100ce3d30b145ab5f44ea30
[]
no_license
XoDeR/AlgoRecap2017
acfeb81e8def939f780cf213a0edb3d906083ab2
8f43d98c3f1c8638238a72f75383cdfe1578b734
refs/heads/master
2020-05-24T22:10:45.144970
2017-07-14T15:54:29
2017-07-14T15:54:29
84,885,439
0
0
null
null
null
null
UTF-8
C++
false
false
938
cpp
#include<iostream> using namespace std; // Function to replace each element of the array with product // of every other element without using division operator void findProduct(int arr[], int n) { // use two auxiliary arrays int left[n], right[n]; // left[i] stores the product of all elements in the sub-array[0..i-1] left[0] = 1; for (int i = 1; i < n; i++) left[i] = arr[i - 1] * left[i - 1]; // right[i] stores the product of all elements in sub-array[i+1..n-1] right[n - 1] = 1; for (int j = n - 2; j >= 0; j--) right[j] = arr[j + 1] * right[j + 1]; // replace each element with product of its left and right sub-array for (int i = 0; i < n; i++) arr[i] = left[i] * right[i]; } // main function int main() { int arr[] = { 5, 3, 4, 2, 6, 8 }; int n = sizeof(arr) / sizeof(arr[0]); findProduct(arr, n); // print the modified array for (int i = 0; i < n; i++) cout << arr[i] << " "; return 0; }
262862d691dbd6401d65b205b3a0dc1cc18373f1
7e6e45fc43fcfaf3a7ac84197a6629ea0215a138
/1929.cpp
80525ab487509cef09005e4a333817ab27a3d831
[]
no_license
calm-lab/online-judge
cb2719c010480c833caa169977db9e19d091236f
92da8776fec4d7835f9b6e6eb0b034c63709b356
refs/heads/master
2023-06-09T09:03:31.080759
2021-06-29T06:52:55
2021-06-29T06:52:55
371,567,818
1
0
null
null
null
null
UTF-8
C++
false
false
449
cpp
#include <iostream> using namespace std; int main(){ int m ,n; cin >> m >> n; bool check[n+1]; fill_n(check, n+1, false); check[0] = check[1] = true; for(int i = 2; i*i <= n; i++){ if(check[i] == false){ for(int j = i*2; j <= n; j+=i){ check[j] = true; } } } for(int i = m; i <= n; i++){ if(check[i]== false) cout << i << '\n'; } }
3ace2f8ddf4bcebef0a5fb77cfbfc391d5fa8def
8f2072a14ebea37f7e087d5d49b48f75a9672472
/test/mem_leak_more.cc
afc87c4ba25a757d1b9b88a720bc62e45b36c55d
[]
no_license
victoriv/prefetcher
2f8de50dfc71a0129e94846a867b0da4f10fd156
5f349a5583a285079c838196756d13fd578a132f
refs/heads/master
2021-01-20T06:57:31.611687
2015-04-09T16:40:04
2015-04-09T16:40:04
29,853,947
0
2
null
null
null
null
UTF-8
C++
false
false
724
cc
/* * Prefetcher with a large memory leak. */ #include <stdlib.h> #include <stdio.h> #define __STDC_FORMAT_MACROS #include <inttypes.h> #include "interface.hh" void prefetch_init(void) {} AccessStat* old_stat = NULL; void prefetch_access(AccessStat stat) { if (old_stat) { Addr address = stat.mem_addr + (stat.mem_addr - old_stat->mem_addr); if (address <= MAX_PHYS_MEM_ADDR) issue_prefetch(address); else printf("Skipped issue to %" PRIx64 "\n", address); } old_stat = (AccessStat*) malloc(sizeof(stat) * 1024); if (old_stat) *old_stat = stat; else fprintf(stderr, "Could not allocate! :(\n"); } void prefetch_complete(Addr addr) {}
6e8c87c8c5f0f8647306ae303edfb70b0ef2b928
fdec7f06a1ea7cad0544c0e07a3c9d2d516da667
/Estudiante.h
c78279eea8ae8235dfe1392da3440a414ba7fbba
[]
no_license
carlosvelaquez/Examen2P3_CarlosVelasquez
e26b36709711ee409da511ff8c0dd0be3e163c53
ee171e3e959beb3ca7a0e72ffb1c23b08b9f13e3
refs/heads/master
2021-07-01T07:14:06.159926
2017-09-23T02:02:16
2017-09-23T02:02:16
104,509,888
0
0
null
null
null
null
UTF-8
C++
false
false
480
h
#pragma once #include "Ciudadano.h" #include "Maestro.h" #include "Lista.h" class Estudiante : public Ciudadano{ private: float promedio; string homeroom; Maestro* maestroGuia; public: Estudiante(); Estudiante(string, string, float, string, string, string, string, string, float, string, Maestro*); float getPromedio(); string getHomeroom(); Maestro* getMaestroGuia(); void setPromedio(float); void setHomeroom(string); void setMaestroGuia(Maestro*); };
b718be915aa829928f2c3751740c54e0cf4b409d
c9c16ccbc6c8acf02599a5831b629b4c71cdbe56
/lagrangian.cpp
37c0c40b002f3e92efba200297c68aa0de1bf450
[ "Apache-2.0" ]
permissive
AustinLBuchanan/kmedian
dd499b7612b84c99f1dae44e9874d586c6ed3b05
f714c92459c33851baf8be631ddbea28c45138a8
refs/heads/master
2020-07-18T06:21:00.786989
2019-09-20T21:24:28
2019-09-20T21:24:28
206,196,110
5
0
null
null
null
null
UTF-8
C++
false
false
7,656
cpp
#include "models.h" #include "ralg.h" #include <algorithm> // used for sorting #include <queue> // priority queue used for B&B double solve_Lagrangian_relaxation(const vector<vector<int> > &c, int k) { int n = int(c[0].size()); bbnode b; b.alpha = new double[n]; for (int i = 0; i < n; ++i) b.alpha[i] = 1.; // whatever b.F = vector<int>(n, -1); vector<bool> bestS; int branchvar; return solve_Lagrangian_relaxation(c, k, b, bestS, branchvar); } double solve_Lagrangian_relaxation(const vector<vector<int> > &c, int k, bbnode &b, vector<bool> &bestS, int &branchvar) { double LB = -INFINITY; int n = int(c[0].size()); vector<double> C(n, 0); vector<vector<double>> c_bar(n, vector<double>(n)); vector<bool> S(n); // boolean representation of the current solution (just the medians) double * bestAlpha = new double[n]; auto cb_grad_func = [&c, k, &C, &c_bar, &S, &LB, n, &bestS, &b, &branchvar](const double* alpha, double& f_val, double* grad) { // compute L(F_0,F_1,alpha) for fixed alpha solveInnerProblem(alpha, k, c, c_bar, C, grad, f_val, S, b.F, branchvar); if (f_val > LB) { LB = f_val; bestS = S; } return true; }; ralg_options opt = defaultOptions; opt.is_monotone = false; if (count(b.F.begin(), b.F.end(), -1) == n) // root node { opt.itermax = 1000; opt.output_iter = 100; } else // not the root node { opt.itermax = 200; opt.output = false; } // lower bound from lagrangian LB = ralg(&opt, cb_grad_func, n, b.alpha, bestAlpha, RALG_MAX); delete[] bestAlpha; return LB; } void solveInnerProblem(const double* alpha, int k, const vector<vector<int>>& c, vector<vector<double>>& c_bar, vector<double>& C, double* grad, double& f_val, vector<bool>& S, const vector<int> &F, int &branchvar) { int n = int(c[0].size()); // reset medians for (int i = 0; i < n; ++i) S[i] = false; // update c_bar for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) c_bar[i][j] = c[i][j] - alpha[i]; // recompute C_j, the contribution to objective of opening facility j for (int j = 0; j < n; ++j) { C[j] = c_bar[j][j]; for (int i = 0; i < n; ++i) if (i != j && c_bar[i][j] < 0) C[j] += c_bar[i][j]; } // select k smallest vector<int> C_indices(C.size()); for (size_t i = 0; i < C.size(); ++i) C_indices[i] = i; std::sort(C_indices.begin(), C_indices.end(), [&C, &F](int i1, int i2) { if (F[i1] == F[i2]) return C[i1] < C[i2]; if (F[i1] == 1) return true; if (F[i2] == 0) return true; return false; }); // compute inner problem function value (f_val) f_val = 0.; for (int i = 0; i < n; ++i) f_val += alpha[i]; for (int j = 0; j < k; ++j) { int v = C_indices[j]; f_val += C[v]; S[v] = true; } // find variable to branch on next branchvar = -1; for (int j = k - 1; j >= 0; --j) { int v = C_indices[j]; if (F[v] != 1) branchvar = v; } // compute subgradient for (int i = 0; i < n; ++i) { grad[i] = 1.; for (int j = 0; j < k; ++j) if (i == C_indices[j] || c_bar[i][C_indices[j]] < 0) grad[i] -= 1; } } double obj(const vector<vector<int>> &c, const vector<bool> &S, int k) { if (count(S.begin(), S.end(), true) != k) return DBL_MAX; double objval = 0; int n = int(c[0].size()); vector<int> intS; // cost to assign S -> S for (int i = 0; i < n; ++i) { if (S[i]) { intS.push_back(i); objval += c[i][i]; } } // cost to assign V\S -> S for (int i = 0; i < n; ++i) { if (S[i]) continue; double minval = DBL_MAX; for (int p = 0; p < k; ++p) { int j = intS[p]; if (c[i][j] < minval) minval = c[i][j]; } objval += minval; } return objval; } void solve_kMedian_with_Lagrangian(const vector<vector<int> > &c, int k) { int n = int(c[0].size()); auto cmp = [](pair<double, bbnode> left, pair<double, bbnode> right) { return left.first < right.first; }; priority_queue< pair<double, bbnode>, vector <pair<double, bbnode>>, decltype(cmp) > B(cmp); // construct root node and add to BB tree bbnode rootnode; rootnode.sizeF0 = 0; rootnode.sizeF1 = 0; rootnode.F.resize(n, -1); rootnode.alpha = new double[n]; for (int i = 0; i < n; ++i) rootnode.alpha[i] = 1.; // whatever B.push(make_pair(0., rootnode)); // 0 is just a placeholder. doesn't matter for root node. // perform BB vector<bool> S; // feasible solution obtained from current BB node vector<bool> bestS; // best feasible solution found so far (just the medians) double UB = DBL_MAX; // objective value of bestS int nodesExplored = 0; int nodesTotal = 1; int nodesSaved = 0; while (!B.empty()) { bbnode b = B.top().second; B.pop(); if (b.parentLB > UB) { nodesSaved++; continue; // this can be pruned without computing new lagrangian bound } nodesExplored++; // compute a lower bound, from Lagrangian double LB = solve_Lagrangian_relaxation(c, k, b, S, b.branchvar); double tempUB = obj(c, S, k); if (tempUB < UB) { bestS = S; UB = tempUB; } if (nodesExplored == 1) { cout << "\t" << " #BB nodes" << "\t" << endl; cout << "\t" << "expl" << "\t" << "total" << "\t" << "L(parent)" << "\t" << "L(F0,F1)" << "\t" << "UB" << "\t" << "|F0|" << "\t" << "|F1|" << "\t" << "obj(S)" << endl; cout << "\t" << nodesExplored << "\t" << nodesTotal << "\t" << "NA" << "\t\t" << LB << "\t\t" << UB << "\t" << b.sizeF0 << "\t" << b.sizeF1 << "\t" << tempUB << endl; } else cout << "\t" << nodesExplored << "\t" << nodesTotal << "\t" << b.parentLB << "\t\t" << LB << "\t\t" << UB << "\t" << b.sizeF0 << "\t" << b.sizeF1 << "\t" << tempUB << endl; if (LB < UB && b.branchvar>=0) { int v = b.branchvar; // do variable fixing? // TODO // create left branch bbnode leftbranch; leftbranch.parentLB = LB; leftbranch.sizeF0 = b.sizeF0 + 1; leftbranch.sizeF1 = b.sizeF1; leftbranch.F = b.F; leftbranch.F[v] = 0; // fix x_vv = 0 leftbranch.alpha = new double[n]; for (int i = 0; i < n; ++i) leftbranch.alpha[i] = b.alpha[i]; // create right branch bbnode rightbranch; rightbranch.parentLB = LB; rightbranch.sizeF0 = b.sizeF0; rightbranch.sizeF1 = b.sizeF1 + 1; rightbranch.F = b.F; rightbranch.F[v] = 1; // fix x_vv = 1 rightbranch.alpha = new double[n]; for (int i = 0; i < n; ++i) rightbranch.alpha[i] = b.alpha[i]; // add branches to B B.push(make_pair(-LB, leftbranch)); // best bound (estimated, based on parent) B.push(make_pair(-LB, rightbranch)); //int depth = b.sizeF0 + b.sizeF1 + 1; //B.push(make_pair(-depth, leftbranch)); // breadth first search //B.push(make_pair(-depth, rightbranch)); //B.push(make_pair(depth, leftbranch)); // depth first search //B.push(make_pair(depth, rightbranch)); //B.push(make_pair(LB, leftbranch)); // worst bound (estimated, based on parent) //B.push(make_pair(LB, rightbranch)); //B.push(make_pair(rand(), leftbranch)); // random search //B.push(make_pair(rand(), rightbranch)); nodesTotal += 2; } } cout << "Final BB solution : "; for (int i = 0; i < n; ++i) if (bestS[i]) cout << i << " "; cout << " has objective value " << UB << " ?= " << obj(c, bestS, k) << endl; cout << "Visited this many BB nodes = " << nodesExplored << endl; cout << "Created this many BB nodes = " << nodesTotal << endl; cout << "Avoided Lagrangian at this many BB nodes = " << nodesSaved << endl; return; }
e17f010d4734093b320b7baafa978da5bb2b9b37
6ce049ad0073d7d5e14efde081c94d9432a15d35
/Yan/icpc/2961.cpp
4cfee89275a4cce428edc7b68eaebacc5135ae52
[]
no_license
yancouto/maratona-sua-mae
0f1377c2902375dc3157e6895624e198f52151e0
75f5788f981b3baeb6488bbf3483062fa355c394
refs/heads/master
2020-05-31T03:26:21.233601
2016-08-19T03:28:22
2016-08-19T03:28:37
38,175,020
6
2
null
null
null
null
UTF-8
C++
false
false
621
cpp
#include <bits/stdc++.h> using namespace std; #define fst first #define snd second typedef unsigned long long ull; typedef long long ll; typedef pair<int, int> pii; #define pb push_back #define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++) template<typename T> inline T abs(T t) { return t < 0? -t : t; } const ll modn = 1000000007; inline ll mod(ll x) { return x % modn; } int main() { while(scanf("%d %d", &n, &m) != EOF && n) { for(i = 0; i < n; i++) adj[i].clear(); for(i = 0; i < m; i++) { scanf("%d %d %d", &a, &b, &w); adj[a].pb(pii(b, w)); adj[b].pb(pii(a, w)); } } }
b19f439f3403a33b6ee1dbf6e134620abfb947f5
b052456d9797e2fe5c4118b576fcce24f8bfe1dc
/client/systems/gunStore/dialog/gunshop_settings.hpp
b7573270fa5f7c3480bb546491f1b99274074f2f
[]
no_license
DN1993/DayZUK-Wasteland-2.5
952da01973669af44bc155788a8c98704475cee8
46fde2651617cb96ced39e9c9e3343ea57f0f84f
refs/heads/master
2021-01-19T07:13:17.090717
2012-12-27T20:24:38
2012-12-27T20:24:38
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,098
hpp
#include "gunstoreDefines.sqf" class gunshopd { idd = gunshop_DIALOG; movingEnable = true; enableSimulation = true; onLoad = "[0] execVM 'client\systems\gunStore\populateGunStore.sqf'"; class controlsBackground { class MainBackground: RscPicture { idc = -1; text = "\ca\ui\data\ui_background_controlers_ca.paa"; x = 0.1875 * safezoneW + safezoneX; y = 0.15 * safezoneH + safezoneY; w = 0.837499 * safezoneW; h = 0.661111 * safezoneH; }; class ItemSelectedPicture: RscPicture { idc = gunshop_gun_pic; text = ""; x = 0.502604 * safezoneW + safezoneX; y = 0.236111 * safezoneH + safezoneY; w = 0.0891668 * safezoneW; h = 0.0753702 * safezoneH; }; class ItemSelectedInfo: RscStructuredText { idc = gunshop_gun_Info; text = ""; x = 0.440104 * safezoneW + safezoneX; y = 0.50463 * safezoneH + safezoneY; w = 0.214166 * safezoneW; h = 0.192963 * safezoneH; }; class ItemSelectedPrice: RscStructuredText { idc = gunshop_gun_TEXT; text = ""; x = 0.502604 * safezoneW + safezoneX; y = 0.317594 * safezoneH + safezoneY; w = 0.0891667 * safezoneW; h = 0.068889 * safezoneH; }; class DialogTitleText: RscText { idc = -1; text = "Gun Store Menu"; x = 0.203125 * safezoneW + safezoneX; y = 0.175 * safezoneH + safezoneY; w = 0.0844792 * safezoneW; h = 0.0448148 * safezoneH; }; class PlayerMoneyText: RscText { idc = gunshop_money; text = "Cash:"; x = 0.6875 * safezoneW + safezoneX; y = 0.175 * safezoneH + safezoneY; w = 0.0844792 * safezoneW; h = 0.0448148 * safezoneH; }; class CartTotalText: RscText { idc = gunshop_total; text = "Total: $0"; x = 0.6875 * safezoneW + safezoneX; y = 0.65 * safezoneH + safezoneY; w = 0.0844792 * safezoneW; h = 0.0448148 * safezoneH; }; }; class controls { class SelectionList: RscListbox { idc = gunshop_gun_list; onLBSelChanged = "[] execvm 'client\systems\gunStore\weaponInfo.sqf'"; x = 0.3125 * safezoneW + safezoneX; y = 0.225 * safezoneH + safezoneY; w = 0.0916666 * safezoneW; h = 0.422222 * safezoneH; }; class CartList: RscListbox { idc = gunshop_cart; onLBSelChanged = "[] execvm 'client\systems\gunStore\weaponInfo.sqf'"; x = 0.690104 * safezoneW + safezoneX; y = 0.225 * safezoneH + safezoneY; w = 0.0916666 * safezoneW; h = 0.422222 * safezoneH; }; class AddToCart: w_RscButton { idc = -1; onButtonClick = "[] execVM 'client\systems\gunStore\addToCart.sqf'"; text = "Add"; x = 0.515625 * safezoneW + safezoneX; y = 0.375 * safezoneH + safezoneY; w = 0.065 * safezoneW; h = 0.040 * safezoneH; }; class RemoveFromCart: w_RscButton { idc = -1; onButtonClick = "[] execVM 'client\systems\gunStore\removeFromCart.sqf'"; text = "Remove"; x = 0.515625 * safezoneW + safezoneX; y = 0.425 * safezoneH + safezoneY; w = 0.065 * safezoneW; h = 0.040 * safezoneH; }; class BuyToCrate: w_RscButton { idc = -1; onButtonClick = "[1] execVM 'client\systems\gunStore\buyGuns.sqf'"; text = "Buy to Crate"; x = 0.609375 * safezoneW + safezoneX; y = 0.750 * safezoneH + safezoneY; w = 0.088 * safezoneW; h = 0.040 * safezoneH; color[] = {0.1,0.95,0.1,1}; }; class BuyToPlayer: w_RscButton { idc = -1; onButtonClick = "[0] execVM 'client\systems\gunStore\buyGuns.sqf'"; text = "Buy to Player"; x = 0.703125 * safezoneW + safezoneX; y = 0.750 * safezoneH + safezoneY; w = 0.088 * safezoneW; h = 0.040 * safezoneH; color[] = {0.1,0.95,0.1,1}; }; class BuySellEquipment: w_RscButton { idc = -1; onButtonClick = "[] execVM 'client\systems\gunStore\sellWeapon.sqf'"; text = "Sell Current Weapon"; x = 0.40625 * safezoneW + safezoneX; y = 0.750 * safezoneH + safezoneY; w = 0.096 * safezoneW; h = 0.040 * safezoneH; }; class CancelButton: w_RscButton { idc = -1; onButtonClick = "closeDialog 0;"; text = "Cancel"; x = 0.203125 * safezoneW + safezoneX; y = 0.750 * safezoneH + safezoneY; w = 0.072 * safezoneW; h = 0.040 * safezoneH; color[] = {0.95,0.1,0.1,1}; }; class StoreButton0: w_RscButton { idc = -1; onButtonClick = "[0] execVM 'client\systems\gunStore\populateGunStore.sqf'"; text = "Weapons"; x = 0.203125 * safezoneW + safezoneX; y = 0.225 * safezoneH + safezoneY; w = 0.088 * safezoneW; h = 0.040 * safezoneH; }; class StoreButton1: w_RscButton { idc = -1; onButtonClick = "[1] execVM 'client\systems\gunStore\populateGunStore.sqf'"; text = "Ammunition"; x = 0.203125 * safezoneW + safezoneX; y = 0.275 * safezoneH + safezoneY; w = 0.088 * safezoneW; h = 0.040 * safezoneH; }; class StoreButton2: w_RscButton { idc = -1; onButtonClick = "[2] execVM 'client\systems\gunStore\populateGunStore.sqf'"; text = "Equipment"; x = 0.203125 * safezoneW + safezoneX; y = 0.325 * safezoneH + safezoneY; w = 0.088 * safezoneW; h = 0.040 * safezoneH; }; }; };
577550c595ebe5e74d2be03016aa4d5b2a4e9931
711e5c8b643dd2a93fbcbada982d7ad489fb0169
/XPSP1/NT/ds/ese98/src/inc/daeconst.hxx
0aa896c42a5c7eceeb604a57f7e8da8a86564910
[]
no_license
aurantst/windows-XP-SP1
629a7763c082fd04d3b881e0d32a1cfbd523b5ce
d521b6360fcff4294ae6c5651c539f1b9a6cbb49
refs/heads/master
2023-03-21T01:08:39.870106
2020-09-28T08:10:11
2020-09-28T08:10:11
null
0
0
null
null
null
null
UTF-8
C++
false
false
11,659
hxx
const CPG cpgDatabaseMin = 256; // File Size - cpgDBReserved (ie. true db min = cpgDatabaseMin+cpgDBReserved) const PGNO pgnoSystemRoot = 1; const OBJID objidSystemRoot = 1; const CHAR szOn[] = "on"; const CHAR szTempDir[] = "temp"szPathDelimiter; const CHAR szPatExt[] = ".pat"; // patch file const CHAR szLogExt[] = ".log"; // log file const CHAR szChkExt[] = ".chk"; // checkpoint file const CHAR szSLVExt[] = ".stm"; // streaming data const CHAR szRestoreMap[] = "restore.map"; const CHAR szAtomicNew[] = "new"; const CHAR szAtomicOld[] = "old"; const CHAR szLogRes1[] = "res1"; const CHAR szLogRes2[] = "res2"; const LONG lGenerationMaxDuringRecovery = 0xfffff; const LONG lGenerationMax = lGenerationMaxDuringRecovery - 16; // same some logs for recovery-undo const CHAR szRestoreInstanceName[] = "Restore"; /* the number of pages in the Long Value tree of each table /**/ const INT cpgLVTree = 1; // number of pages in initial SLV space tree const INT cpgSLVAvailTree = 32; // number of pages in initial SLV space map tree const INT cpgSLVOwnerMapTree = 32; // SLV defrag defaults const LONG lSLVDefragFreeThresholdDefault = 20; // chunks whose free % is >= this will be allocated from const LONG lSLVDefragMoveThresholdDefault = 5; // chunks whose free % is <= this will be relocated // preread constants const CPG cpgPrereadSequential = 1024; // number of pages to preread in a table opened sequentially const CPG cpgPrereadPredictive = 16; // number of pages to preread if we guess we are prereading const LONG cbSequentialDataPrereadThreshold = 64 * 1024; /* default density /**/ const ULONG ulFILEDefaultDensity = 80; // 80% density const ULONG ulFILEDensityLeast = 20; // 20% density const ULONG ulFILEDensityMost = 100; // 100% density const DWORD dwCounterMax = 0xffffff00; const QWORD qwCounterMax = 0xffffffffffffff00; /* Engine OBJIDs: /* /* 0..0x10000000 reserved for engine use, divided as follows: /* /* 0x00000000..0x0000FFFF reserved for TBLIDs under RED /* 0x00000000..0x0EFFFFFF reserved for TBLIDs under BLUE /* 0x0F000000..0x0FFFFFFF reserved for container IDs /* 0x10000000 reserved for ObjectId of DbObject /* /* Client OBJIDs begin at 0x10000001 and go up from there. /**/ const OBJID objidNil = 0x00000000; const OBJID objidRoot = 0x0F000000; const OBJID objidTblContainer = 0x0F000001; const OBJID objidDbContainer = 0x0F000002; const OBJID objidDbObject = 0x10000000; const OBJID objidFDPMax = dwCounterMax; const OBJID objidFDPThreshold = 0xf0000000; const _TCHAR szVerbose[] = _T( "BLUEVERBOSE" ); const CHAR szNull[] = ""; /* transaction level limits /**/ const LEVEL levelMax = 11; // all level < 11 const LEVEL levelUserMost = 7; // max for user const LEVEL levelMin = 0; /* Start and max waiting period for WaitTillOldest /**/ const ULONG ulStartTimeOutPeriod = 20; const ULONG ulMaxTimeOutPeriod = 6000; /* 6 seconds */ /* Version store bucket size (used to be in ver.hxx) /**/ const INT cbBucket = 65536; // number of bytes in a bucket /* default resource / parameter settings /**/ const LONG cpageDbExtensionDefault = 256; const LONG cpageSEDefault = 16; const LONG cpibDefault = 16; const LONG cfucbDefault = 1024; const LONG cfcbDefault = 300; const LONG cscbDefault = 20; const LONG csecLogBufferDefault = 128; // UNDONE: should really be OSMemoryPageReserveGranularity() (expressed in sectors) const LONG csecLogFileSizeDefault = 5120; const LONG cbucketDefault = 1 + ( 1024 * 1024 - 1 ) / cbBucket; // 1MB of version store const LONG cpageTempDBMinDefault = 0; const LONG lLogFlushPeriodDefault = 45; const LONG lPageFragmentDefault = 8; const LONG lCacheSizeMinDefault = 1; const LONG lCacheSizeDefault = 512; const LONG lCheckpointDepthMaxDefault = 20 * 1024 * 1024; const LONG lLRUKCorrIntervalDefault = 128000; const LONG lLRUKHistoryMaxDefault = 1024; const LONG lLRUKPolicyDefault = 2; const LONG lLRUKTimeoutDefault = 100; const LONG lStartFlushThresholdPercentDefault = 1; const LONG lStopFlushThresholdPercentDefault = 2; const LONG lStartFlushThresholdDefault = lCacheSizeDefault * lStartFlushThresholdPercentDefault / 100; const LONG lStopFlushThresholdDefault = lCacheSizeDefault * lStopFlushThresholdPercentDefault / 100; const LONG cbEventHeapMaxDefault = 0; const LONG cpgBackupChunkDefault = 16; const LONG cBackupReadDefault = 8; const BOOL fSLVProviderEnabledDefault = fFalse; #define wszSLVProviderRootPathDefault L"\\SLV" const LONG cbPageHintCacheDefault = 256 * 1024; /* system resource requirements /**/ const LONG cpibSystemFudge = 32; // OLD,OLDSLV,TTMAPS all use PIBs. This should be enough const LONG cpibSystem = 5 + cpibSystemFudge; // RCEClean, LV tree creation, backup, callback, sentinel const LONG cthreadSystem = 5; // RCEClean, LGFlush, BFIO, BFClean, perf const LONG cbucketSystem = 2; /* minimum resource / parameter settings are defined below: /**/ const LONG lLogBufferMin = csecLogBufferDefault; const LONG lLogFileSizeMin = 128; // UNDONE: should really be a multiple of OSMemoryPageReserveGranularity() (expressed in k) /* maximum resource / parameter settings are defined below: /**/ const LONG cpibMax = 32767 - cpibSystem; // limited by sync library /* wait time for latch/crit conflicts /**/ const ULONG cmsecWaitGeneric = 100; const ULONG cmsecWaitWriteLatch = 10; const ULONG cmsecWaitLogFlush = 1; const ULONG cmsecWaitIOComplete = 10; const ULONG cmsecAsyncBackgroundCleanup = 30000; // 30 sec const ULONG cmsecWaitForBackup = 300000; // 5 min const ULONG cmsecWaitOLDSLVConflict = 10000; // 10 sec #ifdef RTM const ULONG csecOLDMinimumPass = 3600; // 1 hr #else const ULONG csecOLDMinimumPass = 300; // 5 min #endif /* initial thread stack sizes /**/ const ULONG cbBFCleanStack = 16384; const LONG lPrereadMost = 64; // the number of bytes used to store the length of a key const INT cbKeyCount = sizeof(USHORT); const INT cbPrefixOverhead = cbKeyCount; // the number of bytes used to store the number of segments in a key const INT cbKeySegmentsCount = sizeof(BYTE); // the number of instance supported const ULONG cMaxInstances = 0x0400; const ULONG cMaxInstancesSingleInstanceDefault = 1; const ULONG cMaxInstancesMultiInstanceDefault = 16; const ULONG cMaxDatabasesPerInstance = 0xf0; // UNDONE: if we go any higher, need to change DBID from a byte const ULONG cMaxDatabasesPerInstanceDefault = 7; const ULONG cMaxDatabasesPerProcess = cMaxDatabasesPerInstance * cMaxInstances; const DBID dbidTemp = 0; const DBID dbidMin = 0; const DBID dbidUserLeast = 1; #ifdef UNLIMITED_DB const DBID dbidMax = (DBID)cMaxDatabasesPerInstance; const DBID dbidMask = 0xff; // no need for mask, remove this when UNLIMITED_DB is permanently on #else const DBID dbidMax = 7; const DBID dbidMask = 0x7f; // WARNING: if increasing dbidMax, consider #endif // impact on cbAttach and whether it will be // enough to accommodate all attachments const IFMP ifmpNil = 0x7fffffff; // UNDONE: should be using this as a sentinel value instead of ifmpMax const IFMP ifmpSLV = ((IFMP)1) << (sizeof(IFMP)*CHAR_BIT - 1); // flag or'ed with the true ifmp const IFMP ifmpMask = ifmpSLV - 1; // mask and'ed with the ifmp to find the true ifmp // Lock ranks const int rankDBGPrint = 0; // // NOTE: ranks 1-9 are reserved for SFS! // #if defined( DEBUG ) && defined( MEM_CHECK ) const int rankCALGlobal = 10; #endif // DEBUG && MEM_CHECK const int rankCritOLDSFS = 10; const int rankRES = 10; const int rankVERPerf = 10; const int rankLGResFiles = 10; const int rankLGWaitQ = 10; const int rankPIBCursors = 10; const int rankTrxOldest = 10; const int rankIntegGlobals = 10; const int rankRepairOpts = 10; const int rankUpgradeOpts = 10; const int rankCritSLVSPACENODECACHE = 20; const int rankCallbacks = 20; const int rankOLDTaskq = 20; const int rankBucketGlobal = 20; const int rankLGBuf = 20; const int rankLGTrace = 21; const int rankBFDUI = 23; const int rankBFDepend = 24; const int rankBFHash = 25; const int rankFCBRCEList = 26; const int rankFCBHash = 29; const int rankFCBSXWL = 30; const int rankDDLDML = 30; const int rankCATHash = 35; const int rankPIBLogDeferBeginTrx = 40; const int rankFCBList = 40; const int rankFILEUnverCol = 50; const int rankFILEUnverIndex = 50; const int rankFCBCreate = 50; const int rankFMP = 60; const int rankBFOB0 = 65; const int rankBFFMPContext = 66; const int rankBFLRUK = 70; const int rankFMPDetaching = 75; const int rankFMPGlobal = 80; const int rankBFParm = 90; const int rankPIBGlobal = 90; const int rankRCEChain = 100; const int rankBFLatch = 1000; const int rankIO = 1000; ///const int rankRCEChain = 2000; const int rankBegin0Commit0 = 5000; const int rankPIBTrx = 6000; const int rankLVCreate = 7000; const int rankIndexingUpdating = 8000; const int rankSLVFileTable = 8500; const int rankTTMAP = 9000; const int rankOLD = 9000; const int rankRCEClean = 9000; const int rankBackupInProcess = 9600; const int rankCheckpoint = 10000; const int rankLGFlush = 11000; const int rankFMPSLVSpace = 12000; const int rankAPI = 13000; const int rankOSSnapshot = 13500; const int rankInstance = 14000; const int rankRestoreInstance = 14100; extern char const *szRES; #if defined( DEBUG ) && defined( MEM_CHECK ) extern char const *szCALGlobal; #endif // DEBUG && MEM_CHECK extern char const *szCritOLDSFS; extern char const *szPIBGlobal; extern char const *szCheckpoint; extern char const *szCritCallbacks; extern char const *szLGBuf; extern char const *szLGTrace; extern char const *szLGResFiles; extern char const *szLGWaitQ; extern char const *szLGFlush; extern char const *szOLDTaskq; extern char const *szFCBCreate; extern char const *szFCBList; extern char const *szFCBSXWL; extern char const *szFCBRCEList; extern char const *szFMPSLVSpace; extern char const *szFMPGlobal; extern char const *szFMP; extern char const *szFMPDetaching; extern char const *szDBGPrint; extern char const *szRCEClean; extern char const *szBucketGlobal; extern char const *szRCEChain; extern char const *szPIBTrx; extern char const *szPIBCursors; extern char const *szPIBLogDeferBeginTrx; extern char const *szVERPerf; extern char const *szLVCreate; extern char const *szTrxOldest; extern char const *szFILEUnverCol; extern char const *szFILEUnverIndex; extern char const *szInstance; extern char const *szAPI; extern char const *szBegin0Commit0; extern char const *szIndexingUpdating; extern char const *szDDLDML; extern char const *szTTMAP; extern char const *szIntegGlobals; extern char const *szRepairOpts; extern char const *szUpgradeOpts; extern char const *szCritSLVSPACENODECACHE; extern char const *szBFDUI; extern char const *szBFHash; extern char const *szBFLRUK; extern char const *szBFOB0; extern char const *szBFFMPContext; extern char const *szBFLatch; extern char const *szBFDepend; extern char const *szBFParm; extern char const *szRestoreInstance;
49ef697d7cf5151e51b33f7b7d306ecb86ff23a4
a03a7935a191d63bee76fd3b85a61ee27f98904a
/src/avt/Queries/Queries/avtTotalLengthQuery.h
1c30d2ab908abceacb4afaa604c9f04164a8bcd9
[]
no_license
cchriste/visit
57091c4a512ab87efd17c64c7494aa4cf01b7e53
c72c413f571e56b52fb7221955219f11f4ba19e3
refs/heads/master
2020-04-12T06:25:27.458132
2015-10-12T15:41:49
2015-10-12T15:41:49
10,111,791
5
1
null
null
null
null
UTF-8
C++
false
false
3,415
h
/***************************************************************************** * * Copyright (c) 2000 - 2015, Lawrence Livermore National Security, LLC * Produced at the Lawrence Livermore National Laboratory * LLNL-CODE-442911 * All rights reserved. * * This file is part of VisIt. For details, see https://visit.llnl.gov/. The * full copyright notice is contained in the file COPYRIGHT located at the root * of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html. * * 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 disclaimer below. * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the disclaimer (as noted below) in the * documentation and/or other materials provided with the distribution. * - Neither the name of the LLNS/LLNL 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 LAWRENCE LIVERMORE NATIONAL SECURITY, * LLC, THE U.S. DEPARTMENT OF ENERGY 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. * *****************************************************************************/ // ************************************************************************* // // avtTotalLengthQuery.h // // ************************************************************************* // #ifndef AVT_TOTAL_LENGTH_QUERY_H #define AVT_TOTAL_LENGTH_QUERY_H #include <query_exports.h> #include <avtSummationQuery.h> class avtEdgeLength; // **************************************************************************** // Class: avtTotalLengthQuery // // Purpose: // A query for total length. // // Programmer: Hank Childs // Creation: November 3, 2006 // // **************************************************************************** class QUERY_API avtTotalLengthQuery : public avtSummationQuery { public: avtTotalLengthQuery(); virtual ~avtTotalLengthQuery(); virtual const char *GetType(void) { return "avtTotalLengthQuery"; }; virtual const char *GetDescription(void) { return "Total length"; }; protected: virtual void VerifyInput(void); virtual avtDataObject_p ApplyFilters(avtDataObject_p); avtEdgeLength *length_expr; }; #endif
[ "bonnell@18c085ea-50e0-402c-830e-de6fd14e8384" ]
bonnell@18c085ea-50e0-402c-830e-de6fd14e8384
e78b2d9de23de91bae5cc1028e540341a60a4324
f634fbe8a13d56bf7f52c12a21a02622af43cd40
/pol_implementation.cpp
375cb463fc34447fe9846e1ab37936834fb0d52b
[]
no_license
DDUC-CS-Sanjeet/polynomial-implementation-bvaid128
24b138349ded2e3aa3a8c71b16f276b9e709c281
92c391b828698c033c5093cf316865c17304ead3
refs/heads/master
2020-12-21T05:42:37.143450
2020-01-27T18:18:32
2020-01-27T18:18:32
236,327,501
0
0
null
null
null
null
UTF-8
C++
false
false
4,182
cpp
#include<iostream> using namespace std; class Polynomial { private: // Variables to store information about polynomial int coeffecient[10]; int degree; public: Polynomial() { // Behavior of default constructor degree = 0; } Polynomial(int d) { // Behavior of constructor with arguments degree = d; } ~Polynomial() // destructor not required { // Behavior of destructor //cout<<"\nDestructing"; } // Overload copy constructor, +, - and = operators Polynomial operator + (Polynomial const &obj){ //overloading '+' operator Polynomial temp; int small; if(this->degree > obj.degree){ temp.degree = this->degree; small = obj.degree; }else{ temp.degree = obj.degree; small = this->degree; } for(int i=temp.degree;i>=0;i--){ if(i<=small){ temp.coeffecient[i] = obj.coeffecient[i] + this->coeffecient[i]; }else{ if(this->degree > obj.degree){ temp.coeffecient[i] = this->coeffecient[i]; }else{ temp.coeffecient[i] = obj.coeffecient[i]; } } } return temp; } Polynomial operator - (Polynomial const &obj){ //overloading '-' operator Polynomial temp; int small; if(this->degree > obj.degree){ temp.degree = this->degree; small = obj.degree; }else{ temp.degree = obj.degree; small = this->degree; } for(int i=temp.degree;i>=0;i--){ if(i<=small){ temp.coeffecient[i] = this->coeffecient[i] - obj.coeffecient[i] ; }else{ if(this->degree > obj.degree){ temp.coeffecient[i] = this->coeffecient[i]; }else{ temp.coeffecient[i] = -obj.coeffecient[i]; } } } return temp; } void operator = (Polynomial const &obj){ //overloading '=' operator this->degree = obj.degree; for(int i=obj.degree;i>=0;i--){ this->coeffecient[i] = obj.coeffecient[i]; } } // overloading ends here void storePolynomial() { // Code to enter and store polynomial for(int i=degree;i>=0;i--){ if(i==0){ cout<<"Enter The Value Of Constant : " ; cin>>coeffecient[i]; }else{ cout<<"Enter The Coffecient of X^"<<i<<" : "; cin>>coeffecient[i]; } } } void display() { // Code to print the polynomial in readable format for(int i=degree,j=0;i>=0;i--){ if(coeffecient[i]!=0){ if(j>0&&coeffecient[i]>0) cout<<"+"; if(i==1){ if(coeffecient[i]!=1){ cout<<coeffecient[i]<<"x"; j++; }else{ cout<<"x"; j++; } }else if(i!=0){ if(coeffecient[i]!=1){ cout<<coeffecient[i]<<"x^"<<i; j++; }else{ cout<<"x^"<<i; j++; } }else{ cout<<coeffecient[i]; j++; } } } } }; //class ends here int main() //driver code { int degFirst, degSecond; // Ask user to input the values of degFirst and degSecond cout<<"Enter The degree of first polynomial : "; cin>>degFirst; cout<<"Enter The Degree of second polynomial : ";; cin>>degSecond; Polynomial firstPolynomial(degFirst); Polynomial secondPolynomial(degSecond); Polynomial thirdPolynomial; cout<<"\nEnter The Coeffecient of 1st Polynomial :-\n"; firstPolynomial.storePolynomial(); cout<<"\nEnter The Coeffecient of 2nd Polynomial :-\n"; secondPolynomial.storePolynomial(); thirdPolynomial=firstPolynomial+secondPolynomial; Polynomial fourthPolynomial=firstPolynomial-secondPolynomial; cout<<"\n1st Polynomial : "; firstPolynomial.display(); cout<<"\n2nd Polynomial : "; secondPolynomial.display(); cout<<"\nAfter Adding 1st And 2nd Polynomial : "; thirdPolynomial.display(); cout<<"\nAfter Subtracting 2nd polynomial from 1st : "; fourthPolynomial.display(); Polynomial fifthPolynomial(0); fifthPolynomial = fourthPolynomial; cout<<"\n\nfifthPolynomial (Checking working of = operator) : "; fifthPolynomial.display(); return 0; } //main ends here
7f7227f7cbe3cef44047f3bac30eb63ad523b143
1f6b3b3ea3d29d384e9e061667153f6faa4d00fa
/Vehicle.h
7ff4d0743e6160f2ddb5a6a8ac906ff608b9cbd2
[]
no_license
daoleviethoang/lthdt-18CLC6-18127101
b82a156b15c0b8324dcbc49d9f301f87af004b0b
daeee67ee01c232bd1851d0737b7f7dd0633b811
refs/heads/master
2023-01-11T10:33:55.579385
2019-07-24T14:49:40
2019-07-24T14:49:40
189,795,912
0
0
null
null
null
null
UTF-8
C++
false
false
382
h
#pragma once #include<conio.h> #include<iostream> #include<string> #include<vector> using namespace std; class Vehicle { private: double Weight; double AmountofFuel; double LengthofKm; public: Vehicle(); void AddWeight(); void RemoveWeight(); void AddFuel(); double VehicleRun(); double getFuel(); double getWeight(); double getAmountofFuel(); double getLengthofKm(); };
0a46260e566e36c9041efde6e9439a43d2bc0c14
49045d9e849d7121a32b00a54ca4d161a0325ce0
/week_06_images_and_video/assignments/frameBufferSlitScan/WORKED/frameBufferSlitScan/src/ofApp.cpp
974283f1ec4363772b02d24745265ccd9512bb4b
[]
no_license
mn3007/creativeCoding
accbf1ce8dfcec64942d207cf69b3524f268aee7
40d3e07f947265f1c341a03f59932d2e88cae54a
refs/heads/master
2021-06-07T18:31:48.139959
2016-11-15T12:03:27
2016-11-15T12:03:27
73,809,646
2
0
null
null
null
null
UTF-8
C++
false
false
2,559
cpp
#include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup(){ ofBackground(0); vidGrabber.setDeviceID(0); vidGrabber.setDesiredFrameRate(60); imgWidth = 320; imgHeight = 240; vidGrabber.initGrabber(imgWidth, imgHeight); slitWidth = 1; maxBufferSize = ofGetWidth()/slitWidth; } //-------------------------------------------------------------- void ofApp::update(){ vidGrabber.update(); if (vidGrabber.isFrameNew()) { ofImage img; img.allocate(imgWidth, imgHeight, OF_IMAGE_COLOR); img.setFromPixels(vidGrabber.getPixels()); img.mirror(false, true); imgBuffer.push_front(img); } if (imgBuffer.size()>maxBufferSize) imgBuffer.pop_back(); } //-------------------------------------------------------------- void ofApp::draw(){ if (imgBuffer.size()>0) { imgBuffer[0].draw(0, 0); int slitLocX = imgBuffer[0].getWidth()/2 - slitWidth/2; ofSetColor(255,0,0); ofRect(slitLocX, 0, slitWidth, imgBuffer[0].getHeight()); ofSetColor(255); for (int x=0; x<imgBuffer.size(); x++) { int locX = x*slitWidth; imgBuffer[x].drawSubsection(locX, ofGetHeight()/2, slitWidth, imgBuffer[0].getHeight(), slitLocX, 0); } } } //-------------------------------------------------------------- void ofApp::keyPressed(int key){ } //-------------------------------------------------------------- void ofApp::keyReleased(int key){ } //-------------------------------------------------------------- void ofApp::mouseMoved(int x, int y){ } //-------------------------------------------------------------- void ofApp::mouseDragged(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mousePressed(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mouseReleased(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mouseEntered(int x, int y){ } //-------------------------------------------------------------- void ofApp::mouseExited(int x, int y){ } //-------------------------------------------------------------- void ofApp::windowResized(int w, int h){ } //-------------------------------------------------------------- void ofApp::gotMessage(ofMessage msg){ } //-------------------------------------------------------------- void ofApp::dragEvent(ofDragInfo dragInfo){ }
e80ab4bc0459af2e4cc5e9a3048cd9449c9322c9
7e762e9dda12e72f96718ef7bec81bca85f3937a
/DQuery.cpp
7f2ffc6589b76968bd2aa83416075138684be8b2
[]
no_license
ShravanCool/spoj-classical
b9bd563a28523ad8d626c867f54646d839302ce9
448bf7745c65f6552fb00b32a827044bd1528925
refs/heads/master
2020-05-31T06:48:59.737307
2019-03-30T16:46:07
2019-03-30T16:46:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,669
cpp
#include <cstdio> #include <algorithm> #include <cmath> #include <vector> using namespace std; long long BLOCK_SZ = 555; int freqArr[10000000]; typedef struct query { long long start, end, index; } query; bool myComp(query a, query b); void add(long long index, long long& curAns); void remove(long long index, long long& curAns); int main() { long long N, Q; scanf("%lld", &N); BLOCK_SZ = sqrt(N); vector<long long> arr(N); for(long long i = 0; i < N; i++) scanf("%lld", &arr[i]); scanf("%lld", &Q); vector<query> qq(Q); for(long long i = 0; i < Q; i++) { scanf("%lld%lld", &qq[i].start, &qq[i].end); qq[i].start--; qq[i].end--; qq[i].index = i; } sort(qq.begin(), qq.end(), myComp); vector<long long> queryAns(Q); long long curL = 0, curR = 0, curAns = 0; for(long long i = 0; i < Q; i++) { while(curL < qq[i].start) { remove(arr[curL], curAns); curL++; } while(curL > qq[i].start) { add(arr[curL-1], curAns); curL--; } while(curR <= qq[i].end) { add(arr[curR], curAns); curR++; } while(curR > qq[i].end+1) { remove(arr[curR-1], curAns); curR--; } queryAns[qq[i].index] = curAns; } for(long long i = 0; i < Q; i++) printf("%lld\n", queryAns[i]); return 0; } bool myComp(query a, query b) { if(a.start/BLOCK_SZ == b.start/BLOCK_SZ) return a.end < b.end; return a.start/BLOCK_SZ < b.start/BLOCK_SZ; } void add(long long index, long long& curAns) { freqArr[index]++; curAns += (freqArr[index] == 1); } void remove(long long index, long long& curAns) { freqArr[index]--; curAns -= (freqArr[index] == 0); }
3ef86f23c4a16b551f74044a45c96cb0fdd06979
fe856864263e8f5b189d9e98261a09001c7a1939
/src/netbase.h
8096acb79cbb16e375807057bef9a88c873f3f53
[ "MIT" ]
permissive
gbanka/seocoin
9666b2b55123aaa20c34251766692c775f60d7a5
1756bc2cff197a90ed89c73b53021d4dcf29a506
refs/heads/master
2021-01-21T23:09:35.008078
2017-06-23T09:35:41
2017-06-23T09:35:42
95,202,522
0
0
null
null
null
null
UTF-8
C++
false
false
6,092
h
// Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef SEOCOIN_NETBASE_H #define SEOCOIN_NETBASE_H #include <string> #include <vector> #include "serialize.h" #include "compat.h" extern int nConnectTimeout; #ifdef WIN32 // In MSVC, this is defined as a macro, undefine it to prevent a compile and link error #undef SetPort #endif enum Network { NET_UNROUTABLE, NET_IPV4, NET_IPV6, NET_TOR, NET_MAX, }; extern int nConnectTimeout; extern bool fNameLookup; /** IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96)) */ class CNetAddr { protected: unsigned char ip[16]; // in network byte order public: CNetAddr(); CNetAddr(const struct in_addr& ipv4Addr); explicit CNetAddr(const char *pszIp, bool fAllowLookup = false); explicit CNetAddr(const std::string &strIp, bool fAllowLookup = false); void Init(); void SetIP(const CNetAddr& ip); bool SetSpecial(const std::string &strName); // for Tor addresses bool IsIPv4() const; // IPv4 mapped address (::FFFF:0:0/96, 0.0.0.0/0) bool IsIPv6() const; // IPv6 address (not mapped IPv4, not Tor) bool IsRFC1918() const; // IPv4 private networks (10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12) bool IsRFC3849() const; // IPv6 documentation address (2001:0DB8::/32) bool IsRFC3927() const; // IPv4 autoconfig (169.254.0.0/16) bool IsRFC3964() const; // IPv6 6to4 tunnelling (2002::/16) bool IsRFC4193() const; // IPv6 unique local (FC00::/15) bool IsRFC4380() const; // IPv6 Teredo tunnelling (2001::/32) bool IsRFC4843() const; // IPv6 ORCHID (2001:10::/28) bool IsRFC4862() const; // IPv6 autoconfig (FE80::/64) bool IsRFC6052() const; // IPv6 well-known prefix (64:FF9B::/96) bool IsRFC6145() const; // IPv6 IPv4-translated address (::FFFF:0:0:0/96) bool IsTor() const; bool IsLocal() const; bool IsRoutable() const; bool IsValid() const; bool IsMulticast() const; enum Network GetNetwork() const; std::string ToString() const; std::string ToStringIP() const; unsigned int GetByte(int n) const; uint64 GetHash() const; bool GetInAddr(struct in_addr* pipv4Addr) const; std::vector<unsigned char> GetGroup() const; int GetReachabilityFrom(const CNetAddr *paddrPartner = NULL) const; void print() const; #ifdef USE_IPV6 CNetAddr(const struct in6_addr& pipv6Addr); bool GetIn6Addr(struct in6_addr* pipv6Addr) const; #endif friend bool operator==(const CNetAddr& a, const CNetAddr& b); friend bool operator!=(const CNetAddr& a, const CNetAddr& b); friend bool operator<(const CNetAddr& a, const CNetAddr& b); IMPLEMENT_SERIALIZE ( READWRITE(FLATDATA(ip)); ) }; /** A combination of a network address (CNetAddr) and a (TCP) port */ class CService : public CNetAddr { protected: unsigned short port; // host order public: CService(); CService(const CNetAddr& ip, unsigned short port); CService(const struct in_addr& ipv4Addr, unsigned short port); CService(const struct sockaddr_in& addr); explicit CService(const char *pszIpPort, int portDefault, bool fAllowLookup = false); explicit CService(const char *pszIpPort, bool fAllowLookup = false); explicit CService(const std::string& strIpPort, int portDefault, bool fAllowLookup = false); explicit CService(const std::string& strIpPort, bool fAllowLookup = false); void Init(); void SetPort(unsigned short portIn); unsigned short GetPort() const; bool GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const; bool SetSockAddr(const struct sockaddr* paddr); friend bool operator==(const CService& a, const CService& b); friend bool operator!=(const CService& a, const CService& b); friend bool operator<(const CService& a, const CService& b); std::vector<unsigned char> GetKey() const; std::string ToString() const; std::string ToStringPort() const; std::string ToStringIPPort() const; void print() const; #ifdef USE_IPV6 CService(const struct in6_addr& ipv6Addr, unsigned short port); CService(const struct sockaddr_in6& addr); #endif IMPLEMENT_SERIALIZE ( CService* pthis = const_cast<CService*>(this); READWRITE(FLATDATA(ip)); unsigned short portN = htons(port); READWRITE(portN); if (fRead) pthis->port = ntohs(portN); ) }; typedef std::pair<CService, int> proxyType; enum Network ParseNetwork(std::string net); void SplitHostPort(std::string in, int &portOut, std::string &hostOut); bool SetProxy(enum Network net, CService addrProxy, int nSocksVersion = 5); bool GetProxy(enum Network net, proxyType &proxyInfoOut); bool IsProxy(const CNetAddr &addr); bool SetNameProxy(CService addrProxy, int nSocksVersion = 5); bool HaveNameProxy(); bool LookupHost(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions = 0, bool fAllowLookup = true); bool LookupHostNumeric(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions = 0); bool Lookup(const char *pszName, CService& addr, int portDefault = 0, bool fAllowLookup = true); bool Lookup(const char *pszName, std::vector<CService>& vAddr, int portDefault = 0, bool fAllowLookup = true, unsigned int nMaxSolutions = 0); bool LookupNumeric(const char *pszName, CService& addr, int portDefault = 0); bool ConnectSocket(const CService &addr, SOCKET& hSocketRet, int nTimeout = nConnectTimeout); bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest, int portDefault = 0, int nTimeout = nConnectTimeout); #endif
e25cf63b15b13e3fbf3034774f5f484da5d47f02
fda63f10ef1a99bc7e260e199a5fb595369e8bb9
/test/examples/potential_friends_test.cc
4cb5fbf905e377a176d007eefd28be6c4ad8b1be
[]
no_license
honkdamonk/Green-Marl
74e1ae6e89b125e7141280f970fba1cb9ccb1772
95832007d273cae728d981ca774d5b0febb628e8
refs/heads/master
2020-12-25T07:57:37.775547
2014-05-29T16:50:35
2014-05-29T16:50:35
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,801
cc
#include "potential_friends.h" #include <set> #include <fstream> #include <iostream> #include <string.h> std::set<int>* loadPrecomputedResults(size_t nodeCount) { std::set<int>* targetSets = new std::set<int>[nodeCount]; std::ifstream inputFileStream; inputFileStream.open("data/potential_friends.txt"); assert(inputFileStream.is_open()); node_t currentNode = 0; int maxSize = 1024; char lineData[maxSize]; while (!inputFileStream.eof()) { inputFileStream.getline(lineData, maxSize); char* p = strtok(lineData, " "); p = strtok(NULL, " "); p = strtok(NULL, " "); while(p != NULL) { node_t x; sscanf(p, "%d", &x); targetSets[currentNode].insert(x); p = strtok(NULL, " "); } currentNode++; } return targetSets; } int main(int argc, char** argv) { std::vector<VALUE_TYPE> node_schema, edge_schema; std::vector<void*> node_props, edge_props; gm_graph G; G.load_edge_list("graphs/potential_friends_testgraph.txt", node_schema, edge_schema, node_props, edge_props); set<int>* targetSets = loadPrecomputedResults(G.num_nodes()); gm_property_of_collection_impl<gm_node_set, false> resultSets(G.num_nodes()); potential_friends(G, resultSets); for(node_t i = 0; i < G.num_nodes(); i++) { std::set<int> targetSet = targetSets[i]; gm_node_set actualSet = resultSets[i]; assert(targetSet.size() == actualSet.get_size()); gm_node_set::seq_iter actualII = actualSet.prepare_seq_iteration(); while(actualII.has_next()) { node_t node = actualII.get_next(); assert(targetSet.find(node) != targetSet.end()); } } delete[] targetSets; return 0; }
d0f3178cc41fe94efcfd999fe021e3e7a1291c87
3211ea6359a995693165b4449aba23e501d62fc2
/Queues/Queue.cpp
6d189c76f7fd27ebd9d92cfd095b761f691e2672
[]
no_license
abhi-shek2000/DataStructuresusingC_plusplus
f9cd714ebb443d418326c6720803109d25a8d245
a994da00c388246d42097670c0c16677502b1a8b
refs/heads/master
2021-02-24T10:42:26.713329
2020-04-17T19:02:27
2020-04-17T19:02:27
245,429,083
2
0
null
null
null
null
UTF-8
C++
false
false
2,218
cpp
/* * File: stack.h * Author: Abhishek Mule * Basic implementation of QUEUE * Created on 10 March, 2020, 4:26 PM */ #include <iostream> using namespace std; class QUEUE{ private: struct NODE{ int data; struct NODE *next; struct NODE *prev; }; struct NODE *front; struct NODE *rear; public: QUEUE(){ front = NULL; rear = NULL; } void enqueue(int d){ struct NODE *newNode = new NODE; newNode->data = d; newNode->next = NULL; newNode->prev = NULL; if (front == NULL && rear == NULL){ front = newNode; rear = newNode; }else { struct NODE *ptr = new NODE; ptr = rear; ptr->prev = newNode; newNode->next = ptr; rear = newNode; } } void print_queue(){ struct NODE *ptr = new NODE; ptr = rear; if (front != NULL){ do{ cout << ptr->data << " "; ptr = ptr->next; }while(ptr != NULL); cout << endl<<endl; } else{ cout << "Queue Empty ! "<<endl; } } void dequeue(){ struct NODE *ptr = new NODE; ptr = front; if (front->prev != NULL){ front = front->prev; front ->next = NULL; //delete ptr; ptr = NULL; } else { front = NULL; ptr = NULL; rear = NULL; } } }; /* * */ int main(void) { QUEUE Q; cout << "\tBASIC QUEUE OPEARTIONS ! "<<endl; int choice; int value; cout <<endl<<endl; while (choice != 4){ cout << "1] Enqueue\n2] Dequeue\n3] Print \n4] EXIT"<<endl; cout << "Choice : "; cin >> choice; switch(choice){ case 1: cout << "Enter Value : "; cin >> value; Q.enqueue(value); break; case 2: Q.dequeue(); break; case 3: Q.print_queue(); break; } } return 0; }
7e4bffe0f77d9d0ecabc760367b75594c3dcb922
cf1110da799ab032029b48afc942041a15f84795
/Num_met_6s_2_01/DirichletTask.h
cce639db859f4bbf0ea37b064c962508abfa1e68
[]
no_license
Pahandrovich/Num_met_Dirichlet_Task
2438f72883f397515b8308fa27b0eb658e15820a
bc0a2992a5271b6f67b7554c67aa27fd3cb550d2
refs/heads/master
2020-05-15T21:49:03.951156
2019-05-08T17:17:19
2019-05-08T17:17:19
182,509,972
0
0
null
2019-05-08T17:17:20
2019-04-21T08:41:01
C++
UTF-8
C++
false
false
1,735
h
#ifndef _DIRICHLETTASK_ #define _DIRICHLETTASK_ #include <cmath> #include <cstdlib> #include <vector> #define PI 3.141592653589793238462643383279502884197169399375105820974944 class Dirichlet_Base { public: std::vector <double> V; int Ind_v(int i, int j) const; double U_acc(double x, double y) const; double Getx (int i); double Gety (int j); double Zeidel_iter(int num_iter); double Zeidel_eps(double eps,int &spent); double Simple_iteration_iter(int num_iter); double Simple_iteration_eps(double eps, int &spent); protected: double a; double b; double c; double d; int n; int m; double h; double k; double A; double diag1; double diag2; double Tau; std::vector <double> Right; virtual double Mu1(double y) const = 0; virtual double Mu2(double y) const = 0; virtual double Mu3(double x) const = 0; virtual double Mu4(double x) const = 0; virtual double f(double x, double y) const = 0; void Init_Right(); //double calc_accuracy(std::vector<double> &a, std::vector<double> &b); Dirichlet_Base(int _n, int _m); }; class Dirichlet_Test : public Dirichlet_Base { public: virtual double Mu1(double y) const; virtual double Mu2(double y) const; virtual double Mu3(double x) const; virtual double Mu4(double x) const; virtual double f(double x, double y) const; //virtual void Init_Right(); public: Dirichlet_Test(int _n, int _m); }; class Dirichlet_Main : public Dirichlet_Base { public: virtual double Mu1(double y) const; virtual double Mu2(double y) const; virtual double Mu3(double x) const; virtual double Mu4(double x) const; virtual double f(double x, double y) const; //virtual void Init_Right(); public: Dirichlet_Main(int _n, int _m); }; #endif // !_DIRICHLETTASK_
0a035701037afeaadbd0883396ea8d83a3abaa64
ee819cbb90cc24ea7e285986e055f4005bc7513f
/Algorithms/Search/test.cpp
b6871a37937fa084c7c0f510f8e620d9837e4ff3
[]
no_license
Imran4424/Hackerrank-Solutions
d6eaec624bfb3e45e3ad1455b54c03baa93ed627
374a8aee2370f68b438a797e02d046938eed397a
refs/heads/master
2021-07-14T16:56:44.572516
2020-07-22T11:14:29
2020-07-22T11:14:29
183,985,195
0
0
null
null
null
null
UTF-8
C++
false
false
2,529
cpp
#include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef pair<lli, lli> couple; vector<string> split_string(string); // Complete the maximumSum function below. lli maximumSum(vector<lli> a, lli m) { vector <lli> prefixSum; prefixSum.push_back(a[0] % m); lli totalPrefix = 0; //cout << prefixSum[0] << " "; for (lli i = 1; i < a.size(); ++i) { prefixSum.push_back((prefixSum[i-1] + a[i]) % m); //cout << prefixSum[i] << " "; totalPrefix += prefixSum[i]; } lli totalMod = totalPrefix % m; //cout << endl; //cout << totalPrefix << endl; sort(prefixSum.begin(), prefixSum.end()); lli sortedMaxMod = prefixSum[prefixSum.size() - 1]; lli maxMod = 0; for (lli i = 0; i < prefixSum.size(); ++i) { if ((m - prefixSum[i]) % m > maxMod) { maxMod = (m - prefixSum[i]) % m; } } return max(maxMod, max(sortedMaxMod, totalMod)); } int main() { ofstream fout(getenv("OUTPUT_PATH")); int q; cin >> q; cin.ignore(numeric_limits<streamsize>::max(), '\n'); for (int q_itr = 0; q_itr < q; q_itr++) { string nm_temp; getline(cin, nm_temp); vector<string> nm = split_string(nm_temp); int n = stoi(nm[0]); lli m = (lli) stol(nm[1]); string a_temp_temp; getline(cin, a_temp_temp); vector<string> a_temp = split_string(a_temp_temp); vector<lli> a(n); for (int i = 0; i < n; i++) { lli a_item = stol(a_temp[i]); a[i] = a_item; } lli result = maximumSum(a, m); fout << result << "\n"; } fout.close(); return 0; } vector<string> split_string(string input_string) { string::iterator new_end = unique(input_string.begin(), input_string.end(), [] (const char &x, const char &y) { return x == y and x == ' '; }); input_string.erase(new_end, input_string.end()); while (input_string[input_string.length() - 1] == ' ') { input_string.pop_back(); } vector<string> splits; char delimiter = ' '; size_t i = 0; size_t pos = input_string.find(delimiter); while (pos != string::npos) { splits.push_back(input_string.substr(i, pos - i)); i = pos + 1; pos = input_string.find(delimiter, i); } splits.push_back(input_string.substr(i, min(pos, input_string.length()) - i + 1)); return splits; }
a156779aee9eeb6ba6452c235e7b3d9bef9e1209
726fd2d41018c9c3e27634e9d1ba5e3e88aa0a56
/Lunchtime/03_20/SWPDGT.cpp
bb014d5eca18161d50dd4874f219e2db7b9902f6
[ "MIT" ]
permissive
vinaysomawat/CodeChef-Solutions
a0cf21e5448e5463f390400f5308d20668d38af2
9a0666a4f1badd593cd075f3beb05377e3c6657a
refs/heads/master
2022-04-17T13:23:05.882005
2020-04-14T16:41:13
2020-04-14T16:41:13
245,212,882
1
0
null
null
null
null
UTF-8
C++
false
false
1,244
cpp
/* Contest: CodeChef March 2020 Cook-Off challange Problem link: https://www.codechef.com/LTIME82B/problems/SWPDGT GitHub Solution Repository: https://github.com/vinaysomawat/CodeChef-Solutions Author: Vinay Somawat Author's Webpage: http://vinaysomawat.github.io/ Author's mail: [email protected] */ #include<bits/stdc++.h> #define ll long long int using namespace std; void solve() { int a,b; cin>>a>>b; int sum = a+b; if(a<10 && b<10) { cout<<sum<<endl; } else if(a<10 || b<10) { int temp1 = max(a,b); int temp2 = min(a,b); a = temp1; b = temp2; int a2 = a%10; a = a/10; int a1 = a%10; a = b*10+a2; b = a1; cout<<max(sum,a+b)<<endl; } else { int a1,a2,b1,b2,sum1,sum2; a2 = a%10; a = a/10; a1 = a%10; b2 =b%10; b = b/10; b1 = b%10; b = b1*10 + a1; a = b2*10 + a2; sum1 = a+b; b = a2*10 + b2; a = a1*10 + b1; sum2 = a+b; cout<<max(sum, max(sum1,sum2))<<endl; } } int main() { int t; cin>>t; while(t--) { solve(); } return 0; }
1399e8805f4ead4bb7d2fe4ee3189bab5abbd9d7
6aeccfb60568a360d2d143e0271f0def40747d73
/sandbox/enums/boost/enums/ordinal/traits.hpp
487201210f2988fde76b86d566b2ac6ad75d8bb1
[ "BSL-1.0" ]
permissive
ttyang/sandbox
1066b324a13813cb1113beca75cdaf518e952276
e1d6fde18ced644bb63e231829b2fe0664e51fac
refs/heads/trunk
2021-01-19T17:17:47.452557
2013-06-07T14:19:55
2013-06-07T14:19:55
13,488,698
1
3
null
2023-03-20T11:52:19
2013-10-11T03:08:51
C++
UTF-8
C++
false
false
1,256
hpp
////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Vicente J. Botet Escriba 2011. // Distributed under the Boost // Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or // copy at http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/enums for documentation. // ////////////////////////////////////////////////////////////////////////////// /*! \file \brief The header \c <boost/enums/ordinal/traits.hpp> declares a class template \c meta::enum_traits<> which must be specialized for each enumeration including two static functions \c pos() and \c val(). */ #ifndef BOOST_ENUMS_ORDINAL_TRAITS_HPP #define BOOST_ENUMS_ORDINAL_TRAITS_HPP namespace boost { namespace enums { namespace meta { template <typename EC> #ifndef BOOST_ENUMS_DOXYGEN_INVOKED struct enum_traits; #else struct enum_traits { //! The specialization must define this function prototype static std::size_t pos(EC e); //! The specialization must define this function prototype static EC val(std::size_t p); }; #endif } } } #endif // BOOST_ENUMS_ORDINAL_TRAITS_HPP
d4063abb49186d65b01d46df543178a9461e92fb
f500ab7be9a435e89d03df4c46e400a7d3dbd03e
/main.cpp
72a56ea7000209481b0620d0a850d3c556814f88
[]
no_license
RyanSwann1/Test
514066413ab2c564ed918630bb3ae3d2a4d1df5d
5ba7266ed9ddb425584820c2f0d521459d79c885
refs/heads/master
2016-09-13T12:36:06.746450
2016-04-13T15:38:09
2016-04-13T15:38:09
56,164,345
0
0
null
null
null
null
UTF-8
C++
false
false
567
cpp
#include "Game.h" #include <SDL.h> #include <iostream> int main(int argc, char* args[]) { //02084287520 //Init game if (Game::instance()->init("Pong", 700, 500)) { //Game loop while (Game::instance()->isRunning()) { //Listen for events Game::instance()->handleEvents(); //Update Game Game::instance()->update(); //Show Rendering Game::instance()->render(); //Simulate 60FPS will change in future SDL_Delay(16); } } else { std::cout << "Game failed to initialize.\n"; } return 0; }
0eab257922b373e4c2cdd47fb42bb0a96a21367d
c53cf4d977cc480ba10fc4643c305c3ca429b0db
/include/YORPLib/FCoeffs.h
895d842f44e6dacc059e13fe9cf2dcb51054c3c0
[ "MIT" ]
permissive
bbercovici/YORPLib
4338f1b00785c87c035b5bbe90e49253616e486c
3ae8dc6a26987cd327479d7212000b97d688929c
refs/heads/master
2021-04-03T04:59:02.300968
2019-02-04T00:22:52
2019-02-04T00:22:52
124,464,922
1
0
null
null
null
null
UTF-8
C++
false
false
4,748
h
/** MIT License Copyright (c) 2014 Jay McMahon 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. */ // // FCoeffs.h // Spacecraft_SRP // // Created by Jay McMahon on 5/27/14. // Copyright (c) 2014 Jay McMahon. All rights reserved. // #ifndef __Spacecraft_SRP__FourierCoeffs__ #define __Spacecraft_SRP__FourierCoeffs__ //#include <iostream> //#include <vector> //#include <string> //#include "Facet.h" //#include "VoxelGrid.h" //#include "Body.h" #include "Shadow.h" namespace YORPLib{ class FCoeffs { public: FCoeffs(); FCoeffs(int order); void computeCoeffs(const double delta_s, Body* Target, const vector < vector <double> >* low, const vector < vector <double> >* high, const double lamDel, const int numbounces, const vector < vector <double> >* fmult, const vector < vector <double> >* tmult, const vector < vector < double > >* latSpec, const vector < vector < double > >* longSpec, const vector < vector < vector < double > > >* fSpec, const vector < vector < vector < double > > >* tSpec); void computeYear(); void setOrder(int order); double* getA(); double* getB(); double* getC(); double* getD(); private: int order; double A[3]; double B[3]; double Ayear[3]; double Byear[3]; double C[3]; double D[3]; double Cyear[3]; double Dyear[3]; double compute_uc1n(double lbnd, double ubnd, int nint); double compute_uc2n(double lbnd, double ubnd, int nint); double compute_uc3n(double lbnd, double ubnd, int nint); double compute_uuc11n(double lbnd, double ubnd, int nint); double compute_uuc12n(double lbnd, double ubnd, int nint); double compute_uuc22n(double lbnd, double ubnd, int nint); double compute_us1n(double lbnd, double ubnd, int nint); double compute_us2n(double lbnd, double ubnd, int nint); double compute_us3n(double lbnd, double ubnd, int nint); double compute_uus11n(double lbnd, double ubnd, int nint); double compute_uus12n(double lbnd, double ubnd, int nint); double compute_uus22n(double lbnd, double ubnd, int nint); double compute_uc1n_shad(double a, double b, int nint, double Ha, double dH); double compute_uc2n_shad(double a, double b, int nint, double Ha, double dH); double compute_uc3n_shad(double a, double b, int nint, double Ha, double dH); double compute_uuc11n_shad(double a, double b, int nint, double Ha, double dH); double compute_uuc12n_shad(double a, double b, int nint, double Ha, double dH); double compute_uuc22n_shad(double a, double b, int nint, double Ha, double dH); double compute_us1n_shad(double a, double b, int nint, double Ha, double dH); double compute_us2n_shad(double a, double b, int nint, double Ha, double dH); double compute_us3n_shad(double a, double b, int nint, double Ha, double dH); double compute_uus11n_shad(double a, double b, int nint, double Ha, double dH); double compute_uus12n_shad(double a, double b, int nint, double Ha, double dH); double compute_uus22n_shad(double a, double b, int nint, double Ha, double dH); double compute_u1_shad(double a, double b, double Ha, double dH); double compute_u2_shad(double a, double b, double Ha, double dH); double compute_u3_shad(double a, double b, double Ha, double dH); double compute_uu11_shad(double a, double b, double Ha, double dH); double compute_uu12_shad(double a, double b, double Ha, double dH); double compute_uu22_shad(double a, double b, double Ha, double dH); }; } #endif /* defined(__Spacecraft_SRP__FourierCoeffs__) */
208359276ac2c977ee3a54af6d9ec9a12f83dd48
d09945668f19bb4bc17087c0cb8ccbab2b2dd688
/atcoder/abc201-250/abc247/a.cpp
d3e36fbf5d133825faea65e5ab9eeee61f0e4b9d
[]
no_license
kmjp/procon
27270f605f3ae5d80fbdb28708318a6557273a57
8083028ece4be1460150aa3f0e69bdb57e510b53
refs/heads/master
2023-09-04T11:01:09.452170
2023-09-03T15:25:21
2023-09-03T15:25:21
30,825,508
23
2
null
2023-08-18T14:02:07
2015-02-15T11:25:23
C++
UTF-8
C++
false
false
917
cpp
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define FORR2(x,y,arr) for(auto& [x,y]:arr) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) template<class T> bool chmax(T &a, const T &b) { if(a<b){a=b;return 1;}return 0;} template<class T> bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;} //------------------------------------------------------- void solve() { int i,j,k,l,r,x,y; string s; cin>>s; cout<<"0"+s.substr(0,3)<<endl; } int main(int argc,char** argv){ string s;int i; if(argc==1) ios::sync_with_stdio(false), cin.tie(0); FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin); cout.tie(0); solve(); return 0; }
817d7d1e6d96f9c056695088a3a371b69a84fdc0
b367fe5f0c2c50846b002b59472c50453e1629bc
/xbox_leak_may_2020/xbox trunk/xbox/private/xdktools/Producer/AudioPathDesigner/DlgEditSynth.h
7dc74bf5cc965c681c0271709b2695e6ca21b06b
[]
no_license
sgzwiz/xbox_leak_may_2020
11b441502a659c8da8a1aa199f89f6236dd59325
fd00b4b3b2abb1ea6ef9ac64b755419741a3af00
refs/heads/master
2022-12-23T16:14:54.706755
2020-09-27T18:24:48
2020-09-27T18:24:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,565
h
#if !defined(AFX_DLGEDITSYNTH_H__51ACE707_7179_4F5C_AB26_67BB6DFB6037__INCLUDED_) #define AFX_DLGEDITSYNTH_H__51ACE707_7179_4F5C_AB26_67BB6DFB6037__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // DlgEditSynth.h : header file // #include "resource.h" ///////////////////////////////////////////////////////////////////////////// // CDlgEditSynth dialog class CDlgEditSynth : public CDialog { // Construction public: CDlgEditSynth(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CDlgEditSynth) enum { IDD = IDD_DLG_SYNTH }; CSpinButtonCtrl m_spinVoices; CEdit m_editVoices; CEdit m_editSynthName; CButton m_checkReverb; CButton m_checkChorus; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CDlgEditSynth) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation public: DWORD m_dwEffects; DWORD m_dwSupportedEffects; DWORD m_dwSampleRate; DWORD m_dwVoices; DWORD m_dwMaxVoices; CString m_strName; protected: // Generated message map functions //{{AFX_MSG(CDlgEditSynth) afx_msg void OnKillfocusEditVoices(); virtual void OnOK(); virtual BOOL OnInitDialog(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_DLGEDITSYNTH_H__51ACE707_7179_4F5C_AB26_67BB6DFB6037__INCLUDED_)
f39bd62a53832b35b4fa7e645f322a6603fea68f
388b8db0f7954a130f68437dae430976575d08d2
/Printer.h
59902a5e54086edd087818ac37c3718b083cc795
[]
no_license
Evan-xia-mew/sysc4805
e01aa60d231402bc7d93e4e6f886f3c60267aa1c
c2bacfff05a547c0c72f69f95fae6019ed3ffd86
refs/heads/master
2020-03-09T00:41:19.097731
2018-04-07T03:59:57
2018-04-07T03:59:57
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,724
h
// {{{RME classifier 'Logical View::Printer' #ifndef Printer_H #define Printer_H #ifdef PRAGMA #pragma interface "Printer.h" #endif #include <RTSystem/TestComponent.h> #include <PrinterProtocol.h> // {{{RME tool 'OT::Cpp' property 'HeaderPreface' // {{{USR // }}}USR // }}}RME extern const RTActorClass Printer; #define SUPER RTActor class Printer_Actor : public RTActor { public: // {{{RME tool 'OT::Cpp' property 'PublicDeclarations' // {{{USR // }}}USR // }}}RME protected: // {{{RME tool 'OT::Cpp' property 'ProtectedDeclarations' // {{{USR // }}}USR // }}}RME private: // {{{RME tool 'OT::Cpp' property 'PrivateDeclarations' // {{{USR // }}}USR // }}}RME protected: // {{{RME port 'PrinterPort' PrinterProtocol::Conjugate PrinterPort; // }}}RME // {{{RME port 'log' Log::Base log; // }}}RME public: Printer_Actor( RTController * rtg_rts, RTActorRef * rtg_ref ); virtual ~Printer_Actor( void ); virtual int _followInV( RTBindingEnd & rtg_end, int rtg_portId, int rtg_repIndex ); protected: // {{{RME transition ':TOP:idle:J58B892CB01D0:printEvent' INLINE_METHODS void transition1_printEvent( const int * rtdata, PrinterProtocol::Conjugate * rtport ); // }}}RME private: INLINE_CHAINS void chain2_Initial( void ); INLINE_CHAINS void chain1_printEvent( void ); public: virtual void rtsBehavior( int signalIndex, int portIndex ); virtual const RTActor_class * getActorData( void ) const; protected: static const RTActor_class rtg_class; public: static const RTStateId rtg_parent_state[]; private: static const RTPortDescriptor rtg_ports[]; }; #undef SUPER // {{{RME tool 'OT::Cpp' property 'HeaderEnding' // {{{USR // }}}USR // }}}RME #endif /* Printer_H */ // }}}RME
54d99e8632ab2f2a0d8cddc35ba4c5264db11f74
4c1f8e1a5e67f088d1507670fb3964afe6ac4b62
/apps/pipslab/StreamingMocapShared/potator/PotatorClientApplication.cpp
fce95611cd8856b71dcacfeeabfd1fa170b68d2c
[]
no_license
keezpipslab/potator
613b7654489fd537e303ee67ea9336564c2d2f88
36bd711dc1e3be296995ebd90f7a91c3df9eca2e
refs/heads/master
2021-01-25T03:40:22.144966
2012-12-28T12:26:31
2012-12-28T12:26:31
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,198
cpp
#include <potator/PotatorClientApplication.h> PotatorClientApplication::PotatorClientApplication() :potator_client(geometry_client) { } PotatorClientApplication::~PotatorClientApplication() { } void PotatorClientApplication::setup(const std::string host, const std::string port) { glEnable(GL_DEPTH_TEST); // glEnable(GL_CULL_FACE); geometry_client.setup(host, port); potator_thread.create(potator_client); drawer.setup(); } void PotatorClientApplication::update() { if(potator_client.hasData()) { std::vector<PotatorStreamData*> vertices; potator_client.copyAndFlushData(vertices); for(std::vector<PotatorStreamData*>::iterator it = vertices.begin(); it != vertices.end(); ++it) { PotatorStreamData* pd = *it; if(pd->type == PDT_VERTEX_POSITION) { PotatorVertexPosition* pvd = static_cast<PotatorVertexPosition*>(pd); drawer.addVertex(pvd->x, pvd->y, pvd->z, 0); delete pvd; } else if(pd->type == PDT_VERTEX_POSITIONS) { PotatorVertexPositions* pvd = static_cast<PotatorVertexPositions*>(pd); drawer.addVertex(pvd->x1, pvd->y1, pvd->z1, pvd->texture_line); drawer.addVertex(pvd->x2, pvd->y2, pvd->z2, pvd->texture_line); delete pvd; } else if(pd->type == PDT_VERTEX_POSITIONS_END_MARKER) { drawer.addNewStrip(); delete pd; } else if(pd->type == PDT_TEXTURE_INFO) { PotatorTextureInfo* pti = static_cast<PotatorTextureInfo*>(pd); drawer.createTexture(pti->w, pti->h, 6); delete pti; } else if(pd->type == PDT_TEXTURE_LINE) { PotatorTextureLine* ptl = static_cast<PotatorTextureLine*>(pd); drawer.addTextureLine(ptl->line, ptl->data, ptl->nbytes); delete ptl; } else if(pd->type == PDT_RESET) { printf("RESET!\n"); reset(); delete pd; } else { delete pd; } } } drawer.update(); } void PotatorClientApplication::draw(const float* pm, const float* vm) { drawer.draw(pm, vm); } void PotatorClientApplication::reset() { printf("PotatorClientApplication::reset()\n"); drawer.reset(); // potator_client.reset(); }
2855c56ce24d92a088ba541e5748638d9112cd61
e5dd7d26eeb3ad705f0ea951b36621a35a44347e
/657_Robot Return to Origin.cpp
626a58e63c7c98e0a8660f3078d5d454fd011a8a
[ "MIT" ]
permissive
wusongnie/LeetCodeOJ_Solutions
f91288485d5ef58091dc7b00ba7bc7815b10ee8e
3e9f0f99c57c9df87625633693ba7cbed08acf3b
refs/heads/master
2021-07-16T01:10:29.961881
2019-08-26T05:48:02
2019-08-26T05:48:02
91,762,121
1
1
null
null
null
null
UTF-8
C++
false
false
538
cpp
class Solution { public: bool judgeCircle(string moves) { int l = 0; int u = 0; for(char& c : moves){ switch(c){ case 'U': u++; break; case 'D': u--; break; case 'L': l++; break; case 'R': l--; break; } } return l == 0 && u == 0; } };
528202f1287ffb7b39224ebce58fc7f9b3e7bc41
f4dc1073def4c95a19d4183475405c439cfc0aff
/Source/lightmass/pbrt/core/progressreporter.h
b4e7a6d419d0e7082964da4cf4ea6fe7f04d0892
[]
no_license
timi-liuliang/aresengine
9cf74e7137bb11cd8475852b8e4c9d51eda62505
efd39c6ef482b8d50a8eeaa5009cac5d5b9f41ee
refs/heads/master
2020-04-15T15:06:41.726469
2019-01-09T05:09:35
2019-01-09T05:09:35
164,779,995
1
0
null
null
null
null
GB18030
C++
false
false
1,549
h
/* pbrt source code Copyright(c) 1998-2010 Matt Pharr and Greg Humphreys. This file is part of pbrt. pbrt 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. Note that the text contents of the book "Physically Based Rendering" are *not* licensed under the GNU GPL. pbrt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #pragma once // core/progressreporter.h* #include "pbrt.h" namespace Pbrt { //----------------------------------- // 进度跟踪 2012-4-19 帝林<阅> //----------------------------------- class ProgressReporter { public: // 构造函数 ProgressReporter( int totalWork, const string &title, int barLength = -1); // 析构函数 ~ProgressReporter(); // 更新 void Update(int num = 1); // 任务完成时调用 void Done(); private: // ProgressReporter Private Data const int totalWork; int workDone, plussesPrinted, totalPlusses; Timer *timer; FILE *outFile; char *m_buf, *curSpace; Mutex *mutex; }; extern int TerminalWidth(); }
db069dc6787f27bcc6313f226b7dc4618f8520a5
b367fe5f0c2c50846b002b59472c50453e1629bc
/xbox_leak_may_2020/xbox trunk/xbox/private/test/directx/d3d/regress/dvtrange/test.h
51ddeef52cfb05cd1f4c131424bb2562cb3b3722
[]
no_license
sgzwiz/xbox_leak_may_2020
11b441502a659c8da8a1aa199f89f6236dd59325
fd00b4b3b2abb1ea6ef9ac64b755419741a3af00
refs/heads/master
2022-12-23T16:14:54.706755
2020-09-27T18:24:48
2020-09-27T18:24:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,153
h
/******************************************************************************* Copyright (c) 2000 Microsoft Corporation. All rights reserved. File Name: test.h Author: Matt Bronder Description: Direct3D repro test functions. *******************************************************************************/ #ifndef __TEST_H__ #define __TEST_H__ #define SCREEN_DIM 20 #define LIGHT_RANGE 10.0f //****************************************************************************** class CReproTest { protected: HINSTANCE m_hInstance; HWND m_hWnd; LPDIRECT3D8 m_pd3d; LPDIRECT3DDEVICE8 m_pDevice; LPDIRECT3DVERTEXBUFFER8 m_pd3dr; UINT m_uNumVertices; UINT m_uNumIndices; LPWORD m_pwScreen; public: CReproTest(); ~CReproTest(); virtual BOOL Create(HINSTANCE hInstance); virtual BOOL Run(); protected: virtual BOOL InitDeviceState(); virtual BOOL SetViewport(DWORD dwWidth, DWORD dwHeight); }; //****************************************************************************** LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); void InitMatrix(D3DMATRIX* pd3dm, float _11, float _12, float _13, float _14, float _21, float _22, float _23, float _24, float _31, float _32, float _33, float _34, float _41, float _42, float _43, float _44); void SetView(LPD3DXMATRIX pd3dm, LPD3DXVECTOR3 pvPos, LPD3DXVECTOR3 pvAt, LPD3DXVECTOR3 pvUp); void SetPerspectiveProjection(D3DMATRIX* pd3dm, float fFront, float fBack, float fFieldOfView, float fAspect); #endif //__TEST_H__
093673a6f3467b79a5e238c1b940c2b882ff7c88
87ef1632a5673baa1192ebd44d9b85e2809f0e75
/SimpSolver.cc
f9d3bceb53d4e99ae28453f3a2442b78bd8a1b59
[ "MIT" ]
permissive
Mystelven/picasso
09f6206c596a9644710132afc04cd0ce09a2751b
de1c87ac6de975abd958f569c5c3488a76dc0c38
refs/heads/master
2021-06-28T10:24:16.539062
2020-12-17T18:42:59
2020-12-17T18:42:59
196,539,946
0
1
null
null
null
null
UTF-8
C++
false
false
26,579
cc
/***************************************************************************************[SimpSolver.cc] Glucose -- Copyright (c) 2009-2014, Gilles Audemard, Laurent Simon CRIL - Univ. Artois, France LRI - Univ. Paris Sud, France (2009-2013) Labri - Univ. Bordeaux, France Syrup (Glucose Parallel) -- Copyright (c) 2013-2014, Gilles Audemard, Laurent Simon CRIL - Univ. Artois, France Labri - Univ. Bordeaux, France Glucose sources are based on MiniSat (see below MiniSat copyrights). Permissions and copyrights of Glucose (sources until 2013, Glucose 3.0, single core) are exactly the same as Minisat on which it is based on. (see below). Glucose-Syrup sources are based on another copyright. Permissions and copyrights for the parallel version of Glucose-Syrup (the "Software") are granted, free of charge, to deal with the Software without restriction, including the rights to use, copy, modify, merge, publish, distribute, sublicence, 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 and below copyrights notices and this permission notice shall be included in all copies or substantial portions of the Software; - The parallel version of Glucose (all files modified since Glucose 3.0 releases, 2013) cannot be used in any competitive event (sat competitions/evaluations) without the express permission of the authors (Gilles Audemard / Laurent Simon). This is also the case for any competitive event using Glucose Parallel as an embedded SAT engine (single core or not). --------------- Original Minisat Copyrights Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson Copyright (c) 2007-2010, Niklas Sorensson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************************************/ #include "mtl/Sort.h" #include "SimpSolver.h" #include "System.h" using namespace Glucose; //================================================================================================= // Options: static const char* _cat = "SIMP"; static BoolOption opt_use_asymm (_cat, "asymm", "Shrink clauses by asymmetric branching.", false); static BoolOption opt_use_rcheck (_cat, "rcheck", "Check if a clause is already implied. (costly)", false); static BoolOption opt_use_elim (_cat, "elim", "Perform variable elimination.", true); static IntOption opt_grow (_cat, "grow", "Allow a variable elimination step to grow by a number of clauses.", 0); static IntOption opt_clause_lim (_cat, "cl-lim", "Variables are not eliminated if it produces a resolvent with a length above this limit. -1 means no limit", 20, IntRange(-1, INT32_MAX)); static IntOption opt_subsumption_lim (_cat, "sub-lim", "Do not check if subsumption against a clause larger than this. -1 means no limit.", 1000, IntRange(-1, INT32_MAX)); static DoubleOption opt_simp_garbage_frac(_cat, "simp-gc-frac", "The fraction of wasted memory allowed before a garbage collection is triggered during simplification.", 0.5, DoubleRange(0, false, HUGE_VAL, false)); //================================================================================================= // Constructor/Destructor: SimpSolver::SimpSolver() : Solver() , grow (opt_grow) , clause_lim (opt_clause_lim) , subsumption_lim (opt_subsumption_lim) , simp_garbage_frac (opt_simp_garbage_frac) , use_asymm (opt_use_asymm) , use_rcheck (opt_use_rcheck) , use_elim (opt_use_elim) , merges (0) , asymm_lits (0) , eliminated_vars (0) , use_simplification (true) , elimorder (1) , occurs (ClauseDeleted(ca)) , elim_heap (ElimLt(n_occ)) , bwdsub_assigns (0) , n_touched (0) { vec<Lit> dummy(1,lit_Undef); ca.extra_clause_field = true; // NOTE: must happen before allocating the dummy clause below. bwdsub_tmpunit = ca.alloc(dummy); remove_satisfied = false; } SimpSolver::~SimpSolver() { } SimpSolver::SimpSolver(const SimpSolver &s) : Solver(s) , grow (s.grow) , clause_lim (s.clause_lim) , subsumption_lim (s.subsumption_lim) , simp_garbage_frac (s.simp_garbage_frac) , use_asymm (s.use_asymm) , use_rcheck (s.use_rcheck) , use_elim (s.use_elim) , merges (s.merges) , asymm_lits (s.asymm_lits) , eliminated_vars (s.eliminated_vars) , use_simplification (s.use_simplification) , elimorder (s.elimorder) , occurs (ClauseDeleted(ca)) , elim_heap (ElimLt(n_occ)) , bwdsub_assigns (s.bwdsub_assigns) , n_touched (s.n_touched) { // TODO: Copy dummy... what is it??? vec<Lit> dummy(1,lit_Undef); ca.extra_clause_field = true; // NOTE: must happen before allocating the dummy clause below. bwdsub_tmpunit = ca.alloc(dummy); remove_satisfied = false; //End TODO s.elimclauses.memCopyTo(elimclauses); s.touched.memCopyTo(touched); s.occurs.copyTo(occurs); s.n_occ.memCopyTo(n_occ); s.elim_heap.copyTo(elim_heap); s.subsumption_queue.copyTo(subsumption_queue); s.frozen.memCopyTo(frozen); s.eliminated.memCopyTo(eliminated); use_simplification = s.use_simplification; bwdsub_assigns = s.bwdsub_assigns; n_touched = s.n_touched; bwdsub_tmpunit = s.bwdsub_tmpunit; qhead = s.qhead; ok = s.ok; } Var SimpSolver::newVar(bool sign, bool dvar) { Var v = Solver::newVar(sign, dvar); frozen .push((char)false); eliminated.push((char)false); if (use_simplification){ n_occ .push(0); n_occ .push(0); occurs .init(v); touched .push(0); elim_heap .insert(v); } return v; } lbool SimpSolver::solve_(bool do_simp, bool turn_off_simp) { vec<Var> extra_frozen; lbool result = l_True; do_simp &= use_simplification; if (do_simp){ // Assumptions must be temporarily frozen to run variable elimination: for (int i = 0; i < assumptions.size(); i++){ Var v = var(assumptions[i]); // If an assumption has been eliminated, remember it. assert(!isEliminated(v)); if (!frozen[v]){ // Freeze and store. setFrozen(v, true); extra_frozen.push(v); } } result = lbool(eliminate(turn_off_simp)); } if (result == l_True) result = Solver::solve_(); else if (verbosity >= 1) printf("===============================================================================\n"); if (result == l_True) extendModel(); if (do_simp) // Unfreeze the assumptions that were frozen: for (int i = 0; i < extra_frozen.size(); i++) setFrozen(extra_frozen[i], false); return result; } bool SimpSolver::addClause_(vec<Lit>& ps) { #ifdef NDEBUG for (int i = 0; i < ps.size(); i++) assert(!isEliminated(var(ps[i]))); #endif int nclauses = clauses.size(); if (use_rcheck && implied(ps)) return true; if (!Solver::addClause_(ps)) return false; if(!parsing && certifiedUNSAT) { if (vbyte) { write_char('a'); for (int i = 0; i < ps.size(); i++) write_lit(2*(var(ps[i])+1) + sign(ps[i])); write_lit(0); } else { for (int i = 0; i < ps.size(); i++) fprintf(certifiedOutput, "%i " , (var(ps[i]) + 1) * (-2 * sign(ps[i]) + 1) ); fprintf(certifiedOutput, "0\n"); } } if (use_simplification && clauses.size() == nclauses + 1){ CRef cr = clauses.last(); const Clause& c = ca[cr]; // NOTE: the clause is added to the queue immediately and then // again during 'gatherTouchedClauses()'. If nothing happens // in between, it will only be checked once. Otherwise, it may // be checked twice unnecessarily. This is an unfortunate // consequence of how backward subsumption is used to mimic // forward subsumption. subsumption_queue.insert(cr); for (int i = 0; i < c.size(); i++){ occurs[var(c[i])].push(cr); n_occ[toInt(c[i])]++; touched[var(c[i])] = 1; n_touched++; if (elim_heap.inHeap(var(c[i]))) elim_heap.increase(var(c[i])); } } return true; } void SimpSolver::removeClause(CRef cr,bool inPurgatory) { const Clause& c = ca[cr]; if (use_simplification) for (int i = 0; i < c.size(); i++){ n_occ[toInt(c[i])]--; updateElimHeap(var(c[i])); occurs.smudge(var(c[i])); } Solver::removeClause(cr,inPurgatory); } bool SimpSolver::strengthenClause(CRef cr, Lit l) { Clause& c = ca[cr]; assert(decisionLevel() == 0); assert(use_simplification); // FIX: this is too inefficient but would be nice to have (properly implemented) // if (!find(subsumption_queue, &c)) subsumption_queue.insert(cr); if (certifiedUNSAT) { if (vbyte) { write_char('a'); for (int i = 0; i < c.size(); i++) if (c[i] != l) write_lit(2*(var(c[i])+1) + sign(c[i])); write_lit(0); } else { for (int i = 0; i < c.size(); i++) if (c[i] != l) fprintf(certifiedOutput, "%i " , (var(c[i]) + 1) * (-2 * sign(c[i]) + 1) ); fprintf(certifiedOutput, "0\n"); } } if (c.size() == 2){ removeClause(cr); c.strengthen(l); }else{ if (certifiedUNSAT) { if (vbyte) { write_char('d'); for (int i = 0; i < c.size(); i++) write_lit(2*(var(c[i])+1) + sign(c[i])); write_lit(0); } else { fprintf(certifiedOutput, "d "); for (int i = 0; i < c.size(); i++) fprintf(certifiedOutput, "%i " , (var(c[i]) + 1) * (-2 * sign(c[i]) + 1) ); fprintf(certifiedOutput, "0\n"); } } detachClause(cr, true); c.strengthen(l); attachClause(cr); remove(occurs[var(l)], cr); n_occ[toInt(l)]--; updateElimHeap(var(l)); } return c.size() == 1 ? enqueue(c[0]) && propagate() == CRef_Undef : true; } // Returns FALSE if clause is always satisfied ('out_clause' should not be used). bool SimpSolver::merge(const Clause& _ps, const Clause& _qs, Var v, vec<Lit>& out_clause) { merges++; out_clause.clear(); bool ps_smallest = _ps.size() < _qs.size(); const Clause& ps = ps_smallest ? _qs : _ps; const Clause& qs = ps_smallest ? _ps : _qs; for (int i = 0; i < qs.size(); i++){ if (var(qs[i]) != v){ for (int j = 0; j < ps.size(); j++){ if (var(ps[j]) == var(qs[i])){ if (ps[j] == ~qs[i]) { return false; } else { goto next; } } } out_clause.push(qs[i]); } next:; } for (int i = 0; i < ps.size(); i++) if (var(ps[i]) != v) out_clause.push(ps[i]); return true; } // Returns FALSE if clause is always satisfied. bool SimpSolver::merge(const Clause& _ps, const Clause& _qs, Var v, int& size) { merges++; bool ps_smallest = _ps.size() < _qs.size(); const Clause& ps = ps_smallest ? _qs : _ps; const Clause& qs = ps_smallest ? _ps : _qs; const Lit* __ps = (const Lit*)ps; const Lit* __qs = (const Lit*)qs; size = ps.size()-1; for (int i = 0; i < qs.size(); i++){ if (var(__qs[i]) != v){ for (int j = 0; j < ps.size(); j++){ if (var(__ps[j]) == var(__qs[i])){ if (__ps[j] == ~__qs[i]){ return false; } else { goto next; } } } size++; } next:; } return true; } void SimpSolver::gatherTouchedClauses() { if (n_touched == 0) return; int i,j; for (i = j = 0; i < subsumption_queue.size(); i++) if (ca[subsumption_queue[i]].mark() == 0) ca[subsumption_queue[i]].mark(2); for (i = 0; i < touched.size(); i++) if (touched[i]){ const vec<CRef>& cs = occurs.lookup(i); for (j = 0; j < cs.size(); j++) if (ca[cs[j]].mark() == 0){ subsumption_queue.insert(cs[j]); ca[cs[j]].mark(2); } touched[i] = 0; } for (i = 0; i < subsumption_queue.size(); i++) if (ca[subsumption_queue[i]].mark() == 2) ca[subsumption_queue[i]].mark(0); n_touched = 0; } bool SimpSolver::implied(const vec<Lit>& c) { assert(decisionLevel() == 0); trail_lim.push(trail.size()); for (int i = 0; i < c.size(); i++) if (value(c[i]) == l_True){ cancelUntil(0); return false; }else if (value(c[i]) != l_False){ assert(value(c[i]) == l_Undef); uncheckedEnqueue(~c[i]); } bool result = propagate() != CRef_Undef; cancelUntil(0); return result; } // Backward subsumption + backward subsumption resolution bool SimpSolver::backwardSubsumptionCheck(bool verbose) { int cnt = 0; int subsumed = 0; int deleted_literals = 0; assert(decisionLevel() == 0); while (subsumption_queue.size() > 0 || bwdsub_assigns < trail.size()){ // Empty subsumption queue and return immediately on user-interrupt: if (asynch_interrupt){ subsumption_queue.clear(); bwdsub_assigns = trail.size(); break; } // Check top-level assignments by creating a dummy clause and placing it in the queue: if (subsumption_queue.size() == 0 && bwdsub_assigns < trail.size()){ Lit l = trail[bwdsub_assigns++]; ca[bwdsub_tmpunit][0] = l; ca[bwdsub_tmpunit].calcAbstraction(); subsumption_queue.insert(bwdsub_tmpunit); } CRef cr = subsumption_queue.peek(); subsumption_queue.pop(); Clause& c = ca[cr]; if (c.mark()) continue; cnt++; assert(c.size() > 1 || value(c[0]) == l_True); // Unit-clauses should have been propagated before this point. // Find best variable to scan: Var best = var(c[0]); for (int i = 1; i < c.size(); i++) if (occurs[var(c[i])].size() < occurs[best].size()) best = var(c[i]); // Search all candidates: vec<CRef>& _cs = occurs.lookup(best); CRef* cs = (CRef*)_cs; for (int j = 0; j < _cs.size(); j++) if (c.mark()) break; else if (!ca[cs[j]].mark() && cs[j] != cr && (subsumption_lim == -1 || ca[cs[j]].size() < subsumption_lim)){ Lit l = c.subsumes(ca[cs[j]]); if (l == lit_Undef) subsumed++, removeClause(cs[j]); else if (l != lit_Error){ deleted_literals++; if (!strengthenClause(cs[j], ~l)) return false; // Did current candidate get deleted from cs? Then check candidate at index j again: if (var(l) == best) j--; } } } return true; } bool SimpSolver::asymm(Var v, CRef cr) { Clause& c = ca[cr]; assert(decisionLevel() == 0); if (c.mark() || satisfied(c)) return true; trail_lim.push(trail.size()); Lit l = lit_Undef; for (int i = 0; i < c.size(); i++) if (var(c[i]) != v && value(c[i]) != l_False) uncheckedEnqueue(~c[i]); else l = c[i]; if (propagate() != CRef_Undef){ cancelUntil(0); asymm_lits++; if (!strengthenClause(cr, l)) return false; }else cancelUntil(0); return true; } bool SimpSolver::asymmVar(Var v) { assert(use_simplification); const vec<CRef>& cls = occurs.lookup(v); if (value(v) != l_Undef || cls.size() == 0) return true; for (int i = 0; i < cls.size(); i++) if (!asymm(v, cls[i])) return false; return backwardSubsumptionCheck(); } static void mkElimClause(vec<uint32_t>& elimclauses, Lit x) { elimclauses.push(toInt(x)); elimclauses.push(1); } static void mkElimClause(vec<uint32_t>& elimclauses, Var v, Clause& c) { int first = elimclauses.size(); int v_pos = -1; // Copy clause to elimclauses-vector. Remember position where the // variable 'v' occurs: for (int i = 0; i < c.size(); i++){ elimclauses.push(toInt(c[i])); if (var(c[i]) == v) v_pos = i + first; } assert(v_pos != -1); // Swap the first literal with the 'v' literal, so that the literal // containing 'v' will occur first in the clause: uint32_t tmp = elimclauses[v_pos]; elimclauses[v_pos] = elimclauses[first]; elimclauses[first] = tmp; // Store the length of the clause last: elimclauses.push(c.size()); } bool SimpSolver::eliminateVar(Var v) { assert(!frozen[v]); assert(!isEliminated(v)); assert(value(v) == l_Undef); // Split the occurrences into positive and negative: // const vec<CRef>& cls = occurs.lookup(v); vec<CRef> pos, neg; for (int i = 0; i < cls.size(); i++) (find(ca[cls[i]], mkLit(v)) ? pos : neg).push(cls[i]); // Check wether the increase in number of clauses stays within the allowed ('grow'). Moreover, no // clause must exceed the limit on the maximal clause size (if it is set): // int cnt = 0; int clause_size = 0; for (int i = 0; i < pos.size(); i++) for (int j = 0; j < neg.size(); j++) if (merge(ca[pos[i]], ca[neg[j]], v, clause_size) && (++cnt > cls.size() + grow || (clause_lim != -1 && clause_size > clause_lim))) return true; // Delete and store old clauses eliminated[v] = true; setDecisionVar(v, false); eliminated_vars++; if (pos.size() > neg.size()){ for (int i = 0; i < neg.size(); i++) mkElimClause(elimclauses, v, ca[neg[i]]); mkElimClause(elimclauses, mkLit(v)); }else{ for (int i = 0; i < pos.size(); i++) mkElimClause(elimclauses, v, ca[pos[i]]); mkElimClause(elimclauses, ~mkLit(v)); } // Produce clauses in cross product: vec<Lit>& resolvent = add_tmp; for (int i = 0; i < pos.size(); i++) for (int j = 0; j < neg.size(); j++) if (merge(ca[pos[i]], ca[neg[j]], v, resolvent) && !addClause_(resolvent)) return false; for (int i = 0; i < cls.size(); i++) removeClause(cls[i]); // Free occurs list for this variable: occurs[v].clear(true); // Free watchers lists for this variable, if possible: if (watches[ mkLit(v)].size() == 0) watches[ mkLit(v)].clear(true); if (watches[~mkLit(v)].size() == 0) watches[~mkLit(v)].clear(true); return backwardSubsumptionCheck(); } bool SimpSolver::substitute(Var v, Lit x) { assert(!frozen[v]); assert(!isEliminated(v)); assert(value(v) == l_Undef); if (!ok) return false; eliminated[v] = true; setDecisionVar(v, false); const vec<CRef>& cls = occurs.lookup(v); vec<Lit>& subst_clause = add_tmp; for (int i = 0; i < cls.size(); i++){ Clause& c = ca[cls[i]]; subst_clause.clear(); for (int j = 0; j < c.size(); j++){ Lit p = c[j]; subst_clause.push(var(p) == v ? x ^ sign(p) : p); } if (!addClause_(subst_clause)) return ok = false; removeClause(cls[i]); } return true; } void SimpSolver::extendModel() { int i, j; Lit x; if(model.size()==0) model.growTo(nVars()); for (i = elimclauses.size()-1; i > 0; i -= j){ for (j = elimclauses[i--]; j > 1; j--, i--) if (modelValue(toLit(elimclauses[i])) != l_False) goto next; x = toLit(elimclauses[i]); model[var(x)] = lbool(!sign(x)); next:; } } bool SimpSolver::eliminate(bool turn_off_elim) { if (!simplify()) { ok = false; return false; } else if (!use_simplification) return true; // Main simplification loop: // int toPerform = clauses.size()<=4800000; while (toPerform && (n_touched > 0 || bwdsub_assigns < trail.size() || elim_heap.size() > 0)){ gatherTouchedClauses(); // printf(" ## (time = %6.2f s) BWD-SUB: queue = %d, trail = %d\n", cpuTime(), subsumption_queue.size(), trail.size() - bwdsub_assigns); if ((subsumption_queue.size() > 0 || bwdsub_assigns < trail.size()) && !backwardSubsumptionCheck(true)){ ok = false; goto cleanup; } // Empty elim_heap and return immediately on user-interrupt: if (asynch_interrupt){ assert(bwdsub_assigns == trail.size()); assert(subsumption_queue.size() == 0); assert(n_touched == 0); elim_heap.clear(); goto cleanup; } // printf(" ## (time = %6.2f s) ELIM: vars = %d\n", cpuTime(), elim_heap.size()); for (int cnt = 0; !elim_heap.empty(); cnt++){ Var elim = elim_heap.removeMin(); if (asynch_interrupt) break; if (isEliminated(elim) || value(elim) != l_Undef) continue; if (use_asymm){ // Temporarily freeze variable. Otherwise, it would immediately end up on the queue again: bool was_frozen = frozen[elim]; frozen[elim] = true; if (!asymmVar(elim)){ ok = false; goto cleanup; } frozen[elim] = was_frozen; } // At this point, the variable may have been set by assymetric branching, so check it // again. Also, don't eliminate frozen variables: if (use_elim && value(elim) == l_Undef && !frozen[elim] && !eliminateVar(elim)){ ok = false; goto cleanup; } checkGarbage(simp_garbage_frac); } assert(subsumption_queue.size() == 0); } cleanup: // If no more simplification is needed, free all simplification-related data structures: if (turn_off_elim){ touched .clear(true); occurs .clear(true); n_occ .clear(true); elim_heap.clear(true); subsumption_queue.clear(true); use_simplification = false; remove_satisfied = true; ca.extra_clause_field = false; // Force full cleanup (this is safe and desirable since it only happens once): rebuildOrderHeap(); garbageCollect(); }else{ // Cheaper cleanup: cleanUpClauses(); // TODO: can we make 'cleanUpClauses()' not be linear in the problem size somehow? checkGarbage(); } if (verbosity > 0 && elimclauses.size() > 0) printf("c | Eliminated clauses: %10.2f Mb |\n", double(elimclauses.size() * sizeof(uint32_t)) / (1024*1024)); return ok; } void SimpSolver::cleanUpClauses() { occurs.cleanAll(); int i,j; for (i = j = 0; i < clauses.size(); i++) if (ca[clauses[i]].mark() == 0) clauses[j++] = clauses[i]; clauses.shrink(i - j); } //================================================================================================= // Garbage Collection methods: void SimpSolver::relocAll(ClauseAllocator& to) { if (!use_simplification) return; // All occurs lists: // for (int i = 0; i < nVars(); i++){ vec<CRef>& cs = occurs[i]; for (int j = 0; j < cs.size(); j++) ca.reloc(cs[j], to); } // Subsumption queue: // for (int i = 0; i < subsumption_queue.size(); i++) ca.reloc(subsumption_queue[i], to); // Temporary clause: // ca.reloc(bwdsub_tmpunit, to); } void SimpSolver::garbageCollect() { // Initialize the next region to a size corresponding to the estimated utilization degree. This // is not precise but should avoid some unnecessary reallocations for the new region: ClauseAllocator to(ca.size() - ca.wasted()); cleanUpClauses(); to.extra_clause_field = ca.extra_clause_field; // NOTE: this is important to keep (or lose) the extra fields. relocAll(to); Solver::relocAll(to); if (verbosity >= 2) printf("c | Garbage collection: %12d bytes => %12d bytes |\n", ca.size()*ClauseAllocator::Unit_Size, to.size()*ClauseAllocator::Unit_Size); to.moveTo(ca); }
691211d94b96b4d2631970b30035f3df32948f5b
ad210e9189028c6ca1e69e276df7fee4c45bcdbe
/d6k/trunk/src/fes/nb_svc.h
7c64ab166ec63f3a3a0447f9acd7e55c2573d41d
[]
no_license
QtLab/best
a9ad00a93df9600b4b3d27bc6b158df2b1cb2e1c
f7420a8c50456fb484847c124d7d0e106d3b11e6
refs/heads/master
2021-06-20T03:36:32.346091
2017-07-06T05:28:11
2017-07-06T05:28:11
null
0
0
null
null
null
null
GB18030
C++
false
false
2,305
h
/*! @file nb_svc.h <PRE> ******************************************************************************** 模块名 : 文件名 : nb_svc.h 文件实现功能 : 网络总线模块适配器 作者 : LiJin 版本 : V1.00 -------------------------------------------------------------------------------- 备注 : <其它说明> -------------------------------------------------------------------------------- 修改记录 : 日 期 版本 修改人 修改内容 ******************************************************************************** </PRE> * @brief 网络总线模块适配器 * @author LiJin * @version 1.0 * @date 2016.09.01 *******************************************************************************/ #ifndef NB_SVC_MODULE_H #define NB_SVC_MODULE_H #include "base_module.h" #include "datatypes.h" #include <deque> struct NET_CONFIG; struct NODE_CONFIG; struct BASE_MSG; struct AINALARM_MSG; struct NODE; class CServer; class CDbSvc; struct EMSG_BUF; template<typename DBSvc> class CRTNetMsgPacker; class CNetbusSvc : public CBaseModule { public: CNetbusSvc(CFesSvc* pServer,const std::string& szMailBoxName, int &MailID); virtual ~CNetbusSvc(void); public: virtual bool Initialize(const char *pszDataPath, unsigned int nMode); virtual void Run(); virtual void Shutdown(); protected: virtual void MainLoop(); void UpdateNetState(); void TransEmails(); void TransDataInfo(); void SendDinToSvr(); void SendAinToSvr(); void SendAlarmData(); void SendAinAlarmData(EMSG_BUF *pEMsgBuf); EMSG_BUF * m_pBuf; // size_t PackageAllRTData(std::shared_ptr<CDbSvc> pDB,unsigned char *pInBuff,size_t nBuffLen); private: NODE *m_pNodes; unsigned int m_nNodeCount; NODE_CONFIG * m_pNodeConfigs; std::shared_ptr<NET_CONFIG> m_pNetConfig; std::shared_ptr< CRTNetMsgPacker<CDbSvc> > m_pNetMsgPacker; bool m_bIsRedNode; //! 本机是否是冗余节点 std::deque<BASE_MSG*> m_arrAlarmMsg; struct AIN_ALARM_DATA { int32u DataCount; int32u DataTotalLen; AINALARM_MSG *pMsg; }; //! 模拟量的越限复限告警,模拟量发生告警时,可以不立即上送,缓存5-10秒左右再上送 std::deque<AINALARM_MSG*> m_arrAinAlarmMsg; }; #endif // NB_SVC_MODULE_H /** @}*/
95cf98be10fd460eb6b6d6697218990d1fc50948
24cd93a27b4b8bf66002747e04717b09a8a076a1
/Rush00/AGameEntity.cpp
26a89553d2fcc9ec28eb66555b8a3750a59418bb
[]
no_license
ygarrot/PiscineCpp
d4a8895bb7817a49aa017e09a0941a9985d024b6
50b061bf65c08aca72ae17b9d469302317467633
refs/heads/master
2021-10-11T04:16:11.622207
2019-01-21T20:18:05
2019-01-21T20:18:05
166,874,429
0
0
null
null
null
null
UTF-8
C++
false
false
2,764
cpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* AGameEntity.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: jdavin <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/01/12 11:57:55 by jdavin #+# #+# */ /* Updated: 2019/01/13 21:56:46 by ygarrot ### ########.fr */ /* */ /* ************************************************************************** */ #include "AGameEntity.hpp" AGameEntity::AGameEntity() : _type("None"){ this->_color = COLOR_WHITE; } AGameEntity::~AGameEntity(void) { } AGameEntity::AGameEntity(AGameEntity const &src) { *this = src; } AGameEntity &AGameEntity::operator=(AGameEntity const & src){ this->_color = src._color; this->_speed = src._speed; this->_position = src._position; /* this->_hitbox = src._hitbox; */ return *this; } int AGameEntity::move(char ***map, t_pos limit, Dashboard *board) { (void)map; (void)board; (void)limit; return 0; } t_pos AGameEntity::getPos() const { return this->_position; } int AGameEntity::getColor() const { return this->_color; } void AGameEntity::displayInfo(WINDOW *info) { mvwprintw(info, 1, (COLS *4) /5, "x:%d, y:%d", this->_position.x, this->_position.y); } void AGameEntity::deleteFromMap(char ***map, t_pos pos) const { int x; while (pos.y-- >= 0) for (x = pos.x; x >= 0; x--) { (*map)[this->_position.y - pos.y][this->_position.x - x] = 0; } } int AGameEntity::getIntoMap(char ***map, t_pos limit, Dashboard *board) const { int y, x; t_pos tmp; AGameEntity *collided; for (y = 0 ; y < this->_hitboxSize[Y]; y++) { for ( x = 0 ; x < this->_hitboxSize[X]; x++) { if (this->_hitbox[x][y]) { tmp.x = this->_position.x + x; tmp.y = this->_position.y + y; if (tmp.x > 0 && tmp.x < limit.x && tmp.y >0 && tmp.y < limit.y) { if ((*map)[tmp.y][tmp.x]) { if ((collided = board->getEntity(getFromPosition, (void*)&tmp)) && collided != this) { collided->deleteFromMap(map, (t_pos){collided->_hitboxSize[X], collided->_hitboxSize[Y]}); board->deleteEntity(collided); } this->deleteFromMap(map, (t_pos){x, y}); return 0; } (*map)[tmp.y][tmp.x] = this->_hitbox[x][y]; } } } } return 1; }
043fbc59ab9dbb7442302ecfd918f8a82c312521
2a7e77565c33e6b5d92ce6702b4a5fd96f80d7d0
/fuzzedpackages/clusternor/src/cknor/libman/fcm.hpp
d715871dec350178c92a3b15513ee8e0b98c4d5d
[ "Apache-2.0" ]
permissive
akhikolla/testpackages
62ccaeed866e2194652b65e7360987b3b20df7e7
01259c3543febc89955ea5b79f3a08d3afe57e95
refs/heads/master
2023-02-18T03:50:28.288006
2021-01-18T13:23:32
2021-01-18T13:23:32
329,981,898
7
1
null
null
null
null
UTF-8
C++
false
false
2,598
hpp
/* * Copyright 2016 neurodata (http://neurodata.io/) * Written by Disa Mhembere ([email protected]) * * This file is part of knor * * 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 CURRENT_KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __KNOR_FCM_HPP__ #define __KNOR_FCM_HPP__ #include "thread.hpp" namespace knor { namespace base { template <typename T> class dense_matrix; } } namespace knor { class fcm : public thread { protected: unsigned nprocrows; // How many rows to process base::dense_matrix<double>* centers; base::dense_matrix<double>* um; // Contribution matrix base::dense_matrix<double>* innerprod; unsigned nclust; unsigned fuzzindex; fcm(const int node_id, const unsigned thd_id, const unsigned start_rid, const unsigned nprocrows, const unsigned ncol, const unsigned nclust, const unsigned fuzzindex, base::dense_matrix<double>* um, base::dense_matrix<double>* centers, // Partition of result matrix of um.dot(data) const std::string fn, base::dist_t dist_metric); public: static thread::ptr create( const int node_id, const unsigned thd_id, const unsigned start_rid, const unsigned nprocrows, const unsigned ncol, const unsigned nclust, const unsigned fuzzindex, base::dense_matrix<double>* um, base::dense_matrix<double>* centers, const std::string fn, base::dist_t dist_metric) { return thread::ptr( new fcm(node_id, thd_id, start_rid, nprocrows, ncol, nclust, fuzzindex, um, centers, fn, dist_metric)); } void start(const thread_state_t state) override; // Allocate and move data using this thread void Estep(); void Mstep(); void run() override; base::dense_matrix<double>* get_innerprod() { return innerprod; } ~fcm(); }; } #endif
1b7393945c97f5dd0f59c4756bf7c8c19d4eef44
2743ed11026e2fba43799799b04d0df55af30365
/abclient/abclient/MissionMapWindow.cpp
776662633dba1b24ed42837de7924f29161f126c
[]
no_license
lineCode/ABx
bb792946429bf60fee38da609b0c36c89ec34990
b726a2ada8815e8d4c8a838f823ffd3ab2e2b81b
refs/heads/master
2022-01-22T06:13:49.170390
2019-07-19T20:03:31
2019-07-19T20:03:31
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,985
cpp
#include "stdafx.h" #include "MissionMapWindow.h" #include "Shortcuts.h" #include "AbEvents.h" #include "LevelManager.h" #include "Player.h" void MissionMapWindow::RegisterObject(Context* context) { context->RegisterFactory<MissionMapWindow>(); } MissionMapWindow::MissionMapWindow(Context* context) : Window(context) { SetName("MissionMapWindow"); SetDefaultStyle(GetSubsystem<UI>()->GetRoot()->GetDefaultStyle()); ResourceCache* cache = GetSubsystem<ResourceCache>(); XMLFile* file = cache->GetResource<XMLFile>("UI/MissionMapWindow.xml"); LoadXML(file->GetRoot()); // It seems this isn't loaded from the XML file SetLayoutMode(LM_VERTICAL); SetLayoutBorder(IntRect(4, 4, 4, 4)); SetPivot(0, 0); SetOpacity(0.9f); SetResizable(true); SetMovable(true); Texture2D* tex = cache->GetResource<Texture2D>("Textures/UI.png"); SetTexture(tex); SetImageRect(IntRect(48, 0, 64, 16)); SetBorder(IntRect(4, 4, 4, 4)); SetImageBorder(IntRect(0, 0, 0, 0)); SetResizeBorder(IntRect(8, 8, 8, 8)); SetBringToFront(true); SetBringToBack(true); Shortcuts* scs = GetSubsystem<Shortcuts>(); Text* caption = dynamic_cast<Text*>(GetChild("CaptionText", true)); caption->SetText(scs->GetCaption(AbEvents::E_SC_TOGGLEMISSIONMAPWINDOW, "Mission Map", true)); SetSize(300, 300); auto* graphics = GetSubsystem<Graphics>(); SetPosition(graphics->GetWidth() - GetWidth() - 5, graphics->GetHeight() / 2 - (GetHeight() / 2)); SetStyleAuto(); zoom_ = 10; UpdateLayout(); SubscribeToEvents(); } void MissionMapWindow::OnDragBegin(const IntVector2& position, const IntVector2& screenPosition, int buttons, int qualifiers, Cursor* cursor) { Window::OnDragBegin(position, screenPosition, buttons, qualifiers, cursor); } void MissionMapWindow::SetScene(SharedPtr<Scene> scene) { if (!scene) return; cameraNode_ = scene->CreateChild("MissionMapCamera"); cameraNode_->Rotate(Quaternion(-90.0f, Vector3::LEFT)); auto* camera = cameraNode_->CreateComponent<Camera>(); camera->SetFarClip(2000.0f); camera->SetOrthographic(true); camera->SetViewMask(128); // Because the rear viewport is rather small, disable occlusion culling from it. Use the camera's // "view override flags" for this. We could also disable eg. shadows or force low material quality // if we wanted camera->SetViewOverrideFlags(VO_DISABLE_OCCLUSION | VO_DISABLE_SHADOWS | VO_LOW_MATERIAL_QUALITY); cameraNode_->SetPosition(Vector3(0.0f, 5.0f, 0.0f)); BorderImage* container = dynamic_cast<BorderImage*>(GetChild("Container", true)); renderTexture_ = new Texture2D(context_); renderTexture_->SetSize(4096, 4096, Graphics::GetRGBFormat(), TEXTURE_RENDERTARGET); renderTexture_->SetFilterMode(FILTER_BILINEAR); container->SetTexture(renderTexture_); FitTexture(); // Get the texture's RenderSurface object (exists when the texture has been created in rendertarget mode) // and define the viewport for rendering the second scene, similarly as how backbuffer viewports are defined // to the Renderer subsystem. By default the texture viewport will be updated when the texture is visible // in the main view RenderSurface* surface = renderTexture_->GetRenderSurface(); SharedPtr<Viewport> rttViewport(new Viewport(context_, scene, cameraNode_->GetComponent<Camera>())); // ResourceCache* cache = GetSubsystem<ResourceCache>(); // SharedPtr<RenderPath> effectRenderPath = rttViewport->GetRenderPath()->Clone(); // effectRenderPath->Append(cache->GetResource<XMLFile>("PostProcess/GammaCorrection.xml")); // effectRenderPath->SetEnabled("GammaCorrection", true); // rttViewport->SetRenderPath(effectRenderPath); // rttViewport->SetRenderPath(cache->GetResource<XMLFile>("RenderPaths/MiniMap.xml")); surface->SetViewport(0, rttViewport); surface->SetUpdateMode(SURFACE_UPDATEALWAYS); } void MissionMapWindow::FitTexture() { if (!renderTexture_) return; BorderImage* container = dynamic_cast<BorderImage*>(GetChild("Container", true)); /* int x = ((renderTexture_->GetWidth() / 2) - (container->GetWidth() / 2)); int y = ((renderTexture_->GetHeight() / 2) - (container->GetHeight() / 2)); int width = container->GetWidth() * zoom_; int height = container->GetHeight() * zoom_; container->SetImageRect(IntRect(x, y, (x + width), (y + height))); */ container->SetImageRect(IntRect(0, 0, renderTexture_->GetWidth(), renderTexture_->GetHeight())); } void MissionMapWindow::SubscribeToEvents() { Button* closeButton = dynamic_cast<Button*>(GetChild("CloseButton", true)); SubscribeToEvent(closeButton, E_RELEASED, URHO3D_HANDLER(MissionMapWindow, HandleCloseClicked)); SubscribeToEvent(E_UPDATE, URHO3D_HANDLER(MissionMapWindow, HandleUpdate)); SubscribeToEvent(this, E_RESIZED, URHO3D_HANDLER(MissionMapWindow, HandleResized)); SubscribeToEvent(this, E_VISIBLECHANGED, URHO3D_HANDLER(MissionMapWindow, HandleVisibleChanged)); } void MissionMapWindow::HandleCloseClicked(StringHash, VariantMap&) { SetVisible(false); } void MissionMapWindow::HandleUpdate(StringHash, VariantMap&) { LevelManager* lm = GetSubsystem<LevelManager>(); SharedPtr<Player> p = lm->GetPlayer(); if (p) { Vector3 pos = p->GetNode()->GetPosition(); pos.y_ = 100.0f; cameraNode_->SetPosition(pos); } } void MissionMapWindow::HandleResized(StringHash, VariantMap&) { FitTexture(); } void MissionMapWindow::HandleVisibleChanged(StringHash, VariantMap& eventData) { if (!renderTexture_) return; using namespace VisibleChanged; bool visible = eventData[P_VISIBLE].GetBool(); RenderSurface* surface = renderTexture_->GetRenderSurface(); if (visible) surface->SetUpdateMode(SURFACE_UPDATEALWAYS); else surface->SetUpdateMode(SURFACE_MANUALUPDATE); }
91dc2d3f1bf0d94e0e5f294f2977c240047f305e
560090526e32e009e2e9331e8a2b4f1e7861a5e8
/Compiled/blaze-3.2/blazetest/src/mathtest/smatdmatsub/LCaUDb.cpp
ef61dc9b4dbf8259585c38560185a2d3ccf00014
[ "BSD-3-Clause" ]
permissive
jcd1994/MatlabTools
9a4c1f8190b5ceda102201799cc6c483c0a7b6f7
2cc7eac920b8c066338b1a0ac495f0dbdb4c75c1
refs/heads/master
2021-01-18T03:05:19.351404
2018-02-14T02:17:07
2018-02-14T02:17:07
84,264,330
2
0
null
null
null
null
UTF-8
C++
false
false
4,171
cpp
//================================================================================================= /*! // \file src/mathtest/smatdmatsub/LCaUDb.cpp // \brief Source file for the LCaUDb sparse matrix/dense matrix subtraction math test // // Copyright (C) 2012-2017 Klaus Iglberger - All Rights Reserved // // This file is part of the Blaze library. You can redistribute it and/or modify it under // the terms of the New (Revised) BSD License. Redistribution and use in source and binary // forms, with or without modification, are permitted provided that the following conditions // are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of // conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other materials // provided with the distribution. // 3. Neither the names of the Blaze development group 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. */ //================================================================================================= //************************************************************************************************* // Includes //************************************************************************************************* #include <cstdlib> #include <iostream> #include <blaze/math/CompressedMatrix.h> #include <blaze/math/DynamicMatrix.h> #include <blaze/math/LowerMatrix.h> #include <blaze/math/UpperMatrix.h> #include <blazetest/mathtest/Creator.h> #include <blazetest/mathtest/smatdmatsub/OperationTest.h> #include <blazetest/system/MathTest.h> //================================================================================================= // // MAIN FUNCTION // //================================================================================================= //************************************************************************************************* int main() { std::cout << " Running 'LCaUDb'..." << std::endl; using blazetest::mathtest::TypeA; using blazetest::mathtest::TypeB; try { // Matrix type definitions typedef blaze::LowerMatrix< blaze::CompressedMatrix<TypeA> > LCa; typedef blaze::UpperMatrix< blaze::DynamicMatrix<TypeB> > UDb; // Creator type definitions typedef blazetest::Creator<LCa> CLCa; typedef blazetest::Creator<UDb> CUDb; // Running tests with small matrices for( size_t i=0UL; i<=6UL; ++i ) { for( size_t j=0UL; j<=LCa::maxNonZeros( i ); ++j ) { RUN_SMATDMATSUB_OPERATION_TEST( CLCa( i, j ), CUDb( i ) ); } } // Running tests with large matrices RUN_SMATDMATSUB_OPERATION_TEST( CLCa( 67UL, 7UL ), CUDb( 67UL ) ); RUN_SMATDMATSUB_OPERATION_TEST( CLCa( 128UL, 16UL ), CUDb( 128UL ) ); } catch( std::exception& ex ) { std::cerr << "\n\n ERROR DETECTED during sparse matrix/dense matrix subtraction:\n" << ex.what() << "\n"; return EXIT_FAILURE; } return EXIT_SUCCESS; } //*************************************************************************************************
d0560d14455ca46d34634ede8215548c33b34056
2577281a0540e416f5c8663ccfbd9bd24f0976e0
/g4ch.cc
fec468d57ac7a9ce482d556cda6ba8bbb8c0acdd
[ "CC-BY-4.0" ]
permissive
changhyeuk/g4ch
f139772531b98f8b7fa1ea131a0bc66adbda4e77
57f79c230445efbbdcfda122389ae8ce4a571cb0
refs/heads/master
2021-01-17T17:53:39.103478
2016-06-13T03:36:04
2016-06-13T03:36:04
60,756,503
0
0
null
null
null
null
UTF-8
C++
false
false
4,404
cc
// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... #include "G4RunManager.hh" #include "G4UImanager.hh" #include "Randomize.hh" #include "DetectorConstruction.hh" #include "PhysicsList.hh" #include "PrimaryGeneratorAction.hh" #include "RunAction.hh" #include "EventAction.hh" #include "SteppingAction.hh" #include "SteppingVerbose.hh" #ifdef G4VIS_USE #include "G4VisExecutive.hh" #endif #ifdef G4UI_USE #include "G4UIExecutive.hh" #endif //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... int main(int argc,char** argv) { // Choose the Random engine // CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine); // User Verbose output class // G4VSteppingVerbose::SetInstance(new SteppingVerbose); // Construct the default run manager // G4RunManager * runManager = new G4RunManager; // Set mandatory initialization classes // runManager->SetUserInitialization(new DetectorConstruction); // runManager->SetUserInitialization(new PhysicsList); // Set user action classes // runManager->SetUserAction(new PrimaryGeneratorAction); // runManager->SetUserAction(new RunAction); // runManager->SetUserAction(new EventAction); // runManager->SetUserAction(new SteppingAction); // Initialize G4 kernel // runManager->Initialize(); #ifdef G4VIS_USE // Initialize visualization G4VisManager* visManager = new G4VisExecutive; // G4VisExecutive can take a verbosity argument - see /vis/verbose guidance. // G4VisManager* visManager = new G4VisExecutive("Quiet"); visManager->Initialize(); #endif // Get the pointer to the User Interface manager G4UImanager* UImanager = G4UImanager::GetUIpointer(); if (argc!=1) // batch mode { G4String command = "/control/execute "; G4String fileName = argv[1]; UImanager->ApplyCommand(command+fileName); } else { // interactive mode : define UI session #ifdef G4UI_USE G4UIExecutive* ui = new G4UIExecutive(argc, argv); #ifdef G4VIS_USE UImanager->ApplyCommand("/control/execute vis.mac"); #endif if (ui->IsGUI()) UImanager->ApplyCommand("/control/execute gui.mac"); ui->SessionStart(); delete ui; #endif } // Job termination // Free the store: user actions, physics_list and detector_description are // owned and deleted by the run manager, so they should not // be deleted in the main() program ! #ifdef G4VIS_USE delete visManager; #endif delete runManager; return 0; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
d110d5fd2146f763c989790e2807f15c5fbf836c
46279163a543cd8820bdc38133404d79e787c5d2
/test/cpp/api/namespace.cpp
0ee5b70b9375ac1c0ee2cfe75b52ea9181583eda
[ "BSD-3-Clause", "LicenseRef-scancode-generic-cla", "BSL-1.0", "Apache-2.0", "BSD-2-Clause" ]
permissive
erwincoumans/pytorch
31738b65e7b998bfdc28d0e8afa7dadeeda81a08
ae9f39eb580c4d92157236d64548b055f71cf14b
refs/heads/master
2023-01-23T10:27:33.628897
2020-12-06T01:22:00
2020-12-06T01:23:40
318,930,000
5
1
NOASSERTION
2020-12-06T01:58:57
2020-12-06T01:58:56
null
UTF-8
C++
false
false
692
cpp
#include <gtest/gtest.h> #include <torch/torch.h> struct Node {}; // If `torch::autograd::Note` is leaked into the root namespace, the following compile error would throw: // ``` // void NotLeakingSymbolsFromTorchAutogradNamespace_test_func(Node *node) {} // ^ // error: reference to `Node` is ambiguous // ``` void NotLeakingSymbolsFromTorchAutogradNamespace_test_func(Node *node) {} TEST(NamespaceTests, NotLeakingSymbolsFromTorchAutogradNamespace) { // Checks that we are not leaking symbols from the // `torch::autograd` namespace to the root namespace NotLeakingSymbolsFromTorchAutogradNamespace_test_func(nullptr); }
85aec1b3b368ee513130feab34d0ff3e4d9b75ae
f81b774e5306ac01d2c6c1289d9e01b5264aae70
/chrome/browser/ui/ash/chrome_capture_mode_delegate.cc
495fedc84a68346ed837d863a486e50f62ae0a70
[ "BSD-3-Clause" ]
permissive
waaberi/chromium
a4015160d8460233b33fe1304e8fd9960a3650a9
6549065bd785179608f7b8828da403f3ca5f7aab
refs/heads/master
2022-12-13T03:09:16.887475
2020-09-05T20:29:36
2020-09-05T20:29:36
293,153,821
1
1
BSD-3-Clause
2020-09-05T21:02:50
2020-09-05T21:02:49
null
UTF-8
C++
false
false
1,616
cc
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ui/ash/chrome_capture_mode_delegate.h" #include "base/files/file_path.h" #include "base/i18n/time_formatting.h" #include "chrome/browser/download/download_prefs.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/pref_names.h" #include "chromeos/login/login_state/login_state.h" #include "components/prefs/pref_service.h" ChromeCaptureModeDelegate::ChromeCaptureModeDelegate() = default; ChromeCaptureModeDelegate::~ChromeCaptureModeDelegate() = default; base::FilePath ChromeCaptureModeDelegate::GetActiveUserDownloadsDir() const { DCHECK(chromeos::LoginState::Get()->IsUserLoggedIn()); DownloadPrefs* download_prefs = DownloadPrefs::FromBrowserContext(ProfileManager::GetActiveUserProfile()); return download_prefs->DownloadPath(); } void ChromeCaptureModeDelegate::ShowScreenCaptureItemInFolder( const base::FilePath& file_path) { platform_util::ShowItemInFolder(ProfileManager::GetActiveUserProfile(), file_path); } bool ChromeCaptureModeDelegate::Uses24HourFormat() const { Profile* profile = ProfileManager::GetActiveUserProfile(); // TODO(afakhry): Consider moving |prefs::kUse24HourClock| to ash/public so // we can do this entirely in ash. if (profile) return profile->GetPrefs()->GetBoolean(prefs::kUse24HourClock); return base::GetHourClockType() == base::k24HourClock; }
2c730ed6661abbd5f9be24bed3ff002a6dcc0655
3da0b0276bc8c3d7d1bcdbabfb0e763a38d3a24c
/unpassed/2443.cpp
81e8575fea74b97b5b24169746d651259117fe3e
[]
no_license
usherfu/zoj
4af6de9798bcb0ffa9dbb7f773b903f630e06617
8bb41d209b54292d6f596c5be55babd781610a52
refs/heads/master
2021-05-28T11:21:55.965737
2009-12-15T07:58:33
2009-12-15T07:58:33
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,094
cpp
#include<iostream> #include<set> #include<string> using namespace std; enum { NO = 9, }; struct Node { int submit; set<string> aclist; int total; // total time; }; Node prob[NO]; void init(){ int i; for(i=0; i<NO; i++){ prob[i].submit = 0; prob[i].total = 0; prob[i].aclist.clear(); } } void print(Node &n){ double rate; int ac = n.aclist.size(); cout<<" "<<ac; if(ac ==0) goto end; rate = n.submit; rate /= ac; cout.setf(ios::fixed); cout.precision(2); cout<<" "<<rate; rate = n.total; rate /= ac; cout.setf(ios::fixed); cout.precision(2); cout<<" "<<rate; end: cout<<endl; } void fun(int n){ init(); string name; int time ; char p,s; while(n--){ cin>>time>>name>>p>>s; p -= 'A'; if(prob[p].aclist.find(name)!= prob[p].aclist.end()){ continue; } prob[p].submit ++; if(s=='A'){ prob[p].aclist.insert(name); prob[p].total += time; } } for(int i=0; i<NO; i++){ cout<< char(i+'A'); print(prob[i]); } } int main(){ int num; int tstcase = 0; while(cin>>num){ if(tstcase++) cout<<endl; fun(num); } return 0; }