blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 201 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 7 100 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 260
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 11.4k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 80
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 8 9.86M | extension stringclasses 52
values | content stringlengths 8 9.86M | authors listlengths 1 1 | author stringlengths 0 119 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
112f9d3b1f7e67c3b55aa9f8a5e684d8d27c8d68 | ae51fe3dd834a3112fd64eb16ccef5328da33e72 | /interfaceWindow.cpp | 1ab5fb94bb804d87a5a4a2414bd79aeea3e3d0f5 | [] | no_license | dimandr/simulator | dfbc10ed19361603d0ffc2724cdabf73ebef3651 | a7562905511cd7e89691c4a24396a659768832b3 | refs/heads/master | 2021-01-09T23:37:51.576659 | 2013-01-17T22:08:13 | 2013-01-17T22:08:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,700 | cpp | #include "interfaceWindow.h"
#include "libstage/stage.hh"
#include <QtGui>
using namespace Stg;
/*
static struct option longopts[] = {
{ "gui", optional_argument, NULL, 'g' },
{ "clock", optional_argument, NULL, 'c' },
{ "help", optional_argument, NULL, 'h' },
{ "args", required_argument, NULL, 'a' },
{ NULL, 0, NULL, 0 }
};
*/
interfaceWindow::interfaceWindow()
{
QWidget *widget = new QWidget;
QLabel *label = new QLabel("Choise the world:");
QPushButton *startWorldButton = createButton(tr("&Start world"), SLOT(startWorld()));
QPushButton *editWorldButton = createButton(tr("&Edit..."), SLOT(editWorld()));
setCentralWidget(widget);
filesComboBox = new QComboBox();
QGridLayout *layout = new QGridLayout;
find();
if(filesComboBox)
layout->addWidget(label, 0, 0);
layout->addWidget(filesComboBox, 0, 1);
layout->addWidget(editWorldButton, 0, 2);
layout->addWidget(startWorldButton, 3, 0, 1, 3);
widget->setLayout(layout);
QObject::connect(filesComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(loadDefaultWorld(QString)));
setWindowTitle(tr("WorldBuilder"));
setMinimumSize(160, 160);
resize(480, 320);
/*
QComboBox *combo = new QComboBox();
foreach(QByteArray format, QText)
combo->addItem("simple");
QObject::connect(combo, SIGNAL(currentIndexChanged(QString)),
label, SLOT(setText(QString)));
QWidget *widget = new QWidget;
setCentralWidget(widget);
//! [0]
//! [1]
QWidget *topFiller = new QWidget;
topFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
#ifdef Q_OS_SYMBIAN
infoLabel = new QLabel(tr("<i>Choose a menu option</i>"));
#else
infoLabel = new QLabel(tr("<i>Choose a menu option, or right-click to "
"invoke a context menu</i>"));
#endif
infoLabel->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
infoLabel->setAlignment(Qt::AlignCenter);
QWidget *bottomFiller = new QWidget;
bottomFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
QVBoxLayout *layout = new QVBoxLayout;
layout->setMargin(5);
layout->addWidget(topFiller);
layout->addWidget(infoLabel);
layout->addWidget(bottomFiller);
layout->addWidget(label);
layout->addWidget(combo);
widget->setLayout(layout);
//! [1]
//! [2]
createActions();
createMenus();
#ifndef Q_OS_SYMBIAN
QString message = tr("A context menu is available by right-clicking");
statusBar()->showMessage(message);
#endif
setWindowTitle(tr("Menus"));
setMinimumSize(160, 160);
resize(480, 320);
*/
}
void interfaceWindow::find()
{
QString fileName = "*.world";
QString path = QDir::currentPath()+"/world";
currentDir = QDir(path);
QStringList files;
files = currentDir.entryList(QStringList(fileName), QDir::Files | QDir::NoSymLinks);
fillWorldsCombobox(files);
}
void interfaceWindow::fillWorldsCombobox(const QStringList &files)
{
filesComboBox->addItem("");
for (int i = 0; i < files.size(); ++i) {
filesComboBox->addItem(files[i]);
}
}
QPushButton *interfaceWindow::createButton(const QString &text, const char *member)
{
QPushButton *button = new QPushButton(text);
connect(button, SIGNAL(clicked()), this, member);
return button;
}
void interfaceWindow::startWorld()
{
if( ! world->paused )
world->Start();
world->Run();
}
void interfaceWindow::editWorld()
{
QMainWindow *editWindow = new QMainWindow;
QWidget *q = new QWidget;
const std::map<std::string, Model*> modelsWithNames = world->GetAllModelsByName();
const std::set<Model*> models = world->GetAllModels();
QComboBox *modls = new QComboBox();
std::set<Model*>::const_iterator it;
it = models.begin();
for(; it != models.end(); it++) {
//Model *m = it->second;
Model *m = *it;
QString name(((std::string)(m->GetModelType())).c_str());
//if(((std::string)m->GetModelType()) == "position"){
//modls->addItem(name+"("+((std::string)m->GetModelType()).c_str()+")");
modls->addItem("("+name+")");
//}
}
//(*it)->GetModelType()
QGridLayout *layout = new QGridLayout;
layout->addWidget(modls, 0, 0);
q->setLayout(layout);
editWindow->setCentralWidget(q);
/*
world->models_by_name;
world->models_by_wfentity;
world->models_with_fiducials_byx;
world->models_with_fiducials_byy;
*/
editWindow->show();
}
void interfaceWindow::loadDefaultWorld(const QString character)
{
world = new WorldGui( 400, 300, character.toStdString().c_str() );
world->Load( character.toStdString() );
//std::cout<<"entered to load\n";
//printf( "\n[Load worldfile: done]" );
//world->ShowClock( showclock );
/*
World::Run();
*/
/*
printf( "%s %s ", "", "" );
int ch=0, optindex=0;
bool usegui = true;
bool showclock = false;
while ((ch = getopt_long(argc, argv, "cgh?", longopts, &optindex)) != -1)
{
switch( ch )
{
case 0: // long option given
printf( "option %s given\n", longopts[optindex].name );
break;
case 'a':
World::ctrlargs = std::string(optarg);
break;
case 'c':
showclock = true;
printf( "[Clock enabled]" );
break;
case 'g':
usegui = false;
printf( "[GUI disabled]" );
break;
default:
printf("unhandled option %c\n", ch );
//exit(0);
}
}
puts("");// end the first start-up line
// arguments at index [optindex] and later are not options, so they
// must be world file names
optindex = optind; //points to first non-option
while( optindex < argc )
{
if( optindex > 0 )
{
const char* worldfilename = argv[optindex];
World* world = ( usegui ?
new WorldGui( 400, 300, worldfilename ) :
new World( worldfilename ) );
world->Load( worldfilename );
printf( "\n[Load worldfile: done]" );
//world->ShowClock( showclock );
if( ! world->paused )
world->Start();
}
optindex++;
}
World::Run();
printf( "\n[Stage: done]" );
*/
}
/*
QStringList interfaceWindow::findFiles(const QStringList &files)
{
QProgressDialog progressDialog(this);
progressDialog.setCancelButtonText(tr("&Cancel"));
progressDialog.setRange(0, files.size());
progressDialog.setWindowTitle(tr("Find Files"));
QStringList foundFiles;
for (int i = 0; i < files.size(); ++i) {
progressDialog.setValue(i);
progressDialog.setLabelText(tr("Searching file number %1 of %2...")
.arg(i).arg(files.size()));
qApp->processEvents();
if (progressDialog.wasCanceled())
break;
QFile file(currentDir.absoluteFilePath(files[i]));
if (file.open(QIODevice::ReadOnly)) {
QString line;
QTextStream in(&file);
while (!in.atEnd()) {
if (progressDialog.wasCanceled())
break;
line = in.readLine();
if (line.contains(text)) {
foundFiles << files[i];
break;
}
}
}
}
return foundFiles;
}
*/
void interfaceWindow::contextMenuEvent(QContextMenuEvent *event)
{
QMenu menu(this);
menu.addAction(cutAct);
menu.addAction(copyAct);
menu.addAction(pasteAct);
menu.exec(event->globalPos());
}
//! [3]
void interfaceWindow::newFile()
{
infoLabel->setText(tr("Invoked <b>File|New</b>"));
}
void interfaceWindow::open()
{
infoLabel->setText(tr("Invoked <b>File|Open</b>"));
}
void interfaceWindow::save()
{
infoLabel->setText(tr("Invoked <b>File|Save</b>"));
}
void interfaceWindow::print()
{
infoLabel->setText(tr("Invoked <b>File|Print</b>"));
}
void interfaceWindow::undo()
{
infoLabel->setText(tr("Invoked <b>Edit|Undo</b>"));
}
void interfaceWindow::redo()
{
infoLabel->setText(tr("Invoked <b>Edit|Redo</b>"));
}
void interfaceWindow::cut()
{
infoLabel->setText(tr("Invoked <b>Edit|Cut</b>"));
}
void interfaceWindow::copy()
{
infoLabel->setText(tr("Invoked <b>Edit|Copy</b>"));
}
void interfaceWindow::paste()
{
infoLabel->setText(tr("Invoked <b>Edit|Paste</b>"));
}
void interfaceWindow::bold()
{
infoLabel->setText(tr("Invoked <b>Edit|Format|Bold</b>"));
}
void interfaceWindow::italic()
{
infoLabel->setText(tr("Invoked <b>Edit|Format|Italic</b>"));
}
void interfaceWindow::leftAlign()
{
infoLabel->setText(tr("Invoked <b>Edit|Format|Left Align</b>"));
}
void interfaceWindow::rightAlign()
{
infoLabel->setText(tr("Invoked <b>Edit|Format|Right Align</b>"));
}
void interfaceWindow::justify()
{
infoLabel->setText(tr("Invoked <b>Edit|Format|Justify</b>"));
}
void interfaceWindow::center()
{
infoLabel->setText(tr("Invoked <b>Edit|Format|Center</b>"));
}
void interfaceWindow::setLineSpacing()
{
infoLabel->setText(tr("Invoked <b>Edit|Format|Set Line Spacing</b>"));
}
void interfaceWindow::setParagraphSpacing()
{
infoLabel->setText(tr("Invoked <b>Edit|Format|Set Paragraph Spacing</b>"));
}
void interfaceWindow::about()
{
infoLabel->setText(tr("Invoked <b>Help|About</b>"));
QMessageBox::about(this, tr("About Menu"),
tr("The <b>Menu</b> example shows how to create "
"menu-bar menus and context menus."));
}
void interfaceWindow::aboutQt()
{
infoLabel->setText(tr("Invoked <b>Help|About Qt</b>"));
}
//! [4]
void interfaceWindow::createActions()
{
//! [5]
newAct = new QAction(tr("&New"), this);
newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("Create a new file"));
connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
//! [4]
openAct = new QAction(tr("&Open..."), this);
openAct->setShortcuts(QKeySequence::Open);
openAct->setStatusTip(tr("Open an existing file"));
connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
//! [5]
saveAct = new QAction(tr("&Save"), this);
saveAct->setShortcuts(QKeySequence::Save);
saveAct->setStatusTip(tr("Save the document to disk"));
connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
printAct = new QAction(tr("&Print..."), this);
printAct->setShortcuts(QKeySequence::Print);
printAct->setStatusTip(tr("Print the document"));
connect(printAct, SIGNAL(triggered()), this, SLOT(print()));
exitAct = new QAction(tr("E&xit"), this);
exitAct->setShortcuts(QKeySequence::Quit);
exitAct->setStatusTip(tr("Exit the application"));
connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
undoAct = new QAction(tr("&Undo"), this);
undoAct->setShortcuts(QKeySequence::Undo);
undoAct->setStatusTip(tr("Undo the last operation"));
connect(undoAct, SIGNAL(triggered()), this, SLOT(undo()));
redoAct = new QAction(tr("&Redo"), this);
redoAct->setShortcuts(QKeySequence::Redo);
redoAct->setStatusTip(tr("Redo the last operation"));
connect(redoAct, SIGNAL(triggered()), this, SLOT(redo()));
cutAct = new QAction(tr("Cu&t"), this);
cutAct->setShortcuts(QKeySequence::Cut);
cutAct->setStatusTip(tr("Cut the current selection's contents to the "
"clipboard"));
connect(cutAct, SIGNAL(triggered()), this, SLOT(cut()));
copyAct = new QAction(tr("&Copy"), this);
copyAct->setShortcuts(QKeySequence::Copy);
copyAct->setStatusTip(tr("Copy the current selection's contents to the "
"clipboard"));
connect(copyAct, SIGNAL(triggered()), this, SLOT(copy()));
pasteAct = new QAction(tr("&Paste"), this);
pasteAct->setShortcuts(QKeySequence::Paste);
pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current "
"selection"));
connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste()));
boldAct = new QAction(tr("&Bold"), this);
boldAct->setCheckable(true);
boldAct->setShortcut(QKeySequence::Bold);
boldAct->setStatusTip(tr("Make the text bold"));
connect(boldAct, SIGNAL(triggered()), this, SLOT(bold()));
QFont boldFont = boldAct->font();
boldFont.setBold(true);
boldAct->setFont(boldFont);
italicAct = new QAction(tr("&Italic"), this);
italicAct->setCheckable(true);
italicAct->setShortcut(QKeySequence::Italic);
italicAct->setStatusTip(tr("Make the text italic"));
connect(italicAct, SIGNAL(triggered()), this, SLOT(italic()));
QFont italicFont = italicAct->font();
italicFont.setItalic(true);
italicAct->setFont(italicFont);
setLineSpacingAct = new QAction(tr("Set &Line Spacing..."), this);
setLineSpacingAct->setStatusTip(tr("Change the gap between the lines of a "
"paragraph"));
connect(setLineSpacingAct, SIGNAL(triggered()), this, SLOT(setLineSpacing()));
setParagraphSpacingAct = new QAction(tr("Set &Paragraph Spacing..."), this);
setLineSpacingAct->setStatusTip(tr("Change the gap between paragraphs"));
connect(setParagraphSpacingAct, SIGNAL(triggered()),
this, SLOT(setParagraphSpacing()));
aboutAct = new QAction(tr("&About"), this);
aboutAct->setStatusTip(tr("Show the application's About box"));
connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
aboutQtAct = new QAction(tr("About &Qt"), this);
aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
connect(aboutQtAct, SIGNAL(triggered()), this, SLOT(aboutQt()));
leftAlignAct = new QAction(tr("&Left Align"), this);
leftAlignAct->setCheckable(true);
leftAlignAct->setShortcut(tr("Ctrl+L"));
leftAlignAct->setStatusTip(tr("Left align the selected text"));
connect(leftAlignAct, SIGNAL(triggered()), this, SLOT(leftAlign()));
rightAlignAct = new QAction(tr("&Right Align"), this);
rightAlignAct->setCheckable(true);
rightAlignAct->setShortcut(tr("Ctrl+R"));
rightAlignAct->setStatusTip(tr("Right align the selected text"));
connect(rightAlignAct, SIGNAL(triggered()), this, SLOT(rightAlign()));
justifyAct = new QAction(tr("&Justify"), this);
justifyAct->setCheckable(true);
justifyAct->setShortcut(tr("Ctrl+J"));
justifyAct->setStatusTip(tr("Justify the selected text"));
connect(justifyAct, SIGNAL(triggered()), this, SLOT(justify()));
centerAct = new QAction(tr("&Center"), this);
centerAct->setCheckable(true);
centerAct->setShortcut(tr("Ctrl+E"));
centerAct->setStatusTip(tr("Center the selected text"));
connect(centerAct, SIGNAL(triggered()), this, SLOT(center()));
alignmentGroup = new QActionGroup(this);
alignmentGroup->addAction(leftAlignAct);
alignmentGroup->addAction(rightAlignAct);
alignmentGroup->addAction(justifyAct);
alignmentGroup->addAction(centerAct);
leftAlignAct->setChecked(true);
}
void interfaceWindow::createMenus()
{
fileMenu = menuBar()->addMenu(tr("&File"));
fileMenu->addAction(newAct);
fileMenu->addAction(openAct);
fileMenu->addAction(saveAct);
fileMenu->addAction(printAct);
fileMenu->addSeparator();
fileMenu->addAction(exitAct);
editMenu = menuBar()->addMenu(tr("&Edit"));
editMenu->addAction(undoAct);
editMenu->addAction(redoAct);
editMenu->addSeparator();
editMenu->addAction(cutAct);
editMenu->addAction(copyAct);
editMenu->addAction(pasteAct);
editMenu->addSeparator();
helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(aboutAct);
helpMenu->addAction(aboutQtAct);
formatMenu = editMenu->addMenu(tr("&Format"));
formatMenu->addAction(boldAct);
formatMenu->addAction(italicAct);
formatMenu->addSeparator()->setText(tr("Alignment"));
formatMenu->addAction(leftAlignAct);
formatMenu->addAction(rightAlignAct);
formatMenu->addAction(justifyAct);
formatMenu->addAction(centerAct);
formatMenu->addSeparator();
formatMenu->addAction(setLineSpacingAct);
formatMenu->addAction(setParagraphSpacingAct);
}
| [
"dandreev@dandreev.tsc.ts"
] | dandreev@dandreev.tsc.ts |
6762717eae1f963e72ff0d569e986bd92e206efa | 45d38b73610aaab32c4427a6b7534f67d892937b | /RMCBB_AVSource/AvPlatform/hi3515/app/src/HiAo-3515.cpp | 8acd9829c9117c3d0374736f9b52c3740ad5eb4c | [] | no_license | dongdong-2009/N9M | 2a2cbcec2ac7b27f57d7bde45210793e61f02b23 | 15aaf64205641c1ca8f5e17db663ca667258b89c | refs/heads/master | 2021-06-09T00:22:49.564233 | 2016-12-12T07:33:18 | 2016-12-12T07:33:18 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 23,852 | cpp | #include "HiAo-3515.h"
#include "AvDebug.h"
#include "mpi_ao.h"
#include "mpi_sys.h"
#include "AvCommonMacro.h"
#include "AvDeviceInfo.h"
CHiAo::CHiAo()
{
#if defined(_AV_SUPPORT_REMOTE_TALK_)
m_lastAdecChn = -1;
m_bCvbsForTalking = false;
#endif
}
CHiAo::~CHiAo()
{
}
int CHiAo::HiAo_start_ao(ao_type_e ao_type)
{
AUDIO_DEV ao_dev = 0;
AIO_ATTR_S ao_attr;
memset(&ao_attr, 0, sizeof(AIO_ATTR_S));
HiAo_get_ao_info(ao_type, &ao_dev, NULL, &ao_attr);
//0717
#ifdef _AV_PLATFORM_HI3521_
if(HI_MPI_AO_ClrPubAttr(ao_dev) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_start_ao HI_MPI_AO_ClrPubAttr FAILED !(ao_dev:%d)", ao_dev);
}
#endif
if (HiAo_memory_balance(ao_dev) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_start_ao HiAo_memory_balance FAILED !(ao_dev:%d)", ao_dev);
return -1;
}
if (HiAo_start_ao_dev(ao_dev, &ao_attr) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_start_ao HiAo_start_ao_dev FAILED! (ao_type:%d) (ao_dev:%d)", ao_type, ao_dev);
return -1;
}
for (unsigned int chn = 0; chn < ao_attr.u32ChnCnt; ++chn)
{
if (HiAo_start_ao_chn(ao_dev, chn) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_start_ao HiAo_start_ao_chn FAILED !(ao_dev:%d) (ao_chn:%d)", ao_dev, chn);
return -1;
}
#if !defined(_AV_PLATFORM_HI3516A_)
if (ao_type == _AO_HDMI_)
{
AUDIO_RESAMPLE_ATTR_S ao_resample_attr;
ao_resample_attr.enInSampleRate = AUDIO_SAMPLE_RATE_8000;
#ifdef _AV_PLATFORM_HI3520D_V300_
ao_resample_attr.enOutSampleRate = AUDIO_SAMPLE_RATE_32000;
#else
ao_resample_attr.enReSampleType = AUDIO_RESAMPLE_1X4;
#endif
ao_resample_attr.u32InPointNum = 320;
if (HiAo_enable_ao_resample(ao_dev, chn, &ao_resample_attr) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_start_ao HiAo_enable_ao_resample (ao_dev:%d) (ao_chn:%d) FAILED!\n", ao_dev, chn);
return -1;
}
}
#endif
}
#if 0// defined(_AV_PLATFORM_HI3515_)
/* bind AI to AO channle */
HI_S32 s32Ret = HI_MPI_AO_BindAi(ao_dev, 0, 0, 0);
if (s32Ret != HI_SUCCESS)
{
DEBUG_ERROR("\nHI_MPI_AO_BindAi error,s32Ret=%d\n",s32Ret);
return HI_FAILURE;
}
#endif
return 0;
}
int CHiAo::HiAo_stop_ao(ao_type_e ao_type)
{
AUDIO_DEV ao_dev = 0;
AIO_ATTR_S ao_attr;
memset(&ao_attr, 0, sizeof(AIO_ATTR_S));
HiAo_get_ao_info(ao_type, &ao_dev, NULL, &ao_attr);
for (unsigned int chn = 0; chn < ao_attr.u32ChnCnt; ++chn)
{
if (ao_type == _AO_HDMI_ && HiAo_disable_ao_resample(ao_dev, chn) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_stop_ao HiAo_disable_ao_resample (ao_dev:%d) (ao_chn:%d) FAILED!\n", ao_dev, chn);
return -1;
}
if (HiAo_stop_ao_chn(ao_dev, chn) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_stop_ao HiAo_stop_ao_chn (ao_dev:%d) (ao_chn:%d) FAILED!\n", ao_dev, chn);
return -1;
}
}
if (HiAo_stop_ao_dev(ao_dev) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_stop_ao HiAo_stop_ao_dev (ao_dev:%d) FAILED!\n", ao_dev);
return -1;
}
//0717
#ifdef _AV_PLATFORM_HI3521_
if(HI_MPI_AO_ClrPubAttr(ao_dev) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_stop_ao HI_MPI_AO_ClrPubAttr (ao_dev:%d) FAILED!\n", ao_dev);
return -1;
}
#endif
return 0;
}
int CHiAo::HiAo_get_ao_info(ao_type_e ao_type, AUDIO_DEV *pAo_dev, AO_CHN *pAo_chn/*=NULL*/, AIO_ATTR_S *pAo_attr/*=NULL*/) const
{
if (pAo_dev != NULL || pAo_chn != NULL)
{
#if defined(_AV_PLATFORM_HI3531_) || defined(_AV_PLATFORM_HI3532_)
switch (ao_type)
{
case _AO_HDMI_:
_AV_POINTER_ASSIGNMENT_(pAo_dev, 5);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
break;
case _AO_TALKBACK_:
_AV_POINTER_ASSIGNMENT_(pAo_dev, 4);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
break;
case _AO_PLAYBACK_CVBS_:
_AV_POINTER_ASSIGNMENT_(pAo_dev, 4);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
break;
default:
DEBUG_ERROR( "CHiAo::HiAi_get_ao_info FAILED(ao_type:%d) no this audio output type\n", ao_type);
return -1;
}
#elif defined(_AV_PLATFORM_HI3535_)
switch(ao_type)
{
case _AO_HDMI_:
_AV_POINTER_ASSIGNMENT_(pAo_dev, 1);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
break;
case _AO_TALKBACK_:
_AV_POINTER_ASSIGNMENT_(pAo_dev, 0);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
break;
case _AO_PLAYBACK_CVBS_:
_AV_POINTER_ASSIGNMENT_(pAo_dev, 0);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
break;
default:
DEBUG_ERROR( "CHiAo::HiAi_get_ao_info FAILED(ao_type:%d) no this audio output type\n", ao_type);
return -1;
}
#elif defined(_AV_PLATFORM_HI3520A_) || defined(_AV_PLATFORM_HI3521_)
switch (ao_type)
{
case _AO_HDMI_:
_AV_POINTER_ASSIGNMENT_(pAo_dev, 3);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
break;
case _AO_TALKBACK_:
_AV_POINTER_ASSIGNMENT_(pAo_dev, 2);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
break;
case _AO_PLAYBACK_CVBS_:
_AV_POINTER_ASSIGNMENT_(pAo_dev, 2);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
break;
default:
DEBUG_ERROR( "CHiAo::HiAi_get_ao_info FAILED(ao_type:%d) no this audio output type\n", ao_type);
return -1;
}
#elif defined(_AV_PLATFORM_HI3520D_)
if( ao_type == _AO_HDMI_ )
{
_AV_POINTER_ASSIGNMENT_(pAo_dev, 1);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
}
else if( ao_type == _AO_TALKBACK_ || ao_type == _AO_PLAYBACK_CVBS_ )
{
_AV_POINTER_ASSIGNMENT_(pAo_dev, 0);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
}
else
{
DEBUG_ERROR( "CHiAo::HiAi_get_ao_info FAILED(ao_type:%d) no this audio output type\n", ao_type);
return -1;
}
#elif defined(_AV_PLATFORM_HI3520D_V300_)
if( ao_type == _AO_HDMI_ )
{
_AV_POINTER_ASSIGNMENT_(pAo_dev, 1);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
}
else if( ao_type == _AO_TALKBACK_ || ao_type == _AO_PLAYBACK_CVBS_ )
{
_AV_POINTER_ASSIGNMENT_(pAo_dev, 0);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
}
else
{
DEBUG_ERROR( "CHiAo::HiAi_get_ao_info FAILED(ao_type:%d) no this audio output type\n", ao_type);
return -1;
}
#elif defined(_AV_PLATFORM_HI3518C_) || defined(_AV_PLATFORM_HI3516A_)
switch (ao_type)
{
case _AO_TALKBACK_:
_AV_POINTER_ASSIGNMENT_(pAo_dev, 0);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
break;
default:
DEBUG_ERROR( "CHiAo::HiAi_get_ao_info FAILED(ao_type:%d) not support this audio output type\n", ao_type);
return -1;
}
#elif defined(_AV_PLATFORM_HI3515_)
switch(ao_type)
{
case _AO_HDMI_:
_AV_POINTER_ASSIGNMENT_(pAo_dev, 0);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
break;
case _AO_TALKBACK_:
_AV_POINTER_ASSIGNMENT_(pAo_dev, 0);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
break;
case _AO_PLAYBACK_CVBS_:
_AV_POINTER_ASSIGNMENT_(pAo_dev, 0);
_AV_POINTER_ASSIGNMENT_(pAo_chn, 0);
break;
default:
DEBUG_ERROR( "CHiAo::HiAi_get_ao_info FAILED(ao_type:%d) no this audio output type\n", ao_type);
return -1;
}
#endif
}
eProductType product_type = PTD_INVALID;
product_type = pgAvDeviceInfo->Adi_product_type();
if (pAo_attr != NULL)
{
pAo_attr->enBitwidth = AUDIO_BIT_WIDTH_16;
pAo_attr->enWorkmode = AIO_MODE_I2S_MASTER;
#if !defined(_AV_PLATFORM_HI3515_)
pAo_attr->enSoundmode = AUDIO_SOUND_MODE_MONO;
#else
pAo_attr->enSoundmode = AUDIO_SOUND_MODE_MOMO;
#endif
pAo_attr->u32FrmNum = 5;
pAo_attr->u32ChnCnt = 2;
#ifdef _AV_PLATFORM_HI3520D_V300_
pAo_attr->u32ClkChnCnt = 2;
#endif
#ifdef _AV_PLATFORM_HI3535_
pAo_attr->u32ClkSel = 0;
pAo_attr->u32EXFlag = 1;
#else
if(product_type == PTD_D5_35)
{
pAo_attr->u32ClkSel = 0;
}
else
{
pAo_attr->u32ClkSel = 1;
}
pAo_attr->u32EXFlag = 0;
#endif
switch (ao_type)
{
case _AO_PLAYBACK_CVBS_:
HiAo_get_cvbs_workmode( pAo_attr->enWorkmode );
pAo_attr->enSamplerate = AUDIO_SAMPLE_RATE_8000;
pAo_attr->u32PtNumPerFrm = 320;
break;
case _AO_HDMI_:
pAo_attr->enSamplerate = AUDIO_SAMPLE_RATE_32000;
pAo_attr->u32PtNumPerFrm = 320 * 4;
break;
case _AO_TALKBACK_:
HiAo_get_cvbs_workmode( pAo_attr->enWorkmode );
pAo_attr->enSamplerate = AUDIO_SAMPLE_RATE_8000;
pAo_attr->u32PtNumPerFrm = 320;
break;
default:
DEBUG_ERROR( "CHiAo::HiAi_get_ao_info FAILED(ao_type:%d) no this audio output type\n", ao_type);
return -1;
}
if((product_type == PTD_A5_II) || (product_type == PTD_6A_I))
{
pAo_attr->u32FrmNum = 40;
pAo_attr->u32ClkSel = 0;
pAo_attr->u32EXFlag = 1;
if (*pAo_dev == 0)
{
pAo_attr->enSamplerate = AUDIO_SAMPLE_RATE_8000;
}
else
{
pAo_attr->enSamplerate = AUDIO_SAMPLE_RATE_8000;
}
}
DEBUG_WARNING("ao attr samplerate:%d, framenum:%d, clksel:%d, extflag:%d, ptnum:%d, workmode:%d, bitwidth:%d, soudmod:%d\n",\
pAo_attr->enSamplerate, pAo_attr->u32FrmNum, pAo_attr->u32ClkSel, pAo_attr->u32EXFlag, pAo_attr->u32PtNumPerFrm,\
pAo_attr->enWorkmode, pAo_attr->enBitwidth,pAo_attr->enSoundmode);
}
return 0;
}
int CHiAo::HiAo_start_ao_dev(AUDIO_DEV ao_dev, const AIO_ATTR_S *pAo_attr) const
{
int ret_val = -1;
eProductType product_type = PTD_INVALID;
product_type = pgAvDeviceInfo->Adi_product_type();
if(product_type == PTD_D5_35)
{
if ((ret_val = HI_MPI_AO_Disable(ao_dev)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_start_ao_dev HI_MPI_AO_Disable FAILED(ao_dev:%d)(0x%08lx)\n", ao_dev, (unsigned long)ret_val);
return -1;
}
}
if ((ret_val = HI_MPI_AO_SetPubAttr(ao_dev, pAo_attr)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_start_ao_dev HI_MPI_AO_SetPubAttr FAILED(ao_dev:%d)(0x%08lx)\n", ao_dev, (unsigned long)ret_val);
return -1;
}
#if defined(_AV_PLATFORM_HI3515_)
HI_MPI_SYS_SetReg(0x20050064,0x83218DEF);
#endif
if ((ret_val = HI_MPI_AO_Enable(ao_dev)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_start_ao_dev HI_MPI_AO_Enable FAILED(ao_dev:%d)(0x%08lx)\n", ao_dev, (unsigned long)ret_val);
return -1;
}
return 0;
}
int CHiAo::HiAo_stop_ao_dev(AUDIO_DEV ao_dev) const
{
int ret_val = -1;
if ((ret_val = HI_MPI_AO_Disable(ao_dev)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_stop_ao_dev HI_MPI_AO_Disable FAILED(ao_dev:%d)(0x%08lx)\n", ao_dev, (unsigned long)ret_val);
return -1;
}
return 0;
}
int CHiAo::HiAo_start_ao_chn(AUDIO_DEV ao_dev, AO_CHN ao_chn) const
{
HI_S32 ret_val = -1;
if ((ret_val = HI_MPI_AO_EnableChn(ao_dev, ao_chn)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_start_ao_chn HI_MPI_AO_EnableChn FAILED(ao_dev:%d)(ao_chn:%d)(0x%08lx)\n", ao_dev, ao_chn, (unsigned long)ret_val);
return -1;
}
return 0;
}
int CHiAo::HiAo_stop_ao_chn(AUDIO_DEV ao_dev, AO_CHN ao_chn) const
{
int ret_val = -1;
if ((ret_val = HI_MPI_AO_DisableChn(ao_dev, ao_chn)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_stop_ao_chn HI_MPI_AO_DisableChn FAILED(ao_dev:%d)(ao_chn:%d)(0x%08lx)\n", ao_dev, ao_chn, (unsigned long)ret_val);
return -1;
}
return 0;
}
#if !defined(_AV_PLATFORM_HI3515_)
int CHiAo::HiAo_send_ao_frame(ao_type_e ao_type, const AUDIO_FRAME_S *pAudioframe) const
{
int ret_val = -1;
int ao_dev = 0;
int ao_chn = 0;
HiAo_get_ao_info(ao_type, &ao_dev, &ao_chn);
#if defined(_AV_PLATFORM_HI3535_)
if ((ret_val = HI_MPI_AO_SendFrame(ao_dev, ao_chn, pAudioframe, -1)) != 0) // for HI3535, -1 block mode
#elif defined(_AV_PLATFORM_HI3520D_V300_)
if ((ret_val = HI_MPI_AO_SendFrame(ao_dev, ao_chn, pAudioframe, 1000)) != 0) // for HI3535, -1 block mode
#else
if ((ret_val = HI_MPI_AO_SendFrame(ao_dev, ao_chn, pAudioframe, HI_TRUE)) != 0)
#endif
{
DEBUG_ERROR( "CHiAo::HiAo_send_ao_frame HI_MPI_AO_SendFrame FAILED(ao_dev:%d)(ao_chn:%d)(0x%08lx)\n", ao_dev, ao_chn, (unsigned long)ret_val);
return -1;
}
return 0;
}
#endif
int CHiAo::HiAo_clear_ao_chnbuf(ao_type_e ao_type) const
{
int ret_val = -1;
AUDIO_DEV ao_dev = 0;
AO_CHN ao_chn = 0;
HiAo_get_ao_info(ao_type, &ao_dev, &ao_chn);
if ((ret_val = HI_MPI_AO_ClearChnBuf(ao_dev, ao_chn)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_clear_ao_chnbuf HI_MPI_AO_ClearChnBuf FAILED(ao_dev:%d)(ao_chn:%d)(0x%08lx)\n", ao_dev, ao_chn, (unsigned long)ret_val);
return -1;
}
return 0;
}
#if !defined(_AV_PLATFORM_HI3515_)
int CHiAo::HiAo_adec_bind_ao(ao_type_e ao_type, ADEC_CHN adec_chn)
{
#if defined(_AV_PRODUCT_CLASS_NVR_)
if (pgAvDeviceInfo->Adi_app_type() == APP_TYPE_TEST)
{
return 0;
}
if( ao_type == _AO_PLAYBACK_CVBS_ )
{
m_lastAdecChn = adec_chn;
if(0)
{
if (m_bCvbsForTalking)
{
return 0;
}
}
}
#endif
int ret_val = -1;
MPP_CHN_S stSrcChn,stDestChn;
stSrcChn.enModId = HI_ID_ADEC;
stSrcChn.s32DevId = 0;
stSrcChn.s32ChnId = adec_chn;
stDestChn.enModId = HI_ID_AO;
HiAo_get_ao_info(ao_type, &stDestChn.s32DevId, &stDestChn.s32ChnId);
printf("HiAo_adec_bind_ao:ao_type=%d,dev=%d,chn=%d!\n", ao_type, stDestChn.s32DevId, stDestChn.s32ChnId);
if ((ret_val = HI_MPI_SYS_Bind(&stSrcChn, &stDestChn)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_adec_bind_ao HI_MPI_SYS_Bind FAILED (ao_type:%d) (adec_chn:%d) (ao_dev:%d) (ao_chn:%d)(0x%08lx)\n", ao_type, adec_chn, stDestChn.s32DevId, stDestChn.s32ChnId, (unsigned long)ret_val);
return -1;
}
return 0;
}
int CHiAo::HiAo_adec_unbind_ao(ao_type_e ao_type, ADEC_CHN adec_chn)
{
#if defined(_AV_PRODUCT_CLASS_NVR_)
if (pgAvDeviceInfo->Adi_app_type() == APP_TYPE_TEST)
{
return 0;
}
if( ao_type == _AO_PLAYBACK_CVBS_ )
{
m_lastAdecChn = -1;
if(1)
{
if( m_bCvbsForTalking )
{
return 0;
}
}
}
#endif
int ret_val = -1;
MPP_CHN_S stSrcChn,stDestChn;
stSrcChn.enModId = HI_ID_ADEC;
stSrcChn.s32DevId = 0;
stSrcChn.s32ChnId = adec_chn;
stDestChn.enModId = HI_ID_AO;
HiAo_get_ao_info(ao_type, &stDestChn.s32DevId, &stDestChn.s32ChnId);
if ((ret_val = HI_MPI_SYS_UnBind(&stSrcChn, &stDestChn)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_adec_bind_ao HI_MPI_SYS_UnBind FAILED (ao_type:%d) (adec_chn:%d) (ao_dev:%d) (ao_chn:%d)(0x%08lx)\n", ao_type, adec_chn, stDestChn.s32DevId, stDestChn.s32ChnId, (unsigned long)ret_val);
return -1;
}
return 0;
}
#else //HI3515
int CHiAo::HiAo_adec_bind_ao(ao_type_e ao_type,AO_CHN ao_chn, ADEC_CHN adec_chn)
{
int ret_val = -1;
AUDIO_DEV ao_dev;
// AO_CHN ao_chn;
HiAo_get_ao_info(ao_type, &ao_dev);
printf("HiAo_adec_bind_ao:ao_type=%d,dev=%d,chn=%d!\n", ao_type, ao_dev, ao_chn);
if ((ret_val = HI_MPI_AO_BindAdec(ao_dev, ao_chn, adec_chn)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_adec_bind_ao HI_MPI_SYS_Bind FAILED (ao_type:%d) (adec_chn:%d) (ao_dev:%d) (ao_chn:%d)(0x%08lx)\n", ao_type, adec_chn, ao_dev, ao_chn, (unsigned long)ret_val);
return -1;
}
return 0;
}
int CHiAo::HiAo_adec_unbind_ao(ao_type_e ao_type,AO_CHN ao_chn, ADEC_CHN adec_chn)
{
int ret_val = -1;
AUDIO_DEV ao_dev;
//AO_CHN ao_chn;
HiAo_get_ao_info(ao_type, &ao_dev);
printf("HiAo_adec_unbind_ao:ao_type=%d,dev=%d,chn=%d!\n", ao_type, ao_dev, ao_chn);
if ((ret_val = HI_MPI_AO_UnBindAdec(ao_dev, ao_chn, adec_chn)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_adec_bind_ao HI_MPI_SYS_Bind FAILED (ao_type:%d) (adec_chn:%d) (ao_dev:%d) (ao_chn:%d)(0x%08lx)\n", ao_type, adec_chn, ao_dev, ao_chn, (unsigned long)ret_val);
return -1;
}
return 0;
}
int CHiAo::HiAo_adec_bind_ao(ao_type_e ao_type, ADEC_CHN adec_chn)
{
int ret_val = -1;
AUDIO_DEV ao_dev;
AO_CHN ao_chn;
HiAo_get_ao_info(ao_type, &ao_dev, &ao_chn);
printf("HiAo_adec_bind_ao:ao_type=%d,dev=%d,chn=%d!\n", ao_type, ao_dev, ao_chn);
if ((ret_val = HI_MPI_AO_BindAdec(ao_dev, ao_chn, adec_chn)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_adec_bind_ao HI_MPI_SYS_Bind FAILED (ao_type:%d) (adec_chn:%d) (ao_dev:%d) (ao_chn:%d)(0x%08lx)\n", ao_type, adec_chn, ao_dev, ao_chn, (unsigned long)ret_val);
return -1;
}
return 0;
}
int CHiAo::HiAo_adec_unbind_ao(ao_type_e ao_type,ADEC_CHN adec_chn)
{
int ret_val = -1;
AUDIO_DEV ao_dev;
AO_CHN ao_chn;
HiAo_get_ao_info(ao_type, &ao_dev, &ao_chn);
printf("HiAo_adec_unbind_ao:ao_type=%d,dev=%d,chn=%d!\n", ao_type, ao_dev, ao_chn);
if ((ret_val = HI_MPI_AO_UnBindAdec(ao_dev, ao_chn, adec_chn)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_adec_bind_ao HI_MPI_SYS_Bind FAILED (ao_type:%d) (adec_chn:%d) (ao_dev:%d) (ao_chn:%d)(0x%08lx)\n", ao_type, adec_chn, ao_dev, ao_chn, (unsigned long)ret_val);
return -1;
}
return 0;
}
#endif
#if defined(_AV_PLATFORM_HI3516A_)
int CHiAo::HiAo_enable_ao_resample(AUDIO_DEV ao_dev, AO_CHN ao_chn, AUDIO_SAMPLE_RATE_E enInSampleRate) const
{
int ret_val = -1;
if ((ret_val = HI_MPI_AO_EnableReSmp(ao_dev, ao_chn, enInSampleRate)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_enable_ao_resample HI_MPI_AO_EnableReSmp FAILED(ao_dev:%d)(ao_chn:%d)(0x%08lx)\n", ao_dev, ao_chn, (unsigned long)ret_val);
return -1;
}
return 0;
}
#else
int CHiAo::HiAo_enable_ao_resample(AUDIO_DEV ao_dev, AO_CHN ao_chn, AUDIO_RESAMPLE_ATTR_S *pResampleAttr) const
{
int ret_val = -1;
#ifdef _AV_PLATFORM_HI3520D_V300_
if ((ret_val = HI_MPI_AO_EnableReSmp(ao_dev, ao_chn, pResampleAttr->enInSampleRate)) != 0)
#else
if ((ret_val = HI_MPI_AO_EnableReSmp(ao_dev, ao_chn, pResampleAttr)) != 0)
#endif
{
DEBUG_ERROR( "CHiAo::HiAo_enable_ao_resample HI_MPI_AO_EnableReSmp FAILED(ao_dev:%d)(ao_chn:%d)(0x%08lx)\n", ao_dev, ao_chn, (unsigned long)ret_val);
return -1;
}
return 0;
}
#endif
int CHiAo::HiAo_disable_ao_resample(AUDIO_DEV ao_dev, AO_CHN ao_chn) const
{
int ret_val = -1;
if ((ret_val = HI_MPI_AO_DisableReSmp(ao_dev, ao_chn)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_disable_ao_resample HI_MPI_AO_DisableReSmp FAILED(ao_dev:%d)(ao_chn:%d)(0x%08lx)\n", ao_dev, ao_chn, (unsigned long)ret_val);
return -1;
}
return 0;
}
int CHiAo::HiAo_memory_balance(AUDIO_DEV ao_dev) const
{
#ifdef _AV_PLATFORM_HI3531_
int ret_val = -1;
MPP_CHN_S mpp_chn;
const char *pDdrName = NULL;
pDdrName = "ddr1";
mpp_chn.enModId = HI_ID_AO;
mpp_chn.s32DevId = ao_dev;
mpp_chn.s32ChnId = 0;
if ((ret_val = HI_MPI_SYS_SetMemConf(&mpp_chn, pDdrName)) != 0)
{
DEBUG_ERROR( "CHiAo::HiAo_memory_balance HI_MPI_SYS_SetMemConf FAILED(ao_dev:%d) (0x%08lx)\n", ao_dev, (unsigned long)ret_val);
return -1;
}
#endif
return 0;
}
int CHiAo::HiAo_get_cvbs_workmode(AIO_MODE_E& mode) const
{
#if defined(_AV_PLATFORM_HI3535_) || defined(_AV_PLATFORM_HI3521_) || defined(_AV_PLATFORM_HI3531_)|| defined(_AV_PLATFORM_HI3515_)
mode = AIO_MODE_I2S_MASTER;
#else
mode = AIO_MODE_I2S_SLAVE;
#endif
return 0;
}
#if defined(_AV_SUPPORT_REMOTE_TALK_)
int CHiAo::HiAo_unbind_cvbs_ao_for_talk( bool bUnBind )
{
if( 1)
{
return 0;
}
if( bUnBind )
{
ADEC_CHN temp = m_lastAdecChn;
if( m_lastAdecChn == -1 )
{
m_bCvbsForTalking = true;
return 0;
}
this->HiAo_adec_unbind_ao(_AO_PLAYBACK_CVBS_, temp );
m_lastAdecChn = temp;
m_bCvbsForTalking = true;
}
else
{
m_bCvbsForTalking = false;
if( m_lastAdecChn == -1 )
{
return 0;
}
this->HiAo_adec_bind_ao(_AO_PLAYBACK_CVBS_, m_lastAdecChn );
}
return 0;
}
#endif
int CHiAo::HiAo_set_ao_volume(AUDIO_DEV dev, unsigned char volume)
{
#ifdef _AV_PLATFORM_HI3535_
HI_S32 ret = 0, AdjustVolume = 0;
if(volume > 63)
{
volume = 63;
}
if(volume >= 40)
{
AdjustVolume = volume - 63;
}
else
{
AdjustVolume = (26 + volume / 3) - 63;
}
ret = HI_MPI_AO_SetVolume(dev, AdjustVolume);
if(ret != HI_SUCCESS)
{
DEBUG_ERROR( "CHiAo::HiAo_set_ao_volume set ao volume failed(dev=%d, volume=%d, ret:0x%x)!\n", dev, volume,ret);
return -1;
}
#endif
return 0;
}
#if defined(_AV_HAVE_AUDIO_INPUT_)
int CHiAo::HiAo_ai_bind_ao(ao_type_e ao_type,AUDIO_DEV ai_dev,AI_CHN ai_chn)
{
int ret_val = -1;
AUDIO_DEV ao_dev;
AO_CHN ao_chn;
//AIO_ATTR_S ao_attr;
HiAo_get_ao_info(ao_type,&ao_dev, &ao_chn, NULL);
ret_val = HI_MPI_AO_BindAi(ao_dev,ao_chn, ai_dev, ai_chn);
if (ret_val != 0)
{
DEBUG_ERROR("HI_MPI_AO_BindAi failed(0x%08x)!ao_dev:%d, ao_chn:%d, ai_dev:%d, ai_chn:%d\n",ret_val,ao_dev,ao_chn, ai_dev, ai_chn);
return -1;
}
return 0;
}
int CHiAo::HiAo_ai_unbind_ao(ao_type_e ao_type,AUDIO_DEV ai_dev,AI_CHN ai_chn)
{
int ret_val = -1;
AUDIO_DEV ao_dev;
AO_CHN ao_chn;
//AIO_ATTR_S ao_attr;
HiAo_get_ao_info(ao_type,&ao_dev, &ao_chn, NULL);
if ((ret_val = HI_MPI_AO_UnBindAi(ao_dev,ao_chn, ai_dev, ai_chn)) != 0)
{
DEBUG_ERROR("HI_MPI_AO_UnBindAi failed(0x%08x)!ao_dev:%d, ao_chn:%d, ai_dev:%d, ai_chn:%d\n",ret_val,ao_dev,ao_chn, ai_dev, ai_chn);
return -1;
}
return 0;
}
#endif
| [
"bingximagic@126.com"
] | bingximagic@126.com |
055c697dcf448c4c25c564ef5ac3e5aa37b7a440 | cd80f58723b623a1a8ad44c14ba0462d9046d770 | /ReverseAStack.cpp | df9e85583176939f5922bce92fc326d4489fd795 | [] | no_license | Akhileshsukumaran/Ds-and-Algo-for-Pratice | 7c8c226c333b844f413993906a0742ff01761f4c | 18c8cdc984f55c1f57398347323ea0cd9c79bdbf | refs/heads/main | 2023-08-24T07:32:16.086904 | 2021-10-12T12:45:36 | 2021-10-12T12:45:36 | 391,370,970 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 695 | cpp | #include<iostream>
#include<stack>
using namespace std;
void InsertAtBottom(stack<int> &s, int temp)
{
if(s.empty())
{
s.push(temp);
return;
}
int t = s.top();
s.pop();
InsertAtBottom(s, temp);
s.push(t);
}
void StackReverse(stack<int> &s)
{
if(s.empty())
{
return;
}
int temp = s.top();
s.pop();
StackReverse(s);
InsertAtBottom(s, temp);
}
int main()
{
stack<int> numbers;
numbers.push(1);
numbers.push(2);
numbers.push(3);
numbers.push(4);
numbers.push(5);
StackReverse(numbers);
while(!numbers.empty())
{
cout<<numbers.top()<<endl;
numbers.pop();
}
} | [
"akhileshs2017@gmail.com"
] | akhileshs2017@gmail.com |
cad8d1d40cceecc7339263c4c8a0994dc4ee823c | 15ae3c07d969f1e75bc2af9555cf3e952be9bfff | /analysis/pragma_before/pragma_529.hpp | e47e3a83bdf24a840465602117386b6ffef8a7b2 | [] | no_license | marroko/generators | d2d1855d9183cbc32f9cd67bdae8232aba2d1131 | 9e80511155444f42f11f25063c0176cb3b6f0a66 | refs/heads/master | 2023-02-01T16:55:03.955738 | 2020-12-12T14:11:17 | 2020-12-12T14:11:17 | 316,802,086 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 71 | hpp | #ifndef BIZPOIHXVH_HPP
#define BIZPOIHXVH_HPP
#endif // BIZPOIHXVH_HPP | [
"marcus1.2.3@wp.pl"
] | marcus1.2.3@wp.pl |
4dfa5a0dd76b2d593fa42855d75289f5221f55aa | 5c5ba0cbdc972b56a3ac7664f68a74fe382c645a | /uri/6 - Paradigms/1777/Main.cpp | 2c5bac0e676e61050b01b145e22f28024f2fc0d1 | [] | no_license | humbertodias/challenges | 91e090b70ed65269ff94f0b8d4096526d3545ba3 | b832d55491b4d5c840b0bb25b931aef8f04f5784 | refs/heads/master | 2020-04-05T14:03:38.384606 | 2019-01-29T12:28:13 | 2019-01-29T12:28:13 | 94,749,550 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,408 | cpp | #include <cstdio>
#include <vector>
#include <set>
#include <algorithm> // sort
#define _ printf("\n");
#define fr(i,a,b) for(int i=(a); i <(b); i++)
#define st first
#define nd second
#define fe(i,a,b) for(int i=(a); i <=(b); i++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define sc1(a) scanf("%d", &a)
#define sc2(a,b) scanf("%d %d", &a, &b)
#define sc3(a,b,c) scanf("%d %d %d", &a, &b, &c)
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
pair<ll, ll> freq[100050];
vii v;
bool mycmp(ii a, ii b){
if(a.st == b.st ) return a.nd < b.nd;
return a.st < b.st;
}
vi v2;
vi v3;
int main (int argc, char const* argv[]) {
int caso;
sc1(caso);
ll n, c;
ll a, b, e;
fe(t,1,caso){
scanf("%lld %lld", &n, &c);
v.clear();
v2.clear();
v3.clear();
fr(i,0,c){
scanf("%lld %lld", &a, &b);
v.pb(mp(a,b));
}
scanf("%lld", &e);
fr(i,0,e){
scanf("%lld", &a);
v3.pb(a);
}
fe(i,0,e+5) freq[i]=mp(0,0);
// sort(v.begin(), v.end(), mycmp);
sort(v3.begin(), v3.end());
v2.pb(v3[0]);
freq[1].nd = 1;
fr(i,1,v3.size()){
if(v3[i] == v2.back() ){
freq[v2.size()].nd++;
}
else{
v2.pb(v3[i]);
freq[v2.size()].nd = 1;
}
}
//fr(i,0,v2.size()){
// printf("%d fre %d %d\n", v2[i] , freq[i].st, freq[i].nd);
// }
//_
int r =0;
fr(i,0,v.size()){
a = v[i].st, b = v[i].nd;
//printf("a: %lld | b: %lld\n", a, b);
int p1 = lower_bound(v2.begin(), v2.end(), a) - v2.begin();
if( p1 >= v2.size()) continue;
//if( v2[p1] < a) continue;
int p2 = upper_bound(v2.begin() + (p1+1) , v2.end(), b) - v2.begin() ;
//printf("p1 : %d | p2: %d\n", p1, p2);
if( p2-1 < 0 ) continue;
if(v2[p2-1] > b) continue;
freq[p1+1].st++;
freq[p2+1].st--;
//printf();
}
fe(i,1,v2.size()){
freq[i].st += freq[i-1].st;
}
fe(i,1,v2.size()){
if(freq[i].st >= 1) r+= freq[i].nd ;
}
printf("Caso #%d: %d\n", t, r);
}
return 0;
}
| [
"humberto.dias@techne.com.br"
] | humberto.dias@techne.com.br |
6d935eda8ea2e5b14082f02b71cd7e4d24a2f519 | bf457609603613ac247e1696f76da8ae0cf11657 | /State Machines/WestWorldWithMessaging/MinerOwnedStates.cpp | d98cd3067528fd9629a69f795369cbb8ee226ebe | [] | no_license | arda-a/Game-AI-Practice | 306a6752b99560c343b0ffa378ec63f3c9ba4fe8 | f1e9839c88ba3ae4a2d7675ca98d372ce5e1bedb | refs/heads/master | 2020-05-25T06:01:32.977964 | 2019-08-19T06:17:20 | 2019-08-19T06:17:20 | 187,660,145 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,078 | cpp | #include "MinerOwnedStates.h"
#include "fsm/State.h"
#include "Miner.h"
#include "Locations.h"
#include "messaging/Telegram.h"
#include "MessageDispatcher.h"
#include "MessageTypes.h"
#include "Time/CrudeTimer.h"
#include "EntityNames.h"
#include <iostream>
using std::cout;
#ifdef TEXTOUTPUT
#include <fstream>
extern std::ofstream os;
#define cout os
#endif
//------------------------------------------------------------------------methods for EnterMineAndDigForNugget
EnterMineAndDigForNugget* EnterMineAndDigForNugget::Instance()
{
static EnterMineAndDigForNugget instance;
return &instance;
}
void EnterMineAndDigForNugget::Enter(Miner* pMiner)
{
//if the miner is not already located at the goldmine, he must
//change location to the gold mine
if (pMiner->Location() != goldmine)
{
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": " << "Walkin' to the goldmine";
pMiner->ChangeLocation(goldmine);
}
}
void EnterMineAndDigForNugget::Execute(Miner* pMiner)
{
//Now the miner is at the goldmine he digs for gold until he
//is carrying in excess of MaxNuggets. If he gets thirsty during
//his digging he packs up work for a while and changes state to
//gp to the saloon for a whiskey.
pMiner->AddToGoldCarried(1);
pMiner->IncreaseFatigue();
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": " << "Pickin' up a nugget";
//if enough gold mined, go and put it in the bank
if (pMiner->PocketsFull())
{
pMiner->GetFSM()->ChangeState(VisitBankAndDepositGold::Instance());
}
if (pMiner->Thirsty())
{
pMiner->GetFSM()->ChangeState(QuenchThirst::Instance());
}
}
void EnterMineAndDigForNugget::Exit(Miner* pMiner)
{
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": "
<< "Ah'm leavin' the goldmine with mah pockets full o' sweet gold";
}
bool EnterMineAndDigForNugget::OnMessage(Miner* pMiner, const Telegram& msg)
{
//send msg to global message handler
return false;
}
//------------------------------------------------------------------------methods for VisitBankAndDepositGold
VisitBankAndDepositGold* VisitBankAndDepositGold::Instance()
{
static VisitBankAndDepositGold instance;
return &instance;
}
void VisitBankAndDepositGold::Enter(Miner* pMiner)
{
//on entry the miner makes sure he is located at the bank
if (pMiner->Location() != bank)
{
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": " << "Goin' to the bank. Yes siree";
pMiner->ChangeLocation(bank);
}
}
void VisitBankAndDepositGold::Execute(Miner* pMiner)
{
//deposit the gold
pMiner->AddToWealth(pMiner->GoldCarried());
pMiner->SetGoldCarried(0);
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": "
<< "Depositing gold. Total savings now: "<< pMiner->Wealth();
//wealthy enough to have a well earned rest?
if (pMiner->Wealth() >= ComfortLevel)
{
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": "
<< "WooHoo! Rich enough for now. Back home to mah li'lle lady";
pMiner->GetFSM()->ChangeState(GoHomeAndSleepTilRested::Instance());
}
//otherwise get more gold
else
{
pMiner->GetFSM()->ChangeState(EnterMineAndDigForNugget::Instance());
}
}
void VisitBankAndDepositGold::Exit(Miner* pMiner)
{
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": " << "Leavin' the bank";
}
bool VisitBankAndDepositGold::OnMessage(Miner* pMiner, const Telegram& msg)
{
//send msg to global message handler
return false;
}
//------------------------------------------------------------------------methods for GoHomeAndSleepTilRested
GoHomeAndSleepTilRested* GoHomeAndSleepTilRested::Instance()
{
static GoHomeAndSleepTilRested instance;
return &instance;
}
void GoHomeAndSleepTilRested::Enter(Miner* pMiner)
{
if (pMiner->Location() != shack)
{
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": " << "Walkin' home";
pMiner->ChangeLocation(shack);
//let the wife know I'm home
Dispatch->DispatchMessage(SEND_MSG_IMMEDIATELY, //time delay
pMiner->ID(), //ID of sender
ent_Elsa, //ID of recipient
Msg_HiHoneyImHome, //the message
NO_ADDITIONAL_INFO);
}
}
void GoHomeAndSleepTilRested::Execute(Miner* pMiner)
{
//if miner is not fatigued start to dig for nuggets again.
if (!pMiner->Fatigued())
{
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": "
<< "All mah fatigue has drained away. Time to find more gold!";
pMiner->GetFSM()->ChangeState(EnterMineAndDigForNugget::Instance());
}
else
{
//sleep
pMiner->DecreaseFatigue();
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": " << "ZZZZ... ";
}
}
void GoHomeAndSleepTilRested::Exit(Miner* pMiner)
{
}
bool GoHomeAndSleepTilRested::OnMessage(Miner* pMiner, const Telegram& msg)
{
SetTextColor(BACKGROUND_RED|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
switch(msg.Msg)
{
case Msg_StewReady:
cout << "\nMessage handled by " << GetNameOfEntity(pMiner->ID())
<< " at time: " << Clock->GetCurrentTime();
SetTextColor(FOREGROUND_RED|FOREGROUND_INTENSITY);
cout << "\n" << GetNameOfEntity(pMiner->ID())
<< ": Okay Hun, ahm a comin'!";
pMiner->GetFSM()->ChangeState(EatStew::Instance());
return true;
}//end switch
return false; //send message to global message handler
}
//------------------------------------------------------------------------QuenchThirst
QuenchThirst* QuenchThirst::Instance()
{
static QuenchThirst instance;
return &instance;
}
void QuenchThirst::Enter(Miner* pMiner)
{
if (pMiner->Location() != saloon)
{
pMiner->ChangeLocation(saloon);
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": " << "Boy, ah sure is thusty! Walking to the saloon";
}
}
void QuenchThirst::Execute(Miner* pMiner)
{
pMiner->BuyAndDrinkAWhiskey();
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": " << "That's mighty fine sippin' liquer";
Dispatch->DispatchMessage(SEND_MSG_IMMEDIATELY, //time delay
pMiner->ID(), //ID of sender
ent_Barfly, //ID of recipient
Msg_Whatchalookingat, //the message
NO_ADDITIONAL_INFO);
}
void QuenchThirst::Exit(Miner* pMiner)
{
SetTextColor(FOREGROUND_RED | FOREGROUND_INTENSITY);
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": " << "Leaving the saloon, feelin' good";
}
bool QuenchThirst::OnMessage(Miner* pMiner, const Telegram& msg)
{
SetTextColor(BACKGROUND_RED | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
switch (msg.Msg)
{
case Msg_ThrowFist:
{
cout << "\nMessage handled by " << GetNameOfEntity(pMiner->ID()) << " at time: "
<< Clock->GetCurrentTime();
SetTextColor(FOREGROUND_RED | FOREGROUND_INTENSITY);
cout << "\n" << GetNameOfEntity(pMiner->ID()) <<
": *Dodges the fist !* Haha.. Learn to fight!";
Dispatch->DispatchMessage(SEND_MSG_IMMEDIATELY, //time delay
pMiner->ID(), //ID of sender
ent_Barfly, //ID of recipient
Msg_DodgeFist, //the message
NO_ADDITIONAL_INFO);
pMiner->GetFSM()->ChangeState(EnterMineAndDigForNugget::Instance());
}
return true;
}
return false;
}
//------------------------------------------------------------------------EatStew
EatStew* EatStew::Instance()
{
static EatStew instance;
return &instance;
}
void EatStew::Enter(Miner* pMiner)
{
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": " << "Smells Reaaal goood Elsa!";
}
void EatStew::Execute(Miner* pMiner)
{
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": " << "Tastes real good too!";
pMiner->GetFSM()->RevertToPreviousState();
}
void EatStew::Exit(Miner* pMiner)
{
cout << "\n" << GetNameOfEntity(pMiner->ID()) << ": " << "Thankya li'lle lady. Ah better get back to whatever ah wuz doin'";
}
bool EatStew::OnMessage(Miner* pMiner, const Telegram& msg)
{
//send msg to global message handler
return false;
}
| [
"6350204+arda-a@users.noreply.github.com"
] | 6350204+arda-a@users.noreply.github.com |
e2ec13ae09123ac04b728a050a997d43836fdbc8 | e5e6bdbf405a918ca604f68e70dcc7f1cc6970ce | /src/Wallet/Keychain/KeyGenerator.h | 03efb85054bd6623630106d55e2944ae01e967d8 | [
"MIT"
] | permissive | GrinPlusPlus/GrinPlusPlus | a86d39fdf31bcd26d13e7dec646a0ecc0b125336 | fa3705f5558f0372410aa4222f5f1d97a0ab2247 | refs/heads/master | 2023-06-21T21:28:08.086560 | 2023-03-01T16:20:42 | 2023-03-01T16:20:42 | 162,051,905 | 153 | 50 | MIT | 2023-05-19T16:56:56 | 2018-12-16T23:53:01 | C++ | UTF-8 | C++ | false | false | 1,133 | h | #pragma once
#include <Wallet/PrivateExtKey.h>
#include <Common/Secure.h>
#include <Core/Config.h>
//
// For specifications on generating the master key for HD wallets, see https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Master_key_generation.
//
class KeyGenerator
{
public:
KeyGenerator(const Config& config) : m_config(config) { }
//
// Generates a master private key for an HD wallet from a 32 byte seed.
//
// \param[in] seed - The 32 byte seed.
//
// \return The generated master CExtendedPrivateKey.
//
PrivateExtKey GenerateMasterKey(const SecureVector& seed) const;
//
// Generates an extended child private key from a parent extended key (for an HD wallet).
// Referred to as CKDpriv in BIP0032.
//
// \param[in] parentExtendedKey - The HD wallet's parent private key plus chain code.
// \param[in] childKeyIndex - if >= 2^31, generate a 'hardened' child key (See BIP0032).
//
// \return The generated child CExtendedPrivateKey.
//
PrivateExtKey GenerateChildPrivateKey(const PrivateExtKey& parentExtendedKey, const uint32_t childKeyIndex) const;
private:
const Config& m_config;
}; | [
"davidburkett38@gmail.com"
] | davidburkett38@gmail.com |
a2e06a966951d8821d5391326c93921f9b284425 | 934e7e5fa81eb1a36f1562cdf6b35eff977bc814 | /Game/pocket.h | 0e2ca7421747741e60f3f838d0af611ed50381b5 | [] | no_license | Kurran/Snooker | 74216d75cef27993c7a652068ac6371461bad8fb | deca275a92333171ce11dcc237b93e7fbe7ff003 | refs/heads/master | 2020-03-24T16:08:25.891564 | 2018-07-30T02:23:13 | 2018-07-30T02:23:13 | 142,814,039 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 435 | h | #pragma once
#pragma comment(lib, "nclgl.lib")
#include "../nclgl/Vector3.h"
#include <iostream>
#include <cmath>
#include "Ball.h"
class Ball;
class Pocket
{
public:
Pocket();
Pocket(const Vector3 &pos, const float& rad);
~Pocket();
inline Vector3 getPosition() const { return position;}
inline float getRadius() const { return radius; }
bool isColliding(const Ball& b);
private:
Vector3 position;
float radius;
};
| [
"kurran.bharaj@gmail.com"
] | kurran.bharaj@gmail.com |
ff23e1761a59452523b2dfb322d0f3ba213d6ff3 | c8724f08b9630a5051d1bce673127da5bd93d861 | /microsoft/5(b).cpp | 96e6a915223a0459c9b76c3410952e3db9dbf5e7 | [] | no_license | codelibra/comp-programming | 89b2b2b656d317b52d2c2427ad11aa21d509c0e9 | fce68180a8f1e68a2a6503bf450a524b41de02d5 | refs/heads/master | 2021-01-21T17:39:17.618853 | 2017-06-04T16:06:53 | 2017-06-04T16:06:53 | 91,977,761 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 295 | cpp | //http://www.geeksforgeeks.org/find-the-missing-number/
//shivi..coding is adictive!!
#include<shiviheaders.h>
using namespace std;
int main()
{
vector<int> vi;
int N,x,sum,k=0;
cin>>N;
for(int i=0;i<N;++i)
{
cin>>x;
k+=x;
}
++N;
sum=(N*(N+1))/2;
cout<<sum-k;
}
| [
"trivedi.akshay3@gmail.com"
] | trivedi.akshay3@gmail.com |
60ce8c1d9647e977d5fbcd49b22ad433004a4ff9 | 656f74c4adb464c51d08cf4d36d5c60b8a432343 | /src/Table.cpp | 71f0b9f594693a79e590c30ad7198d4018cfa6e9 | [] | no_license | omer91se/SPL | e12d2fc3cd0f9f0406c3eed99eb7583879b5b5ec | cb1edb5b8847260dd86b94031a993fb891937ecb | refs/heads/master | 2020-04-04T10:31:51.329799 | 2018-11-18T20:01:56 | 2018-11-18T20:01:56 | 155,858,181 | 0 | 0 | null | 2018-11-02T15:56:26 | 2018-11-02T11:41:39 | C++ | UTF-8 | C++ | false | false | 5,382 | cpp | /**
*@Authors: Anat Bar-Sinai, Omer Segal.
*@version: Last Update: 8.11.2018
*/
#include <iostream>
#include "../include/Table.h"
using namespace std;
template <typename T>
typename vector<T*>::iterator find_it_in_vector (int id, vector<T*> list);
Table::Table(int t_capacity):capacity(t_capacity), open(false), customersList(vector<Customer*>(t_capacity)) {}
int Table::getCapacity() const{
return this->capacity;
}
Table::Table(const Table &other): orderList(vector<OrderPair>(other.capacity)), customersList(vector<Customer*>(other.customersList.size())){
copy(other);
}
Table::Table(Table &&other) {
steal(other);
}
Table &Table::operator=(const Table &other) {
if(this != &other){
clean();
copy(other);
}
return *this;
}
Table &Table::operator=(Table &&other) {
if(this != &other){
clean();
steal(other);
}
return *this;
}
Table::~Table() {
clean();
cout<< "Table Dest"<<endl;
}
//TODO check if input checks are needed.
//TODO for all the functions.
/**
* Adds a customer to customers vector.
*
* @param a pointer to a Customer
*/
void Table::addCustomer(Customer *customer) {
if(customer !=nullptr)
this->customersList.push_back(customer);
}
/**
* Removes a Customer.
*
* @param id of the Customer to remove.
*/
void Table::removeCustomer(int id) {
vector<Customer*>::iterator customer_it = find_it_in_vector(id, this->customersList);
this->customersList.erase(customer_it);
removeOrders(id);
//TODO check if customer's destructor is called.
}
/**
* Finds a Customer.
*
* @param: id of the Customer.
* @return: A pointer to the Customer.
*/
Customer* Table::getCustomer(int id) {
vector<Customer*>::iterator customer_it = find_it_in_vector(id, this->customersList);
return *(customer_it);
}
/**
* customersList Getter.
*
* @return: vector of Customer*.
*/
std::vector<Customer *> &Table::getCustomers() {
return this->customersList;
}
/**
* orderList Getter.
*
* @return: A vector of OrderPair.
*/
std::vector<OrderPair> &Table::getOrders() {
return orderList;
}
/**
* Iterates over the customersList and takes orders.
*
* @param menu to order from (sends it to the Customer's action order()).
*/
void Table::order(const std::vector<Dish> &menu) {
//Iterates over each customer and takes orders.
for (vector<Customer *>::iterator customer_it = this->customersList.begin(); customer_it != this->customersList.end(); ++customer_it){
vector<int> order = (*customer_it)->order(menu);
//Iterates over each customer's order and insert it to the order list.
for (vector<int>::iterator order_it = order.begin(); order_it != order.end(); ++order_it)
for (int i = 0 ; i < menu.size() ; i++)
if (menu[i].getId() == *order_it) {
Dish dish = menu[i];
OrderPair pair((*customer_it)->getId(), dish);
this->orderList.push_back(pair);
break;
}
}
}
/**
* Sets open to true.
*/
void Table::openTable() {
this->open = true;
}
/**
* Sets open to false.
*/
void Table::closeTable() {
for (vector<Customer *>::iterator cust = customersList.begin(); cust != customersList.end(); ++cust){
delete((*cust));
}
customersList = vector<Customer*>(getCapacity());
orderList = vector<OrderPair>();
this->open = false;
}
/**
* Sums up the bills of each customer to one bill.
*
* @return the total price (bill).
*/
int Table::getBill() {
int bill = 0;
for (vector<OrderPair>::iterator pair_it = this->orderList.begin(); pair_it != this->orderList.end(); ++pair_it)
bill = bill + (*pair_it).second.getPrice();
return bill;
}
/**
*
* @return true if the table is open. false otherwise.
*/
bool Table::isOpen() {
return open;
}
/**
*
* @param id
* @param customers_list
* @return
*/
vector<Customer*>::iterator find_customer (int id, vector<Customer*> customers_list) {
for (vector<Customer *>::iterator it = customers_list.begin(); it != customers_list.end(); ++it) {
if ((*it)->getId() == id)
return it;
}
}
void Table::clean() {
for (vector<Customer *>::iterator cust_it = this->getCustomers().begin(); cust_it != this->getCustomers().end(); ++cust_it){
Customer* cust= *cust_it;
customersList.erase(cust_it);
delete(cust);
}
}
void Table::copy(const Table &other) {
for (vector<Customer*>::const_iterator cust_it = other.customersList.begin(); cust_it!= other.customersList.end(); ++cust_it) {
this->customersList.push_back((*cust_it)->clone());
}
for (vector<OrderPair>::const_iterator pair = other.orderList.begin(); pair != other.orderList.end(); ++pair) {
this->orderList.push_back(*pair);
}
this->capacity = other.capacity;
this->open = other.open;
}
void Table::steal(Table &other) {
this->open = other.open;
this->capacity = other.capacity;
this->customersList = other.customersList;
this->orderList = other.orderList;
}
void Table::removeOrders(int id) {
std::vector<OrderPair> temp;
for (auto &i : orderList)
if(i.first != id)
temp.push_back(i);
orderList.clear();
for (const auto &i : temp)
orderList.push_back(i);
}
| [
"omer91se@gmail.com"
] | omer91se@gmail.com |
f58f0b7e601f42139cd4065a48f78c4d4ddcb580 | 66e9d4ade105ca25ccaeece17b63831aaf133e7d | /chromecast/common/cast_url_loader_throttle.cc | 75411205ce7c47314c7faada271115c42adc171d | [
"BSD-3-Clause"
] | permissive | rookiechao/chromium | 17eed8364b9f369d35ca62ff380a7c5d55c5f810 | 2cd605c5bfcb7672fd6f4cae7400ec62308f3c2f | refs/heads/master | 2023-03-07T20:13:33.287402 | 2019-04-04T09:48:01 | 2019-04-04T09:48:01 | 178,987,904 | 1 | 0 | NOASSERTION | 2019-04-02T03:00:16 | 2019-04-02T03:00:16 | null | UTF-8 | C++ | false | false | 683 | cc | // Copyright 2019 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 "chromecast/common/cast_url_loader_throttle.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/resource_response.h"
namespace chromecast {
CastURLLoaderThrottle::CastURLLoaderThrottle() = default;
CastURLLoaderThrottle::~CastURLLoaderThrottle() = default;
void CastURLLoaderThrottle::DetachFromCurrentSequence() {}
void CastURLLoaderThrottle::WillStartRequest(
network::ResourceRequest* /* request */,
bool* defer) {}
} // namespace chromecast
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
be468c6779968a6c6d6a54f2c32612897af9e452 | b989975508e3f1f8c3ba5be9bbd9766cfa1befe7 | /Project 5/Project5Helper.h | 7d20338240e8ec7ce9a753bcc72458503c6a19c1 | [] | no_license | jpicchi18/com-sci-1-cwk | b69fece461c6192996ce88992489bf4924125f0c | 55622756ddec379e66c8acf3ed5799e63b19d305 | refs/heads/main | 2023-02-08T15:41:48.817692 | 2021-01-03T06:37:57 | 2021-01-03T06:37:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 568 | h | //
// Project5Helper.hpp
// Project 5: Box Office
//
// Created by Joseph Picchi on 2/22/19.
// Copyright © 2019 Joseph Picchi. All rights reserved.
//
#ifndef PROJECT5HELPER_H
#define PROJECT5HELPER_H
#include <string>
class Project5Helper
{
public:
Project5Helper();
bool startsWithOrchestra(const std::string & mainStr );
bool startsWith(const std::string & mainStr, const std::string & toMatch);
bool endsWithPM(const std::string & mainStr );
bool endsWith(const std::string & mainStr, const std::string & toMatch);
};
#endif
| [
"noreply@github.com"
] | noreply@github.com |
367f6fe45167664bb2a3f8b5552584dfe0a1e796 | 914c628a11d410b36adc3e4104057c822f38177b | /hello_world.cpp | dbf7885e2c26ea817c27a24a98633391b090edec | [] | no_license | fandm-cps/intro-to-c-rsilva97 | 14a39ebaec5c8ce7c97fceed62cdefb681a41a26 | 5c3c7b2001bd85a469c7af33f6edc7ce162b2eaf | refs/heads/master | 2020-07-17T01:46:59.112160 | 2019-09-02T20:03:56 | 2019-09-02T20:03:56 | 205,915,415 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 547 | cpp | #include <stdio.h> //These are C libraries
//#include <cstdio> //Can use this also
#include <stdlib.h>
#include <iostream>
int main(int argc, char* argv[])
{
if(argc < 2)
{
std::cout << "Error: " << "./hello_world.exe n" << std::endl;
return 1;
}
int n = atoi(argv[1]);
std::cout << "C++- Style" << std::endl;
for(int i = 0; i < n; i++)
{
std::cout << "Hello World" << std::endl;
}
printf("C Style \n");
for(int i = 0; i < n; i++)
{
printf("C - Hello World \n");
}
return 0;
}
| [
"jbooth1@fandm.edu"
] | jbooth1@fandm.edu |
de391a6fbb801f5ea254e63577bc78b62976d57f | dd1b4089f638d801698e34b830b2767149b665f6 | /R3BRoot_Source/r3bdata/veto_segData/R3BPaddleCrystalHt_seg.cxx | cb6ad91a3ab9891aac908dfe9637b01969d078cc | [] | no_license | ChristiaanAlwin/NeuLAND_Veto | d1c1b41cfb1f4ade2de664188da615b2541d3e7b | ed06682b03b1bd6b2c7ecc2f3be7c62036ef45ee | refs/heads/master | 2021-01-05T19:02:08.598882 | 2020-02-17T13:55:17 | 2020-02-17T13:55:17 | 241,109,623 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,387 | cxx | // -------------------------------------------------------------------------
// ----- R3BPaddleCrystalHt_seg source file -----
// -------------------------------------------------------------------------
#include "R3BPaddleCrystalHt_seg.h"
#include <iostream>
using std::cout;
using std::endl;
using std::flush;
// ----- Default constructor -------------------------------------------
R3BPaddleCrystalHt_seg::R3BPaddleCrystalHt_seg()
: FairHit(),
type(0), copy(0),
fEnergy(0.), nbOfSteps(0),
fTimeFirstStep(0.), fTimeLastStep(0.),
nbOfPrimaries(0), fEnergyPrimary(0.),
fThetaPrimary(0.), fPhiPrimary(0.),
eventID(0), runID(0)
{
}
R3BPaddleCrystalHt_seg::R3BPaddleCrystalHt_seg(const R3BPaddleCrystalHt_seg& right)
: FairHit(right),
type(right.type), copy(right.copy),
fEnergy(right.fEnergy), nbOfSteps(right.nbOfSteps),
fTimeFirstStep(right.fTimeFirstStep), fTimeLastStep(right.fTimeLastStep),
nbOfPrimaries(right.nbOfPrimaries), fEnergyPrimary(right.fEnergyPrimary),
fThetaPrimary(right.fThetaPrimary), fPhiPrimary(right.fPhiPrimary),
eventID(right.eventID), runID(right.runID)
{
}
// ----- Destructor ----------------------------------------------------
R3BPaddleCrystalHt_seg::~R3BPaddleCrystalHt_seg()
{
}
// -------------------------------------------------------------------------
// ----- Public method Print -------------------------------------------
void R3BPaddleCrystalHt_seg::Print(const Option_t* opt) const
{
cout <<"==============================================" << endl;
cout << "-I- R3BPaddleCrystalHt_seg: Hit in detector: "
<< fDetectorID << endl;
cout << " Position (" << fX << ", " << fY << ", " << fZ
<< ") cm" << endl;
cout << " type: " << type
<< ", copy: " << copy
<< endl;
cout << " energy: " << fEnergy * 1000. << " MeV"
<< ", nbOfSteps: " << nbOfSteps
<< endl;
cout << " nbOfPrimaries: " << nbOfPrimaries
<< ", energyPrimary: " << fEnergyPrimary * 1000. << " MeV"
<< ", thetaPrimary: " << fThetaPrimary << " deg"
<< ", phiPrimary: " << fPhiPrimary << " deg" << endl;
cout << "----------------------------------------------" << endl;
}
// -------------------------------------------------------------------------
ClassImp(R3BPaddleCrystalHt_seg)
| [
"Christiaan90518@gmail.com"
] | Christiaan90518@gmail.com |
a45c5f56f2b4f7c7e8282b87c7783fdf77622a11 | ddca95269478743a9697c1c3224b8a983c5eb3b9 | /内部排序/计数排序.cpp | b51801d22d834957c24849d8f2d7fe116497c74d | [] | no_license | hijkzzz/leetcode | d265bd4b6548b84cc91ca65d2e50f500eea33100 | 135003500fa25f47a45ded87f360ab40ed9cc35f | refs/heads/master | 2021-10-23T20:55:21.334513 | 2018-08-25T08:58:48 | 2018-08-25T08:58:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 855 | cpp | #include <iostream>
#include <algorithm>
using namespace std;
// 不支持负数
void count_sort(int a[], int n, int MAX) {
// 计数
int *count = new int[MAX + 1];
for (int i = 0; i <= MAX; ++i)
count[i] = 0;
for (int i = 0; i < n; ++i)
++count[a[i]];
// 累计小于等于i的数量
for (int i = 1; i <= MAX; ++i)
count[i] += count[i - 1];
int *sort = new int[n];
for (int i = 0; i < n; ++i) {
// 可能有重复的数字,所以要——
--count[a[i]];
sort[count[a[i]]] = a[i];
}
for (int i = 0; i < n; ++i)
a[i] = sort[i];
delete[] count;
delete[] sort;
}
int main() {
int a[] = {5, 1, 11, 0, 1, 90, 50};
count_sort(a, sizeof(a) / sizeof(int) - 1, 90);
for (auto x : a)
cout << x << " ";
return 0;
} | [
"hujia_n@foxmail.com"
] | hujia_n@foxmail.com |
5ebe8c9b4a187768d2471621d1cea0786adcb32f | 6abff8a28f227da140bfc46651c769f570f4ee80 | /DrawingPad/main.cpp | 49d04bbd21dc92e4e865ba00590fa219bc4aba1d | [] | no_license | yash101/DrawingPad | 64de5f3b4022b60b7bdc14e9dda336b3433697d5 | e9bafefd9e85c800479c985d2e80bfb3de688be7 | refs/heads/master | 2016-09-06T11:00:46.165388 | 2015-05-15T04:50:27 | 2015-05-15T04:50:27 | 25,750,792 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,417 | cpp | #include <iostream>
#include <thread>
#include <string>
#include "include/server.hxx"
#include "include/Terminal.hxx"
#include "include/definitions.hxx"
#include <sys/types.h>
#include <unistd.h>
#ifndef __WIN32
#include <dirent.h>
#include <sys/stat.h>
#else
#include <windows.h>
#endif
using namespace std;
//Before we boot...
void preboot()
{
if(DEBUG)
{
std::cout << "Creating the data directory!" << std::endl;
}
#ifdef __WIN32
CreateDirectory("dat", NULL);
#else
mkdir("dat", 0755);
#endif
}
#ifdef SIGHANDLE
void sighandle(int sig)
{
std::ofstream tout("dat/log.d", std::ios::app);
if(tout.is_open())
{
if(!DEBUG)
{
tout << "Recieved signal: " << sig << std::endl;
}
if(sig == 1)
{
if(!DEBUG)
{
tout << "SIGHUP sent. The user probably hung up. Let's continue running!" << std::endl;
}
return;
}
else if(sig == 2)
{
if(!DEBUG)
{
tout << "SIGINT sent. We'll clean up our trash and exit! :)" << std::endl;
}
}
else if(sig == SIGILL)
{
if(!DEBUG)
{
tout << "SIGILL issued. There's something going wrong!" << std::endl;
}
}
else if(sig == SIGABRT)
{
if(!DEBUG)
{
tout << "SIGABRT issued. Something's going wrong! We're going to shut down!" << std::endl;
}
}
else if(sig == SIGFPE)
{
if(!DEBUG)
{
tout << "SIGFPE issued. Perhaps there is some sort of bug in the code that allows this program to divide by zero! Maybe I just ran out of bits!" << std::endl;
}
}
else if(sig == SIGSEGV)
{
if(!DEBUG)
{
tout << "SIGSEGV issued. SEGMENTATION FAULT!" << std::endl;
}
}
else if(sig == SIGCHLD)
{
if(!DEBUG)
{
tout << "Recieved SIGCHLD. I think we are being asked to terminate. Let's do it the proper way ;)" << std::endl;
}
}
tout.close();
}
if(DEBUG)
{
std::cout << "Quitting!" << std::endl;
}
std::ofstream fout("dat/pid.dat");
if(fout.is_open())
{
fout << "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
fout.close();
}
if(sig == SIGSEGV)
{
abort();
}
exit(EXIT_SUCCESS);
}
#endif
void boot()
{
//Set some signal handlers
#ifdef SIGHANDLE
signal(SIGINT, sighandle);
signal(SIGILL, sighandle);
signal(SIGABRT, sighandle);
signal(SIGFPE, sighandle);
signal(SIGSEGV, sighandle);
signal(SIGCHLD, sighandle);
#endif
//Kill old children of same PID. Otherwise, we won't be able to open ports!
#ifdef AUTOKILL
std::ifstream fin("dat/pid.dat");
if(fin.is_open() && fin.good())
{
std::stringstream str;
str << fin.rdbuf();
if(str.str().size() < 8 && str.str().size() > 0)
{
if(DEBUG)
{
std::cout << "Killing Process with PID, " << str.str() << std::endl;
}
kill(atoi(str.str().c_str()), SIGINT);
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
else
{
if(DEBUG)
{
std::cout << "Not going to kill! No old processes are running!" << std::endl;
}
}
fin.close();
}
if(!fin.good())
{
if(DEBUG)
{
std::cout << "PIDFILE does not exist!" << std::endl;
}
}
#endif
//Save the PID of the child
std::ofstream fout("dat/pid.dat");
if(fout.is_open())
{
fout << getpid();
fout.close();
}
if(DEBUG)
{
std::cout << "Launching the server!" << std::endl;
}
// try
// {
//Start the server
paint_server serv;
serv.set_listening_port(PORTNO_PAINTSERVER);
serv.start_async();
// }
// catch(exception& e)
// {
// if(DEBUG)
// {
// std::cout << "Unable to start the server on port " << PORTNO_PAINTSERVER << std::endl;
// std::cout << "Perhaps there is another server using port " << PORTNO_PAINTSERVER << std::endl;
// std::cout << "Otherwise, it's also possible that either you disabled AUTOKILL, or AUTOKILL failed to run!" << std::endl;
// std::cout << "Exception data: [" << e.what() << "]" << std::endl;
// std::cout << "Quitting because of internal server failure!!!" << std::endl;
// raise(SIGILL);
// }
// std::ofstream lout("dat/log.d");
// if(lout.is_open())
// {
// fout << "Quitting! [" << e.what() << "]" << std::endl;
// lout.close();
// }
// }
if(DEBUG)
{
std::cout << "PaintServer Started...!" << std::endl;
}
//Start the terminal if we will not fork. Otherwise, std::cin is not the best thing to play around with!
#ifndef FORK
std::cout << "Launching Terminal!" << std::endl;
if(TERMINAL)
{
std::thread terminal_thread(&terminal);
terminal_thread.detach();
}
#endif
while(true) std::this_thread::sleep_for(std::chrono::seconds(100));
}
int main()
{
preboot();
//Just clear the screen if we are on a Mac. This is my dev PC, and whenever I do a terminal build,
//there's a ton of crap on the screen!
#ifdef __MACH__
std::system("clear");
#endif
#ifdef FORK
pid_t p = fork();
std::this_thread::sleep_for(std::chrono::milliseconds(10));
if(DEBUG)
{
std::cout << "PID: " << p << std::endl;
}
if(p < 0)
{
if(DEBUG)
{
std::cout << "Failed to fork! Will run normally!" << std::endl;
}
}
else
{
if(p == 0)
{
if(DEBUG)
{
std::cout << "Child has been spawned!" << std::endl;
}
}
else
{
std::this_thread::sleep_for(std::chrono::microseconds(10));
if(DEBUG)
{
std::cout << "Parent will now exit!" << std::endl;
}
return 0;
}
}
#endif
boot();
}
| [
"student@Teachers-MacBook-Air-134.local"
] | student@Teachers-MacBook-Air-134.local |
c70b7691b0c21d460f8bd4f5eac320cfa6521e1c | 64d2870106ffac6a87ced0aaa87522b638be0214 | /abhi/bubble_sort.cpp | 6f25676ea467460635ca9b291b33a4f1d4b7c80f | [] | no_license | Prime-5/Daily_codes | 97b3f4c9e45b76af6cb94076c6d42b16b2922ca1 | c596724b84404fae9ced9a23c48b33cf650ef198 | refs/heads/master | 2021-01-24T01:22:05.607846 | 2018-09-03T10:08:56 | 2018-09-03T10:08:56 | 122,804,788 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 605 | cpp | /*
24 February 2018
Bubble Sort
Running time : O(n^2)
Running space : In space
*/
#include<iostream>
using namespace std;
void selectionsort(int n,int *a)
{
int i,j,temp;
for(i=0;i<n-1;i++)
{ for(j=0;j<n-i-1;j++)
{ if(a[j]>a[j+1])
{ temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
}
int main()
{
int n,i;
cout<<"Enter size of array"<<endl;
cin>>n;
int a[n];
for(i=0;i<n;i++)
{ cin>>a[i];
}
cout<<"\nOriginal array"<<endl;
for(i=0;i<n;i++)
{
cout<<a[i]<<" ";
}
selectionsort(n,a);
cout<<"\nSorted Array"<<endl;
for(i=0;i<n;i++)
{
cout<<a[i]<<" ";
}
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
1a520bd4d6025acc4e29e3b99c0709864845b0f1 | 9663175f4f1daf10c98ede916a4a699a4746ba55 | /FactoryPattern/KShit.h | 9ce5aa72a779354028c4c22bf6da183b6a13b2c3 | [] | no_license | keai4le/DesignPattern | 1d72e2a0d3a35eb4acb89a6c9c2dc206a78e72f7 | 89f7975335b830e81d964b6c4fad84b156184dae | refs/heads/master | 2020-12-30T11:14:40.476366 | 2015-09-09T09:04:43 | 2015-09-09T09:04:43 | 41,634,990 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 93 | h | #pragma once
#include "Shit.h"
class KShit :
public Shit
{
public:
KShit();
~KShit();
};
| [
"771275517@qq.com"
] | 771275517@qq.com |
87db5a3d296dcbb1e3959249749da178737b3c0c | c5db5e5afdf4156baf1f6fcc2aafa2b00dd277bd | /FreeOrion/client/human/OgrePlugins/OgreGLHardwarePixelBuffer.h | 1f4f2806e7ec5ff5f1559e21840a95408b5dd1e2 | [] | no_license | dbuksbaum/FreeOrion | 9b3158ca6e977c39c3384fcb407f9cfd57bd4bea | a9d1dc663334a51737fbe1e7fd743576c05ff768 | refs/heads/master | 2023-08-17T10:21:38.565335 | 2011-12-23T13:21:40 | 2011-12-23T13:21:40 | 3,041,422 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,321 | h | /*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2006 Torus Knot Software Ltd
Also see acknowledgements in Readme.html
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
http://www.gnu.org/copyleft/lesser.txt.
You may alternatively use this source under the terms of a specific version of
the OGRE Unrestricted License provided you have obtained such a license from
Torus Knot Software Ltd.
-----------------------------------------------------------------------------
*/
#ifndef __GLPIXELBUFFER_H__
#define __GLPIXELBUFFER_H__
#include "OgreGLPrerequisites.h"
#include "OgreHardwarePixelBuffer.h"
namespace Ogre {
class _OgrePrivate GLHardwarePixelBuffer: public HardwarePixelBuffer
{
protected:
/// Lock a box
PixelBox lockImpl(const Image::Box lockBox, LockOptions options);
/// Unlock a box
void unlockImpl(void);
// Internal buffer; either on-card or in system memory, freed/allocated on demand
// depending on buffer usage
PixelBox mBuffer;
GLenum mGLInternalFormat; // GL internal format
LockOptions mCurrentLockOptions;
// Buffer allocation/freeage
void allocateBuffer();
void freeBuffer();
// Upload a box of pixels to this buffer on the card
virtual void upload(const PixelBox &data, const Image::Box &dest);
// Download a box of pixels from the card
virtual void download(const PixelBox &data);
public:
/// Should be called by HardwareBufferManager
GLHardwarePixelBuffer(size_t mWidth, size_t mHeight, size_t mDepth,
PixelFormat mFormat,
HardwareBuffer::Usage usage);
/// @copydoc HardwarePixelBuffer::blitFromMemory
void blitFromMemory(const PixelBox &src, const Image::Box &dstBox);
/// @copydoc HardwarePixelBuffer::blitToMemory
void blitToMemory(const Image::Box &srcBox, const PixelBox &dst);
~GLHardwarePixelBuffer();
/** Bind surface to frame buffer. Needs FBO extension.
*/
virtual void bindToFramebuffer(GLenum attachment, size_t zoffset);
GLenum getGLFormat() { return mGLInternalFormat; }
};
/** Texture surface.
*/
class _OgrePrivate GLTextureBuffer: public GLHardwarePixelBuffer
{
public:
/** Texture constructor */
GLTextureBuffer(const String &baseName, GLenum target, GLuint id, GLint face,
GLint level, Usage usage, bool softwareMipmap, bool writeGamma, uint fsaa);
~GLTextureBuffer();
/// @copydoc GLHardwarePixelBuffer::bindToFramebuffer
virtual void bindToFramebuffer(GLenum attachment, size_t zoffset);
/// @copydoc ardwarePixelBuffer::getRenderTarget
RenderTexture* getRenderTarget(size_t);
// Upload a box of pixels to this buffer on the card
virtual void upload(const PixelBox &data, const Image::Box &dest);
// Download a box of pixels from the card
virtual void download(const PixelBox &data);
// Hardware implementation of blitFromMemory
virtual void blitFromMemory(const PixelBox &src_orig, const Image::Box &dstBox);
// Notify TextureBuffer of destruction of render target
void _clearSliceRTT(size_t zoffset)
{
mSliceTRT[zoffset] = 0;
}
// Copy from framebuffer
void copyFromFramebuffer(size_t zoffset);
/// @copydoc HardwarePixelBuffer::blit
void blit(const HardwarePixelBufferSharedPtr &src, const Image::Box &srcBox, const Image::Box &dstBox);
// Blitting implementation
void blitFromTexture(GLTextureBuffer *src, const Image::Box &srcBox, const Image::Box &dstBox);
protected:
// In case this is a texture level
GLenum mTarget;
GLenum mFaceTarget; // same as mTarget in case of GL_TEXTURE_xD, but cubemap face for cubemaps
GLuint mTextureID;
GLint mFace;
GLint mLevel;
bool mSoftwareMipmap; // Use GLU for mip mapping
typedef std::vector<RenderTexture*> SliceTRT;
SliceTRT mSliceTRT;
};
/** Renderbuffer surface. Needs FBO extension.
*/
class _OgrePrivate GLRenderBuffer: public GLHardwarePixelBuffer
{
public:
GLRenderBuffer(GLenum format, size_t width, size_t height, GLsizei numSamples);
~GLRenderBuffer();
/// @copydoc GLHardwarePixelBuffer::bindToFramebuffer
virtual void bindToFramebuffer(GLenum attachment, size_t zoffset);
protected:
// In case this is a render buffer
GLuint mRenderbufferID;
};
};
#endif
| [
"tzlaine@dbd5520b-6a0a-0410-a553-f54834df5b05"
] | tzlaine@dbd5520b-6a0a-0410-a553-f54834df5b05 |
020b76fdc31d5d8f7807f33b0b813a59448452f4 | 081c75d11a4a8eb139f1685f087d9cc85a4fa072 | /include/nmtools/array/view/activations/softshrink.hpp | 5bec3ca25f160829d368f2f449a733b49f7a1d4e | [] | no_license | alifahrri/nmtools | c0a9d63b4101193b484f3e05bce606d58c3b85e2 | fa8a45bc3ddb373b7f547dfea3c2c7bea3056e06 | refs/heads/master | 2023-08-28T19:36:41.814434 | 2023-08-20T08:28:40 | 2023-08-20T08:28:40 | 190,819,342 | 7 | 0 | null | 2023-08-20T08:28:41 | 2019-06-07T22:43:35 | C++ | UTF-8 | C++ | false | false | 1,321 | hpp | #ifndef NMTOOLS_ARRAY_VIEW_ACTIVATIONS_SOFTSHRINK_HPP
#define NMTOOLS_ARRAY_VIEW_ACTIVATIONS_SOFTSHRINK_HPP
#include "nmtools/array/view/ufunc.hpp"
namespace nmtools::view
{
/**
* @brief Function object for softshrink ufunc
*
* @tparam lambda_t
*/
template <typename lambda_t=float>
struct softshrink_t
{
const lambda_t lambda = 0.5;
template <typename T>
constexpr auto operator()(const T& x) const -> T
{
if (x > lambda) {
return x - lambda;
} else if (x < -lambda) {
return x + lambda;
} else {
return static_cast<T>(0);
}
} // operator()
}; // softshrink_t
/**
* @brief Create element-wise softshrink ufunc view.
*
* @tparam array_t
* @tparam lambda_t
* @param array input array
* @param lambda lambda value of softshrink formulation
* @return constexpr auto
*/
template <typename array_t, typename lambda_t=float>
constexpr auto softshrink(const array_t& array, lambda_t lambda=lambda_t{0.5})
{
return ufunc(softshrink_t<lambda_t>{{lambda}},array);
} // softshrink
} // namespace nmtools::view
#endif // NMTOOLS_ARRAY_VIEW_ACTIVATIONS_SOFTSHRINK_HPP | [
"noreply@github.com"
] | noreply@github.com |
82aab39d7c4ce0d67a0047a1c105675b89c01921 | 6f74c30d783d414d05d696ba78b1f2ed85ffe561 | /vtkheaders/vtkWriter.h | 63d10535b0d8f0b328b6827a793681c0b8cbd48e | [] | no_license | yyang2/3DROIManager | e7734b1e844ab28f7c927c1fa577654809784db7 | 088d66d6a6841e78a5fe2fd07312dddbb7ebfbf4 | refs/heads/master | 2021-01-23T16:30:25.723641 | 2011-06-28T22:46:43 | 2011-06-28T22:46:43 | 1,399,984 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,342 | h | /*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkWriter.h,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkWriter - abstract class to write data to file(s)
// .SECTION Description
// vtkWriter is an abstract class for mapper objects that write their data
// to disk (or into a communications port). All writers respond to Write()
// method. This method insures that there is input and input is up to date.
// .SECTION Caveats
// Every subclass of vtkWriter must implement a WriteData() method. Most likely
// will have to create SetInput() method as well.
// .SECTION See Also
// vtkXMLDataSetWriter vtkDataSetWriter vtkImageWriter vtkMCubesWriter
#ifndef __vtkWriter_h
#define __vtkWriter_h
#include "vtkAlgorithm.h"
class vtkDataObject;
#define VTK_ASCII 1
#define VTK_BINARY 2
class VTK_IO_EXPORT vtkWriter : public vtkAlgorithm
{
public:
vtkTypeRevisionMacro(vtkWriter,vtkAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Write data to output. Method executes subclasses WriteData() method, as
// well as StartMethod() and EndMethod() methods.
// Returns 1 on success and 0 on failure.
virtual int Write();
// Description:
// Encode the string so that the reader will not have problems.
// The resulting string is up to three times the size of the input
// string. doublePercent indicates whether to output a double '%' before
// escaped characters so the string may be used as a printf format string.
void EncodeString(char* resname, const char* name, bool doublePercent);
// Description:
// Encode the string so that the reader will not have problems.
// The resulting string is up to three times the size of the input
// string. Write the string to the output stream.
// doublePercent indicates whether to output a double '%' before
// escaped characters so the string may be used as a printf format string.
void EncodeWriteString(ostream* out, const char* name, bool doublePercent);
// Description:
// Set/get the input to this writer.
void SetInput(vtkDataObject *input);
void SetInput(int index, vtkDataObject *input);
//BTX
vtkDataObject *GetInput();
vtkDataObject *GetInput(int port);
//ETX
protected:
vtkWriter();
~vtkWriter();
virtual int ProcessRequest(vtkInformation *request,
vtkInformationVector **inputVector,
vtkInformationVector *outputVector);
virtual int RequestData(vtkInformation *request,
vtkInformationVector **inputVector,
vtkInformationVector *outputVector);
virtual void WriteData() = 0; //internal method subclasses must respond to
vtkTimeStamp WriteTime;
private:
vtkWriter(const vtkWriter&); // Not implemented.
void operator=(const vtkWriter&); // Not implemented.
};
#endif
| [
"yyang2+git@gmail.com"
] | yyang2+git@gmail.com |
cffb80c11785427f20ac96507869b28dffe07fff | cfb4393f6a3088b5beabfefbd3a586dd78328faa | /f.cpp | d8df91b9a26fcd23136b6749c5ec7e4226e5fef4 | [] | no_license | hasipon/utpc2011 | 9aa9129df02e72a44f10e50d407b578ba6b9f7b1 | e4a45fc71323486f3dc9a432881a801ed1e75a9e | refs/heads/master | 2016-09-06T18:10:49.276218 | 2011-05-21T13:23:48 | 2011-05-21T13:23:48 | 1,780,455 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 502 | cpp | #include <iostream>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
if (N/2 < K) {
cout << -1 << endl;
return 0;
}
int a[20000];
for (int j = 0; j < N/2; ++ j) {
a[2*j] = 1;
a[2*j+1] = j+2;
}
for (int j = N/2; j < N-1; ++ j) {
a[2*j] = N/2+1;
a[2*j+1] = j+2;
}
for (int i = 0; i < K; ++ i) {
if (i) cout << endl;
for (int j = 0; j < N-1; ++ j) {
cout << a[2*j] << " " << a[2*j+1] << endl;
a[2*j] = a[2*j]%N + 1;
a[2*j+1] = a[2*j+1]%N + 1;
}
}
}
| [
"takuya.hashimoto@gmail.com"
] | takuya.hashimoto@gmail.com |
ad8eea209b4896a28ee410c6cc3aa90a614b0eab | 01aa77758f69215e3fe559140c1fd91f314fb536 | /common/math/math.cpp | 405a3c157fe55f870aa0b832165d3ee1db09b35c | [] | no_license | yuchenguangfd/Longan | 30f1acc66d76a859363a9421bf719b9d9a50f4f8 | da895e2704731c055ba36df2f05297186bbdf9fa | refs/heads/master | 2020-05-30T06:09:19.404290 | 2015-06-02T11:32:18 | 2015-06-02T11:32:18 | 22,028,930 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 296 | cpp | /*
* math.cpp
* Created on: Jul 20, 2014
* Author: chenguangyu
*/
#include "math.h"
namespace longan {
namespace Math {
int Factorial(int n) {
int res = 1;
for (int i = 2; i <= n; ++i)
res *= i;
return res;
}
} // namespace Math
} //~ namespace longan
| [
"yuchenguangfd@gmail.com"
] | yuchenguangfd@gmail.com |
1b1d59113326c31af479f042d98ef2ebbbeca0aa | 4e0fad4fb8098de7693657f9c276f225f7e2bb68 | /gui/src/MainWindow.cpp | 7fb8f9973b6f0f791545ae6804d9aa73e185ea49 | [
"MIT"
] | permissive | JackZhouSz/stira | 6a9b3a0b393c5c10e67fb83719e59d9c8ee891f0 | 60b419f3e478397a8ab43ce9315a259567d94a26 | refs/heads/master | 2023-03-20T12:24:32.860327 | 2017-01-12T16:21:55 | 2017-01-12T16:21:55 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,833 | cpp |
/***********************************************************************************
* Copyright (C) 2008 by Filip Rooms *
* *
* Terms and conditions for using this software in any form are provided in the *
* file COPYING, which can be found in the root directory of this project. *
* *
* Contact data: filip.rooms@gmail.com *
* http://www.filiprooms.be/ *
* *
***********************************************************************************/
#include "MainWindow.h"
#include "../dialogs/GenerateImageDialog.h"
#include "../dialogs/GeneratePerlinNoiseDialog.h"
#include "../../stira/imagedata/datastructures/Image.h"
#include "../../stira/imagetools/imagegenerator/FractalGenerator.h"
#include <iostream>
#include <QToolBar>
#include <QToolButton>
#include <QMenuBar>
#include <QApplication>
#include <QMenu>
#include <QMessageBox>
#include <QLabel>
#include <QPushButton>
#include <QMdiSubWindow>
#include <QVBoxLayout>
#include "ImageDataList.h"
using namespace std;
using namespace stira::imagetools;
using namespace stira::imagedata;
MainWindow* MainWindow::spMainWindowInstance = 0;
//========================================================================================
MainWindow* MainWindow::GetInstance()
{
if (spMainWindowInstance == 0)
{
spMainWindowInstance = new MainWindow();
}
return spMainWindowInstance;
}
//========================================================================================
MainWindow::MainWindow() : QMainWindow( )
{
setWindowTitle( QString("STIRA GUI") );
SetupWorkspace();
SetupDataDockWidget();
QAction* pAboutAction = new QAction(tr("&About"),this);
QAction* pOpenImageAction = new QAction(tr("&Open Image"),this);
QAction* pGenerateImageAction = new QAction(tr("&Generate Image"),this);
QAction* pGenerateFractalAction = new QAction(tr("&Generate Fractal"),this);
QAction* pGeneratePerlinAction = new QAction(tr("&Generate Perlin Clouds"),this);
QAction* pTileSubWindowAction = new QAction(tr("&Tile Subwindows"),this);
QAction* pCascadeSubWindowAction = new QAction(tr("&Cascade Subwindows"),this);
QAction* pCloseAllAction = new QAction(tr("&Close All"),this);
QAction* pClearAllAction = new QAction(tr("&Clear All"),this);
// Connect
connect( pAboutAction, SIGNAL( triggered() ), this, SLOT( SlotAbout()));
connect( pOpenImageAction, SIGNAL( triggered() ), ImageDataList::GetInstance(), SLOT( SlotReadImageFromFile( )));
connect( pGenerateImageAction, SIGNAL( triggered() ), this, SLOT( SlotSelectGenerateImage()));
connect( pGenerateFractalAction, SIGNAL( triggered() ), this, SLOT( SlotSelectGenerateFractal()));
connect( pGeneratePerlinAction, SIGNAL( triggered() ), this, SLOT( SlotSelectGeneratePerlin()));
connect( pTileSubWindowAction, SIGNAL( triggered() ), mpMdiArea, SLOT( tileSubWindows() ));
connect( pCascadeSubWindowAction, SIGNAL( triggered() ), mpMdiArea, SLOT( cascadeSubWindows () ));
connect( pClearAllAction, SIGNAL( triggered() ), ImageDataList::GetInstance(), SLOT( SlotRemoveAllImages( ) ));
connect( pCloseAllAction, SIGNAL( triggered() ), ImageDataList::GetInstance(), SLOT( SlotCloseAllImages( ) ));
mpMainMenu = new QMenu(tr("&Start"));
mpMainMenu->addAction( pOpenImageAction );
mpMainMenu->addAction( pGenerateImageAction );
mpMainMenu->addAction( pGenerateFractalAction );
mpMainMenu->addAction( pGeneratePerlinAction );
mpMainMenu->addAction( pTileSubWindowAction );
mpMainMenu->addAction( pCascadeSubWindowAction );
mpMainMenu->addAction( pCloseAllAction );
mpMainMenu->addAction( pClearAllAction );
menuBar()->addMenu( mpMainMenu );
mpHelpMenu = new QMenu(tr("&Help"));
mpHelpMenu->addAction( pAboutAction );
menuBar()->addMenu( mpHelpMenu );
mpSettings = new QSettings("/t/tmp/.stira.ini", QSettings::IniFormat);
//setMinimumSize ( StiraDefinitions::maxWidth, StiraDefinitions::maxHeight );
}
//========================================================================================
MainWindow::~MainWindow()
{
}
//========================================================================================
QSettings* MainWindow::GetSettings()
{
return mpSettings;
}
void MainWindow::ResetMainMenu()
{
MainWindow::GetInstance()->menuBar()->clear();
menuBar()->addMenu(mpMainMenu);
}
//========================================================================================
void MainWindow::SetupWorkspace()
{
mpMdiArea = new QMdiArea( this );
//mpScrollArea = new QScrollArea;
//mpScrollArea->setBackgroundRole( QPalette::Dark );
//mpScrollArea->setWidget( mpMdiArea );
//setCentralWidget( mpScrollArea );
setCentralWidget( mpMdiArea );
//mpMdiArea->setScrollBarsEnabled( true );
}
//========================================================================================
void MainWindow::SetupDataDockWidget()
{
mpDataDock = new QDockWidget(tr("Data loaded"), this);
mpDataDock->setFeatures( QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable );
mpDataDock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
mpDataDock->setWidget( ImageDataList::GetInstance() );
addDockWidget(Qt::LeftDockWidgetArea, mpDataDock);
mpDataDock->show();
this->repaint();
}
//========================================================================================
void MainWindow::SlotAddSubWindow( QWidget* pWidget, QString windowname )
{
QMdiSubWindow* pSubWindow = mpMdiArea->addSubWindow( pWidget );
pSubWindow->setAttribute ( Qt::WA_DeleteOnClose, false );
pSubWindow->setWindowTitle( windowname );
pSubWindow->show();
ImageWindow* pParent = dynamic_cast<ImageWindow*>(pWidget);
if (pParent != 0)
{
pParent->SetParent( pSubWindow );
connect( pSubWindow, SIGNAL( aboutToActivate () ), pParent, SLOT( SlotSetMainMenu() ) );
pParent->SlotSetMainMenu();
}
}
//========================================================================================
void MainWindow::SlotRemoveSubWindow( QMdiSubWindow* pSubWindow )
{
mpMdiArea->removeSubWindow( pSubWindow );
}
//========================================================================================
void MainWindow::SlotSelectGenerateImage()
{
mpGenerateImageDialog = new GenerateImageDialog( );
mpGenerateImageDialog->show();
}
//========================================================================================
void MainWindow::SlotSelectGenerateFractal()
{
double centerX, centerY, width;
centerX = -0.5;
centerY = 0.0;
width = 3.0;
mpInteractiveImageWindow = new InteractiveImageWindow( centerX, centerY, width );
//pInteractiveImageWindow->SetParent( this );
QMdiSubWindow* pSubWindow = mpMdiArea->addSubWindow( mpInteractiveImageWindow );
pSubWindow->setAttribute ( Qt::WA_DeleteOnClose, true );
pSubWindow->setWindowTitle( "Mandelbrot fractal explorer" );
pSubWindow->show();
if (mpInteractiveImageWindow != 0)
{
mpInteractiveImageWindow->SetParent( pSubWindow );
//connect( pSubWindow, SIGNAL( aboutToActivate () ), mpInteractiveImageWindow, SLOT( SlotSetMainMenu() ) );
//mpInteractiveImageWindow->SlotSetMainMenu();
}
//mpInteractiveImageWindow->show();
}
//========================================================================================
void MainWindow::SlotSelectGeneratePerlin()
{
mpGeneratePerlinNoiseDialog = new GeneratePerlinNoiseDialog( );
mpGeneratePerlinNoiseDialog->show();
}
//========================================================================================
void MainWindow::SlotAbout()
{
QMessageBox msgBox;
msgBox.setText("<h3>About STIRA</h3>");
msgBox.setInformativeText( "This GUI gives a simple interface to STIRA "
" (<b>S</b>imple <b>T</b>oolkit for <b>I</b>mage <b>R</b>estoration and <b>A</b>nalysis). <br> "
" <b>More info:<b> <a href=\"http://www.filiprooms.be/stira-own-software\">website</a> <br> "
" <b>Contact:</b> filip.rooms@gmail.com <br> "
" Copyright Filip Rooms 2008-16");
msgBox.setStandardButtons(QMessageBox::Close);
msgBox.exec();
}
//========================================================================================
| [
"filip.rooms@gmail.com"
] | filip.rooms@gmail.com |
80ba663c60fafe04259160961cc3624e9b18ad25 | 8a540a8e8690dfea402954160cd2379fe3607892 | /Math/Matrix2.h | 206d4d7e3eb614f240f870c5cc6c47db4e46c473 | [
"WTFPL"
] | permissive | jakobkogler/Algorithm-DataStructures | 597bf55394c77ba1fdbf918871aa9142776e32b9 | f8086642b40cc15f20fbb08fba5ded567773e116 | refs/heads/master | 2023-01-23T03:01:24.578698 | 2023-01-15T11:08:38 | 2023-01-15T11:08:50 | 63,162,129 | 321 | 95 | WTFPL | 2022-08-23T06:35:39 | 2016-07-12T13:54:06 | C++ | UTF-8 | C++ | false | false | 1,275 | h | #include <array>
template <typename T>
class Matrix2 {
public:
using Arr4 = std::array<T, 4>;
Matrix2(Arr4 const& data) : data(data) {}
Matrix2& operator+=(Matrix2 const& other) {
for (int i = 0; i < 4; i++)
data[i] += other.data[i];
return *this;
}
Matrix2 operator+(Matrix2 const& other) {
Matrix2 cpy = *this;
return cpy += other;
}
Matrix2& operator-=(Matrix2 const& other) {
for (int i = 0; i < 4; i++)
data[i] -= other.data[i];
return *this;
}
Matrix2 operator-(Matrix2 const& other) {
Matrix2 cpy = *this;
return cpy -= other;
}
Matrix2 operator*(Matrix2 const& other) {
return Matrix2({data[0]*other.data[0] + data[1]*other.data[2],
data[0]*other.data[1] + data[1]*other.data[3],
data[2]*other.data[0] + data[3]*other.data[2],
data[2]*other.data[1] + data[3]*other.data[3]});
}
Arr4 data;
};
template <typename T>
Matrix2<T> power(Matrix2<T> base, long long e) {
auto result = Matrix2<T>({1, 0, 0, 1});
while (e) {
if (e & 1)
result = result * base;
base = base * base;
e >>= 1;
}
return result;
}
| [
"jakob.kogler@gmail.com"
] | jakob.kogler@gmail.com |
988319c5301d299f476ec99460fbcaa2aa767549 | a495da70ed1f0450059f83e6163b9c011f3e3798 | /csUtil/src-CLI/include/cs/CLI/IntegralOption.h | 4c65b0b13e1ebedb71414ab0ee20b5e98d48ea6c | [] | no_license | CaSchmidt/csUtil | 20e58545edb09d5fdab55eb097d4b4c9e254ca53 | 9b8f1d5bbfd578f1f11d2e34eb94ddde2b3f3ae8 | refs/heads/master | 2023-08-18T06:35:21.274808 | 2023-08-09T18:50:54 | 2023-08-09T18:50:54 | 151,853,593 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,460 | h | /****************************************************************************
** Copyright (c) 2022, Carsten Schmidt. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
**
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
**
** 3. Neither the name of the copyright holder nor the names of its
** contributors may be used to endorse or promote products derived from
** this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#pragma once
#include <array>
#include <charconv>
#include <functional>
#include <cs/CLI/IOption.h>
#include <cs/Core/Range.h>
namespace cs {
template<typename T>
class IntegralOption : public IOption {
private:
struct ctor_tag {
ctor_tag() noexcept
{
}
};
public:
using value_type = if_integral_t<T>;
using valid_func = std::function<bool(const value_type)>;
IntegralOption(const ctor_tag&,
const std::string& name,
const valid_func& validator,
const value_type defValue = value_type{0}) noexcept
: IOption(name)
, _defValue(defValue)
, _validator(validator)
, _value(defValue)
{
initializeDefaultValue();
}
~IntegralOption() noexcept
{
}
value_type value() const
{
return _value;
}
private:
IntegralOption() noexcept = delete;
void initializeDefaultValue()
{
try {
std::array<char,32> buffer;
buffer.fill(0);
char *first = buffer.data();
char *last = first + buffer.size();
const std::to_chars_result result = std::to_chars(first, last, _defValue, 10);
if( result.ec == std::errc{} ) {
_defValueStr = buffer.data();
}
} catch(...) {
_defValueStr.clear();
}
}
const char *impl_defaultValue() const final
{
return _defValueStr.data();
}
bool impl_parse(const char *value) final
{
const std::size_t length0 = strlen(value);
if( length0 < 1 ) {
return false;
}
int base = 10;
if( length0 > 2 && value[0] == '0' ) {
if( value[1] == 'b' || value[1] == 'B' ) {
base = 2;
value += 2;
} else if( value[1] == 'x' || value[1] == 'X' ) {
base = 16;
value += 2;
}
}
if( length0 > 1 && base == 10 && value[0] == '+' ) {
value += 1;
}
const char *first = value;
const char *last = first + strlen(first);
const std::from_chars_result result = std::from_chars(first, last, _value, base);
const bool is_ok = result.ec == std::errc{} && result.ptr == last;
return is_ok && isValid();
}
bool impl_isValid() const final
{
return _validator(_value);
}
value_type _defValue{0};
std::string _defValueStr;
valid_func _validator;
value_type _value{0};
template<typename DerivedT, typename... Args>
friend OptionPtr make_option(const std::string& name, Args&&... args);
};
using IntOption = IntegralOption<int>;
using UIntOption = IntegralOption<unsigned int>;
} // namespace cs
| [
"CaSchmidt@users.noreply.github.com"
] | CaSchmidt@users.noreply.github.com |
f8cb07fb43b83e4e59e3a24e65e9c745d35e94e0 | a26575054e41cc73f9eb2603ba0008694a038126 | /vts/vm/src/test/vm/jvmti/funcs/PopFrame/PopFrame0102/PopFrame0102.cpp | 92504d0981050c0ffc50ff7a9fd81b98f03e8e1d | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | FLORG1/drlvm-vts-bundle | e269ede0e2c41b402315100d7bb830f6c3d8a097 | 61f0d5a91d2e703d95e669298a84fc18ae9f050d | refs/heads/master | 2021-01-17T20:34:24.999958 | 2015-04-23T18:54:38 | 2015-04-23T18:54:38 | 45,146,096 | 2 | 0 | null | 2015-10-28T22:39:44 | 2015-10-28T22:39:43 | null | UTF-8 | C++ | false | false | 3,630 | cpp | /*
Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
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.
*/
/**
* @author Valentin Al. Sitnick
* @version $Revision: 1.1 $
*
*/
/* *********************************************************************** */
#include "events.h"
#include "utils.h"
#include "fake.h"
static bool test = false;
static bool util = false;
static bool flag = false;
const char test_case_name[] = "PopFrame0102";
/* *********************************************************************** */
JNIEXPORT jint JNICALL Agent_OnLoad(prms_AGENT_ONLOAD)
{
Callbacks CB;
check_AGENT_ONLOAD;
jvmtiEvent events[] = { JVMTI_EVENT_EXCEPTION, JVMTI_EVENT_VM_DEATH };
cb_exc;
cb_death;
return func_for_Agent_OnLoad(vm, options, reserved, &CB, events,
sizeof(events)/4, test_case_name, DEBUG_OUT);
}
/* *********************************************************************** */
void JNICALL callbackException(prms_EXCPT)
{
check_EXCPT;
if (flag) return;
char* name;
char* signature;
char* generic;
jint tcount;
jthread* threads;
jthread my_thread;
jvmtiError result;
jvmtiThreadInfo tinfo;
/*
* Function separate all other exceptions in all other method
*/
if (!check_phase_and_method_debug(jvmti_env, method, SPP_LIVE_ONLY,
"special_method", DEBUG_OUT))
{
if (check_phase_and_method_debug(jvmti_env, method, SPP_LIVE_ONLY,
"sub_special", DEBUG_OUT)) test = false;
return;
}
flag = true;
util = true;
result = jvmti_env->GetAllThreads(&tcount, &threads);
fprintf(stderr, "\tnative: GetAllThreads result = %d (must be zero) \n", result);
if (result != JVMTI_ERROR_NONE) return;
for ( int i = 0; i < tcount; i++ )
if (jvmti_env->GetThreadInfo(threads[i], &tinfo) == JVMTI_ERROR_NONE)
if (!strcmp(tinfo.name, "agent"))
{
fprintf(stderr, "\tnative: tested thread was found\n");
my_thread = threads[i];
break;
}
result = jvmti_env->SuspendThread(my_thread);
fprintf(stderr, "\tnative: SuspendThread result = %d (must be zero) \n", result);
if (result != JVMTI_ERROR_NONE) return;
CAPABILITY_TURN_OFF_VOID(can_pop_frame);
result = jvmti_env->PopFrame(my_thread);
fprintf(stderr, "\tnative: PopFrame result = %d (must be JVMTI_ERROR_MUST_POSSESS_CAPABILITY (99)) \n", result);
if (result == JVMTI_ERROR_MUST_POSSESS_CAPABILITY) test = true;
result = jvmti_env->ResumeThread(my_thread);
fprintf(stderr, "\tnative: ResumeThread result = %d (must be zero) \n", result);
if (result != JVMTI_ERROR_NONE) return;
}
void JNICALL callbackVMDeath(prms_VMDEATH)
{
check_VMDEATH;
func_for_callback_VMDeath(jni_env, jvmti_env, test_case_name, test, util);
}
/* *********************************************************************** */
| [
"niklas@therning.org"
] | niklas@therning.org |
4d52045f0c1bc6625c4b37e4e9506543160b8a75 | 6f17e0ea2a66f43517f8d0668feafb260d74db8b | /extlibs/eastl/type_traits.h | ef9432b36502e8136e07886ab77bfb58621cea5d | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | permissive | questor/repotools | 73aa62cf4db63af42abd5ed78f1ec41de3a4ba94 | 1e531a197889c04fff18b4a2e5c1124e410bbba9 | refs/heads/master | 2023-03-22T13:15:12.446911 | 2022-10-14T20:27:46 | 2022-10-14T20:27:46 | 147,827,369 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 45,431 | h | ///////////////////////////////////////////////////////////////////////////////
// Copyright (c) Electronic Arts Inc. All rights reserved.
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Specification
//
// This file implements C++ type traits as proposed by the emerging C++ update
// as of May, 2005. This update is known as "Proposed Draft Technical Report
// on C++ Library Extensions" and is document number n1745. It can be found
// on the Internet as n1745.pdf and as of this writing it is updated every
// couple months to reflect current thinking.
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Description
//
// EASTL includes a fairly serious type traits library that is on par with the
// one found in Boost but offers some additional performance-enhancing help as well.
// The type_traits library provides information about class types, as opposed to
// class instances. For example, the is_integral type trait tells if a type is
// one of int, short, long, char, uint64_t, etc.
//
// There are three primary uses of type traits:
// * Allowing for optimized operations on some data types.
// * Allowing for different logic pathways based on data types.
// * Allowing for compile-type assertions about data type expectations.
//
// Most of the type traits are automatically detected and implemented by the compiler.
// However, EASTL allows for the user to explicitly give the compiler hints about
// type traits that the compiler cannot know, via the EASTL_DECLARE declarations.
// If the user has a class that is relocatable (i.e. can safely use memcpy to copy values),
// the user can use the EASTL_DECLARE_TRIVIAL_RELOCATE declaration to tell the compiler
// that the class can be copied via memcpy. This will automatically significantly speed
// up some containers and algorithms that use that class.
//
// Here is an example of using type traits to tell if a value is a floating point
// value or not:
//
// template <typename T>
// DoSomething(T t) {
// assert(is_floating_point<T>::value);
// }
//
// Here is an example of declaring a class as relocatable and using it in a vector.
//
// EASTL_DECLARE_TRIVIAL_RELOCATE(Widget); // Usually you put this at the Widget class declaration.
// vector<Widget> wVector;
// wVector.erase(wVector.begin()); // This operation will be optimized via using memcpy.
//
// The following is a full list of the currently recognized type traits. Most of these
// are implemented as of this writing, but if there is one that is missing, feel free
// to contact the maintainer of this library and request that it be completed.
// As of this writing all C++11 type traits are supported, as well as some additional ones.
// http://en.cppreference.com/w/cpp/types
//
// Trait Description
// ------------------------------------------------------------------------------
// is_void T is void or a cv-qualified (const/void-qualified) void.
// is_null_pointer
// is_integral T is an integral type.
// is_floating_point T is a floating point type.
// is_array T is an array type. The templated array container is not an array type.
// is_enum T is an enumeration type.
// is_union T is a union type.
// is_class T is a class type but not a union type.
// is_function T is a function type.
// is_pointer T is a pointer type. Includes function pointers, but not pointers to (data or function) members.
// is_rvalue_reference
// is_lvalue_reference
// is_member_object_pointer T is a pointer to data member.
// is_member_function_pointer T is a pointer to member function.
//
// is_fundamental T is a fundamental type (void, integral, or floating point).
// is_arithmetic T is an arithmetic type (integral or floating point).
// is_scalar T is a scalar type (arithmetic, enum, pointer, member_pointer)
// is_object T is an object type.
// is_compound T is a compound type (anything but fundamental).
// is_reference T is a reference type. Includes references to functions.
// is_member_pointer T is a pointer to a member or member function.
//
// is_const T is const-qualified.
// is_volatile T is volatile-qualified.
// is_trivial
// is_trivially_copyable
// is_standard_layout
// is_pod T is a POD type.
// is_literal_type
// is_empty T is an empty class.
// is_polymorphic T is a polymorphic class.
// is_abstract T is an abstract class.
// is_signed T is a signed integral type.
// is_unsigned T is an unsigned integral type.
//
// is_constructible
// is_trivially_constructible
// is_nothrow_constructible
// is_default_constructible
// is_trivially_default_constructible
// is_nothrow_default_constructible
// is_copy_constructible
// is_trivially_copy_constructible
// is_nothrow_copy_constructible
// is_move_constructible
// is_trivially_move_constructible
// is_nothrow_move_constructible
// is_assignable
// is_trivially_assignable
// is_nothrow_assignable
// is_copy_assignable
// is_trivially_copy_assignable
// is_nothrow_copy_assignable
// is_move_assignable
// is_trivially_move_assignable
// is_nothrow_move_assignable
// is_destructible
// is_trivially_destructible
// is_nothrow_destructible
// has_virtual_destructor T has a virtual destructor.
//
// alignment_of An integer value representing the number of bytes of the alignment of objects of type T; an object of type T may be allocated at an address that is a multiple of its alignment.
// rank An integer value representing the rank of objects of type T. The term 'rank' here is used to describe the number of dimensions of an array type.
// extent An integer value representing the extent (dimension) of the I'th bound of objects of type T. If the type T is not an array type, has rank of less than I, or if I == 0 and T is of type 'array of unknown bound of U,' then value shall evaluate to zero; otherwise value shall evaluate to the number of elements in the I'th array bound of T. The term 'extent' here is used to describe the number of elements in an array type.
//
// is_same T and U name the same type.
// is_base_of Base is a base class of Derived or Base and Derived name the same type.
// is_convertible An imaginary lvalue of type From is implicitly convertible to type To. Special conversions involving string-literals and null-pointer constants are not considered. No function-parameter adjustments are made to type To when determining whether From is convertible to To; this implies that if type To is a function type or an array type, then the condition is false.
//
// remove_cv
// remove_const The member typedef type shall be the same as T except that any top level const-qualifier has been removed. remove_const<const volatile int>::type evaluates to volatile int, whereas remove_const<const int*> is const int*.
// remove_volatile
// add_cv
// add_const
// add_volatile
//
// remove_reference
// add_lvalue_reference
// add_rvalue_reference
//
// remove_pointer
// add_pointer
//
// make_signed
// make_unsigned
//
// remove_extent
// remove_all_extents
//
// aligned_storage
// aligned_union
// decay
// enable_if
// conditional
// common_type
// underlying_type
// result_of
//
// integral_constant
// bool_constant
// true_type
// false_type
//
// EASTL extension type traits
// identity Simply sets T as type.
// is_aligned Defined as true if the type has alignment requirements greater than default alignment, which is taken to be 8. is_aligned is not found in Boost nor C++11, though alignment_of is.
// union_cast Allows for easy-to-read casting between types that are unrelated but have binary equivalence. The classic use case is converting between float and int32_t bit representations.
// is_array_of_known_bounds
// is_array_of_unknown_bounds
// add_signed Deprecated in favor of make_signed.
// add_unsigned Deprecated in favor of make_unsigned.
// add_reference
// yes_type
// no_type
// is_swappable Found in <eastl/utility.h>
// is_nothrow_swappable "
// is_reference_wrapper Found in <eastl/functional.h>
// remove_reference_wrapper "
//
// Deprecated pre-C++11 type traits
// has_trivial_constructor The default constructor for T is trivial.
// has_trivial_copy The copy constructor for T is trivial.
// has_trivial_assign The assignment operator for T is trivial.
// has_trivial_destructor The destructor for T is trivial.
// has_nothrow_constructor The default constructor for T has an empty exception specification or can otherwise be deduced never to throw an exception.
// has_nothrow_copy The copy constructor for T has an empty exception specification or can otherwise be deduced never to throw an exception.
// has_nothrow_assign The assignment operator for T has an empty exception specification or can otherwise be deduced never to throw an exception.
// *has_trivial_relocate T can be moved to a new location via bitwise copy. Note that C++11 rvalue/move functionality supercedes this.
//
// * has_trivial_relocate is not found in Boost nor the pre-C++ standard update proposal.
// However, it is somewhat useful in pre-C++11 environments (prior to move semantics)
// for allowing the generation of optimized object moving operations. It is similar to
// the is_pod type trait, but goes further and allows non-pod classes to be categorized
// as relocatable. Such categorization is something that no compiler can do, as only
// the user can know if it is such. Thus EASTL_DECLARE_TRIVIAL_RELOCATE is provided to
// allow the user to give the compiler a hint. However, C++11 rvalue/move functionality
// supercedes this and will eventually fully displace it.
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Requirements
//
// As of this writing (5/2005), type_traits here requires a well-conforming
// C++ compiler with respect to template metaprogramming. To use this library
// you need to have at least one of the following:
// MSVC++ 7.1 (includes Win32, Win64, and WinCE platforms)
// GCC 3.2 (includes MacOSX, and Linux platforms)
// Metrowerks 8.0 (incluees MacOSX, Windows, and other platforms)
// EDG (includes any compiler with EDG as a back-end, such as the Intel compiler)
// Comeau (this is a C++ to C generator)
//
// It may be useful to list the compilers/platforms the current version of
// type_traits doesn't support:
// Borland C++ (it simply has too many bugs with respect to templates).
// GCC 2.96 We used to have a separate set of type traits for this compiler, but removed it due to lack of necessity.
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Implementation
//
// The implementation here is almost entirely based on template metaprogramming.
// This is whereby you use the compiler's template functionality to define types
// and values and make compilation decisions based on template declarations.
// Many of the algorithms here are similar to those found in books such as
// "Modern C++ Design" and C++ libraries such as Boost. The implementations here
// are simpler and more straightforward than those found in some libraries, due
// largely to our assumption that the compiler is good at doing template programming.
///////////////////////////////////////////////////////////////////////////////
#ifndef EASTL_TYPE_TRAITS_H
#define EASTL_TYPE_TRAITS_H
#include <eastl/internal/config.h>
#include <stddef.h> // Is needed for size_t usage by some traits.
#if defined(EASTL_PRAGMA_ONCE_SUPPORTED)
#pragma once // Some compilers (e.g. VC++) benefit significantly from using this. We've measured 3-4% build speed improvements in apps as a result.
#endif
namespace eastl
{
///////////////////////////////////////////////////////////////////////
// integral_constant
//
// This is the base class for various type traits, as defined by C++11.
// This is essentially a utility base class for defining properties
// as both class constants (value) and as types (type).
//
template <typename T, T v>
struct integral_constant
{
static const T value = v;
typedef T value_type;
typedef integral_constant<T, v> type;
EA_CONSTEXPR operator value_type() const EASTL_NOEXCEPT { return value; }
EA_CONSTEXPR value_type operator()() const EASTL_NOEXCEPT { return value; }
};
///////////////////////////////////////////////////////////////////////
// true_type / false_type
//
// These are commonly used types in the implementation of type_traits.
// Other integral constant types can be defined, such as those based on int.
//
typedef integral_constant<bool, true> true_type;
typedef integral_constant<bool, false> false_type;
///////////////////////////////////////////////////////////////////////
// bool_constant
//
// This is a convenience helper for the often used integral_constant<bool, value>.
//
#if defined(EA_COMPILER_NO_TEMPLATE_ALIASES)
template <bool B>
struct bool_constant : public integral_constant<bool, B> {};
#else
template <bool B>
using bool_constant = integral_constant<bool, B>;
#endif
///////////////////////////////////////////////////////////////////////
// yes_type / no_type
//
// These are used as a utility to differentiate between two things.
//
typedef char yes_type; // sizeof(yes_type) == 1
struct no_type { char padding[8]; }; // sizeof(no_type) != 1
///////////////////////////////////////////////////////////////////////
// unused
//
// Used internally to denote a special template argument that means
// it's an unused argument.
//
struct unused { };
///////////////////////////////////////////////////////////////////////
// argument_sink
//
// Used as a type which constructs from anything.
//
#if defined(EA_COMPILER_NO_VARIADIC_TEMPLATES)
struct argument_sink{ argument_sink(...){} };
#else
// For compilers that support variadic templates we provide an
// alternative argument_sink which provides a constructor overload of
// the variadic pack of arguments by reference. This avoids issues of
// object alignment not being respected in Microsoft compilers. Seen
// in VS2015 preview. In general, since arguments are consumed and
// ignored its cheaper to consume references than passing by value
// which incurs a construction cost.
struct argument_sink
{
template<typename... Args>
argument_sink(Args&&...) {}
};
#endif
///////////////////////////////////////////////////////////////////////
// type_select
//
// This is used to declare a type from one of two type options.
// The result is based on the condition type. This has certain uses
// in template metaprogramming.
//
// Example usage:
// typedef ChosenType = typename type_select<is_integral<SomeType>::value, ChoiceAType, ChoiceBType>::type;
//
template <bool bCondition, class ConditionIsTrueType, class ConditionIsFalseType>
struct type_select { typedef ConditionIsTrueType type; };
template <typename ConditionIsTrueType, class ConditionIsFalseType>
struct type_select<false, ConditionIsTrueType, ConditionIsFalseType> { typedef ConditionIsFalseType type; };
///////////////////////////////////////////////////////////////////////
// first_type_select
//
// Similar to type_select but unilaterally selects the first type.
//
template <typename T, typename = eastl::unused, typename = eastl::unused>
struct first_type_select { typedef T type; };
///////////////////////////////////////////////////////////////////////
// type_or
//
// This is a utility class for creating composite type traits.
//
template <bool b1, bool b2, bool b3 = false, bool b4 = false, bool b5 = false>
struct type_or;
template <bool b1, bool b2, bool b3, bool b4, bool b5>
struct type_or { static const bool value = true; };
template <>
struct type_or<false, false, false, false, false> { static const bool value = false; };
///////////////////////////////////////////////////////////////////////
// type_and
//
// This is a utility class for creating composite type traits.
//
template <bool b1, bool b2, bool b3 = true, bool b4 = true, bool b5 = true>
struct type_and;
template <bool b1, bool b2, bool b3, bool b4, bool b5>
struct type_and{ static const bool value = false; };
template <>
struct type_and<true, true, true, true, true>{ static const bool value = true; };
///////////////////////////////////////////////////////////////////////
// type_equal
//
// This is a utility class for creating composite type traits.
//
template <int b1, int b2>
struct type_equal{ static const bool value = (b1 == b2); };
///////////////////////////////////////////////////////////////////////
// type_not_equal
//
// This is a utility class for creating composite type traits.
//
template <int b1, int b2>
struct type_not_equal{ static const bool value = (b1 != b2); };
///////////////////////////////////////////////////////////////////////
// type_not
//
// This is a utility class for creating composite type traits.
//
template <bool b>
struct type_not{ static const bool value = true; };
template <>
struct type_not<true>{ static const bool value = false; };
///////////////////////////////////////////////////////////////////////
// enable_if, disable_if
//
// template <bool B, typename T = void> struct enable_if;
// template <bool B, typename T = void> struct disable_if;
template<bool B, typename T = void>
struct enable_if {};
template <typename T>
struct enable_if<true, T> { typedef T type; };
template<bool B, typename T = void>
struct disable_if {};
template <typename T>
struct disable_if<false, T> { typedef T type; };
///////////////////////////////////////////////////////////////////////
// conditional
//
// Provides member typedef type which is defined as T if B is true at
// compile time, or as F if B is false.
//
template<bool B, typename T, typename F>
struct conditional { typedef T type; };
template <typename T, typename F>
struct conditional<false, T, F> { typedef F type; };
#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <bool B, class T, class F>
using conditional_t = typename conditional<B, T, F>::type;
#endif
///////////////////////////////////////////////////////////////////////
// conjunction
//
// This is a C++17 standard utility class that performs a short-circuiting
// logical AND on a sequence of type traits.
//
// http://en.cppreference.com/w/cpp/types/conjunction
//
#if !defined(EA_COMPILER_NO_VARIADIC_TEMPLATES)
template <class...>
struct conjunction : eastl::true_type {};
template <class B>
struct conjunction<B> : B {};
template <class B, class... Bn>
struct conjunction<B, Bn...> : conditional<bool(B::value), conjunction<Bn...>, B>::type {};
#if EASTL_VARIABLE_TEMPLATES_ENABLED
#if EASTL_INLINE_VARIABLE_ENABLED
template<class... Bn>
inline constexpr bool conjunction_v = conjunction<Bn...>::value;
#else
template<class... Bn>
static const constexpr bool conjunction_v = conjunction<Bn...>::value;
#endif
#endif
#endif
///////////////////////////////////////////////////////////////////////
// disjunction
//
// This is a C++17 standard utility class that performs a short-circuiting
// logical OR on a sequence of type traits.
//
// http://en.cppreference.com/w/cpp/types/disjunction
//
#if !defined(EA_COMPILER_NO_VARIADIC_TEMPLATES)
template <class...>
struct disjunction : eastl::false_type {};
template <class B>
struct disjunction<B> : B {};
template <class B, class... Bn>
struct disjunction<B, Bn...> : conditional<bool(B::value), B, disjunction<Bn...>>::type {};
#if EASTL_VARIABLE_TEMPLATES_ENABLED
#if EASTL_INLINE_VARIABLE_ENABLED
template<class... B>
inline constexpr bool disjunction_v = disjunction<B...>::value;
#else
template<class... B>
static const constexpr bool disjunction_v = disjunction<B...>::value;
#endif
#endif
#endif
///////////////////////////////////////////////////////////////////////
// negation
//
// This is a C++17 standard utility class that performs a logical NOT on a
// single type trait.
//
// http://en.cppreference.com/w/cpp/types/negation
//
template <class B>
struct negation : eastl::bool_constant<!bool(B::value)> {};
#if EASTL_VARIABLE_TEMPLATES_ENABLED
#if EASTL_INLINE_VARIABLE_ENABLED
template<class B>
inline constexpr bool negation_v = negation<B>::value;
#else
template<class B>
static const constexpr bool negation_v = negation<B>::value;
#endif
#endif
///////////////////////////////////////////////////////////////////////
// identity
//
// The purpose of this is typically to deal with non-deduced template
// contexts. See the C++11 Standard, 14.8.2.5 p5.
// Also: http://cppquiz.org/quiz/question/109?result=CE&answer=&did_answer=Answer
//
// Dinkumware has an identity, but adds a member function to it:
// const T& operator()(const T& t) const{ return t; }
//
#if (EABASE_VERSION_N < 20040) || defined(EA_COMPILER_NO_TEMPLATE_ALIASES)
template <typename T>
struct identity { typedef T type; };
#else
template <typename T>
struct identity { using type = T; };
#endif
///////////////////////////////////////////////////////////////////////
// is_same
//
// Given two (possibly identical) types T and U, is_same<T, U>::value == true
// if and only if T and U are the same type.
//
///////////////////////////////////////////////////////////////////////
#define EASTL_TYPE_TRAIT_is_same_CONFORMANCE 1 // is_same is conforming; doesn't make mistakes.
template <typename T, typename U>
struct is_same : public eastl::false_type { };
template <typename T>
struct is_same<T, T> : public eastl::true_type { };
#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <class T, class U>
EA_CONSTEXPR bool is_same_v = is_same<T, U>::value;
#endif
///////////////////////////////////////////////////////////////////////
// is_const
//
// is_const<T>::value == true if and only if T has const-qualification.
//
///////////////////////////////////////////////////////////////////////
#define EASTL_TYPE_TRAIT_is_const_CONFORMANCE 1 // is_const is conforming.
template <typename T> struct is_const_value : public eastl::false_type{};
template <typename T> struct is_const_value<const T*> : public eastl::true_type{};
template <typename T> struct is_const_value<const volatile T*> : public eastl::true_type{};
template <typename T> struct is_const : public eastl::is_const_value<T*>{};
template <typename T> struct is_const<T&> : public eastl::false_type{}; // Note here that T is const, not the reference to T. So is_const is false. See section 8.3.2p1 of the C++ standard.
///////////////////////////////////////////////////////////////////////
// is_volatile
//
// is_volatile<T>::value == true if and only if T has volatile-qualification.
//
///////////////////////////////////////////////////////////////////////
#define EASTL_TYPE_TRAIT_is_volatile_CONFORMANCE 1 // is_volatile is conforming.
template <typename T> struct is_volatile_value : public eastl::false_type{};
template <typename T> struct is_volatile_value<volatile T*> : public eastl::true_type{};
template <typename T> struct is_volatile_value<const volatile T*> : public eastl::true_type{};
template <typename T> struct is_volatile : public eastl::is_volatile_value<T*>{};
template <typename T> struct is_volatile<T&> : public eastl::false_type{}; // Note here that T is volatile, not the reference to T. So is_const is false. See section 8.3.2p1 of the C++ standard.
///////////////////////////////////////////////////////////////////////
// is_reference
//
// is_reference<T>::value == true if and only if T is a reference type.
// This category includes reference to function types.
//
///////////////////////////////////////////////////////////////////////
#define EASTL_TYPE_TRAIT_is_reference_CONFORMANCE 1 // is_reference is conforming; doesn't make mistakes.
template <typename T> struct is_reference : public eastl::false_type{};
template <typename T> struct is_reference<T&> : public eastl::true_type{};
///////////////////////////////////////////////////////////////////////
// is_function
//
// is_function<T>::value == true if and only if T is a function type.
// A function type here does not include a member function type.
//
///////////////////////////////////////////////////////////////////////
#if 0
// This solution, borrowed from libc++, works by taking advantage of the fact that
// upon passing an argument of type function to a function, the argument decays to a function pointer.
// Recall that decay is when a type is converted to another type for casting or argument
// passing purposes, such as how T[] is converted to T* upon passing to a function.
// it would be better than our fallback below, but would require rearranging our headers
// to allow the is_class, etc. below to work. We can't use decay<T>::type below to help us
// because the decay type trait calls is_function.
#define EASTL_TYPE_TRAIT_is_function_CONFORMANCE 1
template <typename T> eastl::yes_type is_function_decayed_helper(T*);
template <typename T> eastl::no_type is_function_decayed_helper(...);
template <typename T> T& return_T_reference();
template <typename T, bool = eastl::is_class<T>::value || // I don't see why an is_class check here is necessary.
eastl::is_union<T>::value || // I don't see why an is_union check here is necessary.
eastl::is_void<T>::value ||
eastl::is_reference<T>::value ||
eastl::is_null_pointer<T>::value >
struct is_function_helper
: public integral_constant<bool, sizeof(is_function_decayed_helper<T>(return_T_reference<T>())) == sizeof(eastl::yes_type)> {};
template <typename T> struct is_function_helper<T, true>
: public false_type {};
template <typename T> struct is_function
: public is_function_helper<T> {};
#elif defined(EA_COMPILER_NO_VARIADIC_TEMPLATES)
#define EASTL_TYPE_TRAIT_is_function_CONFORMANCE 0 // Can't handle functions with ellipsis arguments, like int printf(const char*, ...). Could be fixed with yet more specializations below.
template <typename R> struct is_function_ptr_helper : public eastl::false_type{};
template <typename R> struct is_function_ptr_helper<R (*)()> : public eastl::true_type{};
template <typename R, typename Arg0> struct is_function_ptr_helper<R (*)(Arg0)> : public eastl::true_type{};
template <typename R, typename Arg0, typename Arg1> struct is_function_ptr_helper<R (*)(Arg0, Arg1)> : public eastl::true_type{};
template <typename R, typename Arg0, typename Arg1, typename Arg2> struct is_function_ptr_helper<R (*)(Arg0, Arg1, Arg2)> : public eastl::true_type{};
template <typename R, typename Arg0, typename Arg1, typename Arg2, typename Arg3> struct is_function_ptr_helper<R (*)(Arg0, Arg1, Arg2, Arg3)> : public eastl::true_type{};
template <typename R, typename Arg0, typename Arg1, typename Arg2, typename Arg3, typename Arg4> struct is_function_ptr_helper<R (*)(Arg0, Arg1, Arg2, Arg3, Arg4)> : public eastl::true_type{};
template <typename R, typename Arg0, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5> struct is_function_ptr_helper<R (*)(Arg0, Arg1, Arg2, Arg3, Arg4, Arg5)> : public eastl::true_type{};
template <typename R, typename Arg0, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5, typename Arg6> struct is_function_ptr_helper<R (*)(Arg0, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)> : public eastl::true_type{};
template <typename R, typename Arg0, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5, typename Arg6, typename Arg7> struct is_function_ptr_helper<R (*)(Arg0, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)> : public eastl::true_type{};
template <bool is_ref = true>
struct is_function_chooser
{ template <typename T> struct result_ : public eastl::false_type{}; };
template <>
struct is_function_chooser<false>
{ template <typename T> struct result_ : public eastl::is_function_ptr_helper<T*>{}; };
template <typename T>
struct is_function_value
: public eastl::is_function_chooser<eastl::is_reference<T>::value>::template result_<T>{};
template <typename T>
struct is_function
: public eastl::integral_constant<bool, is_function_value<T>::value>{};
#else
#define EASTL_TYPE_TRAIT_is_function_CONFORMANCE 1 // is_function is conforming.
template <typename>
struct is_function
: public eastl::false_type {};
#if EA_PLATFORM_PTR_SIZE == 4 && defined(EA_PLATFORM_MICROSOFT) && defined(_MSC_EXTENSIONS)
// __cdecl specialization
template <typename ReturnValue, typename... ArgPack>
struct is_function<ReturnValue __cdecl (ArgPack...)>
: public eastl::true_type {};
template <typename ReturnValue, typename... ArgPack>
struct is_function<ReturnValue __cdecl (ArgPack..., ...)> // The second ellipsis handles the case of a function that takes ellipsis, like printf.
: public eastl::true_type {};
// __stdcall specialization
template <typename ReturnValue, typename... ArgPack>
struct is_function<ReturnValue __stdcall (ArgPack...)>
: public eastl::true_type {};
// When functions use a variable number of arguments, it is the caller that cleans the stack (cf. cdecl).
//
// template <typename ReturnValue, typename... ArgPack>
// struct is_function<ReturnValue __stdcall (ArgPack..., ...)> // The second ellipsis handles the case of a function that takes ellipsis, like printf.
// : public eastl::true_type {};
#else
template <typename ReturnValue, typename... ArgPack>
struct is_function<ReturnValue (ArgPack...)>
: public eastl::true_type {};
template <typename ReturnValue, typename... ArgPack>
struct is_function<ReturnValue (ArgPack..., ...)> // The second ellipsis handles the case of a function that takes ellipsis, like printf.
: public eastl::true_type {};
#endif
#endif
// The following remove utilities are defined here instead of in the headers
// below because they are core utilits that many other type traits need.
///////////////////////////////////////////////////////////////////////
// remove_const
//
// Remove const from a type.
//
// The remove_const transformation trait removes top-level const
// qualification (if any) from the type to which it is applied. For a
// given type T, remove_const<T const>::type is equivalent to the type T.
// For example, remove_const<char*>::type is equivalent to char* while
// remove_const<const char*>::type is equivalent to const char*.
// In the latter case, the const qualifier modifies char, not *, and is
// therefore not at the top level.
//
///////////////////////////////////////////////////////////////////////
#define EASTL_TYPE_TRAIT_remove_const_CONFORMANCE 1 // remove_const is conforming.
template <typename T> struct remove_const { typedef T type; };
template <typename T> struct remove_const<const T> { typedef T type; };
template <typename T> struct remove_const<const T[]> { typedef T type[]; };
template <typename T, size_t N> struct remove_const<const T[N]> { typedef T type[N]; };
///////////////////////////////////////////////////////////////////////
// remove_volatile
//
// Remove volatile from a type.
//
// The remove_volatile transformation trait removes top-level volatile
// qualification (if any) from the type to which it is applied.
// For a given type T, the type remove_volatile <T volatile>::T is equivalent
// to the type T. For example, remove_volatile <char* volatile>::type is
// equivalent to char* while remove_volatile <volatile char*>::type is
// equivalent to volatile char*. In the latter case, the volatile qualifier
// modifies char, not *, and is therefore not at the top level.
//
///////////////////////////////////////////////////////////////////////
#define EASTL_TYPE_TRAIT_remove_volatile_CONFORMANCE 1 // remove_volatile is conforming.
template <typename T> struct remove_volatile { typedef T type; };
template <typename T> struct remove_volatile<volatile T> { typedef T type; };
template <typename T> struct remove_volatile<volatile T[]> { typedef T type[]; };
template <typename T, size_t N> struct remove_volatile<volatile T[N]> { typedef T type[N]; };
///////////////////////////////////////////////////////////////////////
// remove_cv
//
// Remove const and volatile from a type.
//
// The remove_cv transformation trait removes top-level const and/or volatile
// qualification (if any) from the type to which it is applied. For a given type T,
// remove_cv<T const volatile>::type is equivalent to T. For example,
// remove_cv<char* volatile>::type is equivalent to char*, while remove_cv<const char*>::type
// is equivalent to const char*. In the latter case, the const qualifier modifies
// char, not *, and is therefore not at the top level.
//
///////////////////////////////////////////////////////////////////////
#define EASTL_TYPE_TRAIT_remove_cv_CONFORMANCE 1 // remove_cv is conforming.
template <typename T>
struct remove_cv { typedef typename eastl::remove_volatile<typename eastl::remove_const<T>::type>::type type; };
///////////////////////////////////////////////////////////////////////
// add_reference
//
// Add reference to a type.
//
// The add_reference transformation trait adds a level of indirection
// by reference to the type to which it is applied. For a given type T,
// add_reference<T>::type is equivalent to T& if is_reference<T>::value == false,
// and T otherwise.
//
///////////////////////////////////////////////////////////////////////
#define EASTL_TYPE_TRAIT_add_reference_CONFORMANCE 1 // add_reference is conforming.
template <typename T> struct add_reference_impl { typedef T& type; };
template <typename T> struct add_reference_impl<T&> { typedef T& type; };
template <> struct add_reference_impl<void>{ typedef void type; };
#if defined(_MSC_VER) && (_MSC_VER <= 1600) // VS2010 and earlier mistakenly report: "cannot add a reference to a zero-sized array." Actually they are allowed, but there's nothing we can do about it under VS2010 and earlier.
template <typename T> struct add_reference_impl<T[0]>{ typedef T type; };
#endif
template <typename T> struct add_reference { typedef typename add_reference_impl<T>::type type; };
///////////////////////////////////////////////////////////////////////
// remove_reference
//
// Remove reference from a type.
//
// The remove_reference transformation trait removes top-level of
// indirection by reference (if any) from the type to which it is applied.
// For a given type T, remove_reference<T&>::type is equivalent to T.
//
///////////////////////////////////////////////////////////////////////
#define EASTL_TYPE_TRAIT_remove_reference_CONFORMANCE 1
template <typename T> struct remove_reference { typedef T type; };
template <typename T> struct remove_reference<T&>{ typedef T type; };
#if !EASTL_NO_RVALUE_REFERENCES
template <typename T> struct remove_reference<T&&>{ typedef T type; };
#endif
#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
using remove_reference_t = typename remove_reference<T>::type;
#endif
///////////////////////////////////////////////////////////////////////
// add_lvalue_reference
//
// C++11 Standard, section 20.9.7.2
// If T names an object or function type then the member typedef type
// shall name T&; otherwise, if T names a type 'rvalue reference to T1' then
// the member typedef type shall name T1&; otherwise, type shall name T.
//
// Rules (8.3.2 p6):
// void + & -> void
// T + & -> T&
// T& + & -> T&
// T&& + & -> T&
///////////////////////////////////////////////////////////////////////
#define EASTL_TYPE_TRAIT_add_lvalue_reference_CONFORMANCE 1 // add_lvalue_reference is conforming.
template <typename T> struct add_lvalue_reference { typedef T& type; }; // If T is an && type then T&& & will be equivalent to T&.
template <typename T> struct add_lvalue_reference<T&> { typedef T& type; }; // This shouldn't be required for modern compilers, as they recognize that a reference to a reference is still a reference.
template <> struct add_lvalue_reference<void> { typedef void type; };
template <> struct add_lvalue_reference<const void> { typedef const void type; };
template <> struct add_lvalue_reference<volatile void> { typedef volatile void type; };
template <> struct add_lvalue_reference<const volatile void> { typedef const volatile void type; };
#if defined(EA_COMPILER_NO_TEMPLATE_ALIASES)
// To do: define macro.
#else
template <typename T>
using add_lvalue_reference_t = typename add_lvalue_reference<T>::type;
#endif
///////////////////////////////////////////////////////////////////////
// add_rvalue_reference
//
// C++11 Standard, section 20.9.7.2
// If T names an object or function type then the member typedef type
// shall name T&&; otherwise, type shall name T. [ Note: This rule reflects
// the semantics of reference collapsing (8.3.2). For example, when a type T
// names a type T1&, the type add_rvalue_reference<T>::type is not an
// rvalue reference. end note ]
//
// Rules (8.3.2 p6):
// void + && -> void
// T + && -> T&&
// T& + && -> T&
// T&& + && -> T&&
///////////////////////////////////////////////////////////////////////
#if EASTL_NO_RVALUE_REFERENCES
#define EASTL_TYPE_TRAIT_add_rvalue_reference_CONFORMANCE 0 // Arguably this could be 1 since it's never wrong, as rvalue references don't exist for this compiler.
// We make it be the same as add_lvalue_reference.
template <typename T>
struct add_rvalue_reference { typedef typename add_lvalue_reference<T>::type type; };
#else
#define EASTL_TYPE_TRAIT_add_rvalue_reference_CONFORMANCE 1
template <typename T> struct add_rvalue_reference { typedef T&& type; }; // Dinkumware has this as { typedef typename eastl::remove_reference<T>::type&& type; }, but that doesn't seem right to me.
template <typename T> struct add_rvalue_reference<T&> { typedef T& type; }; // The Standard section 20.7.9.2 specifies that we do this, though it seems like the compiler ought to not require this, as C++11 stipulates that & + && -> &.
template <> struct add_rvalue_reference<void> { typedef void type; };
template <> struct add_rvalue_reference<const void> { typedef const void type; };
template <> struct add_rvalue_reference<volatile void> { typedef volatile void type; };
template <> struct add_rvalue_reference<const volatile void> { typedef const volatile void type; };
#endif
#if defined(EA_COMPILER_NO_TEMPLATE_ALIASES)
// To do: define macro.
#else
template <typename T>
using add_rvalue_reference_t = typename add_rvalue_reference<T>::type;
#endif
///////////////////////////////////////////////////////////////////////
// declval
//
// declval is normally found in <utility.h> but type traits need it and utility #includes this.
//
// Converts any type T to a reference type, making it possible to use member functions in
// decltype expressions without specifying constructors. It has no use outside decltype expressions.
// By design there is no implementation, as it's never executed but rather is used only in decltype expressions.
// The C++11 Standard section 20.2.4 states that we must declare this.
// http://en.cppreference.com/w/cpp/utility/declval
//
///////////////////////////////////////////////////////////////////////
#if EASTL_NO_RVALUE_REFERENCES
#define EASTL_TYPE_TRAIT_declval_CONFORMANCE 0
template <typename T>
typename eastl::add_lvalue_reference<T>::type declval() EASTL_NOEXCEPT;
#else
#define EASTL_TYPE_TRAIT_declval_CONFORMANCE 1
template <typename T>
typename eastl::add_rvalue_reference<T>::type declval() EASTL_NOEXCEPT;
#endif
#if !defined(EA_COMPILER_NO_DECLTYPE) && !EASTL_TYPE_TRAIT_declval_CONFORMANCE
#error decltype is supported by the compiler but declval is not. A lot of our type trait code assumes that if the compiler supports decltype then it supports rvalue references.
#endif
///////////////////////////////////////////////////////////////////////
// static_min / static_max
//
// These are primarily useful in templated code for meta programming.
// Currently we are limited to size_t, as C++ doesn't allow integral
// template parameters to be generic. We can expand the supported types
// to include additional integers if needed.
//
// These are not in the C++ Standard.
//
// Example usage:
// Printf("%zu", static_max<3, 7, 1, 5>::value); // prints "7"
//
///////////////////////////////////////////////////////////////////////
// VS2013 fails to compile the variadic code below due to what looks like a deficiency in their handling of integral variadic template parameters.
// Also mingw's clang and gcc fail to compile the code on windows.
#if defined(EA_COMPILER_NO_VARIADIC_TEMPLATES) || defined(EA_COMPILER_MSVC) || (defined(EA_PLATFORM_MINGW) && (defined(EA_COMPILER_CLANG) || defined(EA_COMPILER_GNUC)))
// We support only two parameters.
#define EASTL_TYPE_TRAIT_static_min_CONFORMANCE 0
#define EASTL_TYPE_TRAIT_static_max_CONFORMANCE 0
template <size_t I0, size_t I1>
struct static_min
{ static const size_t value = ((I0 <= I1) ? I0 : I1); };
template <size_t I0, size_t I1>
struct static_max
{ static const size_t value = ((I0 >= I1) ? I0 : I1); };
#else
#define EASTL_TYPE_TRAIT_static_min_CONFORMANCE 1
#define EASTL_TYPE_TRAIT_static_max_CONFORMANCE 1
template <size_t I0, size_t ...in>
struct static_min;
template <size_t I0>
struct static_min<I0>
{ static const size_t value = I0; };
template <size_t I0, size_t I1, size_t ...in>
struct static_min<I0, I1, in...>
{ static const size_t value = ((I0 <= I1) ? static_min<I0, in...>::value : static_min<I1, in...>::value); };
template <size_t I0, size_t ...in>
struct static_max;
template <size_t I0>
struct static_max<I0>
{ static const size_t value = I0; };
template <size_t I0, size_t I1, size_t ...in>
struct static_max<I0, I1, in...>
{ static const size_t value = ((I0 >= I1) ? static_max<I0, in...>::value : static_max<I1, in...>::value); };
#endif
} // namespace eastl
// The following files implement the type traits themselves.
#include <eastl/internal/type_fundamental.h>
#include <eastl/internal/type_transformations.h>
#include <eastl/internal/type_properties.h>
#include <eastl/internal/type_compound.h>
#include <eastl/internal/type_pod.h>
#endif // Header include guard
| [
"questor@inter"
] | questor@inter |
aab9944654662eba584ef391a092ce0d59dae14f | ca68fff0b390c1366a0fda094cf5729ff784c683 | /source/log.h | c7e83840aeb2d76c16b622f90c1f4b6affa5c4c1 | [] | no_license | Pavelius/eob | 9cb009cb426ead416ded2c845fc43040ee7106e7 | d1be99ab9b6460ac747365212cfec3af68ddabf2 | refs/heads/master | 2023-05-12T07:54:28.939227 | 2023-04-27T12:35:24 | 2023-04-27T12:35:24 | 187,794,622 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 535 | h | #pragma once
namespace log {
extern bool need_continue;
void cerror(const char* position, const char* format, ...);
void close();
int geterrors();
const char* getfilestart();
void error(const char* position, const char* format, ...);
void errorf(const char* position, const char* format, const char* format_param);
void errorv(const char* position, const char* format);
const char* read(const char* url, bool error_if_not_exist = true);
void setfile(const char* v);
void seturl(const char* v);
}
| [
"p000000000001@gmail.com"
] | p000000000001@gmail.com |
3a5c20d6e01afd577484dbe8d6b0d8969f5dc2ae | 98b345594e6fa0ad9910bc0c20020827bbb62c53 | /re110_1/processor33/80/p | 102750438906ae984c595888eca69d9af4d4c81e | [] | no_license | carsumptive/coe-of2 | e9027de48e42546ca4df1c104dcc8d04725954f2 | fc3e0426696f42fbbbdce7c027df9ee8ced4ccd0 | refs/heads/master | 2023-04-04T06:09:23.093717 | 2021-04-06T06:47:14 | 2021-04-06T06:47:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,151 | /*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "80";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField nonuniform List<scalar>
183
(
-0.435726
-0.243277
-0.151432
-0.428088
-0.243367
-0.153823
-0.417363
-0.243192
-0.157145
-0.402799
-0.242633
-0.161184
-0.241483
-0.165662
-0.239509
-0.170302
-0.236505
-0.174883
-0.232324
-0.179259
-0.226644
-0.183338
-0.218837
-0.187038
-0.208266
-0.190229
-0.194523
-0.192714
-0.177746
-0.194247
-0.158832
-0.194585
-0.139125
-0.193555
-0.119964
-0.191102
-0.102337
-0.187279
-0.0867554
-0.182217
-0.0733073
-0.176168
-0.0615257
-0.169035
-0.0524917
-0.160687
-0.0425111
-0.152735
-0.0402271
-0.101972
-0.0330745
-0.0753361
-0.0296971
-0.0554566
-0.0272401
-0.0409753
-0.0254328
-0.0313165
-0.0239208
-0.0241319
-0.0221293
-0.0190206
-0.0199426
-0.0152393
-0.0174736
-0.0121918
-0.0149485
-0.00969572
-0.0124801
-0.00756785
-0.0101686
-0.00574136
-0.00806062
-0.00416256
-0.00619298
-0.00280604
-0.00458454
-0.00165676
0.00212787
-0.00324091
-0.000704968
0.00275225
-0.00217279
5.07739e-05
0.00323484
-0.0013697
0.000616648
0.00358924
-0.000841616
0.00099058
0.00382044
-0.000573208
0.00117822
0.00393481
-0.142856
-0.0937875
-0.0684582
-0.0440055
-0.032659
-0.0236081
-0.0178134
-0.013523
-0.0101033
-0.00721186
-0.00466395
-0.00237616
-0.000327279
0.00148767
0.00307468
0.00442578
0.0055518
0.00644079
0.00710999
0.00754942
0.00777088
-0.0456494
-0.0116956
0.0074252
0.0151887
0.0156693
0.0152206
0.0131314
0.0110666
0.00937411
0.00820697
0.0075307
0.00725685
0.00727689
0.007487
0.00781707
0.00818621
0.00856557
0.00889818
0.00917421
0.00936245
0.00945976
-0.177453
-0.0789567
-0.181779
-0.0868102
-0.181107
-0.0905482
-0.183347
-0.0959764
-0.187149
-0.103075
-0.190986
-0.110452
-0.194911
-0.117576
-0.199161
-0.124407
-0.203708
-0.130871
-0.208443
-0.13678
-0.213271
-0.141925
-0.218079
-0.146125
-0.22273
-0.149259
-0.227082
-0.151282
-0.231008
-0.152246
-0.234408
-0.152309
-0.43806
-0.237223
-0.15173
-0.441736
-0.239437
-0.150844
-0.443514
-0.241077
-0.15003
-0.443218
-0.242208
-0.149664
-0.440689
-0.242915
-0.150064
)
;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value nonuniform 0();
}
cylinder
{
type zeroGradient;
}
top
{
type symmetryPlane;
}
bottom
{
type symmetryPlane;
}
defaultFaces
{
type empty;
}
procBoundary33to32
{
type processor;
value nonuniform List<scalar>
86
(
-0.453653
-0.440418
-0.426613
-0.411955
-0.383249
-0.383249
-0.357331
-0.323944
-0.282976
-0.23583
-0.185437
-0.135677
-0.0892804
-0.0479158
-0.012484
0.0158166
0.037022
0.0517428
0.0608484
0.0653197
0.0658385
0.0632485
0.060484
0.00962493
-0.0116685
-0.0256872
-0.0333303
-0.0360637
-0.0354032
-0.0328026
-0.02919
-0.0252077
-0.021245
-0.0175042
-0.0141229
-0.0111378
-0.00856592
-0.00640352
-0.00463217
-0.00324213
-0.0022086
-0.00153417
-0.00119059
-0.245436
-0.172561
-0.136753
-0.10391
-0.0807668
-0.0632581
-0.0492347
-0.0382233
-0.0292407
-0.0218815
-0.0158109
-0.0107765
-0.0066042
-0.00315832
-0.000317872
0.00197736
0.00381579
0.00521172
0.00624149
0.0069029
0.00723768
-0.288092
-0.299229
-0.306646
-0.316186
-0.326794
-0.337414
-0.347997
-0.358563
-0.369036
-0.379361
-0.389524
-0.399455
-0.408989
-0.41789
-0.425884
-0.432695
-0.432695
-0.505479
-0.498264
-0.489053
-0.478159
-0.466298
)
;
}
procBoundary33to34
{
type processor;
value nonuniform List<scalar>
85
(
-0.219231
-0.221667
-0.22415
-0.226569
-0.228761
-0.230544
-0.23175
-0.232249
-0.231964
-0.230863
-0.22894
-0.226207
-0.222678
-0.218379
-0.213351
-0.20765
-0.201354
-0.194603
-0.187578
-0.180121
-0.171684
-0.150746
-0.103338
-0.0774428
-0.0560732
-0.0406285
-0.0296433
-0.0209111
-0.0148152
-0.0102185
-0.00683145
-0.00430025
-0.00235356
-0.000836497
0.000372146
0.00134469
0.00134469
0.00639135
0.00668795
0.0069101
0.00707044
0.00717302
0.00722308
-0.0235484
0.0266162
0.0651985
0.0535464
0.0503727
0.042194
0.0346289
0.0283632
0.0234436
0.0197359
0.0170302
0.0150917
0.0137771
0.0128599
0.0122792
0.0119331
0.0117565
0.0116676
0.0116426
0.0116346
0.0116362
-0.0775672
-0.0926151
-0.102032
-0.110634
-0.119985
-0.129315
-0.138216
-0.146816
-0.155234
-0.163461
-0.171419
-0.17898
-0.185985
-0.192278
-0.197741
-0.202325
-0.206096
-0.209296
-0.212075
-0.214531
-0.216872
)
;
}
}
// ************************************************************************* //
| [
"chaseguy15"
] | chaseguy15 | |
dd0e91427c3f4223429f81024a1552275975dd0c | 2562032ef810ab3ccd9de31c8a29092ca8d70ad4 | /Task2_fixed_structure/invoker.h | 2183acbe245601b7eaa94cb861df5fe97b3490ed | [] | no_license | Mr-S-Mirzoev/CPP-For-Internship-AV-Soft | 19b173c353d446b60e13cd1a8761821ef37bdfb2 | 7fc482f9ef56510bf735923f6737f28e0a1b04fb | refs/heads/master | 2022-10-08T12:20:16.680142 | 2020-06-14T15:35:26 | 2020-06-14T15:35:26 | 270,339,726 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,151 | h | #pragma once
#ifndef INCLUDED_INVOKER_14062020
#define INCLUDED_INVOKER_14062020
#include "commands.h"
class Invoker
{
std::vector <Commands::Command *> DoneCommands;
std::vector <Commands::Command *> CanceledCommands;
Company::Company com;
Commands::Command *command;
public:
void addwrk (const std::string &d,
const std::string &w,
const std::string &t,
const unsigned &s );
void adddpt (const std::string &d);
void chgnmdpt (const std::string &name, const std::string &newname);
void delwrk (const std::string &d, const std::string &w);
void deldpt (const std::string &d);
void editdpt (const std::string &d,
const std::string &w,
const std::string &n,
const std::string &f,
const unsigned & s);
void savetofile (const std::string &fname);
void loadfromfile (const std::string &fname);
void Undo();
void Redo();
void Show();
~Invoker ();
};
#endif
| [
"noreply@github.com"
] | noreply@github.com |
9e759021b9b32cf66fe30c9f15b3cdd2f4e38fb1 | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/httpd/gumtree/httpd_repos_function_2265_httpd-2.4.16.cpp | 703b541efd2c67c22563cceb0f8e214a75105fe2 | [] | no_license | niuxu18/logTracker-old | 97543445ea7e414ed40bdc681239365d33418975 | f2b060f13a0295387fe02187543db124916eb446 | refs/heads/master | 2021-09-13T21:39:37.686481 | 2017-12-11T03:36:34 | 2017-12-11T03:36:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 302 | cpp | static void eval_errf(sed_eval_t *eval, const char *fmt, ...)
{
if (eval->errfn && eval->pool) {
va_list args;
const char* error;
va_start(args, fmt);
error = apr_pvsprintf(eval->pool, fmt, args);
eval->errfn(eval->data, error);
va_end(args);
}
} | [
"993273596@qq.com"
] | 993273596@qq.com |
5a4ec47a481ff7ee76f4781c01e08262d0b8a315 | 105e01d10b4ffe685998049106bfdb23d2ca509a | /Algorithm/GreedyAlgorithm/knapsack.cpp | e22a1a566290ac79fd4bafd3ffc2d170966c9dcd | [] | no_license | codeshef/datastructure-and-algorithm | 131380a16178f89885b83c1d03ed355b8ca3543b | b368afa4e6ec666a32005071b423df6ffaa46c74 | refs/heads/master | 2020-04-05T07:47:57.633827 | 2018-04-04T18:58:30 | 2018-04-04T18:58:30 | 81,852,771 | 1 | 0 | null | 2017-07-27T17:51:17 | 2017-02-13T17:39:45 | C++ | UTF-8 | C++ | false | false | 481 | cpp | #include<iostream>
using namespace std;
int max(int a,int b){
return (a>b) ?a:b;
}
int knapsack(int w,int wt[],int val[],int n){
if(n==0 || w==0)
return 0;
if(wt[n-1] > w)
return knapsack(w,wt,val,n-1);
else return max(val[n-1]+knapsack(w-wt[n-1],wt,val,n-1),knapsack(w,wt,val,n-1));
}
int main(){
int val[] = {60,100,120};
int wt[] = {10,20,30};
int w = 50;
int n= sizeof(val)/sizeof(val[0]);
cout<<knapsack(w,wt,val,n);
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
8e5b4d5c99f877e324ef6e4175285e0d5ce43a06 | cf4ffd7fc5a3eb79e07c8eeba3733918f152bd53 | /RootN/main.cpp | 1ba0ca2ca5ac8567607fd1ed8baafcfedcf2fad7 | [] | no_license | shelbyisnothere/GED | 82c01112a94cc3b24258e50b4b45f749defd2a31 | 1431badcf2ce021702b81fba33ac74c4583ea3bb | refs/heads/master | 2023-02-24T19:46:01.775489 | 2021-01-21T22:05:02 | 2021-01-21T22:05:02 | 267,742,381 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,468 | cpp | //
// made by shelby on 9/14/2020
// main c++ file for O(root(n)) approximation
//
#include <iostream>
#include <fstream>
#include <vector>
#include <math.h>
#include <CGAL/squared_distance_3.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/IO/read_xyz_points.h>
#include <CGAL/number_utils.h>
#include "RandomShift.h"
using namespace std;
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
int main(int argc, char * argv[]){
//load data points
vector<Point> p;
vector<Point> q;
double x, y; //for loading in individual points
int np, nq; //overall number of points in p and q
ifstream inFile;
//read p
inFile.open(argv[1]);
if(!inFile.is_open())
cerr << "Unable to open data file 1. \nFile name: " << argv[1];
cout << "\nReading file: " << argv[1] << endl;
inFile >> np;
while(inFile >> x >> y)
{
Point point(x, y, 0);
p.push_back(point);
}
inFile.close();
//read q
inFile.open(argv[2]);
if(!inFile.is_open())
cerr << "Unable to open data file 2. \nFile name: " << argv[2];
cout << "\nReading file: " << argv[2] << endl;
inFile >> nq;
while(inFile >> x >> y)
{
Point point(x, y, 0);
q.push_back(point);
}
inFile.close();
//begin algorithm 1
bool tmp; //place holder for dist(p, q)
int g; //guess value
bool out; //for SED
double sum;
sdsl::int_vector<> S;
sdsl::int_vector<> T;
double c = 1.0; //sufficiently large c
cout << "\nComparing sum of distance between points..." << endl;
for(int i = 0; i < min(np, nq); i++) {
sum += CGAL::sqrt(CGAL::squared_distance(p[i], q[i]));
}
if(np != nq)
{//cant return matching w uneven strings(?)
sum = 1;
}
if(sum < 1){
//return matching?
}
else {
cout << "\nConverting to strings S and T, and comparing edit distance..." << endl;
for(int i = 0; i < log(sqrt(max(np, nq))); i++){
g = pow(2, i);
if(g > 2)
break;
for(int j = 0; j < c * log(max(np, nq)); j++)
{
//transform p and q to strings
RandomShift shift(p, q);
shift.shiftGrid(g, max(np, nq));
S = shift.getS();
T = shift.getT();
for(size_t i = 0; i < S.size(); i++)
{
cerr << S[i] << " ";
}
cerr << endl;
for(size_t i = 0; i < T.size(); i++)
{
cerr << T[i] << " ";
}
cerr << endl << endl;
//SED
//if(!out)
}
}//end outer for
//return empty matching
}//end else
return 0;
}
| [
"shelbyisnothere@gmail.com"
] | shelbyisnothere@gmail.com |
24a28ac659cdea8165537311c734c7430ffb39a8 | e557ce74c9fe34aa2b68441254b7def699067501 | /src/libtsduck/dtv/hls/tshlsAltPlayList.h | a82ba031797d8c6645b50ba59096fc1c2f9f2c22 | [
"BSD-2-Clause"
] | permissive | cedinu/tsduck-mod | 53d9b4061d0eab9864d40b1d47b34f5908f99d8a | 6c97507b63e7882a146eee3613d4184b7e535101 | refs/heads/master | 2023-05-10T12:56:33.185589 | 2023-05-02T09:00:57 | 2023-05-02T09:00:57 | 236,732,523 | 0 | 0 | BSD-2-Clause | 2021-09-23T08:36:08 | 2020-01-28T12:41:10 | C++ | UTF-8 | C++ | false | false | 3,860 | h | //----------------------------------------------------------------------------
//
// TSDuck - The MPEG Transport Stream Toolkit
// Copyright (c) 2005-2023, Thierry Lelegard
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
// THE POSSIBILITY OF SUCH DAMAGE.
//
//----------------------------------------------------------------------------
//!
//! @file
//! Description of an alternative rendition playlist inside an HLS master playlist.
//!
//----------------------------------------------------------------------------
#pragma once
#include "tshlsMediaElement.h"
namespace ts {
namespace hls {
//!
//! Description of an alternative rendition media playlist inside an HLS master playlist.
//! Alternative rendition media playlists are introduced by the tag @c \#EXT-X-MEDIA while
//! regular media playlists (class MediaPlayList) are introduced by the tag @c \#EXT-X-STREAM-INF.
//! @ingroup hls
//!
class TSDUCKDLL AltPlayList: public MediaElement
{
public:
//!
//! Constructor.
//!
AltPlayList();
// Implementation of StringifyInterface
virtual UString toString() const override;
// Public fields.
bool isDefault; //!< The client should play this Rendition in the absence of information from the user indicating a different choice.
bool autoselect; //!< The client may choose to play this Rendition in the absence of explicit user preference.
bool forced; //!< The Rendition contains content that is considered essential to play.
UString name; //!< Human-readable description of the Rendition. Required.
UString type; //!< Playlist type, required, one of "AUDIO", "VIDEO", "SUBTITLES", "CLOSED-CAPTIONS".
UString groupId; //!< Group to which the Rendition belongs. Required.
UString stableRenditionId; //!< Stable identifier for the URI within the Multivariant Playlist. Optional.
UString language; //!< Primary language used in the Rendition. Optional.
UString assocLanguage; //!< Associated language. Optional.
UString inStreamId; //!< Rendition within the segments in the Media Playlist.
UString characteristics; //!< Media Characteristic Tags (MCTs) separated by comma (,) characters.
UString channels; //!< Ordered, slash-separated ("/") list of channel parameters.
};
}
}
| [
"thierry@lelegard.fr"
] | thierry@lelegard.fr |
4dd849c5eace97289a87d41c1b3504060dba0017 | 25f815b9018b9ee267d9b5759d66a46f422e4108 | /Source/GeographicLibModule/Private/GeographicLib/Math.cpp | e5ac5e65cce27dbf14f4c33aa68e1499a8d2afd3 | [] | no_license | starofys/MapVisualization | c6e85eac75df46d29e127c853afab923a6c2295b | e362572e9f25751d804708a9d42ec02c68634d4e | refs/heads/master | 2021-05-30T15:20:35.582425 | 2015-12-08T19:49:15 | 2015-12-08T19:49:15 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,259 | cpp | /**
* \file Math.cpp
* \brief Implementation for GeographicLib::Math class
*
* Copyright (c) Charles Karney (2015) <charles@karney.com> and licensed
* under the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/
**********************************************************************/
#include "GeographicLibModule.h"
#include "Math.hpp"
#if defined(_MSC_VER)
// Squelch warnings about constant conditional expressions
# pragma warning (disable: 4127)
#endif
namespace GeographicLib {
/// \cond SKIP
using namespace std;
template<typename T> T Math::eatanhe(T x, T es) {
return es > T(0) ? es * atanh(es * x) : -es * atan(es * x);
}
template<typename T> T Math::taupf(T tau, T es) {
T tau1 = hypot(T(1), tau),
sig = sinh( eatanhe(tau / tau1, es ) );
return hypot(T(1), sig) * tau - sig * tau1;
}
template<typename T> T Math::tauf(T taup, T es) {
static const int numit = 5;
static const T tol = sqrt(numeric_limits<T>::epsilon()) / T(10);
T e2m = T(1) - sq(es),
// To lowest order in e^2, taup = (1 - e^2) * tau = _e2m * tau; so use
// tau = taup/_e2m as a starting guess. (This starting guess is the
// geocentric latitude which, to first order in the flattening, is equal
// to the conformal latitude.) Only 1 iteration is needed for |lat| <
// 3.35 deg, otherwise 2 iterations are needed. If, instead, tau = taup
// is used the mean number of iterations increases to 1.99 (2 iterations
// are needed except near tau = 0).
tau = taup/e2m,
stol = tol * max(T(1), abs(taup));
// min iterations = 1, max iterations = 2; mean = 1.94
for (int i = 0; i < numit || GEOGRAPHICLIB_PANIC; ++i) {
T taupa = taupf(tau, es),
dtau = (taup - taupa) * (1 + e2m * sq(tau)) /
( e2m * hypot(T(1), tau) * hypot(T(1), taupa) );
tau += dtau;
if (!(abs(dtau) >= stol))
break;
}
return tau;
}
// Instantiate
template Math::real Math::eatanhe<Math::real>(Math::real, Math::real);
template Math::real Math::taupf<Math::real>(Math::real, Math::real);
template Math::real Math::tauf<Math::real>(Math::real, Math::real);
/// \endcond
} // namespace GeographicLib
| [
"bgreeves@umich.edu"
] | bgreeves@umich.edu |
7ffa7c39b8497c6a25b0b3e71f882f37086325c5 | 2906922ce1adc321c55c91764aeca24d46f379c1 | /wdl-ol/WDL/des.cpp | cab4dd4ed9eebbe3c12835ca47bad92f5651b421 | [
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | mazbox/openframeworks-audiounit | c51abe7ed2cc0ac554a5f5d85bd6000672c8a5f6 | b2443a49d60039346b916e0dc027f0c941f21c56 | refs/heads/master | 2021-01-01T20:05:37.562214 | 2013-08-14T05:18:33 | 2013-08-14T05:18:33 | 12,100,220 | 5 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,752 | cpp | /* Loosely based on:
*
* D3DES (V5.09) -
*
* A portable, public domain, version of the Data Encryption Standard.
*
* Written with Symantec's THINK (Lightspeed) C by Richard Outerbridge.
*
* Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge.
* (GEnie : OUTER; CIS : [71755,204]) Graven Imagery, 1992.
*/
#include "des.h"
static const unsigned char pc1[56] = {
56, 48, 40, 32, 24, 16, 8, 0, 57, 49, 41, 33, 25, 17,
9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35,
62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21,
13, 5, 60, 52, 44, 36, 28, 20, 12, 4, 27, 19, 11, 3
};
static const unsigned char totrot[16] = { 1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28 };
static const unsigned char pc2[48] = {
13, 16, 10, 23, 0, 4, 2, 27, 14, 5, 20, 9,
22, 18, 11, 3, 25, 7, 15, 6, 26, 19, 12, 1,
40, 51, 30, 36, 46, 54, 29, 39, 50, 44, 32, 47,
43, 48, 38, 55, 33, 52, 45, 41, 49, 35, 28, 31 };
static unsigned int SP1[64] = {
0x01010400, 0x00000000, 0x00010000, 0x01010404,
0x01010004, 0x00010404, 0x00000004, 0x00010000,
0x00000400, 0x01010400, 0x01010404, 0x00000400,
0x01000404, 0x01010004, 0x01000000, 0x00000004,
0x00000404, 0x01000400, 0x01000400, 0x00010400,
0x00010400, 0x01010000, 0x01010000, 0x01000404,
0x00010004, 0x01000004, 0x01000004, 0x00010004,
0x00000000, 0x00000404, 0x00010404, 0x01000000,
0x00010000, 0x01010404, 0x00000004, 0x01010000,
0x01010400, 0x01000000, 0x01000000, 0x00000400,
0x01010004, 0x00010000, 0x00010400, 0x01000004,
0x00000400, 0x00000004, 0x01000404, 0x00010404,
0x01010404, 0x00010004, 0x01010000, 0x01000404,
0x01000004, 0x00000404, 0x00010404, 0x01010400,
0x00000404, 0x01000400, 0x01000400, 0x00000000,
0x00010004, 0x00010400, 0x00000000, 0x01010004
};
static unsigned int SP2[64] = {
0x80108020, 0x80008000, 0x00008000, 0x00108020,
0x00100000, 0x00000020, 0x80100020, 0x80008020,
0x80000020, 0x80108020, 0x80108000, 0x80000000,
0x80008000, 0x00100000, 0x00000020, 0x80100020,
0x00108000, 0x00100020, 0x80008020, 0x00000000,
0x80000000, 0x00008000, 0x00108020, 0x80100000,
0x00100020, 0x80000020, 0x00000000, 0x00108000,
0x00008020, 0x80108000, 0x80100000, 0x00008020,
0x00000000, 0x00108020, 0x80100020, 0x00100000,
0x80008020, 0x80100000, 0x80108000, 0x00008000,
0x80100000, 0x80008000, 0x00000020, 0x80108020,
0x00108020, 0x00000020, 0x00008000, 0x80000000,
0x00008020, 0x80108000, 0x00100000, 0x80000020,
0x00100020, 0x80008020, 0x80000020, 0x00100020,
0x00108000, 0x00000000, 0x80008000, 0x00008020,
0x80000000, 0x80100020, 0x80108020, 0x00108000
};
static unsigned int SP3[64] = {
0x00000208, 0x08020200, 0x00000000, 0x08020008,
0x08000200, 0x00000000, 0x00020208, 0x08000200,
0x00020008, 0x08000008, 0x08000008, 0x00020000,
0x08020208, 0x00020008, 0x08020000, 0x00000208,
0x08000000, 0x00000008, 0x08020200, 0x00000200,
0x00020200, 0x08020000, 0x08020008, 0x00020208,
0x08000208, 0x00020200, 0x00020000, 0x08000208,
0x00000008, 0x08020208, 0x00000200, 0x08000000,
0x08020200, 0x08000000, 0x00020008, 0x00000208,
0x00020000, 0x08020200, 0x08000200, 0x00000000,
0x00000200, 0x00020008, 0x08020208, 0x08000200,
0x08000008, 0x00000200, 0x00000000, 0x08020008,
0x08000208, 0x00020000, 0x08000000, 0x08020208,
0x00000008, 0x00020208, 0x00020200, 0x08000008,
0x08020000, 0x08000208, 0x00000208, 0x08020000,
0x00020208, 0x00000008, 0x08020008, 0x00020200
};
static unsigned int SP4[64] = {
0x00802001, 0x00002081, 0x00002081, 0x00000080,
0x00802080, 0x00800081, 0x00800001, 0x00002001,
0x00000000, 0x00802000, 0x00802000, 0x00802081,
0x00000081, 0x00000000, 0x00800080, 0x00800001,
0x00000001, 0x00002000, 0x00800000, 0x00802001,
0x00000080, 0x00800000, 0x00002001, 0x00002080,
0x00800081, 0x00000001, 0x00002080, 0x00800080,
0x00002000, 0x00802080, 0x00802081, 0x00000081,
0x00800080, 0x00800001, 0x00802000, 0x00802081,
0x00000081, 0x00000000, 0x00000000, 0x00802000,
0x00002080, 0x00800080, 0x00800081, 0x00000001,
0x00802001, 0x00002081, 0x00002081, 0x00000080,
0x00802081, 0x00000081, 0x00000001, 0x00002000,
0x00800001, 0x00002001, 0x00802080, 0x00800081,
0x00002001, 0x00002080, 0x00800000, 0x00802001,
0x00000080, 0x00800000, 0x00002000, 0x00802080
};
static unsigned int SP5[64] = {
0x00000100, 0x02080100, 0x02080000, 0x42000100,
0x00080000, 0x00000100, 0x40000000, 0x02080000,
0x40080100, 0x00080000, 0x02000100, 0x40080100,
0x42000100, 0x42080000, 0x00080100, 0x40000000,
0x02000000, 0x40080000, 0x40080000, 0x00000000,
0x40000100, 0x42080100, 0x42080100, 0x02000100,
0x42080000, 0x40000100, 0x00000000, 0x42000000,
0x02080100, 0x02000000, 0x42000000, 0x00080100,
0x00080000, 0x42000100, 0x00000100, 0x02000000,
0x40000000, 0x02080000, 0x42000100, 0x40080100,
0x02000100, 0x40000000, 0x42080000, 0x02080100,
0x40080100, 0x00000100, 0x02000000, 0x42080000,
0x42080100, 0x00080100, 0x42000000, 0x42080100,
0x02080000, 0x00000000, 0x40080000, 0x42000000,
0x00080100, 0x02000100, 0x40000100, 0x00080000,
0x00000000, 0x40080000, 0x02080100, 0x40000100
};
static unsigned int SP6[64] = {
0x20000010, 0x20400000, 0x00004000, 0x20404010,
0x20400000, 0x00000010, 0x20404010, 0x00400000,
0x20004000, 0x00404010, 0x00400000, 0x20000010,
0x00400010, 0x20004000, 0x20000000, 0x00004010,
0x00000000, 0x00400010, 0x20004010, 0x00004000,
0x00404000, 0x20004010, 0x00000010, 0x20400010,
0x20400010, 0x00000000, 0x00404010, 0x20404000,
0x00004010, 0x00404000, 0x20404000, 0x20000000,
0x20004000, 0x00000010, 0x20400010, 0x00404000,
0x20404010, 0x00400000, 0x00004010, 0x20000010,
0x00400000, 0x20004000, 0x20000000, 0x00004010,
0x20000010, 0x20404010, 0x00404000, 0x20400000,
0x00404010, 0x20404000, 0x00000000, 0x20400010,
0x00000010, 0x00004000, 0x20400000, 0x00404010,
0x00004000, 0x00400010, 0x20004010, 0x00000000,
0x20404000, 0x20000000, 0x00400010, 0x20004010
};
static unsigned int SP7[64] = {
0x00200000, 0x04200002, 0x04000802, 0x00000000,
0x00000800, 0x04000802, 0x00200802, 0x04200800,
0x04200802, 0x00200000, 0x00000000, 0x04000002,
0x00000002, 0x04000000, 0x04200002, 0x00000802,
0x04000800, 0x00200802, 0x00200002, 0x04000800,
0x04000002, 0x04200000, 0x04200800, 0x00200002,
0x04200000, 0x00000800, 0x00000802, 0x04200802,
0x00200800, 0x00000002, 0x04000000, 0x00200800,
0x04000000, 0x00200800, 0x00200000, 0x04000802,
0x04000802, 0x04200002, 0x04200002, 0x00000002,
0x00200002, 0x04000000, 0x04000800, 0x00200000,
0x04200800, 0x00000802, 0x00200802, 0x04200800,
0x00000802, 0x04000002, 0x04200802, 0x04200000,
0x00200800, 0x00000000, 0x00000002, 0x04200802,
0x00000000, 0x00200802, 0x04200000, 0x00000800,
0x04000002, 0x04000800, 0x00000800, 0x00200002
};
static unsigned int SP8[64] = {
0x10001040, 0x00001000, 0x00040000, 0x10041040,
0x10000000, 0x10001040, 0x00000040, 0x10000000,
0x00040040, 0x10040000, 0x10041040, 0x00041000,
0x10041000, 0x00041040, 0x00001000, 0x00000040,
0x10040000, 0x10000040, 0x10001000, 0x00001040,
0x00041000, 0x00040040, 0x10040040, 0x10041000,
0x00001040, 0x00000000, 0x00000000, 0x10040040,
0x10000040, 0x10001000, 0x00041040, 0x00040000,
0x00041040, 0x00040000, 0x10041000, 0x00001000,
0x00000040, 0x10040040, 0x00001000, 0x00041040,
0x10001000, 0x00000040, 0x10000040, 0x10040000,
0x10040040, 0x10000000, 0x00040000, 0x10001040,
0x00000000, 0x10041040, 0x00040040, 0x10000040,
0x10040000, 0x10001000, 0x10001040, 0x00000000,
0x10041040, 0x00041000, 0x00041000, 0x00001040,
0x00001040, 0x00040040, 0x10000000, 0x10041000
};
WDL_DES::WDL_DES()
{
}
WDL_DES::~WDL_DES()
{
}
void WDL_DES::SetKey(const unsigned char *key8, bool isEncrypt)
{
int i;
unsigned char pc1m[56], pcr[56];
for ( i = 0; i < 56; i++ )
{
int l = pc1[i];
int m = l & 07;
pc1m[i] = (key8[l >> 3] & (1<<m)) ? 1 : 0;
}
for (i = 0; i < 16; i++)
{
int m = (isEncrypt?i:15-i) << 1;
int n = m + 1;
m_keydata[m] = m_keydata[n] = 0;
int j;
for (j = 0; j < 28; j++)
{
int l = j + totrot[i];
if( l < 28 ) pcr[j] = pc1m[l];
else pcr[j] = pc1m[l - 28];
}
for (j = 28; j < 56; j++)
{
int l = j + totrot[i];
if( l < 56 ) pcr[j] = pc1m[l];
else pcr[j] = pc1m[l - 28];
}
for (j = 0; j < 24; j++)
{
int v= 1<<(23-j);
if( pcr[pc2[j]] ) m_keydata[m] |= v;
if( pcr[pc2[j+24]] ) m_keydata[n] |= v;
}
}
for( i = 0; i < 32; i+=2)
{
unsigned int a = ((m_keydata[i] & 0x00fc0000) << 6) |
((m_keydata[i] & 0x00000fc0) << 10) |
((m_keydata[i+1] & 0x00fc0000) >> 10) |
((m_keydata[i+1] & 0x00000fc0) >> 6);
unsigned int b= ((m_keydata[i] & 0x0003f000) << 12) |
((m_keydata[i] & 0x0000003f) << 16) |
((m_keydata[i+1] & 0x0003f000) >> 4) |
(m_keydata[i+1] & 0x0000003f);
m_keydata[i]=a;
m_keydata[i+1]=b;
}
}
void WDL_DES::Process8(unsigned char *buf8)
{
unsigned int leftt=(buf8[0]<<24)|(buf8[1]<<16)|(buf8[2]<<8)|(buf8[3]);
unsigned int right=(buf8[4]<<24)|(buf8[5]<<16)|(buf8[6]<<8)|(buf8[7]);
unsigned int *keys = m_keydata;
unsigned int fval, work;
int round;
work = ((leftt >> 4) ^ right) & 0x0f0f0f0f;
right ^= work;
leftt ^= (work << 4);
work = ((leftt >> 16) ^ right) & 0x0000ffff;
right ^= work;
leftt ^= (work << 16);
work = ((right >> 2) ^ leftt) & 0x33333333;
leftt ^= work;
right ^= (work << 2);
work = ((right >> 8) ^ leftt) & 0x00ff00ff;
leftt ^= work;
right ^= (work << 8);
right = ((right << 1) | ((right >> 31) & 1)) & 0xffffffff;
work = (leftt ^ right) & 0xaaaaaaaa;
leftt ^= work;
right ^= work;
leftt = ((leftt << 1) | ((leftt >> 31) & 1)) & 0xffffffff;
for (round = 0; round < 8; round++)
{
work = (right << 28) | (right >> 4);
work ^= *keys++;
fval = SP7[ work & 0x3f];
fval |= SP5[(work >> 8) & 0x3f];
fval |= SP3[(work >> 16) & 0x3f];
fval |= SP1[(work >> 24) & 0x3f];
work = right ^ *keys++;
fval |= SP8[ work & 0x3f];
fval |= SP6[(work >> 8) & 0x3f];
fval |= SP4[(work >> 16) & 0x3f];
fval |= SP2[(work >> 24) & 0x3f];
leftt ^= fval;
work = (leftt << 28) | (leftt >> 4);
work ^= *keys++;
fval = SP7[ work & 0x3f];
fval |= SP5[(work >> 8) & 0x3f];
fval |= SP3[(work >> 16) & 0x3f];
fval |= SP1[(work >> 24) & 0x3f];
work = leftt ^ *keys++;
fval |= SP8[ work & 0x3f];
fval |= SP6[(work >> 8) & 0x3f];
fval |= SP4[(work >> 16) & 0x3f];
fval |= SP2[(work >> 24) & 0x3f];
right ^= fval;
}
right = (right << 31) | (right >> 1);
work = (leftt ^ right) & 0xaaaaaaaa;
leftt ^= work;
right ^= work;
leftt = (leftt << 31) | (leftt >> 1);
work = ((leftt >> 8) ^ right) & 0x00ff00ff;
right ^= work;
leftt ^= (work << 8);
work = ((leftt >> 2) ^ right) & 0x33333333;
right ^= work;
leftt ^= (work << 2);
work = ((right >> 16) ^ leftt) & 0x0000ffff;
leftt ^= work;
right ^= (work << 16);
work = ((right >> 4) ^ leftt) & 0x0f0f0f0f;
leftt ^= work;
right ^= (work << 4);
buf8[0] = (right>>24)&0xff;
buf8[1] = (right>>16)&0xff;
buf8[2] = (right>>8)&0xff;
buf8[3] = (right)&0xff;
buf8[4] = (leftt>>24)&0xff;
buf8[5] = (leftt>>16)&0xff;
buf8[6] = (leftt>>8)&0xff;
buf8[7] = (leftt)&0xff;
}
| [
"bereza@gmail.com"
] | bereza@gmail.com |
d5b888972ce49c5f9aa3bd01359c8d8d47103fdf | d44812537d3146b8b39f97d2a69cefe251ac4025 | /src/txdb-leveldb.cpp | 1ad4b514844acdd713adcc42a8c085cdc8562974 | [
"MIT"
] | permissive | LeeTheKing/SmoLCore | 6e818e83a8c8182621b98a248c56c4630d49e550 | 8ebff7bd89a590240e52ad9e7a2568216cd03cf6 | refs/heads/master | 2020-04-17T20:06:59.515775 | 2019-01-21T22:53:19 | 2019-01-21T22:53:19 | 166,891,626 | 0 | 0 | MIT | 2019-01-21T22:53:20 | 2019-01-21T22:52:35 | C++ | UTF-8 | C++ | false | false | 20,856 | cpp | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include <map>
#include <boost/version.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <leveldb/env.h>
#include <leveldb/cache.h>
#include <leveldb/filter_policy.h>
#include <memenv/memenv.h>
#include "kernel.h"
#include "checkpoints.h"
#include "txdb.h"
#include "util.h"
#include "main.h"
using namespace std;
using namespace boost;
leveldb::DB *txdb; // global pointer for LevelDB object instance
static leveldb::Options GetOptions() {
leveldb::Options options;
int nCacheSizeMB = GetArg("-dbcache", 25);
options.block_cache = leveldb::NewLRUCache(nCacheSizeMB * 1048576);
options.filter_policy = leveldb::NewBloomFilterPolicy(10);
return options;
}
void init_blockindex(leveldb::Options& options, bool fRemoveOld = false) {
// First time init.
filesystem::path directory = GetDataDir() / "txleveldb";
if (fRemoveOld) {
filesystem::remove_all(directory); // remove directory
unsigned int nFile = 1;
while (true)
{
filesystem::path strBlockFile = GetDataDir() / strprintf("blk%04u.dat", nFile);
// Break if no such file
if( !filesystem::exists( strBlockFile ) )
break;
filesystem::remove(strBlockFile);
nFile++;
}
}
filesystem::create_directory(directory);
printf("Opening LevelDB in %s\n", directory.string().c_str());
leveldb::Status status = leveldb::DB::Open(options, directory.string(), &txdb);
if (!status.ok()) {
throw runtime_error(strprintf("init_blockindex(): error opening database environment %s", status.ToString().c_str()));
}
}
// CDB subclasses are created and destroyed VERY OFTEN. That's why
// we shouldn't treat this as a free operations.
CTxDB::CTxDB(const char* pszMode)
{
assert(pszMode);
activeBatch = NULL;
fReadOnly = (!strchr(pszMode, '+') && !strchr(pszMode, 'w'));
if (txdb) {
pdb = txdb;
return;
}
bool fCreate = strchr(pszMode, 'c');
options = GetOptions();
options.create_if_missing = fCreate;
options.filter_policy = leveldb::NewBloomFilterPolicy(10);
init_blockindex(options); // Init directory
pdb = txdb;
if (Exists(string("version")))
{
ReadVersion(nVersion);
printf("Transaction index version is %d\n", nVersion);
if (nVersion < DATABASE_VERSION)
{
printf("Required index version is %d, removing old database\n", DATABASE_VERSION);
// Leveldb instance destruction
delete txdb;
txdb = pdb = NULL;
delete activeBatch;
activeBatch = NULL;
init_blockindex(options, true); // Remove directory and create new database
pdb = txdb;
bool fTmp = fReadOnly;
fReadOnly = false;
WriteVersion(DATABASE_VERSION); // Save transaction index version
fReadOnly = fTmp;
}
}
else if (fCreate)
{
bool fTmp = fReadOnly;
fReadOnly = false;
WriteVersion(DATABASE_VERSION);
fReadOnly = fTmp;
}
printf("Opened LevelDB successfully\n");
}
void CTxDB::Close()
{
delete txdb;
txdb = pdb = NULL;
delete options.filter_policy;
options.filter_policy = NULL;
delete options.block_cache;
options.block_cache = NULL;
delete activeBatch;
activeBatch = NULL;
}
bool CTxDB::TxnBegin()
{
assert(!activeBatch);
activeBatch = new leveldb::WriteBatch();
return true;
}
bool CTxDB::TxnCommit()
{
assert(activeBatch);
leveldb::Status status = pdb->Write(leveldb::WriteOptions(), activeBatch);
delete activeBatch;
activeBatch = NULL;
if (!status.ok()) {
printf("LevelDB batch commit failure: %s\n", status.ToString().c_str());
return false;
}
return true;
}
class CBatchScanner : public leveldb::WriteBatch::Handler {
public:
std::string needle;
bool *deleted;
std::string *foundValue;
bool foundEntry;
CBatchScanner() : foundEntry(false) {}
virtual void Put(const leveldb::Slice& key, const leveldb::Slice& value) {
if (key.ToString() == needle) {
foundEntry = true;
*deleted = false;
*foundValue = value.ToString();
}
}
virtual void Delete(const leveldb::Slice& key) {
if (key.ToString() == needle) {
foundEntry = true;
*deleted = true;
}
}
};
// When performing a read, if we have an active batch we need to check it first
// before reading from the database, as the rest of the code assumes that once
// a database transaction begins reads are consistent with it. It would be good
// to change that assumption in future and avoid the performance hit, though in
// practice it does not appear to be large.
bool CTxDB::ScanBatch(const CDataStream &key, string *value, bool *deleted) const {
assert(activeBatch);
*deleted = false;
CBatchScanner scanner;
scanner.needle = key.str();
scanner.deleted = deleted;
scanner.foundValue = value;
leveldb::Status status = activeBatch->Iterate(&scanner);
if (!status.ok()) {
throw runtime_error(status.ToString());
}
return scanner.foundEntry;
}
bool CTxDB::ReadTxIndex(uint256 hash, CTxIndex& txindex)
{
assert(!fClient);
txindex.SetNull();
return Read(make_pair(string("tx"), hash), txindex);
}
bool CTxDB::UpdateTxIndex(uint256 hash, const CTxIndex& txindex)
{
assert(!fClient);
return Write(make_pair(string("tx"), hash), txindex);
}
bool CTxDB::AddTxIndex(const CTransaction& tx, const CDiskTxPos& pos, int nHeight)
{
assert(!fClient);
// Add to tx index
uint256 hash = tx.GetHash();
CTxIndex txindex(pos, tx.vout.size());
return Write(make_pair(string("tx"), hash), txindex);
}
bool CTxDB::EraseTxIndex(const CTransaction& tx)
{
assert(!fClient);
uint256 hash = tx.GetHash();
return Erase(make_pair(string("tx"), hash));
}
bool CTxDB::ContainsTx(uint256 hash)
{
assert(!fClient);
return Exists(make_pair(string("tx"), hash));
}
bool CTxDB::ReadDiskTx(uint256 hash, CTransaction& tx, CTxIndex& txindex)
{
assert(!fClient);
tx.SetNull();
if (!ReadTxIndex(hash, txindex))
return false;
return (tx.ReadFromDisk(txindex.pos));
}
bool CTxDB::ReadDiskTx(uint256 hash, CTransaction& tx)
{
CTxIndex txindex;
return ReadDiskTx(hash, tx, txindex);
}
bool CTxDB::ReadDiskTx(COutPoint outpoint, CTransaction& tx, CTxIndex& txindex)
{
return ReadDiskTx(outpoint.hash, tx, txindex);
}
bool CTxDB::ReadDiskTx(COutPoint outpoint, CTransaction& tx)
{
CTxIndex txindex;
return ReadDiskTx(outpoint.hash, tx, txindex);
}
bool CTxDB::WriteBlockIndex(const CDiskBlockIndex& blockindex)
{
return Write(make_pair(string("blockindex"), blockindex.GetBlockHash()), blockindex);
}
bool CTxDB::ReadHashBestChain(uint256& hashBestChain)
{
return Read(string("hashBestChain"), hashBestChain);
}
bool CTxDB::WriteHashBestChain(uint256 hashBestChain)
{
return Write(string("hashBestChain"), hashBestChain);
}
bool CTxDB::ReadBestInvalidTrust(CBigNum& bnBestInvalidTrust)
{
return Read(string("bnBestInvalidTrust"), bnBestInvalidTrust);
}
bool CTxDB::WriteBestInvalidTrust(CBigNum bnBestInvalidTrust)
{
return Write(string("bnBestInvalidTrust"), bnBestInvalidTrust);
}
bool CTxDB::ReadSyncCheckpoint(uint256& hashCheckpoint)
{
return Read(string("hashSyncCheckpoint"), hashCheckpoint);
}
bool CTxDB::WriteSyncCheckpoint(uint256 hashCheckpoint)
{
return Write(string("hashSyncCheckpoint"), hashCheckpoint);
}
bool CTxDB::ReadCheckpointPubKey(string& strPubKey)
{
return Read(string("strCheckpointPubKey"), strPubKey);
}
bool CTxDB::WriteCheckpointPubKey(const string& strPubKey)
{
return Write(string("strCheckpointPubKey"), strPubKey);
}
static CBlockIndex *InsertBlockIndex(uint256 hash)
{
if (hash == 0)
return NULL;
// Return existing
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
if (mi != mapBlockIndex.end())
return (*mi).second;
// Create new
CBlockIndex* pindexNew = new CBlockIndex();
if (!pindexNew)
throw runtime_error("LoadBlockIndex() : new CBlockIndex failed");
mi = mapBlockIndex.insert(make_pair(hash, pindexNew)).first;
pindexNew->phashBlock = &((*mi).first);
return pindexNew;
}
bool CTxDB::LoadBlockIndex()
{
if (mapBlockIndex.size() > 0) {
// Already loaded once in this session. It can happen during migration
// from BDB.
return true;
}
// The block index is an in-memory structure that maps hashes to on-disk
// locations where the contents of the block can be found. Here, we scan it
// out of the DB and into mapBlockIndex.
leveldb::Iterator *iterator = pdb->NewIterator(leveldb::ReadOptions());
// Seek to start key.
CDataStream ssStartKey(SER_DISK, CLIENT_VERSION);
ssStartKey << make_pair(string("blockindex"), uint256(0));
iterator->Seek(ssStartKey.str());
// Now read each entry.
while (iterator->Valid())
{
// Unpack keys and values.
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
ssKey.write(iterator->key().data(), iterator->key().size());
CDataStream ssValue(SER_DISK, CLIENT_VERSION);
ssValue.write(iterator->value().data(), iterator->value().size());
string strType;
ssKey >> strType;
// Did we reach the end of the data to read?
if (fRequestShutdown || strType != "blockindex")
break;
CDiskBlockIndex diskindex;
ssValue >> diskindex;
uint256 blockHash = diskindex.GetBlockHash();
// Construct block index object
CBlockIndex* pindexNew = InsertBlockIndex(blockHash);
pindexNew->pprev = InsertBlockIndex(diskindex.hashPrev);
pindexNew->pnext = InsertBlockIndex(diskindex.hashNext);
pindexNew->nFile = diskindex.nFile;
pindexNew->nBlockPos = diskindex.nBlockPos;
pindexNew->nHeight = diskindex.nHeight;
pindexNew->nMint = diskindex.nMint;
pindexNew->nMoneySupply = diskindex.nMoneySupply;
pindexNew->nFlags = diskindex.nFlags;
pindexNew->nStakeModifier = diskindex.nStakeModifier;
pindexNew->prevoutStake = diskindex.prevoutStake;
pindexNew->nStakeTime = diskindex.nStakeTime;
pindexNew->hashProof = diskindex.hashProof;
pindexNew->nVersion = diskindex.nVersion;
pindexNew->hashMerkleRoot = diskindex.hashMerkleRoot;
pindexNew->nTime = diskindex.nTime;
pindexNew->nBits = diskindex.nBits;
pindexNew->nNonce = diskindex.nNonce;
// Watch for genesis block
if (pindexGenesisBlock == NULL && blockHash == (!fTestNet ? hashGenesisBlock : hashGenesisBlockTestNet))
pindexGenesisBlock = pindexNew;
if (!pindexNew->CheckIndex()) {
delete iterator;
return error("LoadBlockIndex() : CheckIndex failed at %d", pindexNew->nHeight);
}
// AriA: build setStakeSeen
if (pindexNew->IsProofOfStake())
setStakeSeen.insert(make_pair(pindexNew->prevoutStake, pindexNew->nStakeTime));
iterator->Next();
}
delete iterator;
if (fRequestShutdown)
return true;
// Calculate nChainTrust
vector<pair<int, CBlockIndex*> > vSortedByHeight;
vSortedByHeight.reserve(mapBlockIndex.size());
BOOST_FOREACH(const PAIRTYPE(uint256, CBlockIndex*)& item, mapBlockIndex)
{
CBlockIndex* pindex = item.second;
vSortedByHeight.push_back(make_pair(pindex->nHeight, pindex));
}
sort(vSortedByHeight.begin(), vSortedByHeight.end());
BOOST_FOREACH(const PAIRTYPE(int, CBlockIndex*)& item, vSortedByHeight)
{
CBlockIndex* pindex = item.second;
pindex->nChainTrust = (pindex->pprev ? pindex->pprev->nChainTrust : 0) + pindex->GetBlockTrust();
// AriA: calculate stake modifier checksum
pindex->nStakeModifierChecksum = GetStakeModifierChecksum(pindex);
if (!CheckStakeModifierCheckpoints(pindex->nHeight, pindex->nStakeModifierChecksum))
return error("CTxDB::LoadBlockIndex() : Failed stake modifier checkpoint height=%d, modifier=0x%016"PRIx64, pindex->nHeight, pindex->nStakeModifier);
}
// Load hashBestChain pointer to end of best chain
if (!ReadHashBestChain(hashBestChain))
{
if (pindexGenesisBlock == NULL)
return true;
return error("CTxDB::LoadBlockIndex() : hashBestChain not loaded");
}
if (!mapBlockIndex.count(hashBestChain))
return error("CTxDB::LoadBlockIndex() : hashBestChain not found in the block index");
pindexBest = mapBlockIndex[hashBestChain];
nBestHeight = pindexBest->nHeight;
nBestChainTrust = pindexBest->nChainTrust;
printf("LoadBlockIndex(): hashBestChain=%s height=%d trust=%s date=%s\n",
hashBestChain.ToString().substr(0,20).c_str(), nBestHeight, CBigNum(nBestChainTrust).ToString().c_str(),
DateTimeStrFormat("%x %H:%M:%S", pindexBest->GetBlockTime()).c_str());
// AriA: load hashSyncCheckpoint
if (!ReadSyncCheckpoint(Checkpoints::hashSyncCheckpoint))
return error("CTxDB::LoadBlockIndex() : hashSyncCheckpoint not loaded");
printf("LoadBlockIndex(): synchronized checkpoint %s\n", Checkpoints::hashSyncCheckpoint.ToString().c_str());
// Load bnBestInvalidTrust, OK if it doesn't exist
CBigNum bnBestInvalidTrust;
ReadBestInvalidTrust(bnBestInvalidTrust);
nBestInvalidTrust = bnBestInvalidTrust.getuint256();
// Verify blocks in the best chain
int nCheckLevel = GetArg("-checklevel", 1);
int nCheckDepth = GetArg( "-checkblocks", 2500);
if (nCheckDepth == 0)
nCheckDepth = 1000000000; // suffices until the year 19000
if (nCheckDepth > nBestHeight)
nCheckDepth = nBestHeight;
printf("Verifying last %i blocks at level %i\n", nCheckDepth, nCheckLevel);
CBlockIndex* pindexFork = NULL;
map<pair<unsigned int, unsigned int>, CBlockIndex*> mapBlockPos;
for (CBlockIndex* pindex = pindexBest; pindex && pindex->pprev; pindex = pindex->pprev)
{
if (fRequestShutdown || pindex->nHeight < nBestHeight-nCheckDepth)
break;
CBlock block;
if (!block.ReadFromDisk(pindex))
return error("LoadBlockIndex() : block.ReadFromDisk failed");
// check level 1: verify block validity
// check level 7: verify block signature too
if (nCheckLevel>0 && !block.CheckBlock(true, true, (nCheckLevel>6)))
{
printf("LoadBlockIndex() : *** found bad block at %d, hash=%s\n", pindex->nHeight, pindex->GetBlockHash().ToString().c_str());
pindexFork = pindex->pprev;
}
// check level 2: verify transaction index validity
if (nCheckLevel>1)
{
pair<unsigned int, unsigned int> pos = make_pair(pindex->nFile, pindex->nBlockPos);
mapBlockPos[pos] = pindex;
BOOST_FOREACH(const CTransaction &tx, block.vtx)
{
uint256 hashTx = tx.GetHash();
CTxIndex txindex;
if (ReadTxIndex(hashTx, txindex))
{
// check level 3: checker transaction hashes
if (nCheckLevel>2 || pindex->nFile != txindex.pos.nFile || pindex->nBlockPos != txindex.pos.nBlockPos)
{
// either an error or a duplicate transaction
CTransaction txFound;
if (!txFound.ReadFromDisk(txindex.pos))
{
printf("LoadBlockIndex() : *** cannot read mislocated transaction %s\n", hashTx.ToString().c_str());
pindexFork = pindex->pprev;
}
else
if (txFound.GetHash() != hashTx) // not a duplicate tx
{
printf("LoadBlockIndex(): *** invalid tx position for %s\n", hashTx.ToString().c_str());
pindexFork = pindex->pprev;
}
}
// check level 4: check whether spent txouts were spent within the main chain
unsigned int nOutput = 0;
if (nCheckLevel>3)
{
BOOST_FOREACH(const CDiskTxPos &txpos, txindex.vSpent)
{
if (!txpos.IsNull())
{
pair<unsigned int, unsigned int> posFind = make_pair(txpos.nFile, txpos.nBlockPos);
if (!mapBlockPos.count(posFind))
{
printf("LoadBlockIndex(): *** found bad spend at %d, hashBlock=%s, hashTx=%s\n", pindex->nHeight, pindex->GetBlockHash().ToString().c_str(), hashTx.ToString().c_str());
pindexFork = pindex->pprev;
}
// check level 6: check whether spent txouts were spent by a valid transaction that consume them
if (nCheckLevel>5)
{
CTransaction txSpend;
if (!txSpend.ReadFromDisk(txpos))
{
printf("LoadBlockIndex(): *** cannot read spending transaction of %s:%i from disk\n", hashTx.ToString().c_str(), nOutput);
pindexFork = pindex->pprev;
}
else if (!txSpend.CheckTransaction())
{
printf("LoadBlockIndex(): *** spending transaction of %s:%i is invalid\n", hashTx.ToString().c_str(), nOutput);
pindexFork = pindex->pprev;
}
else
{
bool fFound = false;
BOOST_FOREACH(const CTxIn &txin, txSpend.vin)
if (txin.prevout.hash == hashTx && txin.prevout.n == nOutput)
fFound = true;
if (!fFound)
{
printf("LoadBlockIndex(): *** spending transaction of %s:%i does not spend it\n", hashTx.ToString().c_str(), nOutput);
pindexFork = pindex->pprev;
}
}
}
}
nOutput++;
}
}
}
// check level 5: check whether all prevouts are marked spent
if (nCheckLevel>4)
{
BOOST_FOREACH(const CTxIn &txin, tx.vin)
{
CTxIndex txindex;
if (ReadTxIndex(txin.prevout.hash, txindex))
if (txindex.vSpent.size()-1 < txin.prevout.n || txindex.vSpent[txin.prevout.n].IsNull())
{
printf("LoadBlockIndex(): *** found unspent prevout %s:%i in %s\n", txin.prevout.hash.ToString().c_str(), txin.prevout.n, hashTx.ToString().c_str());
pindexFork = pindex->pprev;
}
}
}
}
}
}
if (pindexFork && !fRequestShutdown)
{
// Reorg back to the fork
printf("LoadBlockIndex() : *** moving best chain pointer back to block %d\n", pindexFork->nHeight);
CBlock block;
if (!block.ReadFromDisk(pindexFork))
return error("LoadBlockIndex() : block.ReadFromDisk failed");
CTxDB txdb;
block.SetBestChain(txdb, pindexFork);
}
return true;
}
| [
"otakugroup2015@gmail.com"
] | otakugroup2015@gmail.com |
bd43492cfb0bbbda6b89a6a5441f6de004c047ce | c1d30885a74ab948d6c87ef6c5015d5af9954c8a | /portableImage/src/pnm/pnm.h | 9f87c1e181c246738a253fcd1bf40ee6258c5859 | [] | no_license | shengxiaoyi1993/cpp | 061936256060846ccfaa245575002e5de21a932e | 3fe67bac4a7f6332ed0599bebb44cf9332d2b15e | refs/heads/master | 2021-11-04T21:15:11.477762 | 2021-10-21T11:55:36 | 2021-10-21T11:55:36 | 225,620,682 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 5,333 | h | #ifndef PNM_H
#define PNM_H
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class PNM
{
//===================declare=====================//
public:
//the type of image PNM standard constains
//1. divide by the form of data when saved in file ,ASCII or Binary
// and the DataType it constains,binary,gray or rgb
// MagicNumber_none:contain nothing
// MagicNumber_p1:ASCII binary
// MagicNumber_p2:ASCII gray
// MagicNumber_p3:ASCII rgb
// MagicNumber_p4:Binary binary
// MagicNumber_p5:Binary gray
// MagicNumber_p6:Binary rgb
enum MagicNumber{
MagicNumber_none=0,
MagicNumber_p1,
MagicNumber_p2,
MagicNumber_p3,
MagicNumber_p4,
MagicNumber_p5,
MagicNumber_p6
};
//the type of data how data from image is saved in buffer of this class
//1. used when save to local file
//2. can be got from MagicNumber
// DataType_binary:MagicNumber_p1 MagicNumber_p4 1 channels
// DataType_gray:MagicNumber_p2 MagicNumber_p5 1 channels
// DataType_rgb:MagicNumber_p3 MagicNumber_p6 3 channels
enum DataType{
DataType_binary=1,
DataType_gray,
DataType_rgb
};
//================member data===================//
//the type of PNM image
//channels can be got from it
MagicNumber _magic_number;
unsigned int _width;
unsigned int _height;
//value range of pix, it is supposed to be (2^bits-1)
unsigned short _range;
//data of pixes
//size _width*_width*channels
unsigned short* _data;
//===================func====================//
public:
/**
* [PNM constructor of class]
* 1. initailize the class,load data from local file
* 2. all params will be initailized,otherwise an exception will be thrown out
* @param v_filepath [path of file]
* @return none
*/
explicit PNM(const string & v_filepath);
~PNM();
/**
* @brief saveToFile support to save to P4/P5/P6
* @param v_filepath path of target image
* @param v_type
* @param v_range_dst value range of pix, it is supposed to be (2^bits-1)
* @return
*/
int saveToFile(const string & v_filepath,MagicNumber v_type,unsigned int v_range_dst) const;
/**
* [saveDataToFile to save the data to local file without instantiation ]
* @param v_filepath path of target image
* @param v_type_src the DataType of data,DataType_binary is not supported
* @param v_type_dst the form of target image,MagicNumber_p5/MagicNumber_p6 is supported
* @param v_pdata data,size = _width*_height*channels(v_type_src)
* DataType_gray and DataType_binary has 1 channel
* DataType_rgb has 3 channels
* @param _width width of image of v_pdata
* @param _height height of image of v_pdata
* @param v_range_dst v_range_dst value range of pix, it is supposed to be (2^bits-1)
* @return 0:succeed;otherwise fail
*/
static int saveDataToFile(const string & v_filepath,
DataType v_type_src,
MagicNumber v_type_dst,
unsigned short * v_pdata,
unsigned int _width,
unsigned int _height,
unsigned int v_range_dst
);
//tool function to display the params of class
static void print(const PNM & v_pnm);
void print() const;
private:
static const vector<char> _list_writespace;
static const vector<char> _list_nextline;
static const vector<string> _list_magic_number;
/**
* [getHeadInfo to get the head info]
* @param v_str data load from local file
* @return [description]
*/
int getHeadInfo(const string& v_str);
//to convert data from file from data to buffer in class
//only support P5/P6
int loadData(const string & v_pdata, MagicNumber v_type);
//to load data from file
int loadFromFile(const string & v_filepath);
public:
//to from the head of image
//save to a string
static string formHeadString( MagicNumber v_type,
unsigned int _width,
unsigned int _height,
unsigned int _bits);
static string formHeadStringWithoutRange( MagicNumber v_type,
unsigned int v_width,
unsigned int v_height);
//to judge if this string is a integer
static bool isInteger(const string & v_str) ;
//convert string to integer
static int integerFromString(const string& v_str) ;
//to convert interger to a string
static string stringFromNumber(int v_num);
//to get the a base-2 logarithm of v_num,result is a integer
// e.g.: 255 8
// 1023 10
static int getLogOf2(unsigned v_num);
//to convert Uint8 to uint16
static unsigned short uint16FromUint8(unsigned char v_val);
/**
* [isWhitespace judge if char is writespace or not]
* ascii Code of blanks(0x20), TABs(0x09), CRs(0x0D), LFs(0x0A),#(0x23)
* @param v_ch
* @return true:char is writespace;false: not
*/
static bool isWhitespace(char v_ch) ;
/**
* [isNextline judge if char is LFs(0x0A)]
* @param v_ch [description]
* @return true:char is Nextline;false: not
*/
static bool isNextline(char v_ch) ;
};
#endif // PNM_H
| [
"sxy@localhost.localdomain"
] | sxy@localhost.localdomain |
69cb2f720d5b597a51fd188c8cd712929fecc9d4 | 4dbaab82527acff85c484c312b372ce6aed5b184 | /Broken Engine/Source/PhysX_3.4/Include/cooking/PxConvexMeshDesc.h | 1fe9148cedaf5f6c6ff24612b21c5cdaf52c82fc | [
"MIT",
"Zlib"
] | permissive | Broken-Gem-Studio/Broken-Engine | 6103ddfbe116465a432aed1b931a9226723c1af9 | 71a261bbaaef80b27a9da94f4737fd480caf6e0d | refs/heads/development | 2021-01-08T05:19:07.714253 | 2020-06-15T10:04:56 | 2020-06-15T10:04:56 | 241,921,076 | 5 | 0 | MIT | 2020-06-15T22:25:53 | 2020-02-20T15:36:23 | C++ | UTF-8 | C++ | false | false | 9,872 | h | //
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of NVIDIA CORPORATION nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved.
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
#ifndef PX_COLLISION_NXCONVEXMESHDESC
#define PX_COLLISION_NXCONVEXMESHDESC
/** \addtogroup cooking
@{
*/
#include "foundation/PxVec3.h"
#include "foundation/PxFlags.h"
#include "common/PxCoreUtilityTypes.h"
#include "geometry/PxConvexMesh.h"
#if !PX_DOXYGEN
namespace physx
{
#endif
/**
\brief Flags which describe the format and behavior of a convex mesh.
*/
struct PxConvexFlag
{
enum Enum
{
/**
Denotes the use of 16-bit vertex indices in PxConvexMeshDesc::triangles or PxConvexMeshDesc::polygons.
(otherwise, 32-bit indices are assumed)
@see #PxConvexMeshDesc.indices
*/
e16_BIT_INDICES = (1<<0),
/**
Automatically recomputes the hull from the vertices. If this flag is not set, you must provide the entire geometry manually.
\note There are two different algorithms for hull computation, please see PxConvexMeshCookingType.
@see PxConvexMeshCookingType
*/
eCOMPUTE_CONVEX = (1<<1),
/**
\brief Checks and removes almost zero-area triangles during convex hull computation.
The rejected area size is specified in PxCookingParams::areaTestEpsilon
\note This flag is only used in combination with eCOMPUTE_CONVEX.
\note If this flag is used in combination with eINFLATE_CONVEX, the newly added triangles
by the inflation algorithm are not checked (size of the triangles depends on PxCooking::skinWidth).
@see PxCookingParams PxCookingParams::areaTestEpsilon
*/
eCHECK_ZERO_AREA_TRIANGLES = (1<<2),
/**
\brief Inflates the convex points according to skin width.
\note eINFLATE_CONVEX flag has been deprecated. The flag is automatically used when
PxConvexMeshCookingType::eINFLATION_INCREMENTAL_HULL is set. The default algorithm
PxConvexMeshCookingType::eQUICK_HULL ignores this flag, inflation is not used.
@see PxCookingParams PxConvexMeshCookingType
*/
PX_DEPRECATED eINFLATE_CONVEX = (1<<3),
/**
\brief Quantizes the input vertices using the k-means clustering
\note The input vertices are quantized to PxConvexMeshDesc::quantizedCount
see http://en.wikipedia.org/wiki/K-means_clustering
*/
eQUANTIZE_INPUT = (1 << 4),
/**
\brief Disables the convex mesh validation to speed-up hull creation. Please use separate validation
function in checked/debug builds. Creating a convex mesh with invalid input data without prior validation
may result in undefined behavior.
@see PxCooking::validateConvexMesh
*/
eDISABLE_MESH_VALIDATION = (1 << 5),
/**
\brief Enables plane shifting vertex limit algorithm.
Plane shifting is an alternative algorithm for the case when the computed hull has more vertices
than the specified vertex limit.
The default algorithm computes the full hull, and an OBB around the input vertices. This OBB is then sliced
with the hull planes until the vertex limit is reached.The default algorithm requires the vertex limit
to be set to at least 8, and typically produces results that are much better quality than are produced
by plane shifting.
When plane shifting is enabled, the hull computation stops when vertex limit is reached. The hull planes
are then shifted to contain all input vertices, and the new plane intersection points are then used to
generate the final hull with the given vertex limit.Plane shifting may produce sharp edges to vertices
very far away from the input cloud, and does not guarantee that all input vertices are inside the resulting
hull.However, it can be used with a vertex limit as low as 4.
*/
ePLANE_SHIFTING = (1 << 6),
/**
\brief Inertia tensor computation is faster using SIMD code, but the precision is lower, which may result
in incorrect inertia for very thin hulls.
*/
eFAST_INERTIA_COMPUTATION = (1 << 7),
/**
\brief Convex hulls are created with respect to GPU simulation limitations. Vertex limit is set to 64 and
vertex limit per face is internally set to 32.
\note Can be used only with eCOMPUTE_CONVEX flag.
*/
eGPU_COMPATIBLE = (1 << 8),
/**
\brief Convex hull input vertices are shifted to be around origin to provide better computation stability.
It is recommended to provide input vertices around the origin, otherwise use this flag to improve
numerical stability.
\note Is used only with eCOMPUTE_CONVEX flag.
*/
eSHIFT_VERTICES = (1 << 9)
};
};
/**
\brief collection of set bits defined in PxConvexFlag.
@see PxConvexFlag
*/
typedef PxFlags<PxConvexFlag::Enum,PxU16> PxConvexFlags;
PX_FLAGS_OPERATORS(PxConvexFlag::Enum,PxU16)
/**
\brief Descriptor class for #PxConvexMesh.
\note The number of vertices and the number of convex polygons in a cooked convex mesh is limited to 256.
@see PxConvexMesh PxConvexMeshGeometry PxShape PxPhysics.createConvexMesh()
*/
class PxConvexMeshDesc
{
public:
/**
\brief Vertex positions data in PxBoundedData format.
<b>Default:</b> NULL
*/
PxBoundedData points;
/**
\brief Polygons data in PxBoundedData format.
<p>Pointer to first polygon. </p>
<b>Default:</b> NULL
@see PxHullPolygon
*/
PxBoundedData polygons;
/**
\brief Polygon indices data in PxBoundedData format.
<p>Pointer to first index.</p>
<b>Default:</b> NULL
<p>This is declared as a void pointer because it is actually either an PxU16 or a PxU32 pointer.</p>
@see PxHullPolygon PxConvexFlag::e16_BIT_INDICES
*/
PxBoundedData indices;
/**
\brief Flags bits, combined from values of the enum ::PxConvexFlag
<b>Default:</b> 0
*/
PxConvexFlags flags;
/**
\brief Limits the number of vertices of the result convex mesh. Hard maximum limit is 256
and minimum limit is 4 if PxConvexFlag::ePLANE_SHIFTING is used, otherwise the minimum
limit is 8.
\note Vertex limit is only used when PxConvexFlag::eCOMPUTE_CONVEX is specified.
\note The please see PxConvexFlag::ePLANE_SHIFTING for algorithm explanation
@see PxConvexFlag::ePLANE_SHIFTING
<b>Range:</b> [4, 255]<br>
<b>Default:</b> 255
*/
PxU16 vertexLimit;
/**
\brief Maximum number of vertices after quantization. The quantization is done during the vertex cleaning phase.
The quantization is applied when PxConvexFlag::eQUANTIZE_INPUT is specified.
@see PxConvexFlag::eQUANTIZE_INPUT
<b>Range:</b> [4, 65535]<br>
<b>Default:</b> 255
*/
PxU16 quantizedCount;
/**
\brief constructor sets to default.
*/
PX_INLINE PxConvexMeshDesc();
/**
\brief (re)sets the structure to the default.
*/
PX_INLINE void setToDefault();
/**
\brief Returns true if the descriptor is valid.
\return True if the current settings are valid
*/
PX_INLINE bool isValid() const;
};
PX_INLINE PxConvexMeshDesc::PxConvexMeshDesc() //constructor sets to default
: vertexLimit(255), quantizedCount(255)
{
}
PX_INLINE void PxConvexMeshDesc::setToDefault()
{
*this = PxConvexMeshDesc();
}
PX_INLINE bool PxConvexMeshDesc::isValid() const
{
// Check geometry
if(points.count < 3 || //at least 1 trig's worth of points
(points.count > 0xffff && flags & PxConvexFlag::e16_BIT_INDICES))
return false;
if(!points.data)
return false;
if(points.stride < sizeof(PxVec3)) //should be at least one point's worth of data
return false;
if (quantizedCount < 4)
return false;
// Check topology
if(polygons.data)
{
if(polygons.count < 4) // we require 2 neighbors for each vertex - 4 polygons at least
return false;
if(!indices.data) // indices must be provided together with polygons
return false;
PxU32 limit = (flags & PxConvexFlag::e16_BIT_INDICES) ? sizeof(PxU16) : sizeof(PxU32);
if(indices.stride < limit)
return false;
limit = sizeof(PxHullPolygon);
if(polygons.stride < limit)
return false;
}
else
{
// We can compute the hull from the vertices
if(!(flags & PxConvexFlag::eCOMPUTE_CONVEX))
return false; // If the mesh is convex and we're not allowed to compute the hull,
// you have to provide it completely (geometry & topology).
}
if((flags & PxConvexFlag::ePLANE_SHIFTING) && vertexLimit < 4)
{
return false;
}
if (!(flags & PxConvexFlag::ePLANE_SHIFTING) && vertexLimit < 8)
{
return false;
}
if(vertexLimit > 256)
{
return false;
}
return true;
}
#if !PX_DOXYGEN
} // namespace physx
#endif
/** @} */
#endif
| [
"36189245+ofaura@users.noreply.github.com"
] | 36189245+ofaura@users.noreply.github.com |
012323dbbe65558ba6afda0d3418e0f50e63d07e | af0ecafb5428bd556d49575da2a72f6f80d3d14b | /CodeJamCrawler/dataset/09_20269_43.cpp | 5113b78458a274e7033818ee7af0f2fd666c292c | [] | no_license | gbrlas/AVSP | 0a2a08be5661c1b4a2238e875b6cdc88b4ee0997 | e259090bf282694676b2568023745f9ffb6d73fd | refs/heads/master | 2021-06-16T22:25:41.585830 | 2017-06-09T06:32:01 | 2017-06-09T06:32:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,904 | cpp | #include <stdio.h>
#include <stdlib.h>
int main(){
int L,D,N;
char ch;
scanf("%d%d%d",&L,&D,&N);
scanf("%c",&ch);
int i,j;
char A[D][L];
for(i=0;i<D;i++){
for(j=0;j<L;j++){
scanf("%c",&A[i][j]);
// printf("%c",A[i][j]);
}
scanf("%c",&ch);
// printf("\n");
}
int n;
for(n=0;n<N;n++){
scanf("%c",&ch);
char flags[D];
for(i=0;i<D;i++) flags[i] = 1;
int tot = D;
int j = 0;
int continue_fg = 0;
while( ch != '\n' && ch!=EOF ){
// printf("%c",ch);
if(ch == '('){
scanf("%c",&ch);
while( ch != ')'){
for(i=0;i<D;i++)
if( flags[i] == 1 | flags[i] == 3 )
if( A[i][j] == ch ){
// printf(" twiced @ %d,%d with A[%d][%d] = %c\n",i,j,i,j, A[i][j]);
flags[i] = 2;
}
scanf("%c",&ch);
}
for(i=0;i<D;i++){
if( flags[i] == 1 | flags[i] == 3 ){
// printf(" flag[%d] or zeroed @ j=%d \n",i,j);
flags[i] = 0;
if( --tot == 0 ) {
continue_fg = 1;
break;
}
}
else if( flags[i] == 2 ) flags[i] = 3;
}
}
else{
for(i=0;i<D;i++){
if( flags[i] > 0)
if( A[i][j] != ch ){
// printf(" zeroed @ %d,%d with A[%d][%d] = %c\n",i,j,i,j, A[i][j]);
flags[i] = 0;
if( --tot == 0 ) {
continue_fg = 1;
break;
}
}
}
}
j++;
scanf("%c",&ch);
if( continue_fg ) break;
}
if( continue_fg ) while( ch != '\n' && ch != EOF ) scanf("%c",&ch);
// printf("\n\nflags -> [ ");
// int tot = 0;
// for(i=0;i<D;i++){
// printf("%d ",flags[i] );
// if( flags[i] ) tot++;
// }
// printf("]\n\n-----------------------------------------------------------------\n");
printf("Case #%d: %d\n",n+1,tot);
}
return 0;
}
| [
"nikola.mrzljak@fer.hr"
] | nikola.mrzljak@fer.hr |
d78936adf3a488ae3b40ba41547a419ee50db45e | f428c1ebf0f9ac4c1dfb595f3b2a6f7c00782645 | /Zom-Bik/main_Page.cpp | a835f4b23308596fb98dce6143321bd21bd9a9f1 | [] | no_license | ikbalkazanc/word-guess-game | 04af5a7e5a2719fbcd2e71ab44f6b770df94279d | 11b281d31deb1568a0277d0e8cbc6e1f0ed728e6 | refs/heads/master | 2021-03-10T02:19:50.320761 | 2020-08-05T09:25:55 | 2020-08-05T09:25:55 | 246,407,468 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 348 | cpp | #include "main_Page.h"
#include "game_Page.h"
using namespace System;
using namespace System::Windows::Forms;
//using namespace std;
[STAThread]
int main() {
setlocale(LC_ALL, "Turkish");
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
ZomBik::main_Page form;
Application::Run(%form);
return 0;
} | [
"60016655+ikbalkazanc@users.noreply.github.com"
] | 60016655+ikbalkazanc@users.noreply.github.com |
f2ff7943818bb3d82a8f67fca7ebe05b1af5bd7b | 94c1fd9b9f84f404785d69eded5df3108e651b8b | /PressF/src/Transform.cpp | ada5a9009df5205b78688c9d4f2ff15063b11479 | [] | no_license | adrianjmejias/GPU-Raytracing | d5e7d0049652334dcaae44ccc23c71008d885d3e | dc3c7aaf3deefdde1185f9939692413df47183ae | refs/heads/master | 2022-12-21T04:44:10.467702 | 2019-10-19T15:17:18 | 2019-10-19T15:17:18 | 296,064,131 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,233 | cpp | #include "types.h"
#include "Transform.h"
Vec3 Transform::WorldFront() {
return Vec3{ 0,0,1 };
}
Vec3 Transform::WorldRight() {
return Vec3{ 1,0,0 };
}
Vec3 Transform::WorldUp() {
return Vec3{ 0,1,0 };
}
Vec3 Transform::RotatePoint(Vec3 point, Vec3 rotation) {
return RotatePoint(point, GenRotMat(rotation));
}
Vec3 Transform::RotatePoint(Vec3 point, Mat4 rotation) {
return rotation * Vec4(point, 1);
}
bool Transform::TryGetClean()
{
if (dirty == Dirty::None) return false;
//PF_INFO("Cleaned {0}/ pos/ rot/scale, front, right,up", gameobject.name);
//std::cout << position << " " << rotation << " " << scale << std::endl;
//std::cout << front << " " << right << " " << up << std::endl;
if (dirty == Dirty::Model) {
rotMat = Transform::GenRotMat(rotation);
up = RotatePoint(WorldUp(), rotMat);
right = RotatePoint(WorldRight(), rotMat);
front = RotatePoint(WorldFront(), rotMat);
up = glm::normalize(up);
right = glm::normalize(right);
front = glm::normalize(front);
if (parent) {
const Mat4& parentRot = parent->rotMat;
up = RotatePoint(up, parentRot);
right = RotatePoint(right, parentRot);
front = RotatePoint(front, parentRot);
up = glm::normalize(up);
right = glm::normalize(right);
front = glm::normalize(front);
}
model = Transform::GenModel(scale, position, rotMat);
dirty = Dirty::Acum; // IMPORTANTEEEEEE SINO LOS HIJOS NO SE ACTUALIZAN y yo no me actualizo bien
}
if (dirty == Dirty::Acum) {
if (parent == nullptr) {
acum = model;
}
else
{
acum = parent->GetAccumulated() * model;
}
for (auto child : children) {
PF_ASSERT(child && "you shouldn't have a null child");
child->SetDirty(Dirty::Acum);
}
}
dirty = Dirty::None;
return true;
}
Transform * Transform::SetDirty(Dirty newVal) {
if (static_cast<int>(dirty) < static_cast<int>(newVal)) {
dirty = newVal;
}
return this;
}
Mat4 Transform::GenModel(const Vec3 & scale, const Vec3 & position, const Vec3 & rotation) {
return Transform::GenModel(scale, position, GenRotMat(rotation));
}
Mat4 Transform::GenModel(const Vec3 & scale, const Vec3 & position, const Mat4 & rotation) {
return glm::translate(Mat4(1), position) * rotation * glm::scale(Mat4(1), scale);
}
Mat4 Transform::GenRotMat(const Vec3 & rotation) {
Mat4 rot = Mat4(1);
rot = glm::rotate(rot, glm::radians(rotation.x), Vec3(1, 0, 0));
rot = glm::rotate(rot, glm::radians(rotation.y), Vec3(0, 1, 0));
rot = glm::rotate(rot, glm::radians(rotation.z), Vec3(0, 0, 1));
return rot;
}
Mat4 Transform::GetProjection(const Transform & t, bool isPerspective, float aspectRatio) {
if (isPerspective) {
return glm::perspective(glm::radians(45.f), aspectRatio, 0.1f, 300.0f);
}
else
{
const float sides = 20.f;
return glm::ortho(-sides, sides, -sides, sides, 1.f, 600.f);
}
}
Mat4 Transform::GetView(const Transform & t) {
return glm::lookAt(t.position, t.position + t.front, t.up);
}
Transform::Transform(GameObject & go) : gameObject(go) {
}
Transform::~Transform()
{
}
Transform & Transform::SetParent(Transform * other) {
if (!other) {
// poner como root node porque estoy es quitando el padre
throw std::exception("Not implemented yet");
return *this;
}
if (parent == other) {
return *this; // it is done already
}
if (other->parent == this) {
throw std::exception("CICLO INFINITO POR GAFO EN LA JERARQA\n");
}
//ponerme a mi de padre
SetDirty(Dirty::Acum);
parent = other; // el es mi padre
other->children.push_back(this);// yo soy su hijo
return *this;
}
const Mat4 & Transform::GetAccumulated() {
TryGetClean();
return acum;
}
const Mat4 & Transform::GetModel() {
TryGetClean();
return model;
}
const Vec3 & Transform::GetRotation() { return rotation; }
const Vec3 & Transform::GetScale() { return scale; }
const Vec3 & Transform::GetPosition() { return position; }
Transform & Transform::SetRotation(const Vec3 & val) {
SetDirty(Dirty::Model);
rotation = val;
rotation = glm::mod(val, 360.0f);
return *this;
}
Transform & Transform::SetScale(const Vec3 & val) { SetDirty(Dirty::Model); scale = val; return *this; }
Transform & Transform::SetPosition(const Vec3 & val) { SetDirty(Dirty::Model); position = val; return *this; }
Transform & Transform::SetRotation(float x, float y, float z) { return SetRotation(Vec3(x, y, z)); }
Transform & Transform::SetScale(float x, float y, float z) { return SetScale(Vec3(x, y, z)); }
Transform & Transform::SetPosition(float x, float y, float z) { return SetPosition(Vec3(x, y, z)); }
Transform & Transform::Translate(const Vec3 & val) { return SetPosition(position + val); }
Transform & Transform::Rotate(const Vec3 & val) { return SetRotation(rotation + val); }
Transform & Transform::Scale(const Vec3 & val) { return SetScale(scale + val); }
Transform & Transform::Translate(float x, float y, float z) { return Translate(Vec3(x, y, z)); }
Transform & Transform::Rotate(float x, float y, float z) { return Rotate(Vec3(x, y, z)); }
Transform & Transform::Scale(float x, float y, float z) { return Scale(Vec3(x, y, z)); }
const Vec3 & Transform::Front() { return front; }
const Vec3 & Transform::Right() { return right; }
const Vec3 & Transform::Up() { return up; }
| [
"adrianjmejias@gmail.com"
] | adrianjmejias@gmail.com |
b9e5572fbf78dbcdd154d829bd2b45ff5fa29fe0 | 4eb0a42a61058ac880b0ccbf4aca6fe5c580e1a6 | /GameOfLife/GridState.h | ff090cfb6b2acf8d2a4226b52d1a2424e17b21b8 | [] | no_license | dheller1/gol | c4b0305ff097b948dc793670436c7807a98b9688 | 48c84913ee7b9140dd4cab56dad962b867958b81 | refs/heads/master | 2020-04-11T16:56:12.693590 | 2018-12-15T20:39:22 | 2018-12-15T20:39:22 | 161,942,073 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 495 | h | #pragma once
#include <set>
#include <GL/freeglut.h>
#include "util.h"
class GridRenderer;
class GridState
{
public:
using CellSet = std::set<Coords>;
GridState();
bool isAlive(const Coords& cell) const;
void setRenderer(GridRenderer* renderer);
void iterate();
static void render();
static void reshape(GLsizei width, GLsizei height);
static void iterate_current(int value);
private:
GridRenderer* m_renderer;
CellSet m_aliveCells;
static GridState* g_renderedState;
};
| [
"dominik.heller1@gmail.com"
] | dominik.heller1@gmail.com |
89c7848c51d3510f56d960a921444bf53240da5f | ae33344a3ef74613c440bc5df0c585102d403b3b | /SDK/SOT_sailslivery_bilgerat_01_v02_CutomizationDesc_classes.hpp | 54ab5f1d25690651183b6d53499d8388c141e90e | [] | no_license | ThePotato97/SoT-SDK | bd2d253e811359a429bd8cf0f5dfff73b25cecd9 | d1ff6182a2d09ca20e9e02476e5cb618e57726d3 | refs/heads/master | 2020-03-08T00:48:37.178980 | 2018-03-30T12:23:36 | 2018-03-30T12:23:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 822 | hpp | #pragma once
// SOT: Sea of Thieves (1.0) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x4)
#endif
namespace SDK
{
//---------------------------------------------------------------------------
//Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass sailslivery_bilgerat_01_v02_CutomizationDesc.sailslivery_bilgerat_01_v02_CutomizationDesc_C
// 0x0000 (0x00C8 - 0x00C8)
class Usailslivery_bilgerat_01_v02_CutomizationDesc_C : public UShipCustomizationDesc
{
public:
static UClass* StaticClass()
{
static UClass* ptr = 0;
if(ptr == 0) { ptr = UObject::FindClass(_xor_("BlueprintGeneratedClass sailslivery_bilgerat_01_v02_CutomizationDesc.sailslivery_bilgerat_01_v02_CutomizationDesc_C")); }
return ptr;
}
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"antoniohermano@gmail.com"
] | antoniohermano@gmail.com |
b889117a2a70d9a1432a18c92bdcbcb5ca2fb37c | 7d276a2575c9d7097c3d007b88b593f7c1e4a300 | /src/qt/adrenalinenodeconfigdialog.h | 3db05f3088c4096a11e930ae952c54226cc94d39 | [
"MIT"
] | permissive | supervortex/vortex | ebc9b32bcbc5ceb14c513dbb17b56581949f9224 | 03bd27e2ba140ac9d5e5d8fb296152c7afc32713 | refs/heads/master | 2020-03-25T18:38:14.427641 | 2018-08-14T12:05:12 | 2018-08-14T12:05:12 | 144,041,492 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 598 | h | #ifndef ADRENALINENODECONFIGDIALOG_H
#define ADRENALINENODECONFIGDIALOG_H
#include <QDialog>
namespace Ui {
class AdrenalineNodeConfigDialog;
}
QT_BEGIN_NAMESPACE
class QModelIndex;
QT_END_NAMESPACE
/** Dialog showing transaction details. */
class AdrenalineNodeConfigDialog : public QDialog
{
Q_OBJECT
public:
explicit AdrenalineNodeConfigDialog(QWidget *parent = 0, QString nodeAddress = "123.456.789.123:30000", QString privkey="MASTERNODEPRIVKEY");
~AdrenalineNodeConfigDialog();
private:
Ui::AdrenalineNodeConfigDialog *ui;
};
#endif // ADRENALINENODECONFIGDIALOG_H
| [
"you@example.com"
] | you@example.com |
7c662b6ab597a8e99309d9cdedce6a0112d99620 | c05febfa59e9c041a98574f89d019bc82b709a40 | /algorithm-Test.cpp | 33cb49b0527956f4a84333fd963c04d94fa70a18 | [] | no_license | xiaoerbuyu456/algorithm | 63c302b5d073089fba6696a78c41b84987a11420 | adbcfdd9c0889872a3a49da869776408cbda7068 | refs/heads/master | 2020-05-16T16:36:33.688088 | 2019-09-11T01:40:44 | 2019-09-11T01:40:44 | 183,167,124 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,745 | cpp |
#include "pch.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include "student.h"
#include "sorttesthelper.h"
#include "algorithm.h"
#include <string>
#include <time.h>
using namespace std;
template<typename T>
class A
{
private:
//归并排序
void merge(T &arr[], int l, int mid, int r)
{
//int*aux=new int[r-l+1]();
T aux[r - l + 1];
for (int i = 0; i < r - l; i++)
{
aux[i] = arr[i];
}
int i = l, j = mid + 1;
for (int k = 0; k < r - l; k++)
{
if (i > mid)
{
aux[k] = arr[j];
j++;
}
else if (j > r)
{
aux[k] = arr[i];
i++;
}
else if (arr[i] > arr[j])
{
aux[k] = arr[j];
j++;
}
else
{
aux[k] = arr[i];
i++;
}
}
}
public:
void mergesort(T &arr[], int l, int r)
{
if (l >= r)
return;
int mid = (r + l) / 2;
mergesort(arr, l, mid);
mergesort(arr, mid + 1, r);
merge(arr, l, mid, r);
}
};
int main()
{
int arr[]{ 2,5,4,6,3 };
/*int[] arr = new int[](){3,4,5,6,7};*/
A<int> b;
b.mergesort(arr, 0, 5);
return 0;
//int m = 10000;
//int*arr1 = sorttesthelper::generaterandomarray(m, 0, m);
//sortalgorithm::quicksort(arr1, m);
//sorttesthelper::isSorted(arr1, m);
//sorttesthelper::printf(arr1, m);
//sorttesthelper::testsort("arr1的插入排序", sortalgorithm::quicksort, arr1, m);
////归并排序
////int c = 100;
////int *arr2 = sorttesthelper::generaterandomarray(c, 0, c);
////sortalgorithm::__merge(arr2, 0,(0+c)/2, c);
////sortalgorithm::mergesort(arr2, c);
////sorttesthelper::isSorted(arr2, c);
////sorttesthelper::testsort("归并排序:", sortalgorithm::mergesort, arr2, c);
////sorttesthelper::printf(arr2, c);
//delete[] arr1;
//delete[] arr2;
// MaxHeap<int> maxheap = MaxHeap<int>(100);
//MaxHeap<int> maxheap(100);
//cout << maxheap.size() << endl;
//srand(time(NULL));
//for (int i = 0; i < 50; i++)
// maxheap.insert(rand() % 100);
//maxheap.testPrint();
//while (!maxheap.isempty())
// cout << maxheap.exteactMax() << " ";
//cout << endl;
//return 0;
}
//student.h文件中类型的初始化方法
//student d[4] = { {"D",90},{"C",100},{"B",95},{"A",95} };
//selectionsort(d, 4);
//sorttesthelper::printf(d, 4);
//int b[10];
//////选择排序1
/* for (i = 0; i < 10; i++)
{
for (j = i+1; j < 10; j++)
{
if (a[i] > a[j])
{
tamp = a[i];
a[i] = a[j];
a[j] = tamp;
}
//cout << a[i] << endl;
}
//cout << a[i];
// cout << a[j];
}
cout << endl;*/
/*//选择排序2(利用数组下角标)
for (i = 0; i < 10; i++)
{
int min;
min = i;
for (j = i + 1; j < 10; j++)
{
if (a[i] > a[j])
{
min = j;
tamp = a[i];
a[i] = a[min];
a[min] = tamp;
}
}
}*/
//选择排序(利用c++中的容器和迭代器)
//vector <int> arr = { 3,5,2,6,1,9,4,7,8 };
//if (arr.empty != 0)
//{
// cout << "arr.empty检测成功" << endl;
//}
////使用for对容器进行遍历
//for (auto vel : arr)
//{
// cout << vel << endl;
//}
//vector<int>::iterator pos;//定义一个名为POS的变量
//vector<int>::iterator pos1=arr.begin;//定义POS1使他指向arr的第一个元素
//vector<int>::iterator pos2 = arr.end;//定义POS2使他指向arr的最后+1个元素
//if (pos1 != pos2)
//{
// for (pos1; pos1 != pos2; pos1++)
// {
// for (pos1 + 1; pos1 != pos2; pos1++)
// {
// if (pos1 > pos1 + 1)
// {
// pos = pos1;
// pos1 = pos2;
// pos2 = pos;
// }
// }
// }
//}
//for (auto vel : arr)
//{
// cout<<vel<<endl;
//} | [
"noreply@github.com"
] | noreply@github.com |
7ee6c89095c18efc34bcb9da23b57ed83fc13e8e | ee53b0262007b2f0db0fe15b2ad85f65fafa4e25 | /Leetcode/923. 3Sum With Multiplicity.cpp | a9ee11e0039559a32b21afb932811e6159431674 | [] | no_license | xiaohuanlin/Algorithms | bd48caacb08295fc5756acdac609be78e143a760 | 157cbaeeff74130e5105e58a6b4cdf66403a8a6f | refs/heads/master | 2023-08-09T05:18:06.221485 | 2023-08-08T11:53:15 | 2023-08-08T11:53:15 | 131,491,056 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,363 | cpp | #include <vector>
#include <unordered_map>
#include <algorithm>
#include <iostream>
#include <tuple>
#include <assert.h>
using namespace std;
// Given an integer array arr, and an integer target, return the number of tuples i, j, k such that i < j < k and arr[i] + arr[j] + arr[k] == target.
// As the answer can be very large, return it modulo 109 + 7.
// Example 1:
// Input: arr = [1,1,2,2,3,3,4,4,5,5], target = 8
// Output: 20
// Explanation:
// Enumerating by the values (arr[i], arr[j], arr[k]):
// (1, 2, 5) occurs 8 times;
// (1, 3, 4) occurs 8 times;
// (2, 2, 4) occurs 2 times;
// (2, 3, 3) occurs 2 times.
// Example 2:
// Input: arr = [1,1,2,2,2,2], target = 5
// Output: 12
// Explanation:
// arr[i] = 1, arr[j] = arr[k] = 2 occurs 12 times:
// We choose one 1 from [1,1] in 2 ways,
// and two 2s from [2,2,2,2] in 6 ways.
// Constraints:
// 3 <= arr.length <= 3000
// 0 <= arr[i] <= 100
// 0 <= target <= 300
class Solution {
public:
int threeSumMulti(vector<int>& arr, int target) {
unordered_map<int, long> counts;
for (auto& number: arr) {
counts[number]++;
}
long result = 0;
for (auto& iter1: counts) {
for (auto& iter2: counts) {
int i = iter1.first;
int j = iter2.first;
int k = target - i - j;
if (counts.find(k) == counts.end()) {
continue;
}
if (i < j && j < k) {
// all numbers are unique
result += counts[i] * counts[j] * counts[k];
} else if (i == j && j != k) {
// two numbers are the same
result += counts[i] * (counts[i] - 1) / 2 * counts[k];
} else if (i == j && j == k){
// all same
result += counts[i] * (counts[i] - 1) * (counts[i] - 2) / 6;
}
}
}
return result % int(1e9 + 7);
}
};
int main() {
Solution s;
vector<tuple<tuple<vector<int>, int>, int>> test_cases {
{{{1,1,2,2,3,3,4,4,5,5}, 8}, 20},
{{{1,1,2,2,2,2}, 5}, 12},
};
for (auto& test_case: test_cases) {
assert(s.threeSumMulti(get<0>(get<0>(test_case)),get<1>(get<0>(test_case))) == get<1>(test_case));
}
} | [
"xiaohuanlin1993@gmail.com"
] | xiaohuanlin1993@gmail.com |
57b3a089c310b29d7bd0afd3e414f365dd4b9fab | 12440f574e1d75dcb99db74858e71da121294982 | /src/FingerprintStrategy.cpp | 4866f6993307bbfb26351056a9744a925c5b0004 | [] | no_license | tjol/funge-plus-plus | 3ffebaf91b64d9040847dbde52e67fdb643f1b83 | 070ec42019fec98195585453dc38c9f67d23ca77 | refs/heads/master | 2023-07-20T00:21:15.104694 | 2020-12-14T01:17:14 | 2020-12-14T01:17:14 | 400,636,393 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,890 | cpp | /**
* @file FingerprintStrategy.cpp
* Strategy for fingerprint commands.
* @author Conlan Wesson
*/
#include "FingerprintStrategy.h"
#include "FungeConfig.h"
#include "FingerprintBASE.h"
#include "FingerprintBITW.h"
#include "FingerprintBOOL.h"
#include "FingerprintCPLI.h"
#include "FingerprintHRTI.h"
#include "FingerprintMODE.h"
#include "FingerprintMODU.h"
#include "FingerprintNFUN.h"
#include "FingerprintNULL.h"
#include "FingerprintORTH.h"
#include "FingerprintPERL.h"
#include "FingerprintREFC.h"
#include "FingerprintROMA.h"
#include "FingerprintTERM.h"
#include "FingerprintTOYS.h"
namespace Funge {
FingerprintStrategy::FingerprintStrategy(Field& f, InstructionPointer& i, StackStack& s, FungeState& t) :
FungeStrategy(f, i, s, t,
{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}),
available(),
loaded()
{
available[0x42415345] = new FingerprintBASE(f, i, s);
available[0x42495457] = new FingerprintBITW(f, i, s);
available[0x424F4F4C] = new FingerprintBOOL(f, i, s);
available[0x43504C49] = new FingerprintCPLI(f, i, s);
available[0x48525449] = new FingerprintHRTI(f, i, s);
available[0x4D4F4445] = new FingerprintMODE(f, i, s);
available[0x4D4F4455] = new FingerprintMODU(f, i, s);
available[0x4E46554E] = new FingerprintNFUN(f, i, s);
available[0x4E554C4C] = new FingerprintNULL(f, i, s);
available[0x4F525448] = new FingerprintORTH(f, i, s);
available[0x5045524C] = new FingerprintPERL(f, i, s);
available[0x52454643] = new FingerprintREFC(f, i, s);
available[0x524F4D41] = new FingerprintROMA(f, i, s);
available[0x5445524D] = new FingerprintTERM(f, i, s);
available[0x544f5953] = new FingerprintTOYS(f, i, s);
for(auto fing : funge_config.fingerprints){
load(fing);
}
}
FingerprintStrategy::~FingerprintStrategy(){
for(auto f : available){
delete f.second;
}
}
bool FingerprintStrategy::execute(inst_t cmd){
bool done = false;
auto found = loaded.find(cmd);
if(found != loaded.cend()){
if(found->second.size() > 0){
done = found->second.top()->execute(cmd);
}
}
return done;
}
bool FingerprintStrategy::load(uint64_t fingerprint){
auto found = available.find(fingerprint);
if(found != available.cend()){
for(auto i : found->second->instructions()){
auto exist = loaded.find(i);
if(exist == loaded.cend()){
loaded[i] = std::stack<Fingerprint*>();
}
loaded[i].push(found->second);
}
//std::cout << "Loaded 0x" << std::hex << fingerprint << std::dec << std::endl;
return true;
}
return false;
}
bool FingerprintStrategy::unload(uint64_t fingerprint){
auto found = available.find(fingerprint);
if(found != available.cend()){
for(auto i : found->second->instructions()){
auto exist = loaded.find(i);
if(exist != loaded.cend()){
exist->second.pop();
}
}
return true;
}
return false;
}
}
| [
"conlan.wesson@gmail.com"
] | conlan.wesson@gmail.com |
c07010c478bff772b123c6646bbd3e6931fe8340 | 189f52bf5454e724d5acc97a2fa000ea54d0e102 | /ras/fluidisedBed/1.51/phi.particles | c129c370a6d2b123bc7aa601af86ce055f595c43 | [] | no_license | pyotr777/openfoam_samples | 5399721dd2ef57545ffce68215d09c49ebfe749d | 79c70ac5795decff086dd16637d2d063fde6ed0d | refs/heads/master | 2021-01-12T16:52:18.126648 | 2016-11-05T08:30:29 | 2016-11-05T08:30:29 | 71,456,654 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 148,489 | particles | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1606+ |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class surfaceScalarField;
location "1.51";
object phi.particles;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 3 -1 0 0 0 0];
internalField nonuniform List<scalar>
11770
(
-4.07276e-07
-1.2353e-05
-1.05608e-07
-1.17058e-05
4.01617e-07
-1.14652e-05
1.36401e-06
-1.1426e-05
2.61236e-06
-1.19025e-05
3.85409e-06
-1.30634e-05
4.64024e-06
-1.46844e-05
4.7289e-06
-1.90083e-05
3.86494e-06
-2.29004e-05
2.88717e-06
-2.46311e-05
2.31521e-06
-2.49022e-05
1.78254e-06
-2.46632e-05
6.52814e-07
-2.45669e-05
-1.11104e-06
-2.52402e-05
-2.71532e-06
-2.55627e-05
-4.12132e-06
-2.53276e-05
-5.1967e-06
-2.43836e-05
-5.87051e-06
-2.28626e-05
-6.57192e-06
-2.14006e-05
-7.18476e-06
-1.94283e-05
-7.2914e-06
-1.62148e-05
-6.92362e-06
-1.23184e-05
-6.0703e-06
-9.8203e-06
-5.33417e-06
-9.22634e-06
-4.72208e-06
-9.65968e-06
-3.81391e-06
-1.08895e-05
-2.53483e-06
-1.26409e-05
-5.25062e-07
-1.37396e-05
1.17376e-06
-1.42586e-05
-1.42719e-05
2.61718e-06
-9.13135e-07
1.98307e-06
1.48624e-06
2.31897e-06
1.60295e-06
3.31124e-06
2.99819e-06
4.6714e-06
4.91583e-06
6.71059e-06
6.19731e-06
7.95197e-06
7.88167e-06
7.20976e-06
7.77469e-06
4.94705e-06
5.43386e-06
2.74907e-06
4.03526e-06
1.54123e-06
3.05373e-06
4.59965e-07
2.48775e-06
-8.91076e-07
2.4907e-06
-1.96884e-06
1.5274e-06
-2.36778e-06
1.14835e-06
-2.46718e-06
1.24985e-06
-3.25761e-06
2.41455e-06
-6.10164e-06
4.75584e-06
-1.0764e-05
6.84647e-06
-1.39485e-05
7.39355e-06
-1.43587e-05
7.98267e-06
-1.32151e-05
8.24307e-06
-1.14727e-05
7.19131e-06
-1.06105e-05
5.18961e-06
-9.79281e-06
2.18803e-06
-8.14788e-06
-1.29435e-06
-5.80313e-06
-4.15202e-06
-3.27959e-06
-6.05989e-06
-2.27408e-06
-6.09578e-06
-5.70661e-06
2.24943e-06
-1.13542e-05
2.89372e-06
-1.02462e-05
2.8727e-06
-9.93959e-06
2.9065e-06
-7.55693e-06
2.57942e-06
-3.13694e-06
3.18245e-06
5.27618e-07
5.75133e-06
3.33696e-06
7.72114e-06
5.86164e-06
7.2941e-06
7.73622e-06
5.3225e-06
6.65451e-06
2.72077e-06
5.17433e-06
9.78425e-08
4.73756e-06
-2.18054e-06
4.48626e-06
-3.40892e-06
3.12063e-06
-3.62681e-06
2.12083e-06
-3.54877e-06
2.0389e-06
-4.18784e-06
3.47644e-06
-6.51569e-06
6.24983e-06
-1.04197e-05
9.51746e-06
-1.36825e-05
1.01531e-05
-1.45083e-05
8.80799e-06
-1.34039e-05
5.31981e-06
-1.29992e-05
3.37938e-07
-1.3761e-05
-4.53124e-06
-1.30692e-05
-9.13092e-06
-1.09101e-05
-1.28978e-05
-8.03148e-06
-1.53191e-05
-5.03814e-06
-1.65205e-05
-2.86136e-06
-1.55787e-05
-1.39726e-05
1.25321e-06
-1.41526e-05
5.01502e-06
-1.48442e-05
7.16333e-06
-1.50633e-05
8.35085e-06
-1.36759e-05
7.76345e-06
-9.41208e-06
5.8525e-06
-3.75816e-06
6.66129e-06
3.10639e-06
7.94658e-06
6.74984e-06
6.9817e-06
1.15527e-05
5.22779e-06
1.31545e-05
2.21448e-06
1.13379e-05
-1.03715e-06
1.07043e-05
-3.54483e-06
1.00079e-05
-4.63659e-06
7.8022e-06
-4.69634e-06
6.51152e-06
-4.4551e-06
6.55604e-06
-4.66849e-06
8.22205e-06
-6.15035e-06
1.11508e-05
-8.92176e-06
1.52732e-05
-1.23731e-05
1.68712e-05
-1.57063e-05
1.44823e-05
-1.7515e-05
9.13241e-06
-1.9314e-05
-9.91084e-07
-1.97236e-05
-9.49907e-06
-1.70417e-05
-1.47246e-05
-1.36522e-05
-1.73438e-05
-9.92736e-06
-1.88894e-05
-6.40839e-06
-1.92402e-05
-2.94379e-06
-1.69823e-05
-1.44297e-05
2.71726e-07
-1.25873e-05
5.62585e-06
-1.56544e-05
9.15701e-06
-1.64006e-05
1.21278e-05
-1.68052e-05
1.37306e-05
-1.48925e-05
1.21768e-05
-1.10872e-05
1.04518e-05
-2.22491e-06
1.17632e-05
5.75432e-06
1.07126e-05
1.29161e-05
6.637e-06
1.89487e-05
2.19405e-06
1.9359e-05
-2.06391e-06
1.87431e-05
-4.64362e-06
1.78047e-05
-5.30509e-06
1.45252e-05
-5.03573e-06
1.18835e-05
-4.58646e-06
1.14051e-05
-3.94125e-06
1.25608e-05
-3.53567e-06
1.50347e-05
-5.48388e-06
1.99985e-05
-1.02596e-05
2.24206e-05
-1.43209e-05
1.86148e-05
-1.77636e-05
1.19863e-05
-2.33279e-05
-4.56102e-07
-2.37281e-05
-1.13038e-05
-1.88268e-05
-1.70722e-05
-1.4766e-05
-1.8662e-05
-1.07055e-05
-1.93837e-05
-6.70827e-06
-1.90558e-05
-2.04865e-06
-1.57495e-05
-1.2306e-05
1.48368e-06
-9.06585e-06
6.1089e-06
-1.34031e-05
1.02154e-05
-1.4801e-05
1.42751e-05
-1.63968e-05
1.80442e-05
-1.60583e-05
1.91362e-05
-1.43772e-05
1.52881e-05
-7.25161e-06
1.41118e-05
4.61166e-06
1.48753e-05
1.41646e-05
1.13578e-05
2.09002e-05
6.14169e-06
2.37844e-05
1.3697e-06
2.41016e-05
-1.81344e-06
2.3943e-05
-3.14838e-06
2.12428e-05
-3.62516e-06
1.7585e-05
-3.50451e-06
1.55836e-05
-2.34923e-06
1.48441e-05
-3.4769e-07
1.58869e-05
-1.24854e-06
2.04962e-05
-5.4962e-06
2.35406e-05
-9.42744e-06
2.10257e-05
-1.49528e-05
1.44772e-05
-2.47941e-05
2.11608e-06
-2.66472e-05
-1.04308e-05
-2.0579e-05
-1.71804e-05
-1.57676e-05
-1.88501e-05
-1.17238e-05
-1.87418e-05
-7.77653e-06
-1.79844e-05
-2.57827e-06
-1.39614e-05
-9.44658e-06
2.95018e-06
-6.20211e-06
6.67218e-06
-1.08959e-05
1.14695e-05
-1.30243e-05
1.60247e-05
-1.49682e-05
2.03881e-05
-1.56905e-05
2.504e-05
-1.48044e-05
2.21455e-05
-8.55102e-06
1.56195e-05
3.66581e-06
1.34652e-05
1.50866e-05
1.12836e-05
2.11013e-05
8.96317e-06
2.42372e-05
6.86141e-06
2.50453e-05
4.40066e-06
2.50739e-05
1.45659e-06
2.33333e-05
-8.75469e-07
1.99503e-05
-1.70708e-06
1.68169e-05
-7.33712e-07
1.46268e-05
9.58709e-07
1.46045e-05
9.4453e-07
1.82197e-05
-1.38502e-06
2.20715e-05
-4.60358e-06
2.22757e-05
-1.17148e-05
1.71084e-05
-2.43548e-05
-5.75432e-09
-2.76163e-05
-1.09872e-05
-2.17519e-05
-1.74561e-05
-1.65231e-05
-2.01538e-05
-1.24072e-05
-1.96169e-05
-8.42534e-06
-1.82262e-05
-2.92956e-06
-1.34317e-05
-7.67419e-06
2.79413e-06
-4.325e-06
6.79104e-06
-9.09936e-06
1.20536e-05
-1.19814e-05
1.7571e-05
-1.40373e-05
2.28339e-05
-1.53036e-05
2.82474e-05
-1.38993e-05
2.53385e-05
-7.63283e-06
1.52968e-05
1.43849e-06
1.08052e-05
1.46534e-05
9.2871e-06
1.97895e-05
7.9083e-06
2.26157e-05
6.78293e-06
2.34518e-05
5.41508e-06
2.38379e-05
3.51166e-06
2.23496e-05
1.55234e-06
1.92896e-05
2.09271e-07
1.58928e-05
-9.31753e-08
1.32738e-05
3.62835e-07
1.24958e-05
7.36953e-07
1.48871e-05
7.02311e-07
1.94049e-05
-7.65451e-07
2.23033e-05
-1.16102e-05
1.46855e-05
-2.29918e-05
-4.52993e-06
-2.42395e-05
-1.46262e-05
-2.13937e-05
-1.94439e-05
-1.70621e-05
-2.25675e-05
-1.30577e-05
-2.28705e-05
-8.8476e-06
-2.03443e-05
-3.18403e-06
-1.40913e-05
-7.36912e-06
3.26317e-06
-5.14418e-06
7.10765e-06
-9.35065e-06
1.24104e-05
-1.28936e-05
1.87106e-05
-1.53893e-05
2.44644e-05
-1.59249e-05
2.84242e-05
-1.36714e-05
2.58941e-05
-8.85958e-06
1.43699e-05
-3.73731e-07
6.90153e-06
1.20494e-05
5.69272e-06
1.70267e-05
5.25745e-06
1.95782e-05
5.43701e-06
2.02633e-05
5.59482e-06
2.0127e-05
4.76793e-06
1.70882e-05
3.09306e-06
1.2563e-05
1.23874e-06
8.20722e-06
-2.41618e-07
5.81961e-06
-1.2081e-06
5.45192e-06
-1.65738e-06
7.41283e-06
-8.01318e-07
1.28677e-05
-3.10515e-06
1.20274e-05
-7.20615e-06
2.9601e-06
-8.74144e-06
-6.9249e-06
-1.23727e-05
-1.88592e-05
-1.50332e-05
-2.21629e-05
-1.38631e-05
-2.4419e-05
-1.13591e-05
-2.60896e-05
-8.29182e-06
-2.40265e-05
-3.1953e-06
-1.63489e-05
-8.44546e-06
3.78866e-06
-8.9132e-06
7.41956e-06
-1.29861e-05
1.25945e-05
-1.76652e-05
1.91677e-05
-2.04996e-05
2.29706e-05
-1.91336e-05
2.24819e-05
-1.65194e-05
1.63881e-05
-8.73804e-06
5.96126e-06
2.66871e-06
-7.17661e-07
5.81905e-06
-9.04273e-07
1.16288e-05
-6.54882e-07
1.27444e-05
-2.49694e-07
9.23415e-06
1.52183e-06
3.07384e-07
2.72381e-06
-5.32756e-06
2.29828e-06
-1.02725e-05
1.5252e-06
-1.37179e-05
2.99689e-07
-1.44843e-05
-2.00777e-06
-1.34185e-05
-4.68302e-06
-1.05205e-05
-5.44354e-06
-5.07713e-06
-5.64072e-06
-6.25107e-06
-2.97242e-06
-8.44125e-06
2.54845e-06
-9.86545e-06
3.22258e-06
-1.96942e-05
-1.23441e-06
-2.46431e-05
-4.90283e-06
-2.46237e-05
-5.71748e-06
-2.58184e-05
-5.8031e-06
-2.70964e-05
-2.23969e-06
-2.01068e-05
-9.33035e-06
3.79587e-06
-1.39265e-05
7.06047e-06
-1.92508e-05
1.18365e-05
-2.47062e-05
1.62253e-05
-2.76046e-05
1.53698e-05
-2.46843e-05
7.22433e-06
-1.75931e-05
-3.97289e-06
-1.80727e-06
-1.04798e-05
6.28254e-06
-1.22699e-05
-3.85742e-07
-1.18845e-05
-3.76564e-06
-1.17353e-05
-6.6792e-06
-1.28159e-05
-1.25449e-05
-1.20578e-05
-2.22987e-05
-8.74686e-06
-2.56305e-05
-5.16767e-06
-2.75387e-05
-1.95302e-06
-2.78373e-05
4.77171e-08
-2.68783e-05
2.29917e-07
-2.51608e-05
-1.58414e-06
-2.21594e-05
-3.60033e-06
-1.77562e-05
-3.6201e-06
-1.44791e-05
9.56694e-08
-1.21816e-05
6.56214e-06
-1.20933e-05
1.00073e-05
-1.74964e-05
8.13694e-06
-2.52632e-05
5.04007e-06
-2.45322e-05
2.97646e-06
-2.31766e-05
8.11554e-09
-2.5437e-05
-1.61449e-06
-2.27827e-05
-1.03391e-05
2.11405e-06
-1.73266e-05
6.01556e-06
-2.4227e-05
8.54252e-06
-2.93424e-05
8.33575e-06
-3.17821e-05
1.94905e-07
-2.28379e-05
-1.18979e-05
-6.58243e-06
-1.93612e-05
6.0933e-06
-2.35805e-05
7.59803e-06
-2.7265e-05
-2.68741e-06
-2.66789e-05
-1.47472e-05
-2.34611e-05
-2.00307e-05
-1.99821e-05
-2.34343e-05
-1.5571e-05
-2.63341e-05
-1.11116e-05
-2.70961e-05
-6.96263e-06
-2.72113e-05
-3.33958e-06
-2.63113e-05
-8.4346e-07
-2.47869e-05
2.32909e-07
-2.29268e-05
4.43527e-08
-2.0376e-05
-4.03964e-07
-1.6823e-05
3.17568e-07
-1.35192e-05
3.3342e-06
-1.17129e-05
9.32797e-06
-1.16172e-05
1.32684e-05
-1.6176e-05
1.11045e-05
-2.28853e-05
7.81059e-06
-2.20844e-05
6.79398e-06
-1.95907e-05
3.72399e-06
-1.99917e-05
-1.20991e-06
-2.029e-05
-1.31527e-05
4.21051e-07
-1.71726e-05
4.45696e-06
-2.51801e-05
3.50989e-06
-2.90717e-05
-4.05727e-06
-2.85927e-05
-1.65267e-05
-9.73407e-06
-2.40746e-05
5.54281e-06
-2.70122e-05
9.74452e-06
-3.05876e-05
8.62495e-06
-3.03402e-05
-1.67834e-06
-2.60989e-05
-1.33694e-05
-2.22542e-05
-1.80135e-05
-1.90696e-05
-2.14417e-05
-1.51516e-05
-2.37347e-05
-1.11687e-05
-2.41995e-05
-7.48467e-06
-2.38411e-05
-4.17753e-06
-2.268e-05
-1.65905e-06
-2.12274e-05
-2.29537e-07
-1.93896e-05
4.71899e-07
-1.69131e-05
1.28107e-06
-1.3679e-05
2.83008e-06
-1.09317e-05
5.84847e-06
-9.54711e-06
1.21456e-05
-1.01974e-05
1.49655e-05
-1.52949e-05
1.01723e-05
-1.96812e-05
5.66297e-06
-1.64634e-05
3.83619e-06
-1.52669e-05
3.14431e-06
-1.58991e-05
1.45794e-06
-1.59503e-05
-1.35545e-05
-1.61979e-06
-1.44247e-05
7.06084e-07
-2.2283e-05
-1.84571e-06
-2.4953e-05
-1.08284e-05
-1.99317e-05
-2.23008e-05
2.60244e-06
-2.77842e-05
1.05442e-05
-2.96754e-05
1.23398e-05
-3.09813e-05
9.92598e-06
-2.8484e-05
-8.48447e-07
-2.4196e-05
-1.12407e-05
-2.02818e-05
-1.52359e-05
-1.72418e-05
-1.85667e-05
-1.44419e-05
-2.04947e-05
-1.14049e-05
-2.04113e-05
-8.45032e-06
-1.92761e-05
-5.4054e-06
-1.77576e-05
-2.76244e-06
-1.66199e-05
-8.73178e-07
-1.47974e-05
7.67151e-07
-1.20843e-05
2.48898e-06
-9.16583e-06
4.65185e-06
-7.42606e-06
7.53051e-06
-6.90597e-06
1.4003e-05
-9.70184e-06
1.42761e-05
-1.31317e-05
6.91683e-06
-1.34347e-05
2.74299e-06
-1.0352e-05
9.0196e-07
-1.06139e-05
3.62541e-07
-1.20555e-05
1.59103e-06
-1.2175e-05
-9.63982e-06
-9.66947e-07
-1.10207e-05
5.78392e-07
-1.72937e-05
-1.90951e-06
-1.99656e-05
-1.51337e-05
-1.32351e-05
-2.73909e-05
9.21379e-06
-2.91416e-05
1.53181e-05
-3.00059e-05
1.5757e-05
-2.86685e-05
1.20946e-05
-2.47367e-05
1.59542e-06
-2.09736e-05
-8.53569e-06
-1.75294e-05
-1.32925e-05
-1.51423e-05
-1.57455e-05
-1.34745e-05
-1.71082e-05
-1.15846e-05
-1.65254e-05
-9.7258e-06
-1.42273e-05
-7.11034e-06
-1.18301e-05
-4.32409e-06
-1.03715e-05
-1.47129e-06
-8.55295e-06
1.16855e-06
-5.7121e-06
3.01534e-06
-4.23329e-06
5.35263e-06
-4.23037e-06
1.0108e-05
-5.36882e-06
1.62839e-05
-8.97841e-06
1.45994e-05
-8.85061e-06
7.18718e-06
-5.34303e-06
3.27228e-06
-4.72658e-06
1.75977e-06
-5.68986e-06
1.27825e-06
-7.04878e-06
1.69045e-06
-7.27457e-06
-5.20865e-06
-5.73397e-07
-7.78046e-06
-7.45017e-07
-1.29096e-05
2.70156e-07
-1.58228e-05
-9.70895e-06
-1.05453e-05
-2.5329e-05
9.13464e-06
-2.89219e-05
2.1598e-05
-2.85273e-05
2.12486e-05
-2.53335e-05
1.66936e-05
-2.07498e-05
7.99145e-06
-1.71355e-05
-2.06069e-06
-1.4225e-05
-9.37444e-06
-1.25135e-05
-1.23107e-05
-1.17654e-05
-1.35232e-05
-1.10078e-05
-1.26821e-05
-1.01915e-05
-9.04787e-06
-8.32259e-06
-6.06384e-06
-5.90368e-06
-5.2455e-06
-3.58528e-06
-4.29928e-06
-9.8557e-07
-1.61428e-06
2.3366e-06
-1.26145e-06
6.04003e-06
-2.1068e-06
1.30848e-05
-4.15019e-06
1.49994e-05
-5.42111e-06
8.45151e-06
-2.03639e-06
4.48034e-06
-9.53001e-08
3.05432e-06
-8.41962e-07
2.04332e-06
-2.12552e-06
1.32726e-06
-3.24346e-06
9.46616e-07
-3.5191e-06
-2.25802e-06
-4.33071e-07
-5.16357e-06
3.76959e-07
-9.83233e-06
1.95295e-06
-1.22813e-05
-6.44615e-07
-7.4297e-06
-1.50447e-05
8.2962e-06
-2.60746e-05
3.12828e-05
-2.5575e-05
3.15005e-05
-2.09472e-05
2.6979e-05
-1.49417e-05
1.8453e-05
-1.17246e-05
8.11858e-06
-1.05438e-05
-2.11254e-06
-9.71822e-06
-7.00372e-06
-9.34291e-06
-9.06829e-06
-9.11341e-06
-8.07981e-06
-9.16835e-06
-3.68232e-06
-9.78702e-06
-1.64146e-06
-1.01031e-05
-1.97872e-06
-8.34536e-06
-2.52624e-06
-3.88398e-06
-1.63133e-06
2.07576e-06
-9.28735e-07
7.14222e-06
6.94034e-08
1.4148e-05
-7.78506e-07
1.27455e-05
1.58125e-06
5.53911e-06
3.22537e-06
4.23346e-06
2.59582e-06
3.22062e-06
1.28777e-06
2.30053e-06
-1.72804e-07
1.42971e-06
-1.09014e-06
6.28089e-07
-1.42028e-06
-8.60431e-07
-1.10944e-07
-3.58519e-06
1.10914e-06
-7.52139e-06
3.51728e-06
-8.62726e-06
2.31731e-06
-3.15939e-06
-1.06925e-05
1.14672e-05
-2.10773e-05
4.045e-05
-2.02373e-05
4.39663e-05
-1.67563e-05
4.15045e-05
-9.77472e-06
3.21242e-05
-5.53878e-06
1.74644e-05
-6.31784e-06
6.09718e-06
-7.15194e-06
-2.0746e-08
-7.42455e-06
-2.93497e-06
-8.55196e-06
-2.14732e-06
-1.04248e-05
6.07104e-07
-1.13019e-05
8.81092e-07
-1.12564e-05
2.46911e-07
-1.03289e-05
-8.7286e-07
-7.52864e-06
-1.75674e-06
-1.2005e-06
-8.02558e-07
6.71614e-06
2.3319e-06
9.8377e-06
3.59153e-06
7.76068e-06
5.26291e-06
5.70484e-06
5.06883e-06
4.92477e-06
4.27234e-06
3.84857e-06
2.68657e-06
2.74745e-06
1.02191e-06
1.71853e-06
3.09876e-07
7.75501e-07
-1.0932e-07
-1.38727e-07
2.03018e-07
-2.94626e-06
8.26193e-07
-5.84507e-06
1.75933e-06
-5.86243e-06
1.25356e-06
2.56339e-08
-9.33431e-06
1.34595e-05
-1.57532e-05
4.24027e-05
-1.14315e-05
4.98764e-05
-8.79632e-06
5.03949e-05
-3.60093e-06
4.35272e-05
-7.4437e-07
2.0904e-05
-2.91946e-06
1.09248e-05
-5.43185e-06
4.93844e-06
-7.98116e-06
2.25465e-06
-1.02208e-05
2.59318e-06
-1.11814e-05
2.86271e-06
-1.12158e-05
2.07436e-06
-1.08932e-05
1.09281e-06
-1.01643e-05
-1.94331e-08
-8.1163e-06
-1.08573e-06
-3.91147e-06
-9.97006e-07
3.39211e-06
2.44326e-06
8.08863e-06
3.16209e-06
7.60668e-06
3.93882e-06
7.16903e-06
5.89088e-06
6.29722e-06
5.59592e-06
4.78402e-06
3.85751e-06
2.96067e-06
1.68639e-06
1.46682e-06
1.56008e-06
5.683e-07
7.49024e-07
3.29391e-07
3.02541e-07
-2.94492e-06
-5.96282e-09
-5.04965e-06
-1.93e-06
-6.01597e-06
-5.26543e-06
-3.02319e-06
-1.01119e-05
3.11972e-06
-1.11602e-05
2.99936e-05
-4.89286e-06
3.9867e-05
1.58724e-06
4.47242e-05
6.3887e-06
4.28042e-05
4.55395e-06
1.5156e-05
-2.33503e-08
5.30487e-06
-3.71851e-06
5.75414e-06
-6.70122e-06
4.84822e-06
-9.07175e-06
4.73778e-06
-1.01196e-05
4.14335e-06
-1.04183e-05
2.78427e-06
-1.03617e-05
1.48393e-06
-9.86536e-06
2.70026e-07
-8.71554e-06
-9.3274e-07
-5.83947e-06
-1.91134e-06
1.74485e-06
-4.07748e-07
7.16296e-06
-7.23e-07
7.66562e-06
2.46234e-06
8.03625e-06
5.9444e-06
7.79507e-06
6.13179e-06
5.64958e-06
2.8806e-06
2.41938e-06
-4.30802e-06
1.97486e-07
1.24529e-07
-1.03001e-07
5.30799e-07
-3.36776e-07
1.65994e-06
-8.14016e-06
1.45696e-06
-7.94542e-06
-4.01716e-06
-2.61558e-05
-9.87623e-06
-2.81177e-05
-1.02674e-05
-2.52651e-05
-5.86243e-06
-4.2996e-06
1.51002e-06
6.55672e-06
9.11475e-06
1.49973e-05
1.77903e-05
1.67606e-05
1.90269e-05
-4.72182e-06
8.34188e-06
-1.56216e-05
-1.96209e-06
-1.01486e-05
-5.64511e-06
3.92327e-06
-7.44354e-06
6.05003e-06
-8.62561e-06
4.98702e-06
-9.37336e-06
3.00394e-06
-9.80424e-06
1.36469e-06
-9.57219e-06
1.19241e-07
-8.59212e-06
-1.18886e-06
-6.32866e-06
-2.68487e-06
-5.84841e-07
-3.95575e-06
3.73445e-06
-1.00087e-05
3.90372e-06
-1.26254e-05
5.57119e-06
-1.54239e-05
7.0093e-06
-2.12605e-05
4.33707e-06
-2.60107e-05
3.49635e-07
-3.38503e-05
-2.22247e-06
-2.89823e-05
-1.91202e-06
-2.38436e-05
-2.53158e-05
4.922e-06
-3.47668e-05
2.0792e-06
-3.37496e-05
-2.21363e-06
-5.00336e-05
-2.41877e-06
-4.95527e-05
-8.29447e-07
-4.43332e-05
3.05953e-06
-3.51561e-05
9.58683e-06
-2.71078e-05
1.6988e-05
-2.06787e-05
2.30838e-05
-1.84557e-05
2.66267e-05
-2.63984e-05
2.56559e-05
-3.20278e-05
1.19051e-05
-3.06199e-05
-1.71085e-06
-1.58104e-05
-4.31959e-06
-1.03228e-06
-6.17147e-06
5.10024e-06
-8.1222e-06
2.90616e-06
-9.59427e-06
7.66156e-07
-9.72741e-06
-3.9489e-07
-8.79298e-06
-1.93363e-06
-6.35429e-06
-4.1604e-06
-4.11345e-06
-8.15657e-06
-6.39411e-06
-3.06208e-05
-9.29731e-06
-3.77395e-05
-9.74374e-06
-4.4247e-05
-9.16987e-06
-5.06136e-05
-7.43173e-06
-5.28677e-05
-4.9895e-06
-5.3891e-05
-2.62324e-06
-5.43296e-05
-9.01378e-07
-5.16497e-05
-5.13659e-05
-3.40854e-07
-5.62434e-05
-6.5587e-07
-5.47137e-05
-7.29773e-07
-5.22697e-05
1.35454e-07
-5.00912e-05
2.49231e-06
-4.66496e-05
6.69733e-06
-4.34444e-05
1.16155e-05
-3.92479e-05
1.668e-05
-3.57396e-05
2.13196e-05
-3.42208e-05
2.59154e-05
-3.4244e-05
3.07579e-05
-3.44004e-05
3.24617e-05
-3.47015e-05
2.27736e-05
-3.35536e-05
8.68749e-06
-2.15428e-05
9.77031e-08
-1.23743e-05
-7.02984e-06
-6.86502e-06
-1.07971e-05
-5.55358e-06
-1.06891e-05
-2.50636e-06
-9.19021e-06
-4.48296e-06
-6.77155e-06
-8.52786e-06
-1.0822e-05
-2.59687e-05
-1.59777e-05
-4.37512e-05
-1.52026e-05
-4.68181e-05
-1.39764e-05
-4.9225e-05
-1.25826e-05
-5.1096e-05
-1.04818e-05
-5.19948e-05
-7.82751e-06
-5.26021e-05
-4.76428e-06
-5.2983e-05
-2.01991e-06
-5.29161e-05
-5.16036e-05
-1.39491e-08
-5.45284e-05
7.02573e-07
-5.22251e-05
1.71203e-06
-4.97499e-05
2.58501e-06
-4.85201e-05
4.26266e-06
-4.65709e-05
7.64841e-06
-4.39949e-05
1.16951e-05
-4.07496e-05
1.537e-05
-3.75175e-05
1.9299e-05
-3.55997e-05
2.45991e-05
-3.42798e-05
3.04442e-05
-3.38511e-05
3.41896e-05
-3.32126e-05
3.4883e-05
-3.22294e-05
3.21798e-05
-3.12672e-05
2.20169e-05
-2.7061e-05
-1.10833e-07
-1.34226e-05
-1.4788e-05
-1.53757e-05
-1.45008e-05
-1.96457e-05
-1.2141e-05
-2.19256e-05
-1.53304e-05
-2.57516e-05
-2.00775e-05
-4.08149e-05
-1.86795e-05
-4.25637e-05
-1.69629e-05
-4.43821e-05
-1.55145e-05
-4.63121e-05
-1.37041e-05
-4.79273e-05
-1.14469e-05
-4.91272e-05
-8.71564e-06
-5.02891e-05
-5.52016e-06
-5.08377e-05
-2.30361e-06
-5.00336e-05
-4.8265e-05
-7.30876e-07
-5.14161e-05
5.47028e-07
-5.00038e-05
2.77642e-06
-4.7486e-05
4.40309e-06
-4.62904e-05
6.02594e-06
-4.55505e-05
8.90309e-06
-4.2945e-05
1.22605e-05
-4.0161e-05
1.51588e-05
-3.69915e-05
1.83958e-05
-3.46265e-05
2.33077e-05
-3.35131e-05
2.89394e-05
-3.32355e-05
3.24003e-05
-3.19854e-05
3.29957e-05
-3.01347e-05
3.06532e-05
-2.80765e-05
2.18982e-05
-2.24476e-05
1.95115e-06
-6.80525e-06
-1.61899e-05
-1.20924e-05
-2.28543e-05
-3.14588e-05
-2.46798e-05
-3.67836e-05
-2.37125e-05
-3.82678e-05
-2.13513e-05
-3.9167e-05
-1.91647e-05
-3.95698e-05
-1.76401e-05
-4.12987e-05
-1.62102e-05
-4.3026e-05
-1.44058e-05
-4.44369e-05
-1.20501e-05
-4.57071e-05
-9.53007e-06
-4.68474e-05
-6.85758e-06
-4.76564e-05
-3.31305e-06
-4.77735e-05
-4.54654e-05
-8.77086e-08
-4.81666e-05
1.57876e-06
-4.75385e-05
3.17944e-06
-4.51669e-05
5.48223e-06
-4.38399e-05
7.52935e-06
-4.30415e-05
1.00574e-05
-4.10817e-05
1.30262e-05
-3.90005e-05
1.57975e-05
-3.64293e-05
1.83445e-05
-3.35312e-05
2.21657e-05
-3.2567e-05
2.66787e-05
-3.25154e-05
2.93709e-05
-3.11454e-05
2.95442e-05
-2.87836e-05
2.67492e-05
-2.48159e-05
1.87632e-05
-1.65703e-05
3.62163e-06
5.70978e-07
-1.07178e-05
-2.0059e-06
-1.85641e-05
-2.53221e-05
-2.25691e-05
-3.42256e-05
-2.28726e-05
-3.58667e-05
-2.08088e-05
-3.64304e-05
-1.87245e-05
-3.65962e-05
-1.72592e-05
-3.81749e-05
-1.58876e-05
-3.97145e-05
-1.41927e-05
-4.10438e-05
-1.21922e-05
-4.21159e-05
-9.70859e-06
-4.3044e-05
-6.86245e-06
-4.38751e-05
-3.6659e-06
-4.40129e-05
-4.22854e-05
2.00338e-08
-4.5023e-05
1.49274e-06
-4.41183e-05
3.70276e-06
-4.21833e-05
5.90273e-06
-4.14344e-05
8.21881e-06
-4.04741e-05
1.0549e-05
-3.87199e-05
1.32823e-05
-3.63636e-05
1.66522e-05
-3.42612e-05
1.92078e-05
-3.08479e-05
2.16994e-05
-2.96263e-05
2.41439e-05
-2.99661e-05
2.50782e-05
-2.94768e-05
2.45377e-05
-2.6953e-05
2.16848e-05
-2.07482e-05
1.49737e-05
-9.51076e-06
4.60874e-06
6.87887e-06
-6.05493e-06
6.35437e-06
-1.42037e-05
-1.5881e-05
-1.96932e-05
-2.97576e-05
-2.13853e-05
-3.27513e-05
-1.99374e-05
-3.34606e-05
-1.80521e-05
-3.35166e-05
-1.65543e-05
-3.50257e-05
-1.50136e-05
-3.65675e-05
-1.32697e-05
-3.78868e-05
-1.13298e-05
-3.89897e-05
-9.35353e-06
-3.98964e-05
-7.046e-06
-4.05777e-05
-3.36001e-06
-4.05253e-05
-3.87601e-05
-8.78783e-07
-4.14547e-05
7.04267e-07
-4.06871e-05
3.54338e-06
-3.93922e-05
6.69447e-06
-3.85438e-05
9.17963e-06
-3.75214e-05
1.09007e-05
-3.5807e-05
1.32606e-05
-3.31004e-05
1.65518e-05
-3.07045e-05
2.0134e-05
-2.70297e-05
2.26528e-05
-2.56512e-05
2.25748e-05
-2.63946e-05
2.07205e-05
-2.73476e-05
1.84803e-05
-2.44243e-05
1.56726e-05
-1.5993e-05
1.16136e-05
-2.80794e-06
6.14586e-06
1.2294e-05
3.66057e-07
1.33826e-05
-7.19723e-06
-5.29946e-06
-1.55221e-05
-2.49617e-05
-1.92879e-05
-2.91703e-05
-1.8608e-05
-3.03071e-05
-1.68732e-05
-3.04645e-05
-1.52992e-05
-3.20209e-05
-1.36679e-05
-3.38155e-05
-1.18732e-05
-3.54235e-05
-1.00464e-05
-3.6774e-05
-8.24543e-06
-3.77988e-05
-6.38247e-06
-3.84585e-05
-3.53377e-06
-3.87803e-05
-3.68276e-05
-3.75847e-07
-3.76729e-05
1.39387e-06
-3.7496e-05
4.16511e-06
-3.6482e-05
7.27989e-06
-3.55418e-05
9.86913e-06
-3.43572e-05
1.24297e-05
-3.2621e-05
1.42951e-05
-3.01126e-05
1.56925e-05
-2.74193e-05
1.89028e-05
-2.37582e-05
2.1971e-05
-2.22229e-05
2.04491e-05
-2.32639e-05
1.5374e-05
-2.53927e-05
1.15232e-05
-2.1899e-05
1.02853e-05
-1.17081e-05
9.44103e-06
2.05071e-06
7.39173e-06
1.60946e-05
5.45182e-06
1.82607e-05
-2.14044e-07
5.16097e-06
-1.02037e-05
-1.6374e-05
-1.62726e-05
-2.47412e-05
-1.69196e-05
-2.69269e-05
-1.55174e-05
-2.72765e-05
-1.38808e-05
-2.90744e-05
-1.2153e-05
-3.1237e-05
-1.02314e-05
-3.33635e-05
-8.27813e-06
-3.52657e-05
-6.56892e-06
-3.68471e-05
-5.29582e-06
-3.78852e-05
-3.13395e-06
-3.81612e-05
-3.62059e-05
-5.2069e-07
-3.42161e-05
1.25602e-06
-3.44022e-05
4.27235e-06
-3.34093e-05
7.67989e-06
-3.25478e-05
1.05103e-05
-3.1243e-05
1.24956e-05
-2.92674e-05
1.43614e-05
-2.65888e-05
1.61914e-05
-2.38127e-05
1.88677e-05
-2.02985e-05
2.12537e-05
-1.87355e-05
1.77324e-05
-2.02158e-05
1.01062e-05
-2.36682e-05
6.0863e-06
-1.95954e-05
7.05063e-06
-9.37354e-06
9.07942e-06
2.87734e-06
9.56097e-06
1.63784e-05
1.01785e-05
2.10408e-05
8.28628e-06
1.48632e-05
-1.48523e-06
-4.49351e-06
-1.16387e-05
-1.97125e-05
-1.47665e-05
-2.32329e-05
-1.40276e-05
-2.38491e-05
-1.25256e-05
-2.59238e-05
-1.08131e-05
-2.86457e-05
-8.81959e-06
-3.14791e-05
-6.72087e-06
-3.41275e-05
-4.78959e-06
-3.64333e-05
-3.61733e-06
-3.82174e-05
-2.36113e-06
-3.89052e-05
-3.6842e-05
-3.51948e-07
-3.08941e-05
1.64873e-06
-3.18067e-05
4.42048e-06
-3.08866e-05
7.45621e-06
-2.96429e-05
1.01622e-05
-2.80153e-05
1.23466e-05
-2.57976e-05
1.4053e-05
-2.29669e-05
1.56183e-05
-1.9939e-05
1.78005e-05
-1.64228e-05
1.9018e-05
-1.51606e-05
1.28106e-05
-1.74153e-05
3.44286e-06
-2.22508e-05
1.66709e-06
-1.84918e-05
5.7908e-06
-1.08741e-05
9.84816e-06
-1.96458e-06
1.23249e-05
1.18599e-05
1.4092e-05
2.1929e-05
1.39152e-05
2.02163e-05
5.35954e-06
7.21478e-06
-6.86557e-06
-1.19946e-05
-1.21204e-05
-1.87416e-05
-1.22913e-05
-2.04045e-05
-1.11444e-05
-2.24882e-05
-9.5679e-06
-2.57277e-05
-7.60272e-06
-2.93299e-05
-5.47072e-06
-3.27797e-05
-3.328e-06
-3.57661e-05
-2.16544e-06
-3.83686e-05
-1.4266e-06
-3.97616e-05
-3.82097e-05
-2.14568e-07
-2.80343e-05
1.73693e-06
-2.96448e-05
4.39614e-06
-2.87317e-05
7.42607e-06
-2.72797e-05
1.00226e-05
-2.5206e-05
1.19775e-05
-2.24751e-05
1.34404e-05
-1.93151e-05
1.48905e-05
-1.61597e-05
1.62939e-05
-1.2714e-05
1.55637e-05
-1.08216e-05
6.4981e-06
-1.454e-05
-2.86489e-06
-2.08989e-05
-5.20248e-07
-1.89657e-05
6.4016e-06
-1.42112e-05
1.14241e-05
-7.99471e-06
1.5776e-05
3.03509e-06
1.92814e-05
1.90206e-05
2.07649e-05
2.32007e-05
1.51155e-05
1.75276e-05
1.7133e-06
-4.51266e-08
-7.79704e-06
-1.29754e-05
-9.94821e-06
-1.70025e-05
-9.55414e-06
-1.92089e-05
-8.25321e-06
-2.26912e-05
-6.41576e-06
-2.68439e-05
-4.27636e-06
-3.09636e-05
-2.07311e-06
-3.44457e-05
-9.16108e-07
-3.75972e-05
-5.16014e-07
-3.96663e-05
-3.88586e-05
-3.95969e-08
-2.56114e-05
2.04971e-06
-2.80469e-05
4.65991e-06
-2.70719e-05
7.47564e-06
-2.50914e-05
9.7645e-06
-2.24592e-05
1.13746e-05
-1.94056e-05
1.24511e-05
-1.6067e-05
1.3287e-05
-1.28735e-05
1.36945e-05
-9.87487e-06
1.17324e-05
-7.6109e-06
1.9875e-06
-1.04738e-05
-5.86494e-06
-1.73698e-05
-7.29632e-07
-1.91892e-05
7.42474e-06
-1.59303e-05
1.21843e-05
-1.07705e-05
1.73369e-05
-4.68079e-06
2.31515e-05
9.7704e-06
2.60107e-05
2.27864e-05
2.26017e-05
2.30479e-05
9.87307e-06
1.2337e-05
-2.69731e-06
-5.02718e-06
-7.11798e-06
-1.25488e-05
-7.62456e-06
-1.61485e-05
-6.68431e-06
-1.98782e-05
-5.04571e-06
-2.41925e-05
-2.92656e-06
-2.87156e-05
-6.88212e-07
-3.26768e-05
6.14936e-07
-3.60159e-05
1.04443e-06
-3.86066e-05
-3.813e-05
2.32755e-07
-2.37309e-05
2.44191e-06
-2.67953e-05
4.9573e-06
-2.55416e-05
7.50529e-06
-2.32219e-05
9.37352e-06
-2.0204e-05
1.04053e-05
-1.69323e-05
1.06667e-05
-1.36949e-05
1.05704e-05
-1.06608e-05
1.05226e-05
-8.03757e-06
1.03696e-05
-6.03195e-06
3.5956e-06
-6.46565e-06
-4.75741e-06
-1.10253e-05
-6.91239e-07
-1.708e-05
7.70608e-06
-1.63262e-05
1.38591e-05
-1.14668e-05
1.95533e-05
-7.34808e-06
2.55025e-05
1.50984e-06
3.02342e-05
1.86815e-05
2.97308e-05
2.54714e-05
1.98095e-05
2.13467e-05
5.3386e-06
5.57768e-06
-2.34415e-06
-6.10041e-06
-4.54112e-06
-1.23355e-05
-4.55005e-06
-1.71793e-05
-3.42192e-06
-2.16039e-05
-1.61188e-06
-2.6371e-05
6.37756e-07
-3.07879e-05
2.10085e-06
-3.41802e-05
2.78249e-06
-3.67564e-05
-3.56084e-05
4.52763e-07
-2.24995e-05
2.79762e-06
-2.58078e-05
5.26459e-06
-2.44289e-05
7.54554e-06
-2.19455e-05
8.62267e-06
-1.86293e-05
8.60341e-06
-1.52362e-05
8.25168e-06
-1.20513e-05
7.94038e-06
-9.15446e-06
7.60119e-06
-6.62605e-06
7.61093e-06
-4.58022e-06
6.70244e-06
-3.74195e-06
-6.43972e-07
-4.85143e-06
-8.2431e-07
-1.44481e-05
7.70179e-06
-1.61572e-05
1.47432e-05
-1.15349e-05
2.07811e-05
-7.0228e-06
2.58276e-05
-1.33604e-07
3.1524e-05
1.52471e-05
3.34134e-05
2.73121e-05
2.80537e-05
2.67688e-05
1.51722e-05
1.68903e-05
4.24586e-06
1.04744e-06
-3.18918e-07
-7.52922e-06
-1.93712e-06
-1.40808e-05
-1.98436e-06
-1.89159e-05
-7.78514e-07
-2.37028e-05
1.42524e-06
-2.86472e-05
3.18353e-06
-3.23012e-05
4.52686e-06
-3.43453e-05
-3.09078e-05
7.38541e-07
-2.20687e-05
3.24001e-06
-2.53517e-05
5.70367e-06
-2.39598e-05
6.9801e-06
-2.10737e-05
7.0193e-06
-1.75382e-05
6.69401e-06
-1.41045e-05
6.04037e-06
-1.08003e-05
5.16225e-06
-7.77555e-06
4.25445e-06
-5.26895e-06
3.53896e-06
-3.32458e-06
3.18174e-06
-1.92065e-06
-1.54007e-06
-1.08895e-06
-1.43025e-06
-9.86352e-06
6.60271e-06
-1.41325e-05
1.4176e-05
-1.02426e-05
2.00645e-05
-5.16666e-06
2.4848e-05
1.95741e-06
3.13469e-05
1.38751e-05
3.51246e-05
2.80533e-05
3.35275e-05
2.9633e-05
2.32165e-05
2.45207e-05
1.10403e-05
9.17287e-06
4.80019e-06
-2.13415e-06
1.53523e-06
-9.63276e-06
-1.00682e-07
-1.51469e-05
-9.96753e-08
-2.00256e-05
1.59884e-06
-2.54675e-05
3.38096e-06
-2.92508e-05
5.65899e-06
-3.04429e-05
-2.31331e-05
1.30603e-06
-2.29375e-05
3.53989e-06
-2.53535e-05
5.05567e-06
-2.35459e-05
5.44976e-06
-2.03031e-05
5.26526e-06
-1.6727e-05
4.67603e-06
-1.31242e-05
3.53957e-06
-9.5407e-06
2.019e-06
-6.3224e-06
5.90024e-07
-3.9806e-06
-3.16565e-07
-2.34207e-06
-6.49667e-07
-1.09827e-06
-1.81498e-06
-2.32833e-07
-1.55175e-06
-4.53303e-06
3.35171e-06
-9.51062e-06
1.07631e-05
-6.3579e-06
1.69178e-05
-5.34597e-07
2.19733e-05
6.97873e-06
2.91039e-05
1.48439e-05
3.52754e-05
2.81007e-05
3.64527e-05
3.12235e-05
3.04274e-05
2.76427e-05
1.9744e-05
1.75221e-05
1.16807e-05
5.4231e-06
6.2021e-06
-3.2802e-06
2.17083e-06
-8.69093e-06
7.59391e-07
-1.47149e-05
1.84687e-06
-2.07186e-05
3.1702e-06
-2.44643e-05
6.42066e-06
-2.3315e-05
-1.29686e-05
1.51426e-06
-2.45115e-05
3.16671e-06
-2.53041e-05
4.0487e-06
-2.31495e-05
4.07528e-06
-1.98528e-05
3.4514e-06
-1.61047e-05
2.3162e-06
-1.22722e-05
3.85302e-07
-8.04496e-06
-1.68018e-06
-4.85666e-06
-3.08192e-06
-3.08266e-06
-3.8018e-06
-1.94014e-06
-4.12757e-06
-8.22358e-07
-3.73447e-06
-2.12947e-07
-2.9704e-06
-1.60891e-06
-6.13374e-07
-4.22862e-06
4.68435e-06
-7.12673e-07
1.09696e-05
7.2634e-06
1.65282e-05
1.46205e-05
2.42401e-05
1.99727e-05
3.31026e-05
3.01001e-05
3.76869e-05
3.38734e-05
3.73361e-05
3.1198e-05
3.09817e-05
2.49291e-05
2.16393e-05
1.58176e-05
1.19204e-05
5.60353e-06
4.31877e-06
8.83476e-07
1.22377e-06
-6.88084e-06
1.61021e-06
-1.42287e-05
2.4306e-06
-1.77439e-05
4.32134e-06
-1.41656e-05
-6.01434e-06
1.36952e-06
-2.55021e-05
2.9405e-06
-2.54827e-05
3.63058e-06
-2.32758e-05
3.09853e-06
-1.99664e-05
1.51019e-06
-1.5607e-05
-7.99486e-07
-1.12927e-05
-3.68984e-06
-5.7134e-06
-5.70162e-06
-3.84579e-06
-6.44799e-06
-3.10106e-06
-6.53742e-06
-2.46267e-06
-6.48806e-06
-1.22343e-06
-6.59627e-06
1.12467e-07
-6.64066e-06
5.79378e-07
-5.96214e-06
7.31846e-07
-3.62136e-06
4.72087e-06
4.09102e-06
1.52184e-05
1.36652e-05
2.86734e-05
2.20471e-05
3.48902e-05
3.14552e-05
4.02036e-05
3.90045e-05
4.23636e-05
4.21943e-05
4.05345e-05
4.08292e-05
3.62475e-05
3.08795e-05
2.60058e-05
1.32635e-05
1.41183e-05
2.57668e-06
8.39846e-06
-2.45997e-07
3.79336e-07
8.61123e-08
-7.26449e-06
1.06326e-06
-1.06887e-05
8.72585e-07
-8.1684e-06
-3.4443e-06
1.63603e-06
-2.61387e-05
3.40873e-06
-2.63666e-05
3.9801e-06
-2.43461e-05
3.32621e-06
-2.09695e-05
4.20551e-07
-1.57431e-05
-5.39905e-06
-2.74782e-05
-8.86133e-06
-5.87749e-06
-9.15248e-06
-4.54829e-06
-8.86215e-06
-4.30775e-06
-8.14973e-06
-3.77333e-06
-7.65115e-06
-1.89438e-06
-7.96274e-06
8.14532e-07
-8.91318e-06
2.37535e-06
-9.43291e-06
4.74872e-06
-8.63253e-06
1.03284e-05
-3.41833e-06
2.17695e-05
5.9058e-06
4.67039e-05
1.5936e-05
5.42535e-05
2.69907e-05
5.44303e-05
3.61514e-05
5.54223e-05
3.99559e-05
5.28748e-05
4.06911e-05
4.79908e-05
2.59439e-05
3.38727e-05
6.6488e-06
2.16456e-05
2.1544e-06
1.21925e-05
5.39339e-07
3.68517e-06
1.62243e-07
-3.12629e-06
4.24563e-07
-6.54869e-06
3.88432e-07
-5.77772e-06
-2.42513e-06
2.78373e-06
-2.73456e-05
4.7948e-06
-2.82613e-05
5.84029e-06
-2.63637e-05
6.2447e-06
-2.39875e-05
3.13022e-07
-3.38364e-05
-9.07868e-06
-4.93809e-05
-1.30892e-05
-3.10131e-05
-1.15458e-05
-2.2767e-05
-1.05621e-05
-9.36043e-06
-9.49111e-06
-5.43745e-06
-8.65853e-06
-2.95956e-06
-9.60313e-06
-2.62361e-08
-1.3108e-05
-1.02395e-06
-1.8208e-05
1.52506e-06
-2.28223e-05
5.76845e-06
-2.09899e-05
2.41069e-05
-1.25414e-05
5.32243e-05
-1.68416e-06
5.97869e-05
1.00059e-05
5.64917e-05
2.03446e-05
5.85257e-05
2.70035e-05
5.54486e-05
3.29277e-05
4.96103e-05
2.47315e-05
3.79008e-05
9.38095e-06
2.82263e-05
5.57937e-06
1.60357e-05
3.84469e-06
5.44549e-06
2.22536e-06
-1.46813e-06
1.13032e-06
-4.59712e-06
4.64105e-07
-4.75911e-06
-2.16219e-06
5.13193e-06
-2.98852e-05
7.02519e-06
-3.16746e-05
9.47705e-06
-2.94707e-05
4.65263e-06
-3.90397e-05
-3.23694e-06
-5.17435e-05
-5.96835e-06
-5.30423e-05
-7.41669e-06
-5.4281e-05
-1.03387e-05
-5.05174e-05
-1.17475e-05
-3.52545e-05
-1.12375e-05
-1.31036e-05
-8.87133e-06
-2.01693e-05
-9.4382e-06
-2.70078e-05
-1.65749e-05
-2.78817e-05
-2.53136e-05
-2.35924e-05
-3.09671e-05
-1.72217e-05
-2.99542e-05
1.00217e-05
-2.02394e-05
3.55134e-05
-7.65658e-06
3.90541e-05
2.3244e-06
3.37772e-05
1.10622e-05
3.92059e-05
1.87091e-05
3.81548e-05
2.59484e-05
3.46376e-05
2.50559e-05
2.98878e-05
1.81207e-05
2.53585e-05
1.42056e-05
1.93036e-05
8.80792e-06
9.15752e-06
3.44506e-06
-1.0665e-06
5.66756e-07
-4.43239e-06
-2.36957e-07
-4.7555e-06
-2.11855e-06
6.54139e-06
-3.8753e-05
7.97868e-06
-3.69991e-05
3.94738e-06
-3.96824e-05
-4.61641e-06
-5.21769e-05
-8.67736e-06
-5.12094e-05
-8.84392e-06
-5.08063e-05
-8.81674e-06
-5.44186e-05
-9.6447e-06
-5.91809e-05
-1.31925e-05
-5.93316e-05
-1.53208e-05
-4.12141e-05
-1.60592e-05
-4.75569e-05
-1.81017e-05
-5.34773e-05
-1.92845e-05
-5.02205e-05
-2.13419e-05
-4.57855e-05
-2.56489e-05
-3.89785e-05
-2.76011e-05
-2.03794e-05
-2.09707e-05
-2.50415e-06
-1.10459e-05
-5.46571e-07
-3.32501e-06
-4.04486e-06
4.31297e-06
2.0659e-06
1.15176e-05
1.9813e-06
1.85219e-05
-4.1474e-07
2.36205e-05
-2.71857e-06
2.79052e-05
-5.58863e-06
2.89607e-05
-6.84189e-06
1.48185e-05
-1.518e-05
-1.32177e-06
-2.60204e-05
-2.8868e-06
-4.77433e-06
-2.42853e-06
-6.05347e-06
-2.8353e-06
5.38384e-06
-4.7389e-05
7.4074e-06
-4.41772e-05
-1.92514e-06
-5.26528e-05
-1.01259e-05
-5.02412e-05
-1.08706e-05
-4.79812e-05
-1.19346e-05
-4.94079e-05
-1.43912e-05
-5.42078e-05
-1.69048e-05
-5.88681e-05
-1.8009e-05
-6.01595e-05
-1.90456e-05
-5.89328e-05
-1.99351e-05
-5.63218e-05
-1.98139e-05
-5.30203e-05
-1.87804e-05
-4.95374e-05
-1.75931e-05
-4.74401e-05
-1.72801e-05
-4.52126e-05
-1.76564e-05
-4.08111e-05
-1.5361e-05
-3.33679e-05
-1.0428e-05
-3.12847e-05
-5.86539e-06
-3.18021e-05
-1.60933e-06
-2.9946e-05
2.03138e-06
-3.1324e-05
4.81088e-06
-3.44116e-05
6.24915e-06
-3.78651e-05
7.75217e-06
-4.1734e-05
7.9037e-06
-4.39365e-05
4.35552e-06
-4.86126e-05
-2.87911e-06
-5.25978e-05
-9.53324e-06
-3.142e-05
-6.24838e-06
-1.01573e-05
-1.15957e-05
-7.71361e-07
-4.66755e-05
-4.03237e-06
-5.33968e-05
-1.11384e-05
-5.41889e-05
-1.26802e-05
-4.63675e-05
-1.38396e-05
-4.59149e-05
-1.62031e-05
-4.81771e-05
-1.87635e-05
-5.40255e-05
-2.03703e-05
-5.73171e-05
-2.10436e-05
-5.72532e-05
-2.06722e-05
-5.59697e-05
-1.98095e-05
-5.38336e-05
-1.90836e-05
-5.03647e-05
-1.81476e-05
-4.75798e-05
-1.66089e-05
-4.57252e-05
-1.50955e-05
-4.41119e-05
-1.38127e-05
-4.30128e-05
-1.20613e-05
-4.18875e-05
-9.82578e-06
-4.10289e-05
-7.50333e-06
-4.1162e-05
-5.40662e-06
-4.17329e-05
-3.78165e-06
-4.33819e-05
-2.44355e-06
-4.56965e-05
-1.11564e-06
-4.82888e-05
4.8298e-07
-5.08151e-05
2.0796e-06
-5.29026e-05
4.29904e-06
-5.41064e-05
3.81797e-06
-5.51466e-05
-5.08044e-06
-5.66838e-05
-6.46789e-06
-3.27038e-05
-2.39634e-05
-3.75339e-06
-4.19724e-05
-9.38011e-06
-5.5438e-05
-1.48876e-05
-4.92425e-05
-1.52271e-05
-4.39688e-05
-1.67859e-05
-4.374e-05
-1.87358e-05
-4.69261e-05
-2.02538e-05
-5.21794e-05
-2.13762e-05
-5.42375e-05
-2.16463e-05
-5.44082e-05
-2.06138e-05
-5.38537e-05
-1.91128e-05
-5.16984e-05
-1.80724e-05
-4.84182e-05
-1.7384e-05
-4.56716e-05
-1.65395e-05
-4.35168e-05
-1.50784e-05
-4.21694e-05
-1.34786e-05
-4.12573e-05
-1.19509e-05
-4.0763e-05
-1.01642e-05
-4.06408e-05
-8.24216e-06
-4.09561e-05
-6.40819e-06
-4.17783e-05
-4.6228e-06
-4.30461e-05
-2.78425e-06
-4.46797e-05
-7.85738e-07
-4.6657e-05
1.3358e-06
-4.87477e-05
3.25497e-06
-5.07143e-05
5.60408e-06
-5.21954e-05
7.42584e-06
-5.30759e-05
2.19043e-06
-5.72693e-05
4.13545e-07
-4.96732e-05
-2.66058e-05
-4.89238e-06
-3.54115e-05
-1.15276e-05
-5.0147e-05
-1.7616e-05
-4.57714e-05
-1.82476e-05
-4.11801e-05
-1.9183e-05
-4.15274e-05
-1.95036e-05
-4.48303e-05
-1.95826e-05
-4.82227e-05
-2.00577e-05
-5.03777e-05
-2.02897e-05
-5.1186e-05
-1.98948e-05
-5.10679e-05
-1.89398e-05
-4.91578e-05
-1.77519e-05
-4.64859e-05
-1.67858e-05
-4.37332e-05
-1.5924e-05
-4.12357e-05
-1.48194e-05
-3.99175e-05
-1.34592e-05
-3.91092e-05
-1.20638e-05
-3.86103e-05
-1.04404e-05
-3.85952e-05
-8.54264e-06
-3.89964e-05
-6.63746e-06
-3.97721e-05
-4.59472e-06
-4.09768e-05
-2.49165e-06
-4.26095e-05
-3.03378e-07
-4.46099e-05
1.97034e-06
-4.67141e-05
4.12978e-06
-4.85964e-05
6.43619e-06
-5.01546e-05
8.46026e-06
-5.08427e-05
3.65561e-06
-5.42937e-05
1.18837e-06
-4.66842e-05
-2.31338e-05
-6.33033e-06
-2.73331e-05
-1.32611e-05
-4.48225e-05
-1.99078e-05
-4.25428e-05
-2.0259e-05
-3.82795e-05
-1.96175e-05
-3.88243e-05
-1.78011e-05
-4.16253e-05
-1.6728e-05
-4.35275e-05
-1.73364e-05
-4.5869e-05
-1.80665e-05
-4.74474e-05
-1.83018e-05
-4.79511e-05
-1.74701e-05
-4.66554e-05
-1.60813e-05
-4.38672e-05
-1.56468e-05
-4.11926e-05
-1.56434e-05
-3.89842e-05
-1.47913e-05
-3.74525e-05
-1.33262e-05
-3.66913e-05
-1.20845e-05
-3.63784e-05
-1.05359e-05
-3.63997e-05
-8.60201e-06
-3.68944e-05
-6.60335e-06
-3.76953e-05
-4.41065e-06
-3.89371e-05
-2.12258e-06
-4.05596e-05
2.51258e-07
-4.24778e-05
2.69365e-06
-4.44845e-05
4.95301e-06
-4.62792e-05
7.16825e-06
-4.76767e-05
9.20418e-06
-4.83966e-05
4.30213e-06
-5.10167e-05
9.80494e-07
-4.33581e-05
-1.96102e-05
-4.65569e-06
-2.23309e-05
-1.30792e-05
-4.01686e-05
-1.99493e-05
-3.97156e-05
-2.01081e-05
-3.49806e-05
-1.79557e-05
-3.52057e-05
-1.47885e-05
-3.80947e-05
-1.3262e-05
-3.96184e-05
-1.38433e-05
-4.14073e-05
-1.52337e-05
-4.3119e-05
-1.66832e-05
-4.4508e-05
-1.73967e-05
-4.36943e-05
-1.6504e-05
-4.0879e-05
-1.51191e-05
-3.81318e-05
-1.47597e-05
-3.63694e-05
-1.44941e-05
-3.49109e-05
-1.33552e-05
-3.41832e-05
-1.20117e-05
-3.40353e-05
-1.04969e-05
-3.41345e-05
-8.55053e-06
-3.46855e-05
-6.4119e-06
-3.55209e-05
-4.09313e-06
-3.67467e-05
-1.63645e-06
-3.83087e-05
8.77984e-07
-4.01109e-05
3.43e-06
-4.19692e-05
5.68569e-06
-4.36637e-05
7.90766e-06
-4.48506e-05
9.97334e-06
-4.55892e-05
5.00202e-06
-4.75691e-05
-1.18823e-07
-4.11049e-05
-1.79731e-05
-3.31209e-06
-2.11193e-05
-1.09237e-05
-3.64762e-05
-1.69237e-05
-3.63786e-05
-1.77654e-05
-3.14979e-05
-1.52007e-05
-3.11102e-05
-1.18118e-05
-3.43897e-05
-1.0243e-05
-3.58352e-05
-1.01956e-05
-3.71878e-05
-1.17242e-05
-3.85678e-05
-1.42782e-05
-4.01243e-05
-1.58652e-05
-3.9987e-05
-1.59658e-05
-3.77324e-05
-1.49415e-05
-3.47137e-05
-1.41869e-05
-3.31345e-05
-1.40528e-05
-3.21156e-05
-1.33346e-05
-3.13806e-05
-1.18801e-05
-3.13328e-05
-1.02496e-05
-3.16397e-05
-8.33519e-06
-3.22044e-05
-6.04842e-06
-3.3116e-05
-3.62665e-06
-3.43054e-05
-1.0426e-06
-3.57887e-05
1.58918e-06
-3.74675e-05
4.15043e-06
-3.92162e-05
6.3815e-06
-4.07526e-05
8.51447e-06
-4.17914e-05
1.04287e-05
-4.24005e-05
6.02388e-06
-4.37261e-05
-6.03019e-07
-3.97716e-05
-1.89884e-05
-1.16853e-06
-2.0785e-05
-6.38162e-06
-3.38128e-05
-1.32578e-05
-3.25847e-05
-1.58108e-05
-2.80555e-05
-1.24778e-05
-2.73534e-05
-8.4704e-06
-3.04988e-05
-6.97356e-06
-3.1905e-05
-6.90716e-06
-3.31972e-05
-8.65022e-06
-3.46471e-05
-1.19363e-05
-3.54571e-05
-1.4569e-05
-3.56628e-05
-1.55149e-05
-3.41626e-05
-1.51068e-05
-3.0942e-05
-1.4008e-05
-2.91683e-05
-1.33571e-05
-2.85603e-05
-1.29438e-05
-2.82099e-05
-1.16209e-05
-2.82148e-05
-9.80885e-06
-2.87065e-05
-7.85021e-06
-2.9358e-05
-5.54316e-06
-3.0389e-05
-3.06407e-06
-3.16142e-05
-3.85376e-07
-3.30958e-05
2.32368e-06
-3.47022e-05
4.78126e-06
-3.636e-05
6.95796e-06
-3.76834e-05
8.85823e-06
-3.84786e-05
1.04935e-05
-3.88155e-05
7.26512e-06
-3.93959e-05
-4.87347e-07
-3.82782e-05
-2.31881e-05
-1.00608e-07
-2.16255e-05
-4.69175e-06
-3.12379e-05
-1.11213e-05
-2.87528e-05
-1.33296e-05
-2.46004e-05
-9.09093e-06
-2.42566e-05
-5.20165e-06
-2.67002e-05
-4.13613e-06
-2.79884e-05
-4.54955e-06
-2.93899e-05
-6.56779e-06
-3.04947e-05
-9.97619e-06
-3.06981e-05
-1.32934e-05
-3.10426e-05
-1.47365e-05
-3.00645e-05
-1.49889e-05
-2.73252e-05
-1.42414e-05
-2.47905e-05
-1.28145e-05
-2.3949e-05
-1.1937e-05
-2.4218e-05
-1.10994e-05
-2.47864e-05
-9.30516e-06
-2.52344e-05
-7.13608e-06
-2.63473e-05
-4.89365e-06
-2.74776e-05
-2.36536e-06
-2.88591e-05
3.22405e-07
-3.03944e-05
2.98793e-06
-3.19521e-05
5.36499e-06
-3.33972e-05
7.3135e-06
-3.43976e-05
8.96552e-06
-3.48178e-05
1.0372e-05
-3.4864e-05
8.75432e-06
-3.44941e-05
1.0428e-06
-3.49013e-05
-2.646e-05
-7.76026e-07
-2.32426e-05
-6.15268e-06
-2.75117e-05
-1.11481e-05
-2.35062e-05
-1.10786e-05
-2.06072e-05
-6.09611e-06
-2.15232e-05
-2.72363e-06
-2.25614e-05
-1.91416e-06
-2.39261e-05
-2.76811e-06
-2.49246e-05
-5.70841e-06
-2.52501e-05
-9.61689e-06
-2.53593e-05
-1.27872e-05
-2.62299e-05
-1.43999e-05
-2.57604e-05
-1.45145e-05
-2.3877e-05
-1.4148e-05
-2.11694e-05
-1.27834e-05
-1.95054e-05
-1.10369e-05
-1.95663e-05
-1.01691e-05
-2.06595e-05
-8.68683e-06
-2.18691e-05
-6.44471e-06
-2.32179e-05
-4.13458e-06
-2.45634e-05
-1.56723e-06
-2.60427e-05
1.09328e-06
-2.7528e-05
3.63725e-06
-2.89106e-05
5.89156e-06
-2.9956e-05
7.71367e-06
-3.05245e-05
9.20124e-06
-3.05909e-05
1.01075e-05
-2.9999e-05
8.02612e-06
-2.92149e-05
3.47721e-06
-2.95851e-05
-2.39329e-05
-3.03534e-06
-2.15392e-05
-9.33408e-06
-2.26403e-05
-1.3814e-05
-1.80822e-05
-9.62761e-06
-1.65887e-05
-3.48465e-06
-1.78451e-05
-1.42597e-06
-1.83695e-05
-6.10603e-07
-1.93157e-05
-1.74366e-06
-1.95392e-05
-4.76381e-06
-1.94481e-05
-9.21047e-06
-1.97336e-05
-1.31008e-05
-2.08552e-05
-1.47746e-05
-2.10579e-05
-1.49944e-05
-1.99143e-05
-1.40904e-05
-1.80499e-05
-1.28005e-05
-1.64358e-05
-1.12371e-05
-1.60191e-05
-9.5488e-06
-1.67539e-05
-7.99104e-06
-1.83002e-05
-5.89752e-06
-1.97609e-05
-3.39417e-06
-2.12065e-05
-6.99556e-07
-2.26289e-05
1.96529e-06
-2.3958e-05
4.44924e-06
-2.50355e-05
6.70793e-06
-2.57598e-05
8.48765e-06
-2.60047e-05
9.80325e-06
-2.55264e-05
1.02306e-05
-2.43902e-05
7.46297e-06
-2.36354e-05
3.12531e-06
-2.41022e-05
-1.895e-05
-4.41784e-06
-1.73686e-05
-1.03533e-05
-1.68873e-05
-1.23262e-05
-1.39236e-05
-7.89475e-06
-1.26952e-05
-2.77265e-06
-1.33522e-05
-6.79781e-07
-1.37152e-05
-4.0397e-07
-1.3581e-05
-2.178e-06
-1.34002e-05
-5.52256e-06
-1.33305e-05
-9.78877e-06
-1.39467e-05
-1.35147e-05
-1.52907e-05
-1.54623e-05
-1.58432e-05
-1.59074e-05
-1.51894e-05
-1.51115e-05
-1.40328e-05
-1.32513e-05
-1.32105e-05
-1.13268e-05
-1.29321e-05
-9.51084e-06
-1.34278e-05
-7.59277e-06
-1.45278e-05
-5.38835e-06
-1.61082e-05
-2.68446e-06
-1.7456e-05
3.74654e-08
-1.87029e-05
2.73313e-06
-1.97795e-05
5.40029e-06
-2.05595e-05
7.71576e-06
-2.10518e-05
9.53753e-06
-2.0809e-05
1.07391e-05
-1.97473e-05
1.08795e-05
-1.85205e-05
8.49371e-06
-1.79972e-05
3.46909e-06
-1.86325e-05
-1.6061e-05
-4.37195e-06
-1.46276e-05
-9.468e-06
-1.2391e-05
-9.54659e-06
-9.87142e-06
-5.80095e-06
-8.41059e-06
-2.4207e-06
-8.17202e-06
-9.32783e-07
-7.58106e-06
-1.24979e-06
-6.96933e-06
-3.26468e-06
-6.64459e-06
-6.74564e-06
-6.90777e-06
-1.10068e-05
-7.96009e-06
-1.44835e-05
-9.69216e-06
-1.62089e-05
-1.05021e-05
-1.66275e-05
-1.01997e-05
-1.58378e-05
-9.51282e-06
-1.39331e-05
-8.98576e-06
-1.17227e-05
-8.89094e-06
-9.5691e-06
-9.58313e-06
-7.42019e-06
-1.07053e-05
-5.02919e-06
-1.21887e-05
-2.24376e-06
-1.34419e-05
6.85909e-07
-1.44502e-05
3.54924e-06
-1.52397e-05
6.20866e-06
-1.58114e-05
8.53121e-06
-1.58235e-05
1.04167e-05
-1.51054e-05
1.14849e-05
-1.38794e-05
1.13964e-05
-1.27952e-05
9.22559e-06
-1.25776e-05
3.8341e-06
-1.34035e-05
-1.41156e-05
-4.14839e-06
-1.20265e-05
-6.61524e-06
-9.25488e-06
-6.17151e-06
-5.95426e-06
-3.76433e-06
-3.51622e-06
-1.9167e-06
-1.77052e-06
-1.52381e-06
-3.85338e-07
-2.65271e-06
4.6577e-07
-5.1305e-06
5.71357e-07
-8.66781e-06
-1.81334e-07
-1.26938e-05
-1.75044e-06
-1.58438e-05
-3.83718e-06
-1.73146e-05
-4.94659e-06
-1.75728e-05
-4.9464e-06
-1.66116e-05
-4.71179e-06
-1.45764e-05
-4.35727e-06
-1.22158e-05
-4.44365e-06
-9.81272e-06
-5.11599e-06
-7.41604e-06
-6.24132e-06
-4.8211e-06
-7.6571e-06
-1.89665e-06
-8.84842e-06
1.10905e-06
-9.79934e-06
3.9645e-06
-1.05023e-05
6.48057e-06
-1.06114e-05
8.60374e-06
-1.01262e-05
1.02383e-05
-9.28994e-06
1.09887e-05
-8.32742e-06
1.04749e-05
-7.76511e-06
8.28898e-06
-7.94033e-06
4.27361e-06
-8.85862e-06
-1.0261e-05
-2.20392e-06
-9.44809e-06
-3.27959e-06
-6.04262e-06
-3.09519e-06
-1.82455e-06
-2.45805e-06
1.78008e-06
-2.22586e-06
4.73988e-06
-2.94111e-06
7.04514e-06
-4.66896e-06
8.17284e-06
-7.42293e-06
8.05414e-06
-1.10763e-05
6.82883e-06
-1.50186e-05
4.78554e-06
-1.7903e-05
2.32847e-06
-1.90519e-05
8.10221e-07
-1.8872e-05
4.8775e-07
-1.74754e-05
3.8878e-07
-1.51981e-05
6.44434e-07
-1.26085e-05
3.90921e-07
-9.99756e-06
-2.67322e-07
-7.42778e-06
-1.43595e-06
-4.64126e-06
-2.81347e-06
-1.63902e-06
-4.08619e-06
1.29919e-06
-4.97173e-06
4.10415e-06
-5.24141e-06
6.64547e-06
-4.83953e-06
8.67353e-06
-4.2407e-06
9.82662e-06
-3.67305e-06
9.8477e-06
-3.32004e-06
8.38305e-06
-3.51496e-06
5.92884e-06
-4.34129e-06
3.33492e-06
-5.32546e-06
-5.80262e-06
-3.6769e-07
-6.55623e-06
-1.01526e-06
-2.0526e-06
-1.48464e-06
2.38993e-06
-2.04714e-06
6.313e-06
-3.19715e-06
1.00972e-05
-5.034e-06
1.35085e-05
-7.40313e-06
1.54781e-05
-1.04325e-05
1.55585e-05
-1.41335e-05
1.41324e-05
-1.79417e-05
1.16814e-05
-2.05423e-05
8.85084e-06
-2.13928e-05
6.78276e-06
-2.07284e-05
5.88128e-06
-1.87166e-05
5.58957e-06
-1.60219e-05
5.61244e-06
-1.31633e-05
5.26675e-06
-1.0316e-05
4.60209e-06
-7.45117e-06
3.44809e-06
-4.36606e-06
2.01247e-06
-1.16856e-06
9.0444e-07
1.99983e-06
4.79451e-07
4.98435e-06
7.20091e-07
7.39636e-06
1.1156e-06
8.92378e-06
1.34665e-06
9.36464e-06
1.22049e-06
8.47328e-06
7.52287e-07
6.35301e-06
-1.66768e-07
4.03287e-06
-1.50585e-06
2.07999e-06
-2.68721e-06
-2.89306e-06
-2.01006e-07
-2.75694e-06
-1.07604e-06
1.4396e-06
-2.05489e-06
5.28364e-06
-3.16105e-06
9.14046e-06
-4.86042e-06
1.33989e-05
-7.37682e-06
1.79211e-05
-1.04602e-05
2.13413e-05
-1.39063e-05
2.25571e-05
-1.77659e-05
2.13496e-05
-2.13736e-05
1.88412e-05
-2.37408e-05
1.56449e-05
-2.43108e-05
1.28426e-05
-2.28188e-05
1.12973e-05
-2.00613e-05
1.08163e-05
-1.69922e-05
1.0515e-05
-1.37553e-05
1.00984e-05
-1.04725e-05
9.43475e-06
-7.07993e-06
8.37046e-06
-3.57792e-06
7.21766e-06
-7.3619e-08
6.5527e-06
3.25612e-06
6.45442e-06
6.06598e-06
6.56078e-06
8.01081e-06
6.50155e-06
8.84702e-06
5.99203e-06
8.50073e-06
5.03474e-06
7.09334e-06
3.80578e-06
5.05207e-06
2.4251e-06
2.95514e-06
8.66725e-07
1.2123e-06
-6.17185e-07
-1.2648e-06
-1.33666e-06
-7.02536e-08
-2.52234e-06
3.45715e-06
-3.81525e-06
7.08357e-06
-5.72725e-06
1.09649e-05
-8.44569e-06
1.58501e-05
-1.1728e-05
2.13079e-05
-1.50847e-05
2.55307e-05
-1.84669e-05
2.79096e-05
-2.20845e-05
2.75652e-05
-2.57169e-05
2.53145e-05
-2.78605e-05
2.20961e-05
-2.71297e-05
1.89433e-05
-2.44248e-05
1.69454e-05
-2.11789e-05
1.6169e-05
-1.76936e-05
1.5573e-05
-1.40229e-05
1.50991e-05
-1.02056e-05
1.45219e-05
-6.19084e-06
1.37285e-05
-2.25702e-06
1.2963e-05
1.36784e-06
1.24508e-05
4.50975e-06
1.2112e-05
6.83501e-06
1.16688e-05
8.06389e-06
1.08214e-05
8.1094e-06
9.45647e-06
7.22091e-06
7.77846e-06
5.81461e-06
6.08547e-06
4.15397e-06
4.49053e-06
2.40757e-06
2.85604e-06
8.72318e-07
1.11556e-06
-2.32366e-07
-1.10939e-06
1.14984e-06
-2.98093e-06
4.80974e-06
-5.51356e-06
8.63242e-06
-9.13616e-06
1.34157e-05
-1.42318e-05
2.0748e-05
-1.93774e-05
2.57392e-05
-2.34608e-05
2.90671e-05
-2.68395e-05
3.12113e-05
-2.94142e-05
3.12375e-05
-3.12162e-05
3.03449e-05
-3.15141e-05
2.79132e-05
-2.92505e-05
2.47783e-05
-2.56079e-05
2.27996e-05
-2.1788e-05
2.179e-05
-1.7838e-05
2.10553e-05
-1.37165e-05
2.05509e-05
-9.35815e-06
2.00463e-05
-4.8784e-06
1.94174e-05
-7.48503e-07
1.86608e-05
2.70548e-06
1.78587e-05
5.32943e-06
1.68874e-05
6.87782e-06
1.55732e-05
7.27681e-06
1.38388e-05
6.77687e-06
1.18006e-05
5.80819e-06
9.73191e-06
4.64327e-06
7.84712e-06
3.35315e-06
6.16162e-06
1.99286e-06
4.48206e-06
7.36707e-07
2.57385e-06
5.8995e-07
-1.43321e-06
1.94861e-06
-3.63359e-06
6.1871e-06
-7.20768e-06
1.10484e-05
-1.56293e-05
2.11589e-05
-2.45773e-05
2.81727e-05
-2.93814e-05
3.10551e-05
-3.17007e-05
3.25444e-05
-3.23538e-05
3.29847e-05
-3.34536e-05
3.19667e-05
-3.49207e-05
3.17624e-05
-3.40982e-05
3.26356e-05
-3.06713e-05
3.05444e-05
-2.63091e-05
2.85615e-05
-2.1868e-05
2.75092e-05
-1.74079e-05
2.67067e-05
-1.28407e-05
2.61206e-05
-8.11714e-06
2.54967e-05
-3.50076e-06
2.46521e-05
4.99868e-07
2.35531e-05
3.47874e-06
2.21122e-05
5.26142e-06
2.02381e-05
5.92521e-06
1.80291e-05
5.78827e-06
1.56791e-05
5.22031e-06
1.33403e-05
4.44462e-06
1.1154e-05
3.55972e-06
9.21221e-06
2.60354e-06
7.48971e-06
1.59989e-06
5.78011e-06
6.31157e-07
3.77379e-06
1.29209e-06
-1.71765e-06
2.83348e-06
-4.49799e-06
8.26198e-06
-1.44224e-05
1.89099e-05
-2.56203e-05
3.00837e-05
-2.98671e-05
3.31529e-05
-3.13304e-05
3.47043e-05
-3.07227e-05
3.48569e-05
-2.9129e-05
3.36478e-05
-2.8943e-05
3.17198e-05
-3.17659e-05
3.03614e-05
-3.35828e-05
3.24362e-05
-3.0815e-05
3.45031e-05
-2.60958e-05
3.32917e-05
-2.12596e-05
3.24246e-05
-1.63974e-05
3.15795e-05
-1.15713e-05
3.07521e-05
-6.83733e-06
2.98114e-05
-2.50044e-06
2.85092e-05
9.68115e-07
2.68019e-05
3.14183e-06
2.45795e-05
4.06246e-06
2.19691e-05
4.24665e-06
1.92892e-05
4.07291e-06
1.67365e-05
3.69049e-06
1.43523e-05
3.16414e-06
1.21728e-05
2.55816e-06
1.02376e-05
1.90382e-06
8.50743e-06
1.21382e-06
6.78329e-06
5.14514e-07
4.72936e-06
1.88954e-06
-2.81674e-06
4.461e-06
-1.16548e-05
1.39045e-05
-2.16481e-05
2.69801e-05
-2.62337e-05
3.34133e-05
-2.72972e-05
3.52197e-05
-2.49344e-05
3.58222e-05
-2.26598e-05
3.50422e-05
-2.26043e-05
3.33961e-05
-2.28905e-05
3.18022e-05
-2.40969e-05
3.04449e-05
-2.77585e-05
3.06196e-05
-2.80739e-05
3.36399e-05
-2.39178e-05
3.41109e-05
-1.9418e-05
3.42135e-05
-1.47647e-05
3.38639e-05
-1.01997e-05
3.30754e-05
-5.97679e-06
3.18791e-05
-2.36872e-06
3.01834e-05
2.09249e-07
2.79681e-05
1.61401e-06
2.53512e-05
2.21445e-06
2.25657e-05
2.42963e-06
1.98458e-05
2.42904e-06
1.73094e-05
2.26751e-06
1.49799e-05
1.98983e-06
1.28635e-05
1.64368e-06
1.09676e-05
1.25514e-06
9.2491e-06
8.3603e-07
7.52421e-06
3.79962e-07
5.45508e-06
2.37418e-06
-5.12481e-06
8.76822e-06
-1.36874e-05
2.0239e-05
-1.94758e-05
2.89646e-05
-1.76436e-05
3.38037e-05
-1.5485e-05
3.57902e-05
-1.58173e-05
3.52361e-05
-1.67462e-05
3.44324e-05
-1.71978e-05
3.33304e-05
-1.77412e-05
3.20677e-05
-1.83172e-05
3.13743e-05
-1.92471e-05
3.15063e-05
-1.99786e-05
3.1786e-05
-1.90209e-05
3.22321e-05
-1.65084e-05
3.27863e-05
-1.31023e-05
3.29469e-05
-9.40986e-06
3.26034e-05
-5.98961e-06
3.15745e-05
-3.25251e-06
2.98999e-05
-1.45367e-06
2.7712e-05
-3.51834e-07
2.52289e-05
3.54798e-07
2.25924e-05
7.55844e-07
1.9986e-05
9.50836e-07
1.75513e-05
1.00079e-06
1.53218e-05
9.45286e-07
1.329e-05
8.24296e-07
1.14482e-05
6.63078e-07
9.75306e-06
4.74851e-07
8.03697e-06
2.34891e-07
5.97181e-06
2.74019e-06
-6.75259e-06
1.36869e-05
-3.10887e-06
2.25901e-05
-3.03174e-06
2.88532e-05
-7.26435e-06
3.27533e-05
-1.07415e-05
3.5002e-05
-1.1964e-05
3.52058e-05
-1.23869e-05
3.44999e-05
-1.28239e-05
3.34708e-05
-1.32996e-05
3.2633e-05
-1.36436e-05
3.23744e-05
-1.36915e-05
3.22679e-05
-1.3574e-05
3.19719e-05
-1.32007e-05
3.17051e-05
-1.23757e-05
3.16235e-05
-1.09753e-05
3.14667e-05
-8.97133e-06
3.111e-05
-6.74033e-06
3.02799e-05
-4.80318e-06
2.88788e-05
-3.27149e-06
2.69926e-05
-2.09672e-06
2.47451e-05
-1.25809e-06
2.23015e-05
-6.89621e-07
1.98679e-05
-3.17849e-07
1.75724e-05
-8.73896e-08
1.54541e-05
4.16243e-08
1.35091e-05
1.07267e-07
1.17251e-05
1.3532e-07
1.00583e-05
1.40551e-07
8.35611e-06
8.93583e-08
6.30482e-06
2.98915e-06
2.31972e-06
1.34223e-05
-3.13598e-08
2.11787e-05
-4.2236e-06
2.82653e-05
-6.54767e-06
3.32211e-05
-8.09513e-06
3.514e-05
-8.97719e-06
3.5146e-05
-9.20312e-06
3.45236e-05
-9.41451e-06
3.37239e-05
-9.68874e-06
3.31933e-05
-9.96744e-06
3.29297e-05
-1.00691e-05
3.26589e-05
-1.00863e-05
3.23108e-05
-9.98232e-06
3.19855e-05
-9.66781e-06
3.15953e-05
-9.08209e-06
3.10404e-05
-8.18207e-06
3.0303e-05
-7.00807e-06
2.93139e-05
-5.71148e-06
2.79677e-05
-4.46779e-06
2.6212e-05
-3.39239e-06
2.41274e-05
-2.52638e-06
2.18749e-05
-1.86092e-06
1.96134e-05
-1.3628e-06
1.74523e-05
-9.94287e-07
1.54367e-05
-7.19924e-07
1.35702e-05
-5.04533e-07
1.18397e-05
-3.22631e-07
1.0201e-05
-1.58552e-07
8.51451e-06
-4.93523e-08
6.48103e-06
3.12929e-06
2.53101e-06
8.44767e-06
-8.16901e-07
1.92305e-05
-4.38014e-06
2.67153e-05
-6.69524e-06
3.3789e-05
-6.96804e-06
3.56529e-05
-6.86853e-06
3.50573e-05
-6.66842e-06
3.43835e-05
-6.66697e-06
3.38272e-05
-6.86199e-06
3.35162e-05
-7.11505e-06
3.3305e-05
-7.36235e-06
3.3037e-05
-7.62698e-06
3.26888e-05
-7.81785e-06
3.227e-05
-7.84607e-06
3.16997e-05
-7.67319e-06
3.09368e-05
-7.28655e-06
2.9971e-05
-6.69227e-06
2.87728e-05
-5.9277e-06
2.73028e-05
-5.0679e-06
2.55475e-05
-4.20634e-06
2.35583e-05
-3.41848e-06
2.14396e-05
-2.74191e-06
1.93074e-05
-2.18149e-06
1.72521e-05
-1.72294e-06
1.53187e-05
-1.3427e-06
1.35153e-05
-1.01257e-06
1.18287e-05
-7.09231e-07
1.02135e-05
-4.17832e-07
8.54182e-06
-1.76185e-07
6.52644e-06
3.1747e-06
-4.70082e-07
6.46234e-06
-3.13379e-06
1.70751e-05
-5.05946e-06
2.59559e-05
-6.75491e-06
3.59582e-05
-5.75373e-06
3.55026e-05
-4.66799e-06
3.45201e-05
-4.26504e-06
3.3979e-05
-4.2786e-06
3.38085e-05
-4.53303e-06
3.37939e-05
-4.88862e-06
3.37285e-05
-5.32157e-06
3.3524e-05
-5.7841e-06
3.31695e-05
-6.17441e-06
3.26418e-05
-6.42374e-06
3.19075e-05
-6.50902e-06
3.09633e-05
-6.4268e-06
2.98123e-05
-6.17891e-06
2.84489e-05
-5.77277e-06
2.68656e-05
-5.2328e-06
2.5072e-05
-4.6087e-06
2.31116e-05
-3.96208e-06
2.10601e-05
-3.34327e-06
1.90047e-05
-2.78002e-06
1.70182e-05
-2.27908e-06
1.51407e-05
-1.832e-06
1.3381e-05
-1.42058e-06
1.17245e-05
-1.0261e-06
1.01253e-05
-6.36504e-07
8.46431e-06
-2.88274e-07
6.46514e-06
3.14216e-06
-2.67436e-06
5.82601e-06
-5.42279e-06
1.6928e-05
-6.04123e-06
3.0621e-05
-4.06507e-06
3.60726e-05
-2.68107e-06
3.39216e-05
-1.94429e-06
3.35048e-05
-1.91701e-06
3.36136e-05
-2.1997e-06
3.39523e-05
-2.64725e-06
3.42252e-05
-3.20419e-06
3.43025e-05
-3.82609e-06
3.41516e-05
-4.43587e-06
3.37569e-05
-4.95174e-06
3.31118e-05
-5.33356e-06
3.22248e-05
-5.57117e-06
3.11163e-05
-5.66642e-06
2.9804e-05
-5.62312e-06
2.82992e-05
-5.44373e-06
2.66115e-05
-5.13447e-06
2.4761e-05
-4.71567e-06
2.27888e-05
-4.22359e-06
2.07569e-05
-3.69942e-06
1.87352e-05
-3.17648e-06
1.67828e-05
-2.67375e-06
1.49344e-05
-2.19541e-06
1.31974e-05
-1.73377e-06
1.15557e-05
-1.27651e-06
9.96253e-06
-8.15573e-07
8.30585e-06
-3.84497e-07
6.31944e-06
3.04806e-06
-3.03867e-06
6.90611e-06
-8.01318e-06
2.24256e-05
-5.205e-06
3.25383e-05
2.27903e-08
3.18525e-05
2.39944e-07
3.1965e-05
2.15303e-07
3.28737e-05
-9.92666e-08
3.37148e-05
-6.24784e-07
3.44406e-05
-1.29778e-06
3.49061e-05
-2.05145e-06
3.50692e-05
-2.81537e-06
3.49106e-05
-3.51253e-06
3.44296e-05
-4.09267e-06
3.36518e-05
-4.53893e-06
3.26138e-05
-4.85139e-06
3.13514e-05
-5.03769e-06
2.98938e-05
-5.10598e-06
2.82632e-05
-5.06048e-06
2.64789e-05
-4.90237e-06
2.4566e-05
-4.63706e-06
2.25636e-05
-4.28079e-06
2.05251e-05
-3.85931e-06
1.85089e-05
-3.40003e-06
1.65646e-05
-2.92443e-06
1.47224e-05
-2.44385e-06
1.29887e-05
-1.95906e-06
1.13464e-05
-1.46443e-06
9.74863e-06
-9.5624e-07
8.08859e-06
-4.64263e-07
6.11033e-06
2.90767e-06
-7.90907e-06
1.54286e-05
-2.24881e-07
2.53727e-05
3.49395e-06
2.67855e-05
2.44501e-06
2.84622e-05
2.18074e-06
3.12488e-05
1.74989e-06
3.29832e-05
1.1343e-06
3.43407e-05
3.5241e-07
3.5267e-05
-5.27738e-07
3.58278e-05
-1.42197e-06
3.59996e-05
-2.25445e-06
3.57594e-05
-2.97062e-06
3.51465e-05
-3.55267e-06
3.42168e-05
-4.00209e-06
3.3024e-05
-4.32807e-06
3.16161e-05
-4.54322e-06
3.00273e-05
-4.65933e-06
2.82857e-05
-4.68292e-06
2.64154e-05
-4.61454e-06
2.44437e-05
-4.45308e-06
2.24066e-05
-4.20235e-06
2.03504e-05
-3.8741e-06
1.83246e-05
-3.48548e-06
1.63718e-05
-3.05383e-06
1.45189e-05
-2.59191e-06
1.27724e-05
-2.10549e-06
1.11158e-05
-1.59459e-06
9.50315e-06
-1.05964e-06
7.83239e-06
-5.26608e-07
5.85768e-06
2.73564e-06
-2.50347e-06
1.93128e-05
6.02435e-06
1.93533e-05
4.35759e-06
2.2907e-05
3.79112e-06
2.77503e-05
3.03578e-06
3.09686e-05
2.54643e-06
3.35174e-05
1.64117e-06
3.52184e-05
6.62329e-07
3.62908e-05
-3.43845e-07
3.68977e-05
-1.292e-06
3.69896e-05
-2.10604e-06
3.66144e-05
-2.76747e-06
3.58445e-05
-3.28779e-06
3.4753e-05
-3.68081e-06
3.34074e-05
-3.96845e-06
3.18644e-05
-4.16544e-06
3.01615e-05
-4.28447e-06
2.83264e-05
-4.33276e-06
2.63844e-05
-4.31061e-06
2.43627e-05
-4.21399e-06
2.22941e-05
-4.03943e-06
2.02181e-05
-3.78824e-06
1.81766e-05
-3.46732e-06
1.62065e-05
-3.08682e-06
1.43321e-05
-2.65677e-06
1.25607e-05
-2.18437e-06
1.08783e-05
-1.6734e-06
9.24159e-06
-1.1279e-06
7.55377e-06
-5.70692e-07
5.57948e-06
2.54635e-06
7.33304e-06
1.12096e-05
5.41443e-06
1.50191e-05
4.61654e-06
2.17118e-05
3.52887e-06
2.67486e-05
3.10899e-06
3.09776e-05
2.44637e-06
3.4445e-05
1.29817e-06
3.64542e-05
2.24652e-07
3.75172e-05
-7.79295e-07
3.80517e-05
-1.62534e-06
3.79748e-05
-2.30558e-06
3.74038e-05
-2.8367e-06
3.64462e-05
-3.23704e-06
3.51952e-05
-3.52471e-06
3.37206e-05
-3.73137e-06
3.20618e-05
-3.87532e-06
3.02657e-05
-3.96671e-06
2.83584e-05
-4.0108e-06
2.63624e-05
-4.00653e-06
2.43032e-05
-3.94761e-06
2.22103e-05
-3.82602e-06
2.01174e-05
-3.63582e-06
1.80596e-05
-3.37538e-06
1.60686e-05
-3.04722e-06
1.41667e-05
-2.65638e-06
1.23623e-05
-2.20866e-06
1.06448e-05
-1.70941e-06
8.97576e-06
-1.16534e-06
7.26547e-06
-5.97117e-07
5.29054e-06
2.35299e-06
4.08038e-06
5.34615e-06
4.08345e-06
1.36218e-05
3.04892e-06
2.01376e-05
2.47369e-06
2.59701e-05
2.59856e-06
3.17912e-05
1.50982e-06
3.57678e-05
-7.88033e-08
3.80134e-05
-1.16888e-06
3.88688e-05
-1.89143e-06
3.91485e-05
-2.42317e-06
3.88122e-05
-2.81989e-06
3.80242e-05
-3.11278e-06
3.6892e-05
-3.32177e-06
3.55022e-05
-3.47385e-06
3.39162e-05
-3.57138e-06
3.21827e-05
-3.63885e-06
3.03223e-05
-3.6845e-06
2.83668e-05
-3.70788e-06
2.63368e-05
-3.70506e-06
2.42548e-05
-3.66716e-06
2.21471e-05
-3.58273e-06
2.00424e-05
-3.44075e-06
1.79703e-05
-3.23309e-06
1.59581e-05
-2.9555e-06
1.4026e-05
-2.60746e-06
1.21834e-05
-2.19149e-06
1.04237e-05
-1.71253e-06
8.71508e-06
-1.17866e-06
6.97708e-06
-6.08888e-07
5.00161e-06
2.16526e-06
1.16858e-06
3.75565e-06
1.38291e-06
1.18279e-05
7.25025e-07
1.863e-05
1.13849e-06
2.61542e-05
3.59846e-07
3.28467e-05
-5.82041e-07
3.92036e-05
-2.29863e-06
4.30439e-05
-3.25787e-06
4.11675e-05
-3.47286e-06
4.02002e-05
-3.51097e-06
3.9418e-05
-3.50954e-06
3.83942e-05
-3.49552e-06
3.71211e-05
-3.47521e-06
3.56392e-05
-3.45415e-06
3.39904e-05
-3.4384e-06
3.22091e-05
-3.42168e-06
3.0324e-05
-3.41437e-06
2.83464e-05
-3.41076e-06
2.63038e-05
-3.40232e-06
2.42146e-05
-3.37716e-06
2.21023e-05
-3.3208e-06
1.99918e-05
-3.21847e-06
1.79086e-05
-3.05731e-06
1.5876e-05
-2.82771e-06
1.39128e-05
-2.52391e-06
1.20291e-05
-2.14441e-06
1.02224e-05
-1.69222e-06
8.46775e-06
-1.17531e-06
6.69647e-06
-6.10731e-07
4.71975e-06
1.98784e-06
-1.35319e-07
3.56533e-06
-1.03626e-06
1.01961e-05
-1.00994e-06
1.78419e-05
-2.45684e-06
2.54895e-05
-1.32087e-06
3.75137e-05
-2.41594e-06
4.67049e-05
-5.69485e-06
5.01205e-05
-6.09153e-06
4.4176e-05
-5.16813e-06
4.08233e-05
-4.59648e-06
3.9675e-05
-4.16479e-06
3.84662e-05
-3.83908e-06
3.7114e-05
-3.59307e-06
3.55998e-05
-3.40941e-06
3.39395e-05
-3.2771e-06
3.21554e-05
-3.19026e-06
3.02688e-05
-3.13302e-06
2.83021e-05
-3.10471e-06
2.62673e-05
-3.09102e-06
2.41859e-05
-3.07685e-06
2.20788e-05
-3.04502e-06
1.99683e-05
-2.97786e-06
1.78767e-05
-2.85909e-06
1.5825e-05
-2.67514e-06
1.38304e-05
-2.41603e-06
1.1904e-05
-2.07621e-06
1.00469e-05
-1.65583e-06
8.24129e-06
-1.16139e-06
6.43091e-06
-6.0712e-07
4.44998e-06
1.82138e-06
-1.48785e-06
2.89988e-06
-2.21374e-06
9.42869e-06
-3.39033e-06
1.62162e-05
-2.59599e-06
3.15278e-05
-3.50515e-06
4.59356e-05
-6.75537e-06
5.27563e-05
-8.84806e-06
5.32222e-05
-8.40418e-06
4.52477e-05
-6.6274e-06
4.05134e-05
-5.3507e-06
3.94243e-05
-4.5611e-06
3.82248e-05
-3.99186e-06
3.68895e-05
-3.57274e-06
3.5407e-05
-3.26586e-06
3.37847e-05
-3.04803e-06
3.20376e-05
-2.90294e-06
3.01845e-05
-2.81572e-06
2.82468e-05
-2.7733e-06
2.62378e-05
-2.76123e-06
2.41768e-05
-2.76165e-06
2.20833e-05
-2.75529e-06
1.99775e-05
-2.7224e-06
1.78798e-05
-2.64429e-06
1.58092e-05
-2.50467e-06
1.37828e-05
-2.2904e-06
1.18126e-05
-1.99249e-06
9.90284e-06
-1.60784e-06
8.04238e-06
-1.14045e-06
6.1874e-06
-6.00718e-07
4.19685e-06
1.66524e-06
-1.53062e-06
3.34384e-06
-3.72717e-06
8.19299e-06
-4.9556e-06
2.47138e-05
-6.44014e-06
4.23069e-05
-8.70281e-06
5.19814e-05
-9.19886e-06
5.47875e-05
-9.01111e-06
5.33155e-05
-8.29527e-06
4.54469e-05
-6.71594e-06
3.99189e-05
-5.39581e-06
3.88762e-05
-4.47854e-06
3.77619e-05
-3.81064e-06
3.65065e-05
-3.31634e-06
3.51055e-05
-2.95378e-06
3.35625e-05
-2.69887e-06
3.18857e-05
-2.53051e-06
3.0091e-05
-2.43719e-06
2.81993e-05
-2.399e-06
2.62298e-05
-2.40077e-06
2.41989e-05
-2.42363e-06
2.21253e-05
-2.44727e-06
2.00276e-05
-2.45078e-06
1.79247e-05
-2.41396e-06
1.5835e-05
-2.31876e-06
1.37756e-05
-2.14995e-06
1.176e-05
-1.89582e-06
9.79533e-06
-1.55013e-06
7.87686e-06
-1.11364e-06
5.97236e-06
-5.9223e-07
3.96536e-06
1.52001e-06
5.01638e-08
3.8667e-06
-6.08302e-06
1.49075e-05
-1.19579e-05
3.82574e-05
-1.24463e-05
4.90483e-05
-1.18579e-05
5.34642e-05
-9.53055e-06
5.42929e-05
-7.5827e-06
5.0195e-05
-6.49754e-06
4.35359e-05
-5.50314e-06
3.926e-05
-4.43147e-06
3.82141e-05
-3.69238e-06
3.7203e-05
-3.14417e-06
3.60581e-05
-2.7223e-06
3.47677e-05
-2.4049e-06
3.33281e-05
-2.1827e-06
3.17387e-05
-2.04096e-06
3.00166e-05
-1.97212e-06
2.81841e-05
-1.96219e-06
2.62614e-05
-1.99458e-06
2.42662e-05
-2.05142e-06
2.22159e-05
-2.11267e-06
2.01278e-05
-2.15721e-06
1.80199e-05
-2.16444e-06
1.591e-05
-2.11537e-06
1.38156e-05
-1.99356e-06
1.17522e-05
-1.78548e-06
9.73007e-06
-1.48206e-06
7.75024e-06
-1.08035e-06
5.79149e-06
-5.81139e-07
3.76087e-06
1.38852e-06
-5.97358e-06
9.21482e-06
-1.09913e-05
2.88349e-05
-1.60204e-05
4.44961e-05
-1.43306e-05
5.06343e-05
-1.2012e-05
5.25714e-05
-7.72285e-06
5.11935e-05
-3.80727e-06
4.3526e-05
-2.09568e-06
3.91702e-05
-1.95048e-06
3.7811e-05
-2.03476e-06
3.72855e-05
-2.0121e-06
3.65822e-05
-1.88285e-06
3.56408e-05
-1.71327e-06
3.44906e-05
-1.56175e-06
3.31494e-05
-1.45483e-06
3.16422e-05
-1.39729e-06
2.99938e-05
-1.39401e-06
2.82244e-05
-1.4407e-06
2.63518e-05
-1.52497e-06
2.43932e-05
-1.63085e-06
2.23661e-05
-1.74005e-06
2.02869e-05
-1.83273e-06
1.81726e-05
-1.88867e-06
1.60409e-05
-1.88883e-06
1.39096e-05
-1.81654e-06
1.17958e-05
-1.65741e-06
9.71316e-06
-1.40023e-06
7.66815e-06
-1.03807e-06
5.65006e-06
-5.66104e-07
3.58859e-06
1.27497e-06
-1.11908e-05
1.85083e-05
-1.47646e-05
3.79604e-05
-1.57751e-05
4.56658e-05
-1.35268e-05
5.01799e-05
-8.71392e-06
4.88717e-05
-2.75524e-06
4.56671e-05
8.1709e-07
3.8093e-05
2.04405e-06
3.6283e-05
1.58709e-06
3.63181e-05
8.03653e-07
3.64051e-05
1.99521e-07
3.60582e-05
-1.53879e-07
3.53212e-05
-3.31192e-07
3.42955e-05
-4.22893e-07
3.30478e-05
-4.92243e-07
3.16233e-05
-5.69896e-07
3.00482e-05
-6.75035e-07
2.83402e-05
-8.11827e-07
2.6516e-05
-9.72933e-07
2.45925e-05
-1.14659e-06
2.25857e-05
-1.31738e-06
2.05119e-05
-1.46771e-06
1.83878e-05
-1.579e-06
1.62312e-05
-1.63304e-06
1.40606e-05
-1.61349e-06
1.18944e-05
-1.50639e-06
9.7486e-06
-1.29959e-06
7.63477e-06
-9.82696e-07
5.55202e-06
-5.44805e-07
3.45226e-06
1.18257e-06
-9.32492e-06
2.50946e-05
-1.39235e-05
4.1321e-05
-1.36315e-05
4.56267e-05
-8.58974e-06
4.58661e-05
-2.06653e-06
4.46424e-05
2.43981e-06
3.92749e-05
4.2394e-06
3.54002e-05
4.60019e-06
3.51191e-05
4.05763e-06
3.55846e-05
3.19662e-06
3.59384e-05
2.37217e-06
3.57676e-05
1.73662e-06
3.51306e-05
1.28868e-06
3.41764e-05
9.65083e-07
3.30039e-05
6.99019e-07
3.16609e-05
4.52608e-07
3.01666e-05
2.03836e-07
2.85295e-05
-5.47265e-08
2.67603e-05
-3.20315e-07
2.48726e-05
-5.84113e-07
2.28827e-05
-8.3365e-07
2.08084e-05
-1.05425e-06
1.86682e-05
-1.2299e-06
1.64812e-05
-1.3442e-06
1.42672e-05
-1.38195e-06
1.20458e-05
-1.33003e-06
9.83502e-06
-1.1771e-06
7.64975e-06
-9.10866e-07
5.49765e-06
-5.14808e-07
3.35214e-06
1.11144e-06
-6.81159e-06
2.96766e-05
-1.02875e-05
4.15712e-05
-8.38355e-06
4.30253e-05
-2.45597e-06
4.14038e-05
3.00275e-06
3.95731e-05
5.67015e-06
3.42025e-05
6.51403e-06
3.36558e-05
6.43902e-06
3.43362e-05
5.86302e-06
3.52215e-05
5.06003e-06
3.57544e-05
4.25687e-06
3.56164e-05
3.56994e-06
3.49732e-05
3.01036e-06
3.40455e-05
2.53652e-06
3.29472e-05
2.10104e-06
3.17076e-05
1.68002e-06
3.0322e-05
1.26409e-06
2.87803e-05
8.53033e-07
2.7082e-05
4.52629e-07
2.52373e-05
7.21725e-08
2.32638e-05
-2.77424e-07
2.11834e-05
-5.84336e-07
1.90189e-05
-8.36028e-07
1.67933e-05
-1.01919e-06
1.45286e-05
-1.12064e-06
1.22466e-05
-1.12864e-06
9.96742e-06
-1.0333e-06
7.70815e-06
-8.22572e-07
5.48264e-06
-4.75836e-07
3.28409e-06
1.05823e-06
-5.9949e-06
3.42361e-05
-5.47065e-06
3.72027e-05
-1.19477e-06
3.53527e-05
4.4144e-06
3.62682e-05
7.05063e-06
3.31498e-05
7.59424e-06
3.14453e-05
8.06022e-06
3.24251e-05
7.8171e-06
3.3599e-05
7.22584e-06
3.4893e-05
6.54226e-06
3.55904e-05
5.9044e-06
3.53692e-05
5.33969e-06
3.4647e-05
4.81335e-06
3.3749e-05
4.2809e-06
3.27691e-05
3.7191e-06
3.16905e-05
3.1305e-06
3.04684e-05
2.53044e-06
2.90666e-05
1.93778e-06
2.74705e-05
1.37047e-06
2.56864e-05
8.43571e-07
2.37353e-05
3.69025e-07
2.1646e-05
-4.34844e-08
1.94493e-05
-3.85586e-07
1.71758e-05
-6.4838e-07
1.48515e-05
-8.22164e-07
1.25007e-05
-8.97433e-07
1.01465e-05
-8.6579e-07
7.80805e-06
-7.16885e-07
5.50378e-06
-4.28694e-07
3.24422e-06
1.02017e-06
-2.20105e-06
3.60563e-05
1.2215e-06
3.14759e-05
6.11386e-06
2.9129e-05
8.66525e-06
3.0069e-05
8.23616e-06
2.92244e-05
8.78467e-06
2.98694e-05
9.07728e-06
3.11296e-05
8.83584e-06
3.26441e-05
8.35707e-06
3.44402e-05
7.89776e-06
3.51948e-05
7.5424e-06
3.47481e-05
7.20999e-06
3.39385e-05
6.79592e-06
3.3142e-05
6.25384e-06
3.23731e-05
5.58802e-06
3.15437e-05
4.83217e-06
3.05611e-05
4.03121e-06
2.93599e-05
3.22955e-06
2.79107e-05
2.46374e-06
2.62162e-05
1.75968e-06
2.43017e-05
1.13372e-06
2.22057e-05
5.94994e-07
1.9971e-05
1.46787e-07
1.76417e-05
-2.07972e-07
1.52498e-05
-4.64812e-07
1.28212e-05
-6.17091e-07
1.03834e-05
-6.56771e-07
7.95929e-06
-5.775e-07
5.56954e-06
-3.63677e-07
3.23828e-06
1.00024e-06
2.68725e-06
3.23767e-05
5.64196e-06
2.77601e-05
7.86426e-06
2.70761e-05
8.62994e-06
2.7535e-05
8.80023e-06
2.74596e-05
9.47917e-06
2.83807e-05
9.82473e-06
2.95433e-05
9.69855e-06
3.12689e-05
9.47837e-06
3.36919e-05
9.42175e-06
3.42943e-05
9.44741e-06
3.35262e-05
9.36764e-06
3.27347e-05
9.0577e-06
3.21818e-05
8.50027e-06
3.17395e-05
7.72758e-06
3.12499e-05
6.79854e-06
3.0581e-05
5.78337e-06
2.96428e-05
4.75174e-06
2.83902e-05
3.76167e-06
2.68206e-05
2.85325e-06
2.49635e-05
2.05113e-06
2.28681e-05
1.36696e-06
2.05909e-05
7.98952e-07
1.82008e-05
3.4115e-07
1.57419e-05
-9.42418e-09
1.32369e-05
-2.51638e-07
1.07129e-05
-3.78719e-07
8.19592e-06
-3.82953e-07
5.71057e-06
-2.57019e-07
3.29426e-06
1.01458e-06
6.32157e-06
2.45808e-05
7.76781e-06
2.4996e-05
8.46306e-06
2.60626e-05
8.66354e-06
2.61657e-05
9.14171e-06
2.57847e-05
9.98276e-06
2.64503e-05
1.04741e-05
2.74539e-05
1.06309e-05
2.94114e-05
1.08606e-05
3.22994e-05
1.13896e-05
3.25685e-05
1.17553e-05
3.16576e-05
1.18156e-05
3.11417e-05
1.1535e-05
3.09862e-05
1.09423e-05
3.09578e-05
1.00706e-05
3.08577e-05
8.98371e-06
3.05465e-05
7.7638e-06
2.99161e-05
6.5006e-06
2.89026e-05
5.27546e-06
2.74932e-05
4.14733e-06
2.57147e-05
3.15476e-06
2.36284e-05
2.31102e-06
2.13182e-05
1.60485e-06
1.8876e-05
1.01334e-06
1.63618e-05
5.312e-07
1.37879e-05
1.61814e-07
1.1178e-05
-8.47022e-08
8.55731e-06
-1.95182e-07
5.9574e-06
-1.64435e-07
3.43104e-06
1.06105e-06
8.04027e-06
1.59881e-05
8.4004e-06
2.18758e-05
8.69336e-06
2.5267e-05
8.80416e-06
2.46807e-05
9.42937e-06
2.37291e-05
1.04192e-05
2.40229e-05
1.10279e-05
2.48255e-05
1.16754e-05
2.7097e-05
1.28072e-05
3.02047e-05
1.37984e-05
2.98439e-05
1.4243e-05
2.92982e-05
1.42916e-05
2.93365e-05
1.40024e-05
2.96927e-05
1.33878e-05
3.01332e-05
1.24639e-05
3.04521e-05
1.12784e-05
3.05095e-05
9.90405e-06
3.0199e-05
8.43983e-06
2.94493e-05
6.99128e-06
2.82307e-05
5.64899e-06
2.65575e-05
4.45894e-06
2.45053e-05
3.42424e-06
2.21895e-05
2.5301e-06
1.97219e-05
1.74919e-06
1.71586e-05
1.09382e-06
1.45088e-05
5.667e-07
1.18055e-05
1.78608e-07
9.06748e-06
-5.14416e-08
6.32646e-06
-1.11184e-07
3.64923e-06
1.13086e-06
6.27167e-06
9.87867e-06
7.51355e-06
1.87042e-05
8.5499e-06
2.41529e-05
9.0981e-06
2.25768e-05
9.84251e-06
2.11815e-05
1.08633e-05
2.11578e-05
1.17088e-05
2.17282e-05
1.30567e-05
2.36301e-05
1.53907e-05
2.72048e-05
1.63129e-05
2.64649e-05
1.67384e-05
2.66707e-05
1.68104e-05
2.73852e-05
1.65292e-05
2.83156e-05
1.58759e-05
2.92703e-05
1.48897e-05
3.00385e-05
1.36301e-05
3.04771e-05
1.21524e-05
3.04913e-05
1.05386e-05
3.00211e-05
8.90342e-06
2.90232e-05
7.35069e-06
2.74861e-05
5.92367e-06
2.54984e-05
4.64044e-06
2.32013e-05
3.50239e-06
2.07303e-05
2.50355e-06
1.81335e-05
1.66385e-06
1.54085e-05
9.69768e-07
1.26111e-05
4.28239e-07
9.74004e-06
7.26969e-08
6.82945e-06
-7.40087e-08
3.95913e-06
1.23384e-06
3.82217e-06
6.77745e-06
5.79507e-06
1.62073e-05
8.32383e-06
2.19306e-05
9.65875e-06
1.9576e-05
1.0512e-05
1.81389e-05
1.15763e-05
1.79262e-05
1.26514e-05
1.82193e-05
1.51162e-05
1.95266e-05
1.79259e-05
2.27923e-05
1.8638e-05
2.29249e-05
1.92219e-05
2.396e-05
1.93763e-05
2.53265e-05
1.9132e-05
2.68734e-05
1.84534e-05
2.83614e-05
1.74195e-05
2.95894e-05
1.6102e-05
3.04103e-05
1.45488e-05
3.07332e-05
1.28239e-05
3.05737e-05
1.10407e-05
2.98817e-05
9.28907e-06
2.8546e-05
7.57953e-06
2.6665e-05
5.95255e-06
2.43695e-05
4.46508e-06
2.18331e-05
3.24403e-06
1.91726e-05
2.22771e-06
1.63918e-05
1.36319e-06
1.35394e-05
6.67325e-07
1.05481e-05
1.86964e-07
7.46213e-06
-4.52273e-08
4.36909e-06
1.38365e-06
1.17526e-06
5.26767e-06
3.60375e-06
1.50632e-05
8.1742e-06
1.87637e-05
1.03187e-05
1.58333e-05
1.13419e-05
1.47122e-05
1.25163e-05
1.43597e-05
1.38809e-05
1.43602e-05
1.70155e-05
1.51876e-05
1.99848e-05
1.74705e-05
2.0851e-05
1.93166e-05
2.15418e-05
2.12272e-05
2.18205e-05
2.32731e-05
2.16416e-05
2.54322e-05
2.09981e-05
2.74564e-05
1.99856e-05
2.91176e-05
1.86721e-05
3.02436e-05
1.71396e-05
3.08897e-05
1.54446e-05
3.11744e-05
1.36466e-05
3.09268e-05
1.17293e-05
2.98385e-05
9.51976e-06
2.7978e-05
7.25601e-06
2.56146e-05
5.28086e-06
2.30007e-05
3.91297e-06
2.02128e-05
2.73013e-06
1.73084e-05
1.70731e-06
1.44038e-05
8.91805e-07
1.1369e-05
2.97265e-07
8.1625e-06
-1.09838e-08
4.8636e-06
1.5928e-06
-1.05366e-06
4.10401e-06
2.7079e-06
1.04381e-05
9.33694e-06
1.45294e-05
1.09293e-05
1.22727e-05
1.21371e-05
1.11631e-05
1.35257e-05
1.04468e-05
1.54391e-05
1.00988e-05
1.8531e-05
1.05104e-05
2.11201e-05
1.26532e-05
2.24491e-05
1.57589e-05
2.33854e-05
1.85293e-05
2.39082e-05
2.12997e-05
2.38808e-05
2.40845e-05
2.33467e-05
2.66182e-05
2.24178e-05
2.86159e-05
2.12435e-05
3.00411e-05
1.98645e-05
3.11078e-05
1.83039e-05
3.21426e-05
1.65708e-05
3.28477e-05
1.45291e-05
3.23972e-05
1.20857e-05
3.10154e-05
9.2873e-06
2.86693e-05
6.61291e-06
2.52582e-05
4.57117e-06
2.13151e-05
2.96704e-06
1.81262e-05
1.97156e-06
1.51385e-05
1.12129e-06
1.2061e-05
4.30974e-07
8.79399e-06
5.95278e-08
5.37008e-06
1.83236e-06
1.86702e-07
1.62652e-06
4.52128e-06
-1.17543e-05
1.03022e-05
-2.06089e-06
1.14811e-05
9.07189e-06
1.27763e-05
7.43786e-06
1.44335e-05
6.1666e-06
1.69242e-05
5.40793e-06
1.94337e-05
5.44908e-06
2.14231e-05
8.64144e-06
2.33096e-05
1.24333e-05
2.46314e-05
1.59871e-05
2.54773e-05
1.9528e-05
2.56713e-05
2.29543e-05
2.53015e-05
2.59287e-05
2.45635e-05
2.82493e-05
2.36118e-05
2.99953e-05
2.24276e-05
3.19533e-05
2.10547e-05
3.52164e-05
1.98111e-05
3.66821e-05
1.87711e-05
3.63472e-05
1.72004e-05
3.5552e-05
1.39892e-05
3.45037e-05
1.00357e-05
3.29973e-05
6.549e-06
2.85913e-05
3.9109e-06
2.29687e-05
2.32731e-06
1.61729e-05
1.37918e-06
1.26698e-05
6.84433e-07
9.28427e-06
1.72105e-07
5.82998e-06
2.00388e-06
-2.61943e-06
-9.6003e-06
2.77636e-07
-2.63267e-05
7.13512e-06
-2.66861e-05
1.17325e-05
4.2708e-06
1.31373e-05
3.46592e-06
1.50257e-05
1.54536e-06
1.75223e-05
6.23115e-07
1.95075e-05
7.98232e-07
2.14302e-05
4.84561e-06
2.36072e-05
9.547e-06
2.52605e-05
1.38487e-05
2.63966e-05
1.81478e-05
2.68252e-05
2.21885e-05
2.66934e-05
2.56003e-05
2.62547e-05
2.81969e-05
2.56703e-05
3.07053e-05
2.50812e-05
3.49814e-05
2.48385e-05
3.95493e-05
2.53542e-05
3.9621e-05
2.59203e-05
3.83256e-05
2.55596e-05
3.80833e-05
2.33902e-05
4.01872e-05
1.85993e-05
4.17546e-05
1.20276e-05
3.8928e-05
6.53872e-06
3.22238e-05
3.65628e-06
2.19542e-05
2.14624e-06
1.4503e-05
1.30344e-06
9.95507e-06
2.34133e-07
5.92912e-06
2.36739e-06
-4.44807e-06
-1.23975e-05
-1.83155e-07
-1.84832e-05
6.21907e-06
-3.21696e-05
1.02454e-05
-1.45136e-06
1.2955e-05
-1.43754e-06
1.52037e-05
-3.36131e-06
1.73869e-05
-4.03489e-06
1.86335e-05
-2.96837e-06
2.08182e-05
1.58252e-06
2.30301e-05
7.15913e-06
2.50461e-05
1.23671e-05
2.644e-05
1.73531e-05
2.71226e-05
2.1941e-05
2.72854e-05
2.57217e-05
2.72638e-05
2.90382e-05
2.81122e-05
3.32041e-05
2.98373e-05
3.76771e-05
3.13642e-05
4.07514e-05
3.26178e-05
3.9782e-05
3.35023e-05
3.90747e-05
3.27909e-05
4.12069e-05
3.02187e-05
4.54895e-05
2.66335e-05
4.64204e-05
2.24296e-05
4.37803e-05
1.7614e-05
3.79049e-05
9.99768e-06
2.90661e-05
4.18502e-06
2.15746e-05
2.66766e-06
1.25835e-05
4.05346e-07
7.24637e-06
2.79352e-06
-2.52041e-06
-1.28529e-06
1.57094e-06
-9.2912e-06
7.53702e-06
-2.27265e-05
1.08809e-05
-1.05555e-05
1.29818e-05
-7.6696e-06
1.48374e-05
-8.1289e-06
1.62624e-05
-8.03959e-06
1.71275e-05
-5.93159e-06
1.94267e-05
-7.47633e-07
2.15142e-05
5.30526e-06
2.37039e-05
1.14243e-05
2.53714e-05
1.719e-05
2.62701e-05
2.22906e-05
2.67809e-05
2.61247e-05
2.85287e-05
3.07323e-05
3.20035e-05
3.15077e-05
3.56767e-05
3.39449e-05
3.85914e-05
3.80906e-05
4.03991e-05
3.88328e-05
4.03736e-05
4.09031e-05
3.85556e-05
4.51535e-05
3.6335e-05
4.81634e-05
3.47483e-05
4.7798e-05
3.3346e-05
4.52812e-05
3.03599e-05
4.06039e-05
2.03822e-05
3.36581e-05
9.61865e-06
2.93431e-05
3.35417e-06
2.11531e-05
1.56061e-07
1.16082e-05
3.82861e-06
-1.03253e-06
7.56658e-06
5.02326e-06
-2.52458e-06
1.0061e-05
-1.58567e-05
1.21951e-05
-1.9253e-05
1.22877e-05
-1.38977e-05
1.32305e-05
-1.22337e-05
1.40084e-05
-1.10957e-05
1.47565e-05
-8.37308e-06
1.68151e-05
-2.65673e-06
1.89047e-05
4.08811e-06
2.11463e-05
1.10634e-05
2.29609e-05
1.76957e-05
2.42923e-05
2.27673e-05
2.87839e-05
2.22055e-05
3.61554e-05
2.27392e-05
4.06063e-05
2.19503e-05
4.22237e-05
2.83133e-05
4.43041e-05
3.52689e-05
4.54734e-05
3.86611e-05
4.45193e-05
4.31334e-05
4.29822e-05
4.70445e-05
4.2023e-05
4.85117e-05
4.17604e-05
4.81173e-05
4.17271e-05
4.63475e-05
3.82558e-05
4.25878e-05
3.38576e-05
3.73684e-05
2.06726e-05
3.45888e-05
7.4881e-06
2.91133e-05
5.46185e-06
1.49058e-05
4.44082e-06
1.85645e-06
8.55591e-06
7.01526e-06
-2.06899e-06
1.19378e-05
-1.4982e-05
1.19796e-05
-2.87979e-05
9.74425e-06
-1.82267e-05
1.02349e-05
-1.44657e-05
1.03361e-05
-1.35652e-05
1.11298e-05
-1.05454e-05
1.28984e-05
-4.21219e-06
1.49702e-05
3.41561e-06
1.73438e-05
1.12476e-05
1.93939e-05
1.79694e-05
2.76618e-05
1.3684e-05
4.12225e-05
1.18542e-05
4.79498e-05
1.16701e-05
4.7336e-05
1.59263e-05
4.57516e-05
2.68582e-05
4.61874e-05
3.44195e-05
4.65368e-05
3.95382e-05
4.60783e-05
4.41687e-05
4.57883e-05
4.72484e-05
4.59518e-05
4.84919e-05
4.68158e-05
4.82354e-05
4.67873e-05
4.64186e-05
4.48652e-05
4.31789e-05
4.65692e-05
4.0686e-05
4.33714e-05
3.76634e-05
2.93074e-05
2.65678e-05
1.71265e-05
1.47576e-05
6.88249e-06
5.3519e-06
3.62421e-06
1.11815e-05
-8.31035e-06
1.35689e-05
-2.86632e-05
1.10086e-05
-5.33988e-05
7.19449e-06
-5.34669e-05
5.56878e-06
-1.85594e-05
5.39554e-06
-1.58762e-05
6.15214e-06
-1.26893e-05
7.51867e-06
-5.6039e-06
9.5243e-06
3.30317e-06
1.17146e-05
1.17834e-05
1.50538e-05
1.65657e-05
2.56134e-05
6.69782e-06
3.77074e-05
1.70476e-05
4.41361e-05
1.94347e-05
4.56325e-05
2.14004e-05
4.58674e-05
2.81163e-05
4.62024e-05
3.42385e-05
4.61587e-05
3.94802e-05
4.61891e-05
4.38672e-05
4.6816e-05
4.69388e-05
4.81687e-05
4.80371e-05
4.95487e-05
4.73461e-05
4.99253e-05
4.49661e-05
5.08216e-05
4.36543e-05
5.76487e-05
4.24566e-05
6.72649e-05
3.49413e-05
6.0158e-05
2.06558e-05
3.73274e-05
5.64836e-06
-2.06585e-06
7.45701e-06
-6.26903e-06
1.04216e-05
-2.76501e-05
9.06487e-06
-5.37712e-05
9.0003e-06
-7.60649e-05
6.20218e-06
-8.74942e-05
1.18801e-07
-5.70511e-05
-8.01357e-07
-2.16394e-05
-1.52552e-07
-1.54966e-05
6.85998e-07
-6.67753e-06
2.27955e-06
3.20523e-06
4.00104e-06
1.13902e-05
5.41145e-06
1.71748e-05
6.88084e-06
-2.90682e-06
1.67454e-05
-6.01338e-06
3.29946e-05
9.23355e-06
4.10102e-05
2.96398e-05
4.38321e-05
3.2559e-05
4.48436e-05
3.63675e-05
4.50362e-05
4.01369e-05
4.54755e-05
4.365e-05
4.66195e-05
4.62646e-05
4.81714e-05
4.6862e-05
4.9607e-05
4.58049e-05
5.1809e-05
4.37898e-05
5.76449e-05
4.30027e-05
6.77032e-05
3.85894e-05
7.27048e-05
2.69294e-05
6.0405e-05
1.22603e-05
3.2762e-05
-9.71125e-06
-1.86554e-05
3.28712e-06
-2.02773e-05
-7.45586e-08
-4.47023e-05
-1.63819e-06
-6.47206e-05
5.3089e-06
-7.90442e-05
1.14862e-05
-8.75119e-05
4.52539e-06
-9.08206e-05
-7.70994e-06
-3.23819e-05
-7.24921e-06
-2.06807e-05
-7.90178e-06
-1.18423e-05
-8.02085e-06
-6.39504e-06
-4.64677e-06
-5.24701e-05
-6.38996e-06
-5.16701e-05
-1.49312e-05
-7.59962e-05
-1.30178e-05
-8.18738e-05
2.94565e-06
-5.68321e-05
2.13575e-05
1.32416e-06
3.2954e-05
3.26593e-05
3.86899e-05
4.04675e-05
4.11121e-05
4.33177e-05
4.27459e-05
4.52903e-05
4.4364e-05
4.6621e-05
4.61003e-05
4.64957e-05
4.92576e-05
4.51464e-05
5.53028e-05
4.08889e-05
6.39325e-05
3.49033e-05
7.01592e-05
2.4927e-05
6.47879e-05
1.05341e-05
3.93358e-05
-5.97579e-06
1.03819e-05
-2.46944e-05
-3.07497e-05
-1.73265e-05
-1.59505e-05
-1.74078e-05
-3.75112e-05
-1.11943e-05
-5.7047e-05
8.99658e-08
-7.30258e-05
9.39067e-06
-8.30247e-05
2.96146e-06
-8.95493e-05
-1.5357e-05
-6.76604e-05
-1.53402e-05
-2.69388e-05
-1.72201e-05
-6.93647e-05
-1.87986e-05
-8.35036e-05
-1.87517e-05
-0.000136806
-1.80989e-05
-0.000139892
-1.92175e-05
-0.000144953
-2.25402e-05
-0.000138041
-2.34265e-05
-0.000124729
-1.26431e-05
-7.75171e-05
5.37307e-06
-2.09691e-05
1.91821e-05
1.61651e-05
2.78048e-05
3.21758e-05
3.37695e-05
3.82356e-05
3.92765e-05
4.00653e-05
4.51234e-05
3.91581e-05
5.13303e-05
3.43291e-05
5.73759e-05
2.06577e-05
6.10826e-05
6.45167e-06
5.79291e-05
-6.52676e-06
4.15703e-05
-1.71626e-05
1.62361e-05
-2.32442e-05
9.48917e-07
-2.78823e-05
-3.20468e-05
-2.63033e-05
-7.86459e-06
-2.47848e-05
-2.92225e-05
-1.54745e-05
-4.6749e-05
-3.78753e-06
-6.61737e-05
7.9614e-06
-7.95647e-05
2.0427e-05
-8.86337e-05
3.32221e-06
-9.48981e-05
-1.07083e-05
-7.21431e-05
-1.00823e-05
-0.000130381
-2.31071e-05
-0.000151129
-2.58941e-05
-0.000153714
-2.36386e-05
-0.000153898
-2.11332e-05
-0.000152576
-1.84668e-05
-0.000150584
-1.62152e-05
-0.000147196
-1.48136e-05
-0.000135175
-7.29478e-06
-0.000105723
5.55703e-06
-6.782e-05
1.72485e-05
-3.69711e-05
2.69025e-05
-1.26495e-05
3.52567e-05
-4.42432e-06
4.19275e-05
-4.56766e-06
4.39553e-05
-1.49244e-05
4.13677e-05
-3.48544e-05
3.62446e-05
-4.34521e-05
2.88122e-05
-4.37944e-05
1.84774e-05
-3.79758e-05
8.57751e-06
-2.71484e-05
2.56745e-06
-2.38757e-05
-3.00586e-05
-9.61627e-06
-8.2951e-06
-1.57533e-05
-2.54661e-05
-1.87903e-05
-4.44298e-05
-1.17717e-05
-6.15268e-05
1.80562e-06
-7.67168e-05
1.47461e-05
-8.86879e-05
2.34968e-05
-9.44078e-05
9.60991e-06
-0.000108309
-1.94803e-05
-0.000136706
-3.19123e-05
-0.000153196
-3.17424e-05
-0.000153689
-2.88256e-05
-0.000153456
-2.60935e-05
-0.000151828
-2.28285e-05
-0.000149749
-1.81796e-05
-0.000147467
-1.48908e-05
-0.000143384
-1.17475e-05
-0.000139594
-7.00169e-06
-0.000129978
1.31541e-06
-0.000110479
1.03243e-05
-8.68883e-05
1.60134e-05
-7.53832e-05
1.72537e-05
-7.07255e-05
1.21808e-05
-7.28304e-05
7.10764e-06
-7.75827e-05
7.05121e-06
-7.10898e-05
1.00496e-05
-5.77219e-05
1.22392e-05
-4.11232e-05
9.989e-06
-2.40974e-05
4.95474e-06
-1.96547e-05
-2.61001e-05
-2.947e-06
-8.44765e-06
-6.21954e-06
-2.57313e-05
-7.99338e-06
-4.26292e-05
-9.95498e-06
-5.88752e-05
-4.06806e-06
-7.4648e-05
7.91459e-06
-8.703e-05
1.80088e-05
-9.50137e-05
6.50906e-06
-0.000105168
-2.22901e-05
-0.000134484
-3.48985e-05
-0.000153239
-3.40394e-05
-0.000153007
-3.10015e-05
-0.000152625
-2.82477e-05
-0.000150823
-2.58648e-05
-0.000148607
-2.30399e-05
-0.000146315
-2.03783e-05
-0.000142432
-1.63292e-05
-0.000139125
-1.26898e-05
-0.000131988
-9.47574e-06
-0.00012478
-6.22517e-06
-0.000115562
-3.62312e-06
-0.000106089
-1.6783e-06
-9.77824e-05
-9.59216e-07
-8.93806e-05
5.13495e-07
-8.00735e-05
3.95981e-06
-6.85696e-05
8.62527e-06
-5.42632e-05
1.22588e-05
-3.80128e-05
1.13296e-05
-2.10817e-05
6.45979e-06
-1.55431e-05
-2.18144e-05
5.32323e-06
-5.11459e-06
4.39207e-06
-2.67572e-05
1.68612e-06
-4.46873e-05
1.24451e-07
-5.94116e-05
3.29913e-07
-7.34523e-05
4.94763e-06
-8.54563e-05
1.4292e-05
-9.37469e-05
4.33589e-06
-0.000100366
-2.51603e-05
-0.00012655
-3.89315e-05
-0.000152641
-3.72385e-05
-0.000151877
-3.46564e-05
-0.000151196
-3.22622e-05
-0.000149305
-2.99226e-05
-0.000147405
-2.6205e-05
-0.000145161
-2.30438e-05
-0.000140533
-2.06528e-05
-0.000136616
-1.83697e-05
-0.000128972
-1.51664e-05
-0.00012118
-1.14975e-05
-0.0001118
-8.00469e-06
-0.00010203
-4.99137e-06
-9.36398e-05
-3.21555e-06
-8.52547e-05
-1.04157e-06
-7.58405e-05
2.67529e-06
-6.43843e-05
7.40239e-06
-5.00726e-05
1.16051e-05
-3.42994e-05
1.1653e-05
-1.77665e-05
7.03631e-06
-1.13553e-05
-1.76663e-05
1.93173e-05
-2.85659e-05
1.5182e-05
-2.72378e-05
1.13784e-05
-4.55114e-05
8.252e-06
-6.1999e-05
7.47453e-06
-7.44268e-05
8.86552e-06
-8.44704e-05
1.21945e-05
-9.14683e-05
7.16788e-06
-9.62777e-05
-2.10022e-05
-0.00011348
-4.06406e-05
-0.000151137
-3.868e-05
-0.000150281
-3.63207e-05
-0.0001493
-3.42911e-05
-0.000147419
-3.2567e-05
-0.000145369
-3.00432e-05
-0.000142896
-2.79173e-05
-0.000138191
-2.56656e-05
-0.000134391
-2.25203e-05
-0.000126601
-1.87e-05
-0.000118074
-1.48685e-05
-0.000108499
-1.10668e-05
-9.84321e-05
-7.8327e-06
-9.00096e-05
-5.58795e-06
-8.16985e-05
-2.84206e-06
-7.2035e-05
1.35727e-06
-6.04484e-05
6.32944e-06
-4.57768e-05
1.06875e-05
-3.04187e-05
1.12804e-05
-1.42881e-05
7.00595e-06
-7.13841e-06
-1.34477e-05
2.23516e-05
-7.80213e-05
2.85657e-05
-6.27256e-05
1.65485e-05
-7.42069e-05
1.42151e-05
-6.31353e-05
1.22981e-05
-7.74442e-05
1.30531e-05
-8.51223e-05
1.51119e-05
-9.01935e-05
1.54871e-05
-9.27273e-05
-1.44407e-05
-0.000102507
-4.27068e-05
-0.000149243
-4.1048e-05
-0.000148263
-3.94017e-05
-0.000146926
-3.79032e-05
-0.000145297
-3.65373e-05
-0.000143121
-3.40304e-05
-0.000140591
-3.13835e-05
-0.000135697
-2.89587e-05
-0.000131412
-2.60191e-05
-0.000123273
-2.24192e-05
-0.000114282
-1.85666e-05
-0.000104677
-1.4598e-05
-9.46095e-05
-1.1069e-05
-8.63537e-05
-8.37415e-06
-7.80931e-05
-5.08973e-06
-6.83432e-05
-2.78371e-07
-5.65312e-05
5.0969e-06
-4.16093e-05
9.60129e-06
-2.65511e-05
1.05195e-05
-1.07843e-05
6.67673e-06
-2.9711e-06
-9.15732e-06
-1.0687e-06
-0.000104497
6.45276e-06
-9.92078e-05
1.52172e-05
-0.000104221
1.39283e-05
-8.85802e-05
1.54353e-05
-8.18947e-05
1.48277e-05
-8.7532e-05
1.66385e-05
-8.99082e-05
1.7506e-05
-9.03051e-05
-1.34761e-05
-9.66372e-05
-4.38537e-05
-0.000147036
-4.23415e-05
-0.000145698
-4.10248e-05
-0.000143719
-3.98019e-05
-0.00014239
-3.87521e-05
-0.000139883
-3.69066e-05
-0.000137284
-3.50058e-05
-0.000132221
-3.33352e-05
-0.00012775
-3.03421e-05
-0.000119723
-2.65076e-05
-0.00011026
-2.24946e-05
-0.000100941
-1.81876e-05
-9.08233e-05
-1.44655e-05
-8.28305e-05
-1.13528e-05
-7.46985e-05
-7.55192e-06
-6.49611e-05
-2.2265e-06
-5.25561e-05
3.60403e-06
-3.72645e-05
8.33145e-06
-2.25305e-05
9.5565e-06
-7.28262e-06
6.24685e-06
9.95648e-07
-5.1576e-06
-2.02198e-06
-0.000103163
9.26569e-07
-9.74681e-05
2.64628e-06
-0.000107102
1.1131e-05
-0.00011318
1.55052e-05
-9.28543e-05
1.47651e-05
-9.05711e-05
1.56167e-05
-9.06685e-05
1.66288e-05
-8.95471e-05
-1.52098e-05
-9.36343e-05
-4.60869e-05
-0.000144492
-4.48268e-05
-0.00014272
-4.41387e-05
-0.000140273
-4.33029e-05
-0.000139011
-4.25805e-05
-0.000136367
-4.11518e-05
-0.000133566
-3.90104e-05
-0.000128393
-3.72301e-05
-0.000123691
-3.43514e-05
-0.000115948
-3.04285e-05
-0.000106196
-2.63997e-05
-9.72603e-05
-2.202e-05
-8.73471e-05
-1.79353e-05
-7.9409e-05
-1.42839e-05
-7.15365e-05
-9.99313e-06
-6.21564e-05
-4.23083e-06
-4.91446e-05
1.93009e-06
-3.29269e-05
6.81942e-06
-1.83253e-05
8.34534e-06
-3.75078e-06
5.57524e-06
4.66596e-06
-1.75752e-06
-2.16409e-06
-9.96422e-05
3.14804e-06
-9.30528e-05
-9.97801e-07
-0.000100806
1.50862e-06
-0.000117059
8.85274e-06
-0.000108975
1.12004e-05
-9.41207e-05
1.22359e-05
-9.2304e-05
1.31092e-05
-9.1145e-05
-1.83001e-05
-9.35012e-05
-4.78055e-05
-0.000141832
-4.65489e-05
-0.000139326
-4.6241e-05
-0.00013653
-4.58827e-05
-0.000134853
-4.5404e-05
-0.000132552
-4.45051e-05
-0.000129406
-4.27612e-05
-0.000124255
-4.11106e-05
-0.000119179
-3.84683e-05
-0.000111466
-3.45051e-05
-0.000102076
-3.03714e-05
-9.37014e-05
-2.59722e-05
-8.43067e-05
-2.1541e-05
-7.63315e-05
-1.74227e-05
-6.85292e-05
-1.26252e-05
-5.94356e-05
-6.33595e-06
-4.60355e-05
1.81025e-07
-2.87743e-05
5.16108e-06
-1.38679e-05
6.95584e-06
-6.63414e-08
4.72354e-06
8.10573e-06
1.04382e-06
-2.53238e-06
-9.62646e-05
2.68707e-06
-8.96916e-05
2.32254e-07
-9.69464e-05
-5.67199e-06
-0.000110339
-1.71232e-06
-0.000117896
5.57171e-06
-0.000102135
7.52965e-06
-9.50908e-05
9.6276e-06
-9.55713e-05
-2.1251e-05
-9.76907e-05
-5.0111e-05
-0.000138822
-4.92295e-05
-0.00013513
-4.89335e-05
-0.00013202
-4.91301e-05
-0.000129785
-4.89743e-05
-0.000127895
-4.83616e-05
-0.000124514
-4.67996e-05
-0.000119693
-4.52121e-05
-0.00011441
-4.25828e-05
-0.000106804
-3.85351e-05
-9.78739e-05
-3.4408e-05
-9.03419e-05
-2.99732e-05
-8.17006e-05
-2.53263e-05
-7.38258e-05
-2.08448e-05
-6.62351e-05
-1.56071e-05
-5.74058e-05
-8.7196e-06
-4.40598e-05
-1.69288e-06
-2.5969e-05
3.45456e-06
-9.77932e-06
5.47275e-06
3.60767e-06
3.77091e-06
1.13078e-05
3.22704e-06
-4.07759e-06
-9.16981e-05
1.87076e-06
-8.64992e-05
2.43827e-06
-9.4809e-05
-4.93661e-06
-0.000103823
-9.11104e-06
-0.000113077
-2.54037e-06
-0.000109159
1.00867e-06
-0.000100405
1.57604e-06
-0.000103474
-2.73532e-05
-0.000111827
-5.28831e-05
-0.000136052
-5.25361e-05
-0.000130713
-5.19886e-05
-0.000127103
-5.2733e-05
-0.000124662
-5.27574e-05
-0.000122927
-5.22072e-05
-0.000119512
-5.08392e-05
-0.000114812
-4.92503e-05
-0.00010924
-4.66051e-05
-0.000102044
-4.23378e-05
-9.38405e-05
-3.82632e-05
-8.70328e-05
-3.39049e-05
-7.94414e-05
-2.90852e-05
-7.19999e-05
-2.45092e-05
-6.49559e-05
-1.91916e-05
-5.6527e-05
-1.19244e-05
-4.37622e-05
-4.09987e-06
-2.541e-05
1.59581e-06
-6.99433e-06
3.94315e-06
6.84395e-06
2.77378e-06
1.41001e-05
4.75987e-06
-3.89561e-06
-8.71868e-05
1.22356e-06
-8.36144e-05
2.64582e-06
-9.32686e-05
-3.61907e-06
-0.00010004
-1.30602e-05
-0.000106374
-1.20034e-05
-0.000107617
-9.21523e-06
-0.000104994
-1.59249e-05
-0.000111798
-4.07153e-05
-0.000125809
-5.51522e-05
-0.000133204
-5.58105e-05
-0.000125951
-5.49857e-05
-0.00012122
-5.59749e-05
-0.000119108
-5.64524e-05
-0.000117194
-5.63192e-05
-0.000114351
-5.52528e-05
-0.000109915
-5.32588e-05
-0.000103933
-5.04109e-05
-9.72045e-05
-4.60633e-05
-9.02029e-05
-4.19253e-05
-8.41875e-05
-3.77303e-05
-7.75552e-05
-3.29258e-05
-7.08926e-05
-2.8309e-05
-6.45327e-05
-2.31392e-05
-5.65903e-05
-1.57728e-05
-4.45608e-05
-7.03413e-06
-2.6569e-05
-4.12622e-07
-5.75013e-06
2.42022e-06
9.28284e-06
1.79609e-06
1.6317e-05
5.76803e-06
-3.85142e-06
-8.22918e-05
8.01208e-07
-8.00753e-05
1.03436e-06
-9.1623e-05
-4.00876e-06
-9.73925e-05
-1.32483e-05
-0.000100927
-1.62346e-05
-0.000101983
-1.69694e-05
-0.000105035
-2.91267e-05
-0.000111981
-4.68412e-05
-0.000123531
-5.69029e-05
-0.000129707
-6.00926e-05
-0.000121484
-5.91923e-05
-0.000115217
-5.98971e-05
-0.000113336
-6.04556e-05
-0.000111232
-6.03488e-05
-0.000108953
-5.95009e-05
-0.000104831
-5.72758e-05
-9.87616e-05
-5.40448e-05
-9.33062e-05
-4.94932e-05
-8.76076e-05
-4.51967e-05
-8.24363e-05
-4.11623e-05
-7.68151e-05
-3.6642e-05
-7.12207e-05
-3.20752e-05
-6.58307e-05
-2.70582e-05
-5.87113e-05
-1.97174e-05
-4.74894e-05
-1.01144e-05
-2.98801e-05
-2.38853e-06
-6.5919e-06
1.00146e-06
1.05955e-05
9.29602e-07
1.78197e-05
6.36576e-06
-3.30779e-06
-7.73356e-05
1.03097e-06
-7.68441e-05
-3.06143e-07
-8.94865e-05
-6.51239e-06
-9.4993e-05
-1.24317e-05
-9.58599e-05
-1.53599e-05
-9.76388e-05
-1.94591e-05
-0.000100753
-2.53716e-05
-0.000105738
-3.8676e-05
-0.000112835
-5.5395e-05
-0.000123557
-6.33498e-05
-0.000117069
-6.31043e-05
-0.000109074
-6.36176e-05
-0.000107166
-6.44187e-05
-0.000105627
-6.46103e-05
-0.000103817
-6.38299e-05
-0.000100095
-6.07554e-05
-9.49529e-05
-5.64396e-05
-9.12962e-05
-5.16335e-05
-8.66671e-05
-4.75368e-05
-8.22109e-05
-4.38082e-05
-7.79238e-05
-3.95119e-05
-7.38631e-05
-3.52167e-05
-6.9823e-05
-3.06063e-05
-6.41912e-05
-2.37546e-05
-5.44037e-05
-1.36575e-05
-3.7789e-05
-4.53742e-06
-1.27486e-05
-2.95023e-07
9.96313e-06
1.53347e-07
1.84129e-05
6.61741e-06
-3.12644e-06
-7.2348e-05
1.37001e-06
-7.34498e-05
-2.13922e-06
-8.69687e-05
-8.06896e-06
-9.20148e-05
-1.17863e-05
-9.24416e-05
-1.28913e-05
-9.45077e-05
-1.62815e-05
-9.60594e-05
-2.0707e-05
-0.000100066
-3.05364e-05
-0.000104929
-5.14063e-05
-0.000114031
-6.60995e-05
-0.000112197
-6.72541e-05
-0.000102742
-6.74651e-05
-0.000100861
-6.80851e-05
-0.000100318
-6.8057e-05
-9.91375e-05
-6.65139e-05
-9.67621e-05
-6.23797e-05
-9.35221e-05
-5.73823e-05
-9.0823e-05
-5.27809e-05
-8.70244e-05
-4.88445e-05
-8.375e-05
-4.52014e-05
-8.12227e-05
-4.09778e-05
-7.91212e-05
-3.6825e-05
-7.67174e-05
-3.2798e-05
-7.3066e-05
-2.72449e-05
-6.56017e-05
-1.82716e-05
-5.12186e-05
-7.59891e-06
-2.69609e-05
-1.38185e-06
4.64681e-06
-4.27775e-07
1.79332e-05
6.6795e-06
-3.8598e-06
-6.72913e-05
2.51636e-06
-6.86895e-05
-2.77849e-06
-8.32122e-05
-8.96268e-06
-8.922e-05
-1.04828e-05
-8.96942e-05
-1.22642e-05
-9.13229e-05
-1.46232e-05
-9.30122e-05
-1.66091e-05
-9.51094e-05
-2.24655e-05
-9.9131e-05
-4.56052e-05
-0.000104718
-6.79679e-05
-0.000105809
-7.10576e-05
-9.66662e-05
-7.09281e-05
-9.51524e-05
-7.11967e-05
-9.57513e-05
-7.03502e-05
-9.54931e-05
-6.7615e-05
-9.50046e-05
-6.30867e-05
-9.33804e-05
-5.79272e-05
-9.13325e-05
-5.32578e-05
-8.87047e-05
-4.90798e-05
-8.72104e-05
-4.50884e-05
-8.6637e-05
-4.0765e-05
-8.65783e-05
-3.65573e-05
-8.60452e-05
-3.28163e-05
-8.45865e-05
-2.86371e-05
-8.01281e-05
-2.20193e-05
-6.88382e-05
-1.10533e-05
-4.72733e-05
-2.38409e-06
-1.06113e-05
-5.06475e-07
1.3891e-05
6.94654e-06
-3.86334e-06
-6.24487e-05
3.84775e-06
-6.28147e-05
-1.94406e-06
-7.73545e-05
-8.85576e-06
-8.54303e-05
-1.02068e-05
-8.65977e-05
-1.12487e-05
-8.82092e-05
-1.28772e-05
-8.96458e-05
-1.4485e-05
-9.14052e-05
-1.90647e-05
-9.34655e-05
-4.41227e-05
-9.75279e-05
-7.03409e-05
-9.79199e-05
-7.43646e-05
-9.08519e-05
-7.36678e-05
-9.008e-05
-7.30086e-05
-9.24764e-05
-7.12471e-05
-9.32663e-05
-6.78792e-05
-9.42553e-05
-6.3304e-05
-9.37441e-05
-5.79948e-05
-9.28542e-05
-5.28194e-05
-9.18172e-05
-4.79467e-05
-9.1953e-05
-4.33043e-05
-9.27566e-05
-3.87708e-05
-9.40971e-05
-3.44192e-05
-9.51263e-05
-3.05975e-05
-9.54574e-05
-2.73143e-05
-9.35068e-05
-2.31259e-05
-8.6645e-05
-1.48311e-05
-7.11868e-05
-4.57651e-06
-3.98e-05
1.24175e-07
-1.20043e-06
6.93675e-06
-4.66901e-06
-5.65565e-05
5.83029e-06
-5.86381e-05
2.05037e-06
-7.00129e-05
-5.29676e-06
-7.93023e-05
-8.9042e-06
-8.20153e-05
-1.09228e-05
-8.34524e-05
-1.29232e-05
-8.47864e-05
-1.53414e-05
-8.59507e-05
-2.10294e-05
-8.63579e-05
-4.80429e-05
-9.0374e-05
-7.4938e-05
-9.02036e-05
-7.72068e-05
-8.60434e-05
-7.49747e-05
-8.66846e-05
-7.34004e-05
-9.0602e-05
-7.11658e-05
-9.20265e-05
-6.7648e-05
-9.40007e-05
-6.29359e-05
-9.47934e-05
-5.72429e-05
-9.54767e-05
-5.1453e-05
-9.59922e-05
-4.59198e-05
-9.70995e-05
-4.06202e-05
-9.8307e-05
-3.56789e-05
-9.98303e-05
-3.11145e-05
-0.000101051
-2.72133e-05
-0.000101681
-2.41177e-05
-0.000100676
-2.15493e-05
-9.75695e-05
-1.78939e-05
-9.01778e-05
-9.11522e-06
-7.17582e-05
-5.00871e-07
-3.25186e-05
3.98672e-06
-6.24269e-06
-4.97339e-05
7.32292e-06
-5.77232e-05
9.35989e-06
-6.53516e-05
2.0219e-06
-7.21542e-05
-7.429e-06
-7.53553e-05
-1.05303e-05
-7.70965e-05
-1.25791e-05
-7.9352e-05
-1.51591e-05
-8.03015e-05
-2.40115e-05
-8.03083e-05
-5.61553e-05
-8.23635e-05
-8.1347e-05
-8.4315e-05
-7.88881e-05
-8.31501e-05
-7.50048e-05
-8.54692e-05
-7.30986e-05
-8.97627e-05
-7.02905e-05
-9.16655e-05
-6.65689e-05
-9.45562e-05
-6.17494e-05
-9.68894e-05
-5.59509e-05
-9.91068e-05
-4.98943e-05
-0.000100898
-4.40016e-05
-0.000102428
-3.83302e-05
-0.000103504
-3.30184e-05
-0.000104492
-2.79858e-05
-0.000104879
-2.33775e-05
-0.000104598
-1.98246e-05
-0.00010313
-1.77547e-05
-0.000100761
-1.61174e-05
-9.80294e-05
-1.25247e-05
-8.9945e-05
-4.5458e-06
-6.59737e-05
-4.50158e-06
-8.25614e-06
-3.97839e-05
6.5588e-06
-5.82524e-05
1.36359e-05
-6.47825e-05
7.68361e-06
-6.67597e-05
-5.92452e-06
-6.72466e-05
-9.35627e-06
-7.15252e-05
-1.13207e-05
-7.51224e-05
-1.37689e-05
-7.61966e-05
-2.52958e-05
-7.6588e-05
-6.3451e-05
-7.77248e-05
-8.65818e-05
-8.22212e-05
-7.98079e-05
-8.21715e-05
-7.54524e-05
-8.60993e-05
-7.23134e-05
-8.96193e-05
-6.85724e-05
-9.25683e-05
-6.46865e-05
-9.64329e-05
-5.9844e-05
-0.000100127
-5.43121e-05
-0.000103619
-4.84588e-05
-0.000106401
-4.25982e-05
-0.000108263
-3.68725e-05
-0.000109194
-3.14819e-05
-0.000109631
-2.64317e-05
-0.000109402
-2.13281e-05
-0.000108413
-1.66336e-05
-0.000105904
-1.33593e-05
-0.000102115
-1.17889e-05
-9.97866e-05
-1.1687e-05
-9.55231e-05
-7.67502e-06
-8.33045e-05
-1.84972e-05
-1.39966e-05
-2.53835e-05
5.57287e-06
-5.54907e-05
1.44583e-05
-6.69246e-05
9.95932e-06
-6.44981e-05
-2.17973e-06
-6.11187e-05
-5.70081e-06
-6.78372e-05
-8.85865e-06
-7.21057e-05
-1.43856e-05
-7.35483e-05
-4.51924e-05
-7.30335e-05
-8.41128e-05
-7.97631e-05
-8.9766e-05
-8.24101e-05
-8.16733e-05
-8.33628e-05
-7.67884e-05
-8.79593e-05
-7.15397e-05
-9.06537e-05
-6.67494e-05
-9.49691e-05
-6.23823e-05
-9.95041e-05
-5.75394e-05
-0.000104197
-5.25475e-05
-0.000108641
-4.71825e-05
-0.000112384
-4.1608e-05
-0.000114934
-3.6007e-05
-0.000116094
-3.05977e-05
-0.000116161
-2.5611e-05
-0.00011545
-2.09059e-05
-0.000114043
-1.6074e-05
-0.000110942
-1.15467e-05
-0.00010573
-8.46835e-06
-0.000101275
-6.8958e-06
-9.69641e-05
-5.8123e-06
-8.86099e-05
-4.54805e-05
-1.25994e-05
-1.6059e-05
4.16961e-06
-4.74542e-05
1.5329e-05
-6.93556e-05
1.7241e-05
-6.60152e-05
9.55744e-06
-6.0682e-05
9.46242e-07
-6.58986e-05
-6.83754e-06
-6.90931e-05
-2.4683e-05
-7.04485e-05
-6.91192e-05
-7.48027e-05
-9.7711e-05
-8.22137e-05
-9.20922e-05
-8.25966e-05
-8.46806e-05
-8.52798e-05
-7.84578e-05
-8.91852e-05
-7.1679e-05
-9.28687e-05
-6.59468e-05
-9.77767e-05
-6.07146e-05
-0.000102597
-5.57557e-05
-0.000107719
-5.1013e-05
-0.000112629
-4.60395e-05
-0.000117163
-4.07645e-05
-0.000120666
-3.53126e-05
-0.000122824
-2.9871e-05
-0.00012338
-2.47421e-05
-0.000122577
-2.02047e-05
-0.000120513
-1.60295e-05
-0.000116868
-1.14643e-05
-0.000111524
-7.37633e-06
-0.000105322
-4.64082e-06
-9.90366e-05
-3.76619e-06
-9.17632e-05
-7.04047e-05
-6.9863e-06
-1.61916e-05
7.93666e-07
-4.45898e-05
1.44608e-05
-6.75145e-05
2.33591e-05
-6.94668e-05
2.22289e-05
-6.46554e-05
9.7075e-06
-6.62434e-05
-8.891e-06
-6.4632e-05
-5.69545e-05
-6.85513e-05
-9.7189e-05
-8.02472e-05
-9.89684e-05
-8.22777e-05
-9.31244e-05
-8.31171e-05
-8.66097e-05
-8.58071e-05
-8.00738e-05
-8.92558e-05
-7.32926e-05
-9.41521e-05
-6.69784e-05
-9.91851e-05
-6.10264e-05
-0.000104396
-5.57263e-05
-0.00010963
-5.06953e-05
-0.000114733
-4.56439e-05
-0.000119571
-4.03259e-05
-0.000123649
-3.48755e-05
-0.000126797
-2.93743e-05
-0.000128321
-2.39301e-05
-0.000128149
-1.9045e-05
-0.000126157
-1.51752e-05
-0.000122332
-1.14679e-05
-0.000117326
-7.71734e-06
-0.000110401
-4.74761e-06
-0.00010289
-2.88071e-06
-9.4245e-05
-7.82402e-05
7.3792e-07
-1.93604e-05
4.06328e-06
-4.72848e-05
1.27368e-05
-6.51044e-05
2.45727e-05
-7.11115e-05
2.98901e-05
-7.01043e-05
1.79344e-05
-7.24128e-05
-3.40457e-05
-5.98229e-05
-8.68828e-05
-7.05352e-05
-9.79148e-05
-8.2692e-05
-9.66498e-05
-8.28135e-05
-9.26595e-05
-8.36824e-05
-8.75186e-05
-8.56121e-05
-8.14377e-05
-8.88613e-05
-7.51879e-05
-9.35066e-05
-6.90493e-05
-9.87286e-05
-6.29539e-05
-0.000104353
-5.70728e-05
-0.000109948
-5.14188e-05
-0.000115447
-4.59304e-05
-0.000120545
-4.0415e-05
-0.000124805
-3.48499e-05
-0.000128292
-2.93598e-05
-0.000130254
-2.38455e-05
-0.000130615
-1.84902e-05
-0.000129276
-1.40269e-05
-0.000126024
-1.06164e-05
-0.000121379
-7.84192e-06
-0.000114456
-4.99402e-06
-0.000106723
-2.48975e-06
-9.73896e-05
-8.1021e-05
1.06279e-05
-3.16331e-05
1.36791e-05
-5.52882e-05
1.74897e-05
-6.52094e-05
2.2291e-05
-6.99904e-05
2.76671e-05
-7.68464e-05
1.66738e-05
-8.13627e-05
-3.76524e-05
-6.25445e-05
-8.22985e-05
-6.52531e-05
-8.78225e-05
-8.12177e-05
-9.0402e-05
-8.34583e-05
-9.0075e-05
-8.39775e-05
-8.70312e-05
-8.5352e-05
-8.19893e-05
-8.81027e-05
-7.63226e-05
-9.19627e-05
-7.05238e-05
-9.70865e-05
-6.46209e-05
-0.000102828
-5.85116e-05
-0.000108798
-5.2289e-05
-0.00011494
-4.63472e-05
-0.000120769
-4.06599e-05
-0.000125255
-3.49651e-05
-0.000128896
-2.94586e-05
-0.000131018
-2.41133e-05
-0.000131518
-1.87846e-05
-0.000130464
-1.3926e-05
-0.000127721
-1.0041e-05
-0.000123384
-7.2028e-06
-0.000116912
-5.35569e-06
-0.00010923
-2.93653e-06
-0.000101184
-8.42216e-05
2.58675e-05
-6.18587e-05
2.10824e-05
-6.62476e-05
2.097e-05
-6.71074e-05
2.09773e-05
-6.95736e-05
1.95363e-05
-9.17151e-05
1.17629e-05
-9.0583e-05
-2.53779e-05
-6.20191e-05
-6.53582e-05
-5.01677e-05
-7.73807e-05
-7.4413e-05
-8.09279e-05
-8.2801e-05
-8.26744e-05
-8.43806e-05
-8.26714e-05
-8.52828e-05
-8.02687e-05
-8.71624e-05
-7.56954e-05
-9.04555e-05
-7.03886e-05
-9.50365e-05
-6.48964e-05
-0.00010069
-5.91739e-05
-0.00010689
-5.29949e-05
-0.000113463
-4.68314e-05
-0.000120236
-4.10296e-05
-0.000125244
-3.52394e-05
-0.000129039
-2.96266e-05
-0.000131343
-2.44014e-05
-0.000131868
-1.94482e-05
-0.000130914
-1.44386e-05
-0.000128472
-1.01605e-05
-0.000124372
-6.99833e-06
-0.000118078
-4.81295e-06
-0.000110537
-2.91533e-06
-0.000103768
-8.91816e-05
1.46995e-05
-8.39238e-05
1.74874e-05
-7.37969e-05
1.97764e-05
-6.90886e-05
1.38262e-05
-9.63152e-05
9.40278e-06
-0.000111959
1.16227e-06
-9.35606e-05
-2.32906e-05
-5.56747e-05
-5.01768e-05
-3.69355e-05
-6.32656e-05
-5.74449e-05
-6.82476e-05
-7.77761e-05
-7.23513e-05
-8.44023e-05
-7.38498e-05
-8.61224e-05
-7.39614e-05
-8.70928e-05
-7.2061e-05
-8.96299e-05
-6.81432e-05
-9.34007e-05
-6.35003e-05
-9.85645e-05
-5.87417e-05
-0.000104939
-5.34309e-05
-0.00011124
-4.75944e-05
-0.00011848
-4.17844e-05
-0.000124302
-3.58702e-05
-0.000128355
-3.00365e-05
-0.000131031
-2.47441e-05
-0.000131863
-2.02049e-05
-0.000130916
-1.55111e-05
-0.000128607
-1.0811e-05
-0.000124854
-7.31402e-06
-0.000118687
-4.69553e-06
-0.000111274
-2.94667e-06
-0.000105163
-9.33408e-05
5.75277e-06
-9.60341e-05
9.73292e-06
-8.1231e-05
5.80934e-06
-0.00010136
-3.93154e-08
-0.0001275
7.55221e-07
-0.000119991
-1.5506e-06
-8.99309e-05
-1.32486e-05
-5.49268e-05
-3.03174e-05
-3.11285e-05
-4.50615e-05
-3.51582e-05
-5.34886e-05
-6.00601e-05
-5.88122e-05
-7.94931e-05
-6.21264e-05
-8.65164e-05
-6.36007e-05
-8.8456e-05
-6.40889e-05
-8.99289e-05
-6.29668e-05
-9.27137e-05
-5.99632e-05
-9.68617e-05
-5.67042e-05
-0.000102763
-5.31101e-05
-0.000108498
-4.84746e-05
-0.000115508
-4.31552e-05
-0.000122122
-3.72415e-05
-0.000126497
-3.10015e-05
-0.000129509
-2.53288e-05
-0.000130969
-2.08573e-05
-0.000130337
-1.66438e-05
-0.000128075
-1.19956e-05
-0.000124771
-7.95368e-06
-0.00011898
-4.8567e-06
-0.000111719
-2.41063e-06
-0.000105905
-9.5313e-05
-5.76396e-07
-0.000106334
-2.87425e-06
-0.000108403
-5.10709e-06
-0.000132231
-5.98443e-06
-0.00013172
-1.77828e-06
-0.000118243
2.2452e-06
-8.87085e-05
-1.02767e-06
-5.76585e-05
-9.87906e-06
-3.12133e-05
-2.2541e-05
-2.17234e-05
-3.44674e-05
-3.55534e-05
-4.2103e-05
-6.13218e-05
-4.73672e-05
-7.99564e-05
-5.07826e-05
-8.77991e-05
-5.24521e-05
-9.08102e-05
-5.34374e-05
-9.28838e-05
-5.32824e-05
-9.58235e-05
-5.20823e-05
-0.000100593
-5.07869e-05
-0.0001064
-4.83989e-05
-0.000112757
-4.45223e-05
-0.000119873
-3.93225e-05
-0.000124596
-3.2977e-05
-0.000127275
-2.66183e-05
-0.000129005
-2.17368e-05
-0.000128914
-1.7782e-05
-0.000126747
-1.33706e-05
-0.000124067
-8.99109e-06
-0.000118802
-5.25593e-06
-0.00011197
-2.3359e-06
-0.000106363
-9.63948e-05
-1.2627e-06
-0.00010817
-5.87117e-06
-0.000128863
-9.12523e-06
-0.000132566
-7.82749e-06
-0.000129427
-2.49374e-06
-0.000117477
2.6063e-06
-8.92924e-05
3.43815e-06
-5.85242e-05
5.31361e-08
-3.29275e-05
-6.09452e-06
-1.80693e-05
-1.45811e-05
-2.02772e-05
-2.34689e-05
-3.74057e-05
-2.89454e-05
-6.1012e-05
-3.31139e-05
-7.59382e-05
-3.74015e-05
-8.61967e-05
-3.98181e-05
-9.16955e-05
-4.16726e-05
-9.47316e-05
-4.30202e-05
-9.92088e-05
-4.44828e-05
-0.000105859
-4.56848e-05
-0.000111975
-4.4403e-05
-0.000118854
-4.09052e-05
-0.000123338
-3.55278e-05
-0.000125699
-2.88123e-05
-0.000127009
-2.30465e-05
-0.000126735
-1.89174e-05
-0.000124744
-1.45828e-05
-0.000122932
-1.02208e-05
-0.00011811
-6.06475e-06
-0.000111961
-2.47732e-06
-0.000106712
-9.73459e-05
-1.9267e-06
-0.000107498
-7.70653e-06
-0.000127186
-1.01989e-05
-0.000129679
-8.24223e-06
-0.000127728
-4.06625e-06
-0.000117129
1.78359e-06
-8.95111e-05
5.13935e-06
-5.75467e-05
5.27215e-06
-3.33883e-05
2.81893e-06
-1.72765e-05
-1.64415e-06
-1.37483e-05
-7.31352e-06
-2.17604e-05
-1.11292e-05
-3.92032e-05
-1.19791e-05
-5.36198e-05
-1.50002e-05
-6.61801e-05
-2.01033e-05
-7.83077e-05
-2.38367e-05
-8.75726e-05
-2.70191e-05
-9.49137e-05
-3.20926e-05
-0.000103927
-3.82865e-05
-0.000112706
-4.17557e-05
-0.000119191
-4.11049e-05
-0.000122461
-3.75208e-05
-0.000124656
-3.15225e-05
-0.000125784
-2.48225e-05
-0.00012488
-2.00212e-05
-0.00012252
-1.57012e-05
-0.00012158
-1.13887e-05
-0.000117174
-7.08806e-06
-0.000111844
-2.75137e-06
-0.000106996
-9.84349e-05
-2.87875e-06
-0.000105396
-7.73828e-06
-0.000124398
-9.93763e-06
-0.000127413
-9.04227e-06
-0.000126126
-5.37065e-06
-0.000116416
5.33592e-07
-8.95601e-05
5.09326e-06
-5.50384e-05
7.63182e-06
-3.31517e-05
8.28132e-06
-1.72324e-05
6.82017e-06
-1.01806e-05
3.54896e-06
-1.27401e-05
1.49197e-06
-2.26808e-05
3.85611e-06
-3.28803e-05
8.02397e-06
-4.12852e-05
9.25512e-06
-5.33005e-05
6.36514e-06
-6.6503e-05
1.14264e-06
-7.85508e-05
-9.10593e-06
-9.03061e-05
-2.37972e-05
-0.000107722
-3.47826e-05
-0.000119226
-3.90003e-05
-0.000122335
-3.82853e-05
-0.00012354
-3.3689e-05
-0.00012469
-2.68401e-05
-0.000123689
-2.11353e-05
-0.00012052
-1.6594e-05
-0.00012002
-1.23688e-05
-0.000116286
-8.02663e-06
-0.000111782
-3.20908e-06
-0.00010729
-9.96441e-05
-2.30282e-06
-0.000103418
-7.77524e-06
-0.000121982
-1.08816e-05
-0.000124906
-9.65353e-06
-0.000124097
-6.57493e-06
-0.000115817
-1.5594e-06
-9.01442e-05
3.79453e-06
-5.27549e-05
7.93823e-06
-3.35732e-05
1.09012e-05
-1.8375e-05
1.22353e-05
-8.9143e-06
1.18366e-05
-7.3328e-06
1.12031e-05
-1.13351e-05
1.2556e-05
-1.85453e-05
1.5972e-05
-2.5908e-05
2.07218e-05
-3.5151e-05
2.5615e-05
-4.61757e-05
2.86877e-05
-5.84859e-05
2.5068e-05
-6.95008e-05
3.56763e-06
-8.87426e-05
-2.20551e-05
-0.000112131
-3.3636e-05
-0.000121859
-3.68826e-05
-0.000122924
-3.49943e-05
-0.000123118
-2.90586e-05
-0.00012255
-2.24261e-05
-0.000119128
-1.71845e-05
-0.00011819
-1.28787e-05
-0.000115502
-8.29739e-06
-0.000111647
-3.36613e-06
-0.000107553
-0.000100608
-3.36076e-06
-0.000101228
-8.84274e-06
-0.000118801
-1.08463e-05
-0.000122189
-9.86739e-06
-0.000122269
-7.80381e-06
-0.000114961
-3.70269e-06
-9.10065e-05
1.45064e-06
-5.30518e-05
6.66889e-06
-3.59714e-05
1.11028e-05
-2.15394e-05
1.43515e-05
-1.04366e-05
1.61067e-05
-5.50838e-06
1.70995e-05
-6.28379e-06
1.83309e-05
-1.05859e-05
1.99732e-05
-1.81039e-05
2.18387e-05
-2.81865e-05
2.43022e-05
-3.88549e-05
2.71142e-05
-4.93888e-05
3.16136e-05
-5.86852e-05
2.6318e-05
-6.98593e-05
1.74825e-07
-9.28082e-05
-2.44409e-05
-0.000116166
-3.32757e-05
-0.00012195
-3.44745e-05
-0.000121767
-3.06183e-05
-0.000121157
-2.37311e-05
-0.0001184
-1.76361e-05
-0.000116482
-1.30424e-05
-0.00011477
-8.26732e-06
-0.000111516
-3.37678e-06
-0.000107694
-0.0001011
-3.11788e-06
-9.89666e-05
-7.95529e-06
-0.000115737
-1.1061e-05
-0.000119621
-1.06065e-05
-0.000119987
-8.51235e-06
-0.000113703
-5.72968e-06
-9.1843e-05
-1.39524e-06
-5.65665e-05
4.03653e-06
-4.0794e-05
9.28598e-06
-2.69494e-05
1.40999e-05
-1.4792e-05
1.73643e-05
-6.98624e-06
1.93625e-05
-5.70779e-06
2.10351e-05
-8.3686e-06
2.29943e-05
-1.54561e-05
2.47729e-05
-2.61781e-05
2.61437e-05
-3.70726e-05
2.70785e-05
-4.74864e-05
2.82101e-05
-5.6498e-05
3.14164e-05
-6.41282e-05
1.81356e-05
-7.52749e-05
-9.81672e-06
-9.9286e-05
-2.65338e-05
-0.000117787
-3.19028e-05
-0.000120607
-3.05509e-05
-0.000119764
-2.45677e-05
-0.000118085
-1.81212e-05
-0.00011561
-1.27774e-05
-0.000114148
-7.88892e-06
-0.000111671
-3.24275e-06
-0.000107866
-0.000101277
-3.44457e-06
-9.67709e-05
-8.70047e-06
-0.000112309
-1.1516e-05
-0.000116574
-1.08108e-05
-0.000117586
-9.24623e-06
-0.000112266
-7.14759e-06
-9.2068e-05
-3.55159e-06
-6.06399e-05
1.01163e-06
-4.67442e-05
5.99392e-06
-3.40069e-05
1.181e-05
-2.13768e-05
1.65162e-05
-1.19261e-05
1.96228e-05
-8.89382e-06
2.16922e-05
-1.07009e-05
2.39916e-05
-1.6982e-05
2.6319e-05
-2.76193e-05
2.78178e-05
-3.82098e-05
2.85453e-05
-4.76238e-05
2.87614e-05
-5.5841e-05
2.91854e-05
-6.32926e-05
2.86158e-05
-6.99397e-05
9.85634e-06
-8.20706e-05
-1.62115e-05
-0.000105648
-2.68759e-05
-0.000118053
-2.8767e-05
-0.000118715
-2.49513e-05
-0.000117859
-1.84927e-05
-0.000115516
-1.25644e-05
-0.000113829
-7.40084e-06
-0.000111822
-2.82559e-06
-0.000108074
-0.000101157
-3.83265e-06
-9.42162e-05
-8.16592e-06
-0.000109091
-1.11064e-05
-0.000113761
-1.13877e-05
-0.000115055
-1.0412e-05
-0.000110566
-7.90646e-06
-9.1565e-05
-4.33347e-06
-6.29191e-05
-1.13004e-06
-5.13839e-05
2.79107e-06
-4.11228e-05
8.58692e-06
-2.90423e-05
1.38617e-05
-1.96363e-05
1.80588e-05
-1.60195e-05
2.11154e-05
-1.74388e-05
2.39803e-05
-2.33129e-05
2.66496e-05
-3.29543e-05
2.82339e-05
-4.22566e-05
2.87958e-05
-4.98049e-05
2.92317e-05
-5.64164e-05
2.90998e-05
-6.24947e-05
2.95151e-05
-6.91002e-05
2.19816e-05
-7.49098e-05
1.70132e-07
-8.90465e-05
-1.86554e-05
-0.000111314
-2.52976e-05
-0.000117465
-2.41644e-05
-0.00011763
-1.8628e-05
-0.000116003
-1.24542e-05
-0.000113902
-7.19475e-06
-0.000111722
-2.51284e-06
-0.000108036
-0.000100313
-3.67836e-06
-9.14888e-05
-8.18593e-06
-0.000105755
-1.18566e-05
-0.000110573
-1.16942e-05
-0.000112326
-1.08837e-05
-0.000108711
-8.60295e-06
-9.10083e-05
-4.53864e-06
-6.3737e-05
-1.84991e-06
-5.37727e-05
9.35584e-07
-4.60482e-05
5.8148e-06
-3.65212e-05
1.06662e-05
-2.8879e-05
1.50855e-05
-2.59261e-05
1.8807e-05
-2.74339e-05
2.204e-05
-3.31708e-05
2.44889e-05
-4.09552e-05
2.62682e-05
-4.80276e-05
2.73515e-05
-5.35835e-05
2.81553e-05
-5.8398e-05
2.90603e-05
-6.24544e-05
2.8701e-05
-6.82881e-05
2.79944e-05
-7.28231e-05
1.57393e-05
-7.92038e-05
-6.06376e-06
-9.73282e-05
-1.83864e-05
-0.00011438
-2.12714e-05
-0.000117525
-1.82008e-05
-0.000117334
-1.21429e-05
-0.000114793
-7.00345e-06
-0.000111936
-2.2916e-06
-0.000107851
-9.86831e-05
-4.24846e-06
-8.86949e-05
-8.38688e-06
-0.000101745
-1.15258e-05
-0.000106953
-1.16407e-05
-0.000109588
-1.15419e-05
-0.000106795
-9.60707e-06
-9.04958e-05
-5.1088e-06
-6.38257e-05
-2.05824e-06
-5.48838e-05
1.80309e-07
-4.83979e-05
4.00663e-06
-4.18558e-05
7.89835e-06
-3.74133e-05
1.20209e-05
-3.59652e-05
1.58677e-05
-3.78462e-05
1.89524e-05
-4.26172e-05
2.10587e-05
-4.81883e-05
2.29186e-05
-5.30152e-05
2.45112e-05
-5.70476e-05
2.54433e-05
-6.06893e-05
2.74757e-05
-6.35314e-05
2.81162e-05
-6.76243e-05
2.79338e-05
-7.22104e-05
2.74598e-05
-7.61301e-05
1.30733e-05
-8.46519e-05
-6.99703e-06
-0.000105234
-1.5912e-05
-0.000116794
-1.58807e-05
-0.000118917
-1.12647e-05
-0.000116808
-6.54975e-06
-0.000113029
-2.14132e-06
-0.000108111
-9.72055e-05
-4.65032e-06
-8.54738e-05
-8.17429e-06
-9.76923e-05
-1.1359e-05
-0.000103576
-1.18714e-05
-0.000106675
-1.21987e-05
-0.000104511
-1.05731e-05
-9.00914e-05
-5.98797e-06
-6.36692e-05
-2.738e-06
-5.5454e-05
-4.33842e-07
-4.95157e-05
3.07278e-06
-4.45563e-05
6.08667e-06
-4.28361e-05
9.73242e-06
-4.31892e-05
1.33531e-05
-4.54319e-05
1.60714e-05
-4.8871e-05
1.81002e-05
-5.29166e-05
2.00815e-05
-5.63716e-05
2.20375e-05
-5.93851e-05
2.34185e-05
-6.19851e-05
2.54294e-05
-6.47266e-05
2.70279e-05
-6.7695e-05
2.71104e-05
-7.17581e-05
2.86556e-05
-7.50656e-05
2.70406e-05
-7.92585e-05
1.05493e-05
-9.24495e-05
-7.06385e-06
-0.00011223
-1.16829e-05
-0.000119347
-9.69981e-06
-0.000118954
-5.5371e-06
-0.000114703
-1.70614e-06
-0.000109245
-9.64481e-05
-3.84443e-06
-8.1996e-05
-7.14439e-06
-9.36677e-05
-1.13381e-05
-9.95669e-05
-1.20248e-05
-0.000103493
-1.2504e-05
-0.000102264
-1.12715e-05
-8.95587e-05
-6.85873e-06
-6.34781e-05
-3.63655e-06
-5.57486e-05
-1.27453e-06
-5.02795e-05
2.2914e-06
-4.62676e-05
4.96127e-06
-4.56333e-05
8.02481e-06
-4.70817e-05
1.11814e-05
-4.95885e-05
1.37033e-05
-5.23132e-05
1.57951e-05
-5.55775e-05
1.778e-05
-5.86097e-05
1.9903e-05
-6.11598e-05
2.21654e-05
-6.27457e-05
2.3936e-05
-6.5207e-05
2.56259e-05
-6.82426e-05
2.63687e-05
-7.15066e-05
2.71478e-05
-7.48222e-05
3.05042e-05
-7.71129e-05
2.46262e-05
-8.30897e-05
6.47253e-06
-0.000101855
-6.06484e-06
-0.000117244
-7.14569e-06
-0.000119764
-4.0309e-06
-0.00011605
-9.05645e-07
-0.000110797
-9.61738e-05
-5.01943e-06
-7.85298e-05
-8.08623e-06
-8.93598e-05
-1.13055e-05
-9.53544e-05
-1.16278e-05
-0.000100221
-1.27384e-05
-9.99374e-05
-1.2278e-05
-8.8593e-05
-7.72898e-06
-6.31737e-05
-4.31272e-06
-5.58751e-05
-2.06582e-06
-5.10181e-05
1.33579e-06
-4.79092e-05
3.93403e-06
-4.78873e-05
6.64128e-06
-4.9593e-05
9.50293e-06
-5.21477e-05
1.20587e-05
-5.45817e-05
1.42255e-05
-5.71223e-05
1.60674e-05
-6.01335e-05
1.79601e-05
-6.25952e-05
2.05357e-05
-6.37643e-05
2.26882e-05
-6.54946e-05
2.42737e-05
-6.84673e-05
2.54387e-05
-7.1317e-05
2.57295e-05
-7.4291e-05
2.7878e-05
-7.68096e-05
3.13816e-05
-7.87582e-05
2.01444e-05
-9.06172e-05
1.60013e-06
-0.000112712
-3.94172e-06
-0.00011883
-2.41611e-06
-0.000116349
-1.0386e-07
-0.000111652
-9.61546e-05
-4.7666e-06
-7.43286e-05
-7.03484e-06
-8.44106e-05
-1.06465e-05
-9.13591e-05
-1.17188e-05
-9.68448e-05
-1.32968e-05
-9.70241e-05
-1.31916e-05
-8.76463e-05
-8.70644e-06
-6.2931e-05
-4.95141e-06
-5.59129e-05
-2.72373e-06
-5.16497e-05
4.74914e-07
-4.93548e-05
3.05492e-06
-5.00352e-05
5.67308e-06
-5.17762e-05
8.27283e-06
-5.40134e-05
1.07059e-05
-5.63163e-05
1.29262e-05
-5.82573e-05
1.47446e-05
-6.12036e-05
1.64427e-05
-6.3545e-05
1.86836e-05
-6.47769e-05
2.11497e-05
-6.61273e-05
2.29356e-05
-6.84149e-05
2.43271e-05
-7.1087e-05
2.48137e-05
-7.35608e-05
2.51583e-05
-7.6383e-05
2.88852e-05
-7.77663e-05
2.49865e-05
-8.37627e-05
9.04164e-06
-0.000107911
-3.97763e-07
-0.000116797
-5.2971e-07
-0.000115455
7.00437e-07
-0.000111427
-9.60529e-05
-4.36417e-06
-6.99612e-05
-6.40317e-06
-7.96466e-05
-1.05953e-05
-8.67597e-05
-1.17476e-05
-9.31291e-05
-1.35404e-05
-9.42362e-05
-1.40977e-05
-8.64973e-05
-9.78936e-06
-6.28162e-05
-5.76594e-06
-5.59358e-05
-3.44515e-06
-5.21408e-05
-3.15651e-07
-5.04157e-05
2.26283e-06
-5.15759e-05
4.82056e-06
-5.33392e-05
7.20567e-06
-5.52422e-05
9.48757e-06
-5.74261e-05
1.16262e-05
-5.91516e-05
1.33932e-05
-6.18995e-05
1.51643e-05
-6.40608e-05
1.72085e-05
-6.53176e-05
1.94588e-05
-6.66979e-05
2.1424e-05
-6.84031e-05
2.29526e-05
-7.07138e-05
2.3722e-05
-7.29182e-05
2.35799e-05
-7.51297e-05
2.51365e-05
-7.70391e-05
2.39367e-05
-8.10926e-05
1.28222e-05
-0.000104016
3.37561e-06
-0.000114423
1.77876e-06
-0.000113856
1.78736e-06
-0.000110537
-9.53214e-05
-5.19432e-06
-6.55238e-05
-6.91923e-06
-7.48819e-05
-1.04802e-05
-8.1712e-05
-1.15096e-05
-8.92975e-05
-1.39597e-05
-9.13323e-05
-1.50902e-05
-8.49634e-05
-1.07694e-05
-6.27153e-05
-6.5942e-06
-5.59969e-05
-4.19972e-06
-5.26047e-05
-1.07519e-06
-5.12536e-05
1.43705e-06
-5.26153e-05
3.88999e-06
-5.43832e-05
6.15842e-06
-5.6066e-05
8.39172e-06
-5.80447e-05
1.04738e-05
-5.97554e-05
1.21248e-05
-6.22383e-05
1.38586e-05
-6.43872e-05
1.59056e-05
-6.56154e-05
1.79247e-05
-6.67499e-05
1.98731e-05
-6.82022e-05
2.14028e-05
-7.02277e-05
2.21921e-05
-7.22038e-05
2.23763e-05
-7.34779e-05
2.32074e-05
-7.53305e-05
2.24171e-05
-7.97629e-05
1.44235e-05
-0.000100872
6.26365e-06
-0.000112158
3.76406e-06
-0.000112087
2.83094e-06
-0.000109284
-9.36666e-05
-5.06964e-06
-6.05218e-05
-6.4046e-06
-6.94855e-05
-1.00737e-05
-7.67059e-05
-1.15818e-05
-8.50317e-05
-1.44301e-05
-8.81973e-05
-1.58181e-05
-8.34354e-05
-1.16268e-05
-6.25689e-05
-7.36343e-06
-5.6054e-05
-4.8557e-06
-5.30719e-05
-1.74832e-06
-5.20439e-05
6.76459e-07
-5.34971e-05
3.00712e-06
-5.51594e-05
5.11009e-06
-5.66042e-05
7.21708e-06
-5.8422e-05
9.3407e-06
-6.01485e-05
1.10407e-05
-6.22922e-05
1.25687e-05
-6.45258e-05
1.44842e-05
-6.58456e-05
1.65246e-05
-6.64738e-05
1.85091e-05
-6.76049e-05
1.99547e-05
-6.95938e-05
2.06111e-05
-7.11342e-05
2.11959e-05
-7.17626e-05
2.23737e-05
-7.32237e-05
2.15157e-05
-7.8008e-05
1.47747e-05
-9.80387e-05
7.58257e-06
-0.000109929
4.76764e-06
-0.000110235
3.34589e-06
-0.000107704
-9.13192e-05
-5.20682e-06
-5.48976e-05
-5.86672e-06
-6.33218e-05
-9.71346e-06
-7.1402e-05
-1.16225e-05
-8.0372e-05
-1.47062e-05
-8.50864e-05
-1.64478e-05
-8.16551e-05
-1.24608e-05
-6.24141e-05
-8.15072e-06
-5.6129e-05
-5.50207e-06
-5.35142e-05
-2.45882e-06
-5.27419e-05
-2.00198e-07
-5.4178e-05
2.06604e-06
-5.56783e-05
4.09886e-06
-5.69206e-05
5.96979e-06
-5.85681e-05
8.08244e-06
-6.03357e-05
9.96877e-06
-6.21907e-05
1.14181e-05
-6.43539e-05
1.3142e-05
-6.57951e-05
1.52471e-05
-6.61106e-05
1.73259e-05
-6.69183e-05
1.87197e-05
-6.87986e-05
1.94429e-05
-6.97188e-05
2.03449e-05
-6.99477e-05
2.20716e-05
-7.11607e-05
2.15606e-05
-7.60389e-05
1.50643e-05
-9.46409e-05
7.96675e-06
-0.000107451
5.07786e-06
-0.000108367
3.47708e-06
-0.000105812
-8.84721e-05
-5.57091e-06
-4.85637e-05
-5.41716e-06
-5.74738e-05
-9.24097e-06
-6.60873e-05
-1.17297e-05
-7.49718e-05
-1.50317e-05
-8.15498e-05
-1.69765e-05
-7.98446e-05
-1.32699e-05
-6.23026e-05
-8.88905e-06
-5.62478e-05
-6.19145e-06
-5.39024e-05
-3.26313e-06
-5.32575e-05
-1.17577e-06
-5.45809e-05
1.04276e-06
-5.59303e-05
3.09498e-06
-5.70468e-05
4.82303e-06
-5.84614e-05
6.84938e-06
-6.01693e-05
8.86153e-06
-6.19604e-05
1.03796e-05
-6.39465e-05
1.19884e-05
-6.53875e-05
1.40942e-05
-6.55392e-05
1.62005e-05
-6.63124e-05
1.76121e-05
-6.79406e-05
1.86239e-05
-6.82974e-05
1.9959e-05
-6.81052e-05
2.21584e-05
-6.91515e-05
2.25708e-05
-7.38402e-05
1.64013e-05
-8.98812e-05
8.69815e-06
-0.000104717
5.44818e-06
-0.000106607
3.88065e-06
-0.000103704
-8.46011e-05
-5.36922e-06
-4.19249e-05
-5.55193e-06
-5.14455e-05
-9.43553e-06
-5.95464e-05
-1.1658e-05
-6.92884e-05
-1.539e-05
-7.76535e-05
-1.75865e-05
-7.79029e-05
-1.40414e-05
-6.2324e-05
-9.62848e-06
-5.63062e-05
-6.92937e-06
-5.41466e-05
-4.11004e-06
-5.35634e-05
-2.14462e-06
-5.47473e-05
-2.76312e-09
-5.5924e-05
2.09207e-06
-5.69519e-05
3.81827e-06
-5.82349e-05
5.78622e-06
-5.97798e-05
7.81539e-06
-6.14832e-05
9.31407e-06
-6.33527e-05
1.0898e-05
-6.47555e-05
1.30285e-05
-6.47761e-05
1.51124e-05
-6.55926e-05
1.6562e-05
-6.70387e-05
1.78232e-05
-6.71257e-05
1.96881e-05
-6.65282e-05
2.22703e-05
-6.73347e-05
2.44982e-05
-7.14498e-05
1.97577e-05
-8.42964e-05
1.08006e-05
-0.000101527
6.35267e-06
-0.000104647
4.84829e-06
-0.000101316
-7.90184e-05
-6.29895e-06
-3.35542e-05
-5.28181e-06
-4.35722e-05
-8.18693e-06
-5.26362e-05
-1.09841e-05
-6.30111e-05
-1.52491e-05
-7.3389e-05
-1.81849e-05
-7.58488e-05
-1.50091e-05
-6.25787e-05
-1.04759e-05
-5.62703e-05
-7.75646e-06
-5.42238e-05
-4.99261e-06
-5.36638e-05
-3.09681e-06
-5.4676e-05
-1.03461e-06
-5.57332e-05
1.12599e-06
-5.66187e-05
2.91523e-06
-5.78948e-05
4.80219e-06
-5.93305e-05
6.85404e-06
-6.07769e-05
8.35083e-06
-6.25241e-05
9.89421e-06
-6.38779e-05
1.20398e-05
-6.39616e-05
1.41809e-05
-6.47018e-05
1.56111e-05
-6.6039e-05
1.68823e-05
-6.60602e-05
1.91852e-05
-6.53049e-05
2.18261e-05
-6.59709e-05
2.56814e-05
-6.95245e-05
2.40451e-05
-8.02376e-05
1.4385e-05
-9.78584e-05
7.54336e-06
-0.000102114
5.60924e-06
-9.84341e-05
-7.24377e-05
-5.93958e-06
-2.25428e-05
-4.07929e-06
-3.52572e-05
-7.53494e-06
-4.56567e-05
-1.03865e-05
-5.62267e-05
-1.52693e-05
-6.85328e-05
-1.929e-05
-7.39749e-05
-1.62177e-05
-6.29072e-05
-1.14119e-05
-5.62502e-05
-8.64974e-06
-5.42149e-05
-5.89001e-06
-5.36265e-05
-3.99968e-06
-5.44004e-05
-1.98269e-06
-5.5396e-05
2.0329e-07
-5.61071e-05
2.13987e-06
-5.73464e-05
3.91536e-06
-5.87208e-05
5.89803e-06
-5.99952e-05
7.55304e-06
-6.15216e-05
9.01082e-06
-6.27575e-05
1.11075e-05
-6.30243e-05
1.32595e-05
-6.37067e-05
1.46522e-05
-6.48887e-05
1.59587e-05
-6.4893e-05
1.84001e-05
-6.42949e-05
2.08464e-05
-6.50731e-05
2.48859e-05
-6.85621e-05
2.62945e-05
-7.8509e-05
1.77713e-05
-9.47135e-05
8.58224e-06
-9.9101e-05
4.89849e-06
-9.5336e-05
-6.78226e-05
-7.43509e-06
-1.16406e-05
-4.70365e-06
-2.51309e-05
-7.26123e-06
-3.69146e-05
-9.53239e-06
-4.921e-05
-1.53918e-05
-6.32065e-05
-2.06637e-05
-7.18001e-05
-1.75228e-05
-6.32456e-05
-1.23937e-05
-5.63435e-05
-9.60037e-06
-5.41582e-05
-6.83231e-06
-5.35233e-05
-4.86024e-06
-5.40061e-05
-2.81181e-06
-5.49216e-05
-6.58884e-07
-5.55146e-05
1.39256e-06
-5.65955e-05
3.18373e-06
-5.78764e-05
5.04245e-06
-5.91662e-05
6.75683e-06
-6.03897e-05
8.24594e-06
-6.15675e-05
1.02717e-05
-6.19302e-05
1.22663e-05
-6.24847e-05
1.36103e-05
-6.35477e-05
1.49535e-05
-6.36638e-05
1.72535e-05
-6.33415e-05
1.94764e-05
-6.43606e-05
2.27219e-05
-6.83905e-05
2.52739e-05
-7.8864e-05
1.93093e-05
-9.21512e-05
9.70029e-06
-9.56901e-05
4.11124e-06
-9.21773e-05
-6.54442e-05
-4.78581e-06
-5.66779e-06
-4.41362e-06
-1.49553e-05
-6.36138e-06
-2.70653e-05
-8.58428e-06
-4.04535e-05
-1.57186e-05
-5.65553e-05
-2.24369e-05
-6.86844e-05
-1.89959e-05
-6.38581e-05
-1.34749e-05
-5.65665e-05
-1.0631e-05
-5.41024e-05
-7.79987e-06
-5.33644e-05
-5.67457e-06
-5.35494e-05
-3.56348e-06
-5.43438e-05
-1.43235e-06
-5.48607e-05
6.72503e-07
-5.57279e-05
2.53066e-06
-5.68633e-05
4.31883e-06
-5.81331e-05
6.02898e-06
-5.90508e-05
7.52925e-06
-6.03382e-05
9.43548e-06
-6.07059e-05
1.13527e-05
-6.09501e-05
1.26306e-05
-6.19469e-05
1.38174e-05
-6.22936e-05
1.59504e-05
-6.21984e-05
1.79705e-05
-6.35791e-05
1.9896e-05
-6.87676e-05
2.20376e-05
-8.05574e-05
1.90298e-05
-8.95778e-05
1.07362e-05
-9.19951e-05
4.11847e-06
-8.87722e-05
-6.32446e-05
-1.78447e-06
-4.02356e-06
-3.74157e-06
-1.08512e-05
-5.21615e-06
-1.90294e-05
-6.84917e-06
-3.04656e-05
-1.5316e-05
-4.64024e-05
-2.38196e-05
-6.40815e-05
-2.061e-05
-6.40648e-05
-1.4758e-05
-5.68826e-05
-1.17102e-05
-5.42147e-05
-8.7079e-06
-5.31468e-05
-6.43361e-06
-5.30823e-05
-4.29965e-06
-5.36745e-05
-2.12018e-06
-5.40691e-05
2.82471e-08
-5.48469e-05
1.90251e-06
-5.57893e-05
3.7043e-06
-5.68241e-05
5.51026e-06
-5.75812e-05
6.91898e-06
-5.89472e-05
8.54369e-06
-5.93116e-05
1.04592e-05
-5.92864e-05
1.17301e-05
-6.00428e-05
1.27453e-05
-6.05781e-05
1.45624e-05
-6.07132e-05
1.63422e-05
-6.26456e-05
1.77848e-05
-6.99951e-05
1.90372e-05
-8.16258e-05
1.74111e-05
-8.71574e-05
1.09524e-05
-8.83193e-05
4.15298e-06
-8.53248e-05
-6.14474e-05
-9.16391e-07
-3.77218e-06
-1.65621e-06
-9.96065e-06
-2.49183e-06
-1.5973e-05
-3.67896e-06
-2.33961e-05
-1.231e-05
-3.57724e-05
-2.35769e-05
-5.75792e-05
-2.25215e-05
-6.34699e-05
-1.63344e-05
-5.72027e-05
-1.28752e-05
-5.46492e-05
-9.62952e-06
-5.29501e-05
-7.16914e-06
-5.26327e-05
-4.98985e-06
-5.29472e-05
-2.71145e-06
-5.3196e-05
-5.57928e-07
-5.3879e-05
1.35883e-06
-5.46662e-05
3.19213e-06
-5.5443e-05
5.02498e-06
-5.60902e-05
6.41087e-06
-5.72744e-05
7.77667e-06
-5.77265e-05
9.62061e-06
-5.75714e-05
1.08246e-05
-5.79571e-05
1.17017e-05
-5.84916e-05
1.31467e-05
-5.88816e-05
1.47402e-05
-6.16075e-05
1.64446e-05
-7.13487e-05
1.73889e-05
-8.10159e-05
1.5978e-05
-8.46286e-05
1.07282e-05
-8.47089e-05
4.12271e-06
-8.20343e-05
-6.05223e-05
4.5355e-07
-3.65311e-06
-4.2733e-07
-9.8832e-06
-9.01405e-07
-1.53568e-05
-1.75582e-06
-2.10796e-05
-7.28728e-06
-3.08757e-05
-2.05612e-05
-5.10292e-05
-2.46381e-05
-6.23824e-05
-1.83742e-05
-5.77658e-05
-1.42162e-05
-5.53394e-05
-1.0633e-05
-5.29629e-05
-7.90928e-06
-5.22428e-05
-5.60059e-06
-5.22292e-05
-3.26491e-06
-5.23649e-05
-1.05359e-06
-5.27483e-05
9.36461e-07
-5.34275e-05
2.71115e-06
-5.40994e-05
4.54128e-06
-5.45607e-05
6.01143e-06
-5.53391e-05
7.2333e-06
-5.59634e-05
8.92902e-06
-5.56931e-05
1.00047e-05
-5.57723e-05
1.08304e-05
-5.61182e-05
1.21548e-05
-5.68346e-05
1.37742e-05
-6.07114e-05
1.55492e-05
-7.17874e-05
1.65046e-05
-7.91489e-05
1.56313e-05
-8.14813e-05
1.10148e-05
-8.11714e-05
4.02865e-06
-7.87513e-05
-6.02901e-05
1.80332e-06
-1.17113e-05
5.06773e-07
-9.67175e-06
-5.6591e-07
-1.55434e-05
-3.03599e-07
-2.09919e-05
-3.26909e-06
-3.03771e-05
-1.96533e-05
-5.59664e-05
-2.72554e-05
-6.13171e-05
-2.09164e-05
-5.87194e-05
-1.5799e-05
-5.61245e-05
-1.17443e-05
-5.33432e-05
-8.6339e-06
-5.20016e-05
-6.16162e-06
-5.1563e-05
-3.80506e-06
-5.15385e-05
-1.4944e-06
-5.16804e-05
6.23873e-07
-5.20886e-05
2.34945e-06
-5.26243e-05
4.14553e-06
-5.29807e-05
5.68825e-06
-5.33794e-05
6.84619e-06
-5.39982e-05
8.29445e-06
-5.36153e-05
9.20552e-06
-5.34433e-05
1.0048e-05
-5.35922e-05
1.15985e-05
-5.47132e-05
1.34345e-05
-6.01185e-05
1.52983e-05
-7.1229e-05
1.64443e-05
-7.67231e-05
1.62622e-05
-7.81169e-05
1.22377e-05
-7.7596e-05
3.92847e-06
-7.50617e-05
-6.20678e-05
-1.06148e-06
-3.58385e-05
-1.27916e-06
-3.15208e-05
-2.57769e-06
-1.77975e-05
-5.14566e-06
-2.46918e-05
-1.99129e-05
-4.4505e-05
-3.3382e-05
-6.32811e-05
-2.98581e-05
-6.14346e-05
-2.32504e-05
-5.9608e-05
-1.76318e-05
-5.7106e-05
-1.2978e-05
-5.40327e-05
-9.34653e-06
-5.19996e-05
-6.64777e-06
-5.09945e-05
-4.20437e-06
-5.07193e-05
-1.81617e-06
-5.06401e-05
3.20446e-07
-5.0778e-05
2.07426e-06
-5.10371e-05
3.9204e-06
-5.13069e-05
5.45812e-06
-5.14939e-05
6.56462e-06
-5.18288e-05
7.79219e-06
-5.13807e-05
8.5343e-06
-5.09915e-05
9.38376e-06
-5.10969e-05
1.11972e-05
-5.26367e-05
1.33553e-05
-5.98015e-05
1.53097e-05
-6.9491e-05
1.62879e-05
-7.4113e-05
1.56096e-05
-7.49014e-05
1.17638e-05
-7.40006e-05
4.80903e-06
-7.12628e-05
-6.25941e-05
-1.12197e-05
-4.79485e-05
-9.58925e-06
-5.70759e-05
-8.69678e-06
-4.31117e-05
-2.42663e-05
-4.52598e-05
-3.80628e-05
-6.10264e-05
-3.65399e-05
-6.23585e-05
-3.17069e-05
-6.19625e-05
-2.54733e-05
-6.03143e-05
-1.93831e-05
-5.81329e-05
-1.4176e-05
-5.47965e-05
-1.00453e-05
-5.22583e-05
-7.05815e-06
-5.05529e-05
-4.4927e-06
-4.99516e-05
-2.07802e-06
-4.95137e-05
6.07494e-08
-4.94922e-05
1.96277e-06
-4.94758e-05
3.83165e-06
-4.95391e-05
5.24097e-06
-4.95486e-05
6.35485e-06
-4.95412e-05
7.48887e-06
-4.90523e-05
8.08526e-06
-4.84504e-05
8.91688e-06
-4.86367e-05
1.08701e-05
-5.07488e-05
1.36248e-05
-5.92308e-05
1.58186e-05
-6.74098e-05
1.63301e-05
-7.11418e-05
1.52823e-05
-7.16008e-05
1.14076e-05
-7.05166e-05
6.18214e-06
-6.74197e-05
-5.95646e-05
-4.69422e-06
-3.96541e-05
-1.44446e-05
-5.60472e-05
-2.38129e-05
-6.3001e-05
-3.24449e-05
-6.28963e-05
-3.66753e-05
-6.25122e-05
-3.62571e-05
-6.16644e-05
-3.24952e-05
-6.17979e-05
-2.69093e-05
-6.07623e-05
-2.09619e-05
-5.87469e-05
-1.53102e-05
-5.56205e-05
-1.07067e-05
-5.26632e-05
-7.37461e-06
-5.02377e-05
-4.70838e-06
-4.9208e-05
-2.25764e-06
-4.84722e-05
-2.65508e-08
-4.81318e-05
1.93166e-06
-4.79346e-05
3.74858e-06
-4.77633e-05
5.13916e-06
-4.75589e-05
6.3193e-06
-4.72514e-05
7.37083e-06
-4.66047e-05
7.82178e-06
-4.5784e-05
8.61564e-06
-4.60683e-05
1.08116e-05
-4.90666e-05
1.40345e-05
-5.82794e-05
1.62265e-05
-6.54143e-05
1.6399e-05
-6.7971e-05
1.48605e-05
-6.82037e-05
1.05476e-05
-6.7017e-05
5.49718e-06
-6.32633e-05
-5.62402e-05
1.99779e-06
-3.33672e-05
1.66452e-06
-4.69853e-05
-4.3728e-06
-5.81552e-05
-1.79863e-05
-6.22173e-05
-2.96091e-05
-6.14037e-05
-3.29019e-05
-6.09934e-05
-3.1705e-05
-6.09779e-05
-2.75576e-05
-6.07886e-05
-2.20799e-05
-5.90041e-05
-1.64011e-05
-5.63392e-05
-1.13445e-05
-5.31312e-05
-7.65534e-06
-5.00418e-05
-4.85077e-06
-4.84938e-05
-2.33782e-06
-4.74541e-05
-3.67609e-08
-4.68326e-05
1.92675e-06
-4.63802e-05
3.77784e-06
-4.60098e-05
5.31184e-06
-4.55843e-05
6.46296e-06
-4.49728e-05
7.34413e-06
-4.39861e-05
7.71982e-06
-4.30032e-05
8.38898e-06
-4.34451e-05
1.10116e-05
-4.75674e-05
1.44307e-05
-5.71764e-05
1.63849e-05
-6.30587e-05
1.66288e-05
-6.47639e-05
1.47126e-05
-6.46303e-05
9.49238e-06
-6.31921e-05
4.47705e-06
-5.91886e-05
-5.29378e-05
2.91149e-06
-2.87151e-05
3.73e-06
-4.22904e-05
1.91939e-06
-5.23654e-05
-6.41437e-06
-5.84654e-05
-1.96548e-05
-5.98359e-05
-2.82315e-05
-5.96652e-05
-2.93764e-05
-5.97154e-05
-2.70961e-05
-5.98031e-05
-2.25645e-05
-5.91017e-05
-1.71966e-05
-5.67221e-05
-1.20352e-05
-5.35709e-05
-7.92109e-06
-4.99273e-05
-4.90962e-06
-4.78293e-05
-2.37307e-06
-4.64627e-05
-1.26748e-08
-4.55922e-05
2.03723e-06
-4.48683e-05
3.92849e-06
-4.42888e-05
5.62277e-06
-4.36324e-05
6.75672e-06
-4.2704e-05
7.47235e-06
-4.131e-05
7.87467e-06
-4.01445e-05
8.65155e-06
-4.07489e-05
1.13308e-05
-4.59887e-05
1.47237e-05
-5.54881e-05
1.66485e-05
-6.03677e-05
1.68394e-05
-6.13134e-05
1.47458e-05
-6.09408e-05
9.25319e-06
-5.91597e-05
4.20852e-06
-5.54546e-05
-4.95715e-05
4.33595e-06
-2.51702e-05
6.42913e-06
-3.93599e-05
8.033e-06
-4.93101e-05
4.65389e-06
-5.53903e-05
-7.83687e-06
-5.69458e-05
-2.09599e-05
-5.77317e-05
-2.59709e-05
-5.8691e-05
-2.56715e-05
-5.8489e-05
-2.24636e-05
-5.82774e-05
-1.77367e-05
-5.68661e-05
-1.26648e-05
-5.38572e-05
-8.22361e-06
-4.98403e-05
-4.98412e-06
-4.72132e-05
-2.34482e-06
-4.55565e-05
9.12758e-08
-4.43895e-05
2.2834e-06
-4.34527e-05
4.19656e-06
-4.26317e-05
5.90013e-06
-4.16965e-05
7.16087e-06
-4.04886e-05
7.80721e-06
-3.86656e-05
8.28526e-06
-3.72571e-05
9.55544e-06
-3.79591e-05
1.19739e-05
-4.40252e-05
1.48128e-05
-5.33482e-05
1.67309e-05
-5.72578e-05
1.6759e-05
-5.7711e-05
1.44289e-05
-5.70929e-05
9.35948e-06
-5.51651e-05
4.63721e-06
-5.15826e-05
-4.6051e-05
5.55611e-06
-2.39142e-05
8.73349e-06
-3.86792e-05
1.09292e-05
-4.7957e-05
9.87895e-06
-5.2045e-05
3.17437e-06
-5.33583e-05
-1.00164e-05
-5.45179e-05
-2.03681e-05
-5.74224e-05
-2.31442e-05
-5.78653e-05
-2.18536e-05
-5.70336e-05
-1.79712e-05
-5.64177e-05
-1.31468e-05
-5.39548e-05
-8.58535e-06
-4.97249e-05
-5.06106e-06
-4.66399e-05
-2.30942e-06
-4.46833e-05
1.6334e-07
-4.32818e-05
2.51532e-06
-4.21075e-05
4.55269e-06
-4.10618e-05
6.31048e-06
-3.98458e-05
7.74011e-06
-3.83714e-05
8.39591e-06
-3.59805e-05
8.97729e-06
-3.43609e-05
1.04276e-05
-3.52029e-05
1.28214e-05
-4.20199e-05
1.51981e-05
-5.08811e-05
1.65113e-05
-5.38757e-05
1.61282e-05
-5.4052e-05
1.31464e-05
-5.31686e-05
7.64172e-06
-5.10886e-05
3.74003e-06
-4.78657e-05
-4.24507e-05
6.78014e-06
-2.55762e-05
1.07411e-05
-4.01866e-05
1.33826e-05
-4.72113e-05
1.38353e-05
-4.9308e-05
1.01582e-05
-4.98912e-05
-4.39834e-07
-5.05278e-05
-1.27573e-05
-5.41842e-05
-1.91665e-05
-5.69444e-05
-1.99958e-05
-5.58364e-05
-1.77047e-05
-5.49717e-05
-1.34911e-05
-5.36157e-05
-8.95561e-06
-4.95242e-05
-5.2081e-06
-4.60498e-05
-2.32319e-06
-4.38238e-05
2.80658e-07
-4.22017e-05
2.75538e-06
-4.0832e-05
4.89183e-06
-3.95814e-05
6.78622e-06
-3.80731e-05
8.34278e-06
-3.63853e-05
9.18536e-06
-3.34515e-05
1.00448e-05
-3.14956e-05
1.15902e-05
-3.24704e-05
1.3653e-05
-3.97135e-05
1.54969e-05
-4.80258e-05
1.63291e-05
-5.04734e-05
1.54097e-05
-5.04963e-05
1.21505e-05
-4.94435e-05
7.06453e-06
-4.72529e-05
4.02165e-06
-4.43238e-05
-3.85208e-05
8.50189e-06
-3.14825e-05
1.24382e-05
-4.32262e-05
1.51645e-05
-4.71612e-05
1.57733e-05
-4.69073e-05
1.38462e-05
-4.59902e-05
6.62955e-06
-4.60088e-05
-5.21217e-06
-4.94295e-05
-1.45831e-05
-5.48999e-05
-1.80112e-05
-5.48109e-05
-1.70196e-05
-5.32274e-05
-1.35877e-05
-5.21318e-05
-9.24455e-06
-4.92036e-05
-5.39721e-06
-4.53631e-05
-2.36855e-06
-4.29145e-05
3.18863e-07
-4.11288e-05
2.91461e-06
-3.95948e-05
5.23269e-06
-3.81562e-05
7.34508e-06
-3.63813e-05
8.914e-06
-3.45559e-05
9.98563e-06
-3.1155e-05
1.12865e-05
-2.87216e-05
1.30595e-05
-2.9775e-05
1.4801e-05
-3.69652e-05
1.59321e-05
-4.48679e-05
1.63087e-05
-4.71495e-05
1.48773e-05
-4.70979e-05
1.15033e-05
-4.57859e-05
6.82976e-06
-4.33514e-05
4.42327e-06
-3.99332e-05
-3.37103e-05
1.00661e-05
-3.93855e-05
1.33473e-05
-4.59705e-05
1.61373e-05
-4.67089e-05
1.74541e-05
-4.41287e-05
1.60543e-05
-4.14479e-05
1.04931e-05
-4.133e-05
7.62545e-07
-4.45301e-05
-9.26163e-06
-5.14266e-05
-1.51816e-05
-5.40114e-05
-1.61416e-05
-5.17994e-05
-1.36711e-05
-5.04534e-05
-9.49411e-06
-4.85103e-05
-5.60526e-06
-4.45628e-05
-2.45753e-06
-4.19471e-05
3.51267e-07
-4.00284e-05
3.04585e-06
-3.83548e-05
5.46486e-06
-3.67548e-05
7.8234e-06
-3.47464e-05
9.46023e-06
-3.28957e-05
1.0836e-05
-2.89955e-05
1.27332e-05
-2.60447e-05
1.46231e-05
-2.71686e-05
1.60395e-05
-3.40463e-05
1.65604e-05
-4.14788e-05
1.62235e-05
-4.38503e-05
1.40524e-05
-4.36076e-05
1.02375e-05
-4.17866e-05
5.8827e-06
-3.88339e-05
4.65279e-06
-3.46204e-05
-2.72921e-05
1.04114e-05
-4.50121e-05
1.32969e-05
-4.74898e-05
1.62599e-05
-4.58441e-05
1.79323e-05
-4.10951e-05
1.72423e-05
-3.69517e-05
1.38493e-05
-3.68013e-05
5.03377e-06
-3.93854e-05
-5.20821e-06
-4.69012e-05
-1.18856e-05
-5.21058e-05
-1.47285e-05
-5.03996e-05
-1.33553e-05
-4.89206e-05
-9.66001e-06
-4.69259e-05
-5.72411e-06
-4.36752e-05
-2.49768e-06
-4.09195e-05
4.02684e-07
-3.8871e-05
3.20251e-06
-3.70798e-05
5.6965e-06
-3.53095e-05
8.22126e-06
-3.30955e-05
9.95549e-06
-3.11897e-05
1.16524e-05
-2.70371e-05
1.43079e-05
-2.35999e-05
1.65391e-05
-2.46848e-05
1.75817e-05
-3.09016e-05
1.72867e-05
-3.79368e-05
1.598e-05
-4.02875e-05
1.2928e-05
-3.95822e-05
9.13302e-06
-3.7041e-05
5.62366e-06
-3.33926e-05
5.45507e-06
-2.77496e-05
-1.78666e-05
9.77226e-06
-4.79942e-05
1.25062e-05
-4.82022e-05
1.55566e-05
-4.46753e-05
1.77163e-05
-3.77432e-05
1.74254e-05
-3.23727e-05
1.41298e-05
-3.18907e-05
6.78301e-06
-3.47343e-05
-1.67166e-06
-4.28746e-05
-8.61827e-06
-4.9179e-05
-1.27952e-05
-4.91674e-05
-1.28072e-05
-4.71116e-05
-9.69517e-06
-4.50803e-05
-5.72693e-06
-4.26978e-05
-2.4284e-06
-3.98091e-05
5.52879e-07
-3.76098e-05
3.44551e-06
-3.56852e-05
5.97983e-06
-3.37298e-05
8.57951e-06
-3.1355e-05
1.04313e-05
-2.92587e-05
1.24584e-05
-2.51931e-05
1.58003e-05
-2.1463e-05
1.84172e-05
-2.21736e-05
1.92466e-05
-2.75354e-05
1.82354e-05
-3.4074e-05
1.57772e-05
-3.6264e-05
1.20888e-05
-3.47892e-05
8.65007e-06
-3.1241e-05
5.7072e-06
-2.64474e-05
6.47667e-06
-1.91407e-05
-9.472e-06
8.44677e-06
-4.95036e-05
1.09825e-05
-4.82355e-05
1.45237e-05
-4.27001e-05
1.71572e-05
-3.42418e-05
1.67606e-05
-2.77874e-05
1.33338e-05
-2.71845e-05
7.29096e-06
-3.11203e-05
8.91401e-07
-3.91188e-05
-4.68346e-06
-4.54651e-05
-9.57238e-06
-4.76974e-05
-1.15169e-05
-4.54742e-05
-9.4224e-06
-4.3474e-05
-5.62637e-06
-4.10674e-05
-2.19694e-06
-3.85347e-05
8.51141e-07
-3.62045e-05
3.78549e-06
-3.40909e-05
6.42588e-06
-3.19396e-05
9.06662e-06
-2.93851e-05
1.10367e-05
-2.71264e-05
1.3285e-05
-2.32523e-05
1.71856e-05
-1.94761e-05
2.04708e-05
-1.94239e-05
2.11558e-05
-2.38291e-05
1.90666e-05
-2.97961e-05
1.5239e-05
-3.15479e-05
1.11144e-05
-2.882e-05
8.80077e-06
-2.442e-05
6.30653e-06
-1.93677e-05
3.19527e-06
-1.33601e-05
-5.82793e-06
7.07961e-06
-4.98704e-05
9.66519e-06
-4.74436e-05
1.35878e-05
-3.96266e-05
1.60924e-05
-2.96726e-05
1.52881e-05
-2.31392e-05
1.12854e-05
-2.30276e-05
5.53008e-06
-2.78778e-05
1.48967e-06
-3.5497e-05
-1.36655e-06
-4.17033e-05
-5.76278e-06
-4.53591e-05
-9.17497e-06
-4.3804e-05
-8.57418e-06
-4.16523e-05
-5.34582e-06
-3.89816e-05
-1.7773e-06
-3.68043e-05
1.39013e-06
-3.45395e-05
4.30246e-06
-3.21789e-05
6.98888e-06
-2.98469e-05
9.83335e-06
-2.71252e-05
1.18484e-05
-2.47488e-05
1.4312e-05
-2.11061e-05
1.87018e-05
-1.75206e-05
2.24948e-05
-1.65737e-05
2.33827e-05
-1.98161e-05
2.05626e-05
-2.48107e-05
1.54708e-05
-2.55776e-05
1.07464e-05
-2.16104e-05
7.84301e-06
-1.84036e-05
5.73732e-06
-1.52882e-05
3.08207e-06
-1.15735e-05
-4.39059e-06
5.76344e-06
-4.945e-05
8.65184e-06
-4.58147e-05
1.25895e-05
-3.57492e-05
1.44752e-05
-2.42511e-05
1.32894e-05
-1.85769e-05
9.29168e-06
-1.92065e-05
4.49465e-06
-2.4781e-05
2.11465e-06
-3.20677e-05
9.96832e-07
-3.81264e-05
-1.73827e-06
-4.20181e-05
-5.45139e-06
-4.1666e-05
-6.58031e-06
-3.94661e-05
-4.48247e-06
-3.67826e-05
-1.08961e-06
-3.43407e-05
2.17764e-06
-3.19657e-05
5.15521e-06
-2.9539e-05
7.85649e-06
-2.70353e-05
1.07166e-05
-2.41023e-05
1.29672e-05
-2.15333e-05
1.55981e-05
-1.84451e-05
2.01485e-05
-1.50412e-05
2.45783e-05
-1.28148e-05
2.6118e-05
-1.45274e-05
2.33508e-05
-1.88249e-05
1.68103e-05
-1.82213e-05
1.20533e-05
-1.60608e-05
1.04561e-05
-1.54589e-05
7.65346e-06
-1.38817e-05
3.23505e-06
-1.1609e-05
-2.44557e-06
4.37289e-06
-4.83066e-05
7.14138e-06
-4.33563e-05
1.11103e-05
-3.12681e-05
1.2614e-05
-1.88314e-05
1.07715e-05
-1.42466e-05
6.65502e-06
-1.57138e-05
2.93939e-06
-2.1612e-05
2.23527e-06
-2.81777e-05
2.70766e-06
-3.39207e-05
2.00027e-06
-3.77744e-05
-8.72729e-07
-3.84063e-05
-3.24778e-06
-3.66723e-05
-2.50089e-06
-3.392e-05
2.48882e-07
-3.09151e-05
3.37566e-06
-2.77356e-05
6.32259e-06
-2.51012e-05
9.07696e-06
-2.25484e-05
1.19656e-05
-1.99934e-05
1.45e-05
-1.72154e-05
1.72165e-05
-1.54555e-05
2.12615e-05
-1.15762e-05
2.65006e-05
-8.302e-06
3.03934e-05
-9.2468e-06
2.78756e-05
-1.44261e-05
2.21727e-05
-1.52548e-05
1.88225e-05
-1.5182e-05
1.6477e-05
-1.58216e-05
1.28066e-05
-1.32653e-05
3.8161e-06
-1.81023e-05
-1.29632e-05
2.908e-06
-4.63319e-05
5.81912e-06
-3.98873e-05
9.51648e-06
-2.57451e-05
1.0263e-05
-1.35669e-05
7.78459e-06
-1.02921e-05
4.18518e-06
-1.25515e-05
2.14435e-06
-1.79454e-05
2.80562e-06
-2.39504e-05
4.34676e-06
-2.94671e-05
5.08846e-06
-3.32788e-05
3.84026e-06
-3.39753e-05
1.59508e-06
-3.29949e-05
1.1043e-06
-3.03804e-05
2.88389e-06
-2.70563e-05
5.24618e-06
-2.38322e-05
7.58284e-06
-2.11976e-05
1.00328e-05
-1.87286e-05
1.27756e-05
-1.6893e-05
1.58494e-05
-1.41023e-05
1.87676e-05
-1.32714e-05
2.21202e-05
-9.5483e-06
2.72701e-05
-6.48595e-06
3.24263e-05
-7.55732e-06
3.4585e-05
-1.46352e-05
3.36666e-05
-2.23224e-05
2.95248e-05
-2.23152e-05
2.36768e-05
-2.29049e-05
2.08593e-05
-2.14209e-05
1.72366e-05
-2.32674e-05
-1.59812e-05
1.63913e-06
-4.31411e-05
4.62945e-06
-3.49076e-05
7.90893e-06
-1.88785e-05
7.79145e-06
-8.52764e-06
4.90366e-06
-6.56859e-06
2.31296e-06
-9.00831e-06
2.08451e-06
-1.357e-05
3.96218e-06
-1.92076e-05
6.47977e-06
-2.48732e-05
8.21835e-06
-2.86331e-05
8.36891e-06
-2.90956e-05
7.17212e-06
-2.91454e-05
5.96888e-06
-2.76027e-05
5.71958e-06
-2.52867e-05
6.351e-06
-2.31585e-05
7.91885e-06
-2.1494e-05
9.97422e-06
-1.90674e-05
1.28375e-05
-1.78231e-05
1.58564e-05
-1.53259e-05
1.89388e-05
-1.61319e-05
2.31297e-05
-1.42503e-05
2.82689e-05
-1.35543e-05
3.32807e-05
-1.76258e-05
3.54285e-05
-2.86441e-05
3.52448e-05
-3.83442e-05
3.4983e-05
-3.77965e-05
3.38565e-05
-3.38633e-05
3.07702e-05
-2.64307e-05
1.94888e-05
-1.87935e-05
-7.14009e-06
1.20307e-07
-3.93742e-05
3.16451e-06
-2.73505e-05
6.0544e-06
-1.07528e-05
5.26924e-06
-3.59786e-06
2.64197e-06
-2.59222e-06
1.60811e-06
-4.59041e-06
3.05246e-06
-8.52216e-06
6.02184e-06
-1.41699e-05
9.27703e-06
-1.99322e-05
1.18497e-05
-2.3649e-05
1.25343e-05
-2.54198e-05
1.16605e-05
-2.72951e-05
1.01931e-05
-2.86273e-05
8.4465e-06
-3.02742e-05
7.23934e-06
-3.43434e-05
7.51287e-06
-3.65415e-05
9.11843e-06
-3.49125e-05
1.1931e-05
-3.41726e-05
1.47924e-05
-3.17368e-05
1.78013e-05
-3.35435e-05
2.26696e-05
-3.2393e-05
2.71068e-05
-3.34753e-05
2.88929e-05
-3.8821e-05
2.81529e-05
-4.65888e-05
2.69793e-05
-4.94577e-05
2.63785e-05
-4.39431e-05
2.42342e-05
-3.46199e-05
1.93573e-05
-2.25245e-05
1.06718e-05
-1.40073e-05
-5.30354e-06
-1.58332e-06
-3.5343e-05
1.56506e-06
-1.77594e-05
4.14346e-06
-3.07289e-06
3.25161e-06
1.70723e-06
1.62914e-06
2.23917e-06
2.39263e-06
7.31907e-07
5.33832e-06
-3.03312e-06
9.35246e-06
-8.79366e-06
1.33191e-05
-1.49125e-05
1.5772e-05
-2.05009e-05
1.58884e-05
-2.56521e-05
1.50647e-05
-3.08965e-05
1.38145e-05
-3.67823e-05
1.06847e-05
-4.13608e-05
6.51092e-06
-5.01616e-05
4.63125e-06
-5.45803e-05
5.33333e-06
-5.43497e-05
7.45958e-06
-5.38979e-05
1.00437e-05
-5.17557e-05
1.32029e-05
-5.24613e-05
1.70086e-05
-5.08342e-05
1.98469e-05
-5.09989e-05
2.12912e-05
-5.18406e-05
2.12827e-05
-4.98027e-05
2.00933e-05
-4.57892e-05
1.83681e-05
-3.76567e-05
1.57291e-05
-2.87805e-05
1.16538e-05
-2.00993e-05
6.04261e-06
-1.21233e-05
-4.38987e-06
-2.82242e-06
-3.11874e-05
4.28376e-07
-1.0777e-05
2.51331e-06
2.90568e-06
2.46089e-06
7.7265e-06
2.12502e-06
7.5852e-06
4.59884e-06
6.11697e-06
9.17391e-06
2.15441e-06
1.46428e-05
-3.76871e-06
1.84129e-05
-1.11657e-05
1.97127e-05
-2.27417e-05
1.94033e-05
-3.31805e-05
1.68799e-05
-3.94781e-05
1.19735e-05
-4.4175e-05
6.12826e-06
-4.63796e-05
2.58402e-06
-5.12819e-05
2.24008e-06
-5.40086e-05
3.33685e-06
-5.49123e-05
5.37113e-06
-5.52985e-05
7.59138e-06
-5.46683e-05
1.01389e-05
-5.45337e-05
1.30072e-05
-5.30513e-05
1.52045e-05
-5.15032e-05
1.61471e-05
-4.89413e-05
1.57625e-05
-4.4237e-05
1.4546e-05
-3.85295e-05
1.2721e-05
-3.23949e-05
1.03464e-05
-2.53396e-05
7.26271e-06
-1.79515e-05
3.56432e-06
-1.07727e-05
-3.78711e-06
-3.85467e-06
-2.85907e-05
-5.21994e-07
-6.52251e-06
1.01738e-06
7.39973e-06
2.75919e-06
1.28206e-05
4.18533e-06
1.133e-05
8.27423e-06
9.23344e-06
1.42469e-05
4.70876e-06
1.99034e-05
-1.34513e-06
2.35984e-05
-1.26237e-05
2.30614e-05
-2.94661e-05
1.93977e-05
-4.04263e-05
1.59542e-05
-4.44525e-05
1.11817e-05
-4.42919e-05
6.33237e-06
-4.43582e-05
3.87128e-06
-4.5874e-05
3.15339e-06
-4.74325e-05
3.54243e-06
-4.85322e-05
4.70748e-06
-4.92583e-05
6.38746e-06
-4.9403e-05
8.42117e-06
-4.88183e-05
1.02577e-05
-4.74813e-05
1.13392e-05
-4.51811e-05
1.1639e-05
-4.22485e-05
1.12055e-05
-3.86091e-05
1.01727e-05
-3.40267e-05
8.67732e-06
-2.8618e-05
6.76966e-06
-2.25371e-05
4.52294e-06
-1.61058e-05
2.09743e-06
-9.66474e-06
-3.33503e-06
-5.9938e-06
-2.81487e-05
-3.16563e-06
-3.02734e-06
-1.41556e-06
9.40392e-06
2.83714e-06
1.4619e-05
6.5888e-06
1.19755e-05
1.20165e-05
8.31892e-06
1.8406e-05
2.96637e-06
2.37017e-05
-5.04266e-06
2.44368e-05
-2.1258e-05
2.21134e-05
-3.59484e-05
2.00024e-05
-4.2234e-05
1.70268e-05
-4.33276e-05
1.25447e-05
-4.23076e-05
8.77832e-06
-4.23122e-05
6.59671e-06
-4.31481e-05
5.51945e-06
-4.40793e-05
5.27369e-06
-4.47305e-05
5.62081e-06
-4.5013e-05
6.35035e-06
-4.48178e-05
7.25718e-06
-4.40832e-05
8.05727e-06
-4.27075e-05
8.49166e-06
-4.0648e-05
8.46042e-06
-3.79325e-05
7.95631e-06
-3.45075e-05
7.03988e-06
-3.03618e-05
5.80058e-06
-2.55413e-05
4.33076e-06
-2.01732e-05
2.74036e-06
-1.44847e-05
1.17846e-06
-8.70486e-06
-2.97002e-06
-1.01059e-05
-2.79782e-05
-7.54426e-06
-4.78104e-06
-3.51587e-06
7.30083e-06
2.70781e-06
1.18882e-05
7.85187e-06
7.83332e-06
1.40308e-05
7.85508e-08
1.98499e-05
-7.04776e-06
2.20123e-05
-1.93679e-05
1.98552e-05
-3.30148e-05
1.77618e-05
-4.02179e-05
1.65487e-05
-4.19287e-05
1.43565e-05
-4.09298e-05
1.15726e-05
-4.01617e-05
9.24832e-06
-4.00557e-05
7.56278e-06
-4.04322e-05
6.50182e-06
-4.09175e-05
5.97614e-06
-4.12439e-05
5.85806e-06
-4.1278e-05
6.00419e-06
-4.09161e-05
6.26111e-06
-4.00824e-05
6.46061e-06
-3.87041e-05
6.45884e-06
-3.67422e-05
6.1787e-06
-3.41936e-05
5.60505e-06
-3.10338e-05
4.77543e-06
-2.72587e-05
3.76056e-06
-2.29233e-05
2.64931e-06
-1.81357e-05
1.54808e-06
-1.30583e-05
5.79084e-07
-7.85955e-06
-2.66298e-06
-1.29872e-05
-2.8726e-05
-1.05916e-05
-1.82054e-05
-4.31846e-06
-4.52255e-06
2.41753e-06
-1.03825e-06
8.18451e-06
-7.43532e-06
1.3757e-05
-1.70788e-05
1.66605e-05
-2.45172e-05
1.67007e-05
-3.45647e-05
1.63659e-05
-3.98991e-05
1.57015e-05
-4.0646e-05
1.40998e-05
-3.95226e-05
1.2198e-05
-3.84379e-05
1.04467e-05
-3.78166e-05
8.87994e-06
-3.76302e-05
7.61191e-06
-3.77429e-05
6.67717e-06
-3.79352e-05
6.05759e-06
-3.80196e-05
5.69293e-06
-3.78689e-05
5.49711e-06
-3.73865e-05
5.37108e-06
-3.64983e-05
5.21338e-06
-3.51437e-05
4.93992e-06
-3.32846e-05
4.50246e-06
-3.09038e-05
3.89364e-06
-2.79904e-05
3.14453e-06
-2.45549e-05
2.31485e-06
-2.06454e-05
1.48267e-06
-1.6351e-05
7.39179e-07
-1.17952e-05
1.8015e-07
-7.10808e-06
-2.39728e-06
-1.21751e-05
-2.42258e-05
-1.05002e-05
-3.08707e-05
-4.88586e-06
-2.356e-05
1.59881e-06
-2.06795e-05
6.8183e-06
-2.685e-05
1.06501e-05
-3.26997e-05
1.25675e-05
-3.65721e-05
1.30285e-05
-3.87948e-05
1.28267e-05
-3.88498e-05
1.22442e-05
-3.76146e-05
1.13621e-05
-3.65408e-05
1.0312e-05
-3.57665e-05
9.20421e-06
-3.52886e-05
8.13556e-06
-3.50722e-05
7.18495e-06
-3.50338e-05
6.39542e-06
-3.50375e-05
5.77437e-06
-3.49523e-05
5.29701e-06
-3.46718e-05
4.91645e-06
-3.4111e-05
4.57435e-06
-3.32023e-05
4.21175e-06
-3.18926e-05
3.7813e-06
-3.01456e-05
3.25804e-06
-2.79414e-05
2.64492e-06
-2.52731e-05
1.97231e-06
-2.21544e-05
1.29257e-06
-1.86276e-05
6.72583e-07
-1.47659e-05
1.8791e-07
-1.06665e-05
-8.6917e-08
-6.43434e-06
-2.16295e-06
-7.71111e-06
-1.40784e-05
-8.53257e-06
-2.7335e-05
-4.47358e-06
-3.18463e-05
5.51899e-07
-3.19321e-05
4.62703e-06
-3.51167e-05
7.57544e-06
-3.65582e-05
9.23503e-06
-3.67522e-05
9.80904e-06
-3.59579e-05
9.87867e-06
-3.49523e-05
9.69551e-06
-3.42196e-05
9.29183e-06
-3.35516e-05
8.69554e-06
-3.30205e-05
7.9903e-06
-3.26487e-05
7.24969e-06
-3.24298e-05
6.53246e-06
-3.23072e-05
5.87635e-06
-3.21945e-05
5.29568e-06
-3.19983e-05
4.78356e-06
-3.16344e-05
4.31721e-06
-3.10314e-05
3.86538e-06
-3.01303e-05
3.39653e-06
-2.88843e-05
2.88727e-06
-2.72596e-05
2.32945e-06
-2.52364e-05
1.73446e-06
-2.28087e-05
1.13348e-06
-1.99889e-05
5.73837e-07
-1.68124e-05
1.13239e-07
-1.33389e-05
-1.85567e-07
-9.64731e-06
-2.64097e-07
-5.82472e-06
-1.95333e-06
-2.83348e-06
-7.76754e-06
-5.01083e-06
-1.82505e-05
-3.43738e-06
-2.61767e-05
1.46966e-07
-2.98989e-05
3.25282e-06
-3.19449e-05
5.41544e-06
-3.23505e-05
6.67073e-06
-3.20621e-05
7.38388e-06
-3.17836e-05
7.74027e-06
-3.14039e-05
7.82004e-06
-3.09979e-05
7.66416e-06
-3.05895e-05
7.32885e-06
-3.02263e-05
6.87269e-06
-2.9943e-05
6.34876e-06
-2.9736e-05
5.80015e-06
-2.95713e-05
5.25611e-06
-2.93912e-05
4.73155e-06
-2.9129e-05
4.22792e-06
-2.87197e-05
3.73619e-06
-2.81048e-05
3.24187e-06
-2.72343e-05
2.73069e-06
-2.60676e-05
2.19456e-06
-2.45742e-05
1.63655e-06
-2.27347e-05
1.07401e-06
-2.05424e-05
5.38892e-07
-1.80065e-05
7.49415e-08
-1.51553e-05
-2.66984e-07
-1.20368e-05
-4.33748e-07
-8.71617e-06
-3.78493e-07
-5.26732e-06
-1.76328e-06
-2.86905e-07
-5.00138e-06
-1.15722e-06
-1.30489e-05
-6.43148e-07
-1.93036e-05
9.0774e-07
-2.34924e-05
2.6263e-06
-2.60316e-05
4.07463e-06
-2.73561e-05
5.12782e-06
-2.79146e-05
5.83143e-06
-2.8088e-05
6.24117e-06
-2.80466e-05
6.40707e-06
-2.78788e-05
6.37329e-06
-2.76507e-05
6.1831e-06
-2.74154e-05
5.87854e-06
-2.72022e-05
5.49709e-06
-2.70153e-05
5.06891e-06
-2.68344e-05
4.61577e-06
-2.66206e-05
4.15067e-06
-2.63259e-05
3.67827e-06
-2.59008e-05
3.19686e-06
-2.52984e-05
2.70164e-06
-2.44773e-05
2.1887e-06
-2.34025e-05
1.65921e-06
-2.20469e-05
1.12305e-06
-2.03921e-05
6.01143e-07
-1.84301e-05
1.25616e-07
-1.61659e-05
-2.62439e-07
-1.36206e-05
-5.17087e-07
-1.08323e-05
-5.91971e-07
-7.85481e-06
-4.48276e-07
-4.75171e-06
-1.58866e-06
7.36526e-07
-3.53763e-06
6.94186e-07
-9.87596e-06
1.01429e-06
-1.51421e-05
1.75813e-06
-1.90456e-05
2.68411e-06
-2.16875e-05
3.57198e-06
-2.33077e-05
4.30182e-06
-2.42142e-05
4.83569e-06
-2.46716e-05
5.1744e-06
-2.4843e-05
5.33558e-06
-2.48434e-05
5.34363e-06
-2.47467e-05
5.22634e-06
-2.46047e-05
5.01103e-06
-2.44478e-05
4.72216e-06
-2.42844e-05
4.38004e-06
-2.41034e-05
4.00012e-06
-2.38788e-05
3.59253e-06
-2.35761e-05
3.16253e-06
-2.31577e-05
2.71185e-06
-2.25866e-05
2.24084e-06
-2.18291e-05
1.75128e-06
-2.08558e-05
1.24939e-06
-1.96426e-05
7.48591e-07
-1.81721e-05
2.71304e-07
-1.64351e-05
-1.50883e-07
-1.44326e-05
-4.79074e-07
-1.21786e-05
-6.70774e-07
-9.70219e-06
-6.8414e-07
-7.04722e-06
-4.85636e-07
-4.26864e-06
-1.42594e-06
1.14465e-06
-2.67432e-06
1.55227e-06
-7.74605e-06
1.89821e-06
-1.21376e-05
2.33328e-06
-1.5602e-05
2.84429e-06
-1.81216e-05
3.35729e-06
-1.98121e-05
3.80767e-06
-2.08635e-05
4.15668e-06
-2.14686e-05
4.38835e-06
-2.17743e-05
4.50291e-06
-2.18868e-05
4.50989e-06
-2.18804e-05
4.42333e-06
-2.1806e-05
4.25848e-06
-2.16936e-05
4.02998e-06
-2.15542e-05
3.75059e-06
-2.13831e-05
3.4304e-06
-2.11631e-05
3.07666e-06
-2.08697e-05
2.69398e-06
-2.04746e-05
2.28527e-06
-1.99489e-05
1.85319e-06
-1.92655e-05
1.40217e-06
-1.83998e-05
9.40643e-07
-1.73313e-05
4.83171e-07
-1.60437e-05
5.20236e-08
-1.45266e-05
-3.22528e-07
-1.27774e-05
-6.03659e-07
-1.08036e-05
-7.51324e-07
-8.6259e-06
-7.26459e-07
-6.27889e-06
-4.98678e-07
-3.80961e-06
-1.27202e-06
1.26995e-06
-2.0961e-06
1.89571e-06
-6.19963e-06
2.29429e-06
-9.85063e-06
2.61088e-06
-1.28431e-05
2.90835e-06
-1.51179e-05
3.1907e-06
-1.67282e-05
3.44019e-06
-1.77944e-05
3.63702e-06
-1.84536e-05
3.76776e-06
-1.88252e-05
3.82694e-06
-1.90025e-05
3.81543e-06
-1.90538e-05
3.7381e-06
-1.9026e-05
3.60195e-06
-1.89476e-05
3.41453e-06
-1.88312e-05
3.18287e-06
-1.86759e-05
2.91297e-06
-1.8471e-05
2.60945e-06
-1.8199e-05
2.2758e-06
-1.78388e-05
1.9149e-06
-1.73682e-05
1.53005e-06
-1.67658e-05
1.12647e-06
-1.60116e-05
7.12886e-07
-1.50881e-05
3.03378e-07
-1.39805e-05
-8.12311e-08
-1.26779e-05
-4.12784e-07
-1.11747e-05
-6.56721e-07
-9.47273e-06
-7.74925e-07
-7.58463e-06
-7.29895e-07
-5.53618e-06
-4.92745e-07
-3.36648e-06
-1.12402e-06
1.25418e-06
-1.67154e-06
1.95627e-06
-5.00512e-06
2.37971e-06
-8.01616e-06
2.64315e-06
-1.05407e-05
2.8282e-06
-1.25141e-05
2.97396e-06
-1.39587e-05
3.09223e-06
-1.49527e-05
3.18096e-06
-1.55949e-05
3.2339e-06
-1.59793e-05
3.24574e-06
-1.61832e-05
3.21384e-06
-1.62654e-05
3.13817e-06
-1.6267e-05
3.02055e-06
-1.62139e-05
2.8638e-06
-1.61185e-05
2.67105e-06
-1.59825e-05
2.44526e-06
-1.57994e-05
2.189e-06
-1.55569e-05
1.90452e-06
-1.52396e-05
1.59415e-06
-1.48307e-05
1.26095e-06
-1.43134e-05
9.09787e-07
-1.3672e-05
5.48595e-07
-1.28919e-05
1.89863e-07
-1.19602e-05
-1.47983e-07
-1.08662e-05
-4.39686e-07
-9.602e-06
-6.53435e-07
-8.16501e-06
-7.5303e-07
-6.56059e-06
-7.01836e-07
-4.8057e-06
-4.71261e-07
-2.93106e-06
-9.79089e-07
1.16226e-06
-1.33416e-06
1.85281e-06
-4.02598e-06
2.26413e-06
-6.47104e-06
2.49e-06
-8.54361e-06
2.61052e-06
-1.0189e-05
2.67702e-06
-1.14178e-05
2.71574e-06
-1.2284e-05
2.73575e-06
-1.28601e-05
2.73704e-06
-1.3218e-05
2.71635e-06
-1.3419e-05
2.67032e-06
-1.35111e-05
2.59671e-06
-1.35285e-05
2.49455e-06
-1.34932e-05
2.36387e-06
-1.34167e-05
2.20533e-06
-1.33018e-05
2.01987e-06
-1.31447e-05
1.80859e-06
-1.29371e-05
1.57268e-06
-1.26679e-05
1.31375e-06
-1.23245e-05
1.0342e-06
-1.18945e-05
7.38035e-07
-1.13654e-05
4.31773e-07
-1.07257e-05
1.2571e-07
-9.96455e-06
-1.64771e-07
-9.07211e-06
-4.18023e-07
-8.03977e-06
-6.05714e-07
-6.86154e-06
-6.94074e-07
-5.53676e-06
-6.47276e-07
-4.07397e-06
-4.36305e-07
-2.49479e-06
-8.34241e-07
1.02495e-06
-1.04628e-06
1.64719e-06
-3.17443e-06
2.01388e-06
-5.10201e-06
2.20015e-06
-6.73848e-06
2.27803e-06
-8.04545e-06
2.29916e-06
-9.03189e-06
2.29393e-06
-9.73778e-06
2.27609e-06
-1.02163e-05
2.24913e-06
-1.05209e-05
2.21166e-06
-1.06981e-05
2.16065e-06
-1.07847e-05
2.09321e-06
-1.08076e-05
2.00719e-06
-1.07843e-05
1.90124e-06
-1.07247e-05
1.77467e-06
-1.06317e-05
1.62726e-06
-1.05033e-05
1.45914e-06
-1.03341e-05
1.27076e-06
-1.0116e-05
1.06303e-06
-9.84035e-06
8.37628e-07
-9.49778e-06
5.97476e-07
-9.07918e-06
3.47486e-07
-8.57577e-06
9.55151e-08
-7.979e-06
-1.46424e-07
-7.28048e-06
-3.60841e-07
-6.47195e-06
-5.2374e-07
-5.54588e-06
-6.04797e-07
-4.49731e-06
-5.69706e-07
-3.32748e-06
-3.8903e-07
-2.04854e-06
-6.86177e-07
8.55265e-07
-7.83116e-07
1.37015e-06
-2.38821e-06
1.66757e-06
-3.8254e-06
1.80866e-06
-5.03812e-06
1.85482e-06
-6.00587e-06
1.85151e-06
-6.73949e-06
1.82655e-06
-7.26913e-06
1.79357e-06
-7.63273e-06
1.75697e-06
-7.86792e-06
1.71633e-06
-8.00767e-06
1.66925e-06
-8.07837e-06
1.61298e-06
-8.09958e-06
1.54516e-06
-8.08435e-06
1.46401e-06
-8.04007e-06
1.36833e-06
-7.96942e-06
1.25737e-06
-7.87144e-06
1.13078e-06
-7.74256e-06
9.88522e-07
-7.57757e-06
8.31003e-07
-7.37041e-06
6.59209e-07
-7.1147e-06
4.75051e-07
-6.80408e-06
2.81856e-07
-6.43232e-06
8.50972e-08
-5.99322e-06
-1.06613e-07
-5.48035e-06
-2.80229e-07
-4.8868e-06
-4.16889e-07
-4.20523e-06
-4.91107e-07
-3.42876e-06
-4.71707e-07
-2.55346e-06
-3.29913e-07
-1.58278e-06
-5.31127e-07
6.56357e-07
-5.26286e-07
1.03522e-06
-1.61985e-06
1.2473e-06
-2.57758e-06
1.34052e-06
-3.37622e-06
1.36298e-06
-4.0105e-06
1.34961e-06
-4.49171e-06
1.32162e-06
-4.84088e-06
1.28948e-06
-5.08247e-06
1.25674e-06
-5.24031e-06
1.2232e-06
-5.33522e-06
1.18706e-06
-5.38402e-06
1.14612e-06
-5.3993e-06
1.09838e-06
-5.38957e-06
1.04228e-06
-5.35978e-06
9.76629e-07
-5.31185e-06
9.00648e-07
-5.24537e-06
8.13836e-07
-5.15825e-06
7.15964e-07
-5.04734e-06
6.07099e-07
-4.90891e-06
4.87702e-07
-4.73901e-06
3.58819e-07
-4.53369e-06
2.22398e-07
-4.28905e-06
8.17672e-08
-4.00113e-06
-5.76285e-08
-3.66572e-06
-1.87173e-07
-3.27799e-06
-2.93681e-07
-2.83228e-06
-3.58029e-07
-2.32223e-06
-3.54687e-07
-1.742e-06
-2.58315e-07
-1.08885e-06
-3.65097e-07
4.21336e-07
-2.69335e-07
6.43528e-07
-8.35694e-07
7.64283e-07
-1.31422e-06
8.1337e-07
-1.70713e-06
8.21387e-07
-2.01761e-06
8.09607e-07
-2.25323e-06
7.90501e-07
-2.42475e-06
7.70009e-07
-2.54397e-06
7.50004e-07
-2.62222e-06
7.30205e-07
-2.66942e-06
7.09423e-07
-2.69367e-06
6.86265e-07
-2.70108e-06
6.59474e-07
-2.69582e-06
6.28043e-07
-2.68034e-06
5.91224e-07
-2.65565e-06
5.4848e-07
-2.62161e-06
4.99446e-07
-2.57725e-06
4.43896e-07
-2.52111e-06
3.81755e-07
-2.45143e-06
3.13139e-07
-2.36635e-06
2.38451e-07
-2.26402e-06
1.58549e-07
-2.14262e-06
7.50014e-08
-2.0003e-06
-9.47803e-09
-1.83506e-06
-9.03583e-08
-1.64456e-06
-1.60267e-07
-1.42585e-06
-2.07732e-07
-1.17527e-06
-2.16162e-07
-8.88596e-07
-1.69023e-07
-5.61295e-07
-1.88251e-07
1.17278e-07
1.77136e-07
2.17229e-07
2.36658e-07
2.44058e-07
2.45628e-07
2.44818e-07
2.43129e-07
2.40949e-07
2.38146e-07
2.34413e-07
2.29442e-07
2.22994e-07
2.14904e-07
2.05064e-07
1.93398e-07
1.7984e-07
1.64328e-07
1.46805e-07
1.27243e-07
1.05669e-07
8.22204e-08
5.72228e-08
3.13244e-08
5.7174e-09
-1.74999e-08
-3.48959e-08
-4.17219e-08
-3.9055e-08
)
;
boundaryField
{
inlet
{
type fixedValue;
value uniform 0;
}
outlet
{
type fixedValue;
value uniform 0;
}
walls
{
type fixedValue;
value uniform 0;
}
frontAndBackPlanes
{
type empty;
value nonuniform 0();
}
}
// ************************************************************************* //
| [
"peterbryz@yahoo.com"
] | peterbryz@yahoo.com |
cc14125e117458ff1a086e9e97d2ee1e19f950c5 | 97bb7da626def8ad206be815c64348778f550d38 | /416.partition_equal_subset_sum/PartitionEqualSubsetSum.h | a46263b045a26d23df5019d996de671e1644fbd1 | [] | no_license | songkey7/leetcode | c242daafe33cc6035461fc2f3e751489d8b2551e | 2f72c821bd0551313813c9b745ddf5207e1cb71c | refs/heads/master | 2021-05-14T09:50:35.570822 | 2020-04-10T01:20:11 | 2020-04-10T01:20:11 | 116,336,985 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 313 | h | //
// Created by Qi Song on 1/9/18.
//
#ifndef LEETCODE_PARTITIONEQUALSUBSETSUM_H
#define LEETCODE_PARTITIONEQUALSUBSETSUM_H
#include "../Base.h"
class PartitionEqualSubsetSum: public Base {
bool can_partition(vector<int> &nums);
public:
void run();
};
#endif //LEETCODE_PARTITIONEQUALSUBSETSUM_H
| [
"qsong@freewheel.tv"
] | qsong@freewheel.tv |
1c2304a0e20ff21655b42a87a0a5c3e1c8488c6a | bb057b858707a47c421db12d7cc3bb65311cacc2 | /kotlin-native/runtime/src/mm/cpp/SpecialRefRegistryTest.cpp | 16b0f141a0847402c8a861a6fca214b890f88e6d | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | JetBrains/kotlin | b6c8922b22b54f4e269fddbbb37b7def4c97d788 | 0dd36ad456b8d67cf5f47ec9fe7428a4ee727b20 | refs/heads/master | 2023-08-28T11:15:27.222417 | 2023-08-25T11:01:10 | 2023-08-28T10:22:04 | 3,432,266 | 51,608 | 7,338 | null | 2023-09-14T09:30:01 | 2012-02-13T17:29:58 | Kotlin | UTF-8 | C++ | false | false | 14,960 | cpp | /*
* Copyright 2010-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
#include "SpecialRefRegistry.hpp"
#include <condition_variable>
#include <mutex>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "ObjCBackRef.hpp"
#include "StableRef.hpp"
#include "TestSupport.hpp"
#include "ThreadRegistry.hpp"
#include "WeakRef.hpp"
using namespace kotlin;
namespace {
class Waiter : private Pinned {
public:
void allow() noexcept {
{
std::unique_lock guard(mutex_);
allow_ = true;
}
cv_.notify_all();
};
void wait() noexcept {
std::unique_lock guard(mutex_);
cv_.wait(guard, [this] { return allow_; });
}
private:
bool allow_ = false;
std::mutex mutex_;
std::condition_variable cv_;
};
} // namespace
class SpecialRefRegistryTest : public testing::Test {
public:
~SpecialRefRegistryTest() {
// Clean up safely.
roots();
all();
}
void publish() noexcept { mm::ThreadRegistry::Instance().CurrentThreadData()->specialRefRegistry().publish(); }
template <typename... Invalidated>
std::vector<ObjHeader*> all(Invalidated&&... invalidated) noexcept {
std::set<ObjHeader*> invalidatedSet({std::forward<Invalidated>(invalidated)...});
std::vector<ObjHeader*> result;
for (auto& obj : mm::SpecialRefRegistry::instance().lockForIter()) {
if (invalidatedSet.find(obj) != invalidatedSet.end()) {
obj = nullptr;
}
result.push_back(obj);
}
return result;
}
std::vector<ObjHeader*> roots() noexcept {
std::vector<ObjHeader*> result;
for (auto* obj : mm::SpecialRefRegistry::instance().roots()) {
result.push_back(obj);
}
return result;
}
ObjHeader* tryRef(mm::WeakRef& weakRef) noexcept {
ObjHeader* result;
return weakRef.tryRef(&result);
}
};
TEST_F(SpecialRefRegistryTest, RegisterStableRefWithoutPublish) {
RunInNewThread([this] {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
ObjHolder holder(obj);
auto ref = mm::StableRef::create(obj);
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
EXPECT_THAT(*ref, obj);
std::move(ref).dispose();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
publish();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
});
}
TEST_F(SpecialRefRegistryTest, RegisterStableRef) {
RunInNewThread([this] {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
ObjHolder holder(obj);
auto ref = mm::StableRef::create(obj);
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
EXPECT_THAT(*ref, obj);
publish();
EXPECT_THAT(roots(), testing::UnorderedElementsAre(obj));
EXPECT_THAT(all(), testing::UnorderedElementsAre(obj));
EXPECT_THAT(*ref, obj);
std::move(ref).dispose();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
});
}
TEST_F(SpecialRefRegistryTest, RegisterWeakRefWithoutPublish) {
RunInNewThread([this] {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
ObjHolder holder(obj);
auto ref = mm::WeakRef::create(obj);
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
EXPECT_THAT(tryRef(ref), obj);
std::move(ref).dispose();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
publish();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
});
}
TEST_F(SpecialRefRegistryTest, RegisterWeakRef) {
RunInNewThread([this] {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
ObjHolder holder(obj);
auto ref = mm::WeakRef::create(obj);
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
EXPECT_THAT(tryRef(ref), obj);
publish();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre(obj));
EXPECT_THAT(tryRef(ref), obj);
std::move(ref).dispose();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
});
}
TEST_F(SpecialRefRegistryTest, RegisterObjCRefWithoutPublish) {
RunInNewThread([this] {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
ObjHolder holder(obj);
auto ref = mm::ObjCBackRef::create(obj);
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
EXPECT_THAT(*ref, obj);
ref.release();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
EXPECT_THAT(*ref, obj);
std::move(ref).dispose();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
publish();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
});
}
TEST_F(SpecialRefRegistryTest, RegisterObjCRef) {
RunInNewThread([this] {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
ObjHolder holder(obj);
auto ref = mm::ObjCBackRef::create(obj);
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
EXPECT_THAT(*ref, obj);
publish();
EXPECT_THAT(roots(), testing::UnorderedElementsAre(obj));
EXPECT_THAT(all(), testing::UnorderedElementsAre(obj));
EXPECT_THAT(*ref, obj);
ref.release();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre(obj));
EXPECT_THAT(*ref, obj);
std::move(ref).dispose();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
});
}
TEST_F(SpecialRefRegistryTest, RegisterAllRefsWithoutPublish) {
RunInNewThread([this] {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
ObjHolder holder(obj);
auto ref1 = mm::StableRef::create(obj);
auto ref2 = mm::WeakRef::create(obj);
auto ref3 = mm::ObjCBackRef::create(obj);
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
std::move(ref1).dispose();
std::move(ref2).dispose();
ref3.release();
std::move(ref3).dispose();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
publish();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
});
}
TEST_F(SpecialRefRegistryTest, RegisterAllRefs) {
RunInNewThread([this] {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
ObjHolder holder(obj);
auto ref1 = mm::StableRef::create(obj);
auto ref2 = mm::WeakRef::create(obj);
auto ref3 = mm::ObjCBackRef::create(obj);
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
publish();
EXPECT_THAT(roots(), testing::UnorderedElementsAre(obj, obj));
EXPECT_THAT(all(), testing::UnorderedElementsAre(obj, obj, obj));
std::move(ref1).dispose();
std::move(ref2).dispose();
ref3.release();
std::move(ref3).dispose();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
});
}
TEST_F(SpecialRefRegistryTest, InvalidateWeakRef) {
RunInNewThread([this] {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
ObjHolder holder(obj);
auto ref = mm::WeakRef::create(obj);
publish();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(obj), testing::UnorderedElementsAre(nullptr));
EXPECT_THAT(tryRef(ref), nullptr);
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre(nullptr));
EXPECT_THAT(tryRef(ref), nullptr);
std::move(ref).dispose();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
});
}
TEST_F(SpecialRefRegistryTest, InvalidateObjCRef) {
RunInNewThread([this] {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
ObjHolder holder(obj);
auto ref = mm::ObjCBackRef::create(obj);
ref.release();
publish();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(obj), testing::UnorderedElementsAre(nullptr));
EXPECT_FALSE(ref.tryRetainForTests());
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre(nullptr));
std::move(ref).dispose();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
});
}
TEST_F(SpecialRefRegistryTest, TryObjCRef) {
RunInNewThread([this] {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
ObjHolder holder(obj);
auto ref = mm::ObjCBackRef::create(obj);
ref.release();
publish();
EXPECT_TRUE(ref.tryRetainForTests());
EXPECT_THAT(*ref, obj);
EXPECT_THAT(roots(), testing::UnorderedElementsAre(obj));
EXPECT_THAT(all(), testing::UnorderedElementsAre(obj));
EXPECT_THAT(*ref, obj);
ref.release();
std::move(ref).dispose();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
});
}
TEST_F(SpecialRefRegistryTest, ReRetainObjCRefBeforePublish) {
RunInNewThread([this] {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
ObjHolder holder(obj);
auto ref = mm::ObjCBackRef::create(obj);
ref.release();
ref.retain();
EXPECT_THAT(roots(), testing::UnorderedElementsAre(obj));
EXPECT_THAT(all(), testing::UnorderedElementsAre());
EXPECT_THAT(*ref, obj);
publish();
EXPECT_THAT(roots(), testing::UnorderedElementsAre(obj));
EXPECT_THAT(all(), testing::UnorderedElementsAre(obj));
EXPECT_THAT(*ref, obj);
ref.release();
std::move(ref).dispose();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
});
}
TEST_F(SpecialRefRegistryTest, StressStableRef) {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
Waiter waiter;
std::vector<ScopedThread> mutators;
for (int i = 0; i < kDefaultThreadCount; ++i) {
mutators.emplace_back([&, this] {
ScopedMemoryInit scope;
ObjHolder holder(obj);
waiter.wait();
auto ref = mm::StableRef::create(obj);
publish();
std::move(ref).dispose();
});
}
waiter.allow();
mutators.clear();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
}
TEST_F(SpecialRefRegistryTest, StressWeakRef) {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
Waiter waiter;
std::vector<ScopedThread> mutators;
for (int i = 0; i < kDefaultThreadCount; ++i) {
mutators.emplace_back([&, this] {
ScopedMemoryInit scope;
ObjHolder holder(obj);
waiter.wait();
auto ref = mm::WeakRef::create(obj);
publish();
std::move(ref).dispose();
});
}
waiter.allow();
mutators.clear();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
}
TEST_F(SpecialRefRegistryTest, StressObjCRef) {
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
Waiter waiter;
std::vector<ScopedThread> mutators;
for (int i = 0; i < kDefaultThreadCount; ++i) {
mutators.emplace_back([&, this] {
ScopedMemoryInit scope;
ObjHolder holder(obj);
waiter.wait();
auto ref = mm::ObjCBackRef::create(obj);
publish();
ref.release();
std::move(ref).dispose();
});
}
waiter.allow();
mutators.clear();
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
}
TEST_F(SpecialRefRegistryTest, StressObjCRefRetainRelease) {
RunInNewThread([this] {
constexpr int kGCCycles = 10000;
constexpr int kRefsCount = 3;
ObjHeader* obj = reinterpret_cast<ObjHeader*>(1);
ObjHolder holder(obj);
Waiter waiter;
std::atomic<bool> canStop = false;
std::vector<mm::ObjCBackRef> refs;
for (int i = 0; i < kRefsCount; ++i) {
refs.emplace_back(mm::ObjCBackRef::create(obj));
refs.back().release();
}
publish();
std::vector<ScopedThread> mutators;
mutators.emplace_back([&, this] {
waiter.wait();
for (int i = 0; i < kGCCycles; ++i) {
roots();
all();
}
canStop.store(true, std::memory_order_release);
});
for (int i = 0; i < kDefaultThreadCount; ++i) {
mutators.emplace_back([i, obj, &refs, &waiter, &canStop] {
ScopedMemoryInit scope;
ObjHolder holder(obj);
waiter.wait();
auto& ref = refs[i % kRefsCount];
while (!canStop.load(std::memory_order_acquire)) {
ref.retain();
ref.release();
}
});
}
waiter.allow();
mutators.clear();
for (auto& ref : refs) {
std::move(ref).dispose();
}
EXPECT_THAT(roots(), testing::UnorderedElementsAre());
EXPECT_THAT(all(), testing::UnorderedElementsAre());
});
}
| [
"noreply@jetbrains.team"
] | noreply@jetbrains.team |
38f51497b34938b65797ac51d7b833c2b28ceb2c | 4159690789fdb210de41fe44cd4f48d63d6b480c | /include/uncertain_tf/CovarianceTimeCache.h | a269bdabdb94d7da25570ac99dba566f6c70b497 | [] | no_license | ruehr/uncertain_tf | 11d600bd5593409514d3923b584bf669377d9b3a | d21e36aac6137f734024f88e7ec9090c31c0b2e8 | refs/heads/master | 2016-09-02T00:37:40.349600 | 2013-05-26T13:11:12 | 2013-05-26T13:27:43 | 4,111,359 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,124 | h | #ifndef _COVARIANCE_TIME_CACHE_H_
#define _COVARIANCE_TIME_CACHE_H_
#include "tf/tf.h"
#include <Eigen/Dense>
#include <set>
using Eigen::MatrixXd;
namespace uncertain_tf
{
typedef tf::Stamped<Eigen::MatrixXd> StampedCovariance;
class CovarianceStorage
{
public :
CovarianceStorage() {};
CovarianceStorage(const MatrixXd& data, ros::Time stamp); //, CompactFrameID frame_id);
CovarianceStorage(const CovarianceStorage& rhs)
{
*this = rhs;
}
CovarianceStorage& operator=(const CovarianceStorage& rhs)
{
covariance_ = rhs.covariance_;
stamp_ = rhs.stamp_;
//frame_id_ = rhs.frame_id_;
return *this;
}
bool operator< (const CovarianceStorage &b) const
{
return this->stamp_ < b.stamp_;
}
MatrixXd covariance_;
ros::Time stamp_;
//CompactFrameID frame_id_; // we do not store frame_ids since we always assume the connectivity at a given time is stored in the tf tree, and the covariances fit
};
class CovarianceTimeCache
{
public:
static const int MIN_INTERPOLATION_DISTANCE = 5; //!< Number of nano-seconds to not interpolate below.
static const unsigned int MAX_LENGTH_LINKED_LIST = 1000000; //!< Maximum length of linked list, to make sure not to be able to use unlimited memory.
static const int64_t DEFAULT_MAX_STORAGE_TIME = 1ULL * 1000000000LL; //!< default value of 10 seconds storage
CovarianceTimeCache(ros::Duration max_storage_time = ros::Duration().fromNSec(DEFAULT_MAX_STORAGE_TIME));
bool getData(ros::Time time, CovarianceStorage &data_out, std::string* error_str = 0);
bool insertData(const CovarianceStorage& new_data);
inline uint8_t findClosest(const CovarianceStorage*& one,const CovarianceStorage*& two, ros::Time target_time, std::string* error_str);
inline void interpolate(const CovarianceStorage& one, const CovarianceStorage& two, ros::Time time, CovarianceStorage& output);
void pruneList();
typedef std::set<CovarianceStorage> L_CovarianceStorage;
L_CovarianceStorage storage_;
ros::Duration max_storage_time_;
};
}
#endif
| [
"ruehr@in.tum.de"
] | ruehr@in.tum.de |
773269f55d16d5ee5b38df0576dcf911d8f53a13 | 0ea080b580e5cb16af6dd25f291d4bbeed32b4bd | /uebungen/blatt_01/aufgabe_02/Feld.h | 6e45a27a658542b4707672afb07bfefe57778658 | [] | no_license | dotWee/oth-ad_vol_SOSE2019 | e139c31ca08e605f3b668a419c7a9973acb9dade | 341e463a1009de5c7b760a36e64714669ef0f683 | refs/heads/master | 2020-06-09T06:17:13.635864 | 2019-06-23T20:23:05 | 2019-06-23T20:23:05 | 193,389,009 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 292 | h | #ifndef AD_VOL_SOSE2019_FELD_H
#define AD_VOL_SOSE2019_FELD_H
class Feld {
public:
void Init(int length);
void FillRandom();
int Min();
int Max();
int Avg();
void Print();
private:
int length;
int* array;
};
#endif //AD_VOL_SOSE2019_FELD_H | [
"coding@dotwee.de"
] | coding@dotwee.de |
ef89bc00585ae01ec29eaac7adcc9590a773b620 | 4f8a640d18c43757f5f8a8043e3d403319f09c69 | /lib/MPU9150Lib/MPU9150Lib.cpp | c6e1560e19274d5b95ef1f2b2f1672e54d7009f8 | [] | no_license | MinervaBots/Hound | 3b3c2de109dd0e9d309c7c46d1534d7da5b893b4 | f51a40a17f6c44cde20b18fb8b61eac5061a2d73 | refs/heads/master | 2020-12-03T05:27:25.487475 | 2017-06-20T14:46:25 | 2017-06-20T14:46:25 | 43,793,694 | 2 | 2 | null | 2017-04-14T15:05:12 | 2015-10-07T03:45:47 | C++ | UTF-8 | C++ | false | false | 15,877 | cpp | ////////////////////////////////////////////////////////////////////////////
//
// This file is part of MPU9150Lib
//
// Copyright (c) 2013 Pansenti, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
// Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "MPU9150Lib.h"
#include "inv_mpu.h"
#include "inv_mpu_dmp_motion_driver.h"
#include "MPUQuaternion.h"
////////////////////////////////////////////////////////////////////////////
//
// The functions below are from the InvenSense SDK example code.
//
// Original copyright notice below:
/*
$License:
Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
See included License.txt for License information.
$
*/
/* These next two functions converts the orientation matrix (see
* gyro_orientation) to a scalar representation for use by the DMP.
* NOTE: These functions are borrowed from InvenSense's MPL.
*/
static inline unsigned short inv_row_2_scale(const signed char *row)
{
unsigned short b;
if (row[0] > 0)
b = 0;
else if (row[0] < 0)
b = 4;
else if (row[1] > 0)
b = 1;
else if (row[1] < 0)
b = 5;
else if (row[2] > 0)
b = 2;
else if (row[2] < 0)
b = 6;
else
b = 7; // error
return b;
}
/* The sensors can be mounted onto the board in any orientation. The mounting
* matrix seen below tells the MPL how to rotate the raw data from thei
* driver(s).
* TODO: The following matrices refer to the configuration on an internal test
* board at Invensense. If needed, please modify the matrices to match the
* chip-to-body matrix for your particular set up.
*/
static signed char gyro_orientation[9] = { 1, 0, 0,
0, 1, 0,
0, 0, 1};
static inline unsigned short inv_orientation_matrix_to_scalar(const signed char *mtx)
{
unsigned short scalar;
/*
XYZ 010_001_000 Identity Matrix
XZY 001_010_000
YXZ 010_000_001
YZX 000_010_001
ZXY 001_000_010
ZYX 000_001_010
*/
scalar = inv_row_2_scale(mtx);
scalar |= inv_row_2_scale(mtx + 3) << 3;
scalar |= inv_row_2_scale(mtx + 6) << 6;
return scalar;
}
//
////////////////////////////////////////////////////////////////////////////
MPU9150Lib::MPU9150Lib()
{
// use calibration if available
m_useAccelCalibration = true;
m_useMagCalibration = true;
m_device = 0;
}
void MPU9150Lib::selectDevice(int device)
{
m_device = device;
}
void MPU9150Lib::useAccelCal(boolean useCal)
{
m_useAccelCalibration = useCal;
}
void MPU9150Lib::disableAccelCal()
{
if (!m_useAccelCalibration)
return;
m_useAccelCalibration = false;
m_accelOffset[0] = 0;
m_accelOffset[1] = 0;
m_accelOffset[2] = 0;
mpu_set_accel_bias(m_accelOffset);
}
void MPU9150Lib::useMagCal(boolean useCal)
{
m_useMagCalibration = useCal;
}
boolean MPU9150Lib::init(int mpuRate, int magMix, int magRate, int lpf)
{
struct int_param_s int_param;
int result;
mpu_select_device(m_device);
dmp_select_device(m_device);
if (magRate > 100)
return false; // rate must be less than or equal to 100Hz
if (magRate < 1)
return false;
m_magInterval = (unsigned long)(1000 / magRate); // record mag interval
m_lastMagSample = millis();
if (mpuRate > 1000)
return false;
if (mpuRate < 1)
return false;
m_magMix = magMix;
m_lastDMPYaw = 0;
m_lastYaw = 0;
// get calibration data if it's there
if (calLibRead(m_device, &m_calData)) { // use calibration data if it's there and wanted
m_useMagCalibration &= m_calData.magValid == 1;
m_useAccelCalibration &= m_calData.accelValid == 1;
// Process calibration data for runtime
if (m_useMagCalibration) {
m_magXOffset = (short)(((long)m_calData.magMaxX + (long)m_calData.magMinX) / 2);
m_magXRange = m_calData.magMaxX - m_magXOffset;
m_magYOffset = (short)(((long)m_calData.magMaxY + (long)m_calData.magMinY) / 2);
m_magYRange = m_calData.magMaxY - m_magYOffset;
m_magZOffset = (short)(((long)m_calData.magMaxZ + (long)m_calData.magMinZ) / 2);
m_magZRange = m_calData.magMaxZ - m_magZOffset;
}
if (m_useAccelCalibration) {
m_accelOffset[0] = -((long)m_calData.accelMaxX + (long)m_calData.accelMinX) / 2;
m_accelOffset[1] = -((long)m_calData.accelMaxY + (long)m_calData.accelMinY) / 2;
m_accelOffset[2] = -((long)m_calData.accelMaxZ + (long)m_calData.accelMinZ) / 2;
mpu_set_accel_bias(m_accelOffset);
m_accelXRange = m_calData.accelMaxX + (short)m_accelOffset[0];
m_accelYRange = m_calData.accelMaxY + (short)m_accelOffset[1];
m_accelZRange = m_calData.accelMaxZ + (short)m_accelOffset[2];
}
} else {
m_useMagCalibration = false;
m_useAccelCalibration = false;
}
#ifdef MPULIB_DEBUG
if (m_useMagCalibration)
Serial.println("Using mag cal");
if (m_useAccelCalibration)
Serial.println("Using accel cal");
#endif
mpu_init_structures();
// Not using interrupts so set up this structure to keep the driver happy
int_param.cb = NULL;
int_param.pin = 0;
int_param.lp_exit = 0;
int_param.active_low = 1;
result = mpu_init(&int_param);
if (result != 0) {
#ifdef MPULIB_DEBUG
Serial.print("mpu_init failed with code: "); Serial.println(result);
#endif
return false;
}
mpu_set_sensors(INV_XYZ_GYRO | INV_XYZ_ACCEL | INV_XYZ_COMPASS); // enable all of the sensors
mpu_configure_fifo(INV_XYZ_GYRO | INV_XYZ_ACCEL); // get accel and gyro data in the FIFO also
#ifdef MPULIB_DEBUG
Serial.println("Loading firmware");
#endif
if ((result = dmp_load_motion_driver_firmware()) != 0) { // try to load the DMP firmware
#ifdef MPULIB_DEBUG
Serial.print("Failed to load dmp firmware: ");
Serial.println(result);
#endif
return false;
}
dmp_set_orientation(inv_orientation_matrix_to_scalar(gyro_orientation)); // set up the correct orientation
dmp_enable_feature(DMP_FEATURE_6X_LP_QUAT | DMP_FEATURE_SEND_RAW_ACCEL | DMP_FEATURE_SEND_CAL_GYRO |
DMP_FEATURE_GYRO_CAL);
dmp_set_fifo_rate(mpuRate);
if (mpu_set_dmp_state(1) != 0) {
#ifdef MPULIB_DEBUG
Serial.println("mpu_set_dmp_state failed");
#endif
return false;
}
mpu_set_sample_rate(mpuRate); // set the update rate
mpu_set_compass_sample_rate(magRate); // set the compass update rate to match
if (lpf != 0)
mpu_set_lpf(lpf); // set the low pass filter
return true;
}
boolean MPU9150Lib::read()
{
short intStatus;
int result;
short sensors;
unsigned char more;
unsigned long timestamp;
mpu_select_device(m_device);
dmp_select_device(m_device);
mpu_get_int_status(&intStatus); // get the current MPU state
if ((intStatus & (MPU_INT_STATUS_DMP | MPU_INT_STATUS_DMP_0))
!= (MPU_INT_STATUS_DMP | MPU_INT_STATUS_DMP_0))
return false;
// get the data from the fifo
if ((result = dmp_read_fifo(m_rawGyro, m_rawAccel, m_rawQuaternion, ×tamp, &sensors, &more)) != 0) {
return false;
}
// got the fifo data so now get the mag data if it's time
if ((millis() - m_lastMagSample) >= m_magInterval) {
if ((result = mpu_get_compass_reg(m_rawMag, ×tamp)) != 0) {
#ifdef MPULIB_DEBUG
Serial.print("Failed to read compass: ");
Serial.println(result);
#endif
return false;
}
// *** Note mag axes are changed here to align with gyros: Y = -X, X = Y
m_lastMagSample = millis();
if (m_useMagCalibration) {
m_calMag[VEC3_Y] = -(short)(((long)(m_rawMag[VEC3_X] - m_magXOffset) * (long)SENSOR_RANGE) / (long)m_magXRange);
m_calMag[VEC3_X] = (short)(((long)(m_rawMag[VEC3_Y] - m_magYOffset) * (long)SENSOR_RANGE) / (long)m_magYRange);
m_calMag[VEC3_Z] = (short)(((long)(m_rawMag[VEC3_Z] - m_magZOffset) * (long)SENSOR_RANGE) / (long)m_magZRange);
} else {
m_calMag[VEC3_Y] = -m_rawMag[VEC3_X];
m_calMag[VEC3_X] = m_rawMag[VEC3_Y];
m_calMag[VEC3_Z] = m_rawMag[VEC3_Z];
}
}
// got the raw data - now process
m_dmpQuaternion[QUAT_W] = (float)m_rawQuaternion[QUAT_W]; // get float version of quaternion
m_dmpQuaternion[QUAT_X] = (float)m_rawQuaternion[QUAT_X];
m_dmpQuaternion[QUAT_Y] = (float)m_rawQuaternion[QUAT_Y];
m_dmpQuaternion[QUAT_Z] = (float)m_rawQuaternion[QUAT_Z];
MPUQuaternionNormalize(m_dmpQuaternion); // and normalize
MPUQuaternionQuaternionToEuler(m_dmpQuaternion, m_dmpEulerPose);
// Scale accel data
if (m_useAccelCalibration) {
/* m_calAccel[VEC3_X] = -(short)((((long)m_rawAccel[VEC3_X] + m_accelOffset[0])
* (long)SENSOR_RANGE) / (long)m_accelXRange);
m_calAccel[VEC3_Y] = (short)((((long)m_rawAccel[VEC3_Y] + m_accelOffset[1])
* (long)SENSOR_RANGE) / (long)m_accelYRange);
m_calAccel[VEC3_Z] = (short)((((long)m_rawAccel[VEC3_Z] + m_accelOffset[2])
* (long)SENSOR_RANGE) / (long)m_accelZRange);
*/ if (m_rawAccel[VEC3_X] >= 0)
m_calAccel[VEC3_X] = -(short)((((long)m_rawAccel[VEC3_X])
* (long)SENSOR_RANGE) / (long)m_calData.accelMaxX);
else
m_calAccel[VEC3_X] = -(short)((((long)m_rawAccel[VEC3_X])
* (long)SENSOR_RANGE) / -(long)m_calData.accelMinX);
if (m_rawAccel[VEC3_Y] >= 0)
m_calAccel[VEC3_Y] = (short)((((long)m_rawAccel[VEC3_Y])
* (long)SENSOR_RANGE) / (long)m_calData.accelMaxY);
else
m_calAccel[VEC3_Y] = (short)((((long)m_rawAccel[VEC3_Y])
* (long)SENSOR_RANGE) / -(long)m_calData.accelMinY);
if (m_rawAccel[VEC3_Z] >= 0)
m_calAccel[VEC3_Z] = (short)((((long)m_rawAccel[VEC3_Z])
* (long)SENSOR_RANGE) / (long)m_calData.accelMaxZ);
else
m_calAccel[VEC3_Z] = (short)((((long)m_rawAccel[VEC3_Z])
* (long)SENSOR_RANGE) / -(long)m_calData.accelMinZ);
} else {
m_calAccel[VEC3_X] = -m_rawAccel[VEC3_X];
m_calAccel[VEC3_Y] = m_rawAccel[VEC3_Y];
m_calAccel[VEC3_Z] = m_rawAccel[VEC3_Z];
}
dataFusion();
return true;
}
void MPU9150Lib::dataFusion()
{
float qMag[4];
float deltaDMPYaw, deltaMagYaw;
float newMagYaw, newYaw;
float temp1[4], unFused[4];
float unFusedConjugate[4];
// *** NOTE *** pitch direction swapped here
m_fusedEulerPose[VEC3_X] = m_dmpEulerPose[VEC3_X];
m_fusedEulerPose[VEC3_Y] = -m_dmpEulerPose[VEC3_Y];
m_fusedEulerPose[VEC3_Z] = 0;
MPUQuaternionEulerToQuaternion(m_fusedEulerPose, unFused); // create a new quaternion
deltaDMPYaw = -m_dmpEulerPose[VEC3_Z] + m_lastDMPYaw; // calculate change in yaw from dmp
m_lastDMPYaw = m_dmpEulerPose[VEC3_Z]; // update that
qMag[QUAT_W] = 0;
qMag[QUAT_X] = m_calMag[VEC3_X];
qMag[QUAT_Y] = m_calMag[VEC3_Y];
qMag[QUAT_Z] = m_calMag[VEC3_Z];
// Tilt compensate mag with the unfused data (i.e. just roll and pitch with yaw 0)
MPUQuaternionConjugate(unFused, unFusedConjugate);
MPUQuaternionMultiply(qMag, unFusedConjugate, temp1);
MPUQuaternionMultiply(unFused, temp1, qMag);
// Now fuse this with the dmp yaw gyro information
newMagYaw = -atan2(qMag[QUAT_Y], qMag[QUAT_X]);
if (newMagYaw != newMagYaw) { // check for nAn
#ifdef MPULIB_DEBUG
Serial.println("***nAn\n");
#endif
return; // just ignore in this case
}
if (newMagYaw < 0)
newMagYaw = 2.0f * (float)M_PI + newMagYaw; // need 0 <= newMagYaw <= 2*PI
newYaw = m_lastYaw + deltaDMPYaw; // compute new yaw from change
if (newYaw > (2.0f * (float)M_PI)) // need 0 <= newYaw <= 2*PI
newYaw -= 2.0f * (float)M_PI;
if (newYaw < 0)
newYaw += 2.0f * (float)M_PI;
deltaMagYaw = newMagYaw - newYaw; // compute difference
if (deltaMagYaw >= (float)M_PI)
deltaMagYaw = deltaMagYaw - 2.0f * (float)M_PI;
if (deltaMagYaw <= -(float)M_PI)
deltaMagYaw = (2.0f * (float)M_PI + deltaMagYaw);
if (m_magMix > 0) {
newYaw += deltaMagYaw / m_magMix; // apply some of the correction
if (newYaw > (2.0f * (float)M_PI)) // need 0 <= newYaw <= 2*PI
newYaw -= 2.0f * (float)M_PI;
if (newYaw < 0)
newYaw += 2.0f * (float)M_PI;
}
m_lastYaw = newYaw;
if (newYaw > (float)M_PI)
newYaw -= 2.0f * (float)M_PI;
m_fusedEulerPose[VEC3_Z] = newYaw; // fill in output yaw value
MPUQuaternionEulerToQuaternion(m_fusedEulerPose, m_fusedQuaternion);
}
void MPU9150Lib::printQuaternion(long *quat)
{
Serial.print("w: "); Serial.print(quat[QUAT_W]);
Serial.print(" x: "); Serial.print(quat[QUAT_X]);
Serial.print(" y: "); Serial.print(quat[QUAT_Y]);
Serial.print(" z: "); Serial.print(quat[QUAT_Z]);
}
void MPU9150Lib::printQuaternion(float *quat)
{
Serial.print("w: "); Serial.print(quat[QUAT_W]);
Serial.print(" x: "); Serial.print(quat[QUAT_X]);
Serial.print(" y: "); Serial.print(quat[QUAT_Y]);
Serial.print(" z: "); Serial.print(quat[QUAT_Z]);
}
void MPU9150Lib::printVector(short *vec)
{
Serial.print("x: "); Serial.print(vec[VEC3_X]);
Serial.print(" y: "); Serial.print(vec[VEC3_Y]);
Serial.print(" z: "); Serial.print(vec[VEC3_Z]);
}
void MPU9150Lib::printVector(float *vec)
{
Serial.print("x: "); Serial.print(vec[VEC3_X]);
Serial.print(" y: "); Serial.print(vec[VEC3_Y]);
Serial.print(" z: "); Serial.print(vec[VEC3_Z]);
}
void MPU9150Lib::printAngles(float *vec)
{
Serial.print("x: "); Serial.print(vec[VEC3_X] * RAD_TO_DEGREE);
Serial.print(" y: "); Serial.print(vec[VEC3_Y] * RAD_TO_DEGREE);
Serial.print(" z: "); Serial.print(vec[VEC3_Z] * RAD_TO_DEGREE);
}
| [
"fraga@MacBook-Air-de-Angela-Maria-Fraga.local"
] | fraga@MacBook-Air-de-Angela-Maria-Fraga.local |
5df190d51ec30b91c48e0ce7909467927909862d | d24cef73100a0c5d5c275fd0f92493f86d113c62 | /SRC/engine/property/stressfreestrain/stressfreestrain.C | dd83833a22b355fbf71fa84ec8d0315caf545a7c | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | rlinder1/oof3d | 813e2a8acfc89e67c3cf8fdb6af6b2b983b8b8ee | 1fb6764d9d61126bd8ad4025a2ce7487225d736e | refs/heads/master | 2021-01-23T00:40:34.642449 | 2016-09-15T20:51:19 | 2016-09-15T20:51:19 | 92,832,740 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,389 | c | // -*- C++ -*-
// $RCSfile: stressfreestrain.C,v $
// $Revision: 1.11.10.3 $
// $Author: langer $
// $Date: 2013/11/08 20:46:04 $
/* This software was produced by NIST, an agency of the U.S. government,
* and by statute is not subject to copyright in the United States.
* Recipients of this software assume all responsibilities associated
* with its operation, modification and maintenance. However, to
* facilitate maintenance we ask that before distributing modified
* versions of this software, you first contact the authors at
* oof_manager@nist.gov.
*/
#include <oofconfig.h>
#include "engine/IO/propertyoutput.h"
#include "engine/cstrain.h"
#include "engine/element.h"
#include "engine/flux.h"
#include "engine/material.h"
#include "engine/ooferror.h"
#include "engine/property/elasticity/cijkl.h"
#include "engine/property/elasticity/elasticity.h"
#include "engine/property/orientation/orientation.h"
#include "engine/property/stressfreestrain/stressfreestrain.h"
#include "engine/smallsystem.h"
StressFreeStrain::StressFreeStrain(PyObject *reg,
const std::string &nm)
: FluxProperty(nm, reg)
{
stress_flux = dynamic_cast<SymmetricTensorFlux*>(Flux::getFlux("Stress"));
}
int StressFreeStrain::integration_order(const CSubProblem*, const Element*el) const {
return el->shapefun_degree();
}
void StressFreeStrain::flux_offset(const FEMesh *mesh, const Element *element,
const Flux *flux,
const MasterPosition &x,
double time,
SmallSystem *fluxdata)
const
{
if(*flux != *stress_flux) {
throw ErrProgrammingError("Unexpected flux.", __FILE__, __LINE__);
}
const Cijkl modulus = elasticity->cijkl(mesh, element, x);
SymmMatrix3 sfs = stressfreestrain(mesh, element, x);
for(SymTensorIterator ij; !ij.end(); ++ij) {
double &offset_el = fluxdata->offset_vector_element(ij);
for(SymTensorIterator kl; !kl.end(); ++kl) {
if(kl.diagonal()) {
offset_el -= modulus(ij, kl)*sfs[kl];
}
else {
offset_el -= 2.0*modulus(ij, kl)*sfs[kl];
}
}
}
}
IsotropicStressFreeStrain::IsotropicStressFreeStrain(PyObject *registry,
const std::string &name,
double e)
: StressFreeStrain(registry, name),
e_(e)
{}
void IsotropicStressFreeStrain::cross_reference(Material *mat) {
try {
elasticity = dynamic_cast<Elasticity*>(mat->fetchProperty("Elasticity"));
}
catch (ErrNoSuchProperty&) {
elasticity = 0;
throw;
}
}
void IsotropicStressFreeStrain::precompute(FEMesh *mesh) {
StressFreeStrain::precompute(mesh);
stressfreestrain_(0,0) = stressfreestrain_(1,1) = stressfreestrain_(2,2) = e_;
}
AnisotropicStressFreeStrain::AnisotropicStressFreeStrain(PyObject *registry,
const std::string &name,
SymmMatrix3 *e)
: StressFreeStrain(registry, name),
e_(*e),
orientation(0)
{}
void AnisotropicStressFreeStrain::cross_reference(Material *mat) {
try {
elasticity = dynamic_cast<Elasticity*>(mat->fetchProperty("Elasticity"));
orientation = dynamic_cast<OrientationPropBase*>
(mat->fetchProperty("Orientation"));
}
catch (ErrNoSuchProperty&) {
elasticity = 0;
orientation = 0;
throw;
}
}
void AnisotropicStressFreeStrain::precompute(FEMesh*) {
if(orientation && orientation->constant_in_space())
stressfreestrain_ = e_.transform(orientation->orientation());
}
const SymmMatrix3
AnisotropicStressFreeStrain::stressfreestrain(const FEMesh *mesh,
const Element *elem,
const MasterPosition &pos)
const
{
if(orientation->constant_in_space())
return stressfreestrain_;
return e_.transform(orientation->orientation(mesh, elem, pos));
}
void StressFreeStrain::output(const FEMesh *mesh,
const Element *element,
const PropertyOutput *output,
const MasterPosition &pos,
OutputVal *data)
const
{
// Mostly copied from ThermalExpansion::output
const std::string &outputname = output->name();
if(outputname == "Strain") {
const std::string *stype = output->getRegisteredParamName("type");
SymmMatrix3 *sdata = dynamic_cast<SymmMatrix3*>(data);
if(*stype == "Elastic")
*sdata -= stressfreestrain(mesh, element, pos);
delete stype;
}
if(outputname == "Energy") {
// Energy looks strange, because we're doing two of the three
// terms in a product of differences. The full answer is
// (1/2)Cijkl(e_ij-e0_ij)(e_kl-e0_kl), with e_ij the strain, and
// e0_ij the stress-free strain. But the elasticity property
// independently contributes (1/2)Cijkl.e_ij.e_kl. The remaining
// terms are - Cijkl.e_ij.e0_kl + Cijkl.e0_ij.e0_kl. In the code
// below, "stress" refers to the product Cijkl.e0_ij.
const std::string *etype = output->getEnumParam((char*) "etype");
if(*etype == "Total" || *etype == "Elastic") {
ScalarOutputVal *edata = dynamic_cast<ScalarOutputVal*>(data);
const Cijkl modulus = elasticity->cijkl(mesh, element, pos);
SymmMatrix3 strain;
SymmMatrix3 sfs = stressfreestrain(mesh, element, pos);
elasticity->geometricStrain(mesh, element, pos, &strain);
SymmMatrix3 stress(modulus*sfs);
double e = 0;
for(int i=0; i<3; i++) {
e += stress(i,i)*(-strain(i,i)+0.5*sfs(i,i));
int j=(i+1)%3;
e += 2*stress(i,j)*(-strain(i,j)+0.5*sfs(i,j));
}
*edata += e;
}
delete etype;
}
}
| [
"faical.congo@nist.gov"
] | faical.congo@nist.gov |
361dadec0de37e2200712d67f3daa7bc5746d191 | 467f63ad6e58955019cca4d92e95bd0bb7366c22 | /source/scandevrangedialog.cpp | 97961cab5170d678530e766130c0def972433ddc | [] | no_license | yisea123/CANBootloader-Qt | 1fcb6954035f6de46143fb0da0542a13edff604d | 5a557e0b194259999db2cc125884e70dc0c0b8ea | refs/heads/master | 2020-06-15T07:33:31.986998 | 2019-01-05T13:49:16 | 2019-01-05T13:49:16 | 195,238,054 | 1 | 0 | null | 2019-07-04T12:31:59 | 2019-07-04T12:31:59 | null | UTF-8 | C++ | false | false | 1,121 | cpp | #include "scandevrangedialog.h"
#include "ui_scandevrangedialog.h"
ScanDevRangeDialog::ScanDevRangeDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::ScanDevRangeDialog)
{
ui->setupUi(this);
ui->spinBoxStartAddr->setValue(0x132);
ui->spinBoxEndAddr->setValue(0x134);
}
ScanDevRangeDialog::~ScanDevRangeDialog()
{
delete ui;
}
void ScanDevRangeDialog::on_spinBoxStartAddr_valueChanged(int arg1)
{
if(arg1 > ui->spinBoxEndAddr->value()){
ui->spinBoxEndAddr->setValue(arg1);
}
}
void ScanDevRangeDialog::on_spinBoxEndAddr_valueChanged(int arg1)
{
if(arg1 < ui->spinBoxStartAddr->value()){
ui->spinBoxStartAddr->setValue(arg1);
}
}
void ScanDevRangeDialog::on_pushButtonConfirm_clicked()
{
StartAddr = ui->spinBoxStartAddr->value();
EndAddr = ui->spinBoxEndAddr->value();
this->accept();
}
void ScanDevRangeDialog::on_pushButtonCancel_clicked()
{
this->reject();
}
void ScanDevRangeDialog::Set_startaddr(int start)
{
ui->spinBoxStartAddr->setValue(start);
}
void ScanDevRangeDialog::Set_endaddr(int end)
{
ui->spinBoxEndAddr->setValue(end);
}
| [
"wcj53636746@126.com"
] | wcj53636746@126.com |
84b24d7779cc16769d0dd48dc07bcbae8a550798 | a45f050ee1793a168fc1a93ae26026143326234a | /src/WeatherSystem/SituationSound.cpp | e65172657586323cf8e527c631cd209f8db5fe91 | [
"BSD-2-Clause"
] | permissive | Grymm6/Plugin_WeatherSystem | b1409b9bb324154546d8f70284e16704061447ed | c616ebb42101f8aacc2abae4f45c50918baf281b | refs/heads/master | 2020-04-27T14:47:35.594208 | 2014-05-01T17:48:49 | 2014-05-01T17:48:49 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,746 | cpp | #include "StdAfx.h"
#include "SituationSound.h"
#include "IWeatherSituation.h"
#include "IEntity.h"
#include "IEntitySystem.h"
#include "IGame.h"
#include "IGameFramework.h"
#include "Actor.h"
void SSituationSound::LoadFromXml(XmlNodeRef root)
{
if (!root)
{
return;
}
string modName = "Sound";
XmlString sTempString;
XMLGET(root, "path", sTempString, modName);
x_sPath = sTempString.empty() ? "Invalid" : sTempString;
XMLGET(root, "spawnAfterSecs", x_fSpawnAfterSeconds, modName);
XMLGET(root, "spawnOnce", x_bSpawnOnce, modName);
XMLGET(root, "position", sTempString, modName);
x_vPosition = ParsePositionAttribute(sTempString);
XMLGET(root, "positioningMode", sTempString, modName);
x_positioningMode = GetPositioningModeFromString(sTempString.c_str());
XMLGET(root, "radius", x_fRadius, modName);
XMLGET(root, "volume", x_fVolume, modName);
XMLGET(root, "fadeInTime", x_fFadeInTime, modName);
XMLGET(root, "loop", x_bLoop, modName);
XMLGET(root, "minSpawnDelay", x_fMinSpawnDelay, modName);
XMLGET(root, "maxSpawnDelay", x_fMaxSpawnDelay, modName);
}
void SSituationSound::Update(float fFrameTime)
{
if (!m_pSound || !m_pSoundProxy)
{
return;
}
if (m_bHasBeenPlayed && x_bSpawnOnce)
{
return;
}
if (m_fTime >= m_fSpawnTime)
{
if (!m_pSound->IsPlaying())
{
m_fFadeProgression = 0.f;
Vec3 finalPos = x_vPosition;
switch (x_positioningMode)
{
case ePM_AroundPlayer:
{
Vec3 v;
v.SetRandomDirection();
finalPos = v * x_fRadius;
}
break;
case ePM_AroundWorld:
{
int maxDim = gEnv->p3DEngine->GetTerrainSize();
Vec3 v;
v.SetRandomDirection();
finalPos = v * maxDim;
}
break;
default:
break;
}
m_pEntity->SetPos(gEnv->pGame->GetIGameFramework()->GetClientActor()->GetEntity()->GetPos() + finalPos);
tSoundID id = m_pSoundProxy->PlaySound(x_sPath, finalPos, Vec3(0, 1, 0), m_nSoundFlags, 0, ESoundSemantic::eSoundSemantic_SoundSpot);
m_pSound = m_pSoundProxy->GetSound(id);
if (m_pSound)
m_pSound->SetPaused(false);
m_bHasBeenPlayed = true;
if (!x_bSpawnOnce)
{
m_fSpawnTime = x_fMinSpawnDelay + (cry_frand() * (x_fMaxSpawnDelay - x_fMinSpawnDelay));
m_fTime = 0.f;
}
}
// Appearantly the sound may become invalid when shutting down engine
if (m_pSound)
{
if (!m_bFadeOut)
{
if (m_fFadeProgression < x_fFadeInTime)
{
float fPercentage = m_fFadeProgression / x_fFadeInTime;
m_pSound->GetInterfaceExtended()->SetVolume(x_fVolume * fPercentage);
}
else
{
m_pSound->GetInterfaceExtended()->SetVolume(x_fVolume);
}
m_fFadeProgression += fFrameTime;
}
else
{
if (m_fFadeProgression < x_fFadeInTime)
{
float fPercentage = m_fFadeProgression / m_fFadeOutTime;
m_pSound->GetInterfaceExtended()->SetVolume(x_fVolume * fPercentage);
}
else
{
m_pSound->GetInterfaceExtended()->SetVolume(0.f);
}
m_fFadeProgression -= fFrameTime;
}
}
}
m_fTime += fFrameTime;
}
void SSituationSound::Reset()
{
m_fTime = 0.f;
if (x_fSpawnAfterSeconds >= 0)
{
m_fSpawnTime = x_fSpawnAfterSeconds;
}
else
{
m_fSpawnTime = 0.f;
}
m_bHasBeenPlayed = false;
m_bFadeOut = false;
m_fFadeOutTime = 0.f;
m_fFadeProgression = 0.f;
if (!gEnv->IsEditing() && m_pSound)
{
m_pSound->SetPaused(true);
m_pSound->Stop();
}
if (gEnv->IsEditor())
{
m_pEntity = nullptr;
m_pSound = nullptr;
m_pSoundProxy = nullptr;
}
}
void SSituationSound::SpawnSound()
{
int &soundFlags = m_nSoundFlags;
soundFlags |= FLAG_SOUND_3D | FLAG_SOUND_START_PAUSED;
if (x_bLoop)
{
soundFlags |= FLAG_SOUND_LOOP;
}
switch (x_positioningMode)
{
case ePM_World:
break;
case ePM_Local:
{
soundFlags |= FLAG_SOUND_RELATIVE;
}
break;
case ePM_AroundPlayer:
break;
case ePM_AroundWorld:
break;
default:
break;
}
if (x_fSpawnAfterSeconds >= 0)
{
m_fSpawnTime = x_fSpawnAfterSeconds;
}
else
{
m_fSpawnTime = 0.f;
}
m_pSound = gEnv->pSoundSystem->CreateSound(x_sPath, soundFlags);
SEntitySpawnParams params;
params.pClass = gEnv->pEntitySystem->GetClassRegistry()->FindClass("BasicEntity");
params.vPosition = Vec3(0);
m_pEntity = gEnv->pEntitySystem->SpawnEntity(params);
if (m_pEntity)
{
m_pEntity->Invisible(true);
}
if (m_pEntity)
{
m_pSoundProxy = (IEntitySoundProxy *)m_pEntity->CreateProxy(EEntityProxy::ENTITY_PROXY_SOUND);
}
}
void SSituationSound::FadeOut(float fTimeLeft)
{
m_bFadeOut = true;
m_fFadeOutTime = fTimeLeft;
m_fFadeProgression = fTimeLeft;
}
//=============================================================================
// Private
//=============================================================================
| [
"omggomb@gmx.de"
] | omggomb@gmx.de |
ffac58bdb1b351c537ec9512fe8d5355430070b8 | aaed5a377911c147996f4fc315f01de1f28764b6 | /第二章/2.5数学问题的解题窍门/埃氏筛法.cpp | 9d81aa3bed485e770ae8c91cfe9bc11f4819828a | [] | no_license | pidanself/about-my-change | 234a4fbe6828fc6c9ccc04c5070503a0927cb2c0 | 3f76be7e745de06e8d35107408441f7eff86a5c0 | refs/heads/master | 2020-04-22T19:49:15.801063 | 2019-04-08T15:09:16 | 2019-04-08T15:09:16 | 170,620,352 | 1 | 0 | null | null | null | null | GB18030 | C++ | false | false | 328 | cpp | //埃氏筛法 时间复杂度近似为n
#include<iostream>
using namespace std;
int main(){
int n,ans=0;
cin>>n;
bool mem[n+1];
for(int i=0;i<n+1;i++){
mem[i]=true;
}
mem[1]=false;
for(int i=2;i<=n;i++){
if(mem[i]){
for(int j=2*i;j<=n;j+=i){
mem[j]=false;
}
ans++;
}
}
cout<<ans;
return 0;
}
| [
"15652786161@163.com"
] | 15652786161@163.com |
94c0be28e8024438cc724c2275c62e4ceff44195 | d33ac2fd5144f9967b94d334c432f2bdc5e19530 | /Results/OpenFoam-rhoCentralFoam-100x100/0.47/uniform/time | e28a2df4d111fe1f4ff9e2122fe9df761e85f60f | [] | no_license | mcheikh1991/P8_Python-C-Fortran_CFD-Serial | 7247cdec5d3ce832ab10ebfcd4a973b4ce38f228 | fc0d642be29fa43ccb5250a9185a62b8e9191ea2 | refs/heads/main | 2023-01-19T05:11:44.264060 | 2020-11-30T09:37:47 | 2020-11-30T09:37:47 | 317,175,125 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 998 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "0.47/uniform";
object time;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
value 0.469999999999980878;
name "0.47";
index 2350;
deltaT 0.0002;
deltaT0 0.0002;
// ************************************************************************* //
| [
"mcheikh@buffalo.edu"
] | mcheikh@buffalo.edu | |
ae97569456a3751a2250daefc5dff2f23d9d052b | 57ad20f42af3000a0e7b831fa4044afa525ffd9e | /Externals/include/Mathter/MatrixModules/DecomposeSVD.hpp | fb6a66eb8a2087c6b20ebe061480ae8974f73829 | [] | no_license | IanBravo/Inline-Engine | e2900ea3d4146cfebf23e5ab3400592ffaa01cbf | 6c73bb7f16b97dc4b2012a908b1ca716c5f38ad0 | refs/heads/master | 2021-05-02T16:27:08.984108 | 2018-02-06T12:43:41 | 2018-02-06T12:43:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,715 | hpp | //==============================================================================
// This software is distributed under The Unlicense.
// For more information, please refer to <http://unlicense.org/>
//==============================================================================
#pragma once
#include "MatrixModule.hpp"
namespace mathter {
template <class T, int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
class DecompositionSVD {
template <int Rows_, int Columns_>
using MatrixT = Matrix<T, Rows_, Columns_, Order, Layout, Packed>;
static constexpr int Sdim = std::min(Rows, Columns);
static constexpr int Udim = Rows;
static constexpr int Vdim = Columns;
public:
DecompositionSVD(const MatrixT<Rows, Columns>& arg) {
arg.DecomposeSVD(U, S, V);
}
MatrixT<Udim, Sdim> U;
MatrixT<Sdim, Sdim> S;
MatrixT<Sdim, Vdim> V;
};
template <class T, int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
class MatrixSVD {
using MatrixT = Matrix<T, Rows, Columns, Order, Layout, Packed>;
MatrixT& self() { return *static_cast<MatrixT*>(this); }
const MatrixT& self() const { return *static_cast<const MatrixT*>(this); }
static constexpr int Sdim = std::min(Rows, Columns);
static constexpr int Udim = Rows;
static constexpr int Vdim = Columns;
public:
void DecomposeSVD(
Matrix<T, Udim, Sdim, Order, Layout, Packed>& Uout,
Matrix<T, Sdim, Sdim, Order, Layout, Packed>& Sout,
Matrix<T, Sdim, Vdim, Order, Layout, Packed>& Vout) const
{
DecomposeSVD(Uout, Sout, Vout, std::integral_constant<bool, (Rows >= Columns)>());
}
private:
void DecomposeSVD(
Matrix<T, Rows, Columns, Order, Layout, Packed>& Uout,
Matrix<T, Columns, Columns, Order, Layout, Packed>& Sout,
Matrix<T, Columns, Columns, Order, Layout, Packed>& Vout,
std::true_type) const;
void DecomposeSVD(
Matrix<T, Rows, Rows, Order, Layout, Packed>& Uout,
Matrix<T, Rows, Rows, Order, Layout, Packed>& Sout,
Matrix<T, Rows, Columns, Order, Layout, Packed>& Vout,
std::false_type) const
{
Matrix<T, Columns, Rows, Order, Layout, Packed> U;
Matrix<T, Rows, Rows, Order, Layout, Packed> S;
Matrix<T, Rows, Rows, Order, Layout, Packed> V;
self().Transposed().DecomposeSVD(U, S, V);
Vout = U.Transposed();
Sout = S;
Uout = V.Transposed();
}
public:
friend MatrixT;
using Inherit = MatrixSVD;
};
template <class T, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
void Rq2x2Helper(const Matrix<T, 2, 2, Order, Layout, Packed>& A, T& x, T& y, T& z, T& c2, T& s2) {
T a = A(0, 0);
T b = A(0, 1);
T c = A(1, 0);
T d = A(1, 1);
if (c == 0) {
x = a;
y = b;
z = d;
c2 = 1;
s2 = 0;
return;
}
T maxden = std::max(abs(c), abs(d));
T rcmaxden = 1/maxden;
c *= rcmaxden;
d *= rcmaxden;
T den = 1/sqrt(c*c + d*d);
T numx = (-b*c + a*d);
T numy = (a*c + b*d);
x = numx * den;
y = numy * den;
z = maxden/den;
s2 = -c * den;
c2 = d * den;
}
template <class T, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
void Svd2x2Helper(const Matrix<T, 2, 2, Order, Layout, Packed>& A, T& c1, T& s1, T& c2, T& s2, T& d1, T& d2) {
// Calculate RQ decomposition of A
T x, y, z;
Rq2x2Helper(A, x, y, z, c2, s2);
// Calculate tangent of rotation on R[x,y;0,z] to diagonalize R^T*R
T scaler = T(1)/std::max(abs(x), std::max(abs(y), std::numeric_limits<T>::min()));
T x_ = x*scaler, y_ = y*scaler, z_ = z*scaler;
T numer = ((z_-x_)*(z_+x_)) + y_*y_;
T gamma = x_*y_;
gamma = numer == 0 ? 1 : gamma;
T zeta = numer/gamma;
T t = 2*impl::sign_nonzero(zeta)/(abs(zeta) + sqrt(zeta*zeta+4));
// Calculate sines and cosines
c1 = T(1) / sqrt(T(1) + t*t);
s1 = c1*t;
// Calculate U*S = R*R(c1,s1)
T usa = c1*x - s1*y;
T usb = s1*x + c1*y;
T usc = -s1*z;
T usd = c1*z;
// Update V = R(c1,s1)^T*Q
t = c1*c2 + s1*s2;
s2 = c2*s1 - c1*s2;
c2 = t;
// Separate U and S
d1 = std::hypot(usa, usc);
d2 = std::hypot(usb, usd);
T dmax = std::max(d1, d2);
T usmax1 = d2 > d1 ? usd : usa;
T usmax2 = d2 > d1 ? usb : -usc;
T signd1 = impl::sign_nonzero(x*z);
dmax *= d2 > d1 ? signd1 : 1;
d2 *= signd1;
T rcpdmax = 1/dmax;
c1 = dmax != T(0) ? usmax1 * rcpdmax : T(1);
s1 = dmax != T(0) ? usmax2 * rcpdmax : T(0);
}
template <class T, int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
void MatrixSVD<T, Rows, Columns, Order, Layout, Packed>::DecomposeSVD(
Matrix<T, Rows, Columns, Order, Layout, Packed>& Uout,
Matrix<T, Columns, Columns, Order, Layout, Packed>& Sout,
Matrix<T, Columns, Columns, Order, Layout, Packed>& Vout,
std::true_type) const
{
Matrix<T, Rows, Columns, Order, eMatrixLayout::COLUMN_MAJOR, false> B;
Matrix<T, Rows, Columns, Order, eMatrixLayout::COLUMN_MAJOR, false> U;
Matrix<T, Columns, Columns, Order, eMatrixLayout::COLUMN_MAJOR, false> V;
// Precondition with QR if needed
if (Rows > Columns) {
Matrix<T, Rows, Rows, Order, Layout, false> Q;
Matrix<T, Rows, Columns, Order, Layout, false> R;
self().DecomposeQR(Q, R);
B = R;
U = Q.Submatrix<Rows, Columns>(0, 0);
V.SetIdentity();
}
else {
B = self();
U.SetIdentity();
V.SetIdentity();
}
T tolerance = T(1e-6);
T N = B.NormSquared();
T s;
do {
s = 0;
for (int i = 0; i < self().ColumnCount(); ++i) {
for (int j = i+1; j < self().ColumnCount(); ++j) {
s += B(i, j)*B(i, j) + B(j, i)*B(j, i);
T s1, c1, s2, c2, d1, d2; // SVD of the submat row,col i,j of B
Matrix<T, 2, 2> Bsub = {
B(i, i), B(i, j),
B(j, i), B(j, j)
};
Svd2x2Helper(Bsub, c1, s1, c2, s2, d1, d2);
Matrix<T, 2, 2> U_ = {
c1, -s1,
s1, c1
};
Matrix<T, 2, 2> V_ = {
c2, s2,
-s2, c2
};
auto check = U_*Bsub*V_;
// Apply givens rotations given by 2x2 SVD to working matrices
// B = R(c1,s1)*B*R(c2,-s2)
Vector<T, 4, false> givensCoeffs = { c1, -s1, s1, c1 };
Vector<T, 4, false> bElems;
for (int col = 0; col < B.ColumnCount(); ++col) {
bElems.Set(B(i, col), B(j, col), B(i, col), B(j, col));
bElems *= givensCoeffs;
B(i, col) = bElems(0) + bElems(1);
B(j, col) = bElems(2) + bElems(3);
}
auto coli = B.stripes[i];
B.stripes[i] = c2*coli + -s2*B.stripes[j];
B.stripes[j] = s2*coli + c2*B.stripes[j];
// U = U*R(c1,s1);
coli = U.stripes[i];
U.stripes[i] = c1*coli + -s1*U.stripes[j];
U.stripes[j] = s1*coli + c1*U.stripes[j];
// V = V*R(c2,s2);
auto coliv = V.stripes[i];
V.stripes[i] = c2*coliv + -s2*V.stripes[j];
V.stripes[j] = s2*coliv + c2*V.stripes[j];
}
}
} while (s > tolerance*N);
Uout = U;
Sout.SetZero();
for (int i = 0; i<B.ColumnCount(); ++i) {
Sout(i, i) = B(i, i);
}
Vout = V.Transposed();
}
} | [
"kardospeter1994@hotmail.com"
] | kardospeter1994@hotmail.com |
8d74a523e4ed1a8ab5caccb032a9423ab36606e8 | 2ed8b67edb85615896f6c7b309b6c104ed4c34d4 | /Butta Secure Processing Project/C Code (Secure Installation)/aes-gcm/src/logging.cc | ce8743d8be190f5781c9ffb47ecc86f53655e95f | [] | no_license | nbutta/ComputerAchitecture612Spring2019 | 8fdd928cede2cac179b2ac25688ed180ca0c87ad | 547cc2d0cb0c7a7c7a5168f870f5215ce237a9fe | refs/heads/master | 2022-06-29T20:17:56.360696 | 2020-05-13T15:26:28 | 2020-05-13T15:26:28 | 263,668,041 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,520 | cc | //
// logging.cc
//
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string>
#include "logging.h"
std::string format_string(const char* fmt, ...)
{
char msgbuf[128];
va_list ap;
va_start(ap, fmt);
int len = vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
va_end(ap);
std::string str;
if (len > 127) {
char *bigbuf = new char[len + 1];
va_start(ap, fmt);
vsnprintf(bigbuf, len + 1, fmt, ap);
va_end(ap);
str = bigbuf;
delete [] bigbuf;
} else {
str = msgbuf;
}
return str;
}
void log_error_exit(const char* fmt, ...)
{
char msgbuf[1024];
va_list ap;
va_start(ap, fmt);
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
va_end(ap);
fprintf(stderr, "FATAL ERROR: %s\n", msgbuf);
exit(9);
}
void log_error(const char* fmt, ...)
{
char msgbuf[1024];
va_list ap;
va_start(ap, fmt);
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
va_end(ap);
fprintf(stderr, "ERROR: %s\n", msgbuf);
}
void log_info(const char* fmt, ...)
{
char msgbuf[1024];
va_list ap;
va_start(ap, fmt);
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
va_end(ap);
fprintf(stdout, "INFO: %s\n", msgbuf);
}
void log_debug(const char* fmt, ...)
{
char msgbuf[1024];
va_list ap;
va_start(ap, fmt);
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
va_end(ap);
fprintf(stdout, "DEBUG: %s\n", msgbuf);
}
| [
"J39950@ngc.authority"
] | J39950@ngc.authority |
4ab0b313405d73b3f831947de11473ffa091286d | ea7c2707319a6cc1ecb51de61b2911fcea7f802c | /RuleClassifier.cpp | 61ef2d08a1c158b97261d4ffd17b30b0e8a9b8b0 | [] | no_license | glebwell/CN2_Rules | 6bb06af2601c9525c986a2fbb36e662968148283 | 1d788ee393eaa0de46761030248a9f49e29af9da | refs/heads/master | 2021-01-12T17:49:49.888335 | 2016-11-13T18:58:54 | 2016-11-13T18:58:54 | 71,645,679 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,851 | cpp | #include <iostream>
#include <algorithm>
#include "RuleClassifier.h"
RuleClassifier::RuleClassifier(const DataVector& test_data, const std::vector<RulePtr>& rules):
m_total_examples_count(0), m_success_prediction_count(0), m_test_data(test_data), m_rules(rules)
{
}
void RuleClassifier::run()
{
m_failes_by_class.resize(m_test_data.size());
for (unsigned char class_id = 0; class_id < m_test_data.size(); ++class_id)
{
const Examples& exs = m_test_data[class_id];
for (const auto& ex : exs)
{
++m_total_examples_count;
unsigned char predicted_class = predict(ex);
if (predicted_class == class_id)
++m_success_prediction_count;
else
++m_failes_by_class[class_id];
}
}
std::cout << "[" << m_success_prediction_count << " " << m_total_examples_count << "]" << " "
<< (float) m_success_prediction_count/m_total_examples_count * 100 << "%" << "\n";
std::string str = "[";
for (const auto& f : m_failes_by_class)
{
str.append(std::to_string(f) + " ");
}
str.back() = ']'; // delete last space
std::cout << "Failes:" << str << "\n";
}
unsigned char RuleClassifier::predict(const std::vector<float>& example) const
{
Distribution dist(m_test_data.size()); // size of dist is a classes count
std::vector<RulePtr> firedRules;
auto end = --m_rules.cend(); // go for all rules, except last - default rule
//
// copy fired rules
//
std::copy_if(m_rules.cbegin(), end, std::back_inserter(firedRules),
[&](const RulePtr& r) {return r->testRule(example); });
if (firedRules.empty()) // apply default
{
RulePtr default_rule = m_rules.back(); // default rule is last
auto begin = default_rule->distribution().cbegin();
auto end = default_rule->distribution().cend();
// TODO: check if max is not one
// return position of max element - it's a class_id
return std::distance(begin, std::max_element(begin, end));
}
else // apply fired rules
{
//
// Check that fired rules target class is the same
//
bool is_same = std::adjacent_find(firedRules.cbegin(), firedRules.cend(),
[](const RulePtr& r1, const RulePtr& r2) {return r1->targetClass() != r2->targetClass(); }) == firedRules.cend();
if (is_same) // all classes are the same, just return class_id
{
return firedRules.back()->targetClass();
}
else
{
for (const auto& r : firedRules)
{
const Distribution& rule_dist = r->distribution();
// accumulate sum of fired rules distribution
std::transform(rule_dist.cbegin(), rule_dist.cend(), dist.cbegin(), dist.begin(),
[](size_t s, size_t d) {return s + d; });
}
// return position of max element - it's a class_id
// TODO: check if max is not one
return std::distance(dist.cbegin(), std::max_element(dist.cbegin(), dist.cend()));
}
}
} | [
"gleb.maltcev@yandex.ru"
] | gleb.maltcev@yandex.ru |
df601b828ee1165285541972ef62f176cec22a8b | 90e46b80788f2e77eb68825011c682500cabc59c | /Codechef/TAHIRING/DEBUGME_buggy.cpp | faf042ca98cbf5b3d2860ccdce3bff9a1a78b201 | [] | no_license | yashsoni501/Competitive-Programming | 87a112e681ab0a134b345a6ceb7e817803bee483 | 3b228e8f9a64ef5f7a8df4af8c429ab17697133c | refs/heads/master | 2023-05-05T13:40:15.451558 | 2021-05-31T10:04:26 | 2021-05-31T10:04:26 | 298,651,663 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,606 | cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define FIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mod 1000000007
int main() {
FIO;
int t, n, k, i, j, x, cnt1, cnt2, tmp;
string s;
cin >> t;
while (t--> 0) {
cin >> n >> x;
cin >> s;
int disparity[n][n];
int frequency[26] = {0};
for (i = 0; i < n; i++) {
for (j = i; j < n; j++) {
frequency[s[j] - 'a']++;
cnt1 = 0;
cnt2 = n;
for (k = 0; k <= 25; k++) {
cnt1 = max(cnt1, frequency[k]);
if (frequency[k] > 0)
cnt2 = min(cnt2, frequency[k]);
}
for (k = 0; k <= 25; k++)
if (frequency[k] == cnt1)
break;
disparity[i][j] = k;
for (k = 0; k <= 25; k++)
if (frequency[k] == cnt2)
break;
disparity[i][j] -= k;
}
for(j=0;j<26;j++) frequency[j]=0;
}
int dp[x][n];
for (i = 0; i < n; i++) {
dp[0][i] = disparity[0][i];
}
for (i = 1; i < x; i++) {
for (j = 0; j < n; j++) {
dp[i][j] = dp[i - 1][j];
for (k = 0; k < j; k++) {
dp[i][j] = min(dp[i][j], dp[i - 1][k] + disparity[k + 1][j]);
}
}
}
cout << dp[x - 1][n - 1] << "\n";
}
return 0;
}
| [
"yashsoni501@gmail.com"
] | yashsoni501@gmail.com |
50b3048a767eae1a0f0256290efa7db67df3abfc | 8dc639fbad71ca8ae1f9d105a86135230dc966f8 | /servo_ultrasonico/servo_ultrasonico.ino | be8f427f426f7b032ba30e1587e55465224b76ff | [] | no_license | dvidHD/ARD | a9572bf71eab875b808c0cffc6fc2e8343936c62 | 128d5bdfe7d91dd3a708f64820ddec958ca94c30 | refs/heads/master | 2020-04-02T07:30:09.321637 | 2020-01-20T01:34:49 | 2020-01-20T01:34:49 | 154,199,454 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,080 | ino | #include <Servo.h>
Servo derecha;
Servo izquierda;
int trigPin = 10;
int echoPin = 11;
long duration;
int distance;
void setup() {
derecha.attach(6);
izquierda.attach(3);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600);
}
void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);
delay(150);
if (distance < 15){
derecha.write(140);
izquierda.write(90);
delay(200);
derecha.write(180);
izquierda.write(0);
delay(200);
derecha.write(140);
izquierda.write(90);
delay(120);
}
if(distance > 30){
derecha.write(0);
izquierda.write(180);
delay(400);
}
}
| [
"drebolloandrade@gmail.com"
] | drebolloandrade@gmail.com |
b27d5610d24ae86bdecafb89346f898ca9681fd5 | 90070fb9d66acff62eee5127844a6fda4f1d4e43 | /PureC++/qtconcurrent/wordcount/src/widgets/build-tools-Desktop_Qt_5_5_0_MSVC2010_32bit-Debug/plugandpaintplugins/basictools/debug/moc_basictoolsplugin.cpp | e4c3b62a27964589693dfced4fef8a19b236e2bc | [] | no_license | smileHorse/C- | 115cb7e49e214b55151070c718b7e4b22ff4b800 | 487e4c33bdcd9f03754bb7dc903e8477298cde4f | refs/heads/master | 2021-01-21T08:37:09.722703 | 2020-02-09T09:26:41 | 2020-02-09T09:26:41 | 91,629,036 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,779 | cpp | /****************************************************************************
** Meta object code from reading C++ file 'basictoolsplugin.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.5.0)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../../../../tools/plugandpaintplugins/basictools/basictoolsplugin.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#include <QtCore/qplugin.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'basictoolsplugin.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.5.0. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
struct qt_meta_stringdata_BasicToolsPlugin_t {
QByteArrayData data[1];
char stringdata0[17];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_BasicToolsPlugin_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_BasicToolsPlugin_t qt_meta_stringdata_BasicToolsPlugin = {
{
QT_MOC_LITERAL(0, 0, 16) // "BasicToolsPlugin"
},
"BasicToolsPlugin"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_BasicToolsPlugin[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
0 // eod
};
void BasicToolsPlugin::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject BasicToolsPlugin::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_BasicToolsPlugin.data,
qt_meta_data_BasicToolsPlugin, qt_static_metacall, Q_NULLPTR, Q_NULLPTR}
};
const QMetaObject *BasicToolsPlugin::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *BasicToolsPlugin::qt_metacast(const char *_clname)
{
if (!_clname) return Q_NULLPTR;
if (!strcmp(_clname, qt_meta_stringdata_BasicToolsPlugin.stringdata0))
return static_cast<void*>(const_cast< BasicToolsPlugin*>(this));
if (!strcmp(_clname, "BrushInterface"))
return static_cast< BrushInterface*>(const_cast< BasicToolsPlugin*>(this));
if (!strcmp(_clname, "ShapeInterface"))
return static_cast< ShapeInterface*>(const_cast< BasicToolsPlugin*>(this));
if (!strcmp(_clname, "FilterInterface"))
return static_cast< FilterInterface*>(const_cast< BasicToolsPlugin*>(this));
if (!strcmp(_clname, "org.qt-project.Qt.Examples.PlugAndPaint.BrushInterface"))
return static_cast< BrushInterface*>(const_cast< BasicToolsPlugin*>(this));
if (!strcmp(_clname, "org.qt-project.Qt.Examples.PlugAndPaint.ShapeInterface"))
return static_cast< ShapeInterface*>(const_cast< BasicToolsPlugin*>(this));
if (!strcmp(_clname, "org.qt-project.Qt.Examples.PlugAndPaint.FilterInterface"))
return static_cast< FilterInterface*>(const_cast< BasicToolsPlugin*>(this));
return QObject::qt_metacast(_clname);
}
int BasicToolsPlugin::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
return _id;
}
QT_PLUGIN_METADATA_SECTION const uint qt_section_alignment_dummy = 42;
#ifdef QT_NO_DEBUG
QT_PLUGIN_METADATA_SECTION
static const unsigned char qt_pluginMetaData[] = {
'Q', 'T', 'M', 'E', 'T', 'A', 'D', 'A', 'T', 'A', ' ', ' ',
'q', 'b', 'j', 's', 0x01, 0x00, 0x00, 0x00,
0xc0, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
0xac, 0x00, 0x00, 0x00, 0x1b, 0x03, 0x00, 0x00,
0x03, 0x00, 'I', 'I', 'D', 0x00, 0x00, 0x00,
'6', 0x00, 'o', 'r', 'g', '.', 'q', 't',
'-', 'p', 'r', 'o', 'j', 'e', 'c', 't',
'.', 'Q', 't', '.', 'E', 'x', 'a', 'm',
'p', 'l', 'e', 's', '.', 'P', 'l', 'u',
'g', 'A', 'n', 'd', 'P', 'a', 'i', 'n',
't', '.', 'B', 'r', 'u', 's', 'h', 'I',
'n', 't', 'e', 'r', 'f', 'a', 'c', 'e',
0x1b, 0x0c, 0x00, 0x00, 0x09, 0x00, 'c', 'l',
'a', 's', 's', 'N', 'a', 'm', 'e', 0x00,
0x10, 0x00, 'B', 'a', 's', 'i', 'c', 'T',
'o', 'o', 'l', 's', 'P', 'l', 'u', 'g',
'i', 'n', 0x00, 0x00, 0x1a, 0xa0, 0xa0, 0x00,
0x07, 0x00, 'v', 'e', 'r', 's', 'i', 'o',
'n', 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
0x05, 0x00, 'd', 'e', 'b', 'u', 'g', 0x00,
0x15, 0x14, 0x00, 0x00, 0x08, 0x00, 'M', 'e',
't', 'a', 'D', 'a', 't', 'a', 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
0x90, 0x00, 0x00, 0x00, 'P', 0x00, 0x00, 0x00,
0x84, 0x00, 0x00, 0x00, 't', 0x00, 0x00, 0x00
};
#else // QT_NO_DEBUG
QT_PLUGIN_METADATA_SECTION
static const unsigned char qt_pluginMetaData[] = {
'Q', 'T', 'M', 'E', 'T', 'A', 'D', 'A', 'T', 'A', ' ', ' ',
'q', 'b', 'j', 's', 0x01, 0x00, 0x00, 0x00,
0xc0, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
0xac, 0x00, 0x00, 0x00, 0x1b, 0x03, 0x00, 0x00,
0x03, 0x00, 'I', 'I', 'D', 0x00, 0x00, 0x00,
'6', 0x00, 'o', 'r', 'g', '.', 'q', 't',
'-', 'p', 'r', 'o', 'j', 'e', 'c', 't',
'.', 'Q', 't', '.', 'E', 'x', 'a', 'm',
'p', 'l', 'e', 's', '.', 'P', 'l', 'u',
'g', 'A', 'n', 'd', 'P', 'a', 'i', 'n',
't', '.', 'B', 'r', 'u', 's', 'h', 'I',
'n', 't', 'e', 'r', 'f', 'a', 'c', 'e',
0x15, 0x0c, 0x00, 0x00, 0x08, 0x00, 'M', 'e',
't', 'a', 'D', 'a', 't', 'a', 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x9b, 0x0f, 0x00, 0x00,
0x09, 0x00, 'c', 'l', 'a', 's', 's', 'N',
'a', 'm', 'e', 0x00, 0x10, 0x00, 'B', 'a',
's', 'i', 'c', 'T', 'o', 'o', 'l', 's',
'P', 'l', 'u', 'g', 'i', 'n', 0x00, 0x00,
'1', 0x00, 0x00, 0x00, 0x05, 0x00, 'd', 'e',
'b', 'u', 'g', 0x00, 0x1a, 0xa0, 0xa0, 0x00,
0x07, 0x00, 'v', 'e', 'r', 's', 'i', 'o',
'n', 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
'P', 0x00, 0x00, 0x00, 'l', 0x00, 0x00, 0x00,
0x90, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00
};
#endif // QT_NO_DEBUG
QT_MOC_EXPORT_PLUGIN(BasicToolsPlugin, BasicToolsPlugin)
QT_END_MOC_NAMESPACE
| [
"65022492@qq.com"
] | 65022492@qq.com |
08ed222eefaf651e97c6656ab380e5c863b43a63 | 9ee7f62d3b868c54f98fa48edf7c81089d27e180 | /StanHull/hull.h | 2a5615339e309bdb2435584a30a7306635dcbc9f | [
"MIT"
] | permissive | mathieuSauvage/DDConvexHull | faf758345a75a926677ac081046e29c745d8b981 | 0805d9782cb748a7522acaf8b8c966b0985e9297 | refs/heads/master | 2021-01-15T18:45:40.627036 | 2013-02-07T18:38:38 | 2013-02-07T18:38:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,062 | h | #ifndef HUL_H
#define HULL_H
/*!
**
** Copyright (c) 2007 by John W. Ratcliff mailto:jratcliff@infiniplex.net
**
** Portions of this source has been released with the PhysXViewer application, as well as
** Rocket, CreateDynamics, ODF, and as a number of sample code snippets.
**
** If you find this code useful or you are feeling particularily generous I would
** ask that you please go to http://www.amillionpixels.us and make a donation
** to Troy DeMolay.
**
** DeMolay is a youth group for young men between the ages of 12 and 21.
** It teaches strong moral principles, as well as leadership skills and
** public speaking. The donations page uses the 'pay for pixels' paradigm
** where, in this case, a pixel is only a single penny. Donations can be
** made for as small as $4 or as high as a $100 block. Each person who donates
** will get a link to their own site as well as acknowledgement on the
** donations blog located here http://www.amillionpixels.blogspot.com/
**
** If you wish to contact me you can use the following methods:
**
** Skype Phone: 636-486-4040 (let it ring a long time while it goes through switches)
** Skype ID: jratcliff63367
** Yahoo: jratcliff63367
** AOL: jratcliff1961
** email: jratcliff@infiniplex.net
** Personal website: http://jratcliffscarab.blogspot.com
** Coding Website: http://codesuppository.blogspot.com
** FundRaising Blog: http://amillionpixels.blogspot.com
** Fundraising site: http://www.amillionpixels.us
** New Temple Site: http://newtemple.blogspot.com
**
**
** The MIT license:
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
** of this software and associated documentation files (the "Software"), to deal
** in the Software without restriction, including without limitation the rights
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
** copies of the Software, and to permit persons to whom the Software is furnished
** to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in all
** copies or substantial portions of the Software.
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
** WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
** CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
// Jtilden - on mac OSX, include string for memcpy
#ifdef __APPLE__
#include <string.h>
#endif
class HullResult
{
public:
HullResult(void)
{
mPolygons = true;
mNumOutputVertices = 0;
mOutputVertices = 0;
mNumFaces = 0;
mNumIndices = 0;
mIndices = 0;
}
bool mPolygons; // true if indices represents polygons, false indices are triangles
unsigned int mNumOutputVertices; // number of vertices in the output hull
double *mOutputVertices; // array of vertices, 3 doubles each x,y,z
unsigned int mNumFaces; // the number of faces produced
unsigned int mNumIndices; // the total number of indices
unsigned int *mIndices; // pointer to indices.
// If triangles, then indices are array indexes into the vertex list.
// If polygons, indices are in the form (number of points in face) (p1, p2, p3, ..) etc..
};
class FHullResult
{
public:
FHullResult(const HullResult &r)
{
mPolygons = r.mPolygons;
mNumOutputVertices = r.mNumOutputVertices;
mNumFaces = r.mNumFaces;
mNumIndices = r.mNumIndices;
mIndices = 0;
mOutputVertices = 0;
if ( mNumIndices )
{
mIndices = new unsigned int[mNumIndices];
memcpy(mIndices,r.mIndices,sizeof(unsigned int)*mNumIndices);
}
if ( mNumOutputVertices )
{
mOutputVertices = new float[mNumOutputVertices*3];
const double *src = r.mOutputVertices;
float *dst = mOutputVertices;
for (unsigned int i=0; i<mNumOutputVertices; i++)
{
dst[0] = (float) src[0];
dst[1] = (float) src[1];
dst[2] = (float) src[2];
dst+=3;
src+=3;
}
}
}
~FHullResult(void)
{
delete mIndices;
delete mOutputVertices;
}
bool mPolygons; // true if indices represents polygons, false indices are triangles
unsigned int mNumOutputVertices; // number of vertices in the output hull
float *mOutputVertices; // array of vertices, 3 doubles each x,y,z
unsigned int mNumFaces; // the number of faces produced
unsigned int mNumIndices; // the total number of indices
unsigned int *mIndices; // pointer to indices.
// If triangles, then indices are array indexes into the vertex list.
// If polygons, indices are in the form (number of points in face) (p1, p2, p3, ..) etc..
};
enum HullFlag
{
QF_TRIANGLES = (1<<0), // report results as triangles, not polygons.
QF_REVERSE_ORDER = (1<<1), // reverse order of the triangle indices.
QF_SKIN_WIDTH = (1<<2), // extrude hull based on this skin width
QF_DEFAULT = 0
};
class HullDesc
{
public:
HullDesc(void)
{
mFlags = QF_DEFAULT;
mVcount = 0;
mVertices = 0;
mVertexStride = 0;
mNormalEpsilon = 0.001f;
mMaxVertices = 4096; // maximum number of points to be considered for a convex hull.
mSkinWidth = 0.01f; // default is one centimeter
};
HullDesc(HullFlag flag,
unsigned int vcount,
double *vertices,
unsigned int stride)
{
mFlags = flag;
mVcount = vcount;
mVertices = vertices;
mVertexStride = stride;
mNormalEpsilon = 0.001f;
mMaxVertices = 4096;
mSkinWidth = 0.01f; // default is one centimeter
}
bool HasHullFlag(HullFlag flag) const
{
if ( mFlags & flag ) return true;
return false;
}
void SetHullFlag(HullFlag flag)
{
mFlags|=flag;
}
void ClearHullFlag(HullFlag flag)
{
mFlags&=~flag;
}
unsigned int mFlags; // flags to use when generating the convex hull.
unsigned int mVcount; // number of vertices in the input point cloud
double *mVertices; // the array of vertices.
unsigned int mVertexStride; // the stride of each vertex, in bytes.
double mNormalEpsilon; // the epsilon for removing duplicates. This is a normalized value, if normalized bit is on.
double mSkinWidth;
unsigned int mMaxVertices; // maximum number of vertices to be considered for the hull!
};
enum HullError
{
QE_OK, // success!
QE_FAIL // failed.
};
// This class is used when converting a convex hull into a triangle mesh.
class ConvexHullVertex
{
public:
double mPos[3];
double mNormal[3];
double mTexel[2];
};
// A virtual interface to receive the triangles from the convex hull.
class ConvexHullTriangleInterface
{
public:
virtual void ConvexHullTriangle(const ConvexHullVertex &v1,const ConvexHullVertex &v2,const ConvexHullVertex &v3) = 0;
};
class HullLibrary
{
public:
HullError CreateConvexHull(const HullDesc &desc, // describes the input request
HullResult &result); // contains the resulst
HullError ReleaseResult(HullResult &result); // release memory allocated for this result, we are done with it.
// Utility function to convert the output convex hull as a renderable set of triangles. Unfolds the polygons into
// individual triangles, compute the vertex normals, and projects some texture co-ordinates.
HullError CreateTriangleMesh(HullResult &answer,ConvexHullTriangleInterface *iface);
private:
double ComputeNormal(double *n,const double *A,const double *B,const double *C);
void AddConvexTriangle(ConvexHullTriangleInterface *callback,const double *p1,const double *p2,const double *p3);
void BringOutYourDead(const double *verts,unsigned int vcount, double *overts,unsigned int &ocount,unsigned int *indices,unsigned indexcount);
bool CleanupVertices(unsigned int svcount,
const double *svertices,
unsigned int stride,
unsigned int &vcount, // output number of vertices
double *vertices, // location to store the results.
double normalepsilon,
double *scale);
};
#endif
| [
"destructo@Pickles.local"
] | destructo@Pickles.local |
e46a9a81e62ec6361cca5e6397086eddc1205a48 | 390e1d1eef3b51d961cc329f381c864829c3f676 | /TestVecteur/main.cpp | af92dc9a3f1f06bd707a224f3e450d90f80d2ee2 | [] | no_license | AlexTahiata/Apprendre_Cpp | a67d7bf07b0f24a057560fea102b8684c07cd422 | c45e6d0bf81e242ecc1a1cbb9e7df1d437cc9b5e | refs/heads/master | 2020-07-19T17:34:49.134860 | 2019-10-18T09:09:30 | 2019-10-18T09:09:30 | 206,488,234 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 167 | cpp | #include <iostream>
#include "Vecteur.h"
using namespace std;
int main()
{
Vecteur<int> v1(4,5);
Vecteur<int> v2(10,8);
v1 = v1 + v2;
return 0;
}
| [
"atahiata72@gmail.com"
] | atahiata72@gmail.com |
38b7bb7065a5a8b0b0adeec7a4eb5b487d28e9e5 | 0b52c96e6d2aa22b60390d50325eec952bc81516 | /main.cpp | e8bd3e8a8e8b1a3e2a55dfbefeab4d9afb63d86d | [] | no_license | LeadProgramming/Front-End-Compiler | 7afc7c7378f1728915aa46cb400e55ba1ca80654 | e5d947d0ad38e8a1e561e8096097bf14775372eb | refs/heads/main | 2023-02-09T18:09:04.870786 | 2021-01-04T11:20:47 | 2021-01-04T11:20:47 | 324,071,189 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 490 | cpp | /*
* Name: David Nguyen (891362089)
* Professor's Name: Professor Anthony Le
* Date: 12/16/19
* Assignment Name: Syntax Analysis
* Assignment #: 3
*/
#include "Compiler.h"
using namespace std;
int main() {
string syntax_input = "syntax_input.txt";
string syntax_output = "syntax_output.txt";
try {
Compiler c;
c.readFile(syntax_input);
c.writeFile(syntax_output);
}
catch(const runtime_error& e){
cout << e.what();
}
return 0;
} | [
"davitvanguyen@gmail.com"
] | davitvanguyen@gmail.com |
f727b06a61396eb2f48e004e3672e8780bb2f1ea | 98eca557283fe549bf3438ec79c3f3b3fa46deba | /cpp/201_300/228.cpp | 6d68c8c272c33d0324abf650e3e6933deb4ae9d9 | [] | no_license | hilings/leetcode | cd9f14c6430872f4e6b9bed3460b03f31b82d5b9 | b6e14cc3e5eb84eea13fbecfa9f2031caf1fab9a | refs/heads/master | 2022-06-19T04:13:09.492736 | 2022-06-17T06:41:04 | 2022-06-17T06:41:04 | 33,797,308 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,007 | cpp | //
// 228.cpp
// leetcode
//
// Created by Hang Zhang on 5/10/16.
// Copyright © 2016 Hilings Studio. All rights reserved.
//
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<string> summaryRanges(vector<int>& nums) {
vector<string> ret;
for (int i = 0; i < nums.size(); i++) {
int j = i;
while (j+1 < nums.size() && nums[j+1] == nums[j]+1)
j++;
if (i < j) {
ret.push_back(to_string(nums[i])+"->"+to_string(nums[j]));
i = j;
} else {
ret.push_back(to_string(nums[i]));
}
}
return ret;
}
};
int main(int arg, char *argv[]) {
// insert code here...
cout << "LeetCode 228. Summary Ranges, C++ ...\n\n";
Solution sol;
vector<int> nums {0,1,2,4,5,7};
vector<string> r = sol.summaryRanges(nums);
for (string s: r) {
cout << s << '\n';
}
return 0;
} | [
"hangzhang.h@gmail.com"
] | hangzhang.h@gmail.com |
8a51d8ab14c1d45dcd8d9955527aeef90e01d27f | aadf31061666fc9fd95583710a34d01fa571b09f | /include/ShiftRightExpression.hpp | 041b6f003950ea8e65e53dfae32d9cb1baa7d28b | [] | no_license | vladfridman/wisey | 6198cf88387ea82175ea6e1734edb7f9f7cf20c6 | 9d0efcee32e05c7b8dc3dfd22293737324294fea | refs/heads/master | 2022-04-14T08:00:42.743194 | 2020-03-12T14:22:45 | 2020-03-12T14:22:45 | 74,822,543 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,331 | hpp | //
// ShiftRightExpression.hpp
// Wisey
//
// Created by Vladimir Fridman on 5/24/18.
// Copyright © 2018 Vladimir Fridman. All rights reserved.
//
#ifndef ShiftRightExpression_h
#define ShiftRightExpression_h
#include "IBinaryExpression.hpp"
namespace wisey {
/**
* Represents shift right '>>' wisey operation
*/
class ShiftRightExpression : public IBinaryExpression {
const IExpression* mLeftExpression;
const IExpression* mRightExpression;
int mLine;
public:
ShiftRightExpression(const IExpression* leftExpression,
const IExpression* rightExpression,
int line);
~ShiftRightExpression();
const IExpression* getLeft() const override;
const IExpression* getRight() const override;
std::string getOperation() const override;
int getLine() const override;
llvm::Value* generateIR(IRGenerationContext& context, const IType* assignToType) const override;
const IType* getType(IRGenerationContext& context) const override;
bool isConstant() const override;
bool isAssignable() const override;
void printToStream(IRGenerationContext& context, std::iostream& stream) const override;
};
} /* namespace wisey */
#endif /* ShiftRightExpression_h */
| [
"vlad.fridman@gmail.com"
] | vlad.fridman@gmail.com |
53e7d004edccd2131501e91b05d2a7df87a65636 | f2b1435d896689d06095266c16c62dd6f610988e | /1000.cpp | 1a5cce0794e8346c95ee715b382cc6520e989ab8 | [] | no_license | slonegd/timus | 9b674fd72babcdd49ae3e76cfa38bc0454f68707 | 2fa204a7bd1be9d16da3b84901aa10a4cb936b5e | refs/heads/master | 2021-04-05T23:45:10.585991 | 2018-08-10T03:38:18 | 2018-08-10T03:38:18 | 124,635,721 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 107 | cpp | #include <iostream>
int main()
{
int a,b;
std::cin >> a >> b;
std::cout << a+b << std::endl;
} | [
"slonkdv@mail.ru"
] | slonkdv@mail.ru |
6d96bfcd017c95f8d8c7deb17e440f8ccc582c3a | 93288390fd191a2a2499b9e2a20cc3724d79ed7c | /CarND-PID-Control-Project/src/main.cpp | 45468b207912f2b34fe2c46042ac28647d0dd88d | [
"MIT"
] | permissive | T800GHB/Udacity_Self_Driving_Project | 71ccc6c8c4a0ced74f2fd6d09146c6e6f3bb954b | 62c4066a1ce49b10488567f0269455f55ff8ea79 | refs/heads/master | 2022-06-26T02:08:23.130335 | 2020-09-26T08:17:21 | 2020-09-26T08:17:21 | 186,078,293 | 0 | 0 | null | 2022-06-21T22:33:15 | 2019-05-11T02:27:16 | C++ | UTF-8 | C++ | false | false | 3,499 | cpp | #include <math.h>
#include <uWS/uWS.h>
#include <iostream>
#include <string>
#include "json.hpp"
#include "PID.h"
// for convenience
using nlohmann::json;
using std::string;
// For converting back and forth between radians and degrees.
constexpr double pi() { return M_PI; }
double deg2rad(double x) { return x * pi() / 180; }
double rad2deg(double x) { return x * 180 / pi(); }
// Checks if the SocketIO event has JSON data.
// If there is data the JSON object in string format will be returned,
// else the empty string "" will be returned.
string hasData(string s) {
auto found_null = s.find("null");
auto b1 = s.find_first_of("[");
auto b2 = s.find_last_of("]");
if (found_null != string::npos) {
return "";
}
else if (b1 != string::npos && b2 != string::npos) {
return s.substr(b1, b2 - b1 + 1);
}
return "";
}
int main() {
uWS::Hub h;
PID pid;
// double Kp_init = 0.1;
// double Ki_init = 0.0001;
// double Kd_init = 3;
/**
* Initialize the pid variable.
*/
double Kp_init = 0.15;
double Ki_init = 0.0001;
double Kd_init = 2.5;
pid.Init(Kp_init, Ki_init, Kd_init);
h.onMessage([&pid](uWS::WebSocket<uWS::SERVER> ws, char *data, size_t length,
uWS::OpCode opCode) {
// "42" at the start of the message means there's a websocket message event.
// The 4 signifies a websocket message
// The 2 signifies a websocket event
if (length && length > 2 && data[0] == '4' && data[1] == '2') {
auto s = hasData(string(data).substr(0, length));
if (s != "") {
auto j = json::parse(s);
string event = j[0].get<string>();
if (event == "telemetry") {
// j[1] is the data JSON object
double cte = std::stod(j[1]["cte"].get<string>());
double speed = std::stod(j[1]["speed"].get<string>());
double angle = std::stod(j[1]["steering_angle"].get<string>());
double steer_value;
/**
* Calculate steering value here, remember the steering value is
* [-1, 1].
* NOTE: Feel free to play around with the throttle and speed.
* Maybe use another PID controller to control the speed!
*/
pid.UpdateError(cte);
steer_value = pid.TotalError();
// DEBUG
std::cout << "CTE: " << cte << " Steering Value: " << steer_value
<< std::endl;
json msgJson;
msgJson["steering_angle"] = steer_value;
msgJson["throttle"] = 0.3;
auto msg = "42[\"steer\"," + msgJson.dump() + "]";
std::cout << msg << std::endl;
ws.send(msg.data(), msg.length(), uWS::OpCode::TEXT);
} // end "telemetry" if
} else {
// Manual driving
string msg = "42[\"manual\",{}]";
ws.send(msg.data(), msg.length(), uWS::OpCode::TEXT);
}
} // end websocket message if
}); // end h.onMessage
h.onConnection([&h](uWS::WebSocket<uWS::SERVER> ws, uWS::HttpRequest req) {
std::cout << "Connected!!!" << std::endl;
});
h.onDisconnection([&h](uWS::WebSocket<uWS::SERVER> ws, int code,
char *message, size_t length) {
ws.close();
std::cout << "Disconnected" << std::endl;
});
int port = 4567;
if (h.listen(port)) {
std::cout << "Listening to port " << port << std::endl;
} else {
std::cerr << "Failed to listen to port" << std::endl;
return -1;
}
h.run();
} | [
"hanbing.guo@zongmutech.com"
] | hanbing.guo@zongmutech.com |
967bdf29458e6b34e3020e22b4616efb310e7e7d | e4cf988c57b94734da3f9ca8f0373fc31de9125a | /sketch_MR1_ALL.ino | 160a739dea842e9f579a854f18da29383a24b3a7 | [] | no_license | sink-616/Automation_MR1 | 642526a6c37b8308b37a39373ddbc5c0c5b0a54d | 3e50f0c5fc5eef9b38934ed61fd04d1da9be5dc7 | refs/heads/master | 2020-05-03T09:40:33.003692 | 2019-03-30T13:32:08 | 2019-03-30T13:32:08 | 178,560,429 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,164 | ino | #include <Arduino.h>
#include <RoboClaw.h>
#include "Set_Up.h"
#include "MsTimerTPU3.h"
#include"iodefine_gcc63n.h"
#include "pid.h"
#include "bezier.h"
RoboClaw MD(&Serial2,10);
PID posix_pid(INT_TIME*0.001);
PID posiy_pid(INT_TIME*0.001);
PID deg_pid(INT_TIME*0.001);
PID spdx_pid(INT_TIME*0.001);
PID spdy_pid(INT_TIME*0.001);
PID srot_pid(INT_TIME*0.001);
//int encount1 = 0, encount2 = 0, encount3 = 0;
int Px = 127,Py = 127,Prot = 127,Pdire = 1;
double Ppx = 127,Ppy = 127,Pprot = 127,Ppdire = 1,Ppqpps = 0,Ppadd = 0,Ppspd = 0, Ppsrot = 0;
unsigned short int len = 0;
double global_x = 0,global_y = 0,deg = 0;
double spd_Lx = 0,spd_Ly = 0,spd_Lrot = 0;
double Ax[PHASE];
double Bx[PHASE];
double Cx[PHASE];
double Dx[PHASE];
double Ay[PHASE];
double By[PHASE];
double Cy[PHASE];
double Dy[PHASE];
double a_be[PHASE];
double b_be[PHASE];
double c_be[PHASE];
double d_be[PHASE];
double e_be[PHASE];
double f_be[PHASE];
double d_be_[PHASE];
double e_be_[PHASE];
double f_be_[PHASE];
double t_be = 0.0;
double pre_t_be = 0.1;
double epsilon = 1.0;
void setup() {
MD.begin(115200);
Serial.begin(115200);
Serial1.begin(115200);
MsTimerTPU3::set(INT_TIME, &serial_read);
MsTimerTPU3::start();
set_enc();
posix_pid.set(P_P,P_I,P_D);
posiy_pid.set(P_P,P_I,P_D);
deg_pid.set(D_P,D_I,D_D);
spdx_pid.set(XS_P,NU,XS_D);
spdy_pid.set(YS_P,NU,YS_D);
srot_pid.set(R_P,NU,R_D);
for(int i = 0; i < PHASE; i++) {
Ax[i] = Px[3*i+3] -3*Px[3*i+2] + 3*Px[3*i+1] - Px[3*i+0];
Ay[i] = Py[3*i+3] -3*Py[3*i+2] + 3*Py[3*i+1] - Py[3*i+0];
Bx[i] = Px[3*i+2] -2*Px[3*i+1] + Px[3*i+0];
By[i] = Py[3*i+2] -2*Py[3*i+1] + Py[3*i+0];
Cx[i] = Px[3*i+1] - Px[3*i+0];
Cy[i] = Py[3*i+1] - Py[3*i+0];
Dx[i] = Px[3*i+0];
Dy[i] = Py[3*i+0];
}
for(int i = 0; i < PHASE; i++) {
a_be[i] = pow(Ax[i], 2.0) + pow(Ay[i], 2.0);
b_be[i] = 5*(Ax[i]*Bx[i] + Ay[i]*By[i]);
c_be[i] = 2*((3*pow(Bx[i],2.0)+2*Ax[i]*Cx[i]) + (3*pow(By[i],2.0)+2*Ay[i]*Cy[i]));
d_be_[i] = 9*Bx[i]*Cx[i] + 9*By[i]*Cy[i];
e_be_[i] = 3*pow(Cx[i],2.0) + 3*pow(Cy[i],2.0);
f_be_[i] = 0;
}
}
// tを求めるための方程式
double func(int p, double t){
return a_be[p] * pow(t, 5.0) + b_be[p] * pow(t,4.0) + c_be[p] * pow(t,3.0) + d_be[p] * pow(t,2.0) + e_be[p] * t + f_be[p];
}
// tを求めるための方程式の1階微分
double dfunc(int p, double t){
return 5.0 * a_be[p] * pow(t, 4.0) + 4.0 * b_be[p] * pow(t,3.0) + 3.0 * c_be[p] * pow(t,2.0) + 2.0 * d_be[p] * t + e_be[p];
}
void serial_read(){
len = Serial1.available();
static char buff[10] = {};
static unsigned char x = 127 ,y = 127 ,rot = 127 ;
static char manu_direction = 0x01;
static int co = 0;
for (int i = len;i;i--){
buff[co] = Serial1.read();
if(buff[co] == '\n') {
manu_direction = buff[co-4];
x = buff[co-3];
y = buff[co-2];
rot = buff[co-1];
for (int j = co;j;j--){
buff[j] = 0;
}
co=0;
}else;
co++;
if (co > 9){
for (int j = 0;j <= 9;j++){
buff[j] = 0;
}
co=0;
}else;
}
if (x == 1) x = 0;
if (y == 1) y = 0;
if (rot == 1) rot = 0;
Px = x;
Py = y;
Prot = rot;
Pdire = manu_direction;
odometry();
manual (Pdire,Px,Py,Prot);
}
void odometry(){
unsigned short int rawcount1 = MTU1.TCNT;
static unsigned short int pre_rawcount1 = 0;
// 差分をインクリメントする
double Diff1 = -diff(rawcount1,pre_rawcount1);
//encount1 += Diff1;
pre_rawcount1 = rawcount1;
unsigned short int rawcount2 = MTU2.TCNT;
static unsigned short int pre_rawcount2 = 0;
// 差分をインクリメントする
double Diff2 = (double)(diff(rawcount2,pre_rawcount2));
//encount2 += Diff2;
pre_rawcount2 = rawcount2;
unsigned short int rawcount3 = TPU1.TCNT;
static unsigned short int pre_rawcount3 = 0;
// 差分をインクリメントする
double Diff3 = -diff(rawcount3,pre_rawcount3);
//encount3 += Diff3;
pre_rawcount3 = rawcount3;
double v_enc1 = (Diff1/RESOLUTION_X)*(DIAMETER*PI)/(INT_TIME*0.001);
double v_enc2 = (Diff2/RESOLUTION_Y)*(DIAMETER*PI)/(INT_TIME*0.001);
double v_enc3 = (Diff3/RESOLUTION_X)*(DIAMETER*PI)/(INT_TIME*0.001);
//local speed (mm/s)
double omega_e1 = v_enc1/W_DIS1;
double omega_e3 = v_enc3/W_DIS1;
spd_Lrot = (omega_e1/* + (v_enc2/W_DIS2) */+ omega_e3)*0.287;
spd_Ly = (v_enc1 - v_enc3)/2;
spd_Lx = (v_enc2 - spd_Lrot*W_DIS2);
deg += spd_Lrot;
double rad = deg/180*PI;
//grobal speed (mm/s)
double spd_Gx = spd_Ly*cos(rad) + spd_Lx*sin(rad);
double spd_Gy = spd_Ly*sin(rad) + spd_Lx*cos(rad);
double spd_Grot = spd_Lrot;
double del_x = spd_Lx*(INT_TIME*0.001);
double del_y = spd_Ly*(INT_TIME*0.001);
global_x += del_y;
global_y += del_x;
Ppdire = deg;
}
void Mecanum_command(double duty[4]){
MD.SpeedM1(ADR_MD1, (int)(duty[3])*M_CMD);
MD.SpeedM2(ADR_MD1, (int)(duty[2])*M_CMD);
MD.SpeedM1(ADR_MD2, (int)(duty[1])*M_CMD);
MD.SpeedM2(ADR_MD2, (int)(duty[0])*M_CMD);
}
void Mecanum_move(double add_direction, double add_speed, double revolution){
double duty[4];
duty[0] = (cos(add_direction) - sin(add_direction))*add_speed - revolution;//右前
duty[1] = (cos(add_direction) + sin(add_direction))*add_speed + revolution;//左前
duty[2] = (cos(add_direction) + sin(add_direction))*add_speed - revolution;//右後
duty[3] = (cos(add_direction) - sin(add_direction))*add_speed + revolution;//左後
/*Ppx = duty[0]*M_CMD;
Ppy = duty[1]*M_CMD;
Pprot = duty[2]*M_CMD;
Ppdire = duty[3]*M_CMD;*/
Mecanum_command(duty);
}
double limitAD(double crr, double prev, double tick){ //加減速制限
if(crr > prev + LIMITER_ACCEL * tick) { return prev + LIMITER_ACCEL * tick; }
if(crr < prev - LIMITER_DECCEL * tick) { return prev - LIMITER_DECCEL * tick; }
return crr;
}
double limitR(double crr, double prev, double tick){ //加減速制限
if(crr > prev + LIMITER_ROT * tick) { return prev + LIMITER_ROT * tick; }
if(crr < prev - LIMITER_DEROT * tick) { return prev - LIMITER_DEROT * tick; }
return crr;
}
void manual (int manu_direction,double x, double y, double rot){
if (manu_direction == 1) {
x = -x +127;
y = -y +127;
}
else {
x -=127;
y -=127;
}
rot -= 127;
//rot = -rot;
static double add_x = 0.0, add_y = 0.0, add_srot = 0.0;
static double prevX = 0, prevY = 0,preR = 0;
x = limitAD(x*1000/127, prevX, INT_TIME*0.001);
y = limitAD(y*1000/127*-1, prevY, INT_TIME*0.001);
rot = limitR(rot*4, preR, INT_TIME*0.001);
double qpps_x = spd_Lx/(100.0*PI)*(4.0*48.0)/M_CMD;
double qpps_y = spd_Ly/(100.0*PI)*(4.0*48.0)/M_CMD;
add_x += spdx_pid.con(x-qpps_x);
add_y += spdy_pid.con(y-qpps_y);
int L_rot = spd_Lrot*300;
add_srot += srot_pid.con(rot-L_rot);
double sam_limit;
add_x = spdx_pid.limit(add_x,abs(add_x)+200);
add_y = spdy_pid.limit(add_y,S_LIMIT);
Ppsrot = srot_pid.limit(add_srot,R_LIMIT);
if(x == 0 && qpps_x == 0.0) {
add_x = 0;
}
if(y == 0 && qpps_y == 0) {
add_y = 0;
}
if(rot == 0 && spd_Lrot == 0) {
Ppsrot = 0;
add_srot = 0;
}
double add_speed = hypot( add_x, add_y);
double add_direction = atan2( add_x, add_y);
Mecanum_move(add_direction,add_speed,Ppsrot);
prevX = x;
prevY = y;
preR = rot;
Ppx = x;
Ppy = y;
Ppadd = qpps_y;
Ppspd = add_y;
}
void newton(){
int count_newton = 0;
do {
t_be = pre_t_be - func(phase, pre_t_be)/dfunc(phase, pre_t_be);
epsilon = abs((t_be - pre_t_be)/pre_t_be);
//if(t_be < 0) t_be = 0.0;
//else if(t_be > 1.0) t_be = 1.0;
pre_t_be = t_be;
count_newton++;
}while(epsilon >= 1e-4 || count_newton <= 50);
}
void loop() {
//Serial.print(Ppx);
//Serial.print("\t");
Serial.print(Ppy);
Serial.print("\t");
/*Serial.print(Pprot);
Serial.print("\t");*/
//Serial.print(Ppdire);
//Serial.print("\t");
//Serial.print(Ppqpps);
//Serial.print("\t");
Serial.print(Ppadd);
Serial.print("\t");
Serial.print(Ppspd);
Serial.print("\n");
delay(150);
}
| [
"e5118108f2@edu.teu.ac.jp"
] | e5118108f2@edu.teu.ac.jp |
6b9c3b062f0abc7d26c4db73d1edbdb01341f184 | 93e82811be1b7a7426f07c8533dd8345eb271b27 | /pub_sub/server/server/main.cpp | 1a1611f60b24699caf80661a5f192e8d75e0d96f | [] | no_license | andreyvatoropinit/zmq-req-rep-and-pub-sub | a88ec951c9b8a53315a138023f324d8fb1b5c60d | 8bea0634e5cc573e22175e6f4aef3ab790a499a2 | refs/heads/master | 2022-11-18T14:23:41.600463 | 2020-07-10T11:18:29 | 2020-07-10T11:18:29 | 278,614,563 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,195 | cpp | #include <zmq.h>
#include <qstring.h>
#include <assert.h>
#include <qdebug.h>
#include <QFile>
#include <unistd.h>
static char address_subscriber [] = "tcp://localhost:5556";
static int const size_of_data_from_client = 60;
static char socket_proxy [] = "tcp://*:5555";
static const QStringList data_pattern_which_need_subscriber = { "222", "444"};
enum GET_SEND_DATA
{
proxy_send_data,
proxy_get_data
};
void SaveDataToLogFile (QString string_buffer, int send_get_data)
{
QFile log_file ("log_proxy");
log_file.open(QIODevice::Append);
QString string_for_write_in_log_file {};
if (send_get_data == proxy_get_data)
string_for_write_in_log_file = "Proxy get data from publisher \n" + string_buffer;
if (send_get_data == proxy_send_data)
string_for_write_in_log_file = "Proxy send data to subscriber \n" + string_buffer;
QByteArray ba = string_for_write_in_log_file.toLocal8Bit(); // write to file
ba.append("\n");ba.append("\n");
log_file.write(ba); log_file.close();
}
void SendDataToSubscriber (QString string_buffer)
{
// prepare data for char array
QByteArray ba = string_buffer.toLocal8Bit();
char buffer_for_subscriber [string_buffer.length()];
for (int i = 0; i < string_buffer.length();i++)
buffer_for_subscriber[i] = ba[i];
void *context = zmq_ctx_new ();
void *requester = zmq_socket (context, ZMQ_REQ);
qDebug () << "Data from server to subscriber:";
zmq_connect (requester, address_subscriber);
qDebug () << string_buffer;
qDebug () << "";
zmq_send (requester, buffer_for_subscriber, sizeof (buffer_for_subscriber), 0);
zmq_close (requester);
zmq_ctx_destroy (context);
}
bool ProcessDataFromPublisher (QString string_buffer)
{
if (string_buffer.length() != 0)
{
qDebug () << "Get data from publisher to server:";
qDebug () << string_buffer;
}
for (int i = 0; i < data_pattern_which_need_subscriber.length(); i++)
{
if (string_buffer.contains(data_pattern_which_need_subscriber[i]))
{
return true; // if subscriber need data - return true
}
}
return false;
}
int main (void)
{
void *context = zmq_ctx_new ();
void *responder = zmq_socket (context, ZMQ_REP);
int rc = zmq_bind (responder, socket_proxy );
assert (rc == 0);
printf ("Server started\n");
while (true)
{
sleep (1);
char buffer [size_of_data_from_client]; memset(buffer,0,size_of_data_from_client);
zmq_recv (responder, buffer, size_of_data_from_client, 0);
QString string_buffer (buffer);
bool get_data_for_subscriber = ProcessDataFromPublisher (string_buffer);
if (get_data_for_subscriber == false) // if data no valid for subscriber - exit
{
zmq_send (responder, "0", 1, 0); // send answer one byte
continue;
}
else // if data valid save to log and send to subscriber
{
SaveDataToLogFile (string_buffer, proxy_get_data);
SendDataToSubscriber (string_buffer);
SaveDataToLogFile (string_buffer, proxy_send_data);
}
}
return 0;
}
| [
"andrey.vatoropin.it@gmail.com"
] | andrey.vatoropin.it@gmail.com |
9a086eefa4d2f121dc48914f37d5d2ed1f10dacd | 08c14b4962a96c1994f10ae9b2d2dbdbf16c9d34 | /src/main.cpp | 02057c1e9e868340497bf1d42c5463749a56f14c | [] | no_license | Dfuz/QAgent | a03746ba0526be9757dbe34c994d5cab3b76c8a1 | f3cea3f013262795f22e7bf0bd1173cd1918b59e | refs/heads/main | 2023-04-21T02:15:57.676765 | 2021-05-02T19:03:48 | 2021-05-02T19:03:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 847 | cpp | #include <QCommandLineParser>
#include <QCoreApplication>
#include "qagent.h"
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QCoreApplication::setApplicationName("QAgent");
QCoreApplication::setApplicationVersion("1.0");
QCommandLineParser parser;
parser.setApplicationDescription("Test helper");
parser.addHelpOption();
parser.addVersionOption();
parser.addOption({{"n", "name"}, "Set custom hostname", "value"});
parser.addOption({{"c", "config"}, "Set config file", "value"});
parser.process(app);
QAgent agent;
if (parser.value("config").isEmpty())
agent.readConfig();
else agent.readConfig(parser.value("config"));
if (!parser.value("name").isEmpty())
agent.setHostName(parser.value("name"));
agent.startAgent();
return app.exec();
}
| [
"vadimperfilev@gmail.com"
] | vadimperfilev@gmail.com |
53e897801c7b352eaa46ddc52f9c3940588ecba8 | 52ca17dca8c628bbabb0f04504332c8fdac8e7ea | /boost/interprocess/detail/config_end.hpp | f2b90d804071f5b2f841d4105971d81d37143b05 | [] | no_license | qinzuoyan/thirdparty | f610d43fe57133c832579e65ca46e71f1454f5c4 | bba9e68347ad0dbffb6fa350948672babc0fcb50 | refs/heads/master | 2021-01-16T17:47:57.121882 | 2015-04-21T06:59:19 | 2015-04-21T06:59:19 | 33,612,579 | 0 | 0 | null | 2015-04-08T14:39:51 | 2015-04-08T14:39:51 | null | UTF-8 | C++ | false | false | 76 | hpp | #include "thirdparty/boost_1_58_0/boost/interprocess/detail/config_end.hpp"
| [
"qinzuoyan@xiaomi.com"
] | qinzuoyan@xiaomi.com |
f7b7b4405ecffa1b4c80d3795034251d0744edf9 | 92a9f837503a591161330d39d061ce290c996f0e | /SiNDY-u/CheckRelPointPolygon/stdafx.h | b7858751b34b7994ef452715f2573dfe26a6cd5b | [] | no_license | AntLJ/TestUploadFolder | 53a7dae537071d2b1e3bab55e925c8782f3daa0f | 31f9837abbd6968fc3a0be7610560370c4431217 | refs/heads/master | 2020-12-15T21:56:47.756829 | 2020-01-23T07:33:23 | 2020-01-23T07:33:23 | 235,260,509 | 1 | 1 | null | null | null | null | SHIFT_JIS | C++ | false | false | 1,749 | h | /*
* Copyright (C) INCREMENT P CORP. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY INCREMENT P CORP., WITHOUT WARRANTY OF
* ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NONINFRINGEMENT.
*
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDER BE LIABLE FOR ANY
* CLAIM, DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
*/
// stdafx.h : 標準のシステム インクルード ファイルのインクルード ファイル、または
// 参照回数が多く、かつあまり変更されない、プロジェクト専用のインクルード ファイル
// を記述します。
//
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <stdlib.h>
#include <tchar.h>
#include <atlbase.h>
#include <atlstr.h>
#include <assert.h>
#include <TDC/useful_headers/tstring.h>
#include <vector>
#include <list>
#include <map>
#include <string>
#include <assert.h>
#include <iostream>
#include <fstream>
#define _USE_SINDYLIB_STATIC
#include <libarchelper.h>
#include <coord_converter.h>
#include <libwinlib.h>
#include <libschema.h>
#pragma warning(push)
#pragma warning(disable: 4192)
#pragma warning(disable: 4278)
#include <WinLib/arcobjects_import_highmethod.h>
#import "tlb/sindyeCore.tlb" raw_interfaces_only raw_native_types no_namespace named_guids exclude("OLE_COLOR", "OLE_HANDLE", "ICursorPtr", "VARTYPE")exclude("sindyeDispNaviRelation", "sindyeDispOtherRelation", "sindyeEditType", "sindyeEditableType", "sindyeWorkKind") rename("IRow", "_IRow") rename("ICursor", "_ICursor")
#pragma warning(pop)
| [
"noreply@github.com"
] | noreply@github.com |
2d7d7e7db7387e2ed11215793db2da8808a3327b | 86609148aee683f1a2f92f9ab5c073b4c29380e4 | /utils/dnp3_src/cpp/libs/include/opendnp3/app/parsing/ICollection.h | 12b0d8e9e779927a2cd47b6b393ca53f7ccb5bd3 | [
"Apache-2.0"
] | permissive | thiagoralves/OpenPLC_v3 | 16ba73585ab6b4aff7fb3e0f6388cf31f7aa2fce | cf139121bc15cb960a8fad62c02f34532b36a7c7 | refs/heads/master | 2023-08-07T06:55:19.533734 | 2023-07-19T15:33:35 | 2023-07-19T15:33:35 | 137,387,519 | 817 | 370 | null | 2023-09-14T03:09:01 | 2018-06-14T17:15:49 | C++ | UTF-8 | C++ | false | false | 2,463 | h | /*
* Licensed to Green Energy Corp (www.greenenergycorp.com) under one or
* more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
* Green Energy Corp 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.
*
* This project was forked on 01/01/2013 by Automatak, LLC and modifications
* may have been made to this file. Automatak, LLC licenses these modifications
* to you under the terms of the License.
*/
#ifndef OPENDNP3_ICOLLECTION_H
#define OPENDNP3_ICOLLECTION_H
#include <cstddef>
namespace opendnp3
{
/**
* Abstract way of visiting elements of a collection
*
*/
template <class T>
class IVisitor
{
public:
virtual void OnValue(const T& value) = 0;
};
/**
* A visitor implemented as an abstract functor
*
*/
template <class T, class Fun>
class FunctorVisitor : public IVisitor<T>
{
public:
FunctorVisitor(const Fun& fun_) : fun(fun_) {}
virtual void OnValue(const T& value) override final
{
fun(value);
}
private:
Fun fun;
};
/**
* An interface representing an abstract immutable collection of things of type T.
*
* The user can only read these values via callback to receive each element.
*/
template <class T>
class ICollection
{
public:
/**
* The number of elements in the collection
*/
virtual size_t Count() const = 0;
/**
* Visit all the elements of a collection
*/
virtual void Foreach(IVisitor<T>& visitor) const = 0;
/**
visit all of the elements of a collection
*/
template <class Fun>
void ForeachItem(const Fun& fun) const
{
FunctorVisitor<T, Fun> visitor(fun);
this->Foreach(visitor);
}
/**
Retrieve the only value from the collection.
*/
bool ReadOnlyValue(T& value) const
{
if (this->Count() == 1)
{
auto assignValue = [&value](const T & item)
{
value = item;
};
this->ForeachItem(assignValue);
return true;
}
else
{
return false;
}
}
};
}
#endif
| [
"thiagoralves@gmail.com"
] | thiagoralves@gmail.com |
522364efb5e8dbac2d720b8641cb7ce15df759bd | ef16cc4c8052cb0021b18503c1c03b360aca379e | /led.ino | 43488b5003ac7fe2c9fa8fd0efc8609bc9a81841 | [] | no_license | Naiph/Arduino | 3608ecafbeec3025bb8f5cf34306f44bf89074f2 | 53a5573160461e8d0f074daec8759140d8b292fe | refs/heads/master | 2020-04-13T23:59:51.892037 | 2019-01-19T19:40:17 | 2019-01-19T19:40:17 | 163,521,745 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 318 | ino | int ledPin1 = 8;
int ledPin2 = 9;
void setup() {
// put your setup code here, to run once:
pinMode(ledPin1,OUTPUT);
pinMode(ledPin2,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(ledPin2,HIGH);
delay(1000);
digitalWrite(ledPin1, LOW);
delay(1000);
}
| [
"noreply@github.com"
] | noreply@github.com |
2b05fba6a8ea454be765f823c03b6825f8e64041 | 0bf6a7dfaff8585989e14e7b6983f9f851cdeb2d | /firmware/src/DataSource/Stick/StickLoose.cpp | 87179eef2f49f9da8ddf13f4319654335f602bbc | [] | no_license | BenjiHansell/Radio-Controller | 176ee6102e8d05469ecb73297faa4d44786911c9 | 2deb02a5f3bf996a787899c9dca5275d997a9cab | refs/heads/master | 2021-05-16T11:57:37.732675 | 2017-09-28T16:46:50 | 2017-09-28T16:46:50 | 105,136,469 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 774 | cpp | #include "StickLoose.hpp"
#include <Arduino.h>
#include "num_to_str.hpp"
StickLoose::StickLoose(uint8_t _pin, const char _name[3], bool _reverse, uint8_t _margin) :
Stick(_pin, _name, _reverse, _margin)
{
}
const char* StickLoose::get_data(char* const output){
auto val = read()/10;
if(val != 100){
output[0] = unit_to_char(val/10);
output[1] = unit_to_char(val%10);
}else{
output[0] = 'X';
output[1] = 'X';
}
output[2] = '\0';
// previous_raw = raw;
return output;
}
uint_fast16_t StickLoose::read() {
do_a_read_maybe();
int32_t output = (int32_t)(raw - min) * (1000 + 2 * (margin)) / (max - min) - (margin);
if (output < 0) output = 0;
if (output > 1000) output = 1000;
//return raw; // test
return output;
}
| [
"noreply@github.com"
] | noreply@github.com |
9501d09c85e73bd70f4e72f26f6a21d209d045f6 | 2af943fbfff74744b29e4a899a6e62e19dc63256 | /OpenIGTLink2_beta/Examples/TrackingData/TrackingDataServer.cxx | 89ce741ce38dedfb1db2e0879171f615d74e53dd | [
"BSD-3-Clause"
] | permissive | lheckemann/namic-sandbox | c308ec3ebb80021020f98cf06ee4c3e62f125ad9 | 0c7307061f58c9d915ae678b7a453876466d8bf8 | refs/heads/master | 2021-08-24T12:40:01.331229 | 2014-02-07T21:59:29 | 2014-02-07T21:59:29 | 113,701,721 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 9,258 | cxx | /*=========================================================================
Program: Open IGT Link -- Example for Tracking Data Server
Module: $RCSfile: $
Language: C++
Date: $Date: $
Version: $Revision: $
Copyright (c) Insight Software Consortium. All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include <iostream>
#include <math.h>
#include <cstdlib>
#include <cstring>
#include "igtlOSUtil.h"
#include "igtlMessageHeader.h"
#include "igtlImageMessage.h"
#include "igtlServerSocket.h"
#include "igtlTrackingDataMessage.h"
#include "igtlMultiThreader.h"
void* ThreadFunction(void* ptr);
int SendTrackingData(igtl::Socket::Pointer& socket, igtl::TrackingDataMessage::Pointer& trackingMsg);
void GetRandomTestMatrix(igtl::Matrix4x4& matrix, float phi, float theta);
typedef struct {
int nloop;
igtl::MutexLock::Pointer glock;
igtl::Socket::Pointer socket;
int interval;
int stop;
} ThreadData;
int main(int argc, char* argv[])
{
//------------------------------------------------------------
// Parse Arguments
if (argc != 2) // check number of arguments
{
// If not correct, print usage
std::cerr << "Usage: " << argv[0] << " <port>" << std::endl;
std::cerr << " <port> : Port # (18944 in Slicer default)" << std::endl;
exit(0);
}
int port = atoi(argv[1]);
igtl::ServerSocket::Pointer serverSocket;
serverSocket = igtl::ServerSocket::New();
int r = serverSocket->CreateServer(port);
if (r < 0)
{
std::cerr << "Cannot create a server socket." << std::endl;
exit(0);
}
igtl::MultiThreader::Pointer threader = igtl::MultiThreader::New();
igtl::MutexLock::Pointer glock = igtl::MutexLock::New();
ThreadData td;
while (1)
{
//------------------------------------------------------------
// Waiting for Connection
int threadID = -1;
igtl::Socket::Pointer socket;
socket = serverSocket->WaitForConnection(1000);
if (socket.IsNotNull()) // if client connected
{
std::cerr << "A client is connected." << std::endl;
// Create a message buffer to receive header
igtl::MessageHeader::Pointer headerMsg;
headerMsg = igtl::MessageHeader::New();
//------------------------------------------------------------
// loop
for (;;)
{
// Initialize receive buffer
headerMsg->InitPack();
// Receive generic header from the socket
int rs = socket->Receive(headerMsg->GetPackPointer(), headerMsg->GetPackSize());
if (rs == 0)
{
if (threadID >= 0)
{
td.stop = 1;
threader->TerminateThread(threadID);
threadID = -1;
}
std::cerr << "Disconnecting the client." << std::endl;
td.socket = NULL; // VERY IMPORTANT. Completely remove the instance.
socket->CloseSocket();
break;
}
if (rs != headerMsg->GetPackSize())
{
continue;
}
// Deserialize the header
headerMsg->Unpack();
// Check data type and receive data body
if (strcmp(headerMsg->GetDeviceType(), "STT_TDATA") == 0)
{
std::cerr << "Received a STT_TDATA message." << std::endl;
igtl::StartTrackingDataMessage::Pointer startTracking;
startTracking = igtl::StartTrackingDataMessage::New();
startTracking->SetMessageHeader(headerMsg);
startTracking->AllocatePack();
int r2 = socket->Receive(startTracking->GetPackBodyPointer(), startTracking->GetPackBodySize());
int c = startTracking->Unpack(1);
if (c & igtl::MessageHeader::UNPACK_BODY) // if CRC check is OK
{
td.interval = startTracking->GetResolution();
td.glock = glock;
td.socket = socket;
td.stop = 0;
threadID = threader->SpawnThread((igtl::ThreadFunctionType) &ThreadFunction, &td);
}
}
else if (strcmp(headerMsg->GetDeviceType(), "STP_TDATA") == 0)
{
socket->Skip(headerMsg->GetBodySizeToRead(), 0);
std::cerr << "Received a STP_TDATA message." << std::endl;
if (threadID >= 0)
{
td.stop = 1;
threader->TerminateThread(threadID);
threadID = -1;
std::cerr << "Disconnecting the client." << std::endl;
td.socket = NULL; // VERY IMPORTANT. Completely remove the instance.
socket->CloseSocket();
}
break;
}
else
{
std::cerr << "Receiving : " << headerMsg->GetDeviceType() << std::endl;
socket->Skip(headerMsg->GetBodySizeToRead(), 0);
}
}
}
}
//------------------------------------------------------------
// Close connection (The example code never reaches to this section ...)
serverSocket->CloseSocket();
}
void* ThreadFunction(void* ptr)
{
//------------------------------------------------------------
// Get thread information
igtl::MultiThreader::ThreadInfo* info =
static_cast<igtl::MultiThreader::ThreadInfo*>(ptr);
//int id = info->ThreadID;
//int nThread = info->NumberOfThreads;
ThreadData* td = static_cast<ThreadData*>(info->UserData);
//------------------------------------------------------------
// Get user data
igtl::MutexLock::Pointer glock = td->glock;
long interval = td->interval;
std::cerr << "Interval = " << interval << " (ms)" << std::endl;
//long interval = 1000;
//long interval = (id + 1) * 100; // (ms)
igtl::Socket::Pointer& socket = td->socket;
//------------------------------------------------------------
// Allocate TrackingData Message Class
//
// NOTE: TrackingDataElement class instances are allocated
// before the loop starts to avoid reallocation
// in each image transfer.
igtl::TrackingDataMessage::Pointer trackingMsg;
trackingMsg = igtl::TrackingDataMessage::New();
trackingMsg->SetDeviceName("Tracker");
igtl::TrackingDataElement::Pointer trackElement0;
trackElement0 = igtl::TrackingDataElement::New();
trackElement0->SetName("Channel 0");
trackElement0->SetType(igtl::TrackingDataElement::TYPE_TRACKER);
igtl::TrackingDataElement::Pointer trackElement1;
trackElement1 = igtl::TrackingDataElement::New();
trackElement1->SetName("Channel 1");
trackElement1->SetType(igtl::TrackingDataElement::TYPE_6D);
igtl::TrackingDataElement::Pointer trackElement2;
trackElement2 = igtl::TrackingDataElement::New();
trackElement2->SetName("Channel 2");
trackElement2->SetType(igtl::TrackingDataElement::TYPE_5D);
trackingMsg->AddTrackingDataElement(trackElement0);
trackingMsg->AddTrackingDataElement(trackElement1);
trackingMsg->AddTrackingDataElement(trackElement2);
//------------------------------------------------------------
// Loop
while (!td->stop)
{
glock->Lock();
SendTrackingData(socket, trackingMsg);
glock->Unlock();
igtl::Sleep(interval);
}
//glock->Lock();
//std::cerr << "Thread #" << id << ": end." << std::endl;
//glock->Unlock();
return NULL;
}
int SendTrackingData(igtl::Socket::Pointer& socket, igtl::TrackingDataMessage::Pointer& trackingMsg)
{
static float phi0 = 0.0;
static float theta0 = 0.0;
static float phi1 = 0.0;
static float theta1 = 0.0;
static float phi2 = 0.0;
static float theta2 = 0.0;
igtl::Matrix4x4 matrix;
igtl::TrackingDataElement::Pointer ptr;
// Channel 0
trackingMsg->GetTrackingDataElement(0, ptr);
GetRandomTestMatrix(matrix, phi0, theta0);
ptr->SetMatrix(matrix);
// Channel 1
trackingMsg->GetTrackingDataElement(1, ptr);
GetRandomTestMatrix(matrix, phi1, theta1);
ptr->SetMatrix(matrix);
// Channel 2
trackingMsg->GetTrackingDataElement(2, ptr);
GetRandomTestMatrix(matrix, phi2, theta2);
ptr->SetMatrix(matrix);
trackingMsg->Pack();
socket->Send(trackingMsg->GetPackPointer(), trackingMsg->GetPackSize());
phi0 += 0.1;
phi1 += 0.2;
phi2 += 0.3;
theta0 += 0.2;
theta1 += 0.1;
theta2 += 0.05;
return 0;
}
//------------------------------------------------------------
// Function to generate random matrix.
void GetRandomTestMatrix(igtl::Matrix4x4& matrix, float phi, float theta)
{
float position[3];
float orientation[4];
// random position
position[0] = 50.0 * cos(phi);
position[1] = 50.0 * sin(phi);
position[2] = 50.0 * cos(phi);
phi = phi + 0.2;
// random orientation
orientation[0]=0.0;
orientation[1]=0.6666666666*cos(theta);
orientation[2]=0.577350269189626;
orientation[3]=0.6666666666*sin(theta);
theta = theta + 0.1;
//igtl::Matrix4x4 matrix;
igtl::QuaternionToMatrix(orientation, matrix);
matrix[0][3] = position[0];
matrix[1][3] = position[1];
matrix[2][3] = position[2];
//igtl::PrintMatrix(matrix);
}
| [
"tokuda@5e132c66-7cf4-0310-b4ca-cd4a7079c2d8"
] | tokuda@5e132c66-7cf4-0310-b4ca-cd4a7079c2d8 |
1502651871c2b1e55aa9ef21f6ffb835d10dcca3 | e1def3560179a608a1575001ebecb453f600cd81 | /src/core/GLBitmapFactory.cpp | 19ce36621b3d7b9cfedc13c31a0a0e1991d34742 | [
"Apache-2.0"
] | permissive | shirazi/Simple3D | dea760b3056fe262b09b7db067bcd6906289c4fc | 094243540dfb3a18f6449c309f510d5edd08e500 | refs/heads/master | 2021-06-09T20:10:37.904315 | 2017-01-14T12:25:39 | 2017-01-14T12:25:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,846 | cpp | #include "core/GLBitmapFactory.h"
#ifndef GL_BUILD_FOR_ANDROID
#include "../third_party/FreeImage/Source/FreeImage.h"
#include <string.h>
static GLBmp* _convert(FIBITMAP* mBitmap)
{
auto w = FreeImage_GetWidth(mBitmap);
auto h = FreeImage_GetHeight(mBitmap);
GLBmp* result = new GLBmp(w, h);
for (int y=0; y<h; ++y)
{
auto src = FreeImage_GetScanLine(mBitmap, y);
auto dst = result->getAddr(0, y);
::memcpy(dst, src, w*4*sizeof(char));
}
return result;
}
static FIBITMAP* _convertR(const GLBmp* srcs)
{
auto w = srcs->width();
auto h = srcs->height();
auto mBitmap = FreeImage_Allocate(w, h, 32);
for (int y=0; y<h; ++y)
{
auto src = srcs->getAddr(0, y);
auto dst = FreeImage_GetScanLine(mBitmap, y);
::memcpy(dst, src, w*4*sizeof(char));
}
return mBitmap;
}
GLBmp* GLBitmapFactory::create(const char* pic)
{
FREE_IMAGE_FORMAT f = FreeImage_GetFileType(pic);
FIBITMAP* bitmap = FreeImage_Load(f, pic);
auto mBitmap = FreeImage_ConvertTo32Bits(bitmap);
FreeImage_Unload(bitmap);
auto result = _convert(mBitmap);
FreeImage_Unload(mBitmap);
return result;
}
GLBmp* create(unsigned char* data, int length)
{
FIMEMORY* memory = FreeImage_OpenMemory(data, length);
FREE_IMAGE_FORMAT f = FreeImage_GetFileTypeFromMemory(memory, length);
FIBITMAP* bitmap = FreeImage_LoadFromMemory(f, memory);
FreeImage_CloseMemory(memory);
auto mBitmap = FreeImage_ConvertTo32Bits(bitmap);
FreeImage_Unload(bitmap);
auto result = _convert(mBitmap);
FreeImage_Unload(mBitmap);
return result;
}
void GLBitmapFactory::dump(const GLBmp* bmp, const char* filename)
{
auto bitmap = _convertR(bmp);
FreeImage_Save(FIF_PNG, bitmap, filename, PNG_DEFAULT);
FreeImage_Unload(bitmap);
}
#endif
| [
"xiaotang@in66.com"
] | xiaotang@in66.com |
f911a5488776bba65ebb4033a7d220ec7cb28d22 | 55051debe2501e952898e651f908f93dc9c24384 | /matrixTransformation.cpp | 7ed11c505cfb16071479b2a5e8af3215c79bd3e8 | [
"MIT"
] | permissive | radoth/encoder | a9c7139c71f1da2f5ba614122a08edf9b875f2c4 | 4d9e0ff2782130d925ce1af5d8f604e5b31305e0 | refs/heads/master | 2022-08-20T17:53:30.151450 | 2020-05-30T17:00:08 | 2020-05-30T17:00:08 | 258,678,076 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,651 | cpp | /*前向/逆变换*/
#include "timeSettings.h"
#include <cstdio>
#include <cmath>
#include "commonData.h"
static void processPrediction(unsigned char *pred,unsigned char *cur,int lx,short *blk)
{
int i, j;
for (j=0; j<8; j++)
{
for (i=0; i<8; i++)
cur[i] = clp[blk[i] + pred[i]];
blk+= 8;
cur+= lx;
pred+= lx;
}
}
static void restorePrediction(unsigned char *pred,unsigned char *cur,int lx,short *blk)
{
int i, j;
for (j=0; j<8; j++)
{
for (i=0; i<8; i++)
blk[i] = cur[i] - pred[i];
blk+= 8;
cur+= lx;
pred+= lx;
}
}
void matrixTransform(unsigned char *pred[],unsigned char *cur[],struct MacroBlockInfo *mbi,short blocks[][64])
{
int i, j, i1, j1, k, n, cc, offs, lx;
k = 0;
for (j=0; j<pictureHeight; j+=16)
for (i=0; i<width; i+=16)
{
for (n=0; n<blockCount; n++)
{
cc = (n<4) ? 0 : (n&1)+1;
if (cc==0)
{
if ((pictStruct==FRAME_PICTURE) && mbi[k].DCTType)
{
offs = i + ((n&1)<<3) + width*(j+((n&2)>>1));
lx = width<<1;
}
else
{
offs = i + ((n&1)<<3) + pictureWidth*(j+((n&2)<<2));
lx = pictureWidth;
}
if (pictStruct==BOTTOM_FIELD)
offs += width;
}
else
{
i1 = (chromaFormat==CHROMA444) ? i : i>>1;
j1 = (chromaFormat!=CHROMA420) ? j : j>>1;
if ((pictStruct==FRAME_PICTURE) && mbi[k].DCTType
&& (chromaFormat!=CHROMA420))
{
offs = i1 + (n&8) + chromWidth*(j1+((n&2)>>1));
lx = chromWidth<<1;
}
else
{
offs = i1 + (n&8) + chromWidth2*(j1+((n&2)<<2));
lx = chromWidth2;
}
if (pictStruct==BOTTOM_FIELD)
offs += chromWidth;
}
restorePrediction(pred[cc]+offs,cur[cc]+offs,lx,blocks[k*blockCount+n]);
fDCTCalc(blocks[k*blockCount+n]);
}
k++;
}
}
void matrixInverseTransform(unsigned char *pred[],unsigned char *cur[],struct MacroBlockInfo *mbi,short blocks[][64])
{
int i, j, i1, j1, k, n, cc, offs, lx;
k = 0;
for (j=0; j<pictureHeight; j+=16)
for (i=0; i<width; i+=16)
{
for (n=0; n<blockCount; n++)
{
cc = (n<4) ? 0 : (n&1)+1;
if (cc==0)
{
if ((pictStruct==FRAME_PICTURE) && mbi[k].DCTType)
{
offs = i + ((n&1)<<3) + width*(j+((n&2)>>1));
lx = width<<1;
}
else
{
offs = i + ((n&1)<<3) + pictureWidth*(j+((n&2)<<2));
lx = pictureWidth;
}
if (pictStruct==BOTTOM_FIELD)
offs += width;
}
else
{
i1 = (chromaFormat==CHROMA444) ? i : i>>1;
j1 = (chromaFormat!=CHROMA420) ? j : j>>1;
if ((pictStruct==FRAME_PICTURE) && mbi[k].DCTType
&& (chromaFormat!=CHROMA420))
{
offs = i1 + (n&8) + chromWidth*(j1+((n&2)>>1));
lx = chromWidth<<1;
}
else
{
offs = i1 + (n&8) + chromWidth2*(j1+((n&2)<<2));
lx = chromWidth2;
}
if (pictStruct==BOTTOM_FIELD)
offs += chromWidth;
}
idct(blocks[k*blockCount+n]);
processPrediction(pred[cc]+offs,cur[cc]+offs,lx,blocks[k*blockCount+n]);
}
k++;
}
}
void chooseDCT(unsigned char *pred,unsigned char *cur,struct MacroBlockInfo *mbi)
{
short blk0[128], blk1[128];
int i, j, i0, j0, k, offs, s0, s1, sq0, sq1, s01;
double d, r;
k = 0;
for (j0=0; j0<pictureHeight; j0+=16)
for (i0=0; i0<width; i0+=16)
{
if (framePredDct || pictStruct!=FRAME_PICTURE)
mbi[k].DCTType = 0;
else
{
for (j=0; j<8; j++)
{
offs = width*((j<<1)+j0) + i0;
for (i=0; i<16; i++)
{
blk0[16*j+i] = cur[offs] - pred[offs];
blk1[16*j+i] = cur[offs+width] - pred[offs+width];
offs++;
}
}
s0=s1=sq0=sq1=s01=0;
for (i=0; i<128; i++)
{
s0+= blk0[i];
sq0+= blk0[i]*blk0[i];
s1+= blk1[i];
sq1+= blk1[i]*blk1[i];
s01+= blk0[i]*blk1[i];
}
d = (sq0-(s0*s0)/128.0)*(sq1-(s1*s1)/128.0);
if (d>0.0)
{
r = (s01-(s0*s1)/128.0)/sqrt(d);
if (r>0.5)
mbi[k].DCTType = 0;
else
mbi[k].DCTType = 1;
}
else
mbi[k].DCTType = 1;
}
k++;
}
}
| [
"58544593+radoth@users.noreply.github.com"
] | 58544593+radoth@users.noreply.github.com |
3aa57935508a570a6bc0a4b3ed4e4a5263d741e4 | 82d6bb940b4b664131bd89ef9ccd2e0738e0a059 | /AudioVolumeVisualizer/AudioVolumeVisualizer.ino | 0781898348bdfa26ca6f3b5e27d0071a056e529f | [
"Apache-2.0"
] | permissive | LoopedBard3/Arduino-Projects | 13870f07c337b8478e487936447f731a9567a09c | 4b67662834d6883976eefefc13c3a4a18f74ba33 | refs/heads/master | 2021-01-19T20:40:58.708068 | 2017-04-18T02:34:08 | 2017-04-18T02:34:08 | 88,532,620 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 965 | ino | #include "FastLED.h"
FASTLED_USING_NAMESPACE
#if FASTLED_VERSION < 3001000
#error "Requires FastLED 3.1 or later; check github for latest code."
#endif
#define DATA_PIN1 8
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
#define NUM_LEDS1 254
CRGB leds[NUM_LEDS1];
int ledsOn = 1;
int FPS = 300;
float vol = 0.0;
void setup() {
delay(3000);
Serial.begin(115200);
Serial.setTimeout(5000);
FastLED.addLeds<LED_TYPE, DATA_PIN1, COLOR_ORDER>(leds, NUM_LEDS1).setCorrection(TypicalLEDStrip);
Serial.println("Connection is found (Arduino)");
}
void loop() {
if (Serial.available() > 0){
ledsOn = (int) (Serial.parseInt());
Serial.println(ledsOn);
Serial.flush();
}
fadeToBlackBy(leds, NUM_LEDS1, 30);
fill_solid(leds, ledsOn, CRGB::Blue);
//FastLED.delay(1000/FPS);
FastLED.show();
}
| [
"pbibus@hotmail.com"
] | pbibus@hotmail.com |
6c4d0ee9d0b8534ab22c6cf1a45f0fc8bc9c4f43 | 59477c4ca0e2f90b4c393e68e466aa583854f543 | /MultiSensorBoard/APDS-9960/APDS-9960.ino | 9daea2c3db935893b417d43eceef064c8e6a95d5 | [] | no_license | samuelpratt/HardwareFun | b8e3183a749ddae74ee7cea37d4f7729e57adffd | cb3f99aef545b324b95589c7b77bf6da0e1089d5 | refs/heads/master | 2022-11-06T10:06:04.701970 | 2020-06-24T16:54:37 | 2020-06-24T16:54:37 | 262,291,752 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 583 | ino | #include <Arduino_APDS9960.h>
void setup() {
Serial.begin(9600);
while (!Serial);
if (!APDS.begin()) {
//This seems to always happen on my board!
Serial.println("Error initializing APDS9960 sensor!");
}
}
void loop() {
// check if a proximity reading is available
if (APDS.proximityAvailable()) {
// read the proximity
// - 0 => close
// - 255 => far
// - -1 => error
int proximity = APDS.readProximity();
// print value to the Serial Monitor
Serial.println(proximity);
}
// wait a bit before reading again
delay(100);
}
| [
"sampratt@SamPratt-MacBook-Pro.local"
] | sampratt@SamPratt-MacBook-Pro.local |
888c0eac6afb93eb135409fb3360b840b6ca77af | b8d16ef266b318097dde7f6e7d8721bb5d5407d5 | /winRTTutorial3/winRTTutorial3/Debug/Generated Files/winrt/Windows.Web.UI.h | b0d3b508d00a5db02e32857a4c75d271f83013e3 | [] | no_license | lisedspencer/windows-winRT-tutorial | 1c5e9123e0b1c9286d58c940a085ca6b95f501a8 | ea96ce3cb2c970a101d24da8c5de4583171a0db4 | refs/heads/main | 2023-07-31T21:35:11.030167 | 2021-09-20T01:08:18 | 2021-09-20T01:08:18 | 407,620,240 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 95,346 | h | // WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.210913.7
#pragma once
#ifndef WINRT_Windows_Web_UI_H
#define WINRT_Windows_Web_UI_H
#include "winrt/base.h"
static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.210913.7"), "Mismatched C++/WinRT headers.");
#define CPPWINRT_VERSION "2.0.210913.7"
#include "winrt/Windows.Web.h"
#include "winrt/impl/Windows.ApplicationModel.DataTransfer.2.h"
#include "winrt/impl/Windows.Foundation.2.h"
#include "winrt/impl/Windows.Foundation.Collections.2.h"
#include "winrt/impl/Windows.Storage.Streams.2.h"
#include "winrt/impl/Windows.UI.2.h"
#include "winrt/impl/Windows.Web.2.h"
#include "winrt/impl/Windows.Web.Http.2.h"
#include "winrt/impl/Windows.Web.UI.2.h"
namespace winrt::impl
{
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Uri) consume_Windows_Web_UI_IWebViewControl<D>::Source() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->get_Source(&value));
return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::Source(winrt::Windows::Foundation::Uri const& source) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->put_Source(*(void**)(&source)));
}
template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Web_UI_IWebViewControl<D>::DocumentTitle() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->get_DocumentTitle(&value));
return hstring{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(bool) consume_Windows_Web_UI_IWebViewControl<D>::CanGoBack() const
{
bool value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->get_CanGoBack(&value));
return value;
}
template <typename D> WINRT_IMPL_AUTO(bool) consume_Windows_Web_UI_IWebViewControl<D>::CanGoForward() const
{
bool value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->get_CanGoForward(&value));
return value;
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::DefaultBackgroundColor(winrt::Windows::UI::Color const& value) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->put_DefaultBackgroundColor(impl::bind_in(value)));
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::UI::Color) consume_Windows_Web_UI_IWebViewControl<D>::DefaultBackgroundColor() const
{
winrt::Windows::UI::Color value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->get_DefaultBackgroundColor(put_abi(value)));
return value;
}
template <typename D> WINRT_IMPL_AUTO(bool) consume_Windows_Web_UI_IWebViewControl<D>::ContainsFullScreenElement() const
{
bool value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->get_ContainsFullScreenElement(&value));
return value;
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Web::UI::WebViewControlSettings) consume_Windows_Web_UI_IWebViewControl<D>::Settings() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->get_Settings(&value));
return winrt::Windows::Web::UI::WebViewControlSettings{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Web::UI::WebViewControlDeferredPermissionRequest>) consume_Windows_Web_UI_IWebViewControl<D>::DeferredPermissionRequests() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->get_DeferredPermissionRequests(&value));
return winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Web::UI::WebViewControlDeferredPermissionRequest>{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::GoForward() const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->GoForward());
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::GoBack() const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->GoBack());
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::Refresh() const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->Refresh());
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::Stop() const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->Stop());
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::Navigate(winrt::Windows::Foundation::Uri const& source) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->Navigate(*(void**)(&source)));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::NavigateToString(param::hstring const& text) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->NavigateToString(*(void**)(&text)));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::NavigateToLocalStreamUri(winrt::Windows::Foundation::Uri const& source, winrt::Windows::Web::IUriToStreamResolver const& streamResolver) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->NavigateToLocalStreamUri(*(void**)(&source), *(void**)(&streamResolver)));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::NavigateWithHttpRequestMessage(winrt::Windows::Web::Http::HttpRequestMessage const& requestMessage) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->NavigateWithHttpRequestMessage(*(void**)(&requestMessage)));
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<hstring>) consume_Windows_Web_UI_IWebViewControl<D>::InvokeScriptAsync(param::hstring const& scriptName, param::async_iterable<hstring> const& arguments) const
{
void* operation{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->InvokeScriptAsync(*(void**)(&scriptName), *(void**)(&arguments), &operation));
return winrt::Windows::Foundation::IAsyncOperation<hstring>{ operation, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncAction) consume_Windows_Web_UI_IWebViewControl<D>::CapturePreviewToStreamAsync(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream) const
{
void* operation{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->CapturePreviewToStreamAsync(*(void**)(&stream), &operation));
return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::ApplicationModel::DataTransfer::DataPackage>) consume_Windows_Web_UI_IWebViewControl<D>::CaptureSelectedContentToDataPackageAsync() const
{
void* operation{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->CaptureSelectedContentToDataPackageAsync(&operation));
return winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::ApplicationModel::DataTransfer::DataPackage>{ operation, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Uri) consume_Windows_Web_UI_IWebViewControl<D>::BuildLocalStreamUri(param::hstring const& contentIdentifier, param::hstring const& relativePath) const
{
void* result{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->BuildLocalStreamUri(*(void**)(&contentIdentifier), *(void**)(&relativePath), &result));
return winrt::Windows::Foundation::Uri{ result, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::GetDeferredPermissionRequestById(uint32_t id, winrt::Windows::Web::UI::WebViewControlDeferredPermissionRequest& result) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->GetDeferredPermissionRequestById(id, impl::bind_out(result)));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::NavigationStarting(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNavigationStartingEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_NavigationStarting(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::NavigationStarting_revoker consume_Windows_Web_UI_IWebViewControl<D>::NavigationStarting(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNavigationStartingEventArgs> const& handler) const
{
return impl::make_event_revoker<D, NavigationStarting_revoker>(this, NavigationStarting(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::NavigationStarting(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_NavigationStarting(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::ContentLoading(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlContentLoadingEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_ContentLoading(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::ContentLoading_revoker consume_Windows_Web_UI_IWebViewControl<D>::ContentLoading(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlContentLoadingEventArgs> const& handler) const
{
return impl::make_event_revoker<D, ContentLoading_revoker>(this, ContentLoading(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::ContentLoading(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_ContentLoading(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::DOMContentLoaded(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlDOMContentLoadedEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_DOMContentLoaded(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::DOMContentLoaded_revoker consume_Windows_Web_UI_IWebViewControl<D>::DOMContentLoaded(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlDOMContentLoadedEventArgs> const& handler) const
{
return impl::make_event_revoker<D, DOMContentLoaded_revoker>(this, DOMContentLoaded(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::DOMContentLoaded(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_DOMContentLoaded(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::NavigationCompleted(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNavigationCompletedEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_NavigationCompleted(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::NavigationCompleted_revoker consume_Windows_Web_UI_IWebViewControl<D>::NavigationCompleted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNavigationCompletedEventArgs> const& handler) const
{
return impl::make_event_revoker<D, NavigationCompleted_revoker>(this, NavigationCompleted(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::NavigationCompleted(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_NavigationCompleted(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::FrameNavigationStarting(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNavigationStartingEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_FrameNavigationStarting(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::FrameNavigationStarting_revoker consume_Windows_Web_UI_IWebViewControl<D>::FrameNavigationStarting(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNavigationStartingEventArgs> const& handler) const
{
return impl::make_event_revoker<D, FrameNavigationStarting_revoker>(this, FrameNavigationStarting(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::FrameNavigationStarting(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_FrameNavigationStarting(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::FrameContentLoading(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlContentLoadingEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_FrameContentLoading(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::FrameContentLoading_revoker consume_Windows_Web_UI_IWebViewControl<D>::FrameContentLoading(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlContentLoadingEventArgs> const& handler) const
{
return impl::make_event_revoker<D, FrameContentLoading_revoker>(this, FrameContentLoading(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::FrameContentLoading(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_FrameContentLoading(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::FrameDOMContentLoaded(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlDOMContentLoadedEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_FrameDOMContentLoaded(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::FrameDOMContentLoaded_revoker consume_Windows_Web_UI_IWebViewControl<D>::FrameDOMContentLoaded(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlDOMContentLoadedEventArgs> const& handler) const
{
return impl::make_event_revoker<D, FrameDOMContentLoaded_revoker>(this, FrameDOMContentLoaded(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::FrameDOMContentLoaded(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_FrameDOMContentLoaded(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::FrameNavigationCompleted(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNavigationCompletedEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_FrameNavigationCompleted(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::FrameNavigationCompleted_revoker consume_Windows_Web_UI_IWebViewControl<D>::FrameNavigationCompleted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNavigationCompletedEventArgs> const& handler) const
{
return impl::make_event_revoker<D, FrameNavigationCompleted_revoker>(this, FrameNavigationCompleted(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::FrameNavigationCompleted(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_FrameNavigationCompleted(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::ScriptNotify(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlScriptNotifyEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_ScriptNotify(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::ScriptNotify_revoker consume_Windows_Web_UI_IWebViewControl<D>::ScriptNotify(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlScriptNotifyEventArgs> const& handler) const
{
return impl::make_event_revoker<D, ScriptNotify_revoker>(this, ScriptNotify(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::ScriptNotify(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_ScriptNotify(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::LongRunningScriptDetected(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlLongRunningScriptDetectedEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_LongRunningScriptDetected(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::LongRunningScriptDetected_revoker consume_Windows_Web_UI_IWebViewControl<D>::LongRunningScriptDetected(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlLongRunningScriptDetectedEventArgs> const& handler) const
{
return impl::make_event_revoker<D, LongRunningScriptDetected_revoker>(this, LongRunningScriptDetected(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::LongRunningScriptDetected(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_LongRunningScriptDetected(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::UnsafeContentWarningDisplaying(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Foundation::IInspectable> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_UnsafeContentWarningDisplaying(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::UnsafeContentWarningDisplaying_revoker consume_Windows_Web_UI_IWebViewControl<D>::UnsafeContentWarningDisplaying(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Foundation::IInspectable> const& handler) const
{
return impl::make_event_revoker<D, UnsafeContentWarningDisplaying_revoker>(this, UnsafeContentWarningDisplaying(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::UnsafeContentWarningDisplaying(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_UnsafeContentWarningDisplaying(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::UnviewableContentIdentified(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlUnviewableContentIdentifiedEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_UnviewableContentIdentified(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::UnviewableContentIdentified_revoker consume_Windows_Web_UI_IWebViewControl<D>::UnviewableContentIdentified(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlUnviewableContentIdentifiedEventArgs> const& handler) const
{
return impl::make_event_revoker<D, UnviewableContentIdentified_revoker>(this, UnviewableContentIdentified(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::UnviewableContentIdentified(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_UnviewableContentIdentified(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::PermissionRequested(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlPermissionRequestedEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_PermissionRequested(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::PermissionRequested_revoker consume_Windows_Web_UI_IWebViewControl<D>::PermissionRequested(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlPermissionRequestedEventArgs> const& handler) const
{
return impl::make_event_revoker<D, PermissionRequested_revoker>(this, PermissionRequested(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::PermissionRequested(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_PermissionRequested(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::UnsupportedUriSchemeIdentified(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlUnsupportedUriSchemeIdentifiedEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_UnsupportedUriSchemeIdentified(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::UnsupportedUriSchemeIdentified_revoker consume_Windows_Web_UI_IWebViewControl<D>::UnsupportedUriSchemeIdentified(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlUnsupportedUriSchemeIdentifiedEventArgs> const& handler) const
{
return impl::make_event_revoker<D, UnsupportedUriSchemeIdentified_revoker>(this, UnsupportedUriSchemeIdentified(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::UnsupportedUriSchemeIdentified(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_UnsupportedUriSchemeIdentified(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::NewWindowRequested(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNewWindowRequestedEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_NewWindowRequested(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::NewWindowRequested_revoker consume_Windows_Web_UI_IWebViewControl<D>::NewWindowRequested(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNewWindowRequestedEventArgs> const& handler) const
{
return impl::make_event_revoker<D, NewWindowRequested_revoker>(this, NewWindowRequested(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::NewWindowRequested(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_NewWindowRequested(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::ContainsFullScreenElementChanged(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Foundation::IInspectable> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_ContainsFullScreenElementChanged(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::ContainsFullScreenElementChanged_revoker consume_Windows_Web_UI_IWebViewControl<D>::ContainsFullScreenElementChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Foundation::IInspectable> const& handler) const
{
return impl::make_event_revoker<D, ContainsFullScreenElementChanged_revoker>(this, ContainsFullScreenElementChanged(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::ContainsFullScreenElementChanged(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_ContainsFullScreenElementChanged(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Web_UI_IWebViewControl<D>::WebResourceRequested(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlWebResourceRequestedEventArgs> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->add_WebResourceRequested(*(void**)(&handler), put_abi(token)));
return token;
}
template <typename D> typename consume_Windows_Web_UI_IWebViewControl<D>::WebResourceRequested_revoker consume_Windows_Web_UI_IWebViewControl<D>::WebResourceRequested(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlWebResourceRequestedEventArgs> const& handler) const
{
return impl::make_event_revoker<D, WebResourceRequested_revoker>(this, WebResourceRequested(handler));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl<D>::WebResourceRequested(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl)->remove_WebResourceRequested(impl::bind_in(token));
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControl2<D>::AddInitializeScript(param::hstring const& script) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControl2)->AddInitializeScript(*(void**)(&script)));
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Uri) consume_Windows_Web_UI_IWebViewControlContentLoadingEventArgs<D>::Uri() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlContentLoadingEventArgs)->get_Uri(&value));
return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Uri) consume_Windows_Web_UI_IWebViewControlDOMContentLoadedEventArgs<D>::Uri() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlDOMContentLoadedEventArgs)->get_Uri(&value));
return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Web_UI_IWebViewControlDeferredPermissionRequest<D>::Id() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlDeferredPermissionRequest)->get_Id(&value));
return value;
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Uri) consume_Windows_Web_UI_IWebViewControlDeferredPermissionRequest<D>::Uri() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlDeferredPermissionRequest)->get_Uri(&value));
return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Web::UI::WebViewControlPermissionType) consume_Windows_Web_UI_IWebViewControlDeferredPermissionRequest<D>::PermissionType() const
{
winrt::Windows::Web::UI::WebViewControlPermissionType value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlDeferredPermissionRequest)->get_PermissionType(reinterpret_cast<int32_t*>(&value)));
return value;
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControlDeferredPermissionRequest<D>::Allow() const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlDeferredPermissionRequest)->Allow());
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControlDeferredPermissionRequest<D>::Deny() const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlDeferredPermissionRequest)->Deny());
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::TimeSpan) consume_Windows_Web_UI_IWebViewControlLongRunningScriptDetectedEventArgs<D>::ExecutionTime() const
{
winrt::Windows::Foundation::TimeSpan value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlLongRunningScriptDetectedEventArgs)->get_ExecutionTime(put_abi(value)));
return value;
}
template <typename D> WINRT_IMPL_AUTO(bool) consume_Windows_Web_UI_IWebViewControlLongRunningScriptDetectedEventArgs<D>::StopPageScriptExecution() const
{
bool value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlLongRunningScriptDetectedEventArgs)->get_StopPageScriptExecution(&value));
return value;
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControlLongRunningScriptDetectedEventArgs<D>::StopPageScriptExecution(bool value) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlLongRunningScriptDetectedEventArgs)->put_StopPageScriptExecution(value));
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Uri) consume_Windows_Web_UI_IWebViewControlNavigationCompletedEventArgs<D>::Uri() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlNavigationCompletedEventArgs)->get_Uri(&value));
return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(bool) consume_Windows_Web_UI_IWebViewControlNavigationCompletedEventArgs<D>::IsSuccess() const
{
bool value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlNavigationCompletedEventArgs)->get_IsSuccess(&value));
return value;
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Web::WebErrorStatus) consume_Windows_Web_UI_IWebViewControlNavigationCompletedEventArgs<D>::WebErrorStatus() const
{
winrt::Windows::Web::WebErrorStatus value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlNavigationCompletedEventArgs)->get_WebErrorStatus(reinterpret_cast<int32_t*>(&value)));
return value;
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Uri) consume_Windows_Web_UI_IWebViewControlNavigationStartingEventArgs<D>::Uri() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlNavigationStartingEventArgs)->get_Uri(&value));
return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(bool) consume_Windows_Web_UI_IWebViewControlNavigationStartingEventArgs<D>::Cancel() const
{
bool value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlNavigationStartingEventArgs)->get_Cancel(&value));
return value;
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControlNavigationStartingEventArgs<D>::Cancel(bool value) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlNavigationStartingEventArgs)->put_Cancel(value));
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Uri) consume_Windows_Web_UI_IWebViewControlNewWindowRequestedEventArgs<D>::Uri() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlNewWindowRequestedEventArgs)->get_Uri(&value));
return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Uri) consume_Windows_Web_UI_IWebViewControlNewWindowRequestedEventArgs<D>::Referrer() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlNewWindowRequestedEventArgs)->get_Referrer(&value));
return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(bool) consume_Windows_Web_UI_IWebViewControlNewWindowRequestedEventArgs<D>::Handled() const
{
bool value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlNewWindowRequestedEventArgs)->get_Handled(&value));
return value;
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControlNewWindowRequestedEventArgs<D>::Handled(bool value) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlNewWindowRequestedEventArgs)->put_Handled(value));
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Web::UI::IWebViewControl) consume_Windows_Web_UI_IWebViewControlNewWindowRequestedEventArgs2<D>::NewWindow() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlNewWindowRequestedEventArgs2)->get_NewWindow(&value));
return winrt::Windows::Web::UI::IWebViewControl{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControlNewWindowRequestedEventArgs2<D>::NewWindow(winrt::Windows::Web::UI::IWebViewControl const& value) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlNewWindowRequestedEventArgs2)->put_NewWindow(*(void**)(&value)));
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Deferral) consume_Windows_Web_UI_IWebViewControlNewWindowRequestedEventArgs2<D>::GetDeferral() const
{
void* deferral{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlNewWindowRequestedEventArgs2)->GetDeferral(&deferral));
return winrt::Windows::Foundation::Deferral{ deferral, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Web_UI_IWebViewControlPermissionRequest<D>::Id() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlPermissionRequest)->get_Id(&value));
return value;
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Uri) consume_Windows_Web_UI_IWebViewControlPermissionRequest<D>::Uri() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlPermissionRequest)->get_Uri(&value));
return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Web::UI::WebViewControlPermissionType) consume_Windows_Web_UI_IWebViewControlPermissionRequest<D>::PermissionType() const
{
winrt::Windows::Web::UI::WebViewControlPermissionType value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlPermissionRequest)->get_PermissionType(reinterpret_cast<int32_t*>(&value)));
return value;
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Web::UI::WebViewControlPermissionState) consume_Windows_Web_UI_IWebViewControlPermissionRequest<D>::State() const
{
winrt::Windows::Web::UI::WebViewControlPermissionState value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlPermissionRequest)->get_State(reinterpret_cast<int32_t*>(&value)));
return value;
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControlPermissionRequest<D>::Defer() const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlPermissionRequest)->Defer());
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControlPermissionRequest<D>::Allow() const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlPermissionRequest)->Allow());
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControlPermissionRequest<D>::Deny() const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlPermissionRequest)->Deny());
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Web::UI::WebViewControlPermissionRequest) consume_Windows_Web_UI_IWebViewControlPermissionRequestedEventArgs<D>::PermissionRequest() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlPermissionRequestedEventArgs)->get_PermissionRequest(&value));
return winrt::Windows::Web::UI::WebViewControlPermissionRequest{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Uri) consume_Windows_Web_UI_IWebViewControlScriptNotifyEventArgs<D>::Uri() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlScriptNotifyEventArgs)->get_Uri(&value));
return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Web_UI_IWebViewControlScriptNotifyEventArgs<D>::Value() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlScriptNotifyEventArgs)->get_Value(&value));
return hstring{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControlSettings<D>::IsJavaScriptEnabled(bool value) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlSettings)->put_IsJavaScriptEnabled(value));
}
template <typename D> WINRT_IMPL_AUTO(bool) consume_Windows_Web_UI_IWebViewControlSettings<D>::IsJavaScriptEnabled() const
{
bool value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlSettings)->get_IsJavaScriptEnabled(&value));
return value;
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControlSettings<D>::IsIndexedDBEnabled(bool value) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlSettings)->put_IsIndexedDBEnabled(value));
}
template <typename D> WINRT_IMPL_AUTO(bool) consume_Windows_Web_UI_IWebViewControlSettings<D>::IsIndexedDBEnabled() const
{
bool value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlSettings)->get_IsIndexedDBEnabled(&value));
return value;
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControlSettings<D>::IsScriptNotifyAllowed(bool value) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlSettings)->put_IsScriptNotifyAllowed(value));
}
template <typename D> WINRT_IMPL_AUTO(bool) consume_Windows_Web_UI_IWebViewControlSettings<D>::IsScriptNotifyAllowed() const
{
bool value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlSettings)->get_IsScriptNotifyAllowed(&value));
return value;
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Uri) consume_Windows_Web_UI_IWebViewControlUnsupportedUriSchemeIdentifiedEventArgs<D>::Uri() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlUnsupportedUriSchemeIdentifiedEventArgs)->get_Uri(&value));
return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(bool) consume_Windows_Web_UI_IWebViewControlUnsupportedUriSchemeIdentifiedEventArgs<D>::Handled() const
{
bool value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlUnsupportedUriSchemeIdentifiedEventArgs)->get_Handled(&value));
return value;
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControlUnsupportedUriSchemeIdentifiedEventArgs<D>::Handled(bool value) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlUnsupportedUriSchemeIdentifiedEventArgs)->put_Handled(value));
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Uri) consume_Windows_Web_UI_IWebViewControlUnviewableContentIdentifiedEventArgs<D>::Uri() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlUnviewableContentIdentifiedEventArgs)->get_Uri(&value));
return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Uri) consume_Windows_Web_UI_IWebViewControlUnviewableContentIdentifiedEventArgs<D>::Referrer() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlUnviewableContentIdentifiedEventArgs)->get_Referrer(&value));
return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Web_UI_IWebViewControlUnviewableContentIdentifiedEventArgs<D>::MediaType() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlUnviewableContentIdentifiedEventArgs)->get_MediaType(&value));
return hstring{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::Deferral) consume_Windows_Web_UI_IWebViewControlWebResourceRequestedEventArgs<D>::GetDeferral() const
{
void* deferral{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlWebResourceRequestedEventArgs)->GetDeferral(&deferral));
return winrt::Windows::Foundation::Deferral{ deferral, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Web::Http::HttpRequestMessage) consume_Windows_Web_UI_IWebViewControlWebResourceRequestedEventArgs<D>::Request() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlWebResourceRequestedEventArgs)->get_Request(&value));
return winrt::Windows::Web::Http::HttpRequestMessage{ value, take_ownership_from_abi };
}
template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Web_UI_IWebViewControlWebResourceRequestedEventArgs<D>::Response(winrt::Windows::Web::Http::HttpResponseMessage const& value) const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlWebResourceRequestedEventArgs)->put_Response(*(void**)(&value)));
}
template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Web::Http::HttpResponseMessage) consume_Windows_Web_UI_IWebViewControlWebResourceRequestedEventArgs<D>::Response() const
{
void* value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Web::UI::IWebViewControlWebResourceRequestedEventArgs)->get_Response(&value));
return winrt::Windows::Web::Http::HttpResponseMessage{ value, take_ownership_from_abi };
}
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControl> : produce_base<D, winrt::Windows::Web::UI::IWebViewControl>
{
int32_t __stdcall get_Source(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Source());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall put_Source(void* source) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().Source(*reinterpret_cast<winrt::Windows::Foundation::Uri const*>(&source));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_DocumentTitle(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<hstring>(this->shim().DocumentTitle());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_CanGoBack(bool* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<bool>(this->shim().CanGoBack());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_CanGoForward(bool* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<bool>(this->shim().CanGoForward());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall put_DefaultBackgroundColor(struct struct_Windows_UI_Color value) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().DefaultBackgroundColor(*reinterpret_cast<winrt::Windows::UI::Color const*>(&value));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_DefaultBackgroundColor(struct struct_Windows_UI_Color* value) noexcept final try
{
zero_abi<winrt::Windows::UI::Color>(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::UI::Color>(this->shim().DefaultBackgroundColor());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_ContainsFullScreenElement(bool* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<bool>(this->shim().ContainsFullScreenElement());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_Settings(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Web::UI::WebViewControlSettings>(this->shim().Settings());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_DeferredPermissionRequests(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Web::UI::WebViewControlDeferredPermissionRequest>>(this->shim().DeferredPermissionRequests());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall GoForward() noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().GoForward();
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall GoBack() noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().GoBack();
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall Refresh() noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().Refresh();
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall Stop() noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().Stop();
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall Navigate(void* source) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().Navigate(*reinterpret_cast<winrt::Windows::Foundation::Uri const*>(&source));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall NavigateToString(void* text) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().NavigateToString(*reinterpret_cast<hstring const*>(&text));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall NavigateToLocalStreamUri(void* source, void* streamResolver) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().NavigateToLocalStreamUri(*reinterpret_cast<winrt::Windows::Foundation::Uri const*>(&source), *reinterpret_cast<winrt::Windows::Web::IUriToStreamResolver const*>(&streamResolver));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall NavigateWithHttpRequestMessage(void* requestMessage) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().NavigateWithHttpRequestMessage(*reinterpret_cast<winrt::Windows::Web::Http::HttpRequestMessage const*>(&requestMessage));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall InvokeScriptAsync(void* scriptName, void* arguments, void** operation) noexcept final try
{
clear_abi(operation);
typename D::abi_guard guard(this->shim());
*operation = detach_from<winrt::Windows::Foundation::IAsyncOperation<hstring>>(this->shim().InvokeScriptAsync(*reinterpret_cast<hstring const*>(&scriptName), *reinterpret_cast<winrt::Windows::Foundation::Collections::IIterable<hstring> const*>(&arguments)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall CapturePreviewToStreamAsync(void* stream, void** operation) noexcept final try
{
clear_abi(operation);
typename D::abi_guard guard(this->shim());
*operation = detach_from<winrt::Windows::Foundation::IAsyncAction>(this->shim().CapturePreviewToStreamAsync(*reinterpret_cast<winrt::Windows::Storage::Streams::IRandomAccessStream const*>(&stream)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall CaptureSelectedContentToDataPackageAsync(void** operation) noexcept final try
{
clear_abi(operation);
typename D::abi_guard guard(this->shim());
*operation = detach_from<winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::ApplicationModel::DataTransfer::DataPackage>>(this->shim().CaptureSelectedContentToDataPackageAsync());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall BuildLocalStreamUri(void* contentIdentifier, void* relativePath, void** result) noexcept final try
{
clear_abi(result);
typename D::abi_guard guard(this->shim());
*result = detach_from<winrt::Windows::Foundation::Uri>(this->shim().BuildLocalStreamUri(*reinterpret_cast<hstring const*>(&contentIdentifier), *reinterpret_cast<hstring const*>(&relativePath)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall GetDeferredPermissionRequestById(uint32_t id, void** result) noexcept final try
{
clear_abi(result);
typename D::abi_guard guard(this->shim());
this->shim().GetDeferredPermissionRequestById(id, *reinterpret_cast<winrt::Windows::Web::UI::WebViewControlDeferredPermissionRequest*>(result));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall add_NavigationStarting(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().NavigationStarting(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNavigationStartingEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_NavigationStarting(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().NavigationStarting(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_ContentLoading(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().ContentLoading(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlContentLoadingEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_ContentLoading(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().ContentLoading(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_DOMContentLoaded(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().DOMContentLoaded(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlDOMContentLoadedEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_DOMContentLoaded(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().DOMContentLoaded(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_NavigationCompleted(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().NavigationCompleted(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNavigationCompletedEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_NavigationCompleted(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().NavigationCompleted(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_FrameNavigationStarting(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().FrameNavigationStarting(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNavigationStartingEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_FrameNavigationStarting(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().FrameNavigationStarting(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_FrameContentLoading(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().FrameContentLoading(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlContentLoadingEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_FrameContentLoading(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().FrameContentLoading(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_FrameDOMContentLoaded(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().FrameDOMContentLoaded(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlDOMContentLoadedEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_FrameDOMContentLoaded(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().FrameDOMContentLoaded(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_FrameNavigationCompleted(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().FrameNavigationCompleted(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNavigationCompletedEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_FrameNavigationCompleted(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().FrameNavigationCompleted(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_ScriptNotify(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().ScriptNotify(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlScriptNotifyEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_ScriptNotify(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().ScriptNotify(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_LongRunningScriptDetected(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().LongRunningScriptDetected(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlLongRunningScriptDetectedEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_LongRunningScriptDetected(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().LongRunningScriptDetected(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_UnsafeContentWarningDisplaying(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().UnsafeContentWarningDisplaying(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Foundation::IInspectable> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_UnsafeContentWarningDisplaying(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().UnsafeContentWarningDisplaying(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_UnviewableContentIdentified(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().UnviewableContentIdentified(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlUnviewableContentIdentifiedEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_UnviewableContentIdentified(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().UnviewableContentIdentified(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_PermissionRequested(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().PermissionRequested(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlPermissionRequestedEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_PermissionRequested(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().PermissionRequested(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_UnsupportedUriSchemeIdentified(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().UnsupportedUriSchemeIdentified(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlUnsupportedUriSchemeIdentifiedEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_UnsupportedUriSchemeIdentified(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().UnsupportedUriSchemeIdentified(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_NewWindowRequested(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().NewWindowRequested(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlNewWindowRequestedEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_NewWindowRequested(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().NewWindowRequested(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_ContainsFullScreenElementChanged(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().ContainsFullScreenElementChanged(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Foundation::IInspectable> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_ContainsFullScreenElementChanged(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().ContainsFullScreenElementChanged(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
int32_t __stdcall add_WebResourceRequested(void* handler, winrt::event_token* token) noexcept final try
{
zero_abi<winrt::event_token>(token);
typename D::abi_guard guard(this->shim());
*token = detach_from<winrt::event_token>(this->shim().WebResourceRequested(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Web::UI::IWebViewControl, winrt::Windows::Web::UI::WebViewControlWebResourceRequestedEventArgs> const*>(&handler)));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall remove_WebResourceRequested(winrt::event_token token) noexcept final
{
typename D::abi_guard guard(this->shim());
this->shim().WebResourceRequested(*reinterpret_cast<winrt::event_token const*>(&token));
return 0;
}
};
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControl2> : produce_base<D, winrt::Windows::Web::UI::IWebViewControl2>
{
int32_t __stdcall AddInitializeScript(void* script) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().AddInitializeScript(*reinterpret_cast<hstring const*>(&script));
return 0;
}
catch (...) { return to_hresult(); }
};
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlContentLoadingEventArgs> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlContentLoadingEventArgs>
{
int32_t __stdcall get_Uri(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Uri());
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlDOMContentLoadedEventArgs> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlDOMContentLoadedEventArgs>
{
int32_t __stdcall get_Uri(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Uri());
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlDeferredPermissionRequest> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlDeferredPermissionRequest>
{
int32_t __stdcall get_Id(uint32_t* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<uint32_t>(this->shim().Id());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_Uri(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Uri());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_PermissionType(int32_t* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Web::UI::WebViewControlPermissionType>(this->shim().PermissionType());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall Allow() noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().Allow();
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall Deny() noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().Deny();
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlLongRunningScriptDetectedEventArgs> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlLongRunningScriptDetectedEventArgs>
{
int32_t __stdcall get_ExecutionTime(int64_t* value) noexcept final try
{
zero_abi<winrt::Windows::Foundation::TimeSpan>(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::TimeSpan>(this->shim().ExecutionTime());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_StopPageScriptExecution(bool* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<bool>(this->shim().StopPageScriptExecution());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall put_StopPageScriptExecution(bool value) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().StopPageScriptExecution(value);
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlNavigationCompletedEventArgs> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlNavigationCompletedEventArgs>
{
int32_t __stdcall get_Uri(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Uri());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_IsSuccess(bool* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<bool>(this->shim().IsSuccess());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_WebErrorStatus(int32_t* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Web::WebErrorStatus>(this->shim().WebErrorStatus());
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlNavigationStartingEventArgs> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlNavigationStartingEventArgs>
{
int32_t __stdcall get_Uri(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Uri());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_Cancel(bool* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<bool>(this->shim().Cancel());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall put_Cancel(bool value) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().Cancel(value);
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlNewWindowRequestedEventArgs> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlNewWindowRequestedEventArgs>
{
int32_t __stdcall get_Uri(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Uri());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_Referrer(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Referrer());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_Handled(bool* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<bool>(this->shim().Handled());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall put_Handled(bool value) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().Handled(value);
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlNewWindowRequestedEventArgs2> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlNewWindowRequestedEventArgs2>
{
int32_t __stdcall get_NewWindow(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Web::UI::IWebViewControl>(this->shim().NewWindow());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall put_NewWindow(void* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().NewWindow(*reinterpret_cast<winrt::Windows::Web::UI::IWebViewControl const*>(&value));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall GetDeferral(void** deferral) noexcept final try
{
clear_abi(deferral);
typename D::abi_guard guard(this->shim());
*deferral = detach_from<winrt::Windows::Foundation::Deferral>(this->shim().GetDeferral());
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlPermissionRequest> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlPermissionRequest>
{
int32_t __stdcall get_Id(uint32_t* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<uint32_t>(this->shim().Id());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_Uri(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Uri());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_PermissionType(int32_t* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Web::UI::WebViewControlPermissionType>(this->shim().PermissionType());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_State(int32_t* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Web::UI::WebViewControlPermissionState>(this->shim().State());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall Defer() noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().Defer();
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall Allow() noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().Allow();
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall Deny() noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().Deny();
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlPermissionRequestedEventArgs> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlPermissionRequestedEventArgs>
{
int32_t __stdcall get_PermissionRequest(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Web::UI::WebViewControlPermissionRequest>(this->shim().PermissionRequest());
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlScriptNotifyEventArgs> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlScriptNotifyEventArgs>
{
int32_t __stdcall get_Uri(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Uri());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_Value(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<hstring>(this->shim().Value());
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlSettings> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlSettings>
{
int32_t __stdcall put_IsJavaScriptEnabled(bool value) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().IsJavaScriptEnabled(value);
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_IsJavaScriptEnabled(bool* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<bool>(this->shim().IsJavaScriptEnabled());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall put_IsIndexedDBEnabled(bool value) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().IsIndexedDBEnabled(value);
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_IsIndexedDBEnabled(bool* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<bool>(this->shim().IsIndexedDBEnabled());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall put_IsScriptNotifyAllowed(bool value) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().IsScriptNotifyAllowed(value);
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_IsScriptNotifyAllowed(bool* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<bool>(this->shim().IsScriptNotifyAllowed());
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlUnsupportedUriSchemeIdentifiedEventArgs> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlUnsupportedUriSchemeIdentifiedEventArgs>
{
int32_t __stdcall get_Uri(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Uri());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_Handled(bool* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
*value = detach_from<bool>(this->shim().Handled());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall put_Handled(bool value) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().Handled(value);
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlUnviewableContentIdentifiedEventArgs> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlUnviewableContentIdentifiedEventArgs>
{
int32_t __stdcall get_Uri(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Uri());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_Referrer(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Referrer());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_MediaType(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<hstring>(this->shim().MediaType());
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Windows::Web::UI::IWebViewControlWebResourceRequestedEventArgs> : produce_base<D, winrt::Windows::Web::UI::IWebViewControlWebResourceRequestedEventArgs>
{
int32_t __stdcall GetDeferral(void** deferral) noexcept final try
{
clear_abi(deferral);
typename D::abi_guard guard(this->shim());
*deferral = detach_from<winrt::Windows::Foundation::Deferral>(this->shim().GetDeferral());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_Request(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Web::Http::HttpRequestMessage>(this->shim().Request());
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall put_Response(void* value) noexcept final try
{
typename D::abi_guard guard(this->shim());
this->shim().Response(*reinterpret_cast<winrt::Windows::Web::Http::HttpResponseMessage const*>(&value));
return 0;
}
catch (...) { return to_hresult(); }
int32_t __stdcall get_Response(void** value) noexcept final try
{
clear_abi(value);
typename D::abi_guard guard(this->shim());
*value = detach_from<winrt::Windows::Web::Http::HttpResponseMessage>(this->shim().Response());
return 0;
}
catch (...) { return to_hresult(); }
};
#endif
}
WINRT_EXPORT namespace winrt::Windows::Web::UI
{
}
namespace std
{
#ifndef WINRT_LEAN_AND_MEAN
template<> struct hash<winrt::Windows::Web::UI::IWebViewControl> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControl2> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlContentLoadingEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlDOMContentLoadedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlDeferredPermissionRequest> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlLongRunningScriptDetectedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlNavigationCompletedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlNavigationStartingEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlNewWindowRequestedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlNewWindowRequestedEventArgs2> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlPermissionRequest> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlPermissionRequestedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlScriptNotifyEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlSettings> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlUnsupportedUriSchemeIdentifiedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlUnviewableContentIdentifiedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::IWebViewControlWebResourceRequestedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::WebViewControlContentLoadingEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::WebViewControlDOMContentLoadedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::WebViewControlDeferredPermissionRequest> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::WebViewControlLongRunningScriptDetectedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::WebViewControlNavigationCompletedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::WebViewControlNavigationStartingEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::WebViewControlNewWindowRequestedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::WebViewControlPermissionRequest> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::WebViewControlPermissionRequestedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::WebViewControlScriptNotifyEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::WebViewControlSettings> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::WebViewControlUnsupportedUriSchemeIdentifiedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::WebViewControlUnviewableContentIdentifiedEventArgs> : winrt::impl::hash_base {};
template<> struct hash<winrt::Windows::Web::UI::WebViewControlWebResourceRequestedEventArgs> : winrt::impl::hash_base {};
#endif
}
#endif
| [
"noreply@github.com"
] | noreply@github.com |
48178e49e3281b10769d0531aa87cccd3c4eb7b8 | 0c3b51a5672113aacb72294c7b552534629b21d7 | /content/browser/service_worker/service_worker_context_wrapper.cc | 6c857eb63672be72dd91263cb0f653560050f84d | [
"BSD-3-Clause"
] | permissive | anon-with-no-name/zirconium | dd7321912c0db0a81421f3af7b9816767c7dc654 | 4e0235ea5bfe8856f696f89ddb67fc1f21176d5b | refs/heads/master | 2020-12-26T06:53:57.666632 | 2015-04-05T23:31:13 | 2015-04-05T23:31:13 | 33,467,629 | 0 | 0 | null | 2015-04-06T06:48:47 | 2015-04-06T05:07:33 | C++ | UTF-8 | C++ | false | false | 16,202 | cc | // 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.
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include <map>
#include <set>
#include <string>
#include <vector>
#include "base/barrier_closure.h"
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/threading/sequenced_worker_pool.h"
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_context_observer.h"
#include "content/browser/service_worker/service_worker_process_manager.h"
#include "content/browser/service_worker/service_worker_quota_client.h"
#include "content/browser/service_worker/service_worker_request_handler.h"
#include "content/browser/service_worker/service_worker_utils.h"
#include "content/browser/service_worker/service_worker_version.h"
#include "content/browser/storage_partition_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/service_worker_context.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
#include "storage/browser/quota/quota_manager_proxy.h"
#include "storage/browser/quota/special_storage_policy.h"
namespace content {
namespace {
typedef std::set<std::string> HeaderNameSet;
base::LazyInstance<HeaderNameSet> g_excluded_header_name_set =
LAZY_INSTANCE_INITIALIZER;
void RunSoon(const base::Closure& closure) {
base::MessageLoop::current()->PostTask(FROM_HERE, closure);
}
void WorkerStarted(const ServiceWorkerContextWrapper::StatusCallback& callback,
ServiceWorkerStatusCode status) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(callback, status));
}
void StartActiveWorkerOnIO(
const ServiceWorkerContextWrapper::StatusCallback& callback,
ServiceWorkerStatusCode status,
const scoped_refptr<ServiceWorkerRegistration>& registration) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (status == SERVICE_WORKER_OK) {
// Pass the reference of |registration| to WorkerStarted callback to prevent
// it from being deleted while starting the worker. If the refcount of
// |registration| is 1, it will be deleted after WorkerStarted is called.
registration->active_version()->StartWorker(
base::Bind(WorkerStarted, callback));
return;
}
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(callback, SERVICE_WORKER_ERROR_NOT_FOUND));
}
} // namespace
void ServiceWorkerContext::AddExcludedHeadersForFetchEvent(
const std::set<std::string>& header_names) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
g_excluded_header_name_set.Get().insert(header_names.begin(),
header_names.end());
}
bool ServiceWorkerContext::IsExcludedHeaderNameForFetchEvent(
const std::string& header_name) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
return g_excluded_header_name_set.Get().find(header_name) !=
g_excluded_header_name_set.Get().end();
}
ServiceWorkerContext* ServiceWorkerContext::GetServiceWorkerContext(
net::URLRequest* request) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
ServiceWorkerRequestHandler* handler =
ServiceWorkerRequestHandler::GetHandler(request);
if (!handler || !handler->context())
return nullptr;
return handler->context()->wrapper_;
}
ServiceWorkerContextWrapper::ServiceWorkerContextWrapper(
BrowserContext* browser_context)
: observer_list_(
new ObserverListThreadSafe<ServiceWorkerContextObserver>()),
process_manager_(new ServiceWorkerProcessManager(browser_context)),
is_incognito_(false),
storage_partition_(nullptr) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
ServiceWorkerContextWrapper::~ServiceWorkerContextWrapper() {
}
void ServiceWorkerContextWrapper::Init(
const base::FilePath& user_data_directory,
storage::QuotaManagerProxy* quota_manager_proxy,
storage::SpecialStoragePolicy* special_storage_policy) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
is_incognito_ = user_data_directory.empty();
base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool();
scoped_ptr<ServiceWorkerDatabaseTaskManager> database_task_manager(
new ServiceWorkerDatabaseTaskManagerImpl(pool));
scoped_refptr<base::SingleThreadTaskRunner> disk_cache_thread =
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE);
InitInternal(user_data_directory,
database_task_manager.Pass(),
disk_cache_thread,
quota_manager_proxy,
special_storage_policy);
}
void ServiceWorkerContextWrapper::Shutdown() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
storage_partition_ = nullptr;
process_manager_->Shutdown();
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
base::Bind(&ServiceWorkerContextWrapper::ShutdownOnIO, this));
}
void ServiceWorkerContextWrapper::DeleteAndStartOver() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
context_core_->DeleteAndStartOver(
base::Bind(&ServiceWorkerContextWrapper::DidDeleteAndStartOver, this));
}
ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
return context_core_.get();
}
StoragePartitionImpl* ServiceWorkerContextWrapper::storage_partition() const {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
return storage_partition_;
}
void ServiceWorkerContextWrapper::set_storage_partition(
StoragePartitionImpl* storage_partition) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
storage_partition_ = storage_partition;
}
static void FinishRegistrationOnIO(
const ServiceWorkerContext::ResultCallback& continuation,
ServiceWorkerStatusCode status,
const std::string& status_message,
int64 registration_id) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
BrowserThread::PostTask(
BrowserThread::UI,
FROM_HERE,
base::Bind(continuation, status == SERVICE_WORKER_OK));
}
void ServiceWorkerContextWrapper::RegisterServiceWorker(
const GURL& pattern,
const GURL& script_url,
const ResultCallback& continuation) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
base::Bind(&ServiceWorkerContextWrapper::RegisterServiceWorker,
this,
pattern,
script_url,
continuation));
return;
}
if (!context_core_.get()) {
LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
base::Bind(continuation, false));
return;
}
context()->RegisterServiceWorker(
pattern,
script_url,
NULL /* provider_host */,
base::Bind(&FinishRegistrationOnIO, continuation));
}
static void FinishUnregistrationOnIO(
const ServiceWorkerContext::ResultCallback& continuation,
ServiceWorkerStatusCode status) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
BrowserThread::PostTask(
BrowserThread::UI,
FROM_HERE,
base::Bind(continuation, status == SERVICE_WORKER_OK));
}
void ServiceWorkerContextWrapper::UnregisterServiceWorker(
const GURL& pattern,
const ResultCallback& continuation) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
base::Bind(&ServiceWorkerContextWrapper::UnregisterServiceWorker,
this,
pattern,
continuation));
return;
}
if (!context_core_.get()) {
LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
base::Bind(continuation, false));
return;
}
context()->UnregisterServiceWorker(
pattern,
base::Bind(&FinishUnregistrationOnIO, continuation));
}
void ServiceWorkerContextWrapper::StartServiceWorker(
const GURL& pattern,
const StatusCallback& callback) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&ServiceWorkerContextWrapper::StartServiceWorker, this,
pattern, callback));
return;
}
if (!context_core_.get()) {
LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(callback, SERVICE_WORKER_ERROR_START_WORKER_FAILED));
return;
}
context_core_->storage()->FindRegistrationForPattern(
pattern, base::Bind(&StartActiveWorkerOnIO, callback));
}
static void DidFindRegistrationForDocument(
const net::CompletionCallback& callback,
ServiceWorkerStatusCode status,
const scoped_refptr<ServiceWorkerRegistration>& registration) {
int rv = registration ? net::OK : net::ERR_CACHE_MISS;
// Use RunSoon here because FindRegistrationForDocument can complete
// immediately but CanHandleMainResourceOffline must be async.
RunSoon(base::Bind(callback, rv));
}
void ServiceWorkerContextWrapper::CanHandleMainResourceOffline(
const GURL& url,
const GURL& first_party,
const net::CompletionCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
context()->storage()->FindRegistrationForDocument(
url,
base::Bind(&DidFindRegistrationForDocument, callback));
}
void ServiceWorkerContextWrapper::GetAllOriginsInfo(
const GetUsageInfoCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!context_core_.get()) {
LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
base::Bind(callback, std::vector<ServiceWorkerUsageInfo>()));
return;
}
context()->storage()->GetAllRegistrations(base::Bind(
&ServiceWorkerContextWrapper::DidGetAllRegistrationsForGetAllOrigins,
this,
callback));
}
void ServiceWorkerContextWrapper::DidGetAllRegistrationsForGetAllOrigins(
const GetUsageInfoCallback& callback,
const std::vector<ServiceWorkerRegistrationInfo>& registrations) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
std::vector<ServiceWorkerUsageInfo> usage_infos;
std::map<GURL, ServiceWorkerUsageInfo> origins;
for (const auto& registration_info : registrations) {
GURL origin = registration_info.pattern.GetOrigin();
ServiceWorkerUsageInfo& usage_info = origins[origin];
if (usage_info.origin.is_empty())
usage_info.origin = origin;
usage_info.scopes.push_back(registration_info.pattern);
usage_info.total_size_bytes += registration_info.stored_version_size_bytes;
}
for (const auto& origin_info_pair : origins) {
usage_infos.push_back(origin_info_pair.second);
}
callback.Run(usage_infos);
}
void ServiceWorkerContextWrapper::DidFindRegistrationForCheckHasServiceWorker(
const GURL& other_url,
const CheckHasServiceWorkerCallback& callback,
ServiceWorkerStatusCode status,
const scoped_refptr<ServiceWorkerRegistration>& registration) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (status != SERVICE_WORKER_OK) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(callback, false));
return;
}
DCHECK(registration);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(callback, registration->active_version() &&
ServiceWorkerUtils::ScopeMatches(
registration->pattern(), other_url)));
}
namespace {
void StatusCodeToBoolCallbackAdapter(
const ServiceWorkerContext::ResultCallback& callback,
ServiceWorkerStatusCode code) {
callback.Run(code == ServiceWorkerStatusCode::SERVICE_WORKER_OK);
}
void EmptySuccessCallback(bool success) {
}
} // namespace
void ServiceWorkerContextWrapper::DeleteForOrigin(
const GURL& origin_url,
const ResultCallback& result) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!context_core_.get()) {
LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
base::Bind(result, false));
return;
}
context()->UnregisterServiceWorkers(
origin_url, base::Bind(&StatusCodeToBoolCallbackAdapter, result));
}
void ServiceWorkerContextWrapper::DeleteForOrigin(const GURL& origin_url) {
DeleteForOrigin(origin_url, base::Bind(&EmptySuccessCallback));
}
void ServiceWorkerContextWrapper::CheckHasServiceWorker(
const GURL& url,
const GURL& other_url,
const CheckHasServiceWorkerCallback& callback) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&ServiceWorkerContextWrapper::CheckHasServiceWorker, this,
url, other_url, callback));
return;
}
if (!context_core_.get()) {
LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(callback, false));
return;
}
GURL stripped_url = net::SimplifyUrlForRequest(url);
context()->storage()->FindRegistrationForDocument(
stripped_url, base::Bind(&ServiceWorkerContextWrapper::
DidFindRegistrationForCheckHasServiceWorker,
this, other_url, callback));
}
void ServiceWorkerContextWrapper::AddObserver(
ServiceWorkerContextObserver* observer) {
observer_list_->AddObserver(observer);
}
void ServiceWorkerContextWrapper::RemoveObserver(
ServiceWorkerContextObserver* observer) {
observer_list_->RemoveObserver(observer);
}
void ServiceWorkerContextWrapper::InitInternal(
const base::FilePath& user_data_directory,
scoped_ptr<ServiceWorkerDatabaseTaskManager> database_task_manager,
const scoped_refptr<base::SingleThreadTaskRunner>& disk_cache_thread,
storage::QuotaManagerProxy* quota_manager_proxy,
storage::SpecialStoragePolicy* special_storage_policy) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
base::Bind(&ServiceWorkerContextWrapper::InitInternal,
this,
user_data_directory,
base::Passed(&database_task_manager),
disk_cache_thread,
make_scoped_refptr(quota_manager_proxy),
make_scoped_refptr(special_storage_policy)));
return;
}
DCHECK(!context_core_);
if (quota_manager_proxy) {
quota_manager_proxy->RegisterClient(new ServiceWorkerQuotaClient(this));
}
context_core_.reset(new ServiceWorkerContextCore(user_data_directory,
database_task_manager.Pass(),
disk_cache_thread,
quota_manager_proxy,
special_storage_policy,
observer_list_.get(),
this));
}
void ServiceWorkerContextWrapper::ShutdownOnIO() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
context_core_.reset();
}
void ServiceWorkerContextWrapper::DidDeleteAndStartOver(
ServiceWorkerStatusCode status) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (status != SERVICE_WORKER_OK) {
context_core_.reset();
return;
}
context_core_.reset(new ServiceWorkerContextCore(context_core_.get(), this));
DVLOG(1) << "Restarted ServiceWorkerContextCore successfully.";
observer_list_->Notify(FROM_HERE,
&ServiceWorkerContextObserver::OnStorageWiped);
}
} // namespace content
| [
"mou4e@tfwno.gf"
] | mou4e@tfwno.gf |
b846f9fda537b18136b38cea4264fc8cc9e79fec | bb0b3771934dcc8389430c5312711c7a28a99da1 | /rtbkit/core/post_auction/timeout_map.h | 101b5501d84588c394949e65ae5c20cbf969f2b8 | [
"Apache-2.0"
] | permissive | oktal/rtbkit | d08928a42cce6b0dfa641298c28f73d39249c0a4 | 1b1b3b76ab211111c20b2957634619b3ba2813f4 | refs/heads/master | 2023-08-20T03:02:34.766132 | 2014-07-31T19:40:15 | 2014-07-31T19:40:15 | 22,482,230 | 1 | 0 | null | 2014-08-25T14:02:21 | 2014-07-31T19:38:28 | C++ | UTF-8 | C++ | false | false | 3,535 | h | /* timeout_map.h -*- C++ -*-
Rémi Attab (remi.attab@gmail.com), 08 May 2014
FreeBSD-style copyright and disclaimer apply
Map that maintains a timeout mechanism.
Simpler version of the soa TimeoutMap which doesn't require linear scans to
expire elements. Should eventually replace the one in soa.
*/
#pragma once
#include "soa/types/date.h"
#include <set>
#include <queue>
namespace RTBKIT {
/******************************************************************************/
/* TIMEOUT MAP */
/******************************************************************************/
template<typename Key, typename Value>
struct TimeoutMap
{
size_t size() const
{
return map.size();
}
bool count(const Key& key) const
{
return map.count(key);
}
Value& get(const Key& key)
{
auto it = map.find(key);
ExcCheck(it != map.end(), "key not present in the timeout map.");
return it->second.value;
}
const Value& get(const Key& key) const
{
auto it = map.find(key);
ExcCheck(it != map.end(), "key not present in the timeout map.");
return it->second.value;
}
bool emplace(Key key, Value value, Datacratic::Date timeout)
{
auto ret = map.insert(std::make_pair(
std::move(key), Entry(std::move(value), timeout)));
if (!ret.second) return false;
queue.emplace(ret.first->first, timeout);
return true;
}
void update(const Key& key, Datacratic::Date timeout)
{
auto it = map.find(key);
ExcCheck(it != map.end(), "key not present in the timeout map.");
it->second.timeout = timeout;
queue.emplace(key, timeout);
}
Value pop(const Key& key)
{
auto it = map.find(key);
ExcCheck(it != map.end(), "key not present in the timeout map.");
Value value = std::move(it->second.value);
map.erase(it);
return value;
}
bool erase(const Key& key)
{
return map.erase(key);
}
template<typename Fn>
size_t expire(const Fn& fn, Datacratic::Date now = Datacratic::Date::now())
{
std::vector< std::pair<Key, Entry> > toExpire;
toExpire.reserve(1 << 4);
while (!queue.empty() && queue.top().timeout <= now) {
TimeoutEntry entry = std::move(queue.top());
queue.pop();
auto it = map.find(entry.key);
if (it == map.end()) continue;
if (it->second.timeout > now) continue;
toExpire.emplace_back(std::move(*it));
map.erase(it);
}
for (auto& entry : toExpire)
fn(std::move(entry.first), std::move(entry.second.value));
return toExpire.size();
}
private:
struct Entry
{
Value value;
Datacratic::Date timeout;
Entry(Value value, Datacratic::Date timeout) :
value(std::move(value)), timeout(timeout)
{}
};
struct TimeoutEntry
{
Key key;
Datacratic::Date timeout;
TimeoutEntry(Key key, Datacratic::Date timeout) :
key(std::move(key)), timeout(timeout)
{}
bool operator<(const TimeoutEntry& other) const
{
return timeout > other.timeout;
}
};
std::map<Key, Entry> map;
std::priority_queue<TimeoutEntry> queue;
};
} // namespace RTBKIT
| [
"remi@datacratic.com"
] | remi@datacratic.com |
a9f8d3ea421493b59f773ba49874a54d50894dea | d8b65925ddbafa882c44dd819f6ed9721025d1eb | /日常代码/c++/3.cpp | 8556f79ba8d812908bdba7e421801d1a5c346194 | [] | no_license | shengshengxiaowang/every-day | 6c93cf8ff820c01dabb5109cf6b9e4af0f211814 | 4f4ba3796d2ac14981414d2bb1afc6940f2e2029 | refs/heads/master | 2020-04-10T17:26:21.265753 | 2019-12-19T12:31:55 | 2019-12-19T12:31:55 | 161,174,527 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 846 | cpp | #include<iostream>
#include<math.h>
using namespace std;
int main()
{
int n;
cin>>n;
int a[n];
int x1[n+1],x2[n+1];
int count1=0,count2=0,flag=0;
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=0 ;i<n;i++)
{
flag=0;
for(int j=2; j<= sqrt(a[i]); j++)
{
if((a[i]%j)==0) // 如果能被除了1和它本身的数整除,就不是素数
{
flag=1;
break;
}
}
if(flag==0)
{
x1[count1++]=a[i];
}
if(a[i]%2==0)
{
x2[count2++]=a[i];
}
}
int i,j;
for(i=0;i<count1-1;i++)
{
cout<<x1[i]<<" ";
}
cout<<x1[i]<<endl;
for(j=0;j<count2-1;j++)
{
cout<<x2[j]<<" ";
}
cout<<x2[j]<<endl;
}
| [
"278434650@qq.com"
] | 278434650@qq.com |
f2744af475e8bac8c71776bd70170ddca7602165 | 6bebd0b93163e369f695d0b329ae78206733065b | /tessellation_demo_3D_sphere/Cube.cpp | 5a537a2e438420fc3aafee25117f5d56d8212f0a | [] | no_license | YingZhang2017/Graphics_OpenGL | 9802980037bf03dc46f24505ec3b5f873db2b093 | de807492398cf0dc855e92c9cacb803e8e0af757 | refs/heads/master | 2021-01-19T13:05:50.529341 | 2018-07-25T07:39:09 | 2018-07-25T07:39:09 | 88,063,523 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,646 | cpp | /* Cube.h - a class implementation representing
* a Cube object in OpenGL
*
* Ying Zhang, Jul 2018
*/
#include "Cube.h"
// vertices
int nVertices = 36; // 12 triangles * 3
float verts [] = {
-0.5f, -0.5f, -0.5f,
0.5f, -0.5f, -0.5f,
0.5f, 0.5f, -0.5f,
0.5f, 0.5f, -0.5f,
-0.5f, 0.5f, -0.5f,
-0.5f, -0.5f, -0.5f,
-0.5f, -0.5f, 0.5f,
0.5f, -0.5f, 0.5f,
0.5f, 0.5f, 0.5f,
0.5f, 0.5f, 0.5f,
-0.5f, 0.5f, 0.5f,
-0.5f, -0.5f, 0.5f,
-0.5f, 0.5f, 0.5f,
-0.5f, 0.5f, -0.5f,
-0.5f, -0.5f, -0.5f,
-0.5f, -0.5f, -0.5f,
-0.5f, -0.5f, 0.5f,
-0.5f, 0.5f, 0.5f,
0.5f, 0.5f, 0.5f,
0.5f, 0.5f, -0.5f,
0.5f, -0.5f, -0.5f,
0.5f, -0.5f, -0.5f,
0.5f, -0.5f, 0.5f,
0.5f, 0.5f, 0.5f,
-0.5f, -0.5f, -0.5f,
0.5f, -0.5f, -0.5f,
0.5f, -0.5f, 0.5f,
0.5f, -0.5f, 0.5f,
-0.5f, -0.5f, 0.5f,
-0.5f, -0.5f, -0.5f,
-0.5f, 0.5f, -0.5f,
0.5f, 0.5f, -0.5f,
0.5f, 0.5f, 0.5f,
0.5f, 0.5f, 0.5f,
-0.5f, 0.5f, 0.5f,
-0.5f, 0.5f, -0.5f
};
float normals [] = {
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, -1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f,
-1.0f, 0.0f, 0.0f,
-1.0f, 0.0f, 0.0f,
-1.0f, 0.0f, 0.0f,
-1.0f, 0.0f, 0.0f,
-1.0f, 0.0f, 0.0f,
-1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f
};
// ==== Constructor ====
Cube::Cube(string colorName) {
setColor(colorName);
// create buffer
createBuffer();
}
Cube::Cube(Color c) {
color = c;
// create buffer
createBuffer();
}
Cube::Cube(float r, float g, float b, float a) {
color.set(r, g, b, a);
// create buffer
createBuffer();
}
// ==== Destructor =====
Cube::~Cube(){
}
// ====== create buffer =======
void Cube::createBuffer() {
// vbo for verts
glGenBuffers(1, &vboId_vert);
glBindBuffer(GL_ARRAY_BUFFER, vboId_vert);
glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_STATIC_DRAW);
// vbo for normal
glGenBuffers(1, &vboId_normal);
glBindBuffer(GL_ARRAY_BUFFER, vboId_normal);
glBufferData(GL_ARRAY_BUFFER, sizeof(normals), normals, GL_STATIC_DRAW);
// vao
glGenVertexArrays(1, &vaoId);
glBindVertexArray(vaoId);
glBindBuffer(GL_ARRAY_BUFFER, vboId_vert);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, NULL);
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, vboId_normal);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, NULL);
glEnableVertexAttribArray(1);
}
// ==== draw object ======
void Cube::draw() {
glBindVertexArray(vaoId);
// glDrawArrays(GL_TRIANGLES, 0, nVertices);
glDrawArrays(GL_PATCHES, 0, nVertices);
}
| [
"yzhang@lululvxing.com"
] | yzhang@lululvxing.com |
146b0c4befa6e28985dda37694078db328196f11 | 2caf0a204622c2fea0e876c8674bbd3c72fb7dc8 | /Chocolate.cpp | c4c0d7d89eec85cb9d48f81c85038d51afd35045 | [] | no_license | yourdpm/Algorithms | b0ad978a92c8835b7571b7d8b2768afe440de86c | 6623dab3107249c74c7c9bf3307c6d8c5aaf5667 | refs/heads/master | 2020-06-13T23:27:19.401026 | 2019-07-04T10:57:17 | 2019-07-04T10:57:17 | 194,820,991 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 135 | cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin>> n;
if (n%2) cout << "Unfair";
else cout << "Fair";
return 0;
}
| [
"hoanglinh831999@gmail.com"
] | hoanglinh831999@gmail.com |
8f1574736aabf9b417856a05f74a49192bba0072 | 0a4be1f3d0a85aebdc2385433d00ecb902bf7155 | /2841/source.cpp | 7c9a391a20fff5dfe5b377e3a0f087945e8982ff | [] | no_license | Moon-ChangHyun/BOJ | f5632bec92f72775ac786a951dd48796b77294b9 | 3126fe427d3dceb367370ee7d910d61cbd789d0a | refs/heads/master | 2020-04-04T20:13:49.852196 | 2018-11-11T10:16:29 | 2018-11-11T10:16:29 | 156,238,820 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 422 | cpp | #include<stack>
#include<array>
#include<cstdio>
using namespace std;
int main() {
int n, p, ret = 0;
scanf("%d%d", &n, &p);
array<stack<int>, 6> gt;
for (int i = 0; i != n; ++i) {
int a, b;
scanf("%d%d", &a, &b);
while (!gt[a - 1].empty() && gt[a - 1].top() > b) {
gt[a - 1].pop();
++ret;
}
if (gt[a - 1].empty() || gt[a - 1].top() != b) {
gt[a - 1].push(b);
++ret;
}
}
printf("%d", ret);
}
| [
"44778823+Moon-ChangHyun@users.noreply.github.com"
] | 44778823+Moon-ChangHyun@users.noreply.github.com |
9cd80d2b13c22d77103a3485e75c4ff377ea8efb | ecdd8e60f754b304450ae8ec5e25c823834e8fea | /Game/Game.cpp | f6afb68ed6ce758aa30a3d011a095c2a3851143c | [] | no_license | ZiYang-xie/sfSnake_Xzy | bf0964c0a83922ad316dabf74c178b9144e9ef61 | 5f2072d27b76ed5cee2aedb362f64af848482784 | refs/heads/master | 2022-10-10T09:33:25.635186 | 2020-06-12T15:16:33 | 2020-06-12T15:16:33 | 271,826,614 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,518 | cpp | #include <SFML/Graphics.hpp>
#include <memory>
#include "MenuScreen.h"
#include "SettingScreen.h"
#include "Game.h"
using namespace sfSnake;
//帧率设置
const sf::Time Game::TimePerFrame = sf::seconds(1.f / 10.f);
//静态变量
bool Game::bgState = true;
bool Game::isPause = false;
std::shared_ptr<Screen> Game::Screen = std::make_shared<MenuScreen>();
Game::Game() //创建窗口和背景音乐
: window_(sf::VideoMode(Game::Width, Game::Height), "sfSnake")
{
bgmInit(); //初始化音乐
}
void Game::handleInput()
{
bgmControl();
pauseControl();
sf::Event event; //事件获取
while (window_.pollEvent(event)) //关闭窗口处理
{
if (event.type == sf::Event::Closed)
window_.close();
}
Game::Screen->handleInput(window_);
}
void Game::update(sf::Time delta) //游戏刷新
{
if(!isPause)
Game::Screen->update(delta);
}
void Game::render() //游戏渲染
{
window_.clear();
Game::Screen->render(window_);
window_.display();
}
void Game::run()
{
sf::Clock clock;
sf::Time timeSinceLastUpdate = sf::Time::Zero;
while (window_.isOpen())
{
while(isPause) //暂停截断
{
pauseControl();
sf::sleep(sf::microseconds(20)); //sleep以防cpu占用率过高
clock.restart();
}
sf::Time delta = clock.restart(); //delta时钟重置
timeSinceLastUpdate += delta; //上次刷新时间+delta
while (timeSinceLastUpdate > Game::TimePerFrame) //当距上次更新时间超过每帧的间隔时间,更新
{
timeSinceLastUpdate -= TimePerFrame;
handleInput();
update(TimePerFrame);
}
render();
}
}
//BGM初始化
void Game::bgmInit()
{
bgMusic_.openFromFile("Resource/Music/bg_music.wav"); //设置背景音乐
bgMusic_.setVolume(20);
bgMusic_.setLoop(true); //设置音乐循环
bgMusic_.play(); //播放音乐
}
//BGM控制
void Game::bgmControl()
{
if(sf::Keyboard::isKeyPressed(sf::Keyboard::M))
{
if(bgState){
bgMusic_.pause();
bgState = false;
return;
}
else{
bgMusic_.play();
bgState = true;
}
}
}
//暂停控制
void Game::pauseControl()
{
if(sf::Keyboard::isKeyPressed(sf::Keyboard::P)){
isPause = true;
return;
}
else if(sf::Keyboard::isKeyPressed(sf::Keyboard::Q)){
isPause = false;
return;
}
}
| [
"xzy@xzydeMacBook-Pro.local"
] | xzy@xzydeMacBook-Pro.local |
231212273e5143630db4e9fcad3a5f4df0002ec4 | 4635768758d53c76753797e3696327b16e15dba4 | /Othello/Othello.h | 496105f0cc29a77f37933f2cb84ba9736ceec2f1 | [] | no_license | tokabe333/AlgorithmBattlers--Server--_tentative_ | 8e2f1d4f4118dc1f21fff3d388f51bf73b78d5f3 | e64a192cc75e4fd6c63644ef4c7c06bfe4ae75d1 | refs/heads/master | 2023-01-15T07:01:57.258867 | 2020-11-27T09:55:17 | 2020-11-27T09:55:17 | 274,859,348 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 1,330 | h | #ifndef INCLUDE_GUARD_OTHELLO
#define INCLUDE_GUARD_OTHELLO
#include "../Util/Common.h"
#include "../Util/IGameInterface.h"
// class Othello : public IGame {
class Othello : public IGame {
public:
ull white_board; // 白の盤面
ull black_board; // 黒の盤面
int elapsed_turn; // 経過ターン
int** board_data; // 盤面情報(ソルバーに上げる)
int board_size = 8; // 盤面サイズ(今の所8固定)
private:
ull (*white_solver)(ull); // 白のソルバー
ull (*black_sover)(ull); // 黒のソルバー
void show(ull black, ull white);
public:
// コンストラクタ,各プレイヤーのソルバーを渡して初期化
Othello(ull (*whiteSolver)(ull), ull (*blackSolver)(ull));
// @override 盤面表示くん
void show();
// 候補手表示
ull candidate(bool turn);
// 石を置く処理
void PutStone(bool turn, ull point);
// 各ターンの処理 false→まだ試合続行 true→試合終了
bool turn_process(int player);
// 終了処理
void end_process();
// ソルバーに渡すデータを作る
void translate_bit2array();
// static:----------------------------------------
// 立っているビットを数える
static int count(ull t);
// 石の数判定
static ull bit_count(ull player);
};
#endif | [
"tokabe333@gmail.com"
] | tokabe333@gmail.com |
f56e140b1c41797a20ef2f8e8c1aed3a2b067948 | b4e51cd23b3e0629d92a59b83cd97953ec64dd3f | /Source/DiceRoll/Private/Player/MainPlayerController.cpp | ce5b7cc586c8135d23296fa9b79f65a89aaaa4ee | [] | no_license | Thatgiove/DiceRoll | 3e9e4c93929b8af8e2b6d5a4d5abb6ec707bb6af | 226a1d9c5770cc53ba298bb834d8c9eadc661042 | refs/heads/master | 2023-03-23T05:06:12.222700 | 2021-03-16T07:23:15 | 2021-03-16T07:23:15 | 345,052,837 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,381 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "MainPlayerController.h"
#include "DiceRollGameModeBase.h"
#include "UserWidget.h"
void AMainPlayerController::BeginPlay()
{
Super::BeginPlay();
/*Registro il metodo al delegato del GameMode*/
if (ADiceRollGameModeBase* GameMode = Cast<ADiceRollGameModeBase>(GetWorld()->GetAuthGameMode()))
{
/*questo evento scatta quando il Pawn clicca sull'interactableObject*/
GameMode->OpenDiceMiniGame.AddDynamic(this, &AMainPlayerController::ShowHUD);
/*questo evento scatta al click del tasto close dell'HUD*/
GameMode->CloseDiceMiniGame.AddDynamic(this, &AMainPlayerController::HideHud);
}
if (UserOverlayAsset)
{
DiceGameHud = CreateWidget<UUserWidget>(this, UserOverlayAsset);
}
DiceGameHud->AddToViewport();
DiceGameHud->SetVisibility(ESlateVisibility::Hidden);
}
void AMainPlayerController::ShowHUD()
{
if (DiceGameHud)
{
DiceGameHud->SetVisibility(ESlateVisibility::Visible);
}
/*Disabilita l'input*/
GetPawn()->DisableInput(this);
SetInputMode(FInputModeUIOnly());
bShowMouseCursor = true;
}
/*Nasconde il player HUD*/
void AMainPlayerController::HideHud()
{
if (DiceGameHud)
DiceGameHud->SetVisibility(ESlateVisibility::Hidden);
/*Riabilita l'input*/
GetPawn()->EnableInput(this);
SetInputMode(FInputModeGameOnly());
bShowMouseCursor = false;
} | [
"47024965+Thatgiove@users.noreply.github.com"
] | 47024965+Thatgiove@users.noreply.github.com |
d4fbbf79cb71c3d32a20a39c83bbea4ab3fcc2a8 | b8d116c857b13991366b58674a4dd1a96412b5bf | /src/game/client/c_baselesson.cpp | 0709d7557a20a279cd028681e7dc5cf76b5e1b10 | [
"MIT"
] | permissive | SCell555/hl2-asw-port | 6eaa2a4f1f68f1dfb603657d469c42c85b2d9d1a | 16441f599c6b2d3fd051ee2805cc08680dedbb03 | refs/heads/master | 2021-01-17T18:21:59.547507 | 2016-05-12T17:09:21 | 2016-05-12T17:09:21 | 49,386,904 | 3 | 1 | null | 2016-01-10T21:45:46 | 2016-01-10T21:45:44 | null | WINDOWS-1252 | C++ | false | false | 126,350 | cpp | //========= Copyright © 1996-2008, Valve Corporation, All rights reserved. ============//
//
// Purpose: Client handler implementations for instruction players how to play
//
//=============================================================================//
#include "cbase.h"
#include "c_baselesson.h"
#include "c_gameinstructor.h"
#include "hud_locator_target.h"
#include "c_world.h"
#include "iinput.h"
#include "ammodef.h"
#include "vprof.h"
#include "view.h"
#include "vstdlib/ikeyvaluessystem.h"
#ifdef INFESTED_DLL
#include "c_asw_marine.h"
#include "c_asw_marine_resource.h"
#endif
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#define LESSON_PRIORITY_MAX 1000
#define LESSON_PRIORITY_NONE 0
#define LESSON_MIN_TIME_ON_SCREEN_TO_MARK_DISPLAYED 1.5f
#define LESSON_MIN_TIME_BEFORE_LOCK_ALLOWED 0.1f
#define LESSON_DISTANCE_UPDATE_RATE 0.25f
// See comments in UtlSymbol on why this is useful and how it works
IMPLEMENT_PRIVATE_SYMBOLTYPE( CGameInstructorSymbol );
extern ConVar gameinstructor_verbose;
extern ConVar gameinstructor_verbose_lesson;
extern ConVar gameinstructor_find_errors;
//
// CGameInstructorLesson
//
Color CBaseLesson::m_rgbaVerboseHeader = Color( 255, 128, 64, 255 );
Color CBaseLesson::m_rgbaVerbosePlain = Color( 64, 128, 255, 255 );
Color CBaseLesson::m_rgbaVerboseName = Color( 255, 255, 255, 255 );
Color CBaseLesson::m_rgbaVerboseOpen = Color( 0, 255, 0, 255 );
Color CBaseLesson::m_rgbaVerboseClose = Color( 255, 0, 0, 255 );
Color CBaseLesson::m_rgbaVerboseSuccess = Color( 255, 255, 0, 255 );
Color CBaseLesson::m_rgbaVerboseUpdate = Color( 255, 0, 255, 255 );
CBaseLesson::CBaseLesson( const char *pchName, bool bIsDefaultHolder, bool bIsOpenOpportunity, int nSplitScreenSlot )
{
COMPILE_TIME_ASSERT( sizeof( CGameInstructorSymbol ) == sizeof( CUtlSymbol ) );
m_nSplitScreenSlot = nSplitScreenSlot;
m_stringName = pchName;
m_stringReplaceKey = "";
m_bIsDefaultHolder = bIsDefaultHolder;
m_bIsOpenOpportunity = bIsOpenOpportunity;
Init();
}
CBaseLesson::~CBaseLesson( void )
{
if ( m_pRoot )
{
// Remove from root's children list
m_pRoot->m_OpenOpportunities.FindAndRemove( this );
}
else
{
for ( int i = 0; i < m_OpenOpportunities.Count(); ++i )
{
// Remove from children if they are still around
CBaseLesson *pLesson = m_OpenOpportunities[ i ];
pLesson->m_pRoot = NULL;
}
}
}
void CBaseLesson::AddPrerequisite( const char *pchLessonName )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerboseHeader, "\t%s: ", GetName() );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "Adding prereq " );
ConColorMsg( CBaseLesson::m_rgbaVerboseOpen, "\"%s\"", pchLessonName );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ".\n" );
}
const CBaseLesson *pPrerequisite = GetGameInstructor().GetLesson( pchLessonName );
if ( !pPrerequisite )
{
DevWarning( "Prerequisite %s added by lesson %s doesn't exist!\n", pchLessonName, GetName() );
return;
}
m_Prerequisites.AddToTail( pPrerequisite );
}
void CBaseLesson::SetRoot( CBaseLesson *pRoot )
{
m_pRoot = pRoot;
if ( m_pRoot->m_OpenOpportunities.Find( this ) == -1 )
{
m_pRoot->m_OpenOpportunities.AddToTail( this );
}
}
bool CBaseLesson::ShouldShowSpew( void )
{
if ( gameinstructor_verbose_lesson.GetString()[ 0 ] == '\0' )
return false;
return ( Q_stristr( GetName(), gameinstructor_verbose_lesson.GetString() ) != NULL );
}
bool CBaseLesson::NoPriority( void ) const
{
return ( m_iPriority == LESSON_PRIORITY_NONE );
}
bool CBaseLesson::IsLocked( void ) const
{
if ( m_fLockDuration == 0.0f )
return false;
if ( !IsInstructing() || !IsVisible() )
return false;
float fLockTime = m_fLockTime;
if ( fLockTime == 0.0f )
{
fLockTime = m_fStartTime;
}
return ( gpGlobals->curtime > m_fStartTime + LESSON_MIN_TIME_BEFORE_LOCK_ALLOWED && gpGlobals->curtime < fLockTime + m_fLockDuration );
}
bool CBaseLesson::IsLearned( void ) const
{
if ( m_iDisplayLimit > 0 && m_iDisplayCount >= m_iDisplayLimit )
return true;
if ( m_iSuccessLimit > 0 && m_iSuccessCount >= m_iSuccessLimit )
return true;
return false;
}
bool CBaseLesson::PrerequisitesHaveBeenMet( void ) const
{
for ( int i = 0; i < m_Prerequisites.Count(); ++i )
{
if ( !m_Prerequisites[ i ]->IsLearned() )
{
// Failed a prereq
return false;
}
}
// All prereqs passed
return true;
}
bool CBaseLesson::IsTimedOut( void )
{
VPROF_BUDGET( "CBaseLesson::IsTimedOut", "GameInstructor" );
// Check for no timeout
if ( m_fTimeout == 0.0f )
return false;
float fStartTime = m_fStartTime;
if ( GetRoot()->IsLearned() )
{
if ( !m_bBumpWithTimeoutWhenLearned )
{
// Time out instantly if we've learned this and don't want to keep it open for priority bumping
return true;
}
else
{
// It'll never be active, so lets use timeout based on when it was initialized
fStartTime = m_fInitTime;
}
}
if ( !fStartTime )
{
if ( !m_bCanTimeoutWhileInactive )
{
return false;
}
// Not active, so lets use timeout based on when it was initialized
fStartTime = m_fInitTime;
}
bool bTimedOut = ( fStartTime + m_fTimeout < gpGlobals->curtime );
if ( bTimedOut )
{
SetCloseReason( "Timed out." );
}
return bTimedOut;
}
void CBaseLesson::ResetDisplaysAndSuccesses( void )
{
m_iDisplayCount = 0;
m_bSuccessCounted = false;
m_iSuccessCount = 0;
}
bool CBaseLesson::IncDisplayCount( void )
{
if ( m_iDisplayCount < m_iDisplayLimit )
{
m_iDisplayCount++;
return true;
}
return false;
}
bool CBaseLesson::IncSuccessCount( void )
{
if ( m_iSuccessCount < m_iSuccessLimit )
{
m_iSuccessCount++;
return true;
}
return false;
}
void CBaseLesson::Init( void )
{
m_pRoot = NULL;
m_bSuccessCounted = false;
SetCloseReason( "None given." );
m_iPriority = LESSON_PRIORITY_MAX; // Set to invalid value to ensure that it is actually set later on
m_iInstanceType = LESSON_INSTANCE_MULTIPLE;
m_iFixedInstancesMax = 1;
m_bReplaceOnlyWhenStopped = false;
m_iTeam = TEAM_ANY;
m_bOnlyKeyboard = false;
m_bOnlyGamepad = false;
m_iDisplayLimit = 0;
m_iDisplayCount = 0;
m_bWasDisplayed = false;
m_iSuccessLimit = 0;
m_iSuccessCount = 0;
m_fLockDuration = 0.0f;
m_bCanOpenWhenDead = false;
m_bBumpWithTimeoutWhenLearned = false;
m_bCanTimeoutWhileInactive = false;
m_fTimeout = 0.0f;
m_fInitTime = gpGlobals->curtime;
m_fStartTime = 0.0f;
m_fLockTime = 0.0f;
m_fUpdateInterval = 0.5;
m_bHasPlayedSound = false;
m_szStartSound = "Instructor.LessonStart";
m_szLessonGroup = "";
m_iNumDelayedPlayerSwaps = 0;
}
void CBaseLesson::TakePlaceOf( CBaseLesson *pLesson )
{
// Transfer over marked as displayed so a replaced lesson won't count as an extra display
m_bWasDisplayed = pLesson->m_bWasDisplayed;
pLesson->m_bWasDisplayed = false;
}
void CBaseLesson::MarkSucceeded( void )
{
if ( !m_bSuccessCounted )
{
GetGameInstructor().MarkSucceeded( GetName() );
m_bSuccessCounted = true;
}
}
void CBaseLesson::CloseOpportunity( const char *pchReason )
{
SetCloseReason( pchReason );
m_bIsOpenOpportunity = false;
}
bool CBaseLesson::DoDelayedPlayerSwaps( void ) const
{
// A bot has swapped places with a player or player with a bot...
// At the time of the actual swap there was no client representation for the new player...
// So that swap was queued up and now we're going to make things right!
while ( m_iNumDelayedPlayerSwaps )
{
C_BasePlayer *pNewPlayer = UTIL_PlayerByUserId( m_pDelayedPlayerSwap[ m_iNumDelayedPlayerSwaps - 1 ].iNewUserID );
if ( !pNewPlayer )
{
// There is still no client representation of the new player, we'll have to try again later
if ( gameinstructor_verbose.GetInt() > 1 )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tFailed delayed player swap!" );
}
return false;
}
if ( gameinstructor_verbose.GetInt() > 1 )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tSuccessful delayed player swap!" );
}
m_pDelayedPlayerSwap[ m_iNumDelayedPlayerSwaps - 1 ].phHandleToChange->Set( pNewPlayer );
m_iNumDelayedPlayerSwaps--;
}
return true;
}
//
// CTextLesson
//
void CTextLesson::Init( void )
{
m_szDisplayText = "";
m_szDisplayParamText = "";
m_szBinding = "";
m_szGamepadBinding = "";
}
void CTextLesson::Start( void )
{
// TODO: Display some text
//m_szDisplayText
}
void CTextLesson::Stop( void )
{
// TODO: Clean up text
}
//
// CIconLesson
//
void CIconLesson::Init( void )
{
m_hIconTarget = NULL;
m_szVguiTargetName = "";
m_szVguiTargetLookup = "";
m_nVguiTargetEdge = 0;
m_hLocatorTarget = -1;
m_bFixedPosition = false;
m_bNoIconTarget = false;
m_bAllowNodrawTarget = false;
m_bVisible = true;
m_bShowWhenOccluded = true;
m_bNoOffscreen = false;
m_bForceCaption = false;
m_szOnscreenIcon = "";
m_szOffscreenIcon = "";
m_flUpOffset = 0.0f;
m_flRelativeUpOffset = 0.0f;
m_fFixedPositionX = 0.0f;
m_fFixedPositionY = 0.0f;
m_fRange = 0.0f;
m_fCurrentDistance = 0.0f;
m_fOnScreenStartTime = 0.0f;
m_fUpdateDistanceTime = 0.0f;
m_iFlags = LOCATOR_ICON_FX_NONE;
m_szCaptionColor = "255,255,255";// Default to white
}
void CIconLesson::Start( void )
{
if ( !DoDelayedPlayerSwaps() )
{
return;
}
// Display some text
C_BaseEntity *pIconTarget = m_hIconTarget.Get();
if ( !pIconTarget )
{
if ( !m_bNoIconTarget )
{
// Wanted one, but couldn't get it
CloseOpportunity( "Icon Target handle went invalid before the lesson started!" );
}
return;
}
else
{
if ( ( pIconTarget->IsEffectActive( EF_NODRAW ) || pIconTarget->IsDormant() ) && !m_bAllowNodrawTarget )
{
// We don't allow no draw entities
CloseOpportunity( "Icon Target is using effect NODRAW and allow_nodraw_target is false!" );
return;
}
}
CLocatorTarget *pLocatorTarget = NULL;
if( m_hLocatorTarget != -1 )
{
// Lets try the handle that we've held on to
pLocatorTarget = Locator_GetTargetFromHandle( m_hLocatorTarget );
if ( !pLocatorTarget )
{
// It's gone stale, get a new target
m_hLocatorTarget = Locator_AddTarget();
pLocatorTarget = Locator_GetTargetFromHandle( m_hLocatorTarget );
}
}
else
{
// Get a new target
m_hLocatorTarget = Locator_AddTarget();
pLocatorTarget = Locator_GetTargetFromHandle( m_hLocatorTarget );
}
if( m_hLocatorTarget == -1 || !pLocatorTarget )
{
CloseOpportunity( "Could not get a handle for new locator target. Too many targets in use!" );
return;
}
pLocatorTarget->AddIconEffects( m_iFlags );
pLocatorTarget->SetCaptionColor( GetCaptionColorString() );
UpdateLocatorTarget( pLocatorTarget, pIconTarget );
// Update occlusion data
Locator_ComputeTargetIconPositionFromHandle( m_hLocatorTarget );
}
void CIconLesson::Stop( void )
{
if ( !DoDelayedPlayerSwaps() )
{
return;
}
if ( m_hLocatorTarget != -1 )
{
Locator_RemoveTarget( m_hLocatorTarget );
}
m_fOnScreenStartTime = 0.0f;
}
void CIconLesson::Update( void )
{
if ( !DoDelayedPlayerSwaps() )
{
return;
}
C_BaseEntity *pIconTarget = m_hIconTarget.Get();
if ( !pIconTarget )
{
if ( !m_bNoIconTarget )
{
CloseOpportunity( "Lost our icon target handle returned NULL." );
}
return;
}
else
{
if ( ( pIconTarget->IsEffectActive( EF_NODRAW ) || pIconTarget->IsDormant() ) && !m_bAllowNodrawTarget )
{
// We don't allow no draw entities
CloseOpportunity( "Icon Target is using effect NODRAW and allow_nodraw_target is false!" );
return;
}
}
CLocatorTarget *pLocatorTarget = Locator_GetTargetFromHandle( m_hLocatorTarget );
if ( !pLocatorTarget )
{
// Temp instrumentation to catch a bug - possibly calling Update without having called Start?
Warning( "Problem in lesson %s: Locator_GetTargetFromHandle returned null for handle %d.\n IsInstanceActive: %s. IsInstructing: %s. IsLearned: %s\n",
GetName(), m_hLocatorTarget,
(IsInstanceActive() ? "yes" : "no"),
(IsInstructing() ? "yes" : "no"),
(IsLearned() ? "yes" : "no") );
CloseOpportunity( "Lost locator target handle." );
return;
}
UpdateLocatorTarget( pLocatorTarget, pIconTarget );
C_BasePlayer *pLocalPlayer = GetGameInstructor().GetLocalPlayer();
// Check if it has been onscreen long enough to count as being displayed
if ( m_fOnScreenStartTime == 0.0f )
{
if ( pLocatorTarget->IsOnScreen() && ( IsPresentComplete() || ( pLocatorTarget->GetIconEffectsFlags() & LOCATOR_ICON_FX_STATIC ) ) )
{
// Is either static or has finished presenting and is on screen
m_fOnScreenStartTime = gpGlobals->curtime;
}
}
else
{
if ( !pLocatorTarget->IsOnScreen() )
{
// Was visible before, but it isn't now
m_fOnScreenStartTime = 0.0f;
}
else if ( gpGlobals->curtime - m_fOnScreenStartTime >= LESSON_MIN_TIME_ON_SCREEN_TO_MARK_DISPLAYED )
{
// Lesson on screen long enough to be counted as displayed
m_bWasDisplayed = true;
}
}
if ( m_fUpdateDistanceTime < gpGlobals->curtime )
{
// Update it's distance from the local player
C_BaseEntity *pTarget = m_hIconTarget.Get();
if ( !pLocalPlayer || !pTarget || pLocalPlayer == pTarget )
{
m_fCurrentDistance = 0.0f;
}
else
{
m_fCurrentDistance = pLocalPlayer->ActivePlayerCombatCharacter()->EyePosition().DistTo( pTarget->WorldSpaceCenter() );
}
m_fUpdateDistanceTime = gpGlobals->curtime + LESSON_DISTANCE_UPDATE_RATE;
}
}
void CIconLesson::UpdateInactive( void )
{
if ( m_fUpdateDistanceTime < gpGlobals->curtime )
{
if ( !DoDelayedPlayerSwaps() )
{
return;
}
C_BaseEntity *pIconTarget = m_hIconTarget.Get();
if ( !pIconTarget )
{
if ( !m_bNoIconTarget )
{
CloseOpportunity( "Lost our icon target handle returned NULL." );
}
m_fCurrentDistance = 0.0f;
return;
}
else
{
if ( ( pIconTarget->IsEffectActive( EF_NODRAW ) || pIconTarget->IsDormant() ) && !m_bAllowNodrawTarget )
{
// We don't allow no draw entities
CloseOpportunity( "Icon Target is using effect NODRAW and allow_nodraw_target is false!" );
return;
}
}
// Update it's distance from the local player
C_BasePlayer *pLocalPlayer = GetGameInstructor().GetLocalPlayer();
if ( !pLocalPlayer || pLocalPlayer == pIconTarget )
{
m_fCurrentDistance = 0.0f;
}
else
{
m_fCurrentDistance = pLocalPlayer->ActivePlayerCombatCharacter()->EyePosition().DistTo( pIconTarget->WorldSpaceCenter() );
}
m_fUpdateDistanceTime = gpGlobals->curtime + LESSON_DISTANCE_UPDATE_RATE;
}
}
bool CIconLesson::ShouldDisplay( void ) const
{
VPROF_BUDGET( "CIconLesson::ShouldDisplay", "GameInstructor" );
if ( !DoDelayedPlayerSwaps() )
{
return false;
}
if ( m_fRange > 0.0f && m_fCurrentDistance > m_fRange )
{
// Distance to target is more than the max range
return false;
}
if ( !m_bShowWhenOccluded && m_hLocatorTarget >= 0 )
{
CLocatorTarget *pLocatorTarget = Locator_GetTargetFromHandle( m_hLocatorTarget );
if ( pLocatorTarget && pLocatorTarget->IsOccluded() )
{
// Target is occluded and doesn't want to be shown when occluded
return false;
}
}
// Ok to display
return true;
}
bool CIconLesson::IsVisible( void ) const
{
VPROF_BUDGET( "CIconLesson::IsVisible", "GameInstructor" );
if( m_hLocatorTarget == -1 )
{
// If it doesn't want a target, it's "visible" otherwise we'll have to call it invisible
return m_bNoIconTarget;
}
CLocatorTarget *pLocatorTarget = Locator_GetTargetFromHandle( m_hLocatorTarget );
if ( !pLocatorTarget )
{
return false;
}
return pLocatorTarget->IsVisible();
}
void CIconLesson::SwapOutPlayers( int iOldUserID, int iNewUserID )
{
BaseClass::SwapOutPlayers( iOldUserID, iNewUserID );
if ( m_bNoIconTarget )
return;
// Get the player pointers from the user IDs
C_BasePlayer *pOldPlayer = UTIL_PlayerByUserId( iOldUserID );
C_BasePlayer *pNewPlayer = UTIL_PlayerByUserId( iNewUserID );
if ( pOldPlayer == m_hIconTarget.Get() )
{
if ( pNewPlayer )
{
m_hIconTarget = pNewPlayer;
}
else
{
if ( m_iNumDelayedPlayerSwaps < MAX_DELAYED_PLAYER_SWAPS )
{
m_pDelayedPlayerSwap[ m_iNumDelayedPlayerSwaps ].phHandleToChange = &m_hIconTarget;
m_pDelayedPlayerSwap[ m_iNumDelayedPlayerSwaps ].iNewUserID = iNewUserID;
++m_iNumDelayedPlayerSwaps;
}
}
}
}
void CIconLesson::TakePlaceOf( CBaseLesson *pLesson )
{
BaseClass::TakePlaceOf( pLesson );
const CIconLesson *pIconLesson = dynamic_cast<const CIconLesson*>( pLesson );
if ( pIconLesson )
{
if ( pIconLesson->m_hLocatorTarget != -1 )
{
CLocatorTarget *pLocatorTarget = Locator_GetTargetFromHandle( pIconLesson->m_hLocatorTarget );
if ( pLocatorTarget )
{
// This one draw right to the hud... use it's icon target handle
m_hLocatorTarget = pIconLesson->m_hLocatorTarget;
}
}
m_fOnScreenStartTime = pIconLesson->m_fOnScreenStartTime;
}
}
void CIconLesson::SetLocatorBinding( CLocatorTarget * pLocatorTarget )
{
if ( IsX360() || input->ControllerModeActive() )
{
// Try to use gamepad bindings first
if ( m_szGamepadBinding.String()[ 0 ] != '\0' )
{
// Found gamepad binds!
pLocatorTarget->SetBinding( m_szGamepadBinding.String() );
}
else
{
// No gamepad binding, so fallback to the regular binding
pLocatorTarget->SetBinding( m_szBinding.String() );
}
}
else
{
// Always use the regular binding when the gamepad is disabled
pLocatorTarget->SetBinding( m_szBinding.String() );
}
}
bool CIconLesson::IsPresentComplete( void )
{
if ( m_hLocatorTarget == -1 )
return false;
CLocatorTarget *pLocatorTarget = Locator_GetTargetFromHandle( m_hLocatorTarget );
if ( !pLocatorTarget )
return false;
return !pLocatorTarget->IsPresenting();
}
void CIconLesson::PresentStart( void )
{
if ( m_hLocatorTarget == -1 )
return;
CLocatorTarget *pLocatorTarget = Locator_GetTargetFromHandle( m_hLocatorTarget );
if ( !pLocatorTarget )
return;
pLocatorTarget->StartPresent();
}
void CIconLesson::PresentEnd( void )
{
if ( m_hLocatorTarget == -1 )
return;
CLocatorTarget *pLocatorTarget = Locator_GetTargetFromHandle( m_hLocatorTarget );
if ( !pLocatorTarget )
return;
pLocatorTarget->EndPresent();
}
void CIconLesson::UpdateLocatorTarget( CLocatorTarget *pLocatorTarget, C_BaseEntity *pIconTarget )
{
if ( m_bFixedPosition )
{
pLocatorTarget->m_bOriginInScreenspace = true;
pLocatorTarget->m_vecOrigin.x = m_fFixedPositionX;
pLocatorTarget->m_vecOrigin.y = m_fFixedPositionY;
pLocatorTarget->SetVguiTargetName( m_szVguiTargetName.String() );
pLocatorTarget->SetVguiTargetLookup( m_szVguiTargetLookup.String() );
pLocatorTarget->SetVguiTargetEdge( m_nVguiTargetEdge );
}
else
{
pLocatorTarget->m_bOriginInScreenspace = false;
pLocatorTarget->m_vecOrigin = pIconTarget->EyePosition() + MainViewUp( 0 ) * m_flRelativeUpOffset + Vector( 0.0f, 0.0f, m_flUpOffset );
pLocatorTarget->SetVguiTargetName( "" );
}
const char *pchDisplayParamText = m_szDisplayParamText.String();
#ifdef INFESTED_DLL
char szCustomName[ 256 ];
#endif
// Check if the parameter is the be the player display name
if ( Q_stricmp( pchDisplayParamText, "use_name" ) == 0 )
{
// Fix up the player display name
C_BasePlayer *pPlayer = ToBasePlayer( pIconTarget );
if ( pPlayer )
{
pchDisplayParamText = pPlayer->GetPlayerName();
}
else
{
bool bNoName = true;
#ifdef INFESTED_DLL
C_ASW_Marine *pMarine = dynamic_cast< C_ASW_Marine* >( pIconTarget );
if ( pMarine )
{
C_ASW_Marine_Resource *pMR = pMarine->GetMarineResource();
if ( pMR )
{
pMR->GetDisplayName( szCustomName, sizeof( szCustomName ) );
pchDisplayParamText = szCustomName;
bNoName = false;
}
}
#endif
if ( bNoName )
{
// It's not a player!
pchDisplayParamText = "";
}
}
}
pLocatorTarget->SetCaptionText( m_szDisplayText.String(), pchDisplayParamText );
SetLocatorBinding( pLocatorTarget );
pLocatorTarget->SetOnscreenIconTextureName( m_szOnscreenIcon.String() );
pLocatorTarget->SetOffscreenIconTextureName( m_szOffscreenIcon.String() );
pLocatorTarget->SetVisible( m_bVisible );
C_BasePlayer *pLocalPlayer = GetGameInstructor().GetLocalPlayer();
if( !m_bFixedPosition &&
( ( pLocalPlayer != NULL && pLocalPlayer == m_hIconTarget ) ||
GetClientWorldEntity() == m_hIconTarget ) )
{
// Mark this icon as a static icon that draws in a fixed
// location on the hud rather than tracking an object
// in 3D space.
pLocatorTarget->AddIconEffects( LOCATOR_ICON_FX_STATIC );
}
else
{
pLocatorTarget->AddIconEffects( LOCATOR_ICON_FX_NONE );
}
if ( m_bNoOffscreen )
{
pLocatorTarget->AddIconEffects( LOCATOR_ICON_FX_NO_OFFSCREEN );
}
else
{
pLocatorTarget->RemoveIconEffects( LOCATOR_ICON_FX_NO_OFFSCREEN );
}
if( m_bForceCaption || IsLocked() )
{
pLocatorTarget->AddIconEffects( LOCATOR_ICON_FX_FORCE_CAPTION );
}
else
{
pLocatorTarget->RemoveIconEffects( LOCATOR_ICON_FX_FORCE_CAPTION );
}
pLocatorTarget->Update();
if ( pLocatorTarget->m_bIsDrawing )
{
if ( !m_bHasPlayedSound )
{
GetGameInstructor().PlaySound( m_szStartSound.String() );
m_bHasPlayedSound = true;
}
}
}
//
// CScriptedIconLesson
//
// Linking variables to scriptable entries is done here!
// The first parameter correlates to the case insensitive string name read from scripts.
// This macro generates code that passes this consistent variable data in to other macros
#define LESSON_VARIABLE_FACTORY \
LESSON_VARIABLE_MACRO_EHANDLE( VOID, m_hLocalPlayer, EHANDLE ) \
\
LESSON_VARIABLE_MACRO_EHANDLE( LOCAL_PLAYER, m_hLocalPlayer, EHANDLE ) \
LESSON_VARIABLE_MACRO( OUTPUT, m_fOutput, float ) \
\
LESSON_VARIABLE_MACRO_EHANDLE( ENTITY1, m_hEntity1, EHANDLE ) \
LESSON_VARIABLE_MACRO_EHANDLE( ENTITY2, m_hEntity2, EHANDLE ) \
LESSON_VARIABLE_MACRO_STRING( STRING1, m_szString1, CGameInstructorSymbol ) \
LESSON_VARIABLE_MACRO_STRING( STRING2, m_szString2, CGameInstructorSymbol ) \
LESSON_VARIABLE_MACRO( INTEGER1, m_iInteger1, int ) \
LESSON_VARIABLE_MACRO( INTEGER2, m_iInteger2, int ) \
LESSON_VARIABLE_MACRO( FLOAT1, m_fFloat1, float ) \
LESSON_VARIABLE_MACRO( FLOAT2, m_fFloat2, float ) \
\
LESSON_VARIABLE_MACRO_EHANDLE( ICON_TARGET, m_hIconTarget, EHANDLE ) \
LESSON_VARIABLE_MACRO_STRING( VGUI_TARGET_NAME, m_szVguiTargetName, CGameInstructorSymbol ) \
LESSON_VARIABLE_MACRO_STRING( VGUI_TARGET_LOOKUP, m_szVguiTargetLookup, CGameInstructorSymbol ) \
LESSON_VARIABLE_MACRO( VGUI_TARGET_EDGE, m_nVguiTargetEdge, int ) \
LESSON_VARIABLE_MACRO( FIXED_POSITION_X, m_fFixedPositionX, float ) \
LESSON_VARIABLE_MACRO( FIXED_POSITION_Y, m_fFixedPositionY, float ) \
LESSON_VARIABLE_MACRO_BOOL( FIXED_POSITION, m_bFixedPosition, bool ) \
LESSON_VARIABLE_MACRO_BOOL( NO_ICON_TARGET, m_bNoIconTarget, bool ) \
LESSON_VARIABLE_MACRO_BOOL( ALLOW_NODRAW_TARGET, m_bAllowNodrawTarget, bool ) \
LESSON_VARIABLE_MACRO_BOOL( VISIBLE, m_bVisible, bool ) \
LESSON_VARIABLE_MACRO_BOOL( SHOW_WHEN_OCCLUDED, m_bShowWhenOccluded, bool ) \
LESSON_VARIABLE_MACRO_BOOL( NO_OFFSCREEN, m_bNoOffscreen, bool ) \
LESSON_VARIABLE_MACRO_BOOL( FORCE_CAPTION, m_bForceCaption, bool ) \
LESSON_VARIABLE_MACRO_STRING( ONSCREEN_ICON, m_szOnscreenIcon, CGameInstructorSymbol ) \
LESSON_VARIABLE_MACRO_STRING( OFFSCREEN_ICON, m_szOffscreenIcon, CGameInstructorSymbol ) \
LESSON_VARIABLE_MACRO( ICON_OFFSET, m_flUpOffset, float ) \
LESSON_VARIABLE_MACRO( ICON_RELATIVE_OFFSET, m_flRelativeUpOffset, float ) \
LESSON_VARIABLE_MACRO( RANGE, m_fRange, float ) \
\
LESSON_VARIABLE_MACRO( FLAGS, m_iFlags, int ) \
LESSON_VARIABLE_MACRO_STRING( CAPTION_COLOR, m_szCaptionColor, CGameInstructorSymbol ) \
LESSON_VARIABLE_MACRO_STRING( GROUP, m_szLessonGroup, CGameInstructorSymbol ) \
\
LESSON_VARIABLE_MACRO_STRING( CAPTION, m_szDisplayText, CGameInstructorSymbol ) \
LESSON_VARIABLE_MACRO_STRING( CAPTION_PARAM, m_szDisplayParamText, CGameInstructorSymbol ) \
LESSON_VARIABLE_MACRO_STRING( BINDING, m_szBinding, CGameInstructorSymbol ) \
LESSON_VARIABLE_MACRO_STRING( GAMEPAD_BINDING, m_szGamepadBinding, CGameInstructorSymbol ) \
\
LESSON_VARIABLE_MACRO( PRIORITY, m_iPriority, int ) \
LESSON_VARIABLE_MACRO_STRING( REPLACE_KEY, m_stringReplaceKey, CGameInstructorSymbol ) \
\
LESSON_VARIABLE_MACRO( LOCK_DURATION, m_fLockDuration, float ) \
LESSON_VARIABLE_MACRO_BOOL( CAN_OPEN_WHEN_DEAD, m_bCanOpenWhenDead, bool ) \
LESSON_VARIABLE_MACRO_BOOL( BUMP_WITH_TIMEOUT_WHEN_LEARNED, m_bBumpWithTimeoutWhenLearned, bool ) \
LESSON_VARIABLE_MACRO_BOOL( CAN_TIMEOUT_WHILE_INACTIVE, m_bCanTimeoutWhileInactive, bool ) \
LESSON_VARIABLE_MACRO( TIMEOUT, m_fTimeout, float ) \
LESSON_VARIABLE_MACRO( UPDATE_INTERVAL, m_fUpdateInterval, float ) \
LESSON_VARIABLE_MACRO_STRING( START_SOUND, m_szStartSound, CGameInstructorSymbol ) \
// Create keyvalues name symbol
#define LESSON_VARIABLE_SYMBOL( _varEnum, _varName, _varType ) static int g_n##_varEnum##Symbol;
#define LESSON_VARIABLE_INIT_SYMBOL( _varEnum, _varName, _varType ) g_n##_varEnum##Symbol = KeyValuesSystem()->GetSymbolForString( #_varEnum );
#define LESSON_SCRIPT_STRING_ADD_TO_MAP( _varEnum, _varName, _varType ) g_NameToTypeMap.Insert( #_varEnum, LESSON_VARIABLE_##_varEnum## );
// Create enum value
#define LESSON_VARIABLE_ENUM( _varEnum, _varName, _varType ) LESSON_VARIABLE_##_varEnum##,
// Init info call
#define LESSON_VARIABLE_INIT_INFO_CALL( _varEnum, _varName, _varType ) g_pLessonVariableInfo[ LESSON_VARIABLE_##_varEnum## ].Init_##_varEnum##();
// Init info
#define LESSON_VARIABLE_INIT_INFO( _varEnum, _varName, _varType ) \
void Init_##_varEnum##( void ) \
{ \
iOffset = offsetof( CScriptedIconLesson, CScriptedIconLesson::##_varName## ); \
varType = LessonParamTypeFromString( #_varType ); \
}
#define LESSON_VARIABLE_INIT_INFO_BOOL( _varEnum, _varName, _varType ) \
void Init_##_varEnum##( void ) \
{ \
iOffset = offsetof( CScriptedIconLesson, CScriptedIconLesson::##_varName## ); \
varType = FIELD_BOOLEAN; \
}
#define LESSON_VARIABLE_INIT_INFO_EHANDLE( _varEnum, _varName, _varType ) \
void Init_##_varEnum##( void ) \
{ \
iOffset = offsetof( CScriptedIconLesson, CScriptedIconLesson::##_varName## ); \
varType = FIELD_EHANDLE; \
}
#define LESSON_VARIABLE_INIT_INFO_STRING( _varEnum, _varName, _varType ) \
void Init_##_varEnum##( void ) \
{ \
iOffset = offsetof( CScriptedIconLesson, CScriptedIconLesson::##_varName## ); \
varType = FIELD_STRING; \
}
// Copy defaults into this scripted lesson into a new one
#define LESSON_VARIABLE_DEFAULT( _varEnum, _varName, _varType ) ( _varName = m_pDefaultHolder->_varName );
// Copy a variable from this scripted lesson into a new one
#define LESSON_VARIABLE_COPY( _varEnum, _varName, _varType ) ( pOpenLesson->_varName = _varName );
// Return the first param if pchName is the same as the second param
#define LESSON_SCRIPT_STRING( _type, _string ) \
if ( Q_stricmp( pchName, _string ) == 0 )\
{\
return _type;\
}
// Wrapper for using this macro in the factory
#define LESSON_SCRIPT_STRING_GENERAL( _varEnum, _varName, _varType ) LESSON_SCRIPT_STRING( LESSON_VARIABLE_##_varEnum##, #_varEnum )
// Process the element action on this variable
#define PROCESS_LESSON_ACTION( _varEnum, _varName, _varType ) \
case LESSON_VARIABLE_##_varEnum##:\
return ProcessElementAction( pLessonElement->iAction, pLessonElement->bNot, #_varName, _varName, &pLessonElement->szParam, eventParam_float );
#define PROCESS_LESSON_ACTION_EHANDLE( _varEnum, _varName, _varType ) \
case LESSON_VARIABLE_##_varEnum##:\
return ProcessElementAction( pLessonElement->iAction, pLessonElement->bNot, #_varName, _varName, &pLessonElement->szParam, eventParam_float, eventParam_BaseEntity, eventParam_string );
#define PROCESS_LESSON_ACTION_STRING( _varEnum, _varName, _varType ) \
case LESSON_VARIABLE_##_varEnum##:\
return ProcessElementAction( pLessonElement->iAction, pLessonElement->bNot, #_varName, &_varName, &pLessonElement->szParam, eventParam_string );
// Init the variable from the script (or a convar)
#define LESSON_VARIABLE_INIT( _varEnum, _varName, _varType ) \
else if ( g_n##_varEnum##Symbol == pSubKey->GetNameSymbol() ) \
{ \
const char *pchParam = pSubKey->GetString(); \
if ( pchParam && StringHasPrefix( pchParam, "convar " ) ) \
{ \
ConVarRef tempCVar( pchParam + Q_strlen( "convar " ) ); \
if ( tempCVar.IsValid() ) \
{ \
_varName = static_cast<_varType>( tempCVar.GetFloat() ); \
} \
else \
{ \
_varName = static_cast<_varType>( 0.0f ); \
} \
} \
else \
{ \
_varName = static_cast<_varType>( pSubKey->GetFloat() ); \
} \
}
#define LESSON_VARIABLE_INIT_BOOL( _varEnum, _varName, _varType ) \
else if ( Q_stricmp( #_varEnum, pSubKey->GetName() ) == 0 ) \
{ \
_varName = pSubKey->GetBool(); \
}
#define LESSON_VARIABLE_INIT_EHANDLE( _varEnum, _varName, _varType ) \
else if ( g_n##_varEnum##Symbol == pSubKey->GetNameSymbol() ) \
{ \
DevWarning( "Can't initialize an EHANDLE from the instructor lesson script." ); \
}
#define LESSON_VARIABLE_INIT_STRING( _varEnum, _varName, _varType ) \
else if ( g_n##_varEnum##Symbol == pSubKey->GetNameSymbol() ) \
{ \
const char *pchParam = pSubKey->GetString(); \
if ( pchParam && StringHasPrefix( pchParam, "convar " ) ) \
{ \
ConVarRef tempCVar( pchParam + Q_strlen( "convar " ) ); \
if ( tempCVar.IsValid() ) \
{ \
_varName = tempCVar.GetString(); \
} \
else \
{ \
_varName = ""; \
} \
} \
else \
{ \
_varName = pSubKey->GetString(); \
} \
}
// Gets a scripted variable by offset and casts it to the proper type
#define LESSON_VARIABLE_GET_FROM_OFFSET( _type, _offset ) *static_cast<_type*>( static_cast<void*>( static_cast<byte*>( static_cast<void*>( this ) ) + _offset ) )
// Enum of scripted variables
enum LessonVariable
{
// Run enum macros on all scriptable variables (see: LESSON_VARIABLE_FACTORY definition)
#define LESSON_VARIABLE_MACRO LESSON_VARIABLE_ENUM
#define LESSON_VARIABLE_MACRO_BOOL LESSON_VARIABLE_ENUM
#define LESSON_VARIABLE_MACRO_EHANDLE LESSON_VARIABLE_ENUM
#define LESSON_VARIABLE_MACRO_STRING LESSON_VARIABLE_ENUM
LESSON_VARIABLE_FACTORY
#undef LESSON_VARIABLE_MACRO
#undef LESSON_VARIABLE_MACRO_BOOL
#undef LESSON_VARIABLE_MACRO_EHANDLE
#undef LESSON_VARIABLE_MACRO_STRING
LESSON_VARIABLE_TOTAL
};
// Declare the keyvalues symbols for the keynames
#define LESSON_VARIABLE_MACRO LESSON_VARIABLE_SYMBOL
#define LESSON_VARIABLE_MACRO_BOOL LESSON_VARIABLE_SYMBOL
#define LESSON_VARIABLE_MACRO_EHANDLE LESSON_VARIABLE_SYMBOL
#define LESSON_VARIABLE_MACRO_STRING LESSON_VARIABLE_SYMBOL
LESSON_VARIABLE_FACTORY
#undef LESSON_VARIABLE_MACRO
#undef LESSON_VARIABLE_MACRO_BOOL
#undef LESSON_VARIABLE_MACRO_EHANDLE
#undef LESSON_VARIABLE_MACRO_STRING
// String lookup prototypes
LessonVariable LessonVariableFromString( const char *pchName, bool bWarnOnInvalidNames = true );
_fieldtypes LessonParamTypeFromString( const char *pchName );
int LessonActionFromString( const char *pchName );
// This is used to get type info an variable offsets from the variable enumerated value
class LessonVariableInfo
{
public:
LessonVariableInfo( void )
: iOffset( 0 ), varType( FIELD_VOID )
{
}
// Run init info macros on all scriptable variables (see: LESSON_VARIABLE_FACTORY definition)
#define LESSON_VARIABLE_MACRO LESSON_VARIABLE_INIT_INFO
#define LESSON_VARIABLE_MACRO_BOOL LESSON_VARIABLE_INIT_INFO_BOOL
#define LESSON_VARIABLE_MACRO_EHANDLE LESSON_VARIABLE_INIT_INFO_EHANDLE
#define LESSON_VARIABLE_MACRO_STRING LESSON_VARIABLE_INIT_INFO_STRING
LESSON_VARIABLE_FACTORY
#undef LESSON_VARIABLE_MACRO
#undef LESSON_VARIABLE_MACRO_BOOL
#undef LESSON_VARIABLE_MACRO_EHANDLE
#undef LESSON_VARIABLE_MACRO_STRING
public:
int iOffset;
_fieldtypes varType;
};
LessonVariableInfo g_pLessonVariableInfo[ LESSON_VARIABLE_TOTAL ];
const LessonVariableInfo *GetLessonVariableInfo( int iLessonVariable )
{
Assert( iLessonVariable >= 0 && iLessonVariable < LESSON_VARIABLE_TOTAL );
if ( g_pLessonVariableInfo[ 0 ].varType == FIELD_VOID )
{
// Run init info call macros on all scriptable variables (see: LESSON_VARIABLE_FACTORY definition)
#define LESSON_VARIABLE_MACRO LESSON_VARIABLE_INIT_INFO_CALL
#define LESSON_VARIABLE_MACRO_BOOL LESSON_VARIABLE_INIT_INFO_CALL
#define LESSON_VARIABLE_MACRO_EHANDLE LESSON_VARIABLE_INIT_INFO_CALL
#define LESSON_VARIABLE_MACRO_STRING LESSON_VARIABLE_INIT_INFO_CALL
LESSON_VARIABLE_FACTORY
#undef LESSON_VARIABLE_MACRO
#undef LESSON_VARIABLE_MACRO_BOOL
#undef LESSON_VARIABLE_MACRO_EHANDLE
#undef LESSON_VARIABLE_MACRO_STRING
}
return &(g_pLessonVariableInfo[ iLessonVariable ]);
}
static CUtlDict< LessonVariable, int > g_NameToTypeMap;
static CUtlDict< fieldtype_t, int > g_TypeToParamTypeMap;
CUtlDict< int, int > CScriptedIconLesson::LessonActionMap;
CScriptedIconLesson::~CScriptedIconLesson( void )
{
if ( m_pDefaultHolder )
{
delete m_pDefaultHolder;
m_pDefaultHolder = NULL;
}
}
void CScriptedIconLesson::Init( void )
{
m_hLocalPlayer.Set( NULL );
m_fOutput = 0.0f;
m_hEntity1.Set( NULL );
m_hEntity2.Set( NULL );
m_szString1 = "";
m_szString2 = "";
m_iInteger1 = 0;
m_iInteger2 = 0;
m_fFloat1 = 0.0f;
m_fFloat2 = 0.0f;
m_fUpdateEventTime = 0.0f;
m_pDefaultHolder = NULL;
m_iScopeDepth = 0;
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerboseHeader, "GAME INSTRUCTOR: " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "Initializing scripted lesson " );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"", GetName() );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "...\n" );
}
if ( !IsDefaultHolder() )
{
if ( !IsOpenOpportunity() )
{
// Initialize from the key value file
InitFromKeys( GetGameInstructor().GetScriptKeys() );
if ( m_iPriority >= LESSON_PRIORITY_MAX )
{
DevWarning( "Priority level not set for lesson: %s\n", GetName() );
}
// We use this to remember variable defaults to be reset before each open attempt
m_pDefaultHolder = new CScriptedIconLesson( GetName(), true, false, m_nSplitScreenSlot );
CScriptedIconLesson *pOpenLesson = m_pDefaultHolder;
// Run copy macros on all default scriptable variables (see: LESSON_VARIABLE_FACTORY definition)
#define LESSON_VARIABLE_MACRO LESSON_VARIABLE_COPY
#define LESSON_VARIABLE_MACRO_BOOL LESSON_VARIABLE_COPY
#define LESSON_VARIABLE_MACRO_EHANDLE LESSON_VARIABLE_COPY
#define LESSON_VARIABLE_MACRO_STRING LESSON_VARIABLE_COPY
LESSON_VARIABLE_FACTORY
#undef LESSON_VARIABLE_MACRO
#undef LESSON_VARIABLE_MACRO_BOOL
#undef LESSON_VARIABLE_MACRO_EHANDLE
#undef LESSON_VARIABLE_MACRO_STRING
// Listen for open events
for ( int iLessonEvent = 0; iLessonEvent < m_OpenEvents.Count(); ++iLessonEvent )
{
const LessonEvent_t *pLessonEvent = &(m_OpenEvents[ iLessonEvent ]);
ListenForGameEvent( pLessonEvent->szEventName.String() );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tListen for open event " );
ConColorMsg( CBaseLesson::m_rgbaVerboseOpen, "\"%s\"", pLessonEvent->szEventName.String());
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ".\n" );
}
}
// Listen for close events
for ( int iLessonEvent = 0; iLessonEvent < m_CloseEvents.Count(); ++iLessonEvent )
{
const LessonEvent_t *pLessonEvent = &(m_CloseEvents[ iLessonEvent ]);
ListenForGameEvent( pLessonEvent->szEventName.String() );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tListen for close event " );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\"%s\"", pLessonEvent->szEventName.String());
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ".\n" );
}
}
// Listen for success events
for ( int iLessonEvent = 0; iLessonEvent < m_SuccessEvents.Count(); ++iLessonEvent )
{
const LessonEvent_t *pLessonEvent = &(m_SuccessEvents[ iLessonEvent ]);
ListenForGameEvent( pLessonEvent->szEventName.String());
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tListen for success event " );
ConColorMsg( CBaseLesson::m_rgbaVerboseSuccess, "\"%s\"", pLessonEvent->szEventName.String());
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ".\n" );
}
}
}
else
{
// This is an open lesson! Get the root for reference
const CScriptedIconLesson *pLesson = static_cast<const CScriptedIconLesson *>( GetGameInstructor().GetLesson( GetName() ) );
SetRoot( const_cast<CScriptedIconLesson *>( pLesson ) );
}
}
}
void CScriptedIconLesson::InitPrerequisites( void )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerboseHeader, "GAME INSTRUCTOR: " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "Initializing prereqs for scripted lesson " );
ConColorMsg( CBaseLesson::m_rgbaVerboseOpen, "\"%s\"", GetName() );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "...\n" );
}
for ( int iPrerequisit = 0; iPrerequisit < m_PrerequisiteNames.Count(); ++iPrerequisit )
{
const char *pPrerequisiteName = m_PrerequisiteNames[ iPrerequisit ].String();
AddPrerequisite( pPrerequisiteName );
}
}
void CScriptedIconLesson::OnOpen( void )
{
VPROF_BUDGET( "CScriptedIconLesson::OnOpen", "GameInstructor" );
if ( !DoDelayedPlayerSwaps() )
{
return;
}
const CScriptedIconLesson *pLesson = static_cast<const CScriptedIconLesson *>( GetRoot() );
// Process all update events
for ( int iLessonEvent = 0; iLessonEvent < pLesson->m_OnOpenEvents.Count(); ++iLessonEvent )
{
const LessonEvent_t *pLessonEvent = &(pLesson->m_OnOpenEvents[ iLessonEvent ]);
if ( gameinstructor_verbose.GetInt() > 1 && ShouldShowSpew() )
{
ConColorMsg( Color( 255, 128, 64, 255 ), "GAME INSTRUCTOR: " );
ConColorMsg( Color( 64, 128, 255, 255 ), "OnOpen event " );
ConColorMsg( Color( 0, 255, 0, 255 ), "\"%s\"", pLessonEvent->szEventName.String());
ConColorMsg( Color( 64, 128, 255, 255 ), "received for lesson \"%s\"...\n", GetName() );
}
ProcessElements( NULL, &(pLessonEvent->elements) );
}
BaseClass::OnOpen();
}
void CScriptedIconLesson::Update( void )
{
VPROF_BUDGET( "CScriptedIconLesson::Update", "GameInstructor" );
if ( !DoDelayedPlayerSwaps() )
{
return;
}
const CScriptedIconLesson *pLesson = static_cast<const CScriptedIconLesson *>( GetRoot() );
if ( gpGlobals->curtime >= m_fUpdateEventTime )
{
bool bShowSpew = ( gameinstructor_verbose.GetInt() > 1 && ShouldShowSpew() );
int iVerbose = gameinstructor_verbose.GetInt();
if ( gameinstructor_verbose.GetInt() == 1 )
{
// Force the verbose level from 1 to 0 for update events
gameinstructor_verbose.SetValue( 0 );
}
// Process all update events
for ( int iLessonEvent = 0; iLessonEvent < pLesson->m_UpdateEvents.Count(); ++iLessonEvent )
{
const LessonEvent_t *pLessonEvent = &(pLesson->m_UpdateEvents[ iLessonEvent ]);
if ( bShowSpew )
{
ConColorMsg( CBaseLesson::m_rgbaVerboseHeader, "GAME INSTRUCTOR: " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "Update event " );
ConColorMsg( CBaseLesson::m_rgbaVerboseUpdate, "\"%s\"", pLessonEvent->szEventName.String());
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "received for lesson \"%s\"...\n", GetName() );
}
ProcessElements( NULL, &(pLessonEvent->elements) );
}
gameinstructor_verbose.SetValue( iVerbose );
// Wait before doing update events again
m_fUpdateEventTime = gpGlobals->curtime + m_fUpdateInterval;
}
BaseClass::Update();
}
void CScriptedIconLesson::SwapOutPlayers( int iOldUserID, int iNewUserID )
{
BaseClass::SwapOutPlayers( iOldUserID, iNewUserID );
// Get the player pointers from the user IDs
C_BasePlayer *pOldPlayer = UTIL_PlayerByUserId( iOldUserID );
C_BasePlayer *pNewPlayer = UTIL_PlayerByUserId( iNewUserID );
if ( pOldPlayer == m_hEntity1.Get() )
{
if ( pNewPlayer )
{
m_hEntity1 = pNewPlayer;
}
else
{
if ( m_iNumDelayedPlayerSwaps < MAX_DELAYED_PLAYER_SWAPS )
{
m_pDelayedPlayerSwap[ m_iNumDelayedPlayerSwaps ].phHandleToChange = &m_hEntity1;
m_pDelayedPlayerSwap[ m_iNumDelayedPlayerSwaps ].iNewUserID = iNewUserID;
++m_iNumDelayedPlayerSwaps;
}
}
}
if ( pOldPlayer == m_hEntity2.Get() )
{
if ( pNewPlayer )
{
m_hEntity2 = pNewPlayer;
}
else
{
if ( m_iNumDelayedPlayerSwaps < MAX_DELAYED_PLAYER_SWAPS )
{
m_pDelayedPlayerSwap[ m_iNumDelayedPlayerSwaps ].phHandleToChange = &m_hEntity2;
m_pDelayedPlayerSwap[ m_iNumDelayedPlayerSwaps ].iNewUserID = iNewUserID;
++m_iNumDelayedPlayerSwaps;
}
}
}
}
void CScriptedIconLesson::FireGameEvent( IGameEvent *event )
{
VPROF_BUDGET( "CScriptedIconLesson::FireGameEvent", "GameInstructor" );
ACTIVE_SPLITSCREEN_PLAYER_GUARD( GetSplitScreenSlot() );
if ( m_bDisabled )
return;
if ( !DoDelayedPlayerSwaps() )
{
return;
}
if ( !C_BasePlayer::GetLocalPlayer() )
return;
// Check that this lesson is allowed for the current input device
if( m_bOnlyKeyboard && input->ControllerModeActive() )
return;
if( m_bOnlyGamepad && !input->ControllerModeActive() )
return;
// Check that this lesson is for the proper team
CBasePlayer *pLocalPlayer = GetGameInstructor().GetLocalPlayer();
if ( m_iTeam != TEAM_ANY && pLocalPlayer && pLocalPlayer->GetTeamNumber() != m_iTeam )
{
// This lesson is intended for a different team
return;
}
const char *name = event->GetName();
// Open events run on the root
ProcessOpenGameEvents( this, name, event );
// Close and success events run on the children
const CUtlVector < CBaseLesson * > *pChildren = GetChildren();
for ( int iChild = 0; iChild < pChildren->Count(); ++iChild )
{
CScriptedIconLesson *pScriptedChild = dynamic_cast<CScriptedIconLesson*>( (*pChildren)[ iChild ] );
pScriptedChild->ProcessCloseGameEvents( this, name, event );
pScriptedChild->ProcessSuccessGameEvents( this, name, event );
}
}
void CScriptedIconLesson::ProcessOpenGameEvents( const CScriptedIconLesson *pRootLesson, const char *name, IGameEvent *event )
{
if ( pRootLesson->InstanceType() == LESSON_INSTANCE_SINGLE_OPEN && GetGameInstructor().IsLessonOfSameTypeOpen( this ) )
{
// We don't want more than one of this type, and there is already one open
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerboseHeader, "GAME INSTRUCTOR: " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "Opportunity " );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\"%s\" ", pRootLesson->GetName() );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "open events NOT processed (there is already an open lesson of this type).\n" );
}
return;
}
for ( int iLessonEvent = 0; iLessonEvent < pRootLesson->m_OpenEvents.Count(); ++iLessonEvent )
{
const LessonEvent_t *pLessonEvent = &(pRootLesson->m_OpenEvents[ iLessonEvent ]);
if ( Q_strcmp( name, pLessonEvent->szEventName.String()) == 0 )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerboseHeader, "GAME INSTRUCTOR: " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "Open event " );
ConColorMsg( CBaseLesson::m_rgbaVerboseOpen, "\"%s\"", pLessonEvent->szEventName.String());
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "received for lesson \"%s\"...\n", GetName() );
}
if ( m_pDefaultHolder )
{
// Run copy from default macros on all scriptable variables (see: LESSON_VARIABLE_FACTORY definition)
#define LESSON_VARIABLE_MACRO LESSON_VARIABLE_DEFAULT
#define LESSON_VARIABLE_MACRO_BOOL LESSON_VARIABLE_DEFAULT
#define LESSON_VARIABLE_MACRO_EHANDLE LESSON_VARIABLE_DEFAULT
#define LESSON_VARIABLE_MACRO_STRING LESSON_VARIABLE_DEFAULT
LESSON_VARIABLE_FACTORY
#undef LESSON_VARIABLE_MACRO
#undef LESSON_VARIABLE_MACRO_BOOL
#undef LESSON_VARIABLE_MACRO_EHANDLE
#undef LESSON_VARIABLE_MACRO_STRING
}
if ( ProcessElements( event, &(pLessonEvent->elements) ) )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerboseOpen, "\tAll elements returned true. Opening!\n" );
}
MEM_ALLOC_CREDIT();
CScriptedIconLesson *pOpenLesson = new CScriptedIconLesson( GetName(), false, true, GetSplitScreenSlot() );
// Run copy macros on all scriptable variables (see: LESSON_VARIABLE_FACTORY definition)
#define LESSON_VARIABLE_MACRO LESSON_VARIABLE_COPY
#define LESSON_VARIABLE_MACRO_BOOL LESSON_VARIABLE_COPY
#define LESSON_VARIABLE_MACRO_EHANDLE LESSON_VARIABLE_COPY
#define LESSON_VARIABLE_MACRO_STRING LESSON_VARIABLE_COPY
LESSON_VARIABLE_FACTORY
#undef LESSON_VARIABLE_MACRO
#undef LESSON_VARIABLE_MACRO_BOOL
#undef LESSON_VARIABLE_MACRO_EHANDLE
#undef LESSON_VARIABLE_MACRO_STRING
if ( GetGameInstructor().OpenOpportunity( pOpenLesson ) )
{
pOpenLesson->OnOpen();
if ( pRootLesson->InstanceType() == LESSON_INSTANCE_SINGLE_OPEN )
{
// This one is open and we only want one! So, we're done.
// Other open events may be listening for the same events... skip them!
return;
}
}
}
}
}
}
void CScriptedIconLesson::ProcessCloseGameEvents( const CScriptedIconLesson *pRootLesson, const char *name, IGameEvent *event )
{
for ( int iLessonEvent = 0; iLessonEvent < pRootLesson->m_CloseEvents.Count() && IsOpenOpportunity(); ++iLessonEvent )
{
const LessonEvent_t *pLessonEvent = &(pRootLesson->m_CloseEvents[ iLessonEvent ]);
if ( Q_strcmp( name, pLessonEvent->szEventName.String()) == 0 )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerboseHeader, "GAME INSTRUCTOR: " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "Close event " );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\"%s\"", pLessonEvent->szEventName.String());
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "received for lesson \"%s\"...\n", GetName() );
}
if ( ProcessElements( event, &(pLessonEvent->elements) ) )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tAll elements returned true. Closing!\n" );
}
CloseOpportunity( "Close event elements completed." );
}
}
}
}
void CScriptedIconLesson::ProcessSuccessGameEvents( const CScriptedIconLesson *pRootLesson, const char *name, IGameEvent *event )
{
for ( int iLessonEvent = 0; iLessonEvent < pRootLesson->m_SuccessEvents.Count(); ++iLessonEvent )
{
const LessonEvent_t *pLessonEvent = &(pRootLesson->m_SuccessEvents[ iLessonEvent ]);
if ( Q_strcmp( name, pLessonEvent->szEventName.String()) == 0 )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerboseHeader, "GAME INSTRUCTOR: " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "Success event " );
ConColorMsg( CBaseLesson::m_rgbaVerboseSuccess, "\"%s\"", pLessonEvent->szEventName.String());
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "received for lesson \"%s\"...\n", GetName() );
}
if ( ProcessElements( event, &(pLessonEvent->elements) ) )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerboseSuccess, "\tAll elements returned true. Succeeding!\n" );
}
MarkSucceeded();
}
}
}
}
LessonVariable LessonVariableFromString( const char *pchName, bool bWarnOnInvalidNames )
{
int slot = g_NameToTypeMap.Find( pchName );
if ( slot != g_NameToTypeMap.InvalidIndex() )
return g_NameToTypeMap[ slot ];
if ( bWarnOnInvalidNames )
{
AssertMsg( 0, "Invalid scripted lesson variable!" );
DevWarning( "Invalid scripted lesson variable: %s\n", pchName );
}
return LESSON_VARIABLE_TOTAL;
}
_fieldtypes LessonParamTypeFromString( const char *pchName )
{
int slot = g_TypeToParamTypeMap.Find( pchName );
if ( slot != g_TypeToParamTypeMap.InvalidIndex() )
return g_TypeToParamTypeMap[ slot ];
DevWarning( "Invalid scripted lesson variable/param type: %s\n", pchName );
return FIELD_VOID;
}
int LessonActionFromString( const char *pchName )
{
int slot = CScriptedIconLesson::LessonActionMap.Find( pchName );
if ( slot != CScriptedIconLesson::LessonActionMap.InvalidIndex() )
return CScriptedIconLesson::LessonActionMap[ slot ];
DevWarning( "Invalid scripted lesson action: %s\n", pchName );
return LESSON_ACTION_NONE;
}
void CScriptedIconLesson::InitElementsFromKeys( CUtlVector< LessonElement_t > *pLessonElements, KeyValues *pKey )
{
KeyValues *pSubKey = NULL;
for ( pSubKey = pKey->GetFirstSubKey(); pSubKey; pSubKey = pSubKey->GetNextKey() )
{
char szSubKeyName[ 256 ];
Q_strcpy( szSubKeyName, pSubKey->GetName() );
char *pchToken = strtok( szSubKeyName, " " );
LessonVariable iVariable = LessonVariableFromString( pchToken );
pchToken = strtok ( NULL, "" );
int iAction = LESSON_ACTION_NONE;
bool bNot = false;
bool bOptionalParam = false;
if ( !pchToken || pchToken[ 0 ] == '\0' )
{
DevWarning( "No action specified for variable: \"%s\"\n", pSubKey->GetName() );
}
else
{
if ( pchToken[ 0 ] == '?' )
{
pchToken++;
bOptionalParam = true;
}
if ( pchToken[ 0 ] == '!' )
{
pchToken++;
bNot = true;
}
iAction = LessonActionFromString( pchToken );
}
Q_strcpy( szSubKeyName, pSubKey->GetString() );
pchToken = strtok( szSubKeyName, " " );
_fieldtypes paramType = LessonParamTypeFromString( pchToken );
char *pchParam = "";
if ( paramType != FIELD_VOID )
{
pchToken = strtok ( NULL, "" );
pchParam = pchToken;
}
if ( !pchParam )
{
DevWarning( "No parameter specified for action: \"%s\"\n", pSubKey->GetName() );
}
else
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t\tElement \"%s %s\" added.\n", pSubKey->GetName(), pSubKey->GetString() );
}
// See if our param is a scripted var
LessonVariable iParamVarIndex = LessonVariableFromString( pchParam, false );
pLessonElements->AddToTail( LessonElement_t( iVariable, iAction, bNot, bOptionalParam, pchParam, iParamVarIndex, paramType ) );
}
}
}
void CScriptedIconLesson::InitElementsFromElements( CUtlVector< LessonElement_t > *pLessonElements, const CUtlVector< LessonElement_t > *pLessonElements2 )
{
for ( int i = 0; i < pLessonElements2->Count(); ++i )
{
pLessonElements->AddToTail( LessonElement_t( (*pLessonElements2)[ i ] ) );
}
}
void CScriptedIconLesson::InitFromKeys( KeyValues *pKey )
{
if ( !pKey )
return;
static int s_nInstanceTypeSymbol = KeyValuesSystem()->GetSymbolForString( "instance_type" );
static int s_nReplaceKeySymbol = KeyValuesSystem()->GetSymbolForString( "replace_key" );
static int s_nFixedInstancesMaxSymbol = KeyValuesSystem()->GetSymbolForString( "fixed_instances_max" );
static int s_nReplaceOnlyWhenStopped = KeyValuesSystem()->GetSymbolForString( "replace_only_when_stopped" );
static int s_nTeamSymbol = KeyValuesSystem()->GetSymbolForString( "team" );
static int s_nOnlyKeyboardSymbol = KeyValuesSystem()->GetSymbolForString( "only_keyboard" );
static int s_nOnlyGamepadSymbol = KeyValuesSystem()->GetSymbolForString( "only_gamepad" );
static int s_nDisplayLimitSymbol = KeyValuesSystem()->GetSymbolForString( "display_limit" );
static int s_nSuccessLimitSymbol = KeyValuesSystem()->GetSymbolForString( "success_limit" );
static int s_nPreReqSymbol = KeyValuesSystem()->GetSymbolForString( "prereq" );
static int s_nOpenSymbol = KeyValuesSystem()->GetSymbolForString( "open" );
static int s_nCloseSymbol = KeyValuesSystem()->GetSymbolForString( "close" );
static int s_nSuccessSymbol = KeyValuesSystem()->GetSymbolForString( "success" );
static int s_nOnOpenSymbol = KeyValuesSystem()->GetSymbolForString( "onopen" );
static int s_nUpdateSymbol = KeyValuesSystem()->GetSymbolForString( "update" );
KeyValues *pSubKey = NULL;
for ( pSubKey = pKey->GetFirstSubKey(); pSubKey; pSubKey = pSubKey->GetNextKey() )
{
if ( pSubKey->GetNameSymbol() == s_nInstanceTypeSymbol )
{
m_iInstanceType = LessonInstanceType( pSubKey->GetInt() );
}
else if ( pSubKey->GetNameSymbol() == s_nReplaceKeySymbol )
{
m_stringReplaceKey = pSubKey->GetString();
}
else if ( pSubKey->GetNameSymbol() == s_nFixedInstancesMaxSymbol )
{
m_iFixedInstancesMax = pSubKey->GetInt();
}
else if ( pSubKey->GetNameSymbol() == s_nReplaceOnlyWhenStopped )
{
m_bReplaceOnlyWhenStopped = pSubKey->GetBool();
}
else if ( pSubKey->GetNameSymbol() == s_nTeamSymbol )
{
m_iTeam = pSubKey->GetInt();
}
else if ( pSubKey->GetNameSymbol() == s_nOnlyKeyboardSymbol )
{
m_bOnlyKeyboard = pSubKey->GetBool();
}
else if ( pSubKey->GetNameSymbol() == s_nOnlyGamepadSymbol )
{
m_bOnlyGamepad = pSubKey->GetBool();
}
else if ( pSubKey->GetNameSymbol() == s_nDisplayLimitSymbol )
{
m_iDisplayLimit = pSubKey->GetInt();
}
else if ( pSubKey->GetNameSymbol() == s_nSuccessLimitSymbol )
{
m_iSuccessLimit = pSubKey->GetInt();
}
else if ( pSubKey->GetNameSymbol() == s_nPreReqSymbol )
{
CGameInstructorSymbol pName;
pName = pSubKey->GetString();
m_PrerequisiteNames.AddToTail( pName );
}
else if ( pSubKey->GetNameSymbol() == s_nOpenSymbol )
{
KeyValues *pEventKey = NULL;
for ( pEventKey = pSubKey->GetFirstTrueSubKey(); pEventKey; pEventKey = pEventKey->GetNextTrueSubKey() )
{
LessonEvent_t *pLessonEvent = AddOpenEvent();
pLessonEvent->szEventName = pEventKey->GetName();
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tAdding open event " );
ConColorMsg( CBaseLesson::m_rgbaVerboseOpen, "\"%s\" ", pLessonEvent->szEventName.String());
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "...\n" );
}
InitElementsFromKeys( &(pLessonEvent->elements), pEventKey );
}
}
else if ( pSubKey->GetNameSymbol() == s_nCloseSymbol )
{
KeyValues *pEventKey = NULL;
for ( pEventKey = pSubKey->GetFirstTrueSubKey(); pEventKey; pEventKey = pEventKey->GetNextTrueSubKey() )
{
LessonEvent_t *pLessonEvent = AddCloseEvent();
pLessonEvent->szEventName = pEventKey->GetName();
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tAdding close event " );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\"%s\" ", pLessonEvent->szEventName.String());
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "...\n" );
}
InitElementsFromKeys( &(pLessonEvent->elements), pEventKey );
}
}
else if ( pSubKey->GetNameSymbol() == s_nSuccessSymbol )
{
KeyValues *pEventKey = NULL;
for ( pEventKey = pSubKey->GetFirstTrueSubKey(); pEventKey; pEventKey = pEventKey->GetNextTrueSubKey() )
{
LessonEvent_t *pLessonEvent = AddSuccessEvent();
pLessonEvent->szEventName = pEventKey->GetName();
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tAdding success event " );
ConColorMsg( CBaseLesson::m_rgbaVerboseSuccess, "\"%s\" ", pLessonEvent->szEventName.String());
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "...\n" );
}
InitElementsFromKeys( &(pLessonEvent->elements), pEventKey );
}
}
else if ( pSubKey->GetNameSymbol() == s_nOnOpenSymbol )
{
KeyValues *pEventKey = NULL;
for ( pEventKey = pSubKey->GetFirstTrueSubKey(); pEventKey; pEventKey = pEventKey->GetNextTrueSubKey() )
{
LessonEvent_t *pLessonEvent = AddOnOpenEvent();
pLessonEvent->szEventName = pEventKey->GetName();
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tAdding onopen event " );
ConColorMsg( CBaseLesson::m_rgbaVerboseOpen, "\"%s\" ", pLessonEvent->szEventName.String());
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "...\n" );
}
InitElementsFromKeys( &(pLessonEvent->elements), pEventKey );
}
}
else if ( pSubKey->GetNameSymbol() == s_nUpdateSymbol )
{
KeyValues *pEventKey = NULL;
for ( pEventKey = pSubKey->GetFirstTrueSubKey(); pEventKey; pEventKey = pEventKey->GetNextTrueSubKey() )
{
LessonEvent_t *pLessonEvent = AddUpdateEvent();
pLessonEvent->szEventName = pEventKey->GetName();
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tAdding update event " );
ConColorMsg( CBaseLesson::m_rgbaVerboseUpdate, "\"%s\" ", pLessonEvent->szEventName.String());
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "...\n" );
}
InitElementsFromKeys( &(pLessonEvent->elements), pEventKey );
}
}
// Run intialize from key macros on all scriptable variables (see: LESSON_VARIABLE_FACTORY definition)
#define LESSON_VARIABLE_MACRO LESSON_VARIABLE_INIT
#define LESSON_VARIABLE_MACRO_BOOL LESSON_VARIABLE_INIT_BOOL
#define LESSON_VARIABLE_MACRO_EHANDLE LESSON_VARIABLE_INIT_EHANDLE
#define LESSON_VARIABLE_MACRO_STRING LESSON_VARIABLE_INIT_STRING
LESSON_VARIABLE_FACTORY
#undef LESSON_VARIABLE_MACRO
#undef LESSON_VARIABLE_MACRO_BOOL
#undef LESSON_VARIABLE_MACRO_EHANDLE
#undef LESSON_VARIABLE_MACRO_STRING
}
}
bool CScriptedIconLesson::ProcessElements( IGameEvent *event, const CUtlVector< LessonElement_t > *pElements )
{
VPROF_BUDGET( "CScriptedIconLesson::ProcessElements", "GameInstructor" );
m_hLocalPlayer = GetGameInstructor().GetLocalPlayer();
bool bSuccess = true;
int nContinueScope = -1;
m_iScopeDepth = 0;
if ( gameinstructor_find_errors.GetBool() )
{
// Just run them all to check for errors!
for ( int iElement = 0; iElement < pElements->Count(); ++iElement )
{
ProcessElement( event, &((*pElements)[ iElement ] ), false );
}
return false;
}
// Process each element until a step fails
for ( int iElement = 0; iElement < pElements->Count(); ++iElement )
{
if ( nContinueScope == m_iScopeDepth )
{
nContinueScope = -1;
}
if ( !ProcessElement( event, &((*pElements)[ iElement ]), nContinueScope != -1 ) )
{
// This element failed
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tPrevious element returned false.\n" );
}
nContinueScope = m_iScopeDepth - 1;
if ( nContinueScope < 0 )
{
// No outer scope to worry about, we're done
bSuccess = false;
break;
}
}
}
return bSuccess;
}
bool CScriptedIconLesson::ProcessElement( IGameEvent *event, const LessonElement_t *pLessonElement, bool bInFailedScope )
{
ACTIVE_SPLITSCREEN_PLAYER_GUARD( GetSplitScreenSlot() );
VPROF_BUDGET( "CScriptedIconLesson::ProcessElement", "GameInstructor" );
if ( pLessonElement->iAction == LESSON_ACTION_SCOPE_IN )
{
// Special case for closing (we don't need variables for this)
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tScopeIn()\n" );
}
m_iScopeDepth++;
return true;
}
else if ( pLessonElement->iAction == LESSON_ACTION_SCOPE_OUT )
{
// Special case for closing (we don't need variables for this)
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tScopeOut()\n" );
}
m_iScopeDepth--;
return true;
}
if ( bInFailedScope )
{
// Only scope upkeep is done when we're in a failing scope... bail!
return true;
}
if ( pLessonElement->iAction == LESSON_ACTION_CLOSE )
{
// Special case for closing (we don't need variables for this)
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tCloseOpportunity()\n" );
}
CloseOpportunity( "Close action." );
return true;
}
else if ( pLessonElement->iAction == LESSON_ACTION_SUCCESS )
{
// Special case for succeeding (we don't need variables for this)
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tMarkSucceeded()\n" );
}
MarkSucceeded();
return true;
}
else if ( pLessonElement->iAction == LESSON_ACTION_LOCK )
{
// Special case for setting the starting point for the lesson to stay locked from (we don't need variables for this)
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tm_fLockTime = gpGlobals->curtime\n" );
}
m_fLockTime = gpGlobals->curtime;
return true;
}
else if ( pLessonElement->iAction == LESSON_ACTION_PRESENT_COMPLETE )
{
// Special case for checking presentation status (we don't need variables for this)
bool bPresentComplete = IsPresentComplete();
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tIsPresentComplete() " );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%s ", ( bPresentComplete ) ? ( "true" ) : ( "false" ) );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( pLessonElement->bNot ) ? ( "!= true\n" ) : ( "== true\n" ) );
}
return ( pLessonElement->bNot ) ? ( !bPresentComplete ) : ( bPresentComplete );
}
else if ( pLessonElement->iAction == LESSON_ACTION_PRESENT_START )
{
// Special case for setting presentation status (we don't need variables for this)
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tPresentStart()\n" );
}
PresentStart();
return true;
}
else if ( pLessonElement->iAction == LESSON_ACTION_PRESENT_END )
{
// Special case for setting presentation status (we don't need variables for this)
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tPresentEnd()\n" );
}
PresentEnd();
return true;
}
// These values temporarily hold the parameter's value
const char *pParamName = pLessonElement->szParam.String();
float eventParam_float = 0.0f;
char eventParam_string[ 256 ];
eventParam_string[ 0 ] = '\0';
C_BaseEntity *eventParam_BaseEntity = NULL;
// Get the value from the event parameter based on its type
switch ( pLessonElement->paramType )
{
case FIELD_FLOAT:
if ( pLessonElement->iParamVarIndex < LESSON_VARIABLE_TOTAL )
{
// The parameter is a scripted var
const LessonVariableInfo *pInfo = GetLessonVariableInfo( pLessonElement->iParamVarIndex );
switch ( pInfo->varType )
{
case FIELD_FLOAT:
eventParam_float = LESSON_VARIABLE_GET_FROM_OFFSET( float, pInfo->iOffset );
break;
case FIELD_INTEGER:
eventParam_float = static_cast<float>( LESSON_VARIABLE_GET_FROM_OFFSET( int, pInfo->iOffset ) );
break;
case FIELD_BOOLEAN:
eventParam_float = static_cast<float>( LESSON_VARIABLE_GET_FROM_OFFSET( bool, pInfo->iOffset ) );
break;
case FIELD_STRING:
eventParam_float = static_cast<float>( atoi( &LESSON_VARIABLE_GET_FROM_OFFSET( CGameInstructorSymbol, pInfo->iOffset )->String() ) );
break;
case FIELD_EHANDLE:
case FIELD_FUNCTION:
DevWarning( "Can't use this variable type with this parameter type in lesson script.\n" );
break;
}
}
else if ( event && !(event->IsEmpty( pParamName )) )
{
eventParam_float = event->GetFloat( pParamName );
}
else if ( pLessonElement->bOptionalParam )
{
// We don't want to interpret this and not finding the param is still ok
return true;
}
else if ( ( pParamName[ 0 ] >= '0' && pParamName[ 0 ] <= '9' ) || pParamName[ 0 ] == '-' || pParamName[ 0 ] == '.' )
{
// This param doesn't exist, try parsing the string
eventParam_float = Q_atof( pParamName );
}
else
{
DevWarning( "Invalid event field name and not a float \"%s\".\n", pParamName );
return false;
}
break;
case FIELD_INTEGER:
if ( pLessonElement->iParamVarIndex < LESSON_VARIABLE_TOTAL )
{
// The parameter is a scripted var
const LessonVariableInfo *pInfo = GetLessonVariableInfo( pLessonElement->iParamVarIndex );
switch ( pInfo->varType )
{
case FIELD_FLOAT:
eventParam_float = static_cast<int>( LESSON_VARIABLE_GET_FROM_OFFSET( float, pInfo->iOffset ) );
break;
case FIELD_INTEGER:
eventParam_float = LESSON_VARIABLE_GET_FROM_OFFSET( int, pInfo->iOffset );
break;
case FIELD_BOOLEAN:
eventParam_float = static_cast<int>( LESSON_VARIABLE_GET_FROM_OFFSET( bool, pInfo->iOffset ) );
break;
case FIELD_STRING:
eventParam_float = atof( &LESSON_VARIABLE_GET_FROM_OFFSET( CGameInstructorSymbol, pInfo->iOffset )->String() );
break;
case FIELD_EHANDLE:
case FIELD_FUNCTION:
DevWarning( "Can't use this variable type with this parameter type in lesson script.\n" );
break;
}
}
else if ( event && !(event->IsEmpty( pParamName )) )
{
eventParam_float = static_cast<float>( event->GetInt( pParamName ) );
}
else if ( pLessonElement->bOptionalParam )
{
// We don't want to interpret this and not finding the param is still ok
return true;
}
else if ( ( pParamName[ 0 ] >= '0' && pParamName[ 0 ] <= '9' ) || pParamName[ 0 ] == '-' )
{
// This param doesn't exist, try parsing the string
eventParam_float = static_cast<float>( Q_atoi( pParamName ) );
}
else
{
DevWarning( "Invalid event field name and not an integer \"%s\".\n", pParamName );
return false;
}
break;
case FIELD_STRING:
if ( pLessonElement->iParamVarIndex < LESSON_VARIABLE_TOTAL )
{
// The parameter is a scripted var
const LessonVariableInfo *pInfo = GetLessonVariableInfo( pLessonElement->iParamVarIndex );
switch ( pInfo->varType )
{
case FIELD_STRING:
Q_strncpy( eventParam_string, &LESSON_VARIABLE_GET_FROM_OFFSET( CGameInstructorSymbol, pInfo->iOffset )->String(), sizeof( eventParam_string ) );
break;
case FIELD_FLOAT:
Q_snprintf( eventParam_string, sizeof( eventParam_string ), "%f", LESSON_VARIABLE_GET_FROM_OFFSET( float, pInfo->iOffset ) );
break;
case FIELD_INTEGER:
Q_snprintf( eventParam_string, sizeof( eventParam_string ), "%i", LESSON_VARIABLE_GET_FROM_OFFSET( int, pInfo->iOffset ) );
break;
case FIELD_BOOLEAN:
case FIELD_EHANDLE:
case FIELD_FUNCTION:
DevWarning( "Can't use this variable type with this parameter type in lesson script.\n" );
break;
}
}
else
{
const char *pchEventString = NULL;
if ( event && !(event->IsEmpty( pParamName )) )
{
pchEventString = event->GetString( pParamName );
}
if ( pchEventString && pchEventString[0] )
{
Q_strcpy( eventParam_string, pchEventString );
}
else if ( pLessonElement->bOptionalParam )
{
// We don't want to interpret this and not finding the param is still ok
return true;
}
else
{
// This param doesn't exist, try parsing the string
Q_strncpy( eventParam_string, pParamName, sizeof( eventParam_string ) );
}
}
break;
case FIELD_BOOLEAN:
if ( pLessonElement->iParamVarIndex < LESSON_VARIABLE_TOTAL )
{
// The parameter is a scripted var
const LessonVariableInfo *pInfo = GetLessonVariableInfo( pLessonElement->iParamVarIndex );
switch ( pInfo->varType )
{
case FIELD_FLOAT:
eventParam_float = ( ( LESSON_VARIABLE_GET_FROM_OFFSET( float, pInfo->iOffset ) ) ? ( 1.0f ) : ( 0.0f ) );
break;
case FIELD_INTEGER:
eventParam_float = ( ( LESSON_VARIABLE_GET_FROM_OFFSET( int, pInfo->iOffset ) ) ? ( 1.0f ) : ( 0.0f ) );
break;
case FIELD_BOOLEAN:
eventParam_float = ( ( LESSON_VARIABLE_GET_FROM_OFFSET( bool, pInfo->iOffset ) ) ? ( 1.0f ) : ( 0.0f ) );
break;
case FIELD_EHANDLE:
case FIELD_STRING:
case FIELD_FUNCTION:
DevWarning( "Can't use this variable type with this parameter type in lesson script.\n" );
break;
}
}
else if ( event && !(event->IsEmpty( pParamName )) )
{
eventParam_float = ( event->GetBool( pParamName ) ) ? ( 1.0f ) : ( 0.0f );
}
else if ( pLessonElement->bOptionalParam )
{
// We don't want to interpret this and not finding the param is still ok
return true;
}
else if ( pParamName[ 0 ] == '0' || pParamName[ 0 ] == '1' )
{
// This param doesn't exist, try parsing the string
eventParam_float = Q_atof( pParamName ) != 0.0f;
}
else
{
DevWarning( "Invalid event field name and not an boolean \"%s\".\n", pParamName );
return false;
}
break;
case FIELD_CUSTOM:
if ( pLessonElement->iParamVarIndex < LESSON_VARIABLE_TOTAL )
{
// The parameter is a scripted var
const LessonVariableInfo *pInfo = GetLessonVariableInfo( pLessonElement->iParamVarIndex );
switch ( pInfo->varType )
{
case FIELD_EHANDLE:
eventParam_BaseEntity = ( LESSON_VARIABLE_GET_FROM_OFFSET( EHANDLE, pInfo->iOffset ) ).Get();
if ( !eventParam_BaseEntity )
{
if ( pLessonElement->bOptionalParam )
{
// Not having an entity is fine
return true;
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tPlayer param \"%s\" returned NULL.\n", pParamName );
}
return false;
}
break;
case FIELD_FLOAT:
case FIELD_INTEGER:
case FIELD_BOOLEAN:
case FIELD_STRING:
case FIELD_FUNCTION:
DevWarning( "Can't use this variable type with this parameter type in lesson script.\n" );
break;
}
}
else if ( event && !(event->IsEmpty( pParamName )) )
{
eventParam_BaseEntity = UTIL_PlayerByUserId( event->GetInt( pParamName ) );
if ( !eventParam_BaseEntity )
{
if ( pLessonElement->bOptionalParam )
{
// Not having an entity is fine
return true;
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tPlayer param \"%s\" returned NULL.\n", pParamName );
}
return false;
}
}
else if ( pLessonElement->bOptionalParam )
{
// We don't want to interpret this and not finding the param is still ok
return true;
}
else if ( Q_stricmp( pParamName, "null" ) == 0 )
{
// They explicitly want a null pointer
eventParam_BaseEntity = NULL;
}
else
{
DevWarning( "Invalid event field name \"%s\".\n", pParamName );
return false;
}
break;
case FIELD_EHANDLE:
if ( pLessonElement->iParamVarIndex < LESSON_VARIABLE_TOTAL )
{
// The parameter is a scripted var
const LessonVariableInfo *pInfo = GetLessonVariableInfo( pLessonElement->iParamVarIndex );
switch ( pInfo->varType )
{
case FIELD_EHANDLE:
eventParam_BaseEntity = ( LESSON_VARIABLE_GET_FROM_OFFSET( EHANDLE, pInfo->iOffset ) ).Get();
if ( !eventParam_BaseEntity )
{
if ( pLessonElement->bOptionalParam )
{
// Not having an entity is fine
return true;
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tEntity param \"%s\" returned NULL.\n", pParamName );
}
return false;
}
break;
case FIELD_FLOAT:
case FIELD_INTEGER:
case FIELD_BOOLEAN:
case FIELD_STRING:
case FIELD_FUNCTION:
DevWarning( "Can't use this variable type with this parameter type in lesson script.\n" );
break;
}
}
else if ( event && !(event->IsEmpty( pParamName )) )
{
int iEntID = event->GetInt( pParamName );
if ( iEntID >= NUM_ENT_ENTRIES )
{
AssertMsg( 0, "Invalid entity ID used in game event field!" );
DevWarning( "Invalid entity ID used in game event (%s) for param (%s).", event->GetName(), pParamName );
return false;
}
eventParam_BaseEntity = C_BaseEntity::Instance( iEntID );
if ( !eventParam_BaseEntity )
{
if ( pLessonElement->bOptionalParam )
{
// Not having an entity is fine
return true;
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tEntity param \"%s\" returned NULL.\n", pParamName );
}
return false;
}
}
else if ( pLessonElement->bOptionalParam )
{
// We don't want to interpret this and not finding the param is still ok
return true;
}
else if ( Q_stricmp( pParamName, "null" ) == 0 )
{
// They explicitly want a null pointer
eventParam_BaseEntity = NULL;
}
else if ( Q_stricmp( pParamName, "world" ) == 0 )
{
// They explicitly want the world
eventParam_BaseEntity = GetClientWorldEntity();
}
else
{
DevWarning( "Invalid event field name \"%s\".\n", pParamName );
return false;
}
break;
case FIELD_EMBEDDED:
{
// The parameter is a convar
ConVarRef tempCVar( pParamName );
if ( tempCVar.IsValid() )
{
eventParam_float = tempCVar.GetFloat();
Q_strncpy( eventParam_string, tempCVar.GetString(), sizeof( eventParam_string ) );
}
else
{
DevWarning( "Invalid convar name \"%s\".\n", pParamName );
return false;
}
}
break;
}
// Do the action to the specified variable
switch ( pLessonElement->iVariable )
{
// Run process action macros on all scriptable variables (see: LESSON_VARIABLE_FACTORY definition)
#define LESSON_VARIABLE_MACRO PROCESS_LESSON_ACTION
#define LESSON_VARIABLE_MACRO_BOOL PROCESS_LESSON_ACTION
#define LESSON_VARIABLE_MACRO_EHANDLE PROCESS_LESSON_ACTION_EHANDLE
#define LESSON_VARIABLE_MACRO_STRING PROCESS_LESSON_ACTION_STRING
LESSON_VARIABLE_FACTORY;
#undef LESSON_VARIABLE_MACRO
#undef LESSON_VARIABLE_MACRO_BOOL
#undef LESSON_VARIABLE_MACRO_EHANDLE
#undef LESSON_VARIABLE_MACRO_STRING
}
return true;
}
bool CScriptedIconLesson::ProcessElementAction( int iAction, bool bNot, const char *pchVarName, float &fVar, const CGameInstructorSymbol *pchParamName, float fParam )
{
switch ( iAction )
{
case LESSON_ACTION_SET:
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s] = [%s] ", pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f\n", fParam );
}
fVar = fParam;
return true;
case LESSON_ACTION_ADD:
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s] += [%s] ", pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f\n", fParam );
}
fVar += fParam;
return true;
case LESSON_ACTION_SUBTRACT:
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s] -= [%s] ", pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f\n", fParam );
}
fVar -= fParam;
return true;
case LESSON_ACTION_MULTIPLY:
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s] *= [%s] ", pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f\n", fParam );
}
fVar *= fParam;
return true;
case LESSON_ACTION_IS:
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s] ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f ", fVar );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "!= [%s] " ) : ( "== [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f\n", fParam );
}
return ( bNot ) ? ( fVar != fParam ) : ( fVar == fParam );
case LESSON_ACTION_LESS_THAN:
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s] ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f ", fVar );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ">= [%s] " ) : ( "< [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f\n", fParam );
}
return ( bNot ) ? ( fVar >= fParam ) : ( fVar < fParam );
case LESSON_ACTION_HAS_BIT:
{
int iTemp1 = static_cast<int>( fVar );
int iTemp2 = ( 1 << static_cast<int>( fParam ) );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t([%s] ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "0x%X ", iTemp1 );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "& [%s] ", pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "0x%X", iTemp2 );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ") == 0\n" ) : ( ") != 0\n" ) );
}
return ( bNot ) ? ( ( iTemp1 & iTemp2 ) == 0 ) : ( ( iTemp1 & iTemp2 ) != 0 );
}
case LESSON_ACTION_BIT_COUNT_IS:
{
int iTemp1 = UTIL_CountNumBitsSet( static_cast<unsigned int>( fVar ) );
int iTemp2 = static_cast<int>( fParam );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tUTIL_CountNumBitsSet([%s]) ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%i ", iTemp1 );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( " != [%s] " ) : ( " == [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%i\n", iTemp2 );
}
return ( bNot ) ? ( iTemp1 != iTemp2 ) : ( iTemp1 == iTemp2 );
}
case LESSON_ACTION_BIT_COUNT_LESS_THAN:
{
int iTemp1 = UTIL_CountNumBitsSet( static_cast<unsigned int>( fVar ) );
int iTemp2 = static_cast<int>( fParam );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tUTIL_CountNumBitsSet([%s]) ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%i ", iTemp1 );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( " >= [%s] " ) : ( " < [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%i\n", iTemp2 );
}
return ( bNot ) ? ( iTemp1 >= iTemp2 ) : ( iTemp1 < iTemp2 );
}
}
DevWarning( "Invalid lesson action type used with \"%s\" variable type.\n", pchVarName );
return false;
}
bool CScriptedIconLesson::ProcessElementAction( int iAction, bool bNot, const char *pchVarName, int &iVar, const CGameInstructorSymbol *pchParamName, float fParam )
{
float fTemp = static_cast<float>( iVar );
bool bRetVal = ProcessElementAction( iAction, bNot, pchVarName, fTemp, pchParamName, fParam );
iVar = static_cast<int>( fTemp );
return bRetVal;
}
bool CScriptedIconLesson::ProcessElementAction( int iAction, bool bNot, const char *pchVarName, bool &bVar, const CGameInstructorSymbol *pchParamName, float fParam )
{
float fTemp = ( bVar ) ? ( 1.0f ) : ( 0.0f );
bool bRetVal = ProcessElementAction( iAction, bNot, pchVarName, fTemp, pchParamName, fParam );
bVar = ( fTemp != 0.0f );
return bRetVal;
}
bool CScriptedIconLesson::ProcessElementAction( int iAction, bool bNot, const char *pchVarName, EHANDLE &hVar, const CGameInstructorSymbol *pchParamName, float fParam, C_BaseEntity *pParam, const char *pchParam )
{
// First try to let the mod act on the action
bool bModHandled = false;
bool bModReturn = false; //Mod_ProcessElementAction( iAction, bNot, pchVarName, hVar, pchParamName, fParam, pParam, pchParam, bModHandled );
if ( bModHandled )
{
return bModReturn;
}
C_BaseEntity *pVar = hVar.Get();
switch ( iAction )
{
case LESSON_ACTION_SET:
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s] = [%s]\n", pchVarName, pchParamName->String() );
}
hVar = pParam;
return true;
}
case LESSON_ACTION_IS:
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\t[%s] != [%s]\n" ) : ( "\t[%s] == [%s]\n" ), pchVarName, pchParamName->String() );
}
return ( bNot ) ? ( pVar != pParam ) : ( pVar == pParam );
case LESSON_ACTION_GET_DISTANCE:
{
if ( !pVar || !pParam )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[output] = [%s]->DistTo( [%s] )", pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "...\n" );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle or Param handle returned NULL!\n" );
}
return false;
}
C_BasePlayer *pVarPlayer = ( pVar->IsPlayer() ? static_cast< C_BasePlayer* >( pVar ) : NULL );
C_BasePlayer *pParamPlayer = ( pParam->IsPlayer() ? static_cast< C_BasePlayer* >( pParam ) : NULL );
Vector vVarPos = ( pVarPlayer ? pVarPlayer->ActivePlayerCombatCharacter()->EyePosition() : pVar->WorldSpaceCenter() );
Vector vParamPos = ( pParamPlayer ? pParamPlayer->ActivePlayerCombatCharacter()->EyePosition() : pParam->WorldSpaceCenter() );
m_fOutput = vVarPos.DistTo( vParamPos );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[output] = [%s]->DistTo( [%s] ) ", pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f\n", m_fOutput );
}
return true;
}
case LESSON_ACTION_GET_ANGULAR_DISTANCE:
{
if ( !pVar || !pParam )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[output] = [%s]->AngularDistTo( [%s] )", pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "...\n" );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle or Param handle returned NULL!\n" );
}
return false;
}
C_BasePlayer *pVarPlayer = ( pVar->IsPlayer() ? static_cast< C_BasePlayer* >( pVar ) : NULL );
C_BasePlayer *pParamPlayer = ( pParam->IsPlayer() ? static_cast< C_BasePlayer* >( pParam ) : NULL );
Vector vVarPos = ( pVarPlayer ? pVarPlayer->ActivePlayerCombatCharacter()->EyePosition() : pVar->WorldSpaceCenter() );
Vector vParamPos = ( pParamPlayer ? pParamPlayer->ActivePlayerCombatCharacter()->EyePosition() : pParam->WorldSpaceCenter() );
Vector vVarToParam = vParamPos - vVarPos;
VectorNormalize( vVarToParam );
Vector vVarForward;
if ( pVar->IsPlayer() )
{
AngleVectors( static_cast< C_BasePlayer* >( pVar )->ActivePlayerCombatCharacter()->EyeAngles(), &vVarForward, NULL, NULL );
}
else
{
pVar->GetVectors( &vVarForward, NULL, NULL );
}
// Set the distance in degrees
m_fOutput = ( vVarToParam.Dot( vVarForward ) - 1.0f ) * -90.0f;
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[output] = [%s]->AngularDistTo( [%s] ) ", pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f\n", m_fOutput );
}
return true;
}
case LESSON_ACTION_GET_PLAYER_DISPLAY_NAME:
{
int iTemp = static_cast<int>( fParam );
if ( iTemp <= 0 || iTemp > 2 )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tQ_strcpy( [stringINVALID], [%s]->GetPlayerName() ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "... " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")\n" );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tParam selecting string is out of range!\n" );
}
return false;
}
// Use string2 if it was specified, otherwise, use string1
CGameInstructorSymbol *pString;
char const *pchParamNameTemp = NULL;
if ( iTemp == 2 )
{
pString = &m_szString2;
pchParamNameTemp = "string2";
}
else
{
pString = &m_szString1;
pchParamNameTemp = "string1";
}
if ( !pVar )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tQ_strcpy( [%s], [%s]->GetPlayerName() ", pchParamNameTemp, pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "... " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")\n" );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle returned NULL!\n" );
}
return false;
}
*pString = pVar->GetPlayerName();
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tQ_strcpy( [%s], [%s]->GetPlayerName() ", pchParamNameTemp, pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\" ", pString->String() );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")\n" );
}
return true;
}
case LESSON_ACTION_CLASSNAME_IS:
{
if ( !pVar )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\t!FClassnameIs( [%s] " ) : ( "\tFClassnameIs( [%s] " ), pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "..." );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ", [%s] ", pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\" ", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")\n" );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle returned NULL!\n" );
}
return false;
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\t!FClassnameIs( [%s] " ) : ( "\tFClassnameIs( [%s] " ), pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%s", pVar->GetClassname() );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ", [%s] ", pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\" ", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")\n" );
}
return ( bNot ) ? ( !FClassnameIs( pVar, pchParam ) ) : ( FClassnameIs( pVar, pchParam ) );
}
case LESSON_ACTION_TEAM_IS:
{
int iTemp = static_cast<int>( fParam );
if ( !pVar )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->GetTeamNumber() ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "... " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "!= [%s] " ) : ( "== [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%i\n", iTemp );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle returned NULL!\n" );
}
return false;
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->GetTeamNumber() ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%i ", pVar->GetTeamNumber() );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "!= [%s] " ) : ( "== [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%i\n", iTemp );
}
return ( bNot ) ? ( pVar->GetTeamNumber() != iTemp ) : ( pVar->GetTeamNumber() == iTemp );
}
case LESSON_ACTION_MODELNAME_IS:
{
C_BaseAnimating *pBaseAnimating = dynamic_cast<C_BaseAnimating *>( pVar );
if ( !pBaseAnimating )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tQ_stricmp( [%s]->ModelName() ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "..." );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ", [%s] ", pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\" ", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ") != 0\n" ) : ( ") == 0\n" ) );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as BaseAnimating returned NULL!\n" );
}
return false;
}
const char *pchModelName = "-no model-";
CStudioHdr *pModel = pBaseAnimating->GetModelPtr();
if ( pModel )
{
const studiohdr_t *pRenderHDR = pModel->GetRenderHdr();
if ( pRenderHDR )
{
pchModelName = pRenderHDR->name;
}
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tQ_stricmp( [%s]->ModelName() ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%s", pchModelName );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ", [%s] ", pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\" ", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ") != 0\n" ) : ( ") == 0\n" ) );
}
return ( bNot ) ? ( Q_stricmp( pchModelName, pchParam ) != 0 ) : ( Q_stricmp( pchModelName, pchParam ) == 0 );
}
case LESSON_ACTION_HEALTH_LESS_THAN:
{
int iTemp = static_cast<int>( fParam );
if ( !pVar )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->GetHealth() ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "... " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ">= [%s] " ) : ( "< [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%i\n", iTemp );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle returned NULL!\n" );
}
return false;
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->GetHealth() ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%i ", pVar->GetHealth() );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ">= [%s] " ) : ( "< [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%i\n", iTemp );
}
return ( bNot ) ? ( pVar->GetHealth() >= iTemp ) : ( pVar->GetHealth() < iTemp );
}
case LESSON_ACTION_HEALTH_PERCENTAGE_LESS_THAN:
{
if ( !pVar )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->HealthFraction() ", pchVarName, pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "... " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ">= [%s] " ) : ( "< [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f\n", fParam );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle returned NULL!\n" );
}
return false;
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->HealthFraction() ", pchVarName, pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f ", pVar->HealthFraction() );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ">= [%s] " ) : ( "< [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f\n", fParam );
}
float fHealthPercentage = 1.0f;
if ( pVar->GetMaxHealth() != 0.0f )
{
fHealthPercentage = pVar->HealthFraction();
}
return ( bNot ) ? ( fHealthPercentage >= fParam ) : ( fHealthPercentage < fParam );
}
case LESSON_ACTION_GET_ACTIVE_WEAPON:
{
int iTemp = static_cast<int>( fParam );
if ( iTemp <= 0 || iTemp > 2 )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[entityINVALID] = [%s]->GetActiveWeapon()\n", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tParam selecting string is out of range!\n" );
}
return false;
}
// Use entity2 if it was specified, otherwise, use entity1
CHandle<C_BaseEntity> *pHandle;
char const *pchParamNameTemp = NULL;
if ( iTemp == 2 )
{
pHandle = &m_hEntity2;
pchParamNameTemp = "entity2";
}
else
{
pHandle = &m_hEntity1;
pchParamNameTemp = "entity1";
}
C_BaseCombatCharacter *pBaseCombatCharacter = NULL;
if ( pVar )
{
pBaseCombatCharacter = pVar->MyCombatCharacterPointer();
}
if ( !pBaseCombatCharacter )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s] = [%s]->GetActiveWeapon()", pchParamNameTemp, pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as BaseCombatCharacter returned NULL!\n" );
}
return false;
}
pHandle->Set( pBaseCombatCharacter->GetActiveWeapon() );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s] = [%s]->GetActiveWeapon()", pchParamNameTemp, pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"\n", pchParam );
}
return true;
}
case LESSON_ACTION_WEAPON_IS:
{
C_BaseCombatCharacter *pBaseCombatCharacter = NULL;
if ( pVar )
{
pBaseCombatCharacter = pVar->MyCombatCharacterPointer();
}
if ( !pBaseCombatCharacter )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->GetActiveWeapon()->GetName() ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "... " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "!= [%s] " ) : ( "== [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"\n", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as BaseCombatCharacter returned NULL!\n" );
}
return false;
}
CBaseCombatWeapon *pBaseCombatWeapon = pBaseCombatCharacter->GetActiveWeapon();
if ( !pBaseCombatWeapon )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->GetActiveWeapon()->GetName() ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "... " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "!= [%s] " ) : ( "== [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"\n", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar GetActiveWeapon returned NULL!\n" );
}
return false;
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->GetActiveWeapon()->GetName() ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\" ", pBaseCombatWeapon->GetName() );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "!= [%s] " ) : ( "== [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"\n", pchParam );
}
return ( bNot ) ? ( Q_stricmp( pBaseCombatWeapon->GetName(), pchParam ) != 0 ) : ( Q_stricmp( pBaseCombatWeapon->GetName(), pchParam ) == 0 );
}
case LESSON_ACTION_WEAPON_HAS:
{
C_BaseCombatCharacter *pBaseCombatCharacter = NULL;
if ( pVar )
{
pBaseCombatCharacter = pVar->MyCombatCharacterPointer();
}
if ( !pBaseCombatCharacter )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\t![%s]->Weapon_OwnsThisType([%s] " ) : ( "\t[%s]->Weapon_OwnsThisType([%s] " ), pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")\n" );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as BaseCombatCharacter returned NULL!\n" );
}
return false;
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\t![%s]->Weapon_OwnsThisType([%s] " ) : ( "\t[%s]->Weapon_OwnsThisType([%s] " ), pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")\n" );
}
return ( bNot ) ? ( pBaseCombatCharacter->Weapon_OwnsThisType( pchParam ) == NULL ) : ( pBaseCombatCharacter->Weapon_OwnsThisType( pchParam ) != NULL );
}
case LESSON_ACTION_GET_ACTIVE_WEAPON_SLOT:
{
C_BaseCombatCharacter *pBaseCombatCharacter = NULL;
if ( pVar )
{
pBaseCombatCharacter = pVar->MyCombatCharacterPointer();
}
if ( !pBaseCombatCharacter )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[output] = [%s]->Weapon_GetActiveSlot() ...\n", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as BaseCombatCharacter returned NULL!\n" );
}
return false;
}
C_BaseCombatWeapon *pWeapon = pBaseCombatCharacter->GetActiveWeapon();
if ( !pWeapon )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[output] = [%s]->Weapon_GetActiveSlot() ...\n", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar GetActiveWeapon returned NULL!\n" );
}
return false;
}
m_fOutput = pBaseCombatCharacter->Weapon_GetSlot( pWeapon->GetWpnData().szClassName );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[output] = [%s]->Weapon_GetSlot() ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f\n", m_fOutput );
}
return true;
}
case LESSON_ACTION_GET_WEAPON_SLOT:
{
C_BaseCombatCharacter *pBaseCombatCharacter = NULL;
if ( pVar )
{
pBaseCombatCharacter = pVar->MyCombatCharacterPointer();
}
if ( !pBaseCombatCharacter )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[output] = [%s]->Weapon_GetSlot([%s] ", pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ") ...\n" );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as BaseCombatCharacter returned NULL!\n" );
}
return false;
}
m_fOutput = pBaseCombatCharacter->Weapon_GetSlot( pchParam );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[output] = [%s]->Weapon_GetSlot([%s] ", pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ") " );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%f\n", m_fOutput );
}
return true;
}
case LESSON_ACTION_GET_WEAPON_IN_SLOT:
{
int nTemp = static_cast<int>( fParam );
C_BaseCombatCharacter *pBaseCombatCharacter = NULL;
if ( pVar )
{
pBaseCombatCharacter = pVar->MyCombatCharacterPointer();
}
if ( !pBaseCombatCharacter )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[entity1] = [%s]->GetWeapon([%s] ", pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%i\"", nTemp );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")\n" );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as BaseCombatCharacter returned NULL!\n" );
}
return false;
}
m_hEntity1 = pBaseCombatCharacter->GetWeapon( nTemp );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[entity1] = [%s]->GetWeapon([%s] ", pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%i\"", nTemp );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")\n" );
}
return true;
}
case LESSON_ACTION_CLIP_PERCENTAGE_LESS_THAN:
{
C_BaseCombatCharacter *pBaseCombatCharacter = NULL;
if ( pVar )
{
pBaseCombatCharacter = pVar->MyCombatCharacterPointer();
}
if ( !pBaseCombatCharacter )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->GetActiveWeapon()->Clip1Percentage() ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "... " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ">= [%s] " ) : ( "< [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%.1f\n", fParam );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as BaseCombatCharacter returned NULL!\n" );
}
return false;
}
CBaseCombatWeapon *pBaseCombatWeapon = pBaseCombatCharacter->GetActiveWeapon();
if ( !pBaseCombatWeapon )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->GetActiveWeapon()->Clip1Percentage() ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "... " );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ">= [%s] " ) : ( "< [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%.1f\n", fParam );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar GetActiveWeapon returned NULL!\n" );
}
return false;
}
float fClip1Percentage = 100.0f;
if ( pBaseCombatWeapon->UsesClipsForAmmo1() )
{
fClip1Percentage = 100.0f * ( static_cast<float>( pBaseCombatWeapon->Clip1() ) / static_cast<float>( pBaseCombatWeapon->GetMaxClip1() ) );
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->GetActiveWeapon()->Clip1Percentage() ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%.1f ", fClip1Percentage );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ">= [%s] " ) : ( "< [%s] " ), pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%.1f\n", fParam );
}
return ( bNot ) ? ( fClip1Percentage >= fParam ) : ( fClip1Percentage < fParam );
}
case LESSON_ACTION_WEAPON_AMMO_LOW:
{
int iTemp = static_cast<int>( fParam );
C_BasePlayer *pBasePlayer = ToBasePlayer( pVar );
if ( !pBasePlayer )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->GetWeaponInSlot( ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%i ", iTemp );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ")->AmmoPercentage() >= 30\n" ) : ( ")->AmmoPercentage() < 30\n" ) );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as BasePlayer returned NULL!\n" );
}
return false;
}
CBaseCombatWeapon *pBaseCombatWeapon = NULL;
// Get the weapon in variable slot
for ( int iWeapon = 0; iWeapon < MAX_WEAPONS; iWeapon++ )
{
CBaseCombatWeapon *pBaseCombatWeaponTemp = pBasePlayer->ActivePlayerCombatCharacter()->GetWeapon( iWeapon );
if ( pBaseCombatWeaponTemp )
{
if ( pBaseCombatWeaponTemp->GetSlot() == iTemp )
{
pBaseCombatWeapon = pBaseCombatWeaponTemp;
break;
}
}
}
if ( !pBaseCombatWeapon )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->GetWeaponInSlot( ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%i ", iTemp );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ")->AmmoPercentage() >= 30\n" ) : ( ")->AmmoPercentage() < 30\n" ) );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar GetActiveWeapon returned NULL!\n" );
}
return false;
}
// Check if the ammo is full
int iAmmoType = pBaseCombatWeapon->GetPrimaryAmmoType();
int iMaxAmmo = GetAmmoDef()->MaxCarry( iAmmoType, pBasePlayer );
int iPlayerAmmo = pBasePlayer->ActivePlayerCombatCharacter()->GetAmmoCount( iAmmoType );
bool bAmmoLow = ( iPlayerAmmo < ( iMaxAmmo / 3 ) );
if ( bNot )
{
bAmmoLow = !bAmmoLow;
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s]->GetWeaponInSlot( ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "%i ", iTemp );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ")->AmmoPercentage() >= 30 " ) : ( ")->AmmoPercentage() < 30 " ) );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bAmmoLow ) ? ( "true\n" ) : ( "false\n" ) );
}
return bAmmoLow;
}
case LESSON_ACTION_WEAPON_AMMO_FULL:
{
int iTemp = static_cast<int>( fParam );
C_BasePlayer *pBasePlayer = ToBasePlayer( pVar );
if ( !pBasePlayer )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\t![%s]->GetWeaponInSlot( " ) : ( "\t[%s]->GetWeaponInSlot( " ), pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseSuccess, "%i ", iTemp );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")->AmmoFull()\n" );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as BasePlayer returned NULL!\n" );
}
return false;
}
CBaseCombatWeapon *pBaseCombatWeapon = NULL;
// Get the weapon in variable slot
for ( int iWeapon = 0; iWeapon < MAX_WEAPONS; iWeapon++ )
{
CBaseCombatWeapon *pBaseCombatWeaponTemp = pBasePlayer->ActivePlayerCombatCharacter()->GetWeapon( iWeapon );
if ( pBaseCombatWeaponTemp )
{
if ( pBaseCombatWeaponTemp->GetSlot() == iTemp )
{
pBaseCombatWeapon = pBaseCombatWeaponTemp;
break;
}
}
}
if ( !pBaseCombatWeapon )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\t![%s]->GetWeaponInSlot( " ) : ( "\t[%s]->GetWeaponInSlot( " ), pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseSuccess, "%i ", iTemp );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")->AmmoFull()\n" );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar GetWeaponInSlot returned NULL!\n" );
}
return false;
}
// Check if the ammo is full
int iAmmoType = pBaseCombatWeapon->GetPrimaryAmmoType();
int iMaxAmmo = GetAmmoDef()->MaxCarry( iAmmoType, pBasePlayer );
int iPlayerAmmo = pBasePlayer->ActivePlayerCombatCharacter()->GetAmmoCount( iAmmoType );
bool bAmmoFull = ( iPlayerAmmo >= iMaxAmmo );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\t![%s]->GetWeaponInSlot( " ) : ( "\t[%s]->GetWeaponInSlot( " ), pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseSuccess, "%i ", iTemp );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")->AmmoFull() " );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, ( bAmmoFull ) ? ( "true\n" ) : ( "false\n" ) );
}
return ( bNot ) ? ( !bAmmoFull ) : ( bAmmoFull );
}
case LESSON_ACTION_WEAPON_AMMO_EMPTY:
{
int iTemp = static_cast<int>( fParam );
C_BasePlayer *pBasePlayer = ToBasePlayer( pVar );
if ( !pBasePlayer )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\t![%s]->GetWeaponInSlot( " ) : ( "\t[%s]->GetWeaponInSlot( " ), pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseSuccess, "%i ", iTemp );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")->AmmoEmpty()\n" );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as BasePlayer returned NULL!\n" );
}
return false;
}
CBaseCombatWeapon *pBaseCombatWeapon = NULL;
// Get the weapon in variable slot
for ( int iWeapon = 0; iWeapon < MAX_WEAPONS; iWeapon++ )
{
CBaseCombatWeapon *pBaseCombatWeaponTemp = pBasePlayer->ActivePlayerCombatCharacter()->GetWeapon( iWeapon );
if ( pBaseCombatWeaponTemp )
{
if ( pBaseCombatWeaponTemp->GetSlot() == iTemp )
{
pBaseCombatWeapon = pBaseCombatWeaponTemp;
break;
}
}
}
if ( !pBaseCombatWeapon )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\t![%s]->GetWeaponInSlot( " ) : ( "\t[%s]->GetWeaponInSlot( " ), pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseSuccess, "%i ", iTemp );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")->AmmoEmpty()\n" );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar GetWeaponInSlot returned NULL!\n" );
}
return false;
}
// Check if the ammo is empty
int iAmmoType = pBaseCombatWeapon->GetPrimaryAmmoType();
int iPlayerAmmo = pBasePlayer->ActivePlayerCombatCharacter()->GetAmmoCount( iAmmoType );
bool bAmmoEmpty = ( iPlayerAmmo <= 0 );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\t![%s]->GetWeaponInSlot( " ) : ( "\t[%s]->GetWeaponInSlot( " ), pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseSuccess, "%i ", iTemp );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")->AmmoEmpty() " );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, ( bAmmoEmpty ) ? ( "true" ) : ( "false" ) );
ConColorMsg(CBaseLesson::m_rgbaVerbosePlain, " )\n" );
}
return ( bNot ) ? ( !bAmmoEmpty ) : ( bAmmoEmpty );
}
case LESSON_ACTION_WEAPON_CAN_USE:
{
C_BaseCombatWeapon *pBaseCombatWeapon = dynamic_cast<C_BaseCombatWeapon*>( pParam );
C_BasePlayer *pBasePlayer = ToBasePlayer( pVar );
if ( !pBasePlayer )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\t![%s]->Weapon_CanUse([%s])\n" ) : ( "\t[%s]->Weapon_CanUse([%s])\n" ), pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as BasePlayer returned NULL!\n" );
}
return false;
}
if ( !pBaseCombatWeapon )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\t![%s]->Weapon_CanUse([%s])\n" ) : ( "\t[%s]->Weapon_CanUse([%s])\n" ), pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tParam BaseCombatWeapon returned NULL!\n" );
}
return false;
}
bool bCanEquip = pBasePlayer->Weapon_CanUse( pBaseCombatWeapon );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\t![%s]->Weapon_CanUse([%s]) " ) : ( "\t[%s]->Weapon_CanUse([%s]) " ), pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, ( bCanEquip ) ? ( "true\n" ) : ( "false\n" ) );
}
return ( bNot ) ? ( !bCanEquip ) : ( bCanEquip );
}
case LESSON_ACTION_USE_TARGET_IS:
{
C_BasePlayer *pBasePlayer = ToBasePlayer( pVar );
if ( !pBasePlayer )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\tC_BaseEntity::Instance([%s]->GetUseEntity()) != [%s]\n" ) : ( "\tC_BaseEntity::Instance([%s]->GetUseEntity()) == [%s]\n" ), pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as Player returned NULL!\n" );
}
return false;
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( "\tC_BaseEntity::Instance([%s]->GetUseEntity()) != [%s]\n" ) : ( "\tC_BaseEntity::Instance([%s]->GetUseEntity()) == [%s]\n" ), pchVarName, pchParamName->String() );
}
return ( bNot ) ? ( C_BaseEntity::Instance( pBasePlayer->GetUseEntity() ) != pParam ) : ( C_BaseEntity::Instance( pBasePlayer->GetUseEntity() ) == pParam );
}
case LESSON_ACTION_GET_USE_TARGET:
{
int iTemp = static_cast<int>( fParam );
if ( iTemp <= 0 || iTemp > 2 )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[entityINVALID] = C_BaseEntity::Instance([%s]->GetUseEntity())\n", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tParam selecting string is out of range!\n" );
}
return false;
}
// Use entity2 if it was specified, otherwise, use entity1
CHandle<C_BaseEntity> *pHandle;
char const *pchParamNameTemp = NULL;
if ( iTemp == 2 )
{
pHandle = &m_hEntity2;
pchParamNameTemp = "entity2";
}
else
{
pHandle = &m_hEntity1;
pchParamNameTemp = "entity1";
}
C_BasePlayer *pBasePlayer = ToBasePlayer( pVar );
if ( !pBasePlayer )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s] = C_BaseEntity::Instance([%s]->GetUseEntity())\n", pchParamNameTemp, pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as Player returned NULL!\n" );
}
return false;
}
pHandle->Set( C_BaseEntity::Instance( pBasePlayer->GetUseEntity() ) );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s] = C_BaseEntity::Instance([%s]->GetUseEntity())\n", pchParamNameTemp, pchVarName );
}
return true;
}
case LESSON_ACTION_GET_POTENTIAL_USE_TARGET:
{
int iTemp = static_cast<int>( fParam );
if ( iTemp <= 0 || iTemp > 2 )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[entityINVALID] = C_BaseEntity::Instance([%s]->GetPotentialUseEntity())\n", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tParam selecting string is out of range!\n" );
}
return false;
}
// Use entity2 if it was specified, otherwise, use entity1
CHandle<C_BaseEntity> *pHandle;
char const *pchParamNameTemp = NULL;
if ( iTemp == 2 )
{
pHandle = &m_hEntity2;
pchParamNameTemp = "entity2";
}
else
{
pHandle = &m_hEntity1;
pchParamNameTemp = "entity1";
}
C_BasePlayer *pBasePlayer = ToBasePlayer( pVar );
if ( !pBasePlayer )
{
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s] = C_BaseEntity::Instance([%s]->GetPotentialUseEntity())\n", pchParamNameTemp, pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseClose, "\tVar handle as Player returned NULL!\n" );
}
return false;
}
pHandle->Set( C_BaseEntity::Instance( pBasePlayer->GetPotentialUseEntity() ) );
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\t[%s] = C_BaseEntity::Instance([%s]->GetPotentialUseEntity())\n", pchParamNameTemp, pchVarName );
}
return true;
}
}
DevWarning( "Invalid lesson action type used with \"%s\" variable type.\n", pchVarName );
return false;
}
bool CScriptedIconLesson::ProcessElementAction( int iAction, bool bNot, const char *pchVarName, CGameInstructorSymbol *pchVar, const CGameInstructorSymbol *pchParamName, const char *pchParam )
{
switch ( iAction )
{
case LESSON_ACTION_REFERENCE_OPEN:
{
const CBaseLesson *pLesson = GetGameInstructor().GetLesson( pchParamName->String() );
if ( !pLesson )
{
DevWarning( "Invalid lesson specified: \"%s\".", pchParamName->String() );
return false;
}
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( Color( 64, 128, 255, 255 ), ( bNot ) ? ( "\t!( [\"%s\"]->IsInstanceActive() " ) : ( "\t( [\"%s\"]->IsInstanceActive() " ), pchParamName->String() );
ConColorMsg( Color( 255, 255, 255, 255 ), "\"%s\"", (pLesson->IsInstanceActive() ? "true" : "false") );
ConColorMsg( Color( 64, 128, 255, 255 ), " )\n" );
}
return ( bNot ) ? ( !pLesson->IsInstanceActive() ) : ( pLesson->IsInstanceActive() );
}
case LESSON_ACTION_SET:
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tQ_strcpy([%s], [%s] ", pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")\n" );
}
*pchVar = pchParam;
return true;
case LESSON_ACTION_ADD:
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tQ_strcat([%s], [%s] ", pchVarName, pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ")\n" );
}
char szTemp[ 256 ];
Q_strncpy( szTemp, pchVar->String(), sizeof( szTemp ) );
Q_strncat( szTemp, pchParam, sizeof( szTemp ) );
*pchVar = szTemp;
return true;
case LESSON_ACTION_IS:
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tQ_strcmp([%s] ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"", pchVar->String() );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ", [%s] ", pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ") != 0\n" ) : ( ") == 0\n" ) );
}
return ( bNot ) ? ( Q_strcmp( pchVar->String(), pchParam ) != 0 ) : ( Q_strcmp( pchVar->String(), pchParam ) == 0 );
case LESSON_ACTION_HAS_PREFIX:
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tStringHasPrefix([%s] ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"", pchVar->String() );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ", [%s] ", pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerboseName, "\"%s\"", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ") == false\n" ) : ( ") == true\n" ) );
}
return ( bNot ) ? ( !StringHasPrefix( pchVar->String(), pchParam ) ) : ( StringHasPrefix( pchVar->String(), pchParam ) );
case LESSON_ACTION_LESS_THAN:
if ( gameinstructor_verbose.GetInt() > 0 && ShouldShowSpew() )
{
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\tQ_strcmp([%s] ", pchVarName );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\"%s\"", pchVar->String() );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ", [%s] ", pchParamName->String() );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "\"%s\"", pchParam );
ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, ( bNot ) ? ( ") >= 0\n" ) : ( ") < 0\n" ) );
}
return ( bNot ) ? ( Q_strcmp( pchVar->String(), pchParam ) >= 0 ) : ( Q_strcmp( pchVar->String(), pchParam ) < 0 );
}
DevWarning( "Invalid lesson action type used with \"%s\" variable type.\n", pchVarName );
return false;
}
LessonEvent_t * CScriptedIconLesson::AddOpenEvent( void )
{
int iNewLessonEvent = m_OpenEvents.AddToTail();
return &(m_OpenEvents[ iNewLessonEvent ]);
}
LessonEvent_t * CScriptedIconLesson::AddCloseEvent( void )
{
int iNewLessonEvent = m_CloseEvents.AddToTail();
return &(m_CloseEvents[ iNewLessonEvent ]);
}
LessonEvent_t * CScriptedIconLesson::AddSuccessEvent( void )
{
int iNewLessonEvent = m_SuccessEvents.AddToTail();
return &(m_SuccessEvents[ iNewLessonEvent ]);
}
LessonEvent_t * CScriptedIconLesson::AddOnOpenEvent( void )
{
int iNewLessonEvent = m_OnOpenEvents.AddToTail();
return &(m_OnOpenEvents[ iNewLessonEvent ]);
}
LessonEvent_t * CScriptedIconLesson::AddUpdateEvent( void )
{
int iNewLessonEvent = m_UpdateEvents.AddToTail();
return &(m_UpdateEvents[ iNewLessonEvent ]);
}
// Static method to init the keyvalues symbols used for comparisons
void CScriptedIconLesson::PreReadLessonsFromFile()
{
static bool bFirstTime = true;
if ( !bFirstTime )
return;
bFirstTime = false;
// Run init info call macros on all scriptable variables (see: LESSON_VARIABLE_FACTORY definition)
#define LESSON_VARIABLE_MACRO LESSON_VARIABLE_INIT_SYMBOL
#define LESSON_VARIABLE_MACRO_BOOL LESSON_VARIABLE_INIT_SYMBOL
#define LESSON_VARIABLE_MACRO_EHANDLE LESSON_VARIABLE_INIT_SYMBOL
#define LESSON_VARIABLE_MACRO_STRING LESSON_VARIABLE_INIT_SYMBOL
LESSON_VARIABLE_FACTORY
#undef LESSON_VARIABLE_MACRO
#undef LESSON_VARIABLE_MACRO_BOOL
#undef LESSON_VARIABLE_MACRO_EHANDLE
#undef LESSON_VARIABLE_MACRO_STRING
// And build the map of variable name to enum
// Run string to int macros on all scriptable variables (see: LESSON_VARIABLE_FACTORY definition)
#define LESSON_VARIABLE_MACRO LESSON_SCRIPT_STRING_ADD_TO_MAP
#define LESSON_VARIABLE_MACRO_BOOL LESSON_SCRIPT_STRING_ADD_TO_MAP
#define LESSON_VARIABLE_MACRO_EHANDLE LESSON_SCRIPT_STRING_ADD_TO_MAP
#define LESSON_VARIABLE_MACRO_STRING LESSON_SCRIPT_STRING_ADD_TO_MAP
LESSON_VARIABLE_FACTORY
#undef LESSON_VARIABLE_MACRO
#undef LESSON_VARIABLE_MACRO_BOOL
#undef LESSON_VARIABLE_MACRO_EHANDLE
#undef LESSON_VARIABLE_MACRO_STRING
// Set up mapping of field types
g_TypeToParamTypeMap.Insert( "float", FIELD_FLOAT );
g_TypeToParamTypeMap.Insert( "string", FIELD_STRING );
g_TypeToParamTypeMap.Insert( "int", FIELD_INTEGER );
g_TypeToParamTypeMap.Insert( "integer", FIELD_INTEGER );
g_TypeToParamTypeMap.Insert( "short", FIELD_INTEGER );
g_TypeToParamTypeMap.Insert( "long", FIELD_INTEGER );
g_TypeToParamTypeMap.Insert( "bool", FIELD_BOOLEAN );
g_TypeToParamTypeMap.Insert( "player", FIELD_CUSTOM );
g_TypeToParamTypeMap.Insert( "entity", FIELD_EHANDLE );
g_TypeToParamTypeMap.Insert( "convar", FIELD_EMBEDDED );
g_TypeToParamTypeMap.Insert( "void", FIELD_VOID );
// Set up the lesson action map
CScriptedIconLesson::LessonActionMap.Insert( "scope in", LESSON_ACTION_SCOPE_IN );
CScriptedIconLesson::LessonActionMap.Insert( "scope out", LESSON_ACTION_SCOPE_OUT );
CScriptedIconLesson::LessonActionMap.Insert( "close", LESSON_ACTION_CLOSE );
CScriptedIconLesson::LessonActionMap.Insert( "success", LESSON_ACTION_SUCCESS );
CScriptedIconLesson::LessonActionMap.Insert( "lock", LESSON_ACTION_LOCK );
CScriptedIconLesson::LessonActionMap.Insert( "present complete", LESSON_ACTION_PRESENT_COMPLETE );
CScriptedIconLesson::LessonActionMap.Insert( "present start", LESSON_ACTION_PRESENT_START );
CScriptedIconLesson::LessonActionMap.Insert( "present end", LESSON_ACTION_PRESENT_END );
CScriptedIconLesson::LessonActionMap.Insert( "reference open", LESSON_ACTION_REFERENCE_OPEN );
CScriptedIconLesson::LessonActionMap.Insert( "set", LESSON_ACTION_SET );
CScriptedIconLesson::LessonActionMap.Insert( "add", LESSON_ACTION_ADD );
CScriptedIconLesson::LessonActionMap.Insert( "subtract", LESSON_ACTION_SUBTRACT );
CScriptedIconLesson::LessonActionMap.Insert( "multiply", LESSON_ACTION_MULTIPLY );
CScriptedIconLesson::LessonActionMap.Insert( "is", LESSON_ACTION_IS );
CScriptedIconLesson::LessonActionMap.Insert( "less than", LESSON_ACTION_LESS_THAN );
CScriptedIconLesson::LessonActionMap.Insert( "has prefix", LESSON_ACTION_HAS_PREFIX );
CScriptedIconLesson::LessonActionMap.Insert( "has bit", LESSON_ACTION_HAS_BIT );
CScriptedIconLesson::LessonActionMap.Insert( "bit count is", LESSON_ACTION_BIT_COUNT_IS );
CScriptedIconLesson::LessonActionMap.Insert( "bit count less than", LESSON_ACTION_BIT_COUNT_LESS_THAN );
CScriptedIconLesson::LessonActionMap.Insert( "get distance", LESSON_ACTION_GET_DISTANCE );
CScriptedIconLesson::LessonActionMap.Insert( "get angular distance", LESSON_ACTION_GET_ANGULAR_DISTANCE );
CScriptedIconLesson::LessonActionMap.Insert( "get player display name", LESSON_ACTION_GET_PLAYER_DISPLAY_NAME );
CScriptedIconLesson::LessonActionMap.Insert( "classname is", LESSON_ACTION_CLASSNAME_IS );
CScriptedIconLesson::LessonActionMap.Insert( "modelname is", LESSON_ACTION_MODELNAME_IS );
CScriptedIconLesson::LessonActionMap.Insert( "team is", LESSON_ACTION_TEAM_IS );
CScriptedIconLesson::LessonActionMap.Insert( "health less than", LESSON_ACTION_HEALTH_LESS_THAN );
CScriptedIconLesson::LessonActionMap.Insert( "health percentage less than", LESSON_ACTION_HEALTH_PERCENTAGE_LESS_THAN );
CScriptedIconLesson::LessonActionMap.Insert( "get active weapon", LESSON_ACTION_GET_ACTIVE_WEAPON );
CScriptedIconLesson::LessonActionMap.Insert( "weapon is", LESSON_ACTION_WEAPON_IS );
CScriptedIconLesson::LessonActionMap.Insert( "weapon has", LESSON_ACTION_WEAPON_HAS );
CScriptedIconLesson::LessonActionMap.Insert( "get active weapon slot", LESSON_ACTION_GET_ACTIVE_WEAPON_SLOT );
CScriptedIconLesson::LessonActionMap.Insert( "get weapon slot", LESSON_ACTION_GET_WEAPON_SLOT );
CScriptedIconLesson::LessonActionMap.Insert( "get weapon in slot", LESSON_ACTION_GET_WEAPON_IN_SLOT );
CScriptedIconLesson::LessonActionMap.Insert( "clip percentage less than", LESSON_ACTION_CLIP_PERCENTAGE_LESS_THAN);
CScriptedIconLesson::LessonActionMap.Insert( "weapon ammo low", LESSON_ACTION_WEAPON_AMMO_LOW );
CScriptedIconLesson::LessonActionMap.Insert( "weapon ammo full", LESSON_ACTION_WEAPON_AMMO_FULL );
CScriptedIconLesson::LessonActionMap.Insert( "weapon ammo empty", LESSON_ACTION_WEAPON_AMMO_EMPTY );
CScriptedIconLesson::LessonActionMap.Insert( "weapon can use", LESSON_ACTION_WEAPON_CAN_USE );
CScriptedIconLesson::LessonActionMap.Insert( "use target is", LESSON_ACTION_USE_TARGET_IS );
CScriptedIconLesson::LessonActionMap.Insert( "get use target", LESSON_ACTION_GET_USE_TARGET );
CScriptedIconLesson::LessonActionMap.Insert( "get potential use target", LESSON_ACTION_GET_POTENTIAL_USE_TARGET );
// Add mod actions to the map
//Mod_PreReadLessonsFromFile();
}
| [
"castl@inbox.ru"
] | castl@inbox.ru |
67e9b836710c89e6c141a479c3f28575779227fc | 9c16d6b984c9a22c219bd2a20a02db21a51ba8d7 | /chromecast/media/cma/base/decoder_buffer_base.h | 08cf94b0e888eeb0df14920b3b6eee0b3efd7732 | [
"BSD-3-Clause"
] | permissive | nv-chromium/chromium-crosswalk | fc6cc201cb1d6a23d5f52ffd3a553c39acd59fa7 | b21ec2ffe3a13b6a8283a002079ee63b60e1dbc5 | refs/heads/nv-crosswalk-17 | 2022-08-25T01:23:53.343546 | 2019-01-16T21:35:23 | 2019-01-16T21:35:23 | 63,197,891 | 0 | 0 | NOASSERTION | 2019-01-16T21:38:06 | 2016-07-12T22:58:43 | null | UTF-8 | C++ | false | false | 2,004 | 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 CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_BASE_H_
#define CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_BASE_H_
#include "base/basictypes.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/time/time.h"
#include "chromecast/public/media/stream_id.h"
namespace chromecast {
namespace media {
class CastDecryptConfig;
// DecoderBufferBase exposes only the properties of an audio/video buffer.
// The way a DecoderBufferBase is created and organized in memory
// is left as a detail of the implementation of derived classes.
class DecoderBufferBase
: public base::RefCountedThreadSafe<DecoderBufferBase> {
public:
DecoderBufferBase() {}
// Returns the stream id of this decoder buffer belonging to. it's optional
// and default value is kPrimary.
virtual StreamId stream_id() const = 0;
// Returns the PTS of the frame.
virtual base::TimeDelta timestamp() const = 0;
// Sets the PTS of the frame.
virtual void set_timestamp(base::TimeDelta timestamp) = 0;
// Gets the frame data.
virtual const uint8* data() const = 0;
virtual uint8* writable_data() const = 0;
// Returns the size of the frame in bytes.
virtual size_t data_size() const = 0;
// Returns the decrypt configuration.
// Returns NULL if the buffer has no decrypt info.
virtual const CastDecryptConfig* decrypt_config() const = 0;
// Indicate if this is a special frame that indicates the end of the stream.
// If true, functions to access the frame content cannot be called.
virtual bool end_of_stream() const = 0;
protected:
friend class base::RefCountedThreadSafe<DecoderBufferBase>;
virtual ~DecoderBufferBase() {}
private:
DISALLOW_COPY_AND_ASSIGN(DecoderBufferBase);
};
} // namespace media
} // namespace chromecast
#endif // CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_BASE_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
fc7cb548e0f15682caff198da4f03d2028923252 | bcd32907dc7b292350371ac5cc9b67bd3b7a99c2 | /development/C++/src/server/Ae/ServerAeAttribute.h | 7ebf10dd52704530833b1d331c087b7034568538 | [
"MIT"
] | permissive | SoftingIndustrial/OPC-Classic-SDK | c6d3777e2121d6ca34da571930a424717740171e | 08f4b3e968acfce4b775299741cef1819e24fda1 | refs/heads/main | 2022-07-28T14:53:00.481800 | 2022-01-17T13:58:46 | 2022-01-17T13:58:46 | 335,269,862 | 41 | 16 | MIT | 2022-01-17T15:11:39 | 2021-02-02T11:43:04 | C++ | UTF-8 | C++ | false | false | 830 | h | #ifndef _SERVERAEATTRIBUTE_H_
#define _SERVERAEATTRIBUTE_H_
#include "../../Enums.h"
#ifdef WIN64
#pragma pack(push,8)
#else
#pragma pack(push,4)
#endif
namespace SoftingOPCToolboxServer
{
class TBC_EXPORT AeAttribute
{
private:
unsigned long m_id;
tstring m_name;
VARENUM m_dataType;
public:
AeAttribute(
unsigned long anId,
tstring& aName,
VARENUM aDataType);
unsigned long getId(void)
{
return m_id;
}
void setId(unsigned long aValue)
{
m_id = aValue;
}
tstring& getName(void)
{
return m_name;
}
void setName(tstring& aValue)
{
m_name = aValue;
}
VARENUM getDataType(void)
{
return m_dataType;
}
void setDataType(VARENUM aValue)
{
m_dataType = aValue;
}
}; // end class Attribute
} // end namespace SoftingOPCToolboxServer
#pragma pack(pop)
#endif // _AEATTRIBUTE_H_
| [
"35690118+FischerSeb@users.noreply.github.com"
] | 35690118+FischerSeb@users.noreply.github.com |
f812b1e09ce2cbbfeccc6f8c7ce5a5b360e7a6e6 | cc88d733d3d1783c19530eee545c568836c197e0 | /server/include/chilkat/CkLog.h | 0707b7628035ae9676ca3d38d7f6901809a562b2 | [
"Apache-2.0"
] | permissive | SKKU-Tizen-SecBTKey/FrameworkVirtualKeyboard | e9069dcb622d58fea087190cfe1bfd08387fc030 | 6962d4ef499e333f53bb25bed5ef0fe9c48be717 | refs/heads/master | 2016-09-06T12:43:00.897916 | 2015-06-09T16:45:24 | 2015-06-09T16:45:24 | 33,869,404 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,803 | h | // CkLog.h: interface for the CkLog class.
//
//////////////////////////////////////////////////////////////////////
// This header is generated for Chilkat v9.5.0
#ifndef _CkLog_H
#define _CkLog_H
#include "chilkatDefs.h"
#include "CkString.h"
#include "CkMultiByteBase.h"
class CkByteData;
#ifndef __sun__
#pragma pack (push, 8)
#endif
// CLASS: CkLog
class CK_VISIBLE_PUBLIC CkLog : public CkMultiByteBase
{
private:
// Don't allow assignment or copying these objects.
CkLog(const CkLog &);
CkLog &operator=(const CkLog &);
public:
CkLog(void);
virtual ~CkLog(void);
static CkLog *createNew(void);
void CK_VISIBLE_PRIVATE inject(void *impl);
// May be called when finished with the object to free/dispose of any
// internal resources held by the object.
void dispose(void);
// BEGIN PUBLIC INTERFACE
// ----------------------
// Properties
// ----------------------
// ----------------------
// Methods
// ----------------------
// Clears the log. The ARG1 is the initial top-level context tag for the new log.
void Clear(const char *initialTag);
// Enters a new context labelled with the given tag. Must be paired with a matching
// call to LeaveContext.
void EnterContext(const char *tag);
// Leaves the current context. A context that is entered and exited without any
// logging within the context is automatically removed from the log. (To say it
// another way: Empty contexts are automaticallly removed from the log upon leaving
// the context.)
void LeaveContext(void);
// Adds a tagged message to the log (i.e. a name/value pair).
void LogData(const char *tag, const char *message);
// Logs binary data in base64 format.
void LogDataBase64(const char *tag, const CkByteData &data);
// Logs binary data in hex format.
void LogDataHex(const char *tag, const CkByteData &data);
// Logs a string, but only up to the 1st ARG3 characters of the string.
void LogDataMax(const char *tag, const char *message, int maxNumChars);
// Logs the current date/time in RFC822 format. If ARG2 is true, then the GMT/UTC
// time is logged. Otherwise it is the local time.
void LogDateTime(const char *tag, bool gmt);
// Logs an error within the current context.
void LogError(const char *message);
// Logs an informational message within the current context.
void LogInfo(const char *message);
// Logs an integer.
void LogInt(const char *tag, int value);
// Logs a 64-bit integer.
void LogInt64(const char *tag, __int64 value);
// Logs the current time in HH:MM:SS:mmm format.
void LogTimestamp(const char *tag);
// END PUBLIC INTERFACE
};
#ifndef __sun__
#pragma pack (pop)
#endif
#endif
| [
"jinmok80@naver.com"
] | jinmok80@naver.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.