blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
5
140
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
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
listlengths
1
1
author_id
stringlengths
0
158
b6dead724e94465f97ede6cb54424ba103ce9f45
887f3a72757ff8f691c1481618944b727d4d9ff5
/third_party/gecko_1.9.2/win32/gecko_sdk/include/nsIDOMSVGAngle.h
b0c8a56f5eb1b472b18294866d11bbfa5434fadc
[]
no_license
zied-ellouze/gears
329f754f7f9e9baa3afbbd652e7893a82b5013d1
d3da1ed772ed5ae9b82f46f9ecafeb67070d6899
refs/heads/master
2020-04-05T08:27:05.806590
2015-09-03T13:07:39
2015-09-03T13:07:39
41,813,794
1
0
null
null
null
null
UTF-8
C++
false
false
7,845
h
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/mozilla-1.9.2-win32-xulrunner/build/dom/interfaces/svg/nsIDOMSVGAngle.idl */ #ifndef __gen_nsIDOMSVGAngle_h__ #define __gen_nsIDOMSVGAngle_h__ #ifndef __gen_domstubs_h__ #include "domstubs.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif /* starting interface: nsIDOMSVGAngle */ #define NS_IDOMSVGANGLE_IID_STR "58b6190e-37b3-412a-ba02-1d5ad6c6ea7c" #define NS_IDOMSVGANGLE_IID \ {0x58b6190e, 0x37b3, 0x412a, \ { 0xba, 0x02, 0x1d, 0x5a, 0xd6, 0xc6, 0xea, 0x7c }} /** * The nsIDOMSVGAngle interface is the interface to an SVG angle. * * For more information on this interface please see * http://www.w3.org/TR/SVG11/types.html#InterfaceSVGAngle * */ class NS_NO_VTABLE NS_SCRIPTABLE nsIDOMSVGAngle : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMSVGANGLE_IID) enum { SVG_ANGLETYPE_UNKNOWN = 0U }; enum { SVG_ANGLETYPE_UNSPECIFIED = 1U }; enum { SVG_ANGLETYPE_DEG = 2U }; enum { SVG_ANGLETYPE_RAD = 3U }; enum { SVG_ANGLETYPE_GRAD = 4U }; /* readonly attribute unsigned short unitType; */ NS_SCRIPTABLE NS_IMETHOD GetUnitType(PRUint16 *aUnitType) = 0; /* attribute float value; */ NS_SCRIPTABLE NS_IMETHOD GetValue(float *aValue) = 0; NS_SCRIPTABLE NS_IMETHOD SetValue(float aValue) = 0; /* attribute float valueInSpecifiedUnits; */ NS_SCRIPTABLE NS_IMETHOD GetValueInSpecifiedUnits(float *aValueInSpecifiedUnits) = 0; NS_SCRIPTABLE NS_IMETHOD SetValueInSpecifiedUnits(float aValueInSpecifiedUnits) = 0; /* attribute DOMString valueAsString; */ NS_SCRIPTABLE NS_IMETHOD GetValueAsString(nsAString & aValueAsString) = 0; NS_SCRIPTABLE NS_IMETHOD SetValueAsString(const nsAString & aValueAsString) = 0; /* void newValueSpecifiedUnits (in unsigned short unitType, in float valueInSpecifiedUnits); */ NS_SCRIPTABLE NS_IMETHOD NewValueSpecifiedUnits(PRUint16 unitType, float valueInSpecifiedUnits) = 0; /* void convertToSpecifiedUnits (in unsigned short unitType); */ NS_SCRIPTABLE NS_IMETHOD ConvertToSpecifiedUnits(PRUint16 unitType) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMSVGAngle, NS_IDOMSVGANGLE_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSIDOMSVGANGLE \ NS_SCRIPTABLE NS_IMETHOD GetUnitType(PRUint16 *aUnitType); \ NS_SCRIPTABLE NS_IMETHOD GetValue(float *aValue); \ NS_SCRIPTABLE NS_IMETHOD SetValue(float aValue); \ NS_SCRIPTABLE NS_IMETHOD GetValueInSpecifiedUnits(float *aValueInSpecifiedUnits); \ NS_SCRIPTABLE NS_IMETHOD SetValueInSpecifiedUnits(float aValueInSpecifiedUnits); \ NS_SCRIPTABLE NS_IMETHOD GetValueAsString(nsAString & aValueAsString); \ NS_SCRIPTABLE NS_IMETHOD SetValueAsString(const nsAString & aValueAsString); \ NS_SCRIPTABLE NS_IMETHOD NewValueSpecifiedUnits(PRUint16 unitType, float valueInSpecifiedUnits); \ NS_SCRIPTABLE NS_IMETHOD ConvertToSpecifiedUnits(PRUint16 unitType); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSIDOMSVGANGLE(_to) \ NS_SCRIPTABLE NS_IMETHOD GetUnitType(PRUint16 *aUnitType) { return _to GetUnitType(aUnitType); } \ NS_SCRIPTABLE NS_IMETHOD GetValue(float *aValue) { return _to GetValue(aValue); } \ NS_SCRIPTABLE NS_IMETHOD SetValue(float aValue) { return _to SetValue(aValue); } \ NS_SCRIPTABLE NS_IMETHOD GetValueInSpecifiedUnits(float *aValueInSpecifiedUnits) { return _to GetValueInSpecifiedUnits(aValueInSpecifiedUnits); } \ NS_SCRIPTABLE NS_IMETHOD SetValueInSpecifiedUnits(float aValueInSpecifiedUnits) { return _to SetValueInSpecifiedUnits(aValueInSpecifiedUnits); } \ NS_SCRIPTABLE NS_IMETHOD GetValueAsString(nsAString & aValueAsString) { return _to GetValueAsString(aValueAsString); } \ NS_SCRIPTABLE NS_IMETHOD SetValueAsString(const nsAString & aValueAsString) { return _to SetValueAsString(aValueAsString); } \ NS_SCRIPTABLE NS_IMETHOD NewValueSpecifiedUnits(PRUint16 unitType, float valueInSpecifiedUnits) { return _to NewValueSpecifiedUnits(unitType, valueInSpecifiedUnits); } \ NS_SCRIPTABLE NS_IMETHOD ConvertToSpecifiedUnits(PRUint16 unitType) { return _to ConvertToSpecifiedUnits(unitType); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSIDOMSVGANGLE(_to) \ NS_SCRIPTABLE NS_IMETHOD GetUnitType(PRUint16 *aUnitType) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUnitType(aUnitType); } \ NS_SCRIPTABLE NS_IMETHOD GetValue(float *aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValue(aValue); } \ NS_SCRIPTABLE NS_IMETHOD SetValue(float aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetValue(aValue); } \ NS_SCRIPTABLE NS_IMETHOD GetValueInSpecifiedUnits(float *aValueInSpecifiedUnits) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValueInSpecifiedUnits(aValueInSpecifiedUnits); } \ NS_SCRIPTABLE NS_IMETHOD SetValueInSpecifiedUnits(float aValueInSpecifiedUnits) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetValueInSpecifiedUnits(aValueInSpecifiedUnits); } \ NS_SCRIPTABLE NS_IMETHOD GetValueAsString(nsAString & aValueAsString) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValueAsString(aValueAsString); } \ NS_SCRIPTABLE NS_IMETHOD SetValueAsString(const nsAString & aValueAsString) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetValueAsString(aValueAsString); } \ NS_SCRIPTABLE NS_IMETHOD NewValueSpecifiedUnits(PRUint16 unitType, float valueInSpecifiedUnits) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewValueSpecifiedUnits(unitType, valueInSpecifiedUnits); } \ NS_SCRIPTABLE NS_IMETHOD ConvertToSpecifiedUnits(PRUint16 unitType) { return !_to ? NS_ERROR_NULL_POINTER : _to->ConvertToSpecifiedUnits(unitType); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsDOMSVGAngle : public nsIDOMSVGAngle { public: NS_DECL_ISUPPORTS NS_DECL_NSIDOMSVGANGLE nsDOMSVGAngle(); private: ~nsDOMSVGAngle(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsDOMSVGAngle, nsIDOMSVGAngle) nsDOMSVGAngle::nsDOMSVGAngle() { /* member initializers and constructor code */ } nsDOMSVGAngle::~nsDOMSVGAngle() { /* destructor code */ } /* readonly attribute unsigned short unitType; */ NS_IMETHODIMP nsDOMSVGAngle::GetUnitType(PRUint16 *aUnitType) { return NS_ERROR_NOT_IMPLEMENTED; } /* attribute float value; */ NS_IMETHODIMP nsDOMSVGAngle::GetValue(float *aValue) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsDOMSVGAngle::SetValue(float aValue) { return NS_ERROR_NOT_IMPLEMENTED; } /* attribute float valueInSpecifiedUnits; */ NS_IMETHODIMP nsDOMSVGAngle::GetValueInSpecifiedUnits(float *aValueInSpecifiedUnits) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsDOMSVGAngle::SetValueInSpecifiedUnits(float aValueInSpecifiedUnits) { return NS_ERROR_NOT_IMPLEMENTED; } /* attribute DOMString valueAsString; */ NS_IMETHODIMP nsDOMSVGAngle::GetValueAsString(nsAString & aValueAsString) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsDOMSVGAngle::SetValueAsString(const nsAString & aValueAsString) { return NS_ERROR_NOT_IMPLEMENTED; } /* void newValueSpecifiedUnits (in unsigned short unitType, in float valueInSpecifiedUnits); */ NS_IMETHODIMP nsDOMSVGAngle::NewValueSpecifiedUnits(PRUint16 unitType, float valueInSpecifiedUnits) { return NS_ERROR_NOT_IMPLEMENTED; } /* void convertToSpecifiedUnits (in unsigned short unitType); */ NS_IMETHODIMP nsDOMSVGAngle::ConvertToSpecifiedUnits(PRUint16 unitType) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif #endif /* __gen_nsIDOMSVGAngle_h__ */
[ "gears.daemon@fe895e04-df30-0410-9975-d76d301b4276" ]
gears.daemon@fe895e04-df30-0410-9975-d76d301b4276
540a4070e31bedf5e311e967fbefbc99283caffa
e1f3de20ed59316c63d6637f78e4a9b327467e77
/Source/NGFX/examples/MiniEngine/Renderer/RenderProxy.h
d9dbd4fe67e3ba976babf39c87bd356e4d858a5d
[ "MIT" ]
permissive
ylyking/kaleido3d
c4c25521bb494c03d2fce6576a3e5e1c2508fb71
f986c48b322a3c9b33f9266a68614ad1bd4c1c14
refs/heads/master
2020-04-04T13:16:53.016060
2018-01-12T02:37:36
2018-02-09T05:08:47
null
0
0
null
null
null
null
UTF-8
C++
false
false
106
h
#pragma once namespace k3d { class RenderProxy { public: protected: private: }; }
[ "dsotsen@gmail.com" ]
dsotsen@gmail.com
726dc60d9768894703ffc25a311c6a03a308fee9
29e3a3092beef2960c2b2225b45fb9186616d301
/Yellow belt on C++. Final project/Source/node.cpp
69c204b673efb806602a1008acbb514b9a607ad9
[]
no_license
dklyuchinskiy/Database.-Yellow-belt-on-Cpp.
2b81fd61f69af6ecf0037acff4c00198a95a9833
0a540e526ef5cb5308b3f3b9fb2df14f8afed54f
refs/heads/master
2021-04-27T15:13:04.552988
2018-02-28T05:20:07
2018-02-28T05:20:07
122,465,181
0
0
null
null
null
null
UTF-8
C++
false
false
1,784
cpp
#include "node.h" bool DateComparisonNode::Evaluate(const Date& date, const string& my_event) { //cout << "DateComparisonNode" << endl; //cout << "In constructor: " << _date << endl; //cout << "To evaluate input: " << date << endl; if (_op == Comparison::Less) { return (date < _date); } else if (_op == Comparison::LessOrEqual) { return (date <= _date); } else if (_op == Comparison::Greater) { return (date > _date); } else if (_op == Comparison::GreaterOrEqual) { return (date >= _date); } else if (_op == Comparison::Equal) { return (date == _date); } else if (_op == Comparison::NotEqual) { return (date != _date); } else { throw invalid_argument("Invalid argument in DateComparisonNode"); } } bool EventComparisonNode::Evaluate(const Date& date, const string& my_event) { //cout << "EventComparisonNode" << endl; //cout << "In constructor: " << _event << endl; //cout << "To evaluate input: " << my_event << endl; if (_op == Comparison::Equal) { return (_event == my_event); } else if (_op == Comparison::NotEqual) { return (_event != my_event); } else { throw invalid_argument("Invalid argument in EventComparisonNode"); } } bool LogicalOperationNode::Evaluate(const Date& date, const string& my_event) { //cout << "LogicalOperationNode" << endl; if (_lop == LogicalOperation::And) { //cout << "And" << endl; return (_left->Evaluate(date, my_event) && _right->Evaluate(date, my_event)); } else if (_lop == LogicalOperation::Or) { //cout << "Or" << endl; return (_left->Evaluate(date, my_event) || _right->Evaluate(date, my_event)); } else { throw invalid_argument("Invalid argument in LogicalOperationNode"); } } bool EmptyNode::Evaluate(const Date& date, const string& my_event) { return true; }
[ "dmitriy_klyuchinskiy@mail.ru" ]
dmitriy_klyuchinskiy@mail.ru
b8d260aa5f189682c33698d37bd31fab83644b4f
51a4d1077581d562a9da50bd04490f5d61c603fd
/src/qt/qrcodedialog.cpp
41450f10bb1d6ad255a8d887db9fecd87aa280e1
[ "MIT" ]
permissive
Oraclecoin/TheBotCoin
11534cdf92b60de0cc618d8afd84194e20ebd724
a1a6b4cb126d8da018b801180e4ee068e59b28ef
refs/heads/master
2020-12-28T20:31:11.074933
2014-03-31T08:04:04
2014-03-31T08:04:04
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,313
cpp
#include "qrcodedialog.h" #include "ui_qrcodedialog.h" #include "bitcoinunits.h" #include "guiconstants.h" #include "guiutil.h" #include "optionsmodel.h" #include <QPixmap> #include <QUrl> #include <qrencode.h> QRCodeDialog::QRCodeDialog(const QString &addr, const QString &label, bool enableReq, QWidget *parent) : QDialog(parent), ui(new Ui::QRCodeDialog), model(0), address(addr) { ui->setupUi(this); setWindowTitle(QString("%1").arg(address)); ui->chkReqPayment->setVisible(enableReq); ui->lblAmount->setVisible(enableReq); ui->lnReqAmount->setVisible(enableReq); ui->lnLabel->setText(label); ui->btnSaveAs->setEnabled(false); genCode(); } QRCodeDialog::~QRCodeDialog() { delete ui; } void QRCodeDialog::setModel(OptionsModel *model) { this->model = model; if (model) connect(model, SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); // update the display unit, to not use the default ("TBN") updateDisplayUnit(); } void QRCodeDialog::genCode() { QString uri = getURI(); if (uri != "") { ui->lblQRCode->setText(""); QRcode *code = QRcode_encodeString(uri.toUtf8().constData(), 0, QR_ECLEVEL_L, QR_MODE_8, 1); if (!code) { ui->lblQRCode->setText(tr("Error encoding URI into QR Code.")); return; } myImage = QImage(code->width + 8, code->width + 8, QImage::Format_RGB32); myImage.fill(0xffffff); unsigned char *p = code->data; for (int y = 0; y < code->width; y++) { for (int x = 0; x < code->width; x++) { myImage.setPixel(x + 4, y + 4, ((*p & 1) ? 0x0 : 0xffffff)); p++; } } QRcode_free(code); ui->lblQRCode->setPixmap(QPixmap::fromImage(myImage).scaled(300, 300)); ui->outUri->setPlainText(uri); } } QString QRCodeDialog::getURI() { QString ret = QString("Thebotcoin:%1").arg(address); int paramCount = 0; ui->outUri->clear(); if (ui->chkReqPayment->isChecked()) { if (ui->lnReqAmount->validate()) { // even if we allow a non TBN unit input in lnReqAmount, we generate the URI with TBN as unit (as defined in BIP21) ret += QString("?amount=%1").arg(BitcoinUnits::format(BitcoinUnits::TBN, ui->lnReqAmount->value())); paramCount++; } else { ui->btnSaveAs->setEnabled(false); ui->lblQRCode->setText(tr("The entered amount is invalid, please check.")); return QString(""); } } if (!ui->lnLabel->text().isEmpty()) { QString lbl(QUrl::toPercentEncoding(ui->lnLabel->text())); ret += QString("%1label=%2").arg(paramCount == 0 ? "?" : "&").arg(lbl); paramCount++; } if (!ui->lnMessage->text().isEmpty()) { QString msg(QUrl::toPercentEncoding(ui->lnMessage->text())); ret += QString("%1message=%2").arg(paramCount == 0 ? "?" : "&").arg(msg); paramCount++; } // limit URI length to prevent a DoS against the QR-Code dialog if (ret.length() > MAX_URI_LENGTH) { ui->btnSaveAs->setEnabled(false); ui->lblQRCode->setText(tr("Resulting URI too long, try to reduce the text for label / message.")); return QString(""); } ui->btnSaveAs->setEnabled(true); return ret; } void QRCodeDialog::on_lnReqAmount_textChanged() { genCode(); } void QRCodeDialog::on_lnLabel_textChanged() { genCode(); } void QRCodeDialog::on_lnMessage_textChanged() { genCode(); } void QRCodeDialog::on_btnSaveAs_clicked() { QString fn = GUIUtil::getSaveFileName(this, tr("Save QR Code"), QString(), tr("PNG Images (*.png)")); if (!fn.isEmpty()) myImage.scaled(EXPORT_IMAGE_SIZE, EXPORT_IMAGE_SIZE).save(fn); } void QRCodeDialog::on_chkReqPayment_toggled(bool fChecked) { if (!fChecked) // if chkReqPayment is not active, don't display lnReqAmount as invalid ui->lnReqAmount->setValid(true); genCode(); } void QRCodeDialog::updateDisplayUnit() { if (model) { // Update lnReqAmount with the current unit ui->lnReqAmount->setDisplayUnit(model->getDisplayUnit()); } }
[ "xdude.hf@gmail.com" ]
xdude.hf@gmail.com
175b2e1660c9d859eb7754b5be84cd2de343853e
150187f85557ef1bb698fd90d9e72cb106cf2952
/src/init.cpp
50b5fcf4ba4a20d97f9de7805075cfbec4202294
[ "MIT" ]
permissive
Bradfrogger/Marvelous
edf2e09f1fd281de4889bd74cc9cab2807b95c8c
e3e5146526b6f8fe87f62e745cdda5e2530ce699
refs/heads/master
2021-01-20T18:44:14.767930
2016-06-24T02:02:27
2016-06-24T02:02:27
61,846,964
0
0
null
null
null
null
UTF-8
C++
false
false
45,523
cpp
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "txdb.h" #include "walletdb.h" #include "bitcoinrpc.h" #include "net.h" #include "init.h" #include "util.h" #include "ui_interface.h" #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> #include <boost/filesystem/convenience.hpp> #include <boost/interprocess/sync/file_lock.hpp> #include <boost/algorithm/string/predicate.hpp> #include <openssl/crypto.h> #ifndef WIN32 #include <signal.h> #endif using namespace std; using namespace boost; CWallet* pwalletMain; CClientUIInterface uiInterface; #ifdef WIN32 // Win32 LevelDB doesn't use filedescriptors, and the ones used for // accessing block files, don't count towards to fd_set size limit // anyway. #define MIN_CORE_FILEDESCRIPTORS 0 #else #define MIN_CORE_FILEDESCRIPTORS 150 #endif // Used to pass flags to the Bind() function enum BindFlags { BF_NONE = 0, BF_EXPLICIT = (1U << 0), BF_REPORT_ERROR = (1U << 1) }; ////////////////////////////////////////////////////////////////////////////// // // Shutdown // // // Thread management and startup/shutdown: // // The network-processing threads are all part of a thread group // created by AppInit() or the Qt main() function. // // A clean exit happens when StartShutdown() or the SIGTERM // signal handler sets fRequestShutdown, which triggers // the DetectShutdownThread(), which interrupts the main thread group. // DetectShutdownThread() then exits, which causes AppInit() to // continue (it .joins the shutdown thread). // Shutdown() is then // called to clean up database connections, and stop other // threads that should only be stopped after the main network-processing // threads have exited. // // Note that if running -daemon the parent process returns from AppInit2 // before adding any threads to the threadGroup, so .join_all() returns // immediately and the parent exits from main(). // // Shutdown for Qt is very similar, only it uses a QTimer to detect // fRequestShutdown getting set, and then does the normal Qt // shutdown thing. // volatile bool fRequestShutdown = false; void StartShutdown() { fRequestShutdown = true; } bool ShutdownRequested() { return fRequestShutdown; } static CCoinsViewDB *pcoinsdbview; void Shutdown() { printf("Shutdown : In progress...\n"); static CCriticalSection cs_Shutdown; TRY_LOCK(cs_Shutdown, lockShutdown); if (!lockShutdown) return; RenameThread("bitcoin-shutoff"); nTransactionsUpdated++; StopRPCThreads(); ShutdownRPCMining(); if (pwalletMain) bitdb.Flush(false); GenerateBitcoins(false, NULL); StopNode(); { LOCK(cs_main); if (pwalletMain) pwalletMain->SetBestChain(CBlockLocator(pindexBest)); if (pblocktree) pblocktree->Flush(); if (pcoinsTip) pcoinsTip->Flush(); delete pcoinsTip; pcoinsTip = NULL; delete pcoinsdbview; pcoinsdbview = NULL; delete pblocktree; pblocktree = NULL; } if (pwalletMain) bitdb.Flush(true); boost::filesystem::remove(GetPidFile()); UnregisterWallet(pwalletMain); if (pwalletMain) delete pwalletMain; printf("Shutdown : done\n"); } // // Signal handlers are very limited in what they are allowed to do, so: // void DetectShutdownThread(boost::thread_group* threadGroup) { // Tell the main threads to shutdown. while (!fRequestShutdown) { MilliSleep(200); if (fRequestShutdown) threadGroup->interrupt_all(); } } void HandleSIGTERM(int) { fRequestShutdown = true; } void HandleSIGHUP(int) { fReopenDebugLog = true; } ////////////////////////////////////////////////////////////////////////////// // // Start // #if !defined(QT_GUI) bool AppInit(int argc, char* argv[]) { boost::thread_group threadGroup; boost::thread* detectShutdownThread = NULL; bool fRet = false; try { // // Parameters // // If Qt is used, parameters/bitcoin.conf are parsed in qt/bitcoin.cpp's main() ParseParameters(argc, argv); if (!boost::filesystem::is_directory(GetDataDir(false))) { fprintf(stderr, "Error: Specified directory does not exist\n"); Shutdown(); } ReadConfigFile(mapArgs, mapMultiArgs); if (mapArgs.count("-?") || mapArgs.count("--help")) { // First part of help message is specific to bitcoind / RPC client std::string strUsage = _("Marvelous version") + " " + FormatFullVersion() + "\n\n" + _("Usage:") + "\n" + " marvelousd [options] " + "\n" + " marvelousd [options] <command> [params] " + _("Send command to -server or marvelousd") + "\n" + " marvelousd [options] help " + _("List commands") + "\n" + " marvelousd [options] help <command> " + _("Get help for a command") + "\n"; strUsage += "\n" + HelpMessage(); fprintf(stdout, "%s", strUsage.c_str()); return false; } // Command-line RPC for (int i = 1; i < argc; i++) if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "marvelous:")) fCommandLine = true; if (fCommandLine) { int ret = CommandLineRPC(argc, argv); exit(ret); } #if !defined(WIN32) fDaemon = GetBoolArg("-daemon"); if (fDaemon) { // Daemonize pid_t pid = fork(); if (pid < 0) { fprintf(stderr, "Error: fork() returned %d errno %d\n", pid, errno); return false; } if (pid > 0) // Parent process, pid is child process id { CreatePidFile(GetPidFile(), pid); return true; } // Child process falls through to rest of initialization pid_t sid = setsid(); if (sid < 0) fprintf(stderr, "Error: setsid() returned %d errno %d\n", sid, errno); } #endif detectShutdownThread = new boost::thread(boost::bind(&DetectShutdownThread, &threadGroup)); fRet = AppInit2(threadGroup); } catch (std::exception& e) { PrintExceptionContinue(&e, "AppInit()"); } catch (...) { PrintExceptionContinue(NULL, "AppInit()"); } if (!fRet) { if (detectShutdownThread) detectShutdownThread->interrupt(); threadGroup.interrupt_all(); } if (detectShutdownThread) { detectShutdownThread->join(); delete detectShutdownThread; detectShutdownThread = NULL; } Shutdown(); return fRet; } extern void noui_connect(); int main(int argc, char* argv[]) { bool fRet = false; // Connect bitcoind signal handlers noui_connect(); fRet = AppInit(argc, argv); if (fRet && fDaemon) return 0; return (fRet ? 0 : 1); } #endif bool static InitError(const std::string &str) { uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR); return false; } bool static InitWarning(const std::string &str) { uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING); return true; } bool static Bind(const CService &addr, unsigned int flags) { if (!(flags & BF_EXPLICIT) && IsLimited(addr)) return false; std::string strError; if (!BindListenPort(addr, strError)) { if (flags & BF_REPORT_ERROR) return InitError(strError); return false; } return true; } // Core-specific options shared between UI and daemon std::string HelpMessage() { string strUsage = _("Options:") + "\n" + " -? " + _("This help message") + "\n" + " -conf=<file> " + _("Specify configuration file (default: marvelous.conf)") + "\n" + " -pid=<file> " + _("Specify pid file (default: marvelousd.pid)") + "\n" + " -gen " + _("Generate coins (default: 0)") + "\n" + " -datadir=<dir> " + _("Specify data directory") + "\n" + " -dbcache=<n> " + _("Set database cache size in megabytes (default: 25)") + "\n" + " -timeout=<n> " + _("Specify connection timeout in milliseconds (default: 5000)") + "\n" + " -proxy=<ip:port> " + _("Connect through socks proxy") + "\n" + " -socks=<n> " + _("Select the version of socks proxy to use (4-5, default: 5)") + "\n" + " -tor=<ip:port> " + _("Use proxy to reach tor hidden services (default: same as -proxy)") + "\n" " -dns " + _("Allow DNS lookups for -addnode, -seednode and -connect") + "\n" + " -port=<port> " + _("Listen for connections on <port> (default: 6831 or testnet: 16831)") + "\n" + " -maxconnections=<n> " + _("Maintain at most <n> connections to peers (default: 125)") + "\n" + " -addnode=<ip> " + _("Add a node to connect to and attempt to keep the connection open") + "\n" + " -connect=<ip> " + _("Connect only to the specified node(s)") + "\n" + " -seednode=<ip> " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n" + " -externalip=<ip> " + _("Specify your own public address") + "\n" + " -onlynet=<net> " + _("Only connect to nodes in network <net> (IPv4, IPv6 or Tor)") + "\n" + " -discover " + _("Discover own IP address (default: 1 when listening and no -externalip)") + "\n" + " -checkpoints " + _("Only accept block chain matching built-in checkpoints (default: 1)") + "\n" + " -listen " + _("Accept connections from outside (default: 1 if no -proxy or -connect)") + "\n" + " -bind=<addr> " + _("Bind to given address and always listen on it. Use [host]:port notation for IPv6") + "\n" + " -dnsseed " + _("Find peers using DNS lookup (default: 1 unless -connect)") + "\n" + " -banscore=<n> " + _("Threshold for disconnecting misbehaving peers (default: 100)") + "\n" + " -bantime=<n> " + _("Number of seconds to keep misbehaving peers from reconnecting (default: 86400)") + "\n" + " -maxreceivebuffer=<n> " + _("Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)") + "\n" + " -maxsendbuffer=<n> " + _("Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)") + "\n" + " -bloomfilters " + _("Allow peers to set bloom filters (default: 1)") + "\n" + #ifdef USE_UPNP #if USE_UPNP " -upnp " + _("Use UPnP to map the listening port (default: 1 when listening)") + "\n" + #else " -upnp " + _("Use UPnP to map the listening port (default: 0)") + "\n" + #endif #endif " -paytxfee=<amt> " + _("Fee per KB to add to transactions you send") + "\n" + " -mininput=<amt> " + _("When creating transactions, ignore inputs with value less than this (default: 0.0001)") + "\n" + #ifdef QT_GUI " -server " + _("Accept command line and JSON-RPC commands") + "\n" + #endif #if !defined(WIN32) && !defined(QT_GUI) " -daemon " + _("Run in the background as a daemon and accept commands") + "\n" + #endif " -testnet " + _("Use the test network") + "\n" + " -debug " + _("Output extra debugging information. Implies all other -debug* options") + "\n" + " -debugnet " + _("Output extra network debugging information") + "\n" + " -logtimestamps " + _("Prepend debug output with timestamp (default: 1)") + "\n" + " -shrinkdebugfile " + _("Shrink debug.log file on client startup (default: 1 when no -debug)") + "\n" + " -printtoconsole " + _("Send trace/debug info to console instead of debug.log file") + "\n" + #ifdef WIN32 " -printtodebugger " + _("Send trace/debug info to debugger") + "\n" + #endif " -rpcuser=<user> " + _("Username for JSON-RPC connections") + "\n" + " -rpcpassword=<pw> " + _("Password for JSON-RPC connections") + "\n" + " -rpcport=<port> " + _("Listen for JSON-RPC connections on <port> (default: 6832 or testnet: 16832)") + "\n" + " -rpcallowip=<ip> " + _("Allow JSON-RPC connections from specified IP address") + "\n" + #ifndef QT_GUI " -rpcconnect=<ip> " + _("Send commands to node running on <ip> (default: 127.0.0.1)") + "\n" + #endif " -rpcthreads=<n> " + _("Set the number of threads to service RPC calls (default: 4)") + "\n" + " -blocknotify=<cmd> " + _("Execute command when the best block changes (%s in cmd is replaced by block hash)") + "\n" + " -walletnotify=<cmd> " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n" + " -spendzeroconfchange " + _("Spend unconfirmed change when sending transactions (default: 1)") + "\n" + " -alertnotify=<cmd> " + _("Execute command when a relevant alert is received (%s in cmd is replaced by message)") + "\n" + " -upgradewallet " + _("Upgrade wallet to latest format") + "\n" + " -keypool=<n> " + _("Set key pool size to <n> (default: 100)") + "\n" + " -rescan " + _("Rescan the block chain for missing wallet transactions") + "\n" + " -salvagewallet " + _("Attempt to recover private keys from a corrupt wallet.dat") + "\n" + " -checkblocks=<n> " + _("How many blocks to check at startup (default: 288, 0 = all)") + "\n" + " -checklevel=<n> " + _("How thorough the block verification is (0-4, default: 3)") + "\n" + " -txindex " + _("Maintain a full transaction index (default: 0)") + "\n" + " -loadblock=<file> " + _("Imports blocks from external blk000??.dat file") + "\n" + " -maxorphantx=<n> " + _("Keep at most <n> unconnectable transactions in memory (default: 25)") + "\n" + " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + "\n" + " -par=<n> " + _("Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)") + "\n" + "\n" + _("Block creation options:") + "\n" + " -blockminsize=<n> " + _("Set minimum block size in bytes (default: 0)") + "\n" + " -blockmaxsize=<n> " + _("Set maximum block size in bytes (default: 250000)") + "\n" + " -blockprioritysize=<n> " + _("Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)") + "\n" + "\n" + _("SSL options: (see the Marvelous Wiki for SSL setup instructions)") + "\n" + " -rpcssl " + _("Use OpenSSL (https) for JSON-RPC connections") + "\n" + " -rpcsslcertificatechainfile=<file.cert> " + _("Server certificate file (default: server.cert)") + "\n" + " -rpcsslprivatekeyfile=<file.pem> " + _("Server private key (default: server.pem)") + "\n" + " -rpcsslciphers=<ciphers> " + _("Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)") + "\n"; return strUsage; } struct CImportingNow { CImportingNow() { assert(fImporting == false); fImporting = true; } ~CImportingNow() { assert(fImporting == true); fImporting = false; } }; void ThreadImport(std::vector<boost::filesystem::path> vImportFiles) { RenameThread("bitcoin-loadblk"); // -reindex if (fReindex) { CImportingNow imp; int nFile = 0; while (true) { CDiskBlockPos pos(nFile, 0); FILE *file = OpenBlockFile(pos, true); if (!file) break; printf("Reindexing block file blk%05u.dat...\n", (unsigned int)nFile); LoadExternalBlockFile(file, &pos); nFile++; } pblocktree->WriteReindexing(false); fReindex = false; printf("Reindexing finished\n"); // To avoid ending up in a situation without genesis block, re-try initializing (no-op if reindexing worked): InitBlockIndex(); } // hardcoded $DATADIR/bootstrap.dat filesystem::path pathBootstrap = GetDataDir() / "bootstrap.dat"; if (filesystem::exists(pathBootstrap)) { FILE *file = fopen(pathBootstrap.string().c_str(), "rb"); if (file) { CImportingNow imp; filesystem::path pathBootstrapOld = GetDataDir() / "bootstrap.dat.old"; printf("Importing bootstrap.dat...\n"); LoadExternalBlockFile(file); RenameOver(pathBootstrap, pathBootstrapOld); } } // -loadblock= BOOST_FOREACH(boost::filesystem::path &path, vImportFiles) { FILE *file = fopen(path.string().c_str(), "rb"); if (file) { CImportingNow imp; printf("Importing %s...\n", path.string().c_str()); LoadExternalBlockFile(file); } } } /** Initialize bitcoin. * @pre Parameters should be parsed and config file should be read. */ bool AppInit2(boost::thread_group& threadGroup) { // ********************************************************* Step 1: setup #ifdef _MSC_VER // Turn off Microsoft heap dump noise _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); _CrtSetReportFile(_CRT_WARN, CreateFileA("NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0)); #endif #if _MSC_VER >= 1400 // Disable confusing "helpful" text message on abort, Ctrl-C _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); #endif #ifdef WIN32 // Enable Data Execution Prevention (DEP) // Minimum supported OS versions: WinXP SP3, WinVista >= SP1, Win Server 2008 // A failure is non-critical and needs no further attention! #ifndef PROCESS_DEP_ENABLE // We define this here, because GCCs winbase.h limits this to _WIN32_WINNT >= 0x0601 (Windows 7), // which is not correct. Can be removed, when GCCs winbase.h is fixed! #define PROCESS_DEP_ENABLE 0x00000001 #endif typedef BOOL (WINAPI *PSETPROCDEPPOL)(DWORD); PSETPROCDEPPOL setProcDEPPol = (PSETPROCDEPPOL)GetProcAddress(GetModuleHandleA("Kernel32.dll"), "SetProcessDEPPolicy"); if (setProcDEPPol != NULL) setProcDEPPol(PROCESS_DEP_ENABLE); // Initialize Windows Sockets WSADATA wsadata; int ret = WSAStartup(MAKEWORD(2,2), &wsadata); if (ret != NO_ERROR || LOBYTE(wsadata.wVersion ) != 2 || HIBYTE(wsadata.wVersion) != 2) { return InitError(strprintf("Error: Winsock library failed to start (WSAStartup returned error %d)", ret)); } #endif #ifndef WIN32 umask(077); // Clean shutdown on SIGTERM struct sigaction sa; sa.sa_handler = HandleSIGTERM; sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sigaction(SIGTERM, &sa, NULL); sigaction(SIGINT, &sa, NULL); // Reopen debug.log on SIGHUP struct sigaction sa_hup; sa_hup.sa_handler = HandleSIGHUP; sigemptyset(&sa_hup.sa_mask); sa_hup.sa_flags = 0; sigaction(SIGHUP, &sa_hup, NULL); #endif // ********************************************************* Step 2: parameter interactions fTestNet = GetBoolArg("-testnet"); fBloomFilters = GetBoolArg("-bloomfilters", true); if (fBloomFilters) nLocalServices |= NODE_BLOOM; if (mapArgs.count("-bind")) { // when specifying an explicit binding address, you want to listen on it // even when -connect or -proxy is specified SoftSetBoolArg("-listen", true); } if (mapArgs.count("-connect") && mapMultiArgs["-connect"].size() > 0) { // when only connecting to trusted nodes, do not seed via DNS, or listen by default SoftSetBoolArg("-dnsseed", false); SoftSetBoolArg("-listen", false); } if (mapArgs.count("-proxy")) { // to protect privacy, do not listen by default if a proxy server is specified SoftSetBoolArg("-listen", false); } if (!GetBoolArg("-listen", true)) { // do not map ports or try to retrieve public IP when not listening (pointless) SoftSetBoolArg("-upnp", false); SoftSetBoolArg("-discover", false); } if (mapArgs.count("-externalip")) { // if an explicit public IP is specified, do not try to find others SoftSetBoolArg("-discover", false); } if (GetBoolArg("-salvagewallet")) { // Rewrite just private keys: rescan to find transactions SoftSetBoolArg("-rescan", true); } // Make sure enough file descriptors are available int nBind = std::max((int)mapArgs.count("-bind"), 1); nMaxConnections = GetArg("-maxconnections", 125); nMaxConnections = std::max(std::min(nMaxConnections, (int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)), 0); int nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS); if (nFD < MIN_CORE_FILEDESCRIPTORS) return InitError(_("Not enough file descriptors available.")); if (nFD - MIN_CORE_FILEDESCRIPTORS < nMaxConnections) nMaxConnections = nFD - MIN_CORE_FILEDESCRIPTORS; // ********************************************************* Step 3: parameter-to-internal-flags fDebug = GetBoolArg("-debug"); fBenchmark = GetBoolArg("-benchmark"); // -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency nScriptCheckThreads = GetArg("-par", 0); if (nScriptCheckThreads <= 0) nScriptCheckThreads += boost::thread::hardware_concurrency(); if (nScriptCheckThreads <= 1) nScriptCheckThreads = 0; else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS) nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS; // -debug implies fDebug* if (fDebug) fDebugNet = true; else fDebugNet = GetBoolArg("-debugnet"); if (fDaemon) fServer = true; else fServer = GetBoolArg("-server"); /* force fServer when running without GUI */ #if !defined(QT_GUI) fServer = true; #endif fPrintToConsole = GetBoolArg("-printtoconsole"); fPrintToDebugger = GetBoolArg("-printtodebugger"); fLogTimestamps = GetBoolArg("-logtimestamps", true); bool fDisableWallet = GetBoolArg("-disablewallet", false); if (mapArgs.count("-timeout")) { int nNewTimeout = GetArg("-timeout", 5000); if (nNewTimeout > 0 && nNewTimeout < 600000) nConnectTimeout = nNewTimeout; } // Continue to put "/P2SH/" in the coinbase to monitor // BIP16 support. // This can be removed eventually... const char* pszP2SH = "/P2SH/"; COINBASE_FLAGS << std::vector<unsigned char>(pszP2SH, pszP2SH+strlen(pszP2SH)); // Fee-per-kilobyte amount considered the same as "free" // If you are mining, be careful setting this: // if you set it to zero then // a transaction spammer can cheaply fill blocks using // 1-satoshi-fee transactions. It should be set above the real // cost to you of processing a transaction. if (mapArgs.count("-mintxfee")) { int64 n = 0; if (ParseMoney(mapArgs["-mintxfee"], n) && n > 0) CTransaction::nMinTxFee = n; else return InitError(strprintf(_("Invalid amount for -mintxfee=<amount>: '%s'"), mapArgs["-mintxfee"].c_str())); } if (mapArgs.count("-minrelaytxfee")) { int64 n = 0; if (ParseMoney(mapArgs["-minrelaytxfee"], n) && n > 0) CTransaction::nMinRelayTxFee = n; else return InitError(strprintf(_("Invalid amount for -minrelaytxfee=<amount>: '%s'"), mapArgs["-minrelaytxfee"].c_str())); } if (mapArgs.count("-paytxfee")) { if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee)) return InitError(strprintf(_("Invalid amount for -paytxfee=<amount>: '%s'"), mapArgs["-paytxfee"].c_str())); if (nTransactionFee > 0.25 * COIN) InitWarning(_("Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.")); } bSpendZeroConfChange = GetArg("-spendzeroconfchange", true); if (mapArgs.count("-mininput")) { if (!ParseMoney(mapArgs["-mininput"], nMinimumInputValue)) return InitError(strprintf(_("Invalid amount for -mininput=<amount>: '%s'"), mapArgs["-mininput"].c_str())); } // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log std::string strDataDir = GetDataDir().string(); // Make sure only a single Bitcoin process is using the data directory. boost::filesystem::path pathLockFile = GetDataDir() / ".lock"; FILE* file = fopen(pathLockFile.string().c_str(), "a"); // empty lock file; created if it doesn't exist. if (file) fclose(file); static boost::interprocess::file_lock lock(pathLockFile.string().c_str()); if (!lock.try_lock()) return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Marvelous is probably already running."), strDataDir.c_str())); if (GetBoolArg("-shrinkdebugfile", !fDebug)) ShrinkDebugFile(); printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); printf("Marvelous version %s (%s)\n", FormatFullVersion().c_str(), CLIENT_DATE.c_str()); printf("Using OpenSSL version %s\n", SSLeay_version(SSLEAY_VERSION)); if (!fLogTimestamps) printf("Startup time: %s\n", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", GetTime()).c_str()); printf("Default data directory %s\n", GetDefaultDataDir().string().c_str()); printf("Using data directory %s\n", strDataDir.c_str()); printf("Using at most %i connections (%i file descriptors available)\n", nMaxConnections, nFD); std::ostringstream strErrors; if (fDaemon) fprintf(stdout, "Marvelous server starting\n"); if (nScriptCheckThreads) { printf("Using %u threads for script verification\n", nScriptCheckThreads); for (int i=0; i<nScriptCheckThreads-1; i++) threadGroup.create_thread(&ThreadScriptCheck); } int64 nStart; #if defined(USE_SSE2) scrypt_detect_sse2(); #endif // ********************************************************* Step 5: verify wallet database integrity if (!fDisableWallet) { uiInterface.InitMessage(_("Verifying wallet...")); if (!bitdb.Open(GetDataDir())) { // try moving the database env out of the way boost::filesystem::path pathDatabase = GetDataDir() / "database"; boost::filesystem::path pathDatabaseBak = GetDataDir() / strprintf("database.%"PRI64d".bak", GetTime()); try { boost::filesystem::rename(pathDatabase, pathDatabaseBak); printf("Moved old %s to %s. Retrying.\n", pathDatabase.string().c_str(), pathDatabaseBak.string().c_str()); } catch(boost::filesystem::filesystem_error &error) { // failure is ok (well, not really, but it's not worse than what we started with) } // try again if (!bitdb.Open(GetDataDir())) { // if it still fails, it probably means we can't even create the database env string msg = strprintf(_("Error initializing wallet database environment %s!"), strDataDir.c_str()); return InitError(msg); } } if (GetBoolArg("-salvagewallet")) { // Recover readable keypairs: if (!CWalletDB::Recover(bitdb, "wallet.dat", true)) return false; } if (filesystem::exists(GetDataDir() / "wallet.dat")) { CDBEnv::VerifyResult r = bitdb.Verify("wallet.dat", CWalletDB::Recover); if (r == CDBEnv::RECOVER_OK) { string msg = strprintf(_("Warning: wallet.dat corrupt, data salvaged!" " Original wallet.dat saved as wallet.{timestamp}.bak in %s; if" " your balance or transactions are incorrect you should" " restore from a backup."), strDataDir.c_str()); InitWarning(msg); } if (r == CDBEnv::RECOVER_FAIL) return InitError(_("wallet.dat corrupt, salvage failed")); } } // (!fDisableWallet) // ********************************************************* Step 6: network initialization int nSocksVersion = GetArg("-socks", 5); if (nSocksVersion != 4 && nSocksVersion != 5) return InitError(strprintf(_("Unknown -socks proxy version requested: %i"), nSocksVersion)); if (mapArgs.count("-onlynet")) { std::set<enum Network> nets; BOOST_FOREACH(std::string snet, mapMultiArgs["-onlynet"]) { enum Network net = ParseNetwork(snet); if (net == NET_UNROUTABLE) return InitError(strprintf(_("Unknown network specified in -onlynet: '%s'"), snet.c_str())); nets.insert(net); } for (int n = 0; n < NET_MAX; n++) { enum Network net = (enum Network)n; if (!nets.count(net)) SetLimited(net); } } #if defined(USE_IPV6) #if ! USE_IPV6 else SetLimited(NET_IPV6); #endif #endif CService addrProxy; bool fProxy = false; if (mapArgs.count("-proxy")) { addrProxy = CService(mapArgs["-proxy"], 9050); if (!addrProxy.IsValid()) return InitError(strprintf(_("Invalid -proxy address: '%s'"), mapArgs["-proxy"].c_str())); if (!IsLimited(NET_IPV4)) SetProxy(NET_IPV4, addrProxy, nSocksVersion); if (nSocksVersion > 4) { #ifdef USE_IPV6 if (!IsLimited(NET_IPV6)) SetProxy(NET_IPV6, addrProxy, nSocksVersion); #endif SetNameProxy(addrProxy, nSocksVersion); } fProxy = true; } // -tor can override normal proxy, -notor disables tor entirely if (!(mapArgs.count("-tor") && mapArgs["-tor"] == "0") && (fProxy || mapArgs.count("-tor"))) { CService addrOnion; if (!mapArgs.count("-tor")) addrOnion = addrProxy; else addrOnion = CService(mapArgs["-tor"], 9050); if (!addrOnion.IsValid()) return InitError(strprintf(_("Invalid -tor address: '%s'"), mapArgs["-tor"].c_str())); SetProxy(NET_TOR, addrOnion, 5); SetReachable(NET_TOR); } // see Step 2: parameter interactions for more information about these fNoListen = !GetBoolArg("-listen", true); fDiscover = GetBoolArg("-discover", true); fNameLookup = GetBoolArg("-dns", true); bool fBound = false; if (!fNoListen) { if (mapArgs.count("-bind")) { BOOST_FOREACH(std::string strBind, mapMultiArgs["-bind"]) { CService addrBind; if (!Lookup(strBind.c_str(), addrBind, GetListenPort(), false)) return InitError(strprintf(_("Cannot resolve -bind address: '%s'"), strBind.c_str())); fBound |= Bind(addrBind, (BF_EXPLICIT | BF_REPORT_ERROR)); } } else { struct in_addr inaddr_any; inaddr_any.s_addr = INADDR_ANY; #ifdef USE_IPV6 fBound |= Bind(CService(in6addr_any, GetListenPort()), BF_NONE); #endif fBound |= Bind(CService(inaddr_any, GetListenPort()), !fBound ? BF_REPORT_ERROR : BF_NONE); } if (!fBound) return InitError(_("Failed to listen on any port. Use -listen=0 if you want this.")); } if (mapArgs.count("-externalip")) { BOOST_FOREACH(string strAddr, mapMultiArgs["-externalip"]) { CService addrLocal(strAddr, GetListenPort(), fNameLookup); if (!addrLocal.IsValid()) return InitError(strprintf(_("Cannot resolve -externalip address: '%s'"), strAddr.c_str())); AddLocal(CService(strAddr, GetListenPort(), fNameLookup), LOCAL_MANUAL); } } BOOST_FOREACH(string strDest, mapMultiArgs["-seednode"]) AddOneShot(strDest); // ********************************************************* Step 7: load block chain fReindex = GetBoolArg("-reindex"); // Upgrading to 0.8; hard-link the old blknnnn.dat files into /blocks/ filesystem::path blocksDir = GetDataDir() / "blocks"; if (!filesystem::exists(blocksDir)) { filesystem::create_directories(blocksDir); bool linked = false; for (unsigned int i = 1; i < 10000; i++) { filesystem::path source = GetDataDir() / strprintf("blk%04u.dat", i); if (!filesystem::exists(source)) break; filesystem::path dest = blocksDir / strprintf("blk%05u.dat", i-1); try { filesystem::create_hard_link(source, dest); printf("Hardlinked %s -> %s\n", source.string().c_str(), dest.string().c_str()); linked = true; } catch (filesystem::filesystem_error & e) { // Note: hardlink creation failing is not a disaster, it just means // blocks will get re-downloaded from peers. printf("Error hardlinking blk%04u.dat : %s\n", i, e.what()); break; } } if (linked) { fReindex = true; } } // cache size calculations size_t nTotalCache = GetArg("-dbcache", 25) << 20; if (nTotalCache < (1 << 22)) nTotalCache = (1 << 22); // total cache cannot be less than 4 MiB size_t nBlockTreeDBCache = nTotalCache / 8; if (nBlockTreeDBCache > (1 << 21) && !GetBoolArg("-txindex", false)) nBlockTreeDBCache = (1 << 21); // block tree db cache shouldn't be larger than 2 MiB nTotalCache -= nBlockTreeDBCache; size_t nCoinDBCache = nTotalCache / 2; // use half of the remaining cache for coindb cache nTotalCache -= nCoinDBCache; nCoinCacheSize = nTotalCache / 300; // coins in memory require around 300 bytes bool fLoaded = false; while (!fLoaded) { bool fReset = fReindex; std::string strLoadError; uiInterface.InitMessage(_("Loading block index...")); nStart = GetTimeMillis(); do { try { UnloadBlockIndex(); delete pcoinsTip; delete pcoinsdbview; delete pblocktree; pblocktree = new CBlockTreeDB(nBlockTreeDBCache, false, fReindex); pcoinsdbview = new CCoinsViewDB(nCoinDBCache, false, fReindex); pcoinsTip = new CCoinsViewCache(*pcoinsdbview); if (fReindex) pblocktree->WriteReindexing(true); if (!LoadBlockIndex()) { strLoadError = _("Error loading block database"); break; } // If the loaded chain has a wrong genesis, bail out immediately // (we're likely using a testnet datadir, or the other way around). if (!mapBlockIndex.empty() && pindexGenesisBlock == NULL) return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?")); // Initialize the block index (no-op if non-empty database was already loaded) if (!InitBlockIndex()) { strLoadError = _("Error initializing block database"); break; } // Check for changed -txindex state if (fTxIndex != GetBoolArg("-txindex", false)) { strLoadError = _("You need to rebuild the database using -reindex to change -txindex"); break; } uiInterface.InitMessage(_("Verifying blocks...")); if (!VerifyDB(GetArg("-checklevel", 3), GetArg( "-checkblocks", 288))) { strLoadError = _("Corrupted block database detected"); break; } } catch(std::exception &e) { strLoadError = _("Error opening block database"); break; } fLoaded = true; } while(false); if (!fLoaded) { // first suggest a reindex if (!fReset) { bool fRet = uiInterface.ThreadSafeMessageBox( strLoadError + ".\n\n" + _("Do you want to rebuild the block database now?"), "", CClientUIInterface::MSG_ERROR | CClientUIInterface::BTN_ABORT); if (fRet) { fReindex = true; fRequestShutdown = false; } else { return false; } } else { return InitError(strLoadError); } } } // as LoadBlockIndex can take several minutes, it's possible the user // requested to kill bitcoin-qt during the last operation. If so, exit. // As the program has not fully started yet, Shutdown() is possibly overkill. if (fRequestShutdown) { printf("Shutdown requested. Exiting.\n"); return false; } printf(" block index %15"PRI64d"ms\n", GetTimeMillis() - nStart); if (GetBoolArg("-printblockindex") || GetBoolArg("-printblocktree")) { PrintBlockTree(); return false; } if (mapArgs.count("-printblock")) { string strMatch = mapArgs["-printblock"]; int nFound = 0; for (map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi) { uint256 hash = (*mi).first; if (strncmp(hash.ToString().c_str(), strMatch.c_str(), strMatch.size()) == 0) { CBlockIndex* pindex = (*mi).second; CBlock block; block.ReadFromDisk(pindex); block.BuildMerkleTree(); block.print(); printf("\n"); nFound++; } } if (nFound == 0) printf("No blocks matching %s were found\n", strMatch.c_str()); return false; } // ********************************************************* Step 8: load wallet if (fDisableWallet) { printf("Wallet disabled!\n"); pwalletMain = NULL; } else { uiInterface.InitMessage(_("Loading wallet...")); nStart = GetTimeMillis(); bool fFirstRun = true; pwalletMain = new CWallet("wallet.dat"); DBErrors nLoadWalletRet = pwalletMain->LoadWallet(fFirstRun); if (nLoadWalletRet != DB_LOAD_OK) { if (nLoadWalletRet == DB_CORRUPT) strErrors << _("Error loading wallet.dat: Wallet corrupted") << "\n"; else if (nLoadWalletRet == DB_NONCRITICAL_ERROR) { string msg(_("Warning: error reading wallet.dat! All keys read correctly, but transaction data" " or address book entries might be missing or incorrect.")); InitWarning(msg); } else if (nLoadWalletRet == DB_TOO_NEW) strErrors << _("Error loading wallet.dat: Wallet requires newer version of Marvelous") << "\n"; else if (nLoadWalletRet == DB_NEED_REWRITE) { strErrors << _("Wallet needed to be rewritten: restart Marvelous to complete") << "\n"; printf("%s", strErrors.str().c_str()); return InitError(strErrors.str()); } else strErrors << _("Error loading wallet.dat") << "\n"; } if (GetBoolArg("-upgradewallet", fFirstRun)) { int nMaxVersion = GetArg("-upgradewallet", 0); if (nMaxVersion == 0) // the -upgradewallet without argument case { printf("Performing wallet upgrade to %i\n", FEATURE_LATEST); nMaxVersion = CLIENT_VERSION; pwalletMain->SetMinVersion(FEATURE_LATEST); // permanently upgrade the wallet immediately } else printf("Allowing wallet upgrade up to %i\n", nMaxVersion); if (nMaxVersion < pwalletMain->GetVersion()) strErrors << _("Cannot downgrade wallet") << "\n"; pwalletMain->SetMaxVersion(nMaxVersion); } if (fFirstRun) { // Create new keyUser and set as default key RandAddSeedPerfmon(); CPubKey newDefaultKey; if (pwalletMain->GetKeyFromPool(newDefaultKey, false)) { pwalletMain->SetDefaultKey(newDefaultKey); if (!pwalletMain->SetAddressBookName(pwalletMain->vchDefaultKey.GetID(), "")) strErrors << _("Cannot write default address") << "\n"; } pwalletMain->SetBestChain(CBlockLocator(pindexBest)); } printf("%s", strErrors.str().c_str()); printf(" wallet %15"PRI64d"ms\n", GetTimeMillis() - nStart); RegisterWallet(pwalletMain); CBlockIndex *pindexRescan = pindexBest; if (GetBoolArg("-rescan")) pindexRescan = pindexGenesisBlock; else { CWalletDB walletdb("wallet.dat"); CBlockLocator locator; if (walletdb.ReadBestBlock(locator)) pindexRescan = locator.GetBlockIndex(); else pindexRescan = pindexGenesisBlock; } if (pindexBest && pindexBest != pindexRescan) { uiInterface.InitMessage(_("Rescanning...")); printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight); nStart = GetTimeMillis(); pwalletMain->ScanForWalletTransactions(pindexRescan, true); printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart); pwalletMain->SetBestChain(CBlockLocator(pindexBest)); nWalletDBUpdated++; } } // (!fDisableWallet) // ********************************************************* Step 9: import blocks // scan for better chains in the block chain database, that are not yet connected in the active best chain CValidationState state; if (!ConnectBestBlock(state)) strErrors << "Failed to connect best block"; std::vector<boost::filesystem::path> vImportFiles; if (mapArgs.count("-loadblock")) { BOOST_FOREACH(string strFile, mapMultiArgs["-loadblock"]) vImportFiles.push_back(strFile); } threadGroup.create_thread(boost::bind(&ThreadImport, vImportFiles)); // ********************************************************* Step 10: load peers uiInterface.InitMessage(_("Loading addresses...")); nStart = GetTimeMillis(); { CAddrDB adb; if (!adb.Read(addrman)) printf("Invalid or missing peers.dat; recreating\n"); } printf("Loaded %i addresses from peers.dat %"PRI64d"ms\n", addrman.size(), GetTimeMillis() - nStart); // ********************************************************* Step 11: start node if (!CheckDiskSpace()) return false; if (!strErrors.str().empty()) return InitError(strErrors.str()); RandAddSeedPerfmon(); //// debug print printf("mapBlockIndex.size() = %"PRIszu"\n", mapBlockIndex.size()); printf("nBestHeight = %d\n", nBestHeight); printf("setKeyPool.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->setKeyPool.size() : 0); printf("mapWallet.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->mapWallet.size() : 0); printf("mapAddressBook.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0); StartNode(threadGroup); // InitRPCMining is needed here so getwork/getblocktemplate in the GUI debug console works properly. InitRPCMining(); if (fServer) StartRPCThreads(); // Generate coins in the background if (pwalletMain) GenerateBitcoins(GetBoolArg("-gen", false), pwalletMain); // ********************************************************* Step 12: finished uiInterface.InitMessage(_("Done loading")); if (pwalletMain) { // Add wallet transactions that aren't already in a block to mapTransactions pwalletMain->ReacceptWalletTransactions(); // Run a thread to flush wallet periodically threadGroup.create_thread(boost::bind(&ThreadFlushWalletDB, boost::ref(pwalletMain->strWalletFile))); } return !fRequestShutdown; }
[ "bradfrogger@gmail.com" ]
bradfrogger@gmail.com
ffc4094bb42769e956a7b813014d5ee87ae162e7
24512d6811b87ca33534cf4743ab6a57c2aafeb2
/practicas C++/Cambiar enteros a numeros romanos.cpp
ce9c9e62a148a8928fbb1d0530ae1c4349354f07
[]
no_license
chrisemm96/Practicas-C-
da7c43c5d1a45b920aa2ce52d3f0a16d40d8a74a
8fa1defd379ca63ee096fd3b65d295a1ed62d1d9
refs/heads/main
2023-06-13T01:31:34.828498
2021-07-11T04:12:32
2021-07-11T04:12:32
384,825,543
0
0
null
null
null
null
ISO-8859-1
C++
false
false
1,599
cpp
/* Cambiar un número entero con el mismo valor pero en romanos. M = 1000 D = 500 C = 100 L = 50 X = 10 I = 1 */ #include <iostream> #include <stdlib.h> #include <conio.h> #include <string.h> using namespace std; int main(){ int numero, unidades,decenas,centenas,millar; cout<<"Digite un numero: "; cin>>numero; unidades = numero%10; numero/= 10; // unidades = 2 , numero = 215 decenas = numero%10; numero/=10; // decenas = 5, numero = 21 centenas = numero%10; numero/= 10; // centenas = 1, numero = 2 millar = numero%10; numero/= 10; // millar = 2, numero = 0 switch (millar){ case 1:cout<<"M"; break; case 2:cout<<"MM"; break; case 3:cout<<"MMM"; break; } switch(centenas){ case 1: cout<<"C"; break; case 2: cout<<"CC"; break; case 3: cout<<"CCC"; break; case 4: cout<<"CD"; break; case 5: cout<<"D"; break; case 6: cout<<"DC"; break; case 7: cout<<"DCC"; break; case 8: cout<<"DCCC"; break; case 9: cout<<"CM"; break; } switch(decenas){ case 1: cout<<"X"; break; case 2: cout<<"XX"; break; case 3: cout<<"XXX"; break; case 4: cout<<"XL"; break; case 5: cout<<"L"; break; case 6: cout<<"LX"; break; case 7: cout<<"LXX"; break; case 8: cout<<"LXXX"; break; case 9: cout<<"XC"; break; } switch(unidades){ case 1: cout<<"I"; break; case 2: cout<<"II"; break; case 3: cout<<"III"; break; case 4: cout<<"IV"; break; case 5: cout<<"V"; break; case 6: cout<<"VI"; break; case 7: cout<<"VII"; break; case 8: cout<<"VIII"; break; case 9: cout<<"IX"; break; } cout<<"\n"; getch(); system ("PAUSE"); return 0; }
[ "christiangarzareyes@gmail.com" ]
christiangarzareyes@gmail.com
4c2379e49bbb6be1419fc128044b84d2b7b23012
4692f3d447ad4cd7ff23cd5a10c8c28bede90490
/src/api/operator/numpy/np_nan_to_num_op.cc
804d757a035ba063f11ffba965643320f3c40f9d
[ "MIT", "LLVM-exception", "BSD-3-Clause", "Unlicense", "BSL-1.0", "Apache-2.0", "BSD-2-Clause", "Zlib" ]
permissive
songm28/incubator-mxnet
fa9c40ae38937a13a4b8530e9a0b3b43aae1265f
af1622e50f85a3a3f91ade5821d992adce556b37
refs/heads/master
2023-08-27T00:20:48.352477
2021-11-06T19:11:11
2021-11-06T19:11:11
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,402
cc
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /*! * \file np_nan_to_num_op.cc * \brief Implementation of the API of nan_to_num function in * src/operator/tensor/np_elemwise_unary_op_basic.cc */ #include <mxnet/api_registry.h> #include "../utils.h" #include "../../../operator/tensor/elemwise_unary_op.h" namespace mxnet { MXNET_REGISTER_API("_npi.nan_to_num") .set_body([](runtime::MXNetArgs args, runtime::MXNetRetValue* ret) { using namespace runtime; const nnvm::Op* op = Op::Get("_npi_nan_to_num"); nnvm::NodeAttrs attrs; op::NumpyNanToNumParam param; int num_inputs = 1; NDArray* inputs[] = {args[0].operator mxnet::NDArray*()}; param.copy = args[1].operator bool(); param.nan = args[2].operator double(); if (args[3].type_code() == kNull) { param.posinf = dmlc::nullopt; } else { param.posinf = args[3].operator double(); } if (args[4].type_code() == kNull) { param.neginf = dmlc::nullopt; } else { param.neginf = args[4].operator double(); } attrs.parsed = param; attrs.op = op; SetAttrDict<op::NumpyNanToNumParam>(&attrs); NDArray* out = args[5].operator mxnet::NDArray*(); NDArray** outputs = out == nullptr ? nullptr : &out; // set the number of outputs provided by the `out` arugment int num_outputs = out != nullptr; auto ndoutputs = Invoke(op, &attrs, num_inputs, inputs, &num_outputs, outputs); if (out) { *ret = PythonArg(5); } else { *ret = ndoutputs[0]; } }); } // namespace mxnet
[ "noreply@github.com" ]
songm28.noreply@github.com
75128abc25ff0691db7710af4ac7723a4d8ef14a
eb2150900feb503cbf871212d722408e82f5b808
/Clipboard/Clipboard.cpp
0b766626d4ebe26a9cab97450e5f69607deec920
[]
no_license
houwfactory/ScreenShare
9f8dc35fdddfd9803696cfebdcf5ff89ee364f7e
7a16ab29289aef7e6e2cc82a075267a4d2b2764d
refs/heads/master
2022-11-20T11:23:26.342058
2020-07-19T15:40:24
2020-07-19T15:40:24
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,241
cpp
#include "ClipboardWin.h" #include "Clipboard.h" #include <assert.h> #include <functional> #include <memory> namespace HS { namespace Clipboard { class Clipboard_Configuration : public IClipboard_Configuration { std::shared_ptr<Clipboard_Manager> Impl_; public: Clipboard_Configuration(const std::shared_ptr<Clipboard_Manager> &impl) : Impl_(impl) {} virtual ~Clipboard_Configuration() {} virtual std::shared_ptr<IClipboard_Configuration> onText(const std::function<void(const std::string &text)> &handle) override { assert(!Impl_->onText); Impl_->onText = handle; return std::make_shared<Clipboard_Configuration>(Impl_); } virtual std::shared_ptr<IClipboard_Configuration> onImage(const std::function<void(const Image &image)> &handle) override { assert(!Impl_->onImage); Impl_->onImage = handle; return std::make_shared<Clipboard_Configuration>(Impl_); } virtual std::shared_ptr<IClipboard_Manager> run() override { Impl_->run(); return Impl_; } }; std::shared_ptr<IClipboard_Configuration> CreateClipboard() { return std::make_shared<Clipboard_Configuration>(std::make_shared<Clipboard_Manager>()); } } // namespace Clipboard_Lite } // namespace SL
[ "53197506+yhs6375@users.noreply.github.com" ]
53197506+yhs6375@users.noreply.github.com
ef1726322106f8966eecf23a761fad7a570c4f3c
a44c41642a8b8f5360006d7c7bbd224994964c29
/CPU.cpp
d9b90a2a21527a3ddda8c372c3a1bf4f191b756f
[]
no_license
voalexander/testRun
b05959727e8450f98339a6a99d47b577359d67ec
3df7e0146f5136b4b1ab55264776f9abf5291958
refs/heads/main
2023-04-10T07:37:59.321851
2021-04-14T07:04:51
2021-04-14T07:04:51
357,805,700
0
0
null
null
null
null
UTF-8
C++
false
false
8,706
cpp
#include "CPU.h" #include <stdio.h> #include <iostream> #include <stdlib.h> #include <signal.h> #include <sys/types.h> #include <unistd.h> // PC = Program Counter // SP = Stack Pointer // IR = Instruction Register // AC = Accumulator /* NOTE ALL FUNCTION DESCRIPTIONS ARE IN THE HEADER FILE */ void CPU::init(int * cpuToMemArg, int * memToCpuArg) { this->cpuToMem = cpuToMemArg; this->memToCpu = memToCpuArg; } void CPU::enterInterrupt(InterruptType type) { if(this->mode == USER) { this->SSP = this->SP; this->SP = 1999; if(type == SYS_CALL) //System Call { this->SPC = this->PC + 1; this->PC = 1499; } else if (type == TIMER) //Timer { this->SPC = this->PC; this->PC = 999; } this->mode = KERNEL; } } void CPU::exitInterrupt() { if(this->mode == KERNEL) { this->SP = this->SSP; this->PC = this->SPC; this->mode = USER; } } void CPU::fetchInstruction(bool hasInterrupt) { int i[2] = {0, PC}; int msg; int instruction; if(hasInterrupt) this->enterInterrupt(TIMER); if(messageMem(i, &instruction, sizeof(i), sizeof(instruction)) != NULL) { if(instruction == 29) { this->enterInterrupt(SYS_CALL); } IR = instruction; } PC += 1; } int CPU::processInstruction() { int operand; if(this->hasOperator) { operand = this->IR; this->IR = this->prevIR; } switch(this->IR) // Refer to Instruction Set for case functions { case 1: { if(this->hasOperator) { this->AC = operand; this->hasOperator = false; } else this->hasOperator = true; break; } case 2: { if(this->hasOperator) { int i[2] = {0, operand}; int result; if(messageMem(i, &result, sizeof(i), sizeof(result)) != NULL) this->AC = result; this->hasOperator = false; } else this->hasOperator = true; break; } case 3: { if(this->hasOperator) { // Below reads address twice int i[2] = {0, operand}; int result; int result2; if(messageMem(i, &result, sizeof(i), sizeof(result)) != NULL) { i[1] = result; if(messageMem(i, &result2, sizeof(i), sizeof(result2)) != NULL) this->AC = result2; } this->hasOperator = false; } else this->hasOperator = true; break; } case 4: { if(this->hasOperator) { int i[2] = {0, operand + this->X}; int result; if(messageMem(i, &result, sizeof(i), sizeof(result)) != NULL) this->AC = result; this->hasOperator = false; } else this->hasOperator = true; break; } case 5: { if(this->hasOperator) { int i[2] = {0, operand + this->Y}; int result; if(messageMem(i, &result, sizeof(i), sizeof(result)) != NULL) this->AC = result; this->hasOperator = false; } else this->hasOperator = true; break; } case 6: { int i[2] = {0,this->SP + this->X}; int result; if(messageMem(i, &result, sizeof(i), sizeof(result)) != NULL) this->AC = result; break; } case 7: { if(this->hasOperator) { int i[3] = {1, operand, this->AC}; messageMem(i, NULL, sizeof(i), 0); this->hasOperator = false; } else this->hasOperator = true; break; } case 8: { srand(this->PC); // Randomize time based on PC this->AC = rand() % 100 + 1; break; } case 9: { if(this->hasOperator) { if(operand == 1) std::cout << (int)this->AC; else if(operand == 2) std::cout << char(this->AC); this->hasOperator = false; } else this->hasOperator = true; break; } case 10: { this->AC += this->X; break; } case 11: { this->AC += this->Y; break; } case 12: { this->AC -= this->X; break; } case 13: { this->AC -= this->Y; break; } case 14: { this->X = this->AC; break; } case 15: { this->AC = this->X; break; } case 16: { this->Y = this->AC; break; } case 17: { this->AC = this->Y; break; } case 18: { this->SP = this->AC; break; } case 19: { this->AC = this->SP; break; } case 20: { if(this->hasOperator) { this->PC = operand; this->hasOperator = false; } else this->hasOperator = true; break; } case 21: { if(this->hasOperator) { if(this->AC == 0) this->PC = operand; this->hasOperator = false; } else this->hasOperator = true; break; } case 22: { if(this->hasOperator) { if(this->AC != 0) this->PC = operand; this->hasOperator = false; } else this->hasOperator = true; break; } case 23: { if(this->hasOperator) { this->pushStack(this->PC); this->PC = operand; this->hasOperator = false; } else this->hasOperator = true; break; } case 24: { this->PC = this->popStack(); break; } case 25: { this->X += 1; break; } case 26: { this->X -= 1; break; } case 27: { pushStack(this->AC); break; } case 28: { this->AC = popStack(); break; } case 29: //System Call (handled elsewhere) { break; } case 30: { this->exitInterrupt(); break; } case 50: { // Messages Memory task to end then kills itself int msg = -1; messageMem(&msg, NULL, sizeof(msg), 0); return -1; break; } default: break; } this->prevIR = this->IR; return 0; } void * CPU::messageMem(int * outMsg, int * inMsg, int sizeOut, int sizeIn) { if(this->mode == USER && outMsg[1] > 999) { std::cout << "Memory violation: accessing system address in user mode" << std::endl; exit(EXIT_FAILURE); } write(this->cpuToMem[1], outMsg, sizeOut); if(inMsg != NULL) { if(read(this->memToCpu[0], inMsg, sizeIn) > 0) { return inMsg; } } return NULL; } void CPU::pushStack(int value) { this->SP -= 1; int msg[3] = {1, this->SP, value}; messageMem(msg, NULL, sizeof(msg), 0); } int CPU::popStack() { int readMsg[2] = {0, this->SP}; int writeMsg[3] = {1, this->SP, 0}; int value; messageMem(readMsg, &value, sizeof(readMsg), sizeof(value)); // Read Value messageMem(writeMsg, NULL, sizeof(writeMsg), 0); // Set Value to 0 this->SP += 1; return value; }
[ "noreply@github.com" ]
voalexander.noreply@github.com
c46e4452aea9282d8585b8fe04490b003ab5395a
0ee189afe953dc99825f55232cd52b94d2884a85
/mstd/any_iterator.hpp
8289cd17b0fbdc15ab06a0dd283b51392c50263d
[]
no_license
spolitov/lib
fed99fa046b84b575acc61919d4ef301daeed857
7dee91505a37a739c8568fdc597eebf1b3796cf9
refs/heads/master
2016-09-11T02:04:49.852151
2011-08-11T18:00:44
2011-08-11T18:00:44
2,192,752
0
0
null
null
null
null
UTF-8
C++
false
false
6,480
hpp
// (C) Copyright Sergei Politov 2008. Permission to copy, use, modify, sell and // distribute this software is granted provided this copyright notice appears // in all copies. This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. #ifndef __ANY_ITERATOR_HPP_ #define __ANY_ITERATOR_HPP_ #include <boost/iterator/iterator_facade.hpp> #include <boost/utility/enable_if.hpp> #include <boost/mpl/bool.hpp> #include <boost/mpl/and.hpp> #include <boost/mpl/not.hpp> #include <boost/mpl/erase.hpp> #include <boost/mpl/vector.hpp> #include <boost/tuple/tuple.hpp> #include <boost/static_assert.hpp> #include "detail/any_iterator_metafunctions.hpp" #include "detail/any_iterator_holder.hpp" #include "detail/any_iterator_forward_feature.hpp" #include "detail/any_iterator_bidirectional_feature.hpp" #include "detail/any_iterator_random_access_feature.hpp" namespace mstd { template<class Traversal, class Tuple> class get_features_list; template<class Tuple> struct get_features_list<boost::forward_traversal_tag, Tuple> { typedef boost::mpl::vector<detail::any_iterator_forward_feature<Tuple> > type; }; template<class Tuple> struct get_features_list<boost::bidirectional_traversal_tag, Tuple> { typedef boost::mpl::vector<detail::any_iterator_forward_feature<Tuple>, detail::any_iterator_bidirectional_feature<Tuple> > type; }; template<class Tuple> struct get_features_list<boost::random_access_traversal_tag, Tuple> { typedef boost::mpl::vector<detail::any_iterator_forward_feature<Tuple>, detail::any_iterator_bidirectional_feature<Tuple>, detail::any_iterator_random_access_feature<Tuple> > type; }; template<class Features> class type_item; template<> class type_item<boost::mpl::vector0<> > : public virtual detail::any_iterator_holder { public: template<class It> type_item(const It * src) {} template<class List> type_item(const type_item<List> & rhs) {} void swap(type_item & rhs) {} }; template<class List> struct type_item_base { typedef type_item<typename boost::mpl::erase<List, typename List::begin>::type > type; }; template<class List> class type_item : public List::begin::type, public type_item_base<List>::type { public: typedef typename List::begin::type feature; typedef typename type_item_base<List>::type base; template<class It> type_item(const It * src) : feature(src), base(src) {} template<class List> type_item(const type_item<List> & rhs) : feature(rhs), base(rhs) {} void swap(type_item & rhs) { List::begin::type::swap(rhs); base::swap(rhs); } }; template<class Traversal, class Tuple> class traversal_to_features { public: typedef typename get_features_list<Traversal, Tuple>::type features; typedef type_item<features> type; }; template<class Value, class CategoryOrTraversal, class Reference = Value&, class Difference = std::ptrdiff_t> class any_iterator : public boost::iterator_facade<any_iterator<Value, CategoryOrTraversal, Reference, Difference>, Value, CategoryOrTraversal, Reference, Difference>, private traversal_to_features<typename boost::iterator_category_to_traversal<CategoryOrTraversal>::type, boost::tuple<Value, Reference, Difference> >::type { template< class OtherValue, class OtherCategoryOrTraversal, class OtherReference, class OtherDifference > friend class any_iterator; public: class disabler {}; typedef typename boost::iterator_category_to_traversal<CategoryOrTraversal>::type Traversal; typedef boost::tuple<Value, Reference, Difference> Tuple; private: typedef boost::iterator_facade<any_iterator<Value, CategoryOrTraversal, Reference, Difference>, Value, CategoryOrTraversal, Reference, Difference> super_type; typedef typename traversal_to_features<Traversal, Tuple>::type features_type; public: any_iterator() {} any_iterator(const any_iterator & rhs) : any_iterator_holder(rhs), super_type(rhs), features_type(rhs) {} any_iterator& operator=(const any_iterator & rhs) { if(this != &rhs) { any_iterator tmp(rhs); swap(tmp); } return *this; } template<class OValue, class OCategoryOrTraversal, class OReference, class ODifference> explicit any_iterator(const any_iterator<OValue, OCategoryOrTraversal, OReference, ODifference> & rhs) : detail::any_iterator_holder(rhs), features_type(rhs) { } template<class WrappedIterator> explicit any_iterator(const WrappedIterator & src, typename boost::disable_if<detail::is_any_iterator<WrappedIterator>, disabler>::type = disabler()) : detail::any_iterator_holder(new detail::any_iterator_holder_concrete_impl<WrappedIterator>(src)), features_type(&src) { BOOST_STATIC_ASSERT((detail::is_iterator_type_erasure_compatible<WrappedIterator, any_iterator>::type::value)); } template<class WrappedIterator> typename boost::enable_if< boost::mpl::and_< detail::is_iterator_type_erasure_compatible<WrappedIterator, any_iterator>, boost::mpl::not_<detail::is_any_iterator<WrappedIterator> > >, any_iterator >::type & operator=(WrappedIterator const & src) { any_iterator tmp(src); swap(tmp); return *this; } private: friend class boost::iterator_core_access; any_iterator & swap(any_iterator & other) { any_iterator_holder::swap(other); features_type::swap(other); return *this; } }; template<class iterator> struct make_any_iterator_type { typedef any_iterator< typename boost::iterator_value<iterator>::type, typename boost::iterator_category<iterator>::type, typename boost::iterator_reference<iterator>::type, typename boost::iterator_difference<iterator>::type > type; }; } #endif
[ "admin@zranger.net" ]
admin@zranger.net
33004be5608582a0f412593768104af6f0889cbc
839c8fb4fd2736c78ca6b927d4706689a5816a5e
/Codeforces Beta Round 93/b.cpp
5c8a762d8eb04af22b7dd6ff0930061452b43bd0
[]
no_license
AnkurRyder/Codeforces
1eeea5b0f4c7c069acfa2292a84ccd9042cbdb0a
cc14e47b662afb79a09a4712beab519b7cf24b66
refs/heads/master
2020-03-28T08:52:23.354806
2019-10-13T20:33:13
2019-10-13T20:33:13
147,995,354
2
0
null
null
null
null
UTF-8
C++
false
false
1,837
cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL; #define fi first #define se second #define mp make_pair #define re(i, n) for(int i = 0; i < n; i++) #define rep(i,a,b) for(int i = (a); i <= (b); i++) #define ren(i,a,b) for(int i = (a); i >= (b); i--) #define si(x) scanf("%d",&x) #define sl(x) scanf("%lld",&x) #define ss(s) scanf("%s",s) #define pi(x) printf("%d\n",x) #define pl(x) printf("%lld\n",x) #define ps(s) printf("%s\n",s) #define trace1(x) cerr<<#x<<": "<<x<<endl #define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl #define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl #define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl #define trace5(a, b, c, d, e) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl int main() { std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); string s; cin >> s; int l = s.size(); std::vector<int> v(l); std::vector<int> count(l); int j = 0; rep(i , 1 , l) { while(j > 0 && s[i] != s[j]) j = v[j-1]; if(s[i] == s[j]) j++; v[i] = j; } re(i , l-1) count[v[i]]++; j = l; //re(i, l) // cout << v[i] <<" "; //cout <<"\n"; while(j > 0) { j = v[j-1]; if(j == 0) break; if(count[j] > 0){ re(i, j) cout << s[i]; return 0; } } cout << "Just a legend\n"; return 0; }
[ "noreply@github.com" ]
AnkurRyder.noreply@github.com
34dfda650d89168d1e134f2d1c2f01d66bf19441
09a20466c1650ab4beb6554ceabc8649a7540c06
/core/lib/soci/core/test/common-tests.h
705f6dd182fc28ed008082d70291c2783cbc5f14
[ "BSL-1.0", "MIT" ]
permissive
LedgerHQ/lib-ledger-core
2f1153655ed7c116b866d2b21920a8a3017f5d96
ad1e271b5f61e92f663ff08c337acc8b107fc85f
refs/heads/main
2023-07-09T18:24:41.408616
2023-07-06T13:09:06
2023-07-06T13:09:06
68,716,694
99
99
MIT
2023-06-30T08:36:20
2016-09-20T13:51:06
C++
UTF-8
C++
false
false
123,456
h
// // Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // 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 SOCI_COMMON_TESTS_H_INCLUDED #define SOCI_COMMON_TESTS_H_INCLUDED #include "soci.h" #include "soci-config.h" #ifdef HAVE_BOOST // explicitly pull conversions for Boost's optional, tuple and fusion: #include <boost/version.hpp> #include <boost-optional.h> #include <boost-tuple.h> #include <boost-gregorian-date.h> #if defined(BOOST_VERSION) && BOOST_VERSION >= 103500 #include <boost-fusion.h> #include <boost-tuple.h> #endif // BOOST_VERSION #endif // HAVE_BOOST #include <algorithm> #include <cmath> #include <iostream> #include <limits> #include <string> #include <typeinfo> // Objects used later in tests 14,15 struct PhonebookEntry { std::string name; std::string phone; }; struct PhonebookEntry2 : public PhonebookEntry { }; class PhonebookEntry3 { public: void setName(std::string const & n) { name_ = n; } std::string getName() const { return name_; } void setPhone(std::string const & p) { phone_ = p; } std::string getPhone() const { return phone_; } public: std::string name_; std::string phone_; }; // user-defined object for test26 and test28 class MyInt { public: MyInt() {} MyInt(int i) : i_(i) {} void set(int i) { i_ = i; } int get() const { return i_; } private: int i_; }; namespace soci { // basic type conversion for user-defined type with single base value template<> struct type_conversion<MyInt> { typedef int base_type; static void from_base(int i, indicator ind, MyInt &mi) { if (ind == i_ok) { mi.set(i); } } static void to_base(MyInt const &mi, int &i, indicator &ind) { i = mi.get(); ind = i_ok; } }; // basic type conversion on many values (ORM) template<> struct type_conversion<PhonebookEntry> { typedef soci::values base_type; static void from_base(values const &v, indicator /* ind */, PhonebookEntry &pe) { // here we ignore the possibility the the whole object might be NULL pe.name = v.get<std::string>("NAME"); pe.phone = v.get<std::string>("PHONE", "<NULL>"); } static void to_base(PhonebookEntry const &pe, values &v, indicator &ind) { v.set("NAME", pe.name); v.set("PHONE", pe.phone, pe.phone.empty() ? i_null : i_ok); ind = i_ok; } }; // type conversion which directly calls values::get_indicator() template<> struct type_conversion<PhonebookEntry2> { typedef soci::values base_type; static void from_base(values const &v, indicator /* ind */, PhonebookEntry2 &pe) { // here we ignore the possibility the the whole object might be NULL pe.name = v.get<std::string>("NAME"); indicator ind = v.get_indicator("PHONE"); //another way to test for null pe.phone = ind == i_null ? "<NULL>" : v.get<std::string>("PHONE"); } static void to_base(PhonebookEntry2 const &pe, values &v, indicator &ind) { v.set("NAME", pe.name); v.set("PHONE", pe.phone, pe.phone.empty() ? i_null : i_ok); ind = i_ok; } }; template<> struct type_conversion<PhonebookEntry3> { typedef soci::values base_type; static void from_base(values const &v, indicator /* ind */, PhonebookEntry3 &pe) { // here we ignore the possibility the the whole object might be NULL pe.setName(v.get<std::string>("NAME")); pe.setPhone(v.get<std::string>("PHONE", "<NULL>")); } static void to_base(PhonebookEntry3 const &pe, values &v, indicator &ind) { v.set("NAME", pe.getName()); v.set("PHONE", pe.getPhone(), pe.getPhone().empty() ? i_null : i_ok); ind = i_ok; } }; } // namespace soci namespace soci { namespace tests { // ensure connection is checked, no crash occurs #define SOCI_TEST_ENSURE_CONNECTED(sql, method) { \ std::string msg; \ try { \ (sql.method)(); \ assert(!"exception expected"); \ } catch (soci_error const &e) { msg = e.what(); } \ assert(msg.empty() == false); } (void)sql #define SOCI_TEST_ENSURE_CONNECTED2(sql, method) { \ std::string msg; \ try { std::string seq; long v(0); \ (sql.method)(seq, v); \ assert(!"exception expected"); \ } catch (soci_error const &e) { msg = e.what(); } \ assert(msg.empty() == false); } (void)sql inline bool equal_approx(double const a, double const b) { // The formula taken from CATCH test framework // https://github.com/philsquared/Catch/ // Thanks to Richard Harris for his help refining this formula double const epsilon(std::numeric_limits<float>::epsilon() * 100); double const scale(1.0); return std::fabs(a - b) < epsilon * (scale + (std::max)(std::fabs(a), std::fabs(b))); } // TODO: improve cleanup capabilities by subtypes, soci_test name may be omitted --mloskot // i.e. optional ctor param accepting custom table name class table_creator_base { public: table_creator_base(session& sql) : msession(sql) { drop(); } virtual ~table_creator_base() { drop();} private: void drop() { try { msession << "drop table soci_test"; } catch (soci_error const& e) { //std::cerr << e.what() << std::endl; e.what(); } } session& msession; }; class procedure_creator_base { public: procedure_creator_base(session& sql) : msession(sql) { drop(); } virtual ~procedure_creator_base() { drop();} private: void drop() { try { msession << "drop procedure soci_test"; } catch (soci_error&) {} } session& msession; }; class function_creator_base { public: function_creator_base(session& sql) : msession(sql) { drop(); } virtual ~function_creator_base() { drop();} protected: virtual std::string dropstatement() { return "drop function soci_test"; } private: void drop() { try { msession << dropstatement(); } catch (soci_error&) {} } session& msession; }; class test_context_base { public: test_context_base(backend_factory const &backEnd, std::string const &connectString) : backEndFactory_(backEnd), connectString_(connectString) {} backend_factory const & get_backend_factory() const { return backEndFactory_; } std::string get_connect_string() const { return connectString_; } virtual std::string to_date_time(std::string const &dateTime) const = 0; virtual table_creator_base* table_creator_1(session&) const = 0; virtual table_creator_base* table_creator_2(session&) const = 0; virtual table_creator_base* table_creator_3(session&) const = 0; virtual table_creator_base* table_creator_4(session&) const = 0; virtual ~test_context_base() {} // quiet the compiler private: backend_factory const &backEndFactory_; std::string const connectString_; }; class common_tests { public: common_tests(test_context_base const &tc) : tc_(tc), backEndFactory_(tc.get_backend_factory()), connectString_(tc.get_connect_string()) {} void run(bool dbSupportsTransactions = true) { std::cout<<"\nSOCI Common Tests:\n\n"; test0(); test1(); test2(); test3(); test4(); test5(); test6(); test7(); test8(); test9(); if (dbSupportsTransactions) { test10(); } else { std::cout<<"skipping test 10 (database doesn't support transactions)\n"; } test11(); test12(); test13(); test14(); test15(); test16(); test17(); test18(); test19(); test20(); test21(); test22(); test23(); test24(); test25(); test26(); test27(); test28(); test29(); test30(); test31(); test_get_affected_rows(); test_query_transformation(); test_query_transformation_with_connection_pool(); test_pull5(); test_issue67(); test_prepared_insert_with_orm_type(); test_issue154(); test_placeholder_partial_matching_with_orm_type(); } private: test_context_base const & tc_; backend_factory const &backEndFactory_; std::string const connectString_; typedef std::auto_ptr<table_creator_base> auto_table_creator; void test0() { { soci::session sql; // no connection SOCI_TEST_ENSURE_CONNECTED(sql, begin); SOCI_TEST_ENSURE_CONNECTED(sql, commit); SOCI_TEST_ENSURE_CONNECTED(sql, rollback); SOCI_TEST_ENSURE_CONNECTED(sql, get_backend_name); SOCI_TEST_ENSURE_CONNECTED(sql, make_statement_backend); SOCI_TEST_ENSURE_CONNECTED(sql, make_rowid_backend); SOCI_TEST_ENSURE_CONNECTED(sql, make_blob_backend); SOCI_TEST_ENSURE_CONNECTED2(sql, get_next_sequence_value); SOCI_TEST_ENSURE_CONNECTED2(sql, get_last_insert_id); } std::cout << "test 0 passed\n"; } void test1() { session sql(backEndFactory_, connectString_); auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::string msg; try { // expected error sql << "drop table soci_test_nosuchtable"; assert(false); } catch (soci_error const &e) { msg = e.what(); } assert(msg.empty() == false); sql << "insert into soci_test (id) values (" << 123 << ")"; int id; sql << "select id from soci_test", into(id); assert(id == 123); std::cout << "test 1 passed\n"; } // "into" tests, type conversions, etc. void test2() { { session sql(backEndFactory_, connectString_); { auto_table_creator tableCreator(tc_.table_creator_1(sql)); char c('a'); sql << "insert into soci_test(c) values(:c)", use(c); sql << "select c from soci_test", into(c); assert(c == 'a'); } { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::string helloSOCI("Hello, SOCI!"); sql << "insert into soci_test(str) values(:s)", use(helloSOCI); std::string str; sql << "select str from soci_test", into(str); assert(str == "Hello, SOCI!"); } { auto_table_creator tableCreator(tc_.table_creator_1(sql)); short three(3); sql << "insert into soci_test(sh) values(:id)", use(three); short sh(0); sql << "select sh from soci_test", into(sh); assert(sh == 3); } { auto_table_creator tableCreator(tc_.table_creator_1(sql)); int five(5); sql << "insert into soci_test(id) values(:id)", use(five); int i(0); sql << "select id from soci_test", into(i); assert(i == 5); } { auto_table_creator tableCreator(tc_.table_creator_1(sql)); unsigned long seven(7); sql << "insert into soci_test(ul) values(:ul)", use(seven); unsigned long ul(0); sql << "select ul from soci_test", into(ul); assert(ul == 7); } { auto_table_creator tableCreator(tc_.table_creator_1(sql)); double pi(3.14159265); sql << "insert into soci_test(d) values(:d)", use(pi); double d(0.0); sql << "select d from soci_test", into(d); assert(equal_approx(d, 3.14159265)); } { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::tm nov15; nov15.tm_year = 105; nov15.tm_mon = 10; nov15.tm_mday = 15; nov15.tm_hour = 0; nov15.tm_min = 0; nov15.tm_sec = 0; sql << "insert into soci_test(tm) values(:tm)", use(nov15); std::tm t; sql << "select tm from soci_test", into(t); assert(t.tm_year == 105); assert(t.tm_mon == 10); assert(t.tm_mday == 15); assert(t.tm_hour == 0); assert(t.tm_min == 0); assert(t.tm_sec == 0); } { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::tm nov15; nov15.tm_year = 105; nov15.tm_mon = 10; nov15.tm_mday = 15; nov15.tm_hour = 22; nov15.tm_min = 14; nov15.tm_sec = 17; sql << "insert into soci_test(tm) values(:tm)", use(nov15); std::tm t; sql << "select tm from soci_test", into(t); assert(t.tm_year == 105); assert(t.tm_mon == 10); assert(t.tm_mday == 15); assert(t.tm_hour == 22); assert(t.tm_min == 14); assert(t.tm_sec == 17); } // test indicators { auto_table_creator tableCreator(tc_.table_creator_1(sql)); int id(1); std::string str("Hello"); sql << "insert into soci_test(id, str) values(:id, :str)", use(id), use(str); int i; indicator ind; sql << "select id from soci_test", into(i, ind); assert(ind == i_ok); } // more indicator tests, NULL values { auto_table_creator tableCreator(tc_.table_creator_1(sql)); sql << "insert into soci_test(id,tm) values(NULL,NULL)"; int i; indicator ind; sql << "select id from soci_test", into(i, ind); assert(ind == i_null); // additional test for NULL with std::tm std::tm t; sql << "select tm from soci_test", into(t, ind); assert(ind == i_null); try { // expect error sql << "select id from soci_test", into(i); assert(false); } catch (soci_error const &e) { std::string error = e.what(); assert(error == "Null value fetched and no indicator defined."); } sql << "select id from soci_test where id = 1000", into(i, ind); assert(sql.got_data() == false); // no data expected sql << "select id from soci_test where id = 1000", into(i); assert(sql.got_data() == false); // no data expected, test correct behaviour with use int id = 1000; sql << "select id from soci_test where id = :id", use(id), into(i); assert(sql.got_data() == false); } } std::cout << "test 2 passed" << std::endl; } // repeated fetch and bulk fetch void test3() { { session sql(backEndFactory_, connectString_); // repeated fetch and bulk fetch of char { // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); char c; for (c = 'a'; c <= 'z'; ++c) { sql << "insert into soci_test(c) values(\'" << c << "\')"; } int count; sql << "select count(*) from soci_test", into(count); assert(count == 'z' - 'a' + 1); { char c2 = 'a'; statement st = (sql.prepare << "select c from soci_test order by c", into(c)); st.execute(); while (st.fetch()) { assert(c == c2); ++c2; } assert(c2 == 'a' + count); } { char c2 = 'a'; std::vector<char> vec(10); statement st = (sql.prepare << "select c from soci_test order by c", into(vec)); st.execute(); while (st.fetch()) { for (std::size_t i = 0; i != vec.size(); ++i) { assert(c2 == vec[i]); ++c2; } vec.resize(10); } assert(c2 == 'a' + count); } { // verify an exception is thrown when empty vector is used std::vector<char> vec; try { sql << "select c from soci_test", into(vec); assert(false); } catch (soci_error const &e) { std::string msg = e.what(); assert(msg == "Vectors of size 0 are not allowed."); } } } // repeated fetch and bulk fetch of std::string { // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); int const rowsToTest = 10; for (int i = 0; i != rowsToTest; ++i) { std::ostringstream ss; ss << "Hello_" << i; sql << "insert into soci_test(str) values(\'" << ss.str() << "\')"; } int count; sql << "select count(*) from soci_test", into(count); assert(count == rowsToTest); { int i = 0; std::string s; statement st = (sql.prepare << "select str from soci_test order by str", into(s)); st.execute(); while (st.fetch()) { std::ostringstream ss; ss << "Hello_" << i; assert(s == ss.str()); ++i; } assert(i == rowsToTest); } { int i = 0; std::vector<std::string> vec(4); statement st = (sql.prepare << "select str from soci_test order by str", into(vec)); st.execute(); while (st.fetch()) { for (std::size_t j = 0; j != vec.size(); ++j) { std::ostringstream ss; ss << "Hello_" << i; assert(ss.str() == vec[j]); ++i; } vec.resize(4); } assert(i == rowsToTest); } } // repeated fetch and bulk fetch of short { // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); short const rowsToTest = 100; short sh; for (sh = 0; sh != rowsToTest; ++sh) { sql << "insert into soci_test(sh) values(" << sh << ")"; } int count; sql << "select count(*) from soci_test", into(count); assert(count == rowsToTest); { short sh2 = 0; statement st = (sql.prepare << "select sh from soci_test order by sh", into(sh)); st.execute(); while (st.fetch()) { assert(sh == sh2); ++sh2; } assert(sh2 == rowsToTest); } { short sh2 = 0; std::vector<short> vec(8); statement st = (sql.prepare << "select sh from soci_test order by sh", into(vec)); st.execute(); while (st.fetch()) { for (std::size_t i = 0; i != vec.size(); ++i) { assert(sh2 == vec[i]); ++sh2; } vec.resize(8); } assert(sh2 == rowsToTest); } } // repeated fetch and bulk fetch of int (4-bytes) { // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); int const rowsToTest = 100; int i; for (i = 0; i != rowsToTest; ++i) { sql << "insert into soci_test(id) values(" << i << ")"; } int count; sql << "select count(*) from soci_test", into(count); assert(count == rowsToTest); { int i2 = 0; statement st = (sql.prepare << "select id from soci_test order by id", into(i)); st.execute(); while (st.fetch()) { assert(i == i2); ++i2; } assert(i2 == rowsToTest); } { // additional test with the use element int i2 = 0; int cond = 0; // this condition is always true statement st = (sql.prepare << "select id from soci_test where id >= :cond order by id", use(cond), into(i)); st.execute(); while (st.fetch()) { assert(i == i2); ++i2; } assert(i2 == rowsToTest); } { int i2 = 0; std::vector<int> vec(8); statement st = (sql.prepare << "select id from soci_test order by id", into(vec)); st.execute(); while (st.fetch()) { for (std::size_t i = 0; i != vec.size(); ++i) { assert(i2 == vec[i]); ++i2; } vec.resize(8); } assert(i2 == rowsToTest); } } // repeated fetch and bulk fetch of unsigned int (4-bytes) { // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); unsigned int const rowsToTest = 100; unsigned int ul; for (ul = 0; ul != rowsToTest; ++ul) { sql << "insert into soci_test(ul) values(" << ul << ")"; } int count; sql << "select count(*) from soci_test", into(count); assert(count == static_cast<int>(rowsToTest)); { unsigned int ul2 = 0; statement st = (sql.prepare << "select ul from soci_test order by ul", into(ul)); st.execute(); while (st.fetch()) { assert(ul == ul2); ++ul2; } assert(ul2 == rowsToTest); } { unsigned int ul2 = 0; std::vector<unsigned int> vec(8); statement st = (sql.prepare << "select ul from soci_test order by ul", into(vec)); st.execute(); while (st.fetch()) { for (std::size_t i = 0; i != vec.size(); ++i) { assert(ul2 == vec[i]); ++ul2; } vec.resize(8); } assert(ul2 == rowsToTest); } } // repeated fetch and bulk fetch of double { // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); int const rowsToTest = 100; double d = 0.0; for (int i = 0; i != rowsToTest; ++i) { sql << "insert into soci_test(d) values(" << d << ")"; d += 0.6; } int count; sql << "select count(*) from soci_test", into(count); assert(count == rowsToTest); { double d2 = 0.0; int i = 0; statement st = (sql.prepare << "select d from soci_test order by d", into(d)); st.execute(); while (st.fetch()) { assert(equal_approx(d, d2)); d2 += 0.6; ++i; } assert(i == rowsToTest); } { double d2 = 0.0; int i = 0; std::vector<double> vec(8); statement st = (sql.prepare << "select d from soci_test order by d", into(vec)); st.execute(); while (st.fetch()) { for (std::size_t j = 0; j != vec.size(); ++j) { assert(equal_approx(d2, vec[j])); d2 += 0.6; ++i; } vec.resize(8); } assert(i == rowsToTest); } } // repeated fetch and bulk fetch of std::tm { // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); int const rowsToTest = 8; for (int i = 0; i != rowsToTest; ++i) { std::ostringstream ss; ss << 2000 + i << "-0" << 1 + i << '-' << 20 - i << ' ' << 15 + i << ':' << 50 - i << ':' << 40 + i; sql << "insert into soci_test(id, tm) values(" << i << ", " << tc_.to_date_time(ss.str()) << ")"; } int count; sql << "select count(*) from soci_test", into(count); assert(count == rowsToTest); { std::tm t; int i = 0; statement st = (sql.prepare << "select tm from soci_test order by id", into(t)); st.execute(); while (st.fetch()) { assert(t.tm_year + 1900 == 2000 + i); assert(t.tm_mon + 1 == 1 + i); assert(t.tm_mday == 20 - i); assert(t.tm_hour == 15 + i); assert(t.tm_min == 50 - i); assert(t.tm_sec == 40 + i); ++i; } assert(i == rowsToTest); } { int i = 0; std::vector<std::tm> vec(3); statement st = (sql.prepare << "select tm from soci_test order by id", into(vec)); st.execute(); while (st.fetch()) { for (std::size_t j = 0; j != vec.size(); ++j) { assert(vec[j].tm_year + 1900 == 2000 + i); assert(vec[j].tm_mon + 1 == 1 + i); assert(vec[j].tm_mday == 20 - i); assert(vec[j].tm_hour == 15 + i); assert(vec[j].tm_min == 50 - i); assert(vec[j].tm_sec == 40 + i); ++i; } vec.resize(3); } assert(i == rowsToTest); } } } std::cout << "test 3 passed" << std::endl; } // test for indicators (repeated fetch and bulk) void test4() { session sql(backEndFactory_, connectString_); // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(id, val) values(1, 10)"; sql << "insert into soci_test(id, val) values(2, 11)"; sql << "insert into soci_test(id, val) values(3, NULL)"; sql << "insert into soci_test(id, val) values(4, NULL)"; sql << "insert into soci_test(id, val) values(5, 12)"; { int val; indicator ind; statement st = (sql.prepare << "select val from soci_test order by id", into(val, ind)); st.execute(); bool gotData = st.fetch(); assert(gotData); assert(ind == i_ok); assert(val == 10); gotData = st.fetch(); assert(gotData); assert(ind == i_ok); assert(val == 11); gotData = st.fetch(); assert(gotData); assert(ind == i_null); gotData = st.fetch(); assert(gotData); assert(ind == i_null); gotData = st.fetch(); assert(gotData); assert(ind == i_ok); assert(val == 12); gotData = st.fetch(); assert(gotData == false); } { std::vector<int> vals(3); std::vector<indicator> inds(3); statement st = (sql.prepare << "select val from soci_test order by id", into(vals, inds)); st.execute(); bool gotData = st.fetch(); assert(gotData); assert(vals.size() == 3); assert(inds.size() == 3); assert(inds[0] == i_ok); assert(vals[0] == 10); assert(inds[1] == i_ok); assert(vals[1] == 11); assert(inds[2] == i_null); gotData = st.fetch(); assert(gotData); assert(vals.size() == 2); assert(inds[0] == i_null); assert(inds[1] == i_ok); assert(vals[1] == 12); gotData = st.fetch(); assert(gotData == false); } // additional test for "no data" condition { std::vector<int> vals(3); std::vector<indicator> inds(3); statement st = (sql.prepare << "select val from soci_test where 0 = 1", into(vals, inds)); bool gotData = st.execute(true); assert(gotData == false); // for convenience, vectors should be truncated assert(vals.empty()); assert(inds.empty()); // for even more convenience, fetch should not fail // but just report end of rowset // (and vectors should be truncated) vals.resize(1); inds.resize(1); gotData = st.fetch(); assert(gotData == false); assert(vals.empty()); assert(inds.empty()); } // additional test for "no data" without prepared statement { std::vector<int> vals(3); std::vector<indicator> inds(3); sql << "select val from soci_test where 0 = 1", into(vals, inds); // vectors should be truncated assert(vals.empty()); assert(inds.empty()); } } std::cout << "test 4 passed" << std::endl; } // test for different sizes of data vector and indicators vector // (library should force ind. vector to have same size as data vector) void test5() { session sql(backEndFactory_, connectString_); // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(id, val) values(1, 10)"; sql << "insert into soci_test(id, val) values(2, 11)"; sql << "insert into soci_test(id, val) values(3, NULL)"; sql << "insert into soci_test(id, val) values(4, NULL)"; sql << "insert into soci_test(id, val) values(5, 12)"; { std::vector<int> vals(4); std::vector<indicator> inds; statement st = (sql.prepare << "select val from soci_test order by id", into(vals, inds)); st.execute(); st.fetch(); assert(vals.size() == 4); assert(inds.size() == 4); vals.resize(3); st.fetch(); assert(vals.size() == 1); assert(inds.size() == 1); } } std::cout << "test 5 passed" << std::endl; } // "use" tests, type conversions, etc. void test6() { // Note: this functionality is not available with older PostgreSQL #ifndef SOCI_POSTGRESQL_NOPARAMS { session sql(backEndFactory_, connectString_); // test for char { auto_table_creator tableCreator(tc_.table_creator_1(sql)); char c('a'); sql << "insert into soci_test(c) values(:c)", use(c); c = 'b'; sql << "select c from soci_test", into(c); assert(c == 'a'); } // test for std::string { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::string s = "Hello SOCI!"; sql << "insert into soci_test(str) values(:s)", use(s); std::string str; sql << "select str from soci_test", into(str); assert(str == "Hello SOCI!"); } // test for short { auto_table_creator tableCreator(tc_.table_creator_1(sql)); short s = 123; sql << "insert into soci_test(id) values(:id)", use(s); short s2 = 0; sql << "select id from soci_test", into(s2); assert(s2 == 123); } // test for int { auto_table_creator tableCreator(tc_.table_creator_1(sql)); int i = -12345678; sql << "insert into soci_test(id) values(:i)", use(i); int i2 = 0; sql << "select id from soci_test", into(i2); assert(i2 == -12345678); } // test for unsigned long { auto_table_creator tableCreator(tc_.table_creator_1(sql)); unsigned long ul = 4000000000ul; sql << "insert into soci_test(ul) values(:num)", use(ul); unsigned long ul2 = 0; sql << "select ul from soci_test", into(ul2); assert(ul2 == 4000000000ul); } // test for double { auto_table_creator tableCreator(tc_.table_creator_1(sql)); double d = 3.14159265; sql << "insert into soci_test(d) values(:d)", use(d); double d2 = 0; sql << "select d from soci_test", into(d2); assert(equal_approx(d2, d)); } // test for std::tm { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::tm t; t.tm_year = 105; t.tm_mon = 10; t.tm_mday = 19; t.tm_hour = 21; t.tm_min = 39; t.tm_sec = 57; sql << "insert into soci_test(tm) values(:t)", use(t); std::tm t2; t2.tm_year = 0; t2.tm_mon = 0; t2.tm_mday = 0; t2.tm_hour = 0; t2.tm_min = 0; t2.tm_sec = 0; sql << "select tm from soci_test", into(t2); assert(t.tm_year == 105); assert(t.tm_mon == 10); assert(t.tm_mday == 19); assert(t.tm_hour == 21); assert(t.tm_min == 39); assert(t.tm_sec == 57); } // test for repeated use { auto_table_creator tableCreator(tc_.table_creator_1(sql)); int i; statement st = (sql.prepare << "insert into soci_test(id) values(:id)", use(i)); i = 5; st.execute(true); i = 6; st.execute(true); i = 7; st.execute(true); std::vector<int> v(5); sql << "select id from soci_test order by id", into(v); assert(v.size() == 3); assert(v[0] == 5); assert(v[1] == 6); assert(v[2] == 7); } // tests for use of const objects // test for char { auto_table_creator tableCreator(tc_.table_creator_1(sql)); char const c('a'); sql << "insert into soci_test(c) values(:c)", use(c); char c2 = 'b'; sql << "select c from soci_test", into(c2); assert(c2 == 'a'); } // test for std::string { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::string const s = "Hello const SOCI!"; sql << "insert into soci_test(str) values(:s)", use(s); std::string str; sql << "select str from soci_test", into(str); assert(str == "Hello const SOCI!"); } // test for short { auto_table_creator tableCreator(tc_.table_creator_1(sql)); short const s = 123; sql << "insert into soci_test(id) values(:id)", use(s); short s2 = 0; sql << "select id from soci_test", into(s2); assert(s2 == 123); } // test for int { auto_table_creator tableCreator(tc_.table_creator_1(sql)); int const i = -12345678; sql << "insert into soci_test(id) values(:i)", use(i); int i2 = 0; sql << "select id from soci_test", into(i2); assert(i2 == -12345678); } // test for unsigned long { auto_table_creator tableCreator(tc_.table_creator_1(sql)); unsigned long const ul = 4000000000ul; sql << "insert into soci_test(ul) values(:num)", use(ul); unsigned long ul2 = 0; sql << "select ul from soci_test", into(ul2); assert(ul2 == 4000000000ul); } // test for double { auto_table_creator tableCreator(tc_.table_creator_1(sql)); double const d = 3.14159265; sql << "insert into soci_test(d) values(:d)", use(d); double d2 = 0; sql << "select d from soci_test", into(d2); assert(equal_approx(d2, d)); } // test for std::tm { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::tm t; t.tm_year = 105; t.tm_mon = 10; t.tm_mday = 19; t.tm_hour = 21; t.tm_min = 39; t.tm_sec = 57; std::tm const & ct = t; sql << "insert into soci_test(tm) values(:t)", use(ct); std::tm t2; t2.tm_year = 0; t2.tm_mon = 0; t2.tm_mday = 0; t2.tm_hour = 0; t2.tm_min = 0; t2.tm_sec = 0; sql << "select tm from soci_test", into(t2); assert(t.tm_year == 105); assert(t.tm_mon == 10); assert(t.tm_mday == 19); assert(t.tm_hour == 21); assert(t.tm_min == 39); assert(t.tm_sec == 57); } } std::cout << "test 6 passed" << std::endl; #endif // SOCI_POSTGRESQL_NOPARAMS } // test for multiple use (and into) elements void test7() { { session sql(backEndFactory_, connectString_); auto_table_creator tableCreator(tc_.table_creator_1(sql)); { int i1 = 5; int i2 = 6; int i3 = 7; #ifndef SOCI_POSTGRESQL_NOPARAMS sql << "insert into soci_test(i1, i2, i3) values(:i1, :i2, :i3)", use(i1), use(i2), use(i3); #else // Older PostgreSQL does not support use elements. sql << "insert into soci_test(i1, i2, i3) values(5, 6, 7)"; #endif // SOCI_POSTGRESQL_NOPARAMS i1 = 0; i2 = 0; i3 = 0; sql << "select i1, i2, i3 from soci_test", into(i1), into(i2), into(i3); assert(i1 == 5); assert(i2 == 6); assert(i3 == 7); // same for vectors sql << "delete from soci_test"; i1 = 0; i2 = 0; i3 = 0; #ifndef SOCI_POSTGRESQL_NOPARAMS statement st = (sql.prepare << "insert into soci_test(i1, i2, i3) values(:i1, :i2, :i3)", use(i1), use(i2), use(i3)); i1 = 1; i2 = 2; i3 = 3; st.execute(true); i1 = 4; i2 = 5; i3 = 6; st.execute(true); i1 = 7; i2 = 8; i3 = 9; st.execute(true); #else // Older PostgreSQL does not support use elements. sql << "insert into soci_test(i1, i2, i3) values(1, 2, 3)"; sql << "insert into soci_test(i1, i2, i3) values(4, 5, 6)"; sql << "insert into soci_test(i1, i2, i3) values(7, 8, 9)"; #endif // SOCI_POSTGRESQL_NOPARAMS std::vector<int> v1(5); std::vector<int> v2(5); std::vector<int> v3(5); sql << "select i1, i2, i3 from soci_test order by i1", into(v1), into(v2), into(v3); assert(v1.size() == 3); assert(v2.size() == 3); assert(v3.size() == 3); assert(v1[0] == 1); assert(v1[1] == 4); assert(v1[2] == 7); assert(v2[0] == 2); assert(v2[1] == 5); assert(v2[2] == 8); assert(v3[0] == 3); assert(v3[1] == 6); assert(v3[2] == 9); } } std::cout << "test 7 passed" << std::endl; } // use vector elements void test8() { // Not supported with older PostgreSQL #ifndef SOCI_POSTGRESQL_NOPARAMS { session sql(backEndFactory_, connectString_); // test for char { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<char> v; v.push_back('a'); v.push_back('b'); v.push_back('c'); v.push_back('d'); sql << "insert into soci_test(c) values(:c)", use(v); std::vector<char> v2(4); sql << "select c from soci_test order by c", into(v2); assert(v2.size() == 4); assert(v2[0] == 'a'); assert(v2[1] == 'b'); assert(v2[2] == 'c'); assert(v2[3] == 'd'); } // test for std::string { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<std::string> v; v.push_back("ala"); v.push_back("ma"); v.push_back("kota"); sql << "insert into soci_test(str) values(:s)", use(v); std::vector<std::string> v2(4); sql << "select str from soci_test order by str", into(v2); assert(v2.size() == 3); assert(v2[0] == "ala"); assert(v2[1] == "kota"); assert(v2[2] == "ma"); } // test for short { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<short> v; v.push_back(-5); v.push_back(6); v.push_back(7); v.push_back(123); sql << "insert into soci_test(sh) values(:sh)", use(v); std::vector<short> v2(4); sql << "select sh from soci_test order by sh", into(v2); assert(v2.size() == 4); assert(v2[0] == -5); assert(v2[1] == 6); assert(v2[2] == 7); assert(v2[3] == 123); } // test for int { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<int> v; v.push_back(-2000000000); v.push_back(0); v.push_back(1); v.push_back(2000000000); sql << "insert into soci_test(id) values(:i)", use(v); std::vector<int> v2(4); sql << "select id from soci_test order by id", into(v2); assert(v2.size() == 4); assert(v2[0] == -2000000000); assert(v2[1] == 0); assert(v2[2] == 1); assert(v2[3] == 2000000000); } // test for unsigned int { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<unsigned int> v; v.push_back(0); v.push_back(1); v.push_back(123); v.push_back(1000); sql << "insert into soci_test(ul) values(:ul)", use(v); std::vector<unsigned int> v2(4); sql << "select ul from soci_test order by ul", into(v2); assert(v2.size() == 4); assert(v2[0] == 0); assert(v2[1] == 1); assert(v2[2] == 123); assert(v2[3] == 1000); } // test for double { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<double> v; v.push_back(0); v.push_back(-0.0001); v.push_back(0.0001); v.push_back(3.1415926); sql << "insert into soci_test(d) values(:d)", use(v); std::vector<double> v2(4); sql << "select d from soci_test order by d", into(v2); assert(v2.size() == 4); assert(equal_approx(v2[0],-0.0001)); assert(equal_approx(v2[1], 0)); assert(equal_approx(v2[2], 0.0001)); assert(equal_approx(v2[3], 3.1415926)); } // test for std::tm { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<std::tm> v; std::tm t; t.tm_year = 105; t.tm_mon = 10; t.tm_mday = 26; t.tm_hour = 22; t.tm_min = 45; t.tm_sec = 17; v.push_back(t); t.tm_sec = 37; v.push_back(t); t.tm_mday = 25; v.push_back(t); sql << "insert into soci_test(tm) values(:t)", use(v); std::vector<std::tm> v2(4); sql << "select tm from soci_test order by tm", into(v2); assert(v2.size() == 3); assert(v2[0].tm_year == 105); assert(v2[0].tm_mon == 10); assert(v2[0].tm_mday == 25); assert(v2[0].tm_hour == 22); assert(v2[0].tm_min == 45); assert(v2[0].tm_sec == 37); assert(v2[1].tm_year == 105); assert(v2[1].tm_mon == 10); assert(v2[1].tm_mday == 26); assert(v2[1].tm_hour == 22); assert(v2[1].tm_min == 45); assert(v2[1].tm_sec == 17); assert(v2[2].tm_year == 105); assert(v2[2].tm_mon == 10); assert(v2[2].tm_mday == 26); assert(v2[2].tm_hour == 22); assert(v2[2].tm_min == 45); assert(v2[2].tm_sec == 37); } // additional test for int (use const vector) { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::vector<int> v; v.push_back(-2000000000); v.push_back(0); v.push_back(1); v.push_back(2000000000); std::vector<int> const & cv = v; sql << "insert into soci_test(id) values(:i)", use(cv); std::vector<int> v2(4); sql << "select id from soci_test order by id", into(v2); assert(v2.size() == 4); assert(v2[0] == -2000000000); assert(v2[1] == 0); assert(v2[2] == 1); assert(v2[3] == 2000000000); } } std::cout << "test 8 passed" << std::endl; #endif // SOCI_POSTGRESQL_NOPARAMS } // test for named binding void test9() { // Not supported with older PostgreSQL #ifndef SOCI_POSTGRESQL_NOPARAMS { session sql(backEndFactory_, connectString_); { auto_table_creator tableCreator(tc_.table_creator_1(sql)); int i1 = 7; int i2 = 8; // verify the exception is thrown if both by position // and by name use elements are specified try { sql << "insert into soci_test(i1, i2) values(:i1, :i2)", use(i1, "i1"), use(i2); assert(false); } catch (soci_error const& e) { std::string what(e.what()); assert(what == "Binding for use elements must be either by position " "or by name."); } // normal test sql << "insert into soci_test(i1, i2) values(:i1, :i2)", use(i1, "i1"), use(i2, "i2"); i1 = 0; i2 = 0; sql << "select i1, i2 from soci_test", into(i1), into(i2); assert(i1 == 7); assert(i2 == 8); i2 = 0; sql << "select i2 from soci_test where i1 = :i1", into(i2), use(i1); assert(i2 == 8); sql << "delete from soci_test"; // test vectors std::vector<int> v1; v1.push_back(1); v1.push_back(2); v1.push_back(3); std::vector<int> v2; v2.push_back(4); v2.push_back(5); v2.push_back(6); sql << "insert into soci_test(i1, i2) values(:i1, :i2)", use(v1, "i1"), use(v2, "i2"); sql << "select i2, i1 from soci_test order by i1 desc", into(v1), into(v2); assert(v1.size() == 3); assert(v2.size() == 3); assert(v1[0] == 6); assert(v1[1] == 5); assert(v1[2] == 4); assert(v2[0] == 3); assert(v2[1] == 2); assert(v2[2] == 1); } } std::cout << "test 9 passed" << std::endl; #endif // SOCI_POSTGRESQL_NOPARAMS } // transaction test void test10() { { session sql(backEndFactory_, connectString_); auto_table_creator tableCreator(tc_.table_creator_1(sql)); int count; sql << "select count(*) from soci_test", into(count); assert(count == 0); { transaction tr(sql); sql << "insert into soci_test (id, name) values(1, 'John')"; sql << "insert into soci_test (id, name) values(2, 'Anna')"; sql << "insert into soci_test (id, name) values(3, 'Mike')"; tr.commit(); } { transaction tr(sql); sql << "select count(*) from soci_test", into(count); assert(count == 3); sql << "insert into soci_test (id, name) values(4, 'Stan')"; sql << "select count(*) from soci_test", into(count); assert(count == 4); tr.rollback(); sql << "select count(*) from soci_test", into(count); assert(count == 3); } { transaction tr(sql); sql << "delete from soci_test"; sql << "select count(*) from soci_test", into(count); assert(count == 0); tr.rollback(); sql << "select count(*) from soci_test", into(count); assert(count == 3); } { // additional test for detection of double commit transaction tr(sql); tr.commit(); try { tr.commit(); assert(false); } catch (soci_error const &e) { std::string msg = e.what(); assert(msg == "The transaction object cannot be handled twice."); } } } std::cout << "test 10 passed" << std::endl; } // test of use elements with indicators void test11() { #ifndef SOCI_POSTGRESQL_NOPARAMS { session sql(backEndFactory_, connectString_); auto_table_creator tableCreator(tc_.table_creator_1(sql)); indicator ind1 = i_ok; indicator ind2 = i_ok; int id = 1; int val = 10; sql << "insert into soci_test(id, val) values(:id, :val)", use(id, ind1), use(val, ind2); id = 2; val = 11; ind2 = i_null; sql << "insert into soci_test(id, val) values(:id, :val)", use(id, ind1), use(val, ind2); sql << "select val from soci_test where id = 1", into(val, ind2); assert(ind2 == i_ok); assert(val == 10); sql << "select val from soci_test where id = 2", into(val, ind2); assert(ind2 == i_null); std::vector<int> ids; ids.push_back(3); ids.push_back(4); ids.push_back(5); std::vector<int> vals; vals.push_back(12); vals.push_back(13); vals.push_back(14); std::vector<indicator> inds; inds.push_back(i_ok); inds.push_back(i_null); inds.push_back(i_ok); sql << "insert into soci_test(id, val) values(:id, :val)", use(ids), use(vals, inds); ids.resize(5); vals.resize(5); sql << "select id, val from soci_test order by id desc", into(ids), into(vals, inds); assert(ids.size() == 5); assert(ids[0] == 5); assert(ids[1] == 4); assert(ids[2] == 3); assert(ids[3] == 2); assert(ids[4] == 1); assert(inds.size() == 5); assert(inds[0] == i_ok); assert(inds[1] == i_null); assert(inds[2] == i_ok); assert(inds[3] == i_null); assert(inds[4] == i_ok); assert(vals.size() == 5); assert(vals[0] == 14); assert(vals[2] == 12); assert(vals[4] == 10); } std::cout << "test 11 passed" << std::endl; #endif // SOCI_POSTGRESQL_NOPARAMS } // Dynamic binding to Row objects void test12() { { session sql(backEndFactory_, connectString_); sql.uppercase_column_names(true); auto_table_creator tableCreator(tc_.table_creator_2(sql)); row r; sql << "select * from soci_test", into(r); assert(sql.got_data() == false); sql << "insert into soci_test" " values(3.14, 123, \'Johny\'," << tc_.to_date_time("2005-12-19 22:14:17") << ", 'a')"; // select into a row { row r; statement st = (sql.prepare << "select * from soci_test", into(r)); st.execute(true); assert(r.size() == 5); assert(r.get_properties(0).get_data_type() == dt_double); assert(r.get_properties(1).get_data_type() == dt_integer); assert(r.get_properties(2).get_data_type() == dt_string); assert(r.get_properties(3).get_data_type() == dt_date); // type char is visible as string // - to comply with the implementation for Oracle assert(r.get_properties(4).get_data_type() == dt_string); assert(r.get_properties("NUM_INT").get_data_type() == dt_integer); assert(r.get_properties(0).get_name() == "NUM_FLOAT"); assert(r.get_properties(1).get_name() == "NUM_INT"); assert(r.get_properties(2).get_name() == "NAME"); assert(r.get_properties(3).get_name() == "SOMETIME"); assert(r.get_properties(4).get_name() == "CHR"); assert(equal_approx(r.get<double>(0), 3.14)); assert(r.get<int>(1) == 123); assert(r.get<std::string>(2) == "Johny"); std::tm t = { 0 }; t = r.get<std::tm>(3); assert(t.tm_year == 105); // again, type char is visible as string assert(r.get<std::string>(4) == "a"); assert(equal_approx(r.get<double>("NUM_FLOAT"), 3.14)); assert(r.get<int>("NUM_INT") == 123); assert(r.get<std::string>("NAME") == "Johny"); assert(r.get<std::string>("CHR") == "a"); assert(r.get_indicator(0) == i_ok); // verify exception thrown on invalid get<> bool caught = false; try { r.get<std::string>(0); } catch (std::bad_cast const &) { caught = true; } assert(caught); // additional test for stream-like extraction { double d; int i; std::string s; std::tm t; std::string c; r >> d >> i >> s >> t >> c; assert(equal_approx(d, 3.14)); assert(i == 123); assert(s == "Johny"); assert(t.tm_year == 105); assert(t.tm_mon == 11); assert(t.tm_mday == 19); assert(t.tm_hour == 22); assert(t.tm_min == 14); assert(t.tm_sec == 17); assert(c == "a"); } } // additional test to check if the row object can be // reused between queries { row r; sql << "select * from soci_test", into(r); assert(r.size() == 5); assert(r.get_properties(0).get_data_type() == dt_double); assert(r.get_properties(1).get_data_type() == dt_integer); assert(r.get_properties(2).get_data_type() == dt_string); assert(r.get_properties(3).get_data_type() == dt_date); sql << "select name, num_int from soci_test", into(r); assert(r.size() == 2); assert(r.get_properties(0).get_data_type() == dt_string); assert(r.get_properties(1).get_data_type() == dt_integer); } } std::cout << "test 12 passed" << std::endl; } // more dynamic bindings void test13() { session sql(backEndFactory_, connectString_); auto_table_creator tableCreator(tc_.table_creator_1(sql)); sql << "insert into soci_test(id, val) values(1, 10)"; sql << "insert into soci_test(id, val) values(2, 20)"; sql << "insert into soci_test(id, val) values(3, 30)"; #ifndef SOCI_POSTGRESQL_NOPARAMS { int id = 2; row r; sql << "select val from soci_test where id = :id", use(id), into(r); assert(r.size() == 1); assert(r.get_properties(0).get_data_type() == dt_integer); assert(r.get<int>(0) == 20); } { int id; row r; statement st = (sql.prepare << "select val from soci_test where id = :id", use(id), into(r)); id = 2; st.execute(true); assert(r.size() == 1); assert(r.get_properties(0).get_data_type() == dt_integer); assert(r.get<int>(0) == 20); id = 3; st.execute(true); assert(r.size() == 1); assert(r.get_properties(0).get_data_type() == dt_integer); assert(r.get<int>(0) == 30); id = 1; st.execute(true); assert(r.size() == 1); assert(r.get_properties(0).get_data_type() == dt_integer); assert(r.get<int>(0) == 10); } #else { row r; sql << "select val from soci_test where id = 2", into(r); assert(r.size() == 1); assert(r.get_properties(0).get_data_type() == dt_integer); assert(r.get<int>(0) == 20); } #endif // SOCI_POSTGRESQL_NOPARAMS std::cout << "test 13 passed" << std::endl; } // More Dynamic binding to row objects void test14() { { session sql(backEndFactory_, connectString_); sql.uppercase_column_names(true); auto_table_creator tableCreator(tc_.table_creator_3(sql)); row r1; sql << "select * from soci_test", into(r1); assert(sql.got_data() == false); sql << "insert into soci_test values('david', '(404)123-4567')"; sql << "insert into soci_test values('john', '(404)123-4567')"; sql << "insert into soci_test values('doe', '(404)123-4567')"; row r2; statement st = (sql.prepare << "select * from soci_test", into(r2)); st.execute(); assert(r2.size() == 2); int count = 0; while (st.fetch()) { ++count; assert(r2.get<std::string>("PHONE") == "(404)123-4567"); } assert(count == 3); } std::cout << "test 14 passed" << std::endl; } // test15 is like test14 but with a type_conversion instead of a row void test15() { session sql(backEndFactory_, connectString_); sql.uppercase_column_names(true); // simple conversion (between single basic type and user type) { auto_table_creator tableCreator(tc_.table_creator_1(sql)); MyInt mi; mi.set(123); sql << "insert into soci_test(id) values(:id)", use(mi); int i; sql << "select id from soci_test", into(i); assert(i == 123); sql << "update soci_test set id = id + 1"; sql << "select id from soci_test", into(mi); assert(mi.get() == 124); } // simple conversion with use const { auto_table_creator tableCreator(tc_.table_creator_1(sql)); MyInt mi; mi.set(123); MyInt const & cmi = mi; sql << "insert into soci_test(id) values(:id)", use(cmi); int i; sql << "select id from soci_test", into(i); assert(i == 123); } // conversions based on values (many fields involved -> ORM) { auto_table_creator tableCreator(tc_.table_creator_3(sql)); PhonebookEntry p1; sql << "select * from soci_test", into(p1); assert(p1.name == ""); assert(p1.phone == ""); p1.name = "david"; // Note: uppercase column names are used here (and later on) // for consistency with how they can be read from database // (which means forced to uppercase on Oracle) and how they are // set/get in the type conversion routines for PhonebookEntry. // In short, IF the database is Oracle, // then all column names for binding should be uppercase. sql << "insert into soci_test values(:NAME, :PHONE)", use(p1); sql << "insert into soci_test values('john', '(404)123-4567')"; sql << "insert into soci_test values('doe', '(404)123-4567')"; PhonebookEntry p2; statement st = (sql.prepare << "select * from soci_test", into(p2)); st.execute(); int count = 0; while (st.fetch()) { ++count; if (p2.name == "david") { // see type_conversion<PhonebookEntry> assert(p2.phone =="<NULL>"); } else { assert(p2.phone == "(404)123-4567"); } } assert(count == 3); } // conversions based on values with use const { auto_table_creator tableCreator(tc_.table_creator_3(sql)); PhonebookEntry p1; p1.name = "Joe Coder"; p1.phone = "123-456"; PhonebookEntry const & cp1 = p1; sql << "insert into soci_test values(:NAME, :PHONE)", use(cp1); PhonebookEntry p2; sql << "select * from soci_test", into(p2); assert(sql.got_data()); assert(p2.name == "Joe Coder"); assert(p2.phone == "123-456"); } // conversions based on accessor functions (as opposed to direct variable bindings) { auto_table_creator tableCreator(tc_.table_creator_3(sql)); PhonebookEntry3 p1; p1.setName("Joe Hacker"); p1.setPhone("10010110"); sql << "insert into soci_test values(:NAME, :PHONE)", use(p1); PhonebookEntry3 p2; sql << "select * from soci_test", into(p2); assert(sql.got_data()); assert(p2.getName() == "Joe Hacker"); assert(p2.getPhone() == "10010110"); } { // Use the PhonebookEntry2 type conversion, to test // calls to values::get_indicator() auto_table_creator tableCreator(tc_.table_creator_3(sql)); PhonebookEntry2 p1; sql << "select * from soci_test", into(p1); assert(p1.name == ""); assert(p1.phone == ""); p1.name = "david"; sql << "insert into soci_test values(:NAME, :PHONE)", use(p1); sql << "insert into soci_test values('john', '(404)123-4567')"; sql << "insert into soci_test values('doe', '(404)123-4567')"; PhonebookEntry2 p2; statement st = (sql.prepare << "select * from soci_test", into(p2)); st.execute(); int count = 0; while (st.fetch()) { ++count; if (p2.name == "david") { // see type_conversion<PhonebookEntry2> assert(p2.phone =="<NULL>"); } else { assert(p2.phone == "(404)123-4567"); } } assert(count == 3); } std::cout << "test 15 passed" << std::endl; } void test_prepared_insert_with_orm_type() { { session sql(backEndFactory_, connectString_); sql.uppercase_column_names(true); auto_table_creator tableCreator(tc_.table_creator_3(sql)); PhonebookEntry temp; PhonebookEntry e1 = { "name1", "phone1" }; PhonebookEntry e2 = { "name2", "phone2" }; //sql << "insert into soci_test values (:NAME, :PHONE)", use(temp); statement insertStatement = (sql.prepare << "insert into soci_test values (:NAME, :PHONE)", use(temp)); temp = e1; insertStatement.execute(true); temp = e2; insertStatement.execute(true); int count = 0; sql << "select count(*) from soci_test where NAME in ('name1', 'name2')", into(count); assert(count == 2); } std::cout << "test test_prepared_insert_with_orm_type passed" << std::endl; } void test_placeholder_partial_matching_with_orm_type() { { session sql(backEndFactory_, connectString_); sql.uppercase_column_names(true); auto_table_creator tableCreator(tc_.table_creator_3(sql)); PhonebookEntry in = { "name1", "phone1" }; std::string name = "nameA"; sql << "insert into soci_test values (:NAMED, :PHONE)", use(in), use(name, "NAMED"); PhonebookEntry out; sql << "select * from soci_test where PHONE = 'phone1'", into(out); assert(out.name == "nameA"); assert(out.phone == "phone1"); } std::cout << "test test_placeholder_partial_matching_with_orm_type passed" << std::endl; } // test for bulk fetch with single use void test16() { #ifndef SOCI_POSTGRESQL_NOPARAMS { session sql(backEndFactory_, connectString_); auto_table_creator tableCreator(tc_.table_creator_1(sql)); sql << "insert into soci_test(name, id) values('john', 1)"; sql << "insert into soci_test(name, id) values('george', 2)"; sql << "insert into soci_test(name, id) values('anthony', 1)"; sql << "insert into soci_test(name, id) values('marc', 3)"; sql << "insert into soci_test(name, id) values('julian', 1)"; int code = 1; std::vector<std::string> names(10); sql << "select name from soci_test where id = :id order by name", into(names), use(code); assert(names.size() == 3); assert(names[0] == "anthony"); assert(names[1] == "john"); assert(names[2] == "julian"); } #endif // SOCI_POSTGRESQL_NOPARAMS std::cout << "test 16 passed" << std::endl; } // test for basic logging support void test17() { session sql(backEndFactory_, connectString_); std::ostringstream log; sql.set_log_stream(&log); try { sql << "drop table soci_test1"; } catch (...) {} assert(sql.get_last_query() == "drop table soci_test1"); sql.set_log_stream(NULL); try { sql << "drop table soci_test2"; } catch (...) {} assert(sql.get_last_query() == "drop table soci_test2"); sql.set_log_stream(&log); try { sql << "drop table soci_test3"; } catch (...) {} assert(sql.get_last_query() == "drop table soci_test3"); assert(log.str() == "drop table soci_test1\n" "drop table soci_test3\n"); std::cout << "test 17 passed\n"; } // test for rowset creation and copying void test18() { session sql(backEndFactory_, connectString_); // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); { // Open empty rowset rowset<row> rs1 = (sql.prepare << "select * from soci_test"); assert(rs1.begin() == rs1.end()); } { // Copy construction rowset<row> rs1 = (sql.prepare << "select * from soci_test"); rowset<row> rs2(rs1); rowset<row> rs3(rs1); rowset<row> rs4(rs3); assert(rs1.begin() == rs2.begin()); assert(rs1.begin() == rs3.begin()); assert(rs1.end() == rs2.end()); assert(rs1.end() == rs3.end()); } { // Assignment rowset<row> rs1 = (sql.prepare << "select * from soci_test"); rowset<row> rs2 = (sql.prepare << "select * from soci_test"); rowset<row> rs3 = (sql.prepare << "select * from soci_test"); rs1 = rs2; rs3 = rs2; assert(rs1.begin() == rs2.begin()); assert(rs1.begin() == rs3.begin()); assert(rs1.end() == rs2.end()); assert(rs1.end() == rs3.end()); } std::cout << "test 18 passed" << std::endl; } // test for simple iterating using rowset iterator (without reading data) void test19() { session sql(backEndFactory_, connectString_); // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(id, val) values(1, 10)"; sql << "insert into soci_test(id, val) values(2, 11)"; sql << "insert into soci_test(id, val) values(3, NULL)"; sql << "insert into soci_test(id, val) values(4, NULL)"; sql << "insert into soci_test(id, val) values(5, 12)"; { rowset<row> rs = (sql.prepare << "select * from soci_test"); assert(5 == std::distance(rs.begin(), rs.end())); } } std::cout << "test 19 passed" << std::endl; } // test for reading rowset<row> using iterator void test20() { session sql(backEndFactory_, connectString_); sql.uppercase_column_names(true); // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_2(sql)); { { // Empty rowset rowset<row> rs = (sql.prepare << "select * from soci_test"); assert(0 == std::distance(rs.begin(), rs.end())); } { // Non-empty rowset sql << "insert into soci_test values(3.14, 123, \'Johny\'," << tc_.to_date_time("2005-12-19 22:14:17") << ", 'a')"; sql << "insert into soci_test values(6.28, 246, \'Robert\'," << tc_.to_date_time("2004-10-01 18:44:10") << ", 'b')"; rowset<row> rs = (sql.prepare << "select * from soci_test"); rowset<row>::const_iterator it = rs.begin(); assert(it != rs.end()); // // First row // row const & r1 = (*it); // Properties assert(r1.size() == 5); assert(r1.get_properties(0).get_data_type() == dt_double); assert(r1.get_properties(1).get_data_type() == dt_integer); assert(r1.get_properties(2).get_data_type() == dt_string); assert(r1.get_properties(3).get_data_type() == dt_date); assert(r1.get_properties(4).get_data_type() == dt_string); assert(r1.get_properties("NUM_INT").get_data_type() == dt_integer); // Data // Since we didn't specify order by in the above query, // the 2 rows may be returned in either order // (If we specify order by, we can't do it in a cross db // compatible way, because the Oracle table for this has been // created with lower case column names) std::string name = r1.get<std::string>(2); assert(name == "Johny" || name == "Robert"); if (name == "Johny") { assert(equal_approx(r1.get<double>(0), 3.14)); assert(r1.get<int>(1) == 123); assert(r1.get<std::string>(2) == "Johny"); std::tm t1 = { 0 }; t1 = r1.get<std::tm>(3); assert(t1.tm_year == 105); assert(r1.get<std::string>(4) == "a"); assert(equal_approx(r1.get<double>("NUM_FLOAT"), 3.14)); assert(r1.get<int>("NUM_INT") == 123); assert(r1.get<std::string>("NAME") == "Johny"); assert(r1.get<std::string>("CHR") == "a"); } else { assert(equal_approx(r1.get<double>(0), 6.28)); assert(r1.get<int>(1) == 246); assert(r1.get<std::string>(2) == "Robert"); std::tm t1 = r1.get<std::tm>(3); assert(t1.tm_year == 104); assert(r1.get<std::string>(4) == "b"); assert(equal_approx(r1.get<double>("NUM_FLOAT"), 6.28)); assert(r1.get<int>("NUM_INT") == 246); assert(r1.get<std::string>("NAME") == "Robert"); assert(r1.get<std::string>("CHR") == "b"); } // // Iterate to second row // ++it; assert(it != rs.end()); // // Second row // row const & r2 = (*it); // Properties assert(r2.size() == 5); assert(r2.get_properties(0).get_data_type() == dt_double); assert(r2.get_properties(1).get_data_type() == dt_integer); assert(r2.get_properties(2).get_data_type() == dt_string); assert(r2.get_properties(3).get_data_type() == dt_date); assert(r2.get_properties(4).get_data_type() == dt_string); assert(r2.get_properties("NUM_INT").get_data_type() == dt_integer); std::string newName = r2.get<std::string>(2); assert(name != newName); assert(newName == "Johny" || newName == "Robert"); if (newName == "Johny") { assert(equal_approx(r2.get<double>(0), 3.14)); assert(r2.get<int>(1) == 123); assert(r2.get<std::string>(2) == "Johny"); std::tm t2 = r2.get<std::tm>(3); assert(t2.tm_year == 105); assert(r2.get<std::string>(4) == "a"); assert(equal_approx(r2.get<double>("NUM_FLOAT"), 3.14)); assert(r2.get<int>("NUM_INT") == 123); assert(r2.get<std::string>("NAME") == "Johny"); assert(r2.get<std::string>("CHR") == "a"); } else { assert(equal_approx(r2.get<double>(0), 6.28)); assert(r2.get<int>(1) == 246); assert(r2.get<std::string>(2) == "Robert"); std::tm t2 = r2.get<std::tm>(3); assert(t2.tm_year == 104); assert(r2.get<std::string>(4) == "b"); assert(equal_approx(r2.get<double>("NUM_FLOAT"), 6.28)); assert(r2.get<int>("NUM_INT") == 246); assert(r2.get<std::string>("NAME") == "Robert"); assert(r2.get<std::string>("CHR") == "b"); } } { // Non-empty rowset with NULL values sql << "insert into soci_test " << "(num_int, num_float , name, sometime, chr) " << "values (0, NULL, NULL, NULL, NULL)"; rowset<row> rs = (sql.prepare << "select num_int, num_float, name, sometime, chr " << "from soci_test where num_int = 0"); rowset<row>::const_iterator it = rs.begin(); assert(it != rs.end()); // // First row // row const& r1 = (*it); // Properties assert(r1.size() == 5); assert(r1.get_properties(0).get_data_type() == dt_integer); assert(r1.get_properties(1).get_data_type() == dt_double); assert(r1.get_properties(2).get_data_type() == dt_string); assert(r1.get_properties(3).get_data_type() == dt_date); assert(r1.get_properties(4).get_data_type() == dt_string); // Data assert(r1.get_indicator(0) == soci::i_ok); assert(r1.get<int>(0) == 0); assert(r1.get_indicator(1) == soci::i_null); assert(r1.get_indicator(2) == soci::i_null); assert(r1.get_indicator(3) == soci::i_null); assert(r1.get_indicator(4) == soci::i_null); } } std::cout << "test 20 passed" << std::endl; } // test for reading rowset<int> using iterator void test21() { session sql(backEndFactory_, connectString_); // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(id) values(1)"; sql << "insert into soci_test(id) values(2)"; sql << "insert into soci_test(id) values(3)"; sql << "insert into soci_test(id) values(4)"; sql << "insert into soci_test(id) values(5)"; { rowset<int> rs = (sql.prepare << "select id from soci_test order by id asc"); // 1st row rowset<int>::const_iterator pos = rs.begin(); assert(1 == (*pos)); // 3rd row std::advance(pos, 2); assert(3 == (*pos)); // 5th row std::advance(pos, 2); assert(5 == (*pos)); // The End ++pos; assert(pos == rs.end()); } } std::cout << "test 21 passed" << std::endl; } // test for handling 'use' and reading rowset<std::string> using iterator void test22() { session sql(backEndFactory_, connectString_); // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(str) values('abc')"; sql << "insert into soci_test(str) values('def')"; sql << "insert into soci_test(str) values('ghi')"; sql << "insert into soci_test(str) values('jkl')"; { // Expected result in numbers std::string idle("def"); rowset<std::string> rs1 = (sql.prepare << "select str from soci_test where str = :idle", use(idle)); assert(1 == std::distance(rs1.begin(), rs1.end())); // Expected result in value idle = "jkl"; rowset<std::string> rs2 = (sql.prepare << "select str from soci_test where str = :idle", use(idle)); assert(idle == *(rs2.begin())); } } std::cout << "test 22 passed" << std::endl; } // test for handling troublemaker void test23() { session sql(backEndFactory_, connectString_); // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(str) values('abc')"; { // verify exception thrown bool caught = false; try { std::string troublemaker; rowset<std::string> rs1 = (sql.prepare << "select str from soci_test", into(troublemaker)); } catch (soci_error const&) { caught = true; } assert(caught); } std::cout << "test 23 passed" << std::endl; } } // test for handling NULL values with expected exception: // "Null value fetched and no indicator defined." void test24() { session sql(backEndFactory_, connectString_); // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(val) values(1)"; sql << "insert into soci_test(val) values(2)"; sql << "insert into soci_test(val) values(NULL)"; sql << "insert into soci_test(val) values(3)"; { // verify exception thrown bool caught = false; try { rowset<int> rs = (sql.prepare << "select val from soci_test order by val asc"); int tester = 0; for (rowset<int>::const_iterator it = rs.begin(); it != rs.end(); ++it) { tester = *it; } (void)tester; // Never should get here assert(false); } catch (soci_error const&) { caught = true; } assert(caught); } std::cout << "test 24 passed" << std::endl; } } // test25 is like test15 but with rowset and iterators use void test25() { session sql(backEndFactory_, connectString_); sql.uppercase_column_names(true); { auto_table_creator tableCreator(tc_.table_creator_3(sql)); PhonebookEntry p1; sql << "select * from soci_test", into(p1); assert(p1.name == ""); assert(p1.phone == ""); p1.name = "david"; sql << "insert into soci_test values(:NAME, :PHONE)", use(p1); sql << "insert into soci_test values('john', '(404)123-4567')"; sql << "insert into soci_test values('doe', '(404)123-4567')"; rowset<PhonebookEntry> rs = (sql.prepare << "select * from soci_test"); int count = 0; for (rowset<PhonebookEntry>::const_iterator it = rs.begin(); it != rs.end(); ++it) { ++count; PhonebookEntry const& p2 = (*it); if (p2.name == "david") { // see type_conversion<PhonebookEntry> assert(p2.phone =="<NULL>"); } else { assert(p2.phone == "(404)123-4567"); } } assert(3 == count); } std::cout << "test 25 passed" << std::endl; } // test for handling NULL values with boost::optional // (both into and use) void test26() { #ifdef HAVE_BOOST session sql(backEndFactory_, connectString_); // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); { sql << "insert into soci_test(val) values(7)"; { // verify non-null value is fetched correctly boost::optional<int> opt; sql << "select val from soci_test", into(opt); assert(opt.is_initialized()); assert(opt.get() == 7); // indicators can be used with optional // (although that's just a consequence of implementation, // not an intended feature - but let's test it anyway) indicator ind; opt.reset(); sql << "select val from soci_test", into(opt, ind); assert(opt.is_initialized()); assert(opt.get() == 7); assert(ind == i_ok); // verify null value is fetched correctly sql << "select i1 from soci_test", into(opt); assert(opt.is_initialized() == false); // and with indicator opt = 5; sql << "select i1 from soci_test", into(opt, ind); assert(opt.is_initialized() == false); assert(ind == i_null); // verify non-null is inserted correctly opt = 3; sql << "update soci_test set val = :v", use(opt); int j = 0; sql << "select val from soci_test", into(j); assert(j == 3); // verify null is inserted correctly opt.reset(); sql << "update soci_test set val = :v", use(opt); ind = i_ok; sql << "select val from soci_test", into(j, ind); assert(ind == i_null); } // vector tests (select) { sql << "delete from soci_test"; // simple readout of non-null data sql << "insert into soci_test(id, val, str) values(1, 5, \'abc\')"; sql << "insert into soci_test(id, val, str) values(2, 6, \'def\')"; sql << "insert into soci_test(id, val, str) values(3, 7, \'ghi\')"; sql << "insert into soci_test(id, val, str) values(4, 8, null)"; sql << "insert into soci_test(id, val, str) values(5, 9, \'mno\')"; std::vector<boost::optional<int> > v(10); sql << "select val from soci_test order by val", into(v); assert(v.size() == 5); assert(v[0].is_initialized()); assert(v[0].get() == 5); assert(v[1].is_initialized()); assert(v[1].get() == 6); assert(v[2].is_initialized()); assert(v[2].get() == 7); assert(v[3].is_initialized()); assert(v[3].get() == 8); assert(v[4].is_initialized()); assert(v[4].get() == 9); // readout of nulls sql << "update soci_test set val = null where id = 2 or id = 4"; std::vector<int> ids(5); sql << "select id, val from soci_test order by id", into(ids), into(v); assert(v.size() == 5); assert(ids.size() == 5); assert(v[0].is_initialized()); assert(v[0].get() == 5); assert(v[1].is_initialized() == false); assert(v[2].is_initialized()); assert(v[2].get() == 7); assert(v[3].is_initialized() == false); assert(v[4].is_initialized()); assert(v[4].get() == 9); // readout with statement preparation int id = 1; ids.resize(3); v.resize(3); statement st = (sql.prepare << "select id, val from soci_test order by id", into(ids), into(v)); st.execute(); while (st.fetch()) { for (std::size_t i = 0; i != v.size(); ++i) { assert(id == ids[i]); if (id == 2 || id == 4) { assert(v[i].is_initialized() == false); } else { assert(v[i].is_initialized() && v[i].get() == id + 4); } ++id; } ids.resize(3); v.resize(3); } assert(id == 6); } // and why not stress iterators and the dynamic binding, too! { rowset<row> rs = (sql.prepare << "select id, val, str from soci_test order by id"); rowset<row>::const_iterator it = rs.begin(); assert(it != rs.end()); row const& r1 = (*it); assert(r1.size() == 3); // Note: for the reason of differences between number(x,y) type and // binary representation of integers, the following commented assertions // do not work for Oracle. // The problem is that for this single table the data type used in Oracle // table creator for the id column is number(10,0), // which allows to insert all int values. // On the other hand, the column description scheme used in the Oracle // backend figures out that the natural type for such a column // is eUnsignedInt - this makes the following assertions fail. // Other database backends (like PostgreSQL) use other types like int // and this not only allows to insert all int values (obviously), // but is also recognized as int (obviously). // There is a similar problem with stream-like extraction, // where internally get<T> is called and the type mismatch is detected // for the id column - that's why the code below skips this column // and tests the remaining column only. //assert(r1.get_properties(0).get_data_type() == dt_integer); assert(r1.get_properties(1).get_data_type() == dt_integer); assert(r1.get_properties(2).get_data_type() == dt_string); //assert(r1.get<int>(0) == 1); assert(r1.get<int>(1) == 5); assert(r1.get<std::string>(2) == "abc"); assert(r1.get<boost::optional<int> >(1).is_initialized()); assert(r1.get<boost::optional<int> >(1).get() == 5); assert(r1.get<boost::optional<std::string> >(2).is_initialized()); assert(r1.get<boost::optional<std::string> >(2).get() == "abc"); ++it; row const& r2 = (*it); assert(r2.size() == 3); // assert(r2.get_properties(0).get_data_type() == dt_integer); assert(r2.get_properties(1).get_data_type() == dt_integer); assert(r2.get_properties(2).get_data_type() == dt_string); //assert(r2.get<int>(0) == 2); try { // expect exception here, this is NULL value (void)r1.get<int>(1); assert(false); } catch (soci_error const &) {} // but we can read it as optional assert(r2.get<boost::optional<int> >(1).is_initialized() == false); // stream-like data extraction ++it; row const &r3 = (*it); boost::optional<int> io; boost::optional<std::string> so; r3.skip(); // move to val and str columns r3 >> io >> so; assert(io.is_initialized() && io.get() == 7); assert(so.is_initialized() && so.get() == "ghi"); ++it; row const &r4 = (*it); r3.skip(); // move to val and str columns r4 >> io >> so; assert(io.is_initialized() == false); assert(so.is_initialized() == false); } // bulk inserts of non-null data { sql << "delete from soci_test"; std::vector<int> ids; std::vector<boost::optional<int> > v; ids.push_back(10); v.push_back(20); ids.push_back(11); v.push_back(21); ids.push_back(12); v.push_back(22); ids.push_back(13); v.push_back(23); sql << "insert into soci_test(id, val) values(:id, :val)", use(ids, "id"), use(v, "val"); int sum; sql << "select sum(val) from soci_test", into(sum); assert(sum == 86); // bulk inserts of some-null data sql << "delete from soci_test"; v[2].reset(); v[3].reset(); sql << "insert into soci_test(id, val) values(:id, :val)", use(ids, "id"), use(v, "val"); sql << "select sum(val) from soci_test", into(sum); assert(sum == 41); } // composability with user conversions { sql << "delete from soci_test"; boost::optional<MyInt> omi1; boost::optional<MyInt> omi2; omi1 = MyInt(125); omi2.reset(); sql << "insert into soci_test(id, val) values(:id, :val)", use(omi1), use(omi2); sql << "select id, val from soci_test", into(omi2), into(omi1); assert(omi1.is_initialized() == false); assert(omi2.is_initialized() && omi2.get().get() == 125); } // use with const optional and user conversions { sql << "delete from soci_test"; boost::optional<MyInt> omi1; boost::optional<MyInt> omi2; omi1 = MyInt(125); omi2.reset(); boost::optional<MyInt> const & comi1 = omi1; boost::optional<MyInt> const & comi2 = omi2; sql << "insert into soci_test(id, val) values(:id, :val)", use(comi1), use(comi2); sql << "select id, val from soci_test", into(omi2), into(omi1); assert(omi1.is_initialized() == false); assert(omi2.is_initialized() && omi2.get().get() == 125); } // use with rowset and table containing null values { auto_table_creator tableCreator(tc_.table_creator_1(sql)); sql << "insert into soci_test(id, val) values(1, 10)"; sql << "insert into soci_test(id, val) values(2, 11)"; sql << "insert into soci_test(id, val) values(3, NULL)"; sql << "insert into soci_test(id, val) values(4, 13)"; rowset<boost::optional<int> > rs = (sql.prepare << "select val from soci_test order by id asc"); // 1st row rowset<boost::optional<int> >::const_iterator pos = rs.begin(); assert((*pos).is_initialized()); assert(10 == (*pos).get()); // 2nd row ++pos; assert((*pos).is_initialized()); assert(11 == (*pos).get()); // 3rd row ++pos; assert((*pos).is_initialized() == false); // 4th row ++pos; assert((*pos).is_initialized()); assert(13 == (*pos).get()); } } std::cout << "test 26 passed" << std::endl; #else std::cout << "test 26 skipped (no Boost)" << std::endl; #endif // HAVE_BOOST } // connection and reconnection tests void test27() { { // empty session session sql; // idempotent: sql.close(); try { sql.reconnect(); assert(false); } catch (soci_error const &e) { assert(e.what() == std::string( "Cannot reconnect without previous connection.")); } // open from empty session sql.open(backEndFactory_, connectString_); sql.close(); // reconnecting from closed session sql.reconnect(); // opening already connected session try { sql.open(backEndFactory_, connectString_); assert(false); } catch (soci_error const &e) { assert(e.what() == std::string( "Cannot open already connected session.")); } sql.close(); // open from closed sql.open(backEndFactory_, connectString_); // reconnect from already connected session sql.reconnect(); } { session sql; try { sql << "this statement cannot execute"; assert(false); } catch (soci_error const &e) { assert(e.what() == std::string("Session is not connected.")); } } std::cout << "test 27 passed" << std::endl; } void test28() { #ifdef HAVE_BOOST session sql(backEndFactory_, connectString_); auto_table_creator tableCreator(tc_.table_creator_2(sql)); { boost::tuple<double, int, std::string> t1(3.5, 7, "Joe Hacker"); assert(equal_approx(t1.get<0>(), 3.5)); assert(t1.get<1>() == 7); assert(t1.get<2>() == "Joe Hacker"); sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); // basic query boost::tuple<double, int, std::string> t2; sql << "select num_float, num_int, name from soci_test", into(t2); assert(equal_approx(t2.get<0>(), 3.5)); assert(t2.get<1>() == 7); assert(t2.get<2>() == "Joe Hacker"); sql << "delete from soci_test"; } { // composability with boost::optional // use: boost::tuple<double, boost::optional<int>, std::string> t1( 3.5, boost::optional<int>(7), "Joe Hacker"); assert(equal_approx(t1.get<0>(), 3.5)); assert(t1.get<1>().is_initialized()); assert(t1.get<1>().get() == 7); assert(t1.get<2>() == "Joe Hacker"); sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); // into: boost::tuple<double, boost::optional<int>, std::string> t2; sql << "select num_float, num_int, name from soci_test", into(t2); assert(equal_approx(t2.get<0>(), 3.5)); assert(t2.get<1>().is_initialized()); assert(t2.get<1>().get() == 7); assert(t2.get<2>() == "Joe Hacker"); sql << "delete from soci_test"; } { // composability with user-provided conversions // use: boost::tuple<double, MyInt, std::string> t1(3.5, 7, "Joe Hacker"); assert(equal_approx(t1.get<0>(), 3.5)); assert(t1.get<1>().get() == 7); assert(t1.get<2>() == "Joe Hacker"); sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); // into: boost::tuple<double, MyInt, std::string> t2; sql << "select num_float, num_int, name from soci_test", into(t2); assert(equal_approx(t2.get<0>(), 3.5)); assert(t2.get<1>().get() == 7); assert(t2.get<2>() == "Joe Hacker"); sql << "delete from soci_test"; } { // let's have fun - composition of tuple, optional and user-defined type // use: boost::tuple<double, boost::optional<MyInt>, std::string> t1( 3.5, boost::optional<MyInt>(7), "Joe Hacker"); assert(equal_approx(t1.get<0>(), 3.5)); assert(t1.get<1>().is_initialized()); assert(t1.get<1>().get().get() == 7); assert(t1.get<2>() == "Joe Hacker"); sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); // into: boost::tuple<double, boost::optional<MyInt>, std::string> t2; sql << "select num_float, num_int, name from soci_test", into(t2); assert(equal_approx(t2.get<0>(), 3.5)); assert(t2.get<1>().is_initialized()); assert(t2.get<1>().get().get() == 7); assert(t2.get<2>() == "Joe Hacker"); sql << "update soci_test set num_int = NULL"; sql << "select num_float, num_int, name from soci_test", into(t2); assert(equal_approx(t2.get<0>(), 3.5)); assert(t2.get<1>().is_initialized() == false); assert(t2.get<2>() == "Joe Hacker"); } { // rowset<tuple> sql << "insert into soci_test(num_float, num_int, name) values(4.0, 8, 'Tony Coder')"; sql << "insert into soci_test(num_float, num_int, name) values(4.5, NULL, 'Cecile Sharp')"; sql << "insert into soci_test(num_float, num_int, name) values(5.0, 10, 'Djhava Ravaa')"; typedef boost::tuple<double, boost::optional<int>, std::string> T; rowset<T> rs = (sql.prepare << "select num_float, num_int, name from soci_test order by num_float asc"); rowset<T>::const_iterator pos = rs.begin(); assert(equal_approx(pos->get<0>(), 3.5)); assert(pos->get<1>().is_initialized() == false); assert(pos->get<2>() == "Joe Hacker"); ++pos; assert(equal_approx(pos->get<0>(), 4.0)); assert(pos->get<1>().is_initialized()); assert(pos->get<1>().get() == 8); assert(pos->get<2>() == "Tony Coder"); ++pos; assert(equal_approx(pos->get<0>(), 4.5)); assert(pos->get<1>().is_initialized() == false); assert(pos->get<2>() == "Cecile Sharp"); ++pos; assert(equal_approx(pos->get<0>(), 5.0)); assert(pos->get<1>().is_initialized()); assert(pos->get<1>().get() == 10); assert(pos->get<2>() == "Djhava Ravaa"); ++pos; assert(pos == rs.end()); } std::cout << "test 28 passed" << std::endl; #else std::cout << "test 28 skipped (no Boost)" << std::endl; #endif // HAVE_BOOST } void test29() { #ifdef HAVE_BOOST #if defined(BOOST_VERSION) && BOOST_VERSION >= 103500 session sql(backEndFactory_, connectString_); auto_table_creator tableCreator(tc_.table_creator_2(sql)); { boost::fusion::vector<double, int, std::string> t1(3.5, 7, "Joe Hacker"); assert(equal_approx(boost::fusion::at_c<0>(t1), 3.5)); assert(boost::fusion::at_c<1>(t1) == 7); assert(boost::fusion::at_c<2>(t1) == "Joe Hacker"); sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); // basic query boost::fusion::vector<double, int, std::string> t2; sql << "select num_float, num_int, name from soci_test", into(t2); assert(equal_approx(boost::fusion::at_c<0>(t2), 3.5)); assert(boost::fusion::at_c<1>(t2) == 7); assert(boost::fusion::at_c<2>(t2) == "Joe Hacker"); sql << "delete from soci_test"; } { // composability with boost::optional // use: boost::fusion::vector<double, boost::optional<int>, std::string> t1( 3.5, boost::optional<int>(7), "Joe Hacker"); assert(equal_approx(boost::fusion::at_c<0>(t1), 3.5)); assert(boost::fusion::at_c<1>(t1).is_initialized()); assert(boost::fusion::at_c<1>(t1).get() == 7); assert(boost::fusion::at_c<2>(t1) == "Joe Hacker"); sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); // into: boost::fusion::vector<double, boost::optional<int>, std::string> t2; sql << "select num_float, num_int, name from soci_test", into(t2); assert(equal_approx(boost::fusion::at_c<0>(t2), 3.5)); assert(boost::fusion::at_c<1>(t2).is_initialized()); assert(boost::fusion::at_c<1>(t2) == 7); assert(boost::fusion::at_c<2>(t2) == "Joe Hacker"); sql << "delete from soci_test"; } { // composability with user-provided conversions // use: boost::fusion::vector<double, MyInt, std::string> t1(3.5, 7, "Joe Hacker"); assert(equal_approx(boost::fusion::at_c<0>(t1), 3.5)); assert(boost::fusion::at_c<1>(t1).get() == 7); assert(boost::fusion::at_c<2>(t1) == "Joe Hacker"); sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); // into: boost::fusion::vector<double, MyInt, std::string> t2; sql << "select num_float, num_int, name from soci_test", into(t2); assert(equal_approx(boost::fusion::at_c<0>(t2), 3.5)); assert(boost::fusion::at_c<1>(t2).get() == 7); assert(boost::fusion::at_c<2>(t2) == "Joe Hacker"); sql << "delete from soci_test"; } { // let's have fun - composition of tuple, optional and user-defined type // use: boost::fusion::vector<double, boost::optional<MyInt>, std::string> t1( 3.5, boost::optional<MyInt>(7), "Joe Hacker"); assert(equal_approx(boost::fusion::at_c<0>(t1), 3.5)); assert(boost::fusion::at_c<1>(t1).is_initialized()); assert(boost::fusion::at_c<1>(t1).get().get() == 7); assert(boost::fusion::at_c<2>(t1) == "Joe Hacker"); sql << "insert into soci_test(num_float, num_int, name) values(:d, :i, :s)", use(t1); // into: boost::fusion::vector<double, boost::optional<MyInt>, std::string> t2; sql << "select num_float, num_int, name from soci_test", into(t2); assert(equal_approx(boost::fusion::at_c<0>(t2), 3.5)); assert(boost::fusion::at_c<1>(t2).is_initialized()); assert(boost::fusion::at_c<1>(t2).get().get() == 7); assert(boost::fusion::at_c<2>(t2) == "Joe Hacker"); sql << "update soci_test set num_int = NULL"; sql << "select num_float, num_int, name from soci_test", into(t2); assert(equal_approx(boost::fusion::at_c<0>(t2), 3.5)); assert(boost::fusion::at_c<1>(t2).is_initialized() == false); assert(boost::fusion::at_c<2>(t2) == "Joe Hacker"); } { // rowset<fusion::vector> sql << "insert into soci_test(num_float, num_int, name) values(4.0, 8, 'Tony Coder')"; sql << "insert into soci_test(num_float, num_int, name) values(4.5, NULL, 'Cecile Sharp')"; sql << "insert into soci_test(num_float, num_int, name) values(5.0, 10, 'Djhava Ravaa')"; typedef boost::fusion::vector<double, boost::optional<int>, std::string> T; rowset<T> rs = (sql.prepare << "select num_float, num_int, name from soci_test order by num_float asc"); rowset<T>::const_iterator pos = rs.begin(); assert(equal_approx(boost::fusion::at_c<0>(*pos), 3.5)); assert(boost::fusion::at_c<1>(*pos).is_initialized() == false); assert(boost::fusion::at_c<2>(*pos) == "Joe Hacker"); ++pos; assert(equal_approx(boost::fusion::at_c<0>(*pos), 4.0)); assert(boost::fusion::at_c<1>(*pos).is_initialized()); assert(boost::fusion::at_c<1>(*pos).get() == 8); assert(boost::fusion::at_c<2>(*pos) == "Tony Coder"); ++pos; assert(equal_approx(boost::fusion::at_c<0>(*pos), 4.5)); assert(boost::fusion::at_c<1>(*pos).is_initialized() == false); assert(boost::fusion::at_c<2>(*pos) == "Cecile Sharp"); ++pos; assert(equal_approx(boost::fusion::at_c<0>(*pos), 5.0)); assert(boost::fusion::at_c<1>(*pos).is_initialized()); assert(boost::fusion::at_c<1>(*pos).get() == 10); assert(boost::fusion::at_c<2>(*pos) == "Djhava Ravaa"); ++pos; assert(pos == rs.end()); } std::cout << "test 29 passed" << std::endl; #else std::cout << "test 29 skipped (no boost::fusion)" << std::endl; #endif // BOOST_VERSION #else std::cout << "test 29 skipped (no Boost)" << std::endl; #endif // HAVE_BOOST } // test for boost::gregorian::date void test30() { #ifdef HAVE_BOOST session sql(backEndFactory_, connectString_); { auto_table_creator tableCreator(tc_.table_creator_1(sql)); std::tm nov15; nov15.tm_year = 105; nov15.tm_mon = 10; nov15.tm_mday = 15; nov15.tm_hour = 0; nov15.tm_min = 0; nov15.tm_sec = 0; sql << "insert into soci_test(tm) values(:tm)", use(nov15); boost::gregorian::date bgd; sql << "select tm from soci_test", into(bgd); assert(bgd.year() == 2005); assert(bgd.month() == 11); assert(bgd.day() == 15); sql << "update soci_test set tm = NULL"; try { sql << "select tm from soci_test", into(bgd); assert(false); } catch (soci_error const & e) { assert(e.what() == std::string("Null value not allowed for this type")); } } { auto_table_creator tableCreator(tc_.table_creator_1(sql)); boost::gregorian::date bgd(2008, boost::gregorian::May, 5); sql << "insert into soci_test(tm) values(:tm)", use(bgd); std::tm t; sql << "select tm from soci_test", into(t); assert(t.tm_year == 108); assert(t.tm_mon == 4); assert(t.tm_mday == 5); } std::cout << "test 30 passed" << std::endl; #else std::cout << "test 30 skipped (no Boost)" << std::endl; #endif // HAVE_BOOST } // connection pool - simple sequential test, no multiple threads void test31() { { // phase 1: preparation const size_t pool_size = 10; connection_pool pool(pool_size); for (std::size_t i = 0; i != pool_size; ++i) { session & sql = pool.at(i); sql.open(backEndFactory_, connectString_); } // phase 2: usage for (std::size_t i = 0; i != pool_size; ++i) { // poor man way to lease more than one connection session sql_unused1(pool); session sql(pool); session sql_unused2(pool); { auto_table_creator tableCreator(tc_.table_creator_1(sql)); char c('a'); sql << "insert into soci_test(c) values(:c)", use(c); sql << "select c from soci_test", into(c); assert(c == 'a'); } } } std::cout << "test 31 passed\n"; } // Issue 66 - test query transformation callback feature static std::string no_op_transform(std::string query) { return query; } static std::string lower_than_g(std::string query) { return query + " WHERE c < 'g'"; } struct where_condition : std::unary_function<std::string, std::string> { where_condition(std::string const& where) : where_(where) {} result_type operator()(argument_type query) const { return query + " WHERE " + where_; } std::string where_; }; void run_query_transformation_test(session& sql) { // create and populate the test table auto_table_creator tableCreator(tc_.table_creator_1(sql)); for (char c = 'a'; c <= 'z'; ++c) { sql << "insert into soci_test(c) values(\'" << c << "\')"; } char const* query = "select count(*) from soci_test"; // free function, no-op { sql.set_query_transformation(no_op_transform); int count; sql << query, into(count); assert(count == 'z' - 'a' + 1); } // free function { sql.set_query_transformation(lower_than_g); int count; sql << query, into(count); assert(count == 'g' - 'a'); } // function object with state { sql.set_query_transformation(where_condition("c > 'g' AND c < 'j'")); int count = 0; sql << query, into(count); assert(count == 'j' - 'h'); count = 0; sql.set_query_transformation(where_condition("c > 's' AND c <= 'z'")); sql << query, into(count); assert(count == 'z' - 's'); } // Bug in Visual Studio __cplusplus still means C++03 // https://connect.microsoft.com/VisualStudio/feedback/details/763051/ #if defined _MSC_VER && _MSC_VER>=1600 #define SOCI_HAVE_CPP11 1 #elif __cplusplus >= 201103L #define SOCI_HAVE_CPP11 1 #else #undef SOCI_HAVE_CPP11 #endif #ifdef SOCI_HAVE_CPP11 // lambda { sql.set_query_transformation( [](std::string const& query) { return query + " WHERE c > 'g' AND c < 'j'"; }); int count = 0; sql << query, into(count); assert(count == 'j' - 'h'); } #endif #undef SOCI_HAVE_CPP11 // prepared statements // constant effect (pre-prepare set transformation) { // set transformation after statement is prepared sql.set_query_transformation(lower_than_g); // prepare statement int count; statement st = (sql.prepare << query, into(count)); // observe transformation effect st.execute(true); assert(count == 'g' - 'a'); // reset transformation sql.set_query_transformation(no_op_transform); // observe the same transformation, no-op set above has no effect count = 0; st.execute(true); assert(count == 'g' - 'a'); } // no effect (post-prepare set transformation) { // reset sql.set_query_transformation(no_op_transform); // prepare statement int count; statement st = (sql.prepare << query, into(count)); // set transformation after statement is prepared sql.set_query_transformation(lower_than_g); // observe no effect of WHERE clause injection st.execute(true); assert(count == 'z' - 'a' + 1); } } void test_query_transformation() { { session sql(backEndFactory_, connectString_); run_query_transformation_test(sql); } std::cout << "test query_transformation passed" << std::endl; } void test_query_transformation_with_connection_pool() { { // phase 1: preparation const size_t pool_size = 10; connection_pool pool(pool_size); for (std::size_t i = 0; i != pool_size; ++i) { session & sql = pool.at(i); sql.open(backEndFactory_, connectString_); } session sql(pool); run_query_transformation_test(sql); } std::cout << "test query_transformation with connection pool passed" << std::endl; } // Originally, submitted to SQLite3 backend and later moved to common test. // Test commit b394d039530f124802d06c3b1a969c3117683152 // Author: Mika Fischer <mika.fischer@zoopnet.de> // Date: Thu Nov 17 13:28:07 2011 +0100 // Implement get_affected_rows for SQLite3 backend void test_get_affected_rows() { { session sql(backEndFactory_, connectString_); auto_table_creator tableCreator(tc_.table_creator_4(sql)); if (!tableCreator.get()) { std::cout << "test get_affected_rows skipped (function not implemented)" << std::endl; return; } for (int i = 0; i != 10; i++) { sql << "insert into soci_test(val) values(:val)", use(i); } statement st1 = (sql.prepare << "update soci_test set val = val + 1"); st1.execute(true); assert(st1.get_affected_rows() == 10); statement st2 = (sql.prepare << "delete from soci_test where val <= 5"); st2.execute(true); assert(st2.get_affected_rows() == 5); statement st3 = (sql.prepare << "update soci_test set val = val + 1"); st3.execute(true); assert(st3.get_affected_rows() == 5); std::vector<int> v(5, 0); for (std::size_t i = 0; i < v.size(); ++i) { v[i] = (7 + i); } // test affected rows for bulk operations. statement st4 = (sql.prepare << "delete from soci_test where val = :v", use(v)); st4.execute(true); assert(st4.get_affected_rows() == 5); std::vector<std::string> w(2, "1"); w[1] = "a"; // this invalid value may cause an exception. statement st5 = (sql.prepare << "insert into soci_test(val) values(:val)", use(w)); try { st5.execute(true); } catch(...) {} // confirm the partial insertion. int val = 0; sql << "select count(val) from soci_test", into(val); if(val != 0) { // test the preserved 'number of rows // affected' after a potential failure. assert(st5.get_affected_rows() != 0); } } std::cout << "test get_affected_rows passed" << std::endl; } // test fix for: Backend is not set properly with connection pool (pull #5) void test_pull5() { { const size_t pool_size = 1; connection_pool pool(pool_size); for (std::size_t i = 0; i != pool_size; ++i) { session & sql = pool.at(i); sql.open(backEndFactory_, connectString_); } soci::session sql(pool); sql.reconnect(); sql.begin(); // no crash expected } std::cout << "test pull-5 passed\n"; } // issue 67 - Allocated statement backend memory leaks on exception // If the test runs under memory debugger and it passes, then // soci::details::statement_impl::backEnd_ must not leak void test_issue67() { session sql(backEndFactory_, connectString_); auto_table_creator tableCreator(tc_.table_creator_1(sql)); { try { rowset<row> rs1 = (sql.prepare << "select * from soci_testX"); // TODO: On Linux, no exception thrown; neither from prepare, nor from execute? // soci_odbc_test_postgresql: // /home/travis/build/SOCI/soci/src/core/test/common-tests.h:3505: // void soci::tests::common_tests::test_issue67(): Assertion `!"exception expected"' failed. //assert(!"exception expected"); // relax temporarily } catch (soci_error const &e) { (void)e; assert("expected exception caught"); std::cout << "test issue-67 passed - check memory debugger output for leaks" << std::endl; } } } // issue 154 - Calling undefine_and_bind and then define_and_bind causes a leak. // If the test runs under memory debugger and it passes, then // soci::details::standard_use_type_backend and vector_use_type_backend must not leak void test_issue154() { session sql(backEndFactory_, connectString_); auto_table_creator tableCreator(tc_.table_creator_1(sql)); sql << "insert into soci_test(id) values (1)"; { int id = 1; int val = 0; statement st(sql); st.exchange(use(id)); st.alloc(); st.prepare("select id from soci_test where id = :1"); st.define_and_bind(); st.undefine_and_bind(); st.exchange(soci::into(val)); st.define_and_bind(); st.execute(true); assert(val == 1); } // vector variation { std::vector<int> ids(1, 2); std::vector<int> vals(1, 1); int val = 0; statement st(sql); st.exchange(use(ids)); st.alloc(); st.prepare("insert into soci_test(id, val) values (:1, :2)"); st.define_and_bind(); st.undefine_and_bind(); st.exchange(use(vals)); st.define_and_bind(); st.execute(true); sql << "select val from soci_test where id = 2", into(val); assert(val == 1); } std::cout << "test issue-154 passed - check memory debugger output for leaks" << std::endl; } }; // class common_tests } // namespace tests } // namespace soci #endif // SOCI_COMMON_TESTS_H_INCLUDED
[ "pollastri.p@gmail.com" ]
pollastri.p@gmail.com
47af66fae5a522d6990738b3f8f81748bebcc4e4
2d0aa70f9c8fcfe4db903b0390154879921d42b7
/ME3MPSDKTEST/ME3MPSDKTEST/SDK_HEADERS/GFxUI_classes.h
b4122a132b269cc34312044572f68e01b590066e
[]
no_license
Erik-JS/Misc-Stuff
ac9eb3304b5ffa6c7c85bce2b5d614b9c52a2d56
e11c5e0f5c0ca3fd2742c48dc5d68f7d5bf4fa32
refs/heads/master
2021-01-17T06:09:49.543058
2016-07-16T20:19:59
2016-07-16T20:19:59
43,450,777
0
1
null
2016-07-24T16:24:36
2015-09-30T18:22:46
C++
UTF-8
C++
false
false
29,120
h
/* ############################################################################################# # Mass Effect 3 (1.5) SDK # Generated with TheFeckless UE3 SDK Generator v1.4_Beta-Rev.51 # ========================================================================================= # # File: GFxUI_classes.h # ========================================================================================= # # Credits: uNrEaL, Tamimego, SystemFiles, R00T88, _silencer, the1domo, K@N@VEL # Thanks: HOOAH07, lowHertz # Forums: www.uc-forum.com, www.gamedeception.net ############################################################################################# */ #ifdef _MSC_VER #pragma pack ( push, 0x4 ) #endif /* # ========================================================================================= # # Constants # ========================================================================================= # */ /* # ========================================================================================= # # Enums # ========================================================================================= # */ // Enum GFxUI.GFxMovie.GFxRenderTextureMode /*enum GFxRenderTextureMode { RTM_Opaque = 0, RTM_Alpha = 1, RTM_AlphaComposite = 2, RTM_MAX = 3 };*/ // Enum GFxUI.GFxMovie.GFxTimingMode /*enum GFxTimingMode { TM_Game = 0, TM_Real = 1, TM_MAX = 2 };*/ // Enum GFxUI.GFxMovie.ASType /*enum ASType { AS_Undefined = 0, AS_Null = 1, AS_Number = 2, AS_String = 3, AS_Boolean = 4, AS_MAX = 5 };*/ // Enum GFxUI.GFxMovie.GFxAlign /*enum GFxAlign { Align_Center = 0, Align_TopCenter = 1, Align_BottomCenter = 2, Align_CenterLeft = 3, Align_CenterRight = 4, Align_TopLeft = 5, Align_TopRight = 6, Align_BottomLeft = 7, Align_BottomRight = 8, Align_MAX = 9 };*/ // Enum GFxUI.GFxMovie.GFxScaleMode /*enum GFxScaleMode { SM_NoScale = 0, SM_ShowAll = 1, SM_ExactFit = 2, SM_NoBorder = 3, SM_MAX = 4 };*/ /* # ========================================================================================= # # Classes # ========================================================================================= # */ // Class GFxUI.GFxEngine // 0x0010 (0x004C - 0x003C) class UGFxEngine : public UObject { public: TArray< struct FGCReference > GCReferences; // 0x003C (0x000C) [0x0000000000402000] ( CPF_Transient | CPF_NeedCtorLink ) int RefCount; // 0x0048 (0x0004) [0x0000000000002000] ( CPF_Transient ) private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1293 ]; return pClassPointer; }; }; UClass* UGFxEngine::pClassPointer = NULL; // Class GFxUI.GFxFSCmdHandler // 0x0000 (0x003C - 0x003C) class UGFxFSCmdHandler : public UObject { public: private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1294 ]; return pClassPointer; }; }; UClass* UGFxFSCmdHandler::pClassPointer = NULL; // Class GFxUI.GFxGameViewportClient // 0x000B (0x0128 - 0x011D) class UGFxGameViewportClient : public UGameViewportClient { public: class UClass* GFxUIControllerClass; // 0x0120 (0x0004) [0x0000000000000000] class UGFxInteraction* GFxUIController; // 0x0124 (0x0004) [0x0000000000000000] private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1295 ]; return pClassPointer; }; bool eventInit ( struct FString* OutError ); }; UClass* UGFxGameViewportClient::pClassPointer = NULL; // Class GFxUI.GFxInteraction // 0x0004 (0x0070 - 0x006C) class UGFxInteraction : public UInteraction { public: struct FPointer VfTable_FCallbackEventDevice; // 0x006C (0x0004) [0x0000000000801002] ( CPF_Const | CPF_Native | CPF_NoExport ) private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1296 ]; return pClassPointer; }; void NotifyPlayerRemoved ( int PlayerIndex, class ULocalPlayer* RemovedPlayer ); void NotifyPlayerAdded ( int PlayerIndex, class ULocalPlayer* AddedPlayer ); void NotifyGameSessionEnded ( ); class UGFxMovie* GetFocusMovie ( ); bool SetFocusMovie ( struct FString MovieName, unsigned long captureInput ); }; UClass* UGFxInteraction::pClassPointer = NULL; // Class GFxUI.GFxMovie // 0x011F (0x015B - 0x003C) class UGFxMovie : public UObject { public: TArray< struct FName > CaptureKeys; // 0x003C (0x000C) [0x0000000000400001] ( CPF_Edit | CPF_NeedCtorLink ) TArray< struct FName > FocusIgnoreKeys; // 0x0048 (0x000C) [0x0000000000400001] ( CPF_Edit | CPF_NeedCtorLink ) TArray< struct FExternalTexture > ExternalTextures; // 0x0054 (0x000C) [0x0000000000400001] ( CPF_Edit | CPF_NeedCtorLink ) TArray< struct FGFxDataStoreBinding > DataStoreBindings; // 0x0060 (0x000C) [0x0000000000400001] ( CPF_Edit | CPF_NeedCtorLink ) struct FPointer pMovie; // 0x006C (0x0004) [0x0000000000003002] ( CPF_Const | CPF_Native | CPF_Transient ) struct FPointer pCaptureKeys; // 0x0070 (0x0004) [0x0000000000003002] ( CPF_Const | CPF_Native | CPF_Transient ) struct FPointer pFocusIgnoreKeys; // 0x0074 (0x0004) [0x0000000000003002] ( CPF_Const | CPF_Native | CPF_Transient ) unsigned char UnknownData00[ 0x3C ]; // 0x0078 (0x003C) UNKNOWN PROPERTY: MapProperty GFxUI.GFxMovie.OwnedGFxValues unsigned char UnknownData01[ 0x3C ]; // 0x00B4 (0x003C) UNKNOWN PROPERTY: MapProperty GFxUI.GFxMovie.ASUClasses unsigned char UnknownData02[ 0x3C ]; // 0x00F0 (0x003C) UNKNOWN PROPERTY: MapProperty GFxUI.GFxMovie.ASUObjects class UGFxMovieInfo* MovieInfo; // 0x012C (0x0004) [0x0000000000000001] ( CPF_Edit ) class UTextureRenderTarget2D* RenderTexture; // 0x0130 (0x0004) [0x0000000000000001] ( CPF_Edit ) class UGFxFSCmdHandler* FSCmdHandler; // 0x0134 (0x0004) [0x0000000000000001] ( CPF_Edit ) class UObject* ExternalInterface; // 0x0138 (0x0004) [0x0000000000000001] ( CPF_Edit ) int LocalPlayerOwnerIndex; // 0x013C (0x0004) [0x0000000000002000] ( CPF_Transient ) int NextASUObject; // 0x0140 (0x0004) [0x0000000000002002] ( CPF_Const | CPF_Transient ) int nZOrder; // 0x0144 (0x0004) [0x0000000000000001] ( CPF_Edit ) float CreationTime; // 0x0148 (0x0004) [0x0000000000000001] ( CPF_Edit ) float fRenderTime; // 0x014C (0x0004) [0x0000000000000001] ( CPF_Edit ) class UGFxDataStoreSubscriber* DataStoreSubscriber; // 0x0150 (0x0004) [0x0000000000002000] ( CPF_Transient ) unsigned long bDisplayWithHudOff : 1; // 0x0154 (0x0004) [0x0000000000000001] [0x00000001] ( CPF_Edit ) unsigned long bOnlyOwnerFocusable : 1; // 0x0154 (0x0004) [0x0000000000000000] [0x00000002] unsigned long bDiscardNonOwnerInput : 1; // 0x0154 (0x0004) [0x0000000000000000] [0x00000004] unsigned long bGammaCorrection : 1; // 0x0154 (0x0004) [0x0000000000000001] [0x00000008] ( CPF_Edit ) unsigned char SceneDPG; // 0x0158 (0x0001) [0x0000000000000001] ( CPF_Edit ) unsigned char TimingMode; // 0x0159 (0x0001) [0x0000000000000001] ( CPF_Edit ) unsigned char RenderTextureMode; // 0x015A (0x0001) [0x0000000000000001] ( CPF_Edit ) private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1297 ]; return pClassPointer; }; bool UnregisterGFxValue ( class UGFxValue* i_val ); bool RegisterGFxValue ( class UGFxValue* i_val ); void ActionScriptSetFunction ( class UGFxValue* Obj, struct FString member ); class UGFxValue* ActionScriptObject ( struct FString Path ); struct FString ActionScriptString ( struct FString Path ); float ActionScriptFloat ( struct FString Path ); int ActionScriptInt ( struct FString Path ); void ActionScriptVoid ( struct FString Path ); class APlayerController* GetPC ( ); class ULocalPlayer* GetLP ( ); void SetExternalInterface ( class UObject* H ); void SetFsCmdHandler ( class UGFxFSCmdHandler* H ); void SetVariableObject ( struct FString Path, class UGFxValue* Value ); class UGFxValue* GetVariableObject ( struct FString Path, class UClass* Type ); class UGFxValue* CreateArray ( ); class UGFxValue* CreateObject ( struct FString ASClass, class UClass* Type ); bool SetVariableStringArray ( struct FString Path, int Index, TArray< struct FString > Arg ); bool SetVariableFloatArray ( struct FString Path, int Index, TArray< float > Arg ); bool SetVariableIntArray ( struct FString Path, int Index, TArray< int > Arg ); bool SetVariableArray ( struct FString Path, int Index, TArray< struct FASValue > Arg ); bool GetVariableStringArray ( struct FString Path, int Index, TArray< struct FString >* Arg ); bool GetVariableFloatArray ( struct FString Path, int Index, TArray< float >* Arg ); bool GetVariableIntArray ( struct FString Path, int Index, TArray< int >* Arg ); bool GetVariableArray ( struct FString Path, int Index, TArray< struct FASValue >* Arg ); void SetVariableString ( struct FString Path, struct FString S ); void SetVariableNumber ( struct FString Path, float F ); void SetVariableBool ( struct FString Path, unsigned long B ); void SetVariable ( struct FString Path, struct FASValue Arg ); struct FString GetVariableString ( struct FString Path ); float GetVariableNumber ( struct FString Path ); bool GetVariableBool ( struct FString Path ); struct FASValue GetVariable ( struct FString Path ); void PublishDataStoreValues ( ); void RefreshDataStoreBindings ( ); struct FASValue Invoke ( struct FString method, TArray< struct FASValue >* Args ); void SetTimingMode ( unsigned char mode ); void Pause ( unsigned long pauseplay ); void Advance ( float Time ); bool SetExternalTexture ( struct FString Resource, class UTexture* Texture ); void FlushPlayerInput ( unsigned long capturekeysonly ); void ClearFocusIgnoreKeys ( ); void AddFocusIgnoreKey ( struct FName Key ); void ClearCaptureKeys ( ); void AddCaptureKey ( struct FName Key ); void SetFocus ( unsigned long captureInput, unsigned long Focus ); void SetSceneDPG ( unsigned char NewDPG ); void SetPerspective3D ( struct FMatrix* matPersp ); void SetView3D ( struct FMatrix* matView ); void GetVisibleFrameRect ( float* x0, float* y0, float* X1, float* Y1 ); void SetAlignment ( unsigned char A ); void SetViewScaleMode ( unsigned char sm ); void SetViewport ( int X, int Y, int Width, int Height ); class UGameViewportClient* GetGameViewportClient ( ); void SetMovieInfo ( class UGFxMovieInfo* Data ); void eventOnClose ( ); void Close ( unsigned long Unload ); bool eventStart ( unsigned long StartPaused ); }; UClass* UGFxMovie::pClassPointer = NULL; // Class GFxUI.GFxMovieInfo // 0x0038 (0x0074 - 0x003C) class UGFxMovieInfo : public UObject { public: TArray< unsigned char > RawData; // 0x003C (0x0010) [0x0000000000400002] ( CPF_Const | CPF_NeedCtorLink ) unsigned char UnknownData00[ 0x4 ]; // 0x0040 (0x0004) FIX WRONG TYPE SIZE OF PREVIUS PROPERTY TArray< class UObject* > References; // 0x004C (0x000C) [0x0000000000400001] ( CPF_Edit | CPF_NeedCtorLink ) TArray< class UObject* > UserReferences; // 0x0058 (0x000C) [0x0000000000400001] ( CPF_Edit | CPF_NeedCtorLink ) TArray< class UObject* > CompressedTextureReferences; // 0x0064 (0x000C) [0x0000000000400001] ( CPF_Edit | CPF_NeedCtorLink ) unsigned long bUsesFontlib : 1; // 0x0070 (0x0004) [0x0000000000020001] [0x00000001] ( CPF_Edit | CPF_EditConst ) private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1298 ]; return pClassPointer; }; }; UClass* UGFxMovieInfo::pClassPointer = NULL; // Class GFxUI.GFxValue // 0x0030 (0x006C - 0x003C) class UGFxValue : public UObject { public: int Value[ 0xC ]; // 0x003C (0x0030) [0x0000000000001002] ( CPF_Const | CPF_Native ) private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1299 ]; return pClassPointer; }; void ActionScriptSetFunctionOn ( class UGFxValue* Target, struct FString member ); void ActionScriptSetFunction ( struct FString member ); TArray< class UGFxValue* > ActionScriptArray ( struct FString Path ); class UGFxValue* ActionScriptObject ( struct FString Path ); struct FString ActionScriptString ( struct FString method ); float ActionScriptFloat ( struct FString method ); int ActionScriptInt ( struct FString method ); void ActionScriptVoid ( struct FString method ); void SetElementMemberString ( int Index, struct FString member, struct FString S ); void SetElementMemberNumber ( int Index, struct FString member, float F ); void SetElementMemberBool ( int Index, struct FString member, unsigned long B ); void SetElementMemberObject ( int Index, struct FString member, class UGFxValue* val ); void SetElementMember ( int Index, struct FString member, struct FASValue Arg ); struct FString GetElementMemberString ( int Index, struct FString member ); float GetElementMemberNumber ( int Index, struct FString member ); bool GetElementMemberBool ( int Index, struct FString member ); class UGFxValue* GetElementMemberObject ( int Index, struct FString member, class UClass* Type ); struct FASValue GetElementMember ( int Index, struct FString member ); void SetElementColorTransform ( int Index, struct FASColorTransform cxform ); void SetElementPosition ( int Index, float X, float Y ); void SetElementVisible ( int Index, unsigned long visible ); void SetElementDisplayMatrix ( int Index, struct FMatrix M ); void SetElementDisplayInfo ( int Index, struct FASDisplayInfo D ); void SetElementString ( int Index, struct FString S ); void SetElementNumber ( int Index, float F ); void SetElementBool ( int Index, unsigned long B ); void SetElementObject ( int Index, class UGFxValue* val ); void SetElement ( int Index, struct FASValue Arg ); struct FMatrix GetElementDisplayMatrix ( int Index ); struct FASDisplayInfo GetElementDisplayInfo ( int Index ); struct FString GetElementString ( int Index ); float GetElementNumber ( int Index ); bool GetElementBool ( int Index ); class UGFxValue* GetElementObject ( int Index, class UClass* Type ); struct FASValue GetElement ( int Index ); void SetMemberObjectText ( struct FString sMember, struct FString sText, unsigned long bIsHTML ); void SetText ( struct FString Text, unsigned long bIsHTML ); struct FString GetText ( ); class UGFxValue* CastTo ( class UClass* Type ); class UGFxValue* AttachMovie ( struct FString symbolname, struct FString InstanceName, int Depth, class UClass* Type ); class UGFxValue* CreateEmptyMovieClip ( struct FString InstanceName, int Depth, class UClass* Type ); void GotoAndStopI ( int frame ); void GotoAndStop ( struct FString frame ); void GotoAndPlayI ( int frame ); void GotoAndPlay ( struct FString frame ); void SetColorTransform ( struct FASColorTransform cxform ); void SetPosition ( float X, float Y ); void SetVisible ( unsigned long visible ); void SetDisplayMatrix3D ( struct FMatrix M ); void SetDisplayMatrix ( struct FMatrix M ); void SetDisplayInfo ( struct FASDisplayInfo* D ); bool GetPosition ( float* X, float* Y ); struct FASColorTransform GetColorTransform ( ); struct FMatrix GetDisplayMatrix ( ); struct FASDisplayInfo GetDisplayInfo ( ); void SetString ( struct FString member, struct FString S ); void SetNumber ( struct FString member, float F ); void SetBool ( struct FString member, unsigned long B ); void SetFunction ( struct FString member, class UObject* Context, struct FName fname ); void SetObject ( struct FString member, class UGFxValue* val ); void Set ( struct FString member, struct FASValue Arg ); struct FString GetString ( struct FString member ); float GetNumber ( struct FString member ); bool GetBool ( struct FString member ); class UGFxValue* GetObject ( struct FString member, class UClass* Type ); struct FASValue Get ( struct FString member ); struct FASValue Invoke ( struct FString member, TArray< struct FASValue > Args ); }; UClass* UGFxValue::pClassPointer = NULL; // Class GFxUI.GFxAction_CloseMovie // 0x0008 (0x00B8 - 0x00B0) class UGFxAction_CloseMovie : public USequenceAction { public: class UGFxMovie* movie; // 0x00B0 (0x0004) [0x0000000000000001] ( CPF_Edit ) unsigned long bUnload : 1; // 0x00B4 (0x0004) [0x0000000000000001] [0x00000001] ( CPF_Edit ) private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1300 ]; return pClassPointer; }; bool eventIsValidLevelSequenceObject ( ); }; UClass* UGFxAction_CloseMovie::pClassPointer = NULL; // Class GFxUI.GFxAction_GetVariable // 0x0010 (0x00C0 - 0x00B0) class UGFxAction_GetVariable : public USequenceAction { public: struct FString Variable; // 0x00B0 (0x000C) [0x0000000000400001] ( CPF_Edit | CPF_NeedCtorLink ) class UGFxMovie* movie; // 0x00BC (0x0004) [0x0000000000000001] ( CPF_Edit ) private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1301 ]; return pClassPointer; }; bool eventIsValidLevelSequenceObject ( ); }; UClass* UGFxAction_GetVariable::pClassPointer = NULL; // Class GFxUI.GFxAction_Invoke // 0x001C (0x00CC - 0x00B0) class UGFxAction_Invoke : public USequenceAction { public: struct FString methodName; // 0x00B0 (0x000C) [0x0000000000400001] ( CPF_Edit | CPF_NeedCtorLink ) TArray< struct FASValue > Arguments; // 0x00BC (0x000C) [0x0000000000400001] ( CPF_Edit | CPF_NeedCtorLink ) class UGFxMovie* movie; // 0x00C8 (0x0004) [0x0000000000000001] ( CPF_Edit ) private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1302 ]; return pClassPointer; }; bool eventIsValidLevelSequenceObject ( ); }; UClass* UGFxAction_Invoke::pClassPointer = NULL; // Class GFxUI.GFxAction_OpenMovie // 0x0008 (0x00B8 - 0x00B0) class UGFxAction_OpenMovie : public USequenceAction { public: class UGFxMovie* movie; // 0x00B0 (0x0004) [0x0000000000000001] ( CPF_Edit ) unsigned long bTakeFocus : 1; // 0x00B4 (0x0004) [0x0000000000000001] [0x00000001] ( CPF_Edit ) unsigned long bCaptureInput : 1; // 0x00B4 (0x0004) [0x0000000000000001] [0x00000002] ( CPF_Edit ) unsigned long bStartPaused : 1; // 0x00B4 (0x0004) [0x0000000000000001] [0x00000004] ( CPF_Edit ) private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1303 ]; return pClassPointer; }; bool eventIsValidLevelSequenceObject ( ); }; UClass* UGFxAction_OpenMovie::pClassPointer = NULL; // Class GFxUI.GFxAction_SetCaptureKeys // 0x0010 (0x00C0 - 0x00B0) class UGFxAction_SetCaptureKeys : public USequenceAction { public: TArray< struct FName > CaptureKeys; // 0x00B0 (0x000C) [0x0000000000400001] ( CPF_Edit | CPF_NeedCtorLink ) class UGFxMovie* movie; // 0x00BC (0x0004) [0x0000000000000001] ( CPF_Edit ) private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1304 ]; return pClassPointer; }; }; UClass* UGFxAction_SetCaptureKeys::pClassPointer = NULL; // Class GFxUI.GFxAction_SetFocus // 0x0008 (0x00B8 - 0x00B0) class UGFxAction_SetFocus : public USequenceAction { public: class UGFxMovie* movie; // 0x00B0 (0x0004) [0x0000000000000001] ( CPF_Edit ) unsigned long bCaptureInput : 1; // 0x00B4 (0x0004) [0x0000000000000001] [0x00000001] ( CPF_Edit ) private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1305 ]; return pClassPointer; }; }; UClass* UGFxAction_SetFocus::pClassPointer = NULL; // Class GFxUI.GFxAction_SetVariable // 0x0010 (0x00C0 - 0x00B0) class UGFxAction_SetVariable : public USequenceAction { public: struct FString Variable; // 0x00B0 (0x000C) [0x0000000000400001] ( CPF_Edit | CPF_NeedCtorLink ) class UGFxMovie* movie; // 0x00BC (0x0004) [0x0000000000000001] ( CPF_Edit ) private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1306 ]; return pClassPointer; }; bool eventIsValidLevelSequenceObject ( ); }; UClass* UGFxAction_SetVariable::pClassPointer = NULL; // Class GFxUI.GFxEvent_FsCommand // 0x0012 (0x00E4 - 0x00D2) class UGFxEvent_FsCommand : public USequenceEvent { public: struct FString FSCommand; // 0x00D4 (0x000C) [0x0000000000400001] ( CPF_Edit | CPF_NeedCtorLink ) class UGFxMovie* movie; // 0x00E0 (0x0004) [0x0000000000000001] ( CPF_Edit ) private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1307 ]; return pClassPointer; }; }; UClass* UGFxEvent_FsCommand::pClassPointer = NULL; // Class GFxUI.GFxFSCmdHandler_Kismet // 0x003C (0x0078 - 0x003C) class UGFxFSCmdHandler_Kismet : public UGFxFSCmdHandler { public: unsigned char UnknownData00[ 0x3C ]; // 0x003C (0x003C) UNKNOWN PROPERTY: MapProperty GFxUI.GFxFSCmdHandler_Kismet.Events private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1308 ]; return pClassPointer; }; bool eventFSCommand ( class UGFxMovie* movie, struct FString Cmd, struct FString Arg ); }; UClass* UGFxFSCmdHandler_Kismet::pClassPointer = NULL; // Class GFxUI.GFxDataStoreSubscriber // 0x0008 (0x0044 - 0x003C) class UGFxDataStoreSubscriber : public UObject { public: struct FPointer VfTable_IUIDataStorePublisher; // 0x003C (0x0004) [0x0000000000801002] ( CPF_Const | CPF_Native | CPF_NoExport ) class UGFxMovie* movie; // 0x0040 (0x0004) [0x0000000000000000] private: static UClass* pClassPointer; public: static UClass* StaticClass() { if ( ! pClassPointer ) pClassPointer = (UClass*) UObject::GObjObjects()->Data[ 1309 ]; return pClassPointer; }; bool SaveSubscriberValue ( int BindingIndex, TArray< class UUIDataStore* >* out_BoundDataStores ); void ClearBoundDataStores ( ); void GetBoundDataStores ( TArray< class UUIDataStore* >* out_BoundDataStores ); void NotifyDataStoreValueUpdated ( class UUIDataStore* SourceDataStore, unsigned long bValuesInvalidated, struct FName PropertyTag, class UUIDataProvider* SourceProvider, int ArrayIndex ); bool RefreshSubscriberValue ( int BindingIndex ); struct FString GetDataStoreBinding ( int BindingIndex ); void SetDataStoreBinding ( struct FString MarkupText, int BindingIndex ); void PublishValues ( ); }; UClass* UGFxDataStoreSubscriber::pClassPointer = NULL; #ifdef _MSC_VER #pragma pack ( pop ) #endif
[ "erikjs_br@hotmail.com" ]
erikjs_br@hotmail.com
531edf545b6a809856e87d2962dd93633a8b8e04
03daf75f5ce9972e186d2f99864a70f6acbcfb45
/Classes/HelloWorldScene.cpp
b8dc105af2e691cfeffc1c530f036a3d25faa079
[]
no_license
novemrain/Cocos-AStar
2dbc11499baa12534d732f28846f7e8be13a0da1
2d8e5832149ffd489d57d6ecbc33dd763b171219
refs/heads/master
2021-01-11T00:57:07.368360
2016-10-10T02:35:26
2016-10-10T02:35:26
70,445,140
0
0
null
null
null
null
GB18030
C++
false
false
6,806
cpp
#include "HelloWorldScene.h" #include "UVSprite.h" USING_NS_CC; AStarGame::AStarGame() :map(nullptr) , m_pWorkThread(nullptr) , path(nullptr) , bOver(false) {} AStarGame::~AStarGame() { delete[] map; if (m_pWorkThread)m_pWorkThread->join(); CC_SAFE_DELETE(m_pWorkThread); } Scene* AStarGame::createScene() { // 'scene' is an autorelease object auto scene = Scene::create(); // 'layer' is an autorelease object auto layer = AStarGame::create(); // add layer as a child to scene scene->addChild(layer); // return the scene return scene; } // on "init" you need to initialize your instance bool AStarGame::init() { ////////////////////////////// // 1. super init first if ( !Layer::init() ) { return false; } Size visibleSize = Director::getInstance()->getVisibleSize(); Vec2 origin = Director::getInstance()->getVisibleOrigin(); auto findItem = MenuItemImage::create( "CloseNormal.png", "CloseSelected.png", CC_CALLBACK_1(AStarGame::findCallback, this)); findItem->setPosition(Vec2(origin.x + visibleSize.width - findItem->getContentSize().width / 2, origin.y + findItem->getContentSize().height / 2)); auto restartItem = MenuItemImage::create( "CloseSelected.png", "CloseNormal.png", CC_CALLBACK_1(AStarGame::restartCallback, this)); restartItem->setPosition(Vec2(origin.x + visibleSize.width - restartItem->getContentSize().width / 2, origin.y + restartItem->getContentSize().height * 4/ 2)); // create menu, it's an autorelease object auto menu = Menu::create(findItem, restartItem, NULL); menu->setPosition(Vec2::ZERO); this->addChild(menu, 1); root = Node::create(); this->addChild(root); UVSprite * sprite = UVSprite::create("ball.png"); sprite->setPosition(Vec2(visibleSize / 2)); addChild(sprite); sprite->setUVTexture("snowflake2.png"); sprite->setUvStretch(false); sprite->setUvVelocity(Vec2(0.0f, -0.01f)); sprite->setUvAlphaFilter(true); return true; } void AStarGame::drawMap() { map = new short*[WIDTH]; // make a random map for (int i = 0; i < WIDTH; i++) { map[i] = new short[HEIGHT]; for (int j = 0; j < HEIGHT; j++) { bool avaliable = CCRANDOM_MINUS1_1() > -0.6f; if (i <= 1 || i >= WIDTH - 2 || j <= 1 || j >= HEIGHT - 2) { //avaliable = true; } map[i][j] = avaliable ? 1 : 0; } } // build some walls to make it complex for (int i = 1; i < 16; i++) { for (int j = 0; j < HEIGHT - 10; j++) { auto x = WIDTH * i / 16; auto y = i % 2 == 0 ? j : HEIGHT - j - 1; map[x][y] = 0; } } map[0][0] = 1; map[WIDTH - 1][HEIGHT - 1] = 1; // draw it for (int i = 0; i < WIDTH; i++) { for (int j = 0; j < HEIGHT; j++) { bool avaliable = map[i][j] == 1; auto sprite = Sprite::create(avaliable ? "white.png" : "black.png"); sprite->setAnchorPoint(ccp(0, 0)); sprite->setPosition(ccp(i * CELL_WIDTH, j * CELL_HEIGHT)); root->addChild(sprite); } } } void AStarGame::drawPath(Step* step) { if (step) { // path was found , draw it int steps = 0; while (step != nullptr) { auto x = step->x; auto y = step->y; Step* s = step; step = s->parent; delete s; auto sprite = Sprite::create("stars.png"); sprite->setAnchorPoint(ccp(0, 0)); sprite->setPosition(ccp(x * CELL_WIDTH, y * CELL_HEIGHT)); root->addChild(sprite); steps++; } CCLOG("AStarGame::drawPath steps = %d", steps); } else { CCLOG("AStarGame::drawPath step null , no path"); } } void AStarGame::restartCallback(Ref* pSender) { // restart , draw a new random map root->removeAllChildren(); delete[] map; bOver = false; root->runAction(CCSequence::create( CCDelayTime::create(0.5f), CallFunc::create(CC_CALLBACK_0(AStarGame::drawMap, this)), nullptr )); } void AStarGame::findCallback(Ref* pSender) { // find path async if (m_pWorkThread == nullptr) { m_pWorkThread = new std::thread(&AStarGame::findPathAsync, this); auto scheduler = cocos2d::Director::getInstance()->getScheduler(); // schedule a listener , detect whether the finding-work is over scheduler->schedule(schedule_selector(AStarGame::asyncUpdate), this, 0, false); } } void AStarGame::findPathAsync() { AStarMap* AStar = new AStarMap(map, WIDTH, HEIGHT); auto path = AStarMap::findPath(AStar, Pos(0, 0), Pos(WIDTH - 1, HEIGHT - 1), 8); this->path = path; this->bOver = true; } void AStarGame::asyncUpdate(float t) { // the listener function if (this->bOver) { drawPath(this->path); this->path = nullptr; auto scheduler = cocos2d::Director::getInstance()->getScheduler(); scheduler->unschedule(schedule_selector(AStarGame::asyncUpdate), this); m_pWorkThread->join(); CC_SAFE_DELETE(m_pWorkThread); } } //线程创建好之后可以自动执行 //若要强行插在主线程前面,那么join //线程在结束前需要在主线程中对它调用join或者detach一次 //不能不调也不能重复!否则不能正确退出线程 //Cocos中工作线程里使用CCLog可能会导致死锁! /* void threadTest() { CCLOG("threadTest"); } std::mutex mtx; // 全局互斥锁. std::condition_variable cv; // 全局条件变量. bool ready = false; // 全局标志位. int sum = 0; void do_print_id(int id) { std::unique_lock <std::mutex> lck(mtx); while (!ready) // 如果标志位不为 true, 则等待... { //CCLOG("do_print_id start lock %d ", id); cv.wait(lck); // 当前线程被阻塞, 当全局标志位变为 true 之后, //CCLOG("do_print_id awake %d ", id); //printf("waitover"); } sum++; } void go() { CCLOG("go"); std::unique_lock <std::mutex> lck(mtx); ready = true; // 设置全局标志位为 true. cv.notify_all(); // 唤醒所有线程. } */ //static std::thread t(threadTest); //std::ref(t); //t.join(); //CCLOG("AStarGame::restartCallback over"); /* std::thread threads[10]; // spawn 10 threads: for (int i = 0; i < 10; ++i) threads[i] = std::thread(do_print_id, i); CCLOG("begin%d" , sum); go(); // go! for (int i = 0; i < 10; ++i) threads[i].join(); CCLOG("over%d", sum); //线程创建好之后可以自动执行 //若要强行插在主线程前面,那么join //线程在结束前需要在主线程中对它调用join或者detach一次 //不能不调也不能重复!否则不能正确退出线程 //Cocos中工作线程里使用CCLog可能会导致死锁! //CCLOG("sleep"); //std::this_thread::sleep_for(std::chrono::milliseconds(500)); //CCLOG("sleep over %d" , sum); //for (auto & th : threads) // th.detach(); //std::this_thread::sleep_for(std::chrono::milliseconds(5000)); //CCLOG("sleep over again %d", sum); */
[ "noreply@github.com" ]
novemrain.noreply@github.com
1a93ad074ad9385640bc4f3d71c5a144011b9ed7
22de59bf69f980594e172f0ca387bf8a162acd69
/src/session.cpp
c05226cd0d837135b6c89fc2fa186c01cce569e5
[]
no_license
squarehimself/XMoniz
de5e3ff42e9fc8a076c6415d40c602162e041bab
4718f57b5a445dd1a59976718cb2fd1fc14cf206
refs/heads/master
2020-04-09T05:46:00.420852
2010-10-23T18:24:49
2010-10-23T18:24:49
1,018,067
16
0
null
null
null
null
UTF-8
C++
false
false
10,754
cpp
/* * Copyright © 2005 Novell, Inc. * * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without * fee, provided that the above copyright notice appear in all copies * and that both that copyright notice and this permission notice * appear in supporting documentation, and that the name of * Novell, Inc. not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior permission. * Novell, Inc. makes no representations about the suitability of this * software for any purpose. It is provided "as is" without express or * implied warranty. * * NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN * NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Radek Doulik <rodo@novell.com> */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <compiz.h> #include <stdlib.h> #include <stdio.h> #include <poll.h> #include <unistd.h> #include <fcntl.h> #include <string.h> #include <pwd.h> #include <X11/SM/SMlib.h> #include <X11/ICE/ICElib.h> #include <boost/bind.hpp> #include <core/session.h> #include <core/core.h> #define SM_DEBUG(x) static SmcConn smcConnection; static CompWatchFdHandle iceWatchFdHandle; static bool connected = false; static bool iceConnected = false; static char *smClientId, *smPrevClientId; static void iceInit (void); static void setStringListProperty (SmcConn connection, const char *name, const char **values, int nValues) { SmProp prop, *pProp; int i; prop.name = (char *) name; prop.type = const_cast<char *> (SmLISTofARRAY8); prop.vals = (SmPropValue *) malloc (nValues * sizeof (SmPropValue)); if (!prop.vals) return; for (i = 0; i < nValues; i++) { prop.vals[i].value = (char *) values[i]; prop.vals[i].length = strlen (values[i]); } prop.num_vals = nValues; pProp = &prop; SmcSetProperties (connection, 1, &pProp); free (prop.vals); } static void setCloneRestartCommands (SmcConn connection) { const char **args; int i, count = 0; /* at maximum, we pass our old arguments + our new client id to the SM, so allocate for that case */ args = (const char **) malloc ((programArgc + 2) * sizeof (char *)); if (!args) return; for (i = 0; i < programArgc; i++) { if (strcmp (programArgv[i], "--sm-client-id") == 0) i++; /* skip old client id, we'll add the new one later */ else if (strcmp (programArgv[i], "--replace") == 0) continue; /* there's nothing to replace when starting session */ else args[count++] = programArgv[i]; } setStringListProperty (connection, SmCloneCommand, args, count); /* insert new client id at position 1 and 2; position 0 is the executable name */ for (i = count - 1; i >= 1; i--) args[i + 2] = args[i]; args[1] = "--sm-client-id"; args[2] = smClientId; count += 2; setStringListProperty (connection, SmRestartCommand, args, count); free (args); } static void setRestartStyle (SmcConn connection, char hint) { SmProp prop, *pProp; SmPropValue propVal; prop.name = const_cast<char *> (SmRestartStyleHint); prop.type = const_cast<char *> (SmCARD8); prop.num_vals = 1; prop.vals = &propVal; propVal.value = &hint; propVal.length = 1; pProp = &prop; SmcSetProperties (connection, 1, &pProp); } static void setProgramInfo (SmcConn connection, pid_t pid, uid_t uid) { SmProp progProp, pidProp, userProp; SmPropValue progVal, pidVal, userVal; SmProp *props[3]; char pidBuffer[32]; unsigned int count = 0; struct passwd *pw; progProp.name = const_cast<char *> (SmProgram); progProp.type = const_cast<char *> (SmARRAY8); progProp.num_vals = 1; progProp.vals = &progVal; progVal.value = (SmPointer) "compiz"; progVal.length = strlen ((char *) progVal.value); props[count++] = &progProp; snprintf (pidBuffer, sizeof (pidBuffer), "%d", pid); pidProp.name = const_cast<char *> (SmProcessID); pidProp.type = const_cast<char *> (SmARRAY8); pidProp.num_vals = 1; pidProp.vals = &pidVal; pidVal.value = (SmPointer) pidBuffer; pidVal.length = strlen (pidBuffer); props[count++] = &pidProp; pw = getpwuid (uid); if (pw) { userProp.name = const_cast<char *> (SmUserID); userProp.type = const_cast<char *> (SmARRAY8); userProp.num_vals = 1; userProp.vals = &userVal; userVal.value = (SmPointer) pw->pw_name; userVal.length = strlen (pw->pw_name); props[count++] = &userProp; } SmcSetProperties (connection, count, props); } static void saveYourselfCallback (SmcConn connection, SmPointer client_data, int saveType, Bool shutdown, int interact_Style, Bool fast) { CompOption::Vector args; args.push_back (CompOption ("save_type", CompOption::TypeInt)); args.push_back (CompOption ("shutdown", CompOption::TypeBool)); args.push_back (CompOption ("interact_style", CompOption::TypeInt)); args.push_back (CompOption ("fast", CompOption::TypeBool)); args[0].value ().set (saveType); args[1].value ().set ((bool) shutdown); args[2].value ().set (interact_Style); args[3].value ().set ((bool) fast); screen->sessionEvent (CompSession::EventSaveYourself, args); setCloneRestartCommands (connection); setRestartStyle (connection, SmRestartImmediately); setProgramInfo (connection, getpid (), getuid ()); SmcSaveYourselfDone (connection, 1); } static void dieCallback (SmcConn connection, SmPointer clientData) { screen->sessionEvent (CompSession::EventDie, noOptions); CompSession::close (); exit (0); } static void saveCompleteCallback (SmcConn connection, SmPointer clientData) { screen->sessionEvent (CompSession::EventSaveComplete, noOptions); } static void shutdownCancelledCallback (SmcConn connection, SmPointer clientData) { screen->sessionEvent (CompSession::EventShutdownCancelled, noOptions); } void CompSession::init (char *prevClientId) { static SmcCallbacks callbacks; if (getenv ("SESSION_MANAGER")) { char errorBuffer[1024]; iceInit (); callbacks.save_yourself.callback = saveYourselfCallback; callbacks.save_yourself.client_data = NULL; callbacks.die.callback = dieCallback; callbacks.die.client_data = NULL; callbacks.save_complete.callback = saveCompleteCallback; callbacks.save_complete.client_data = NULL; callbacks.shutdown_cancelled.callback = shutdownCancelledCallback; callbacks.shutdown_cancelled.client_data = NULL; smcConnection = SmcOpenConnection (NULL, NULL, SmProtoMajor, SmProtoMinor, SmcSaveYourselfProcMask | SmcDieProcMask | SmcSaveCompleteProcMask | SmcShutdownCancelledProcMask, &callbacks, prevClientId, &smClientId, sizeof (errorBuffer), errorBuffer); if (!smcConnection) compLogMessage ("core", CompLogLevelWarn, "SmcOpenConnection failed: %s", errorBuffer); else { connected = true; if (prevClientId) smPrevClientId = strdup (prevClientId); } } } void CompSession::close () { if (connected) { setRestartStyle (smcConnection, SmRestartIfRunning); if (SmcCloseConnection (smcConnection, 0, NULL) != SmcConnectionInUse) connected = false; if (smClientId) { free (smClientId); smClientId = NULL; } if (smPrevClientId) { free (smPrevClientId); smPrevClientId = NULL; } } } CompString CompSession::getClientId (CompSession::ClientIdType type) { if (!connected) return ""; switch (type) { case CompSession::ClientId: if (smClientId) return smClientId; case CompSession::PrevClientId: if (smPrevClientId) return smPrevClientId; } return ""; } /* ice connection handling taken and updated from gnome-ice.c * original gnome-ice.c code written by Tom Tromey <tromey@cygnus.com> */ /* This is called when data is available on an ICE connection. */ static bool iceProcessMessages (IceConn connection) { IceProcessMessagesStatus status; SM_DEBUG (printf ("ICE connection process messages\n")); status = IceProcessMessages (connection, NULL, NULL); if (status == IceProcessMessagesIOError) { SM_DEBUG (printf ("ICE connection process messages" " - error => shutting down the connection\n")); IceSetShutdownNegotiation (connection, False); IceCloseConnection (connection); } return 1; } /* This is called when a new ICE connection is made. It arranges for the ICE connection to be handled via the event loop. */ static void iceNewConnection (IceConn connection, IcePointer clientData, Bool opening, IcePointer *watchData) { if (opening) { SM_DEBUG (printf ("ICE connection opening\n")); /* Make sure we don't pass on these file descriptors to any exec'ed children */ fcntl (IceConnectionNumber (connection), F_SETFD, fcntl (IceConnectionNumber (connection), F_GETFD,0) | FD_CLOEXEC); iceWatchFdHandle = screen->addWatchFd (IceConnectionNumber (connection), POLLIN | POLLPRI | POLLHUP | POLLERR, boost::bind (iceProcessMessages, connection)); iceConnected = true; } else { SM_DEBUG (printf ("ICE connection closing\n")); if (iceConnected) { screen->removeWatchFd (iceWatchFdHandle); iceWatchFdHandle = 0; iceConnected = false; } } } static IceIOErrorHandler oldIceHandler; static void iceErrorHandler (IceConn connection) { if (oldIceHandler) (*oldIceHandler) (connection); } /* We call any handler installed before (or after) iceInit but avoid calling the default libICE handler which does an exit() */ static void iceInit (void) { static bool iceInitialized = false; if (!iceInitialized) { IceIOErrorHandler defaultIceHandler; oldIceHandler = IceSetIOErrorHandler (NULL); defaultIceHandler = IceSetIOErrorHandler (iceErrorHandler); if (oldIceHandler == defaultIceHandler) oldIceHandler = NULL; IceAddConnectionWatch (iceNewConnection, NULL); iceInitialized = true; } }
[ "toolman33@gmail.com" ]
toolman33@gmail.com
a7330349679765508eef05dba785470b66682a5c
b301ab714ad4d4625d4a79005a1bda6456a283ec
/codeforces/contest/1484/b/b.cpp
5e95f7e75f22eea12893ccc2bdf3df54c8c5ae57
[]
no_license
askeySnip/OJ_records
220fd83d406709328e8450df0f6da98ae57eb2d9
4b77e3bb5cf19b98572fa6583dff390e03ff1a7c
refs/heads/master
2022-06-26T02:14:34.957580
2022-06-11T13:56:33
2022-06-11T13:56:33
117,955,514
1
0
null
null
null
null
UTF-8
C++
false
false
3,057
cpp
/* AUTHOR: lz.askey CREATED: 27.03.2021 01:04:03 LANG: C++11 */ #include <assert.h> #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <iterator> #include <map> #include <new> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<pair<int, int> > vii; typedef long long ll; #define bit(x, i) (x & (1 << i)) #define in(i, l, r) (l < i && i < r) #define linr(i, l, r) (l <= i && i <= r) #define lin(i, l, r) (l <= i && i < r) #define inr(i, l, r) (l < i && i <= r) #define gi(a) scanf("%d", &a) #define gii(a, b) scanf("%d%d", &a, &b) #define giii(a, b, c) scanf("%d%d%d", &a, &b, &c) #define gs(x) scanf("%s", x) #define clr(a, x) memset(a, x, sizeof(a)) #define c2i(c) (c - '0') #define sz(x) ((int)((x).size())) #define all(c) (c).begin(), (c).end() #define mp make_pair #define pb push_back #define eb emplace_back #define ff first #define ss second // for debug #define what_is(x) \ cerr << "Line " << __LINE__ << ": " << #x << " is " << (x) << endl; #define error(args...) \ { \ string _s = #args; \ replace(_s.begin(), _s.end(), ',', ' '); \ stringstream _ss(_s); \ istream_iterator<string> _it(_ss); \ err(_it, args); \ } void err(istream_iterator<string> it) { cerr << endl; } template <typename T, typename... Args> void err(istream_iterator<string> it, T a, Args... args) { cerr << *it << " = " << a << endl; err(++it, args...); } #define REP(i, a, b) for (int i = int(a); i < int(b); i++) const int inf = 0x3f3f3f3f; const int mod = 1e9 + 7; const int fx[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; const int fxx[8][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}}; // struct // data int n; int a[100010], dif[100010]; void solve() { int mx = 0; REP(i, 0, n) mx = max(mx, a[i]); REP(i, 0, n - 1) dif[i] = a[i + 1] - a[i]; int n1 = 2e9, n2 = 2e9, cnt = 0, tmp = 0; bool f = true; REP(i, 0, n - 1) { if (dif[i] < 0) { if (n1 == 2e9) n1 = dif[i]; else { if (n1 != dif[i]) { f = false; break; } } } if (dif[i] > 0) { if (n2 == 2e9) n2 = dif[i]; else { if (n2 != dif[i]) { f = false; break; } } } cnt += (dif[i] == dif[0]); tmp += (dif[i] == 0); } if (cnt == n - 1) cout << "0\n"; else if (f && !tmp && (n2 - n1) > mx) cout << n2 - n1 << " " << n2 << endl; else cout << "-1\n"; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { cin >> n; REP(i, 0, n) cin >> a[i]; solve(); } return 0; }
[ "296181278@qq.com" ]
296181278@qq.com
a7efbc9d72b9ae493b06ff9c2766a45181467226
d1a7dd0954be41e7ecdfaee3b1f5a7a4e067fa47
/Source/MultiMapED/Private/LevelRelations/LevelRelations_Factory.h
9ad5cdeee4fc298a208603d32fcd89ac2dc411bb
[]
no_license
risooonho/Unreal-Engine-4-Multi-Map-Plugin
166d3a9cee07b993c6bf11bf741d21a3e6c2d0cb
a2dcb685cb29aad1e5bd9cee3bd1548bdcddc3fd
refs/heads/master
2022-11-12T06:03:31.875559
2018-06-02T17:25:11
2018-06-02T17:25:11
null
0
0
null
null
null
null
WINDOWS-1252
C++
false
false
904
h
// Copyright Mickail `TehnoMag` Lukianov © 2018 #pragma once #include "CoreMinimal.h" #include "Factories/Factory.h" #include "AssetTypeActions_Base.h" #include "LevelRelations_Factory.generated.h" class FLevelRelations_Actions : public FAssetTypeActions_Base { public: virtual FText GetName() const override; virtual UClass* GetSupportedClass() const override; virtual FColor GetTypeColor() const override; virtual uint32 GetCategories() override; virtual class UThumbnailInfo* GetThumbnailInfo(UObject* Asset) const override { return nullptr; }; static uint32 Category; }; /** *Comment */ UCLASS() class ULevelRelations_Factory : public UFactory { GENERATED_BODY() public: ULevelRelations_Factory(); virtual UObject* FactoryCreateNew(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override; protected: private: };
[ "delta-server@ya.ru" ]
delta-server@ya.ru
3b7890e7fe14959e8783917bd64378dbd79ff456
34aa58efb0bd2908b6a89b97e02947f6ab5523f2
/server/游戏组件/藏宝库子游戏/斗地主/机器人服务/AndroidServiceManager.h
52eb3d86c968f16855a4c05903a46c9a5af878ca
[]
no_license
aywlcn/whdlm
8e6c9901aed369658f0a7bb657f04fd13df5802e
86d0d2edb98ce8a8a09378cabfda4fc357c7cdd2
refs/heads/main
2023-05-28T14:12:50.150854
2021-06-11T10:50:58
2021-06-11T10:50:58
380,582,203
1
0
null
2021-06-26T19:31:50
2021-06-26T19:31:49
null
GB18030
C++
false
false
1,372
h
#ifndef ANDROID_SERVICE_HEAD_FILE #define ANDROID_SERVICE_HEAD_FILE #pragma once #include "Stdafx.h" ////////////////////////////////////////////////////////////////////////// //游戏服务器管理类 class CGameServiceManager : public IGameServiceManager { public: tagGameServiceOption m_GameServiceOption; protected: static CGameServiceManager * m_pGameServiceManager; //函数定义 public: //构造函数 CGameServiceManager(void); //析构函数 virtual ~CGameServiceManager(void); //基础接口 public: //释放对象 virtual VOID Release() { return; } //接口查询 virtual VOID * QueryInterface(const IID & Guid, DWORD dwQueryVer); //创建接口 public: //创建桌子 virtual VOID * CreateTableFrameSink(REFGUID Guid, DWORD dwQueryVer); //创建机器 virtual VOID * CreateAndroidUserItemSink(REFGUID Guid, DWORD dwQueryVer); //创建数据 virtual VOID * CreateGameDataBaseEngineSink(REFGUID Guid, DWORD dwQueryVer); //参数接口 public: //组件属性 virtual bool GetServiceAttrib(tagGameServiceAttrib & GameServiceAttrib); //调整参数 virtual bool RectifyParameter(tagGameServiceOption & GameServiceOption); //静态函数 public: //获取对象 static CGameServiceManager * GetInstance() { return m_pGameServiceManager; } }; ////////////////////////////////////////////////////////////////////////// #endif
[ "494294315@qq.com" ]
494294315@qq.com
55c6ec9565305ed2dba90727b6703f4ccad9b424
bd1fea86d862456a2ec9f56d57f8948456d55ee6
/000/114/434/CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_calloc_72a.cpp
2fcb210955422557b13a52f59ce8039f27722f91
[]
no_license
CU-0xff/juliet-cpp
d62b8485104d8a9160f29213368324c946f38274
d8586a217bc94cbcfeeec5d39b12d02e9c6045a2
refs/heads/master
2021-03-07T15:44:19.446957
2020-03-10T12:45:40
2020-03-10T12:45:40
246,275,244
0
1
null
null
null
null
UTF-8
C++
false
false
3,344
cpp
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_calloc_72a.cpp Label Definition File: CWE762_Mismatched_Memory_Management_Routines__delete.label.xml Template File: sources-sinks-72a.tmpl.cpp */ /* * @description * CWE: 762 Mismatched Memory Management Routines * BadSource: calloc Allocate data using calloc() * GoodSource: Allocate data using new * Sinks: * GoodSink: Deallocate data using free() * BadSink : Deallocate data using delete * Flow Variant: 72 Data flow: data passed in a vector from one function to another in different source files * * */ #include "std_testcase.h" #include <vector> using namespace std; namespace CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_calloc_72 { #ifndef OMITBAD /* bad function declaration */ void badSink(vector<int64_t *> dataVector); void bad() { int64_t * data; vector<int64_t *> dataVector; /* Initialize data*/ data = NULL; /* POTENTIAL FLAW: Allocate memory with a function that requires free() to free the memory */ data = (int64_t *)calloc(100, sizeof(int64_t)); /* Put data in a vector */ dataVector.insert(dataVector.end(), 1, data); dataVector.insert(dataVector.end(), 1, data); dataVector.insert(dataVector.end(), 1, data); badSink(dataVector); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void goodG2BSink(vector<int64_t *> dataVector); static void goodG2B() { int64_t * data; vector<int64_t *> dataVector; /* Initialize data*/ data = NULL; /* FIX: Allocate memory from the heap using new */ data = new int64_t; /* Put data in a vector */ dataVector.insert(dataVector.end(), 1, data); dataVector.insert(dataVector.end(), 1, data); dataVector.insert(dataVector.end(), 1, data); goodG2BSink(dataVector); } /* goodB2G uses the BadSource with the GoodSink */ void goodB2GSink(vector<int64_t *> dataVector); static void goodB2G() { int64_t * data; vector<int64_t *> dataVector; /* Initialize data*/ data = NULL; /* POTENTIAL FLAW: Allocate memory with a function that requires free() to free the memory */ data = (int64_t *)calloc(100, sizeof(int64_t)); dataVector.insert(dataVector.end(), 1, data); dataVector.insert(dataVector.end(), 1, data); dataVector.insert(dataVector.end(), 1, data); goodB2GSink(dataVector); } void good() { goodG2B(); goodB2G(); } #endif /* OMITGOOD */ } /* close namespace */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN using namespace CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_calloc_72; /* so that we can use good and bad easily */ int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
[ "frank@fischer.com.mt" ]
frank@fischer.com.mt
f30b8c3ad13c274ecc2440cb2370beaed0b3470b
1d7d7a8269c8e626acb48c0fd272f4f818eb369f
/Jan 2017/POJ1376 run away.cpp
53e394eb200fc96f07e980d51bcd669728a0a9c6
[]
no_license
unicornt/code
fc238ee7fdf0eeedbfc30484d53ae2f03c7bf0c3
31b2483bd1d6ee939cbe90ce887316996f1d95b4
refs/heads/master
2020-12-24T19:13:00.408450
2017-04-21T14:15:43
2017-04-21T14:15:43
77,031,102
0
0
null
null
null
null
UTF-8
C++
false
false
1,479
cpp
#include <cstdio> #include <cstdlib> #include <cmath> #include <algorithm> #define rep(i,a,b) for(int i=a,i##_END_=b;i<i##_END_;++i) #define per(i,a,b) for(int i=(b)-1,i##_BEGIN_=a;i>=i##_BEGIN_;--i) #define x first #define y second using namespace std; typedef pair<double,double> node; const int M=10005; double X,Y; node p[M]; double Rnd(){return rand()%10000/10000.0;} void legal(node&a) { if(a.x<0) a.x=0; if(a.x>X) a.x=X; if(a.y<0) a.y=0; if(a.y>Y) a.y=Y; } double sqr(double x){return x*x;} double dis(node a,node b){return sqrt(sqr(a.x-b.x)+sqr(a.y-b.y));} int n; double calc(node a) { double res=1e300; rep(i,0,n) res=min(res,dis(a,p[i])); return res; } node get_node(node a,double t) { node ret; double res=-1; rep(i,0,80) { node w=node(a.x+t*(Rnd()*2-1),a.y+t*(Rnd()*2-1)); legal(w); double tmp=calc(w); if(tmp>res) { res=tmp; ret=w; } } return ret; } int main() { srand(233); int T; for(scanf("%d",&T);T;T--) { scanf("%lf%lf%d",&X,&Y,&n); rep(i,0,n) scanf("%lf%lf",&p[i].x,&p[i].y); node now=p[0],ans=now; // printf("%f %f\n",calc(node(0,0)),calc(node(50,50))); double nans,res; nans=res=calc(now); double t=1e10; while(t>0.01) { node ton=get_node(now,t); double tans=calc(ton); double delta=tans-nans; if(tans>res) res=tans,ans=ton; if(delta>=0||exp(delta/t)>=Rnd()) { now=ton; nans=tans; } t*=0.95; } printf("The safest point is (%.1f, %.1f).\n",ans.x,ans.y); } return 0; }
[ "noreply@github.com" ]
unicornt.noreply@github.com
9e4512dd8702f1c0501e7569867006ec01217801
341b3bbf4f87b00a3dcdc1d4f0acac1014f3aa5f
/snippets/001-enum-cast.cpp
c90a5428d33aed9de48ecb3f24c531347cbb5482
[ "Unlicense" ]
permissive
baatochan/CppStuff
03a139584556165ed9c778fe24c7d6736a3d0f15
d25d9e3fd59f6d6455c7d86f5ebfa0224fd013e8
refs/heads/master
2021-05-09T02:24:51.392838
2019-11-02T21:42:18
2019-11-02T21:43:00
119,209,203
0
0
null
null
null
null
UTF-8
C++
false
false
280
cpp
#include <iostream> enum class EC { E0, E1, E2 }; enum class EC2 { A=-1, B, C }; int main() { EC e = EC::E1; EC2 ec = static_cast<EC2>(e); if (ec == EC2::C) { std::cout << "ec == EC2::C" << std::endl; } else { std::cout << "ec != EC2::C" << std::endl; } return 0; }
[ "bartoszka1996@gmail.com" ]
bartoszka1996@gmail.com
46c32e467d1e8bc93e5300a168d7b2f41c9be6d7
0f252a72f9c464bc4e38d8b18c4d03717d84acf2
/laptop/Codeforces/cf_863D.cpp
68d5a58041f059e485a72b49da8b26d6f9cc3de7
[]
no_license
ZikXewen/Submissions
e5286f1a94f1108eaa43c30fe6d12cec8537f066
ec6efc8f92440e43850b8d094927958c5533eb05
refs/heads/master
2023-07-24T11:59:16.460972
2021-05-24T13:02:43
2021-05-24T13:02:43
220,632,852
1
0
null
null
null
null
UTF-8
C++
false
false
1,657
cpp
#include <bits/stdc++.h> using namespace std; struct one{ int va, pri, sz; bool rv; one *l, *r; one(int _va) : va(_va), pri(rand()), sz(1), rv(0), l(0), r(0) {} } *tr; int _sz(one *u){return u? u -> sz : 0;} void mk(one *&u){if(u) u -> rv ^= 1;} void ps(one *&u){if(u -> rv) u -> rv = 0, swap(u -> l, u -> r), mk(u -> l), mk(u -> r);} void ud(one *&u){u -> sz = _sz(u -> l) + _sz(u -> r) + 1;} void spl(one *u, one *&l, one *&r, int po){ if(!u){l = r = 0; return;} ps(u); if(_sz(u -> l) < po) spl(u -> r, u -> r, r, po - _sz(u -> l) - 1), l = u; else spl(u -> l, l, u -> l, po), r = u; ud(u); } void mrg(one *l, one *r, one *&u){ if(!l or !r){u = l? l : r; return;} ps(l); ps(r); if(l -> pri < r -> pri) mrg(l -> r, r, l -> r), u = l; else mrg(l, r -> l, r -> l), u = r; ud(u); } int N, Q, M; vector<int> an; void prnt(one *u = tr){ if(!u) return; ps(u); prnt(u -> l); an.emplace_back(u -> va); prnt(u -> r); } int main(){ ios::sync_with_stdio(0), cin.tie(0); srand(time(0)); cin >> N >> Q >> M; for(int i = 0, u; i < N; ++i) cin >> u, mrg(tr, new one(u), tr); for(int i = 0, u, v, w; i < Q; ++i){ cin >> u >> v >> w; if(u == 1){ one *l, *ex, *r; // l tr ex r spl(tr, tr, r, w); spl(tr, tr, ex, w - 1); spl(tr, l, tr, v - 1); mrg(l, ex, l); mrg(l, tr, tr); mrg(tr, r, tr); } else { one *l, *r; spl(tr, tr, r, w); spl(tr, l, tr, v - 1); mk(tr); mrg(l, tr, tr); mrg(tr, r, tr); } } prnt(); for(int i = 0, u; i < M; ++i) cin >> u, cout << an[u - 1] << ' '; }
[ "datasup12@gmail.com" ]
datasup12@gmail.com
f8b47f812ef7a81ebaed6237ad7e07e2926e76a5
3af6551baf2684fe6ee2fb36b74e39cb25067559
/RTSPServer/Sender.cpp
f7bc4da47f989b1bd6beda18f80ec7f5d3d25f3d
[]
no_license
bniss/MediaServer
a6737905d792ba6bccce263df658379ede142a4c
8d5e6e538eaa61976555e06c2443ab4c1bbdeaa2
refs/heads/master
2021-05-31T16:32:35.171890
2015-09-09T05:56:58
2015-09-09T05:56:58
null
0
0
null
null
null
null
GB18030
C++
false
false
3,778
cpp
#include "Sender.h" namespace live555RTSP { CRTPSender::CRTPSender(live555RTSP::RTSPServer* ourserver) :myrtpexternalsender(NULL), fourserver(ourserver), stop_(false), rtpexternaltransinfo(NULL), rtpsenderstate(CREATE), foursessionid(0), m_iCurClock(0) { memset(clientipaddress, 0 ,64); myrtpexternalsender = new MyRTPExternalSender(this); rtcprecvdata = new unsigned char[RTCP_DATASTZE]; } CRTPSender::~CRTPSender(void) { if(myrtpexternalsender){ delete myrtpexternalsender; myrtpexternalsender = NULL; } if (rtpexternaltransinfo){ rtpsession_.DeleteTransmissionInfo(rtpexternaltransinfo); //delete rtpexternaltransinfo; rtpexternaltransinfo = NULL; } if( rtcprecvdata ){ delete[] rtcprecvdata; rtcprecvdata = NULL; } } int CRTPSender::Start() { //init rtpsession jrtplib::RTPSessionParams sessionparams; sessionparams.SetOwnTimestampUnit(1.0/90000.0); sessionparams.SetMaximumPacketSize(RTPUDPEXTRANS_RTPMAXSIZE); jrtplib::RTPExternalTransmissionParams transparams(myrtpexternalsender,RTPUDPEXTRANS_HEADERSIZE); //jrtplib::RTPUDPv4TransmissionParams transparams; rtpsession_.Create(sessionparams,&transparams,jrtplib::RTPTransmitter::ExternalProto); rtpsession_.SetDefaultPayloadType(RTP_PAYLOADTYPE); rtpsession_.SetDefaultMark(false); rtpsession_.SetDefaultTimestampIncrement(RTP_TIMESTAMP_INC); rtpexternaltransinfo = (jrtplib::RTPExternalTransmissionInfo *)rtpsession_.GetTransmissionInfo(); StartRecvRTCP(); rtpsenderstate = START; return 0; } int CRTPSender::SendData(unsigned long dwDataType, unsigned char *data, unsigned long len, int timestampinc) { if (stop_)return -1; if(!( rtpsenderstate == WAITFOR_SENDHAED || rtpsenderstate == WORKING ))return -2; if( (dwDataType >> 16) > 0){ rtpsenderstate = WORKING; } int cursize = len; unsigned char* sendbuf = data; int status = 0; RTPExtensionData t_RTPExtensionData; t_RTPExtensionData.dwDataType = dwDataType; t_RTPExtensionData.dwtimeTamp = timestampinc; // 失效 int t_ExtensionLenth = 1; //t_ExtensionLenth > 1时jrtp工作异常 发送数据好像丢包 //if(timestampinc != -1) // t_ExtensionLenth = 2; int devtype = dwDataType & 0xffff; if( devtype < H264_MAX_DEVTYPE && ( (dwDataType >> 16) > 0 ) ) return 0; boost::recursive_mutex::scoped_lock lock_(rtpsession_mutex_); if( devtype <= H264_MAX_DEVTYPE ) { jrtplib::RTPHeader rtpHeader; memcpy(&rtpHeader, sendbuf, sizeof(jrtplib::RTPHeader)); if(rtpHeader.marker == 1) { //int iNowClock = (int)(((float)clock()/CLOCKS_PER_SEC ) * 1000.0); //int iTimeStampInc = iNowClock - m_iCurClock; //m_iCurClock = iNowClock; //if( iTimeStampInc > 90000 / 2 || iTimeStampInc <= 0) // iTimeStampInc = RTP_TIMESTAMP_INC; //else // iTimeStampInc = iTimeStampInc * 90; status = rtpsession_.SendPacket(sendbuf + 12, len - 12, RTP_PAYLOADTYPE, true, /*iTimeStampInc*/RTP_TIMESTAMP_INC); } else status = rtpsession_.SendPacket(sendbuf + 12, len - 12, RTP_PAYLOADTYPE, false, 0); } else { while( cursize > 0 ) { if( cursize >= RTPUDPEXTRANS_RTPMAXSIZE_PART ) { status = rtpsession_.SendPacketEx(sendbuf,RTPUDPEXTRANS_RTPMAXSIZE_PART,RTP_PAYLOADTYPE,false,0, 1, &t_RTPExtensionData, t_ExtensionLenth); sendbuf = sendbuf + RTPUDPEXTRANS_RTPMAXSIZE_PART; cursize = cursize - RTPUDPEXTRANS_RTPMAXSIZE_PART; } else { status = rtpsession_.SendPacketEx(sendbuf,cursize,RTP_PAYLOADTYPE,true,RTP_TIMESTAMP_INC, 1, &t_RTPExtensionData, t_ExtensionLenth); sendbuf = sendbuf + cursize; cursize = 0; } } } status = rtpsession_.Poll(); lock_.unlock(); //if ( status < 0 ) // std::cerr << "CSender::HandleSendRTPData" << jrtplib::RTPGetErrorString(status) << std::endl; return status; } }// end namespace
[ "arronmy525@gmail.com" ]
arronmy525@gmail.com
d4f60f643f9a101eec39cbe10be8af7a360c4813
c0caed81b5b3e1498cbca4c1627513c456908e38
/src/protocols/enzdes/AddOrRemoveMatchCstsCreator.hh
97a2ff8e9965c0741289e3b670a572490fae19a2
[]
no_license
malaifa/source
5b34ac0a4e7777265b291fc824da8837ecc3ee84
fc0af245885de0fb82e0a1144422796a6674aeae
refs/heads/master
2021-01-19T22:10:22.942155
2017-04-19T14:13:07
2017-04-19T14:13:07
88,761,668
0
2
null
null
null
null
UTF-8
C++
false
false
1,233
hh
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*- // vi: set ts=2 noet: // // (c) Copyright Rosetta Commons Member Institutions. // (c) This file is part of the Rosetta software suite and is made available under license. // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons. // (c) For more information, see http://www.rosettacommons.org. Questions about this can be // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu. /// @file protocols/enzdes/AddOrRemoveMatchCstsAddOrRemoveMatchCstsCreator.hh /// @brief This class will create instances of Mover AddOrRemoveMatchCsts for the MoverFactory /// @author Andrew Leaver-Fay via code_writer.py (aleaverfay@gmail.com) #ifndef INCLUDED_protocols_enzdes_AddOrRemoveMatchCstsCreator_hh #define INCLUDED_protocols_enzdes_AddOrRemoveMatchCstsCreator_hh #include <protocols/moves/MoverCreator.hh> namespace protocols { namespace enzdes { class AddOrRemoveMatchCstsCreator : public protocols::moves::MoverCreator { public: virtual moves::MoverOP create_mover() const; virtual std::string keyname() const; static std::string mover_name(); }; } } #endif
[ "malaifa@yahoo.com" ]
malaifa@yahoo.com
4bc8a4b19d6b6e1d91b99357a7ce0756f0189c7b
198ab1db1be319ca3b1438cee13483bdb06e752f
/tags/iris-0.1.17/src/util/Utils.cpp
2a2be93a1fc19a710db98cb070b6c1cb1067cbed
[]
no_license
CommunicoPublic/iris
b11b366e244707d017ff55d6c952b7247d5ea1dc
b412f5db97ba7305f0b946e628709c1c6f976953
refs/heads/master
2020-05-30T10:04:24.953824
2015-06-30T10:02:39
2015-06-30T10:02:39
26,064,979
2
0
null
null
null
null
UTF-8
C++
false
false
986
cpp
/*- * Copyright (c) Iris Dev. team. All rights reserved. * See http://www.communico.pro/license for details. * */ #include "Utils.hpp" namespace IRIS { // // Convert string to 64-bit unsigned int // UINT_64 Util::StrToUInt(CCHAR_P sData, UINT_64 iDataSize) { UINT_64 iResult = 0; for(UINT_64 iPos = 0; iPos < iDataSize; ++iPos) { const UCHAR_8 ucTMP = *sData; if (!(ucTMP >= '0' && ucTMP <= '9')) { break; } iResult = iResult * 10 + ucTMP - '0'; ++sData; } return iResult; } // // Convert string to 64-bit int // INT_64 Util::StrToInt(CCHAR_P sData, UINT_64 iDataSize) { INT_64 iResult = 0; bool bNegative = false; if (iDataSize > 0 && *sData == '-') { bNegative = true; ++sData; --iDataSize; } for(UINT_64 iPos = 0; iPos < iDataSize; ++iPos) { const UCHAR_8 ucTMP = *sData; if (!(ucTMP >= '0' && ucTMP <= '9')) { break; } iResult = iResult * 10 + ucTMP - '0'; ++sData; } return bNegative ? -iResult : iResult; } } // namespace IRIS // End.
[ "root@ubuntu.communco.pro" ]
root@ubuntu.communco.pro
8745e8be3d66ecb7a3540c4c23c7d9926af6d6d5
e98b8922ee3d566d7b7193bc71d269ce69b18b49
/include/qpid/sys/Transport.h
dc53a2c6c77aa2e7deab3909a1405ecf3c900711
[]
no_license
QuarkCloud/qpid-lite
bfcf275eb5a99be3a1defb18331780d1b242dfa6
3818811d1b2eb70c9603c1e74045072b9a9b8cbc
refs/heads/master
2020-04-14T17:18:28.441389
2019-02-18T02:20:56
2019-02-18T02:20:56
163,975,774
1
1
null
null
null
null
UTF-8
C++
false
false
1,781
h
#ifndef QPID_SYS_TRANSPORT_H #define QPID_SYS_TRANSPORT_H 1 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ #include "qpid/sys/Compile.h" #include "qpid/sys/OutputControl.h" #include "qpid/sys/Poller.h" #include "qpid/sys/SecuritySettings.h" #include "qpid/sys/TransportContext.h" #include <boost/shared_ptr.hpp> namespace qpid { namespace sys { class Transport : public qpid::sys::OutputControl { public: virtual ~Transport() {} virtual void connect(const std::string& host, const std::string& port) = 0; virtual void close() = 0; virtual void abort() = 0; virtual const qpid::sys::SecuritySettings* getSecuritySettings() = 0; typedef Transport* Factory(TransportContext&, boost::shared_ptr<qpid::sys::Poller>); QPID_SYS_EXTERN static Transport* create(const std::string& name, TransportContext&, boost::shared_ptr<qpid::sys::Poller>); QPID_SYS_EXTERN static void add(const std::string& name, Factory* factory); }; } }// namespace qpid::sys #endif /*!QPID_SYS_TRANSPORT_H*/
[ "romandion@163.com" ]
romandion@163.com
b34205caaa3cdd45290de51b22bb5a6174b5a3ac
d64fab44ed6216789e87605cf8bd6f40f32ae1b4
/BattleTank/Source/BattleTank/Private/Projectile.cpp
1624cf25b23034903e97b8e99ab9b22c9c86d027
[]
no_license
patrick58d/04_BattleTank
1e00fd92a621b6d7ad0a0eee644413743dc19233
e645633adda6cf9ea98dbf06ea4c5f1493202b5b
refs/heads/master
2021-01-19T21:09:41.791192
2017-06-12T12:14:07
2017-06-12T12:14:07
88,617,415
0
0
null
null
null
null
UTF-8
C++
false
false
1,046
cpp
// Fill out your copyright notice in the Description page of Project Settings. #include "BattleTank.h" #include "G:/repos/04_BattleTanks/BattleTank/Source/BattleTank/Public/Projectile.h" // Sets default values AProjectile::AProjectile() { // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; ProjectileMovement = CreateDefaultSubobject<UProjectileMovementComponent>(FName("Projectile Movement")); ProjectileMovement->bAutoActivate = false; } // Called when the game starts or when spawned void AProjectile::BeginPlay() { Super::BeginPlay(); } // Called every frame void AProjectile::Tick( float DeltaTime ) { Super::Tick( DeltaTime ); } void AProjectile::LaunchProjectile(float Speed) { auto Time = GetWorld()->GetTimeSeconds(); UE_LOG(LogTemp, Warning, TEXT("%f: Projectile Fired at: %f"), Time, Speed); ProjectileMovement->Activate(true); ProjectileMovement->SetVelocityInLocalSpace(FVector::ForwardVector * Speed); }
[ "pmcavena@gmail.com" ]
pmcavena@gmail.com
060ad37d8973523c6c63bcf4cfffceff06d86d24
1c63faabce81af953f285f33b7a30b9ce43dcc4f
/occiSelec.cpp
28fb3dc5df94e3988dd38128bdd6518c6fc53288
[]
no_license
YunGilDong/linux_occilib
3e12f95d743610f0d926bd1268d2d87e8010d9ac
2eb0622aebf0b57c7b4521f028c2552ea5ec89b3
refs/heads/master
2021-01-07T01:51:54.370374
2020-02-19T06:11:18
2020-02-19T06:11:18
241,544,049
0
0
null
null
null
null
UTF-8
C++
false
false
4,663
cpp
/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. */ /* NAME occidml.cpp - Basic DML Operations demo DESCRIPTION To exhibit the insertion, selection, updating and deletion of a row using OCCI interface MODIFIED (MM/DD/YY) mvasudev 09/27/10 - remove HR schema and user SCOTT mvasudev 05/22/08 - Add try/catch blocks sudsrini 10/22/06 - Username/Password lower case lburgess 04/14/06 - lowercase passwords sudsrini 07/23/04 - Copyright Info idcqe 03/05/01 - Creation */ #include <iostream> #include <occi.h> using namespace oracle::occi; using namespace std; //------------------------------------------------------------------------------ // Local //------------------------------------------------------------------------------ Environment *env; Connection *conn; Statement *stmt; //------------------------------------------------------------------------------ // connect //------------------------------------------------------------------------------ bool connect(void) { bool ok = true; try { env = Environment::createEnvironment (Environment::DEFAULT); conn = env->createConnection ("TRAMTEST", "TRAMTEST", "TRdb"); cout<<"Database connection success"<<endl; } catch(SQLException ex) { ok = false; cout<<"Exception thrown for connect"<<endl; cout << "# ERR: SQLException in " << __FILE__; cout << "(" << __FUNCTION__ << ") on line "<< __LINE__ << endl; cout << ex.what() << '\n'; cout<<"Error number: "<< ex.getErrorCode() << endl; } return (ok); } //------------------------------------------------------------------------------ // occiSelect //------------------------------------------------------------------------------ int occiSelect(void) { bool ok = true; int entry = 0; cout<<"OCCI select"<<endl; string query="select * from tram"; ResultSet *rset; try { stmt = conn->createStatement (query); rset = stmt->executeQuery (); while(rset->next()) { cout <<"ID : "<< rset->getInt(1) << endl; cout <<"ADMIN : "<< rset->getString(7) << endl; cout <<"RMARK : "<< rset->getString(10) << endl; entry++; } } catch(SQLException ex) { ok = false; cout<<"Exception thrown for select"<<endl; cout << "# ERR: SQLException in " << __FILE__; cout << "(" << __FUNCTION__ << ") on line "<< __LINE__ << endl; cout << ex.what() << '\n'; cout<<"Error number: "<< ex.getErrorCode() << endl; } if(ok) stmt->closeResultSet (rset); conn->terminateStatement (stmt); } //------------------------------------------------------------------------------ // occiSelect //------------------------------------------------------------------------------ int occiSelect2(void) { bool ok = true; int entry = 0; cout<<"OCCI select"<<endl; //string query="select * from tram where TRAM_ID = :pTramID"; string query="select * from tram where TRAM_ID = :pTramID"; ResultSet *rset; try { stmt = conn->createStatement (query); stmt->setNumber (1, 100000001); rset = stmt->executeQuery (); while(rset->next()) { cout <<"ID : "<< rset->getInt(1) << endl; cout <<"ADMIN : "<< rset->getString(7) << endl; cout <<"RMARK : "<< rset->getString(10) << endl; entry++; } } catch(SQLException ex) { ok = false; cout<<"Exception thrown for select"<<endl; cout << "# ERR: SQLException in " << __FILE__; cout << "(" << __FUNCTION__ << ") on line "<< __LINE__ << endl; cout << ex.what() << '\n'; cout<<"Error number: "<< ex.getErrorCode() << endl; } if(ok) stmt->closeResultSet (rset); conn->terminateStatement (stmt); } //------------------------------------------------------------------------------ // main //------------------------------------------------------------------------------ int main(void) { cout<<"OCCI TEST"<<endl; bool ok = false; ok = connect(); if(ok) { occiSelect(); occiSelect2(); } // oracle db disconnection env->terminateConnection (conn); Environment::terminateEnvironment (env); return 0; }
[ "gdyun@the-road.co.kr" ]
gdyun@the-road.co.kr
cb16ca444294e91a6aee598d4754394302a69456
3f7df81cd893fda2aa6e837a5dc0887831d71ee3
/12/ex_11.cpp
61afb8bf8de90a095ce081be356a45b4db436b81
[]
no_license
ronengi/BSPPP
604e7e5dffe383cf9cc4753f0dc8fc1ad3284bdd
7325439c5be85508e83f79c4b8a59f4ac7c53106
refs/heads/master
2021-09-22T11:04:10.499244
2018-09-08T23:24:07
2018-09-08T23:24:07
109,804,524
0
0
null
null
null
null
UTF-8
C++
false
false
827
cpp
#include <cmath> //#include <unistd.h> #include "../bs_fltk/Simple_window.h" #include "../bs_fltk/Graph.h" #include "../bs_fltk/Graph.h" #define PI 3.14159265 int main() { using namespace Graph_lib; Simple_window win(Point(0, 0), 900, 800, "Polygons"); int x0 = win.x_max() / 2, y0 = win.y_max() / 2; int r = 50; Circle *c; Polygon *p; double a = 0; int x, y; for (int i = 3; i < 20; ++i, r += 20) { c = new Circle(Point(x0,y0), r); (*c).set_color(Color::green); p = new Polygon; (*p).set_style(Line_style(Line_style::solid, 2)); (*p).set_color(Color::blue); for (int j = 0; j < i; ++j) { x = x0 + sin(a) * r; y = y0 - cos(a) * r; (*p).add(Point(x, y)); a += 2 * PI / i; } win.attach(*p); win.attach(*c); } win.wait_for_button(); }
[ "ronengi@gmail.com" ]
ronengi@gmail.com
cefca9d39b6ef1cfd87589d662440552f2c25a96
24c03e7ae65dbaecf4877efe782315ec164e3973
/rc_rgb_led.ino
7bd328e6bd73772221b8613e080c2d312a3a836c
[]
no_license
snaewe/rc_rgb_led
ef541ea7bbaa2746fe046cb00ae25e366e78cbab
017d15a9d63cee218cd082873ed40805e8e15262
refs/heads/master
2020-06-03T05:30:14.690500
2017-07-30T19:04:41
2017-07-30T19:04:41
94,118,023
0
0
null
null
null
null
UTF-8
C++
false
false
3,167
ino
// // Code von: http://meineweltinmeinemkopf.blogspot.de/2015/04/beleuchtung-mit-dem-attiny-45.html // // NeoPixel Bibliothek hinzufügen für die Ansteuerung der WS2812B LED Streifen #include <Adafruit_NeoPixel.h> // Instanz initialisieren // Parameter Angaben: // 1. Anzahl für verwendeter RGB LEDs // 2. Auf welchen Pin soll verwendet werden. // 3. Auswahl zwischen RGB, GRB oder BRG und verwendeter Takt 400KHz oder 800KHz Adafruit_NeoPixel pixels = Adafruit_NeoPixel(4, 2, NEO_GRB + NEO_KHZ800); // Helligkeit einstellen. Kann von 0 bis Maximal 255 festgelegt werden. // Bei Maximaler Ausleuchtung ist zu prüfen, ob die Maximale Stromabnahme erreicht wird. const int brightness = 100; // Helligkeit bei verwendung der WS2812b, wenn sie weis auf blitzen sollen. // Bei 210 wird die Maximale Stromabnahme überschritten. // Darf nur kurz verwendet werden, ansonsten brennt der Spannungsregler durch. const int brightnessWhite = 210; // Wird zum festlegen des Licht Einstellung verwendet. // Damit die Einstellung funktioniert, // muss an der Fernsteuerung einmal hin und her Geschaltet oder gedreht werden, // um die längste Pulslänge zu ermitteln. static unsigned long maxPwmIn = 2; void setup() { // Signal von der Fernsteuerung aufnehmen. pinMode(3, INPUT); // Positionslichter schalten pinMode(0, OUTPUT); // RGB LEDs Stribes starten pixels.begin(); pixels.show(); } void loop() { // Signal von der Fernsteuerung einlesen. // Für die Verwendung sollte ein Schalter genutzt werden. unsigned long pwmIn = pulseIn(3, HIGH); // Wird zum Anlernen verwendet. Durch festlegen der maximalen Pulslänge // können zwei Zustände verwendet werden. if (pwmIn > maxPwmIn) { maxPwmIn = pwmIn; } // Wenn das Signal kürzer ist als der Maximalen Pulslänge. if (pwmIn < maxPwmIn - 100) { // Positionslichter einschalten // (Bei verwendung von NPN Transisitor, kann die '255 -' weg) analogWrite(0, 255 - brightness); delay(100); // Ausschalten (Bei NPN, den Wert auf 0 setzen.) analogWrite(0, 255); delay(100); // RGB LED Streifen ansteuern. // Rot und Grün allRGB_LED_Off(); pixels.setPixelColor(0, pixels.Color(brightness, 0, 0)); pixels.setPixelColor(1, pixels.Color(0, brightness, 0)); pixels.show(); delay(100); allRGB_LED_Off(); pixels.setPixelColor(2, pixels.Color(brightness, 0, 0)); pixels.setPixelColor(3, pixels.Color(0, brightness, 0)); pixels.show(); delay(100); } else { // Positionslichter ausschalten // (Bei verwendung von NPN Transisitor, ist zum Ausschalten der Wert 0) analogWrite(0, 255); // RGB LED Streifen ansteuern. for (int i = 0; i < 4; i++) { // Alle aus. allRGB_LED_Off(); // Mit der Aktuellen Iteration als Index verwenden, // um den entsprechende RGB LED zu überschreiben. pixels.setPixelColor(i, pixels.Color(brightnessWhite, brightnessWhite, brightnessWhite)); pixels.show(); delay(100); } } } // Stellt alle Werte zurück. void allRGB_LED_Off() { for (int i = 0; i < 4; i++) { pixels.setPixelColor(i, pixels.Color(0, 0, 0)); } }
[ "stefan.naewe@gmail.com" ]
stefan.naewe@gmail.com
02e9f9fea27d961eeafdb289c0080b18374cbc1f
d4c720f93631097ee048940d669e0859e85eabcf
/gpu/command_buffer/service/shared_image/dxgi_swap_chain_image_backing.cc
428662c9b5b1744642f3c6707eb8a5c9aae5d523
[ "BSD-3-Clause" ]
permissive
otcshare/chromium-src
26a7372773b53b236784c51677c566dc0ad839e4
3b920d87437d9293f654de1f22d3ea341e7a8b55
refs/heads/webnn
2023-03-21T03:20:15.377034
2023-01-25T21:19:44
2023-01-25T21:19:44
209,262,645
18
21
BSD-3-Clause
2023-03-23T06:20:07
2019-09-18T08:52:07
null
UTF-8
C++
false
false
11,151
cc
// Copyright 2022 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "gpu/command_buffer/service/shared_image/dxgi_swap_chain_image_backing.h" #include "base/debug/alias.h" #include "base/debug/dump_without_crashing.h" #include "base/feature_list.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_functions.h" #include "base/strings/stringprintf.h" #include "base/synchronization/waitable_event.h" #include "base/trace_event/trace_event.h" #include "base/win/windows_version.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/memory_tracking.h" #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image/d3d_image_backing.h" #include "gpu/command_buffer/service/shared_image/dxgi_swap_chain_image_representation.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing.h" #include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_manager.h" #include "gpu/command_buffer/service/shared_image/skia_gl_image_representation.h" #include "third_party/skia/include/core/SkAlphaType.h" #include "third_party/skia/include/gpu/GrTypes.h" #include "ui/gfx/buffer_format_util.h" #include "ui/gfx/color_space.h" #include "ui/gfx/color_space_win.h" #include "ui/gfx/geometry/size.h" #include "ui/gl/direct_composition_support.h" #include "ui/gl/gl_angle_util_win.h" #include "ui/gl/gl_switches.h" #include "ui/gl/gl_utils.h" namespace gpu { namespace { const char* kDXGISwapChainImageBackingLabel = "DXGISwapChainImageBacking"; bool IsWaitableSwapChainEnabled() { // Waitable swap chains were first enabled in Win 8.1/DXGI 1.3 return (base::win::GetVersion() >= base::win::Version::WIN8_1) && base::FeatureList::IsEnabled(features::kDXGIWaitableSwapChain); } UINT GetMaxWaitableQueuedFrames() { return static_cast<UINT>( features::kDXGIWaitableSwapChainMaxQueuedFrames.Get()); } } // namespace // static std::unique_ptr<DXGISwapChainImageBacking> DXGISwapChainImageBacking::Create( const Mailbox& mailbox, viz::SharedImageFormat format, DXGI_FORMAT internal_format, const gfx::Size& size, const gfx::ColorSpace& color_space, GrSurfaceOrigin surface_origin, SkAlphaType alpha_type, uint32_t usage) { Microsoft::WRL::ComPtr<ID3D11Device> d3d11_device = gl::QueryD3D11DeviceObjectFromANGLE(); Microsoft::WRL::ComPtr<IDXGIDevice> dxgi_device; d3d11_device.As(&dxgi_device); DCHECK(dxgi_device); Microsoft::WRL::ComPtr<IDXGIAdapter> dxgi_adapter; dxgi_device->GetAdapter(&dxgi_adapter); DCHECK(dxgi_adapter); Microsoft::WRL::ComPtr<IDXGIFactory2> dxgi_factory; dxgi_adapter->GetParent(IID_PPV_ARGS(&dxgi_factory)); DCHECK(dxgi_factory); DXGI_SWAP_CHAIN_DESC1 desc = {}; desc.Width = size.width(); desc.Height = size.height(); desc.Format = internal_format; desc.Stereo = FALSE; desc.SampleDesc.Count = 1; desc.BufferCount = gl::DirectCompositionRootSurfaceBufferCount(); desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT | /* Needed to bind to GL texture */ DXGI_USAGE_SHADER_INPUT; desc.Scaling = DXGI_SCALING_STRETCH; desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; desc.AlphaMode = SkAlphaTypeIsOpaque(alpha_type) ? DXGI_ALPHA_MODE_IGNORE : DXGI_ALPHA_MODE_PREMULTIPLIED; desc.Flags = 0; if (gl::DirectCompositionSwapChainTearingEnabled()) { desc.Flags |= DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; } if (IsWaitableSwapChainEnabled()) { desc.Flags |= DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT; } Microsoft::WRL::ComPtr<IDXGISwapChain1> dxgi_swap_chain; HRESULT hr = dxgi_factory->CreateSwapChainForComposition( d3d11_device.Get(), &desc, nullptr, &dxgi_swap_chain); base::UmaHistogramSparse( "GPU.DirectComposition.CreateSwapChainForComposition", hr); // If CreateSwapChainForComposition fails, we cannot draw to the // browser window. Return false after disabling Direct Composition support // and let the Renderer handle it. Either the GPU command buffer or the GPU // process will be restarted. if (FAILED(hr)) { DLOG(ERROR) << "CreateSwapChainForComposition failed: " << logging::SystemErrorCodeToString(hr); // Disable direct composition because SwapChain creation might fail again // next time. gl::SetDirectCompositionSwapChainFailed(); return nullptr; } gl::LabelSwapChainAndBuffers(dxgi_swap_chain.Get(), kDXGISwapChainImageBackingLabel); Microsoft::WRL::ComPtr<IDXGISwapChain3> swap_chain_3; if (SUCCEEDED(dxgi_swap_chain.As(&swap_chain_3))) { hr = swap_chain_3->SetColorSpace1( gfx::ColorSpaceWin::GetDXGIColorSpace(color_space)); DCHECK_EQ(hr, S_OK) << ", SetColorSpace1 failed: " << logging::SystemErrorCodeToString(hr); if (IsWaitableSwapChainEnabled()) { hr = swap_chain_3->SetMaximumFrameLatency(GetMaxWaitableQueuedFrames()); DCHECK_EQ(hr, S_OK) << ", SetMaximumFrameLatency failed: " << logging::SystemErrorCodeToString(hr); } } return base::WrapUnique(new DXGISwapChainImageBacking( mailbox, format, size, color_space, surface_origin, alpha_type, usage, std::move(d3d11_device), std::move(dxgi_swap_chain))); } DXGISwapChainImageBacking::DXGISwapChainImageBacking( const Mailbox& mailbox, viz::SharedImageFormat format, const gfx::Size& size, const gfx::ColorSpace& color_space, GrSurfaceOrigin surface_origin, SkAlphaType alpha_type, uint32_t usage, Microsoft::WRL::ComPtr<ID3D11Device> d3d11_device, Microsoft::WRL::ComPtr<IDXGISwapChain1> dxgi_swap_chain) : ClearTrackingSharedImageBacking( mailbox, format, size, color_space, surface_origin, alpha_type, usage, gfx::BufferSizeForBufferFormat(size, ToBufferFormat(format)), false /* is_thread_safe */), d3d11_device_(std::move(d3d11_device)), dxgi_swap_chain_(std::move(dxgi_swap_chain)) { const bool has_scanout = !!(usage & SHARED_IMAGE_USAGE_SCANOUT); const bool has_write = !!(usage & SHARED_IMAGE_USAGE_DISPLAY_WRITE); DCHECK(has_scanout); DCHECK(has_write); } DXGISwapChainImageBacking::~DXGISwapChainImageBacking() = default; SharedImageBackingType DXGISwapChainImageBacking::GetType() const { return SharedImageBackingType::kDXGISwapChain; } void DXGISwapChainImageBacking::Update( std::unique_ptr<gfx::GpuFence> in_fence) { DCHECK(!in_fence); } void DXGISwapChainImageBacking::AddSwapRect(const gfx::Rect& swap_rect) { if (pending_swap_rect_.has_value()) { // Force a Present if there's already a pending swap rect. For normal usage // of this backing, we normally expect one Skia write access to overlay read // access. // We'll log a message so it appears in the GPU log in case it aids in // debugging. LOG(WARNING) << "Multiple skia write accesses per overlay access, flushing " "pending swap."; Present(false); } pending_swap_rect_ = swap_rect; } bool DXGISwapChainImageBacking::Present( bool should_synchronize_present_with_vblank) { if (!pending_swap_rect_.has_value()) { DVLOG(1) << "Skipping present without an update rect"; return true; } HRESULT hr, device_removed_reason; const bool use_swap_chain_tearing = gl::DirectCompositionSwapChainTearingEnabled(); const bool force_present_interval_0 = base::FeatureList::IsEnabled(features::kDXGISwapChainPresentInterval0); UINT interval = first_swap_ || !should_synchronize_present_with_vblank || use_swap_chain_tearing || force_present_interval_0 ? 0 : 1; UINT flags = use_swap_chain_tearing ? DXGI_PRESENT_ALLOW_TEARING : 0; TRACE_EVENT2("gpu", "DirectCompositionChildSurfaceWin::PresentSwapChain", "has_alpha", !SkAlphaTypeIsOpaque(alpha_type()), "dirty_rect", pending_swap_rect_->ToString()); DXGI_PRESENT_PARAMETERS params = {}; RECT dirty_rect = pending_swap_rect_.value().ToRECT(); params.DirtyRectsCount = 1; params.pDirtyRects = &dirty_rect; hr = dxgi_swap_chain_->Present1(interval, flags, &params); // Ignore DXGI_STATUS_OCCLUDED since that's not an error but only // indicates that the window is occluded and we can stop rendering. if (FAILED(hr) && hr != DXGI_STATUS_OCCLUDED) { LOG(ERROR) << "Present1 failed: " << logging::SystemErrorCodeToString(hr); return false; } if (first_swap_) { // Wait for the GPU to finish executing its commands before // committing the DirectComposition tree, or else the swapchain // may flicker black when it's first presented. first_swap_ = false; Microsoft::WRL::ComPtr<IDXGIDevice2> dxgi_device2; d3d11_device_.As(&dxgi_device2); DCHECK(dxgi_device2); base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC, base::WaitableEvent::InitialState::NOT_SIGNALED); hr = dxgi_device2->EnqueueSetEvent(event.handle()); if (SUCCEEDED(hr)) { event.Wait(); } else { device_removed_reason = d3d11_device_->GetDeviceRemovedReason(); base::debug::Alias(&hr); base::debug::Alias(&device_removed_reason); base::debug::DumpWithoutCrashing(); } } pending_swap_rect_.reset(); return true; } std::unique_ptr<OverlayImageRepresentation> DXGISwapChainImageBacking::ProduceOverlay(SharedImageManager* manager, MemoryTypeTracker* tracker) { return std::make_unique<DXGISwapChainOverlayImageRepresentation>( manager, this, tracker); } std::unique_ptr<SkiaImageRepresentation> DXGISwapChainImageBacking::ProduceSkia( SharedImageManager* manager, MemoryTypeTracker* tracker, scoped_refptr<SharedContextState> context_state) { TRACE_EVENT0("gpu", "DXGISwapChainImageBacking::ProduceSkia"); if (!gl_texture_) { Microsoft::WRL::ComPtr<ID3D11Texture2D> backbuffer_texture; HRESULT hr = dxgi_swap_chain_->GetBuffer(0, IID_PPV_ARGS(&backbuffer_texture)); if (FAILED(hr)) { DLOG(ERROR) << "GetBuffer(0) failed: " << logging::SystemErrorCodeToString(hr); return nullptr; } gl_texture_ = D3DImageBacking::CreateGLTexture( format(), size(), color_space(), backbuffer_texture, GL_TEXTURE_2D, 0, 0, dxgi_swap_chain_); if (!gl_texture_) { LOG(ERROR) << "Failed to create GL texture"; return nullptr; } } return SkiaGLImageRepresentationDXGISwapChain::Create( std::make_unique<GLTexturePassthroughDXGISwapChainBufferRepresentation>( manager, this, tracker, gl_texture_), std::move(context_state), manager, this, tracker); } } // namespace gpu
[ "chromium-scoped@luci-project-accounts.iam.gserviceaccount.com" ]
chromium-scoped@luci-project-accounts.iam.gserviceaccount.com
d8f9f9985f247b17072747dbd736019b162928b3
845b2b6993fb50e988f008e6465e1e319266a470
/Electrosurgical/include/DataTypes/VectorFunc.h
67b74995d1645cbc13a6b5f0688549ebfa548b69
[]
no_license
tuannt8/tuan-ercp
9810683d5bcfc20cfb444d7a35431bf79ee6c403
eedcffa2d745b79beba50d6c6efeaebd93639b2e
refs/heads/master
2021-03-12T19:21:03.053974
2013-04-22T04:38:28
2013-04-22T04:38:28
32,391,915
1
0
null
null
null
null
UTF-8
C++
false
false
3,663
h
/******************************************** * Original source code: SOFA * * Modified by Hoeryong Jung * * Date: 2009. 10. 21 * * contact: junghl80@kaist.ac.kr * /*******************************************/ #ifndef VECTOR_FUNC_H #define VECTOR_FUNC_H #include <vector> #include "DataTypes/Vec.h" #include "DataTypes/Mat.h" class VectorFunc { public: VectorFunc() { }; ~VectorFunc() { }; int indexOfElement(std::vector<int>& v, int eValue) { for(int i=0;i<v.size();i++) { if(v[i]==eValue) { return i; } } return -1; } int indexOfElement(std::vector<int>* v, int value) { std::vector< int >::iterator location=v->end(); location = std::find( v->begin(), v->end(), value ); if (location != v->end()) { return std::distance(v->begin(), location); } return -1; } void removeElementValue(std::vector<int>& v, int eValue) { for(int i=0;i<v.size();i++) { if(v[i]==eValue) { removeElement(v,i); break; } } } bool isElementInVector(std::vector<int>& v, int value) { for(int i=0;i<v.size();i++) { if(v[i]==value) return true; } return false; }; void removeElement(std::vector<int>& v, int localIdx) { v[localIdx]=v[v.size()-1]; v.pop_back(); }; void removeElement(std::vector<float>& v, int localIdx) { v[localIdx]=v[v.size()-1]; v.pop_back(); }; void removeElement(std::vector<Vec4i>& v, int localIdx) { v[localIdx]=v[v.size()-1]; v.pop_back(); }; void removeElement(std::vector<Vec3f>& v, int localIdx) { v[localIdx]=v[v.size()-1]; v.pop_back(); }; void arrangeVector(std::vector<int>& v) { if(v.size()>1) { std::vector<int> temp; quickSort(v, 0, v.size()-1); for(int i=0;i<v.size()-1;i++) { if(!(v[i]==v[i+1])) temp.push_back(v[i]); } temp.push_back(v[v.size()-1]); v.clear(); for(int i=0;i<temp.size();i++) v.push_back(temp[i]); } }; void quickSort(std::vector<int>& num, int left, int right) { if(left<right) { int pivotIdx=(left+right)/2; pivotIdx=partition(num, left, right, pivotIdx); quickSort(num,left,pivotIdx-1); quickSort(num,pivotIdx+1, right); } }; int partition(std::vector<int>& num, int left, int right, int pivotIdx) { int pivotValue=num[pivotIdx]; num[pivotIdx]=num[right]; num[right]=pivotValue; int storeIdx=left; for(int i=left;i<right;i++) { if(num[i]<pivotValue) { int temp=num[storeIdx]; num[storeIdx]=num[i]; num[i]=temp; storeIdx=storeIdx+1; } } int temp=num[storeIdx]; num[storeIdx]=num[right]; num[right]=temp; return storeIdx; }; void quickSort(std::vector<float>& num, int left, int right) { if(left<right) { int pivotIdx=(left+right)/2; pivotIdx=partition(num, left, right, pivotIdx); quickSort(num,left,pivotIdx-1); quickSort(num,pivotIdx+1, right); } }; int partition(std::vector<float>& num, int left, int right, int pivotIdx) { float pivotValue=num[pivotIdx]; num[pivotIdx]=num[right]; num[right]=pivotValue; int storeIdx=left; for(int i=left;i<right;i++) { if(num[i]<pivotValue) { float temp=num[storeIdx]; num[storeIdx]=num[i]; num[i]=temp; storeIdx=storeIdx+1; } } float temp=num[storeIdx]; num[storeIdx]=num[right]; num[right]=temp; return storeIdx; }; void constructMatFromVec(Vec3f v1, Vec3f v2, Mat3x3f& mat) { for(int i=0;i<3;i++) { for(int j=0;j<3;j++) mat[i][j]=v1[i]*v2[j]; } }; }; #endif
[ "nguyentrungtuan.107@gmail.com@387d5d86-a975-01e3-4a56-1d5cb435c38f" ]
nguyentrungtuan.107@gmail.com@387d5d86-a975-01e3-4a56-1d5cb435c38f
cef5ffcf7b6b628921403415914107c132c9eedf
c46944c19d1c23c68e3e6b884efe70a39aeacf92
/PAT A1077/A1077/A1077/A1077.cpp
fa91e4cfa577600004c56ddc1e243d49ea61be29
[]
no_license
specialpointcentral/PAT-code
266f3becfb699c1f0c2dc2908e0dd48c545ba200
b8a917749fd814d397b5955c074fc9a3fb1d1ea7
refs/heads/master
2022-01-06T19:57:36.400791
2019-05-17T14:16:05
2019-05-17T14:16:05
171,138,537
0
0
null
null
null
null
UTF-8
C++
false
false
1,429
cpp
// A1077.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include "pch.h" #include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int n; cin >> n; string a, b, sub; if (n != 0) { getchar(); getline(cin, a); reverse(a.begin(), a.end()); --n; } while (n--) { getline(cin, b); // 全部反转 reverse(b.begin(), b.end()); // a,b的相同尾子串给sub sub.clear(); for (int i = 0; i < min(b.size(), a.size()); ++i) { if (a[i] == b[i]) { sub += a[i]; } else { break; } } if (a == "") { // 已经没有相同子串 cout << "nai"; return 0; } else { a = sub; } } reverse(sub.begin(), sub.end()); cout << sub; return 0; } // 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 // 调试程序: F5 或调试 >“开始调试”菜单 // 入门提示: // 1. 使用解决方案资源管理器窗口添加/管理文件 // 2. 使用团队资源管理器窗口连接到源代码管理 // 3. 使用输出窗口查看生成输出和其他消息 // 4. 使用错误列表窗口查看错误 // 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 // 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件
[ "spcreply@126.com" ]
spcreply@126.com
2ed7a8c470dd02ff0e55d696af7d7a471fe89ce7
4a9f20313ddd8ba4189d50b094abc6676eb05a9e
/save-setu-12403.cpp
c532a4f37a887b5bc6252be61c61dca60a991478
[]
no_license
rubayet/UVa
75e8d5fc4367f33bf7b5e0d5dbc2f9970e52a6fc
e92a56d9e317d372d7385dd158e3246f37f78a74
refs/heads/master
2020-04-04T15:13:49.586994
2013-11-16T18:15:19
2013-11-16T18:15:19
null
0
0
null
null
null
null
UTF-8
C++
false
false
473
cpp
// author: Rodrigo Alves // problem: Save Setu // url: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3834 // status: WA #include <iostream> using namespace std; int main() { int n, x = 0; string s; cin >> n; while(n--) { cin >> s; if(s == "donate") { int y; cin >> y; x += y; } else { cout<< x <<endl; } } return 0; }
[ "rodrigovieira1994@gmail.com" ]
rodrigovieira1994@gmail.com
04afaae0a6f0d83bdd34072f7acc7faa7064c0db
ac768b24e517cb3bfaa4cc34fdcd92913bad62ba
/local/include/FL/Fl_Free.H
6061fb55646d0d5632a66b975ebdc7e1d9f44a9f
[]
no_license
JeffOwOSun/Impressionist
24215da6394fd7768835f778d0bd046ae5b9945f
2821aeeb3f0273a7ec20c7dbfeb9d6c7b68da26f
refs/heads/master
2020-04-08T01:24:45.928079
2015-09-25T15:26:54
2015-09-25T15:26:54
42,025,329
7
4
null
2015-09-25T14:57:43
2015-09-07T01:33:17
C++
UTF-8
C++
false
false
1,845
h
// // "$Id: Fl_Free.H,v 1.5.2.4 2001/01/22 15:13:37 easysw Exp $" // // Forms free header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2001 by Bill Spitzak and others. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Library General Public License for more details. // // You should have received a copy of the GNU Library General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA. // // Please report all bugs and problems to "fltk-bugs@fltk.org". // #ifndef Fl_Free_H #define Fl_Free_H #ifndef Fl_Widget_H #include "Fl_Widget.H" #endif #define FL_NORMAL_FREE 1 #define FL_SLEEPING_FREE 2 #define FL_INPUT_FREE 3 #define FL_CONTINUOUS_FREE 4 #define FL_ALL_FREE 5 typedef int (*FL_HANDLEPTR)(Fl_Widget *, int , float, float, char); class Fl_Free : public Fl_Widget { FL_HANDLEPTR hfunc; static FL_EXPORT void step(void *); protected: FL_EXPORT void draw(); public: FL_EXPORT int handle(int); FL_EXPORT Fl_Free(uchar t,int x,int y,int w,int h,const char *l,FL_HANDLEPTR hdl); FL_EXPORT ~Fl_Free(); }; // old event names for compatability: #define FL_MOUSE FL_DRAG #define FL_DRAW 0 #define FL_STEP 9 #define FL_FREEMEM 12 #define FL_FREEZE FL_UNMAP #define FL_THAW FL_MAP #endif // // End of "$Id: Fl_Free.H,v 1.5.2.4 2001/01/22 15:13:37 easysw Exp $". //
[ "sunyushi9546@gmail.com" ]
sunyushi9546@gmail.com
5340f966a141db3cfb9c005d9bfc42fe55c088cf
dd8a36cea9cd0482be8bf0531f7032f116ac5849
/avcore/qt/video/qyuvplayer.cpp
39826f98c6fdd2d32ccab32f6a2a11eca92e8a58
[]
no_license
kevinroy-lo/YKAVStudyPlatform
3856db5f7132d66f7beaee35d11b0d274c4e3664
2c5cd0cc4deeaf2986d1682b2a4f73f3e469235a
refs/heads/main
2023-06-10T20:54:43.580199
2021-07-05T03:22:47
2021-07-05T03:22:47
null
0
0
null
null
null
null
UTF-8
C++
false
false
358
cpp
// // Created by 阳坤 on 2021/7/4. // // You may need to build the project (run Qt uic code generator) to get "ui_QYUVPlayer.h" resolved #include "qyuvplayer.h" #include "ui_QYUVPlayer.h" QYUVPlayer::QYUVPlayer(QWidget *parent) : QWidget(parent), ui(new Ui::QYUVPlayer) { ui->setupUi(this); } QYUVPlayer::~QYUVPlayer() { delete ui; }
[ "yang1001yk@gmail.com" ]
yang1001yk@gmail.com
77b34abad524d28aeac50476df053d58848707b3
5671c626ee367c9aacb909cd76a06d2fadf941e2
/frameworks/core/components/track/flutter_render_scale_ring_track.h
237be47fbf16cce2856f3c137f399e5720aeeffc
[ "Apache-2.0" ]
permissive
openharmony/ace_ace_engine
fa3f2abad9866bbb329524fb039fa89dd9517592
c9be21d0e8cb9662d5f4f93184fdfdb538c9d4e1
refs/heads/master
2022-07-21T19:32:59.377634
2022-05-06T11:18:20
2022-05-06T11:18:20
400,083,641
2
1
null
null
null
null
UTF-8
C++
false
false
1,304
h
/* * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_TRACK_FLUTTER_RENDER_SCALE_RING_TRACK_H #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_TRACK_FLUTTER_RENDER_SCALE_RING_TRACK_H #include "core/components/track/render_track.h" namespace OHOS::Ace { class FlutterRenderScaleRingTrack : public RenderScaleRingTrack { DECLARE_ACE_TYPE(FlutterRenderScaleRingTrack, RenderScaleRingTrack); public: FlutterRenderScaleRingTrack() = default; ~FlutterRenderScaleRingTrack() override = default; void Paint(RenderContext& context, const Offset& offset) override; }; } // namespace OHOS::Ace #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_TRACK_FLUTTER_RENDER_SCALE_RING_TRACK_H
[ "mamingshuai1@huawei.com" ]
mamingshuai1@huawei.com
f61a53fb5951b7d61b94ce4a0a224a35e55e8029
7e3a6412ba6bcca03bfc5d74a5fc299a00f76231
/other/gakpro/b.cpp
9e6f80d75da8de27c07ff901a3b4bfa94f6d8205
[]
no_license
M-yuhki/atcoder
012d883d32eb58b65190c07e9bcb461042931650
bffae75c2a871a780467a1e67152c9a8fde31f6b
refs/heads/master
2020-03-15T19:36:36.061757
2020-02-15T07:17:52
2020-02-15T07:17:52
132,312,876
0
0
null
null
null
null
UTF-8
C++
false
false
720
cpp
#include <bits/stdc++.h> #include <iostream> #include <cstring> #include <vector> #include <algorithm> #include <string> #include <regex> #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define ARRAY_LEN(ARR) (sizeof(ARR) / sizeof((ARR)[0])) using namespace std; const long long MOD = 1000000007; typedef long long ll; int main(void){ ll n,k; cin >> n >> k; vector<int> a(n); REP(i,n){ cin >> a[i]; } ll c,d; c = 0; d = 0; REP(i,n){ FOR(j,i+1,n){ if(a[i] > a[j]){ c++; d++; } else if(a[i] < a[j]) d++; } } ll ans = 0; ans = c * k % MOD + ( k * (k-1) / 2 % MOD ) * d; ans = ans % MOD; cout << ans << endl; }
[ "yuhki@GloogaDualiesDeco.local" ]
yuhki@GloogaDualiesDeco.local
dadbd5d90b60f039fc0f8b1d8cadbf8abf923c08
c13efc55043d3a7a3884d62ce162546c3bdcbe96
/2016/c++/Day 1/taxiCab.cpp
e57cdf58fbdc2dea0f28b86190b489c28366a5c9
[]
no_license
sK0pe/adventOfCode
e4825d174669708d0c210c6a6bea6c6e3631c422
0d8e3bf5a9dcdbe0922a657a3d2c26c77fda65b7
refs/heads/master
2021-12-11T10:01:37.953110
2021-12-10T12:03:57
2021-12-10T12:03:57
75,729,660
0
0
null
null
null
null
UTF-8
C++
false
false
2,676
cpp
// start at x = 0, y = 0 // start +ve x plane, r = +ve // even moves always affect x plane // odd moves always affect y plane // // // 0,0 x += 2 as direction = r, -1 modifier as r // 2,0 switch to y as odd y += // // contiguous similar directions give -ve number // // r2 // x+=2 // l2 // y+=2 // // l2 // x-=2 // l2 // y-=2 // // r2 // x+=2 // r2 // y-=2 // r2 // x -=2 // // 0 , -2 // // r5 // x+=5 // l5 // y+=5 // r5 // x+=5 // r3 // y-=3 // // 10,2 #include <iostream> #include <cstdio> #include <vector> #include <string> #include <utility> #include <set> using namespace std; void tokeniser(string& str, string delimiter, vector<string> &tokens){ auto start = str.find_first_not_of(delimiter, 0); auto end = start; while(end != string::npos){ end = str.find(delimiter, start); tokens.push_back(str.substr(start, end - start)); start = str.find_first_not_of(delimiter, end); } } int main(){ string directionList; // readin entire line getline(cin, directionList); vector<string> directions; tokeniser(directionList, ", ", directions); int x = 0; int y = 0; char previousDirection = 'L'; char currDir = 'L'; int magnitude; int modX = 1, modY =1; set<pair<int, int>> history; bool foundCrossOver = false; history.insert(make_pair(0,0)); pair<int, int> crossOver; for(int i = 0; i < (int)directions.size(); ++i){ cout << directions[i] << endl; cout << "x = " << x << endl; cout << "y = " << y << endl; sscanf(directions[i].c_str(), "%c%d", &currDir, &magnitude); if(i % 2== 0){ // affect x if(previousDirection == currDir){ modX *= -1; } x += modX * magnitude; } else{ // affect y if(previousDirection == currDir){ modY *= -1; } y += modY * magnitude; } previousDirection = currDir; auto newCoord = make_pair(x, y); if(!foundCrossOver && history.count(newCoord) > 0){ crossOver = newCoord; foundCrossOver = true; cout << "found crossover" << endl; } else{ history.insert(make_pair(x,y)); } cout << "x = " << x << endl; cout << "y = " << y << endl; } cout << abs(x) + abs(y) << "from 0 to end point" << endl; cout << abs(crossOver.first) + abs(crossOver.second) << "from first cross over to end" << endl; return 0; }
[ "pradyumn.vij@gmail.com" ]
pradyumn.vij@gmail.com
3432ad8e28f5cceaab4514197a2e659da627711b
dfa154d743b9c49b1e8277b0e419f51877b053f6
/client_service/source/msgappdata.cpp
17816c5f75ea09dc39f2ae2f7f61974f901fd74c
[]
no_license
Innovationzk/FlyingPigeon
a02da090f9e995ffd7f2ad11ab6547dce2643205
6b4c7fd3c7a78226923f48140cd00a3eed2989ec
refs/heads/master
2020-08-12T13:09:24.718414
2019-10-16T11:15:54
2019-10-16T11:15:54
214,773,314
0
0
null
null
null
null
UTF-8
C++
false
false
257
cpp
#include <msgappdata.h> #include <commondef.h> MsgAppData::MsgAppData() { } MsgAppData::~MsgAppData() { } void MsgAppData::setUserName(const std::string& name) { m_usrName = name; } std::string MsgAppData::getUserName() { return m_usrName; }
[ "765519067@qq.com" ]
765519067@qq.com
ceb27f095a548e4006cc562c8960a01ea3ac3764
2e86b13ef98923eb45ee4da540b10f69f0f2f453
/examples/RBM/SysCV/Cmodel/predict_mod/subfun_cppUpdateFun_index.cpp
0709947f35f6c74c0a9f7e7fb6d1a61f010a7f86
[ "MIT" ]
permissive
pramodsu/ILA-Tools
1dfd7e2282382a9f6870bf85deb77c460047b112
e76bd90cf356ada8dd6f848fb377f57c83322c71
refs/heads/master
2020-03-18T21:16:35.249306
2018-08-17T07:23:59
2018-08-17T07:23:59
135,271,196
1
3
MIT
2018-08-13T06:47:10
2018-05-29T09:14:21
C
UTF-8
C++
false
false
1,751
cpp
#include "common.hpp" #include "model_predict_class.hpp" BIT_VEC model_predict::cppUpdateFun_index(BIT_VEC conf_done, BIT_VEC conf_num_hidden, BIT_VEC conf_num_loops, BIT_VEC conf_num_movies, BIT_VEC conf_num_testusers, BIT_VEC conf_num_users, BIT_VEC conf_num_visible, BIT_VEC data_in, BIT_VEC rd_grant, BIT_VEC rst, BIT_VEC wr_grant) { BIT_VEC cppVar_1355; bool cppVar_1356; BIT_VEC cppVar_1358; bool cppVar_1359; BIT_VEC cppVar_1361; bool cppVar_1362; BIT_VEC cppVar_1364; bool cppVar_1365; BIT_VEC cppVar_1366; bool cppVar_1367; bool cppVar_1368; BIT_VEC cppVar_1370; BIT_VEC cppVar_1371; bool cppVar_1372; bool cppVar_1373; bool cppVar_1374; BIT_VEC cppVar_1375; BIT_VEC cppVar_1376; BIT_VEC cppVar_1369; BIT_VEC cppVar_1363; BIT_VEC cppVar_1360; BIT_VEC cppVar_1357; BIT_VEC cppVar_1354; cppVar_1356 = (predict_upc == 0); if (cppVar_1356) { cppVar_1354 = index; } else { cppVar_1359 = (predict_upc == 1); if (cppVar_1359) { cppVar_1357 = index; } else { cppVar_1362 = (predict_upc == 2); if (cppVar_1362) { cppVar_1365 = (wr_request == 0); cppVar_1367 = (wr_complete == 1); cppVar_1368 = cppVar_1365 && cppVar_1367; if (cppVar_1368) { cppVar_1371 = num_testusers - 1; cppVar_1371 = (cppVar_1371 & cppMask_un_16_); cppVar_1372 = (index == cppVar_1371); cppVar_1373 = (loop_count == num_loops); cppVar_1374 = cppVar_1372 && cppVar_1373; if (cppVar_1374) { cppVar_1369 = index; } else { cppVar_1376 = index + 1; cppVar_1376 = (cppVar_1376 & cppMask_un_16_); cppVar_1369 = cppVar_1376; } cppVar_1363 = cppVar_1369; } else { cppVar_1363 = index; } cppVar_1360 = cppVar_1363; } else { cppVar_1360 = index; } cppVar_1357 = cppVar_1360; } cppVar_1354 = cppVar_1357; } return cppVar_1354; }
[ "byhuang1992@gmail.com" ]
byhuang1992@gmail.com
cac3a783f37703aec8aa225721ff1d30508e6edf
7926b330515aa573a810ed9cb298c3de93b007f9
/源代码/DP比赛/对话.cpp
a31733952e881d431692b804068e27f185e79a22
[]
no_license
laijirong/NOIP-C-files
6f1dceae364e41625f3a4ef0e3897ef1c731d0fe
951af9aa0b287a8c169b6ba03d618ba8ba2e0ae2
refs/heads/master
2020-04-20T11:38:00.485181
2019-06-16T03:00:55
2019-06-16T03:00:55
168,822,282
0
0
null
null
null
null
UTF-8
C++
false
false
900
cpp
#include<cstdio> #include <cstring> using namespace std; char str[300]; int n,len; int l[10]; int rec[300],used[300]; char W[][7]={"input","output","in","out","one","puton"}; int check(int a,int b) { if(b<l[a]) return 0; for(int i=0;i<l[a];i++) if(str[b-i]!=W[a][l[a]-1-i]) return 0; return 1; } int dp(int a) { if(a==0) return 1; if(used[a]) return rec[a]; int t=0; for(int i=0;i<6;i++) if(check(i,a)&&dp(a-l[i])) {t=1;break;} used[a]=1; rec[a]=t; return t; } void doit() { scanf("%s",&str[1]); len=strlen(&str[1]); for(int i=1;i<=len;i++) rec[i]=used[i]=0; if(dp(len)) puts("YES"); else printf("%s\n","NO"); } int main() { freopen("10050.in","r",stdin); freopen("10050.out","w",stdout); for(int i=0;i<6;i++) l[i]=strlen(W[i]); scanf("%d",&n); for(int i=1;i<=n;i++) doit(); }
[ "laijirong@outlook.com" ]
laijirong@outlook.com
f0fa45e085b3a3d97f71a351ce61cb020db205e8
9cc9dd7384de913efc27d3fde5cfe154a4a18229
/Assignment1/candidate_eli.cpp
cdd1e94dae2000d543f65c68cd865cc658eb580b
[]
no_license
MuditPandey/Machine-Learning
39d81e9bec2c9c7a7ed8359fa704cf0dceb0355d
da08015e93ee646959d97dd83beab4f8378cfab0
refs/heads/master
2021-09-19T19:54:18.425744
2018-07-31T12:13:02
2018-07-31T12:13:02
104,564,900
0
1
null
null
null
null
UTF-8
C++
false
false
13,446
cpp
#include<bits/stdc++.h> #include<ctype.h> #include<string> #include<stdlib.h> using namespace std; vector<vector<int> > data; map<int,string> attribute_name; map<int,set<int> > attribute_val; bool vector_equal(vector<int> &,vector<int> &); void print_vv(vector<vector<int> > &); void print_v(vector<int> &); bool is_gen(vector<int> &,vector<int> &); void init(); void load_data(); bool consistent(vector<int> &, vector<int> &,int &); void candidate_elimination(vector<vector<int> > &,int &); vector<vector<int> > minimal_generlization(vector<int> ,vector<int> &,vector<vector<int> > &); vector<vector<int> > minimal_specialization(vector<int> ,vector<int> &,vector<vector<int> > &); bool check_valid(vector<vector<int> > &,vector<vector<int> > &, vector<vector< int> > &,int ); int main() { cout<<"Initializing...\n"; init(); cout<<"Done.\nLoading training data.\n"; load_data(); cout<<"Done\n"; for(int i=1;i<=7;i++) { //cout<<"For:"<<i<<endl; candidate_elimination(data,i); } return 0; } void candidate_elimination(vector<vector<int> > &training,int &class_val) { cout<<"***************************************** CLASS "<<class_val<<" ************************************************\n"; vector< vector<int> > Gen; vector< vector<int> > Spec; vector<int> G,S; for(int i=0;i<training[0].size()-1;i++) { G.push_back(-1); S.push_back(100); } Gen.push_back(G); Spec.push_back(S); //print_vv(training); for(int i=0;i<training.size();i++) { cout << i << "-> "; //cout<<"----------Training example:"<<i<<"---------------"<<endl; //cout<<"Training ex:"; //print_v(training[i]); if(training[i][training[i].size()-1]==class_val) { //Positive example //cout<<"Positive!"<<endl; for(int j=0;j<Gen.size();j++) { if(!consistent(Gen[j],training[i],class_val)) { //cout<<"Gen "; //print_v(Gen[j]); //cout<<" inconsistent!"<<endl; Gen.erase(Gen.begin()+j); j--; } } //cout<<"Gen: "; //print_vv(Gen); for(int p=0;p<Spec.size();p++) { if(!consistent(Spec[p],training[i],class_val)) { //Remove inconsistent Spec //cout<<"Spec inconsistent ..!"<<endl; vector<int> x=Spec[p]; //cout<<"Removing:"; //print_v(Spec[p]); //cout<<"\n"; Spec.erase(Spec.begin()+p); p--; //get minimal generalization vector<vector<int> > add=minimal_generlization(x,training[i],Gen); //print_vv(add); for(int j=0;j<add.size();j++) Spec.push_back(add[j]); //Remove from S any hypothesis that is more general than any other for(int j=0;j<Spec.size();j++) { for(int k=0;k<Spec.size();k++) { if(!vector_equal(Spec[j],Spec[k])) { if(is_gen(Spec[j],Spec[k])) { Spec.erase(Spec.begin()+j); j--; break; } } } } } //cout<<"Spec: "; //print_vv(Spec); } } else { //Negative example //cout<<"Negative!"<<endl; for(int j=0;j<Spec.size();j++) { if(!consistent(Spec[j],training[i],class_val)) { //cout<<"Spec "; // print_v(Spec[j]); //cout<<" inconsistent!"<<endl; Spec.erase(Spec.begin()+j); j--; } } for(int p=0;p<Gen.size();p++) { if(!consistent(Gen[p],training[i],class_val)) { //cout<<"Gen inconsistent ..!"<<endl; vector<int> x=Gen[p]; //cout<<"Removing:"; //print_v(Gen[p]); //cout<<"\n"; Gen.erase(Gen.begin()+p); p--; vector<vector<int> > add=minimal_specialization(x,training[i],Spec); //print_vv(add); for(int j=0;j<add.size();j++) Gen.push_back(add[j]); //Remove from G any hypothesis less general than any in G for(int j=0;j<Gen.size();j++) { for(int k=0;k<Gen.size();k++) { if(!vector_equal(Gen[j],Gen[k])) { if(is_gen(Gen[j],Gen[k])) { //cout<<"Removing less gen: "; //print_v(Gen[k]); //cout<<endl; Gen.erase(Gen.begin()+k); k--; break; } } } } } } } if(Gen.empty() || Spec.empty()) { cout<<"\nHypothesis not in hypothesis space for class " << class_val << endl; return; } //cout << "gen: " << Gen.size() << ", spec: " << Spec.size() << endl; //cout<<"Gen_fin:"; //print_vv(Gen); //cout<<"Spec_fin:"; //print_vv(Spec); } cout << "\n-------------------RESULTS---------------------------" << endl; cout<<"G="<<Gen.size()<<" S="<<Spec.size()<<endl; cout<<"GEN:"; print_vv(Gen); cout<<"SPEC:"; print_vv(Spec); if(check_valid(Spec,Gen,training,class_val)) { cout<<"VALID RESULT!\n"; } else cout<<"INVALID RESULT!\n"; } bool is_gen(vector<int> &hypot1,vector<int> &hypot2) { //Checks if hypot1 is more general than hypot2 if(hypot1.size()!=hypot2.size()) { cout<<"Hypothesis of different sizes!"<<endl; return false; } bool gen=true; for(int i=0;i<hypot1.size();i++) { if(hypot1[i]==-1 || hypot2[i]==100) continue; if(hypot1[i]!=hypot2[i]) { gen=false; break; } } return gen; } vector<vector<int> > minimal_generlization(vector<int> hypothesis,vector<int> &example,vector<vector<int> > &Gen) { //return all minimal generalizations of hypothesis consistent with example //cout<<"Min-gen"<<endl; for(int i=0;i<hypothesis.size();i++) { if(hypothesis[i]==100) hypothesis[i]=example[i]; if(hypothesis[i]==-1) continue; if(hypothesis[i]!=example[i]) { hypothesis[i]=-1; } } vector<vector<int> > ret; bool add=false; for(int i=0;i<Gen.size();i++) { if(is_gen(Gen[i],hypothesis)) { add=true; break; } } if(add) ret.push_back(hypothesis); return ret; } vector<vector<int> > minimal_specialization(vector<int> hypothesis,vector<int> &example,vector<vector<int> > &Spec) { //return all minimal specializations of hypothesis consistent with example //cout<<"Min-spec"<<endl; vector<vector<int> > ret; for(int i=0;i<hypothesis.size();i++) { if(hypothesis[i]==example[i]) continue; if(hypothesis[i]==-1) { for(set<int>::iterator it=attribute_val[i].begin();it!=attribute_val[i].end();it++) { vector<int> add=hypothesis; if(example[i]!=*it) { add[i]=*it; bool flag=false; for(int i=0;i<Spec.size();i++) { if(is_gen(add,Spec[i])) { flag=true; break; } } if(flag) ret.push_back(add); continue; } } } } return ret; } bool consistent(vector<int> &hypothesis, vector<int> &ex,int &target_class) { //cout<<"hypo:"; //print_v(hypothesis); //cout<<"example:"; // print_v(ex); if(ex.size()!=hypothesis.size()+1) { cout<<"Error in size of hypothesis and example!"<<endl; return false; } int result_class=ex[ex.size()-1]; bool cons=true; for(int i=0;i<hypothesis.size() && i<ex.size()-1;i++) { if(hypothesis[i]==-1) continue; if(hypothesis[i]!=ex[i]) { cons=false; break; } } if((result_class==target_class && cons) || (result_class!=target_class && !cons)) return true; else return false; } void init() { attribute_name[0]="hair"; attribute_name[1]="feathers"; attribute_name[2]="eggs"; attribute_name[3]="milk"; attribute_name[4]="airborne"; attribute_name[5]="aquatic"; attribute_name[6]="predator"; attribute_name[7]="toothed"; attribute_name[8]="backbone"; attribute_name[9]="breathes"; attribute_name[10]="venomous"; attribute_name[11]="fins"; attribute_name[12]="legs"; attribute_name[13]="tail"; attribute_name[14]="domestic"; attribute_name[15]="catsize"; attribute_name[16]="type"; set<int> add; add.insert(0); add.insert(1); attribute_val[0]=add; attribute_val[1]=add; attribute_val[2]=add; attribute_val[3]=add; attribute_val[4]=add; attribute_val[5]=add; attribute_val[6]=add; attribute_val[7]=add; attribute_val[8]=add; attribute_val[9]=add; attribute_val[10]=add; attribute_val[11]=add; attribute_val[13]=add; attribute_val[14]=add; attribute_val[15]=add; add.clear(); add.insert(0); add.insert(2); add.insert(4); add.insert(5); add.insert(6); add.insert(8); attribute_val[12]=add; add.clear(); add.insert(1); add.insert(2); add.insert(3); add.insert(4); add.insert(5); add.insert(6); add.insert(7); attribute_val[16]=add; } void print_vv(vector<vector<int> > &add) { for(int p=0;p<add.size();p++) { print_v(add[p]); cout<<endl; } } void print_v(vector<int> &add) { for(int p=0;p<add.size();p++) { if (add[p] == -1) cout << "?,"; else if (add[p] == 100) cout << "@,"; else cout<<add[p]<<","; } //cout<<endl; } bool vector_equal(vector<int> &a,vector<int> &b) { if(a.size()!=b.size()) return false; for(int i=0;i<a.size();i++) { if(a[i]!=b[i]) return false; } return true; } void load_data() { fstream fil; fil.open("zoo.txt",ios::in); string line; while(getline(fil,line)) { // cout<<line; vector<int> temp; int i=0; while(!isdigit(line[i]) && i<line.length()) i++; while(i<line.length()) { if(isdigit(line[i])) { char c[2]; c[0]=line[i]; c[1]=0; temp.push_back(atoi(c)); } i++; } // for(int i=0;i<temp.size();i++) // cout<<temp[i]<<","; //cout<<endl; data.push_back(temp); } fil.close(); } bool check_valid(vector<vector<int> > &Spec,vector<vector<int> > &Gen, vector<vector< int> > &training,int class_val) { for(int i=0;i<training.size();i++) { for(int j=0;j<Spec.size();j++) { if(!consistent(Spec[j],training[i],class_val)) { cout<<"Spec :"; print_v(Spec[j]); cout<<" inconsistent!\n"; return false; } } for(int j=0;j<Gen.size();j++) { if(!consistent(Gen[j],training[i],class_val)) { cout<<"Gen :"; print_v(Gen[j]); cout<<" inconsistent!\n"; return false; } } } return true; }
[ "noreply@github.com" ]
MuditPandey.noreply@github.com
fb9714aeb843b0571cacbeff69b239a154334394
1af49694004c6fbc31deada5618dae37255ce978
/ui/events/ozone/evdev/event_converter_test_util.cc
a60136c3f188ef416714c6a0c7c1b00f8b363178
[ "BSD-3-Clause" ]
permissive
sadrulhc/chromium
59682b173a00269ed036eee5ebfa317ba3a770cc
a4b950c23db47a0fdd63549cccf9ac8acd8e2c41
refs/heads/master
2023-02-02T07:59:20.295144
2020-12-01T21:32:32
2020-12-01T21:32:32
317,678,056
3
0
BSD-3-Clause
2020-12-01T21:56:26
2020-12-01T21:56:25
null
UTF-8
C++
false
false
5,041
cc
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ui/events/ozone/evdev/event_converter_test_util.h" #include <stdint.h> #include "ui/events/ozone/device/device_manager.h" #include "ui/events/ozone/evdev/device_event_dispatcher_evdev.h" #include "ui/events/ozone/evdev/event_factory_evdev.h" #include "ui/events/platform/platform_event_dispatcher.h" namespace ui { namespace { class TestDeviceManager : public ui::DeviceManager { public: TestDeviceManager() {} ~TestDeviceManager() override {} // DeviceManager: void ScanDevices(DeviceEventObserver* observer) override {} void AddObserver(DeviceEventObserver* observer) override {} void RemoveObserver(DeviceEventObserver* observer) override {} }; class TestDeviceEventDispatcherEvdev : public DeviceEventDispatcherEvdev { public: TestDeviceEventDispatcherEvdev(EventFactoryEvdev* event_factory_evdev) : event_factory_evdev_(event_factory_evdev) {} ~TestDeviceEventDispatcherEvdev() override {} // DeviceEventDispatcher: void DispatchKeyEvent(const KeyEventParams& params) override { event_factory_evdev_->DispatchKeyEvent(params); } void DispatchMouseMoveEvent(const MouseMoveEventParams& params) override { event_factory_evdev_->DispatchMouseMoveEvent(params); } void DispatchMouseButtonEvent(const MouseButtonEventParams& params) override { event_factory_evdev_->DispatchMouseButtonEvent(params); } void DispatchMouseWheelEvent(const MouseWheelEventParams& params) override { event_factory_evdev_->DispatchMouseWheelEvent(params); } void DispatchPinchEvent(const PinchEventParams& params) override { event_factory_evdev_->DispatchPinchEvent(params); } void DispatchScrollEvent(const ScrollEventParams& params) override { event_factory_evdev_->DispatchScrollEvent(params); } void DispatchTouchEvent(const TouchEventParams& params) override { event_factory_evdev_->DispatchTouchEvent(params); } void DispatchKeyboardDevicesUpdated( const std::vector<InputDevice>& devices) override { event_factory_evdev_->DispatchKeyboardDevicesUpdated(devices); } void DispatchTouchscreenDevicesUpdated( const std::vector<TouchscreenDevice>& devices) override { event_factory_evdev_->DispatchTouchscreenDevicesUpdated(devices); } void DispatchMouseDevicesUpdated(const std::vector<InputDevice>& devices, bool has_mouse, bool has_pointing_stick) override { event_factory_evdev_->DispatchMouseDevicesUpdated(devices, has_mouse, has_pointing_stick); } void DispatchTouchpadDevicesUpdated( const std::vector<InputDevice>& devices) override { event_factory_evdev_->DispatchTouchpadDevicesUpdated(devices); } void DispatchUncategorizedDevicesUpdated( const std::vector<InputDevice>& devices) override { event_factory_evdev_->DispatchUncategorizedDevicesUpdated(devices); } void DispatchDeviceListsComplete() override { event_factory_evdev_->DispatchDeviceListsComplete(); } void DispatchStylusStateChanged(StylusState stylus_state) override { event_factory_evdev_->DispatchStylusStateChanged(stylus_state); } void DispatchGamepadEvent(const GamepadEvent& event) override { event_factory_evdev_->DispatchGamepadEvent(event); } void DispatchGamepadDevicesUpdated( const std::vector<GamepadDevice>& devices) override { event_factory_evdev_->DispatchGamepadDevicesUpdated(devices); } private: EventFactoryEvdev* event_factory_evdev_; }; class TestEventFactoryEvdev : public EventFactoryEvdev { public: TestEventFactoryEvdev(CursorDelegateEvdev* cursor, DeviceManager* device_manager, KeyboardLayoutEngine* keyboard_layout_engine, const EventDispatchCallback& callback) : EventFactoryEvdev(cursor, device_manager, keyboard_layout_engine), callback_(callback) {} ~TestEventFactoryEvdev() override {} private: uint32_t DispatchEvent(PlatformEvent event) override { callback_.Run(event); return POST_DISPATCH_NONE; } const EventDispatchCallback callback_; }; } // namespace std::unique_ptr<DeviceEventDispatcherEvdev> CreateDeviceEventDispatcherEvdevForTest(EventFactoryEvdev* event_factory) { return std::make_unique<TestDeviceEventDispatcherEvdev>(event_factory); } std::unique_ptr<DeviceManager> CreateDeviceManagerForTest() { return std::make_unique<TestDeviceManager>(); } std::unique_ptr<EventFactoryEvdev> CreateEventFactoryEvdevForTest( CursorDelegateEvdev* cursor, DeviceManager* device_manager, KeyboardLayoutEngine* keyboard_layout_engine, const EventDispatchCallback& callback) { return std::make_unique<TestEventFactoryEvdev>( cursor, device_manager, keyboard_layout_engine, callback); } } // namespace ui
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
f0fab0ccf5cca0719fdd52649eda98b1cc0574b7
b4f1d7facba2f5a582fd23d135d573dcfbb3c260
/TrackballCamera.cpp
0213bdb288ec6e47da4db9aa47e7d6e822f13723
[]
no_license
JeremyAdamHart/HapticsSailing
0c33c02eec61e4724de36eed3ac6b250b262fae2
3a67819af6f8749e5dde5c8813ea88f6d86e1197
refs/heads/master
2020-12-24T21:22:51.602466
2020-01-08T22:46:42
2020-01-08T22:46:42
86,298,551
1
1
null
null
null
null
UTF-8
C++
false
false
2,389
cpp
#include "TrackballCamera.h" mat4 rotateAbout(vec3 axis, float radians) { mat4 matrix; matrix[0][0] = cos(radians) + axis.x*axis.x*(1 - cos(radians)); matrix[1][0] = axis.x*axis.y*(1 - cos(radians)) - axis.z*sin(radians); matrix[2][0] = axis.x*axis.z*(1 - cos(radians)) + axis.y*sin(radians); matrix[0][1] = axis.y*axis.x*(1 - cos(radians)) + axis.z*sin(radians); matrix[1][1] = cos(radians) + axis.y*axis.y*(1 - cos(radians)); matrix[2][1] = axis.y*axis.z*(1 - cos(radians)) - axis.x*sin(radians); matrix[0][2] = axis.z*axis.x*(1 - cos(radians)) - axis.y*sin(radians); matrix[1][2] = axis.z*axis.y*(1 - cos(radians)) + axis.x*sin(radians); matrix[2][2] = cos(radians) + axis.z*axis.z*(1 - cos(radians)); return matrix; } TrackballCamera::TrackballCamera() : dir(vec3(0, 0, -1)), right(vec3(1, 0, 0)), up(vec3(0, 1, 0)), pos(vec3(0, 0, 1.f)), center(vec3(0.f)){} TrackballCamera::TrackballCamera(vec3 _dir, vec3 _pos, const mat4 &projection) :dir(_dir), pos(_pos), center(vec3(0.f)), projection(projection){ right = normalize(cross(dir, vec3(0, -1, 0))); up = normalize(cross(right, dir)); } void TrackballCamera::trackballUp(float radians) { mat4 rotation = rotateAbout(right, -radians); vec4 newPos = rotation*vec4(pos, 1); pos = vec3(newPos.x, newPos.y, newPos.z); vec4 newUp = rotation*vec4(up, 1); up = normalize(vec3(newUp.x, newUp.y, newUp.z)); vec4 newDir = rotation*vec4(dir, 1); dir = normalize(vec3(newDir.x, newDir.y, newDir.z)); } void TrackballCamera::trackballRight(float radians) { mat4 rotation = rotateAbout(up, radians); vec4 newPos = rotation*vec4(pos, 1); pos = vec3(newPos.x, newPos.y, newPos.z); vec4 newRight = rotation*vec4(right, 1); right = normalize(vec3(newRight.x, newRight.y, newRight.z)); vec4 newDir = rotation*vec4(dir, 1); dir = normalize(vec3(newDir.x, newDir.y, newDir.z)); } void TrackballCamera::zoom(float factor) { pos = -dir*length(pos)*factor; } mat4 TrackballCamera::getCameraMatrix() const { mat4 cameraRotation = mat4( vec4(right, 0), vec4(up, 0), vec4(-dir, 0), vec4(0, 0, 0, 1)); mat4 translation = mat4( vec4(1, 0, 0, 0), vec4(0, 1, 0, 0), vec4(0, 0, 1, 0), vec4(-(pos + center), 1)); return transpose(cameraRotation)*translation; } mat4 TrackballCamera::getProjectionMatrix() const { return projection; } vec3 TrackballCamera::getPosition() const { return pos+center; }
[ "jeremyadamhart@gmail.com" ]
jeremyadamhart@gmail.com
f02cd3d86b464723eb5b62b38786d83cf7ce137f
7da7ee1ed863d4cd4cadef835b16d8950c6952d6
/AtCoder/regio2018/joi2016yo_a.cpp
d6cacc6fefc70096a567de36d2231ab65261a335
[]
no_license
rikuya6/ICPC_learning
8fd226bcd9f13f37a4d55d6de57702d0ed7182b8
d01e4c764f93f0330cc687365e3ac397e46f9559
refs/heads/master
2022-06-04T10:12:57.981280
2020-05-06T04:58:15
2020-05-06T04:58:15
52,092,562
0
0
null
2018-09-23T13:29:19
2016-02-19T14:20:22
C++
UTF-8
C++
false
false
305
cpp
#include <iostream> #include <algorithm> using namespace std; int main() { int a[4]; for (int i = 0; i < 4; i++) { cin >> a[i]; } sort(a, a + 4); int sum{}; for (int i = 1; i < 4; i++) { sum += a[i]; } int b1, b2; cin >> b1 >> b2; sum += max(b1, b2); cout << sum << endl; }
[ "rikuya6@gmail.com" ]
rikuya6@gmail.com
6516818112b4570ba65f869dff1511ad23ca955f
92a67f73581f2e5055397c27674b64a02383f4c1
/4.18 arraynew/arraynew.cpp
072800bab0d4d5cd46b1515d51fdbbf9886d1887
[]
no_license
Farrell0828/C-Plus-Plus-Primer-Plus
fb0fbc137eadb23f76a602c756f77edcacbe9e40
81c3328012193e8127d342cdbea12d40f677df00
refs/heads/master
2021-01-21T11:18:43.685333
2017-04-05T15:09:25
2017-04-05T15:09:25
83,550,434
1
1
null
null
null
null
UTF-8
C++
false
false
544
cpp
// arraynew.cpp -- pointer addition #include "iostream" int main() { using namespace std; double * p3 = new double[3]; p3[0] = 0.2; p3[1] = 0.5; p3[2] = 0.8; cout << "p3[1] is " << p3[1] << ".\n"; p3 = p3 + 1; cout << "Now, p3[0] is " << p3[0] << " and p3[1] is " << p3[1] << ".\n"; p3 = p3 - 1; delete [] p3; // play time int * p4 = new int[3]; p4[0] = 1; p4[1] = 2; p4[2] = 3; cout << *p4 << endl; cout << p4[0] << endl << p4[1] << endl; p4++; cout << p4[0] << endl << p4[-1] << endl; p4--; delete [] p4; return 0; }
[ "mengfanqi0828@163.com" ]
mengfanqi0828@163.com
7b034731ef6fac7d297b003bccf7f32206542566
09eaf2b22ad39d284eea42bad4756a39b34da8a2
/ojs/codeforces/666/B/B.cpp
63d1d33579370b08eedf4996e2a786b3a774e016
[]
no_license
victorsenam/treinos
186b70c44b7e06c7c07a86cb6849636210c9fc61
72a920ce803a738e25b6fc87efa32b20415de5f5
refs/heads/master
2021-01-24T05:58:48.713217
2018-10-14T13:51:29
2018-10-14T13:51:29
41,270,007
2
0
null
null
null
null
UTF-8
C++
false
false
3,373
cpp
#include <bits/stdc++.h> using namespace std; typedef unsigned long long int ull; typedef long long int ll; #ifndef ONLINE_JUDGE #define DEBUG(...) {fprintf(stderr, __VA_ARGS__);} #else #define DEBUG(...) {} #endif const int N = 3007; const int M = 10000; int hd[N], to[M], nx[M], es; int dist[N][N]; int mds[N][5], lds[N][5]; int n, m; int pr[4]; int qi, qf; int qu[N]; int aux[N]; int r[5], v[5]; int main () { scanf("%d %d", &n, &m); es = 2; for (int i = 0; i < m; i++) { int a, b; scanf("%d %d", &a, &b); a--; b--; nx[es] = hd[a]; to[es] = b; hd[a] = es++; //nx[es] = hd[b]; to[es] = a; hd[b] = es++; } for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) dist[i][j] = INT_MAX; for (int i = 0; i < n; i++) { dist[i][i] = 0; qi = qf = 0; qu[qf++] = i; while (qi < qf) { int u = qu[qi++]; for (int ed = hd[u]; ed; ed = nx[ed]) { if (dist[i][to[ed]] != INT_MAX) continue; dist[i][to[ed]] = dist[i][u] + 1; qu[qf++] = to[ed]; } } } for (int i = 0; i < n; i++) aux[i] = i; for (int i = 0; i < n; i++) { int qt = n; for (int j = 0; j < qt; j++) if (dist[i][aux[j]] == INT_MAX) { --qt; swap(aux[j], aux[qt]); --j; } for (int k = 0; k < 4; k++) for (int j = k+1; j < qt; j++) if (dist[i][aux[j]] > dist[i][aux[k]]) swap(aux[j], aux[k]); for (int k = 0; k < 4; k++) mds[i][k] = aux[k]; } for (int i = 0; i < n; i++) { int qt = n; for (int j = 0; j < qt; j++) if (dist[aux[j]][i] == INT_MAX) { --qt; swap(aux[j], aux[qt]); --j; } for (int k = 0; k < 4; k++) for (int j = k+1; j < qt; j++) if (dist[aux[j]][i] > dist[aux[k]][i]) swap(aux[j], aux[k]); for (int k = 0; k < 4; k++) lds[i][k] = aux[k]; } int res = 0; for (int u = 0; u < n; u++) { for (int w = 0; w < n; w++) { for (int b = 0; b < 4; b++) { for (int c = 0; c < 4; c++) { v[0] = lds[u][b]; v[1] = u; v[2] = w; v[3] = mds[v[2]][c]; bool ok = 1; for (int i = 1; ok && i < 4; i++) if (dist[v[i-1]][v[i]] == INT_MAX) ok = 0; for (int i = 0; ok && i < 4; i++) for (int j = 0; ok && j < i; j++) ok = (v[i] != v[j]); if (!ok) continue; int loc = 0; for (int i = 1; i < 4; i++) loc += dist[v[i-1]][v[i]]; if (loc > res) { res = loc; for (int i = 0; i < 4; i++) pr[i] = v[i]; } } } } } DEBUG("%d\n", res); for (int k = 0; k < 4; k++) printf("%d ", pr[k]+1); printf("\n"); }
[ "victorsenam@gmail.com" ]
victorsenam@gmail.com
9d1578881ca2f7ee8e07532733ee966019e368b9
947d8cc7b8c180c765810d48704ffc2d06956841
/src/plugins/polymesh/ui/generic_mesh.cpp
506caa0af639eea441a741aa0a006ca51c4daf10
[ "MIT" ]
permissive
yangjiang123/possumwood
c82b7a18eabe77aa87f9767336348acf3cf02111
91b1844b9fb0e7952a8a9170508ec4c03168b25e
refs/heads/master
2022-07-01T04:44:35.687225
2020-05-10T14:29:22
2020-05-10T14:29:22
267,554,460
1
0
null
2020-05-28T09:58:17
2020-05-28T09:58:16
null
UTF-8
C++
false
false
3,129
cpp
#include "generic_mesh.h" #include <QHBoxLayout> #include <QVBoxLayout> #include <QFormLayout> #include <QDialog> #include <QTreeWidget> #include <QHeaderView> #include <dependency_graph/rtti.h> GenericMeshUI::GenericMeshUI() { m_widget = new QWidget(); QHBoxLayout* layout = new QHBoxLayout(m_widget); layout->setContentsMargins(0,0,0,0); m_label = new QLabel(m_widget); layout->addWidget(m_label, 1); m_detailsButton = new QToolButton(m_widget); m_detailsButton->setText("..."); layout->addWidget(m_detailsButton); QAbstractButton::connect(m_detailsButton, &QToolButton::pressed, [this]() { QDialog* dialog = new QDialog(m_widget); dialog->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); dialog->setWindowTitle("Generic mesh details..."); QVBoxLayout* layout = new QVBoxLayout(dialog); QTreeWidget* tree = new QTreeWidget(dialog); tree->headerItem()->setText(1, "asfd"); tree->header()->hide(); layout->addWidget(tree, 1); { QTreeWidgetItem* item = new QTreeWidgetItem(tree); item->setText(0, "Vertex attributes"); item->setFirstColumnSpanned(true); for(auto& i : m_vertexAttrs) { QTreeWidgetItem* elem = new QTreeWidgetItem(); elem->setText(0, i.first.c_str()); elem->setText(1, dependency_graph::unmangledName(i.second.c_str()).c_str()); item->addChild(elem); } } { QTreeWidgetItem* item = new QTreeWidgetItem(tree); item->setText(0, "Index attributes"); item->setFirstColumnSpanned(true); for(auto& i : m_indexAttrs) { QTreeWidgetItem* elem = new QTreeWidgetItem(); elem->setText(0, i.first.c_str()); elem->setText(1, dependency_graph::unmangledName(i.second.c_str()).c_str()); item->addChild(elem); } } { QTreeWidgetItem* item = new QTreeWidgetItem(tree); item->setText(0, "Polygon attributes"); item->setFirstColumnSpanned(true); for(auto& i : m_polyAttrs) { QTreeWidgetItem* elem = new QTreeWidgetItem(); elem->setText(0, i.first.c_str()); elem->setText(1, dependency_graph::unmangledName(i.second.c_str()).c_str()); item->addChild(elem); } } tree->expandAll(); dialog->adjustSize(); dialog->show(); QDialog::connect(dialog, &QDialog::finished, [dialog]() { dialog->deleteLater(); }); }); } GenericMeshUI::~GenericMeshUI() { } void GenericMeshUI::get(possumwood::polymesh::GenericPolymesh& value) const { assert(false); } void GenericMeshUI::set(const possumwood::polymesh::GenericPolymesh& value) { std::stringstream text; text << value.vertices().size() << " vertices, " << value.polygons().size() << " polygons"; m_label->setText(text.str().c_str()); m_vertexAttrs.clear(); for(auto& h : value.vertices().handles()) m_vertexAttrs.push_back(std::make_pair(h.name(), h.type().name())); m_indexAttrs.clear(); for(auto& h : value.indices().handles()) m_indexAttrs.push_back(std::make_pair(h.name(), h.type().name())); m_polyAttrs.clear(); for(auto& h : value.polygons().handles()) m_polyAttrs.push_back(std::make_pair(h.name(), h.type().name())); } QWidget* GenericMeshUI::widget() { return m_widget; }
[ "martin.prazak@gmail.com" ]
martin.prazak@gmail.com
6ce70a9ee0ea9982cb61d9a40a8ff2eef8372967
76859f325589b72fbb1c4bf8678505cf64a62334
/src/lib/cstdmf/timestamp.hpp
575ffdfd4690af1a4714852eaa7f0716fcb2c38c
[]
no_license
yf885188/BigWorld-Engine-1.9.1
267d3d24c29e414308143d3b2440cd4255ec4557
e9d5a56739eb20c0c6973653a1342000e9f699be
refs/heads/master
2023-08-29T17:12:16.985405
2021-11-18T06:41:31
2021-11-18T06:41:31
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,601
hpp
/****************************************************************************** BigWorld Technology Copyright BigWorld Pty, Ltd. All Rights Reserved. Commercial in confidence. WARNING: This computer program is protected by copyright law and international treaties. Unauthorized use, reproduction or distribution of this program, or any portion of this program, may result in the imposition of civil and criminal penalties as provided by law. ******************************************************************************/ #ifndef TIMESTAMP_H #define TIMESTAMP_H #include "cstdmf/stdmf.hpp" #include "cstdmf/debug.hpp" // Indicates whether or not to use a call to RDTSC (Read Time Stamp Counter) // to calculate timestamp. The benefit of using this is that it is fast and // accurate, returning actual clock ticks. The downside is that this does not // work well with CPUs that use Speedstep technology to vary their clock speeds. #ifndef _XBOX360 #ifdef unix // #define BW_USE_RDTSC #else // unix # define BW_USE_RDTSC #endif // unix #endif // _XBOX360 /** * This function returns the processor's (real-time) clock cycle counter. */ #ifdef unix enum BWTimingMethod { RDTSC_TIMING_METHOD, GET_TIME_OF_DAY_TIMING_METHOD, GET_TIME_TIMING_METHOD, NO_TIMING_METHOD, }; extern BWTimingMethod g_timingMethod; inline uint64 timestamp_rdtsc() { uint64 ret; __asm__ __volatile__ ( // Read Time-Stamp Counter // loads current value of processor's timestamp counter into EDX:EAX "rdtsc": "=A" (ret) // output EDX:EAX->ret ); return ret; } // Alternate Linux implementation uses gettimeofday. In rough tests, this can // be between 20 and 600 times slower than using RDTSC. Also, there is a problem // under 2.4 kernels where two consecutive calls to gettimeofday may actually // return a result that goes backwards. #include <sys/time.h> inline uint64 timestamp_gettimeofday() { timeval tv; gettimeofday( &tv, NULL ); return 1000000ULL * uint64( tv.tv_sec ) + uint64( tv.tv_usec ); } #include <asm/unistd.h> inline uint64 timestamp_gettime() { timespec tv; // Using a syscall here so we don't have to link with -lrt MF_VERIFY(syscall( __NR_clock_gettime, CLOCK_MONOTONIC, &tv ) == 0); return 1000000000ULL * tv.tv_sec + tv.tv_nsec; } inline uint64 timestamp() { #ifdef BW_USE_RDTSC return timestamp_rdtsc(); #else // BW_USE_RDTSC if (g_timingMethod == RDTSC_TIMING_METHOD) return timestamp_rdtsc(); else if (g_timingMethod == GET_TIME_OF_DAY_TIMING_METHOD) return timestamp_gettimeofday(); else //if (g_timingMethod == GET_TIME_TIMING_METHOD) return timestamp_gettime(); #endif // BW_USE_RDTSC } #elif defined(_WIN32) #ifdef BW_USE_RDTSC #pragma warning (push) #pragma warning (disable: 4035) inline uint64 timestamp() { __asm rdtsc // MSVC complains about no return value here. // According to the help, this warning is 'harmless', and // they even have example code which does it. Go figure. } #pragma warning (pop) #else // BW_USE_RDTSC #ifdef _XBOX360 #include <xtl.h> #else // _XBOX360 #include <windows.h> #endif // _XBOX360 inline uint64 timestamp() { LARGE_INTEGER counter; QueryPerformanceCounter( &counter ); return counter.QuadPart; } #endif // BW_USE_RDTSC #elif defined( PLAYSTATION3 ) inline uint64 timestamp() { uint64 ts; SYS_TIMEBASE_GET( ts ); return ts; } #else #error Unsupported platform! #endif uint64 stampsPerSecond(); double stampsPerSecondD(); uint64 stampsPerSecond_rdtsc(); double stampsPerSecondD_rdtsc(); uint64 stampsPerSecond_gettimeofday(); double stampsPerSecondD_gettimeofday(); #endif // TIMESTAMP_H
[ "terran.erre@mail.ru" ]
terran.erre@mail.ru
bce4547a11c522e4a32149b94acc39c7789e2c9b
57b6fa831fe532cf0739135c77946f0061e3fbf5
/NWNXLib/API/Mac/API/CResDWK.hpp
d87141f727748f248aa7ab574bc498497c47143e
[ "MIT" ]
permissive
presscad/nwnee
dfcb90767258522f2b23afd9437d3dcad74f936d
0f36b281524e0b7e9796bcf30f924792bf9b8a38
refs/heads/master
2020-08-22T05:26:11.221042
2018-11-24T16:45:45
2018-11-24T16:45:45
216,326,718
1
0
MIT
2019-10-20T07:54:45
2019-10-20T07:54:45
null
UTF-8
C++
false
false
880
hpp
#pragma once #include <cstdint> #include "CRes.hpp" namespace NWNXLib { namespace API { struct CResDWK : CRes { int32_t m_bLoaded; uint32_t m_nDWKNormalSize; uint8_t* m_pDWKData; // The below are auto generated stubs. CResDWK(const CResDWK&) = default; CResDWK& operator=(const CResDWK&) = default; CResDWK(); ~CResDWK(); unsigned char* GetDWKDataPtr(); uint32_t GetDWKSize(); int32_t IsLoaded(); int32_t OnResourceFreed(); int32_t OnResourceServiced(); }; void CResDWK__CResDWKCtor__0(CResDWK* thisPtr); void CResDWK__CResDWKDtor__0(CResDWK* thisPtr); unsigned char* CResDWK__GetDWKDataPtr(CResDWK* thisPtr); uint32_t CResDWK__GetDWKSize(CResDWK* thisPtr); int32_t CResDWK__IsLoaded(CResDWK* thisPtr); int32_t CResDWK__OnResourceFreed(CResDWK* thisPtr); int32_t CResDWK__OnResourceServiced(CResDWK* thisPtr); } }
[ "liarethnwn@gmail.com" ]
liarethnwn@gmail.com
cd8585365f647808d1ba3b81057dc6d3a4015455
25b6de168b628156d5ae735e6f249f6829a8123e
/resource/cpp/primer-ppt/class10_code/28_文本查询程序.cpp
749c9544472c3c0c41d7a82a2bf10a3fe8935f43
[ "MIT" ]
permissive
yuenshome/yuenshome.github.io
58452b9c575bfa4617403f45f0c16930029dde3d
cf596441a90771d6e7cabb98a6b30cc572f594cd
refs/heads/master
2023-03-31T10:15:31.788985
2023-03-24T09:11:53
2023-03-24T09:11:53
109,459,702
87
18
null
null
null
null
GB18030
C++
false
false
3,429
cpp
//文本查询程序: 在一个给定的文件中查询单词 //查询结果以及输出:显示所有出现该单词的行号和行内容,以及出现行的次数。 //如果一个单词在一行中多次出现,那么该行只显示一次,也只计数一次。 #include <iostream> #include <string> #include <cstring> #include <vector> #include <map> #include <set> #include <memory> #include <sstream> #include <fstream> #include <algorithm> using namespace std; class QueryResult; ostream& print(ostream& out, const QueryResult &qr); class TextQuery { public: //根据文件生成相关需要的数据:按行保存文件到vector,建立单词到行号集合的映射 TextQuery(ifstream& ifs):file(make_shared<vector<string>>()) { //根据文件,构造 string text; while (getline(ifs, text)) { //一行一行读到 text中 (*file).push_back(text); //存入vector int n = (*file).size() - 1; //当前行号 istringstream line(text); //准备读该行的每个单词 string word; while (line >> word) { //该行中的每个单词,存入map(wm中) transform(word.begin(), word.end(), word.begin(), ::tolower); //转小写 shared_ptr<set<int>> &lines = wm[word]; //没有该单词,也会自动插入,但是此时value是空指针 if (!lines) lines.reset(new set<int>); //创建一个新的 set<int> (*lines).insert(n); //将此行号插入 set中 } } } void show()const { int i = 1; for (const auto& item : *file) //显示vector: cout << "(" << i++ << ") " << item << endl; for (const auto& item : wm) { //显示map: cout << item.first << "-->"; for (const auto& item1 : *item.second) cout << item1 << " "; cout << endl; } } QueryResult query(const string& sought)const; private: shared_ptr<vector<string>> file; //文件内容,每个元素都是一行,并且下标和行号对应 map<string, shared_ptr<set<int>>> wm; //单词 --> 保存行号的set 的映射 }; class QueryResult { friend ostream& print(ostream& out, const QueryResult &qr); public: QueryResult(const string& s, const shared_ptr<vector<string>>& f, const shared_ptr<set<int>> &p): sought(s),file(f),lines(p){} private: string sought; //查询的单词 shared_ptr<vector<string>> file; //文件内容 shared_ptr<set<int>> lines; //行号集合 }; //查询函数,输入单词,返回一个QueryResult对象 QueryResult TextQuery::query(const string& sought)const { //如果没有找到该单词,则返回下面这个 空set<int> static shared_ptr<set<int>> nodata = make_shared<set<int>>(); auto it = wm.find(sought); if (it != wm.end()) //找到了 return{ sought,file, (*it).second }; else return{ sought,file,nodata }; } ostream& print(ostream& out, const QueryResult &qr) { out << qr.sought << " 共在 " << (*qr.lines).size() << " 行中出现:\n"; for (const auto& item : *qr.lines) cout << " (" << item + 1 << ") " << (*qr.file)[item] << endl; return out; } int main() { ifstream ifs("word_query.txt"); if (!ifs) { cout << "open error!\n"; return -1; } TextQuery tq(ifs); tq.show(); cout << "------------\n"; while (true) { cout << "\n输入要查找的单词 (输入q退出): "; string s; if (cin >> s && s != "q") { transform(s.begin(), s.end(), s.begin(), ::tolower); //转小写 print(cout, tq.query(s)); } else break; } }
[ "noreply@github.com" ]
yuenshome.noreply@github.com
092c9df410ca67fb0d4c058042fa442f74b103f0
7c0816ca98e46a0b2f90cb43ad3c805be9c96e8b
/BlendDemo/BlendDemo.cpp
9e161bbc261e2fcd6db4a8eacf4f417b0440dde8
[]
no_license
LihbGame/D3D11Demo
1f6f52177fe38e1d0f10b40baa9678d18be4118d
11d64b7d234b8dde160aa03941ff18bb6572d5cf
refs/heads/master
2020-06-16T08:13:39.786921
2019-07-14T13:26:58
2019-07-14T13:26:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
19,683
cpp
//*************************************************************************************** // BlendDemo.cpp by Frank Luna (C) 2011 All Rights Reserved. // // Demonstrates blending, HLSL clip(), and fogging. // // Controls: // Hold the left mouse button down and move the mouse to rotate. // Hold the right mouse button down to zoom in and out. // // Press '1' - Lighting only render mode. // Press '2' - Texture render mode. // Press '3' - Fog render mode. // //*************************************************************************************** #include "d3dApp.h" #include "d3dx11Effect.h" #include "GeometryGenerator.h" #include "MathHelper.h" #include "LightHelper.h" #include "Effects.h" #include "Vertex.h" #include "RenderStates.h" #include "Waves.h" #include "ShaderCompiler.h" enum RenderOptions { Lighting = 0, Textures = 1, TexturesAndFog = 2 }; struct ConstBuffers { DirectionalLight mDirLights[3]; XMFLOAT3 EyePos; float gFogStart; float gFogRange; XMFLOAT4 gFogColor; XMFLOAT4X4 gWorld; XMFLOAT4X4 gWorldInvTranspose; XMFLOAT4X4 gWorldViewProj; XMFLOAT4X4 gTexTransform; Material gMaterial; }; class BlendApp : public D3DApp { public: BlendApp(HINSTANCE hInstance); ~BlendApp(); bool Init(); void OnResize(); void UpdateScene(float dt); void DrawScene(); void OnMouseDown(WPARAM btnState, int x, int y); void OnMouseUp(WPARAM btnState, int x, int y); void OnMouseMove(WPARAM btnState, int x, int y); private: float GetHillHeight(float x, float z)const; XMFLOAT3 GetHillNormal(float x, float z)const; void BuildLandGeometryBuffers(); void BuildWaveGeometryBuffers(); void BuildCrateGeometryBuffers(); void CreateConstBuffer(); private: ID3D11Buffer* mLandVB; ID3D11Buffer* mLandIB; ID3D11Buffer* mWavesVB; ID3D11Buffer* mWavesIB; ID3D11Buffer* mBoxVB; ID3D11Buffer* mBoxIB; ID3D11ShaderResourceView* mGrassMapSRV; ID3D11ShaderResourceView* mWavesMapSRV; ID3D11ShaderResourceView* mBoxMapSRV; Waves mWaves; DirectionalLight mDirLights[3]; Material mLandMat; Material mWavesMat; Material mBoxMat; XMFLOAT4X4 mGrassTexTransform; XMFLOAT4X4 mWaterTexTransform; XMFLOAT4X4 mLandWorld; XMFLOAT4X4 mWavesWorld; XMFLOAT4X4 mBoxWorld; XMFLOAT4X4 mView; XMFLOAT4X4 mProj; UINT mLandIndexCount; XMFLOAT2 mWaterTexOffset; RenderOptions mRenderOptions; XMFLOAT3 mEyePosW; float mTheta; float mPhi; float mRadius; POINT mLastMousePos; ID3D11Buffer* m_ConstBuffer; ConstBuffers mConstBuf; ID3D11SamplerState* m_pAnisotropySampler; }; int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, PSTR cmdLine, int showCmd) { // Enable run-time memory check for debug builds. #if defined(DEBUG) | defined(_DEBUG) _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); #endif BlendApp theApp(hInstance); if( !theApp.Init() ) return 0; return theApp.Run(); } BlendApp::BlendApp(HINSTANCE hInstance) : D3DApp(hInstance), mLandVB(0), mLandIB(0), mWavesVB(0), mWavesIB(0), mBoxVB(0), mBoxIB(0), mGrassMapSRV(0), mWavesMapSRV(0), mBoxMapSRV(0), mWaterTexOffset(0.0f, 0.0f), mEyePosW(0.0f, 0.0f, 0.0f), mLandIndexCount(0), mRenderOptions(RenderOptions::TexturesAndFog), mTheta(1.3f*MathHelper::Pi), mPhi(0.4f*MathHelper::Pi), mRadius(80.0f) { mMainWndCaption = L"Blend Demo"; mEnable4xMsaa = false; mLastMousePos.x = 0; mLastMousePos.y = 0; XMMATRIX I = XMMatrixIdentity(); XMStoreFloat4x4(&mLandWorld, I); XMStoreFloat4x4(&mWavesWorld, I); XMStoreFloat4x4(&mView, I); XMStoreFloat4x4(&mProj, I); XMMATRIX boxScale = XMMatrixScaling(15.0f, 15.0f, 15.0f); XMMATRIX boxOffset = XMMatrixTranslation(8.0f, 5.0f, -15.0f); XMStoreFloat4x4(&mBoxWorld, boxScale*boxOffset); XMMATRIX grassTexScale = XMMatrixScaling(5.0f, 5.0f, 0.0f); XMStoreFloat4x4(&mGrassTexTransform, grassTexScale); mDirLights[0].Ambient = XMFLOAT4(0.2f, 0.2f, 0.2f, 1.0f); mDirLights[0].Diffuse = XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f); mDirLights[0].Specular = XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f); mDirLights[0].Direction = XMFLOAT3(0.57735f, -0.57735f, 0.57735f); mDirLights[1].Ambient = XMFLOAT4(0.0f, 0.0f, 0.0f, 1.0f); mDirLights[1].Diffuse = XMFLOAT4(0.20f, 0.20f, 0.20f, 1.0f); mDirLights[1].Specular = XMFLOAT4(0.25f, 0.25f, 0.25f, 1.0f); mDirLights[1].Direction = XMFLOAT3(-0.57735f, -0.57735f, 0.57735f); mDirLights[2].Ambient = XMFLOAT4(0.0f, 0.0f, 0.0f, 1.0f); mDirLights[2].Diffuse = XMFLOAT4(0.2f, 0.2f, 0.2f, 1.0f); mDirLights[2].Specular = XMFLOAT4(0.0f, 0.0f, 0.0f, 1.0f); mDirLights[2].Direction = XMFLOAT3(0.0f, -0.707f, -0.707f); mLandMat.Ambient = XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f); mLandMat.Diffuse = XMFLOAT4(1.0f, 1.0f, 1.0f, 1.0f); mLandMat.Specular = XMFLOAT4(0.2f, 0.2f, 0.2f, 16.0f); mWavesMat.Ambient = XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f); mWavesMat.Diffuse = XMFLOAT4(1.0f, 1.0f, 1.0f, 0.5f); mWavesMat.Specular = XMFLOAT4(0.8f, 0.8f, 0.8f, 32.0f); mBoxMat.Ambient = XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f); mBoxMat.Diffuse = XMFLOAT4(1.0f, 1.0f, 1.0f, 1.0f); mBoxMat.Specular = XMFLOAT4(0.4f, 0.4f, 0.4f, 16.0f); } BlendApp::~BlendApp() { md3dImmediateContext->ClearState(); ReleaseCOM(mLandVB); ReleaseCOM(mLandIB); ReleaseCOM(mWavesVB); ReleaseCOM(mWavesIB); ReleaseCOM(mBoxVB); ReleaseCOM(mBoxIB); ReleaseCOM(mGrassMapSRV); ReleaseCOM(mWavesMapSRV); ReleaseCOM(mBoxMapSRV); ReleaseCOM(m_ConstBuffer); Shader::DestroyAll(); InputLayouts::DestroyAll(); RenderStates::DestroyAll(); } bool BlendApp::Init() { if(!D3DApp::Init()) return false; mWaves.Init(160, 160, 1.0f, 0.03f, 5.0f, 0.3f); // Must init Effects first since InputLayouts depend on shader signatures. Shader::InitAll(); Shader::CreateAllShaders(md3dDevice); CreateConstBuffer(); InputLayouts::InitAll(md3dDevice); RenderStates::InitAll(md3dDevice); ID3D11Resource* texResource = nullptr; HR(DirectX::CreateDDSTextureFromFile(md3dDevice, L"Textures/grass.dds", &texResource, &mGrassMapSRV)); ReleaseCOM(texResource); // view saves reference HR(DirectX::CreateDDSTextureFromFile(md3dDevice, L"Textures/water2.dds", &texResource, &mWavesMapSRV)); ReleaseCOM(texResource); // view saves reference HR(DirectX::CreateDDSTextureFromFile(md3dDevice, L"Textures/WireFence.dds", &texResource, &mBoxMapSRV)); ReleaseCOM(texResource); // view saves reference BuildLandGeometryBuffers(); BuildWaveGeometryBuffers(); BuildCrateGeometryBuffers(); D3D11_SAMPLER_DESC samplerDesc; samplerDesc.Filter = D3D11_FILTER_ANISOTROPIC; samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP; samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP; samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP; samplerDesc.MipLODBias = 0.0f; samplerDesc.MaxAnisotropy = 4; samplerDesc.ComparisonFunc = D3D11_COMPARISON_NEVER; samplerDesc.BorderColor[0] = 0.f; samplerDesc.BorderColor[1] = 0.f; samplerDesc.BorderColor[2] = 0.f; samplerDesc.BorderColor[3] = 0.f; samplerDesc.MinLOD = -D3D11_FLOAT32_MAX; samplerDesc.MaxLOD = D3D11_FLOAT32_MAX; md3dDevice->CreateSamplerState(&samplerDesc, &m_pAnisotropySampler); return true; } void BlendApp::OnResize() { D3DApp::OnResize(); XMMATRIX P = XMMatrixPerspectiveFovLH(0.25f*MathHelper::Pi, AspectRatio(), 1.0f, 1000.0f); XMStoreFloat4x4(&mProj, P); } void BlendApp::UpdateScene(float dt) { // Convert Spherical to Cartesian coordinates. float x = mRadius*sinf(mPhi)*cosf(mTheta); float z = mRadius*sinf(mPhi)*sinf(mTheta); float y = mRadius*cosf(mPhi); mEyePosW = XMFLOAT3(x, y, z); // Build the view matrix. XMVECTOR pos = XMVectorSet(x, y, z, 1.0f); XMVECTOR target = XMVectorZero(); XMVECTOR up = XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f); XMMATRIX V = XMMatrixLookAtLH(pos, target, up); XMStoreFloat4x4(&mView, V); // // Every quarter second, generate a random wave. // static float t_base = 0.0f; if( (mTimer.TotalTime() - t_base) >= 0.1f ) { t_base += 0.1f; DWORD i = 5 + rand() % (mWaves.RowCount()-10); DWORD j = 5 + rand() % (mWaves.ColumnCount()-10); float r = MathHelper::RandF(0.5f, 1.0f); mWaves.Disturb(i, j, r); } mWaves.Update(dt); // // Update the wave vertex buffer with the new solution. // D3D11_MAPPED_SUBRESOURCE mappedData; HR(md3dImmediateContext->Map(mWavesVB, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedData)); Vertex::Basic32* v = reinterpret_cast<Vertex::Basic32*>(mappedData.pData); for(UINT i = 0; i < mWaves.VertexCount(); ++i) { v[i].Pos = mWaves[i]; v[i].Normal = mWaves.Normal(i); // Derive tex-coords in [0,1] from position. v[i].Tex.x = 0.5f + mWaves[i].x / mWaves.Width(); v[i].Tex.y = 0.5f - mWaves[i].z / mWaves.Depth(); } md3dImmediateContext->Unmap(mWavesVB, 0); // // Animate water texture coordinates. // // Tile water texture. XMMATRIX wavesScale = XMMatrixScaling(5.0f, 5.0f, 0.0f); // Translate texture over time. mWaterTexOffset.y += 0.05f*dt; mWaterTexOffset.x += 0.1f*dt; XMMATRIX wavesOffset = XMMatrixTranslation(mWaterTexOffset.x, mWaterTexOffset.y, 0.0f); // Combine scale and translation. XMStoreFloat4x4(&mWaterTexTransform, wavesScale*wavesOffset); // // Switch the render mode based in key input. // if( GetAsyncKeyState('1') & 0x8000 ) mRenderOptions = RenderOptions::Lighting; if( GetAsyncKeyState('2') & 0x8000 ) mRenderOptions = RenderOptions::Textures; if( GetAsyncKeyState('3') & 0x8000 ) mRenderOptions = RenderOptions::TexturesAndFog; } void BlendApp::DrawScene() { md3dImmediateContext->ClearRenderTargetView(mRenderTargetView, reinterpret_cast<const float*>(&Colors::Silver)); md3dImmediateContext->ClearDepthStencilView(mDepthStencilView, D3D11_CLEAR_DEPTH|D3D11_CLEAR_STENCIL, 1.0f, 0); md3dImmediateContext->IASetInputLayout(InputLayouts::Basic32); md3dImmediateContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); float blendFactor[] = {0.0f, 0.0f, 0.0f, 0.0f}; UINT stride = sizeof(Vertex::Basic32); UINT offset = 0; XMMATRIX view = XMLoadFloat4x4(&mView); XMMATRIX proj = XMLoadFloat4x4(&mProj); XMMATRIX viewProj = view*proj; md3dImmediateContext->VSSetShader(Shader::pVSShader, NULL, 0); md3dImmediateContext->PSSetShader(Shader::pPSShader, NULL, 0); md3dImmediateContext->VSSetConstantBuffers(0, 1, &m_ConstBuffer); md3dImmediateContext->PSSetConstantBuffers(0, 1, &m_ConstBuffer); md3dImmediateContext->PSSetSamplers(0, 1, &m_pAnisotropySampler); md3dImmediateContext->PSSetShaderResources(0, 1, &mBoxMapSRV); XMMATRIX world = XMLoadFloat4x4(&mBoxWorld); XMMATRIX worldInvTranspose = MathHelper::InverseTranspose(world); XMMATRIX worldViewProj = world * view*proj; mConstBuf.mDirLights[0] = mDirLights[0]; mConstBuf.mDirLights[1] = mDirLights[1]; mConstBuf.mDirLights[2] = mDirLights[2]; mConstBuf.EyePos = mEyePosW; XMStoreFloat4(&mConstBuf.gFogColor,Colors::Silver); mConstBuf.gFogRange = 175.0f; mConstBuf.gFogStart = 15.0f; mConstBuf.gMaterial = mBoxMat; XMStoreFloat4x4(&mConstBuf.gTexTransform, XMMatrixIdentity()); mConstBuf.gWorld = mBoxWorld; XMStoreFloat4x4(&mConstBuf.gWorldInvTranspose, worldInvTranspose); XMStoreFloat4x4(&mConstBuf.gWorldViewProj, worldViewProj); md3dImmediateContext->UpdateSubresource(m_ConstBuffer, 0, NULL, &mConstBuf, 0, 0); md3dImmediateContext->IASetVertexBuffers(0, 1, &mBoxVB, &stride, &offset); md3dImmediateContext->IASetIndexBuffer(mBoxIB, DXGI_FORMAT_R32_UINT, 0); md3dImmediateContext->RSSetState(RenderStates::NoCullRS); md3dImmediateContext->DrawIndexed(36, 0, 0); // Restore default render state. md3dImmediateContext->RSSetState(0); // // Draw the hills and water with texture and fog (no alpha clipping needed). // //landAndWavesTech->GetDesc( &techDesc ); // for(UINT p = 0; p < techDesc.Passes; ++p) // { // // // // Draw the hills. // // // md3dImmediateContext->IASetVertexBuffers(0, 1, &mLandVB, &stride, &offset); // md3dImmediateContext->IASetIndexBuffer(mLandIB, DXGI_FORMAT_R32_UINT, 0); // // Set per object constants. // XMMATRIX world = XMLoadFloat4x4(&mLandWorld); // XMMATRIX worldInvTranspose = MathHelper::InverseTranspose(world); // XMMATRIX worldViewProj = world*view*proj; // // Effects::BasicFX->SetWorld(world); // Effects::BasicFX->SetWorldInvTranspose(worldInvTranspose); // Effects::BasicFX->SetWorldViewProj(worldViewProj); // Effects::BasicFX->SetTexTransform(XMLoadFloat4x4(&mGrassTexTransform)); // Effects::BasicFX->SetMaterial(mLandMat); // Effects::BasicFX->SetDiffuseMap(mGrassMapSRV); // landAndWavesTech->GetPassByIndex(p)->Apply(0, md3dImmediateContext); // md3dImmediateContext->DrawIndexed(mLandIndexCount, 0, 0); // // // // Draw the waves. // // // md3dImmediateContext->IASetVertexBuffers(0, 1, &mWavesVB, &stride, &offset); // md3dImmediateContext->IASetIndexBuffer(mWavesIB, DXGI_FORMAT_R32_UINT, 0); // // Set per object constants. // world = XMLoadFloat4x4(&mWavesWorld); // worldInvTranspose = MathHelper::InverseTranspose(world); // worldViewProj = world*view*proj; // // Effects::BasicFX->SetWorld(world); // Effects::BasicFX->SetWorldInvTranspose(worldInvTranspose); // Effects::BasicFX->SetWorldViewProj(worldViewProj); // Effects::BasicFX->SetTexTransform(XMLoadFloat4x4(&mWaterTexTransform)); // Effects::BasicFX->SetMaterial(mWavesMat); // Effects::BasicFX->SetDiffuseMap(mWavesMapSRV); // md3dImmediateContext->OMSetBlendState(RenderStates::TransparentBS, blendFactor, 0xffffffff); // landAndWavesTech->GetPassByIndex(p)->Apply(0, md3dImmediateContext); // md3dImmediateContext->DrawIndexed(3*mWaves.TriangleCount(), 0, 0); // // Restore default blend state // md3dImmediateContext->OMSetBlendState(0, blendFactor, 0xffffffff); // } HR(mSwapChain->Present(0, 0)); } void BlendApp::OnMouseDown(WPARAM btnState, int x, int y) { mLastMousePos.x = x; mLastMousePos.y = y; SetCapture(mhMainWnd); } void BlendApp::OnMouseUp(WPARAM btnState, int x, int y) { ReleaseCapture(); } void BlendApp::OnMouseMove(WPARAM btnState, int x, int y) { if( (btnState & MK_LBUTTON) != 0 ) { // Make each pixel correspond to a quarter of a degree. float dx = XMConvertToRadians(0.25f*static_cast<float>(x - mLastMousePos.x)); float dy = XMConvertToRadians(0.25f*static_cast<float>(y - mLastMousePos.y)); // Update angles based on input to orbit camera around box. mTheta += dx; mPhi += dy; // Restrict the angle mPhi. mPhi = MathHelper::Clamp(mPhi, 0.1f, MathHelper::Pi-0.1f); } else if( (btnState & MK_RBUTTON) != 0 ) { // Make each pixel correspond to 0.01 unit in the scene. float dx = 0.1f*static_cast<float>(x - mLastMousePos.x); float dy = 0.1f*static_cast<float>(y - mLastMousePos.y); // Update the camera radius based on input. mRadius += dx - dy; // Restrict the radius. mRadius = MathHelper::Clamp(mRadius, 20.0f, 500.0f); } mLastMousePos.x = x; mLastMousePos.y = y; } float BlendApp::GetHillHeight(float x, float z)const { return 0.3f*( z*sinf(0.1f*x) + x*cosf(0.1f*z) ); } XMFLOAT3 BlendApp::GetHillNormal(float x, float z)const { // n = (-df/dx, 1, -df/dz) XMFLOAT3 n( -0.03f*z*cosf(0.1f*x) - 0.3f*cosf(0.1f*z), 1.0f, -0.3f*sinf(0.1f*x) + 0.03f*x*sinf(0.1f*z)); XMVECTOR unitNormal = XMVector3Normalize(XMLoadFloat3(&n)); XMStoreFloat3(&n, unitNormal); return n; } void BlendApp::BuildLandGeometryBuffers() { GeometryGenerator::MeshData grid; GeometryGenerator geoGen; geoGen.CreateGrid(160.0f, 160.0f, 50, 50, grid); mLandIndexCount = grid.Indices.size(); // // Extract the vertex elements we are interested and apply the height function to // each vertex. // std::vector<Vertex::Basic32> vertices(grid.Vertices.size()); for(UINT i = 0; i < grid.Vertices.size(); ++i) { XMFLOAT3 p = grid.Vertices[i].Position; p.y = GetHillHeight(p.x, p.z); vertices[i].Pos = p; vertices[i].Normal = GetHillNormal(p.x, p.z); vertices[i].Tex = grid.Vertices[i].TexC; } D3D11_BUFFER_DESC vbd; vbd.Usage = D3D11_USAGE_IMMUTABLE; vbd.ByteWidth = sizeof(Vertex::Basic32) * grid.Vertices.size(); vbd.BindFlags = D3D11_BIND_VERTEX_BUFFER; vbd.CPUAccessFlags = 0; vbd.MiscFlags = 0; D3D11_SUBRESOURCE_DATA vinitData; vinitData.pSysMem = &vertices[0]; HR(md3dDevice->CreateBuffer(&vbd, &vinitData, &mLandVB)); // // Pack the indices of all the meshes into one index buffer. // D3D11_BUFFER_DESC ibd; ibd.Usage = D3D11_USAGE_IMMUTABLE; ibd.ByteWidth = sizeof(UINT) * mLandIndexCount; ibd.BindFlags = D3D11_BIND_INDEX_BUFFER; ibd.CPUAccessFlags = 0; ibd.MiscFlags = 0; D3D11_SUBRESOURCE_DATA iinitData; iinitData.pSysMem = &grid.Indices[0]; HR(md3dDevice->CreateBuffer(&ibd, &iinitData, &mLandIB)); } void BlendApp::BuildWaveGeometryBuffers() { // Create the vertex buffer. Note that we allocate space only, as // we will be updating the data every time step of the simulation. D3D11_BUFFER_DESC vbd; vbd.Usage = D3D11_USAGE_DYNAMIC; vbd.ByteWidth = sizeof(Vertex::Basic32) * mWaves.VertexCount(); vbd.BindFlags = D3D11_BIND_VERTEX_BUFFER; vbd.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; vbd.MiscFlags = 0; HR(md3dDevice->CreateBuffer(&vbd, 0, &mWavesVB)); // Create the index buffer. The index buffer is fixed, so we only // need to create and set once. std::vector<UINT> indices(3*mWaves.TriangleCount()); // 3 indices per face // Iterate over each quad. UINT m = mWaves.RowCount(); UINT n = mWaves.ColumnCount(); int k = 0; for(UINT i = 0; i < m-1; ++i) { for(DWORD j = 0; j < n-1; ++j) { indices[k] = i*n+j; indices[k+1] = i*n+j+1; indices[k+2] = (i+1)*n+j; indices[k+3] = (i+1)*n+j; indices[k+4] = i*n+j+1; indices[k+5] = (i+1)*n+j+1; k += 6; // next quad } } D3D11_BUFFER_DESC ibd; ibd.Usage = D3D11_USAGE_IMMUTABLE; ibd.ByteWidth = sizeof(UINT) * indices.size(); ibd.BindFlags = D3D11_BIND_INDEX_BUFFER; ibd.CPUAccessFlags = 0; ibd.MiscFlags = 0; D3D11_SUBRESOURCE_DATA iinitData; iinitData.pSysMem = &indices[0]; HR(md3dDevice->CreateBuffer(&ibd, &iinitData, &mWavesIB)); } void BlendApp::BuildCrateGeometryBuffers() { GeometryGenerator::MeshData box; GeometryGenerator geoGen; geoGen.CreateBox(1.0f, 1.0f, 1.0f, box); // // Extract the vertex elements we are interested in and pack the // vertices of all the meshes into one vertex buffer. // std::vector<Vertex::Basic32> vertices(box.Vertices.size()); for(UINT i = 0; i < box.Vertices.size(); ++i) { vertices[i].Pos = box.Vertices[i].Position; vertices[i].Normal = box.Vertices[i].Normal; vertices[i].Tex = box.Vertices[i].TexC; } D3D11_BUFFER_DESC vbd; vbd.Usage = D3D11_USAGE_IMMUTABLE; vbd.ByteWidth = sizeof(Vertex::Basic32) * box.Vertices.size(); vbd.BindFlags = D3D11_BIND_VERTEX_BUFFER; vbd.CPUAccessFlags = 0; vbd.MiscFlags = 0; D3D11_SUBRESOURCE_DATA vinitData; vinitData.pSysMem = &vertices[0]; HR(md3dDevice->CreateBuffer(&vbd, &vinitData, &mBoxVB)); // // Pack the indices of all the meshes into one index buffer. // D3D11_BUFFER_DESC ibd; ibd.Usage = D3D11_USAGE_IMMUTABLE; ibd.ByteWidth = sizeof(UINT) * box.Indices.size(); ibd.BindFlags = D3D11_BIND_INDEX_BUFFER; ibd.CPUAccessFlags = 0; ibd.MiscFlags = 0; D3D11_SUBRESOURCE_DATA iinitData; iinitData.pSysMem = &box.Indices[0]; HR(md3dDevice->CreateBuffer(&ibd, &iinitData, &mBoxIB)); } void BlendApp::CreateConstBuffer() { static D3D11_BUFFER_DESC desc = { sizeof(ConstBuffers), //ByteWidth D3D11_USAGE_DEFAULT, //Usage D3D11_BIND_CONSTANT_BUFFER, //BindFlags 0, //CPUAccessFlags 0 //MiscFlags }; md3dDevice->CreateBuffer(&desc, NULL, &m_ConstBuffer); }
[ "37478514+Lihongbo0512@users.noreply.github.com" ]
37478514+Lihongbo0512@users.noreply.github.com
2c3c7a996f7fe6c15c1a3ceb537c2bf82d8e9002
9af4a943495841107d57180632c16a20b2573f9d
/hw3d/Vertex.h
5682ce3fc58d889dab8cbf5b7fa340fa1a3a2d2c
[]
no_license
Seoui/DirectX11_Chili
5a205f49d69d70bd6e3fb9bf395cdcd6e72dd086
0777d594e84e8ba2179035681bb0542ca03b59ee
refs/heads/master
2023-02-06T01:20:18.849795
2020-12-23T00:17:58
2020-12-23T00:17:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,811
h
#pragma once #include <vector> #include <type_traits> #include "Graphics.h" #include "Color.h" #include "ConditionalNoexcept.h" namespace Dvtx { class VertexLayout { public: enum ElementType { Position2D, Position3D, Texture2D, Normal, Float3Color, Float4Color, BGRAColor, Count, }; template<ElementType> struct Map; template<> struct Map<Position2D> { using SysType = DirectX::XMFLOAT2; static constexpr DXGI_FORMAT dxgiFormat = DXGI_FORMAT_R32G32_FLOAT; static constexpr const char* semantic = "Position"; static constexpr const char* code = "P2"; }; template<> struct Map<Position3D> { using SysType = DirectX::XMFLOAT3; static constexpr DXGI_FORMAT dxgiFormat = DXGI_FORMAT_R32G32B32_FLOAT; static constexpr const char* semantic = "Position"; static constexpr const char* code = "P3"; }; template<> struct Map<Texture2D> { using SysType = DirectX::XMFLOAT2; static constexpr DXGI_FORMAT dxgiFormat = DXGI_FORMAT_R32G32_FLOAT; static constexpr const char* semantic = "Texcoord"; static constexpr const char* code = "T2"; }; template<> struct Map<Normal> { using SysType = DirectX::XMFLOAT3; static constexpr DXGI_FORMAT dxgiFormat = DXGI_FORMAT_R32G32B32_FLOAT; static constexpr const char* semantic = "Normal"; static constexpr const char* code = "N"; }; template<> struct Map<Float3Color> { using SysType = DirectX::XMFLOAT3; static constexpr DXGI_FORMAT dxgiFormat = DXGI_FORMAT_R32G32B32_FLOAT; static constexpr const char* semantic = "Color"; static constexpr const char* code = "C3"; }; template<> struct Map<Float4Color> { using SysType = DirectX::XMFLOAT4; static constexpr DXGI_FORMAT dxgiFormat = DXGI_FORMAT_R32G32B32A32_FLOAT; static constexpr const char* semantic = "Color"; static constexpr const char* code = "C4"; }; template<> struct Map<BGRAColor> { using SysType = ::BGRAColor; static constexpr DXGI_FORMAT dxgiFormat = DXGI_FORMAT_R8G8B8A8_UNORM; static constexpr const char* semantic = "Color"; static constexpr const char* code = "C8"; }; class Element { public: Element(ElementType type, size_t offset); size_t GetOffsetAfter() const noxnd; size_t GetOffset() const; size_t Size() const noxnd; static constexpr size_t SizeOf(ElementType type) noxnd; ElementType GetType() const noexcept; D3D11_INPUT_ELEMENT_DESC GetDesc() const noxnd; const char* GetCode() const noexcept; private: template<ElementType type> static constexpr D3D11_INPUT_ELEMENT_DESC GenerateDesc(size_t offset) noexcept { return { Map<type>::semantic,0,Map<type>::dxgiFormat,0,(UINT)offset,D3D11_INPUT_PER_VERTEX_DATA,0 }; } private: ElementType type; size_t offset; }; public: template<ElementType Type> const Element& Resolve() const noxnd { for (auto& e : elements) { if (e.GetType() == Type) { return e; } } assert("Could not resolve element type" && false); return elements.front(); } const Element& ResolveByIndex(size_t i) const noxnd; VertexLayout& Append(ElementType type) noxnd; size_t Size() const noxnd; size_t GetElementCount() const noexcept; std::vector<D3D11_INPUT_ELEMENT_DESC> GetD3DLayout() const noxnd; std::string GetCode() const noxnd; private: std::vector<Element> elements; }; class Vertex { friend class VertexBuffer; public: template<VertexLayout::ElementType Type> auto& Attr() noxnd { auto pAttribute = pData + layout.Resolve<Type>().GetOffset(); return *reinterpret_cast<typename VertexLayout::Map<Type>::SysType*>(pAttribute); } template<typename T> void SetAttributeByIndex(size_t i, T&& val) noxnd { const auto& element = layout.ResolveByIndex(i); auto pAttribute = pData + element.GetOffset(); switch (element.GetType()) { case VertexLayout::Position2D: SetAttribute<VertexLayout::Position2D>(pAttribute, std::forward<T>(val)); break; case VertexLayout::Position3D: SetAttribute<VertexLayout::Position3D>(pAttribute, std::forward<T>(val)); break; case VertexLayout::Texture2D: SetAttribute<VertexLayout::Texture2D>(pAttribute, std::forward<T>(val)); break; case VertexLayout::Normal: SetAttribute<VertexLayout::Normal>(pAttribute, std::forward<T>(val)); break; case VertexLayout::Float3Color: SetAttribute<VertexLayout::Float3Color>(pAttribute, std::forward<T>(val)); break; case VertexLayout::Float4Color: SetAttribute<VertexLayout::Float4Color>(pAttribute, std::forward<T>(val)); break; case VertexLayout::BGRAColor: SetAttribute<VertexLayout::BGRAColor>(pAttribute, std::forward<T>(val)); break; default: assert("Bad element type" && false); } } protected: Vertex(char* pData, const VertexLayout& layout) noxnd; private: // enables parameter pack setting of multiple parameters by element index template<typename First, typename ...Rest> void SetAttributeByIndex(size_t i, First&& first, Rest&&... rest) noxnd { SetAttributeByIndex(i, std::forward<First>(first)); SetAttributeByIndex(i + 1, std::forward<Rest>(rest)...); } // helper to reduce code duplication in SetAttributeByIndex template<VertexLayout::ElementType DestLayoutType, typename SrcType> void SetAttribute(char* pAttribute, SrcType&& val) noxnd { using Dest = typename VertexLayout::Map<DestLayoutType>::SysType; if constexpr (std::is_assignable<Dest, SrcType>::value) { *reinterpret_cast<Dest*>(pAttribute) = val; } else { assert("Parameter attribute type mismatch" && false); } } private: char* pData = nullptr; const VertexLayout& layout; }; class ConstVertex { public: ConstVertex(const Vertex& v) noxnd; template<VertexLayout::ElementType Type> const auto& Attr() const noxnd { return const_cast<Vertex&>(vertex).Attr<Type>(); } private: Vertex vertex; }; class VertexBuffer { public: VertexBuffer(VertexLayout layout, size_t size = 0u) noxnd; const char* GetData() const noxnd; const VertexLayout& GetLayout() const noexcept; void Resize(size_t newSize) noxnd; size_t Size() const noxnd; size_t SizeBytes() const noxnd; template<typename ...Params> void EmplaceBack(Params&&... params) noxnd { assert(sizeof...(params) == layout.GetElementCount() && "Param count doesn't match number of vertex elements"); buffer.resize(buffer.size() + layout.Size()); Back().SetAttributeByIndex(0u, std::forward<Params>(params)...); } Vertex Back() noxnd; Vertex Front() noxnd; Vertex operator[](size_t i) noxnd; ConstVertex Back() const noxnd; ConstVertex Front() const noxnd; ConstVertex operator[](size_t i) const noxnd; private: std::vector<char> buffer; VertexLayout layout; }; }
[ "dusto@naver.com" ]
dusto@naver.com
a7d0e5fcaa6104ac3e49a7fcac28063dd3550cc1
ac2f2177fc4709f3c94d66e29b5e140e62dcce80
/v1/PWM_signal.cpp
02d52fb097b10faaabcf3dc8e8db95ded1d8f397
[]
no_license
leojenns/touchless-safe-
53f11f8b4cbe6e001731f52390e9049b9b99d0db
d57f82b9cacf043775a140aa92cbea667874c705
refs/heads/master
2021-01-17T20:08:45.278640
2016-06-20T09:53:53
2016-06-20T09:53:53
59,851,145
0
0
null
null
null
null
UTF-8
C++
false
false
318
cpp
/* * File: PWM_signal.cpp * Author: Tim IJntema * * Created on 30 may 2016, 9:27 */ #include "PWM_signal.hpp" PWM_signal::PWM_signal(hwlib::target::pin_out & pwmPin): pwmPin(pwmPin) {} void PWM_signal::PWM_pulse(int pulseWidth){ pwmPin.set(1); hwlib::wait_us(pulseWidth); pwmPin.set(0); hwlib::wait_ms(20); }
[ "leo.jenns.s2@gmail.com" ]
leo.jenns.s2@gmail.com
0f1269e75ecc83575d45dd2add99a87765dfafd2
6d74cd38eeb0219e489417b0b9c654869e9a404f
/Experimental3/Framework/Source/ChairModel.cpp
aa36f8e2280251d13bcf6b1c43802c93b931b954
[]
no_license
z1ppo/COMP371-Project
12d94fc38bd2d7f22eb6ddde935c83e7b2b987fb
15a9d3c639166a917f372dbdad5a6edff5b017dd
refs/heads/master
2021-03-12T21:49:30.168232
2015-08-15T15:45:24
2015-08-15T15:45:24
39,193,484
0
2
null
2015-08-13T18:24:20
2015-07-16T11:35:49
C
UTF-8
C++
false
false
9,014
cpp
// // COMP 371 Assignment Framework // // Created by Nicolas Bergeron on 8/7/14. // Updated by Gary Chang on 14/1/15 // // Copyright (c) 2014-2015 Concordia University. All rights reserved. // #include "ChairModel.h" #include "objloader.hpp" #include "Renderer.h" //#include "texture.hpp" //#include "SOIL.h" #include "Camera.h" #include "World.h" // Include GLEW - OpenGL Extension Wrangler #include <GL/glew.h> using namespace glm; ChairModel::ChairModel(int shipTextureID) : Model() { // Create Vertex Buffer for all the verices of the Cube //Vertex vertexBuffer[] = loadOBJ("../Assets/Model/Chair.obj" ); // Create a vertex array mTextureID = shipTextureID; //bullet = new Projectile(vec3(5.0,5.0,0.0)); std::vector< glm::vec3 > vertices; std::vector< glm::vec2 > uvs; std::vector< glm::vec3 > normals; // Won't be used at the moment. bool res = loadOBJ("../Assets/Models/Ship1.obj", vertices, uvs, normals); glGenVertexArrays(1, &mVertexArrayID); // Upload Vertex Buffer to the GPU, keep a reference to it (mVertexBufferID) glGenBuffers(1, &mVertexBufferID); glBindBuffer(GL_ARRAY_BUFFER, mVertexBufferID); //glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), &vertices[0], GL_STATIC_DRAW); glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof(glm::vec3), &vertices[0], GL_STATIC_DRAW); GLuint uvbuffer; glGenBuffers(1, &uvbuffer); glBindBuffer(GL_ARRAY_BUFFER, uvbuffer); glBufferData(GL_ARRAY_BUFFER, uvs.size() * sizeof(glm::vec2), &uvs[0], GL_STATIC_DRAW); GLuint normalbuffer; glGenBuffers(1, &normalbuffer); glBindBuffer(GL_ARRAY_BUFFER, normalbuffer); glBufferData(GL_ARRAY_BUFFER, normals.size() * sizeof(glm::vec3), &normals[0], GL_STATIC_DRAW); } ChairModel::~ChairModel() { // Free the GPU from the Vertex Buffer glDeleteBuffers(1, &mVertexBufferID); glDeleteVertexArrays(1, &mVertexArrayID); } void ChairModel::Update(float dt) { // If you are curious, un-comment this line to have spinning cubes! // That will only work if your world transform is correct... // mRotationAngleInDegrees += 90 * dt; // spins by 90 degrees per second this->SetPosition(this->GetPosition()+(vec3(0,0,0.5)*dt)); bullet->Update(dt); Model::Update(dt); } void ChairModel::Draw() { // Draw the Vertex Buffer // Note this draws a unit Cube // The Model View Projection transforms are computed in the Vertex Shader bullet->Draw(); ShaderType oldShader = (ShaderType)Renderer::GetCurrentShader(); Renderer::SetShader(TEX_LIGHT2); Renderer::CheckForErrors(); glUseProgram(Renderer::GetShaderProgramID()); Renderer::CheckForErrors(); //bullet.Draw(); GLuint textureLocation = glGetUniformLocation(Renderer::GetShaderProgramID(), "mySamplerTexture"); Renderer::CheckForErrors(); glActiveTexture(GL_TEXTURE0); Renderer::CheckForErrors(); unsigned int programID = Renderer::GetShaderProgramID(); Renderer::CheckForErrors(); glBindTexture(GL_TEXTURE_2D, mTextureID); Renderer::CheckForErrors(); glUniform1i(textureLocation, 0); Renderer::CheckForErrors(); glBindVertexArray(mVertexArrayID); Renderer::CheckForErrors(); glBindVertexArray(uvbuffer); Renderer::CheckForErrors(); glBindVertexArray(normalbuffer); Renderer::CheckForErrors(); GLuint WorldMatrixLocation = glGetUniformLocation(Renderer::GetShaderProgramID(), "WorldTransform"); Renderer::CheckForErrors(); glUniformMatrix4fv(WorldMatrixLocation, 1, GL_FALSE, &GetWorldMatrix()[0][0]); Renderer::CheckForErrors(); GLuint VMatrixLocation = glGetUniformLocation(programID, "ViewTransform"); Renderer::CheckForErrors(); // Send the view projection constants to the shader const Camera* currentCamera = World::GetInstance()->GetCurrentCamera(); Renderer::CheckForErrors(); mat4 V = currentCamera->GetViewMatrix(); Renderer::CheckForErrors(); glUniformMatrix4fv(VMatrixLocation, 1, GL_FALSE, &V[0][0]); Renderer::CheckForErrors(); GLuint PMatrixLocation = glGetUniformLocation(programID, "ProjectionTransform"); Renderer::CheckForErrors(); mat4 P = currentCamera->GetProjectionMatrix(); Renderer::CheckForErrors(); glUniformMatrix4fv(PMatrixLocation, 1, GL_FALSE, &P[0][0]); Renderer::CheckForErrors(); // Get a handle for Light Attributes uniform GLuint LightPositionID = glGetUniformLocation(programID, "WorldLightPosition"); Renderer::CheckForErrors(); GLuint LightColorID = glGetUniformLocation(programID, "lightColor"); Renderer::CheckForErrors(); GLuint LightAttenuationID = glGetUniformLocation(programID, "lightAttenuation"); Renderer::CheckForErrors(); // Get a handle for Material Attributes uniform GLuint MaterialAmbientID = glGetUniformLocation(programID, "materialAmbient"); Renderer::CheckForErrors(); GLuint MaterialDiffuseID = glGetUniformLocation(programID, "materialDiffuse"); Renderer::CheckForErrors(); GLuint MaterialSpecularID = glGetUniformLocation(programID, "materialSpecular"); Renderer::CheckForErrors(); GLuint MaterialExponentID = glGetUniformLocation(programID, "materialExponent"); Renderer::CheckForErrors(); // Set shader constants const float ka = 0.2f; Renderer::CheckForErrors(); const float kd = 0.8f; Renderer::CheckForErrors(); const float ks = 0.2f; Renderer::CheckForErrors(); const float n = 90.0f; Renderer::CheckForErrors(); glUniform1f(MaterialAmbientID, ka); Renderer::CheckForErrors(); glUniform1f(MaterialDiffuseID, kd); Renderer::CheckForErrors(); glUniform1f(MaterialSpecularID, ks); Renderer::CheckForErrors(); glUniform1f(MaterialExponentID, n); Renderer::CheckForErrors(); vec3 lightColor = World::GetInstance()->lightColor; Renderer::CheckForErrors(); float lightKc = World::GetInstance()->lightKc; Renderer::CheckForErrors(); float lightKl = World::GetInstance()->lightKl; Renderer::CheckForErrors(); float lightKq = World::GetInstance()->lightKq; Renderer::CheckForErrors(); vec4 lightPosition = World::GetInstance()->lightPosition; Renderer::CheckForErrors(); glUniform4f(LightPositionID, lightPosition.x, lightPosition.y, lightPosition.z, lightPosition.w); Renderer::CheckForErrors(); glUniform3f(LightColorID, lightColor.r, lightColor.g, lightColor.b); Renderer::CheckForErrors(); glUniform3f(LightAttenuationID, lightKc, lightKl, lightKq); Renderer::CheckForErrors(); // 1st attribute buffer : vertex Positions glEnableVertexAttribArray(0); Renderer::CheckForErrors(); glBindBuffer(GL_ARRAY_BUFFER, mVertexBufferID); Renderer::CheckForErrors(); glVertexAttribPointer( 0, // attribute. No particular reason for 0, but must match the layout in the shader. 3, // size GL_FLOAT, // type GL_FALSE, // normalized? 0, // stride (void*)0 // array buffer offset ); Renderer::CheckForErrors(); // 2nd attribute buffer : vertex normal //glEnableVertexAttribArray(1); //glBindBuffer(GL_ARRAY_BUFFER, mVertexBufferID); //glVertexAttribPointer( 1, // 3, // GL_FLOAT, // GL_FALSE, // sizeof(Vertex), // (void*)sizeof(vec3) // Normal is Offseted by vec3 (see class Vertex) // ); glEnableVertexAttribArray(1); Renderer::CheckForErrors(); glBindBuffer(GL_ARRAY_BUFFER, normalbuffer); Renderer::CheckForErrors(); glVertexAttribPointer( 1, // attribute 3, // size GL_FLOAT, // type GL_FALSE, // normalized? 0, // stride (void*)0 // array buffer offset ); Renderer::CheckForErrors(); glEnableVertexAttribArray(2); Renderer::CheckForErrors(); glBindBuffer(GL_ARRAY_BUFFER, uvbuffer); Renderer::CheckForErrors(); glVertexAttribPointer( 2, // attribute 2, // size GL_FLOAT, // type GL_FALSE, // normalized? 0, // stride (void*)0 // array buffer offset ); Renderer::CheckForErrors(); // 3rd attribute buffer : vertex color //glEnableVertexAttribArray(2); //glBindBuffer(GL_ARRAY_BUFFER, mVertexBufferID); //glVertexAttribPointer( 2, // 2, // GL_FLOAT, // GL_FALSE, // sizeof(Vertex), // (void*) (2* sizeof(vec3)) // Color is Offseted by 2 vec3 (see class Vertex) // ); // Draw the triangles ! glDrawArrays(GL_TRIANGLES, 0, 7710); //856, 4398 36 vertices: 3 * 2 * 6 (3 per triangle, 2 triangles per face, 6 faces) //glDisableVertexAttribArray(3); Renderer::CheckForErrors(); glDisableVertexAttribArray(2); Renderer::CheckForErrors(); glDisableVertexAttribArray(1); Renderer::CheckForErrors(); glDisableVertexAttribArray(0); Renderer::CheckForErrors(); Renderer::SetShader(oldShader); } bool ChairModel::ParseLine(const std::vector<ci_string> &token) { if (token.empty()) { return true; } else { return Model::ParseLine(token); } }
[ "deziipo@gmail.com" ]
deziipo@gmail.com
1b7a74c2269dacfbd6a2c55cfadb872208f8a5bc
0dbf6f20cdd797ba0dc1f780232cde7d7134bedb
/Source/TP_Project/Public/TPSPowerupActor.h
234ced3b51f6ea826837b1ba3bdf7343aceac86f
[]
no_license
Sayedta91/TP_Project
bec69cd4ab12cfd26ca65b79a05875725cd8a5a4
47a050754bfa1049e0165cfb4448ce0c10d90e34
refs/heads/master
2020-04-23T22:45:27.677112
2019-05-03T14:14:00
2019-05-03T14:14:00
171,513,050
0
0
null
null
null
null
UTF-8
C++
false
false
1,099
h
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "TPSPowerupActor.generated.h" UCLASS() class TP_PROJECT_API ATPSPowerupActor : public AActor { GENERATED_BODY() public: // Sets default values for this actor's properties ATPSPowerupActor(); protected: // Called when the game starts or when spawned virtual void BeginPlay() override; // time between ticks UPROPERTY(EditDefaultsOnly, Category = "Powerup") float PowerupInterval; // total number of times we apply power up effect UPROPERTY(EditDefaultsOnly, Category = "Powerup") int32 NumberOfTicks; // total number of ticks applied int32 TicksProcessed; FTimerHandle TH_PowerUpTick; UFUNCTION() void OnTickPowerup(); public: void ActivatePowerup(); UFUNCTION(BlueprintImplementableEvent, Category = "Powerup") void OnActivated(); UFUNCTION(BlueprintImplementableEvent, Category = "Powerup") void OnPowerupTicked(); UFUNCTION(BlueprintImplementableEvent, Category = "Powerup") void OnExpired(); };
[ "sayedta91@gmail.com" ]
sayedta91@gmail.com
c1b845bfac0d9e81e81652a9d2625a751e5311ff
b367fe5f0c2c50846b002b59472c50453e1629bc
/xbox_leak_may_2020/xbox trunk/xbox/private/test/directx/dplay/testnet/tncontrl/masterlist.cpp
6ea1d54577816b833eb2d29b1d788abb1bc8fa1b
[]
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
3,182
cpp
#ifndef _XBOX // ! no master supported //================================================================================== // Includes //================================================================================== #include <windows.h> #include "..\tncommon\debugprint.h" #include "..\tncommon\cppobjhelp.h" #include "..\tncommon\linklist.h" #include "..\tncommon\linkedstr.h" #include "tncontrl.h" #include "main.h" #include "masterinfo.h" #include "masterlist.h" /* #undef DEBUG_SECTION #define DEBUG_SECTION "CTNMastersList::CTNMastersList()" //================================================================================== // CTNMastersList constructor //---------------------------------------------------------------------------------- // // Description: Creates the CTNMastersList object. Initializes the data structures. // // Arguments: None. // // Returns: None (just the object). //================================================================================== CTNMastersList::CTNMastersList(void) { DPL(0, "this = %x, sizeof (this) = %i", 2, this, sizeof (CTNMastersList)); } #undef DEBUG_SECTION #define DEBUG_SECTION "" #undef DEBUG_SECTION #define DEBUG_SECTION "CTNMastersList::~CTNMastersList()" //================================================================================== // CTNMastersList destructor //---------------------------------------------------------------------------------- // // Description: Destroys the CTNMastersList object and any memory it may have // allocated during its life. // // Arguments: None. // // Returns: None. //================================================================================== CTNMastersList::~CTNMastersList(void) { DPL(0, "this = %x", 1, this); } #undef DEBUG_SECTION #define DEBUG_SECTION "" */ #undef DEBUG_SECTION #define DEBUG_SECTION "CTNMastersList::GetMasterByID()" //================================================================================== // CTNMastersList::GetMasterByID //---------------------------------------------------------------------------------- // // Description: Returns a pointer to the CTNMasterInfo object identified by the // passed in ID. // // Arguments: // PTNCTRLMACHINEID pID Pointer to machine to look up. // // Returns: Pointer to object or NULL if couldn't find it. //================================================================================== PTNMASTERINFO CTNMastersList::GetMasterByID(PTNCTRLMACHINEID pID) { int i; PTNMASTERINFO pItem = NULL; this->EnterCritSection(); for(i = 0; i < this->Count(); i++) { pItem = (PTNMASTERINFO) this->GetItem(i); if (pItem == NULL) { DPL(0, "Couldn't retrieve master %i!", 1, i); this->LeaveCritSection(); return (NULL); } // end if (couldn't get that item) if (pItem->m_id.dwTime == pID->dwTime) { this->LeaveCritSection(); return (pItem); } // end if (we found the tester) } // end for (each tester) this->LeaveCritSection(); return (NULL); } #undef DEBUG_SECTION #define DEBUG_SECTION "" #endif // ! XBOX
[ "benjamin.barratt@icloud.com" ]
benjamin.barratt@icloud.com
ac2d57d92b510e7a6da794a9e6c198d768442e5f
d099ef4dbaace1d7d89994f2133bf0aa12f1d0b3
/_MODEL_FOLDERS_/o18/o18_INDICES.cpp
c7178e8a1d90b807a289517d37483a25389c2bf5
[]
no_license
marcclintdion/startHere_threadStable-4
e7bd701b547c4768c0d60467d31435447c251e21
d78b3a02c7b1b5007e8f54a58f96f64df1b088b6
refs/heads/master
2021-01-02T23:14:42.383781
2015-05-03T08:43:36
2015-05-03T08:43:36
39,881,209
0
0
null
null
null
null
UTF-8
C++
false
false
208,878
cpp
GLuint o18_INDICES[] = { //numberOfIndices = 34023 0, 1, 2, 3, 4, 5, 1, 0, 6, 7, 1, 8, 0, 4, 3, 9, 10, 11, 12, 13, 14, 15, 14, 13, 1, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 25, 24, 27, 7, 28, 2, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 5, 4, 47, 48, 49, 24, 50, 51, 52, 6, 0, 26, 5, 53, 49, 54, 55, 50, 56, 57, 58, 59, 60, 61, 14, 62, 63, 18, 20, 64, 9, 62, 14, 10, 9, 15, 63, 65, 12, 59, 66, 57, 67, 68, 69, 70, 71, 72, 73, 56, 74, 68, 75, 76, 55, 77, 50, 5, 78, 53, 79, 80, 81, 3, 26, 0, 14, 15, 9, 51, 82, 83, 48, 3, 5, 84, 85, 86, 87, 88, 89, 88, 90, 91, 37, 92, 86, 93, 36, 94, 87, 95, 90, 92, 37, 36, 91, 41, 96, 87, 97, 98, 99, 39, 46, 47, 100, 78, 101, 49, 102, 103, 104, 105, 72, 106, 107, 108, 109, 25, 110, 111, 112, 113, 110, 114, 110, 115, 116, 115, 110, 117, 118, 119, 120, 121, 122, 118, 123, 124, 125, 126, 127, 128, 129, 126, 128, 130, 131, 132, 132, 131, 133, 134, 130, 132, 135, 136, 137, 138, 139, 140, 141, 142, 143, 123, 144, 124, 142, 145, 143, 146, 147, 124, 148, 145, 149, 150, 151, 152, 124, 144, 146, 145, 142, 149, 153, 154, 155, 154, 150, 155, 156, 157, 158, 156, 158, 159, 141, 160, 161, 151, 150, 162, 163, 151, 162, 147, 146, 164, 147, 164, 165, 166, 167, 168, 148, 147, 165, 169, 170, 171, 172, 173, 174, 175, 173, 172, 176, 177, 178, 179, 178, 180, 179, 176, 178, 181, 182, 136, 129, 135, 137, 139, 136, 140, 136, 182, 183, 183, 137, 136, 161, 142, 141, 139, 181, 136, 184, 185, 186, 187, 149, 142, 188, 185, 184, 184, 189, 190, 186, 189, 184, 155, 191, 153, 192, 193, 194, 194, 195, 192, 194, 196, 195, 179, 196, 176, 178, 172, 197, 197, 172, 174, 180, 178, 197, 198, 199, 159, 198, 159, 200, 199, 156, 159, 201, 202, 203, 204, 205, 206, 207, 208, 209, 208, 210, 209, 211, 212, 213, 214, 215, 216, 216, 215, 212, 217, 218, 219, 220, 221, 222, 221, 223, 222, 213, 218, 211, 219, 218, 213, 224, 225, 226, 227, 228, 229, 227, 229, 230, 231, 232, 228, 233, 224, 226, 230, 229, 234, 234, 235, 230, 236, 227, 230, 224, 237, 225, 238, 239, 231, 227, 231, 228, 201, 240, 202, 241, 242, 243, 244, 245, 161, 245, 246, 247, 161, 245, 247, 243, 205, 204, 242, 246, 243, 248, 249, 130, 161, 160, 244, 246, 250, 247, 241, 243, 204, 246, 242, 250, 251, 248, 252, 134, 253, 248, 210, 254, 209, 255, 256, 166, 256, 164, 166, 166, 144, 123, 257, 258, 259, 144, 166, 146, 252, 260, 251, 249, 131, 130, 150, 154, 162, 255, 168, 261, 258, 262, 263, 209, 264, 207, 252, 163, 260, 248, 130, 134, 260, 163, 162, 258, 257, 262, 262, 264, 263, 264, 209, 263, 261, 254, 255, 168, 255, 166, 146, 166, 164, 253, 252, 248, 232, 231, 265, 226, 266, 233, 221, 220, 267, 268, 224, 233, 267, 265, 221, 223, 221, 171, 266, 214, 233, 239, 265, 231, 171, 269, 223, 269, 171, 170, 270, 271, 272, 271, 273, 274, 275, 271, 274, 276, 270, 272, 276, 272, 277, 278, 279, 280, 278, 280, 281, 280, 206, 281, 272, 282, 277, 206, 280, 204, 273, 271, 270, 283, 271, 275, 284, 285, 286, 287, 288, 289, 284, 290, 291, 286, 285, 217, 288, 287, 284, 292, 286, 217, 291, 288, 284, 217, 219, 292, 284, 286, 290, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 304, 303, 306, 307, 308, 307, 303, 308, 309, 310, 311, 312, 313, 314, 315, 314, 316, 317, 316, 314, 313, 318, 314, 311, 319, 320, 309, 315, 316, 321, 322, 323, 323, 322, 324, 325, 326, 327, 326, 325, 328, 298, 297, 329, 296, 330, 297, 331, 332, 333, 334, 329, 333, 329, 334, 298, 335, 336, 337, 319, 311, 310, 338, 339, 340, 329, 297, 333, 334, 333, 332, 308, 303, 302, 313, 295, 318, 315, 309, 311, 341, 342, 343, 342, 344, 343, 345, 323, 324, 346, 335, 337, 341, 332, 331, 337, 332, 346, 341, 343, 346, 332, 337, 334, 332, 341, 346, 337, 336, 334, 336, 298, 334, 347, 348, 349, 328, 350, 326, 351, 352, 348, 351, 353, 352, 353, 327, 352, 354, 355, 356, 357, 358, 359, 311, 360, 315, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 370, 372, 374, 367, 369, 375, 370, 369, 376, 377, 378, 379, 369, 378, 374, 380, 381, 382, 383, 384, 385, 384, 383, 367, 374, 381, 378, 368, 376, 386, 387, 388, 389, 390, 391, 392, 393, 394, 394, 393, 395, 394, 396, 392, 397, 398, 399, 400, 401, 402, 399, 403, 404, 405, 387, 404, 406, 396, 395, 407, 403, 392, 388, 405, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 421, 424, 425, 424, 426, 427, 423, 428, 429, 430, 431, 432, 433, 426, 424, 434, 435, 436, 437, 438, 439, 424, 421, 423, 440, 441, 442, 443, 441, 426, 427, 426, 441, 444, 413, 412, 427, 431, 425, 445, 416, 446, 447, 411, 410, 419, 418, 448, 435, 449, 450, 451, 452, 453, 454, 451, 455, 451, 456, 455, 457, 452, 458, 452, 451, 454, 459, 460, 461, 462, 463, 464, 430, 465, 466, 431, 466, 425, 414, 467, 468, 469, 470, 471, 435, 450, 462, 472, 438, 473, 418, 417, 412, 448, 418, 468, 464, 435, 462, 420, 436, 418, 474, 475, 476, 424, 477, 433, 478, 465, 430, 438, 472, 439, 416, 415, 435, 419, 476, 420, 479, 420, 476, 449, 435, 434, 480, 478, 430, 426, 433, 481, 472, 469, 471, 413, 444, 482, 483, 448, 468, 430, 432, 480, 439, 484, 480, 470, 450, 449, 419, 474, 476, 466, 420, 422, 392, 396, 447, 434, 478, 449, 412, 468, 418, 436, 466, 465, 478, 480, 484, 438, 437, 485, 466, 431, 430, 486, 487, 480, 415, 436, 435, 488, 487, 486, 469, 472, 473, 474, 448, 475, 438, 485, 473, 417, 444, 412, 422, 421, 425, 473, 485, 489, 412, 414, 468, 446, 416, 464, 436, 415, 418, 416, 444, 417, 471, 484, 472, 487, 439, 480, 470, 469, 490, 469, 473, 490, 427, 425, 424, 489, 485, 491, 444, 416, 482, 490, 489, 359, 473, 489, 490, 492, 454, 455, 460, 493, 494, 495, 496, 458, 328, 325, 497, 495, 454, 492, 496, 498, 458, 499, 500, 501, 460, 459, 493, 502, 498, 503, 504, 461, 460, 453, 452, 502, 505, 366, 506, 456, 451, 507, 508, 456, 507, 509, 492, 455, 364, 366, 362, 501, 363, 505, 510, 511, 512, 513, 510, 512, 501, 505, 499, 514, 506, 515, 499, 506, 514, 452, 457, 502, 506, 499, 505, 363, 501, 361, 479, 423, 422, 484, 471, 478, 466, 436, 420, 390, 389, 516, 410, 408, 407, 405, 388, 387, 403, 405, 404, 467, 517, 518, 428, 423, 479, 359, 489, 491, 396, 406, 447, 416, 445, 482, 475, 448, 519, 400, 397, 399, 382, 384, 367, 377, 376, 520, 447, 407, 392, 396, 394, 395, 415, 417, 418, 521, 522, 325, 478, 434, 465, 366, 505, 363, 366, 363, 362, 368, 367, 384, 380, 369, 370, 368, 384, 385, 376, 305, 520, 380, 374, 369, 370, 373, 380, 368, 378, 369, 378, 377, 379, 523, 492, 509, 502, 457, 458, 498, 461, 503, 441, 440, 486, 476, 428, 479, 400, 399, 404, 399, 398, 392, 471, 449, 478, 393, 392, 398, 422, 420, 479, 433, 477, 481, 518, 468, 467, 471, 470, 449, 427, 432, 431, 435, 464, 416, 425, 466, 422, 448, 483, 519, 428, 476, 475, 451, 453, 507, 441, 443, 442, 424, 524, 477, 525, 508, 507, 485, 526, 491, 522, 497, 325, 516, 389, 391, 527, 528, 503, 465, 434, 436, 405, 407, 408, 407, 405, 403, 474, 419, 448, 529, 530, 531, 532, 533, 534, 533, 535, 534, 536, 537, 538, 539, 532, 534, 540, 541, 542, 536, 538, 531, 539, 543, 544, 545, 546, 547, 548, 549, 532, 550, 551, 552, 553, 552, 402, 534, 554, 539, 533, 532, 555, 529, 554, 534, 556, 532, 549, 542, 557, 558, 535, 559, 529, 560, 561, 562, 563, 555, 564, 559, 558, 565, 558, 559, 540, 554, 543, 539, 535, 566, 559, 530, 565, 531, 532, 539, 548, 546, 545, 567, 568, 556, 549, 529, 534, 535, 569, 570, 571, 546, 564, 572, 535, 533, 555, 541, 540, 573, 541, 569, 571, 574, 575, 572, 558, 576, 565, 565, 536, 531, 564, 546, 567, 564, 567, 577, 546, 575, 547, 572, 564, 568, 550, 578, 547, 579, 577, 567, 573, 566, 563, 569, 541, 579, 570, 569, 579, 575, 574, 550, 575, 550, 547, 557, 576, 558, 555, 563, 535, 540, 566, 573, 578, 550, 553, 566, 535, 563, 556, 568, 564, 564, 555, 556, 573, 579, 541, 539, 544, 548, 555, 532, 556, 565, 530, 559, 566, 540, 559, 551, 550, 574, 576, 580, 565, 562, 537, 560, 561, 581, 562, 582, 541, 571, 530, 529, 559, 570, 579, 567, 541, 582, 583, 584, 585, 586, 587, 588, 589, 587, 589, 590, 591, 590, 589, 592, 588, 593, 594, 595, 596, 597, 598, 599, 600, 599, 601, 597, 602, 598, 603, 604, 443, 605, 600, 606, 607, 608, 609, 610, 611, 609, 594, 612, 602, 536, 580, 560, 376, 368, 385, 613, 551, 574, 393, 398, 551, 614, 615, 616, 617, 618, 619, 617, 619, 393, 620, 607, 621, 622, 596, 623, 624, 442, 604, 625, 626, 627, 541, 583, 628, 584, 586, 629, 589, 588, 592, 630, 590, 591, 585, 631, 364, 632, 633, 634, 635, 586, 585, 636, 513, 512, 365, 506, 366, 634, 633, 637, 372, 371, 592, 585, 633, 635, 636, 512, 584, 629, 638, 636, 590, 630, 638, 636, 638, 639, 640, 593, 588, 634, 641, 632, 511, 510, 642, 643, 644, 645, 385, 646, 376, 383, 646, 385, 305, 376, 646, 639, 513, 636, 636, 584, 629, 590, 638, 629, 638, 630, 639, 593, 372, 592, 631, 585, 584, 639, 647, 644, 588, 648, 640, 364, 637, 585, 644, 643, 642, 649, 650, 604, 651, 652, 653, 654, 655, 523, 656, 657, 453, 658, 509, 659, 660, 657, 661, 662, 663, 664, 665, 666, 667, 664, 611, 668, 608, 620, 669, 513, 639, 644, 664, 668, 662, 654, 670, 671, 633, 585, 637, 495, 458, 452, 443, 604, 442, 620, 608, 607, 607, 661, 621, 601, 599, 598, 672, 662, 668, 443, 426, 481, 610, 623, 672, 673, 674, 611, 623, 609, 608, 675, 676, 677, 604, 678, 612, 672, 623, 677, 668, 610, 672, 595, 594, 602, 678, 602, 612, 669, 622, 608, 601, 598, 650, 624, 669, 620, 598, 602, 650, 602, 597, 679, 674, 680, 609, 680, 661, 609, 596, 677, 623, 664, 673, 611, 481, 603, 443, 680, 674, 660, 677, 596, 595, 678, 604, 650, 681, 673, 664, 650, 649, 601, 676, 672, 677, 624, 621, 682, 683, 684, 685, 686, 687, 683, 606, 600, 601, 688, 583, 689, 577, 563, 564, 690, 691, 692, 553, 550, 552, 609, 623, 610, 609, 611, 674, 628, 683, 542, 391, 614, 616, 693, 626, 694, 695, 395, 627, 617, 393, 551, 551, 613, 617, 601, 649, 606, 696, 685, 684, 695, 693, 615, 561, 697, 698, 618, 617, 613, 614, 391, 390, 699, 700, 583, 395, 695, 406, 613, 574, 701, 700, 699, 702, 684, 628, 583, 700, 703, 689, 699, 583, 582, 704, 705, 706, 705, 707, 706, 580, 536, 565, 696, 684, 583, 627, 693, 695, 706, 707, 708, 709, 687, 698, 691, 549, 710, 558, 540, 542, 568, 690, 572, 619, 625, 627, 701, 618, 613, 399, 392, 403, 390, 406, 614, 615, 614, 695, 580, 576, 557, 711, 694, 625, 693, 712, 615, 712, 616, 615, 614, 406, 695, 626, 693, 627, 626, 625, 694, 627, 395, 393, 393, 619, 627, 691, 568, 549, 557, 542, 683, 713, 698, 687, 580, 709, 697, 707, 714, 703, 703, 702, 708, 715, 692, 691, 572, 575, 546, 574, 692, 701, 690, 568, 691, 690, 574, 572, 574, 690, 692, 573, 563, 577, 542, 541, 628, 687, 686, 713, 697, 560, 580, 537, 536, 560, 709, 557, 687, 581, 561, 698, 713, 716, 698, 683, 628, 684, 700, 689, 583, 697, 709, 698, 688, 696, 583, 685, 686, 683, 697, 561, 560, 557, 709, 580, 573, 577, 579, 687, 557, 683, 703, 700, 702, 707, 703, 708, 717, 718, 719, 720, 597, 599, 609, 661, 607, 606, 649, 477, 622, 623, 608, 599, 600, 719, 612, 596, 622, 649, 481, 477, 612, 669, 604, 610, 668, 611, 612, 594, 596, 440, 442, 682, 486, 721, 441, 488, 486, 682, 722, 621, 661, 661, 680, 660, 595, 602, 679, 622, 669, 612, 653, 723, 724, 725, 723, 653, 604, 603, 649, 602, 678, 650, 722, 682, 621, 726, 727, 504, 728, 656, 652, 728, 661, 657, 624, 620, 621, 728, 652, 722, 442, 624, 682, 669, 624, 604, 495, 492, 655, 657, 656, 728, 493, 459, 655, 661, 728, 722, 652, 725, 653, 665, 667, 321, 644, 510, 513, 629, 587, 590, 603, 481, 649, 526, 437, 729, 511, 506, 512, 407, 447, 410, 515, 506, 511, 644, 730, 645, 730, 644, 647, 510, 644, 642, 506, 365, 512, 731, 521, 325, 498, 496, 459, 497, 522, 732, 733, 732, 658, 734, 494, 671, 655, 496, 495, 658, 670, 523, 521, 731, 671, 498, 459, 461, 658, 522, 521, 671, 670, 521, 670, 658, 521, 522, 658, 732, 654, 523, 670, 659, 733, 658, 509, 455, 659, 509, 658, 523, 655, 654, 493, 492, 523, 655, 494, 493, 654, 494, 654, 671, 461, 727, 527, 460, 354, 504, 480, 432, 721, 496, 655, 459, 437, 526, 485, 487, 488, 729, 735, 725, 528, 502, 652, 656, 726, 736, 528, 737, 735, 528, 724, 651, 653, 652, 651, 722, 667, 737, 736, 725, 503, 528, 453, 502, 656, 738, 502, 503, 502, 738, 652, 503, 725, 738, 498, 502, 458, 723, 739, 724, 527, 726, 528, 527, 503, 461, 665, 526, 666, 737, 528, 736, 725, 652, 738, 727, 726, 527, 727, 461, 504, 454, 495, 452, 729, 724, 739, 439, 472, 484, 439, 487, 437, 682, 651, 729, 723, 737, 667, 667, 666, 723, 359, 340, 490, 725, 735, 723, 665, 491, 526, 737, 723, 735, 666, 739, 723, 651, 682, 722, 526, 729, 739, 488, 682, 729, 721, 427, 441, 432, 427, 721, 486, 480, 721, 486, 440, 682, 666, 526, 739, 487, 729, 437, 724, 729, 651, 740, 741, 299, 304, 305, 646, 309, 316, 517, 297, 500, 333, 500, 331, 333, 734, 351, 348, 347, 734, 348, 354, 347, 349, 340, 359, 358, 742, 388, 408, 482, 320, 319, 413, 319, 414, 310, 414, 319, 339, 743, 490, 319, 413, 482, 446, 464, 463, 414, 310, 467, 320, 482, 445, 340, 339, 490, 499, 514, 331, 501, 297, 744, 500, 297, 501, 331, 500, 499, 490, 743, 470, 408, 410, 742, 743, 450, 470, 383, 304, 646, 467, 309, 517, 463, 462, 745, 462, 450, 743, 309, 467, 310, 745, 462, 743, 344, 511, 642, 341, 514, 515, 514, 341, 331, 341, 515, 342, 343, 344, 642, 342, 511, 344, 342, 515, 511, 642, 643, 343, 731, 325, 327, 667, 322, 321, 667, 736, 324, 734, 671, 351, 347, 460, 494, 353, 731, 327, 347, 354, 460, 343, 643, 346, 347, 494, 734, 351, 671, 731, 504, 354, 356, 726, 504, 356, 324, 736, 345, 731, 353, 351, 665, 357, 359, 357, 665, 321, 345, 726, 356, 322, 667, 324, 736, 726, 345, 359, 491, 665, 313, 312, 746, 445, 446, 747, 748, 313, 749, 747, 463, 750, 749, 313, 746, 387, 751, 404, 752, 753, 754, 755, 756, 754, 306, 757, 758, 318, 759, 760, 761, 762, 763, 764, 761, 763, 755, 765, 766, 756, 752, 754, 754, 765, 755, 762, 761, 767, 761, 760, 767, 761, 317, 318, 760, 761, 318, 759, 768, 760, 769, 755, 766, 770, 769, 766, 771, 772, 773, 771, 774, 775, 776, 777, 778, 779, 773, 772, 780, 776, 781, 780, 781, 782, 783, 782, 781, 784, 780, 782, 785, 779, 772, 778, 777, 774, 786, 787, 788, 789, 790, 788, 791, 792, 429, 790, 786, 788, 790, 793, 786, 794, 789, 795, 796, 794, 797, 790, 789, 792, 798, 792, 794, 429, 799, 791, 794, 795, 797, 764, 800, 801, 802, 803, 804, 805, 806, 799, 807, 808, 809, 804, 803, 806, 803, 810, 806, 811, 812, 801, 810, 803, 813, 814, 798, 794, 815, 816, 817, 807, 818, 808, 819, 816, 815, 820, 821, 822, 823, 815, 824, 804, 805, 825, 789, 794, 792, 826, 821, 827, 800, 811, 801, 773, 778, 774, 774, 771, 773, 822, 821, 826, 772, 771, 775, 776, 780, 777, 828, 829, 830, 790, 792, 791, 429, 792, 798, 794, 796, 814, 805, 804, 806, 825, 802, 804, 831, 832, 833, 832, 831, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 836, 832, 834, 836, 835, 832, 839, 838, 844, 833, 832, 835, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 795, 789, 855, 856, 857, 858, 859, 860, 856, 850, 857, 854, 861, 795, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 860, 858, 860, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 889, 894, 895, 896, 887, 897, 890, 898, 899, 899, 888, 890, 886, 899, 898, 886, 885, 899, 890, 889, 900, 901, 898, 900, 895, 900, 889, 785, 772, 891, 892, 902, 903, 892, 904, 893, 893, 785, 891, 905, 845, 906, 891, 772, 775, 892, 907, 904, 845, 847, 906, 898, 890, 900, 903, 907, 892, 908, 859, 909, 910, 884, 883, 911, 881, 880, 859, 858, 909, 912, 870, 869, 913, 848, 850, 789, 857, 854, 859, 908, 860, 884, 914, 882, 875, 915, 916, 917, 855, 857, 918, 919, 912, 920, 921, 876, 922, 853, 852, 920, 876, 923, 840, 924, 920, 925, 863, 926, 865, 927, 928, 924, 921, 920, 912, 866, 918, 929, 912, 869, 921, 930, 876, 929, 931, 932, 866, 865, 918, 933, 870, 934, 833, 935, 936, 937, 938, 939, 940, 937, 941, 871, 942, 872, 943, 944, 841, 862, 939, 926, 863, 862, 926, 840, 936, 838, 931, 915, 874, 916, 831, 875, 874, 932, 931, 875, 923, 876, 934, 870, 919, 920, 923, 945, 876, 930, 874, 923, 875, 831, 863, 925, 946, 937, 940, 938, 916, 834, 831, 875, 874, 915, 834, 916, 843, 936, 945, 833, 920, 945, 936, 831, 833, 945, 933, 868, 870, 947, 933, 934, 870, 912, 919, 869, 868, 929, 945, 923, 831, 936, 840, 920, 835, 935, 833, 844, 838, 935, 935, 838, 936, 857, 849, 854, 849, 857, 850, 789, 788, 917, 788, 787, 917, 789, 917, 857, 811, 800, 948, 813, 803, 948, 782, 783, 302, 818, 807, 949, 753, 752, 950, 759, 318, 951, 759, 951, 872, 942, 759, 872, 316, 317, 761, 318, 317, 314, 765, 296, 766, 330, 296, 765, 429, 428, 825, 744, 952, 501, 380, 903, 902, 383, 382, 784, 429, 953, 423, 477, 524, 796, 802, 475, 519, 475, 825, 428, 524, 424, 953, 456, 525, 455, 525, 819, 455, 812, 468, 518, 825, 475, 802, 953, 424, 423, 952, 361, 501, 953, 429, 798, 367, 774, 382, 903, 380, 373, 455, 823, 659, 819, 823, 455, 525, 456, 508, 294, 293, 516, 954, 538, 844, 839, 581, 840, 538, 954, 837, 529, 531, 837, 581, 839, 562, 549, 548, 955, 537, 562, 844, 531, 538, 837, 839, 844, 562, 548, 544, 955, 554, 529, 837, 543, 554, 837, 633, 632, 895, 648, 904, 907, 903, 640, 907, 796, 606, 477, 956, 599, 719, 677, 914, 675, 861, 717, 719, 877, 672, 676, 720, 957, 597, 717, 861, 854, 957, 679, 597, 914, 677, 595, 718, 958, 956, 595, 679, 914, 660, 674, 911, 910, 914, 884, 866, 714, 867, 900, 959, 960, 632, 960, 895, 629, 846, 587, 959, 895, 960, 897, 961, 960, 960, 632, 897, 640, 903, 593, 845, 905, 587, 900, 895, 959, 586, 846, 629, 640, 648, 907, 901, 960, 961, 905, 904, 648, 588, 587, 905, 895, 635, 633, 380, 902, 381, 903, 373, 372, 641, 897, 632, 902, 962, 381, 372, 593, 903, 507, 828, 525, 846, 845, 587, 905, 648, 588, 960, 901, 900, 681, 881, 673, 963, 675, 910, 861, 719, 600, 858, 664, 663, 878, 877, 676, 911, 673, 881, 676, 675, 878, 964, 866, 912, 840, 581, 924, 673, 911, 674, 719, 718, 956, 605, 861, 600, 686, 685, 930, 664, 858, 681, 963, 878, 675, 881, 681, 858, 694, 938, 940, 618, 965, 619, 694, 940, 693, 581, 698, 924, 946, 692, 715, 606, 796, 605, 965, 618, 701, 696, 932, 874, 689, 703, 866, 707, 705, 867, 689, 929, 688, 716, 713, 921, 705, 966, 867, 924, 698, 716, 921, 924, 716, 932, 696, 688, 964, 912, 929, 930, 921, 713, 616, 712, 940, 938, 694, 711, 711, 625, 965, 712, 693, 940, 685, 696, 874, 874, 930, 685, 932, 688, 929, 537, 844, 538, 946, 701, 692, 625, 619, 965, 955, 710, 549, 714, 866, 703, 713, 686, 930, 689, 964, 929, 866, 964, 689, 707, 867, 714, 958, 967, 852, 967, 958, 718, 963, 910, 968, 657, 828, 453, 877, 662, 672, 675, 914, 910, 828, 507, 453, 956, 720, 599, 517, 316, 761, 764, 517, 761, 517, 764, 518, 747, 446, 463, 318, 295, 294, 301, 740, 299, 745, 750, 463, 330, 765, 754, 969, 300, 299, 299, 741, 758, 969, 970, 300, 330, 753, 297, 949, 766, 350, 754, 753, 330, 827, 361, 826, 971, 826, 361, 637, 820, 634, 777, 780, 382, 774, 367, 775, 782, 304, 383, 797, 605, 796, 605, 797, 795, 429, 805, 799, 429, 825, 805, 811, 468, 812, 948, 483, 811, 809, 497, 972, 819, 525, 816, 819, 815, 823, 733, 823, 824, 483, 948, 519, 519, 803, 802, 827, 821, 362, 816, 525, 817, 808, 328, 809, 328, 497, 809, 361, 827, 362, 811, 483, 468, 953, 798, 814, 361, 952, 971, 364, 362, 821, 821, 820, 637, 780, 784, 382, 383, 784, 782, 953, 814, 524, 803, 519, 948, 524, 814, 796, 823, 733, 659, 952, 744, 971, 836, 543, 837, 843, 842, 544, 935, 954, 844, 843, 544, 834, 954, 935, 835, 544, 842, 955, 954, 835, 837, 834, 544, 836, 836, 544, 543, 962, 892, 891, 679, 882, 914, 967, 718, 848, 957, 720, 973, 861, 605, 795, 711, 939, 938, 927, 966, 928, 846, 586, 847, 775, 962, 891, 821, 637, 364, 635, 894, 847, 641, 896, 897, 894, 635, 895, 898, 901, 961, 961, 886, 898, 887, 961, 897, 381, 775, 367, 774, 777, 382, 892, 962, 902, 586, 635, 847, 961, 887, 886, 775, 381, 962, 956, 958, 851, 958, 852, 851, 662, 909, 663, 662, 877, 879, 663, 909, 858, 925, 965, 701, 710, 842, 841, 848, 717, 849, 879, 909, 662, 679, 957, 973, 925, 701, 946, 974, 873, 391, 873, 872, 391, 966, 927, 865, 691, 944, 715, 867, 966, 865, 939, 711, 926, 872, 516, 391, 974, 391, 616, 941, 616, 940, 925, 926, 711, 691, 710, 944, 710, 955, 842, 965, 925, 711, 710, 841, 944, 717, 848, 718, 720, 956, 851, 525, 830, 817, 968, 910, 883, 717, 854, 849, 975, 968, 883, 830, 525, 828, 733, 824, 972, 497, 732, 972, 732, 733, 972, 801, 812, 518, 302, 304, 782, 753, 971, 744, 753, 744, 297, 818, 350, 808, 350, 818, 949, 518, 764, 801, 872, 951, 516, 951, 294, 516, 328, 808, 350, 294, 951, 318, 976, 977, 978, 979, 980, 976, 981, 982, 983, 984, 985, 986, 987, 984, 986, 988, 986, 989, 990, 988, 989, 991, 992, 993, 994, 993, 995, 995, 993, 984, 988, 987, 986, 996, 997, 992, 993, 998, 991, 991, 998, 999, 992, 985, 984, 1000, 1001, 994, 1001, 998, 994, 992, 997, 985, 994, 1002, 1000, 1003, 1004, 1005, 1006, 1007, 1008, 1002, 1008, 1000, 1001, 1000, 1009, 1007, 981, 983, 998, 993, 994, 993, 992, 984, 1010, 1006, 1008, 982, 981, 1011, 1011, 757, 982, 1012, 1004, 1013, 1008, 1002, 1010, 1002, 994, 1014, 1007, 1006, 969, 757, 1004, 982, 1007, 983, 1008, 1005, 757, 302, 783, 52, 1005, 1011, 981, 1007, 768, 1015, 1016, 1017, 768, 1018, 1019, 1020, 1021, 1022, 1017, 1023, 1024, 1025, 1022, 1021, 1023, 1026, 1027, 1028, 1029, 1016, 1028, 768, 1018, 1028, 1023, 1017, 1018, 1023, 1028, 1027, 1023, 1023, 1020, 44, 1017, 1022, 1025, 1020, 1023, 1021, 1030, 976, 978, 770, 1031, 1032, 1028, 1018, 768, 1025, 1024, 763, 1009, 1000, 1008, 1002, 1014, 1010, 1004, 757, 1005, 1033, 979, 976, 65, 979, 1033, 976, 1030, 1033, 44, 1022, 1023, 1032, 1030, 770, 96, 88, 91, 33, 32, 96, 13, 18, 15, 1034, 1035, 10, 1036, 64, 1037, 1035, 1034, 21, 15, 1034, 10, 1038, 20, 19, 23, 1035, 21, 19, 18, 13, 63, 12, 14, 12, 19, 13, 15, 18, 1034, 71, 70, 61, 75, 68, 1039, 75, 60, 76, 107, 82, 72, 68, 76, 57, 82, 107, 83, 76, 59, 57, 60, 75, 1039, 73, 68, 56, 68, 73, 69, 61, 60, 71, 1013, 83, 107, 58, 57, 66, 61, 70, 66, 66, 59, 61, 59, 76, 60, 51, 50, 77, 1040, 71, 60, 68, 57, 56, 779, 58, 1041, 58, 779, 56, 83, 52, 51, 1042, 43, 790, 790, 43, 793, 793, 43, 1043, 88, 96, 1044, 88, 87, 90, 95, 87, 42, 95, 91, 90, 91, 95, 42, 89, 88, 1045, 43, 1046, 1043, 42, 41, 91, 98, 97, 1047, 97, 87, 89, 1048, 97, 31, 39, 99, 1049, 26, 48, 24, 81, 80, 829, 78, 5, 47, 80, 53, 78, 81, 829, 104, 829, 80, 1050, 1051, 53, 80, 80, 79, 1051, 1050, 78, 1052, 78, 1050, 80, 104, 103, 81, 49, 101, 27, 37, 1053, 35, 1054, 86, 85, 1053, 86, 1055, 1053, 1056, 35, 1057, 1054, 85, 86, 1054, 1055, 85, 84, 1057, 86, 1053, 37, 1056, 1053, 1055, 92, 84, 86, 84, 92, 36, 36, 35, 94, 1058, 1059, 25, 109, 108, 1060, 1044, 40, 1061, 40, 1049, 1061, 1062, 29, 31, 17, 8, 1, 1, 7, 2, 99, 1063, 1049, 1064, 46, 1065, 1066, 1065, 39, 7, 1067, 28, 26, 1059, 6, 1058, 109, 1060, 1059, 1058, 1068, 108, 27, 1069, 27, 108, 25, 1059, 1068, 6, 109, 1058, 25, 3, 48, 26, 1059, 26, 25, 53, 1051, 49, 119, 1070, 1071, 120, 1072, 118, 1073, 1074, 1075, 1076, 1077, 1078, 1075, 1079, 1073, 1080, 1081, 1082, 1076, 1083, 1084, 1074, 1085, 1086, 1077, 1084, 1087, 1077, 1088, 1078, 1089, 1090, 1091, 1079, 1092, 1073, 1082, 1081, 1079, 1085, 1093, 1086, 1085, 1074, 1073, 1094, 1073, 1092, 1095, 1075, 1074, 1096, 1097, 116, 1098, 1099, 1100, 1100, 1101, 1098, 115, 117, 1102, 79, 103, 1103, 1104, 1105, 105, 1106, 1107, 1108, 1109, 1071, 1070, 1041, 58, 66, 73, 1110, 69, 1111, 1112, 122, 1113, 1110, 121, 120, 119, 1071, 1112, 118, 122, 1110, 73, 74, 1114, 22, 1115, 22, 21, 1070, 119, 1116, 1070, 22, 1114, 1117, 1070, 1115, 22, 1072, 120, 1071, 1118, 1115, 1119, 119, 118, 1112, 1111, 1120, 119, 69, 1110, 1113, 1119, 1116, 1120, 82, 70, 72, 82, 51, 77, 64, 20, 1121, 122, 1122, 1123, 1122, 122, 121, 1072, 1071, 1124, 1110, 1122, 121, 1041, 66, 55, 1109, 1124, 1071, 1114, 1125, 1117, 1112, 1111, 119, 1116, 119, 1120, 77, 55, 66, 1072, 121, 118, 70, 82, 77, 1115, 1116, 1119, 1115, 1070, 1116, 1126, 1127, 1128, 1129, 1127, 1130, 105, 1106, 1108, 79, 81, 103, 77, 66, 70, 79, 1131, 102, 1132, 1133, 1134, 1135, 1136, 1130, 1137, 1138, 1139, 1140, 1126, 1128, 1141, 1092, 1142, 1143, 1106, 105, 1144, 1145, 1146, 105, 1108, 1104, 103, 105, 1105, 1147, 1137, 1148, 1104, 1129, 1130, 1149, 1150, 1144, 1127, 1126, 1130, 1078, 1146, 1151, 1152, 1135, 1126, 1149, 1153, 1148, 1126, 1135, 1130, 1144, 1154, 1149, 1093, 1085, 1073, 1155, 1156, 1140, 1137, 1155, 1140, 1091, 1134, 1133, 1156, 1152, 1126, 1137, 1140, 1128, 1138, 1137, 1128, 1090, 1089, 1104, 1154, 1144, 1146, 1139, 1149, 1148, 1149, 1139, 1150, 1157, 1083, 1093, 1158, 1159, 1160, 1147, 1161, 1156, 1146, 1088, 1162, 1162, 1154, 1146, 114, 116, 1097, 1159, 1163, 1164, 1145, 1151, 1146, 1146, 1078, 1088, 1153, 1149, 1154, 1165, 1093, 1094, 1081, 1080, 1166, 1080, 1167, 1168, 1081, 1166, 1169, 1170, 1171, 1172, 1079, 1075, 1173, 1173, 1082, 1079, 1174, 1047, 1169, 1175, 1174, 1166, 1086, 1083, 1076, 1092, 1141, 1094, 1073, 1094, 1093, 1135, 1134, 1136, 1086, 1093, 1083, 1092, 1079, 1176, 1133, 1177, 1089, 1103, 1178, 1131, 1157, 1179, 1087, 1180, 1181, 1182, 1183, 1184, 1185, 1160, 1186, 1187, 1188, 1100, 1189, 1190, 1191, 1192, 114, 1193, 113, 1194, 1195, 1186, 1196, 1159, 1164, 1196, 1160, 1159, 1157, 1087, 1084, 1180, 1191, 1197, 1130, 1136, 1090, 1198, 1199, 1200, 1100, 1188, 1201, 1200, 1189, 1099, 114, 1202, 1193, 1187, 1195, 1193, 1159, 1158, 1203, 1102, 1204, 115, 1205, 1206, 1201, 112, 117, 110, 1207, 1208, 1057, 1185, 1209, 1183, 1192, 1210, 1190, 1202, 114, 1097, 1202, 1187, 1193, 1211, 1212, 1192, 1180, 1196, 1181, 1203, 1163, 1159, 1187, 1202, 1213, 1197, 1214, 1194, 1156, 1155, 1147, 1057, 84, 1207, 45, 1215, 46, 36, 1185, 84, 1185, 1207, 84, 1089, 1216, 1105, 1217, 1132, 1134, 114, 110, 116, 1170, 1218, 1171, 1101, 1219, 1098, 1220, 1200, 1099, 1100, 1099, 1189, 1189, 1200, 1221, 1221, 1200, 1199, 1098, 1220, 1099, 1220, 1198, 1200, 1188, 1205, 1201, 1205, 1188, 1189, 1101, 1100, 1222, 1161, 1153, 1162, 1102, 117, 1223, 1160, 1197, 1186, 1164, 1208, 1181, 1185, 1184, 1207, 1209, 1185, 36, 1207, 1181, 1208, 36, 93, 1209, 1197, 1160, 1196, 1182, 1207, 1184, 1194, 1186, 1197, 1210, 1192, 1212, 1172, 1171, 1204, 1196, 1180, 1197, 1184, 1211, 1182, 1182, 1192, 1191, 1194, 1214, 1224, 1181, 1196, 1164, 1191, 1180, 1182, 1211, 1192, 1182, 1214, 1191, 1190, 1191, 1214, 1197, 1195, 1187, 1186, 1195, 1194, 1193, 1130, 1090, 1104, 1089, 1091, 1133, 1171, 115, 1204, 117, 112, 1223, 1170, 1201, 1206, 1142, 1169, 1047, 1182, 1181, 1207, 1175, 1166, 1168, 1175, 1043, 1046, 1081, 1176, 1079, 1080, 1168, 1166, 1169, 1142, 1092, 1047, 1174, 1046, 1092, 1176, 1169, 1093, 1165, 1157, 1148, 1137, 1139, 1225, 1024, 1066, 1061, 29, 1062, 1176, 1081, 1169, 1155, 1137, 1147, 1129, 1104, 1108, 1161, 1147, 1148, 1226, 1061, 1049, 1077, 1076, 1084, 1063, 99, 1215, 1104, 1089, 1105, 1167, 1080, 1082, 1091, 1136, 1134, 1136, 1091, 1090, 1153, 1154, 1162, 1083, 1157, 1084, 1105, 1216, 1103, 1103, 103, 1105, 1051, 79, 102, 1131, 79, 1103, 1126, 1140, 1156, 1216, 1178, 1103, 1153, 1161, 1148, 38, 96, 32, 1062, 88, 1044, 1225, 1227, 34, 30, 1228, 1229, 31, 97, 89, 98, 1047, 1046, 1166, 1174, 1169, 1174, 1175, 1046, 1226, 1230, 1229, 2, 4, 0, 49, 48, 5, 28, 4, 2, 102, 49, 1051, 101, 1069, 27, 24, 49, 27, 1062, 1045, 88, 32, 39, 38, 39, 1225, 1066, 32, 1227, 39, 40, 39, 1049, 40, 1044, 38, 46, 39, 1065, 1227, 1225, 39, 1227, 32, 34, 1063, 1231, 1049, 1232, 1063, 1215, 99, 46, 1215, 1231, 1226, 1049, 1228, 1226, 1229, 89, 1045, 31, 1044, 96, 38, 29, 1226, 1228, 1061, 1226, 29, 1045, 1062, 31, 1044, 1061, 1062, 30, 29, 1228, 977, 976, 1233, 1003, 83, 1013, 1005, 52, 1003, 1004, 1003, 1013, 83, 1003, 52, 1032, 1068, 1234, 1068, 1032, 1031, 1031, 16, 1235, 770, 16, 1031, 1233, 976, 980, 1068, 1236, 1234, 1015, 768, 1237, 65, 63, 979, 1022, 1064, 1065, 1022, 44, 1064, 45, 44, 1020, 1016, 1015, 35, 45, 1020, 1019, 1060, 1236, 1058, 980, 62, 1233, 1038, 65, 1238, 1236, 1060, 1239, 1235, 6, 1068, 16, 1, 1235, 65, 1038, 19, 1240, 1038, 1238, 1031, 1235, 1068, 6, 1235, 1, 62, 980, 63, 1068, 1058, 1236, 977, 1233, 62, 1015, 94, 35, 1064, 44, 46, 19, 12, 65, 1022, 1066, 1024, 1022, 1065, 1066, 980, 979, 63, 1006, 1010, 1014, 1014, 1241, 1006, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1247, 1250, 1251, 1248, 1246, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1259, 1261, 1257, 1263, 1264, 990, 1262, 1261, 1259, 1261, 1260, 1264, 1263, 989, 1257, 1259, 1258, 1265, 1261, 1264, 1263, 1263, 1257, 1261, 1266, 1258, 1257, 1267, 1268, 1266, 1269, 1270, 1271, 1257, 1267, 1266, 1272, 1273, 1268, 1268, 1267, 1274, 1275, 1269, 1273, 989, 1274, 1267, 1273, 1272, 997, 1269, 1275, 1276, 1268, 1273, 1269, 1277, 1278, 1279, 1280, 1277, 1281, 1281, 1279, 983, 1277, 1280, 1282, 1281, 983, 1283, 1281, 1277, 1279, 1278, 1277, 1282, 1281, 1283, 1284, 1285, 1286, 1287, 1286, 1288, 1287, 1289, 1290, 1291, 1292, 1290, 1293, 1292, 1294, 1295, 1296, 1297, 1298, 1299, 1292, 1300, 1301, 1302, 1291, 1303, 1304, 1305, 1297, 1292, 1306, 1307, 1308, 1309, 1310, 1307, 1311, 1307, 1312, 1313, 1314, 1315, 1316, 1317, 1307, 1309, 1318, 1316, 1319, 1320, 1321, 1322, 1316, 1318, 1314, 1323, 1324, 1325, 1324, 1326, 1325, 1323, 1308, 1324, 1327, 1328, 1324, 1323, 1309, 1308, 1308, 1327, 1324, 1327, 1329, 1328, 1324, 1328, 1326, 1330, 1319, 1316, 1323, 1325, 1331, 1314, 1318, 1308, 1314, 1320, 1322, 1328, 1332, 1326, 1333, 1331, 1334, 1331, 1325, 1334, 1321, 1320, 1335, 1336, 1337, 1338, 1296, 1298, 1339, 1340, 1298, 1341, 1334, 1325, 1342, 1343, 1340, 1344, 1339, 1298, 1345, 1343, 1345, 1340, 1243, 1242, 1346, 1347, 1348, 1341, 1340, 1341, 1337, 1341, 1349, 1350, 1341, 1255, 1347, 1255, 1341, 1298, 1351, 1352, 1349, 1349, 1353, 1350, 1354, 1351, 1349, 1351, 1355, 1352, 1256, 1297, 1306, 1256, 1255, 1298, 1356, 1306, 1357, 1358, 1359, 1245, 1356, 1360, 1256, 1361, 1254, 1362, 1360, 1254, 1256, 1357, 1306, 1363, 1255, 1254, 1347, 1347, 1254, 1364, 1349, 1341, 1348, 1254, 1361, 1364, 1360, 1365, 1366, 1366, 1365, 1367, 1297, 1256, 1298, 1356, 1256, 1306, 1368, 1369, 1365, 1370, 1363, 1306, 1359, 1370, 1245, 1369, 1368, 1371, 1372, 1373, 1374, 1371, 1368, 1375, 1357, 1376, 1365, 1376, 1358, 1375, 1367, 1365, 1369, 1368, 1376, 1375, 1358, 1376, 1359, 1252, 1246, 1377, 1378, 1246, 1370, 1359, 1363, 1370, 1379, 1249, 1248, 1370, 1246, 1245, 1365, 1360, 1356, 1380, 1381, 1247, 1251, 1379, 1248, 1245, 1247, 1381, 1249, 1379, 1382, 1381, 1375, 1358, 1379, 1383, 1382, 1384, 1021, 1026, 1385, 1286, 1384, 1386, 1387, 1388, 1385, 1389, 1390, 1388, 1387, 1391, 1392, 1393, 1389, 1394, 1395, 1396, 1397, 1394, 1398, 1399, 1386, 1400, 1401, 1395, 1393, 1397, 1393, 1395, 1402, 1403, 1404, 1405, 1402, 1406, 1398, 1407, 1408, 1395, 1394, 1397, 1408, 1404, 1409, 1410, 1385, 1400, 1411, 1407, 1398, 1407, 1411, 1412, 1412, 1413, 1414, 1402, 1405, 1403, 1396, 1411, 1394, 1377, 1378, 1390, 1407, 1412, 1414, 1414, 1404, 1408, 1252, 1409, 1253, 1414, 1402, 1404, 1414, 1413, 1406, 1377, 1409, 1252, 1415, 1416, 1417, 1397, 1389, 1393, 1404, 1403, 1418, 1419, 1420, 1421, 1421, 1420, 1418, 1420, 1409, 1418, 1420, 1416, 1415, 1422, 1415, 1423, 1416, 1420, 1419, 1423, 1415, 1424, 1246, 1378, 1377, 1425, 1426, 1416, 1289, 1427, 1303, 1289, 1305, 1293, 1244, 1374, 1428, 1429, 1331, 1333, 1429, 1430, 1331, 1353, 1431, 1432, 1349, 1352, 1353, 1352, 1431, 1353, 1346, 1333, 1243, 1433, 1244, 1428, 1373, 1428, 1374, 1432, 1373, 1372, 1338, 1372, 1334, 1243, 1374, 1244, 1434, 1021, 1384, 1435, 1285, 1287, 1285, 1434, 1384, 1436, 1429, 1346, 1430, 1437, 1438, 1243, 1334, 1374, 1439, 1438, 1440, 1243, 1333, 1334, 1441, 1437, 1436, 1438, 1437, 1442, 1436, 1242, 1443, 1444, 1445, 1331, 1429, 1436, 1430, 1439, 1444, 1430, 1436, 1437, 1430, 1340, 1337, 1344, 1315, 1322, 1321, 1315, 1314, 1322, 1370, 1306, 1292, 1290, 1292, 1295, 1292, 1293, 1370, 1238, 1446, 1240, 1446, 1238, 1312, 1317, 1447, 1448, 1448, 1449, 1446, 1446, 1450, 1240, 1448, 1451, 1449, 1450, 1449, 1452, 1452, 1449, 1451, 1453, 1454, 1455, 1453, 1448, 1447, 1454, 1453, 1456, 1453, 1455, 1457, 1453, 1447, 1458, 1451, 1448, 1457, 1459, 1456, 1460, 1456, 1453, 1458, 1458, 1461, 1460, 1461, 1462, 1463, 1463, 1464, 1461, 1458, 1465, 1462, 1458, 1460, 1456, 1445, 1466, 1465, 1317, 1445, 1465, 1467, 1468, 1469, 1470, 1468, 1471, 1472, 1469, 1445, 1445, 1469, 1466, 1466, 1469, 1470, 1445, 1444, 1472, 1473, 1466, 1474, 1468, 1470, 1469, 1430, 1444, 1331, 1444, 1475, 1472, 1467, 1476, 1477, 1384, 1286, 1285, 1478, 1479, 1287, 1398, 1377, 1390, 1288, 1286, 1385, 1290, 1289, 1293, 1427, 1289, 1291, 1310, 1314, 1308, 1480, 1481, 1451, 1450, 1452, 1481, 1311, 1307, 1313, 1033, 1312, 1238, 1312, 1307, 1317, 1448, 1446, 1317, 1308, 1307, 1310, 1482, 1474, 1470, 1449, 1450, 1446, 1471, 1482, 1470, 1458, 1447, 1465, 1465, 1447, 1317, 1459, 1454, 1456, 1481, 1452, 1451, 1312, 1317, 1446, 1310, 1483, 1314, 1467, 1469, 1472, 1462, 1461, 1458, 1305, 1289, 1303, 1308, 1318, 1327, 1298, 1340, 1345, 1439, 1440, 1444, 1323, 1331, 1309, 1320, 1314, 1483, 1318, 1484, 1327, 1325, 1326, 1342, 1438, 1439, 1430, 1338, 1337, 1432, 1372, 1374, 1334, 1292, 1297, 1300, 1288, 1304, 1287, 1389, 1385, 1410, 1399, 1026, 1387, 1409, 1404, 1418, 1365, 1356, 1357, 1407, 1414, 1408, 1470, 1474, 1466, 1436, 1346, 1242, 1390, 1397, 1398, 1411, 1398, 1394, 1409, 1420, 1422, 1378, 1485, 1390, 1290, 1295, 1486, 1485, 1385, 1390, 1422, 1250, 1409, 1408, 1409, 1377, 1402, 1414, 1406, 1487, 1488, 999, 1489, 1249, 1382, 1484, 1318, 1319, 1467, 1472, 1476, 1276, 1270, 1269, 989, 1267, 1257, 1274, 1272, 1268, 996, 1275, 1273, 1473, 1474, 1490, 1331, 1445, 1309, 999, 1491, 1487, 1448, 1453, 1457, 1358, 1245, 1381, 1492, 1362, 1366, 1376, 1368, 1365, 1254, 1360, 1362, 1357, 1363, 1359, 1380, 1247, 1249, 1442, 1493, 1494, 1355, 1431, 1352, 1399, 1384, 1026, 1291, 1302, 1427, 1387, 1386, 1399, 1362, 1360, 1366, 1389, 1397, 1390, 1384, 1399, 1400, 1429, 1333, 1346, 1386, 1388, 1410, 1385, 1384, 1400, 1334, 1342, 1338, 1341, 1350, 1337, 1422, 1423, 1495, 1354, 1349, 1348, 1408, 1377, 1398, 1386, 1410, 1400, 1432, 1337, 1350, 1338, 1432, 1372, 1297, 1296, 1300, 1327, 1484, 1329, 1294, 1486, 1295, 1376, 1357, 1359, 1466, 1473, 1465, 1350, 1353, 1432, 1310, 1311, 1496, 1383, 1379, 1251, 1422, 1420, 1415, 1293, 1305, 1485, 1248, 1253, 1250, 1378, 1370, 1485, 1247, 1253, 1248, 1370, 1293, 1485, 1305, 1288, 1485, 1250, 1253, 1409, 1253, 1247, 1246, 1497, 1303, 1427, 1498, 1285, 1435, 1416, 1419, 1425, 1462, 1473, 1499, 1317, 1309, 1445, 1473, 1462, 1465, 1500, 1303, 1497, 1304, 1288, 1305, 1310, 1496, 1483, 1304, 1478, 1287, 1479, 1501, 1435, 1478, 1303, 1500, 1287, 1479, 1435, 1303, 1478, 1304, 1290, 1486, 1301, 1291, 1290, 1301, 1288, 1385, 1485, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1503, 1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1500, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1524, 1527, 1528, 1529, 1527, 1526, 1527, 1529, 1530, 1531, 1532, 1533, 1530, 1529, 1521, 1526, 1525, 1534, 1527, 1524, 1526, 1535, 1536, 1537, 1536, 1535, 1538, 1522, 1521, 1534, 1538, 1535, 1539, 1540, 1541, 1542, 1529, 1526, 1534, 1539, 1534, 1525, 1522, 1535, 1543, 1544, 1545, 1546, 1522, 1533, 1523, 1522, 1543, 1547, 1544, 1532, 1545, 1548, 1521, 1546, 1546, 1549, 1550, 1523, 1544, 1546, 1551, 1552, 1545, 1546, 1521, 1523, 1553, 1533, 1547, 1554, 1555, 1545, 1545, 1532, 1551, 1522, 1539, 1535, 1556, 1540, 1557, 1558, 1551, 1532, 1552, 1551, 1557, 1559, 1560, 1561, 1551, 1558, 1557, 1556, 1558, 1531, 1562, 1563, 1564, 1565, 1564, 1557, 1562, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1567, 1569, 1573, 1558, 1556, 1557, 1573, 1570, 1567, 1574, 1575, 1563, 1576, 1577, 1574, 1566, 1576, 1563, 1566, 1565, 1577, 1578, 1563, 1575, 1554, 1545, 1552, 1576, 1566, 1577, 1271, 1565, 1557, 1275, 1579, 1580, 1533, 1522, 1547, 1581, 1582, 1583, 1579, 1584, 1580, 1580, 1585, 1577, 1586, 1587, 1588, 1541, 1540, 1556, 1576, 1574, 1563, 1585, 1580, 1584, 1554, 1552, 1557, 1589, 1590, 1591, 1592, 1560, 1593, 1592, 1593, 1594, 1571, 1570, 1573, 1590, 1589, 1594, 1590, 1593, 1595, 1573, 1561, 1560, 1584, 1596, 1585, 1596, 1584, 1597, 1596, 1598, 1599, 1593, 1560, 1600, 1572, 1592, 1594, 1596, 1599, 1585, 1597, 1601, 1598, 1599, 1602, 1603, 1602, 1598, 1583, 1560, 1571, 1573, 1604, 1605, 1606, 1560, 1607, 1600, 1608, 1583, 1598, 1582, 1607, 1559, 1609, 1608, 1610, 1583, 1609, 1581, 1569, 1561, 1573, 1611, 1602, 1583, 1612, 1600, 1606, 1581, 1609, 1604, 1581, 1604, 1606, 1607, 1606, 1600, 1601, 1613, 1598, 1582, 1611, 1583, 1605, 1604, 1280, 1611, 1582, 1559, 1614, 1280, 1604, 1606, 1607, 1581, 1610, 1615, 1609, 1568, 1567, 1616, 1605, 1617, 1606, 1618, 106, 1619, 1620, 1587, 1621, 1622, 1621, 1587, 1622, 1618, 1619, 1623, 1624, 1625, 1584, 1579, 1626, 1580, 1577, 1275, 1588, 1620, 1627, 1608, 1598, 1613, 1628, 1629, 1625, 106, 1618, 1630, 1618, 1622, 1587, 1619, 106, 1625, 1629, 1628, 1631, 1595, 1593, 1600, 1591, 1627, 1632, 1595, 1612, 1591, 1607, 1582, 1581, 1627, 1612, 1633, 1632, 1620, 1629, 1617, 1612, 1606, 1617, 1634, 1633, 1621, 1622, 1619, 1624, 1628, 1625, 1635, 1599, 1603, 1633, 1588, 1627, 1632, 1589, 1591, 1634, 1605, 1280, 1605, 1634, 1617, 1555, 1554, 1578, 1584, 1626, 1597, 1587, 1586, 1618, 1636, 1597, 1626, 1559, 1561, 1635, 1614, 1609, 1615, 1620, 1621, 1629, 1598, 1602, 1599, 1565, 1271, 1637, 1609, 1614, 1604, 1593, 1590, 1594, 1603, 1611, 1559, 1586, 1633, 1634, 1629, 1621, 1625, 1587, 1620, 1588, 1627, 1620, 1632, 1612, 1617, 1633, 1638, 1632, 1629, 1586, 1588, 1633, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1515, 1648, 1513, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1649, 1656, 1657, 1658, 1646, 1659, 1660, 1661, 1662, 1648, 1663, 1658, 1657, 1664, 1652, 1659, 1653, 1659, 1652, 1651, 1645, 1665, 1666, 1667, 1649, 1655, 1667, 1668, 1650, 1655, 1669, 1668, 1299, 1657, 1646, 1292, 1646, 1666, 1670, 1671, 1672, 1661, 1660, 1673, 1661, 1674, 1675, 1645, 1676, 1677, 1650, 1668, 1676, 1669, 1678, 1679, 1680, 1681, 1682, 1654, 1675, 1683, 1668, 1684, 1676, 1648, 1685, 1679, 1646, 1292, 1299, 1665, 1645, 1677, 1654, 1661, 1675, 1663, 1678, 1686, 1663, 1648, 1679, 1684, 1669, 1679, 1315, 1687, 1688, 102, 1689, 1690, 1690, 1689, 1691, 1688, 1687, 1692, 1693, 1692, 1694, 1693, 1695, 1696, 1697, 1698, 1699, 1700, 1701, 1702, 1703, 1698, 1704, 1705, 1691, 1706, 1694, 1707, 1699, 1708, 1706, 1709, 1709, 1710, 1711, 1687, 1707, 1712, 1710, 1709, 1706, 1711, 1713, 1714, 1713, 1711, 1710, 1714, 1715, 1698, 1712, 1692, 1687, 1692, 1693, 1716, 1717, 1718, 1719, 1717, 1720, 1718, 1721, 1722, 1723, 1691, 1710, 1706, 1724, 1725, 1702, 1725, 1724, 1726, 1727, 1724, 1728, 1727, 1729, 1726, 1729, 1727, 1728, 1728, 1730, 1729, 1728, 1724, 1731, 1701, 1724, 1702, 1731, 1704, 1730, 1731, 1724, 1701, 1698, 1703, 1701, 1722, 1732, 1517, 1733, 1734, 1735, 1717, 1736, 1696, 1737, 1716, 1693, 1721, 1725, 1732, 1718, 1720, 1738, 1739, 1740, 1342, 1741, 1733, 1735, 1702, 1725, 1721, 1721, 1742, 1702, 1700, 1695, 1701, 1700, 1702, 1696, 1725, 1726, 1729, 1743, 1725, 1744, 1730, 1728, 1731, 1742, 1721, 1723, 1736, 1717, 1719, 1518, 1517, 1732, 1745, 1746, 1739, 1747, 1748, 1749, 1675, 1750, 1683, 1751, 1516, 1752, 1745, 1738, 1723, 1741, 1735, 1753, 1650, 1658, 1664, 1671, 1754, 1672, 1753, 1674, 1673, 1674, 1735, 1516, 1717, 1702, 1742, 1755, 1751, 1739, 1755, 1746, 1517, 1749, 1751, 1752, 1695, 1700, 1696, 1750, 1756, 1683, 1755, 1517, 1751, 1750, 1516, 1518, 1516, 1751, 1517, 1757, 1732, 1743, 1758, 1750, 1743, 1518, 1757, 1750, 1516, 1735, 1752, 1674, 1750, 1675, 1296, 1339, 1671, 1759, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 1767, 1768, 1769, 1354, 1510, 1770, 1508, 1770, 1510, 1771, 1772, 1773, 1774, 1773, 1772, 1775, 1769, 1768, 1776, 1777, 1778, 1779, 1769, 1780, 1354, 1781, 1780, 1769, 1782, 1776, 1768, 1776, 1782, 1783, 1770, 1784, 1508, 1781, 1769, 1785, 1786, 1783, 1361, 1787, 1783, 1788, 1789, 1786, 1361, 1508, 1778, 1507, 1784, 1789, 1779, 1790, 1791, 1792, 1793, 1777, 1779, 1783, 1786, 1788, 1778, 1777, 1774, 1509, 1505, 1794, 1784, 1778, 1508, 1787, 1795, 1796, 1797, 1770, 1771, 1798, 1355, 1780, 1789, 1788, 1786, 1505, 1509, 1506, 1799, 1777, 1492, 1509, 1794, 1800, 1777, 1799, 1774, 1506, 1508, 1507, 1799, 1367, 1772, 1801, 1802, 1803, 1801, 1512, 1804, 1803, 1805, 1806, 1807, 1808, 1809, 1799, 1772, 1774, 1802, 1505, 1773, 1800, 1810, 1811, 1800, 1794, 1812, 1800, 1813, 1814, 1775, 1790, 1773, 1509, 1800, 1811, 1794, 1505, 1812, 1784, 1770, 1795, 1773, 1778, 1774, 1802, 1773, 1790, 1775, 1791, 1790, 1810, 1800, 1814, 1812, 1505, 1802, 1792, 1803, 1790, 1802, 1801, 1812, 1815, 1813, 1816, 1512, 1801, 1806, 1511, 1804, 1512, 1812, 1816, 1813, 1809, 1817, 1818, 1505, 1507, 1773, 1819, 1816, 1820, 1816, 1812, 1820, 1821, 1503, 1512, 1812, 1804, 1820, 1804, 1812, 1801, 1820, 1511, 1819, 1816, 1809, 1818, 1818, 1815, 1816, 1511, 1820, 1804, 1803, 1806, 1801, 1819, 1511, 1807, 1805, 1512, 1806, 1822, 1807, 1823, 1502, 1823, 1807, 1824, 1825, 1826, 1827, 1828, 1829, 1824, 1388, 1830, 1054, 1831, 1832, 1833, 1054, 1832, 1643, 1834, 1644, 1389, 1826, 1827, 1826, 1828, 1827, 1835, 1833, 1830, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, 1831, 1843, 1845, 1844, 1843, 1846, 1847, 1845, 1843, 1828, 1826, 1825, 1825, 1848, 1828, 1825, 1849, 1850, 1840, 1851, 1841, 1848, 1831, 1845, 1836, 1852, 1853, 1852, 1828, 1848, 1852, 1836, 1838, 1848, 1825, 1850, 1854, 1855, 1856, 1847, 1857, 1836, 1855, 1842, 1844, 1857, 1842, 1855, 1854, 1858, 1855, 1847, 1836, 1853, 1855, 1859, 1857, 1840, 1856, 1851, 1840, 1839, 1858, 1857, 1837, 1836, 1837, 1859, 1860, 1839, 1859, 1858, 1861, 1860, 1839, 1829, 1828, 1838, 1389, 1824, 1826, 1831, 1848, 1850, 1862, 1829, 1838, 1841, 1863, 1864, 1865, 1866, 1867, 1868, 1866, 1863, 1869, 1870, 1864, 1852, 1848, 1853, 1865, 1871, 1864, 1870, 1872, 1839, 1873, 1874, 1875, 1841, 1870, 1839, 1859, 1837, 1857, 1876, 1877, 1873, 1873, 1871, 1874, 1877, 1876, 1878, 1871, 1879, 1880, 1877, 1879, 1873, 1881, 1882, 1883, 1881, 1883, 1877, 1876, 1884, 1878, 1878, 1882, 1881, 1882, 1878, 1885, 1886, 1855, 1887, 1793, 1789, 1492, 1888, 1879, 1877, 1866, 1865, 1863, 1889, 1890, 1891, 1889, 1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1898, 1891, 1899, 1900, 1899, 1891, 1899, 1900, 1901, 1898, 1892, 1891, 1898, 1897, 1902, 1901, 1903, 1899, 1900, 1891, 1904, 1403, 1905, 1906, 1849, 1833, 1832, 1903, 1905, 1907, 1907, 1905, 1908, 1909, 1907, 1908, 1907, 1910, 1897, 1901, 1900, 1906, 1905, 1901, 1906, 1908, 1882, 1909, 1904, 1911, 1419, 1912, 1913, 1914, 1896, 1895, 1915, 1896, 1890, 1893, 1916, 1912, 1914, 1893, 1892, 1913, 1890, 1896, 1915, 1900, 1904, 1419, 1890, 1889, 1893, 1890, 1904, 1891, 1904, 1890, 1911, 1912, 1896, 1893, 1669, 1684, 1668, 1519, 1514, 1520, 1917, 1669, 1918, 1514, 1513, 1919, 1640, 1920, 1921, 1922, 1639, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1763, 1924, 1926, 1930, 1762, 1760, 1720, 1742, 1723, 1930, 1925, 1931, 1932, 1645, 1647, 1933, 1798, 1934, 1648, 1515, 1935, 1798, 1933, 1936, 1920, 1937, 1921, 1760, 1938, 1761, 1798, 1759, 1761, 1923, 1639, 1641, 1798, 1780, 1781, 1934, 1938, 1939, 1933, 1934, 1940, 1940, 1939, 1941, 1942, 1763, 1943, 1944, 1642, 1644, 1945, 1946, 1947, 1764, 1763, 1942, 1943, 1926, 1948, 1949, 1942, 1943, 1942, 1949, 1929, 1921, 1641, 1640, 1946, 1941, 1947, 1766, 1948, 1950, 1949, 1927, 1929, 1766, 1765, 1927, 1949, 1943, 1948, 1647, 1650, 1932, 1951, 1933, 1940, 1651, 1652, 1649, 1676, 1645, 1932, 1952, 1953, 1765, 1949, 1948, 1766, 1933, 1954, 1936, 1678, 1917, 1955, 1649, 1667, 1650, 1759, 1798, 1781, 1956, 1957, 1928, 1957, 1945, 1947, 1947, 1941, 1928, 1765, 1953, 1956, 1762, 1939, 1938, 1958, 1959, 1956, 1763, 1762, 1930, 1664, 1657, 1672, 1760, 1762, 1938, 1927, 1949, 1766, 1952, 1960, 1953, 1961, 1946, 1945, 1650, 1659, 1651, 1656, 1652, 1655, 1662, 1686, 1513, 1652, 1656, 1649, 1962, 1963, 1964, 1965, 1964, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1974, 1973, 1976, 1976, 1963, 1977, 1976, 1973, 1978, 1974, 1968, 1975, 1968, 1967, 1979, 1980, 1981, 1982, 1976, 1977, 1974, 1981, 1983, 1982, 1981, 1973, 1984, 1980, 1982, 1985, 1983, 1981, 1986, 1964, 1987, 1962, 1988, 1963, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1993, 1997, 1998, 1970, 1999, 2000, 1996, 2001, 1997, 1993, 2002, 1969, 2003, 1989, 1993, 1996, 2004, 2005, 1989, 2006, 1997, 2001, 1996, 2007, 1998, 2008, 2009, 1971, 2006, 1993, 2010, 2011, 1971, 2005, 2006, 2006, 1962, 2012, 2013, 2014, 2011, 2005, 1970, 2007, 1970, 2005, 1971, 2015, 1972, 2009, 1974, 1977, 2003, 2016, 1982, 2017, 1988, 1989, 2003, 2003, 1977, 1988, 1989, 1962, 2006, 2018, 1990, 1992, 1969, 2007, 2008, 1966, 1964, 1963, 1986, 1981, 2019, 1971, 2009, 1972, 2012, 1962, 1987, 1978, 1966, 1963, 2002, 2020, 2021, 1999, 2013, 1998, 2004, 1996, 2022, 2001, 1997, 2002, 2023, 2024, 2025, 1991, 2026, 1992, 2027, 2000, 2001, 1970, 2028, 1999, 2029, 1991, 1990, 2026, 2001, 2021, 2000, 2030, 1996, 2030, 2000, 2031, 2001, 2026, 2027, 2022, 2030, 2031, 2010, 1993, 1995, 1992, 2020, 2028, 2008, 1998, 2013, 1991, 2029, 1499, 2000, 2032, 2033, 2034, 2032, 2027, 2023, 2032, 2035, 1999, 2020, 2013, 2033, 2031, 2000, 1998, 2007, 1970, 2032, 2034, 2036, 2032, 2036, 2035, 2032, 2000, 2027, 2036, 2037, 2038, 2031, 2033, 2039, 1989, 2005, 2007, 2003, 1969, 1974, 2031, 2040, 2022, 2012, 2009, 2006, 2041, 2042, 2043, 2044, 2045, 2046, 2039, 2047, 2048, 2049, 2050, 2051, 2052, 2049, 2053, 2054, 2042, 2055, 2054, 2056, 2057, 2051, 2058, 2053, 2043, 2042, 2058, 2052, 2057, 2047, 2059, 2024, 2023, 2052, 2025, 2024, 2058, 2044, 2060, 2057, 2052, 2053, 2025, 2039, 2023, 2056, 2054, 2055, 1759, 1781, 2061, 2044, 2058, 2051, 2053, 2049, 2051, 2041, 2060, 2062, 2058, 2042, 2053, 2063, 2062, 2064, 2046, 2060, 2044, 2065, 2062, 2060, 1695, 1693, 1694, 1965, 2066, 2067, 1687, 1315, 2068, 1982, 2016, 1985, 2066, 1965, 1966, 2045, 2044, 2069, 2013, 2011, 2070, 2013, 1969, 2008, 2060, 2041, 2043, 1980, 2066, 1966, 2059, 2023, 2035, 1463, 1499, 2029, 1972, 2071, 1970, 1760, 1759, 2072, 1652, 1654, 1681, 1701, 1703, 1704, 1692, 1712, 1694, 1714, 1708, 1709, 1691, 1705, 2073, 1746, 1722, 1517, 1736, 1737, 1693, 2074, 2075, 1718, 1660, 1664, 1672, 1685, 1677, 1676, 1740, 1739, 1751, 1710, 2076, 2077, 1737, 1736, 1719, 1927, 1765, 1928, 1957, 1947, 1928, 1441, 1957, 1959, 1765, 1956, 1928, 1931, 1763, 1930, 1924, 1763, 1931, 1941, 1961, 1940, 1925, 1924, 1931, 1748, 1740, 1751, 1941, 1762, 1764, 1739, 1342, 2078, 1516, 1750, 1674, 1699, 1695, 1694, 1756, 1750, 1758, 2074, 1718, 1738, 1650, 1647, 1658, 1671, 1670, 1296, 1734, 1749, 1752, 1769, 1776, 1783, 1734, 1747, 1749, 1782, 1768, 1347, 1754, 1671, 2079, 1745, 1723, 1746, 2039, 2032, 2023, 1660, 1659, 1664, 1809, 1816, 1819, 1905, 2080, 1908, 1869, 1864, 1880, 1849, 1825, 1830, 1910, 1907, 1909, 1870, 1841, 1864, 1871, 1865, 1867, 1884, 1873, 1875, 1890, 1915, 1911, 1772, 1791, 1775, 1681, 1655, 1652, 1873, 1884, 1876, 1732, 1722, 1721, 1565, 1637, 1577, 1396, 1395, 1861, 1905, 1403, 2080, 1878, 1884, 1885, 1678, 1663, 1679, 1864, 1871, 1880, 1892, 1898, 1902, 1856, 1840, 1858, 1865, 1864, 1863, 1502, 1511, 1503, 1847, 1843, 1842, 1872, 1861, 1839, 1897, 1903, 1907, 1571, 1592, 1572, 2028, 2018, 1992, 2042, 2057, 2053, 2081, 2050, 2049, 1563, 1562, 1566, 2082, 1555, 2083, 1978, 1981, 1966, 2020, 1999, 2028, 2071, 2018, 2028, 1969, 1968, 1974, 1981, 1980, 1966, 1878, 1881, 1877, 1861, 1872, 1396, 1879, 1871, 1873, 1905, 1903, 1901, 1866, 1868, 2084, 1880, 1888, 1869, 1828, 1852, 1838, 1853, 1848, 1845, 1841, 1851, 1863, 1912, 1894, 1896, 2011, 2014, 1993, 1636, 1601, 1597, 2034, 2027, 2026, 1548, 1546, 1550, 1532, 1544, 1523, 2085, 1525, 1528, 1525, 2085, 1538, 1533, 1553, 1531, 1554, 1564, 1563, 2086, 1527, 1530, 2044, 2051, 2087, 1525, 1524, 1528, 2034, 1991, 1499, 2052, 2047, 2025, 2047, 2057, 2056, 2040, 2039, 2048, 1563, 1578, 1554, 1600, 1612, 1595, 2060, 2043, 2058, 2030, 2022, 1996, 2049, 2052, 2088, 1612, 1627, 1591, 2002, 2021, 2001, 2089, 2045, 2069, 2060, 2046, 2065, 2090, 1537, 1536, 1521, 2086, 1530, 2091, 1260, 2090, 1994, 1993, 2004, 2040, 2031, 2039, 1539, 1522, 1534, 1554, 1557, 1564, 2039, 2025, 2047, 2050, 2087, 2051, 2037, 2036, 2034, 1970, 2071, 2028, 1912, 1916, 2092, 1560, 1559, 1607, 2020, 1992, 2026, 1602, 1611, 1603, 1857, 1847, 1842, 1991, 2034, 2026, 1681, 1654, 1756, 1609, 1583, 1608, 2039, 2033, 2032, 1599, 1577, 1585, 2020, 2002, 2013, 1712, 1707, 1694, 1855, 1886, 1856, 1746, 1755, 1739, 1559, 1635, 1603, 2038, 2059, 2035, 1598, 1596, 1597, 1977, 1963, 1988, 1521, 1529, 1534, 1525, 1538, 1539, 1571, 1560, 1592, 1589, 1632, 1638, 1623, 1625, 106, 1590, 1595, 1591, 1608, 1613, 1610, 1981, 1984, 2019, 2014, 2013, 2002, 2069, 2087, 2089, 2026, 2021, 2020, 1989, 2007, 1969, 1963, 1962, 1989, 2036, 2038, 2035, 1621, 1619, 1625, 1565, 1562, 1564, 1963, 1976, 1978, 1714, 1697, 1699, 1722, 1746, 1723, 2042, 2054, 2057, 2024, 2059, 2093, 2064, 2062, 2065, 2086, 1521, 1548, 2087, 2069, 2044, 1630, 2094, 106, 1695, 1698, 1701, 1973, 1981, 1978, 1993, 2014, 2002, 2095, 1895, 1894, 1511, 1502, 1807, 1903, 1897, 1899, 1751, 1749, 1748, 1809, 1819, 1807, 1769, 1783, 1787, 1795, 1787, 1788, 1714, 1709, 1711, 1770, 1797, 1796, 1778, 1784, 1779, 1777, 1793, 1492, 1789, 1795, 1788, 1823, 1502, 1504, 1778, 1773, 1507, 1813, 1800, 1812, 1803, 1802, 1790, 1783, 1782, 1361, 1961, 1941, 1946, 1929, 1764, 1942, 1926, 1943, 1763, 1959, 1957, 1956, 1941, 1929, 1928, 1941, 1764, 1929, 2096, 1958, 1960, 2076, 1710, 1691, 1953, 1958, 1956, 1789, 1793, 1779, 1668, 1667, 1655, 1655, 1680, 2097, 1685, 1684, 1679, 1859, 1855, 1858, 1674, 1661, 1673, 1750, 1757, 1743, 1940, 1961, 1951, 1645, 1666, 1646, 1735, 1674, 1753, 1851, 1868, 1863, 1843, 1831, 2098, 1843, 2098, 1846, 1686, 1662, 1663, 1736, 1693, 1696, 1879, 1888, 1880, 1854, 1856, 1858, 1859, 1839, 1860, 1681, 1680, 1655, 1661, 1654, 1653, 1684, 1685, 1676, 1718, 2075, 1719, 1715, 1714, 1713, 1704, 1731, 1701, 1717, 1742, 1720, 1724, 1727, 1726, 2079, 1741, 1753, 1795, 1789, 1784, 1509, 1508, 1506, 1831, 1850, 1832, 1849, 1832, 1850, 1845, 1847, 1853, 1837, 1862, 1838, 1833, 1849, 1830, 1934, 1939, 1940, 1698, 1697, 1714, 1725, 1743, 1732, 1658, 1647, 1646, 1917, 2099, 1955, 1678, 1669, 1917, 1892, 1889, 1891, 1702, 1717, 1696, 1732, 1757, 1518, 1825, 1824, 1830, 1669, 1655, 1918, 1655, 2097, 2100, 1657, 1670, 1672, 1698, 1695, 1699, 1738, 1720, 1723, 2073, 1690, 1691, 1707, 1714, 1699, 1659, 1650, 1664, 1953, 1960, 1958, 1934, 1798, 1938, 1967, 1969, 2013, 1762, 1941, 1939, 1913, 1912, 1893, 1795, 1770, 1796, 1648, 1662, 1513, 1532, 1531, 1558, 2101, 1866, 2084, 1867, 1866, 2101, 1902, 1897, 1910, 2102, 2103, 1994, 2104, 2082, 2083, 1995, 1994, 2103, 2022, 2040, 2105, 2056, 2055, 2106, 2107, 2102, 2105, 2102, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2088, 2115, 2049, 2116, 2093, 2059, 2081, 2115, 2117, 2118, 1589, 1638, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 2127, 1594, 2128, 2129, 2126, 2120, 2130, 2126, 2125, 2121, 2131, 2132, 2122, 2105, 1994, 2004, 2123, 2133, 2134, 2128, 2133, 2119, 2135, 2124, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2138, 2153, 2154, 2155, 2156, 2147, 2157, 2148, 2158, 2159, 2160, 2161, 2146, 2148, 2153, 2141, 2152, 2138, 2152, 2139, 2162, 2163, 2164, 2165, 2166, 2167, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2167, 2176, 2165, 2177, 2178, 1914, 2179, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 2187, 2168, 2188, 2169, 2176, 2189, 2190, 2191, 2192, 2175, 2176, 2167, 2169, 2193, 2194, 2195, 2148, 2196, 2161, 2197, 2174, 2196, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 2192, 2205, 2206, 2175, 2197, 2207, 2208, 2209, 2210, 2209, 2211, 2165, 2197, 2196, 2212, 2213, 2214, 2215, 2210, 2211, 2216, 2217, 2218, 2219, 2220, 2221, 2148, 2157, 2222, 2223, 2224, 2225, 2192, 2204, 2175, 2171, 2170, 2226, 2227, 2204, 2163, 2204, 2228, 2229, 2212, 2230, 2213, 2231, 2232, 2195, 2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 2245, 2246, 2247, 2192, 2247, 2205, 2248, 2205, 2249, 2250, 2143, 2251, 2170, 2182, 2226, 2214, 2220, 2252, 2230, 2212, 2228, 2253, 2254, 2255, 2214, 2216, 2212, 2256, 2257, 2225, 2258, 2225, 2224, 2259, 2260, 2261, 2262, 2263, 2264, 2160, 2265, 2266, 2223, 2267, 2268, 2265, 2269, 2266, 2184, 2217, 2182, 2270, 2271, 2248, 2259, 2160, 2260, 2272, 2269, 2265, 2255, 2254, 2220, 2213, 2230, 2273, 2253, 2274, 2275, 2276, 2187, 2277, 2184, 2278, 2279, 2251, 2279, 2250, 2181, 2280, 2261, 2218, 2184, 2279, 2281, 2204, 2205, 2282, 2245, 2247, 2280, 2181, 2180, 2183, 2156, 2278, 2217, 2283, 2226, 2280, 2259, 2261, 2283, 2284, 2171, 2236, 2238, 2243, 2180, 2179, 2146, 2285, 2286, 2287, 2232, 2179, 2181, 2271, 2270, 2288, 2228, 2204, 2289, 2179, 2290, 2147, 2244, 2238, 2248, 2228, 2212, 2229, 2225, 2257, 2291, 2292, 2293, 2294, 2224, 2268, 2295, 2296, 2288, 2267, 2151, 2297, 2298, 2299, 2300, 2301, 2302, 2259, 2180, 2303, 2264, 2304, 2305, 2198, 2200, 2250, 2278, 2156, 2296, 2289, 2271, 2304, 2306, 2307, 2236, 2258, 2224, 2227, 2173, 2175, 2245, 2308, 2286, 2183, 2278, 2184, 2239, 2307, 2240, 2309, 2310, 2311, 2312, 2264, 2303, 2313, 2191, 2206, 2271, 2289, 2281, 2258, 2243, 2314, 2248, 2238, 2270, 2276, 2315, 2185, 2316, 2253, 2275, 2198, 2305, 2294, 2264, 2317, 2304, 2318, 2306, 2304, 2274, 2255, 2319, 2159, 2320, 2321, 2244, 2243, 2238, 2322, 2323, 2324, 2287, 2325, 2207, 2326, 2309, 2292, 2289, 2327, 2230, 2328, 2329, 2330, 2331, 2240, 2307, 2306, 2257, 2256, 2294, 2305, 2332, 2285, 2333, 2286, 2334, 2335, 2336, 2314, 2242, 2240, 2257, 2277, 2291, 2337, 2338, 2339, 2340, 2294, 2332, 2304, 2307, 2303, 2325, 2287, 2308, 2258, 2256, 2225, 2264, 2312, 2262, 2325, 2208, 2207, 2341, 2342, 2343, 2338, 2344, 2345, 2232, 2181, 2195, 2141, 2346, 2142, 2140, 2142, 2231, 2329, 2328, 2345, 2261, 2347, 2193, 2348, 2349, 2350, 2329, 2351, 2352, 2256, 2314, 2331, 2157, 2177, 2222, 2200, 2186, 2305, 2353, 2347, 2260, 2341, 2354, 2149, 2339, 2328, 2355, 2356, 2301, 2235, 2356, 2234, 2298, 2357, 2315, 2358, 2338, 2337, 2316, 2151, 2359, 2149, 2360, 2353, 2266, 2353, 2360, 2361, 2362, 2360, 2363, 2299, 2350, 2364, 2260, 2266, 2353, 2365, 2366, 2367, 2367, 2360, 2266, 2361, 2347, 2353, 2266, 2260, 2160, 2368, 2360, 2367, 2368, 2366, 2363, 2369, 2297, 2370, 2369, 2371, 2301, 2156, 2144, 2250, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2324, 2323, 2381, 2382, 1797, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2388, 2380, 2390, 2391, 2392, 2393, 2376, 2375, 2394, 2395, 2396, 2397, 2398, 2097, 1680, 2398, 2399, 2400, 2377, 2401, 2402, 2257, 2306, 2318, 2249, 2403, 2242, 2236, 2404, 2237, 2404, 2236, 2295, 2403, 2246, 2245, 2187, 2274, 2319, 2239, 2405, 2303, 2332, 2185, 2315, 2319, 2277, 2187, 2318, 2277, 2257, 2242, 2241, 2240, 2243, 2242, 2314, 2282, 2191, 2208, 2310, 2285, 2311, 2406, 2287, 2207, 1913, 2407, 2222, 2408, 2168, 2407, 2408, 1902, 1910, 2409, 2407, 2166, 2410, 2190, 2189, 2411, 1909, 1885, 1874, 2412, 1875, 2413, 2410, 2189, 2414, 2413, 2415, 1875, 2412, 2414, 2166, 2168, 2167, 2188, 2168, 1910, 2188, 2411, 2169, 2416, 2413, 2414, 2416, 2412, 2417, 2418, 2211, 2412, 2418, 1874, 2215, 2419, 2412, 2211, 2419, 2420, 2417, 2190, 2313, 2206, 2191, 2282, 2247, 2421, 2422, 2423, 2424, 1886, 2422, 2420, 2410, 2417, 2202, 2425, 2422, 2203, 2426, 2427, 2310, 2309, 2333, 2428, 2423, 1887, 2427, 2429, 2430, 2427, 2431, 2429, 2426, 2432, 2427, 2426, 2203, 2422, 2426, 2421, 2432, 2410, 2313, 2190, 2202, 2101, 2425, 2208, 2325, 2282, 2412, 2416, 2414, 2425, 2424, 2422, 2415, 2411, 1885, 2406, 2285, 2287, 2406, 2433, 2434, 2313, 2410, 2420, 2176, 2197, 2165, 1884, 1875, 2414, 2220, 2214, 2213, 2435, 2217, 2216, 2435, 2436, 2283, 2436, 2219, 2437, 2219, 2438, 2437, 2273, 2255, 2220, 2438, 2439, 2440, 2267, 2273, 2327, 2441, 2442, 2330, 2221, 2220, 2254, 2221, 2443, 2219, 2444, 2352, 2445, 2445, 2352, 2446, 2329, 2441, 2330, 2440, 2355, 2438, 2440, 2443, 2339, 2443, 2221, 2254, 2439, 2443, 2440, 2442, 2438, 2355, 2150, 2297, 2151, 2447, 2448, 2233, 2300, 2449, 2447, 2450, 2451, 2452, 2369, 2301, 2298, 2338, 2359, 2151, 1567, 1570, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 1548, 2458, 2457, 2459, 2461, 2459, 2458, 2462, 2463, 2464, 2465, 2459, 2110, 2112, 2460, 2457, 2466, 2106, 2463, 2465, 2467, 1549, 2108, 2468, 2465, 2464, 2467, 1550, 1549, 2048, 2047, 2056, 2123, 2134, 2124, 2462, 2467, 2108, 2469, 2111, 2110, 1556, 1553, 1541, 2470, 1547, 1543, 2470, 2471, 1553, 2107, 2105, 2472, 2010, 2473, 2474, 2110, 2462, 2469, 2459, 2112, 2461, 2103, 2102, 2108, 2048, 2106, 2472, 2111, 2469, 2107, 1984, 1973, 2475, 1523, 1533, 1532, 2476, 2133, 2123, 2477, 1616, 2478, 2109, 2479, 2110, 2468, 2109, 2465, 1995, 2104, 2010, 2088, 2052, 2480, 2024, 2093, 2480, 2019, 2131, 1986, 2103, 2108, 1549, 1555, 2082, 2481, 2460, 2458, 2457, 2056, 2106, 2048, 2479, 2112, 2110, 2453, 2478, 1616, 2482, 2475, 1979, 2476, 2456, 2455, 2461, 2112, 2114, 2472, 2105, 2040, 2048, 2472, 2040, 2483, 2466, 2461, 2114, 2113, 2484, 2107, 2469, 2108, 2485, 2465, 2109, 2004, 2022, 2105, 2111, 2485, 2109, 1616, 2477, 2083, 2468, 2113, 2109, 1547, 2470, 1553, 2477, 2474, 2473, 2111, 2472, 2485, 2486, 1535, 1537, 2115, 2480, 2093, 2487, 2468, 2464, 2474, 2477, 2478, 1543, 1535, 2486, 2116, 2115, 2093, 2011, 2010, 2070, 2458, 1548, 2467, 2019, 1984, 2475, 2133, 2118, 2134, 2234, 2351, 2345, 2456, 2132, 2482, 2433, 2406, 2207, 2488, 2489, 2490, 2118, 1638, 2491, 2010, 2474, 2127, 2163, 2229, 2492, 2493, 2365, 2367, 2449, 2300, 2364, 2466, 2457, 2461, 2186, 2332, 2305, 2407, 1892, 1902, 2129, 2494, 1572, 2495, 2496, 2497, 2413, 2416, 2417, 2366, 2368, 2367, 2498, 2499, 2500, 2455, 2454, 2130, 2501, 2172, 2500, 2491, 1629, 1631, 2128, 2121, 2129, 2433, 2502, 2434, 2203, 2202, 2422, 2220, 2219, 2436, 2132, 2131, 2482, 2101, 2084, 2425, 2136, 2134, 2491, 2129, 1572, 1594, 2300, 2447, 2235, 2446, 2503, 2504, 2482, 1979, 2505, 2502, 2433, 2215, 2082, 2104, 1995, 2499, 2506, 2500, 1887, 1844, 2428, 2505, 1979, 1967, 2103, 2082, 1995, 1549, 2481, 2103, 2493, 2507, 2365, 2500, 2172, 2498, 2508, 2378, 2324, 2456, 2476, 2123, 2397, 2509, 2399, 1550, 2467, 1548, 2119, 2455, 2130, 2510, 2511, 2512, 2354, 2370, 2297, 2297, 2150, 2354, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2372, 2372, 2521, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2395, 2529, 2396, 2527, 2097, 2528, 2530, 2531, 2532, 1715, 1713, 2533, 2534, 2385, 2384, 2535, 2536, 2537, 2472, 2111, 2107, 1499, 2037, 2034, 1743, 1744, 1758, 2538, 1690, 2073, 2132, 2456, 2122, 1798, 1761, 1938, 2539, 1814, 2515, 2540, 2541, 2542, 2372, 2522, 2519, 1796, 2384, 1787, 2346, 2153, 2177, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2443, 2253, 2550, 2551, 2146, 2216, 2218, 2212, 2423, 2428, 2552, 1884, 2414, 1885, 2214, 2252, 2216, 2126, 2553, 2127, 2471, 1541, 1553, 2481, 2082, 2103, 2480, 2052, 2024, 2465, 2485, 2106, 2454, 2456, 2482, 1553, 1556, 1531, 2070, 2010, 2127, 2121, 2125, 2453, 2133, 2476, 2455, 2455, 2119, 2133, 2462, 2110, 2459, 1538, 2554, 1536, 2479, 2109, 2113, 2453, 2125, 2478, 2104, 2083, 2473, 2494, 1570, 1572, 2478, 2125, 2474, 2123, 2122, 2456, 2555, 2124, 2556, 2070, 2553, 1967, 2482, 2019, 2475, 1631, 2136, 2491, 2124, 2555, 2122, 2555, 1983, 1986, 2120, 2126, 2121, 2453, 2494, 2121, 1616, 1567, 2453, 2475, 1975, 1979, 1975, 2475, 1973, 2115, 2088, 2480, 2119, 2121, 2128, 2115, 2081, 2049, 1975, 1968, 1979, 1594, 1589, 2118, 2131, 2122, 2555, 2557, 1037, 2558, 1631, 1628, 2559, 1983, 2555, 2557, 2560, 2556, 2124, 1982, 1983, 2558, 2561, 2562, 2135, 2013, 2070, 1967, 2477, 2473, 2083, 2505, 2454, 2482, 2115, 2116, 2117, 2120, 2119, 2130, 2454, 2553, 2130, 2134, 2136, 2124, 2135, 2562, 2124, 2159, 2158, 2320, 2105, 2102, 1994, 2558, 1983, 2557, 2462, 2458, 2467, 2106, 2485, 2472, 2563, 2564, 2565, 2469, 2462, 2108, 1785, 2566, 2061, 2567, 2568, 2569, 2494, 2129, 2121, 2130, 2553, 2126, 2463, 2106, 2055, 1548, 2460, 2086, 2112, 2479, 2113, 2570, 2571, 2572, 2573, 2574, 2373, 2556, 2557, 2555, 2128, 1594, 2118, 2553, 2070, 2127, 2474, 2125, 2127, 2562, 2560, 2124, 2542, 2535, 2575, 2491, 1638, 1629, 2019, 2482, 2131, 2553, 2454, 2505, 2491, 2134, 2118, 2118, 2133, 2128, 2473, 2010, 2104, 1570, 2494, 2453, 2576, 2506, 2577, 2576, 2500, 2506, 2578, 2579, 2488, 2580, 2581, 2582, 2583, 2495, 2497, 2172, 2501, 2170, 2265, 2145, 2156, 2154, 2511, 2510, 2446, 2352, 2584, 2577, 2444, 2445, 2357, 2317, 2340, 2351, 2448, 2584, 2365, 2507, 2585, 2150, 2149, 2354, 2586, 2152, 2140, 2156, 2272, 2265, 2360, 2368, 2363, 2290, 2587, 2346, 2168, 2408, 1910, 2183, 2182, 2154, 2311, 2430, 2309, 2267, 2223, 2319, 1885, 2414, 2415, 2197, 2176, 2206, 2405, 2239, 2241, 2175, 2206, 2191, 2306, 2331, 2307, 2263, 2262, 2294, 2578, 2576, 2577, 2192, 2191, 2247, 2582, 2488, 2579, 2326, 2262, 2312, 2268, 2224, 2223, 2149, 2275, 2200, 2430, 2203, 2427, 2412, 1874, 2418, 2246, 2403, 2249, 2234, 2151, 2298, 2277, 2318, 2358, 2303, 2286, 2312, 2588, 2583, 2497, 2317, 2263, 2340, 2210, 2215, 2433, 2242, 2244, 2249, 2199, 2589, 2590, 2154, 2510, 2493, 2285, 2406, 2434, 2288, 2296, 2271, 2290, 2179, 2587, 2255, 2273, 2319, 2347, 2261, 2260, 2550, 2146, 2161, 2448, 2447, 2449, 2141, 2153, 2346, 2279, 2251, 2492, 2270, 2238, 2237, 2269, 2272, 2155, 2166, 2165, 2409, 2178, 1916, 1914, 2551, 2550, 2162, 2436, 2252, 2220, 1902, 2408, 2407, 2411, 2188, 1910, 2591, 2592, 2364, 2444, 2577, 2506, 2205, 2248, 2281, 2174, 2197, 2175, 2218, 2229, 2212, 2496, 2495, 2579, 2266, 2269, 2367, 2550, 2161, 2174, 2222, 2177, 1914, 2216, 2252, 2435, 2290, 2346, 2177, 2284, 2437, 2438, 2490, 2170, 2501, 2141, 2140, 2152, 1892, 2407, 1913, 2348, 2301, 2371, 2153, 2178, 2177, 2445, 2497, 2577, 2593, 2594, 2512, 2254, 2253, 2443, 2595, 2596, 2597, 2594, 2510, 2512, 2598, 2140, 2231, 1916, 2178, 2153, 2344, 2338, 2151, 2587, 2232, 2142, 2232, 2231, 2142, 2262, 2326, 2292, 2497, 2445, 2588, 2584, 2448, 2503, 2579, 2599, 2582, 2599, 2580, 2582, 2269, 2155, 2493, 2158, 2259, 2320, 2600, 2596, 2595, 2259, 2158, 2160, 2592, 2449, 2364, 1916, 2137, 2092, 2493, 2367, 2269, 2577, 2496, 2579, 2551, 2162, 2164, 2302, 2320, 2259, 2582, 2601, 2489, 2296, 2327, 2289, 2222, 2409, 2148, 2177, 2157, 2290, 2218, 2279, 2229, 2488, 2490, 2501, 2268, 2267, 2288, 2236, 2243, 2258, 2551, 2302, 2180, 2511, 2170, 2490, 2146, 2551, 2180, 2300, 2235, 2301, 2241, 2403, 2245, 2309, 2293, 2292, 2436, 2437, 2283, 2355, 2330, 2442, 2179, 2232, 2587, 2328, 2339, 2338, 2437, 2284, 2283, 2320, 2302, 2164, 2164, 2163, 2492, 2449, 2504, 2503, 2157, 2147, 2290, 2225, 2291, 2223, 2593, 2602, 2594, 2271, 2281, 2248, 2173, 2227, 2162, 2327, 2273, 2230, 2196, 2409, 2165, 2204, 2281, 2289, 2272, 2156, 2155, 2603, 2604, 2605, 2606, 2607, 2564, 2567, 2608, 1925, 1797, 2534, 2384, 2609, 2546, 2610, 2538, 2073, 1705, 2611, 2508, 2324, 2379, 2378, 2508, 2612, 2520, 2613, 2614, 2613, 2520, 2611, 2381, 2382, 2382, 2383, 2508, 1510, 1811, 2379, 1797, 2382, 2615, 1814, 2616, 1810, 2549, 2316, 2337, 2191, 2420, 2208, 2388, 2378, 2380, 1509, 1811, 1510, 2515, 1814, 1813, 1810, 2380, 1811, 2570, 2572, 2617, 1811, 2380, 2379, 2618, 2399, 2509, 2387, 2378, 2388, 2382, 2381, 2615, 1787, 2384, 2619, 2383, 1771, 2379, 2508, 2611, 2382, 2616, 1814, 2539, 1797, 2615, 2534, 1771, 2383, 1797, 2620, 2391, 2393, 2521, 2621, 1730, 2378, 2387, 2324, 2622, 2623, 2516, 2391, 2375, 2377, 2381, 2611, 2324, 2624, 1744, 1729, 2389, 2388, 2390, 1769, 1787, 1785, 2383, 2379, 2508, 2386, 2619, 2384, 2625, 2566, 2626, 2072, 2061, 2566, 1739, 2078, 1745, 2377, 2402, 2627, 2608, 1926, 1925, 2628, 2626, 2386, 2384, 1796, 1797, 2629, 1925, 1930, 2630, 2631, 2530, 2619, 1785, 1787, 2619, 2386, 2566, 2568, 2567, 2628, 2629, 2567, 1925, 1930, 2632, 2629, 2618, 2633, 2400, 1844, 1887, 1855, 1510, 2379, 1771, 2505, 1967, 2553, 2422, 1886, 2634, 1715, 2533, 2635, 2621, 2624, 1730, 2061, 2072, 1759, 2517, 2516, 2636, 2514, 2539, 2515, 2607, 2402, 2613, 2632, 2625, 2629, 2569, 2608, 2567, 2614, 2519, 2637, 2541, 2518, 2617, 2638, 2639, 2540, 2548, 2547, 2640, 2541, 2641, 2542, 2520, 2612, 2373, 2642, 2643, 2531, 2644, 2641, 2645, 2646, 2574, 2401, 2535, 2537, 2575, 2546, 2647, 2610, 2401, 2573, 2402, 2377, 2627, 2392, 2614, 2520, 2519, 2612, 2613, 2402, 2541, 2617, 2572, 2636, 2570, 2517, 2648, 2649, 2650, 1730, 1704, 2651, 2612, 2573, 2373, 2518, 2622, 2516, 2401, 2377, 2376, 2393, 2638, 2620, 2517, 2570, 2617, 2652, 2610, 2631, 2652, 2571, 2570, 2653, 2375, 2620, 2653, 2654, 2394, 2575, 2654, 2620, 2655, 2656, 2657, 2657, 2528, 2655, 2390, 2380, 1810, 2571, 2652, 2631, 2537, 2655, 2654, 2509, 2646, 2618, 2400, 2658, 2659, 2574, 2646, 2509, 2392, 2391, 2377, 2400, 2659, 2097, 2660, 2524, 2654, 1756, 2661, 1681, 2311, 2285, 2434, 2623, 2393, 2392, 1834, 1643, 2662, 2395, 1682, 2661, 2663, 2664, 2665, 2666, 2667, 2668, 2334, 2336, 2370, 2144, 2156, 2145, 1846, 2428, 1844, 2524, 2523, 2669, 2205, 2247, 2246, 2670, 2591, 2450, 2671, 2672, 2590, 2673, 2674, 1515, 2661, 1682, 1681, 2396, 2675, 2509, 2622, 2638, 2393, 2431, 2427, 2432, 2349, 2371, 2336, 1867, 2215, 1874, 2333, 2326, 2312, 1758, 2661, 1756, 2422, 2421, 2426, 2509, 2397, 2396, 2343, 2334, 2354, 2509, 2675, 2574, 2654, 2575, 2537, 2573, 2612, 2402, 2393, 2623, 2622, 2097, 2659, 2525, 2528, 2525, 2660, 1918, 1655, 2100, 2525, 2528, 2097, 2646, 2633, 2618, 2655, 2660, 2654, 2574, 2573, 2401, 2536, 2641, 2644, 2658, 2394, 2523, 2537, 2536, 2656, 2535, 2542, 2641, 2542, 2638, 2540, 2607, 2667, 2564, 2375, 2653, 2394, 2669, 2394, 2654, 2641, 2572, 2631, 2644, 2645, 2676, 2660, 2655, 2528, 2399, 2398, 1680, 2542, 2620, 2638, 2372, 2374, 2521, 1682, 2397, 2399, 2392, 2627, 2606, 2097, 2398, 2400, 1704, 1698, 1715, 2651, 2522, 2521, 2373, 2574, 2675, 2677, 2678, 1715, 1730, 2651, 2521, 2677, 1715, 2635, 2635, 2679, 2519, 2621, 2675, 2529, 2522, 2651, 2678, 2675, 2396, 2529, 2540, 2639, 2518, 2675, 2374, 2373, 2675, 2621, 2521, 2335, 2334, 2680, 1785, 2061, 1781, 2409, 2196, 2148, 2289, 2230, 2228, 2364, 2681, 2591, 2451, 2450, 2681, 2234, 2356, 2235, 2680, 2682, 2683, 2350, 2299, 2301, 2684, 2335, 2685, 2235, 2447, 2233, 2498, 2171, 2284, 2421, 2423, 2552, 2684, 2452, 2349, 2350, 2349, 2681, 2330, 2355, 2328, 2354, 2341, 2343, 2325, 2308, 2282, 2351, 2234, 2233, 2686, 2671, 2687, 2423, 2422, 2634, 2319, 2223, 2291, 2334, 2343, 2680, 2359, 2275, 2149, 2145, 2160, 2159, 2576, 2578, 2501, 2333, 2312, 2286, 2304, 2358, 2318, 2684, 2336, 2335, 2316, 2549, 2253, 2226, 2182, 2217, 2446, 2588, 2445, 2297, 2369, 2298, 2590, 2687, 2671, 2451, 2349, 2452, 2364, 2350, 2681, 2352, 2441, 2329, 2349, 2336, 2684, 2315, 2277, 2358, 2349, 2451, 2681, 2664, 2688, 2662, 2293, 2199, 2198, 1753, 1673, 1754, 2654, 2653, 2620, 2659, 2523, 2525, 1713, 1710, 2077, 1682, 2395, 2397, 2679, 2635, 2533, 2524, 2669, 2654, 2522, 2678, 2677, 2517, 2617, 2518, 2399, 2618, 2400, 2689, 2690, 2691, 2374, 2675, 2521, 2589, 2431, 2590, 2498, 2442, 2499, 2443, 2549, 2337, 2331, 2314, 2240, 2199, 2293, 2589, 2371, 2370, 2336, 2315, 2357, 2340, 2252, 2436, 2435, 2213, 2273, 2220, 2692, 2209, 2210, 2692, 2433, 2207, 2182, 2170, 2154, 2327, 2296, 2267, 2211, 2418, 2215, 2217, 2435, 2283, 2273, 2267, 2319, 2443, 2439, 2219, 2191, 2313, 2420, 2308, 2287, 2286, 2439, 2438, 2219, 2300, 2299, 2364, 2500, 2576, 2501, 2682, 2343, 2342, 2205, 2246, 2249, 2275, 2274, 2200, 1914, 1913, 2222, 2370, 2354, 2334, 2355, 2440, 2339, 2634, 1887, 2423, 2301, 2356, 2298, 2172, 2171, 2498, 2251, 2143, 2159, 2498, 2284, 2442, 2285, 2310, 2333, 2234, 2344, 2151, 2449, 2592, 2693, 2193, 2181, 2261, 2186, 2274, 2187, 2301, 2348, 2350, 2597, 2601, 2582, 2317, 2357, 2358, 2332, 2186, 2185, 2234, 2345, 2344, 2166, 2407, 2168, 2359, 2338, 2316, 2420, 2419, 2211, 2314, 2256, 2258, 2159, 2321, 2251, 1874, 1871, 1867, 2351, 2329, 2345, 2506, 2499, 2441, 2677, 2635, 2519, 2572, 2641, 2541, 2286, 2405, 2245, 2245, 2282, 2308, 2349, 2348, 2371, 2309, 2430, 2429, 2605, 2679, 2533, 2270, 2237, 2288, 2523, 2659, 2658, 2449, 2503, 2448, 1704, 1715, 2678, 2510, 2594, 2507, 2496, 2577, 2497, 2492, 2229, 2279, 2277, 2319, 2291, 2229, 2163, 2204, 2208, 2420, 2209, 2403, 2241, 2242, 2179, 2147, 2146, 2407, 2409, 2222, 2211, 2209, 2420, 2217, 2184, 2218, 2315, 2340, 2332, 2236, 2224, 2295, 2144, 2143, 2250, 2286, 2303, 2405, 2206, 2176, 2190, 2245, 2405, 2241, 2153, 2137, 1916, 2138, 2137, 2153, 2249, 2244, 2248, 1909, 1882, 1885, 2441, 2444, 2506, 2174, 2173, 2550, 2504, 2449, 2693, 2404, 2288, 2237, 2346, 2587, 2142, 2492, 2251, 2321, 2352, 2444, 2441, 2412, 2419, 2417, 1909, 2411, 1910, 2438, 2442, 2284, 2511, 2490, 2512, 2181, 2193, 2195, 2302, 2551, 2164, 2595, 2597, 2581, 2442, 2441, 2499, 2584, 2352, 2351, 2360, 2362, 2361, 2599, 2579, 2495, 2156, 2183, 2154, 2596, 2593, 2694, 2579, 2578, 2577, 2448, 2351, 2233, 2259, 2280, 2180, 2424, 1856, 1886, 2209, 2692, 2207, 2342, 2199, 2682, 2326, 2333, 2309, 2253, 2255, 2274, 2434, 2201, 2430, 1887, 2634, 1886, 2511, 2154, 2170, 2430, 2311, 2434, 2256, 2331, 2306, 2307, 2239, 2303, 2687, 2590, 2431, 2695, 2696, 2683, 2275, 2359, 2316, 2187, 2276, 2185, 2682, 2199, 2697, 2501, 2578, 2488, 2431, 2589, 2293, 2342, 2341, 2149, 2199, 2590, 2697, 2338, 2345, 2328, 2343, 2682, 2680, 2101, 2502, 1867, 2288, 2404, 2295, 2682, 2697, 2683, 2262, 2292, 2294, 2417, 2410, 2413, 2432, 2421, 2687, 2145, 2265, 2160, 2101, 2202, 2502, 2202, 2201, 2502, 2203, 2430, 2201, 2443, 2337, 2339, 2215, 1867, 2502, 2371, 2369, 2370, 2431, 2293, 2429, 2149, 2200, 2342, 2434, 2502, 2201, 2507, 2493, 2510, 2504, 2588, 2446, 2433, 2692, 2210, 2283, 2171, 2226, 2199, 2342, 2200, 2446, 2584, 2503, 2432, 2687, 2431, 2155, 2154, 2493, 2204, 2227, 2175, 2698, 2600, 2595, 1729, 1730, 2624, 2624, 2529, 1758, 2527, 2100, 2097, 2699, 2700, 2688, 2656, 2655, 2537, 2376, 2633, 2401, 1682, 2399, 1680, 2690, 1918, 2701, 2674, 1677, 1685, 2647, 2530, 2610, 2546, 2548, 2642, 2530, 2532, 2630, 2661, 1758, 2529, 2620, 2542, 2575, 2642, 2548, 2702, 2647, 2546, 2642, 2609, 2703, 2547, 2667, 2666, 2704, 2631, 2630, 2645, 2530, 2647, 2642, 2631, 2645, 2641, 2546, 2609, 2547, 2641, 2536, 2535, 2518, 2541, 2540, 2649, 2705, 2706, 2077, 2603, 2605, 2644, 2691, 2536, 1513, 2707, 2708, 2669, 2523, 2394, 2533, 1713, 2077, 2668, 2613, 2614, 2373, 2372, 2520, 2658, 2400, 2633, 2392, 2606, 2623, 2522, 2677, 2519, 2709, 2710, 2711, 2633, 2376, 2394, 2638, 2622, 2639, 2633, 2394, 2658, 1704, 2678, 2651, 2645, 2630, 2676, 2712, 1955, 2713, 2699, 2709, 2714, 2606, 2563, 2623, 2524, 2660, 2525, 2674, 2715, 1677, 2716, 1919, 2717, 2564, 2563, 2606, 2704, 2564, 2667, 2718, 1514, 1519, 2712, 2719, 2720, 2679, 2637, 2519, 2721, 2705, 2648, 2690, 2713, 1955, 2713, 2690, 2722, 1654, 1683, 1756, 2547, 2723, 2640, 2624, 2621, 2529, 2633, 2646, 2401, 1744, 2624, 1758, 2402, 2607, 2627, 2642, 2531, 2530, 2665, 2724, 2717, 2529, 2395, 2661, 2547, 2703, 2723, 2631, 2572, 2571, 2375, 2391, 2620, 2630, 2725, 2676, 2639, 2622, 2518, 2668, 2667, 2607, 2631, 2610, 2530, 2613, 2668, 2607, 2533, 2077, 2605, 1744, 1725, 1729, 2606, 2627, 2607, 2555, 1986, 2131, 2695, 2683, 2697, 2672, 2697, 2590, 2293, 2198, 2294, 2293, 2309, 2429, 2358, 2304, 2317, 2263, 2317, 2264, 2315, 2276, 2277, 2340, 2263, 2294, 2450, 2591, 2681, 2186, 2200, 2274, 2295, 2268, 2288, 2143, 2145, 2159, 2278, 2250, 2279, 2320, 2164, 2492, 2173, 2162, 2550, 2321, 2320, 2492, 2162, 2227, 2163, 2161, 2196, 2174, 2413, 2189, 2726, 2189, 2176, 2726, 2176, 2169, 2726, 2169, 2411, 2726, 2411, 2415, 2726, 2415, 2413, 2726, 2674, 1935, 1515, 1734, 1752, 1735, 1660, 1754, 1673, 1660, 1672, 1754, 1653, 1659, 1661, 2625, 2632, 1760, 2632, 1930, 1760, 2629, 2628, 2567, 2626, 2566, 2386, 2625, 2072, 2566, 2629, 2625, 2626, 2628, 2629, 2626, 2566, 1785, 2619, 1760, 2072, 2625, 2558, 2017, 1982, 2079, 1753, 1754, 2665, 2664, 2662, 2663, 2720, 2710, 2690, 2689, 2722, 1644, 2727, 1937, 2728, 2714, 2545, 1923, 1641, 2706, 2729, 2538, 1705, 2730, 2731, 2732, 2538, 2730, 2732, 2733, 2538, 2732, 2730, 2538, 2729, 2705, 2721, 1923, 2734, 2648, 2735, 2714, 2725, 2545, 1834, 2649, 2706, 2649, 1834, 2662, 2735, 2648, 2650, 2662, 2688, 2736, 2689, 2676, 2737, 2738, 1643, 1642, 2738, 2724, 2665, 2736, 2688, 2650, 2727, 2706, 1641, 1921, 2727, 1641, 1937, 1944, 1644, 2727, 1921, 1937, 2727, 1644, 2706, 2739, 2738, 1642, 2716, 2717, 2724, 2706, 2705, 1923, 2700, 2728, 2735, 2650, 2700, 2735, 2716, 2740, 1500, 2664, 2699, 2688, 2662, 2738, 2665, 2728, 2700, 2699, 2663, 2665, 2717, 2709, 2699, 2710, 2707, 2712, 2720, 2714, 2728, 2699, 2543, 2532, 2531, 2725, 2630, 2532, 2725, 2543, 2545, 2708, 2663, 2717, 2663, 2710, 2664, 1955, 2099, 1918, 2676, 2689, 2644, 2719, 2711, 2720, 2709, 2725, 2714, 2710, 2699, 2664, 2712, 2707, 1686, 2100, 2741, 1918, 1513, 2708, 1919, 1955, 2712, 1678, 2720, 2663, 2708, 2725, 2709, 2711, 2737, 2711, 2689, 2708, 2717, 1919, 2722, 2712, 2713, 2722, 2689, 2711, 2710, 2720, 2711, 2711, 2719, 2722, 2719, 2712, 2722, 1686, 1678, 2712, 2707, 1513, 1686, 2711, 2737, 2725, 2708, 2707, 2720, 2737, 2676, 2725, 2690, 2656, 2536, 1918, 2690, 1955, 2526, 2690, 2701, 2691, 2644, 2689, 2690, 2536, 2691, 1917, 1918, 2099, 2526, 2741, 2527, 2657, 2526, 2528, 2716, 1520, 1919, 2656, 2526, 2657, 2526, 2656, 2690, 1918, 2526, 2701, 2741, 2526, 1918, 2741, 2100, 2527, 1520, 1514, 1919, 1520, 2716, 1500, 2688, 2700, 2650, 2738, 2739, 2724, 2662, 2736, 2649, 2740, 2716, 2724, 1644, 1834, 2706, 2736, 2650, 2649, 1643, 2738, 2662, 2532, 2543, 2725, 2705, 2649, 2648, 2531, 2643, 2543, 2545, 2544, 2735, 2735, 2728, 2545, 2724, 2742, 2740, 1648, 1935, 1685, 1515, 1514, 2718, 2715, 2674, 2673, 2715, 1665, 1677, 1935, 2674, 1685, 2718, 2673, 1515, 2742, 2724, 2739, 1932, 1650, 1676, 2544, 2734, 2735, 2489, 2601, 2597, 2694, 2490, 2597, 2593, 2512, 2694, 2490, 2489, 2597, 2593, 2596, 2602, 1829, 1401, 1393, 1434, 1285, 1498, 1258, 1266, 2471, 1542, 1266, 1268, 1269, 1542, 1268, 1542, 2471, 1266, 2471, 1542, 1541, 997, 996, 1273, 1271, 1542, 1269, 1284, 1586, 1281, 1634, 1281, 1586, 1630, 1618, 1284, 1319, 1737, 1484, 1688, 1330, 1316, 1737, 1329, 1484, 1315, 1688, 1316, 1326, 2078, 1342, 1768, 1354, 1348, 2743, 1383, 1251, 1380, 2744, 1381, 1381, 2745, 2746, 2744, 1380, 1249, 1489, 2744, 1249, 1251, 2747, 2743, 1391, 2748, 1388, 1392, 1829, 1393, 2749, 1411, 1396, 1416, 2750, 1417, 1442, 1441, 1493, 1985, 2016, 1481, 1451, 1457, 2067, 1499, 1473, 1490, 1450, 1481, 2016, 1468, 1467, 2751, 1480, 1985, 1481, 2067, 1480, 1451, 1283, 2752, 1630, 1381, 2746, 1375, 1437, 1441, 1442, 1499, 1463, 1462, 1586, 1284, 1618, 1477, 2751, 1467, 1468, 2751, 1471, 1284, 1283, 1630, 1265, 1258, 2471, 1280, 1281, 1634, 1455, 1987, 1457, 1366, 1367, 2753, 1434, 1498, 2754, 1347, 1768, 1348, 2755, 1471, 2751, 1335, 1320, 1483, 1478, 2742, 1479, 1665, 2715, 1301, 1504, 1489, 1382, 1425, 1915, 1426, 1944, 1501, 1642, 2748, 1835, 1830, 1537, 2090, 1260, 1260, 1262, 1537, 1262, 1259, 1537, 1271, 1270, 1637, 1270, 1276, 1637, 1271, 1540, 1542, 1637, 1276, 1577, 1271, 1557, 1540, 1579, 996, 1626, 1491, 1278, 1615, 1276, 1275, 1577, 1601, 1636, 1488, 1282, 1614, 1615, 996, 1579, 1275, 1613, 1601, 1488, 1487, 1491, 1615, 1630, 2752, 2094, 1488, 1487, 1613, 2752, 1012, 2094, 1478, 2740, 2742, 1294, 1665, 1486, 1294, 1292, 1666, 1296, 1670, 1300, 2729, 1321, 1335, 1705, 1321, 2729, 1319, 1330, 1716, 2075, 2074, 1328, 1737, 1719, 1329, 1734, 1733, 1344, 1733, 1741, 1343, 2075, 1329, 1719, 1330, 1688, 1692, 1330, 1692, 1716, 1745, 1332, 1738, 1733, 1343, 1344, 1332, 2074, 1738, 1716, 1737, 1319, 1336, 1338, 1740, 1337, 1747, 1734, 2079, 1671, 1345, 1345, 1343, 2079, 1339, 1345, 1671, 2715, 2673, 1301, 1748, 1336, 1740, 1332, 1745, 1326, 1741, 2079, 1343, 1748, 1747, 1337, 1748, 1337, 1336, 1780, 1355, 1351, 2753, 1367, 1799, 1354, 1780, 1351, 1361, 1782, 1364, 1789, 1361, 1492, 1782, 1347, 1364, 1791, 1369, 1371, 1772, 1367, 1369, 1371, 1375, 1792, 1791, 1772, 1369, 1670, 1657, 1300, 1805, 2745, 1512, 1805, 1803, 2746, 2745, 1805, 2746, 2744, 1489, 1821, 1383, 1504, 1382, 1792, 1375, 1803, 2745, 1821, 1512, 1824, 1389, 1410, 1860, 1395, 1837, 1401, 1829, 1862, 1862, 1837, 1395, 1395, 1401, 1862, 1870, 1869, 2749, 1872, 2749, 1396, 1403, 1405, 2080, 1883, 1882, 1405, 1883, 1405, 1406, 1413, 1883, 1406, 1421, 1418, 1900, 2080, 1405, 1908, 1421, 1900, 1419, 2750, 1426, 2095, 2750, 1416, 1426, 2742, 1501, 1479, 1302, 1301, 2673, 2742, 2739, 1501, 2754, 1498, 1920, 1337, 1734, 1344, 1431, 1355, 1936, 1954, 1933, 1428, 1936, 1355, 1798, 1342, 1740, 1338, 1961, 1443, 1951, 1436, 1945, 1441, 1433, 1428, 1951, 1501, 2739, 1642, 1945, 1957, 1441, 1494, 1958, 2096, 1945, 1436, 1443, 1443, 1242, 1244, 1443, 1433, 1951, 1493, 1958, 1494, 2730, 1335, 2731, 1496, 2731, 1483, 2067, 2066, 1480, 1987, 1455, 2012, 1459, 2015, 2009, 2015, 1459, 1460, 2015, 1461, 1972, 1464, 1990, 2018, 1990, 1463, 2029, 2018, 2071, 1464, 1972, 1461, 2071, 2059, 2038, 1490, 2050, 2081, 2755, 1482, 1471, 2117, 2038, 2037, 1490, 2089, 2755, 2751, 2748, 1830, 1388, 1964, 1965, 1457, 1474, 1482, 2117, 1958, 1493, 1959, 1454, 1459, 2012, 1665, 1294, 1666, 2078, 1326, 1745, 1443, 1961, 1945, 1418, 1403, 1906, 1425, 1419, 1911, 1388, 1824, 1410, 2749, 1872, 1870, 1395, 1860, 1861, 1405, 1882, 1908, 1413, 1877, 1883, 1433, 1443, 1244, 1392, 1827, 1829, 2745, 2744, 1821, 1463, 1990, 1464, 2755, 2089, 2087, 2087, 2050, 2755, 1454, 2012, 1455, 1610, 1613, 1487, 1315, 1321, 2068, 1933, 1951, 1428, 1985, 1480, 1980, 1278, 1282, 1615, 2066, 1980, 1480, 1457, 1987, 1964, 2751, 1477, 2089, 1450, 2016, 2017, 1459, 2009, 2012, 1965, 2067, 1457, 1615, 1610, 1487, 1335, 2730, 2729, 1461, 2015, 1460, 1280, 1614, 1282, 1503, 1821, 1489, 1489, 1504, 1503, 1791, 1371, 1792, 1823, 1504, 1383, 1492, 1366, 2753, 1492, 2753, 1799, 1492, 1361, 1362, 2745, 1381, 2744, 1441, 1959, 1493, 1389, 1827, 1392, 1657, 1299, 1300, 1329, 2075, 1328, 1332, 1328, 2074, 1375, 2746, 1803, 2095, 1426, 1895, 1425, 1911, 1915, 1915, 1895, 1426, 1418, 1906, 1900, 1264, 1260, 2091, 1265, 2470, 1543, 1471, 2081, 2117, 1471, 2755, 2081, 1259, 1265, 2486, 1944, 1937, 1435, 1537, 1259, 2486, 2059, 1490, 2116, 1474, 2117, 2116, 2071, 1461, 1464, 2471, 2470, 1265, 1543, 2486, 1265, 1490, 1474, 2116, 2600, 2594, 2602, 1497, 1302, 2718, 1497, 1519, 1500, 1302, 2673, 2718, 1499, 1490, 2037, 1335, 1483, 2731, 1501, 1944, 1435, 2740, 1478, 1500, 1519, 1497, 2718, 1920, 1640, 2754, 1937, 1498, 1435, 1920, 1498, 1937, 1302, 1497, 1427, 1486, 1665, 1301, 2600, 2602, 2596, 2595, 2756, 2698, 2488, 2582, 2489, 2694, 2512, 2490, 2581, 2597, 2582, 2596, 2694, 2597, 1238, 65, 1033, 986, 985, 1274, 1008, 983, 1009, 1272, 985, 997, 999, 2757, 991, 1278, 1491, 1001, 1488, 2757, 999, 1279, 1001, 1009, 999, 998, 1491, 1026, 1023, 1027, 1313, 1234, 1311, 1030, 1313, 1033, 1234, 1313, 1032, 1491, 998, 1001, 1313, 1030, 1032, 1033, 1313, 1312, 1036, 2758, 1109, 1624, 71, 1040, 1628, 1624, 1040, 1040, 2559, 1628, 1039, 2559, 60, 71, 1624, 1623, 107, 2094, 1013, 106, 72, 1623, 97, 2702, 1047, 2702, 97, 1048, 2643, 1048, 31, 2759, 1056, 2748, 1056, 1835, 2748, 1835, 1056, 1055, 45, 1640, 1215, 1063, 1232, 1922, 1232, 1639, 1922, 2731, 1060, 108, 2098, 1054, 1057, 2559, 1039, 68, 2758, 1036, 2556, 2559, 1040, 60, 68, 67, 2559, 2760, 1160, 1187, 2761, 1156, 2704, 2686, 1213, 1202, 1157, 1165, 2636, 1178, 1216, 2603, 2762, 1203, 2760, 1113, 2561, 69, 2559, 67, 1631, 1124, 1109, 2758, 121, 1072, 2561, 1124, 2561, 1072, 1121, 1037, 64, 1623, 72, 71, 1113, 121, 2561, 1152, 1156, 2761, 1162, 2565, 1161, 2703, 2609, 2763, 1077, 1087, 2764, 1179, 2765, 2764, 1135, 1152, 2761, 1165, 2703, 2636, 2766, 1213, 2686, 1088, 2764, 1162, 1134, 2761, 1217, 31, 30, 2767, 2768, 1094, 1141, 2696, 1218, 2769, 1179, 1157, 2636, 2604, 2603, 1216, 2764, 1088, 1077, 1208, 1164, 2098, 1226, 1922, 1230, 2428, 1846, 1203, 1170, 1206, 2769, 2762, 2428, 1203, 1187, 1213, 2760, 1158, 2760, 1203, 1160, 2760, 1158, 2671, 2686, 1097, 1846, 2098, 1163, 2565, 2764, 2563, 2604, 1089, 1177, 1156, 2565, 2564, 2565, 1162, 2764, 2761, 1134, 1135, 1179, 2636, 2516, 2770, 2696, 2769, 115, 1171, 2696, 1221, 1199, 2685, 1221, 2685, 1189, 2685, 1205, 1189, 2685, 2335, 2769, 1163, 2098, 1164, 1163, 1203, 1846, 1057, 1208, 2098, 1205, 2769, 1206, 2769, 1205, 2685, 1218, 2696, 1171, 1218, 1170, 2769, 2695, 1096, 116, 116, 115, 2695, 1097, 2686, 1202, 115, 2696, 2695, 2760, 1213, 2766, 2763, 2636, 2703, 2702, 1142, 1047, 2768, 2723, 1165, 2564, 2704, 1156, 2565, 1156, 1161, 1094, 2768, 1165, 2703, 1165, 2723, 2771, 30, 1229, 2604, 1177, 2605, 2570, 2636, 2763, 1179, 2764, 1087, 1089, 2604, 1216, 101, 2733, 2732, 2702, 2640, 1142, 1640, 1232, 1215, 108, 1069, 2732, 1069, 101, 2732, 2733, 101, 102, 30, 2771, 2767, 1640, 1639, 1232, 1226, 1231, 1922, 1231, 1063, 1922, 2643, 31, 2767, 991, 996, 992, 1234, 1236, 1239, 1038, 1240, 20, 1263, 990, 989, 986, 1274, 989, 985, 1272, 1274, 1283, 1004, 1012, 1001, 1279, 1278, 1009, 983, 1279, 1004, 983, 982, 2752, 1283, 1012, 1021, 1434, 1019, 1387, 1029, 1391, 1027, 1029, 1387, 1434, 2754, 1019, 1026, 1027, 1387, 983, 1004, 1283, 1036, 2557, 2556, 1048, 2642, 2702, 1691, 1178, 2076, 1054, 1833, 1055, 1054, 2098, 1831, 1833, 1835, 1055, 1230, 1922, 1923, 1689, 1178, 1691, 1178, 1689, 1131, 2557, 1036, 1037, 2642, 1048, 2643, 1689, 102, 1131, 2765, 2563, 2764, 2450, 2452, 1199, 2335, 2680, 2770, 2610, 2652, 2763, 2761, 2704, 1217, 1141, 1142, 2640, 2637, 2679, 1133, 2421, 2766, 2687, 67, 69, 2136, 2561, 1124, 2562, 106, 2094, 107, 1121, 2558, 1037, 69, 2135, 2136, 2560, 2562, 1124, 67, 2136, 1631, 2135, 69, 2561, 2556, 2560, 1124, 1124, 2758, 2556, 2640, 2702, 2548, 2766, 2552, 2760, 2605, 1177, 2679, 1177, 1133, 2679, 1133, 1132, 2637, 2672, 2671, 1096, 2765, 1179, 2516, 1132, 1217, 2637, 2763, 2609, 2610, 2552, 2428, 2762, 2563, 2765, 2623, 2652, 2570, 2763, 2076, 1178, 2077, 2765, 2516, 2623, 1217, 2666, 2668, 1096, 2671, 1097, 2683, 2770, 2680, 2684, 1199, 2452, 2696, 2770, 2683, 2668, 2614, 1217, 2697, 2672, 1096, 2335, 2770, 2769, 1199, 2670, 2450, 2687, 2766, 2686, 1199, 2684, 2685, 1198, 2670, 1199, 1229, 2721, 2648, 2762, 2760, 2552, 2552, 2766, 2421, 1096, 2695, 2697, 2614, 2637, 1217, 1141, 2723, 2768, 2640, 2723, 1141, 2666, 1217, 2704, 2734, 2544, 2767, 2077, 1178, 2603, 2017, 2558, 1121, 2538, 2733, 102, 1690, 2538, 102, 2731, 108, 2732, 2771, 2734, 2767, 2543, 2643, 2767, 2648, 2734, 1229, 2721, 1229, 1230, 2734, 2771, 1229, 2544, 2543, 2767, 1923, 2721, 1230, 1311, 1234, 1239, 1311, 1239, 1496, 2757, 996, 991, 2757, 1636, 1626, 996, 2757, 1626, 1012, 1013, 2094, 1640, 45, 2754, 1496, 1060, 2731, 45, 1019, 2754, 1060, 1496, 1239, 1636, 2757, 1488, 1450, 2017, 1121, 20, 1450, 1121, 1450, 20, 1240, 757, 306, 302, 302, 783, 1005, 306, 308, 302, 767, 760, 768, 826, 971, 2772, 822, 826, 11, 822, 23, 820, 820, 23, 634, 1041, 776, 778, 778, 773, 1041, 1042, 791, 2773, 2773, 791, 2774, 34, 810, 813, 2774, 799, 2775, 830, 829, 1052, 2776, 100, 47, 2777, 824, 47, 2778, 1143, 2779, 1143, 2778, 829, 829, 828, 1143, 1052, 817, 830, 799, 2774, 791, 810, 34, 806, 8, 809, 1067, 815, 817, 100, 809, 8, 807, 815, 47, 824, 815, 2776, 47, 824, 28, 1067, 1067, 809, 972, 1067, 7, 8, 8, 17, 807, 2772, 11, 826, 23, 1117, 634, 100, 2776, 815, 62, 2772, 950, 54, 781, 776, 824, 1067, 972, 791, 1042, 790, 843, 113, 841, 904, 1123, 893, 967, 1095, 852, 1095, 913, 1075, 1151, 882, 1078, 856, 855, 1167, 1095, 922, 852, 851, 853, 1076, 922, 1086, 853, 853, 1086, 1076, 2780, 2781, 919, 2782, 2783, 880, 1138, 909, 879, 807, 17, 949, 1219, 1101, 865, 2784, 2785, 896, 122, 906, 1111, 847, 1111, 906, 1120, 1111, 847, 896, 1125, 2784, 847, 894, 1120, 894, 889, 1120, 2785, 887, 896, 906, 122, 1123, 887, 2785, 885, 1123, 904, 905, 906, 1123, 905, 848, 913, 1095, 860, 2782, 880, 909, 1138, 908, 1139, 879, 878, 1150, 878, 963, 1107, 880, 2783, 883, 882, 1151, 1138, 879, 1139, 1150, 1139, 878, 975, 1144, 1150, 863, 946, 2786, 1095, 967, 848, 919, 1222, 2780, 2786, 864, 863, 919, 918, 1222, 1145, 975, 883, 787, 2787, 917, 941, 937, 1183, 915, 931, 1223, 918, 865, 1222, 934, 919, 2781, 841, 113, 943, 931, 929, 1102, 929, 868, 1102, 883, 1151, 1145, 947, 934, 2781, 1101, 1222, 865, 928, 1219, 865, 873, 974, 1209, 1183, 616, 941, 1212, 937, 939, 2786, 944, 943, 922, 1095, 1074, 1225, 813, 948, 850, 856, 1167, 973, 1076, 1078, 880, 1107, 911, 860, 908, 2782, 616, 1183, 974, 2787, 855, 917, 813, 1225, 34, 800, 1225, 948, 753, 2772, 971, 800, 764, 763, 753, 950, 2772, 52, 783, 781, 752, 977, 950, 2788, 800, 763, 679, 973, 1078, 660, 911, 1107, 720, 851, 1076, 1107, 1106, 660, 1125, 896, 641, 641, 634, 1117, 828, 657, 1143, 1117, 1125, 641, 1106, 1143, 660, 1076, 973, 720, 657, 660, 1143, 963, 968, 1150, 968, 975, 1150, 882, 679, 1078, 946, 715, 2786, 944, 2786, 715, 758, 757, 1011, 1011, 1007, 299, 1011, 299, 758, 1007, 969, 299, 762, 1025, 763, 977, 756, 978, 769, 978, 755, 978, 756, 755, 1030, 978, 769, 762, 767, 768, 752, 756, 977, 762, 768, 1017, 1025, 762, 1017, 769, 770, 1030, 9, 2772, 62, 1117, 23, 22, 1035, 23, 822, 1035, 822, 10, 776, 55, 54, 74, 56, 785, 50, 52, 54, 2773, 41, 43, 817, 78, 100, 2779, 105, 104, 105, 2779, 1143, 41, 2775, 96, 2777, 47, 4, 28, 2777, 4, 16, 949, 17, 2772, 9, 11, 822, 11, 10, 54, 52, 781, 93, 94, 942, 773, 779, 1041, 779, 785, 56, 817, 1052, 78, 829, 2778, 2779, 829, 1050, 1052, 787, 793, 1043, 41, 2773, 2774, 41, 2774, 2775, 787, 786, 793, 43, 1042, 2773, 829, 2779, 104, 843, 110, 113, 111, 110, 843, 785, 893, 74, 893, 1122, 1110, 1173, 850, 1082, 2780, 1201, 2781, 1129, 1108, 2783, 2783, 1108, 1107, 1127, 1129, 2783, 55, 776, 1041, 1125, 1114, 2784, 889, 888, 1119, 1119, 888, 1118, 2784, 1114, 1115, 899, 885, 1118, 1115, 1118, 2784, 1120, 889, 1119, 885, 2784, 1118, 1110, 74, 893, 888, 899, 1118, 2785, 2784, 885, 1123, 1122, 893, 1127, 2783, 2782, 908, 1127, 2782, 908, 1128, 1127, 1144, 975, 1145, 871, 1209, 93, 1222, 1100, 2780, 1167, 1082, 850, 1168, 787, 1175, 1168, 1167, 855, 1209, 871, 873, 1214, 864, 1224, 1209, 974, 1183, 1210, 1212, 939, 1190, 862, 864, 943, 113, 1193, 864, 1214, 1190, 1102, 1223, 931, 916, 112, 111, 112, 916, 1223, 1172, 1204, 868, 1128, 908, 1138, 1100, 1201, 2780, 947, 1170, 1172, 915, 1223, 916, 2781, 1201, 947, 868, 933, 1172, 913, 1173, 1075, 1212, 1211, 937, 1194, 943, 1193, 943, 1194, 1224, 111, 843, 916, 2786, 1224, 864, 1210, 862, 1190, 862, 1210, 939, 942, 871, 93, 1224, 2786, 943, 937, 1184, 1183, 933, 947, 1172, 1204, 1102, 868, 1170, 947, 1201, 1173, 913, 850, 1184, 937, 1211, 855, 2787, 1168, 1086, 922, 1074, 824, 2777, 28, 1043, 1175, 787, 2787, 787, 1168, 1024, 1225, 2788, 1225, 800, 2788, 768, 759, 1237, 16, 770, 949, 766, 949, 770, 94, 1015, 942, 62, 950, 977, 1015, 1237, 942, 1024, 2788, 763, 1237, 759, 942, 2789, 2790, 2791, 988, 2792, 2793, 2793, 2792, 2794, 2795, 2796, 2797, 2798, 2795, 2799, 2797, 2796, 2793, 2800, 2793, 2794, 2793, 2800, 2797, 2795, 2797, 2799, 2801, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2807, 2810, 2811, 290, 292, 2812, 2813, 2814, 2815, 2816, 2805, 2817, 291, 2812, 2804, 2818, 2819, 2820, 2804, 2821, 291, 2822, 2811, 2810, 2823, 2824, 2821, 2825, 2806, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2801, 2833, 2834, 2789, 2835, 2836, 2818, 2815, 2819, 2837, 2807, 2809, 2809, 2838, 2839, 2837, 2809, 2839, 2840, 2822, 2810, 2832, 2818, 2820, 222, 2808, 2807, 215, 2817, 213, 2814, 2813, 2808, 219, 213, 292, 2841, 2804, 2806, 2842, 2804, 2841, 2843, 2844, 289, 2824, 2845, 2846, 2816, 2817, 215, 2817, 2805, 2812, 2847, 2843, 2848, 288, 2843, 289, 2812, 2805, 2804, 2806, 2805, 2816, 2826, 2803, 2825, 2806, 2825, 2841, 2807, 2811, 222, 290, 2812, 291, 2816, 2826, 2806, 2802, 2825, 2803, 292, 290, 286, 2821, 2804, 2842, 2821, 2849, 2850, 2843, 288, 2848, 2848, 2821, 2850, 2851, 2852, 2853, 2854, 2855, 2852, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 2865, 2866, 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2862, 2864, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 275, 274, 2884, 2885, 2886, 2887, 2888, 2873, 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896, 2895, 2897, 2898, 2899, 2900, 2876, 2901, 2877, 2896, 2902, 2903, 2888, 2880, 2857, 2851, 2904, 2852, 2905, 2906, 2858, 2888, 2859, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2900, 2914, 2898, 289, 2915, 2916, 2871, 2917, 2907, 2875, 2918, 2843, 2919, 2920, 2892, 2892, 2891, 2921, 2911, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2862, 2899, 2897, 2900, 281, 2929, 2930, 2858, 2906, 2895, 2904, 2931, 2850, 2932, 2933, 2869, 2919, 2923, 2870, 2919, 2934, 2920, 2919, 2892, 2935, 2921, 2936, 2935, 2919, 2937, 2923, 2938, 2939, 2940, 2941, 2939, 2942, 2913, 2912, 2885, 2936, 2937, 2935, 2922, 2911, 2883, 2885, 2887, 2913, 2943, 2944, 276, 2945, 2946, 2947, 2942, 2933, 2932, 2948, 2949, 2950, 2869, 2949, 2932, 2947, 2951, 2945, 2949, 2868, 2950, 2923, 2922, 2944, 2870, 2944, 2950, 2870, 2923, 2944, 2952, 2950, 2944, 2950, 2952, 2948, 2953, 2939, 2941, 2954, 2953, 2947, 2932, 2949, 2955, 2956, 2955, 2948, 2955, 2947, 2932, 276, 2944, 2882, 2868, 2870, 2950, 2941, 2942, 2932, 2953, 2941, 2947, 2855, 2951, 2947, 2849, 2854, 2852, 2855, 2947, 2852, 2930, 278, 281, 2957, 2943, 2958, 2959, 2957, 2930, 2958, 2943, 277, 2927, 2862, 2960, 2903, 2858, 2896, 2903, 2961, 2856, 2910, 2927, 2908, 2862, 2893, 2960, 2924, 2916, 2915, 2906, 2962, 2893, 2952, 2956, 2948, 2850, 2879, 2848, 279, 278, 277, 2894, 2893, 2874, 2947, 2956, 2852, 2940, 2939, 2963, 2962, 2906, 2964, 2905, 2858, 2857, 2965, 2962, 2964, 2853, 2952, 2957, 2908, 2959, 2930, 277, 282, 279, 2868, 2949, 2869, 2961, 2860, 2856, 2853, 2957, 2959, 2949, 2948, 2955, 2922, 2882, 2944, 277, 2943, 276, 2964, 2851, 2965, 2857, 2859, 2888, 2947, 2941, 2932, 2965, 2853, 2959, 2966, 2967, 2968, 2947, 2955, 2956, 2858, 2903, 2856, 2969, 2970, 2883, 2847, 2848, 2879, 2959, 2962, 2965, 2952, 2944, 2943, 2930, 2957, 2958, 2959, 2908, 2960, 2852, 2956, 2853, 278, 2930, 2958, 2853, 2965, 2851, 2882, 270, 276, 2893, 2962, 2960, 2956, 2952, 2853, 2943, 2957, 2952, 2927, 2960, 2908, 2958, 277, 278, 2851, 2964, 2905, 2857, 2856, 2859, 2860, 2859, 2856, 2874, 2893, 2862, 2962, 2959, 2960, 213, 2817, 292, 292, 2817, 2812, 2971, 2972, 2827, 2801, 2834, 2802, 273, 2884, 274, 2912, 2911, 2973, 270, 2881, 273, 273, 2974, 2975, 2961, 2976, 2860, 2929, 281, 2867, 2866, 2929, 2867, 2910, 2929, 2866, 2909, 2930, 2929, 2909, 2929, 2910, 2909, 2908, 2930, 2866, 2865, 2977, 2910, 2866, 2978, 2865, 2979, 2977, 2978, 2866, 2977, 2900, 2897, 2894, 2874, 2980, 2894, 2914, 2980, 2864, 2894, 2980, 2900, 2980, 2874, 2864, 2980, 2914, 2900, 2906, 2905, 2964, 2895, 2896, 2858, 2906, 2893, 2895, 2902, 2961, 2903, 2894, 2897, 2895, 2976, 2861, 2860, 2861, 2981, 2907, 2982, 2983, 2901, 2888, 2917, 2873, 2907, 2859, 2861, 2872, 2982, 2873, 2981, 2871, 2907, 2917, 2888, 2907, 2917, 2871, 2873, 2983, 2984, 2901, 2985, 2918, 2901, 2887, 2883, 2913, 2975, 2974, 2986, 2974, 273, 2881, 270, 2882, 2881, 2881, 2970, 2986, 2911, 2913, 2883, 2882, 2922, 2883, 2987, 2911, 2923, 2892, 2921, 2935, 2923, 2937, 2987, 2883, 2970, 2881, 2986, 2974, 2881, 2937, 2919, 2935, 2937, 2973, 2987, 2934, 2870, 2869, 2919, 2870, 2934, 2973, 2911, 2987, 2920, 2890, 2892, 2933, 2934, 2869, 2890, 2933, 2942, 2920, 2933, 2890, 2933, 2920, 2934, 2988, 2891, 2890, 2939, 2938, 2942, 2989, 2938, 2940, 2990, 2988, 2890, 2876, 2982, 2901, 2878, 2875, 2847, 2847, 2879, 2878, 2847, 2875, 2843, 2918, 2875, 2877, 2991, 203, 2992, 2993, 2926, 2994, 2877, 2901, 2918, 2992, 2995, 2996, 2924, 2995, 2916, 2997, 2995, 2992, 2998, 2999, 2925, 2925, 2924, 2915, 2924, 2926, 2995, 2916, 2997, 3000, 3001, 3002, 2967, 2992, 203, 2997, 2849, 2852, 2850, 2844, 3003, 2915, 2926, 2996, 2995, 2915, 2998, 2925, 2997, 2916, 2995, 3002, 2968, 2967, 2998, 2915, 3003, 2844, 2843, 2918, 2999, 2994, 2925, 288, 291, 2821, 2889, 2982, 2878, 2878, 2982, 2876, 2883, 2887, 2969, 2880, 2851, 2905, 2904, 2851, 2880, 2880, 2931, 2904, 2879, 2850, 2931, 2852, 2904, 2850, 2880, 2888, 2889, 2879, 2931, 2880, 2905, 2857, 2880, 2889, 2878, 2880, 2875, 2878, 2876, 2873, 2982, 2889, 2844, 2918, 3003, 289, 2844, 2915, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3006, 3013, 3004, 3014, 3015, 3016, 2954, 2946, 3005, 2940, 2963, 3014, 3005, 2946, 2945, 2938, 2989, 2990, 3011, 3006, 3017, 3017, 2945, 3011, 3014, 3016, 2989, 3018, 2954, 3005, 3008, 3019, 3009, 3020, 3021, 3009, 2990, 2890, 2938, 2990, 3022, 2988, 2953, 2963, 2939, 3015, 3014, 3023, 3024, 3022, 2989, 3018, 3021, 2953, 2990, 2989, 3022, 3013, 3025, 3004, 3018, 2953, 2954, 2963, 3021, 3023, 3018, 3007, 3009, 3018, 3009, 3021, 3026, 3020, 3009, 2963, 3023, 3014, 3017, 3005, 2945, 3007, 3018, 3005, 3021, 2963, 2953, 3013, 3006, 3010, 3027, 3011, 3028, 3005, 3004, 3007, 2945, 3028, 3011, 2946, 2954, 2947, 3009, 3019, 3026, 2890, 2942, 2938, 3016, 3024, 2989, 2940, 3014, 2989, 3011, 3010, 3006, 3029, 3010, 3012, 3017, 3006, 3005, 3021, 3020, 3023, 3030, 3031, 3032, 2828, 3033, 3034, 2823, 3035, 2845, 2802, 3036, 2841, 3037, 3038, 3039, 3040, 3041, 2842, 2846, 2845, 3042, 3043, 3044, 3045, 3046, 3047, 2831, 3048, 2842, 3036, 2821, 3041, 2823, 2825, 2802, 2841, 3040, 3035, 2823, 2828, 3049, 3033, 3050, 3051, 3052, 2821, 2842, 3041, 3034, 2842, 3048, 3049, 2828, 2827, 2824, 2823, 2845, 2831, 2830, 3046, 3045, 3053, 3031, 2841, 3036, 2842, 2829, 3048, 2834, 3041, 3040, 2823, 3054, 2846, 3042, 3055, 234, 229, 232, 3056, 3057, 226, 225, 3058, 3059, 223, 269, 3056, 232, 265, 266, 226, 3060, 3061, 228, 3057, 228, 3061, 229, 2972, 3056, 267, 2840, 3062, 3063, 3060, 226, 3058, 3056, 265, 267, 3064, 229, 3061, 3065, 3066, 3067, 3065, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 3077, 3070, 3078, 3079, 3080, 3079, 3081, 3080, 3078, 3082, 3083, 3081, 3079, 3083, 3084, 3085, 3086, 251, 3087, 3088, 3089, 3090, 3091, 3085, 3092, 3093, 3094, 3095, 3096, 3096, 3089, 3094, 3097, 3098, 3090, 3099, 3100, 3101, 3098, 3102, 3091, 3098, 3097, 3103, 3100, 3104, 3105, 3098, 3091, 3090, 3099, 3106, 3107, 3108, 3109, 3110, 3109, 3108, 3111, 3112, 3113, 3114, 3115, 3116, 3117, 3113, 3118, 3119, 3120, 3114, 3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3122, 3124, 3132, 3123, 3128, 3124, 3133, 3134, 3122, 3135, 3123, 3122, 3131, 3136, 3136, 3117, 3137, 3137, 3117, 3116, 3138, 3110, 3139, 3140, 3141, 3069, 3142, 3143, 3141, 3144, 3145, 3146, 3125, 3147, 3148, 3127, 3147, 3125, 3144, 3146, 3128, 3111, 3073, 3075, 3149, 3075, 3071, 3150, 3151, 3152, 3153, 3073, 3150, 3154, 3155, 3156, 3109, 3157, 3110, 3158, 3076, 3159, 3104, 3099, 3107, 3159, 3160, 3161, 3089, 3087, 3094, 3162, 3163, 3164, 251, 260, 3094, 3165, 3166, 3167, 3126, 3146, 3127, 3168, 3090, 3096, 3095, 3169, 3170, 3171, 3172, 3173, 3172, 3163, 3162, 3174, 3175, 249, 3176, 3084, 3152, 3177, 3168, 3096, 3178, 3163, 3171, 3094, 3087, 251, 3179, 3180, 3181, 3171, 3088, 3178, 3182, 3152, 3106, 3183, 3139, 3184, 3101, 3185, 3093, 3076, 3070, 3160, 3103, 3086, 3085, 3186, 3187, 3151, 3182, 3101, 3093, 3186, 3073, 3111, 3110, 3138, 3188, 3189, 3190, 3191, 3159, 3161, 3192, 3180, 3179, 3193, 3194, 3195, 3192, 3070, 3072, 3196, 3151, 3106, 3152, 3137, 3197, 3144, 3069, 3198, 3066, 3199, 3188, 3138, 3161, 3200, 3194, 3073, 3186, 3150, 3145, 3127, 3146, 3201, 3202, 3203, 3204, 3114, 3184, 3205, 3206, 3184, 3207, 3208, 3209, 3100, 3185, 3101, 3183, 3119, 3138, 3208, 3116, 3209, 3103, 3085, 3102, 3113, 3184, 3114, 3210, 3129, 3211, 3146, 3126, 3211, 3107, 3187, 3190, 3212, 3178, 3088, 3207, 3209, 3198, 3142, 3147, 3143, 3144, 3136, 3137, 3198, 3141, 3143, 3130, 3132, 3128, 3213, 3188, 3199, 3214, 3091, 3185, 3215, 3216, 3210, 3215, 3125, 3148, 3201, 3156, 3217, 3191, 3218, 3189, 3145, 3144, 3197, 3066, 3205, 3139, 3129, 3128, 3211, 3217, 3216, 3201, 3116, 3115, 3121, 3072, 3074, 3196, 3219, 3136, 3131, 3197, 3137, 3116, 3124, 3220, 3131, 3147, 3142, 3148, 3135, 3122, 3136, 3110, 3067, 3139, 3155, 3133, 3130, 3220, 3124, 3134, 3079, 3078, 3083, 3166, 3165, 162, 3081, 3200, 3196, 3206, 3205, 3209, 3072, 3075, 3074, 3169, 3095, 3094, 3221, 3222, 3097, 3223, 3194, 3224, 3225, 256, 3226, 3227, 3226, 3228, 3229, 3230, 3231, 210, 3232, 3226, 3233, 257, 3234, 3235, 3229, 3231, 3236, 3235, 3237, 3235, 3236, 3238, 3239, 3240, 3235, 3237, 3235, 3241, 3242, 207, 3243, 3244, 3245, 3246, 3237, 3246, 3236, 3237, 3247, 3248, 3239, 3249, 3228, 3235, 3238, 3239, 3204, 3209, 3116, 3167, 3250, 3169, 3251, 3252, 3253, 3156, 3254, 3154, 3107, 3106, 3187, 3176, 3182, 3092, 3165, 3167, 3169, 3255, 3105, 3104, 3087, 3089, 3212, 3102, 3185, 3091, 3196, 3200, 3160, 3224, 3083, 3103, 3095, 3256, 3096, 3088, 3174, 248, 3083, 3086, 3103, 3194, 3222, 3195, 162, 3165, 260, 3170, 3251, 3253, 3177, 3253, 3252, 3196, 3080, 3081, 3090, 3089, 3096, 3092, 3182, 3093, 3257, 3180, 3193, 257, 3233, 3243, 256, 3225, 165, 3258, 3077, 3076, 3097, 3223, 3224, 3178, 3214, 3105, 3173, 3174, 3171, 3205, 3066, 3198, 3067, 3110, 3157, 3080, 3153, 3078, 3259, 3121, 3115, 3126, 3125, 3211, 3078, 3152, 3084, 3101, 3182, 3099, 3108, 3213, 3187, 3260, 3119, 3118, 3163, 3172, 3171, 3206, 3204, 3184, 3256, 3253, 3177, 3090, 3168, 3221, 3202, 3201, 3261, 3085, 3084, 3092, 3169, 3094, 3165, 3105, 3164, 3178, 3085, 3093, 3102, 3174, 3088, 3171, 3090, 3221, 3097, 3262, 3263, 3199, 3264, 3158, 3159, 3208, 3207, 3197, 3178, 3212, 3214, 3177, 3252, 3265, 3175, 3174, 3173, 3198, 3069, 3141, 3074, 3073, 3153, 3266, 3192, 3267, 3205, 3184, 3139, 264, 262, 3243, 3071, 3070, 3077, 3195, 3267, 3192, 3166, 162, 154, 3094, 260, 3165, 3091, 3214, 3212, 3198, 3209, 3205, 3149, 3109, 3111, 249, 3175, 3268, 3269, 3270, 3164, 3256, 3095, 3170, 3192, 3266, 3159, 3139, 3183, 3138, 3084, 3176, 3092, 3160, 3159, 3076, 3138, 3262, 3199, 3213, 3108, 3188, 3170, 3253, 3256, 3177, 3096, 3256, 3212, 3089, 3091, 3163, 3178, 3164, 3186, 3111, 3108, 3189, 3107, 3190, 3271, 3199, 3263, 131, 249, 3268, 3150, 3078, 3153, 3218, 3191, 3271, 3272, 3245, 3244, 255, 254, 210, 256, 255, 3226, 3244, 3273, 3272, 3274, 3231, 3230, 3275, 3276, 3277, 3274, 3242, 3278, 3272, 3273, 3249, 3279, 3280, 3281, 3216, 3217, 3210, 3282, 3281, 3280, 3246, 3279, 3244, 3231, 3274, 3241, 3273, 3244, 3283, 3284, 3285, 3276, 3238, 3272, 3239, 3245, 3236, 3246, 3286, 3227, 3249, 3231, 3241, 3235, 3228, 3240, 3239, 3249, 3227, 3228, 3243, 262, 257, 3236, 3245, 3238, 3241, 3247, 3237, 3246, 3280, 3279, 3245, 3272, 3238, 3229, 3240, 3230, 3240, 3229, 3235, 3243, 207, 264, 3246, 3248, 3280, 3273, 3283, 3287, 3204, 3206, 3209, 3284, 3225, 3226, 3240, 3228, 3232, 3269, 3164, 3105, 3234, 257, 259, 3246, 3237, 3248, 3249, 3239, 3272, 3226, 3232, 3228, 3174, 249, 248, 3162, 3164, 3270, 3288, 3134, 3133, 3284, 3226, 3227, 255, 210, 3226, 3123, 3132, 3124, 3289, 3262, 3260, 3118, 3113, 3112, 3136, 3144, 3135, 3119, 3183, 3184, 3161, 3160, 3200, 3093, 3185, 3102, 3182, 3176, 3152, 3153, 3080, 3074, 3152, 3078, 3150, 3223, 3097, 3222, 256, 165, 164, 3132, 3130, 3133, 3146, 3211, 3128, 3128, 3123, 3135, 3105, 3214, 3185, 3125, 3215, 3210, 3127, 3145, 3197, 3216, 3261, 3201, 3197, 3207, 3127, 3066, 3139, 3067, 3109, 3149, 3157, 3080, 3196, 3074, 3086, 3082, 3084, 3102, 3098, 3103, 3160, 3070, 3196, 3134, 3288, 3290, 3184, 3113, 3119, 3128, 3135, 3144, 248, 251, 3088, 3224, 3103, 3097, 3124, 3132, 3133, 3261, 3216, 3215, 3199, 3271, 3191, 3168, 3177, 3221, 3155, 3288, 3133, 3107, 3189, 3291, 3254, 3156, 3201, 3075, 3149, 3111, 3129, 3210, 3217, 3262, 3138, 3119, 3210, 3211, 3125, 3207, 3143, 3127, 3147, 3127, 3143, 3217, 3292, 3129, 3143, 3207, 3198, 3121, 3204, 3116, 3262, 3119, 3260, 3114, 3204, 3121, 3292, 3156, 3155, 3084, 3082, 3078, 3151, 3150, 3186, 3112, 3114, 3120, 3088, 3087, 3212, 3185, 3100, 3105, 3121, 3259, 3120, 3156, 3292, 3217, 3288, 3155, 3290, 3224, 3194, 3200, 3083, 3082, 3086, 3263, 3262, 3289, 3200, 3081, 3224, 3255, 3104, 3291, 3191, 3213, 3199, 3104, 3100, 3099, 3187, 3186, 3108, 3075, 3072, 3071, 3110, 3188, 3108, 3293, 3294, 3295, 3136, 3219, 3117, 3213, 3190, 3187, 3069, 3066, 3065, 3081, 3083, 3224, 3292, 3130, 3129, 3213, 3191, 3190, 3151, 3187, 3106, 3194, 3223, 3222, 3099, 3182, 3106, 3105, 3255, 3269, 3130, 3292, 3155, 3107, 3291, 3104, 3116, 3208, 3197, 3234, 259, 3296, 3297, 3298, 3299, 3067, 3300, 3065, 3301, 3302, 3303, 3304, 3305, 3306, 3307, 3282, 3308, 244, 3309, 3310, 3311, 3312, 3313, 3314, 3252, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3277, 3319, 3325, 3241, 3326, 3327, 3328, 3329, 3330, 3325, 160, 3277, 3282, 3331, 3308, 3332, 3306, 3333, 3334, 3335, 3321, 3336, 3321, 3286, 3333, 3305, 3337, 3338, 3339, 3340, 3339, 2993, 3341, 3342, 3343, 3283, 3344, 205, 3345, 3346, 3347, 3348, 3308, 3303, 3349, 3350, 3351, 3352, 3285, 3319, 3276, 3335, 3350, 3352, 3273, 3353, 3249, 3354, 3355, 3356, 3357, 3358, 3359, 3286, 3320, 3285, 3360, 3361, 3362, 3324, 3363, 3364, 3365, 3264, 3366, 3338, 3340, 3367, 3348, 3347, 3180, 246, 245, 244, 3345, 3368, 3369, 3370, 3371, 3372, 246, 244, 3373, 3373, 3374, 246, 3375, 3376, 3343, 3281, 3307, 3377, 3296, 3378, 3360, 3353, 3286, 3249, 3379, 3380, 3381, 3266, 3366, 3159, 244, 160, 3325, 3233, 3382, 3383, 3355, 3380, 3367, 3328, 3378, 3384, 3385, 3386, 3364, 240, 3387, 3388, 3389, 3328, 3339, 3390, 3391, 3392, 3244, 3342, 3283, 3375, 3393, 3394, 3395, 3309, 3325, 3322, 3386, 3349, 3287, 3396, 3334, 240, 201, 3384, 3397, 3354, 3356, 3287, 3336, 3353, 3343, 3342, 3279, 3278, 3398, 3326, 3332, 3399, 3364, 3264, 3400, 3401, 3338, 3361, 3389, 3281, 3393, 3279, 3303, 3322, 3349, 3402, 3403, 3404, 3287, 3405, 3406, 3343, 3376, 3407, 3408, 3358, 3357, 3296, 3387, 3384, 3284, 3409, 3285, 3410, 3337, 3411, 3395, 3335, 3412, 3350, 3334, 3396, 3390, 3381, 3413, 3414, 3367, 3340, 3414, 3340, 3339, 3390, 3413, 3391, 3415, 3416, 3417, 3418, 3419, 3415, 3420, 3401, 3400, 3421, 3316, 3318, 3422, 3372, 3371, 3410, 3411, 3233, 3423, 3243, 3233, 3161, 3194, 3192, 3195, 3222, 3424, 3243, 3423, 3242, 3233, 3411, 3423, 3411, 3278, 3423, 3423, 3278, 3242, 3276, 3425, 3284, 3275, 165, 3425, 3275, 3425, 3276, 3225, 3425, 165, 3425, 3225, 3284, 3296, 3360, 3234, 165, 3275, 145, 3278, 3411, 3304, 3063, 3062, 3426, 3264, 3299, 3158, 3274, 3326, 3241, 3422, 3371, 3193, 3427, 3266, 3404, 3266, 3427, 3366, 3338, 3389, 3339, 3287, 3406, 3396, 3286, 3409, 3227, 3395, 3428, 3309, 3331, 3280, 3248, 3429, 3386, 3385, 3304, 3430, 3398, 3431, 3432, 3311, 3317, 3433, 3294, 3415, 3434, 3416, 3365, 3403, 3400, 3422, 3315, 3435, 3436, 3193, 3371, 3424, 3265, 3437, 3297, 3438, 3421, 3258, 3298, 3318, 3439, 3440, 3419, 3403, 3431, 3420, 3252, 3441, 3435, 3303, 3308, 3301, 3374, 3345, 205, 3373, 3368, 3345, 3310, 3428, 3412, 3394, 3281, 3377, 3374, 3373, 3345, 3374, 243, 246, 3373, 3442, 3368, 243, 3374, 205, 3325, 3309, 244, 3369, 3344, 3345, 3319, 3277, 3276, 3428, 3310, 3309, 3428, 3395, 3412, 141, 3277, 160, 3405, 3287, 3283, 3335, 3443, 3412, 3320, 3319, 3285, 3321, 3336, 3334, 3335, 3352, 3443, 3343, 3405, 3283, 3336, 3286, 3353, 3350, 3335, 3334, 3407, 3406, 3343, 3321, 3395, 3325, 3409, 3284, 3227, 3353, 3273, 3287, 3335, 3395, 3321, 3409, 3286, 3285, 3319, 3321, 3325, 3405, 3343, 3406, 3320, 3286, 3321, 3336, 3287, 3334, 3396, 3406, 3407, 3279, 3375, 3343, 3342, 3244, 3279, 3407, 3351, 3396, 3351, 3350, 3396, 3307, 3281, 3282, 3393, 3281, 3394, 3393, 3375, 3279, 3331, 3282, 3280, 3301, 3331, 3248, 3331, 3301, 3308, 3302, 3322, 3303, 3301, 3247, 3327, 3326, 3274, 3278, 3302, 3301, 3327, 3323, 3322, 3302, 3323, 3444, 3324, 3398, 3444, 3326, 3398, 3278, 3304, 3327, 3247, 3241, 3386, 3429, 3349, 3302, 3444, 3323, 3247, 3301, 3248, 3430, 3444, 3398, 3430, 3304, 3324, 3326, 3444, 3327, 3444, 3302, 3327, 3306, 3363, 3324, 3364, 3322, 3324, 3363, 3332, 3364, 3308, 3445, 3307, 3306, 3332, 3363, 3332, 3392, 3399, 3337, 3410, 3333, 3337, 3304, 3411, 3305, 3304, 3337, 3305, 3333, 3306, 3332, 3379, 3392, 3399, 3385, 3364, 3386, 3322, 3364, 3304, 3306, 3324, 3445, 3308, 3349, 3380, 3355, 3381, 3379, 3332, 3333, 3392, 3379, 3390, 3381, 3390, 3379, 3356, 3355, 3367, 3356, 3414, 3446, 3381, 3355, 3413, 3361, 3360, 3389, 3447, 3448, 3391, 3387, 3296, 3388, 3193, 3436, 3257, 3314, 3193, 3179, 3359, 3449, 3357, 3441, 3252, 3251, 3450, 3441, 3251, 3315, 3252, 3435, 3315, 3422, 3193, 3193, 3314, 3315, 3347, 3181, 3180, 3404, 3451, 3348, 3257, 3348, 3180, 3314, 3179, 3265, 3252, 3314, 3265, 3452, 3453, 3415, 3181, 3265, 3179, 3311, 3420, 3431, 3424, 3267, 3195, 3346, 3181, 3347, 3267, 3451, 3266, 3454, 3402, 3404, 3316, 3421, 3455, 3451, 3267, 3346, 3266, 3451, 3404, 3451, 3346, 3348, 3267, 3181, 3346, 3403, 3365, 3404, 3402, 3456, 3403, 3457, 3181, 3267, 3181, 3437, 3265, 3267, 3424, 3457, 3437, 3181, 3457, 3417, 3452, 3415, 3365, 3427, 3404, 3366, 3264, 3159, 3432, 3458, 3311, 3459, 3404, 3348, 3460, 3418, 3453, 3297, 3313, 3438, 3318, 3297, 3421, 3438, 3439, 3421, 3458, 3440, 3312, 3298, 3297, 3318, 3298, 3258, 3299, 3420, 3313, 3401, 3299, 3264, 3401, 3419, 3418, 3439, 3427, 3365, 3366, 3264, 3365, 3400, 3458, 3434, 3440, 3440, 3439, 3438, 3312, 3438, 3313, 3312, 3311, 3458, 3439, 3460, 3421, 3415, 3453, 3418, 3460, 3439, 3418, 3460, 3455, 3421, 3433, 3295, 3294, 3419, 3434, 3415, 3295, 3065, 3300, 3440, 3438, 3312, 3461, 3295, 3462, 3452, 3417, 3463, 3434, 3419, 3440, 3464, 3295, 3461, 3464, 3068, 3065, 3400, 3403, 3420, 3065, 3295, 3464, 3465, 3466, 3467, 3465, 3463, 3417, 3341, 3414, 3339, 3385, 3399, 2981, 3414, 3468, 3446, 3367, 3414, 3356, 3330, 2993, 3339, 3330, 3329, 3469, 3468, 3414, 3341, 3328, 3389, 3360, 3378, 3328, 3360, 3378, 3296, 3384, 3329, 3328, 3384, 3328, 3330, 3339, 3447, 3391, 3413, 3234, 3362, 3382, 3446, 3470, 3356, 3387, 240, 3384, 3002, 3338, 3367, 3470, 3446, 3471, 3383, 3410, 3233, 3382, 3233, 3234, 3362, 3234, 3360, 3397, 3447, 3413, 3470, 3397, 3356, 3444, 3430, 3324, 3311, 3313, 3420, 3424, 3437, 3457, 3295, 3300, 3293, 3354, 3397, 3413, 3355, 3354, 3413, 3399, 3392, 2981, 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3293, 3157, 3481, 3258, 3482, 3483, 3484, 3485, 3486, 3487, 3142, 3488, 3140, 3489, 3141, 3488, 3490, 3485, 3491, 3492, 3493, 3316, 3462, 3433, 3494, 3472, 3495, 3496, 3486, 3497, 3202, 3498, 3203, 3499, 3215, 3148, 3500, 3461, 3501, 3502, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3501, 3293, 3510, 3294, 3293, 3067, 3157, 3077, 3511, 3071, 3484, 3486, 3496, 3462, 3295, 3433, 3485, 3490, 3512, 3071, 3513, 3481, 3514, 3515, 3516, 3491, 3517, 3518, 3461, 3519, 3068, 3202, 3520, 3498, 3455, 3462, 3316, 3521, 3522, 3504, 3487, 3148, 3142, 3453, 3452, 3463, 3523, 3499, 3488, 3488, 3485, 3523, 3149, 3481, 3157, 3293, 3513, 3511, 3518, 3517, 3524, 3488, 3525, 3512, 3317, 3482, 3318, 3526, 3498, 3527, 3478, 3480, 3515, 3528, 3529, 3530, 3215, 3528, 3261, 3531, 3532, 3533, 3495, 3472, 3474, 3299, 3076, 3158, 3523, 3534, 3215, 3507, 3535, 3536, 3505, 3537, 3495, 3538, 3510, 3511, 3463, 3539, 3461, 3521, 3540, 3489, 3541, 3491, 3542, 3525, 3543, 3503, 3544, 3522, 3521, 3534, 3528, 3215, 3537, 3494, 3495, 3488, 3142, 3525, 3475, 3514, 3492, 3433, 3317, 3316, 3543, 3540, 3504, 3537, 3507, 3545, 3546, 3472, 3504, 3500, 3547, 3519, 3505, 3020, 3026, 3297, 3401, 3313, 3294, 3538, 3483, 3489, 3543, 3141, 3508, 3501, 3461, 3455, 3460, 3548, 3547, 3500, 3501, 3483, 3317, 3294, 3483, 3077, 3258, 3522, 3546, 3504, 3541, 3496, 3497, 3539, 3508, 3461, 3533, 3532, 3549, 3482, 3317, 3483, 3482, 3258, 3318, 3538, 3077, 3483, 3511, 3077, 3538, 3461, 3462, 3455, 3481, 3149, 3071, 3067, 3293, 3300, 3466, 3473, 3467, 3464, 3461, 3068, 3508, 3539, 3467, 3465, 3467, 3539, 3519, 3547, 3068, 3463, 3465, 3539, 3510, 3293, 3511, 3510, 3538, 3294, 3076, 3299, 3258, 3513, 3293, 3481, 3513, 3071, 3511, 3550, 3547, 3501, 3521, 3140, 3544, 3461, 3548, 3463, 3494, 3504, 3472, 3522, 3544, 3550, 3473, 3509, 3467, 3474, 3505, 3495, 3461, 3500, 3519, 3546, 3550, 3509, 3551, 3545, 3552, 3489, 3140, 3521, 3547, 3550, 3544, 3553, 3523, 3485, 3548, 3453, 3463, 3548, 3461, 3455, 3026, 3506, 3505, 3554, 3484, 3549, 3148, 3487, 3499, 3541, 3549, 3496, 3401, 3297, 3299, 3540, 3543, 3489, 3540, 3521, 3504, 3551, 3485, 3512, 3509, 3550, 3501, 3491, 3541, 3517, 3487, 3488, 3499, 3530, 3554, 3549, 3485, 3552, 3486, 3523, 3215, 3499, 3486, 3536, 3497, 3555, 3474, 3473, 3507, 3486, 3545, 3553, 3529, 3534, 3503, 3543, 3504, 3512, 3525, 3503, 3485, 3484, 3553, 3509, 3508, 3467, 3494, 3537, 3545, 3532, 3527, 3530, 3486, 3552, 3545, 3493, 3516, 3542, 3528, 3202, 3261, 3529, 3554, 3530, 3504, 3494, 3502, 3554, 3529, 3553, 3527, 3556, 3530, 3534, 3523, 3553, 3203, 3526, 3480, 3496, 3549, 3484, 3542, 3491, 3493, 3502, 3551, 3503, 3516, 3527, 3532, 3529, 3528, 3534, 3556, 3528, 3530, 3492, 3514, 3493, 3142, 3543, 3525, 3202, 3528, 3556, 3485, 3551, 3552, 3542, 3531, 3533, 3502, 3494, 3545, 3541, 3533, 3549, 3543, 3142, 3141, 3533, 3541, 3542, 3507, 3537, 3505, 3476, 3475, 3492, 3497, 3536, 3535, 3491, 3518, 3492, 3527, 3520, 3556, 3520, 3527, 3498, 3520, 3202, 3556, 3549, 3532, 3530, 3531, 3542, 3516, 3480, 3526, 3515, 3541, 3497, 3517, 3514, 3475, 3477, 3557, 3492, 3518, 3532, 3531, 3516, 3479, 3203, 3480, 3517, 3497, 3535, 3460, 3453, 3548, 3546, 3509, 3472, 3546, 3522, 3550, 3473, 3472, 3509, 3516, 3493, 3514, 3526, 3516, 3515, 3526, 3527, 3516, 3507, 3536, 3486, 3553, 3484, 3554, 3551, 3502, 3545, 3551, 3512, 3503, 3490, 3488, 3512, 3526, 3203, 3498, 3557, 3476, 3492, 3058, 234, 3055, 3558, 3559, 3560, 229, 3064, 3055, 225, 237, 234, 3561, 3063, 3426, 3562, 3426, 3563, 3562, 3564, 3561, 3565, 3562, 3035, 232, 3057, 228, 3564, 3562, 3565, 237, 235, 234, 3564, 3566, 3561, 3566, 3063, 3561, 3558, 3567, 3568, 3035, 3562, 3563, 234, 3058, 225, 3426, 3562, 3561, 208, 207, 3569, 3471, 2985, 2901, 3469, 2991, 2992, 2993, 3469, 2996, 206, 3344, 281, 3344, 2867, 281, 2910, 2978, 2927, 2928, 2927, 2978, 2985, 2998, 3003, 2999, 2998, 2985, 3570, 2985, 3471, 3471, 2901, 2984, 3003, 2918, 2985, 2996, 3469, 2992, 2985, 3570, 2999, 3524, 3013, 3010, 3524, 3025, 3013, 3025, 3008, 3007, 3025, 3007, 3004, 3010, 3029, 3524, 3058, 2801, 3060, 3055, 2833, 3058, 2811, 220, 222, 223, 3059, 222, 2809, 3571, 2838, 2831, 3047, 2818, 2832, 3572, 2830, 220, 2811, 2822, 170, 2815, 2814, 2832, 2831, 2818, 3062, 2840, 2810, 2840, 2972, 2822, 3036, 2834, 3048, 3057, 2971, 3061, 2813, 2809, 2808, 3573, 3045, 3031, 2815, 3571, 2813, 2809, 2813, 3571, 3574, 3575, 2835, 2971, 3057, 3056, 266, 3060, 2803, 2829, 2834, 2833, 267, 2822, 2972, 220, 2822, 267, 3059, 2808, 222, 2971, 3056, 2972, 2827, 3061, 2971, 2814, 269, 170, 2815, 2818, 3571, 3060, 2801, 2803, 2829, 3064, 3061, 3058, 2833, 2801, 2808, 3059, 269, 2826, 2816, 214, 2808, 269, 2814, 3032, 3568, 3042, 2815, 170, 2819, 213, 212, 215, 2803, 2826, 266, 2816, 215, 214, 3036, 2802, 2834, 3064, 2829, 2833, 3047, 3571, 2818, 3568, 3032, 3031, 3242, 3569, 207, 3274, 3230, 3569, 210, 3569, 3232, 210, 208, 3569, 3240, 3232, 3569, 3569, 3230, 3240, 3569, 3242, 3274, 3576, 3377, 2896, 2984, 3470, 3471, 2966, 3379, 3333, 2926, 2993, 2996, 2896, 2897, 3576, 3577, 2975, 2986, 2921, 3431, 2936, 2872, 3448, 2983, 3310, 2977, 2979, 275, 3578, 3579, 2912, 3404, 3459, 2968, 3002, 3367, 2978, 2977, 3580, 3570, 3468, 2999, 3368, 3442, 2979, 2861, 2976, 3429, 3410, 3383, 2967, 2872, 2871, 3448, 3443, 3580, 2977, 3468, 3570, 3446, 3432, 3431, 2921, 3434, 2988, 3416, 2975, 3358, 273, 3517, 3535, 3025, 3333, 3410, 2966, 3407, 2898, 2914, 3022, 3417, 3416, 2967, 2966, 3410, 214, 266, 2826, 2973, 2937, 3456, 3344, 3369, 2867, 205, 3344, 206, 2979, 2865, 3368, 3369, 2865, 2867, 3442, 3310, 2979, 3368, 2865, 3369, 2977, 3310, 3412, 2977, 3412, 3443, 2863, 2928, 3443, 3352, 2863, 3443, 3351, 2864, 2863, 3351, 2914, 2864, 3394, 2898, 3375, 2928, 2978, 3580, 3443, 2928, 3580, 3394, 3377, 2899, 2863, 2862, 2928, 3351, 3407, 2914, 3376, 2898, 3407, 3377, 3576, 2899, 3375, 2898, 3376, 3307, 2961, 3377, 3351, 2863, 3352, 2898, 3394, 2899, 3576, 2897, 2899, 2961, 2902, 3377, 2902, 2896, 3377, 2961, 3445, 3349, 3385, 2861, 3429, 3392, 3391, 2871, 3445, 2961, 3307, 2981, 2861, 3385, 2981, 3392, 2871, 2966, 3380, 3379, 2961, 3429, 2976, 2984, 2983, 3397, 3429, 2961, 3349, 3380, 2966, 2968, 2982, 2872, 2983, 3391, 3448, 2871, 3380, 2968, 3367, 275, 2884, 3578, 3358, 3408, 273, 2884, 3408, 3578, 2969, 3370, 2970, 3359, 2975, 3577, 2886, 2885, 3257, 2969, 3436, 3371, 3358, 2975, 3359, 2884, 273, 3408, 3370, 2969, 3371, 3370, 2986, 2970, 2986, 3370, 3372, 2885, 3348, 3257, 2969, 2886, 3436, 2886, 2969, 2887, 3436, 2886, 3257, 2912, 3454, 3404, 3454, 2912, 2973, 3402, 3454, 2973, 3456, 2936, 3403, 3456, 3402, 2973, 3456, 2937, 2936, 3348, 2885, 3459, 2885, 2912, 3459, 3432, 2921, 2891, 2988, 3022, 3416, 3458, 3432, 2891, 2936, 3431, 3403, 3434, 3458, 2891, 2988, 3434, 2891, 3468, 3341, 2994, 2999, 3468, 2994, 2983, 3448, 3447, 2983, 3447, 3397, 3341, 2993, 2994, 3570, 3471, 3446, 2991, 3329, 3384, 3001, 3338, 3002, 3469, 2993, 3330, 3361, 3338, 3001, 201, 2991, 3384, 3329, 2991, 3469, 2925, 2994, 2926, 3470, 2984, 3397, 2991, 201, 203, 3383, 3001, 2967, 3382, 3001, 3383, 3362, 3001, 3382, 3361, 3001, 3362, 3061, 2827, 2829, 3506, 3019, 3507, 3023, 3020, 3505, 3518, 3029, 3557, 3025, 3524, 3517, 3466, 3016, 3473, 3555, 3015, 3023, 3022, 3024, 3465, 3022, 3465, 3417, 3465, 3024, 3466, 3555, 3016, 3015, 3474, 3023, 3505, 3024, 3016, 3466, 3008, 3025, 3535, 3008, 3507, 3019, 3023, 3474, 3555, 3008, 3535, 3507, 3019, 3506, 3026, 3016, 3555, 3473, 3029, 3518, 3524, 3563, 3426, 3032, 3063, 3566, 3049, 2838, 3047, 3043, 3045, 3573, 2839, 3573, 3031, 3030, 3030, 3426, 3062, 3035, 3040, 3564, 2842, 3034, 3564, 3042, 3563, 3032, 3568, 3567, 3039, 3566, 3034, 3033, 3565, 3035, 3564, 3574, 2789, 3050, 2828, 3034, 3048, 3045, 2839, 3043, 3048, 2829, 2828, 3568, 3054, 3042, 2842, 3564, 3040, 3047, 3581, 3043, 3581, 3574, 3050, 3030, 3582, 3573, 2839, 2838, 3043, 3062, 3582, 3030, 3034, 3566, 3564, 3583, 2830, 3572, 3044, 3560, 3045, 3560, 3044, 3052, 2840, 3049, 2972, 3582, 2839, 3573, 3426, 3030, 3032, 3035, 3042, 2845, 3575, 3046, 2830, 3582, 2807, 2837, 2839, 3582, 2837, 3559, 3558, 3053, 2830, 3583, 3575, 2810, 2807, 3582, 3582, 3062, 2810, 3063, 3049, 2840, 3583, 3584, 3575, 3046, 3581, 3047, 3054, 3568, 3039, 3567, 3037, 3039, 3044, 3581, 3052, 3045, 3559, 3053, 2789, 3574, 2835, 2835, 3575, 2836, 3053, 3568, 3031, 3574, 3581, 3046, 3574, 3046, 3575, 3584, 2836, 3575, 3581, 3044, 3043, 3559, 3045, 3560, 3035, 3563, 3042, 3568, 3053, 3558, 3052, 3581, 3050, 3566, 3033, 3049, 3047, 2838, 3571, 2846, 3054, 3039, 2972, 3049, 2827, 3064, 2833, 3055, 3584, 3585, 2836, 3585, 2789, 2836, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 3595, 3596, 3597, 3596, 3598, 3599, 3596, 3595, 3598, 3593, 3600, 3594, 3587, 3601, 3588, 3589, 3591, 3602, 3603, 3604, 3593, 3592, 3605, 3593, 3603, 3593, 3605, 3596, 3599, 3606, 3607, 3597, 3608, 3597, 3609, 3610, 3611, 3612, 3606, 3613, 3614, 3615, 3615, 3616, 3617, 3617, 3613, 3615, 3614, 3589, 3602, 3616, 3618, 3617, 3619, 3620, 3621, 3620, 3589, 3621, 3622, 3623, 3624, 1264, 3625, 990, 3626, 3627, 3628, 3629, 3630, 3627, 3631, 3632, 3591, 3626, 3633, 3632, 3627, 3626, 3632, 3626, 3622, 3634, 3631, 3627, 3632, 3632, 3633, 3602, 3632, 3602, 3591, 3627, 3631, 3635, 3635, 3629, 3627, 3590, 3631, 3591, 1495, 1423, 3636, 1424, 3637, 3636, 3623, 3638, 3624, 3623, 3639, 3638, 3640, 3624, 3638, 3639, 3623, 3641, 3639, 3642, 3638, 3641, 3642, 3639, 3634, 3604, 3616, 3604, 3640, 3643, 3604, 3643, 3593, 3644, 3633, 3634, 3645, 3593, 3643, 3614, 3644, 3615, 3643, 3640, 3645, 3616, 3644, 3634, 3640, 3634, 3624, 3600, 3645, 3642, 3646, 3647, 3648, 3611, 3599, 3649, 3646, 3650, 3649, 3647, 3598, 3651, 3599, 3611, 3606, 3598, 1440, 3651, 3598, 3595, 1440, 3607, 1475, 3595, 1475, 3652, 1476, 3607, 3652, 1475, 3653, 3607, 3608, 3654, 3655, 3656, 3652, 3607, 3657, 3656, 3655, 3658, 3653, 3657, 3607, 3653, 3656, 3658, 3647, 3649, 3599, 1475, 1444, 3595, 3622, 3628, 1495, 3656, 3659, 3654, 3607, 3595, 3597, 3640, 3604, 3634, 3636, 3623, 1495, 3634, 3622, 3624, 3638, 3642, 3645, 3630, 3660, 3627, 3622, 3626, 3628, 3625, 1264, 3661, 3593, 3645, 3600, 3644, 3614, 3602, 3644, 3616, 3615, 1495, 3623, 3622, 3608, 3659, 3656, 1472, 1475, 1476, 3656, 3653, 3608, 3645, 3640, 3638, 3633, 3626, 3634, 3628, 3627, 3660, 3647, 3646, 3649, 3647, 3651, 3648, 3647, 3599, 3598, 3633, 3644, 3602, 3651, 3662, 3648, 3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3674, 3675, 3676, 3670, 3677, 3678, 3679, 2854, 3680, 3681, 3675, 3682, 3675, 3681, 3676, 3669, 3677, 3670, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3673, 3691, 2854, 3692, 3693, 3694, 3695, 3691, 3696, 3671, 3697, 3698, 3699, 3694, 3693, 3700, 3701, 3702, 3703, 3704, 3705, 3699, 3706, 3597, 3610, 3673, 3672, 3707, 3708, 3709, 3710, 3711, 3612, 3712, 3713, 3714, 3715, 3716, 3663, 3665, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 3725, 3726, 3727, 3728, 3659, 3608, 3729, 3730, 3731, 3732, 3733, 3734, 3735, 3736, 3737, 3683, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 3745, 3746, 3747, 3748, 3749, 3750, 3751, 3614, 3752, 3753, 3754, 3755, 3722, 3721, 3756, 3747, 3757, 3758, 3744, 3759, 3760, 3761, 3663, 3762, 3721, 3763, 3764, 3765, 3766, 3767, 3740, 3768, 3748, 3747, 3769, 3770, 3771, 3749, 3738, 3758, 3772, 3614, 3619, 3621, 3773, 3774, 3775, 3665, 3618, 3776, 3765, 3777, 3766, 3775, 3748, 3778, 3714, 3713, 3779, 3780, 3677, 3781, 3782, 3692, 3783, 3702, 3784, 3609, 3694, 3785, 3682, 3609, 3784, 3686, 3786, 3787, 3685, 3674, 3690, 3675, 3763, 3718, 3788, 3589, 3614, 3621, 3682, 3789, 3681, 3710, 3723, 3708, 3764, 3747, 3771, 3709, 3790, 3730, 3791, 3792, 3793, 3699, 3705, 3679, 3597, 3702, 3609, 3707, 3689, 3673, 3794, 3775, 3774, 3795, 3733, 3735, 3796, 3776, 3797, 3603, 3797, 3776, 3798, 3740, 3739, 3799, 3800, 3727, 3801, 3678, 3677, 3767, 3768, 3745, 3678, 3801, 3802, 3803, 3742, 3780, 3689, 3804, 3805, 3773, 3669, 3806, 3804, 3791, 3805, 3740, 3767, 3738, 3696, 3691, 3692, 3807, 3779, 3774, 3808, 3809, 3810, 3714, 3779, 3807, 3753, 3780, 3741, 3811, 3756, 3812, 3752, 3754, 3813, 3747, 3749, 3771, 3696, 3810, 3671, 3814, 3749, 3815, 3706, 3610, 3816, 3734, 3733, 3817, 3706, 3816, 3818, 3819, 3820, 3790, 3821, 3816, 3688, 3675, 3690, 3682, 3791, 3695, 3805, 3690, 3805, 3695, 3799, 3727, 3726, 3822, 3823, 3824, 3825, 3786, 3824, 3823, 3826, 3824, 3825, 3827, 3787, 3828, 3829, 3830, 2798, 3728, 3727, 3831, 3832, 3736, 3800, 3822, 3727, 3833, 3822, 3824, 3822, 3833, 3727, 3823, 3834, 3826, 3737, 3684, 3683, 3826, 3825, 3824, 3835, 3836, 3800, 3825, 3837, 3827, 3827, 3838, 3787, 3684, 3786, 3685, 3685, 3839, 3831, 3838, 3685, 3787, 3786, 3840, 3824, 3841, 3736, 3842, 3737, 3790, 3684, 3831, 3736, 3683, 3732, 3843, 3795, 3730, 3737, 3841, 3839, 3685, 3838, 3831, 3839, 3832, 3683, 3685, 3831, 3732, 3709, 3730, 3731, 3730, 3841, 3736, 3841, 3737, 3708, 3790, 3709, 3731, 3843, 3732, 3795, 3735, 3732, 3708, 3819, 3790, 3686, 3688, 3816, 3735, 3710, 3709, 3844, 3818, 3816, 3730, 3790, 3737, 3709, 3732, 3735, 3786, 3825, 3787, 3733, 3845, 3846, 3687, 3847, 3688, 3848, 3710, 3734, 3845, 3733, 3795, 3610, 3686, 3816, 3731, 3841, 3842, 3849, 3817, 3687, 3849, 3734, 3817, 3710, 3735, 3734, 3686, 3849, 3687, 3817, 3733, 3846, 3610, 3609, 3686, 3849, 3784, 3734, 3821, 3844, 3816, 3608, 3706, 3729, 3702, 3597, 3596, 3847, 3821, 3688, 3849, 3686, 3784, 3606, 3612, 3703, 3703, 3702, 3596, 3608, 3597, 3706, 3729, 3850, 3659, 3851, 3699, 3679, 3852, 3700, 3693, 3785, 3789, 3682, 3697, 3699, 3851, 3700, 3785, 3694, 3699, 3698, 3704, 3698, 3697, 3853, 3851, 3852, 3853, 3792, 3791, 3804, 3852, 3851, 3700, 3770, 3765, 3771, 3820, 3819, 3854, 3785, 3700, 3851, 3695, 3694, 3690, 3690, 3689, 3805, 3690, 3674, 3673, 3819, 3708, 3723, 3672, 3790, 3707, 3820, 3707, 3790, 3848, 3724, 3723, 3734, 3784, 3855, 3855, 3848, 3734, 3612, 3711, 3856, 3784, 3702, 3855, 3848, 3855, 3724, 3701, 3855, 3702, 3606, 3703, 3596, 3703, 3612, 3856, 3723, 3710, 3848, 3611, 3712, 3612, 3851, 3853, 3697, 3694, 3682, 3690, 3857, 3858, 3783, 3810, 3696, 3808, 3705, 3783, 3679, 3782, 3859, 3696, 3704, 3783, 3705, 3696, 3859, 3808, 3618, 3616, 3776, 3692, 3679, 3783, 3775, 3860, 3748, 3782, 3696, 3692, 3815, 3861, 3814, 3810, 3714, 3862, 3809, 3808, 3715, 3810, 3809, 3714, 3671, 3810, 3862, 3670, 3691, 3671, 3809, 3715, 3714, 3691, 3670, 2854, 3781, 3677, 3669, 3807, 3669, 3714, 3863, 3803, 3780, 3863, 3781, 3773, 3780, 3781, 3863, 3862, 3669, 3671, 3669, 3862, 3714, 3806, 3669, 3807, 3781, 3669, 3773, 3773, 3806, 3774, 3613, 3664, 3750, 3806, 3807, 3774, 3774, 3864, 3794, 3778, 3773, 3775, 3778, 3748, 3769, 3748, 3815, 3749, 3863, 3773, 3769, 3773, 3778, 3769, 3865, 3861, 3668, 3814, 3770, 3749, 3770, 3814, 3865, 3864, 3774, 3779, 3860, 3815, 3748, 3680, 3789, 3851, 3680, 3851, 3679, 2854, 3679, 3692, 3858, 3782, 3783, 3789, 3785, 3851, 3747, 3764, 3757, 3762, 3865, 3667, 3865, 3668, 3667, 3814, 3861, 3865, 3762, 3765, 3865, 3719, 3720, 3663, 3716, 3760, 3663, 3763, 3777, 3765, 3666, 3721, 3667, 3717, 3719, 3761, 3617, 3665, 3664, 3718, 3717, 3788, 3613, 3750, 3614, 3592, 3866, 3605, 3776, 3796, 3665, 3722, 3867, 3750, 3719, 3663, 3761, 3664, 3613, 3617, 3618, 3665, 3617, 3604, 3603, 3776, 3796, 3716, 3665, 3616, 3604, 3776, 3762, 3763, 3765, 3720, 3664, 3663, 3720, 3722, 3664, 3664, 3722, 3750, 3763, 3720, 3718, 3777, 3763, 3788, 3719, 3718, 3720, 3720, 3763, 3721, 3721, 3762, 3667, 3865, 3765, 3770, 3868, 3755, 3721, 3721, 3666, 3868, 3869, 3863, 3769, 3747, 3869, 3769, 3756, 3869, 3747, 3811, 3869, 3756, 3803, 3869, 3811, 3780, 3742, 3741, 3768, 3870, 3745, 3813, 3754, 3743, 3863, 3869, 3803, 3765, 3764, 3771, 3677, 3780, 3753, 3753, 3801, 3677, 3801, 3798, 3802, 3741, 3743, 3754, 3870, 3768, 3752, 3738, 3767, 3745, 3739, 3738, 3772, 3768, 3798, 3753, 3753, 3741, 3754, 3871, 3746, 3745, 3758, 3745, 3744, 3772, 3027, 3739, 3738, 3745, 3758, 3768, 3740, 3798, 3745, 3870, 3871, 3758, 3872, 3772, 3753, 3752, 3768, 3753, 3798, 3801, 3867, 3722, 3755, 3873, 3874, 3867, 3751, 3619, 3614, 3750, 3867, 3751, 3867, 3874, 3751, 3755, 3873, 3867, 3875, 3876, 3877, 3878, 3875, 3877, 2799, 3879, 3880, 3879, 3876, 3875, 3879, 3875, 3881, 3879, 3882, 3880, 3800, 3836, 3822, 3883, 3884, 3885, 3885, 3886, 3883, 3885, 3884, 3887, 3886, 3888, 3883, 3889, 3890, 3891, 3892, 3890, 3893, 3894, 3892, 3893, 3895, 3896, 3893, 3896, 3895, 3897, 3898, 3899, 3900, 3899, 3901, 3900, 3900, 3901, 3902, 3903, 3904, 3905, 3906, 3903, 3905, 3907, 3908, 3909, 3910, 3911, 3912, 3909, 3910, 3912, 3908, 3907, 3906, 3913, 3914, 3915, 3916, 3915, 3917, 3917, 3915, 3918, 3901, 3919, 3902, 3920, 3889, 3891, 3914, 3921, 3922, 3888, 3923, 3883, 3924, 3925, 3926, 3914, 3922, 3915, 3906, 3905, 3927, 3928, 3905, 3904, 3896, 3894, 3893, 3927, 3908, 3906, 3928, 3904, 3929, 3930, 3931, 3932, 3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3939, 3944, 3943, 3945, 3941, 3942, 3939, 3945, 3946, 3944, 3936, 3947, 3948, 3949, 3950, 3921, 3951, 3950, 3952, 3950, 3951, 3921, 3953, 3954, 3955, 3950, 3956, 3952, 3957, 3952, 3956, 3958, 3957, 3956, 3959, 3960, 3961, 3962, 3963, 3964, 3965, 3966, 3967, 3968, 3897, 3969, 3960, 3959, 3970, 3932, 3931, 3971, 3944, 3972, 3973, 3971, 3960, 3932, 3974, 3961, 3960, 3959, 3975, 3976, 3960, 3971, 3974, 3975, 3977, 3976, 3935, 3978, 3933, 3979, 3980, 3981, 3982, 3962, 3964, 3983, 3965, 3984, 3897, 3968, 3985, 3947, 3936, 3938, 3964, 3986, 3987, 3966, 3987, 3986, 3988, 3989, 3990, 3966, 3986, 3991, 3991, 3967, 3966, 3990, 3992, 3993, 3969, 3897, 3994, 3896, 3897, 3985, 3982, 3981, 3995, 3980, 3928, 3929, 3996, 3997, 3998, 3997, 3984, 3998, 3965, 3983, 3966, 3989, 3992, 3990, 3962, 3982, 3995, 3980, 3929, 3981, 3986, 3964, 3963, 3965, 3998, 3984, 3982, 3979, 3981, 3972, 3944, 3946, 3999, 3959, 3976, 4000, 3977, 3975, 3984, 4001, 3983, 3976, 4002, 3999, 3970, 4003, 4004, 4005, 3970, 4004, 4003, 3970, 3999, 4006, 3930, 4007, 3970, 4005, 3960, 4008, 4009, 3988, 4010, 4011, 3983, 4012, 3994, 4013, 4014, 4015, 3994, 3996, 4009, 3997, 4016, 3993, 4017, 4011, 3966, 3983, 4018, 4019, 3978, 4020, 4021, 4015, 4022, 4023, 4021, 4022, 4017, 4023, 4024, 4022, 4021, 4025, 4010, 3983, 4012, 4014, 3994, 3990, 3993, 4016, 4017, 3993, 4023, 4008, 3988, 3990, 4013, 3994, 3897, 4009, 3996, 3988, 4026, 4027, 4018, 3937, 4028, 4029, 4027, 4019, 4018, 4030, 3937, 4029, 3999, 4002, 4003, 4007, 4031, 4006, 4021, 4020, 4024, 4032, 4030, 4029, 3948, 3939, 4033, 4015, 4021, 3994, 3958, 4034, 4035, 4034, 3956, 3949, 3958, 4035, 4036, 3956, 3950, 3949, 3956, 4034, 3958, 4025, 3983, 4001, 3936, 4028, 3937, 3973, 4037, 3944, 3940, 3939, 3948, 3943, 4033, 3939, 4037, 3973, 4038, 4039, 4028, 3948, 4028, 3936, 3948, 4032, 4018, 4040, 4038, 4041, 4006, 3943, 3944, 4033, 4042, 4006, 4031, 4006, 4042, 4038, 4030, 4032, 4040, 4039, 3948, 4033, 3978, 4019, 3933, 4018, 4032, 4026, 4038, 3973, 4041, 3910, 4043, 3911, 3914, 3949, 3921, 4036, 4044, 3958, 4045, 4046, 3919, 3890, 3889, 4047, 3901, 3899, 3919, 3917, 3954, 4048, 4049, 3916, 3917, 3953, 4048, 3954, 3916, 3914, 3913, 4050, 3909, 3908, 3909, 4050, 3910, 4045, 3899, 3898, 4051, 4045, 3898, 4046, 4052, 3919, 4052, 4053, 3919, 3899, 4045, 3919, 4047, 4054, 3890, 3893, 3890, 4054, 3884, 3883, 3923, 3884, 4055, 3887, 4056, 3884, 3923, 3924, 3958, 4044, 4055, 3884, 4056, 4057, 3900, 4058, 4059, 4060, 4061, 4060, 4059, 3888, 4060, 4062, 4063, 4064, 4065, 4066, 4067, 4066, 4068, 3958, 3924, 3926, 4067, 4064, 4066, 4065, 4069, 4066, 4070, 3925, 4059, 3886, 4071, 4062, 3926, 4070, 4072, 4060, 4063, 4061, 4071, 4069, 4065, 3888, 3886, 4062, 4073, 4074, 4075, 4061, 4063, 4076, 4077, 4076, 4064, 4062, 4060, 3888, 4061, 4076, 4078, 4064, 4067, 4079, 4064, 4076, 4065, 4078, 4076, 4080, 4078, 4081, 4082, 4063, 4065, 4076, 4077, 4083, 4080, 4084, 4085, 4086, 4074, 4080, 4083, 4079, 4087, 4088, 4082, 4075, 4086, 4086, 4070, 4082, 4070, 3926, 3925, 4087, 4067, 4089, 4070, 4059, 4078, 4068, 4089, 4067, 4090, 4059, 3925, 4082, 4081, 4075, 4081, 4078, 4080, 4091, 4092, 4089, 4083, 4077, 4079, 4067, 4087, 4079, 4081, 4073, 4075, 4059, 4090, 3888, 4059, 4061, 4078, 4093, 4094, 4095, 4093, 4096, 4097, 4095, 4098, 4099, 2513, 4100, 4101, 4100, 4102, 4103, 4104, 4100, 4103, 4100, 4105, 4101, 4102, 4100, 4106, 4103, 3968, 4104, 4107, 1818, 4106, 4107, 4100, 1818, 4106, 4108, 4102, 4100, 2513, 1818, 4109, 3891, 3892, 4098, 4110, 4111, 3985, 4108, 4112, 4113, 4095, 4094, 4114, 4096, 4099, 4115, 4114, 4099, 4116, 4112, 4108, 4116, 4115, 4099, 4113, 4094, 3660, 4116, 4108, 4115, 4096, 4093, 4095, 4110, 4109, 4111, 3894, 4109, 3892, 3985, 4112, 4117, 4109, 3894, 4111, 4116, 4098, 4111, 3891, 4109, 3920, 4096, 4114, 4097, 3985, 4117, 3896, 4116, 4117, 4112, 4109, 4110, 4118, 4116, 3894, 4117, 3894, 4116, 4111, 4119, 4120, 4121, 4122, 4119, 4121, 4123, 4124, 4119, 4123, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4133, 4136, 4137, 4136, 4131, 4138, 4137, 4136, 4138, 4138, 4139, 4137, 4140, 4132, 4136, 4141, 4142, 4130, 4143, 4144, 4130, 4121, 4127, 4129, 4131, 4136, 4132, 1417, 4145, 4129, 4146, 4119, 4140, 4131, 4130, 4144, 4147, 4148, 4149, 4147, 4150, 4151, 4128, 4120, 4152, 4148, 4151, 4135, 4150, 4149, 4153, 4132, 4122, 4130, 4128, 4152, 4154, 4150, 4147, 4149, 4120, 4155, 4152, 4156, 4150, 4153, 4148, 4147, 4151, 4134, 4133, 4137, 4155, 4120, 4119, 4125, 4156, 4153, 4124, 4157, 4119, 4136, 4133, 4135, 3902, 4126, 3900, 4149, 4158, 4153, 4126, 4159, 4124, 4053, 4160, 3902, 4126, 4125, 3900, 3900, 4125, 4058, 4125, 4123, 4119, 4053, 3902, 3919, 3900, 4057, 3898, 4159, 3902, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4164, 4167, 4169, 4170, 4166, 4167, 4164, 4171, 4172, 4173, 4174, 4166, 4165, 4174, 4175, 4176, 4175, 4174, 4165, 4161, 4177, 4178, 4177, 4161, 4179, 4175, 4161, 4178, 4162, 4171, 4173, 4162, 4173, 4163, 4179, 4163, 3903, 3929, 4173, 4180, 4168, 4170, 1952, 4161, 4164, 4171, 3903, 3906, 4179, 3903, 4173, 3904, 4181, 4182, 4180, 4182, 4181, 4173, 4173, 4172, 4182, 4161, 4175, 4165, 4161, 4163, 4179, 4171, 4162, 4161, 4177, 4183, 4178, 4179, 3906, 3907, 3907, 4177, 4179, 4184, 4175, 4178, 4185, 4186, 4187, 4188, 4189, 4190, 3915, 3922, 4191, 4192, 4193, 4194, 4195, 4196, 4197, 4186, 4198, 4199, 4200, 4198, 4190, 4199, 4201, 4191, 4202, 4193, 4199, 4190, 4203, 4200, 4189, 4188, 4204, 4205, 4206, 4188, 4207, 4200, 4208, 4202, 4199, 4191, 3918, 3915, 4191, 3918, 3955, 3954, 4193, 4186, 4199, 4189, 4209, 4203, 4187, 4186, 4193, 4201, 4200, 4207, 4210, 4208, 4209, 3922, 4202, 4191, 4198, 4200, 4199, 4191, 4201, 4207, 4184, 4211, 4175, 4164, 4172, 4171, 4165, 4164, 4161, 4169, 4166, 4176, 4124, 4123, 4126, 4156, 4151, 4150, 4122, 4132, 4140, 4136, 4146, 4140, 4127, 4121, 4128, 4110, 4095, 4118, 4118, 4095, 4113, 4094, 4093, 4097, 4118, 4212, 4109, 4158, 4057, 4153, 4189, 4203, 4190, 4208, 4210, 4207, 4196, 4185, 4187, 4058, 4125, 4153, 4071, 3886, 3885, 4193, 4202, 4194, 4170, 4168, 4167, 4203, 4208, 4200, 4057, 4158, 3934, 4156, 4125, 4119, 4108, 4213, 4115, 4110, 4098, 4095, 4108, 3985, 4102, 4122, 4140, 4119, 4214, 4157, 4124, 4158, 4149, 3934, 4142, 4143, 4130, 4087, 4092, 4088, 4074, 4073, 4080, 3916, 3913, 3915, 4073, 4081, 4080, 4070, 4078, 4082, 4209, 4189, 4204, 4079, 4077, 4064, 4070, 4085, 4215, 4191, 4207, 3955, 4076, 4077, 4080, 4216, 4205, 4188, 4190, 4217, 4188, 4083, 4079, 4088, 4065, 4062, 4071, 4191, 3955, 3918, 4208, 4203, 4209, 4065, 4063, 4062, 3923, 3888, 4090, 4070, 4086, 4085, 4201, 4199, 4200, 4163, 4173, 3903, 4186, 4190, 4198, 4202, 3922, 4194, 4092, 4087, 4089, 3918, 3954, 3917, 4193, 4192, 4187, 3909, 4183, 3907, 4187, 4192, 4196, 4130, 4121, 4141, 4057, 4058, 4153, 4122, 4121, 4130, 4120, 4128, 4121, 4155, 4157, 4152, 4214, 4124, 4159, 4159, 4126, 3902, 4117, 3894, 3896, 4099, 4096, 4095, 4108, 4106, 1818, 4098, 4116, 4099, 3968, 4103, 4102, 4105, 4100, 4104, 3890, 3892, 3891, 4100, 4107, 4106, 4173, 3929, 3904, 4173, 4181, 4180, 4169, 4167, 4166, 4177, 3907, 4183, 4211, 4176, 4175, 4166, 4174, 4176, 4183, 3909, 3912, 4139, 4138, 4131, 4169, 4176, 4218, 4155, 4119, 4157, 4151, 4156, 4135, 4156, 4146, 4135, 3934, 4149, 4148, 4219, 4220, 4221, 4222, 4223, 4224, 3938, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4146, 4156, 4119, 4233, 4234, 4235, 4228, 4236, 4237, 4238, 4224, 4040, 4239, 4137, 4139, 4236, 4240, 4237, 4235, 4234, 3945, 4148, 4222, 3935, 4241, 4237, 4240, 4242, 4243, 4219, 4146, 4136, 4135, 4228, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4233, 4253, 4254, 4255, 4256, 4257, 4230, 4258, 4223, 4259, 4224, 4260, 4244, 4228, 4231, 4261, 4262, 4237, 4257, 4258, 4232, 4231, 4263, 4264, 3930, 4006, 4240, 4265, 4252, 4251, 3973, 3972, 3937, 4030, 4266, 4257, 4226, 4230, 4267, 4268, 4269, 3978, 3935, 4238, 4243, 4270, 4271, 3972, 3946, 4271, 4272, 4229, 4220, 4241, 4257, 4237, 3947, 3940, 3948, 4230, 4259, 4231, 4243, 4234, 4219, 3946, 3945, 4271, 4266, 4224, 4259, 4225, 3938, 3937, 4226, 4273, 3938, 4260, 4232, 4263, 4273, 4248, 4274, 3931, 3930, 4264, 4271, 4249, 3972, 4275, 4267, 4276, 4224, 4266, 4040, 4268, 4249, 4270, 3974, 4277, 3961, 4247, 4241, 4240, 3947, 3938, 4273, 3943, 3942, 3945, 4271, 4270, 4249, 4225, 3937, 4266, 4273, 4246, 4248, 4271, 4234, 4243, 4251, 4264, 4041, 4253, 4278, 4252, 4279, 4280, 4242, 4219, 4272, 4220, 4268, 4281, 4249, 4250, 4264, 4251, 4282, 4283, 4250, 4284, 4285, 4282, 4261, 4222, 4134, 4268, 4250, 4281, 4250, 4284, 4282, 3959, 3999, 3970, 4283, 4286, 3971, 4284, 4268, 4287, 4251, 3972, 4249, 4281, 4250, 4249, 4030, 4040, 4266, 4267, 4288, 4276, 4222, 4148, 4134, 4270, 4243, 4269, 4240, 4236, 4265, 4259, 4230, 4226, 3942, 4253, 4235, 4253, 3942, 3941, 4247, 4278, 4248, 4233, 4235, 4253, 4233, 4272, 4219, 4228, 4237, 4258, 4248, 3941, 4274, 4240, 4252, 4247, 4259, 4225, 4266, 3945, 3942, 4235, 4272, 4227, 4229, 4289, 4290, 4276, 4221, 4242, 4219, 4280, 4279, 4289, 4290, 4291, 4276, 4261, 4231, 4223, 4292, 4293, 4294, 3967, 4295, 4293, 3991, 3963, 4296, 4297, 4298, 4299, 4299, 4300, 4297, 4301, 4300, 3951, 4302, 4303, 4304, 4215, 4305, 4306, 4192, 4197, 4196, 4307, 4297, 4301, 4192, 4308, 4309, 4301, 3952, 4305, 4310, 4195, 4197, 4072, 4070, 4306, 4308, 4192, 4194, 4297, 4311, 4298, 4301, 4305, 4307, 4309, 4312, 4310, 4307, 4305, 4313, 4312, 4303, 4314, 4313, 4315, 4316, 4215, 4306, 4070, 3957, 4072, 4306, 4298, 4308, 4299, 4300, 4299, 3951, 4195, 4310, 4314, 3957, 3958, 3926, 4300, 4301, 4297, 4317, 3921, 3951, 3922, 3921, 4194, 4297, 4307, 4313, 4318, 4313, 4305, 4304, 4312, 4298, 4313, 4311, 4297, 4317, 4299, 4308, 4319, 4206, 4205, 4320, 4205, 4216, 4303, 4312, 4304, 4206, 4204, 4188, 4321, 4322, 4206, 4315, 4313, 4318, 4072, 3957, 3926, 3952, 3957, 4306, 4197, 4309, 4310, 4207, 4210, 3658, 4299, 4317, 3951, 3952, 4306, 4305, 4209, 4204, 4322, 4322, 4323, 4209, 4204, 4206, 4322, 4323, 3658, 4210, 4317, 4194, 3921, 4308, 4298, 4309, 4311, 4304, 4298, 4323, 4210, 4209, 4194, 4317, 4308, 4215, 4085, 4305, 4311, 4313, 4316, 3951, 3952, 4301, 4303, 4302, 4314, 4324, 4289, 4279, 4325, 4326, 4327, 4018, 4238, 4040, 4328, 4329, 4330, 3967, 4331, 3965, 3967, 3991, 4295, 4332, 4333, 4334, 4335, 3995, 4336, 3991, 4296, 4295, 4227, 4272, 4265, 4310, 4312, 4314, 4192, 4309, 4197, 4205, 4320, 4319, 4206, 4319, 4321, 4312, 4309, 4298, 4268, 4275, 4287, 4275, 4337, 4287, 4338, 4283, 4282, 4329, 4337, 4339, 4250, 3931, 4264, 4280, 4288, 4269, 4268, 4270, 4269, 4137, 4261, 4134, 4275, 4268, 4267, 4285, 4328, 4338, 4337, 4329, 4285, 4243, 4242, 4269, 4340, 4220, 4229, 4285, 4287, 4337, 4265, 4272, 4233, 4341, 4000, 4342, 3941, 4248, 4253, 4343, 3974, 4338, 4288, 4267, 4269, 3931, 4250, 4283, 4277, 4343, 4344, 4225, 4259, 4226, 4328, 4343, 4338, 4280, 4269, 4242, 4342, 3975, 3961, 4242, 4221, 4279, 4018, 3978, 4238, 4330, 4345, 4346, 4341, 4347, 4348, 3940, 3947, 4274, 4348, 4349, 4350, 4342, 4000, 3975, 4348, 4344, 4349, 4273, 4274, 3947, 3935, 3934, 4148, 4277, 3974, 4343, 4273, 4257, 4246, 4289, 4276, 4288, 4257, 4241, 4246, 4285, 4284, 4287, 4006, 4041, 4264, 4347, 4342, 3961, 4343, 4328, 4344, 4285, 4338, 4282, 3974, 4286, 4338, 4227, 4265, 4236, 4289, 4324, 4290, 4231, 4262, 4263, 4224, 4238, 4222, 4268, 4284, 4250, 4251, 4041, 3973, 4228, 4227, 4236, 3971, 3931, 4283, 3940, 4274, 3941, 4344, 4328, 4349, 4247, 4246, 4241, 4172, 4351, 4352, 3981, 4327, 3995, 4353, 4294, 4296, 4354, 4335, 4336, 4335, 4354, 4355, 4254, 4356, 4255, 4333, 3992, 4256, 3963, 3962, 4355, 3989, 3988, 3996, 4023, 3969, 4021, 4357, 4334, 4105, 3994, 4021, 3969, 4358, 3965, 4331, 3998, 3965, 4358, 4359, 4357, 4104, 3962, 3995, 4355, 4358, 4360, 3996, 3996, 3998, 4358, 3968, 3969, 4104, 4333, 4361, 4334, 4296, 4355, 4362, 4334, 4357, 4332, 4353, 4362, 4363, 4334, 4361, 4105, 4234, 4233, 4219, 4228, 4245, 4229, 4148, 4135, 4134, 4330, 4349, 4328, 4357, 4359, 4023, 3968, 4102, 3985, 3992, 3989, 4256, 4293, 4331, 3967, 4357, 4105, 4104, 4359, 3969, 4023, 4362, 4353, 4296, 3989, 3996, 4360, 4332, 4357, 4364, 3992, 4333, 4332, 3986, 3963, 3991, 3992, 4364, 3993, 4294, 4295, 4296, 3995, 4335, 4355, 4365, 4333, 4256, 4172, 4352, 4182, 3989, 4360, 4254, 4364, 3992, 4332, 4256, 3989, 4254, 4295, 4294, 4293, 4355, 4296, 3963, 4333, 4365, 4361, 4356, 4293, 4292, 4362, 4355, 4354, 4364, 4357, 4023, 4293, 4356, 4331, 4358, 4331, 4254, 4326, 3995, 4327, 4325, 4327, 4180, 4366, 4354, 4336, 4360, 4358, 4254, 3995, 4326, 4336, 3993, 4364, 4023, 4326, 4325, 4336, 4367, 4366, 4336, 4180, 4327, 3929, 4356, 4254, 4331, 4327, 3981, 3929, 4362, 4354, 4363, 4325, 4180, 4182, 4232, 4260, 4258, 4258, 4260, 4228, 4261, 4137, 4239, 4232, 4258, 4230, 4289, 4288, 4280, 4104, 3969, 4359, 4319, 4368, 4321, 4231, 4259, 4223, 4239, 4262, 4261, 4222, 4261, 4223, 3935, 4222, 4238, 4226, 4257, 4273, 4265, 4233, 4252, 4278, 4247, 4252, 4278, 4253, 4248, 4234, 4271, 3945, 4286, 4283, 4338, 4286, 3974, 3971, 4328, 4285, 4329, 4348, 4277, 4344, 4347, 4341, 4342, 3975, 3959, 3961, 4277, 4348, 4347, 4277, 4347, 3961, 4369, 4370, 4371, 4372, 4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 4385, 4386, 4384, 4387, 4385, 4388, 4389, 4390, 4385, 4391, 4392, 4393, 4394, 4395, 4396, 4397, 4393, 4396, 4398, 4399, 4394, 4397, 4400, 4382, 4395, 4401, 4402, 4403, 4404, 4405, 4397, 4403, 4405, 4406, 4400, 4400, 4406, 4407, 4397, 4394, 4393, 4408, 4394, 4400, 4409, 4410, 4372, 4403, 4397, 4399, 4387, 4384, 4411, 4404, 4412, 4413, 4414, 4404, 4415, 4404, 4416, 4415, 4395, 4417, 4401, 4418, 4419, 4420, 4392, 4380, 4420, 4399, 4421, 4422, 4398, 4396, 4393, 4423, 4424, 4425, 4424, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 4383, 4435, 4436, 4408, 4384, 4436, 4437, 4438, 4408, 4436, 4417, 4439, 4440, 4438, 4437, 4420, 4439, 4437, 4436, 4386, 4436, 4401, 4417, 4441, 4434, 4435, 4435, 4442, 4443, 4417, 4395, 4408, 4382, 4401, 4444, 4445, 4446, 4447, 4445, 4423, 4448, 4449, 4450, 4451, 4441, 4452, 4453, 4423, 4425, 4448, 4452, 4454, 4426, 4455, 4456, 4457, 4427, 4458, 4455, 4427, 4426, 4454, 4459, 4448, 4425, 4460, 4461, 4462, 4463, 4464, 4465, 4442, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4439, 4471, 4419, 4473, 4474, 4475, 4462, 4393, 4382, 4381, 4419, 4471, 4439, 4473, 4476, 4477, 4462, 4475, 4478, 4479, 4475, 4474, 4480, 4462, 4477, 4466, 4442, 4444, 4443, 4481, 4441, 4443, 4442, 4467, 4381, 4383, 4398, 4421, 4399, 4398, 4393, 4381, 4398, 4438, 4401, 4436, 4482, 4467, 4483, 4454, 4481, 4458, 4467, 4482, 4481, 4428, 4458, 4482, 4431, 4484, 4432, 4434, 4485, 4383, 4434, 4441, 4453, 4486, 4485, 4453, 4486, 4487, 4488, 4489, 4490, 4491, 4490, 4489, 4414, 4423, 4445, 4447, 4459, 4425, 4492, 4459, 4493, 4450, 4494, 4495, 4496, 4487, 4486, 4453, 4454, 4452, 4441, 4424, 4455, 4425, 4497, 4452, 4426, 4448, 4449, 4446, 4456, 4455, 4498, 4424, 4423, 4426, 4446, 4449, 4432, 4499, 4489, 4496, 4496, 4489, 4491, 4500, 4495, 4501, 4487, 4447, 4484, 4431, 4490, 4502, 4502, 4490, 4416, 4446, 4484, 4447, 4491, 4431, 4433, 4433, 4496, 4491, 4503, 4450, 4504, 4449, 4451, 4432, 4446, 4445, 4448, 4505, 4506, 4507, 4494, 4496, 4508, 4509, 4503, 4510, 4510, 4511, 4512, 4513, 4511, 4514, 4513, 4515, 4512, 3997, 4008, 4501, 4493, 4459, 4492, 4503, 4504, 4516, 4494, 4515, 4517, 4487, 4502, 4416, 4518, 4516, 4519, 4025, 4505, 4507, 4505, 4025, 4001, 4505, 4514, 4506, 4004, 4520, 4521, 4522, 4523, 4524, 4525, 4526, 4527, 4528, 4529, 3976, 4528, 3976, 3977, 4530, 4531, 4524, 4374, 4375, 4377, 3960, 4005, 3932, 4532, 4533, 4534, 4379, 4418, 4420, 4535, 4536, 4537, 4538, 4539, 4540, 4536, 4535, 4541, 4511, 4510, 4516, 4541, 4542, 4543, 4544, 4545, 4546, 4547, 4548, 4549, 4410, 4409, 4550, 4545, 4544, 4551, 4552, 4553, 4554, 4549, 4546, 4555, 4556, 4557, 4558, 4559, 4560, 4556, 4561, 4562, 4563, 4556, 4560, 4561, 4564, 4565, 4563, 4540, 4554, 4566, 4562, 4567, 4563, 4552, 4568, 4569, 4568, 4570, 4571, 4554, 4539, 4568, 4568, 4539, 4558, 4572, 4571, 4573, 4571, 4572, 4568, 4503, 4516, 4510, 4550, 4409, 4574, 4546, 4575, 4544, 4575, 4546, 4549, 4495, 4494, 4517, 4539, 4538, 4558, 4576, 4577, 4578, 4579, 4580, 4581, 4008, 3997, 4009, 4582, 4583, 4584, 4002, 3976, 4531, 4531, 4530, 4002, 4585, 4463, 4586, 4587, 4588, 4589, 4587, 4590, 4591, 4472, 4592, 4439, 4509, 4510, 4512, 3928, 3980, 4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4008, 3990, 4603, 4011, 3987, 3966, 4604, 4582, 4584, 4001, 3984, 4517, 4020, 4605, 4024, 4606, 4607, 4608, 4429, 4609, 4610, 4397, 4396, 4399, 4441, 4481, 4454, 4415, 4416, 4490, 4457, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4025, 4507, 4010, 4619, 4620, 4621, 4455, 4424, 4427, 4622, 4623, 4616, 4457, 4624, 4611, 4472, 4473, 4477, 4010, 4507, 4625, 4626, 4627, 4628, 4518, 4514, 4511, 4384, 4407, 4411, 4628, 4629, 4630, 4631, 4632, 4499, 4481, 4443, 4467, 4416, 4488, 4487, 4478, 4633, 4462, 4634, 4635, 4636, 4637, 4638, 4603, 4492, 4639, 4493, 4640, 4641, 4478, 4583, 4634, 4584, 4507, 4506, 4518, 4590, 4587, 4642, 4643, 4644, 4011, 4636, 4643, 4645, 4646, 4647, 4648, 4649, 4430, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 4496, 4433, 4508, 4502, 4484, 4431, 4657, 4602, 4658, 4635, 4634, 4659, 4457, 4456, 4649, 4511, 4516, 4518, 4495, 4500, 4496, 4660, 4640, 4661, 4628, 4662, 4629, 4455, 4457, 4612, 4488, 4416, 4421, 4487, 4497, 4447, 4663, 3987, 4664, 4664, 4665, 4663, 4660, 4629, 4662, 4666, 4667, 4668, 4669, 4619, 4621, 4641, 4660, 4662, 4627, 4626, 4646, 4472, 4471, 4473, 4404, 4414, 4670, 4620, 4619, 4671, 4620, 4672, 4621, 4634, 4636, 4584, 4662, 4627, 4652, 4659, 4655, 4635, 4673, 4605, 4674, 4467, 4466, 4483, 4605, 4020, 4015, 4639, 4617, 4582, 4511, 4513, 4512, 4658, 4675, 4674, 4650, 4651, 4653, 4383, 4444, 4442, 4610, 4676, 4460, 4677, 4678, 4679, 4588, 4599, 4665, 4458, 4427, 4454, 4680, 4591, 4648, 4436, 4384, 4386, 4681, 4636, 4625, 4649, 4682, 4624, 4022, 4637, 4603, 4683, 4684, 4597, 4644, 4643, 4635, 4685, 4598, 3979, 4648, 4686, 4680, 4675, 4602, 4601, 4516, 4504, 4519, 4472, 4676, 4592, 4646, 4653, 4627, 4460, 4462, 4633, 4656, 4655, 4589, 4651, 4687, 4633, 4480, 4474, 4462, 4458, 4498, 4455, 4642, 4688, 4623, 4687, 4429, 4633, 4640, 4660, 4641, 4598, 4597, 3979, 4689, 4583, 4617, 4690, 4630, 4629, 4687, 4691, 4430, 4641, 4662, 4652, 4689, 4616, 4623, 4588, 4587, 4591, 4692, 4693, 4694, 4624, 4616, 4611, 4695, 4694, 4693, 4696, 4598, 4685, 4629, 4660, 4661, 4604, 4519, 4504, 4684, 4683, 4694, 4665, 4599, 4598, 4423, 4447, 4497, 4645, 4011, 4010, 4611, 4616, 4618, 4625, 4507, 4681, 4665, 4598, 4696, 4636, 4645, 4625, 4694, 4683, 4692, 4595, 4594, 4697, 4631, 4499, 4500, 4519, 4681, 4507, 4412, 4404, 4670, 4632, 4600, 4489, 4008, 4603, 4631, 4008, 4500, 4501, 4461, 4472, 4477, 4440, 4401, 4438, 4016, 4022, 4603, 4667, 4698, 4014, 4638, 4601, 4603, 4428, 4430, 4456, 4609, 4483, 4610, 4602, 4414, 4600, 4514, 4505, 4001, 4515, 4513, 4514, 4666, 4699, 4700, 4701, 4702, 4703, 4437, 4439, 4438, 4704, 4674, 4675, 4489, 4499, 4632, 4016, 4603, 3990, 4670, 4414, 4602, 4440, 4610, 4483, 4705, 4703, 4702, 4706, 4702, 4701, 4612, 4425, 4455, 4707, 4412, 4708, 4639, 4604, 4504, 4582, 4617, 4583, 4638, 4673, 4704, 4382, 4444, 4383, 4588, 4680, 4599, 4401, 4440, 4466, 4015, 4698, 4605, 4701, 4709, 4706, 4710, 4540, 4566, 4703, 4699, 4701, 4387, 4411, 4711, 4476, 4473, 4419, 4650, 4653, 4590, 4440, 4439, 4592, 4441, 4435, 4443, 4391, 4385, 4387, 4485, 4488, 4421, 4712, 4708, 4412, 4485, 4434, 4453, 4492, 4425, 4612, 4379, 4378, 4713, 4601, 4600, 4632, 4714, 4715, 4716, 4452, 4497, 4453, 4682, 4622, 4624, 4624, 4622, 4616, 4700, 4717, 4667, 4718, 4719, 4720, 4622, 4682, 4642, 4391, 4380, 4392, 4440, 4483, 4466, 4384, 4408, 4407, 4657, 4658, 4712, 4497, 4487, 4453, 4618, 4492, 4612, 4509, 4512, 4494, 4406, 4405, 4403, 4393, 4395, 4382, 4451, 4508, 4432, 4386, 4392, 4420, 4638, 4637, 4673, 4402, 4404, 4413, 4721, 4722, 4723, 4724, 4679, 4678, 4461, 4460, 4676, 4408, 4400, 4407, 4469, 4468, 4725, 4625, 4645, 4010, 4587, 4589, 4688, 4589, 4655, 4688, 4647, 4646, 4608, 4623, 4622, 4642, 4633, 4478, 4726, 4616, 4689, 4617, 4496, 4500, 4499, 4655, 4659, 4727, 4414, 4415, 4490, 4688, 4642, 4587, 4686, 4648, 4647, 4650, 4691, 4651, 3987, 4011, 4644, 4429, 4428, 4609, 4490, 4431, 4491, 4420, 4437, 4386, 4632, 4631, 4603, 4603, 4601, 4632, 4508, 4451, 4450, 4602, 4657, 4670, 4727, 4689, 4623, 4639, 4492, 4618, 4484, 4502, 4487, 4648, 4590, 4646, 4593, 3980, 4597, 4599, 4683, 4597, 4653, 4646, 4590, 4626, 4628, 4630, 4635, 4654, 4644, 4590, 4682, 4650, 4691, 4650, 4430, 4626, 4608, 4646, 4449, 4448, 4459, 4589, 4588, 4656, 4686, 4692, 4680, 4656, 4664, 4654, 4654, 4635, 4655, 4450, 4509, 4508, 4517, 3984, 3997, 4608, 4626, 4606, 4680, 4683, 4599, 4442, 4435, 4383, 4590, 4642, 4682, 4652, 4726, 4641, 4517, 4515, 4001, 4606, 4626, 4630, 4450, 4493, 4504, 4728, 4583, 4689, 4500, 4008, 4631, 3987, 4644, 4664, 4729, 4655, 4727, 4482, 4483, 4609, 4412, 4657, 4712, 4430, 4649, 4456, 4472, 4461, 4676, 4429, 4460, 4633, 4610, 4460, 4429, 4416, 4404, 4422, 4519, 4604, 4681, 4645, 4643, 4011, 4518, 4519, 4507, 4691, 4687, 4651, 4515, 4494, 4512, 4638, 4675, 4601, 4426, 4423, 4497, 4485, 4486, 4488, 4584, 4636, 4681, 4610, 4592, 4676, 4588, 4665, 4664, 4439, 4420, 4419, 4485, 4398, 4383, 4652, 4627, 4653, 4730, 4714, 4711, 4398, 4485, 4421, 4413, 4412, 4707, 4403, 4402, 4406, 4411, 4407, 4730, 4016, 4017, 4022, 4484, 4446, 4432, 4402, 4413, 4707, 4717, 4700, 4731, 4385, 4392, 4386, 4714, 4730, 4406, 4673, 4637, 4024, 4407, 4406, 4730, 4605, 4673, 4024, 4638, 4704, 4675, 4658, 4602, 4675, 4732, 4674, 4733, 4666, 4700, 4667, 4701, 4724, 4709, 4397, 4405, 4400, 4674, 4704, 4673, 4459, 4450, 4449, 4716, 4705, 4702, 4481, 4482, 4458, 4698, 4015, 4014, 4411, 4730, 4711, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4529, 4522, 4531, 4743, 4371, 4719, 4012, 4744, 4745, 4674, 4732, 4658, 4679, 4746, 4677, 4745, 4746, 4668, 4605, 4733, 4674, 4707, 4715, 4402, 4659, 4634, 4727, 4637, 4022, 4024, 4698, 4733, 4605, 4583, 4728, 4634, 4726, 4478, 4641, 4456, 4498, 4428, 4705, 4747, 4703, 4712, 4658, 4732, 4493, 4639, 4504, 4582, 4604, 4639, 4458, 4428, 4498, 4584, 4681, 4604, 4682, 4649, 4650, 4433, 4432, 4508, 3982, 4685, 3979, 4610, 4440, 4592, 4623, 4729, 4727, 4656, 4588, 4664, 4624, 4457, 4649, 4597, 4684, 4593, 4664, 4644, 4654, 4648, 4591, 4590, 4403, 4399, 4422, 4683, 4680, 4692, 4643, 4636, 4635, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 3930, 4755, 4756, 4586, 4376, 4757, 4758, 4543, 4759, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4720, 4719, 4772, 4773, 4774, 4775, 4776, 4555, 4520, 4004, 4777, 4524, 4542, 4778, 4779, 4780, 4718, 4781, 4530, 4524, 4370, 4771, 4719, 4782, 4007, 4754, 4719, 4753, 4743, 4776, 4760, 4555, 4370, 4719, 4371, 4548, 4553, 4783, 4784, 4785, 4786, 4787, 4788, 4578, 4789, 4761, 4790, 4791, 4545, 4551, 4792, 4537, 4793, 4778, 4781, 4524, 4750, 4794, 4748, 4542, 4524, 4795, 4796, 4797, 4794, 4003, 4777, 4004, 4798, 4799, 4800, 4774, 4801, 4802, 4803, 4804, 4520, 4805, 4806, 4377, 4410, 4373, 4372, 4801, 4774, 4789, 4807, 4563, 4565, 4536, 4543, 4808, 4793, 4809, 4792, 4810, 4718, 4780, 4811, 4527, 4526, 4376, 4586, 4812, 4813, 4814, 4778, 4542, 4757, 4543, 4377, 4376, 4815, 4759, 4710, 4816, 4004, 4521, 4005, 4738, 4027, 4817, 4802, 4804, 4803, 4818, 4757, 4542, 4031, 4579, 4581, 4755, 4521, 4754, 4795, 4818, 4542, 4817, 4819, 4820, 4373, 4821, 4822, 4003, 4781, 4777, 4823, 4824, 4825, 4530, 4003, 4002, 4826, 4805, 4377, 4827, 4828, 4793, 4829, 4830, 4790, 4550, 4574, 4831, 4520, 4777, 4803, 4531, 4522, 4524, 4832, 4833, 4766, 4005, 4755, 3932, 4834, 4758, 4464, 4757, 4818, 4835, 4836, 4789, 4774, 4829, 4579, 4830, 4782, 4837, 4838, 4523, 4522, 4839, 4542, 4813, 4778, 4803, 4778, 4802, 4464, 4463, 4827, 4787, 4578, 4577, 4840, 4523, 4839, 4558, 4559, 4556, 3976, 4529, 4531, 4841, 4842, 4843, 4804, 4802, 4801, 4844, 4759, 4836, 4845, 4846, 4847, 4848, 4849, 4850, 4380, 4379, 4420, 4416, 4422, 4421, 4851, 4852, 4853, 4854, 4855, 4856, 4565, 4564, 4857, 4858, 4562, 4561, 4680, 4588, 4591, 4651, 4633, 4726, 4627, 4662, 4628, 4859, 4860, 4534, 4394, 4408, 4395, 4657, 4412, 4670, 4508, 4509, 4494, 4800, 4861, 4862, 4726, 4652, 4651, 4571, 4863, 4864, 4482, 4609, 4428, 4729, 4623, 4688, 4617, 4639, 4618, 4600, 4414, 4489, 4865, 4866, 4867, 4612, 4611, 4618, 4444, 4401, 4466, 4403, 4422, 4404, 4791, 4576, 4578, 4827, 4793, 4808, 4868, 4527, 4809, 4375, 4374, 4527, 4752, 4869, 4743, 4663, 4696, 4685, 4727, 4728, 4689, 4461, 4477, 4462, 4719, 4718, 4753, 4870, 4567, 4809, 4586, 4871, 4812, 4872, 4873, 4874, 4875, 4848, 4876, 4877, 4856, 4855, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 4885, 4886, 4887, 4888, 4889, 4890, 4852, 4856, 4878, 4886, 4891, 4892, 4875, 4893, 4894, 4876, 4848, 4893, 4884, 4895, 4896, 4035, 4034, 4897, 4898, 4855, 4899, 4036, 4900, 4901, 4875, 4892, 4883, 4890, 4877, 4036, 4902, 4897, 4903, 4853, 4904, 4509, 4450, 4503, 4875, 4876, 4893, 4901, 4849, 4875, 4655, 4729, 4688, 4905, 4906, 4881, 4907, 4908, 4906, 4852, 4890, 4853, 4850, 4909, 4907, 4850, 4849, 4910, 4890, 4882, 4853, 4904, 4881, 4906, 4891, 4883, 4878, 4905, 4907, 4906, 4911, 4851, 4903, 4912, 4908, 4907, 4883, 4891, 4881, 4913, 4892, 4893, 4884, 4893, 4876, 4914, 4856, 4852, 4883, 4879, 4878, 4894, 4905, 4881, 4034, 4915, 4896, 4879, 4877, 4916, 4898, 4897, 4917, 4898, 4879, 4916, 4917, 4897, 4902, 4918, 4895, 4884, 4848, 4850, 4907, 4919, 4920, 4912, 4852, 4851, 4921, 4910, 4909, 4850, 4882, 4890, 4883, 4922, 4901, 4923, 4853, 4882, 4904, 4885, 4891, 4886, 4885, 4884, 4876, 4851, 4853, 4903, 4891, 4894, 4881, 4876, 4894, 4891, 4916, 4877, 4855, 4912, 4907, 4919, 4886, 4918, 4884, 4915, 4924, 4896, 4914, 4854, 4856, 4907, 4905, 4848, 4900, 4854, 4914, 4855, 4898, 4916, 4877, 4890, 4856, 4877, 4879, 4883, 4920, 4908, 4912, 4909, 4919, 4907, 4923, 4901, 4892, 4902, 4036, 4035, 4879, 4898, 4880, 4898, 4917, 4880, 4882, 4881, 4904, 4848, 4875, 4849, 4891, 4885, 4876, 4905, 4894, 4848, 4855, 4854, 4897, 4036, 4897, 4854, 4854, 4900, 4036, 4925, 4369, 4371, 4728, 4727, 4634, 4429, 4687, 4430, 3964, 3987, 4663, 3980, 3979, 4597, 3982, 4663, 4685, 3964, 4663, 3982, 4517, 3997, 4495, 4515, 4514, 4001, 4665, 4696, 4663, 4926, 4038, 4927, 4037, 4038, 4926, 4037, 4926, 4927, 4788, 4928, 4929, 4028, 4039, 4930, 4520, 4837, 4521, 4801, 4838, 4804, 4874, 4787, 4577, 4754, 4521, 4837, 4007, 4782, 4931, 4773, 4844, 4774, 4754, 4007, 3930, 4932, 4029, 4930, 4782, 4754, 4837, 3930, 3932, 4755, 4819, 4817, 4933, 4755, 4005, 4521, 4934, 4930, 4927, 4935, 4576, 4791, 4551, 4936, 4791, 4929, 4937, 4934, 4039, 4037, 4927, 4007, 4579, 4031, 4033, 3944, 4037, 4785, 4932, 4928, 4042, 4927, 4038, 4031, 4934, 4927, 4931, 4782, 4838, 4784, 4786, 4820, 4785, 4928, 4873, 4938, 4768, 4824, 4789, 4838, 4801, 4939, 4770, 4940, 4941, 4738, 4820, 4942, 4943, 4738, 4944, 4945, 4825, 4946, 4019, 4027, 4943, 4751, 4753, 4846, 4823, 4825, 4846, 4845, 4751, 4763, 4946, 4764, 4940, 4769, 4735, 4947, 4948, 4769, 4943, 4942, 4823, 4737, 4739, 4810, 4737, 4946, 4027, 4947, 4938, 4824, 4946, 4737, 4810, 4942, 4738, 4941, 4764, 4779, 4762, 4764, 4946, 4780, 4810, 4780, 4946, 4734, 4940, 4735, 4739, 4943, 4753, 4823, 4942, 4824, 4939, 4949, 4950, 4939, 4951, 4952, 4953, 4954, 4955, 4956, 4949, 4957, 4956, 4945, 4950, 4945, 4958, 4847, 4959, 4736, 4960, 4032, 4029, 4933, 4846, 4751, 4943, 4824, 4942, 4947, 4738, 4737, 4027, 4785, 4873, 4872, 4029, 4819, 4933, 4372, 4806, 4409, 4586, 4465, 4871, 4781, 4003, 4530, 4835, 4758, 4757, 4523, 4840, 4795, 4550, 4961, 4410, 4525, 4374, 4373, 4756, 4585, 4586, 4463, 4585, 4828, 4375, 4527, 4868, 4806, 4372, 4374, 4585, 4756, 4793, 4523, 4795, 4524, 4962, 4767, 4831, 4827, 4808, 4834, 4374, 4525, 4527, 4831, 4767, 4550, 4827, 4463, 4828, 4541, 4813, 4542, 4818, 4840, 4835, 4543, 4758, 4834, 4377, 4815, 4826, 4573, 4571, 4864, 4827, 4834, 4464, 4858, 4560, 4963, 4844, 4538, 4540, 4773, 4538, 4844, 4964, 4792, 4562, 4527, 4811, 4870, 4927, 4930, 4039, 4945, 4847, 4825, 4817, 4027, 4026, 4846, 4943, 4823, 4813, 4541, 4535, 4868, 4756, 4375, 4537, 4772, 4535, 4543, 4536, 4541, 4814, 4802, 4778, 4819, 4029, 4820, 4929, 4965, 4788, 4544, 4575, 4966, 4967, 4548, 4968, 4580, 4775, 4969, 4963, 4773, 4964, 4564, 4563, 4567, 4809, 4527, 4870, 4773, 4772, 4964, 4808, 4793, 4536, 4537, 4964, 4772, 4828, 4585, 4793, 4868, 4809, 4793, 4568, 4572, 4569, 4558, 4570, 4568, 4818, 4795, 4840, 4962, 4765, 4767, 4970, 4574, 4409, 4409, 4806, 4970, 4961, 4821, 4410, 4586, 4463, 4465, 4971, 4811, 4526, 4537, 4792, 4964, 4971, 4526, 4822, 4526, 4373, 4822, 4842, 4972, 4973, 4535, 4772, 4974, 4376, 4375, 4756, 4560, 4858, 4561, 4975, 4557, 4556, 4976, 4977, 4978, 4563, 4807, 4557, 4564, 4567, 4870, 4537, 4536, 4793, 4561, 4563, 4975, 4979, 4980, 4981, 4976, 4978, 4857, 4557, 4807, 4571, 4976, 4857, 4564, 4564, 4870, 4982, 4983, 4735, 4769, 4928, 4787, 4873, 4947, 4769, 4938, 4932, 4785, 4784, 4983, 4948, 4874, 4984, 4985, 4972, 4983, 4986, 4987, 4988, 4989, 4990, 4991, 4992, 4742, 4731, 4993, 4717, 4679, 4994, 4666, 4949, 4939, 4952, 4995, 4996, 4991, 4791, 4936, 4935, 4992, 4997, 4740, 4998, 4999, 5000, 4740, 4742, 4992, 4990, 5001, 4953, 5002, 4717, 4993, 5003, 4997, 5004, 4740, 5005, 5006, 4862, 4798, 4800, 4997, 5005, 4740, 4724, 4678, 5007, 5004, 5008, 5009, 5010, 4702, 4706, 5011, 4371, 4743, 5011, 4743, 4869, 5012, 4990, 5006, 5001, 5013, 4954, 4787, 4874, 4873, 5014, 4731, 4708, 4575, 4549, 4967, 4810, 4739, 4753, 4957, 5015, 4945, 4786, 4872, 4948, 4944, 4768, 4950, 4942, 4941, 4947, 5016, 4952, 5017, 4581, 5018, 4934, 4838, 4789, 4790, 4846, 4825, 4847, 5019, 4845, 4847, 4943, 4739, 4738, 4957, 4949, 4954, 4820, 4738, 4817, 4945, 4956, 4957, 5001, 4990, 5012, 4495, 3997, 4501, 4944, 4950, 4945, 4874, 4986, 4983, 5020, 4783, 4553, 5021, 5022, 5023, 4544, 4966, 4551, 4769, 4940, 4770, 4951, 4959, 4960, 4580, 4969, 4581, 4789, 4759, 4761, 5024, 4988, 5025, 4951, 4939, 4940, 4987, 4736, 4983, 5017, 5026, 4960, 5027, 4700, 4699, 4731, 5027, 4747, 4410, 4821, 4373, 4749, 4800, 4750, 4861, 4800, 4749, 4937, 4930, 4934, 4580, 4579, 4829, 4838, 4790, 4931, 4802, 4974, 4772, 4760, 4759, 4816, 4736, 4959, 4734, 5028, 5023, 5022, 4562, 4792, 4567, 5022, 5029, 5030, 4972, 4985, 4973, 4776, 4829, 4761, 4548, 5031, 4968, 4007, 4830, 4579, 4784, 4820, 4029, 4931, 4830, 4007, 4830, 4931, 4790, 4930, 4937, 4932, 4937, 4929, 4928, 4581, 4965, 5018, 4814, 4813, 4974, 4786, 4785, 4872, 4960, 5032, 5017, 4951, 5026, 4952, 4933, 4026, 4032, 4941, 4820, 4786, 5016, 4955, 4954, 4567, 4792, 4809, 4863, 4565, 4864, 4833, 4767, 4766, 4552, 4554, 4568, 4557, 4975, 4563, 4948, 4947, 4786, 4565, 4857, 4864, 4543, 4834, 4808, 4791, 4578, 4545, 4965, 4581, 4969, 4774, 4844, 4836, 4836, 4759, 4789, 4974, 4802, 4814, 4756, 4868, 4793, 4858, 4964, 4562, 4774, 4802, 4772, 4963, 4964, 4858, 4554, 4548, 4566, 4540, 4710, 4844, 4843, 4842, 4973, 4813, 4535, 4974, 4978, 4573, 4857, 4561, 4975, 4556, 4559, 4773, 4963, 4781, 4803, 4777, 4546, 4969, 4775, 4710, 4759, 4844, 4557, 4571, 4570, 5021, 4573, 5033, 4776, 4775, 4580, 4555, 4547, 4549, 4558, 4557, 4570, 4965, 4969, 4545, 4580, 4829, 4776, 4546, 4775, 4555, 4581, 4934, 4031, 4575, 4967, 4841, 4548, 4554, 4553, 4549, 4548, 4967, 4540, 4539, 4554, 4374, 4377, 4806, 4977, 5034, 5033, 4978, 4977, 5033, 4559, 4963, 4560, 4578, 4965, 4545, 4837, 4520, 4804, 5018, 4929, 4934, 4787, 4928, 4788, 4929, 5018, 4965, 4932, 4937, 4928, 4816, 4547, 4555, 4736, 4987, 5000, 4985, 5035, 4973, 4559, 4558, 4538, 4735, 4983, 4736, 4987, 4998, 5000, 4955, 5016, 5036, 4770, 4950, 4768, 4951, 4940, 4734, 4960, 4736, 5000, 5037, 5036, 5038, 4948, 4872, 4874, 4026, 4933, 4817, 4778, 4803, 4781, 5026, 4951, 4960, 5026, 5017, 4952, 4545, 4969, 4546, 4986, 4874, 4577, 4959, 4951, 4734, 4029, 4932, 4784, 5039, 5040, 5041, 5015, 4954, 5013, 5033, 4573, 4978, 4526, 4525, 4373, 4944, 4825, 4824, 4989, 4741, 5006, 4988, 5024, 4989, 5019, 4958, 5042, 4752, 5019, 5042, 5036, 4988, 4953, 4949, 4956, 4950, 5014, 4712, 4993, 4993, 4732, 4733, 5043, 5044, 5005, 5005, 5044, 5012, 5045, 4752, 5042, 4752, 4751, 4845, 4983, 4769, 4948, 5017, 5032, 5036, 5006, 4741, 4740, 4944, 4824, 4768, 4769, 4768, 4938, 4958, 5015, 5042, 4753, 4752, 4743, 4752, 5045, 4869, 5019, 4752, 4845, 4718, 4810, 4753, 4946, 4763, 4019, 5019, 4847, 4958, 4841, 4966, 4575, 4718, 4720, 4779, 4939, 4950, 4770, 4812, 4815, 4376, 4548, 4547, 4566, 5005, 5012, 5006, 5046, 4779, 4720, 4941, 4786, 4947, 4927, 4042, 4031, 5047, 4668, 4667, 4779, 4764, 4780, 4039, 4033, 4037, 4760, 4776, 4761, 4028, 4930, 4029, 4788, 4965, 4578, 4829, 4790, 4761, 4514, 4518, 4506, 4838, 4837, 4804, 4705, 4716, 4715, 4989, 5006, 4990, 4679, 4668, 4746, 5002, 4733, 4698, 4952, 5016, 4954, 5048, 4708, 4731, 5049, 5045, 5042, 5042, 5013, 5049, 4958, 4945, 5015, 5012, 5044, 5050, 4988, 4990, 4953, 4954, 4953, 5001, 4994, 4701, 4699, 4717, 5002, 4667, 5051, 4998, 4935, 4569, 4861, 5052, 5038, 5053, 5039, 5028, 5022, 5030, 4995, 5008, 5054, 5028, 5055, 5023, 5040, 5056, 5041, 4998, 5051, 5057, 4783, 4984, 4972, 4569, 4572, 5023, 4972, 4842, 4783, 4573, 4864, 4857, 5053, 5032, 4999, 5053, 5038, 5032, 4799, 5058, 4796, 4748, 4794, 4984, 4985, 5059, 5035, 5060, 4935, 4998, 5061, 4936, 4966, 4996, 5004, 4992, 4552, 4569, 5052, 5038, 5039, 5059, 5062, 5020, 5052, 4985, 4984, 5025, 4841, 4843, 4966, 5037, 5038, 5025, 4988, 5037, 5025, 4986, 5060, 4998, 4996, 4995, 5054, 4991, 4799, 4995, 5063, 5008, 4995, 4995, 4798, 5063, 4796, 4750, 4799, 4996, 4992, 4991, 5009, 5064, 5065, 4996, 5054, 5004, 5030, 5029, 5066, 5067, 4989, 5024, 5058, 4799, 4991, 5008, 5064, 5009, 5025, 4797, 5024, 4968, 4841, 4967, 4936, 5061, 5056, 5067, 5058, 4991, 5052, 5020, 4552, 5059, 4985, 5025, 4794, 4797, 4984, 4799, 4798, 4995, 5067, 4991, 4742, 4799, 4750, 4800, 4741, 5067, 4742, 5020, 4553, 4552, 5023, 5055, 4569, 4797, 4796, 5024, 4968, 4783, 4842, 5022, 5021, 5033, 4861, 4749, 5052, 5055, 4862, 4861, 5064, 5008, 5063, 5055, 4861, 4569, 4798, 4862, 5063, 5004, 4997, 4992, 4862, 5068, 5063, 5058, 5067, 4796, 4783, 5031, 4548, 4843, 5069, 5061, 4566, 4547, 4710, 4555, 4760, 4816, 5060, 4577, 4576, 5069, 5056, 5061, 5025, 4984, 4797, 5062, 4748, 4984, 4748, 5062, 5052, 5036, 5037, 4988, 4547, 4816, 4710, 5035, 5039, 5041, 4572, 5021, 5023, 4973, 5070, 4843, 4807, 4863, 4571, 4573, 5021, 4572, 4999, 4998, 5057, 4783, 5062, 4984, 4843, 5061, 4966, 5062, 4783, 5020, 4841, 4968, 4842, 5039, 5035, 5059, 4935, 5060, 4576, 5070, 5069, 4843, 5051, 5056, 5057, 5031, 4783, 4968, 4999, 5032, 4960, 4986, 4998, 4987, 4538, 4773, 4559, 5038, 5059, 5025, 5056, 5040, 5057, 5053, 5057, 5040, 4936, 5056, 4935, 4936, 4551, 4966, 4796, 4794, 4750, 4989, 5067, 4741, 5067, 5024, 4796, 5070, 5041, 5069, 4960, 5000, 4999, 4749, 4748, 5052, 5070, 4973, 5035, 5056, 5069, 5041, 5053, 4999, 5057, 5036, 5032, 5038, 5041, 5070, 5035, 5056, 5051, 4935, 4565, 4863, 4807, 4577, 5060, 4986, 5039, 5053, 5040, 5017, 5036, 5016, 4731, 5014, 4993, 5027, 4703, 4747, 5071, 4711, 4714, 4747, 4705, 4715, 4708, 5048, 4707, 4678, 5072, 5073, 4701, 4994, 4724, 5072, 4678, 5074, 4994, 4679, 4724, 5075, 4047, 5076, 5074, 4677, 5077, 4406, 4715, 4714, 4012, 4745, 4668, 5047, 4014, 4012, 5073, 5007, 4678, 4668, 4679, 4666, 4994, 4699, 4666, 5015, 5013, 5042, 4700, 5027, 4731, 4733, 5002, 4993, 5078, 4469, 4725, 4668, 5047, 4012, 4014, 5047, 4667, 5071, 4716, 4702, 4732, 4993, 4712, 5048, 4747, 4707, 5007, 4709, 4724, 5054, 5008, 5004, 4716, 5071, 4714, 4703, 5027, 4699, 5012, 5013, 5001, 4702, 5010, 5071, 4715, 4406, 4402, 5002, 4698, 4667, 5049, 5013, 5050, 4715, 4707, 4747, 4712, 5014, 4708, 5050, 5013, 5012, 4954, 5015, 4957, 4677, 5074, 4678, 4952, 4954, 4949, 4747, 5048, 4731, 4953, 4955, 5036, 5079, 4832, 4766, 5080, 5081, 5082, 5083, 5084, 5085, 4713, 5086, 5087, 4387, 5088, 4391, 5089, 4614, 4613, 5090, 5091, 5092, 5093, 5090, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 5105, 5106, 4479, 4532, 4475, 5107, 4725, 4468, 5108, 5109, 5094, 5091, 5110, 5092, 5111, 5112, 5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 4090, 4899, 5119, 4046, 5121, 5122, 5123, 5124, 5125, 5126, 5127, 4596, 4684, 4594, 5128, 4595, 4697, 5129, 5128, 4697, 5130, 5131, 5132, 5133, 5134, 5135, 5136, 4672, 4620, 5137, 5101, 5103, 5138, 5139, 5140, 5141, 4690, 5142, 5143, 5144, 4595, 5145, 4866, 4865, 5078, 4725, 5146, 5101, 5147, 5148, 5149, 5150, 5151, 4534, 5152, 4859, 4479, 5153, 4533, 5154, 5087, 5084, 5155, 5156, 5098, 5087, 5154, 5157, 5158, 5089, 4613, 5159, 4693, 5160, 4596, 5161, 3927, 5160, 5162, 5163, 3908, 3927, 5161, 5164, 5162, 5165, 5076, 5166, 5075, 5167, 5123, 5168, 5128, 5159, 5168, 4867, 5169, 4865, 5170, 5171, 5172, 5167, 5168, 4866, 4533, 5173, 5174, 4013, 3895, 5175, 5007, 5176, 5177, 5178, 5179, 5180, 5181, 5088, 4388, 4744, 5182, 5175, 5183, 4387, 4711, 4671, 5078, 5136, 5154, 5084, 5083, 4723, 5184, 5185, 4607, 5141, 5089, 5128, 5123, 5122, 4693, 5159, 4695, 5186, 5187, 5188, 4690, 5132, 5189, 5190, 5191, 5192, 5193, 5194, 4860, 5195, 5196, 5197, 4388, 5088, 4389, 4388, 5198, 5181, 5191, 5199, 5192, 4389, 5200, 4390, 4697, 5201, 4695, 5202, 4971, 5081, 5203, 5204, 4822, 5205, 5206, 5082, 5207, 5208, 4370, 5204, 5205, 5082, 5080, 5202, 5081, 5046, 5209, 4051, 5210, 4811, 4971, 4982, 4976, 4564, 5079, 3478, 5211, 4369, 5117, 4370, 5212, 5213, 4977, 4979, 5214, 4980, 5215, 5216, 5217, 5218, 5219, 5220, 4720, 5221, 5209, 4474, 5222, 4479, 5154, 5184, 5223, 5224, 5225, 3808, 5107, 5222, 4480, 5226, 5196, 5085, 5175, 4745, 4744, 5159, 4867, 5168, 4043, 3910, 5227, 5228, 5229, 5230, 5231, 5232, 5233, 5234, 4055, 4056, 5234, 5235, 5236, 5237, 5238, 5239, 5240, 5241, 5242, 5243, 5242, 5244, 5245, 4892, 5246, 4922, 5247, 4901, 5242, 5248, 5240, 5249, 5250, 5251, 5252, 5253, 5254, 5255, 5256, 5240, 5246, 4892, 4913, 5257, 5258, 5259, 4911, 4921, 4851, 4921, 4914, 4852, 5260, 5261, 5262, 5217, 5263, 5264, 5250, 5262, 5265, 4919, 5262, 5249, 4889, 5232, 5231, 5120, 5266, 5235, 5267, 5268, 5269, 5270, 5271, 5218, 5272, 5249, 5251, 5273, 5274, 5265, 5275, 5140, 5276, 5277, 5278, 4923, 5277, 4923, 5245, 5279, 5276, 5245, 5276, 5280, 5275, 5228, 4924, 5229, 5216, 4908, 5217, 4906, 5216, 4904, 5281, 5252, 5251, 5282, 5261, 5283, 5258, 5284, 5285, 5286, 5287, 5254, 5259, 5288, 5289, 5228, 4035, 4896, 5235, 4056, 5120, 5290, 5291, 5229, 5292, 5293, 5294, 5230, 5295, 4918, 4887, 5296, 5297, 5120, 5232, 5266, 4899, 5298, 4044, 5299, 5300, 5301, 4889, 5220, 5296, 5207, 5302, 5209, 5204, 5203, 5303, 5303, 5304, 5205, 5305, 5030, 5306, 5203, 5307, 5308, 5309, 5310, 4832, 4762, 4019, 4763, 4979, 5202, 5080, 5308, 5311, 5310, 4832, 5304, 5309, 4832, 5079, 5211, 5034, 5022, 5033, 5034, 5312, 5095, 4822, 5081, 4971, 5313, 5314, 5315, 5210, 5202, 4979, 5316, 4982, 4981, 5317, 5318, 5319, 5313, 5320, 5321, 5166, 5322, 5323, 5004, 5324, 5003, 5306, 5325, 5305, 5068, 5326, 5063, 5327, 5043, 5005, 5146, 5154, 5223, 5328, 5329, 5180, 5330, 5126, 5331, 5332, 5333, 5334, 5335, 5336, 5337, 4980, 5316, 4981, 5030, 5305, 5028, 5338, 5317, 5339, 5095, 5340, 5034, 5068, 5325, 5341, 5341, 5342, 5326, 5343, 5344, 5345, 5346, 5206, 5347, 5022, 5066, 5029, 5348, 5349, 5350, 5065, 5351, 5352, 5007, 5353, 5354, 5355, 5356, 5326, 5351, 5357, 5352, 5358, 5050, 5044, 5178, 5359, 5360, 5361, 5093, 5321, 5119, 5121, 5207, 5359, 5335, 5337, 5362, 5363, 5364, 5365, 5366, 5352, 4746, 5367, 4677, 5368, 5350, 5369, 5358, 5370, 5360, 5045, 5358, 4869, 5371, 5370, 5043, 5212, 5372, 5312, 5178, 5180, 5335, 5373, 5374, 5375, 5077, 3755, 3666, 5360, 5371, 5376, 4013, 5182, 4012, 5377, 5374, 5378, 4379, 5379, 4418, 5316, 4977, 4976, 5345, 5380, 5381, 5323, 5175, 5075, 5351, 5374, 5357, 5322, 5382, 5323, 5383, 5384, 5385, 5343, 5386, 5387, 5388, 5361, 5321, 4054, 5389, 3895, 5004, 5390, 5324, 5364, 5324, 5390, 5391, 5363, 5365, 4370, 5117, 5119, 5223, 4672, 5136, 5392, 4722, 3858, 5183, 5071, 5010, 5077, 5393, 3755, 5177, 5353, 5007, 5394, 5395, 5396, 5365, 5377, 5397, 5398, 5399, 5400, 4054, 3895, 3893, 5400, 5200, 5398, 5085, 5195, 5083, 4389, 5401, 5200, 5359, 5337, 5011, 5176, 5007, 5073, 5359, 5011, 4869, 5371, 5043, 5376, 5402, 5153, 5222, 5403, 5404, 5405, 4671, 4619, 5406, 5255, 5407, 5280, 5292, 5291, 5293, 5275, 5138, 5140, 5408, 5104, 5100, 5137, 4661, 4640, 5237, 5409, 5410, 5411, 5412, 5170, 5096, 5095, 5318, 5400, 5413, 5414, 5342, 5341, 5306, 5306, 5030, 5066, 5065, 5415, 5351, 5356, 5416, 5417, 5022, 5034, 5066, 5346, 5418, 4979, 5068, 5055, 5028, 5419, 5420, 5421, 5422, 5423, 5424, 5425, 5419, 5421, 5426, 5425, 5174, 5193, 5423, 5194, 4470, 5402, 4468, 5105, 5427, 5428, 5267, 5429, 5268, 5284, 5258, 5257, 5132, 5133, 5430, 5431, 4860, 4859, 5422, 5148, 5423, 5175, 5323, 5432, 5429, 5267, 5433, 5093, 5094, 5109, 4723, 5185, 4721, 5078, 5426, 4469, 5226, 5434, 5198, 5177, 5349, 5435, 5326, 5342, 5355, 5259, 5289, 5257, 5164, 5436, 5169, 5348, 5437, 5413, 5438, 5369, 5350, 4619, 5150, 5406, 5349, 5177, 5438, 5340, 5095, 5439, 5320, 5418, 5440, 5439, 5097, 5441, 5065, 5366, 5009, 5424, 5442, 5156, 5443, 5108, 5094, 5199, 3715, 5192, 5305, 5068, 5028, 5093, 5361, 5444, 5445, 5385, 5344, 5203, 5308, 5303, 5312, 5446, 5095, 4811, 5210, 4981, 5090, 5447, 5094, 5417, 5416, 5351, 5340, 5383, 5066, 5153, 5173, 4533, 5448, 5449, 5431, 5438, 5177, 5176, 5450, 4379, 4713, 5346, 5080, 5206, 5418, 5320, 5214, 5246, 5279, 5245, 5451, 5167, 4866, 3856, 5145, 5114, 5262, 4910, 5260, 5106, 5452, 5104, 5277, 5276, 5140, 5131, 5130, 5452, 3701, 4615, 5453, 5142, 4690, 5189, 5428, 5454, 5105, 5170, 5455, 5142, 5102, 5452, 5130, 5133, 5131, 5106, 5156, 5422, 5424, 5137, 5103, 5130, 5456, 5457, 4478, 5458, 4878, 4880, 5292, 5409, 5239, 5295, 5238, 5240, 5150, 5459, 5406, 5460, 5394, 5396, 5376, 5178, 5360, 5445, 5342, 5385, 5380, 5345, 5441, 5417, 5351, 5415, 5461, 5462, 5463, 5129, 4695, 5159, 5254, 5287, 5464, 3799, 5465, 5466, 5433, 5403, 5283, 5251, 5467, 5272, 5468, 5469, 5470, 5471, 5472, 5470, 5472, 5473, 5289, 5406, 5459, 5425, 5259, 5474, 5465, 5475, 5215, 5476, 5477, 5299, 5478, 5474, 5300, 5466, 5259, 5285, 5474, 5287, 5479, 5272, 5297, 5296, 5219, 5272, 5264, 5263, 5301, 5478, 5299, 5247, 5480, 5429, 5281, 5481, 5252, 3799, 5482, 5465, 5254, 5464, 5252, 5282, 5483, 5484, 5464, 5251, 5252, 5479, 5287, 5301, 3835, 5466, 5300, 5287, 5272, 5467, 5478, 5301, 5287, 5472, 5471, 5473, 5472, 5468, 5470, 5264, 5474, 5285, 5301, 5474, 5264, 5300, 5474, 5301, 5469, 5468, 5485, 5474, 5466, 5465, 5486, 5301, 5264, 5486, 5479, 5301, 5285, 5215, 5264, 5487, 5485, 3829, 5468, 5472, 5289, 5482, 5288, 5465, 5288, 5259, 5465, 5485, 5288, 5482, 5488, 5471, 5470, 5258, 5285, 5259, 5484, 5273, 5262, 5249, 5272, 5263, 5284, 5215, 5285, 5287, 5286, 5478, 5264, 5272, 5479, 5479, 5486, 5264, 5254, 5253, 3834, 5467, 5464, 5287, 5467, 5251, 5464, 5286, 5254, 3834, 5489, 5481, 5274, 5481, 5281, 5274, 5490, 5267, 5269, 5282, 5484, 5261, 5274, 5273, 5489, 4919, 5491, 4920, 5262, 4919, 4909, 5247, 4922, 5480, 5251, 5250, 5265, 5262, 5273, 5265, 5286, 5477, 5478, 5491, 5249, 5263, 5403, 5433, 5267, 5483, 5273, 5484, 5262, 5250, 5249, 5430, 5133, 5135, 5491, 4919, 5249, 4860, 5492, 5193, 5282, 5283, 5403, 5493, 5268, 5138, 5261, 5484, 5262, 5269, 5494, 5490, 5433, 5260, 5429, 5403, 5483, 5282, 5247, 5429, 5260, 5495, 5493, 5138, 5260, 5283, 5261, 5403, 5267, 5404, 5260, 4910, 5247, 5274, 5281, 5251, 4895, 5256, 5279, 5278, 5277, 5496, 5494, 5493, 3843, 5267, 5490, 5404, 4910, 5262, 4909, 5497, 5404, 5490, 5139, 5268, 5496, 5493, 5495, 3843, 5458, 4886, 4878, 4922, 5496, 5480, 5139, 5277, 5140, 5139, 5138, 5268, 5276, 5277, 5245, 5278, 4922, 4923, 5268, 5493, 5269, 5273, 5483, 5489, 5283, 5260, 5433, 5142, 5189, 5170, 5480, 5496, 5268, 5462, 4607, 5089, 5498, 4613, 5115, 5412, 5411, 5430, 4630, 5141, 4606, 4595, 5128, 5143, 5494, 5269, 5493, 5265, 5274, 5251, 5138, 5275, 5495, 4922, 5278, 5496, 5499, 5500, 5188, 5164, 5163, 5162, 5407, 5501, 5280, 4901, 4910, 4849, 5502, 5503, 5291, 5280, 5276, 5255, 5256, 4895, 4918, 5230, 5292, 5239, 5277, 5139, 5496, 5248, 5242, 5407, 5279, 5255, 5276, 5248, 5255, 5240, 5256, 5255, 5279, 5255, 5248, 5407, 4892, 5245, 4923, 4913, 5279, 5246, 4895, 4913, 4893, 5279, 4913, 4895, 5429, 5480, 5268, 5504, 5291, 4049, 5123, 5128, 5168, 5241, 5244, 5242, 5409, 5237, 5239, 5238, 5295, 5239, 5240, 5238, 5241, 5145, 5505, 4866, 5165, 5462, 5461, 4048, 4049, 3917, 3916, 4049, 5290, 5291, 5504, 5293, 5410, 5409, 5294, 4918, 5295, 5240, 5502, 5291, 5292, 5293, 5504, 5294, 5409, 5292, 5294, 4918, 5240, 5256, 5229, 4924, 5290, 5237, 5241, 5238, 5229, 5503, 5230, 5228, 4917, 4902, 5506, 5458, 4880, 4924, 5228, 4896, 4886, 5458, 4918, 4918, 5458, 5230, 5228, 4902, 4035, 5295, 5230, 5239, 5290, 4049, 5291, 5290, 4924, 3916, 5292, 5230, 5502, 5241, 5237, 5244, 5503, 5229, 5291, 5503, 5502, 5230, 4049, 4048, 5504, 4915, 3916, 4924, 4915, 3914, 3916, 3949, 3914, 4034, 3914, 4915, 4034, 5452, 5102, 5100, 4532, 5194, 5423, 5507, 5508, 5459, 5509, 5420, 5419, 5150, 4619, 5151, 4860, 5431, 5449, 5431, 4859, 5509, 4469, 5426, 4470, 5174, 5152, 4533, 5395, 4997, 5003, 5422, 5155, 5101, 5152, 4534, 4533, 4532, 4534, 5194, 5442, 5424, 5193, 5174, 5420, 5152, 5153, 4470, 5173, 5420, 5509, 4859, 4477, 5107, 4480, 4476, 5107, 4477, 5102, 5098, 5100, 5155, 5422, 5156, 5103, 5102, 5130, 5102, 5155, 5098, 5419, 5425, 5459, 5151, 4619, 4669, 4475, 4532, 5423, 5188, 5412, 5135, 5107, 4476, 4725, 5510, 4722, 4721, 5402, 4470, 5153, 5402, 5107, 4468, 5104, 5452, 5100, 5508, 5419, 5459, 4532, 4479, 4533, 5174, 5173, 5426, 5406, 5426, 4671, 5423, 5193, 5424, 5102, 5101, 5155, 5136, 5078, 5146, 5222, 4474, 4480, 4534, 4860, 5194, 5492, 4860, 5449, 5456, 5147, 5511, 5107, 5402, 5222, 4475, 5456, 4478, 5148, 5422, 5101, 5457, 4640, 4478, 5512, 5456, 4475, 5512, 4475, 5423, 5425, 5426, 5406, 5147, 5456, 5148, 5147, 5101, 5511, 4479, 5222, 5153, 5513, 5100, 5099, 5099, 5098, 5156, 5423, 5148, 5512, 5105, 5454, 5106, 5513, 5427, 5408, 5408, 5105, 5104, 4607, 5165, 4608, 5101, 5137, 5511, 5492, 5449, 5514, 5513, 5408, 5100, 5420, 4859, 5152, 5132, 5137, 5130, 5148, 5456, 5512, 5106, 5454, 5133, 5133, 5132, 5131, 5186, 5515, 5187, 5089, 5172, 5516, 4661, 4690, 4629, 5430, 5135, 5412, 5517, 5114, 5145, 5172, 5171, 5516, 5430, 5189, 5132, 5427, 5105, 5408, 5455, 5172, 5141, 4690, 4661, 5132, 5187, 5171, 5188, 4661, 5137, 5132, 5106, 5131, 5452, 5518, 5089, 5516, 5455, 5141, 5142, 5455, 5170, 5172, 5170, 5412, 5171, 5518, 5171, 5187, 4614, 5518, 5187, 5518, 4614, 5089, 5141, 4607, 4606, 5089, 5141, 5172, 5141, 4630, 4690, 5189, 5411, 5170, 3701, 5115, 4615, 5134, 5188, 5135, 5116, 3856, 5114, 5411, 5189, 5430, 5115, 3701, 5116, 5461, 5463, 5158, 4614, 5515, 5453, 5114, 5498, 5115, 5188, 5171, 5412, 5461, 5164, 5165, 4595, 5144, 5161, 5519, 5158, 5498, 5143, 5128, 5122, 5500, 5186, 5188, 4615, 5115, 4613, 4613, 5498, 5158, 5171, 5518, 5516, 5134, 5133, 5454, 5515, 4614, 5187, 4615, 4614, 5453, 5463, 5462, 5089, 4865, 5517, 5145, 4596, 3928, 4593, 4647, 5162, 4686, 5169, 4867, 5160, 4865, 5436, 5519, 5160, 5163, 5169, 5436, 4865, 5169, 5436, 5164, 5461, 4865, 5519, 5517, 5519, 5498, 5517, 5163, 5164, 5169, 4043, 5122, 5124, 4866, 5505, 5451, 5158, 5463, 5089, 3927, 3905, 4596, 5168, 4867, 4866, 5201, 4684, 4694, 4695, 5129, 4697, 5114, 5517, 5498, 5124, 5167, 5451, 5128, 5129, 5159, 4050, 3908, 5161, 5227, 5144, 5143, 4684, 5201, 4594, 5519, 5461, 5158, 4050, 5227, 3910, 5143, 5122, 4043, 5201, 4697, 4594, 4684, 4596, 4593, 5123, 5167, 5124, 5461, 5519, 5436, 4867, 5159, 5160, 5144, 5227, 5161, 5165, 4607, 5462, 4608, 5165, 4647, 5162, 4693, 4692, 5227, 5143, 4043, 4692, 4686, 5162, 5160, 4693, 5162, 5165, 5162, 4647, 5227, 4050, 5161, 4695, 5201, 4694, 5161, 4596, 4595, 3928, 4596, 3905, 5150, 5149, 5507, 5419, 5508, 5509, 4672, 5223, 4723, 4725, 5379, 5146, 5136, 4620, 4671, 5364, 5391, 5331, 5083, 5195, 5185, 5510, 4721, 5224, 5520, 5398, 5200, 5379, 4476, 4419, 5198, 5521, 5226, 5392, 4621, 4723, 5379, 5450, 5146, 5193, 5492, 5442, 4725, 4476, 5379, 4722, 5392, 4723, 4723, 4621, 4672, 5150, 5507, 5459, 5078, 4671, 5426, 5379, 4379, 5450, 4713, 5157, 5450, 5379, 4419, 4418, 5191, 5414, 5522, 5157, 5146, 5450, 3808, 5192, 3715, 5176, 3815, 5438, 5183, 5520, 5401, 5190, 5226, 5414, 5196, 5195, 5085, 5226, 5190, 5196, 5196, 5225, 5197, 5521, 4388, 4390, 4470, 5426, 5173, 5198, 5434, 5181, 5087, 5434, 5084, 5181, 5086, 4378, 5437, 5348, 5350, 5401, 4389, 4387, 5523, 3717, 5524, 5146, 5223, 5136, 5198, 4388, 5521, 4391, 5181, 4380, 5154, 5083, 5184, 5184, 4723, 5223, 5225, 5192, 3808, 4380, 5181, 4378, 5087, 5086, 5434, 5086, 4713, 4378, 5181, 4391, 5088, 5154, 5146, 5157, 5414, 4390, 5400, 4713, 5087, 5157, 5192, 5225, 5190, 5414, 5191, 5190, 5399, 5435, 5349, 5083, 5185, 5184, 5195, 5197, 5185, 5413, 5522, 5414, 5413, 5400, 5348, 5196, 5190, 5225, 5398, 5520, 4706, 5354, 5435, 5398, 5437, 5522, 5413, 5200, 5400, 4390, 5084, 5434, 5085, 5199, 5191, 5522, 5354, 5177, 5435, 5521, 4390, 5414, 4709, 5398, 4706, 5399, 5398, 5435, 5399, 5348, 5400, 4706, 5183, 5010, 4721, 5185, 5224, 5086, 5181, 5434, 5348, 5399, 5349, 5197, 5225, 5224, 5226, 5521, 5414, 4709, 5354, 5398, 5183, 4706, 5520, 5520, 5200, 5401, 5088, 4387, 4389, 5183, 5401, 4387, 5071, 5183, 4711, 5353, 5177, 5354, 5354, 4709, 5007, 5197, 5224, 5185, 5350, 5349, 5438, 5434, 5226, 5085, 5421, 5174, 5425, 5174, 5421, 5420, 5386, 5373, 5387, 5364, 5396, 5003, 3668, 5073, 5072, 5337, 5525, 5526, 5526, 5525, 5334, 5329, 5328, 5524, 5335, 5527, 5336, 4925, 5333, 5117, 5525, 5337, 5336, 5011, 4925, 4371, 5126, 5125, 5523, 5364, 5331, 5396, 5523, 5396, 5331, 5077, 3666, 5074, 5126, 5523, 5331, 5460, 5528, 5524, 5043, 5460, 5179, 5005, 5529, 5327, 5530, 5531, 5525, 5376, 5179, 5178, 5011, 5337, 5526, 5394, 5460, 5043, 5523, 5528, 5396, 5328, 5180, 5179, 5527, 5335, 5180, 5334, 4925, 5526, 5334, 5531, 5332, 5376, 5043, 5179, 5391, 5330, 5331, 5395, 5394, 5327, 5335, 5359, 5178, 4925, 5011, 5526, 5333, 4925, 5334, 5175, 5389, 5075, 4370, 5208, 4771, 5525, 5531, 5334, 5460, 5328, 5179, 5336, 5530, 5525, 5328, 5460, 5524, 5358, 5360, 4869, 5043, 5358, 5044, 5050, 5358, 5049, 5358, 5045, 5049, 5370, 5358, 5043, 5370, 5371, 5360, 5360, 5359, 4869, 5396, 5395, 5003, 5394, 5043, 5327, 3717, 5523, 5125, 5529, 5395, 5327, 5529, 5005, 4997, 5324, 5364, 5003, 5362, 5390, 5009, 5390, 5004, 5009, 4997, 5395, 5529, 5362, 5364, 5390, 5377, 5378, 3811, 5366, 5365, 5362, 5366, 5065, 5352, 5366, 5362, 5009, 5532, 5391, 5365, 5533, 5372, 5214, 5357, 5377, 5352, 5377, 5365, 5352, 5528, 5523, 5524, 5528, 5460, 5396, 5363, 5362, 5365, 5363, 5391, 5364, 5063, 5534, 5064, 5446, 5318, 5095, 5535, 5416, 5356, 5356, 5534, 5326, 5415, 5065, 5064, 5387, 5535, 5344, 5356, 5417, 5415, 5342, 5445, 5355, 5534, 5063, 5326, 5356, 5415, 5534, 5416, 5375, 5351, 5415, 5064, 5534, 5397, 5532, 5365, 5339, 5380, 5338, 5387, 5373, 5416, 5445, 5344, 5355, 5381, 5386, 5345, 5344, 5343, 5387, 5345, 5344, 5384, 5536, 5319, 5315, 5386, 5343, 5345, 5090, 5093, 5444, 5381, 3870, 5386, 5214, 5315, 5319, 5046, 5537, 4779, 5344, 5385, 5384, 5538, 5385, 5342, 5345, 5384, 5441, 5055, 5068, 4862, 5372, 5212, 4980, 5315, 5214, 5320, 5416, 5373, 5375, 5034, 5340, 5066, 5338, 5441, 5097, 5374, 5351, 5375, 5539, 5304, 5110, 5309, 5304, 5303, 5314, 5313, 5093, 5384, 5383, 5439, 5313, 5321, 5093, 5320, 5440, 5321, 5540, 5110, 5304, 5304, 4832, 5540, 5205, 5347, 5206, 5091, 5090, 5444, 5385, 5538, 5383, 5355, 5535, 5356, 5538, 5066, 5383, 5090, 5092, 5447, 5203, 4822, 4821, 5097, 5096, 5338, 5346, 5440, 5418, 4982, 5316, 4976, 5205, 5204, 5303, 5541, 5109, 5108, 4980, 5214, 5372, 5210, 4971, 5202, 5110, 5091, 5539, 5321, 5347, 5388, 4762, 5537, 5542, 5319, 5536, 5317, 4977, 5316, 5212, 5319, 5533, 5214, 5318, 5446, 5533, 5539, 5361, 5388, 5316, 4980, 5212, 5205, 5388, 5347, 5318, 5317, 5096, 5308, 5309, 5303, 5311, 4821, 4961, 4832, 5311, 4833, 5307, 5203, 4821, 5310, 5311, 4832, 5310, 5309, 5308, 4821, 5311, 5307, 5311, 5308, 5307, 5342, 5306, 5538, 5380, 5441, 5338, 5388, 5304, 5539, 4982, 4811, 4981, 4822, 5204, 5082, 5543, 5092, 5110, 5081, 4822, 5082, 5315, 5320, 5313, 5206, 5080, 5082, 5440, 5347, 5321, 5441, 5384, 5439, 5540, 5543, 5110, 5214, 4979, 5418, 5091, 5444, 5539, 4981, 5210, 4979, 4977, 5213, 5034, 5312, 5213, 5212, 5439, 5383, 5340, 5439, 5095, 5097, 5213, 5312, 5034, 5446, 5312, 5372, 5319, 5318, 5533, 5538, 5306, 5066, 5361, 5539, 5444, 5096, 5317, 5338, 4811, 4982, 4870, 5533, 5446, 5372, 5440, 5346, 5347, 5080, 5346, 4979, 5304, 5388, 5205, 5325, 5068, 5305, 5325, 5306, 5341, 5068, 5341, 5326, 5374, 5377, 5357, 5373, 5544, 5374, 5535, 5387, 5416, 5535, 5355, 5344, 4052, 4046, 5118, 4046, 5119, 5118, 4370, 5119, 5207, 4045, 5207, 5121, 4046, 4045, 5121, 4762, 3934, 3933, 5208, 5207, 4771, 5207, 5221, 4771, 5117, 4369, 4925, 5537, 5046, 5542, 5537, 4762, 4779, 4051, 5302, 4045, 5209, 5046, 4720, 5221, 5207, 5209, 5221, 4720, 4771, 4019, 4762, 3933, 5302, 4051, 5209, 5302, 5207, 4045, 4745, 5175, 5432, 5367, 4746, 5432, 5367, 5077, 4677, 3895, 4013, 3897, 5075, 4054, 4047, 5393, 5077, 5545, 5077, 5322, 5545, 5432, 5546, 5367, 5432, 5382, 5077, 5546, 5432, 5077, 5546, 5077, 5367, 4745, 5432, 4746, 5075, 5166, 5323, 5382, 5432, 5323, 5382, 5322, 5077, 4054, 5075, 5389, 5389, 5175, 3895, 5182, 4013, 5175, 5182, 4744, 4012, 5547, 5218, 5473, 5232, 4889, 4888, 5270, 5218, 5220, 5215, 5217, 5264, 5296, 4887, 4889, 5113, 4889, 5111, 4056, 5235, 5234, 5548, 5219, 5471, 5111, 5549, 4900, 5120, 4899, 5233, 4044, 4036, 4899, 5298, 3924, 4044, 5298, 4899, 4090, 5550, 3875, 5551, 3925, 3924, 4090, 3924, 5298, 4090, 5552, 5233, 4899, 5550, 5551, 4888, 5215, 5553, 5216, 5553, 4911, 4903, 5270, 5220, 4911, 5296, 5220, 5219, 5550, 4888, 4887, 5233, 5549, 5231, 5235, 5266, 5236, 5215, 5284, 5476, 5219, 5548, 5297, 5113, 4921, 5220, 5220, 4889, 5113, 5288, 5468, 5289, 5232, 5120, 5233, 5549, 5111, 5231, 5554, 5266, 5232, 3923, 4090, 4056, 4921, 5112, 4914, 5234, 3887, 4055, 5549, 5233, 5552, 5555, 5548, 5471, 5488, 5555, 5471, 4900, 5549, 5552, 4900, 4914, 5111, 4900, 5552, 4899, 5232, 4888, 5551, 5111, 4889, 5231, 5297, 5556, 4887, 5112, 4921, 5113, 4914, 5112, 5111, 4911, 5220, 4921, 5468, 5288, 5485, 5219, 5218, 5471, 4090, 5120, 4056, 5271, 5270, 4911, 5284, 5257, 5476, 5555, 5297, 5548, 4911, 5553, 5271, 5216, 4906, 4908, 4903, 4904, 5553, 5491, 5217, 4920, 5217, 5491, 5263, 4904, 5216, 5553, 5547, 5473, 5471, 5553, 5215, 5475, 4920, 5217, 4908, 5218, 5547, 5471, 5469, 5485, 5487, 5232, 5551, 5554, 4901, 5247, 4910, 5483, 5403, 5405, 3600, 4160, 3594, 3649, 3911, 3611, 3911, 3712, 3611, 5557, 3601, 5558, 3601, 5557, 3588, 3636, 3637, 3623, 5559, 2096, 3662, 4368, 3652, 3657, 1476, 4368, 5560, 3652, 4368, 1476, 3653, 3658, 4323, 5559, 3662, 3651, 3854, 5428, 3820, 5234, 3877, 3587, 3707, 3820, 5427, 5378, 5544, 3742, 3878, 5236, 5561, 3736, 5497, 3842, 3813, 3870, 3752, 5397, 3812, 3756, 3804, 3689, 5427, 3777, 5127, 3766, 3723, 3725, 3819, 3793, 5514, 3791, 3742, 3811, 5378, 5397, 3756, 3757, 3857, 3783, 3704, 3859, 3782, 3858, 3856, 5116, 3703, 3834, 5253, 3825, 3834, 3825, 3826, 3829, 5562, 3726, 3825, 5253, 3837, 3736, 3832, 5497, 5514, 3695, 3791, 3689, 3707, 5427, 5427, 3820, 5428, 3724, 5453, 3725, 5453, 3724, 3855, 3703, 5116, 3701, 3855, 3701, 5453, 3695, 5514, 3693, 3775, 3794, 5368, 3860, 3775, 5368, 5127, 3777, 3788, 3742, 3803, 3811, 3813, 3743, 5544, 3742, 5544, 3743, 5236, 3877, 5234, 5236, 3878, 3877, 5561, 5551, 3878, 5562, 3799, 3726, 3875, 3878, 5551, 3590, 3589, 3920, 3620, 3889, 3920, 4160, 4053, 3594, 3654, 3659, 3953, 3589, 3620, 3920, 3654, 3953, 3955, 3586, 3885, 3887, 3659, 3850, 4048, 3911, 4043, 3712, 4048, 3953, 3659, 4053, 4052, 3594, 3889, 3620, 4047, 4047, 3620, 3619, 3586, 3887, 3587, 4066, 4069, 5558, 4069, 5557, 5558, 5557, 4069, 3588, 4069, 4071, 3588, 4071, 3885, 3588, 4068, 4066, 5558, 3625, 4068, 5558, 4068, 3625, 3661, 3885, 3586, 3588, 4068, 3661, 4089, 4089, 3661, 4091, 4212, 4118, 3629, 4113, 3660, 3630, 3630, 3629, 4118, 3631, 3590, 4212, 3631, 4212, 3635, 3920, 4109, 3590, 4128, 4154, 3637, 3623, 3637, 4154, 3637, 1424, 4129, 4154, 3641, 3623, 3641, 4154, 4152, 4157, 4214, 3641, 3642, 3641, 4214, 3642, 4159, 3600, 4159, 3642, 4214, 4160, 3600, 4159, 4211, 3646, 3648, 4176, 3648, 3662, 4176, 4211, 3648, 3912, 3650, 4183, 3650, 4184, 4178, 3650, 3646, 4184, 3649, 3912, 3911, 4211, 4184, 3646, 3655, 3654, 3955, 4322, 4321, 3657, 3657, 3653, 4322, 4319, 4320, 5560, 4321, 4368, 3657, 3650, 4178, 4183, 4218, 4176, 3662, 4109, 4212, 3590, 4118, 4113, 3630, 4368, 4319, 5560, 4152, 4157, 3641, 1424, 1417, 4129, 3650, 3912, 3649, 4129, 4128, 3637, 3629, 3635, 4212, 4207, 3655, 3955, 4207, 3658, 3655, 3653, 4323, 4322, 5294, 3706, 5410, 4047, 3619, 5076, 5504, 4048, 3850, 3666, 5072, 5074, 3668, 5072, 3666, 5073, 3861, 5176, 3759, 5536, 5315, 5317, 5536, 3759, 3744, 3746, 5339, 3779, 5199, 3864, 3853, 5509, 5508, 3866, 5333, 5332, 3796, 5530, 5336, 3866, 3592, 5118, 3857, 3704, 4669, 5510, 5224, 3808, 5453, 5515, 3725, 3792, 5156, 5442, 3760, 5527, 5180, 3764, 3766, 5330, 5448, 3852, 3693, 3880, 5488, 3830, 3887, 5234, 3587, 5556, 5297, 3879, 3842, 5490, 5494, 5488, 3880, 3882, 5556, 3879, 3881, 5405, 3839, 5483, 3821, 3847, 5243, 5315, 5314, 3758, 3717, 5125, 3788, 3760, 5180, 5329, 3866, 5332, 3605, 3619, 3751, 5076, 5073, 3668, 3861, 3758, 3759, 5315, 5350, 5368, 3794, 4052, 3592, 3594, 3757, 5330, 5391, 5410, 3706, 3818, 5494, 3731, 3842, 5505, 3711, 5451, 5126, 5330, 3766, 3819, 5134, 3854, 3698, 5507, 3704, 3603, 3605, 5531, 5294, 5504, 3729, 5477, 3836, 5299, 3859, 4722, 5510, 3857, 5392, 3858, 3860, 5368, 5369, 3871, 3870, 5381, 5442, 3793, 3792, 3731, 5494, 3843, 3818, 3844, 5237, 5243, 3844, 3821, 3836, 5300, 5299, 5477, 3823, 3822, 3882, 3879, 5297, 3836, 3835, 5300, 3828, 5488, 5470, 3829, 3828, 5470, 5562, 3829, 5485, 3835, 3799, 5466, 5562, 5485, 5482, 3800, 3799, 3835, 5469, 3829, 5470, 3829, 5469, 5487, 5266, 5561, 5236, 3839, 3838, 5483, 3837, 5253, 5252, 5149, 3704, 5507, 3799, 5562, 5482, 3838, 3827, 5489, 5428, 3854, 5454, 3836, 5477, 3822, 3834, 3823, 5477, 5481, 3827, 3837, 5252, 5481, 3837, 3827, 5481, 5489, 5483, 3838, 5489, 3845, 5495, 5275, 5501, 5407, 3687, 5404, 3832, 5405, 3832, 5404, 5497, 3832, 3839, 5405, 3842, 5497, 5490, 3795, 3843, 5495, 5495, 3845, 3795, 3847, 5407, 5242, 5280, 5501, 3846, 5501, 3687, 3817, 3845, 5275, 3846, 3846, 5501, 3817, 5275, 5280, 3846, 5243, 3847, 5242, 3725, 5499, 3819, 3847, 3687, 5407, 5237, 5410, 3818, 3711, 5505, 3856, 3850, 3729, 5504, 3844, 5244, 5237, 3844, 5243, 5244, 3706, 5294, 3729, 3852, 5448, 5431, 5507, 3698, 5508, 5156, 3792, 5099, 3864, 5199, 3794, 5449, 5448, 3693, 5099, 3792, 3804, 3804, 5513, 5099, 5509, 3852, 5431, 3793, 5442, 5492, 5509, 3853, 3852, 5514, 3793, 5492, 3704, 5149, 5151, 5427, 5513, 3804, 5454, 3854, 5134, 5515, 5186, 3725, 5499, 5188, 3819, 5186, 5500, 3725, 5188, 5134, 3819, 5500, 5499, 3725, 5505, 5145, 3856, 3712, 5124, 3711, 4043, 5124, 3712, 5124, 5451, 3711, 3853, 5508, 3698, 3857, 4669, 4621, 4722, 3859, 3858, 3859, 5510, 3808, 5199, 3779, 3713, 5438, 3815, 5369, 3797, 3603, 5531, 4621, 5392, 3857, 3794, 5199, 5522, 3794, 5437, 5350, 3815, 3860, 5369, 3713, 3715, 5199, 5522, 5437, 3794, 3815, 5176, 3861, 3704, 5151, 4669, 3693, 5514, 5449, 3717, 3761, 5329, 5527, 3760, 3716, 3716, 3796, 5336, 5332, 5531, 3605, 5333, 3866, 5117, 5531, 5530, 3797, 5127, 5126, 3766, 3761, 3760, 5329, 5118, 5117, 3866, 3592, 4052, 5118, 5524, 3717, 5329, 5530, 3796, 3797, 3788, 5125, 5127, 5336, 5527, 3716, 5532, 3757, 5391, 3811, 3812, 5377, 5532, 5397, 3757, 3812, 5397, 5377, 3757, 3764, 5330, 5380, 3871, 5381, 5386, 3870, 3813, 5544, 5378, 5374, 5373, 5386, 3813, 5373, 3813, 5544, 3027, 3772, 5541, 3872, 5314, 5093, 3772, 3872, 5541, 3872, 3758, 5314, 5339, 5317, 3744, 5317, 3759, 3744, 3746, 3871, 5380, 5380, 5339, 3746, 5541, 3872, 5109, 5109, 3872, 5093, 5322, 5166, 3874, 5545, 5322, 3874, 3874, 3873, 5545, 3755, 3868, 3666, 3755, 5393, 5545, 3873, 3755, 5545, 3874, 5076, 3751, 5076, 3874, 5166, 5561, 5554, 5551, 5556, 3881, 4887, 5554, 5561, 5266, 5555, 5488, 3882, 3882, 5297, 5555, 3875, 5550, 3881, 5488, 3828, 3830, 3881, 5550, 4887, 5286, 3834, 5477, 4349, 4330, 4346, 2849, 3680, 2854, 2855, 2854, 3670, 2849, 3681, 3789, 2951, 3802, 2945, 3678, 2951, 2855, 3802, 2951, 3678, 5079, 3254, 3201, 3201, 3203, 5079, 3557, 5443, 3476, 3203, 3479, 5079, 3478, 5079, 3479, 3557, 3029, 5443, 3012, 5443, 3029, 2855, 3670, 3678, 3789, 3680, 2849, 3011, 3027, 3012, 3798, 3739, 3028, 3027, 3028, 3739, 3802, 3798, 3028, 2945, 3802, 3028, 4766, 4765, 3154, 3154, 3254, 4766, 3155, 3154, 4962, 3155, 4962, 3290, 3254, 5079, 4766, 4765, 4962, 3154, 5211, 3478, 4832, 4832, 3478, 5540, 5447, 5092, 3477, 3476, 5447, 3477, 3514, 3477, 5543, 3515, 3514, 5543, 5543, 3478, 3515, 5540, 3478, 5543, 5094, 3476, 5443, 3476, 5094, 5447, 5092, 5543, 3477, 5541, 3012, 3027, 3012, 5541, 5108, 5108, 5443, 3012, 2790, 5563, 2821, 5564, 5565, 198, 198, 5565, 5566, 5566, 5567, 5568, 5566, 5565, 5569, 2821, 2824, 2790, 5564, 198, 200, 198, 5566, 5568, 5567, 5566, 5570, 5571, 3840, 5572, 3840, 3786, 5573, 3833, 5571, 5572, 3840, 5573, 5572, 5573, 5563, 5572, 5573, 3676, 2849, 5573, 2849, 5563, 2790, 3585, 5570, 197, 5574, 180, 196, 179, 195, 5575, 169, 192, 195, 5575, 192, 189, 153, 190, 5576, 5577, 126, 191, 190, 153, 5578, 5579, 5580, 5576, 183, 182, 5581, 5582, 5583, 127, 5584, 186, 5584, 127, 126, 5577, 5585, 126, 183, 5576, 126, 182, 5582, 5586, 5577, 5587, 5585, 5586, 5582, 5580, 5580, 5582, 5578, 5587, 5577, 5586, 5588, 5581, 5583, 5585, 5584, 126, 185, 127, 186, 189, 186, 5585, 5589, 5587, 5579, 5579, 5587, 5580, 5577, 5576, 5586, 5584, 5585, 186, 129, 183, 126, 5590, 5583, 139, 5586, 5576, 182, 5582, 5581, 5578, 5586, 5580, 5587, 5591, 5592, 5593, 5594, 5595, 138, 5594, 5596, 5597, 5591, 3359, 5598, 5590, 5588, 5583, 138, 5599, 5600, 182, 181, 5582, 137, 183, 129, 5596, 5594, 3578, 5594, 138, 5600, 5595, 5590, 138, 5595, 5594, 5597, 5582, 139, 5583, 5590, 5595, 5597, 181, 139, 5582, 5593, 5592, 5588, 192, 169, 193, 175, 5601, 173, 174, 173, 5568, 175, 157, 5601, 197, 174, 5602, 5603, 5602, 174, 5574, 195, 179, 195, 5574, 5575, 179, 180, 5574, 5603, 174, 5568, 5603, 5568, 5567, 5567, 3585, 5603, 3572, 2832, 197, 2832, 2820, 5574, 197, 2832, 5574, 5602, 5603, 3583, 2848, 288, 2821, 3039, 3038, 2846, 2824, 3038, 2790, 3038, 2824, 2846, 169, 5575, 170, 5589, 3169, 3250, 3450, 3251, 5578, 5579, 3251, 3170, 3170, 5589, 5579, 3169, 5589, 3170, 145, 148, 165, 3251, 5579, 5578, 3577, 5598, 3359, 3277, 141, 143, 2986, 5604, 3577, 143, 3275, 3277, 3275, 143, 145, 2986, 3372, 5604, 3435, 3441, 5592, 3578, 3408, 3357, 5598, 3577, 5604, 5591, 5598, 3422, 5604, 3422, 5598, 3435, 5591, 3422, 3372, 3422, 5604, 5592, 5591, 3435, 3441, 3450, 5592, 2819, 170, 5575, 5575, 5574, 2820, 3583, 5603, 3584, 3583, 3572, 5602, 2819, 5575, 2820, 3676, 3672, 3674, 2849, 3676, 3681, 3840, 5571, 3824, 2799, 3880, 3830, 2849, 2821, 5563, 156, 199, 173, 199, 198, 173, 5568, 173, 198, 5570, 5605, 5567, 3684, 3790, 3676, 5573, 3684, 3676, 3833, 3824, 5571, 3727, 3833, 2798, 3829, 3726, 3728, 3728, 3830, 3829, 3684, 5573, 3786, 3790, 3672, 3676, 5567, 5605, 3585, 5570, 3585, 5605, 3585, 3584, 5603, 153, 189, 3166, 153, 3166, 154, 3450, 5578, 5581, 3450, 5581, 5588, 5587, 3250, 5585, 189, 3250, 3167, 3167, 3166, 189, 5587, 5589, 3250, 189, 5585, 3250, 3579, 5600, 5599, 3449, 5597, 3357, 5592, 3450, 5588, 5591, 5593, 3449, 5593, 5588, 3449, 5588, 5590, 3449, 3357, 5596, 3578, 5594, 5600, 3578, 5597, 3449, 5590, 5596, 3357, 5597, 5600, 3579, 3578, 3359, 5591, 3449, 5601, 157, 156, 5602, 3572, 197, 156, 173, 5601, 3051, 2789, 2791, 3601, 3587, 2794, 3587, 2800, 2794, 990, 2792, 988, 5558, 3601, 2794, 2792, 5558, 2794, 2792, 990, 3625, 2797, 2800, 3876, 2800, 3877, 3876, 2798, 2799, 3728, 5572, 2798, 3833, 2799, 2797, 3876, 2791, 2790, 3038, 2791, 3038, 3037, 3051, 2791, 3052, 3051, 3050, 2789, 3037, 3567, 2791, 3567, 3558, 2791, 2791, 3558, 3560, 2791, 3560, 3052, 3877, 2800, 3587, 3876, 3879, 2799, 2792, 3625, 5558, 3830, 3728, 2799, 2790, 2789, 3585, 987, 988, 2793, 1250, 1495, 1251, 1415, 1417, 1424, 1494, 5559, 1442, 5559, 1438, 1442, 1476, 5560, 1477, 1495, 1250, 1422, 1495, 2747, 1251, 1527, 2086, 5606, 4084, 1527, 5606, 2085, 2554, 1538, 2090, 1536, 2091, 1813, 1815, 1818, 1809, 1808, 4213, 4094, 1822, 1823, 4145, 2095, 1894, 2137, 4143, 2092, 1894, 4142, 4145, 1417, 2095, 4145, 1767, 1766, 1952, 1950, 1948, 4351, 1765, 1767, 1952, 2045, 4216, 2046, 5607, 4195, 2464, 2063, 4195, 2062, 2045, 2089, 4320, 2046, 4216, 2065, 4216, 2045, 4320, 4142, 1912, 2092, 4144, 4143, 2137, 4142, 1894, 1912, 2554, 2091, 1536, 1527, 4084, 1528, 4195, 5607, 2062, 1822, 4094, 4097, 1807, 1822, 4097, 1808, 1807, 4097, 4143, 4142, 2092, 1817, 1809, 4213, 2468, 4314, 4302, 4244, 5608, 2231, 2194, 4245, 4244, 4244, 2231, 2195, 2194, 4229, 4245, 2193, 4340, 2194, 2195, 2194, 4244, 4229, 2194, 4340, 2363, 4290, 4324, 2468, 2487, 4314, 2466, 2483, 5609, 2086, 5609, 5606, 2114, 4316, 2461, 5609, 2460, 2466, 4302, 2484, 2113, 2468, 4302, 2113, 5609, 5610, 5606, 4195, 2487, 2464, 2086, 2460, 5609, 4354, 4366, 2385, 2385, 4367, 2386, 2323, 5611, 5612, 4351, 1948, 4352, 4339, 2585, 2507, 4291, 2363, 2366, 4316, 2483, 2461, 2487, 4195, 4314, 4291, 4290, 2363, 4324, 5613, 2361, 2362, 4324, 2361, 2347, 4340, 2193, 5613, 4340, 2361, 2365, 4291, 2366, 4291, 2585, 5614, 4324, 2362, 2363, 2507, 2594, 4339, 2347, 2361, 4340, 1948, 1926, 4352, 5612, 2615, 2381, 5615, 2322, 2324, 2387, 5615, 2324, 5616, 4353, 2615, 2513, 2515, 1818, 4363, 2615, 4353, 2615, 4363, 2534, 1813, 1818, 2515, 2389, 5615, 2387, 5615, 2389, 5617, 1810, 5618, 2390, 4363, 4354, 2534, 2608, 2569, 4352, 4367, 2628, 2386, 2568, 2628, 4367, 2608, 4352, 1926, 4366, 4367, 2385, 5618, 2616, 2539, 2615, 5612, 5616, 5618, 5619, 2389, 5618, 1810, 2616, 2381, 2323, 5612, 2385, 2534, 4354, 2139, 4144, 2137, 4291, 2365, 2585, 2390, 5618, 2389, 2539, 2514, 5618, 1383, 2743, 4094, 2747, 3660, 4094, 1477, 4320, 2089, 1383, 4094, 1823, 2743, 2747, 4094, 2750, 2095, 1417, 1477, 5560, 4320, 2747, 3628, 3660, 1423, 1424, 3636, 1438, 5559, 1440, 2096, 5559, 1494, 3651, 1440, 5559, 3595, 1444, 1440, 3628, 2747, 1495, 4075, 4084, 4086, 2085, 4075, 4074, 5610, 4084, 5606, 4075, 2085, 1528, 4085, 4084, 5610, 4084, 4075, 1528, 2091, 2554, 4083, 2091, 4088, 4092, 4088, 2091, 4083, 4091, 1264, 2091, 4092, 4091, 2091, 4114, 1808, 4097, 4108, 1818, 1817, 1808, 4114, 4115, 1808, 4115, 4213, 4141, 4121, 4145, 4145, 4121, 4129, 1960, 4170, 4169, 4169, 4218, 2096, 4164, 1766, 4172, 4172, 1766, 4351, 1960, 1952, 4170, 1766, 1950, 4351, 2064, 4196, 2063, 2063, 4196, 4195, 4169, 2096, 1960, 4142, 4141, 4145, 4188, 4217, 4216, 4074, 4083, 2554, 2554, 2085, 4074, 1766, 4164, 4168, 1952, 1766, 4168, 1817, 4213, 4108, 4239, 4139, 2586, 5608, 4263, 2231, 2152, 2586, 4139, 4263, 5608, 4260, 2598, 4239, 2586, 5608, 4244, 4260, 2598, 4262, 4239, 4279, 5613, 4324, 4221, 5613, 4279, 4263, 2598, 2231, 4365, 5617, 2389, 5610, 5609, 2483, 4311, 2114, 2484, 4315, 2483, 4316, 5610, 4305, 4085, 2114, 4311, 4316, 4318, 5610, 2483, 2483, 4315, 4318, 5610, 4318, 4305, 2152, 4139, 2139, 4304, 4311, 2484, 4367, 4336, 2568, 4325, 2569, 2568, 2569, 4325, 4182, 4304, 2484, 4302, 4337, 4275, 5614, 5614, 4339, 4337, 4276, 5614, 4275, 4339, 5614, 2585, 2598, 4263, 4262, 4220, 4340, 5613, 2598, 2586, 2140, 4349, 4346, 2756, 5614, 4276, 4291, 4131, 2139, 4139, 2568, 4336, 4325, 2322, 5615, 4255, 2514, 4105, 4361, 4101, 4105, 2514, 2322, 4356, 4292, 5611, 4292, 4294, 5616, 5612, 4294, 4365, 5619, 4361, 2323, 4292, 5611, 2514, 4361, 5618, 5617, 4365, 4256, 4255, 5617, 4256, 4292, 2323, 2322, 4255, 4356, 2322, 4353, 5616, 4294, 5611, 4294, 5612, 2513, 4101, 2514, 4352, 2569, 4182, 4255, 5615, 5617, 5619, 5618, 4361, 5619, 4365, 2389, 4221, 4220, 5613, 4144, 2139, 4131, 4346, 4345, 2756, 3661, 1264, 4091, 4218, 3662, 2096, 2698, 4345, 4330, 4330, 4329, 2698, 2698, 2756, 4345, 4350, 4349, 2756, 4329, 4339, 2698, 5620, 2790, 5621, 5570, 5569, 5621, 995, 1014, 994, 995, 984, 987, 969, 1006, 1241, 969, 1241, 970, 5622, 2795, 2798, 5572, 5623, 2798, 2795, 5622, 2796, 5572, 5624, 5623, 5566, 5569, 5570, 5563, 5624, 5572, 2790, 5570, 5621, 512, 631, 584, 631, 365, 364, 365, 631, 512, 4550, 5311, 4961, 5311, 4550, 4767, 5311, 4767, 4833, 398, 397, 400, 400, 551, 398, 552, 400, 402, 551, 400, 552, 1046, 43, 87, 1046, 87, 98, 87, 43, 42, 3177, 3424, 3221, 3424, 3177, 3265, 3221, 3424, 3222, 3310, 3442, 244, 3442, 3373, 244, 4051, 3898, 4057, 4762, 5542, 4057, 5228, 5506, 4880, 5228, 4880, 4917, 5228, 5458, 5506, 5230, 5458, 5228, 5046, 4051, 4057, 4057, 5542, 5046, 3934, 4762, 4057, 138, 5590, 139, 295, 313, 293, 313, 748, 293, 447, 293, 411, 447, 406, 293, 410, 409, 293, 293, 409, 411, 293, 406, 390, 516, 293, 390, 748, 742, 293, 742, 410, 293, 64, 1036, 1034, 1034, 1070, 21, 1070, 1034, 1109, 64, 1034, 18, 1036, 1109, 1034, 1412, 1411, 1888, 1888, 1413, 1412, 2084, 1868, 2424, 2084, 2424, 2425, 1868, 1851, 2424, 2424, 1851, 1856, 1411, 2749, 1888, 2749, 1869, 1888, 1877, 1413, 1888, 3547, 3140, 3068, 3068, 3140, 3069, 3140, 3547, 3544, 124, 147, 125, 742, 5625, 388, 242, 5626, 250, 5627, 280, 279, 282, 5627, 279, 5627, 204, 280, 5628, 187, 142, 142, 161, 5628, 5629, 148, 149, 5629, 147, 148, 702, 699, 5630, 147, 5629, 125, 5631, 216, 212, 5632, 970, 1241, 5564, 200, 5633, 358, 357, 5634, 357, 321, 5634, 5635, 203, 202, 203, 5635, 2997, 235, 237, 5636, 356, 355, 5637, 263, 209, 5638, 5639, 5620, 5621, 5621, 5569, 5639, 5640, 340, 358, 338, 340, 5640, 268, 5641, 224, 5641, 237, 224, 237, 5641, 5636, 5642, 263, 5638, 5564, 5633, 5643, 217, 285, 5644, 1056, 1016, 35, 1056, 2759, 1016, 177, 5645, 178, 5645, 175, 172, 582, 571, 5646, 360, 5647, 315, 314, 315, 5647, 314, 5647, 312, 377, 5648, 379, 5647, 360, 5649, 5650, 708, 702, 708, 5650, 706, 33, 96, 806, 33, 806, 34, 1028, 1016, 1029, 1545, 2481, 1549, 1577, 1561, 1574, 1568, 1578, 1575, 2083, 1578, 1616, 1568, 1575, 1561, 1577, 1599, 1561, 1599, 1635, 1561, 1568, 1561, 1569, 1708, 1714, 1706, 2068, 1706, 1687, 1706, 1714, 1707, 5607, 2041, 2062, 2041, 5607, 2464, 2042, 2041, 2055, 2481, 1545, 1555, 1578, 1568, 1616, 1575, 1574, 1561, 1578, 2083, 1555, 1707, 1687, 1706, 1549, 1546, 1545, 2463, 2041, 2464, 2463, 2055, 2041, 1321, 1705, 1706, 1321, 1706, 2068, 1029, 1016, 1391, 1016, 2759, 2748, 2748, 1391, 1016, 799, 806, 2775, 2775, 806, 96, 4185, 4196, 4217, 4186, 4185, 4217, 4186, 4217, 4190, 5289, 5473, 5257, 5473, 5475, 5476, 5553, 5473, 5271, 5473, 5476, 5257, 5475, 5473, 5553, 5218, 5271, 5473, 4196, 2064, 4217, 4217, 2064, 2065, 2065, 4216, 4217, 995, 5651, 1014, 2793, 5651, 987, 987, 5651, 995, 172, 178, 5645, 5652, 253, 134, 349, 5653, 5654, 354, 349, 5654, 355, 354, 5654, 132, 5655, 134, 5655, 5652, 134, 5656, 129, 128, 5657, 1241, 1014, 5658, 132, 133, 5659, 591, 589, 211, 218, 5660, 218, 217, 5660, 5650, 702, 5630, 5661, 168, 167, 261, 168, 5661, 125, 5662, 123, 5599, 138, 5663, 138, 140, 5663, 5664, 167, 5665, 136, 5663, 140, 151, 163, 5666, 152, 151, 5666, 401, 400, 5667, 404, 5667, 400, 5632, 1241, 5657, 252, 253, 5666, 163, 252, 5666, 5652, 5666, 253, 167, 5664, 5661, 5666, 5668, 152, 271, 283, 5669, 345, 356, 5670, 323, 345, 5670, 356, 5637, 5670, 289, 2916, 5671, 3000, 5671, 2916, 5672, 5673, 5674, 5675, 699, 582, 3579, 5599, 5676, 5676, 5599, 5677, 5675, 5630, 699, 5625, 742, 5678, 247, 5679, 161, 247, 250, 5679, 5662, 5680, 123, 5681, 5673, 5632, 5682, 5683, 5670, 5563, 2790, 5684, 5624, 5563, 5684, 5684, 2790, 5620, 5644, 5660, 217, 5679, 5628, 161, 5685, 157, 175, 5686, 578, 553, 5687, 545, 547, 338, 5688, 339, 750, 745, 5688, 305, 303, 5689, 360, 311, 5690, 5691, 321, 323, 5692, 402, 5693, 5694, 751, 387, 5686, 553, 5692, 445, 5690, 320, 745, 743, 5688, 5694, 386, 388, 578, 5686, 547, 336, 5695, 5696, 5697, 370, 375, 5698, 5689, 5699, 5649, 360, 5690, 335, 5695, 336, 591, 5700, 630, 312, 5701, 746, 5690, 445, 747, 5653, 349, 5702, 5688, 743, 339, 387, 386, 5694, 349, 348, 5702, 311, 320, 5690, 730, 5703, 645, 748, 5704, 742, 5705, 545, 5706, 553, 402, 5692, 5707, 375, 369, 370, 5697, 371, 5707, 369, 379, 1428, 1373, 5708, 1432, 5708, 1373, 1954, 5708, 1936, 5708, 1954, 1428, 2594, 2600, 5709, 5709, 4339, 2594, 272, 271, 5710, 123, 5711, 166, 265, 239, 5712, 5712, 221, 265, 5625, 5694, 388, 5712, 171, 221, 5711, 167, 166, 5713, 287, 289, 287, 5713, 284, 284, 5713, 5714, 157, 5715, 158, 157, 5685, 5715, 5716, 5623, 5624, 5717, 352, 327, 5703, 346, 643, 352, 5717, 348, 348, 5717, 5702, 184, 190, 5718, 191, 5718, 190, 375, 5707, 5697, 188, 184, 5718, 312, 5719, 5720, 545, 5687, 5706, 5721, 171, 5712, 5722, 258, 263, 284, 5714, 5723, 285, 284, 5723, 5724, 5633, 200, 321, 5691, 5634, 5642, 5722, 263, 5725, 259, 258, 3388, 3296, 5725, 259, 5725, 3296, 355, 5726, 5637, 191, 155, 5727, 177, 176, 5728, 128, 127, 5729, 176, 196, 5730, 589, 592, 5731, 5732, 338, 5640, 5733, 5627, 282, 272, 5733, 282, 5734, 5735, 268, 5736, 238, 231, 238, 5736, 239, 5737, 241, 204, 5698, 305, 5689, 741, 740, 5738, 5737, 204, 5627, 5712, 239, 5736, 5739, 187, 5628, 272, 5710, 5733, 5740, 371, 5697, 371, 5740, 592, 5704, 748, 749, 5741, 5620, 5639, 5742, 196, 194, 5743, 5564, 5643, 5731, 592, 5740, 258, 5722, 5725, 5744, 176, 5730, 5744, 5728, 176, 5641, 268, 5735, 401, 5693, 402, 2796, 5745, 2793, 5703, 643, 645, 2796, 5622, 5745, 285, 5723, 5644, 5746, 5742, 194, 970, 5747, 5748, 5748, 300, 970, 570, 567, 5705, 545, 5705, 567, 5686, 5687, 547, 301, 5748, 740, 301, 300, 5748, 336, 5696, 5749, 5750, 350, 5749, 5749, 296, 298, 336, 5749, 298, 5749, 766, 296, 5749, 350, 766, 305, 5699, 520, 305, 5698, 5699, 307, 5689, 303, 377, 520, 5699, 5751, 307, 5738, 175, 5645, 5685, 136, 135, 5752, 742, 5704, 5678, 5646, 5753, 582, 5754, 639, 630, 647, 639, 5754, 5703, 5755, 346, 5648, 5707, 379, 5700, 591, 5659, 730, 647, 5754, 5695, 335, 5755, 335, 346, 5755, 630, 5700, 5754, 127, 185, 5756, 185, 188, 5756, 235, 5757, 230, 242, 241, 5758, 355, 5654, 5726, 5623, 5759, 2798, 5622, 5759, 5760, 2798, 5759, 5622, 236, 230, 5757, 159, 5761, 200, 307, 306, 5738, 350, 5762, 326, 5762, 327, 326, 5763, 149, 187, 5761, 159, 158, 327, 5762, 5717, 3579, 5764, 5765, 5765, 275, 3579, 5766, 212, 211, 5759, 5623, 5716, 1014, 5767, 5657, 1014, 5651, 5767, 5626, 242, 5758, 227, 236, 5768, 5768, 231, 227, 5769, 171, 5721, 191, 5770, 5718, 5569, 5565, 5771, 5771, 5565, 5564, 5772, 5719, 5647, 5719, 312, 5647, 571, 570, 5773, 5646, 571, 5773, 152, 5774, 150, 155, 150, 5774, 167, 5711, 5665, 5661, 5775, 261, 5761, 5724, 200, 970, 5632, 5776, 5564, 5743, 5771, 5766, 5631, 212, 5667, 404, 5777, 5763, 5629, 149, 5635, 5778, 2997, 5779, 254, 261, 209, 254, 5779, 5747, 970, 5776, 306, 758, 5738, 323, 5670, 5691, 5710, 271, 5669, 5638, 209, 5779, 5669, 283, 5780, 5780, 283, 275, 5757, 235, 5636, 5781, 706, 5650, 704, 706, 5781, 5670, 5637, 5782, 2997, 5778, 5783, 5783, 3000, 2997, 5645, 177, 5728, 5784, 5734, 268, 3000, 5783, 5671, 5713, 289, 5671, 5785, 240, 3388, 5784, 233, 214, 5784, 268, 233, 5784, 214, 216, 240, 5785, 202, 5780, 275, 5765, 127, 5756, 5729, 3388, 5786, 5785, 5758, 241, 5737, 5776, 5673, 5672, 5787, 704, 5781, 307, 5751, 5689, 312, 5788, 5701, 5720, 5788, 312, 5712, 5736, 5789, 187, 5739, 5763, 5756, 188, 5790, 5791, 5635, 5792, 5635, 202, 5792, 5792, 202, 5785, 5736, 231, 5768, 5793, 5780, 5765, 5794, 194, 193, 5675, 582, 5753, 5775, 5779, 261, 5770, 191, 5727, 193, 5795, 5794, 3579, 5676, 5764, 5569, 5771, 5639, 5750, 5762, 350, 5796, 236, 5757, 5727, 155, 5774, 5774, 152, 5797, 5746, 194, 5794, 136, 5752, 5798, 5799, 169, 171, 5663, 5800, 5599, 169, 5799, 193, 5800, 5677, 5599, 5801, 3388, 5725, 5659, 589, 5731, 211, 5660, 5802, 171, 5769, 5799, 5790, 188, 5718, 216, 5631, 5784, 5761, 158, 5803, 5797, 152, 5668, 5680, 5711, 123, 135, 5804, 5752, 5656, 5804, 129, 193, 5799, 5795, 3388, 5801, 5786, 135, 129, 5804, 5673, 5681, 5805, 5632, 5673, 5776, 5682, 5670, 5782, 5693, 401, 5667, 751, 5777, 404, 5620, 5741, 5684, 5651, 2793, 5745, 5624, 5684, 5716, 5760, 5745, 5622, 5802, 5766, 211, 5626, 5806, 250, 236, 5796, 5768, 5715, 5803, 158, 250, 5806, 5679, 5663, 136, 5798, 5705, 5773, 570, 5749, 5762, 5750, 5648, 377, 5699, 5738, 758, 741, };
[ "marcdion1974@gmail.com" ]
marcdion1974@gmail.com
cf6a24ef1cf925b7b68d12913123344aef023a22
c17e73ccda58f273af64d6a2bb5fcc9d7631a133
/EX1/code/lines_Strip.cpp
3b2338dd0adc6ef00f41f6772f2e90310fe1641d
[]
no_license
Gokhulnath/GM-LAB
462986ce70fb3da0833d736e1e0af36700746025
3c3850f2afa6a6198c05daa56819a42d93227c2c
refs/heads/main
2023-07-05T04:19:35.352326
2021-08-05T19:36:24
2021-08-05T19:36:24
387,596,942
0
0
null
null
null
null
UTF-8
C++
false
false
671
cpp
#include<windows.h> #include<stdio.h> #include<gl/glut.h> void myInit() { glClearColor(1.0, 1.0, 1.0, 0.0); glColor3f(0.0f, 0.0f, 0.0f); glPointSize(10); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0.0, 640.0, 0.0, 480.0); } void myDisplay() { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_LINE_STRIP); glVertex2f(0, 0); glVertex2f(50, 100); glVertex2f(50, 100); glVertex2f(100, 0); glEnd(); glFlush(); } int main(int argc, char* argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(640, 480); glutCreateWindow("First Exercise"); glutDisplayFunc(myDisplay); myInit(); glutMainLoop(); return 1; }
[ "gokhulnath18051@cse.ssn.edu.in" ]
gokhulnath18051@cse.ssn.edu.in
5afb0be584eb8ca4c768de5e4ebc078ef58802ae
120f50ad80c0f60a659dafb6a09ff2cf31021c16
/client/SWGVideo.cpp
616cc2e2c3495e9b19ad875ccd284acc7c1d6f17
[]
no_license
knetikmedia/knetikcloud-qt5cpp-client
72dc0d1d7cbdf7536021cf546e347885497a1973
cfad9f29a82a513941c0eb8fb2a82c18d16a24dc
refs/heads/master
2021-01-23T06:35:36.976006
2017-03-27T20:52:02
2017-03-27T20:52:02
86,382,081
0
0
null
null
null
null
UTF-8
C++
false
false
11,769
cpp
/** * Knetik Platform API Documentation latest * This is the spec for the Knetik API. Use this in conjunction with the documentation found at https://knetikcloud.com * * OpenAPI spec version: latest * Contact: support@knetik.com * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ #include "SWGVideo.h" #include "SWGHelpers.h" #include <QJsonDocument> #include <QJsonArray> #include <QObject> #include <QDebug> namespace Swagger { SWGVideo::SWGVideo(QString* json) { init(); this->fromJson(*json); } SWGVideo::SWGVideo() { init(); } SWGVideo::~SWGVideo() { this->cleanup(); } void SWGVideo::init() { active = false; author = new SWGArtist(); authored = 0L; banned = false; category_id = new QString(""); category_name = new QString(""); contributors = new SWGCollection«VideoContribution»(); created = 0L; embed = new QString(""); extension = new QString(""); height = 0; id = 0L; length = 0; location = new QString(""); long_description = new QString(""); mime_type = new QString(""); name = new QString(""); priority = 0; privacy = new QString(""); published = false; short_description = new QString(""); size = 0L; tags = new QList<SWGVideoTag*>(); thumbnail = new QString(""); updated = 0L; uploader = new SWGUser(); views = 0L; whitelist = new QList<SWGUser*>(); width = 0; } void SWGVideo::cleanup() { if(author != nullptr) { delete author; } if(category_id != nullptr) { delete category_id; } if(category_name != nullptr) { delete category_name; } if(contributors != nullptr) { delete contributors; } if(embed != nullptr) { delete embed; } if(extension != nullptr) { delete extension; } if(location != nullptr) { delete location; } if(long_description != nullptr) { delete long_description; } if(mime_type != nullptr) { delete mime_type; } if(name != nullptr) { delete name; } if(privacy != nullptr) { delete privacy; } if(short_description != nullptr) { delete short_description; } if(tags != nullptr) { QList<SWGVideoTag*>* arr = tags; foreach(SWGVideoTag* o, *arr) { delete o; } delete tags; } if(thumbnail != nullptr) { delete thumbnail; } if(uploader != nullptr) { delete uploader; } if(whitelist != nullptr) { QList<SWGUser*>* arr = whitelist; foreach(SWGUser* o, *arr) { delete o; } delete whitelist; } } SWGVideo* SWGVideo::fromJson(QString &json) { QByteArray array (json.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); this->fromJsonObject(jsonObject); return this; } void SWGVideo::fromJsonObject(QJsonObject &pJson) { ::Swagger::setValue(&active, pJson["active"], "bool", ""); ::Swagger::setValue(&author, pJson["author"], "SWGArtist", "SWGArtist"); ::Swagger::setValue(&authored, pJson["authored"], "qint64", ""); ::Swagger::setValue(&banned, pJson["banned"], "bool", ""); ::Swagger::setValue(&category_id, pJson["category_id"], "QString", "QString"); ::Swagger::setValue(&category_name, pJson["category_name"], "QString", "QString"); ::Swagger::setValue(&contributors, pJson["contributors"], "SWGCollection«VideoContribution»", "SWGCollection«VideoContribution»"); ::Swagger::setValue(&created, pJson["created"], "qint64", ""); ::Swagger::setValue(&embed, pJson["embed"], "QString", "QString"); ::Swagger::setValue(&extension, pJson["extension"], "QString", "QString"); ::Swagger::setValue(&height, pJson["height"], "qint32", ""); ::Swagger::setValue(&id, pJson["id"], "qint64", ""); ::Swagger::setValue(&length, pJson["length"], "qint32", ""); ::Swagger::setValue(&location, pJson["location"], "QString", "QString"); ::Swagger::setValue(&long_description, pJson["long_description"], "QString", "QString"); ::Swagger::setValue(&mime_type, pJson["mime_type"], "QString", "QString"); ::Swagger::setValue(&name, pJson["name"], "QString", "QString"); ::Swagger::setValue(&priority, pJson["priority"], "qint32", ""); ::Swagger::setValue(&privacy, pJson["privacy"], "QString", "QString"); ::Swagger::setValue(&published, pJson["published"], "bool", ""); ::Swagger::setValue(&short_description, pJson["short_description"], "QString", "QString"); ::Swagger::setValue(&size, pJson["size"], "qint64", ""); ::Swagger::setValue(&tags, pJson["tags"], "QList", "SWGVideoTag"); ::Swagger::setValue(&thumbnail, pJson["thumbnail"], "QString", "QString"); ::Swagger::setValue(&updated, pJson["updated"], "qint64", ""); ::Swagger::setValue(&uploader, pJson["uploader"], "SWGUser", "SWGUser"); ::Swagger::setValue(&views, pJson["views"], "qint64", ""); ::Swagger::setValue(&whitelist, pJson["whitelist"], "QList", "SWGUser"); ::Swagger::setValue(&width, pJson["width"], "qint32", ""); } QString SWGVideo::asJson () { QJsonObject* obj = this->asJsonObject(); QJsonDocument doc(*obj); QByteArray bytes = doc.toJson(); return QString(bytes); } QJsonObject* SWGVideo::asJsonObject() { QJsonObject* obj = new QJsonObject(); obj->insert("active", QJsonValue(active)); toJsonValue(QString("author"), author, obj, QString("SWGArtist")); obj->insert("authored", QJsonValue(authored)); obj->insert("banned", QJsonValue(banned)); toJsonValue(QString("category_id"), category_id, obj, QString("QString")); toJsonValue(QString("category_name"), category_name, obj, QString("QString")); toJsonValue(QString("contributors"), contributors, obj, QString("SWGCollection«VideoContribution»")); obj->insert("created", QJsonValue(created)); toJsonValue(QString("embed"), embed, obj, QString("QString")); toJsonValue(QString("extension"), extension, obj, QString("QString")); obj->insert("height", QJsonValue(height)); obj->insert("id", QJsonValue(id)); obj->insert("length", QJsonValue(length)); toJsonValue(QString("location"), location, obj, QString("QString")); toJsonValue(QString("long_description"), long_description, obj, QString("QString")); toJsonValue(QString("mime_type"), mime_type, obj, QString("QString")); toJsonValue(QString("name"), name, obj, QString("QString")); obj->insert("priority", QJsonValue(priority)); toJsonValue(QString("privacy"), privacy, obj, QString("QString")); obj->insert("published", QJsonValue(published)); toJsonValue(QString("short_description"), short_description, obj, QString("QString")); obj->insert("size", QJsonValue(size)); QJsonArray tagsJsonArray; toJsonArray((QList<void*>*)tags, &tagsJsonArray, "tags", "SWGVideoTag"); obj->insert("tags", tagsJsonArray); toJsonValue(QString("thumbnail"), thumbnail, obj, QString("QString")); obj->insert("updated", QJsonValue(updated)); toJsonValue(QString("uploader"), uploader, obj, QString("SWGUser")); obj->insert("views", QJsonValue(views)); QJsonArray whitelistJsonArray; toJsonArray((QList<void*>*)whitelist, &whitelistJsonArray, "whitelist", "SWGUser"); obj->insert("whitelist", whitelistJsonArray); obj->insert("width", QJsonValue(width)); return obj; } bool SWGVideo::getActive() { return active; } void SWGVideo::setActive(bool active) { this->active = active; } SWGArtist* SWGVideo::getAuthor() { return author; } void SWGVideo::setAuthor(SWGArtist* author) { this->author = author; } qint64 SWGVideo::getAuthored() { return authored; } void SWGVideo::setAuthored(qint64 authored) { this->authored = authored; } bool SWGVideo::getBanned() { return banned; } void SWGVideo::setBanned(bool banned) { this->banned = banned; } QString* SWGVideo::getCategoryId() { return category_id; } void SWGVideo::setCategoryId(QString* category_id) { this->category_id = category_id; } QString* SWGVideo::getCategoryName() { return category_name; } void SWGVideo::setCategoryName(QString* category_name) { this->category_name = category_name; } SWGCollection«VideoContribution»* SWGVideo::getContributors() { return contributors; } void SWGVideo::setContributors(SWGCollection«VideoContribution»* contributors) { this->contributors = contributors; } qint64 SWGVideo::getCreated() { return created; } void SWGVideo::setCreated(qint64 created) { this->created = created; } QString* SWGVideo::getEmbed() { return embed; } void SWGVideo::setEmbed(QString* embed) { this->embed = embed; } QString* SWGVideo::getExtension() { return extension; } void SWGVideo::setExtension(QString* extension) { this->extension = extension; } qint32 SWGVideo::getHeight() { return height; } void SWGVideo::setHeight(qint32 height) { this->height = height; } qint64 SWGVideo::getId() { return id; } void SWGVideo::setId(qint64 id) { this->id = id; } qint32 SWGVideo::getLength() { return length; } void SWGVideo::setLength(qint32 length) { this->length = length; } QString* SWGVideo::getLocation() { return location; } void SWGVideo::setLocation(QString* location) { this->location = location; } QString* SWGVideo::getLongDescription() { return long_description; } void SWGVideo::setLongDescription(QString* long_description) { this->long_description = long_description; } QString* SWGVideo::getMimeType() { return mime_type; } void SWGVideo::setMimeType(QString* mime_type) { this->mime_type = mime_type; } QString* SWGVideo::getName() { return name; } void SWGVideo::setName(QString* name) { this->name = name; } qint32 SWGVideo::getPriority() { return priority; } void SWGVideo::setPriority(qint32 priority) { this->priority = priority; } QString* SWGVideo::getPrivacy() { return privacy; } void SWGVideo::setPrivacy(QString* privacy) { this->privacy = privacy; } bool SWGVideo::getPublished() { return published; } void SWGVideo::setPublished(bool published) { this->published = published; } QString* SWGVideo::getShortDescription() { return short_description; } void SWGVideo::setShortDescription(QString* short_description) { this->short_description = short_description; } qint64 SWGVideo::getSize() { return size; } void SWGVideo::setSize(qint64 size) { this->size = size; } QList<SWGVideoTag*>* SWGVideo::getTags() { return tags; } void SWGVideo::setTags(QList<SWGVideoTag*>* tags) { this->tags = tags; } QString* SWGVideo::getThumbnail() { return thumbnail; } void SWGVideo::setThumbnail(QString* thumbnail) { this->thumbnail = thumbnail; } qint64 SWGVideo::getUpdated() { return updated; } void SWGVideo::setUpdated(qint64 updated) { this->updated = updated; } SWGUser* SWGVideo::getUploader() { return uploader; } void SWGVideo::setUploader(SWGUser* uploader) { this->uploader = uploader; } qint64 SWGVideo::getViews() { return views; } void SWGVideo::setViews(qint64 views) { this->views = views; } QList<SWGUser*>* SWGVideo::getWhitelist() { return whitelist; } void SWGVideo::setWhitelist(QList<SWGUser*>* whitelist) { this->whitelist = whitelist; } qint32 SWGVideo::getWidth() { return width; } void SWGVideo::setWidth(qint32 width) { this->width = width; } } /* namespace Swagger */
[ "shawn.stout@knetik.com" ]
shawn.stout@knetik.com
1d45fc0fec901bcde094cb4ad743159ca7f9e460
10aad6619640fbb68b1260d525e045c71a63089d
/mousegest.cpp
d7165950b19ce0de6604d71670ee04c4c74a3b6c
[]
no_license
sp001abv/MouseGestures
ba63de35df74ce6bbe6794eb001788054c37baea
307c2fdea7c960fe63ab69fba9e11f043174bb29
refs/heads/master
2021-07-26T01:13:18.918442
2020-12-18T14:27:13
2020-12-18T14:27:13
231,324,174
0
0
null
null
null
null
UTF-8
C++
false
false
7,562
cpp
#include <string.h> #include <cstdlib> #include <stdio.h> #include <errno.h> #include <unistd.h> //#include <linux/types.h> #include <linux/input.h> #include <fcntl.h> #include <pthread.h> #define UINPUT_IOCTL_BASE 'U' #define UI_DEV_CREATE _IO(UINPUT_IOCTL_BASE, 1) #define UI_DEV_DESTROY _IO(UINPUT_IOCTL_BASE, 2) #define UI_SET_EVBIT _IOW(UINPUT_IOCTL_BASE, 100, int) #define UI_SET_KEYBIT _IOW(UINPUT_IOCTL_BASE, 101, int) #define UI_SET_RELBIT _IOW(UINPUT_IOCTL_BASE, 102, int) #define UI_SET_ABSBIT _IOW(UINPUT_IOCTL_BASE, 103, int) #define UI_SET_MSCBIT _IOW(UINPUT_IOCTL_BASE, 104, int) #define UINPUT_MAX_NAME_SIZE 80 struct uinput_user_dev { char name[UINPUT_MAX_NAME_SIZE]; struct input_id id; __u32 ff_effects_max; __s32 absmax[ABS_MAX+1]; __s32 absmin[ABS_MAX+1]; __s32 absfuzz[ABS_MAX+1]; __s32 absflat[ABS_MAX+1]; }; //#define BTN_LEFT 272 //#define BTN_RIGHT 273 //#define BTN_MIDDLE 274 #define KEYCODE_SWITCH_APP 187 #define KEYCODE_HOME 3 #define REL_SCROLL 8 #define SEND_SYN send_event(EV_SYN, EV_SYN, EV_SYN) #define SEND_KEY(k, v) send_event(EV_KEY, k, v); SEND_SYN #define SEND_LEFT_KEY(v) SEND_KEY(BTN_LEFT, v) #define SEND_LEFT_KEY_DOWN SEND_LEFT_KEY(1) #define SEND_LEFT_KEY_UP SEND_LEFT_KEY(0) #define SEND_RIGHT_KEY(v) SEND_KEY(BTN_RIGHT, v) #define SEND_RIGHT_KEY_DOWN SEND_RIGHT_KEY(1) #define SEND_RIGHT_KEY_UP SEND_RIGHT_KEY(0) #define SEND_MIDDLE_KEY(v) SEND_KEY(BTN_MIDDLE, v) #define SEND_MIDDLE_KEY_DOWN SEND_MIDDLE_KEY(1) #define SEND_MIDDLE_KEY_UP SEND_MIDDLE_KEY(0) #define ACTION_NONE 0 #define ACTION_DOWN 1 #define ACTION_UP 2 #define ACTION_SCROLL 3 #define ACTION_CLICK 4 #define ACTION_DBLCLICK 5 #define ACTION_TOUCH 6 #define ACTION_SWITCH_APP 7 #define ACTION_KEY_SWITCH_APP 8 #define ACTION_HOME 9 #define ACTION_KEY_HOME 10 #define ACTION_EXPIRE_TIME 650 #define ACTION_RESET_TIME 500 #define DOWN_TRIGGER_TIME 800 #define SCROLL_TRIGGER_VALUE 2 int fd, action = ACTION_NONE; int left_key = 0; int middle_key = 0; int right_key = 0; __s32 scroll, action_x, action_y; unsigned int action_time = 0; timeval event_time; int running = 0; int moved(__s32 v, __s32 d) { return v > d || v < -d; } int moved(__s32 d) { return moved(action_x, d) || moved(action_y, d); } void send_event(__u16 type, __u16 code, __s32 value) { input_event event; event.time = event_time; event.type = type; event.code = code; event.value = value; write(fd, &event, sizeof(event)); } void* run(void *) { running = true; while (running){ if (action == ACTION_DOWN && action_time > DOWN_TRIGGER_TIME) { action = ACTION_TOUCH; SEND_LEFT_KEY_DOWN; //printf("down %d\n", action_time); } if (action == ACTION_KEY_SWITCH_APP || action == ACTION_KEY_HOME) { char command[32]; sprintf(command, "input keyevent %d", action == ACTION_KEY_HOME ? KEYCODE_HOME : KEYCODE_SWITCH_APP); system(command); action = ACTION_NONE; } usleep(40000); if (action_time < 40000) action_time += 40; //printf("action time %u\n", ms(time)); } return NULL; } int main(int argc, char *argv[]) { if (argc < 2) { printf("ver 1.2\n"); printf("usage: %s /dev/input/event\n", argv[0]); return 1; } const char * event = argv[1]; const char * dev = "/dev/uinput"; int fe = open(event, O_RDONLY); if (fe < 0) { printf("%s: %s\n", event, strerror(errno)); return 1; } uinput_user_dev device; memset(&device, 0, sizeof(device)); fd = open(dev, O_WRONLY | O_NONBLOCK); if (fd < 0) { printf("error %s: %s\n", dev, strerror(errno)); return 1; } strcpy(device.name,"mouse gestures"); device.id.bustype=BUS_USB; device.id.vendor=1; device.id.product=1; device.id.version=1; if (write(fd,&device,sizeof(device)) != sizeof(device)) { printf("error setup %s\n", strerror(errno)); return 1; } ioctl(fd,UI_SET_EVBIT, EV_SYN); ioctl(fd,UI_SET_EVBIT, EV_KEY); ioctl(fd,UI_SET_KEYBIT, BTN_LEFT); ioctl(fd,UI_SET_KEYBIT, BTN_RIGHT); ioctl(fd,UI_SET_KEYBIT, BTN_MIDDLE); ioctl(fd,UI_SET_EVBIT, EV_REL); ioctl(fd,UI_SET_RELBIT, REL_X); ioctl(fd,UI_SET_RELBIT, REL_Y); ioctl(fd,UI_SET_RELBIT, REL_SCROLL); ioctl(fd,UI_SET_EVBIT, EV_MSC); ioctl(fd,UI_SET_MSCBIT, EV_MSC); if (ioctl(fd,UI_DEV_CREATE) < 0) { printf("error UI_DEV_CREATE %s\n", strerror(errno)); return 1; } pthread_t t; pthread_create(&t, NULL, run, NULL); ioctl(fe, EVIOCGRAB, 1); input_event e; while(read(fe, &e, sizeof(input_event)) > 0) { event_time = e.time; if (e.code != REL_SCROLL || e.type != EV_REL) { write(fd, &e, sizeof(input_event)); if (e.type == EV_KEY) { if (e.code == BTN_LEFT) left_key = e.value; if (e.code == BTN_MIDDLE) middle_key = e.value; if (e.code == BTN_RIGHT) right_key = e.value; if (left_key && middle_key && right_key) break; } else if (e.type == EV_REL) { if (e.code == REL_X) action_x += e.value; if (e.code == REL_Y) action_y += e.value; if (action == ACTION_DOWN) { if (moved(2)) { action = ACTION_TOUCH; SEND_LEFT_KEY_DOWN; } } else if (action == ACTION_UP) { if (moved(action_y, 10)) { action = ACTION_NONE; action_time = ACTION_RESET_TIME; } else if (moved(action_x, 100)) { action = action_x > 0 ? ACTION_SWITCH_APP : ACTION_HOME; } } else if (action == ACTION_SWITCH_APP || action == ACTION_HOME) { if (moved(action_y, 10)) { action = ACTION_NONE; action_time = ACTION_RESET_TIME; } else if (action == ACTION_SWITCH_APP) { if (action_x < 0) { action = ACTION_KEY_SWITCH_APP; } } else if (action == ACTION_HOME) { if (action_x > 0) { action = ACTION_KEY_HOME; } } } } } else { __s32 s = e.value; int a = s > 0 ? ACTION_DOWN : ACTION_UP; if (action_time > ACTION_EXPIRE_TIME && action != ACTION_TOUCH) { action = a; action_time = 0; action_x = action_y = 0; scroll = s; //printf("action %d %u\n", action, action_time); } else if (action == ACTION_SCROLL) { //printf("s/z %u\n", action_time); action_time = 0; write(fd, &e, sizeof(input_event)); } else if (a == action) { scroll += s; if (scroll > SCROLL_TRIGGER_VALUE || scroll < -SCROLL_TRIGGER_VALUE) { //printf("scroll time %u scroll %d\n", action_time, scroll); action = ACTION_SCROLL; //e.value = scroll; write(fd, &e, sizeof(input_event)); } action_time = 0; } else if (a == ACTION_UP && action == ACTION_TOUCH) { action = ACTION_NONE; action_time = ACTION_RESET_TIME; SEND_LEFT_KEY_UP; //printf("up\n"); } else if (a == ACTION_UP && action == ACTION_DOWN) { action = ACTION_CLICK; SEND_LEFT_KEY_DOWN; SEND_LEFT_KEY_UP; //printf("click\n"); } else if (a == ACTION_DOWN && action == ACTION_CLICK) { action = ACTION_DBLCLICK; action_time = ACTION_RESET_TIME; SEND_LEFT_KEY_DOWN; SEND_LEFT_KEY_UP; //printf("dblclick\n"); } else if (a == ACTION_DOWN && action == ACTION_UP) { action = ACTION_NONE; action_time = ACTION_RESET_TIME; SEND_RIGHT_KEY_DOWN; SEND_RIGHT_KEY_UP; //printf("back\n"); } //printf("%u type=%d,code=%d,value=%d\n", ms(event_time), e.type, e.code, e.value); } } running = false; usleep(50000); ioctl(fe, EVIOCGRAB, 0); close(fe); ioctl(fd,UI_DEV_DESTROY); close(fd); }
[ "noreply@github.com" ]
sp001abv.noreply@github.com
d0fdd8a32a5320f530bf50ee4c04170a1ee4cb54
25e99a0af5751865bce1702ee85cc5c080b0715c
/c++/code/myserver/framework/net/runflag.h
6ae4098b0825c9ea031267740d7a1c4393d0a0bb
[]
no_license
jasonblog/note
215837f6a08d07abe3e3d2be2e1f183e14aa4a30
4471f95736c60969a718d854cab929f06726280a
refs/heads/master
2023-05-31T13:02:27.451743
2022-04-04T11:28:06
2022-04-04T11:28:06
35,311,001
130
67
null
2023-02-10T21:26:36
2015-05-09T02:04:40
C
UTF-8
C++
false
false
438
h
#ifndef RUNFLAG_H_ #define RUNFLAG_H_ // 服务器状态 enum ERunFlag { ERF_RUNTIME = 0, // 运行中 ERF_QUIT, // 退出 ERF_RELOAD, // 重新加载配置 }; // 控制服务器运行状态的类 class CRunFlag { public: CRunFlag(); ~CRunFlag(); void SetRunFlag(ERunFlag eRunFlag); bool CheckRunFlag(ERunFlag eRunFlag); protected: ERunFlag mRunFlag; }; #endif /* RUNFLAG_H_ */
[ "jason_yao" ]
jason_yao
efdf95e9c3defec8510d71d077f5add8526d778b
3ad968797a01a4e4b9a87e2200eeb3fb47bf269a
/Mixer/AudioDialog/AudioDialog/MixerCapsDlg.cpp
fa0c13769722441e537fa54245b0314621a017c5
[]
no_license
LittleDrogon/MFC-Examples
403641a1ae9b90e67fe242da3af6d9285698f10b
1d8b5d19033409cd89da3aba3ec1695802c89a7a
refs/heads/main
2023-03-20T22:53:02.590825
2020-12-31T09:56:37
2020-12-31T09:56:37
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,014
cpp
// ----------------------------------------------------------------------------- // MixerCapsDlg.cpp : implementation file // // Copyright (C) 2008 Peter C. Studt // // This software is provided 'as-is', without any express or implied // warranty. In no event will the author be held liable for any damages // arising from the use of this software. It can be redistributed and/or // modified under the terms of The Code Project Open License (CPOL) // // ----------------------------------------------------------------------------- #include "stdafx.h" #include "MixerCapsDlg.h" // ----------------------------------------------------------------------------- // CMixerCapsDlg dialog IMPLEMENT_DYNAMIC(CMixerCapsDlg, CDialog) // ----------------------------------------------------------------------------- CMixerCapsDlg::CMixerCapsDlg(CWnd* pParent /*=NULL*/) : CDialog(CMixerCapsDlg::IDD, pParent) , nWMID(0) , nWPID(0) , dwDriverVer(0) , szProdName(_T("")) , dwSupport(0) , dwDestCount(0) { nInitComplete = 0 ; } // ----------------------------------------------------------------------------- CMixerCapsDlg::~CMixerCapsDlg() { } // ----------------------------------------------------------------------------- void CMixerCapsDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_STATIC_WMD, WMID); DDX_Control(pDX, IDC_STATIC_WPID, WPID); DDX_Control(pDX, IDC_STATIC_DV, DriverVer); DDX_Control(pDX, IDC_STATIC_PROD_NAME, ProdName); DDX_Control(pDX, IDC_STATIC_SUPPORT, Support); DDX_Control(pDX, IDC_STATIC_N_DESTS, DestCount); DDX_Text(pDX, IDC_STATIC_WMD, nWMID); DDX_Text(pDX, IDC_STATIC_WPID, nWPID); DDX_Text(pDX, IDC_STATIC_DV, dwDriverVer); DDX_Text(pDX, IDC_STATIC_PROD_NAME, szProdName); DDX_Text(pDX, IDC_STATIC_SUPPORT, dwSupport); DDX_Text(pDX, IDC_STATIC_N_DESTS, dwDestCount); } // ----------------------------------------------------------------------------- BEGIN_MESSAGE_MAP(CMixerCapsDlg, CDialog) ON_WM_CREATE() ON_WM_DESTROY() END_MESSAGE_MAP() // ----------------------------------------------------------------------------- // Set the data display fields with the passed MIXERCAPS structure data int CMixerCapsDlg::SetDisplayValues(MIXERCAPS* MixerCaps) { nWMID = MixerCaps->wMid ; nWPID = MixerCaps->wPid ; dwDriverVer = MixerCaps->vDriverVersion ; szProdName = MixerCaps->szPname ; dwSupport = MixerCaps->fdwSupport ; dwDestCount = MixerCaps->cDestinations ; if( nInitComplete ) UpdateData( FALSE ) ; return 0; } // ----------------------------------------------------------------------------- int CMixerCapsDlg::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDialog::OnCreate(lpCreateStruct) == -1) return -1; nInitComplete = 1 ; return 0; } // ----------------------------------------------------------------------------- void CMixerCapsDlg::OnDestroy() { CDialog::OnDestroy(); nInitComplete = 0 ; } // -----------------------------------------------------------------------------
[ "pkedpekr@gmail.com" ]
pkedpekr@gmail.com
1876034dc831ec482061c0176db2c01899b79d98
98b1e51f55fe389379b0db00365402359309186a
/homework_6/problem_2/100x100/0.762/U
2eea6cd8fc94f332e6c7a58e3c0f7078719efa6f
[]
no_license
taddyb/597-009
f14c0e75a03ae2fd741905c4c0bc92440d10adda
5f67e7d3910e3ec115fb3f3dc89a21dcc9a1b927
refs/heads/main
2023-01-23T08:14:47.028429
2020-12-03T13:24:27
2020-12-03T13:24:27
311,713,551
1
0
null
null
null
null
UTF-8
C++
false
false
1,147
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 8 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0.762"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (2 2 0); boundaryField { left { type fixedValue; value uniform (2 2 0); } right { type zeroGradient; } up { type zeroGradient; } down { type fixedValue; value uniform (2 2 0); } frontAndBack { type empty; } } // ************************************************************************* //
[ "tbindas@pop-os.localdomain" ]
tbindas@pop-os.localdomain
683fb9ed802cdf4e02ccd419aaf37ae7a54ca13f
0b894b69abb2588aed52669173fb789a035f4bed
/Number Patterns/problem13.cpp
d42ec9c590f2402d0468a2dee211cf0b8e5dec06
[]
no_license
ArjunAranetaCodes/MoreCodes-CPlusPlus
038747816df23c7cea5e6196aaa51f86d8a098a7
57ec539f4b28efb77ed8a4802999531079afbaa2
refs/heads/master
2021-05-02T11:02:46.867556
2018-10-10T04:00:00
2018-10-06T12:42:59
50,581,752
2
0
null
null
null
null
UTF-8
C++
false
false
405
cpp
/* Problem 13: Write a program to print the pattern of asterisks using loop. * ** *** **** ***** **** *** ** * */ #include<iostream> using namespace std; int main(){ int row = 5; for(int y = 0; y <= row; y++){ for(int x = 0; x < y; x++){ cout << "*"; } cout << endl; } for(int y = row - 1; y > 0; y--){ for(int x = 0; x < y; x++){ cout << "*"; } cout << endl; } return 0; }
[ "arjunaraneta@gmail.com" ]
arjunaraneta@gmail.com
5a955a35ed6a91ea5d1e3c436ac7082146948592
0c067663385922b0bf86cca2dc38108acdfdf0bc
/include/utmatrix.h
6aa9452002960bc5f775da27e3001d7aa063fc6d
[]
no_license
Romka678/Laba-2
7583bc76149f3137c87a5ee624b447066fd5a891
c998556c9da4bb7cbc287154ca5b90c71cc1c109
refs/heads/master
2021-08-28T21:51:24.100934
2017-11-08T17:10:01
2017-11-08T17:10:01
108,313,589
0
0
null
null
null
null
UTF-8
C++
false
false
9,379
h
// ННГУ, ВМК, Курс "Методы программирования-2", С++, ООП // // utmatrix.h - Copyright (c) Гергель В.П. 07.05.2001 // Переработано для Microsoft Visual Studio 2008 Сысоевым А.В. (21.04.2015) // // Верхнетреугольная матрица - реализация на основе шаблона вектора #ifndef __TMATRIX_H__ #define __TMATRIX_H__ #include <iostream> using namespace std; const int MAX_VECTOR_SIZE = 100000000; const int MAX_MATRIX_SIZE = 10000; // Шаблон вектора template <class ValType> class TVector { protected: ValType *pVector; int Size; // размер вектора int StartIndex; // индекс первого элемента вектора public: TVector(int s = 10, int si = 0); TVector(const TVector &v); // конструктор копирования ~TVector(); int GetSize() { return Size; } // размер вектора int GetStartIndex() { return StartIndex; } // индекс первого элемента ValType& operator[](int pos); // доступ bool operator==(const TVector &v) const; // сравнение bool operator!=(const TVector &v) const; // сравнение TVector& operator=(const TVector &v); // присваивание // скалярные операции TVector operator+(const ValType &val); // прибавить скаляр TVector operator-(const ValType &val); // вычесть скаляр TVector operator*(const ValType &val); // умножить на скаляр // векторные операции TVector operator+(const TVector &v); // сложение TVector operator-(const TVector &v); // вычитание ValType operator*(const TVector &v); // скалярное произведение // ввод-вывод friend istream& operator>>(istream &in, TVector &v) { for (int i = 0; i < v.Size; i++) in >> v.pVector[i]; return in; } friend ostream& operator<<(ostream &out, const TVector &v) { for (int i = 0; i < v.Size; i++) out << v.pVector[i] << ' '; return out; } }; template <class ValType> TVector<ValType>::TVector(int s, int si) { if ((s > MAX_VECTOR_SIZE) || (s < 0)) throw("Error"); if((si > MAX_VECTOR_SIZE) || (si < 0)) throw("Error"); Size = s; StartIndex = si; pVector = new ValType[Size]; } /*-------------------------------------------------------------------------*/ template <class ValType> //конструктор копирования TVector<ValType>::TVector(const TVector<ValType> &v) { Size = v.Size; StartIndex = v.StartIndex; pVector = new ValType[v.Size]; for (int i = 0; i < Size; i++) pVector[i] = v.pVector[i]; } /*-------------------------------------------------------------------------*/ template <class ValType> TVector<ValType>::~TVector() { delete[] pVector; } /*-------------------------------------------------------------------------*/ template <class ValType> // доступ ValType& TVector<ValType>::operator[](int pos) { if ((pos > Size + StartIndex) || (pos < 0)) throw("Error"); return pVector[pos - StartIndex]; } /*-------------------------------------------------------------------------*/ template <class ValType> // сравнение bool TVector<ValType>::operator==(const TVector &v) const { bool k = true; if (this->Size != v.Size) return false; else { for (int i = 0; (i < this->Size) && (k); i++) if (this->pVector[i] != v.pVector[i]) k = false; } return k; } /*-------------------------------------------------------------------------*/ template <class ValType> // сравнение bool TVector<ValType>::operator!=(const TVector &v) const { return !(*this == v); } /*-------------------------------------------------------------------------*/ template <class ValType> // присваивание TVector<ValType>& TVector<ValType>::operator=(const TVector &v) { if (this != &v) { if (Size != v.Size) { delete[]pVector; pVector = new ValType[v.Size]; } Size = v.Size; StartIndex = v.StartIndex; for (int i = 0; i <Size; i++) pVector[i] = v.pVector[i]; } return *this; } /*-------------------------------------------------------------------------*/ template <class ValType> // прибавить скаляр TVector<ValType> TVector<ValType>::operator+(const ValType &val) { TVector z(Size, StartIndex); for (int i = 0; i < Size; i++) z.pVector[i] = pVector[i] + val; return z; } /*-------------------------------------------------------------------------*/ template <class ValType> // вычесть скаляр TVector<ValType> TVector<ValType>::operator-(const ValType &val) { TVector z(Size, StartIndex); for (int i = 0; i < Size; i++) z.pVector[i] = pVector[i] - val; return z; } /*-------------------------------------------------------------------------*/ template <class ValType> // умножить на скаляр TVector<ValType> TVector<ValType>::operator*(const ValType &val) { TVector z(Size, StartIndex); for (int i = 0; i < Size; i++) z.pVector[i] = pVector[i] * val; return z; } /*-------------------------------------------------------------------------*/ template <class ValType> // сложение TVector<ValType> TVector<ValType>::operator+(const TVector<ValType> &v) { if (Size != v.Size) throw("Error"); TVector z(Size, StartIndex); for (int i = 0; i <Size; i++) z.pVector[i] = this->pVector[i] + v.pVector[i]; return z; } /*-------------------------------------------------------------------------*/ template <class ValType> // вычитание TVector<ValType> TVector<ValType>::operator-(const TVector<ValType> &v) { if (Size != v.Size) throw("Error"); TVector z(Size, StartIndex); for (int i = 0; i <Size; i++) z.pVector[i] = this->pVector[i] - v.pVector[i]; return z; } /*-------------------------------------------------------------------------*/ template <class ValType> // скалярное произведение ValType TVector<ValType>::operator*(const TVector<ValType> &v) { if (Size != v.Size) throw("Error"); ValType F = 0; for (int i = 0; i < Size; i++) { F = F + (this->pVector[i] * v.pVector[i]); } return F; } /*-------------------------------------------------------------------------*/ // Верхнетреугольная матрица template <class ValType> class TMatrix : public TVector<TVector<ValType> > { public: TMatrix(int s = 10); TMatrix(const TMatrix &mt); // копирование TMatrix(const TVector<TVector<ValType> > &mt); // преобразование типа bool operator==(const TMatrix &mt) const; // сравнение bool operator!=(const TMatrix &mt) const; // сравнение TMatrix& operator= (const TMatrix &mt); // присваивание TMatrix operator+ (const TMatrix &mt); // сложение TMatrix operator- (const TMatrix &mt); // вычитание // ввод / вывод friend istream& operator>>(istream &in, TMatrix &mt) { for (int i = 0; i < mt.Size; i++) in >> mt.pVector[i]; return in; } friend ostream & operator<<(ostream &out, const TMatrix &mt) { for (int i = 0; i < mt.Size; i++) out << mt.pVector[i] << endl; return out; } }; template <class ValType> TMatrix<ValType>::TMatrix(int s) : TVector<TVector<ValType> >(s) { if ((s > MAX_MATRIX_SIZE) || (s < 0)) throw("Error"); for (int i = 0; i < s; i++) pVector[i] = TVector<ValType>(s - i, i); } /*-------------------------------------------------------------------------*/ template <class ValType> // конструктор копирования TMatrix<ValType>::TMatrix(const TMatrix<ValType> &mt) : TVector<TVector<ValType> >(mt) {} template <class ValType> // конструктор преобразования типа TMatrix<ValType>::TMatrix(const TVector<TVector<ValType> > &mt) : TVector<TVector<ValType> >(mt) {} template <class ValType> // сравнение bool TMatrix<ValType>::operator==(const TMatrix<ValType> &mt) const { return TVector<TVector<ValType>>::operator==(mt); } /*-------------------------------------------------------------------------*/ template <class ValType> // сравнение bool TMatrix<ValType>::operator!=(const TMatrix<ValType> &mt) const { return !(*this == mt); } /*-------------------------------------------------------------------------*/ template <class ValType> // присваивание TMatrix<ValType>& TMatrix<ValType>::operator=(const TMatrix<ValType> &mt) { TVector <TVector<ValType>>::operator=(mt); return *this; } /*-------------------------------------------------------------------------*/ template <class ValType> // сложение TMatrix<ValType> TMatrix<ValType>::operator+(const TMatrix<ValType> &mt) { if (Size != mt.Size) throw("Error"); return TVector<TVector<ValType>>::operator+(mt); } /*-------------------------------------------------------------------------*/ template <class ValType> // вычитание TMatrix<ValType> TMatrix<ValType>::operator-(const TMatrix<ValType> &mt) { return TVector<TVector<ValType> >::operator-(mt); } /*-------------------------------------------------------------------------*/ // TVector О3 Л2 П4 С6 // TMatrix О2 Л2 П3 С3 #endif
[ "viat4anin@gmail.com" ]
viat4anin@gmail.com
566977fd2cc81853531ffc54cd679f1f15187386
faf1dcdfd557c10f5bc250d6935e9b36687ec6f9
/src/cpp/ee/ads/internal/GuardedBannerAd.cpp
03d3d3e833fa7d778fc36596316c1e65cdf320f0
[ "MIT" ]
permissive
ndpduc/ee-x
3ead7e6a6285532b6c42dc412b53b76f27bc25ad
1de6dad6c52a1c9a1f5798b48b9c1dee34ac1ead
refs/heads/master
2023-04-19T23:51:04.325853
2021-05-06T11:31:25
2021-05-06T11:31:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,335
cpp
#include "ee/ads/internal/GuardedBannerAd.hpp" #include <ee/core/ObserverHandle.hpp> #include <ee/core/Task.hpp> namespace ee { namespace ads { using Self = GuardedBannerAd; Self::GuardedBannerAd(const std::shared_ptr<IBannerAd>& ad) : ad_(ad) { loading_ = false; loaded_ = false; handle_ = std::make_unique<ObserverHandle>(); handle_->bind(*ad_).addObserver({ .onLoaded = [this] { // Propagation. dispatchEvent([](auto&& observer) { if (observer.onLoaded) { observer.onLoaded(); } }); }, .onLoadResult = [this](const AdLoadResult& result) { // Propagation. dispatchEvent([result](auto&& observer) { if (observer.onLoadResult) { observer.onLoadResult(result); } }); }, .onClicked = [this] { // Propagation. dispatchEvent([](auto&& observer) { if (observer.onClicked) { observer.onClicked(); } }); }, }); } Self::~GuardedBannerAd() = default; void Self::destroy() { ad_->destroy(); handle_->clear(); } bool Self::isLoaded() const { return loaded_; } Task<bool> Self::load() { if (loaded_) { co_return true; } if (loading_) { // Waiting. co_return co_await ad_->load(); } loading_ = true; loaded_ = co_await ad_->load(); loading_ = false; co_return loaded_; } std::pair<float, float> Self::getAnchor() const { return ad_->getAnchor(); } void Self::setAnchor(float x, float y) { ad_->setAnchor(x, y); } std::pair<float, float> Self::getPosition() const { return ad_->getPosition(); } void Self::setPosition(float x, float y) { ad_->setPosition(x, y); } std::pair<float, float> Self::getSize() const { return ad_->getSize(); } void Self::setSize(float width, float height) { ad_->setSize(width, height); } bool Self::isVisible() const { return ad_->isVisible(); } void Self::setVisible(bool visible) { ad_->setVisible(visible); } } // namespace ads } // namespace ee
[ "enrevol@gmail.com" ]
enrevol@gmail.com
d38bac501fb4d2448c49eb518bf595b6f5eb8338
64fc3ea804dfa043cdb05ddc323ebad73150a5ee
/src/intelligence/posetracking/positiontracker.hpp
c081510b71d128bc42319ab53b4887017258015e
[]
no_license
avinashjavaji/igvc-software
697f097cad312b182b9b243fedd3c65eca1e517e
288503cb7a429488c833d1596b50d0e25ad796ef
refs/heads/master
2020-12-25T10:14:19.533404
2015-01-29T00:04:21
2015-01-29T00:04:21
null
0
0
null
null
null
null
UTF-8
C++
false
false
706
hpp
#ifndef POSITIONTRACKER_HPP #define POSITIONTRACKER_HPP #include <common/module.hpp> #include <common/datastructures/IMUData.hpp> #include <common/datastructures/GPSData.hpp> #include <common/datastructures/robotposition.hpp> class PositionTracker : public Module { Q_OBJECT public: PositionTracker() { } virtual ~PositionTracker() { } virtual void Reset() = 0; virtual const RobotPosition &GetPosition() = 0; virtual const GPSData &GetOrigin() = 0; signals: void onNewPosition(const RobotPosition &); void onOriginPercentage(int); public slots: virtual void onIMUData(IMUData) = 0; virtual void onGPSData(const GPSData &) = 0; }; #endif // POSITIONTRACKER_HPP
[ "matthew.barulic@gmail.com" ]
matthew.barulic@gmail.com
efccea971b48de958f76e1c7c4cebf1442ee770b
8f18828d34a770523fd0f3bd562d7d1b0e9ace24
/Abdul_bari_Sir_C++/LeetCodeProblems/Candy.cpp
45b686d1766675b579cc38aa4a7afd867daf4109
[]
no_license
Tushar-99/Data-Structure
8b161852f7f9a845f373e1672ce6b842588d0fca
519620b16c8cdf78ec8e2567779c3290efe04ab8
refs/heads/main
2023-07-17T13:12:27.563438
2021-08-30T05:10:42
2021-08-30T05:10:42
341,862,049
0
0
null
null
null
null
UTF-8
C++
false
false
3,226
cpp
public class Solution { public int candy(int[] ratings) { int[] candies = new int[ratings.length]; Arrays.fill(candies, 1); boolean flag = true; int sum = 0; while (flag) { flag = false; for (int i = 0; i < ratings.length; i++) { if (i != ratings.length - 1 && ratings[i] > ratings[i + 1] && candies[i] <= candies[i + 1]) { candies[i] = candies[i + 1] + 1; flag = true; } if (i > 0 && ratings[i] > ratings[i - 1] && candies[i] <= candies[i - 1]) { candies[i] = candies[i - 1] + 1; flag = true; } } } for (int candy : candies) { sum += candy; } return sum; } } public class Solution { public int candy(int[] ratings) { int sum = 0; int[] left2right = new int[ratings.length]; int[] right2left = new int[ratings.length]; Arrays.fill(left2right, 1); Arrays.fill(right2left, 1); for (int i = 1; i < ratings.length; i++) { if (ratings[i] > ratings[i - 1]) { left2right[i] = left2right[i - 1] + 1; } } for (int i = ratings.length - 2; i >= 0; i--) { if (ratings[i] > ratings[i + 1]) { right2left[i] = right2left[i + 1] + 1; } } for (int i = 0; i < ratings.length; i++) { sum += Math.max(left2right[i], right2left[i]); } return sum; } } public class Solution { public int candy(int[] ratings) { int[] candies = new int[ratings.length]; Arrays.fill(candies, 1); for (int i = 1; i < ratings.length; i++) { if (ratings[i] > ratings[i - 1]) { candies[i] = candies[i - 1] + 1; } } int sum = candies[ratings.length - 1]; for (int i = ratings.length - 2; i >= 0; i--) { if (ratings[i] > ratings[i + 1]) { candies[i] = Math.max(candies[i], candies[i + 1] + 1); } sum += candies[i]; } return sum; } } public class Solution { public int count(int n) { return (n * (n + 1)) / 2; } public int candy(int[] ratings) { if (ratings.length <= 1) { return ratings.length; } int candies = 0; int up = 0; int down = 0; int old_slope = 0; for (int i = 1; i < ratings.length; i++) { int new_slope = (ratings[i] > ratings[i - 1]) ? 1 : (ratings[i] < ratings[i - 1] ? -1 : 0); if ((old_slope > 0 && new_slope == 0) || (old_slope < 0 && new_slope >= 0)) { candies += count(up) + count(down) + Math.max(up, down); up = 0; down = 0; } if (new_slope > 0) up++; if (new_slope < 0) down++; if (new_slope == 0) candies++; old_slope = new_slope; } candies += count(up) + count(down) + Math.max(up, down) + 1; return candies; } }
[ "tushar99.tannu@gmail.com" ]
tushar99.tannu@gmail.com
2b0cd0b1af5146adb95bb1d4ae06fa2c091f9fc8
536656cd89e4fa3a92b5dcab28657d60d1d244bd
/chrome/browser/translate/chrome_translate_client.h
4ef593c489cdf92908ef84df32aeef2545cf8a3b
[ "BSD-3-Clause" ]
permissive
ECS-251-W2020/chromium
79caebf50443f297557d9510620bf8d44a68399a
ac814e85cb870a6b569e184c7a60a70ff3cb19f9
refs/heads/master
2022-08-19T17:42:46.887573
2020-03-18T06:08:44
2020-03-18T06:08:44
248,141,336
7
8
BSD-3-Clause
2022-07-06T20:32:48
2020-03-18T04:52:18
null
UTF-8
C++
false
false
5,662
h
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ #define CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ #include <memory> #include <string> #include "base/feature_list.h" #include "base/macros.h" #include "build/build_config.h" #include "chrome/browser/ui/translate/translate_bubble_model.h" #include "components/language/core/browser/url_language_histogram.h" #include "components/translate/content/browser/content_translate_driver.h" #include "components/translate/core/browser/translate_client.h" #include "components/translate/core/browser/translate_step.h" #include "components/translate/core/common/translate_errors.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" namespace content { class BrowserContext; class WebContents; } // namespace content class PrefService; namespace translate { class LanguageState; class TranslateAcceptLanguages; class TranslatePrefs; class TranslateManager; struct LanguageDetectionDetails; } // namespace translate enum class ShowTranslateBubbleResult; class ChromeTranslateClient : public translate::TranslateClient, public translate::ContentTranslateDriver::Observer, public content::WebContentsObserver, public content::WebContentsUserData<ChromeTranslateClient> { public: ~ChromeTranslateClient() override; // Gets the LanguageState associated with the page. translate::LanguageState& GetLanguageState(); // Returns the ContentTranslateDriver instance associated with this // WebContents. translate::ContentTranslateDriver* translate_driver() { return &translate_driver_; } // Helper method to return a new TranslatePrefs instance. static std::unique_ptr<translate::TranslatePrefs> CreateTranslatePrefs( PrefService* prefs); // Helper method to return the TranslateAcceptLanguages instance associated // with |browser_context|. static translate::TranslateAcceptLanguages* GetTranslateAcceptLanguages( content::BrowserContext* browser_context); // Helper method to return the TranslateManager instance associated with // |web_contents|, or NULL if there is no such associated instance. static translate::TranslateManager* GetManagerFromWebContents( content::WebContents* web_contents); // Gets |source| and |target| language for translation. void GetTranslateLanguages(content::WebContents* web_contents, std::string* source, std::string* target); // Gets the associated TranslateManager. translate::TranslateManager* GetTranslateManager(); // Gets the associated WebContents. Returns NULL if the WebContents is being // destroyed. content::WebContents* GetWebContents(); // TranslateClient implementation. translate::TranslateDriver* GetTranslateDriver() override; PrefService* GetPrefs() override; std::unique_ptr<translate::TranslatePrefs> GetTranslatePrefs() override; translate::TranslateAcceptLanguages* GetTranslateAcceptLanguages() override; #if defined(OS_ANDROID) std::unique_ptr<infobars::InfoBar> CreateInfoBar( std::unique_ptr<translate::TranslateInfoBarDelegate> delegate) const override; int GetInfobarIconID() const override; // Trigger a manual translation when the necessary state (e.g. source // language) is ready. void ManualTranslateWhenReady(); #endif void SetPredefinedTargetLanguage(const std::string& translate_language_code); bool ShowTranslateUI(translate::TranslateStep step, const std::string& source_language, const std::string& target_language, translate::TranslateErrors::Type error_type, bool triggered_from_menu) override; bool IsTranslatableURL(const GURL& url) override; void ShowReportLanguageDetectionErrorUI(const GURL& report_url) override; // ContentTranslateDriver::Observer implementation. void OnLanguageDetermined( const translate::LanguageDetectionDetails& details) override; private: explicit ChromeTranslateClient(content::WebContents* web_contents); friend class content::WebContentsUserData<ChromeTranslateClient>; FRIEND_TEST_ALL_PREFIXES(ChromeTranslateClientTest, LanguageEventShouldRecord); FRIEND_TEST_ALL_PREFIXES(ChromeTranslateClientTest, LanguageEventShouldNotRecord); FRIEND_TEST_ALL_PREFIXES(ChromeTranslateClientTest, TranslationEventShouldRecord); FRIEND_TEST_ALL_PREFIXES(ChromeTranslateClientTest, TranslationEventShouldNotRecord); // content::WebContentsObserver implementation. void WebContentsDestroyed() override; #if !defined(OS_ANDROID) // Shows the translate bubble. ShowTranslateBubbleResult ShowBubble( translate::TranslateStep step, const std::string& source_language, const std::string& target_language, translate::TranslateErrors::Type error_type); #endif translate::ContentTranslateDriver translate_driver_; std::unique_ptr<translate::TranslateManager> translate_manager_; #if defined(OS_ANDROID) // Whether to trigger a manual translation when ready. // See ChromeTranslateClient::ManualTranslateOnReady bool manual_translate_on_ready_ = false; #endif WEB_CONTENTS_USER_DATA_KEY_DECL(); DISALLOW_COPY_AND_ASSIGN(ChromeTranslateClient); }; #endif // CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_
[ "pcding@ucdavis.edu" ]
pcding@ucdavis.edu
9541a0a9097068adcefc6ba2770b8a21fb7755f9
37c4eef2f778788afebf37efe643dafefc290960
/Bitmanipulation/IncredibleHulk.cpp
3da9a7ec968e370141d1e63a233aaed0ee3a2478
[]
no_license
i-sushant/CP
27833b166923f6ce9f385e0f6b9b8c47c95017ab
fcc01898f8d254690ba9400c6a48e13b2f772b63
refs/heads/master
2022-11-24T16:22:24.194259
2020-07-28T08:39:21
2020-07-28T08:39:21
264,732,968
0
0
null
null
null
null
UTF-8
C++
false
false
190
cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; cout << __builtin_popcount(n) << endl; } }
[ "imsushant25@gmail.com" ]
imsushant25@gmail.com
fbc7a5f14c3598ad5df3ef0ff956f1223e3ac6a0
10f8237265db1392ed4c5bcc888f0cecb32a3e54
/src/cc/libkfsIO/NetErrorSimulator.h
02001c5e7c7421a135ade4b546232add8f31ac4b
[ "Apache-2.0" ]
permissive
jomie/kfs
c88f18334f9a4cf2a3dc4ce80f196e52304bfe9f
8bce116e87f31b1e91f75c09e8aec19c1cafffd4
refs/heads/master
2021-01-16T20:56:49.943904
2012-05-03T22:12:07
2012-05-03T22:12:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,160
h
//---------------------------------------------------------- -*- Mode: C++ -*- // $Id: NetErrorSimulator.h 1552 2011-01-06 22:21:54Z sriramr $ // // Created 2009/10/03 // // Copyright 2009 Quantcast Corp. // // This file is part of Kosmos File System (KFS). // // 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 NET_ERROR_SIMULATOR_H #define NET_ERROR_SIMULATOR_H namespace KFS { // Error simulation spec syntax: // sn=^[^:]*:30000$,pn=^[^:]*:20000$,a=rn+rd+wd+err+rst+rand+log,int=1,sleep|rsleep=2;<spec>;... // sn -- perl regex to match <ip>:<port> socket name returned by getsockname() // pn -- perl regex to match <ip>:<port> peer name returned by getpeername() // a -- action: // rn -- read none, disable read // rd -- read discard, discard input buffer data, doesn't disable read // wd -- write discard, disable write, discard output buffer data // err -- set poll error flag, reset all other flags // erd -- when read flag set, set poll error flag, reset all other flags // ewr -- when write flag set, set poll error flag, reset all other flags // rst -- close connection, call NetConnection::Close() // rand -- use random inteval from 0 to "int=" // exit -- call _exit(1) // abort -- call abort() // log -- emit log message when action performed // int=x -- action interval // sleep=x -- sleep for x seconds // rsleep=x -- sleep for random # of seconds in the range [0:x] // class NetManager; bool NetErrorSimulatorConfigure(NetManager& inNetManager, const char* inConfigPtr = 0); } #endif /* NET_ERROR_SIMULATOR_H */
[ "sriramsrao@gmail.com" ]
sriramsrao@gmail.com
308118c67226f179ef9392fddd4804f433b87f11
a971a027f33e1dcd4dea816173bb63d1dddd6bfc
/include/GameTheory.hpp
d235875ba4ac5e9414d327a4b59e40e66dafda13
[ "MIT" ]
permissive
mraggi/ContestLibrary
3c0a74e386cd76f2d09b15f101b2256b85341b1f
a790475a0daf527b8c71fb5ac45df3ebcccb0493
refs/heads/master
2020-03-16T04:01:09.315509
2019-05-16T16:44:12
2019-05-16T16:44:12
132,501,156
4
0
null
null
null
null
UTF-8
C++
false
false
452
hpp
#pragma once #include <algorithm> #include <iostream> #include <numeric> #include <vector> template <class Int> inline Int min_that_doesnt_appear(std::vector<Int> A) { std::sort(A.begin(), A.end()); if (A.empty() || A.front() != 0) return 0; for (Int i = 0; i + 1 < A.size(); ++i) { auto a = A[i]; auto b = A[i + 1]; if (a != b && a + 1 < b) return a + 1; } return A.back() + 1; }
[ "mraggi@gmail.com" ]
mraggi@gmail.com
2d6ac59c04549371d453288ab7e334f932172fbe
cb77dcbbce6c480f68c3dcb8610743f027bee95c
/android/art/dexlayout/dexlayout.cc
ec0cbe6a600f85bb32483607e9ffdf44bf90b4d3
[ "Apache-2.0", "NCSA", "MIT" ]
permissive
fengjixuchui/deoptfuscator
c888b93361d837ef619b9eb95ffd4b01a4bef51a
dec8fbf2b59f8dddf2dbd10868726b255364e1c5
refs/heads/master
2023-03-17T11:49:00.988260
2023-03-09T02:01:47
2023-03-09T02:01:47
333,074,914
0
0
MIT
2023-03-09T02:01:48
2021-01-26T12:16:31
null
UTF-8
C++
false
false
76,889
cc
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Implementation file of the dexlayout utility. * * This is a tool to read dex files into an internal representation, * reorganize the representation, and emit dex files with a better * file layout. */ #include "dexlayout.h" #include <inttypes.h> #include <stdio.h> #include <sys/mman.h> // For the PROT_* and MAP_* constants. #include <iostream> #include <memory> #include <sstream> #include <vector> #include "android-base/stringprintf.h" #include "base/logging.h" // For VLOG_IS_ON. #include "base/os.h" #include "base/utils.h" #include "dex/art_dex_file_loader.h" #include "dex/descriptors_names.h" #include "dex/dex_file-inl.h" #include "dex/dex_file_layout.h" #include "dex/dex_file_loader.h" #include "dex/dex_file_types.h" #include "dex/dex_file_verifier.h" #include "dex/dex_instruction-inl.h" #include "dex_ir_builder.h" #include "dex_verify.h" #include "dex_visualize.h" #include "dex_writer.h" #include "jit/profile_compilation_info.h" #include "mem_map.h" namespace art { using android::base::StringPrintf; /* * Flags for use with createAccessFlagStr(). */ enum AccessFor { kAccessForClass = 0, kAccessForMethod = 1, kAccessForField = 2, kAccessForMAX }; const int kNumFlags = 18; /* * Gets 2 little-endian bytes. */ static inline uint16_t Get2LE(unsigned char const* src) { return src[0] | (src[1] << 8); } /* * Converts a type descriptor to human-readable "dotted" form. For * example, "Ljava/lang/String;" becomes "java.lang.String", and * "[I" becomes "int[]". Also converts '$' to '.', which means this * form can't be converted back to a descriptor. */ static std::string DescriptorToDotWrapper(const char* descriptor) { std::string result = DescriptorToDot(descriptor); size_t found = result.find('$'); while (found != std::string::npos) { result[found] = '.'; found = result.find('$', found); } return result; } /* * Converts the class name portion of a type descriptor to human-readable * "dotted" form. For example, "Ljava/lang/String;" becomes "String". */ static std::string DescriptorClassToDot(const char* str) { std::string descriptor(str); // Reduce to just the class name prefix. size_t last_slash = descriptor.rfind('/'); if (last_slash == std::string::npos) { last_slash = 0; } // Start past the '/' or 'L'. last_slash++; // Copy class name over, trimming trailing ';'. size_t size = descriptor.size() - 1 - last_slash; std::string result(descriptor.substr(last_slash, size)); // Replace '$' with '.'. size_t dollar_sign = result.find('$'); while (dollar_sign != std::string::npos) { result[dollar_sign] = '.'; dollar_sign = result.find('$', dollar_sign); } return result; } /* * Returns string representing the boolean value. */ static const char* StrBool(bool val) { return val ? "true" : "false"; } /* * Returns a quoted string representing the boolean value. */ static const char* QuotedBool(bool val) { return val ? "\"true\"" : "\"false\""; } /* * Returns a quoted string representing the access flags. */ static const char* QuotedVisibility(uint32_t access_flags) { if (access_flags & kAccPublic) { return "\"public\""; } else if (access_flags & kAccProtected) { return "\"protected\""; } else if (access_flags & kAccPrivate) { return "\"private\""; } else { return "\"package\""; } } /* * Counts the number of '1' bits in a word. */ static int CountOnes(uint32_t val) { val = val - ((val >> 1) & 0x55555555); val = (val & 0x33333333) + ((val >> 2) & 0x33333333); return (((val + (val >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24; } /* * Creates a new string with human-readable access flags. * * In the base language the access_flags fields are type uint16_t; in Dalvik they're uint32_t. */ static char* CreateAccessFlagStr(uint32_t flags, AccessFor for_what) { static const char* kAccessStrings[kAccessForMAX][kNumFlags] = { { "PUBLIC", /* 0x00001 */ "PRIVATE", /* 0x00002 */ "PROTECTED", /* 0x00004 */ "STATIC", /* 0x00008 */ "FINAL", /* 0x00010 */ "?", /* 0x00020 */ "?", /* 0x00040 */ "?", /* 0x00080 */ "?", /* 0x00100 */ "INTERFACE", /* 0x00200 */ "ABSTRACT", /* 0x00400 */ "?", /* 0x00800 */ "SYNTHETIC", /* 0x01000 */ "ANNOTATION", /* 0x02000 */ "ENUM", /* 0x04000 */ "?", /* 0x08000 */ "VERIFIED", /* 0x10000 */ "OPTIMIZED", /* 0x20000 */ }, { "PUBLIC", /* 0x00001 */ "PRIVATE", /* 0x00002 */ "PROTECTED", /* 0x00004 */ "STATIC", /* 0x00008 */ "FINAL", /* 0x00010 */ "SYNCHRONIZED", /* 0x00020 */ "BRIDGE", /* 0x00040 */ "VARARGS", /* 0x00080 */ "NATIVE", /* 0x00100 */ "?", /* 0x00200 */ "ABSTRACT", /* 0x00400 */ "STRICT", /* 0x00800 */ "SYNTHETIC", /* 0x01000 */ "?", /* 0x02000 */ "?", /* 0x04000 */ "MIRANDA", /* 0x08000 */ "CONSTRUCTOR", /* 0x10000 */ "DECLARED_SYNCHRONIZED", /* 0x20000 */ }, { "PUBLIC", /* 0x00001 */ "PRIVATE", /* 0x00002 */ "PROTECTED", /* 0x00004 */ "STATIC", /* 0x00008 */ "FINAL", /* 0x00010 */ "?", /* 0x00020 */ "VOLATILE", /* 0x00040 */ "TRANSIENT", /* 0x00080 */ "?", /* 0x00100 */ "?", /* 0x00200 */ "?", /* 0x00400 */ "?", /* 0x00800 */ "SYNTHETIC", /* 0x01000 */ "?", /* 0x02000 */ "ENUM", /* 0x04000 */ "?", /* 0x08000 */ "?", /* 0x10000 */ "?", /* 0x20000 */ }, }; // Allocate enough storage to hold the expected number of strings, // plus a space between each. We over-allocate, using the longest // string above as the base metric. const int kLongest = 21; // The strlen of longest string above. const int count = CountOnes(flags); char* str; char* cp; cp = str = reinterpret_cast<char*>(malloc(count * (kLongest + 1) + 1)); for (int i = 0; i < kNumFlags; i++) { if (flags & 0x01) { const char* accessStr = kAccessStrings[for_what][i]; const int len = strlen(accessStr); if (cp != str) { *cp++ = ' '; } memcpy(cp, accessStr, len); cp += len; } flags >>= 1; } // for *cp = '\0'; return str; } static std::string GetSignatureForProtoId(const dex_ir::ProtoId* proto) { if (proto == nullptr) { return "<no signature>"; } std::string result("("); const dex_ir::TypeList* type_list = proto->Parameters(); if (type_list != nullptr) { for (const dex_ir::TypeId* type_id : *type_list->GetTypeList()) { result += type_id->GetStringId()->Data(); } } result += ")"; result += proto->ReturnType()->GetStringId()->Data(); return result; } /* * Copies character data from "data" to "out", converting non-ASCII values * to fprintf format chars or an ASCII filler ('.' or '?'). * * The output buffer must be able to hold (2*len)+1 bytes. The result is * NULL-terminated. */ static void Asciify(char* out, const unsigned char* data, size_t len) { while (len--) { if (*data < 0x20) { // Could do more here, but we don't need them yet. switch (*data) { case '\0': *out++ = '\\'; *out++ = '0'; break; case '\n': *out++ = '\\'; *out++ = 'n'; break; default: *out++ = '.'; break; } // switch } else if (*data >= 0x80) { *out++ = '?'; } else { *out++ = *data; } data++; } // while *out = '\0'; } /* * Dumps a string value with some escape characters. */ static void DumpEscapedString(const char* p, FILE* out_file) { fputs("\"", out_file); for (; *p; p++) { switch (*p) { case '\\': fputs("\\\\", out_file); break; case '\"': fputs("\\\"", out_file); break; case '\t': fputs("\\t", out_file); break; case '\n': fputs("\\n", out_file); break; case '\r': fputs("\\r", out_file); break; default: putc(*p, out_file); } // switch } // for fputs("\"", out_file); } /* * Dumps a string as an XML attribute value. */ static void DumpXmlAttribute(const char* p, FILE* out_file) { for (; *p; p++) { switch (*p) { case '&': fputs("&amp;", out_file); break; case '<': fputs("&lt;", out_file); break; case '>': fputs("&gt;", out_file); break; case '"': fputs("&quot;", out_file); break; case '\t': fputs("&#x9;", out_file); break; case '\n': fputs("&#xA;", out_file); break; case '\r': fputs("&#xD;", out_file); break; default: putc(*p, out_file); } // switch } // for } /* * Helper for dumpInstruction(), which builds the string * representation for the index in the given instruction. * Returns a pointer to a buffer of sufficient size. */ static std::unique_ptr<char[]> IndexString(dex_ir::Header* header, const Instruction* dec_insn, size_t buf_size) { std::unique_ptr<char[]> buf(new char[buf_size]); // Determine index and width of the string. uint32_t index = 0; uint32_t secondary_index = dex::kDexNoIndex; uint32_t width = 4; switch (Instruction::FormatOf(dec_insn->Opcode())) { // SOME NOT SUPPORTED: // case Instruction::k20bc: case Instruction::k21c: case Instruction::k35c: // case Instruction::k35ms: case Instruction::k3rc: // case Instruction::k3rms: // case Instruction::k35mi: // case Instruction::k3rmi: index = dec_insn->VRegB(); width = 4; break; case Instruction::k31c: index = dec_insn->VRegB(); width = 8; break; case Instruction::k22c: // case Instruction::k22cs: index = dec_insn->VRegC(); width = 4; break; case Instruction::k45cc: case Instruction::k4rcc: index = dec_insn->VRegB(); secondary_index = dec_insn->VRegH(); width = 4; break; default: break; } // switch // Determine index type. size_t outSize = 0; switch (Instruction::IndexTypeOf(dec_insn->Opcode())) { case Instruction::kIndexUnknown: // This function should never get called for this type, but do // something sensible here, just to help with debugging. outSize = snprintf(buf.get(), buf_size, "<unknown-index>"); break; case Instruction::kIndexNone: // This function should never get called for this type, but do // something sensible here, just to help with debugging. outSize = snprintf(buf.get(), buf_size, "<no-index>"); break; case Instruction::kIndexTypeRef: if (index < header->GetCollections().TypeIdsSize()) { const char* tp = header->GetCollections().GetTypeId(index)->GetStringId()->Data(); outSize = snprintf(buf.get(), buf_size, "%s // type@%0*x", tp, width, index); } else { outSize = snprintf(buf.get(), buf_size, "<type?> // type@%0*x", width, index); } break; case Instruction::kIndexStringRef: if (index < header->GetCollections().StringIdsSize()) { const char* st = header->GetCollections().GetStringId(index)->Data(); outSize = snprintf(buf.get(), buf_size, "\"%s\" // string@%0*x", st, width, index); } else { outSize = snprintf(buf.get(), buf_size, "<string?> // string@%0*x", width, index); } break; case Instruction::kIndexMethodRef: if (index < header->GetCollections().MethodIdsSize()) { dex_ir::MethodId* method_id = header->GetCollections().GetMethodId(index); const char* name = method_id->Name()->Data(); std::string type_descriptor = GetSignatureForProtoId(method_id->Proto()); const char* back_descriptor = method_id->Class()->GetStringId()->Data(); outSize = snprintf(buf.get(), buf_size, "%s.%s:%s // method@%0*x", back_descriptor, name, type_descriptor.c_str(), width, index); } else { outSize = snprintf(buf.get(), buf_size, "<method?> // method@%0*x", width, index); } break; case Instruction::kIndexFieldRef: if (index < header->GetCollections().FieldIdsSize()) { dex_ir::FieldId* field_id = header->GetCollections().GetFieldId(index); const char* name = field_id->Name()->Data(); const char* type_descriptor = field_id->Type()->GetStringId()->Data(); const char* back_descriptor = field_id->Class()->GetStringId()->Data(); outSize = snprintf(buf.get(), buf_size, "%s.%s:%s // field@%0*x", back_descriptor, name, type_descriptor, width, index); } else { outSize = snprintf(buf.get(), buf_size, "<field?> // field@%0*x", width, index); } break; case Instruction::kIndexVtableOffset: outSize = snprintf(buf.get(), buf_size, "[%0*x] // vtable #%0*x", width, index, width, index); break; case Instruction::kIndexFieldOffset: outSize = snprintf(buf.get(), buf_size, "[obj+%0*x]", width, index); break; case Instruction::kIndexMethodAndProtoRef: { std::string method("<method?>"); std::string proto("<proto?>"); if (index < header->GetCollections().MethodIdsSize()) { dex_ir::MethodId* method_id = header->GetCollections().GetMethodId(index); const char* name = method_id->Name()->Data(); std::string type_descriptor = GetSignatureForProtoId(method_id->Proto()); const char* back_descriptor = method_id->Class()->GetStringId()->Data(); method = StringPrintf("%s.%s:%s", back_descriptor, name, type_descriptor.c_str()); } if (secondary_index < header->GetCollections().ProtoIdsSize()) { dex_ir::ProtoId* proto_id = header->GetCollections().GetProtoId(secondary_index); proto = GetSignatureForProtoId(proto_id); } outSize = snprintf(buf.get(), buf_size, "%s, %s // method@%0*x, proto@%0*x", method.c_str(), proto.c_str(), width, index, width, secondary_index); } break; // SOME NOT SUPPORTED: // case Instruction::kIndexVaries: // case Instruction::kIndexInlineMethod: default: outSize = snprintf(buf.get(), buf_size, "<?>"); break; } // switch // Determine success of string construction. if (outSize >= buf_size) { // The buffer wasn't big enough; retry with computed size. Note: snprintf() // doesn't count/ the '\0' as part of its returned size, so we add explicit // space for it here. return IndexString(header, dec_insn, outSize + 1); } return buf; } /* * Dumps encoded annotation. */ void DexLayout::DumpEncodedAnnotation(dex_ir::EncodedAnnotation* annotation) { fputs(annotation->GetType()->GetStringId()->Data(), out_file_); // Display all name=value pairs. for (auto& subannotation : *annotation->GetAnnotationElements()) { fputc(' ', out_file_); fputs(subannotation->GetName()->Data(), out_file_); fputc('=', out_file_); DumpEncodedValue(subannotation->GetValue()); } } /* * Dumps encoded value. */ void DexLayout::DumpEncodedValue(const dex_ir::EncodedValue* data) { switch (data->Type()) { case DexFile::kDexAnnotationByte: fprintf(out_file_, "%" PRId8, data->GetByte()); break; case DexFile::kDexAnnotationShort: fprintf(out_file_, "%" PRId16, data->GetShort()); break; case DexFile::kDexAnnotationChar: fprintf(out_file_, "%" PRIu16, data->GetChar()); break; case DexFile::kDexAnnotationInt: fprintf(out_file_, "%" PRId32, data->GetInt()); break; case DexFile::kDexAnnotationLong: fprintf(out_file_, "%" PRId64, data->GetLong()); break; case DexFile::kDexAnnotationFloat: { fprintf(out_file_, "%g", data->GetFloat()); break; } case DexFile::kDexAnnotationDouble: { fprintf(out_file_, "%g", data->GetDouble()); break; } case DexFile::kDexAnnotationString: { dex_ir::StringId* string_id = data->GetStringId(); if (options_.output_format_ == kOutputPlain) { DumpEscapedString(string_id->Data(), out_file_); } else { DumpXmlAttribute(string_id->Data(), out_file_); } break; } case DexFile::kDexAnnotationType: { dex_ir::TypeId* type_id = data->GetTypeId(); fputs(type_id->GetStringId()->Data(), out_file_); break; } case DexFile::kDexAnnotationField: case DexFile::kDexAnnotationEnum: { dex_ir::FieldId* field_id = data->GetFieldId(); fputs(field_id->Name()->Data(), out_file_); break; } case DexFile::kDexAnnotationMethod: { dex_ir::MethodId* method_id = data->GetMethodId(); fputs(method_id->Name()->Data(), out_file_); break; } case DexFile::kDexAnnotationArray: { fputc('{', out_file_); // Display all elements. for (auto& value : *data->GetEncodedArray()->GetEncodedValues()) { fputc(' ', out_file_); DumpEncodedValue(value.get()); } fputs(" }", out_file_); break; } case DexFile::kDexAnnotationAnnotation: { DumpEncodedAnnotation(data->GetEncodedAnnotation()); break; } case DexFile::kDexAnnotationNull: fputs("null", out_file_); break; case DexFile::kDexAnnotationBoolean: fputs(StrBool(data->GetBoolean()), out_file_); break; default: fputs("????", out_file_); break; } // switch } /* * Dumps the file header. */ void DexLayout::DumpFileHeader() { char sanitized[8 * 2 + 1]; dex_ir::Collections& collections = header_->GetCollections(); fprintf(out_file_, "DEX file header:\n"); Asciify(sanitized, header_->Magic(), 8); fprintf(out_file_, "magic : '%s'\n", sanitized); fprintf(out_file_, "checksum : %08x\n", header_->Checksum()); fprintf(out_file_, "signature : %02x%02x...%02x%02x\n", header_->Signature()[0], header_->Signature()[1], header_->Signature()[DexFile::kSha1DigestSize - 2], header_->Signature()[DexFile::kSha1DigestSize - 1]); fprintf(out_file_, "file_size : %d\n", header_->FileSize()); fprintf(out_file_, "header_size : %d\n", header_->HeaderSize()); fprintf(out_file_, "link_size : %d\n", header_->LinkSize()); fprintf(out_file_, "link_off : %d (0x%06x)\n", header_->LinkOffset(), header_->LinkOffset()); fprintf(out_file_, "string_ids_size : %d\n", collections.StringIdsSize()); fprintf(out_file_, "string_ids_off : %d (0x%06x)\n", collections.StringIdsOffset(), collections.StringIdsOffset()); fprintf(out_file_, "type_ids_size : %d\n", collections.TypeIdsSize()); fprintf(out_file_, "type_ids_off : %d (0x%06x)\n", collections.TypeIdsOffset(), collections.TypeIdsOffset()); fprintf(out_file_, "proto_ids_size : %d\n", collections.ProtoIdsSize()); fprintf(out_file_, "proto_ids_off : %d (0x%06x)\n", collections.ProtoIdsOffset(), collections.ProtoIdsOffset()); fprintf(out_file_, "field_ids_size : %d\n", collections.FieldIdsSize()); fprintf(out_file_, "field_ids_off : %d (0x%06x)\n", collections.FieldIdsOffset(), collections.FieldIdsOffset()); fprintf(out_file_, "method_ids_size : %d\n", collections.MethodIdsSize()); fprintf(out_file_, "method_ids_off : %d (0x%06x)\n", collections.MethodIdsOffset(), collections.MethodIdsOffset()); fprintf(out_file_, "class_defs_size : %d\n", collections.ClassDefsSize()); fprintf(out_file_, "class_defs_off : %d (0x%06x)\n", collections.ClassDefsOffset(), collections.ClassDefsOffset()); fprintf(out_file_, "data_size : %d\n", header_->DataSize()); fprintf(out_file_, "data_off : %d (0x%06x)\n\n", header_->DataOffset(), header_->DataOffset()); } /* * Dumps a class_def_item. */ void DexLayout::DumpClassDef(int idx) { // General class information. dex_ir::ClassDef* class_def = header_->GetCollections().GetClassDef(idx); fprintf(out_file_, "Class #%d header:\n", idx); fprintf(out_file_, "class_idx : %d\n", class_def->ClassType()->GetIndex()); fprintf(out_file_, "access_flags : %d (0x%04x)\n", class_def->GetAccessFlags(), class_def->GetAccessFlags()); uint32_t superclass_idx = class_def->Superclass() == nullptr ? DexFile::kDexNoIndex16 : class_def->Superclass()->GetIndex(); fprintf(out_file_, "superclass_idx : %d\n", superclass_idx); fprintf(out_file_, "interfaces_off : %d (0x%06x)\n", class_def->InterfacesOffset(), class_def->InterfacesOffset()); uint32_t source_file_offset = 0xffffffffU; if (class_def->SourceFile() != nullptr) { source_file_offset = class_def->SourceFile()->GetIndex(); } fprintf(out_file_, "source_file_idx : %d\n", source_file_offset); uint32_t annotations_offset = 0; if (class_def->Annotations() != nullptr) { annotations_offset = class_def->Annotations()->GetOffset(); } fprintf(out_file_, "annotations_off : %d (0x%06x)\n", annotations_offset, annotations_offset); if (class_def->GetClassData() == nullptr) { fprintf(out_file_, "class_data_off : %d (0x%06x)\n", 0, 0); } else { fprintf(out_file_, "class_data_off : %d (0x%06x)\n", class_def->GetClassData()->GetOffset(), class_def->GetClassData()->GetOffset()); } // Fields and methods. dex_ir::ClassData* class_data = class_def->GetClassData(); if (class_data != nullptr && class_data->StaticFields() != nullptr) { fprintf(out_file_, "static_fields_size : %zu\n", class_data->StaticFields()->size()); } else { fprintf(out_file_, "static_fields_size : 0\n"); } if (class_data != nullptr && class_data->InstanceFields() != nullptr) { fprintf(out_file_, "instance_fields_size: %zu\n", class_data->InstanceFields()->size()); } else { fprintf(out_file_, "instance_fields_size: 0\n"); } if (class_data != nullptr && class_data->DirectMethods() != nullptr) { fprintf(out_file_, "direct_methods_size : %zu\n", class_data->DirectMethods()->size()); } else { fprintf(out_file_, "direct_methods_size : 0\n"); } if (class_data != nullptr && class_data->VirtualMethods() != nullptr) { fprintf(out_file_, "virtual_methods_size: %zu\n", class_data->VirtualMethods()->size()); } else { fprintf(out_file_, "virtual_methods_size: 0\n"); } fprintf(out_file_, "\n"); } /** * Dumps an annotation set item. */ void DexLayout::DumpAnnotationSetItem(dex_ir::AnnotationSetItem* set_item) { if (set_item == nullptr || set_item->GetItems()->size() == 0) { fputs(" empty-annotation-set\n", out_file_); return; } for (dex_ir::AnnotationItem* annotation : *set_item->GetItems()) { if (annotation == nullptr) { continue; } fputs(" ", out_file_); switch (annotation->GetVisibility()) { case DexFile::kDexVisibilityBuild: fputs("VISIBILITY_BUILD ", out_file_); break; case DexFile::kDexVisibilityRuntime: fputs("VISIBILITY_RUNTIME ", out_file_); break; case DexFile::kDexVisibilitySystem: fputs("VISIBILITY_SYSTEM ", out_file_); break; default: fputs("VISIBILITY_UNKNOWN ", out_file_); break; } // switch DumpEncodedAnnotation(annotation->GetAnnotation()); fputc('\n', out_file_); } } /* * Dumps class annotations. */ void DexLayout::DumpClassAnnotations(int idx) { dex_ir::ClassDef* class_def = header_->GetCollections().GetClassDef(idx); dex_ir::AnnotationsDirectoryItem* annotations_directory = class_def->Annotations(); if (annotations_directory == nullptr) { return; // none } fprintf(out_file_, "Class #%d annotations:\n", idx); dex_ir::AnnotationSetItem* class_set_item = annotations_directory->GetClassAnnotation(); dex_ir::FieldAnnotationVector* fields = annotations_directory->GetFieldAnnotations(); dex_ir::MethodAnnotationVector* methods = annotations_directory->GetMethodAnnotations(); dex_ir::ParameterAnnotationVector* parameters = annotations_directory->GetParameterAnnotations(); // Annotations on the class itself. if (class_set_item != nullptr) { fprintf(out_file_, "Annotations on class\n"); DumpAnnotationSetItem(class_set_item); } // Annotations on fields. if (fields != nullptr) { for (auto& field : *fields) { const dex_ir::FieldId* field_id = field->GetFieldId(); const uint32_t field_idx = field_id->GetIndex(); const char* field_name = field_id->Name()->Data(); fprintf(out_file_, "Annotations on field #%u '%s'\n", field_idx, field_name); DumpAnnotationSetItem(field->GetAnnotationSetItem()); } } // Annotations on methods. if (methods != nullptr) { for (auto& method : *methods) { const dex_ir::MethodId* method_id = method->GetMethodId(); const uint32_t method_idx = method_id->GetIndex(); const char* method_name = method_id->Name()->Data(); fprintf(out_file_, "Annotations on method #%u '%s'\n", method_idx, method_name); DumpAnnotationSetItem(method->GetAnnotationSetItem()); } } // Annotations on method parameters. if (parameters != nullptr) { for (auto& parameter : *parameters) { const dex_ir::MethodId* method_id = parameter->GetMethodId(); const uint32_t method_idx = method_id->GetIndex(); const char* method_name = method_id->Name()->Data(); fprintf(out_file_, "Annotations on method #%u '%s' parameters\n", method_idx, method_name); uint32_t j = 0; for (dex_ir::AnnotationSetItem* annotation : *parameter->GetAnnotations()->GetItems()) { fprintf(out_file_, "#%u\n", j); DumpAnnotationSetItem(annotation); ++j; } } } fputc('\n', out_file_); } /* * Dumps an interface that a class declares to implement. */ void DexLayout::DumpInterface(const dex_ir::TypeId* type_item, int i) { const char* interface_name = type_item->GetStringId()->Data(); if (options_.output_format_ == kOutputPlain) { fprintf(out_file_, " #%d : '%s'\n", i, interface_name); } else { std::string dot(DescriptorToDotWrapper(interface_name)); fprintf(out_file_, "<implements name=\"%s\">\n</implements>\n", dot.c_str()); } } /* * Dumps the catches table associated with the code. */ void DexLayout::DumpCatches(const dex_ir::CodeItem* code) { const uint16_t tries_size = code->TriesSize(); // No catch table. if (tries_size == 0) { fprintf(out_file_, " catches : (none)\n"); return; } // Dump all table entries. fprintf(out_file_, " catches : %d\n", tries_size); std::vector<std::unique_ptr<const dex_ir::TryItem>>* tries = code->Tries(); for (uint32_t i = 0; i < tries_size; i++) { const dex_ir::TryItem* try_item = (*tries)[i].get(); const uint32_t start = try_item->StartAddr(); const uint32_t end = start + try_item->InsnCount(); fprintf(out_file_, " 0x%04x - 0x%04x\n", start, end); for (auto& handler : *try_item->GetHandlers()->GetHandlers()) { const dex_ir::TypeId* type_id = handler->GetTypeId(); const char* descriptor = (type_id == nullptr) ? "<any>" : type_id->GetStringId()->Data(); fprintf(out_file_, " %s -> 0x%04x\n", descriptor, handler->GetAddress()); } // for } // for } /* * Dumps a single instruction. */ void DexLayout::DumpInstruction(const dex_ir::CodeItem* code, uint32_t code_offset, uint32_t insn_idx, uint32_t insn_width, const Instruction* dec_insn) { // Address of instruction (expressed as byte offset). fprintf(out_file_, "%06x:", code_offset + 0x10 + insn_idx * 2); // Dump (part of) raw bytes. const uint16_t* insns = code->Insns(); for (uint32_t i = 0; i < 8; i++) { if (i < insn_width) { if (i == 7) { fprintf(out_file_, " ... "); } else { // Print 16-bit value in little-endian order. const uint8_t* bytePtr = (const uint8_t*) &insns[insn_idx + i]; fprintf(out_file_, " %02x%02x", bytePtr[0], bytePtr[1]); } } else { fputs(" ", out_file_); } } // for // Dump pseudo-instruction or opcode. if (dec_insn->Opcode() == Instruction::NOP) { const uint16_t instr = Get2LE((const uint8_t*) &insns[insn_idx]); if (instr == Instruction::kPackedSwitchSignature) { fprintf(out_file_, "|%04x: packed-switch-data (%d units)", insn_idx, insn_width); } else if (instr == Instruction::kSparseSwitchSignature) { fprintf(out_file_, "|%04x: sparse-switch-data (%d units)", insn_idx, insn_width); } else if (instr == Instruction::kArrayDataSignature) { fprintf(out_file_, "|%04x: array-data (%d units)", insn_idx, insn_width); } else { fprintf(out_file_, "|%04x: nop // spacer", insn_idx); } } else { fprintf(out_file_, "|%04x: %s", insn_idx, dec_insn->Name()); } // Set up additional argument. std::unique_ptr<char[]> index_buf; if (Instruction::IndexTypeOf(dec_insn->Opcode()) != Instruction::kIndexNone) { index_buf = IndexString(header_, dec_insn, 200); } // Dump the instruction. // // NOTE: pDecInsn->DumpString(pDexFile) differs too much from original. // switch (Instruction::FormatOf(dec_insn->Opcode())) { case Instruction::k10x: // op break; case Instruction::k12x: // op vA, vB fprintf(out_file_, " v%d, v%d", dec_insn->VRegA(), dec_insn->VRegB()); break; case Instruction::k11n: // op vA, #+B fprintf(out_file_, " v%d, #int %d // #%x", dec_insn->VRegA(), (int32_t) dec_insn->VRegB(), (uint8_t)dec_insn->VRegB()); break; case Instruction::k11x: // op vAA fprintf(out_file_, " v%d", dec_insn->VRegA()); break; case Instruction::k10t: // op +AA case Instruction::k20t: { // op +AAAA const int32_t targ = (int32_t) dec_insn->VRegA(); fprintf(out_file_, " %04x // %c%04x", insn_idx + targ, (targ < 0) ? '-' : '+', (targ < 0) ? -targ : targ); break; } case Instruction::k22x: // op vAA, vBBBB fprintf(out_file_, " v%d, v%d", dec_insn->VRegA(), dec_insn->VRegB()); break; case Instruction::k21t: { // op vAA, +BBBB const int32_t targ = (int32_t) dec_insn->VRegB(); fprintf(out_file_, " v%d, %04x // %c%04x", dec_insn->VRegA(), insn_idx + targ, (targ < 0) ? '-' : '+', (targ < 0) ? -targ : targ); break; } case Instruction::k21s: // op vAA, #+BBBB fprintf(out_file_, " v%d, #int %d // #%x", dec_insn->VRegA(), (int32_t) dec_insn->VRegB(), (uint16_t)dec_insn->VRegB()); break; case Instruction::k21h: // op vAA, #+BBBB0000[00000000] // The printed format varies a bit based on the actual opcode. if (dec_insn->Opcode() == Instruction::CONST_HIGH16) { const int32_t value = dec_insn->VRegB() << 16; fprintf(out_file_, " v%d, #int %d // #%x", dec_insn->VRegA(), value, (uint16_t) dec_insn->VRegB()); } else { const int64_t value = ((int64_t) dec_insn->VRegB()) << 48; fprintf(out_file_, " v%d, #long %" PRId64 " // #%x", dec_insn->VRegA(), value, (uint16_t) dec_insn->VRegB()); } break; case Instruction::k21c: // op vAA, thing@BBBB case Instruction::k31c: // op vAA, thing@BBBBBBBB fprintf(out_file_, " v%d, %s", dec_insn->VRegA(), index_buf.get()); break; case Instruction::k23x: // op vAA, vBB, vCC fprintf(out_file_, " v%d, v%d, v%d", dec_insn->VRegA(), dec_insn->VRegB(), dec_insn->VRegC()); break; case Instruction::k22b: // op vAA, vBB, #+CC fprintf(out_file_, " v%d, v%d, #int %d // #%02x", dec_insn->VRegA(), dec_insn->VRegB(), (int32_t) dec_insn->VRegC(), (uint8_t) dec_insn->VRegC()); break; case Instruction::k22t: { // op vA, vB, +CCCC const int32_t targ = (int32_t) dec_insn->VRegC(); fprintf(out_file_, " v%d, v%d, %04x // %c%04x", dec_insn->VRegA(), dec_insn->VRegB(), insn_idx + targ, (targ < 0) ? '-' : '+', (targ < 0) ? -targ : targ); break; } case Instruction::k22s: // op vA, vB, #+CCCC fprintf(out_file_, " v%d, v%d, #int %d // #%04x", dec_insn->VRegA(), dec_insn->VRegB(), (int32_t) dec_insn->VRegC(), (uint16_t) dec_insn->VRegC()); break; case Instruction::k22c: // op vA, vB, thing@CCCC // NOT SUPPORTED: // case Instruction::k22cs: // [opt] op vA, vB, field offset CCCC fprintf(out_file_, " v%d, v%d, %s", dec_insn->VRegA(), dec_insn->VRegB(), index_buf.get()); break; case Instruction::k30t: fprintf(out_file_, " #%08x", dec_insn->VRegA()); break; case Instruction::k31i: { // op vAA, #+BBBBBBBB // This is often, but not always, a float. union { float f; uint32_t i; } conv; conv.i = dec_insn->VRegB(); fprintf(out_file_, " v%d, #float %g // #%08x", dec_insn->VRegA(), conv.f, dec_insn->VRegB()); break; } case Instruction::k31t: // op vAA, offset +BBBBBBBB fprintf(out_file_, " v%d, %08x // +%08x", dec_insn->VRegA(), insn_idx + dec_insn->VRegB(), dec_insn->VRegB()); break; case Instruction::k32x: // op vAAAA, vBBBB fprintf(out_file_, " v%d, v%d", dec_insn->VRegA(), dec_insn->VRegB()); break; case Instruction::k35c: // op {vC, vD, vE, vF, vG}, thing@BBBB case Instruction::k45cc: { // op {vC, vD, vE, vF, vG}, meth@BBBB, proto@HHHH // NOT SUPPORTED: // case Instruction::k35ms: // [opt] invoke-virtual+super // case Instruction::k35mi: // [opt] inline invoke uint32_t arg[Instruction::kMaxVarArgRegs]; dec_insn->GetVarArgs(arg); fputs(" {", out_file_); for (int i = 0, n = dec_insn->VRegA(); i < n; i++) { if (i == 0) { fprintf(out_file_, "v%d", arg[i]); } else { fprintf(out_file_, ", v%d", arg[i]); } } // for fprintf(out_file_, "}, %s", index_buf.get()); break; } case Instruction::k3rc: // op {vCCCC .. v(CCCC+AA-1)}, thing@BBBB case Instruction::k4rcc: // op {vCCCC .. v(CCCC+AA-1)}, meth@BBBB, proto@HHHH // NOT SUPPORTED: // case Instruction::k3rms: // [opt] invoke-virtual+super/range // case Instruction::k3rmi: // [opt] execute-inline/range { // This doesn't match the "dx" output when some of the args are // 64-bit values -- dx only shows the first register. fputs(" {", out_file_); for (int i = 0, n = dec_insn->VRegA(); i < n; i++) { if (i == 0) { fprintf(out_file_, "v%d", dec_insn->VRegC() + i); } else { fprintf(out_file_, ", v%d", dec_insn->VRegC() + i); } } // for fprintf(out_file_, "}, %s", index_buf.get()); } break; case Instruction::k51l: { // op vAA, #+BBBBBBBBBBBBBBBB // This is often, but not always, a double. union { double d; uint64_t j; } conv; conv.j = dec_insn->WideVRegB(); fprintf(out_file_, " v%d, #double %g // #%016" PRIx64, dec_insn->VRegA(), conv.d, dec_insn->WideVRegB()); break; } // NOT SUPPORTED: // case Instruction::k00x: // unknown op or breakpoint // break; default: fprintf(out_file_, " ???"); break; } // switch fputc('\n', out_file_); } /* * Dumps a bytecode disassembly. */ void DexLayout::DumpBytecodes(uint32_t idx, const dex_ir::CodeItem* code, uint32_t code_offset) { dex_ir::MethodId* method_id = header_->GetCollections().GetMethodId(idx); const char* name = method_id->Name()->Data(); std::string type_descriptor = GetSignatureForProtoId(method_id->Proto()); const char* back_descriptor = method_id->Class()->GetStringId()->Data(); // Generate header. std::string dot(DescriptorToDotWrapper(back_descriptor)); fprintf(out_file_, "%06x: |[%06x] %s.%s:%s\n", code_offset, code_offset, dot.c_str(), name, type_descriptor.c_str()); // Iterate over all instructions. for (const DexInstructionPcPair& inst : code->Instructions()) { const uint32_t insn_width = inst->SizeInCodeUnits(); if (insn_width == 0) { LOG(WARNING) << "GLITCH: zero-width instruction at idx=0x" << std::hex << inst.DexPc(); break; } DumpInstruction(code, code_offset, inst.DexPc(), insn_width, &inst.Inst()); } // for } /* * Callback for dumping each positions table entry. */ static bool DumpPositionsCb(void* context, const DexFile::PositionInfo& entry) { FILE* out_file = reinterpret_cast<FILE*>(context); fprintf(out_file, " 0x%04x line=%d\n", entry.address_, entry.line_); return false; } /* * Callback for dumping locals table entry. */ static void DumpLocalsCb(void* context, const DexFile::LocalInfo& entry) { const char* signature = entry.signature_ != nullptr ? entry.signature_ : ""; FILE* out_file = reinterpret_cast<FILE*>(context); fprintf(out_file, " 0x%04x - 0x%04x reg=%d %s %s %s\n", entry.start_address_, entry.end_address_, entry.reg_, entry.name_, entry.descriptor_, signature); } /* * Lookup functions. */ static const char* StringDataByIdx(uint32_t idx, dex_ir::Collections& collections) { dex_ir::StringId* string_id = collections.GetStringIdOrNullPtr(idx); if (string_id == nullptr) { return nullptr; } return string_id->Data(); } static const char* StringDataByTypeIdx(uint16_t idx, dex_ir::Collections& collections) { dex_ir::TypeId* type_id = collections.GetTypeIdOrNullPtr(idx); if (type_id == nullptr) { return nullptr; } dex_ir::StringId* string_id = type_id->GetStringId(); if (string_id == nullptr) { return nullptr; } return string_id->Data(); } /* * Dumps code of a method. */ void DexLayout::DumpCode(uint32_t idx, const dex_ir::CodeItem* code, uint32_t code_offset, const char* declaring_class_descriptor, const char* method_name, bool is_static, const dex_ir::ProtoId* proto) { fprintf(out_file_, " registers : %d\n", code->RegistersSize()); fprintf(out_file_, " ins : %d\n", code->InsSize()); fprintf(out_file_, " outs : %d\n", code->OutsSize()); fprintf(out_file_, " insns size : %d 16-bit code units\n", code->InsnsSize()); // Bytecode disassembly, if requested. if (options_.disassemble_) { DumpBytecodes(idx, code, code_offset); } // Try-catch blocks. DumpCatches(code); // Positions and locals table in the debug info. dex_ir::DebugInfoItem* debug_info = code->DebugInfo(); fprintf(out_file_, " positions : \n"); if (debug_info != nullptr) { DexFile::DecodeDebugPositionInfo(debug_info->GetDebugInfo(), [this](uint32_t idx) { return StringDataByIdx(idx, this->header_->GetCollections()); }, DumpPositionsCb, out_file_); } fprintf(out_file_, " locals : \n"); if (debug_info != nullptr) { std::vector<const char*> arg_descriptors; const dex_ir::TypeList* parameters = proto->Parameters(); if (parameters != nullptr) { const dex_ir::TypeIdVector* parameter_type_vector = parameters->GetTypeList(); if (parameter_type_vector != nullptr) { for (const dex_ir::TypeId* type_id : *parameter_type_vector) { arg_descriptors.push_back(type_id->GetStringId()->Data()); } } } DexFile::DecodeDebugLocalInfo(debug_info->GetDebugInfo(), "DexLayout in-memory", declaring_class_descriptor, arg_descriptors, method_name, is_static, code->RegistersSize(), code->InsSize(), code->InsnsSize(), [this](uint32_t idx) { return StringDataByIdx(idx, this->header_->GetCollections()); }, [this](uint32_t idx) { return StringDataByTypeIdx(dchecked_integral_cast<uint16_t>(idx), this->header_->GetCollections()); }, DumpLocalsCb, out_file_); } } /* * Dumps a method. */ void DexLayout::DumpMethod(uint32_t idx, uint32_t flags, const dex_ir::CodeItem* code, int i) { // Bail for anything private if export only requested. if (options_.exports_only_ && (flags & (kAccPublic | kAccProtected)) == 0) { return; } dex_ir::MethodId* method_id = header_->GetCollections().GetMethodId(idx); const char* name = method_id->Name()->Data(); char* type_descriptor = strdup(GetSignatureForProtoId(method_id->Proto()).c_str()); const char* back_descriptor = method_id->Class()->GetStringId()->Data(); char* access_str = CreateAccessFlagStr(flags, kAccessForMethod); if (options_.output_format_ == kOutputPlain) { fprintf(out_file_, " #%d : (in %s)\n", i, back_descriptor); fprintf(out_file_, " name : '%s'\n", name); fprintf(out_file_, " type : '%s'\n", type_descriptor); fprintf(out_file_, " access : 0x%04x (%s)\n", flags, access_str); if (code == nullptr) { fprintf(out_file_, " code : (none)\n"); } else { fprintf(out_file_, " code -\n"); DumpCode(idx, code, code->GetOffset(), back_descriptor, name, (flags & kAccStatic) != 0, method_id->Proto()); } if (options_.disassemble_) { fputc('\n', out_file_); } } else if (options_.output_format_ == kOutputXml) { const bool constructor = (name[0] == '<'); // Method name and prototype. if (constructor) { std::string dot(DescriptorClassToDot(back_descriptor)); fprintf(out_file_, "<constructor name=\"%s\"\n", dot.c_str()); dot = DescriptorToDotWrapper(back_descriptor); fprintf(out_file_, " type=\"%s\"\n", dot.c_str()); } else { fprintf(out_file_, "<method name=\"%s\"\n", name); const char* return_type = strrchr(type_descriptor, ')'); if (return_type == nullptr) { LOG(ERROR) << "bad method type descriptor '" << type_descriptor << "'"; goto bail; } std::string dot(DescriptorToDotWrapper(return_type + 1)); fprintf(out_file_, " return=\"%s\"\n", dot.c_str()); fprintf(out_file_, " abstract=%s\n", QuotedBool((flags & kAccAbstract) != 0)); fprintf(out_file_, " native=%s\n", QuotedBool((flags & kAccNative) != 0)); fprintf(out_file_, " synchronized=%s\n", QuotedBool( (flags & (kAccSynchronized | kAccDeclaredSynchronized)) != 0)); } // Additional method flags. fprintf(out_file_, " static=%s\n", QuotedBool((flags & kAccStatic) != 0)); fprintf(out_file_, " final=%s\n", QuotedBool((flags & kAccFinal) != 0)); // The "deprecated=" not knowable w/o parsing annotations. fprintf(out_file_, " visibility=%s\n>\n", QuotedVisibility(flags)); // Parameters. if (type_descriptor[0] != '(') { LOG(ERROR) << "ERROR: bad descriptor '" << type_descriptor << "'"; goto bail; } char* tmp_buf = reinterpret_cast<char*>(malloc(strlen(type_descriptor) + 1)); const char* base = type_descriptor + 1; int arg_num = 0; while (*base != ')') { char* cp = tmp_buf; while (*base == '[') { *cp++ = *base++; } if (*base == 'L') { // Copy through ';'. do { *cp = *base++; } while (*cp++ != ';'); } else { // Primitive char, copy it. if (strchr("ZBCSIFJD", *base) == nullptr) { LOG(ERROR) << "ERROR: bad method signature '" << base << "'"; break; // while } *cp++ = *base++; } // Null terminate and display. *cp++ = '\0'; std::string dot(DescriptorToDotWrapper(tmp_buf)); fprintf(out_file_, "<parameter name=\"arg%d\" type=\"%s\">\n" "</parameter>\n", arg_num++, dot.c_str()); } // while free(tmp_buf); if (constructor) { fprintf(out_file_, "</constructor>\n"); } else { fprintf(out_file_, "</method>\n"); } } bail: free(type_descriptor); free(access_str); } /* * Dumps a static (class) field. */ void DexLayout::DumpSField(uint32_t idx, uint32_t flags, int i, dex_ir::EncodedValue* init) { // Bail for anything private if export only requested. if (options_.exports_only_ && (flags & (kAccPublic | kAccProtected)) == 0) { return; } dex_ir::FieldId* field_id = header_->GetCollections().GetFieldId(idx); const char* name = field_id->Name()->Data(); const char* type_descriptor = field_id->Type()->GetStringId()->Data(); const char* back_descriptor = field_id->Class()->GetStringId()->Data(); char* access_str = CreateAccessFlagStr(flags, kAccessForField); if (options_.output_format_ == kOutputPlain) { fprintf(out_file_, " #%d : (in %s)\n", i, back_descriptor); fprintf(out_file_, " name : '%s'\n", name); fprintf(out_file_, " type : '%s'\n", type_descriptor); fprintf(out_file_, " access : 0x%04x (%s)\n", flags, access_str); if (init != nullptr) { fputs(" value : ", out_file_); DumpEncodedValue(init); fputs("\n", out_file_); } } else if (options_.output_format_ == kOutputXml) { fprintf(out_file_, "<field name=\"%s\"\n", name); std::string dot(DescriptorToDotWrapper(type_descriptor)); fprintf(out_file_, " type=\"%s\"\n", dot.c_str()); fprintf(out_file_, " transient=%s\n", QuotedBool((flags & kAccTransient) != 0)); fprintf(out_file_, " volatile=%s\n", QuotedBool((flags & kAccVolatile) != 0)); // The "value=" is not knowable w/o parsing annotations. fprintf(out_file_, " static=%s\n", QuotedBool((flags & kAccStatic) != 0)); fprintf(out_file_, " final=%s\n", QuotedBool((flags & kAccFinal) != 0)); // The "deprecated=" is not knowable w/o parsing annotations. fprintf(out_file_, " visibility=%s\n", QuotedVisibility(flags)); if (init != nullptr) { fputs(" value=\"", out_file_); DumpEncodedValue(init); fputs("\"\n", out_file_); } fputs(">\n</field>\n", out_file_); } free(access_str); } /* * Dumps an instance field. */ void DexLayout::DumpIField(uint32_t idx, uint32_t flags, int i) { DumpSField(idx, flags, i, nullptr); } /* * Dumps the class. * * Note "idx" is a DexClassDef index, not a DexTypeId index. * * If "*last_package" is nullptr or does not match the current class' package, * the value will be replaced with a newly-allocated string. */ void DexLayout::DumpClass(int idx, char** last_package) { dex_ir::ClassDef* class_def = header_->GetCollections().GetClassDef(idx); // Omitting non-public class. if (options_.exports_only_ && (class_def->GetAccessFlags() & kAccPublic) == 0) { return; } if (options_.show_section_headers_) { DumpClassDef(idx); } if (options_.show_annotations_) { DumpClassAnnotations(idx); } // For the XML output, show the package name. Ideally we'd gather // up the classes, sort them, and dump them alphabetically so the // package name wouldn't jump around, but that's not a great plan // for something that needs to run on the device. const char* class_descriptor = header_->GetCollections().GetClassDef(idx)->ClassType()->GetStringId()->Data(); if (!(class_descriptor[0] == 'L' && class_descriptor[strlen(class_descriptor)-1] == ';')) { // Arrays and primitives should not be defined explicitly. Keep going? LOG(ERROR) << "Malformed class name '" << class_descriptor << "'"; } else if (options_.output_format_ == kOutputXml) { char* mangle = strdup(class_descriptor + 1); mangle[strlen(mangle)-1] = '\0'; // Reduce to just the package name. char* last_slash = strrchr(mangle, '/'); if (last_slash != nullptr) { *last_slash = '\0'; } else { *mangle = '\0'; } for (char* cp = mangle; *cp != '\0'; cp++) { if (*cp == '/') { *cp = '.'; } } // for if (*last_package == nullptr || strcmp(mangle, *last_package) != 0) { // Start of a new package. if (*last_package != nullptr) { fprintf(out_file_, "</package>\n"); } fprintf(out_file_, "<package name=\"%s\"\n>\n", mangle); free(*last_package); *last_package = mangle; } else { free(mangle); } } // General class information. char* access_str = CreateAccessFlagStr(class_def->GetAccessFlags(), kAccessForClass); const char* superclass_descriptor = nullptr; if (class_def->Superclass() != nullptr) { superclass_descriptor = class_def->Superclass()->GetStringId()->Data(); } if (options_.output_format_ == kOutputPlain) { fprintf(out_file_, "Class #%d -\n", idx); fprintf(out_file_, " Class descriptor : '%s'\n", class_descriptor); fprintf(out_file_, " Access flags : 0x%04x (%s)\n", class_def->GetAccessFlags(), access_str); if (superclass_descriptor != nullptr) { fprintf(out_file_, " Superclass : '%s'\n", superclass_descriptor); } fprintf(out_file_, " Interfaces -\n"); } else { std::string dot(DescriptorClassToDot(class_descriptor)); fprintf(out_file_, "<class name=\"%s\"\n", dot.c_str()); if (superclass_descriptor != nullptr) { dot = DescriptorToDotWrapper(superclass_descriptor); fprintf(out_file_, " extends=\"%s\"\n", dot.c_str()); } fprintf(out_file_, " interface=%s\n", QuotedBool((class_def->GetAccessFlags() & kAccInterface) != 0)); fprintf(out_file_, " abstract=%s\n", QuotedBool((class_def->GetAccessFlags() & kAccAbstract) != 0)); fprintf(out_file_, " static=%s\n", QuotedBool((class_def->GetAccessFlags() & kAccStatic) != 0)); fprintf(out_file_, " final=%s\n", QuotedBool((class_def->GetAccessFlags() & kAccFinal) != 0)); // The "deprecated=" not knowable w/o parsing annotations. fprintf(out_file_, " visibility=%s\n", QuotedVisibility(class_def->GetAccessFlags())); fprintf(out_file_, ">\n"); } // Interfaces. const dex_ir::TypeList* interfaces = class_def->Interfaces(); if (interfaces != nullptr) { const dex_ir::TypeIdVector* interfaces_vector = interfaces->GetTypeList(); for (uint32_t i = 0; i < interfaces_vector->size(); i++) { DumpInterface((*interfaces_vector)[i], i); } // for } // Fields and methods. dex_ir::ClassData* class_data = class_def->GetClassData(); // Prepare data for static fields. dex_ir::EncodedArrayItem* static_values = class_def->StaticValues(); dex_ir::EncodedValueVector* encoded_values = static_values == nullptr ? nullptr : static_values->GetEncodedValues(); const uint32_t encoded_values_size = (encoded_values == nullptr) ? 0 : encoded_values->size(); // Static fields. if (options_.output_format_ == kOutputPlain) { fprintf(out_file_, " Static fields -\n"); } if (class_data != nullptr) { dex_ir::FieldItemVector* static_fields = class_data->StaticFields(); if (static_fields != nullptr) { for (uint32_t i = 0; i < static_fields->size(); i++) { DumpSField((*static_fields)[i]->GetFieldId()->GetIndex(), (*static_fields)[i]->GetAccessFlags(), i, i < encoded_values_size ? (*encoded_values)[i].get() : nullptr); } // for } } // Instance fields. if (options_.output_format_ == kOutputPlain) { fprintf(out_file_, " Instance fields -\n"); } if (class_data != nullptr) { dex_ir::FieldItemVector* instance_fields = class_data->InstanceFields(); if (instance_fields != nullptr) { for (uint32_t i = 0; i < instance_fields->size(); i++) { DumpIField((*instance_fields)[i]->GetFieldId()->GetIndex(), (*instance_fields)[i]->GetAccessFlags(), i); } // for } } // Direct methods. if (options_.output_format_ == kOutputPlain) { fprintf(out_file_, " Direct methods -\n"); } if (class_data != nullptr) { dex_ir::MethodItemVector* direct_methods = class_data->DirectMethods(); if (direct_methods != nullptr) { for (uint32_t i = 0; i < direct_methods->size(); i++) { DumpMethod((*direct_methods)[i]->GetMethodId()->GetIndex(), (*direct_methods)[i]->GetAccessFlags(), (*direct_methods)[i]->GetCodeItem(), i); } // for } } // Virtual methods. if (options_.output_format_ == kOutputPlain) { fprintf(out_file_, " Virtual methods -\n"); } if (class_data != nullptr) { dex_ir::MethodItemVector* virtual_methods = class_data->VirtualMethods(); if (virtual_methods != nullptr) { for (uint32_t i = 0; i < virtual_methods->size(); i++) { DumpMethod((*virtual_methods)[i]->GetMethodId()->GetIndex(), (*virtual_methods)[i]->GetAccessFlags(), (*virtual_methods)[i]->GetCodeItem(), i); } // for } } // End of class. if (options_.output_format_ == kOutputPlain) { const char* file_name = "unknown"; if (class_def->SourceFile() != nullptr) { file_name = class_def->SourceFile()->Data(); } const dex_ir::StringId* source_file = class_def->SourceFile(); fprintf(out_file_, " source_file_idx : %d (%s)\n\n", source_file == nullptr ? 0xffffffffU : source_file->GetIndex(), file_name); } else if (options_.output_format_ == kOutputXml) { fprintf(out_file_, "</class>\n"); } free(access_str); } void DexLayout::DumpDexFile() { // Headers. if (options_.show_file_headers_) { DumpFileHeader(); } // Open XML context. if (options_.output_format_ == kOutputXml) { fprintf(out_file_, "<api>\n"); } // Iterate over all classes. char* package = nullptr; const uint32_t class_defs_size = header_->GetCollections().ClassDefsSize(); for (uint32_t i = 0; i < class_defs_size; i++) { DumpClass(i, &package); } // for // Free the last package allocated. if (package != nullptr) { fprintf(out_file_, "</package>\n"); free(package); } // Close XML context. if (options_.output_format_ == kOutputXml) { fprintf(out_file_, "</api>\n"); } } void DexLayout::LayoutClassDefsAndClassData(const DexFile* dex_file) { std::vector<dex_ir::ClassDef*> new_class_def_order; for (std::unique_ptr<dex_ir::ClassDef>& class_def : header_->GetCollections().ClassDefs()) { dex::TypeIndex type_idx(class_def->ClassType()->GetIndex()); if (info_->ContainsClass(*dex_file, type_idx)) { new_class_def_order.push_back(class_def.get()); } } for (std::unique_ptr<dex_ir::ClassDef>& class_def : header_->GetCollections().ClassDefs()) { dex::TypeIndex type_idx(class_def->ClassType()->GetIndex()); if (!info_->ContainsClass(*dex_file, type_idx)) { new_class_def_order.push_back(class_def.get()); } } std::unordered_set<dex_ir::ClassData*> visited_class_data; size_t class_data_index = 0; dex_ir::CollectionVector<dex_ir::ClassData>::Vector& class_datas = header_->GetCollections().ClassDatas(); for (dex_ir::ClassDef* class_def : new_class_def_order) { dex_ir::ClassData* class_data = class_def->GetClassData(); if (class_data != nullptr && visited_class_data.find(class_data) == visited_class_data.end()) { visited_class_data.insert(class_data); // Overwrite the existing vector with the new ordering, note that the sets of objects are // equivalent, but the order changes. This is why this is not a memory leak. // TODO: Consider cleaning this up with a shared_ptr. class_datas[class_data_index].release(); class_datas[class_data_index].reset(class_data); ++class_data_index; } } CHECK_EQ(class_data_index, class_datas.size()); if (DexLayout::kChangeClassDefOrder) { // This currently produces dex files that violate the spec since the super class class_def is // supposed to occur before any subclasses. dex_ir::CollectionVector<dex_ir::ClassDef>::Vector& class_defs = header_->GetCollections().ClassDefs(); CHECK_EQ(new_class_def_order.size(), class_defs.size()); for (size_t i = 0; i < class_defs.size(); ++i) { // Overwrite the existing vector with the new ordering, note that the sets of objects are // equivalent, but the order changes. This is why this is not a memory leak. // TODO: Consider cleaning this up with a shared_ptr. class_defs[i].release(); class_defs[i].reset(new_class_def_order[i]); } } } void DexLayout::LayoutStringData(const DexFile* dex_file) { const size_t num_strings = header_->GetCollections().StringIds().size(); std::vector<bool> is_shorty(num_strings, false); std::vector<bool> from_hot_method(num_strings, false); for (std::unique_ptr<dex_ir::ClassDef>& class_def : header_->GetCollections().ClassDefs()) { // A name of a profile class is probably going to get looked up by ClassTable::Lookup, mark it // as hot. Add its super class and interfaces as well, which can be used during initialization. const bool is_profile_class = info_->ContainsClass(*dex_file, dex::TypeIndex(class_def->ClassType()->GetIndex())); if (is_profile_class) { from_hot_method[class_def->ClassType()->GetStringId()->GetIndex()] = true; const dex_ir::TypeId* superclass = class_def->Superclass(); if (superclass != nullptr) { from_hot_method[superclass->GetStringId()->GetIndex()] = true; } const dex_ir::TypeList* interfaces = class_def->Interfaces(); if (interfaces != nullptr) { for (const dex_ir::TypeId* interface_type : *interfaces->GetTypeList()) { from_hot_method[interface_type->GetStringId()->GetIndex()] = true; } } } dex_ir::ClassData* data = class_def->GetClassData(); if (data == nullptr) { continue; } for (size_t i = 0; i < 2; ++i) { for (auto& method : *(i == 0 ? data->DirectMethods() : data->VirtualMethods())) { const dex_ir::MethodId* method_id = method->GetMethodId(); dex_ir::CodeItem* code_item = method->GetCodeItem(); if (code_item == nullptr) { continue; } const bool is_clinit = is_profile_class && (method->GetAccessFlags() & kAccConstructor) != 0 && (method->GetAccessFlags() & kAccStatic) != 0; const bool method_executed = is_clinit || info_->GetMethodHotness(MethodReference(dex_file, method_id->GetIndex())).IsInProfile(); if (!method_executed) { continue; } is_shorty[method_id->Proto()->Shorty()->GetIndex()] = true; dex_ir::CodeFixups* fixups = code_item->GetCodeFixups(); if (fixups == nullptr) { continue; } // Add const-strings. for (dex_ir::StringId* id : fixups->StringIds()) { from_hot_method[id->GetIndex()] = true; } // Add field classes, names, and types. for (dex_ir::FieldId* id : fixups->FieldIds()) { // TODO: Only visit field ids from static getters and setters. from_hot_method[id->Class()->GetStringId()->GetIndex()] = true; from_hot_method[id->Name()->GetIndex()] = true; from_hot_method[id->Type()->GetStringId()->GetIndex()] = true; } // For clinits, add referenced method classes, names, and protos. if (is_clinit) { for (dex_ir::MethodId* id : fixups->MethodIds()) { from_hot_method[id->Class()->GetStringId()->GetIndex()] = true; from_hot_method[id->Name()->GetIndex()] = true; is_shorty[id->Proto()->Shorty()->GetIndex()] = true; } } } } } // Sort string data by specified order. std::vector<dex_ir::StringId*> string_ids; for (auto& string_id : header_->GetCollections().StringIds()) { string_ids.push_back(string_id.get()); } std::sort(string_ids.begin(), string_ids.end(), [&is_shorty, &from_hot_method](const dex_ir::StringId* a, const dex_ir::StringId* b) { const bool a_is_hot = from_hot_method[a->GetIndex()]; const bool b_is_hot = from_hot_method[b->GetIndex()]; if (a_is_hot != b_is_hot) { return a_is_hot < b_is_hot; } // After hot methods are partitioned, subpartition shorties. const bool a_is_shorty = is_shorty[a->GetIndex()]; const bool b_is_shorty = is_shorty[b->GetIndex()]; if (a_is_shorty != b_is_shorty) { return a_is_shorty < b_is_shorty; } // Order by index by default. return a->GetIndex() < b->GetIndex(); }); dex_ir::CollectionVector<dex_ir::StringData>::Vector& string_datas = header_->GetCollections().StringDatas(); // Now we know what order we want the string data, reorder them. size_t data_index = 0; for (dex_ir::StringId* string_id : string_ids) { string_datas[data_index].release(); string_datas[data_index].reset(string_id->DataItem()); ++data_index; } if (kIsDebugBuild) { std::unordered_set<dex_ir::StringData*> visited; for (const std::unique_ptr<dex_ir::StringData>& data : string_datas) { visited.insert(data.get()); } for (auto& string_id : header_->GetCollections().StringIds()) { CHECK(visited.find(string_id->DataItem()) != visited.end()); } } CHECK_EQ(data_index, string_datas.size()); } // Orders code items according to specified class data ordering. void DexLayout::LayoutCodeItems(const DexFile* dex_file) { static constexpr InvokeType invoke_types[] = { kDirect, kVirtual }; std::unordered_map<dex_ir::CodeItem*, LayoutType>& code_item_layout = layout_hotness_info_.code_item_layout_; // Assign hotness flags to all code items. for (InvokeType invoke_type : invoke_types) { for (std::unique_ptr<dex_ir::ClassDef>& class_def : header_->GetCollections().ClassDefs()) { const bool is_profile_class = info_->ContainsClass(*dex_file, dex::TypeIndex(class_def->ClassType()->GetIndex())); // Skip classes that are not defined in this dex file. dex_ir::ClassData* class_data = class_def->GetClassData(); if (class_data == nullptr) { continue; } for (auto& method : *(invoke_type == InvokeType::kDirect ? class_data->DirectMethods() : class_data->VirtualMethods())) { const dex_ir::MethodId *method_id = method->GetMethodId(); dex_ir::CodeItem *code_item = method->GetCodeItem(); if (code_item == nullptr) { continue; } // Separate executed methods (clinits and profiled methods) from unexecuted methods. const bool is_clinit = (method->GetAccessFlags() & kAccConstructor) != 0 && (method->GetAccessFlags() & kAccStatic) != 0; const bool is_startup_clinit = is_profile_class && is_clinit; using Hotness = ProfileCompilationInfo::MethodHotness; Hotness hotness = info_->GetMethodHotness(MethodReference(dex_file, method_id->GetIndex())); LayoutType state = LayoutType::kLayoutTypeUnused; if (hotness.IsHot()) { // Hot code is compiled, maybe one day it won't be accessed. So lay it out together for // now. state = LayoutType::kLayoutTypeHot; } else if (is_startup_clinit || hotness.GetFlags() == Hotness::kFlagStartup) { // Startup clinit or a method that only has the startup flag. state = LayoutType::kLayoutTypeStartupOnly; } else if (is_clinit) { state = LayoutType::kLayoutTypeUsedOnce; } else if (hotness.IsInProfile()) { state = LayoutType::kLayoutTypeSometimesUsed; } auto it = code_item_layout.emplace(code_item, state); if (!it.second) { LayoutType& layout_type = it.first->second; // Already exists, merge the hotness. layout_type = MergeLayoutType(layout_type, state); } } } } dex_ir::CollectionVector<dex_ir::CodeItem>::Vector& code_items = header_->GetCollections().CodeItems(); if (VLOG_IS_ON(dex)) { size_t layout_count[static_cast<size_t>(LayoutType::kLayoutTypeCount)] = {}; for (const std::unique_ptr<dex_ir::CodeItem>& code_item : code_items) { auto it = code_item_layout.find(code_item.get()); DCHECK(it != code_item_layout.end()); ++layout_count[static_cast<size_t>(it->second)]; } for (size_t i = 0; i < static_cast<size_t>(LayoutType::kLayoutTypeCount); ++i) { LOG(INFO) << "Code items in category " << i << " count=" << layout_count[i]; } } // Sort the code items vector by new layout. The writing process will take care of calculating // all the offsets. Stable sort to preserve any existing locality that might be there. std::stable_sort(code_items.begin(), code_items.end(), [&](const std::unique_ptr<dex_ir::CodeItem>& a, const std::unique_ptr<dex_ir::CodeItem>& b) { auto it_a = code_item_layout.find(a.get()); auto it_b = code_item_layout.find(b.get()); DCHECK(it_a != code_item_layout.end()); DCHECK(it_b != code_item_layout.end()); const LayoutType layout_type_a = it_a->second; const LayoutType layout_type_b = it_b->second; return layout_type_a < layout_type_b; }); } void DexLayout::LayoutOutputFile(const DexFile* dex_file) { LayoutStringData(dex_file); LayoutClassDefsAndClassData(dex_file); LayoutCodeItems(dex_file); } bool DexLayout::OutputDexFile(const DexFile* input_dex_file, bool compute_offsets, std::unique_ptr<DexContainer>* dex_container, std::string* error_msg) { const std::string& dex_file_location = input_dex_file->GetLocation(); std::unique_ptr<File> new_file; // If options_.output_dex_directory_ is non null, we are outputting to a file. if (options_.output_dex_directory_ != nullptr) { std::string output_location(options_.output_dex_directory_); size_t last_slash = dex_file_location.rfind('/'); std::string dex_file_directory = dex_file_location.substr(0, last_slash + 1); if (output_location == dex_file_directory) { output_location = dex_file_location + ".new"; } else if (last_slash != std::string::npos) { output_location += dex_file_location.substr(last_slash); } else { output_location += "/" + dex_file_location + ".new"; } new_file.reset(OS::CreateEmptyFile(output_location.c_str())); if (new_file == nullptr) { LOG(ERROR) << "Could not create dex writer output file: " << output_location; return false; } } if (!DexWriter::Output(this, dex_container, compute_offsets, error_msg)) { return false; } if (new_file != nullptr) { DexContainer* const container = dex_container->get(); DexContainer::Section* const main_section = container->GetMainSection(); if (!new_file->WriteFully(main_section->Begin(), main_section->Size())) { LOG(ERROR) << "Failed to write main section for dex file " << dex_file_location; new_file->Erase(); return false; } DexContainer::Section* const data_section = container->GetDataSection(); if (!new_file->WriteFully(data_section->Begin(), data_section->Size())) { LOG(ERROR) << "Failed to write data section for dex file " << dex_file_location; new_file->Erase(); return false; } UNUSED(new_file->FlushCloseOrErase()); } return true; } /* * Dumps the requested sections of the file. */ bool DexLayout::ProcessDexFile(const char* file_name, const DexFile* dex_file, size_t dex_file_index, std::unique_ptr<DexContainer>* dex_container, std::string* error_msg) { const bool has_output_container = dex_container != nullptr; const bool output = options_.output_dex_directory_ != nullptr || has_output_container; // Try to avoid eagerly assigning offsets to find bugs since GetOffset will abort if the offset // is unassigned. bool eagerly_assign_offsets = false; if (options_.visualize_pattern_ || options_.show_section_statistics_ || options_.dump_) { // These options required the offsets for dumping purposes. eagerly_assign_offsets = true; } std::unique_ptr<dex_ir::Header> header(dex_ir::DexIrBuilder(*dex_file, eagerly_assign_offsets, GetOptions())); SetHeader(header.get()); if (options_.verbose_) { fprintf(out_file_, "Opened '%s', DEX version '%.3s'\n", file_name, dex_file->GetHeader().magic_ + 4); } if (options_.visualize_pattern_) { VisualizeDexLayout(header_, dex_file, dex_file_index, info_); return true; } if (options_.show_section_statistics_) { ShowDexSectionStatistics(header_, dex_file_index); return true; } // Dump dex file. if (options_.dump_) { DumpDexFile(); } // In case we are outputting to a file, keep it open so we can verify. if (output) { // Layout information about what strings and code items are hot. Used by the writing process // to generate the sections that are stored in the oat file. bool do_layout = info_ != nullptr; if (do_layout) { LayoutOutputFile(dex_file); } // The output needs a dex container, use a temporary one. std::unique_ptr<DexContainer> temp_container; if (dex_container == nullptr) { dex_container = &temp_container; } // If we didn't set the offsets eagerly, we definitely need to compute them here. if (!OutputDexFile(dex_file, do_layout || !eagerly_assign_offsets, dex_container, error_msg)) { return false; } // Clear header before verifying to reduce peak RAM usage. const size_t file_size = header_->FileSize(); header.reset(); // Verify the output dex file's structure, only enabled by default for debug builds. if (options_.verify_output_ && has_output_container) { std::string location = "memory mapped file for " + std::string(file_name); // Dex file verifier cannot handle compact dex. bool verify = options_.compact_dex_level_ == CompactDexLevel::kCompactDexLevelNone; const ArtDexFileLoader dex_file_loader; DexContainer::Section* const main_section = (*dex_container)->GetMainSection(); DexContainer::Section* const data_section = (*dex_container)->GetDataSection(); DCHECK_EQ(file_size, main_section->Size()) << main_section->Size() << " " << data_section->Size(); std::unique_ptr<const DexFile> output_dex_file( dex_file_loader.OpenWithDataSection( main_section->Begin(), main_section->Size(), data_section->Begin(), data_section->Size(), location, /* checksum */ 0, /*oat_dex_file*/ nullptr, verify, /*verify_checksum*/ false, error_msg)); CHECK(output_dex_file != nullptr) << "Failed to re-open output file:" << *error_msg; // Do IR-level comparison between input and output. This check ignores potential differences // due to layout, so offsets are not checked. Instead, it checks the data contents of each // item. // // Regenerate output IR to catch any bugs that might happen during writing. std::unique_ptr<dex_ir::Header> output_header( dex_ir::DexIrBuilder(*output_dex_file, /*eagerly_assign_offsets*/ true, GetOptions())); std::unique_ptr<dex_ir::Header> orig_header( dex_ir::DexIrBuilder(*dex_file, /*eagerly_assign_offsets*/ true, GetOptions())); CHECK(VerifyOutputDexFile(output_header.get(), orig_header.get(), error_msg)) << *error_msg; } } return true; } /* * Processes a single file (either direct .dex or indirect .zip/.jar/.apk). */ int DexLayout::ProcessFile(const char* file_name) { if (options_.verbose_) { fprintf(out_file_, "Processing '%s'...\n", file_name); } // If the file is not a .dex file, the function tries .zip/.jar/.apk files, // all of which are Zip archives with "classes.dex" inside. const bool verify_checksum = !options_.ignore_bad_checksum_; std::string error_msg; const ArtDexFileLoader dex_file_loader; std::vector<std::unique_ptr<const DexFile>> dex_files; if (!dex_file_loader.Open( file_name, file_name, /* verify */ true, verify_checksum, &error_msg, &dex_files)) { // Display returned error message to user. Note that this error behavior // differs from the error messages shown by the original Dalvik dexdump. LOG(ERROR) << error_msg; return -1; } // Success. Either report checksum verification or process // all dex files found in given file. if (options_.checksum_only_) { fprintf(out_file_, "Checksum verified\n"); } else { for (size_t i = 0; i < dex_files.size(); i++) { // Pass in a null container to avoid output by default. if (!ProcessDexFile(file_name, dex_files[i].get(), i, /*dex_container*/ nullptr, &error_msg)) { LOG(WARNING) << "Failed to run dex file " << i << " in " << file_name << " : " << error_msg; } } } return 0; } } // namespace art
[ "gyoonus@gmail.com" ]
gyoonus@gmail.com
c50d1a268eb362d72bea24df6ec4b9211bfa1b4a
a8ce1decc8b44e4d553a2d16991c8866afabead8
/src/libraries/ANALYSIS/DReaction_factory_Thrown.h
5311e0e01e75485c45a3e94dab2b2f1a2970a4fb
[]
no_license
dtbinh/sim-recon
9d9761b1982854eb9eeca01ae41921f9904a4708
841e6b69e44f04b38d6172a5bf7a37b3315cad95
refs/heads/master
2020-12-30T19:58:44.908414
2015-09-25T19:02:37
2015-09-25T19:02:37
43,251,182
1
0
null
2015-09-27T15:08:04
2015-09-27T15:08:04
null
UTF-8
C++
false
false
1,526
h
#ifndef _DReaction_factory_Thrown_ #define _DReaction_factory_Thrown_ #include <iostream> #include <deque> #include "JANA/JFactory.h" #include "particleType.h" #include "ANALYSIS/DReaction.h" #include "PID/DMCReaction.h" #include "TRACKING/DMCThrown.h" #include "ANALYSIS/DAnalysisUtilities.h" using namespace jana; using namespace std; class DAnalysisUtilities; class DReaction_factory_Thrown:public jana::JFactory<DReaction> { public: DReaction_factory_Thrown(){use_factory = 1;}; //prevents JANA from searching the input file for these objects ~DReaction_factory_Thrown(){}; const char* Tag(void){return "Thrown";} DReaction* Build_ThrownReaction(JEventLoop* locEventLoop, deque<pair<const DMCThrown*, deque<const DMCThrown*> > >& locThrownSteps); private: jerror_t init(void); ///< Called once at program start. jerror_t brun(jana::JEventLoop *locEventLoop, int runnumber); ///< Called everytime a new run number is detected. jerror_t evnt(jana::JEventLoop *locEventLoop, int eventnumber); ///< Called every event. jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called. jerror_t fini(void); ///< Called after last event of last event source has been processed. const DAnalysisUtilities* dAnalysisUtilities; DReactionStep* Get_ReactionStepResource(void); deque<DReactionStep*> dReactionStepPool_All; deque<DReactionStep*> dReactionStepPool_Available; size_t MAX_dReactionStepPoolSize; }; #endif // _DReaction_factory_Thrown_
[ "pmatt@jlab.org" ]
pmatt@jlab.org
f14f8f85062eb99296c40a8a40749b5e85f73720
c503d2f570dcc4933921819b3d8692c88d67ee51
/数据结构课设/keshe/linklist.cpp
b590f759cb33770b98bbe76cd6e89f74d68b72c5
[]
no_license
hearting/project
acad04fd9ccb8a1bb842cf770ccc2c08d9330346
5ea596ab61b2dec4feaecd2eb034297730aa7d46
refs/heads/master
2023-05-12T12:05:39.402166
2022-03-21T03:56:06
2022-03-21T03:56:06
208,795,914
0
1
null
2023-05-06T19:14:50
2019-09-16T12:37:00
Lasso
GB18030
C++
false
false
3,791
cpp
// Linklist.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include "pch.h" #include "stdio.h" #include<iostream> #include"linklist.h" Linklist L, p, s, q; int n, i, e; void Creatlist(Linklist &L, int &n)//新建链表 { L = (Linklist)malloc(sizeof(LNode)); L->next = NULL; printf("请输入数字个数:"); scanf_s("%d", &n); for (int i = n; i > 0; --i) { p = (Linklist)malloc(sizeof(LNode)); scanf_s("%d", &p->data); p->next = L->next; L->next = p; } } int Insertlist(Linklist &L, int i, int e) //插入 { p = L; int j = 0; while (p&&j < i - 1) { p = p->next; ++j; } if (!p&&j > i - 1) return 0; else s = (Linklist)malloc(sizeof(LNode)); s->data = e; s->next = p->next; p->next = s; return 1; } int Dellist(Linklist &L, int i, int e)//删除 { p = L; int j = 0; while (j < i - 1) { p = p->next; ++j; } if (!(p->next) && j > i - 1) return 0; q = p->next; p->next = q->next; e = q->data; free(q); return e; } int Findlist(Linklist &L, int i)//查找 { p = L; if (p && i > 0) { for (int j = 0; j < i; j++) { p = p->next; } printf("%d\n", p->data); return 1; } else return 0; } void print(Linklist &L)//输出 { p = L->next; for (i = 1; p != NULL; i++) { printf("%d ", p->data); p = p->next; } printf("\n"); } //创建链表 void create(Linklist &L) { char flag = 'y'; Linklist p, s; p = L; puts("创建一个通讯录:"); while (flag == 'Y' || flag == 'y') { //初始化生成块 s = (Linklist)malloc(sizeof(LNode)); printf("姓名:"); scanf("%s", s->name); printf("号码:"); scanf("%s", s->number); //尾插法核心语句开始 s->next = NULL;//注意封口 p->next = s; p = s; //尾插法核心语句结束 //吃换行符 getchar(); printf("继续输入?(y/n)"); scanf("%c", &flag); } } //输出链表 void output(Linklist &L) { p = L->next; puts("编号\t\t\t姓名\t\t\t号码");//表头 //puts("======\t\t\t======\t\t\t======");//华丽的分割线 int count = 1; while (p) { printf("%d\t\t\t%s\t\t\t%s\n", count, p->name, p->number); p = p->next; count++; } } //修改链表中的某一项 void update(Linklist &L) { p = L; int n; puts("需要修改哪一项?"); scanf("%d", &n); for (int i = 1; i < n + 1; i++) { p = p->next;//把指针移位到需要修改的一项 } if (p == NULL) { puts("没有这项!"); } else { printf("姓名:"); scanf("%s", p->name); printf("号码:"); scanf("%s", p->number); } } //在链表尾部插入一项 void insert(Linklist &L) { p = L; while (p->next) {//尾插法,直接把指针移位到尾部 p = p->next; } //初始化生成块 s = (Linklist)malloc(sizeof(LNode)); printf("姓名:"); scanf("%s", s->name); printf("号码:"); scanf("%s", s->number); //尾插法核心语句开始 s->next = NULL;//注意封口 p->next = s; //只插入一项,无须p=s //尾插法核心语句结束 } //在链表中删除一项 void del(Linklist &L) {//不写delete是因为delete是C语言的关键字 p = L; int n; puts("需要删除哪一项?"); scanf("%d", &n); //这里的指针定位不同于修改,我们需要把指针定位到要删除的前一项,进行删除 for (int i = 1; i < n; i++) { p = p->next; } if (p == NULL) { puts("没有这项!"); } else {//删除的核心语句 q = p->next; p->next = q->next; free(q); } } void find(Linklist &L, char name[20]) { Linklist p1; int i = 0; p1 = L; while(p1->next != NULL && strcmp(p1->name,name)!=0) { p1 = p1->next; i++; } if(strcmp(p1->name,name)==0) { printf("序号\t姓名\t号码\t\n"); printf("%d\t",i); printf("%s\t",p1->name); printf("%s\t", p1->number); printf("\n"); } else printf("目前通讯录没这个宝宝!\n"); }
[ "2762036185@qq.com" ]
2762036185@qq.com
307d51d0109f91429190da017c5e1e58e1ee9879
b6807068dbc3a299fd4d5c2c495cde293331660f
/src/avatar_locomanipulation/ik_module/valkyrie_stance_generation.cpp
de3b1faf26e5f2357a4bfcd99d3ae0e4c3a8050c
[ "MIT" ]
permissive
stevenjj/icra2020locomanipulation
5ca5f2cff1ee048f52824b6acffafff067e21216
414085b68cc1b3b24f7b920b543bba9d95350c16
refs/heads/master
2020-07-30T11:35:16.626523
2019-09-26T21:48:45
2019-09-26T21:48:45
210,215,971
6
2
null
null
null
null
UTF-8
C++
false
false
10,391
cpp
#include <avatar_locomanipulation/ik_module/valkyrie_stance_generation.hpp> ValkyrieStanceGeneration::ValkyrieStanceGeneration(){ default_initialization(); } ValkyrieStanceGeneration::ValkyrieStanceGeneration(std::shared_ptr<RobotModel> & robot_model_in):robot_model(robot_model_in){ default_initialization(); this->setRobotModel(robot_model_in); } // Destructors ValkyrieStanceGeneration::~ValkyrieStanceGeneration(){ } void ValkyrieStanceGeneration::setRobotModel(std::shared_ptr<RobotModel> & robot_model_in){ robot_model = robot_model_in; snap_to_floor_ik_module.setRobotModel(robot_model_in); stance_ik_module.setRobotModel(robot_model_in); } void ValkyrieStanceGeneration::setStartingConfig(const Eigen::VectorXd & q_start_in){ q_start = q_start_in; snap_to_floor_ik_module.setInitialConfig(q_start); stance_ik_module.setInitialConfig(q_start); } // Whether or not there is a desired hand pose void ValkyrieStanceGeneration::setUseRightHand(bool use_right_hand_in){ use_right_hand = use_right_hand_in; } void ValkyrieStanceGeneration::setUseLeftHand(bool use_left_hand_in){ use_left_hand = use_left_hand_in; } // Set Desired Hand Poses void ValkyrieStanceGeneration::setDesiredRightHandPose(const Eigen::Vector3d des_pos, const Eigen::Quaterniond des_quat){ rpalm_des_pos = des_pos; rpalm_des_quat = des_quat; } void ValkyrieStanceGeneration::setDesiredLeftHandPose(const Eigen::Vector3d des_pos, const Eigen::Quaterniond des_quat){ lpalm_des_pos = des_pos; lpalm_des_quat = des_quat; } void ValkyrieStanceGeneration::initializeTasks(){ // Set Base Task base_pose_task.reset(new Task6DPose(robot_model, "pelvis")); base_pose_task->setTaskGain(1e-1); // Set Pelvis Tasks pelvis_wrt_rf_task.reset(new TaskXDPosewrtFrame(robot_model, {TASK_DIM_X, TASK_DIM_Y, TASK_DIM_Z}, "pelvis", "rightCOP_Frame")); pelvis_wrt_mf_task.reset(new Task6DPosewrtMidFeet(robot_model, "pelvis")); // Set Foot Tasks lfoot_contact_normal_task.reset(new TaskContactNormalTask(robot_model, "leftCOP_Frame", left_floor_normal, left_floor_center)); rfoot_contact_normal_task.reset(new TaskContactNormalTask(robot_model, "rightCOP_Frame", right_floor_normal, right_floor_center)); lfoot_wrt_rfoot_task.reset(new TaskXDPosewrtFrame(robot_model, {TASK_DIM_X, TASK_DIM_Y, TASK_DIM_RZ}, "leftCOP_Frame", "rightCOP_Frame")); rpalm_task.reset(new Task6DPoseNoRXRY(robot_model, "rightPalm")); lpalm_task.reset(new Task6DPose(robot_model, "leftPalm")); // Clear Torso, neck, and arm Posture Task Names torso_neck_arm_posture_task_names.clear(); // Add Neck to tasks as there is always a neck task for(int i = 0; i < neck_joint_names.size(); i++){ torso_neck_arm_posture_task_names.push_back(neck_joint_names[i]); } // If not using the right hand, add right arm joints to the posture task if (!(use_right_hand)){ for(int i = 0; i < right_arm_joint_names.size(); i++){ torso_neck_arm_posture_task_names.push_back(right_arm_joint_names[i]); } } // If not using the left hand, add left arm joints to the posture task if (!(use_left_hand)){ for(int i = 0; i < left_arm_joint_names.size(); i++){ torso_neck_arm_posture_task_names.push_back(left_arm_joint_names[i]); } } // If neither hands are being used, add torso joint tasks. if (!(use_left_hand || use_right_hand)){ for(int i = 0; i < torso_joint_names.size(); i++){ torso_neck_arm_posture_task_names.push_back(torso_joint_names[i]); } } // Set torso, neck, and arm posture tasks torso_neck_arm_posture_task.reset(new TaskJointConfig(robot_model, torso_neck_arm_posture_task_names)); torso_neck_arm_posture_task->setTaskGain(1e-1); // Set overall posture task overall_posture_task_joint_names = robot_model->joint_names; overall_posture_task.reset(new TaskJointConfig(robot_model, overall_posture_task_joint_names)); overall_posture_task->setTaskGain(1e-1); // Set the task stack createTaskStack(); } void ValkyrieStanceGeneration::createTaskStack(){ // Create Task Stack // std::vector< std::shared_ptr<Task> > priority_1_task_stack = {torso_neck_arm_posture_task, lfoot_wrt_rfoot_task, lfoot_contact_normal_task, rfoot_contact_normal_task}; std::vector< std::shared_ptr<Task> > priority_1_task_stack = {torso_neck_arm_posture_task, pelvis_wrt_mf_task, lfoot_contact_normal_task, rfoot_contact_normal_task}; std::vector< std::shared_ptr<Task> > priority_2_task_stack = {overall_posture_task, base_pose_task}; // If the hand is being used, add it to the task stack if (use_right_hand){ priority_1_task_stack.push_back(rpalm_task); } if (use_left_hand){ priority_1_task_stack.push_back(lpalm_task); } std::vector< std::shared_ptr<Task> > snap_to_floor_tasks_priority_1 = {pelvis_wrt_mf_task, lfoot_wrt_rfoot_task, torso_neck_arm_posture_task, lfoot_contact_normal_task, rfoot_contact_normal_task}; std::vector< std::shared_ptr<Task> > snap_to_floor_tasks_priority_2 = {overall_posture_task, base_pose_task}; // Create the task stack task_stack_snap_to_floor_p1.reset(new TaskStack(robot_model, snap_to_floor_tasks_priority_1)); task_stack_snap_to_floor_p2.reset(new TaskStack(robot_model, snap_to_floor_tasks_priority_2)); task_stack_priority_1.reset(new TaskStack(robot_model, priority_1_task_stack)); task_stack_priority_2.reset(new TaskStack(robot_model, priority_2_task_stack)); // Clear the task hierarchy and add the tasks to hierarchy snap_to_floor_ik_module.clearTaskHierarchy(); snap_to_floor_ik_module.addTasktoHierarchy(task_stack_snap_to_floor_p1); snap_to_floor_ik_module.addTasktoHierarchy(task_stack_snap_to_floor_p2); stance_ik_module.clearTaskHierarchy(); stance_ik_module.addTasktoHierarchy(task_stack_priority_1); stance_ik_module.addTasktoHierarchy(task_stack_priority_2); // Prepare the IK data structures snap_to_floor_ik_module.prepareNewIKDataStrcutures(); stance_ik_module.prepareNewIKDataStrcutures(); } void ValkyrieStanceGeneration::default_initialization(){ // Set desired base configuration base_des_pos.setZero(); base_des_quat.setIdentity(); // Set desired Pelvis configuration wrt right foot pelvis_wrt_rfoot_des_pos.setZero(); pelvis_wrt_rfoot_des_quat.setIdentity(); pelvis_wrt_rfoot_des_pos[1] = 0.125; pelvis_wrt_rfoot_des_pos[2] = 1.0; // Set Default Desired Pelvis Location w.r.t midfeet frame pelvis_wrt_mf_des_pos.setZero(); pelvis_wrt_mf_des_pos[2] = 1.1; pelvis_wrt_mf_des_quat.setIdentity(); // Set Default Contact normals of the feet left_floor_normal.setZero(); left_floor_normal[2] = 1.0; left_floor_center.setZero(); right_floor_normal.setZero(); right_floor_normal[2] = 1.0; right_floor_center.setZero(); // Set Default Left Foot pose with respect to right feet lf_wrt_rf_des_pos.setZero(); lf_wrt_rf_des_pos[1] = 0.25; lf_wrt_rf_des_quat.setIdentity(); // Set Default right and left hand desired locations lpalm_des_pos.setZero(); lpalm_des_quat.setIdentity(); rpalm_des_pos.setZero(); rpalm_des_quat.setIdentity(); // Set Joint names left_arm_joint_names = {"leftShoulderPitch", "leftShoulderRoll", "leftShoulderYaw", "leftElbowPitch", "leftForearmYaw", "leftWristRoll", "leftWristPitch"}; right_arm_joint_names = {"rightShoulderPitch", "rightShoulderRoll", "rightShoulderYaw", "rightElbowPitch", "rightForearmYaw", "rightWristRoll", "rightWristPitch"}; torso_joint_names = {"torsoYaw", "torsoPitch", "torsoRoll"}; neck_joint_names = {"lowerNeckPitch", "neckYaw", "upperNeckPitch"}; } bool ValkyrieStanceGeneration::computeStance(Eigen::VectorXd & q_out){ // Initialize the tasks initializeTasks(); // Set Remaining task references // Set desired base pose to be close to the initial configuration base_pose_task->setReference(Eigen::Vector3d(q_start[0], q_start[1], q_start[2]), Eigen::Quaterniond(q_start[6], q_start[3], q_start[4], q_start[5])); pelvis_wrt_rf_task->setReference(pelvis_wrt_rfoot_des_pos, pelvis_wrt_rfoot_des_quat); pelvis_wrt_mf_task->setReference(pelvis_wrt_mf_des_pos, pelvis_wrt_mf_des_quat); lfoot_wrt_rfoot_task->setReference(lf_wrt_rf_des_pos, lf_wrt_rf_des_quat); rpalm_task->setReference(rpalm_des_pos, rpalm_des_quat); lpalm_task->setReference(lpalm_des_pos, lpalm_des_quat); // Set Posture references Eigen::VectorXd q_des; getSelectedPostureTaskReferences(torso_neck_arm_posture_task_names, q_start, q_des); torso_neck_arm_posture_task->setReference(q_des); getSelectedPostureTaskReferences(overall_posture_task_joint_names, q_start, q_des); overall_posture_task->setReference(q_des); // Set IK Descent parameters snap_to_floor_ik_module.setSequentialDescent(false); snap_to_floor_ik_module.setBackTrackwithCurrentTaskError(true); snap_to_floor_ik_module.setCheckPrevViolations(true); snap_to_floor_ik_module.setEnableInertiaWeighting(false); // stance_ik_module.setSequentialDescent(false); stance_ik_module.setSequentialDescent(true); stance_ik_module.setBackTrackwithCurrentTaskError(true); stance_ik_module.setCheckPrevViolations(true); stance_ik_module.setEnableInertiaWeighting(false); // Perform the sequential IK: bool snap_to_floor_task_convergence = false; bool stance_identification_task_convergence = false; // Step 1: snap the robot to the floor snap_to_floor_task_convergence = snap_to_floor_ik_module.solveIK(solve_result, task_error_norms, total_error_norm, q_sol); // Step 2: Solve for the end effector pose if (snap_to_floor_task_convergence){ this->setStartingConfig(q_sol); stance_identification_task_convergence = stance_ik_module.solveIK(solve_result, task_error_norms, total_error_norm, q_sol); } // Output the solution q_out = q_sol; return (snap_to_floor_task_convergence && stance_identification_task_convergence); } void ValkyrieStanceGeneration::getSelectedPostureTaskReferences(const std::vector<std::string> & selected_names, const Eigen::VectorXd & q_config, Eigen::VectorXd & q_ref){ Eigen::VectorXd q_des; q_des = Eigen::VectorXd::Zero(selected_names.size()); // Use the initial configuration to find the reference vector for the posture task for(int i = 0; i < selected_names.size(); i++){ // std::cout << selected_names[i] << std::endl; q_des[i] = q_config[robot_model->getJointIndex(selected_names[i])]; } q_ref = q_des; }
[ "stevenjensj@gmail.com" ]
stevenjensj@gmail.com
555761dd52493893c3789c53da66b503dcbcf450
8ddef74060accfe362e7940f1b2d823eca116161
/Feature/LargeFileDownloader/LargeFileDownloader/Common/Communication/resourcedownloadstreamtofile.cpp
098f838e8bfe243460b187c5aa8792717504f965
[ "BSD-2-Clause-Views", "BSD-2-Clause" ]
permissive
Bitfall/AppWhirr-SamplesAndPrototypes
a56e72c687c963e39e08964ee5e608083aea05e1
d990391a345f15c7cd516f3dba26867b6d75f3be
refs/heads/master
2021-01-22T23:20:46.777259
2013-01-31T09:58:03
2013-01-31T09:58:03
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,693
cpp
#include "resourcedownloadstreamtofile.h" #include "Common/File/streamtofilemanager.h" #include "Common/Communication/resourcedownloadnetworkrequest.h" using namespace AW::Common::Utils; namespace AW { namespace Common { namespace Communication { ResourceDownloadStreamToFile::ResourceDownloadStreamToFile(CommunicationResourceGateway::CommunicationResourceGatewayCacheDelegate *commResourceGatewayCacheDelegate, unsigned int maxParallelRequestsCount, QObject *parent) : QObject(parent) { _commResourceGateway = new CommunicationResourceGateway(this, commResourceGatewayCacheDelegate, maxParallelRequestsCount, this); connect(_commResourceGateway, SIGNAL(downloadProgressForUrl(int,QUrl)), this, SLOT(_downloadProgressForUrl(int,QUrl))); connect(_commResourceGateway, SIGNAL(resourceDownloadFailedForUrl(QUrl)), this, SLOT(_resourceDownloadFailedForUrl(QUrl))); connect(_commResourceGateway, SIGNAL(resourceChunkReceivedForUrl(QUrl,QByteArray,bool)), this, SLOT(_resourceChunkReceivedForUrl(QUrl,QByteArray,bool))); connect(_commResourceGateway, SIGNAL(resourceDownloadFinishedWithSuccess(QUrl)), this, SLOT(_finishedResourceDownloading(QUrl))); connect(_commResourceGateway, SIGNAL(finishedWithAllRequests()), this, SLOT(_allNetworkRequestsFinished())); } bool ResourceDownloadStreamToFile::addAndInitializeResourceDownloadRequest(QUrl url, QString localTargetFilePath, bool isRemoveLocalTargetFileIfExists) { StreamToFileManager *streamToFileManager = new StreamToFileManager(this); connect(streamToFileManager, SIGNAL(streamingFinishedWithError(QString,QString)), this, SLOT(_streamToFileFailedWithError(QString,QString))); connect(streamToFileManager, SIGNAL(streamingFinishedWithSuccess(QString)), this, SLOT(_streamToFileFinished(QString))); if( !streamToFileManager->startStreamingToFile(localTargetFilePath, isRemoveLocalTargetFileIfExists) ) { AW_QOBJECT_SAFE_DELETE(streamToFileManager); return false; } _resourceStreamToFileManagerHash[url] = streamToFileManager; _commResourceGateway->addResourceUrl(url); return true; } void ResourceDownloadStreamToFile::startDownloadingResources() { _commResourceGateway->startRequests(); } // -------------------------------------------- // resource network request handling void ResourceDownloadStreamToFile::_downloadProgressForUrl(int percent, QUrl url) { Q_EMIT resourceDownloadProgressForUrl(percent, url); } void ResourceDownloadStreamToFile::_resourceDownloadFailedForUrl(QUrl url) { WLog("resource download FAILED: ") << url; StreamToFileManager *streamToFileManager = _resourceStreamToFileManagerHash.value(url); if(streamToFileManager != NULL) { streamToFileManager->abortStreaming(); } else { WLog("Cannot find related stream-to-file manager: ") << url; } } void ResourceDownloadStreamToFile::_resourceChunkReceivedForUrl(QUrl url, QByteArray resourceChunk, bool isBufferDownloadedResourceAndSendItWhenDownloadFinished) { if(isBufferDownloadedResourceAndSendItWhenDownloadFinished) { WLog("isBufferDownloadedResourceAndSendItWhenDownloadFinished is true - it should be false!"); } StreamToFileManager *streamToFileManager = _resourceStreamToFileManagerHash.value(url); if(streamToFileManager != NULL) { streamToFileManager->writeDataToFile(resourceChunk); } else { WLog("Cannot find related stream-to-file manager: ") << url; } } void ResourceDownloadStreamToFile::_finishedResourceDownloading(QUrl url) { StreamToFileManager *streamToFileManager = _resourceStreamToFileManagerHash.value(url); if(streamToFileManager != NULL) { streamToFileManager->closeStreaming(); } else { WLog("Cannot find related stream-to-file manager: ") << url; } } void ResourceDownloadStreamToFile::_allNetworkRequestsFinished() { DLog("All requests finished"); // file operations can be still active if(_resourceStreamToFileManagerHash.isEmpty()) { Q_EMIT finishedWithAllResourceDownloads(); } // if there's some pending file operations we have to wait for finishing of them and emit finished after every file operation finished } // -------------------------------------------- // file-stream handling void ResourceDownloadStreamToFile::_streamToFileFailedWithError(QString filePath, QString errorMessage) { QUrl relatedUrl = this->_getUrlForLocalTargetFilePath(filePath); WLog("Stream to file FAILED with error:") << errorMessage << " | file path:" << filePath << " url:" << relatedUrl; this->_removeResourceStreamToFileManagerByFilePath(filePath); if(relatedUrl.isEmpty()) { WLog("Url not found for file-path:") << filePath; } else { Q_EMIT resourceDownloadFailedForUrl(relatedUrl); } if(_resourceStreamToFileManagerHash.isEmpty()) { Q_EMIT finishedWithAllResourceDownloads(); } } void ResourceDownloadStreamToFile::_streamToFileFinished(QString filePath) { QUrl relatedUrl = this->_getUrlForLocalTargetFilePath(filePath); DLog("Resource download and stream-to-file finished for file-path:") << filePath << " url:" << relatedUrl; this->_removeResourceStreamToFileManagerByFilePath(filePath); if(relatedUrl.isEmpty()) { WLog("Url not found for file-path:") << filePath; } else { Q_EMIT resourceDownloadFinishedWithSuccess(relatedUrl); } if(_resourceStreamToFileManagerHash.isEmpty()) { Q_EMIT finishedWithAllResourceDownloads(); } } // -------------------------------------------- // CommunicationResourceGatewayDelegate BaseNetworkRequest *ResourceDownloadStreamToFile::createResourceDownloadRequest(BaseNetworkRequest::BaseCommunicationRequestType requestType, QUrl requestUrl, QNetworkRequest::CacheLoadControl cacheControl, int timeoutInterval, NetworkRequestCacheDelegate *requestCacheDelegate) { return new ResourceDownloadNetworkRequest(requestType, requestUrl, cacheControl, timeoutInterval, false, requestCacheDelegate); } // -------------------------------------------- // utils void ResourceDownloadStreamToFile::_removeResourceStreamToFileManagerByFilePath(QString filePath) { DLog("Remove streamer for path: ") << filePath; QUrl foundKeyUrl; StreamToFileManager *streamToFileManager = NULL; QHash< QUrl, StreamToFileManager * >::iterator i = _resourceStreamToFileManagerHash.begin(); while (i != _resourceStreamToFileManagerHash.end() && foundKeyUrl.isEmpty()) { StreamToFileManager *currStreamToFileManager = i.value(); if(currStreamToFileManager->getTargetFilePath() == filePath) { foundKeyUrl = i.key(); streamToFileManager = currStreamToFileManager; } ++i; } if(foundKeyUrl.isEmpty()) { WLog("Key url not found for path: ") << filePath; } else { DLog("Url found, will remove related stream manager."); _resourceStreamToFileManagerHash.remove(foundKeyUrl); AW_QOBJECT_SAFE_DELETE(streamToFileManager); } } QUrl ResourceDownloadStreamToFile::_getUrlForLocalTargetFilePath(QString localTargetFilePath) { QUrl foundKeyUrl; QHash< QUrl, StreamToFileManager * >::iterator i = _resourceStreamToFileManagerHash.begin(); while (i != _resourceStreamToFileManagerHash.end() && foundKeyUrl.isEmpty()) { StreamToFileManager *currStreamToFileManager = i.value(); if(currStreamToFileManager->getTargetFilePath() == localTargetFilePath) { foundKeyUrl = i.key(); } ++i; } return foundKeyUrl; } } // namespace Communication } // namespace Common } // namespace AW
[ "viktor.benei@gmail.com" ]
viktor.benei@gmail.com
ababaf55384a172306766f393b0d406b204c774d
3ca3a87a5092c628ce3f2172b0262022c8df8d90
/test-suite/generated-src/cpp/uses_single_language_listeners.hpp
fd20afee280b3ae55bbc16e736b110458a91dd59
[ "Apache-2.0" ]
permissive
bandlab/djinni
4830353e0b012e70b37cea42e16deb70cad4a381
9124fdfefdf889e8fc7b778e75b717d044af9632
refs/heads/master
2023-01-22T16:47:26.994680
2023-01-18T18:27:56
2023-01-18T18:27:56
136,030,256
2
1
Apache-2.0
2020-07-22T03:26:59
2018-06-04T13:35:38
C++
UTF-8
C++
false
false
761
hpp
// AUTOGENERATED FILE - DO NOT MODIFY! // This file generated by Djinni from single_language_interfaces.djinni #pragma once #include <memory> namespace testsuite { class JavaOnlyListener; class ObjcOnlyListener; /** * Generating and compiling this makes sure other languages don't break * on references to interfaces they don't need. */ class UsesSingleLanguageListeners { public: virtual ~UsesSingleLanguageListeners() {} virtual void callForObjC(const std::shared_ptr<ObjcOnlyListener> & l) = 0; virtual std::shared_ptr<ObjcOnlyListener> returnForObjC() = 0; virtual void callForJava(const std::shared_ptr<JavaOnlyListener> & l) = 0; virtual std::shared_ptr<JavaOnlyListener> returnForJava() = 0; }; } // namespace testsuite
[ "atwyman@dropbox.com" ]
atwyman@dropbox.com
9d3d7392f5cef6c653f8c5e2240076aa91b6a21e
0ff1db84963512b70e74fa06894c61566c6c2ecc
/_src/RandomNetworkGenerator.cpp
65f5dbe7ac3a27bee633a1a003b86d34695097a7
[]
no_license
CiaranWelsh/Evogen
72834796a076281c2f2d7c6b2e521bced4da6c89
9c35cb4e5205234b5b4b4d3c09bf9dcc16cefded
refs/heads/master
2023-01-07T20:11:27.409302
2020-11-01T00:55:45
2020-11-01T00:55:45
293,763,013
0
0
null
null
null
null
UTF-8
C++
false
false
26,674
cpp
// // Created by Ciaran on 09/09/2020. // #include "evo/logger.h" #include <chrono> #include <regex> #include <evo/RandomNetworkGenerator.h> #include <evo/logger.h> #include "mpi.h" namespace evo { /************************************************************************ * Constructors */ RandomNetworkGenerator::RandomNetworkGenerator(const RandomNetworkGeneratorOptions &options) : options_(std::make_unique<RandomNetworkGeneratorOptions>(options)) { nc::random::seed(options.getSeed()); } const std::unique_ptr<RandomNetworkGeneratorOptions> &RandomNetworkGenerator::getOptions() const { return options_; } /************************************************************************ * Getters and setters */ void RandomNetworkGenerator::setOptions(std::unique_ptr<RandomNetworkGeneratorOptions> &options) { options_ = std::move(options); } void RandomNetworkGenerator::setOptions(const RandomNetworkGeneratorOptions &options) { options_ = std::make_unique<RandomNetworkGeneratorOptions>(options); } /************************************************************************ * Private member functions */ IndividualPtr RandomNetworkGenerator::generate() { // fist create a roadrunner model to work with std::unique_ptr<RoadRunner> rr_ptr = createRRModel(); Compartments compartments = createCompartments(); for (int i = 0; i < compartments.ids.size(); i++) { rr_ptr->addCompartment( compartments.ids[i], compartments.values[i], false); } // create boundary species BoundarySpecies boundarySpecies = createBoundarySpecies(); for (int i = 0; i < boundarySpecies.ids.size(); i++) { rr_ptr->addSpecies( boundarySpecies.ids[i], compartments.ids[boundarySpecies.compartment_index[i]], boundarySpecies.values[i], false, true, "", false ); } // create floating species FloatingSpecies floatingSpecies = createFloatingSpecies(); for (int i = 0; i < floatingSpecies.ids.size(); i++) { rr_ptr->addSpecies( floatingSpecies.ids[i], compartments.ids[floatingSpecies.compartment_index[i]], floatingSpecies.values[i], false, false, "", false ); } // create reactions Reactions reactions = createReactions(); for (int reaction_number = 0; reaction_number < options_->getNReactions(); reaction_number++) { const EvoRateLaw &rateLaw = reactions.rate_laws[reaction_number]; std::string rate_law_string = rateLaw.getRateLawString(); // need copy not reference as we modify this string const IntVector &substrate_idx_vector = reactions.substrates[reaction_number]; const IntVector &product_idx_vector = reactions.products[reaction_number]; const IntVector &modifier_idx_vector = reactions.modifiers[reaction_number]; // setup some integers to count the current index of substrate, product etc int substrate_count = 0; int product_count = 0; int modifier_count = 0; // and setup a place to store the string representation of the various components StringVector substrate_string_vector; StringVector product_string_vector; // remember that modifers are infered from rate law internally inside roadrunner const RoleMap &roles = rateLaw.getRoles(); for (const auto &role_pair: roles) { const std::string &rate_law_component = role_pair.first; const RoleType &role = role_pair.second; // Regex defined here as its the same expression for all cases. // \b matches a word boundary (\\b escapes the first \) std::regex reg(rate_law_component + "\\b");// switch (role) { case (EVO_PARAMETER) : { // sample between specified boundaries and add to the model auto val = nc::random::uniform<double>(options_->getParameterLowerBound(), options_->getParameterUpperBound()); // ensure unique parameter name. We pass in reference to used parameter names // so we do not have to reload the model each time we add a parameter (performance reasons). std::string parameter_name = generateUniqueParameterID(current_parameter_id_number_, rate_law_component); // remember to keep track of last used id. current_parameter_id_number_++; existing_model_parameters_[parameter_name] = val; // now we add the parameter to the model rr_ptr->addParameter(parameter_name, val, false); // now ensure the placeholder (it.first) contains the newly generated parameter name rate_law_string = regex_replace(rate_law_string, reg, parameter_name); break; } case (EVO_SUBSTRATE) : { const int &substrate_idx = substrate_idx_vector[substrate_count]; substrate_count++; // convert the index to string const std::string &substrate = convertSpeciesIndexToString(boundarySpecies, floatingSpecies, substrate_idx); substrate_string_vector.push_back(substrate); rate_law_string = regex_replace(rate_law_string, reg, substrate); break; } case (EVO_MODIFIER) : { const int &modifier_idx = modifier_idx_vector[modifier_count]; modifier_count++; // convert the index to string const std::string &modifier = convertSpeciesIndexToString(boundarySpecies, floatingSpecies, modifier_idx); rate_law_string = regex_replace(rate_law_string, reg, modifier); break; } case (EVO_PRODUCT) : { const int &product_idx = product_idx_vector[product_count]; product_count++; // convert the index to string const std::string &product = convertSpeciesIndexToString(boundarySpecies, floatingSpecies, product_idx); product_string_vector.push_back(product); rate_law_string = regex_replace(rate_law_string, reg, product); break; } default : { INVALID_ARGUMENT_ERROR << "Unknown role given"; } } } rr_ptr->addReaction( reactions.ids[reaction_number], substrate_string_vector, product_string_vector, rate_law_string, false ); } rr_ptr->regenerate(); Individual individual(std::move(rr_ptr)); return std::make_unique<Individual>(std::move(individual)); } NestedIndividualPtrVector RandomNetworkGenerator::generate(int N) { // initialize MPI MPI_Init(nullptr, nullptr); // Find out rank and world size int world_rank; int world_size;// injected into program with mpirun command. Default is 1. MPI_Comm_rank(MPI_COMM_WORLD, &world_rank); MPI_Comm_size(MPI_COMM_WORLD, &world_size); // create our storage structure to have the world_size elements NestedIndividualPtrVector rr_vec(world_size); int num_per_proc = N / world_size; int r = N % world_size; // todo think about how we can generalize this logic so that we do // not need to rewrite it for everything that we do with mpi. // note it might be possible to follow the decorator pattern. for (int rank = 0; rank < world_size; rank++) { // only when this nodes rank comes up do we do anything if (rank == world_rank) { int nstart; int nend; if (rank < r) {// handle remainder nstart = rank * (num_per_proc + 1); nend = nstart + num_per_proc; } else { nstart = rank * num_per_proc + r; nend = nstart + (num_per_proc - 1); } for (int i = nstart; i < nend + 1; i++) { // nend + 1 so that we have open intervals (0, 3) for instance is 4 items std::unique_ptr<Individual> individual = generate(); // we set the rank of the individual and move it back individual->setRank(rank); rr_vec[rank].push_back(std::move(individual)); } } } MPI_Finalize(); return rr_vec; } std::unique_ptr<RoadRunner> RandomNetworkGenerator::createRRModel() const { if (options_->getCoreSBML().empty()) { auto *rr = new RoadRunner(); return std::move(std::unique_ptr<RoadRunner>(rr)); } else { NOT_IMPLEMENTED_ERROR << "Generating a random network around a core " "sbml model is not yet implemented"; // auto *rr = new RoadRunner(options_->getCoreSBML()); // existing_model_parameters_ = getExistingModelParameters(*rr); // return std::move(std::unique_ptr<RoadRunner>(rr)); } } /************************************************************************ * Protected member functions */ EvoRateLaw RandomNetworkGenerator::getRandomRateLaw() const { std::vector<EvoRateLaw> keys; for (auto &it : options_->getRateLaws()) { keys.push_back(it.second); } if (options_->getRateLaws().empty()) { INVALID_ARGUMENT_ERROR << "The RateLaw field of RandomNetworkGeneratorOptions is " "empty. Please prodive some rate laws to continue"; } int random_rate_law_index = nc::random::randInt<int>(0, (int) options_->getRateLaws().size()); return keys[random_rate_law_index]; } std::vector<int> RandomNetworkGenerator::selectRandomSpeciesIndex(int n) const { int nspecies = options_->getNBoundarySpecies() + options_->getNFloatingSpecies(); // check for the impossible if (n > nspecies) { std::ostringstream err; err << "Requested selecting " << n << " random boundary species without replacement but only " << nspecies << " species exist."; LOGIC_ERROR << err.str(); } // do the sampling std::vector<int> species_indices = sample_with_replacement(n, nspecies); return species_indices; } std::vector<int> RandomNetworkGenerator::sample_with_replacement(int nsamples, int npop) { if (nsamples > npop) { LOGIC_ERROR << "The number of samples cannot be more than the size of the population when sampling" "with replacement"; } std::vector<int> out; for (int j = npop - nsamples + 1; j < npop + 1; j++) { auto random_number = nc::random::uniform<double>(0.0, 1.0); unsigned int t = 1 + (int) j * random_number; if (std::find(out.begin(), out.end(), t) != out.end()) { out.push_back(j); } else { out.push_back(t); } } // we subtract 1 from the output so that we have index friendly numbers // i.e. algorithm is 1 indexed and C++ is 0 indexed. for (int &i : out) { i -= 1; } return out; } std::string RandomNetworkGenerator::generateUniqueParameterID(unsigned long long number, const std::string &base_name) const { StringVector existing_parameter_ids; for (auto &i: existing_model_parameters_) existing_parameter_ids.push_back(i.first); std::ostringstream proposal; proposal << base_name << number; if (std::find(existing_parameter_ids.begin(), existing_parameter_ids.end(), proposal.str()) != existing_parameter_ids.end()) { // id already used number += 1; proposal.str("");// clear the proposal return generateUniqueParameterID(number, base_name); } else { return proposal.str(); } } std::string RandomNetworkGenerator::convertSpeciesIndexToString(const BoundarySpecies &boundarySpecies, const FloatingSpecies &floatingSpecies, int idx) { StringVector species_ids = boundarySpecies.ids; species_ids.insert(species_ids.begin(), floatingSpecies.ids.begin(), floatingSpecies.ids.end()); if (idx < boundarySpecies.ids.size()) { return boundarySpecies.ids[idx]; } else { return floatingSpecies.ids[idx - boundarySpecies.ids.size()]; // offset by num boundary species } } /************************************************************************ * NaiveRandomNetworkGenerator2 */ Compartments NaiveRandomNetworkGenerator::createCompartments() { Compartments compartments; std::ostringstream id; for (int i = 0; i < options_->getNCompartments(); i++) { double val = options_->getCompartmentUpperBound(); if (options_->getCompartmentLowerBound() != options_->getCompartmentUpperBound()) { val = nc::random::uniform<double>(options_->getCompartmentLowerBound(), options_->getCompartmentUpperBound()); } id << "C" << i; compartments.ids.push_back(id.str()); compartments.values.push_back(val); id.str(std::string());// clear the stream } return compartments; } FloatingSpecies NaiveRandomNetworkGenerator::createFloatingSpecies() { FloatingSpecies floatingSpecies; std::ostringstream id; for (int i = 0; i < options_->getNFloatingSpecies(); i++) { id << "S" << i; double val = options_->getSpeciesUpperBound(); if (options_->getSpeciesLowerBound() != options_->getSpeciesUpperBound()) { val = nc::random::uniform<double>(options_->getSpeciesLowerBound(), options_->getSpeciesUpperBound()); } // With single compartment models, go and get the compartment name // with multiple compartment models, random selection int comp_index; if (options_->getNCompartments() == 1) { comp_index = 0; } else { // pick a number between 0 and num compartments comp_index = nc::random::randInt(0, options_->getNCompartments()); } floatingSpecies.ids.push_back(id.str()); floatingSpecies.values.push_back(val); floatingSpecies.compartment_index.push_back(comp_index); id.str(std::string()); } return floatingSpecies; } BoundarySpecies NaiveRandomNetworkGenerator::createBoundarySpecies() { BoundarySpecies boundarySpecies; std::ostringstream id; for (int i = 0; i < options_->getNBoundarySpecies(); i++) { id << "I" << i; double val = options_->getBoundarySpeciesUpperBound(); if (options_->getBoundarySpeciesLowerBound() != options_->getBoundarySpeciesUpperBound()) { val = nc::random::uniform<double>(options_->getBoundarySpeciesLowerBound(), options_->getBoundarySpeciesUpperBound()); } // With single compartment models, go and get the compartment name // with multiple compartment models, random selection int comp_index; if (options_->getNCompartments() == 1) { comp_index = 0; } else { // pick a number between 0 and num compartments comp_index = nc::random::randInt(0, options_->getNCompartments()); } boundarySpecies.ids.push_back(id.str()); boundarySpecies.values.push_back(val); boundarySpecies.compartment_index.push_back(comp_index); id.str(std::string()); } return boundarySpecies; } Reactions NaiveRandomNetworkGenerator::createReactions() { Reactions reactions(options_->getNReactions()); std::ostringstream reaction_name; for (int reaction_number = 0; reaction_number < options_->getNReactions(); reaction_number++) { // generate reaction name; reaction_name << "R" << reaction_number; reactions.ids[reaction_number] = reaction_name.str(); reaction_name.str("");// clear the stream // select a random rate law EvoRateLaw rateLaw = getRandomRateLaw(); reactions.rate_laws[reaction_number] = rateLaw; const RoleMap &roles = rateLaw.getRoles();// from user input // work out how many randomly selected species we need int num_random_species = rateLaw.numSubstrates() + rateLaw.numProducts() + rateLaw.numModifiers(); int total_num_species_possible = options_->getNBoundarySpecies() + options_->getNFloatingSpecies(); // check that it makes sense to randomly generate num_random_species species if (num_random_species > total_num_species_possible) { const std::string &name = rateLaw.getName(); LOGIC_ERROR << "Rate law \"" << name << "\" requires " << num_random_species << " species " << "but your configurations only allow for " << total_num_species_possible << ". Please change your configuration options either by allowing more Floating or Boundary species or " "using different rate laws."; } // randomly sample without replacement std::vector<int> species_indices = selectRandomSpeciesIndex(num_random_species); assert(species_indices.size() == num_random_species); // this will always be true // dish out the species indices to reaction substrates, products or modifiers. for (int s = 0; s < rateLaw.numSubstrates(); s++) { const int &species_idx = species_indices[species_indices.size() - 1]; reactions.substrates[reaction_number].push_back(species_idx); species_indices.resize(species_indices.size() - 1); } for (int s = 0; s < rateLaw.numProducts(); s++) { const int &species_idx = species_indices[species_indices.size() - 1]; reactions.products[reaction_number].push_back(species_idx); species_indices.resize(species_indices.size() - 1); } for (int s = 0; s < rateLaw.numModifiers(); s++) { const int &species_idx = species_indices[species_indices.size() - 1]; reactions.modifiers[reaction_number].push_back(species_idx); species_indices.resize(species_indices.size() - 1); } assert(species_indices.empty()); } return reactions; } /***************************************************************************** * UniqueReactionsRandomNetworkGenerator */ UniqueReactionsRandomNetworkGenerator::UniqueReactionsRandomNetworkGenerator( const RandomNetworkGeneratorOptions &options, int max_recursion) : NaiveRandomNetworkGenerator(options), max_recursion_(max_recursion) {} Reactions UniqueReactionsRandomNetworkGenerator::createReactions() { NOT_IMPLEMENTED_ERROR << "This class does not yet work"; Reactions reactions(options_->getNReactions()); std::ostringstream reaction_name; int reaction_number = 0; int recursion_count = 0; while (reactions.size() != options_->getNReactions()) { // generate reaction name; reaction_name << "R" << reaction_number; // select a random rate law EvoRateLaw rateLaw = getRandomRateLaw(); const RoleMap &roles = rateLaw.getRoles();// from user input // work out how many randomly selected species we need int num_random_species = rateLaw.numSubstrates() + rateLaw.numProducts() + rateLaw.numModifiers(); int total_num_species_possible = options_->getNBoundarySpecies() + options_->getNFloatingSpecies(); // check that it makes sense to randomly generate num_random_species species if (num_random_species > total_num_species_possible) { const std::string &name = rateLaw.getName(); LOGIC_ERROR << "Rate law \"" << name << "\" requires " << num_random_species << " species " << "but your configurations only allow for " << total_num_species_possible << ". Please change your configuration options either by allowing more Floating or Boundary species or " "using different rate laws."; } // randomly sample without replacement std::vector<int> species_indices = selectRandomSpeciesIndex(num_random_species); assert(species_indices.size() == num_random_species); // this will always be true std::vector<int> substrates; std::vector<int> products; std::vector<int> modifiers; // dish out the species indices to reaction substrates, products or modifiers. for (int s = 0; s < rateLaw.numSubstrates(); s++) { const int &species_idx = species_indices[species_indices.size() - 1]; substrates.push_back(species_idx); species_indices.resize(species_indices.size() - 1); } for (int s = 0; s < rateLaw.numProducts(); s++) { const int &species_idx = species_indices[species_indices.size() - 1]; products.push_back(species_idx); species_indices.resize(species_indices.size() - 1); } for (int s = 0; s < rateLaw.numModifiers(); s++) { const int &species_idx = species_indices[species_indices.size() - 1]; modifiers.push_back(species_idx); species_indices.resize(species_indices.size() - 1); } assert(species_indices.empty()); //todo put a max fail break in that breaks the recursion // first sort so we are guarenteed to have same ordering each time we do comparison std::sort(substrates.begin(), substrates.end()); std::sort(products.begin(), products.end()); std::sort(modifiers.begin(), modifiers.end()); bool substrates_in_reaction = false; bool products_in_reaction = false; bool modifiers_in_reaction = false; if (std::find(reactions.substrates.begin(), reactions.substrates.end(), substrates) != reactions.substrates.end()) substrates_in_reaction = true; if (std::find(reactions.products.begin(), reactions.products.end(), products) != reactions.products.end()) products_in_reaction = true; if (std::find(reactions.modifiers.begin(), reactions.modifiers.end(), modifiers) != reactions.modifiers.end()) modifiers_in_reaction = true; if (substrates_in_reaction && products_in_reaction && modifiers_in_reaction) { // otherwise a like reaction is already defined reaction_number--; // subtract 1 from reaction number to keep reaction count linear. recursion_count++; if (recursion_count == max_recursion_) { LOG("Max recursion of " << max_recursion_ << " has been reached."); break; } } else { // we only add to model when these three are false reactions.ids[reaction_number] = reaction_name.str(); reaction_name.str("");// clear the stream reactions.rate_laws[reaction_number] = rateLaw; reactions.substrates[reaction_number] = substrates; reactions.products[reaction_number] = products; reactions.modifiers[reaction_number] = modifiers; recursion_count = 0; // reset the recursion count since we successfully added a reaction. } } return reactions; } // RandomNetworkGenerator* RandomNetworkFactory(const RandomNetworkGeneratorOptions &options, EvoRandomNetworkGenerator which){ // // switch(which){ // case (EVO_NAIVE_RANDOM_NETWORK_GENERATOR):{ // NaiveRandomNetworkGenerator generator(options); // return std::move(generator); // } // case EVO_UNIQUE_REACTIONS_RANDOM_NETWORK_GENERATOR: // break; // } // } }// namespace evo
[ "cwelsh2@uw.edu" ]
cwelsh2@uw.edu
9d2046653b60812d2c0ae3a8c1a4477712e85fe3
7ebd45b6cb362ef98d7e8138e05c0f12f2a10e82
/src/sample.h
86eeb773cf5db7483dad4336be6c9fa4f7630292
[]
no_license
ohinds/perfen
1d0f70350504400e9e18af71f86b33aa2cab4cbc
785648268fcbafa5d672080806f3d8380f817e1f
refs/heads/master
2020-12-24T18:03:30.830878
2015-10-02T21:26:35
2015-10-02T21:26:35
41,813,804
0
0
null
null
null
null
UTF-8
C++
false
false
616
h
// class to hold one audio sample #pragma once #include <cmath> #include <memory> #include <string> #include "types.h" class Sample { public: Sample(const std::string &filename, float pan); ~Sample(); // loads the audio from the specified file bool load(); const std::string& getFilename() const { return filename; } nframes_t getNumFrames() const { return audio[0].size(); } bool getAudioFrames(nframes_t start_frame, nframes_t num_frames, stereo_sample_vec* samples) const; private: std::string filename; float pan; stereo_sample_vec audio; };
[ "ohinds@gmail.com" ]
ohinds@gmail.com
5e2487cadcee925106622e170798e4967c3cd883
e73e31c1acf01a124e628e95db48b8cb7e218e1c
/unittests/btree.cpp
271e47ebf1a3eacf749c70fa2d2974110bd4fb64
[ "Apache-2.0", "LicenseRef-scancode-proprietary-license", "LicenseRef-scancode-protobuf" ]
permissive
billon-pl/upscaledb
06f7fe5919a56c4794dc0a281cf5c5a2cce2e59a
da365e3504346b968b6d35de2185f12bba1c1ede
refs/heads/master
2020-03-20T01:56:34.322777
2018-06-20T11:00:04
2018-06-20T11:00:04
137,094,250
1
0
Apache-2.0
2018-06-20T11:00:05
2018-06-12T15:46:48
C++
UTF-8
C++
false
false
13,203
cpp
/* * Copyright (C) 2005-2017 Christoph Rupp (chris@crupp.de). * * 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. * * See the file COPYING for License information. */ #include "3rdparty/catch/catch.hpp" #include "3page_manager/page_manager.h" #include "4env/env_local.h" #include "4context/context.h" #include "os.hpp" #include "fixture.hpp" namespace upscaledb { bool g_split = false; extern void (*g_BTREE_INSERT_SPLIT_HOOK)(void); static void split_hook() { g_split = true; } struct BtreeFixture : BaseFixture { void binaryTypeTest() { ups_parameter_t ps[] = { { UPS_PARAM_KEY_TYPE, UPS_TYPE_BINARY }, { 0, 0 } }; // create the database with flags and parameters require_create(0, nullptr, 0, ps); ups_parameter_t query[] = { {UPS_PARAM_KEY_TYPE, 0}, {UPS_PARAM_KEY_SIZE, 0}, {UPS_PARAM_MAX_KEYS_PER_PAGE, 0}, {UPS_PARAM_RECORD_SIZE, 0}, {0, 0} }; DbProxy dbp(db); dbp.require_parameters(query); REQUIRE((uint64_t)UPS_TYPE_BINARY == query[0].value); REQUIRE(UPS_KEY_SIZE_UNLIMITED == query[1].value); REQUIRE(441u == (unsigned)query[2].value); REQUIRE(UPS_RECORD_SIZE_UNLIMITED == query[3].value); #ifdef HAVE_GCC_ABI_DEMANGLE std::string s = btree_index()->test_get_classname(); REQUIRE(s == "upscaledb::BtreeIndexTraitsImpl<upscaledb::DefaultNodeImpl<upscaledb::VariableLengthKeyList, upscaledb::DefaultRecordList>, upscaledb::VariableSizeCompare>"); #endif } void fixedTypeTest(int type, int size, int maxkeys, const char *abiname) { std::string abi; ups_parameter_t ps[] = { { UPS_PARAM_KEY_TYPE, (uint64_t)type }, { 0, 0 }, { 0, 0 } }; if (type == UPS_TYPE_BINARY) { ps[1].name = UPS_PARAM_KEY_SIZE; ps[1].value = size; } // create the database with flags and parameters require_create(0, nullptr, 0, ps); ups_parameter_t query[] = { {UPS_PARAM_KEY_TYPE, 0}, {UPS_PARAM_KEY_SIZE, 0}, {UPS_PARAM_MAX_KEYS_PER_PAGE, 0}, {0, 0} }; DbProxy dbp(db); dbp.require_parameters(query); REQUIRE(type == (int)query[0].value); REQUIRE(size == (int)query[1].value); REQUIRE(maxkeys == (int)query[2].value); #ifdef HAVE_GCC_ABI_DEMANGLE abi = ((LocalDb *)db)->btree_index->test_get_classname(); REQUIRE(abi == abiname); #endif // only keys with that specific length are allowed ups_cursor_t *cursor; REQUIRE(0 == ups_cursor_create(&cursor, db, 0, 0)); char buffer[100] = {0}; ups_key_t key = ups_make_key(buffer, (uint16_t)(size + 1)); ups_record_t rec = {0}; REQUIRE(UPS_INV_KEY_SIZE == ups_db_insert(db, 0, &key, &rec, 0)); REQUIRE(UPS_INV_KEY_SIZE == ups_cursor_insert(cursor, &key, &rec, 0)); key.size = size - 1; REQUIRE(UPS_INV_KEY_SIZE == ups_db_insert(db, 0, &key, &rec, 0)); REQUIRE(UPS_INV_KEY_SIZE == ups_cursor_insert(cursor, &key, &rec, 0)); key.size = size; REQUIRE(0 == ups_db_insert(db, 0, &key, &rec, 0)); REQUIRE(0 == ups_cursor_insert(cursor, &key, &rec, UPS_OVERWRITE)); // reopen and check the demangled API string once more close(); require_open(); REQUIRE(0 == ups_db_get_parameters(db, query)); REQUIRE(type == (int)query[0].value); REQUIRE(size == (int)query[1].value); REQUIRE(maxkeys == (int)query[2].value); #ifdef HAVE_GCC_ABI_DEMANGLE std::string abi2; abi2 = btree_index()->test_get_classname(); REQUIRE(abi2 == abi); #endif } void autoDefaultRecords() { ups_parameter_t p1[] = { { UPS_PARAM_PAGE_SIZE, 1024 * 64 }, { 0, 0 } }; ups_parameter_t p2[] = { { UPS_PARAM_KEY_TYPE, UPS_TYPE_UINT32 }, { UPS_PARAM_RECORD_SIZE, 10 }, { 0, 0 } }; // create the database with flags and parameters require_create(0, p1, 0, p2); ups_parameter_t query[] = { {UPS_PARAM_KEY_TYPE, 0}, {UPS_PARAM_KEY_SIZE, 0}, {UPS_PARAM_RECORD_SIZE, 0}, {UPS_PARAM_MAX_KEYS_PER_PAGE, 0}, {UPS_PARAM_FLAGS, 0}, {0, 0} }; REQUIRE(0 == ups_db_get_parameters(db, query)); REQUIRE(UPS_TYPE_UINT32 == (int)query[0].value); REQUIRE(4 == (int)query[1].value); REQUIRE(10 == (int)query[2].value); REQUIRE(4677 == (int)query[3].value); REQUIRE(UPS_FORCE_RECORDS_INLINE == (int)query[4].value); // reopen and make sure the flag was persisted close(); require_open(); REQUIRE(0 == ups_db_get_parameters(db, query)); REQUIRE(UPS_TYPE_UINT32 == (int)query[0].value); REQUIRE(4 == (int)query[1].value); REQUIRE(10 == (int)query[2].value); REQUIRE(4677 == (int)query[3].value); REQUIRE(UPS_FORCE_RECORDS_INLINE == (int)query[4].value); } void persistentNodeFlags() { ups_parameter_t p[] = { { UPS_PARAM_KEY_TYPE, UPS_TYPE_UINT32 }, { UPS_PARAM_RECORD_SIZE, 10 }, { 0, 0 } }; // create the database with flags and parameters require_create(0, nullptr, 0, p); ups_parameter_t query[] = { {UPS_PARAM_KEY_TYPE, 0}, {UPS_PARAM_KEY_SIZE, 0}, {UPS_PARAM_RECORD_SIZE, 0}, {UPS_PARAM_MAX_KEYS_PER_PAGE, 0}, {UPS_PARAM_FLAGS, 0}, {0, 0} }; REQUIRE(0 == ups_db_get_parameters(db, query)); REQUIRE(UPS_TYPE_UINT32 == (int)query[0].value); REQUIRE(4 == (int)query[1].value); REQUIRE(10 == (int)query[2].value); REQUIRE(1166 == (int)query[3].value); REQUIRE(UPS_FORCE_RECORDS_INLINE == (int)query[4].value); // now insert a key uint32_t k = 33; char buffer[10] = {0}; ups_key_t key = ups_make_key(&k, sizeof(k)); ups_record_t rec = ups_make_record(buffer, sizeof(buffer)); REQUIRE(0 == ups_db_insert(db, 0, &key, &rec, 0)); // reopen and fetch the root page of the database close(); require_open(); Context context(lenv(), 0, 0); Page *page = 0; REQUIRE((page = lenv()->page_manager->fetch(&context, 1024 * 16))); context.changeset.clear(); // unlock pages PBtreeNode *node = PBtreeNode::from_page(page); REQUIRE(ISSET(node->flags(), PBtreeNode::kLeafNode)); } void internalNodeTest() { Page *page; BtreeNodeProxy *node; ups_parameter_t p[] = { { UPS_PARAM_KEY_TYPE, UPS_TYPE_UINT32 }, { UPS_PARAM_RECORD_SIZE, 10 }, { 0, 0 } }; // create the database with flags and parameters require_create(0, nullptr, 0, p); Context context(lenv(), 0, 0); g_BTREE_INSERT_SPLIT_HOOK = split_hook; // check if the root page proxy was created correctly (it's a leaf) REQUIRE((page = lenv()->page_manager->fetch(&context, 1024 * 16))); context.changeset.clear(); // unlock pages node = btree_index()->get_node_from_page(page); REQUIRE(ISSET(node->flags(), PBtreeNode::kLeafNode)); #ifdef HAVE_GCC_ABI_DEMANGLE std::string expected_internalname = "upscaledb::BtreeNodeProxyImpl<upscaledb::PaxNodeImpl<upscaledb::PodKeyList<unsigned int>, upscaledb::InternalRecordList>, upscaledb::NumericCompare<unsigned int> >"; std::string expected_leafname = "upscaledb::BtreeNodeProxyImpl<upscaledb::PaxNodeImpl<upscaledb::PodKeyList<unsigned int>, upscaledb::InlineRecordList>, upscaledb::NumericCompare<unsigned int> >"; REQUIRE(node->test_get_classname() == expected_leafname); #endif char buffer[10] = {0}; uint32_t k = 1; ups_key_t key = ups_make_key(&k, sizeof(k)); ups_record_t rec = ups_make_record(buffer, sizeof(buffer)); // now insert keys till the page is split and a new root is created g_split = false; while (!g_split) { REQUIRE(0 == ups_db_insert(db, 0, &key, &rec, 0)); k++; } // now check the leaf page (same as the previous root page) REQUIRE((page = lenv()->page_manager->fetch(&context, 1024 * 16))); context.changeset.clear(); // unlock pages node = btree_index()->get_node_from_page(page); REQUIRE(ISSET(node->flags(), PBtreeNode::kLeafNode)); #ifdef HAVE_GCC_ABI_DEMANGLE REQUIRE(node->test_get_classname() == expected_leafname); #endif // check the other leaf REQUIRE((page = lenv()->page_manager->fetch(&context, 2 * 1024 * 16))); context.changeset.clear(); // unlock pages node = btree_index()->get_node_from_page(page); REQUIRE(ISSET(node->flags(), PBtreeNode::kLeafNode)); #ifdef HAVE_GCC_ABI_DEMANGLE REQUIRE(node->test_get_classname() == expected_leafname); #endif // and the new root page (must be an internal page) REQUIRE((page = lenv()->page_manager->fetch(&context, 3 * 1024 * 16))); context.changeset.clear(); // unlock pages node = btree_index()->get_node_from_page(page); REQUIRE(NOTSET(node->flags(), PBtreeNode::kLeafNode)); #ifdef HAVE_GCC_ABI_DEMANGLE REQUIRE(node->test_get_classname() == expected_internalname); #endif } void forceInternalNodeTest() { ups_parameter_t p[] = { { UPS_PARAM_KEY_TYPE, UPS_TYPE_UINT32 }, { UPS_PARAM_RECORD_SIZE, 512 }, { 0, 0 } }; // create the database with flags and parameters require_create(0, nullptr, UPS_FORCE_RECORDS_INLINE, p); ups_parameter_t query[] = { {UPS_PARAM_KEY_TYPE, 0}, {UPS_PARAM_KEY_SIZE, 0}, {UPS_PARAM_RECORD_SIZE, 0}, {UPS_PARAM_MAX_KEYS_PER_PAGE, 0}, {UPS_PARAM_FLAGS, 0}, {0, 0} }; REQUIRE(0 == ups_db_get_parameters(db, query)); REQUIRE(UPS_TYPE_UINT32 == (int)query[0].value); REQUIRE(4 == (int)query[1].value); REQUIRE(512 == (int)query[2].value); REQUIRE(31 == (int)query[3].value); REQUIRE(UPS_FORCE_RECORDS_INLINE == (int)query[4].value); close(); require_open(); // reopen and make sure the flag was persisted REQUIRE(0 == ups_db_get_parameters(db, query)); REQUIRE(UPS_TYPE_UINT32 == (int)query[0].value); REQUIRE(4 == (int)query[1].value); REQUIRE(512 == (int)query[2].value); REQUIRE(31 == (int)query[3].value); REQUIRE(UPS_FORCE_RECORDS_INLINE == (int)query[4].value); } }; TEST_CASE("Btree/binaryTypeTest", "") { BtreeFixture f; f.binaryTypeTest(); } TEST_CASE("Btree/uint8Type", "") { BtreeFixture f; f.fixedTypeTest(UPS_TYPE_UINT8, 1, 1633, "upscaledb::BtreeIndexTraitsImpl<upscaledb::PaxNodeImpl<upscaledb::PodKeyList<unsigned char>, upscaledb::DefaultRecordList>, upscaledb::NumericCompare<unsigned char> >"); } TEST_CASE("Btree/uint16Type", "") { BtreeFixture f; f.fixedTypeTest(UPS_TYPE_UINT16, 2, 1485, "upscaledb::BtreeIndexTraitsImpl<upscaledb::PaxNodeImpl<upscaledb::PodKeyList<unsigned short>, upscaledb::DefaultRecordList>, upscaledb::NumericCompare<unsigned short> >"); } TEST_CASE("Btree/uint32Type", "") { BtreeFixture f; f.fixedTypeTest(UPS_TYPE_UINT32, 4, 1256, "upscaledb::BtreeIndexTraitsImpl<upscaledb::PaxNodeImpl<upscaledb::PodKeyList<unsigned int>, upscaledb::DefaultRecordList>, upscaledb::NumericCompare<unsigned int> >"); } TEST_CASE("Btree/uint64Type", "") { BtreeFixture f; const char *abiname; if (sizeof(unsigned long) == 4) abiname = "upscaledb::BtreeIndexTraitsImpl<upscaledb::PaxNodeImpl<upscaledb::PodKeyList<unsigned long long>, upscaledb::DefaultRecordList>, upscaledb::NumericCompare<unsigned long long> >"; else abiname = "upscaledb::BtreeIndexTraitsImpl<upscaledb::PaxNodeImpl<upscaledb::PodKeyList<unsigned long>, upscaledb::DefaultRecordList>, upscaledb::NumericCompare<unsigned long> >"; f.fixedTypeTest(UPS_TYPE_UINT64, 8, 960, abiname); } TEST_CASE("Btree/real32Type", "") { BtreeFixture f; f.fixedTypeTest(UPS_TYPE_REAL32, 4, 1256, "upscaledb::BtreeIndexTraitsImpl<upscaledb::PaxNodeImpl<upscaledb::PodKeyList<float>, upscaledb::DefaultRecordList>, upscaledb::NumericCompare<float> >"); } TEST_CASE("Btree/real64Type", "") { BtreeFixture f; f.fixedTypeTest(UPS_TYPE_REAL64, 8, 960, "upscaledb::BtreeIndexTraitsImpl<upscaledb::PaxNodeImpl<upscaledb::PodKeyList<double>, upscaledb::DefaultRecordList>, upscaledb::NumericCompare<double> >"); } TEST_CASE("Btree/fixedBinaryType", "") { BtreeFixture f; f.fixedTypeTest(UPS_TYPE_BINARY, 8, 960, "upscaledb::BtreeIndexTraitsImpl<upscaledb::PaxNodeImpl<upscaledb::BinaryKeyList, upscaledb::DefaultRecordList>, upscaledb::FixedSizeCompare>"); } TEST_CASE("Btree/autoDefaultRecords", "") { BtreeFixture f; f.autoDefaultRecords(); } TEST_CASE("Btree/persistentNodeFlags", "") { BtreeFixture f; f.persistentNodeFlags(); } TEST_CASE("Btree/internalNodeTest", "") { BtreeFixture f; f.internalNodeTest(); } TEST_CASE("Btree/forceInternalNodeTest", "") { BtreeFixture f; f.forceInternalNodeTest(); } } // namespace upscaledb
[ "zbigniew.romanowski@billongroup.com" ]
zbigniew.romanowski@billongroup.com
63be564bf87cca4cbe29c47afeda6bd297128264
60db84d8cb6a58bdb3fb8df8db954d9d66024137
/android-cpp-sdk/platforms/android-9/javax/security/auth/Subject.hpp
0339912f2e173ed61cca1d508b787c54dab45478
[ "BSL-1.0" ]
permissive
tpurtell/android-cpp-sdk
ba853335b3a5bd7e2b5c56dcb5a5be848da6550c
8313bb88332c5476645d5850fe5fdee8998c2415
refs/heads/master
2021-01-10T20:46:37.322718
2012-07-17T22:06:16
2012-07-17T22:06:16
37,555,992
5
4
null
null
null
null
UTF-8
C++
false
false
13,599
hpp
/*================================================================================ code generated by: java2cpp author: Zoran Angelov, mailto://baldzar@gmail.com class: javax.security.auth.Subject ================================================================================*/ #ifndef J2CPP_INCLUDE_IMPLEMENTATION #ifndef J2CPP_JAVAX_SECURITY_AUTH_SUBJECT_HPP_DECL #define J2CPP_JAVAX_SECURITY_AUTH_SUBJECT_HPP_DECL namespace j2cpp { namespace java { namespace lang { class String; } } } namespace j2cpp { namespace java { namespace lang { class Class; } } } namespace j2cpp { namespace java { namespace lang { class Object; } } } namespace j2cpp { namespace java { namespace security { class PrivilegedExceptionAction; } } } namespace j2cpp { namespace java { namespace security { class AccessControlContext; } } } namespace j2cpp { namespace java { namespace security { class PrivilegedAction; } } } namespace j2cpp { namespace java { namespace util { class Set; } } } namespace j2cpp { namespace java { namespace io { class Serializable; } } } #include <java/io/Serializable.hpp> #include <java/lang/Class.hpp> #include <java/lang/Object.hpp> #include <java/lang/String.hpp> #include <java/security/AccessControlContext.hpp> #include <java/security/PrivilegedAction.hpp> #include <java/security/PrivilegedExceptionAction.hpp> #include <java/util/Set.hpp> namespace j2cpp { namespace javax { namespace security { namespace auth { class Subject; class Subject : public object<Subject> { public: J2CPP_DECLARE_CLASS J2CPP_DECLARE_METHOD(0) J2CPP_DECLARE_METHOD(1) J2CPP_DECLARE_METHOD(2) J2CPP_DECLARE_METHOD(3) J2CPP_DECLARE_METHOD(4) J2CPP_DECLARE_METHOD(5) J2CPP_DECLARE_METHOD(6) J2CPP_DECLARE_METHOD(7) J2CPP_DECLARE_METHOD(8) J2CPP_DECLARE_METHOD(9) J2CPP_DECLARE_METHOD(10) J2CPP_DECLARE_METHOD(11) J2CPP_DECLARE_METHOD(12) J2CPP_DECLARE_METHOD(13) J2CPP_DECLARE_METHOD(14) J2CPP_DECLARE_METHOD(15) J2CPP_DECLARE_METHOD(16) J2CPP_DECLARE_METHOD(17) explicit Subject(jobject jobj) : object<Subject>(jobj) { } operator local_ref<java::lang::Object>() const; operator local_ref<java::io::Serializable>() const; Subject(); Subject(jboolean, local_ref< java::util::Set > const&, local_ref< java::util::Set > const&, local_ref< java::util::Set > const&); static local_ref< java::lang::Object > doAs(local_ref< javax::security::auth::Subject > const&, local_ref< java::security::PrivilegedAction > const&); static local_ref< java::lang::Object > doAsPrivileged(local_ref< javax::security::auth::Subject > const&, local_ref< java::security::PrivilegedAction > const&, local_ref< java::security::AccessControlContext > const&); static local_ref< java::lang::Object > doAs(local_ref< javax::security::auth::Subject > const&, local_ref< java::security::PrivilegedExceptionAction > const&); static local_ref< java::lang::Object > doAsPrivileged(local_ref< javax::security::auth::Subject > const&, local_ref< java::security::PrivilegedExceptionAction > const&, local_ref< java::security::AccessControlContext > const&); jboolean equals(local_ref< java::lang::Object > const&); local_ref< java::util::Set > getPrincipals(); local_ref< java::util::Set > getPrincipals(local_ref< java::lang::Class > const&); local_ref< java::util::Set > getPrivateCredentials(); local_ref< java::util::Set > getPrivateCredentials(local_ref< java::lang::Class > const&); local_ref< java::util::Set > getPublicCredentials(); local_ref< java::util::Set > getPublicCredentials(local_ref< java::lang::Class > const&); jint hashCode(); void setReadOnly(); jboolean isReadOnly(); local_ref< java::lang::String > toString(); static local_ref< javax::security::auth::Subject > getSubject(local_ref< java::security::AccessControlContext > const&); }; //class Subject } //namespace auth } //namespace security } //namespace javax } //namespace j2cpp #endif //J2CPP_JAVAX_SECURITY_AUTH_SUBJECT_HPP_DECL #else //J2CPP_INCLUDE_IMPLEMENTATION #ifndef J2CPP_JAVAX_SECURITY_AUTH_SUBJECT_HPP_IMPL #define J2CPP_JAVAX_SECURITY_AUTH_SUBJECT_HPP_IMPL namespace j2cpp { javax::security::auth::Subject::operator local_ref<java::lang::Object>() const { return local_ref<java::lang::Object>(get_jobject()); } javax::security::auth::Subject::operator local_ref<java::io::Serializable>() const { return local_ref<java::io::Serializable>(get_jobject()); } javax::security::auth::Subject::Subject() : object<javax::security::auth::Subject>( call_new_object< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(0), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(0) >() ) { } javax::security::auth::Subject::Subject(jboolean a0, local_ref< java::util::Set > const &a1, local_ref< java::util::Set > const &a2, local_ref< java::util::Set > const &a3) : object<javax::security::auth::Subject>( call_new_object< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(1), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(1) >(a0, a1, a2, a3) ) { } local_ref< java::lang::Object > javax::security::auth::Subject::doAs(local_ref< javax::security::auth::Subject > const &a0, local_ref< java::security::PrivilegedAction > const &a1) { return call_static_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(2), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(2), local_ref< java::lang::Object > >(a0, a1); } local_ref< java::lang::Object > javax::security::auth::Subject::doAsPrivileged(local_ref< javax::security::auth::Subject > const &a0, local_ref< java::security::PrivilegedAction > const &a1, local_ref< java::security::AccessControlContext > const &a2) { return call_static_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(3), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(3), local_ref< java::lang::Object > >(a0, a1, a2); } local_ref< java::lang::Object > javax::security::auth::Subject::doAs(local_ref< javax::security::auth::Subject > const &a0, local_ref< java::security::PrivilegedExceptionAction > const &a1) { return call_static_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(4), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(4), local_ref< java::lang::Object > >(a0, a1); } local_ref< java::lang::Object > javax::security::auth::Subject::doAsPrivileged(local_ref< javax::security::auth::Subject > const &a0, local_ref< java::security::PrivilegedExceptionAction > const &a1, local_ref< java::security::AccessControlContext > const &a2) { return call_static_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(5), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(5), local_ref< java::lang::Object > >(a0, a1, a2); } jboolean javax::security::auth::Subject::equals(local_ref< java::lang::Object > const &a0) { return call_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(6), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(6), jboolean >(get_jobject(), a0); } local_ref< java::util::Set > javax::security::auth::Subject::getPrincipals() { return call_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(7), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(7), local_ref< java::util::Set > >(get_jobject()); } local_ref< java::util::Set > javax::security::auth::Subject::getPrincipals(local_ref< java::lang::Class > const &a0) { return call_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(8), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(8), local_ref< java::util::Set > >(get_jobject(), a0); } local_ref< java::util::Set > javax::security::auth::Subject::getPrivateCredentials() { return call_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(9), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(9), local_ref< java::util::Set > >(get_jobject()); } local_ref< java::util::Set > javax::security::auth::Subject::getPrivateCredentials(local_ref< java::lang::Class > const &a0) { return call_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(10), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(10), local_ref< java::util::Set > >(get_jobject(), a0); } local_ref< java::util::Set > javax::security::auth::Subject::getPublicCredentials() { return call_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(11), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(11), local_ref< java::util::Set > >(get_jobject()); } local_ref< java::util::Set > javax::security::auth::Subject::getPublicCredentials(local_ref< java::lang::Class > const &a0) { return call_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(12), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(12), local_ref< java::util::Set > >(get_jobject(), a0); } jint javax::security::auth::Subject::hashCode() { return call_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(13), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(13), jint >(get_jobject()); } void javax::security::auth::Subject::setReadOnly() { return call_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(14), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(14), void >(get_jobject()); } jboolean javax::security::auth::Subject::isReadOnly() { return call_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(15), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(15), jboolean >(get_jobject()); } local_ref< java::lang::String > javax::security::auth::Subject::toString() { return call_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(16), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(16), local_ref< java::lang::String > >(get_jobject()); } local_ref< javax::security::auth::Subject > javax::security::auth::Subject::getSubject(local_ref< java::security::AccessControlContext > const &a0) { return call_static_method< javax::security::auth::Subject::J2CPP_CLASS_NAME, javax::security::auth::Subject::J2CPP_METHOD_NAME(17), javax::security::auth::Subject::J2CPP_METHOD_SIGNATURE(17), local_ref< javax::security::auth::Subject > >(a0); } J2CPP_DEFINE_CLASS(javax::security::auth::Subject,"javax/security/auth/Subject") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,0,"<init>","()V") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,1,"<init>","(ZLjava/util/Set;Ljava/util/Set;Ljava/util/Set;)V") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,2,"doAs","(Ljavax/security/auth/Subject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,3,"doAsPrivileged","(Ljavax/security/auth/Subject;Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,4,"doAs","(Ljavax/security/auth/Subject;Ljava/security/PrivilegedExceptionAction;)Ljava/lang/Object;") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,5,"doAsPrivileged","(Ljavax/security/auth/Subject;Ljava/security/PrivilegedExceptionAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,6,"equals","(Ljava/lang/Object;)Z") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,7,"getPrincipals","()Ljava/util/Set;") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,8,"getPrincipals","(Ljava/lang/Class;)Ljava/util/Set;") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,9,"getPrivateCredentials","()Ljava/util/Set;") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,10,"getPrivateCredentials","(Ljava/lang/Class;)Ljava/util/Set;") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,11,"getPublicCredentials","()Ljava/util/Set;") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,12,"getPublicCredentials","(Ljava/lang/Class;)Ljava/util/Set;") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,13,"hashCode","()I") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,14,"setReadOnly","()V") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,15,"isReadOnly","()Z") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,16,"toString","()Ljava/lang/String;") J2CPP_DEFINE_METHOD(javax::security::auth::Subject,17,"getSubject","(Ljava/security/AccessControlContext;)Ljavax/security/auth/Subject;") } //namespace j2cpp #endif //J2CPP_JAVAX_SECURITY_AUTH_SUBJECT_HPP_IMPL #endif //J2CPP_INCLUDE_IMPLEMENTATION
[ "baldzar@gmail.com" ]
baldzar@gmail.com
40215b9ab05936bff3fe3a710c7facfb389514c9
efccc49e7a16e0a380579b25e73f6c8f2585c281
/Mokube/Systems/Message/MessageManager.h
4be74a76c5125b1731455a05624e16f4a7cb090c
[]
no_license
mukbe/Mokube
1e10ef72475a08f63dd10c614ee1ef9a95b43d9d
89ec3c635247bb0007879731848fd93e9186a825
refs/heads/master
2020-12-08T15:09:52.921746
2020-01-16T08:39:43
2020-01-16T08:39:43
233,013,717
0
0
null
null
null
null
UHC
C++
false
false
1,317
h
#pragma once #include <queue> //씬이 넘어갈때마다 메세지 내용을 초기화 시켜줘야 한다 class MessageComponent; class DataContext; class TagMessage; class MessageManager { private: typedef vector<pair<MessageComponent*, TagMessage>>::iterator MsgListIter; public: MessageManager(); ~MessageManager(); void Update(float tick); void RemoveAllMessage(); //메세지 예약 void ReserveMessage(MessageComponent* gameObject, TagMessage msg); //바로 메세지를 전달해보고 딜레이가 같으면 예약메세지로 등록됨 void ReserveMessage(MessageComponent* gameObject, string name, float delay = 0.f); //데이터를 같이 메세지로 예약 template<typename T> void ReserveMessage(MessageComponent* gameObject, string name, float delay, const T& data); void ReturnData(DataContext* const data); private: queue<DataContext*> dataPool; vector<pair<MessageComponent*, TagMessage>> reserveList; DataContext* CreateData(); DataContext* GetData(); }; template<typename T> inline void MessageManager::ReserveMessage(MessageComponent * gameObject, string name, float delay, const T & data) { DataContext* const value = GetData(); value->SetValue(data); ReserveMessage(gameObject, TagMessage(name, delay, value)); } //#define MessagePool MessageManager::Get()
[ "azure9312@gmail.com" ]
azure9312@gmail.com
27ca653978cd632d4a8c690d785079b8572fd9de
9d364070c646239b2efad7abbab58f4ad602ef7b
/platform/external/chromium_org/chrome/browser/ui/webui/chromeos/slow_trace_ui.h
82e6549651b86d4514fd4ded49afc888613ba9b8
[ "BSD-3-Clause" ]
permissive
denix123/a32_ul
4ffe304b13c1266b6c7409d790979eb8e3b0379c
b2fd25640704f37d5248da9cc147ed267d4771c2
refs/heads/master
2021-01-17T20:21:17.196296
2016-08-16T04:30:53
2016-08-16T04:30:53
65,786,970
0
2
null
2020-03-06T22:00:52
2016-08-16T04:15:54
null
UTF-8
C++
false
false
1,419
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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_SLOW_TRACE_UI_H_ #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_SLOW_TRACE_UI_H_ #include <string> #include "base/compiler_specific.h" #include "content/public/browser/url_data_source.h" #include "content/public/browser/web_ui_controller.h" #include "ui/base/layout.h" namespace base { class RefCountedMemory; class RefCountedString; } namespace chromeos { class SlowTraceSource : public content::URLDataSource { public: SlowTraceSource(); virtual std::string GetSource() const OVERRIDE; virtual void StartDataRequest( const std::string& path, int render_process_id, int render_frame_id, const content::URLDataSource::GotDataCallback& callback) OVERRIDE; virtual std::string GetMimeType(const std::string& path) const OVERRIDE; private: virtual ~SlowTraceSource(); void OnGetTraceData(const content::URLDataSource::GotDataCallback& callback, scoped_refptr<base::RefCountedString> trace_data); DISALLOW_COPY_AND_ASSIGN(SlowTraceSource); }; class SlowTraceController : public content::WebUIController { public: explicit SlowTraceController(content::WebUI* web_ui); private: DISALLOW_COPY_AND_ASSIGN(SlowTraceController); }; } #endif
[ "allegrant@mail.ru" ]
allegrant@mail.ru
e4bea223c6613db576c2d0970bbfc981a7ef2d47
c0376f9eb4eb1adf2db5aff3d25abc3576d0241b
/src/plugins/monocle/pagegraphicsitem.h
b00b0b0ae80a43cff5d35d6c4e56e1106af325b8
[ "BSL-1.0" ]
permissive
ROOAARR/leechcraft
0179e6f1e7c0b7afbfcce60cb810d61bd558b163
14bc859ca750598b77abdc8b2d5b9647c281d9b3
refs/heads/master
2021-01-17T22:08:16.273024
2013-08-05T12:28:45
2013-08-05T12:28:45
2,217,574
1
0
null
2013-01-19T15:32:47
2011-08-16T18:55:44
C++
UTF-8
C++
false
false
3,725
h
/********************************************************************** * LeechCraft - modular cross-platform feature rich internet client. * Copyright (C) 2006-2013 Georg Rudoy * * Boost Software License - Version 1.0 - August 17th, 2003 * * Permission is hereby granted, free of charge, to any person or organization * obtaining a copy of the software and accompanying documentation covered by * this license (the "Software") to use, reproduce, display, distribute, * execute, and transmit the Software, and to prepare derivative works of the * Software, and to permit third-parties to whom the Software is furnished to * do so, all subject to the following: * * The copyright notices in the Software and this entire statement, including * the above license grant, this restriction and the following disclaimer, * must be included in all copies of the Software, in whole or in part, and * all derivative works of the Software, unless such copies or derivative * works are solely in the form of machine-executable object code generated by * a source language processor. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. **********************************************************************/ #pragma once #include <functional> #include <QGraphicsPixmapItem> #include <QPointer> #include "interfaces/monocle/idocument.h" namespace LeechCraft { namespace Monocle { class PagesLayoutManager; class ArbitraryRotationWidget; class PageGraphicsItem : public QObject , public QGraphicsPixmapItem { Q_OBJECT IDocument_ptr Doc_; const int PageNum_; bool IsHoverLink_; QList<ILink_ptr> Links_; QList<QPair<QRect, ILink_ptr>> Rect2Link_; ILink_ptr PressedLink_; double XScale_; double YScale_; bool Invalid_; std::function<void (int, QPointF)> ReleaseHandler_; PagesLayoutManager *LayoutManager_; QPointer<ArbitraryRotationWidget> ArbWidget_; public: typedef std::function<void (QRectF)> RectSetter_f; private: struct RectInfo { QRectF DocRect_; RectSetter_f Setter_; }; QMap<QGraphicsItem*, RectInfo> Item2RectInfo_; public: PageGraphicsItem (IDocument_ptr, int, QGraphicsItem* = 0); ~PageGraphicsItem (); void SetLayoutManager (PagesLayoutManager*); void SetReleaseHandler (std::function<void (int, QPointF)>); void SetScale (double, double); int GetPageNum () const; QRectF MapFromDoc (const QRectF&) const; QRectF MapToDoc (const QRectF&) const; void RegisterChildRect (QGraphicsItem*, const QRectF&, RectSetter_f); void UnregisterChildRect (QGraphicsItem*); void ClearPixmap (); void UpdatePixmap (); protected: void paint (QPainter*, const QStyleOptionGraphicsItem*, QWidget*); void hoverMoveEvent (QGraphicsSceneHoverEvent*); void hoverLeaveEvent (QGraphicsSceneHoverEvent*); void mousePressEvent (QGraphicsSceneMouseEvent*); void mouseReleaseEvent (QGraphicsSceneMouseEvent*); void contextMenuEvent (QGraphicsSceneContextMenuEvent*); private: void LayoutLinks (); ILink_ptr FindLink (const QPointF&); bool IsDisplayed () const; private slots: void rotateCCW (); void rotateCW (); void requestRotation (double); void updateRotation (double, int); void handlePixmapRendered (); signals: void rotateRequested (double); }; } }
[ "0xd34df00d@gmail.com" ]
0xd34df00d@gmail.com
ff367405f22b1c7693b5e9a98b16708428e5629d
9f19aa4574cca86a1c08c553a47bbfaffaf25072
/CoreEngine/Vector2f.h
1211b0132543a41368958b260b58ef8cad86e982
[]
no_license
cappah/Core
af8b51406edb9386299c2e3bb9d64bc149ae8336
209d5ea56bb8554092594044f5067d6b2438dbae
refs/heads/master
2021-01-12T09:08:43.839731
2016-12-04T17:33:04
2016-12-04T17:33:04
null
0
0
null
null
null
null
UTF-8
C++
false
false
205
h
#pragma once class Vector2f { public: Vector2f(); Vector2f(float x, float y); ~Vector2f(); void setX(float x); void setY(float y); float getX(); float getY(); private: float m_x; float m_y; };
[ "aaro.peramaa@gmail.com" ]
aaro.peramaa@gmail.com
98f79135c4297797db7066153e4720048b2a8c06
27c136e13979201f88a820d1bca5e56fe52c3a6d
/src/sorgtr.cpp
f25a490f8ec48eee0875d4f1ea9768411ceac74f
[]
no_license
EmergentOrder/magma
421070f87fb3009e4229e41ce0677d4092926a66
546b7716e7b2e3cb256a9c8aa6d4df4272fcb08b
refs/heads/master
2021-01-01T17:05:02.120717
2014-08-12T17:46:58
2014-08-12T17:46:58
22,886,527
1
0
null
null
null
null
UTF-8
C++
false
false
5,436
cpp
/* -- MAGMA (version 1.5.0-beta3) -- Univ. of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver @date July 2014 @generated from zungtr.cpp normal z -> s, Fri Jul 18 17:34:18 2014 */ #include "common_magma.h" /** Purpose ------- SORGTR generates a real unitary matrix Q which is defined as the product of n-1 elementary reflectors of order N, as returned by SSYTRD: if UPLO = MagmaUpper, Q = H(n-1) . . . H(2) H(1), if UPLO = MagmaLower, Q = H(1) H(2) . . . H(n-1). Arguments --------- @param[in] uplo magma_uplo_t - = MagmaUpper: Upper triangle of A contains elementary reflectors from SSYTRD; - = MagmaLower: Lower triangle of A contains elementary reflectors from SSYTRD. @param[in] n INTEGER The order of the matrix Q. N >= 0. @param[in,out] A REAL array, dimension (LDA,N) On entry, the vectors which define the elementary reflectors, as returned by SSYTRD. On exit, the N-by-N unitary matrix Q. @param[in] lda INTEGER The leading dimension of the array A. LDA >= N. @param[in] tau REAL array, dimension (N-1) TAU(i) must contain the scalar factor of the elementary reflector H(i), as returned by SSYTRD. @param[out] work (workspace) REAL array, dimension (LWORK) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. @param[in] lwork INTEGER The dimension of the array WORK. LWORK >= N-1. For optimum performance LWORK >= N*NB, where NB is the optimal blocksize. \n If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. @param[in] dT REAL array on the GPU device. DT contains the T matrices used in blocking the elementary reflectors H(i) as returned by magma_ssytrd. @param[in] nb INTEGER This is the block size used in SSYTRD, and correspondingly the size of the T matrices, used in the factorization, and stored in DT. @param[out] info INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value @ingroup magma_ssyev_comp ********************************************************************/ extern "C" magma_int_t magma_sorgtr(magma_uplo_t uplo, magma_int_t n, float *A, magma_int_t lda, float *tau, float *work, magma_int_t lwork, float *dT, magma_int_t nb, magma_int_t *info) { #define A(i,j) (A + (j)*lda+ (i)) magma_int_t i__1; magma_int_t i, j; magma_int_t iinfo; magma_int_t upper, lwkopt, lquery; *info = 0; lquery = (lwork == -1); upper = (uplo == MagmaUpper); if (! upper && uplo != MagmaLower) { *info = -1; } else if (n < 0) { *info = -2; } else if (lda < max(1,n)) { *info = -4; } else /* if (complicated condition) */ { /* Computing MAX */ if (lwork < max(1, n-1) && ! lquery) { *info = -7; } } lwkopt = max(1, n) * nb; if (*info == 0) { work[0] = MAGMA_S_MAKE( lwkopt, 0 ); } if (*info != 0) { magma_xerbla( __func__, -(*info)); return *info; } else if (lquery) { return *info; } /* Quick return if possible */ if (n == 0) { work[0] = MAGMA_S_ONE; return *info; } if (upper) { /* Q was determined by a call to SSYTRD with UPLO = 'U' Shift the vectors which define the elementary reflectors one column to the left, and set the last row and column of Q to those of the unit matrix */ for (j = 0; j < n-1; ++j) { for (i = 0; i < j-1; ++i) *A(i, j) = *A(i, j + 1); *A(n-1, j) = MAGMA_S_ZERO; } for (i = 0; i < n-1; ++i) { *A(i, n-1) = MAGMA_S_ZERO; } *A(n-1, n-1) = MAGMA_S_ONE; /* Generate Q(1:n-1,1:n-1) */ i__1 = n - 1; lapackf77_sorgql(&i__1, &i__1, &i__1, A(0,0), &lda, tau, work, &lwork, &iinfo); } else { /* Q was determined by a call to SSYTRD with UPLO = 'L'. Shift the vectors which define the elementary reflectors one column to the right, and set the first row and column of Q to those of the unit matrix */ for (j = n-1; j > 0; --j) { *A(0, j) = MAGMA_S_ZERO; for (i = j; i < n-1; ++i) *A(i, j) = *A(i, j - 1); } *A(0, 0) = MAGMA_S_ONE; for (i = 1; i < n-1; ++i) *A(i, 0) = MAGMA_S_ZERO; if (n > 1) { /* Generate Q(2:n,2:n) */ magma_sorgqr(n-1, n-1, n-1, A(1, 1), lda, tau, dT, nb, &iinfo); } } work[0] = MAGMA_S_MAKE( lwkopt, 0 ); return *info; } /* magma_sorgtr */ #undef A
[ "lecaran@gmail.com" ]
lecaran@gmail.com
e6e60a705efd34c44327c2d34da03d2c8232f799
3ab9d2bb6dac3f76be3443b1ec03a4184524a9ea
/src/ui/scenes/Menu/pop-ups/JoinServerInput.h
79b502bcac3f40ece04ecd243358857d2af32457
[]
no_license
dietotter/card-game
9e8ba59b2895ee07bf5a9df1f476c4ba85d8500f
296cb22589bd86b003c22e0a9a87bf9b136f8302
refs/heads/master
2023-06-01T07:37:45.889547
2021-06-07T20:06:00
2021-06-07T20:06:00
333,565,592
0
0
null
null
null
null
UTF-8
C++
false
false
316
h
#pragma once #include "../../../common/PopUp.h" #include "../../../../Scene.h" namespace nik { class JoinServerInput : public PopUp { protected: virtual std::unique_ptr<UIElement> clone() const override; public: JoinServerInput(Scene::RequestSceneFunction requestScene); }; }
[ "nikibar4@gmail.com" ]
nikibar4@gmail.com
69f585a1c901dc075379da400722c0d82744bf65
dbd24421a0e38df31e440ccad0755bc71ff69677
/Plotter/Fast.h
6afd1ba67261ec6d2f40dd64749acdf127d28f7f
[]
no_license
zshiad/PointPlotter
8a5b05b0e37e2b6a779e4d6b9b92267092d15fec
46663240127226aa93577ffb2870200c4f74c463
refs/heads/master
2021-01-13T03:04:48.921254
2016-12-21T04:47:53
2016-12-21T04:47:53
77,018,596
0
0
null
null
null
null
UTF-8
C++
false
false
359
h
#ifndef FAST #define FAST #include <cstdlib> #include <iostream> #include "Point.h" #include "Angle.h" #include <vector> class Fast { public: Fast(std::vector<Point> & ,int,int**); ~Fast(); void print(); private: void sort(std::vector<Point> & ,int,int**); std::vector<Point> line; std::vector<int> pointsize; int linesize; }; #endif
[ "qq805195586@gmail.com" ]
qq805195586@gmail.com
0415ca8c853347aab91f6fdb9205504ccd25bbd1
9f01c102b1c669627e02e0933db2a4ebbe4e7933
/radioDynamycTestRec/radioDynamycTestRec.ino
5fd8bfb724e4cf54f42bbdabc97a8b9612a0f5ca
[]
no_license
Madjogger1202/Ecologist-version-2.0
fee83d444bbe45c6cf86f9fd919f4a18f9b34693
6fa7b234769faf760f02ff3dbd63e0ff88c38bc2
refs/heads/master
2023-06-06T11:42:01.159106
2021-06-29T13:26:57
2021-06-29T13:26:57
303,640,052
0
0
null
null
null
null
UTF-8
C++
false
false
1,422
ino
#include <SPI.h> #include "RF24.h" RF24 radio(10,9); uint32_t radTim=3000; struct frst { const uint8_t id = 0; uint32_t timeMs; uint16_t trsh; } first; struct sec { const uint8_t id = 1; uint16_t trsh; } secon; void setup() { radio.begin(); radio.enableDynamicPayloads(); radio.setAutoAck( true ) ; radio.setChannel(100); // Указываем канал приёма данных (от 0 до 127), 5 - значит приём данных осуществляется на частоте 2,405 ГГц (на одном канале может быть только 1 приёмник и до 6 передатчиков) radio.setDataRate (RF24_250KBPS); // Указываем скорость передачи данных (RF24_250KBPS, RF24_1MBPS, RF24_2MBPS), RF24_1MBPS - 1Мбит/сек radio.setPALevel (RF24_PA_MAX); radio.openReadingPipe(1, 0xEEFAFDFDEELL); radio.powerUp() ; radio.startListening(); Serial.begin(115200); } void loop() { // put your main code here, to run repeatedly: if(radio.available()) { uint8_t sz= radio.getDynamicPayloadSize(); if(sz == sizeof(first)) { radio.read( &first, sizeof(first)); Serial.println(first.timeMs); } else if(sz == sizeof(secon)) radio.read( &secon, sizeof(secon)); { Serial.println(secon.trsh); } } }
[ "61242548+Madjogger1202@users.noreply.github.com" ]
61242548+Madjogger1202@users.noreply.github.com
40debd590d4e3322d16a5961bde1dc5c0839d88f
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_2453486_0/C++/raj1243/tic.cpp
30e7d3eb58b409ef15c30f2cc7e0b86611504e18
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
C++
false
false
2,686
cpp
#include <iostream> using namespace std; int main() { int i,j,t,k,countx,counto,countt,countdot,wonx,wono; char a[4][4]; cin>>t; k=1; while(t--) { wonx=wono=0; countx=counto=countt=countdot=0; int flag=0; for(i=0;i<4;i++) for(j=0;j<4;j++) cin>>a[i][j]; //checking along row for(i=0;i<4;i++) { if(flag==0) {countx=0;counto=0;countt=0; for(j=0;j<4;j++) { if(a[i][j]=='X') countx++; if(a[i][j]=='O') counto++; if(a[i][j]=='T') countt++; if(a[i][j]=='.') countdot++; } if((countx==3&&countt==1)||countx==4) {wonx=1;flag=1;} if((counto==3&&countt==1)||counto==4) {wono=1;flag=1;} } } //cj=hecking along coloumn if(flag==0) { for(i=0;i<4;i++) { if(flag==0) {countx=0;counto=0;countt=0; for(j=0;j<4;j++) { if(a[j][i]=='X') countx++; if(a[j][i]=='O') counto++; if(a[j][i]=='T') countt++; if(a[j][i]=='.') countdot++; } if((countx==3&&countt==1)||countx==4) {wonx=1;flag=1;} if((counto==3&&countt==1)||counto==4) {wono=1;flag=1;} } } } //checking along rite diagonal if(flag==0) {countx=0;counto=0;countt=0; for(j=0;j<4;j++) { if(a[j][j]=='X') countx++; if(a[j][j]=='O') counto++; if(a[j][j]=='T') countt++; if(a[j][j]=='.') countdot++; } if((countx==3&&countt==1)||countx==4) {wonx=1;flag=1;} if((counto==3&&countt==1)||counto==4) {wono=1;flag=1;} } //checking along left diagonal if(flag==0) { countx=0;counto=0;countt=0; for(j=0;j<4;j++) { if(a[3-j][j]=='X') countx++; if(a[3-j][j]=='O') counto++; if(a[3-j][j]=='T') countt++; if(a[3-j][j]=='.') countdot++; } if((countx==3&&countt==1)||countx==4) {wonx=1;flag=1;} if((counto==3&&countt==1)||counto==4) {wono=1;flag=1;} } if(wonx) cout<<"Case #"<<k<<": X won\n"; else if(wono) cout<<"Case #"<<k<<": O won\n"; else if(countdot) cout<<"Case #"<<k<<": Game has not completed\n"; else cout<<"Case #"<<k<<": Draw\n"; k++; cout<<endl; } return 0; }
[ "eewestman@gmail.com" ]
eewestman@gmail.com
e6aa4dade124d0579454276454362b733979e253
c40677a4aacb997dd85929e8515b6280867561ed
/2011/LoveLineUtil/LLSlider.h
ec6469a4ba6a2253cd1aa083f638eaace442f9d2
[]
no_license
thenfour/LoveLine
bf4aef7e8b3ed32aad356e1f630cf113a9f31af2
fe9e8e5ff860c08a8aaf62148491daadf3e606bc
refs/heads/master
2016-09-05T20:15:36.657017
2014-02-18T00:33:48
2014-02-18T00:33:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,835
h
#pragma once #include "CCControl.h" #include "CCString.h" #include "Global.h" struct SLIDER_COMMERCIAL_LIST_ITEM { DWORD Out() { return max(this->dwIn, this->dwOut); } DWORD* _Out() { if(this->dwIn < this->dwOut) return &this->dwOut; return &this->dwIn; } DWORD* _In() { if(this->dwIn > this->dwOut) return &this->dwOut; return &this->dwIn; } DWORD In() { return min(this->dwIn, this->dwOut); } DWORD Len() { return this->Out() - this->In(); } PVOID pParam; GUID id; DWORD dwIn; DWORD dwOut; SLIDER_COMMERCIAL_LIST_ITEM* pNext; SLIDER_COMMERCIAL_LIST_ITEM* pPrevious; }; struct SLIDER_BOOKMARK_LIST_ITEM { PVOID pParam; GUID id; CCString sName; DWORD dwPos; SLIDER_BOOKMARK_LIST_ITEM* pNext; SLIDER_BOOKMARK_LIST_ITEM* pPrevious; }; struct SLIDER_COMMERCIAL { PVOID pParam; GUID id; DWORD dwIn; DWORD dwOut; }; struct SLIDER_BOOKMARK { PVOID pParam; GUID id; CCString sName; DWORD dwPos; }; /* When something's highlighted, it needs to be stored somehow. These are values that describe WHAT is highlighted. */ #define LLS_NONE 0x00000000 #define LLS_CURSOR 0x00000001 #define LLS_BOOKMARK 0x00000002 #define LLS_COMMERCIALIN 0x00000003 #define LLS_COMMERCIALOUT 0x00000004 struct LLSHighlight { DWORD dwType; DWORD dwIndex;// What index of that object is it. }; // Notifications: #define LSN_FIRST 0x00001000 #define LSN_STARTDRAGGING LSN_FIRST + 0x00000010 #define LSN_ENDDRAGGING LSN_FIRST + 0x00000011 #define LSN_DRAGMOVE LSN_FIRST + 0x00000016// Sent when the user moves anything (cursor, etc... but is not sent when SetPos() is called. #define LSN_REMOVECOMMERCIAL LSN_FIRST + 0x00000012// Sent AFTER it was deleted. #define LSN_CHANGECOMMERCIAL LSN_FIRST + 0x00000013// Sent AFTER its changed. #define LSN_CHANGEBOOKMARK LSN_FIRST + 0x00000014// Sent AFTER its changed. #define LSN_REMOVEBOOKMARK LSN_FIRST + 0x00000015// Sent AFTER its removed. #define LSN_SETPOS LSN_FIRST + 0x00000017// Sent every time SetPos() is called. No lparam. struct LSN_DRAG_STRUCT { NMHDR hdr; DWORD dwNewPosition; LLSHighlight DragObject; }; struct LSN_REMOVECOMMERCIAL_STRUCT { NMHDR hdr; SLIDER_COMMERCIAL Commercial; }; struct LSN_CHANGECOMMERCIAL_STRUCT { NMHDR hdr; SLIDER_COMMERCIAL Old; SLIDER_COMMERCIAL New; }; struct LSN_REMOVEBOOKMARK_STRUCT { NMHDR hdr; SLIDER_BOOKMARK Bookmark; }; struct LSN_CHANGEBOOKMARK_STRUCT { NMHDR hdr; SLIDER_BOOKMARK Old; SLIDER_BOOKMARK New; }; ////////////////////////////////////////////////////////////////////////////// class CCEXPORT LLSlider : public CCControl { public: LLSlider(); ~LLSlider(); HRESULT Create(HWND hParent, HINSTANCE hInstance, RECT prect, RECT orect); DWORD GetPos(); void SetPos(DWORD dw); void SetLength(DWORD dwLen); BOOL IsDragging(LLSHighlight* pWhat); /* Returns NULL if the specified position is not inside a commercial. Otherwise, the index of the specified commercial is returned. */ int HitTest(DWORD dwPos); HRESULT ClearCommercials(); HRESULT AddCommercial(DWORD dwIn, DWORD dwOut, PVOID pParam, GUID id); HRESULT SetCommercial(int i, DWORD dwIn, DWORD dwOut, PVOID pParam, GUID id); HRESULT RemoveCommercial(int i); int GetCommercialCount(); HRESULT GetCommercial(int i, SLIDER_COMMERCIAL* pCommercial); HRESULT ClearBookmarks(); HRESULT AddBookmark(DWORD dwIn, CCString Text, PVOID pParam, GUID id); HRESULT SetBookmark(int i, DWORD dwIn, CCString Text, PVOID pParam, GUID id); HRESULT RemoveBookmark(int i); int GetBookmarkCount(); HRESULT GetBookmark(int i, SLIDER_BOOKMARK* pCommercial); private: /* This returns a pointer to the DWORD position that is described by pHighlight. For instance, if pHighlight.dwType == LLS_CURSOR, this returns &this->dwPos. */ DWORD* _GetPosition(LLSHighlight* pHighlight); /* This will set the cursor at the highlighted position. */ void SetCursorOnHighlight(); HBRUSH hFlatLine; HBRUSH hCursor; HBRUSH hHighlight; HBRUSH hCommercial; HBRUSH hBackground; HBRUSH hBookmark; HBRUSH hBookmarkHandle; HBRUSH hCommercialSelected; HBRUSH hCommercialHandle; HPEN hDelete; SLIDER_COMMERCIAL_LIST_ITEM* _GetCommercial(int i); SLIDER_BOOKMARK_LIST_ITEM* _GetBookmark(int i); void SendParentNotification(DWORD dwMsg, PVOID lParam); static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); /* Drawing stuff... This should all happen in a WM_PAINT message. These functions all take into account the invalid rectangle in the PAINTSTRUCT struct for optimization. */ CCString sStatusText; // The highlight describes what's being highlighted - this also // is valid for whent he user is dragging an object. LLSHighlight Highlight; DWORD dwOldPos;// NOT pixels. BOOL bDeleting;// When an item is being dragged off to be deleted this will be TRUE. DWORD* pdw;// This is a pointer to the value that's being dragged. POINT pOldPos;// Old MOUSE coords. RECT rcCursor; RECT rcWindow; RECT rcStatus; RECT rcBookmark; RECT rcSlider; RECT rcStatusFrame; RECT rcBookmarkFrame; RECT rcSliderFrame; RECT rcHighlight;// Rectangle that surrounds the last known highlighted region. void InvalidateHighlight();// Invalidates only the highlighted rectangle. BOOL bIsDragging; void CalculateHighlight(POINT* p); void CalculateHighlightRect();// Based on this->Highlight. void Draw(PAINTSTRUCT* ps); void DrawBlueLine(PAINTSTRUCT* ps); void DrawCommercial(SLIDER_COMMERCIAL_LIST_ITEM* p, PAINTSTRUCT* ps, BOOL bSelected); void CalculateCursorRect(RECT* prc);// This just approximates. void DrawCursor(PAINTSTRUCT* ps); void DrawBookmark(SLIDER_BOOKMARK_LIST_ITEM* p, PAINTSTRUCT* ps, BOOL bSelected); void DrawStatus(PAINTSTRUCT* ps); DWORD TimeToPixels(DWORD dwMS); DWORD PixelsToTime(int dwPixels); CCString sClass; DWORD dwLength; DWORD dwPos; void CheckBounds(DWORD* pdw); SLIDER_COMMERCIAL_LIST_ITEM* pCommercials; SLIDER_BOOKMARK_LIST_ITEM* pBookmarks; };
[ "carlco@gmail.com" ]
carlco@gmail.com
6d905171525f46cf36eaaad5c36b9e2625b5764e
fb1b5cce9785d13a8925a46b69f73fca9e318fe5
/cheftet.cpp
ed8e372fe0d798fac6a39e1a426c01e92bfd267b
[]
no_license
ankurssharma96/Competitive-solutions
72c0f280d0598ebe1733ac02a7056dd1bc4d2294
7abcad978c8eed05f6e431d59d519ac61da0c509
refs/heads/master
2021-05-08T13:43:30.658392
2018-08-18T18:15:11
2018-08-18T18:15:11
120,032,021
0
0
null
null
null
null
UTF-8
C++
false
false
3,096
cpp
#include<iostream> #include<algorithm> using namespace std; int main() { long long int t; cin>>t; while(t--) { long long int n,i,j,k=0,ctr=0; cin>>n; long long int b[n],a[n],z[n],d[n],temp[n]; for(i=0;i<n;i++) { cin>>b[i]; temp[i]=b[i]; z[i]=0; } for(i=0;i<n;i++) { cin>>a[i]; } long long int x[4],y[4],c[20],res[200]; x[0]=a[0]; x[1]=a[0]+b[0]; x[2]=a[0]+b[1]; x[3]=a[0]+b[0]+b[1]; y[0]=a[n-1]; y[1]=a[n-1]+b[n-1]; y[2]=a[n-1]+b[n-2]; y[3]=a[n-1]+b[n-1]+b[n-2]; for(i=0;i<4;i++) { for(j=0;j<4;j++) { if(x[i]==y[j]) { c[k]=x[i]; k++; } } } for(j=0;j<k;j++) { for(i=0;i<n;i++) { if(a[i]==c[j]) z[i]=1; } for(i=0;i<n;i++) { d[i]=a[i]+b[i]; if(d[i]==c[j]) { z[i]=1; b[i]=0; } } for(i=1;i<n;i++) { d[i]=a[i]+b[i-1]; if(d[i]==c[j]) { z[i]=1; b[i-1]=0; } } for(i=0;i<n-1;i++) { d[i]=a[i]+b[i+1]; if(d[i]==c[j]) { z[i]=1; b[i+1]=0; } } for(i=1;i<n;i++) { d[i]=a[i]+b[i]+b[i-1]; if(d[i]==c[j]) { z[i]=1; b[i]=0; b[i-1]=0; } } for(i=0;i<n-1;i++) { d[i]=a[i]+b[i]+b[i+1]; if(d[i]==c[j]) { z[i]=1; b[i]=0; b[i+1]=0; } } for(i=1;i<n-1;i++) { d[i]=a[i]+b[i-1]+b[i+1]; if(d[i]==c[j]) { z[i]=1; b[i+1]=0; b[i-1]=0; } } for(i=1;i<n-1;i++) { d[i]=a[i]+b[i]+b[i-1]+b[i+1]; if(d[i]==c[j]) { z[i]=1; b[i]=0; b[i+1]=0; b[i-1]=0; } } int w=0; for(i=0;i<n;i++) { if(z[i]==0) { w=1; } } if(w==0) { res[ctr]=c[j]; ctr++; } } for(i=0;i<n;i++) { b[i]=temp[i]; z[i]=0; } for(j=0;j<k;j++) { for(i=0;i<n;i++) { if(a[i]==c[j]) z[i]=1; } for(i=1;i<n;i++) { d[i]=a[i]+b[i-1]; if(d[i]==c[j]) { z[i]=1; b[i-1]=0; } } for(i=0;i<n-1;i++) { d[i]=a[i]+b[i+1]; if(d[i]==c[j]) { z[i]=1; b[i+1]=0; } } for(i=1;i<n;i++) { d[i]=a[i]+b[i]+b[i-1]; if(d[i]==c[j]) { z[i]=1; b[i]=0; b[i-1]=0; } } for(i=0;i<n-1;i++) { d[i]=a[i]+b[i]+b[i+1]; if(d[i]==c[j]) { z[i]=1; b[i]=0; b[i+1]=0; } } for(i=0;i<n;i++) { d[i]=a[i]+b[i]; if(d[i]==c[j]) { z[i]=1; b[i]=0; } } for(i=1;i<n-1;i++) { d[i]=a[i]+b[i-1]+b[i+1]; if(d[i]==c[j]) { z[i]=1; b[i+1]=0; b[i-1]=0; } } for(i=1;i<n-1;i++) { d[i]=a[i]+b[i]+b[i-1]+b[i+1]; if(d[i]==c[j]) { z[i]=1; b[i]=0; b[i+1]=0; b[i-1]=0; } } int w=0; for(i=0;i<n;i++) { if(z[i]==0) { w=1; } } if(w==0) { res[ctr]=c[j]; ctr++; } } sort(res,res+ctr); if(ctr) cout<<res[ctr-1]<<endl; else cout<<"-1"<<endl; } }
[ "ankurssharma96@gmail.com" ]
ankurssharma96@gmail.com
e30178b4fa20842bd88646242944bc21d5ab9730
7c64360b6e32f8576344048db7b9938ea722dedd
/optickscore/SensorLib.cc
d8dc40a7c8540238326893ec474284db7a4ceb64
[ "Apache-2.0" ]
permissive
recepkandemir/opticks
4be08a9243c3e0abe82eca77be70178e6384e555
523387f7593676bab58de22d22049e650de3f5c3
refs/heads/master
2023-01-24T16:55:04.131498
2020-12-04T20:25:09
2020-12-04T20:25:09
null
0
0
null
null
null
null
UTF-8
C++
false
false
12,875
cc
#include <sstream> #include "PLOG.hh" #include "NPY.hpp" #include "SensorLib.hh" const plog::Severity SensorLib::LEVEL = PLOG::EnvLevel("SensorLib", "DEBUG"); const char* SensorLib::SENSOR_DATA = "sensorData.npy" ; const char* SensorLib::SENSOR_ANGULAR_EFFICIENCY = "angularEfficiency.npy" ; SensorLib* SensorLib::Load(const char* dir) // static { LOG(info) << dir ; SensorLib* sensorlib = new SensorLib(dir) ; return sensorlib ; } SensorLib::SensorLib(const char* dir) : m_loaded(dir ? true : false), m_sensor_data(m_loaded ? NPY<float>::load(dir, SENSOR_DATA) : NULL), m_sensor_num(m_loaded && m_sensor_data != NULL ? m_sensor_data->getNumItems() : 0 ), m_sensor_angular_efficiency(m_loaded ? NPY<float>::load(dir, SENSOR_ANGULAR_EFFICIENCY) : NULL), m_closed(false) { LOG(LEVEL); } unsigned SensorLib::getNumSensor() const { return m_sensor_num ; } void SensorLib::save(const char* dir, const char* reldir) const { LOG(info) << dir << "/" << reldir ; if(m_sensor_data != NULL) m_sensor_data->save(dir, reldir, SENSOR_DATA); if(m_sensor_angular_efficiency != NULL) m_sensor_angular_efficiency->save(dir, reldir, SENSOR_ANGULAR_EFFICIENCY ); } std::string SensorLib::desc() const { unsigned num_category = getNumSensorCategories(); // 0 when no std::stringstream ss ; ss << "SensorLib" << " closed " << ( m_closed ? "Y" : "N" ) << " loaded " << ( m_loaded ? "Y" : "N" ) << " sensor_data " << ( m_sensor_data ? m_sensor_data->getShapeString() : "N" ) << " sensor_num " << m_sensor_num << " sensor_angular_efficiency " << ( m_sensor_angular_efficiency ? m_sensor_angular_efficiency->getShapeString() : "N" ) << " num_category " << num_category ; return ss.str(); } void SensorLib::dump(const char* msg, unsigned modulo) const { dumpSensorData(msg, modulo); dumpAngularEfficiency(msg); } void SensorLib::dumpSensorData(const char* msg, unsigned modulo) const { LOG(info) << msg << " modulo " << modulo ; LOG(info) << desc() ; float efficiency_1 ; float efficiency_2 ; int category ; int identifier ; int w = 12 ; std::cout << std::setw(w) << "sensorIndex" << " : " << std::setw(w) << "efficiency_1" << " : " << std::setw(w) << "efficiency_2" << " : " << std::setw(w) << "category" << " : " << std::setw(w) << "identifier" << std::endl ; for(unsigned i=0 ; i < m_sensor_num ; i++) { unsigned sensorIndex = 1 + i ; // 1-based getSensorData(sensorIndex, efficiency_1, efficiency_2, category, identifier); if(modulo == 0 || i % modulo == 0 ) std::cout << std::setw(w) << sensorIndex << " : " << std::setw(w) << efficiency_1 << " : " << std::setw(w) << efficiency_2 << " : " << std::setw(w) << category << " : " << std::setw(w) << identifier << std::endl ; } } /** SensorLib::initSensorData --------------------------- Canonically invoked by G4Opticks::setGeometry **/ void SensorLib::initSensorData(unsigned sensor_num) { assert( ! m_loaded ) ; LOG(LEVEL) << " sensor_num " << sensor_num ; m_sensor_num = sensor_num ; m_sensor_data = NPY<float>::make(m_sensor_num, 4); m_sensor_data->zero(); } /** SensorLib::setSensorData --------------------------- Calls to this for all sensor_placements G4PVPlacement provided by SensorLib::getSensorPlacements provides a way to associate the Opticks contiguous 1-based sensorIndex with a detector defined sensor identifier. Within JUNO simulation framework this is used from LSExpDetectorConstruction::SetupOpticks. sensorIndex 1-based contiguous index used to access the sensor data, the (sensorIndex - 1) must be less than the number of sensors efficiency_1 efficiency_2 two efficiencies which are multiplied together with the local angle dependent efficiency to yield the detection efficiency used to assign SURFACE_COLLECT to photon hits that already have SURFACE_DETECT category used to distinguish between sensors with different theta textures identifier detector specific integer representing a sensor, does not need to be contiguous **/ void SensorLib::setSensorData(unsigned sensorIndex, float efficiency_1, float efficiency_2, int category, int identifier) { unsigned i = sensorIndex - 1 ; // 1-based assert( i < m_sensor_num ); m_sensor_data->setFloat(i,0,0,0, efficiency_1); m_sensor_data->setFloat(i,1,0,0, efficiency_2); m_sensor_data->setInt( i,2,0,0, category); m_sensor_data->setInt( i,3,0,0, identifier); } void SensorLib::getSensorData(unsigned sensorIndex, float& efficiency_1, float& efficiency_2, int& category, int& identifier) const { unsigned i = sensorIndex - 1 ; // 1-based assert( i < m_sensor_num ); assert( m_sensor_data ); efficiency_1 = m_sensor_data->getFloat(i,0,0,0); efficiency_2 = m_sensor_data->getFloat(i,1,0,0); category = m_sensor_data->getInt( i,2,0,0); identifier = m_sensor_data->getInt( i,3,0,0); } int SensorLib::getSensorIdentifier(unsigned sensorIndex) const { unsigned i = sensorIndex - 1 ; // 1-based assert( i < m_sensor_num ); assert( m_sensor_data ); return m_sensor_data->getInt( i, 3, 0, 0); } /* template <typename T> void SensorLib::setSensorDataMeta( const char* key, T value ) { assert( m_sensor_data ); m_sensor_data->setMeta<T>( key, value ); } */ void SensorLib::setSensorAngularEfficiency( const std::vector<int>& shape, const std::vector<float>& values, int theta_steps, float theta_min, float theta_max, int phi_steps, float phi_min, float phi_max ) { LOG(LEVEL) << "[" ; const NPY<float>* a = MakeSensorAngularEfficiency(shape, values, theta_steps, theta_min, theta_max, phi_steps, phi_min, phi_max) ; setSensorAngularEfficiency(a); LOG(LEVEL) << "]" ; } const NPY<float>* SensorLib::MakeSensorAngularEfficiency( // static const std::vector<int>& shape, const std::vector<float>& values, int theta_steps, float theta_min, float theta_max, int phi_steps, float phi_min, float phi_max ) { std::string metadata = "" ; NPY<float>* a = new NPY<float>(shape, values, metadata); a->setMeta<int>("theta_steps", theta_steps); a->setMeta<float>("theta_min", theta_min); a->setMeta<float>("theta_max", theta_max); a->setMeta<int>("phi_steps", phi_steps); a->setMeta<float>("phi_min", phi_min); a->setMeta<float>("phi_max", phi_max); return a ; } void SensorLib::setSensorAngularEfficiency( const NPY<float>* sensor_angular_efficiency ) { m_sensor_angular_efficiency = sensor_angular_efficiency ; } unsigned SensorLib::getNumSensorCategories() const { return m_sensor_angular_efficiency ? m_sensor_angular_efficiency->getShape(0) : 0 ; } void SensorLib::dumpAngularEfficiency(const char* msg) const { LOG(info) << msg << " sensor_angular_efficiency " << ( m_sensor_angular_efficiency ? m_sensor_angular_efficiency->getShapeString() : "NULL" ) ; if(m_sensor_angular_efficiency == NULL ) return ; unsigned num_dimensions = m_sensor_angular_efficiency->getNumDimensions(); assert( num_dimensions == 4 ); unsigned ni = m_sensor_angular_efficiency->getShape(0); unsigned nj = m_sensor_angular_efficiency->getShape(1); unsigned nk = m_sensor_angular_efficiency->getShape(2); unsigned nl = m_sensor_angular_efficiency->getShape(3); unsigned num_cat = ni ; unsigned num_theta = nj ; unsigned num_phi = nk ; unsigned num_elem = nl ; // multiplicity LOG(info) << " num_cat " << num_cat << " num_theta " << num_theta << " num_phi " << num_phi << " num_elem " << num_elem ; assert( num_elem == 1 ); unsigned edgeitems = 8 ; unsigned w = 8 ; std::stringstream ss ; ss << " " << std::setw(3) << "" << " " ; for(unsigned k=0 ; k < nk ; k++) { if( k < edgeitems || k > nk - edgeitems ) ss << std::setw(w) << k << " " ; else if( k == edgeitems ) ss << std::setw(w) << "..." << " " ; } std::string phi_labels = ss.str(); for(unsigned i=0 ; i < ni ; i++) { std::cout << " category " << i << std::endl ; std::cout << phi_labels << std::endl ; for(unsigned j=0 ; j < nj ; j++) { std::cout << "(" << std::setw(3) << j << ") " ; for(unsigned k=0 ; k < nk ; k++) { float value = m_sensor_angular_efficiency->getValue(i, j, k); if( k < edgeitems || k > nk - edgeitems ) { std::cout << std::setw(w) << value << " " ; } else if( k == edgeitems ) { std::cout << std::setw(w) << "..." << " " ; } } std::cout << std::endl ; } std::cout << phi_labels << std::endl ; } } NPY<float>* SensorLib::getSensorDataArray() const { return m_sensor_data ; } const NPY<float>* SensorLib::getSensorAngularEfficiencyArray() const { return m_sensor_angular_efficiency ; } bool SensorLib::isClosed() const { return m_closed ; } /** SensorLib::close ----------------- Closing the sensorlib checks consistency between the sensorData and angularEfficiency arrays. The 0-based category index from the sensorData must be less than the number of angularEfficiency categories when an angularEfficiency array is present. When no angularEfficiency array has been set the sensorData categories must all be -1. **/ void SensorLib::close() { if(m_closed) { LOG(error) << " closed already " ; return ; } m_closed = true ; if(m_sensor_num == 0 ) { LOG(error) << " SKIP as m_sensor_num zero " ; return ; } bool dump = false ; checkSensorCategories(dump); LOG(info) << desc() ; } void SensorLib::checkSensorCategories(bool dump) { LOG(info) << "[ " << desc() ; unsigned num_category = getNumSensorCategories(); // 0 when none m_category_counts.clear(); for(unsigned i=0 ; i < m_sensor_num ; i++) { unsigned sensorIndex = 1 + i ; // 1-based float efficiency_1 ; float efficiency_2 ; int category ; int identifier ; getSensorData(sensorIndex, efficiency_1, efficiency_2, category, identifier); bool category_expected = ( num_category == 0 ) ? category == -1 : category > -1 ; if(!category_expected || dump) std::cout << " sensorIndex " << std::setw(6) << sensorIndex << " efficiency_1 " << std::setw(10) << efficiency_1 << " efficiency_2 " << std::setw(10) << efficiency_2 << " category " << std::setw(6) << category << " identifier " << std::setw(10) << std::hex << identifier << std::dec << " category_expected " << ( category_expected ? "Y" : "N" ) << std::endl ; assert(category_expected); m_category_counts[category] += 1 ; } dumpCategoryCounts("SensorLib::checkSensorCategories"); LOG(info) << "] " << desc() ; } void SensorLib::dumpCategoryCounts(const char* msg) const { LOG(info) << msg ; typedef std::map<int,int>::const_iterator IT ; for(IT it=m_category_counts.begin() ; it != m_category_counts.end() ; it++ ) { std::cout << " category " << std::setw(10) << it->first << " count " << std::setw(10) << it->second << std::endl ; } } /* template <typename T> void SensorLib::setSensorAngularEfficiencyMeta( const char* key, T value ) { assert( m_sensor_angular_efficiency ); m_sensor_angular_efficiency->setMeta<T>( key, value ); } template OKGEO_API void SensorLib::setSensorDataMeta(const char* key, int value); template OKGEO_API void SensorLib::setSensorDataMeta(const char* key, float value); template OKGEO_API void SensorLib::setSensorDataMeta(const char* key, std::string value); template OKGEO_API void SensorLib::setSensorAngularEfficiencyMeta(const char* key, int value); template OKGEO_API void SensorLib::setSensorAngularEfficiencyMeta(const char* key, float value); template OKGEO_API void SensorLib::setSensorAngularEfficiencyMeta(const char* key, std::string value); */
[ "simoncblyth@gmail.com" ]
simoncblyth@gmail.com
73d81f1975abbb41c8d21d9a0da1a1b1d042c9c3
8f147081e53c67ece68357b1978c5ed1234a069c
/Assignments/hw4/hw4_tests/01_constructor_tests/constructor_tests.cpp
1a23c44112baee90e3878469630739d57b069c5b
[ "MIT" ]
permissive
aalmarhabi/teach-cpp-autograding
a424c320f79d762f61968f40b3d31c625dc682be
ff0037db725c05448b9fa46872e2e85a46decbde
refs/heads/master
2022-02-01T22:27:44.533351
2018-07-05T03:15:38
2018-07-05T03:15:38
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,441
cpp
// // Created by Chohee Kim on 11/8/16. // #include "gtest/gtest.h" #include "Rectangle.h" #include "Square.h" #include "Circle.h" using namespace std; int currentPoints_constructorTest = 0; int maxPoints = 30; TEST(hw4TestCircle, basicConstructorCircle) { Circle<int> *circleInt = new Circle<int>(2, 2, 4); Circle<float> *circleFloat = new Circle<float>(4.4, 2.2, 4.4); if (HasFailure()){ cerr << "\nCircleConstructorTest has failed\"" << endl; }else { currentPoints_constructorTest += 10; } cout << "\nCurrent POINTS:" << currentPoints_constructorTest << "/" << maxPoints << endl; } TEST(hw4TestRectangle, basicConstructorRectangle) { Rectangle<int> *rectangleInt = new Rectangle<int>(4, 4, 5, 6); Rectangle<float> *rectangleFloat = new Rectangle<float>(4.4, 4.4, 5.4, 6); if (HasFailure()){ cerr << "\nRectangleConstructorTest has failed\"" << endl; }else { currentPoints_constructorTest += 10; } cout << "\nCurrent POINTS:" << currentPoints_constructorTest << "/" << maxPoints << endl; } TEST(hw4TestSquare, basicConstructorSquare) { Square<int> *squareInt = new Square<int>(3, 3, 3); Square<float> *squareFloat = new Square<float>(5.5, 3, 4.4); if (HasFailure()){ cerr << "\nSquareConstructorTest has failed\"" << endl; }else { currentPoints_constructorTest += 10; } cout << "\nCurrent POINTS:" << currentPoints_constructorTest << "/" << maxPoints << endl; }
[ "omarasifshaikh@hotmail.com" ]
omarasifshaikh@hotmail.com
f33b24147a54f2c4dc475c2eee50468a4d37158f
8d407892105f801a83bbc1414ea252abba05631f
/TextEditing/CmdDeleteChar.cpp
6366446352d875eb3614c91ac774ed50ac09e977
[]
no_license
celes128/TextEditing
6bc63abd5c0bf537dfc41e3fed352d65983b6dd9
b399b1b82558d71c11ada3ba1407d50c9ccc48b6
refs/heads/main
2023-08-15T04:11:48.155491
2021-10-03T14:37:30
2021-10-03T14:37:30
412,800,108
0
0
null
null
null
null
UTF-8
C++
false
false
331
cpp
#include "pch.h" #include "CmdDeleteChar.h" #include "TextLine.h" namespace ted { CmdDeleteChar::CmdDeleteChar(size_t i, TextLine &line) : m_c(line[i]) , m_i(i) , m_line(line) {} void CmdDeleteChar::Execute() { m_line.DeleteCharAtIndex(m_i); } void CmdDeleteChar::Undo() { m_line.InsertAtIndex(m_c, m_i); } }
[ "celestiaz821@gmail.com" ]
celestiaz821@gmail.com
c6a17bbbaa8ac5cb3bee93b1d0d1d05c1a9617d9
79a2b47b6a6c903a243773b0c69ab25623edcbe0
/Task4/Labyrinth/World/Actor/LifeObjects/LifeObjects.cpp
87959ff22051d15810f259eae2bf2cec13f10283
[]
no_license
7kia/CG
3a9bb11f3018d16c38c809d79536ec0dea7703df
5a532afd685113b3a13a03dd03b08bf86cfef4bd
refs/heads/master
2020-04-12T09:03:30.731305
2016-12-18T17:49:53
2016-12-18T17:50:13
61,549,242
0
0
null
null
null
null
UTF-8
C++
false
false
2,027
cpp
#include "stdafx.h" #include "World\World.h" #include "LifeObjects.h" CLifeObject::CLifeObject() : CActor(CActor::IdClass::LifeObject) , CHave3DPosition() , CHaveDirection() , CHaveLinearVelocity(LifeObjectSpace::LINEAR_MOVE_SPEED) , CHaveRotationSpeed(LifeObjectSpace::ROTATION_SPEED_RADIANS) , CHaveHealth() , m_visual(16, 16) { } CLifeObject::CLifeObject(CLifeObjectType & type , CWorld* pWorld , const glm::vec3 & position , const glm::vec3 & direction) : CActor(CActor::IdClass::LifeObject) , CHave3DPosition(position) , CHaveDirection(direction) , CHaveLinearVelocity(LifeObjectSpace::LINEAR_MOVE_SPEED) , CHaveRotationSpeed(LifeObjectSpace::ROTATION_SPEED_RADIANS) , CHaveHealth() , m_visual(16, 16) { SetType(type); SetCollison(pWorld); } void CLifeObject::SetType(CLifeObjectType & setType) { m_type = &setType; //m_type = &setType; SetMaxLinearVelocity(m_type->GetVelocity()); SetIdFaction(m_type->GetIdFaction()); m_health.SetValue(m_type->GetHealth()); m_health.SetMaxValue(m_type->GetHealth()); m_weapon.SetType(m_type->GetTypeWeapon()); } void CLifeObject::SetCollison(CWorld* pWorld) { m_world = pWorld; m_collision.SetRadius(1.f); m_collision.SetReferenceSystemOrigin(glm::vec2()); auto position = GetPosition(); m_collision.SetPosition(position.x, position.y); m_collision.SetVelocity(glm::vec2()); m_visual.SetTransform(glm::translate(glm::mat4(), position)); m_collision.AddToWorld(pWorld->GetWorld()); m_collision.SetMaster(this); } void CLifeObject::Attack() { if (m_weapon.GetState() == CWeapon::IdState::NotActive) { m_weapon.SetState(CWeapon::IdState::NotShoot); } } void CLifeObject::SetWeaponState(CWeapon::IdState state) { m_weapon.SetState(state); } CWeapon::IdState CLifeObject::GetWeaponState() const { return m_weapon.GetState(); } void CLifeObject::SetWeapon(const CWeaponType & typeWeapon) { m_weapon.SetType(typeWeapon); } void CLifeObject::CheckHealth() { if (GetHealth() <= 0) { SetStateLive(false); } }
[ "il7kia@yandex.ru" ]
il7kia@yandex.ru
40f6d0ddf2725f12bbb69e0f8563a441cf5b8f70
d73cf4af65fffc16c2326281fb7de3344566d6a1
/BOM/UPSHelper.cpp
c2f50857155288600a904552866c32e05333bcdf
[]
no_license
yongchaohu/WH_DEVICE
c3299ddd63ff15ca5ba3fa476cb90eee01ddb541
5212d3b15dfcf5a542c0936ebf0e72ed66b85d05
refs/heads/master
2020-05-27T20:38:35.562316
2019-06-24T03:02:29
2019-06-24T03:02:29
188,782,571
0
0
null
2019-05-27T06:18:48
2019-05-27T06:18:48
null
GB18030
C++
false
false
3,170
cpp
#include "stdafx.h" #include "UPSHelper.h" ////////////////////////////////////////////////////////////////////////// /** @brief 构造函数 @param (i)CService& service @retval 无 @exception 无 */ ////////////////////////////////////////////////////////////////////////// CUPSHelper::CUPSHelper(CService &service):CServiceHelper(service) { } ////////////////////////////////////////////////////////////////////////// /** @brief 析构函数 @param 无 @retval 无 @exception 无 */ ////////////////////////////////////////////////////////////////////////// CUPSHelper::~CUPSHelper() { } ////////////////////////////////////////////////////////////////////////// /** @brief 初始化并口 @param none @retval long 0:成功 1:初始化失败 @exception 无 */ ////////////////////////////////////////////////////////////////////////// long CUPSHelper::UPSOpen() { int port = theBOM_INFO.GetUPSCommPort(); int baud = theBOM_INFO.GetUPSBaudRate(); CUPSOpen pUPSCmd(port, baud); long errCode = pUPSCmd.ExecuteCommand(); if(errCode != UPS_SUCCESSED){ throw CUPSException(CUPSException::ERROR_UPS_OPEN_COM, _T(__FILE__), __LINE__); } return errCode; } ////////////////////////////////////////////////////////////////////////// /** @brief 读取并口状态值 @param (o)_tagUPSBatteryInfo& info 读取UPS信息 @retval long 0:成功 1:读取失败 @exception 无 */ ////////////////////////////////////////////////////////////////////////// long CUPSHelper::UPSRead(_tagUPSBatteryInfo &info) { CUPSRead pUPSCmd; long errCode = pUPSCmd.ExecuteCommand(); if(errCode != UPS_SUCCESSED){ throw CUPSException(CUPSException::ERROR_UPS_READ_COM, _T(__FILE__), __LINE__); } pUPSCmd.GetUPSInfo(info); return errCode; } ///////////////////////////////////////////////////////////////////////// /** @brief 关闭并口 @param none @retval long 0:成功 1:初始化失败 @exception 无 */ ////////////////////////////////////////////////////////////////////////// long CUPSHelper::UPSClose() { // 关闭并口 CUPSClose pUPSCmd; long errCode = pUPSCmd.ExecuteCommand(); if(errCode != UPS_SUCCESSED){ throw CUPSException(CUPSException::ERROR_UPS_CLOSE_COM, _T(__FILE__), __LINE__); } return errCode; } ///////////////////////////////////////////////////////////////////////// /** @brief 获取剩余电量百分比 @param none @retval DWORD 剩余电量百分比 @exception 无 */ ////////////////////////////////////////////////////////////////////////// DWORD CUPSHelper::GetUPSBatteryCapacity() { _tagUPSBatteryInfo mUPSInfo; long errCode = UPSRead(mUPSInfo); return mUPSInfo.dBatteryCapacity; } ///////////////////////////////////////////////////////////////////////// /** @brief 获取剩余时间 @param none @retval DWORD 剩余时间(单位:分钟) @exception 无 */ ////////////////////////////////////////////////////////////////////////// DWORD CUPSHelper::GetUPSLeftStandbyTime() { _tagUPSBatteryInfo mUPSInfo; long errCode = UPSRead(mUPSInfo); return mUPSInfo.dwLeftStandbyTime/60; }
[ "1017943468@qq.com" ]
1017943468@qq.com