blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 986
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 23
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 145
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 122
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
745c0f283c6850ed596d1ea63ff2cf11f426b0e4 | 93409e882a893eff3d6a535d6ac94c57aca98e46 | /source/FPIdle.cpp | 21bec48b72544d65132bea5966d53528467adc57 | [] | no_license | begner/CUELegendKeys | e62f44e89189a7b2fe840014be70038552962918 | 2ebee4a18bb0bfb9fec73739b37e79c4b3f0bef6 | refs/heads/master | 2021-01-20T15:36:24.974091 | 2016-11-17T20:11:46 | 2016-11-17T20:11:46 | 65,309,600 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,269 | cpp | #include "FPIdle.h"
FPIdle::FPIdle(HWND uiHWND) : FPScreenMirror(uiHWND)
{
NuLogger::getInstance()->log("Setup FrameProcessing Idle");
desktopWindow = GetDesktopWindow();
FPScreenMirror::setCaptureWindow(desktopWindow);
FPScreenMirror::setOffset(RECT{ 100, 200, 100, 0 });
FPScreenMirror::setUIDimensions(209, 287, 363, 204);
FPScreenMirror::reinitialize();
}
FPIdle::~FPIdle()
{
}
int FPIdle::getWindowBackgroundResource() {
if (mode == FP_IDLE_MODE_OFF) {
return IDB_WINDOW_BACKGROUND_IDLE;
}
else {
return IDB_WINDOW_BACKGROUND_IDLE_MIRROR;
}
}
void FPIdle::setCaptureWindow(HWND currentProcess) {
}
bool FPIdle::process() {
if (mode == FP_IDLE_MODE_OFF) {
// IDLE Mode does not need to be limitless
enableFpsLimit(true);
setFpsLimit(Settings::getInstance()->getValue("IdleMode", "IdleFPSLimit", (int)2));
PerformanceStart();
// copy background to UI
getBackgroundMat()->copyTo(drawUI);
PerformanceDraw(getBackgroundMat()->cols - 130, 20);
drawToWindow(&drawUI);
PerformanceStop();
return true;
}
else {
setFpsLimit(Settings::getInstance()->getValue("IdleMode", "ScreenMirrorFPSLimit", (int)15));
return FPScreenMirror::process();
}
}
void FPIdle::setMode(int setMode) {
mode = setMode;
} | [
"ben@egner.it"
] | ben@egner.it |
1ae5d622751dacbd34ca9053d5e2f957062e91ea | 1d1790e544ce2764b57015551bc8ce3822af43e3 | /main.cpp | 64e8f493671761c75ff17b7922278f1717a62724 | [] | no_license | AhmedSakrr/ReinDamit | bbc10ca89d33a90b352ead3114ab7745b9e2798f | 6645d749101032142d258b3beb2a59f77dbdaba6 | refs/heads/master | 2022-03-24T04:53:25.685114 | 2019-12-22T17:48:51 | 2019-12-22T17:48:51 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,443 | cpp | #include "rein.h"
#include <fstream>
#include <iostream>
int inject(HWND parent, char* file[], char* proc[]);
char szDllFile[300];
char szProc[100];
LRESULT CALLBACK MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
switch (uMsg) {
case WM_CLOSE:
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int cmdShow)
{
std::ifstream config;
config.open("rein.conf");
if (config.is_open()){
if (!config.eof()) {
config >> szDllFile;
}
if (!config.eof()) {
config >> szProc;
}
}
config.close();
WNDCLASS wc;
MSG msg;
HWND hWnd;
CHAR className[] = "text";
wc = {};
wc.lpfnWndProc = MessageHandler;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wc.hInstance = hInstance;
wc.lpszClassName = className;
hWnd = CreateWindow(className, className, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, 0, 0, hInstance, 0);
ShowWindow(hWnd, cmdShow);
SetForegroundWindow(hWnd);
SetFocus(hWnd);
UpdateWindow(hWnd);
while (true) {
BOOL res = GetMessage(&msg, 0, 0, 0);
if (res > 0) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else {
return res;
}
}
}
int inject(HWND parent, char* file[], char* proc[]){
PROCESSENTRY32 PE32{ 0 };
PE32.dwSize = sizeof(PE32);
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hSnap == INVALID_HANDLE_VALUE) {
DWORD Error = GetLastError();
MessageBox(parent, "Error: Invalid Handle", "There was a Problem loading the process list", MB_OK | MB_ICONERROR);
return 1;
}
else {
BOOL bRet = Process32First(hSnap, &PE32);
DWORD PID = 0;
while (bRet) {
if (!strcmp(*proc, PE32.szExeFile)) {
PID = PE32.th32ProcessID;
break;
}
bRet = Process32Next(hSnap, &PE32);
}
CloseHandle(hSnap);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID);
if (hProc) {
if (ReinManuell(hProc, *file)) {
MessageBox(parent, "SUCCESS!", "DLL was injected", MB_OK | MB_ICONHAND);
}
else {
DWORD Error = GetLastError();
MessageBox(parent, "Error:", "Was not able to inject :'(", MB_OK | MB_ICONERROR);
}
}else {
DWORD Error = GetLastError();
MessageBox(parent, "Error:", "was not able to open the process", MB_OK | MB_ICONERROR);
}
CloseHandle(hProc);
}
return 0;
} | [
"Erarnitox@gmail.com"
] | Erarnitox@gmail.com |
e8825f57421b101fc71981fb83866927132c665a | 31d51c412a99ecbc3e0e191c402cca3e858142bf | /computeCTR.cpp | 29ccd9044dbc8300dd883e66291e284bacc5ad44 | [] | no_license | marcopizzichemi/Macros | 985579b70f88af99d56d187147936d7f872988b2 | 45e3a8d6b98b24ec071a56b0ead5a0ae6b3fa358 | refs/heads/master | 2020-04-15T14:28:41.910391 | 2018-10-15T09:24:20 | 2018-10-15T09:24:20 | 44,091,951 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,946 | cpp | // compile with
// g++ -o ../build/computeCTR computeCTR.cpp `root-config --cflags --glibs` -Wl,--no-as-needed -lHist -lCore -lMathCore -lTree -lTreePlayer
// small program to extract timing calibration and data
#include "TROOT.h"
#include "TFile.h"
#include "TStyle.h"
#include "TSystem.h"
#include "TLegend.h"
#include "TCanvas.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TH3I.h"
#include "TString.h"
#include "TApplication.h"
#include "TLegend.h"
#include "TTree.h"
#include "TF2.h"
#include "TGraph2D.h"
#include "TGraph.h"
#include "TSpectrum.h"
#include "TSpectrum2.h"
#include "TTreeFormula.h"
#include "TMath.h"
#include "TChain.h"
#include "TCut.h"
#include "TLine.h"
#include "TError.h"
#include "TEllipse.h"
#include "TFormula.h"
#include "TGraphErrors.h"
#include "TGraph2DErrors.h"
#include "TMultiGraph.h"
#include "TCutG.h"
#include "TGaxis.h"
#include "TPaveStats.h"
#include "TProfile.h"
#include "TH1D.h"
#include "TPaveText.h"
#include "TGraphDelaunay.h"
#include "TVector.h"
#include "TNamed.h"
#include "TPaveLabel.h"
#include "THStack.h"
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <stdio.h>
#include <getopt.h>
#include <algorithm> // std::sort
void extractCTR(TH1F* histo,double fitMin,double fitMax, int divs, double* res)
{
double f1min = histo->GetXaxis()->GetXmin();
double f1max = histo->GetXaxis()->GetXmax();
// std::cout << f1min << " " << f1max << std::endl;
TF1* f1 = new TF1("f1","crystalball");
f1->SetParameters(histo->GetMaximum(),histo->GetMean(),histo->GetRMS(),1,3);
histo->Fit(f1,"Q","",fitMin,fitMax);
double min,max,min10,max10;
// int divs = 3000;
double step = (f1max-f1min)/divs;
// is [0] the max of the function???
for(int i = 0 ; i < divs ; i++)
{
// std::cout << f1->Eval(f1min + i*step) << "\t"
// << f1->Eval(f1min + (i+1)*step) << "\t"
// << f1->GetParameter(0) << "\t"
// << std::endl;
if( (f1->Eval(f1min + i*step) < f1->GetParameter(0)/2.0) && (f1->Eval(f1min + (i+1)*step) > f1->GetParameter(0)/2.0) )
{
min = f1min + (i+0.5)*step;
// std::cout << f1->Eval(f1min + i*step) << " "
// << f1->Eval(f1min + (i+1)*step) << " "
// << f1->GetMaximum()/2.0 << " "
// << min << std::endl;
}
if( (f1->Eval(f1min + i*step) > f1->GetParameter(0)/2.0) && (f1->Eval(f1min + (i+1)*step) < f1->GetParameter(0)/2.0) )
{
max = f1min + (i+0.5)*step;
}
if( (f1->Eval(f1min + i*step) < f1->GetParameter(0)/10.0) && (f1->Eval(f1min + (i+1)*step) > f1->GetParameter(0)/10.0) )
{
min10 = f1min + (i+0.5)*step;
}
if( (f1->Eval(f1min + i*step) > f1->GetParameter(0)/10.0) && (f1->Eval(f1min + (i+1)*step) < f1->GetParameter(0)/10.0) )
{
max10 = f1min + (i+0.5)*step;
}
}
res[0] = sqrt(2)*sqrt(pow((max-min),2)-pow(70e-12,2));
res[1] = sqrt(2)*sqrt(pow((max10-min10),2)-pow((70e-12/2.355)*4.29,2));
}
void usage()
{
std::cout << "\t\t" << "[-i|--input] <temp.root> [-o|--output] <output.root> [-c|--calibration] calibration.root [--coincidence] coincidence.root [OPTIONS]" << std::endl
<< "\t\t" << "<temp.root> - complete dataset (analysis ttree) of run" << std::endl
// << "\t\t" << "<output.root> - output file name" << std::endl
// << "\t\t" << "<calibration.root> - calibration file " << std::endl
// << "\t\t" << "<coincidence.root> - time calibration file " << std::endl
// << "\t\t" << "--simulation - the datast is from a simulation (therefore the tagging photopeak is ignored)" << std::endl
// << "\t\t" << "--length <value> - crystal length in mm, default = 15.0" << std::endl
// << "\t\t" << "--doiFraction <value> - fraction of DOI length towards which the time stamps are corrected (from 0 to 1)" << std::endl
// << "\t\t" << " - 0 = front of the crystal (DOI close to detector) " << std::endl
// << "\t\t" << " - 1 = back of the crystal (DOI far from detector) " << std::endl
// << "\t\t" << "--tagFwhm <value> - FWHM timing resolution of reference board, in ps - default = 70" << std::endl
// << "\t\t" << "--rmsLow <value> - lower bound of CTR fit -> mean - rmsLow*mean - default = 1.75" << std::endl
// << "\t\t" << "--rmsHigh <value> - upper bound of CTR fit -> mean + rmsHigh*mean - default = 1.75" << std::endl
// << "\t\t" << "--histoMin <value> - lower limit of CTR spectra, in ns - default = -15" << std::endl
// << "\t\t" << "--histoMax <value> - upper limit of CTR spectra, in ns - default = 15" << std::endl
// << "\t\t" << "--histoBins <value> - n of bins for CTR spectra - default = 500" << std::endl
// << "\t\t" << "--smooth <value> - n of iteration in CTR histograms smoothing - default = 0 (no smoothing)" << std::endl
<< "\t\t" << std::endl;
}
int main (int argc, char** argv)
{
if(argc < 2)
{
std::cout << argv[0] << std::endl;
usage();
return 1;
}
std::string inputFileName = "";
std::string outputFileName = "";
double fitMin = -9.4e-9;
double fitMax = -8.1e-9;
int divs = 10000;
// parse arguments
static struct option longOptions[] =
{
{ "input", required_argument, 0, 0 },
{ "output", required_argument, 0, 0 },
{ "fitMin", required_argument, 0, 0 },
{ "fitMax", required_argument, 0, 0 },
{ "divs", required_argument, 0, 0 },
{ NULL, 0, 0, 0 }
};
while(1) {
int optionIndex = 0;
int c = getopt_long(argc, argv, "i:o:", longOptions, &optionIndex);
if (c == -1) {
break;
}
if (c == 'i'){
inputFileName = (char *)optarg;
}
else if (c == 'o'){
outputFileName = (char *)optarg;
}
else if (c == 0 && optionIndex == 0){
inputFileName = (char *)optarg;
}
else if (c == 0 && optionIndex == 1){
outputFileName = (char *)optarg;
}
else if (c == 0 && optionIndex == 2){
fitMin = atof((char *)optarg);
}
else if (c == 0 && optionIndex == 3){
fitMax = atof((char *)optarg);
}
else if (c == 0 && optionIndex == 4){
divs = atoi((char *)optarg);
}
else {
std::cout << "Usage: " << argv[0] << std::endl;
usage();
return 1;
}
}
// if() // maybe put a check on inputFileName and outputFileName not to be empty strings?
//FEEDBACK TO USER
std::cout << std::endl;
std::cout << "ANALYSIS PARAMETERS: " << std::endl
<< "Input file = " << inputFileName << std::endl
<< "Output file = " << outputFileName << std::endl
<< "fitMin = " << fitMin << std::endl
<< "fitMax = " << fitMax << std::endl
<< "divs = " << divs << std::endl;
std::cout << std::endl;
TFile *_file0 = TFile::Open(inputFileName.c_str());
_file0->cd();
TList *listCry = _file0->GetListOfKeys();
std::cout << "testtttttttt" << std::endl;
int nKeysCry = listCry->GetEntries();
std::cout << nKeysCry << std::endl;
std::vector<std::string> keysCryName;
std::vector<TCanvas*> canvas;
std::vector<TH1F*> histograms;
int bins = 40;
double minCTR = 100;
double maxCTR = 500;
TH1F* noCorr = new TH1F("No Correction","No Correction",bins,minCTR,maxCTR);
TH1F* centralCorr = new TH1F("Central Correction","Central Correction",bins,minCTR,maxCTR);
TH1F* fullCorr = new TH1F("Full Correction","Full Correction",bins,minCTR,maxCTR);
if(nKeysCry) //if directory not empty
{
for(int i = 0 ; i < nKeysCry ; i++){
keysCryName.push_back(listCry->At(i)->GetName());
}
std::string basic_prefix("No correction");
std::string central_prefix("Central correction");
std::string all_prefix("Full correction");
// std::cout << "BASIC CTRs --------------------" << std::endl;
for(unsigned int i = 0 ; i < keysCryName.size() ; i++)
{
if(!keysCryName[i].compare(0,basic_prefix.size(),basic_prefix)) //
{
TH1F* histo = (TH1F*) gDirectory->Get(keysCryName[i].c_str());
histo->GetXaxis()->SetTitle("Time [s]");
double ret[2];
extractCTR(histo,fitMin,fitMax,divs,ret);
std::cout << histo->GetName() << "\t\t\t";
std::cout << ret[0]*1e12 << "\t"
<< ret[1]*1e12 << std::endl;
noCorr->Fill(ret[0]*1e12);
histograms.push_back(histo);
}
}
// std::cout << "-------------------------------" << std::endl;
std::cout << std::endl;
// std::cout << "CENTRAL CTRs --------------------" << std::endl;
for(unsigned int i = 0 ; i < keysCryName.size() ; i++)
{
if(!keysCryName[i].compare(0,central_prefix.size(),central_prefix)) //
{
TH1F* histo = (TH1F*) gDirectory->Get(keysCryName[i].c_str());
histo->GetXaxis()->SetTitle("Time [s]");
double ret[2];
extractCTR(histo,fitMin,fitMax,divs,ret);
std::cout << histo->GetName() << "\t";
std::cout << ret[0]*1e12 << "\t"
<< ret[1]*1e12 << std::endl;
centralCorr->Fill(ret[0]*1e12);
histograms.push_back(histo);
}
}
// std::cout << "-------------------------------" << std::endl;
std::cout << std::endl;
// std::cout << "ALL CTRs --------------------" << std::endl;
for(unsigned int i = 0 ; i < keysCryName.size() ; i++)
{
if(!keysCryName[i].compare(0,all_prefix.size(),all_prefix)) //
{
TH1F* histo = (TH1F*) gDirectory->Get(keysCryName[i].c_str());
histo->GetXaxis()->SetTitle("Time [s]");
double ret[2];
extractCTR(histo,fitMin,fitMax,divs,ret);
std::cout << histo->GetName() << "\t\t";
std::cout << ret[0]*1e12 << "\t"
<< ret[1]*1e12 << std::endl;
fullCorr->Fill(ret[0]*1e12);
histograms.push_back(histo);
}
}
// std::cout << "-------------------------------" << std::endl;
std::cout << std::endl;
}
TFile *outputFile = new TFile(outputFileName.c_str(),"RECREATE");
outputFile->cd();
noCorr->Write();
centralCorr->Write();
fullCorr->Write();
for(unsigned int i = 0; i < histograms.size() ; i++)
{
histograms[i]->Write();
}
outputFile->Close();
_file0->Close();
}
| [
"marco.pizzichemi@gmail.com"
] | marco.pizzichemi@gmail.com |
557da4f03d8eb74eb3ed12c917675f6b6d2d67e1 | b88e2623de02f197ff72cc4e92fd9d970afbfa52 | /src/integrate.cpp | bc06185a1eac986723b20e93df795c421daefb92 | [] | no_license | hoergems/openrave_interface | dc4e9fa95671c5d5c03c1f2a8b16ada707d8810a | ec6828873cfc2a8e3896cf9a6041708a92201f65 | refs/heads/master | 2021-01-10T10:01:25.854816 | 2016-04-11T04:50:25 | 2016-04-11T04:50:25 | 51,899,580 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,365 | cpp | #include "include/integrate.hpp"
using namespace boost::numeric::odeint;
using std::endl;
using std::cout;
namespace shared{
template<class T>
struct VecToList
{
static PyObject* convert(const std::vector<T>& vec)
{
boost::python::list* l = new boost::python::list();
for(size_t i = 0; i < vec.size(); i++)
(*l).append(vec[i]);
return l->ptr();
}
};
Integrate::Integrate():
steady_states_setup_(false),
g_(0.0),
f_x_(0.0),
f_y_(0.0),
f_z_(0.0),
f_roll_(0.0),
f_pitch_(0.0),
f_yaw_(0.0),
viscous_(),
acceleration_limit_(10000.0),
rbdl_interface_(nullptr),
body_name_(""),
body_point_(),
world_normal_(),
last_t(0){
setupSteadyStates();
rho_vec_ = VectorXd(3);
vel_ = VectorXd(3);
}
void Integrate::setGravityConstant(double g) {
g_ = g;
}
void Integrate::setRBDLInterface(std::shared_ptr<shared::RBDLInterface> &rbdl_interface) {
rbdl_interface_ = rbdl_interface;
}
std::shared_ptr<shared::RBDLInterface> Integrate::getRBDLInterface() {
return rbdl_interface_;
}
void Integrate::setExternalForce(double &f_x,
double &f_y,
double &f_z,
double &f_roll,
double &f_pitch,
double &f_yaw) {
f_x_ = f_x;
f_y_ = f_y;
f_z_ = f_z;
f_roll_ = f_roll;
f_pitch_ = f_pitch;
f_yaw_ = f_yaw;
}
void Integrate::setAccelerationLimit(double &accelerationLimit) {
acceleration_limit_ = accelerationLimit;
}
void Integrate::setJointDamping(std::vector<double> &viscous) {
viscous_.clear();
for (auto &k: viscous) {
viscous_.push_back(k);
}
}
double Integrate::factorial_(int num) const {
double factor = 1;
for (int i = 1; i < num + 1; i++) {
factor = factor * i;
}
return factor;
}
MatrixXd Integrate::power_series_(MatrixXd &m, double t, int depth) const {
MatrixXd A_t = -m * t;
MatrixXd A_i = -m * t;
MatrixXd term = MatrixXd::Identity(m.rows(), m.cols());
for (size_t i = 1; i < depth + 1; i++) {
term = term + A_i / factorial_(i + 1);
A_i = A_i * A_t;
}
return t * term;
}
void Integrate::calc_inverse_inertia_matrix(MatrixXd &M) const {
M_inv_ = M.inverse();
}
std::vector<double> Integrate::getResult() {
return result_;
}
MatrixXd Integrate::get_end_effector_jacobian(const state_type &x, const state_type &rho, const state_type &zeta) const {
return getEEJacobian(x, rho, zeta);
}
void Integrate::getProcessMatrices(std::vector<double> &x,
std::vector<double> &rho,
double t_e,
std::vector<MatrixXd> &matrices) const {
std::vector<double> zeta_nil;
MatrixXd M = getM0(x, rho, zeta_nil);
calc_inverse_inertia_matrix(M);
MatrixXd AMatrix = getA0(x, rho, zeta_nil);
MatrixXd BMatrix = getB0(x, rho, zeta_nil);
MatrixXd VMatrix = getV0(x, rho, zeta_nil);
MatrixXd A_matrx1 = (t_e * AMatrix).exp();
MatrixXd integral = power_series_(AMatrix, t_e, 20);
MatrixXd B_matrx = A_matrx1 * integral * BMatrix;
MatrixXd V_matrx = A_matrx1 * integral * VMatrix;
matrices.push_back(A_matrx1);
matrices.push_back(B_matrx);
matrices.push_back(V_matrx);
}
std::vector<double> Integrate::getProcessMatricesVec(std::vector<double> &x,
std::vector<double> &rho,
double t_e) const {
std::vector<MatrixXd> matrices;
getProcessMatrices(x, rho, t_e, matrices);
std::vector<double> res;
for (size_t i = 0; i < matrices[0].size(); i++) {
res.push_back(matrices[0](i));
}
for (size_t i = 0; i < matrices[1].size(); i++) {
res.push_back(matrices[1](i));
}
for (size_t i = 0; i < matrices[2].size(); i++) {
res.push_back(matrices[2](i));
}
return res;
}
std::vector<double> Integrate::getProcessMatricesSteadyStatesVec(std::vector<double> &x, double t_e) const {
std::vector<double> rho_nil;
std::vector<double> zeta_nil;
std::pair<int, std::vector<double>> closest_steady_state = getClosestSteadyState(x);
for (size_t i = 0; i < closest_steady_state.second.size(); i++) {
if (closest_steady_state.second[i] == -1) {
closest_steady_state.second[i] = x[i];
}
}
std::pair<AB_funct, std::pair<AB_funct, AB_funct>> ab_functions = getClosestSteadyStateFunctions(closest_steady_state_.first);
auto A = ab_functions.first;
auto B = ab_functions.second.first;
auto V = ab_functions.second.second;
MatrixXd AMatrix = (this->*A)(closest_steady_state.second, rho_nil, zeta_nil);
MatrixXd BMatrix = (this->*B)(closest_steady_state.second, rho_nil, zeta_nil);
MatrixXd VMatrix = (this->*V)(closest_steady_state.second, rho_nil, zeta_nil);
MatrixXd A_matrx1 = (t_e * AMatrix).exp();
MatrixXd integral = power_series_(AMatrix, t_e, 20);
MatrixXd B_matrx = A_matrx1 * integral * BMatrix;
MatrixXd B_matrx_temp = MatrixXd::Identity(B_matrx.rows(), B_matrx.cols() * 2);
MatrixXd V_matrx_temp = MatrixXd::Identity(VMatrix.rows(), VMatrix.cols() * 2);
for (size_t i = 0; i < B_matrx.rows(); i++) {
for (size_t j = 0; j < B_matrx.cols(); j++) {
B_matrx_temp(i, j) = B_matrx(i, j);
V_matrx_temp(i, j) = VMatrix(i, j);
}
}
std::vector<double> res;
for (size_t i = 0; i < A_matrx1.size(); i++) {
res.push_back(A_matrx1(i));
}
for (size_t i = 0; i < B_matrx_temp.size(); i++) {
res.push_back(B_matrx_temp(i));
}
for (size_t i = 0; i < V_matrx_temp.size(); i++) {
res.push_back(V_matrx_temp(i));
}
return res;
}
void Integrate::do_integration_constraints(std::vector<double> &x,
std::vector<double> &control,
std::vector<double> &control_error,
std::vector<double> &int_times,
std::string &body_name,
std::vector<double> &body_point,
std::vector<double> &world_normal,
std::vector<double> &result) const {
body_name_ = body_name;
body_point_ = body_point;
world_normal_ = world_normal;
last_dxdt.clear();
qdot_init.clear();
last_t = 0;
result.clear();
double t0 = int_times[0];
double te = int_times[1];
double step_size = int_times[2];
rho_ = control;
zeta_ = control_error;
step_size_ = step_size;
////////////////////////
std::vector<double> q;
std::vector<double> qdot;
std::vector<double> tau;
VectorXd res = VectorXd::Zero(x.size() / 2);
for (size_t i = 0; i < x.size() / 2; i++) {
q.push_back(x[i]);
qdot.push_back(x[i + x.size() / 2]);
}
rbdl_interface_->contact_impulse(q,
qdot,
tau,
body_name,
body_point,
world_normal,
res);
for (size_t i = 0; i < x.size() / 2; i++) {
x[i + x.size() / 2] = res[i];
}
size_t k = integrate_const(bulirsch_stoer<state_type>() ,
std::bind(&Integrate::ode , this , pl::_1 , pl::_2 , pl::_3),
x, t0 , te , step_size);
result = x;
}
void Integrate::do_integration(std::vector<double> &x,
std::vector<double> &control,
std::vector<double> &control_error,
std::vector<double> &int_times,
std::vector<double> &result) const {
body_point_.clear();
world_normal_.clear();
result.clear();
double t0 = int_times[0];
double te = int_times[1];
double step_size = int_times[2];
rho_ = control;
zeta_ = control_error;
size_t k = integrate_const(bulirsch_stoer<state_type>() ,
std::bind(&Integrate::ode , this , pl::_1 , pl::_2 , pl::_3),
x , t0 , te , step_size);
result = x;
}
void Integrate::setupSteadyStates() const {
}
std::pair<Integrate::AB_funct, std::pair<Integrate::AB_funct, Integrate::AB_funct>> Integrate::getClosestSteadyStateFunctions(int &idx) const {
return std::make_pair(a_map_.find(idx)->second, std::make_pair(b_map_.find(idx)->second, v_map_.find(idx)->second));
}
std::pair<int, std::vector<double>> Integrate::getClosestSteadyState(const state_type &x) const {
int min_idx = 0;
double dist = 0.0;
double min_dist = 10000000.0;
double steady_state_val = 0.0;
for (size_t i = 0; i < steady_states_.size(); i++) {
dist = 0.0;
for (size_t j = 0; j < steady_states_[i].size(); j++) {
if (steady_states_[i][j] == -1) {
steady_state_val = x[j];
}
else {
steady_state_val = steady_states_[i][j];
}
dist += std::pow(x[j] - steady_state_val, 2);
}
dist = std::sqrt(dist);
if (dist < min_dist) {
min_dist = dist;
min_idx = i;
}
}
return std::make_pair(min_idx, steady_states_[min_idx]);
}
void Integrate::ode_contact(const state_type &x, state_type &dxdt, double t) const {
VectorXd res = VectorXd::Zero(x.size() / 2);
dxdt.clear();
std::vector<double> q;
std::vector<double> rho;
for (size_t i = 0; i < x.size() / 2; i++) {
q.push_back(x[i]);
dxdt.push_back(x[i + x.size() / 2]);
rho.push_back(rho_[i] + zeta_[i]);
}
//rbdl_interface_->forward_dynamics_constraints(q, dxdt, rho, body_name_, body_point_, world_normal_, res);
for (size_t i = 0; i < x.size() / 2; i++) {
dxdt.push_back(res[i]);
}
return;
}
void Integrate::ode(const state_type &x , state_type &dxdt , double t) const {
dxdt.clear();
VectorXd res = VectorXd::Zero(x.size() / 2);
std::vector<double> q;
std::vector<double> rho;
for (size_t i = 0; i < x.size() / 2; i++) {
q.push_back(x[i]);
dxdt.push_back(x[i + x.size() / 2]);
rho.push_back(rho_[i] + zeta_[i]);
}
if (body_point_.size() > 0) {
rbdl_interface_->forward_dynamics_constraints(q, dxdt, rho, body_name_, body_point_, world_normal_, res);
}
else {
rbdl_interface_->forward_dynamics(q, dxdt, rho, res);
}
for (size_t i = 0; i < x.size() / 2; i++) {
dxdt.push_back(res(i));
}
return;
}
BOOST_PYTHON_MODULE(libintegrate) {
using namespace boost::python;
class_<std::vector<double> > ("v_double")
.def(vector_indexing_suite<std::vector<double> >());
class_<Integrate>("Integrate", init<>())
.def("doIntegration", &Integrate::do_integration)
.def("getResult", &Integrate::getResult)
.def("getProcessMatricesSteadyStates", &Integrate::getProcessMatricesSteadyStatesVec)
.def("getProcessMatrices", &Integrate::getProcessMatricesVec)
.def("setGravityConstant", &Integrate::setGravityConstant)
;
}
MatrixXd Integrate::getA0(const state_type &x, const state_type &rho, const state_type &zeta) const{
MatrixXd m(6, 6);
return m;
}
MatrixXd Integrate::getB0(const state_type &x, const state_type &rho, const state_type &zeta) const{
MatrixXd m(6, 3);
return m;
}
MatrixXd Integrate::getV0(const state_type &x, const state_type &rho, const state_type &zeta) const{
MatrixXd m(6, 3);
return m;
}
MatrixXd Integrate::getM0(const state_type &x, const state_type &rho, const state_type &zeta) const{
MatrixXd m(3, 3);
return m;
}
MatrixXd Integrate::getF0(const state_type &x, const state_type &rho, const state_type &zeta) const{
VectorXd m(6);
return m;
}
MatrixXd Integrate::getEEJacobian(const state_type &x, const state_type &rho, const state_type &zeta) const{
MatrixXd m(6, 3);
return m;
}
} | [
"hoergems@gmail.com"
] | hoergems@gmail.com |
d46f0c0bc08b50b3db3fcb40ae0deaec13126cf2 | dc7d429b74a6be2b411cea21ba06ca5bfcaf0f88 | /atlantis_fw/AsicFwS2/include/matrix.h | b3e5a12dea672c229d6f9c1733286e41c671b345 | [] | no_license | hoantien/Light_code | 620b458dace18f749d068e3d74303dd6875b2ca8 | 9b83bbb88c1c403d73c7c45c44389c006fe0d0e6 | refs/heads/master | 2020-03-08T10:25:30.436400 | 2018-04-04T15:10:58 | 2018-04-04T15:10:58 | 128,072,987 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 44,545 | h | // we want to have support for the following:
// matrix3x3f, matrix4x4f, vec2f, vec3f, vec4f
// plus, minus, multiplication, inverse, transpose
#ifndef __MATRIX_H__
#define __MATRIX_H__
#ifdef __cplusplus
#include <cstdlib>
#include <algorithm> // has compile problem...
#include <cmath>
namespace ltaf { // lt auto focus
// -----------------------------------------------------------
// Vec2 class
// -----------------------------------------------------------
template<typename T>
class Vec2
{
public:
Vec2() {}
Vec2( T t ) : _x( t ), _y( t ) {}
Vec2( T x, T y ) : _x( x ), _y( y ) {}
Vec2( const Vec2 & t ) : _x( t._x ), _y( t._y ) {}
template<typename U>
explicit Vec2( const Vec2<U> & t )
: _x( static_cast<T>( t.x() ) )
, _y( static_cast<T>( t.y() ) ) {}
Vec2 & operator=( const Vec2 & t )
{ _x = t._x; _y = t._y; return *this; }
Vec2 & operator/=( const Vec2 & t )
{ _x /= t._x; _y /= t._y; return *this; }
Vec2 & operator%=( const Vec2 & t )
{ _x %= t._x; _y %= t._y; return *this; }
Vec2 & operator*=( const Vec2 & t )
{ _x *= t._x; _y *= t._y; return *this; }
Vec2 & operator+=( const Vec2 & t )
{ _x += t._x; _y += t._y; return *this; }
Vec2 & operator-=( const Vec2 & t )
{ _x -= t._x; _y -= t._y; return *this; }
Vec2 & operator&=( const Vec2 & t )
{ _x &= t._x; _y &= t._y; return *this; }
Vec2 & operator|=( const Vec2 & t )
{ _x |= t._x; _y |= t._y; return *this; }
Vec2 & operator>>=( int t )
{ _x >>= t; _y >>= t; return *this; }
Vec2 & operator<<=( int t )
{ _x <<= t; _y <<= t; return *this; }
Vec2 operator-() const { return { -_x, -_y}; }
template<typename U> Vec2<typename std::common_type<T, U>::type>
operator+( const Vec2<U> & t ) const { return { _x + t.x(), _y + t.y() }; }
template<typename U> Vec2<typename std::common_type<T, U>::type>
operator-( const Vec2<U> & t ) const { return { _x - t.x(), _y - t.y() }; }
template<typename U> Vec2<typename std::common_type<T, U>::type>
operator*( const Vec2<U> & t ) const { return { _x * t.x(), _y * t.y() }; }
template<typename U> Vec2<typename std::common_type<T, U>::type>
operator/( const Vec2<U> & t ) const { return { _x / t.x(), _y / t.y() }; }
template < typename U,
typename = typename std::enable_if < std::is_integral<T>::value && std::is_integral<U>::value >::type >
Vec2<typename std::common_type<T, U>::type>
operator%( const Vec2<U> & t ) const { return { _x % t.x(), _y % t.y() }; }
template < typename U,
typename = typename std::enable_if < std::is_arithmetic<U>::value >::type >
Vec2<typename std::common_type<T, U>::type>
operator+( U t ) const { return { _x + t, _y + t }; }
template < typename U,
typename = typename std::enable_if < std::is_arithmetic<U>::value >::type >
Vec2<typename std::common_type<T, U>::type>
operator-( U t ) const { return { _x - t, _y - t }; }
template < typename U,
typename = typename std::enable_if < std::is_arithmetic<U>::value >::type >
Vec2<typename std::common_type<T, U>::type>
operator*( U t ) const { return { _x * t, _y * t }; }
template < typename U,
typename = typename std::enable_if < std::is_arithmetic<U>::value >::type >
Vec2<typename std::common_type<T, U>::type>
operator/( U t ) const { return { _x / t, _y / t }; }
template < typename U,
typename = typename std::enable_if < std::is_integral<T>::value && std::is_integral<U>::value >::type >
Vec2<typename std::common_type<T, U>::type>
operator%( U t ) const { return { _x % t, _y % t }; }
T min() const { return std::min( _x, _y ); }
T max() const { return std::max( _x, _y ); }
T sum() const { return _x + _y; }
T dot( const Vec2<T> & t ) const { return _x * t.x() + _y * t.y(); }
Vec2 abs() const { return { std::abs( _x ), std::abs( _y ) }; }
const T & x() const { return _x; }
const T & y() const { return _y; }
void setX( T x ) { _x = x; }
void setY( T y ) { _y = y; }
private:
T _x, _y;
};
// basic add/sub/mul/div operators
template < typename T, typename U,
typename = typename std::enable_if < std::is_arithmetic<T>::value >::type >
Vec2<typename std::common_type<T, U>::type>
operator+( T a, const Vec2<U> & b ) { return b + a; }
template < typename T, typename U,
typename = typename std::enable_if < std::is_arithmetic<T>::value >::type >
Vec2<typename std::common_type<T, U>::type>
operator*( T a, const Vec2<U> & b ) { return b * a; }
template < typename T, typename U,
typename = typename std::enable_if < std::is_arithmetic<T>::value >::type >
Vec2<typename std::common_type<T, U>::type>
operator-( T a, const Vec2<U> & b ) { return Vec2<T>( a ) - b; }
template < typename T, typename U,
typename = typename std::enable_if < std::is_arithmetic<T>::value >::type >
Vec2<typename std::common_type<T, U>::type>
operator/( T a, const Vec2<U> & b ) { return Vec2<T>( a ) / b; }
// basic math functions
template<typename T>
T min( const Vec2<T> & t ) { return t.min(); }
template<typename T>
T max( const Vec2<T> & t ) { return t.max(); }
template<typename T>
T sum( const Vec2<T> & t ) { return t.sum(); }
template<typename T>
T dot( const Vec2<T> & a, const Vec2<T> & b ) { return a.dot( b ); }
template<typename T>
Vec2<T> min( const Vec2<T> & a, const Vec2<T> & b )
{ return { std::min( a.x(), b.x() ), std::min( a.y(), b.y() ) }; }
template<typename T>
Vec2<T> abs( const Vec2<T> & t ) { return t.abs(); }
// template<typename T>
// Vec2<T> sign( const Vec2<T> & t ) { return t.sign(); }
template<typename T>
typename std::enable_if<std::is_floating_point<T>::value, T>::type
length( const Vec2<T> & a )
{ return std::sqrt( dot( a, a ) ); }
template<typename T>
typename std::enable_if<std::is_floating_point<T>::value, Vec2<T> >::type
sqrt( const Vec2<T> & a )
{ return { std::sqrt( a.x() ), std::sqrt( a.y() ) }; }
template<typename T>
typename std::enable_if<std::is_floating_point<T>::value, T>::type
squaredSum( const Vec2<T> & a )
{ return dot( a, a ); }
template<typename T>
typename std::enable_if<std::is_floating_point<T>::value, Vec2<T> >::type
normalize( const Vec2<T> & a )
{
return a / length( a );
}
// template<typename T>
// typename std::enable_if<std::is_floating_point<T>::value, Vec2<T> >::type
// pow( const Vec2<T> & a, const Vec2<T> & b )
// { return { std::pow( a.x(), b.x() ), std::pow( a.y(), b.y() ) }; }
// template<typename T>
// typename std::enable_if<std::is_floating_point<T>::value, Vec2<T> >::type
// pow( const Vec2<T> & a, T b )
// { return { std::pow( a.x(), b ), std::pow( a.y(), b ) }; }
// template<typename T>
// typename std::enable_if<std::is_floating_point<T>::value, Vec2<T> >::type
// pow( T a, const Vec2<T> & b )
// { return { std::pow( a, b.x() ), std::pow( a, b.y() ) }; }
// template<typename T>
// typename std::enable_if<std::is_floating_point<T>::value, Vec2<T> >::type
// floor( const Vec2<T> & a )
// { return { std::floor( a.x() ), std::floor( a.y() ) }; }
// template<typename T>
// typename std::enable_if<std::is_floating_point<T>::value, Vec2<T> >::type
// ceil( const Vec2<T> & a )
// { return { std::ceil( a.x() ), std::ceil( a.y() ) }; }
// -----------------------------------------------------------
// Vec3 class
// -----------------------------------------------------------
template<typename T>
class Vec3
{
public:
Vec3() {}
Vec3( T t ) : _x( t ), _y( t ), _z( t ) {}
Vec3( T x, T y, T z ) : _x( x ), _y( y ), _z( z ) {}
Vec3( const Vec3 & t ) : _x( t._x ), _y( t._y ), _z( t._z ) {}
template<typename U>
explicit Vec3( const Vec3<U> & t )
: _x( static_cast<T>( t.x() ) )
, _y( static_cast<T>( t.y() ) )
, _z( static_cast<T>( t.z() ) ) {}
Vec3 & operator=( const Vec3 & t )
{ _x = t._x; _y = t._y; _z = t._z; return *this; }
Vec3 & operator/=( const Vec3 & t )
{ _x /= t._x; _y /= t._y; _z /= t._z; return *this; }
Vec3 & operator%=( const Vec3 & t )
{ _x %= t._x; _y %= t._y; _z %= t._z; return *this; }
Vec3 & operator*=( const Vec3 & t )
{ _x *= t._x; _y *= t._y; _z *= t._z; return *this; }
Vec3 & operator+=( const Vec3 & t )
{ _x += t._x; _y += t._y; _z += t._z; return *this; }
Vec3 & operator-=( const Vec3 & t )
{ _x -= t._x; _y -= t._y; _z -= t._z; return *this; }
Vec3 & operator&=( const Vec3 & t )
{ _x &= t._x; _y &= t._y; _z &= t._z; return *this; }
Vec3 & operator|=( const Vec3 & t )
{ _x |= t._x; _y |= t._y; _z |= t._z; return *this; }
Vec3 & operator>>=( int t )
{ _x >>= t; _y >>= t; _z >>= t; return *this; }
Vec3 & operator<<=( int t )
{ _x <<= t; _y <<= t; _z <<= t; return *this; }
Vec3 operator-() const { return { -_x, -_y, -_z }; }
template<typename U >
Vec3<typename std::common_type<T, U>::type>
operator+( const Vec3<U> & t ) const { return { _x + t.x(), _y + t.y(), _z + t.z() }; }
template<typename U> Vec3<typename std::common_type<T, U>::type>
operator-( const Vec3<U> & t ) const { return { _x - t.x(), _y - t.y(), _z - t.z() }; }
template<typename U> Vec3<typename std::common_type<T, U>::type>
operator*( const Vec3<U> & t ) const { return { _x * t.x(), _y * t.y(), _z * t.z() }; }
template<typename U> Vec3<typename std::common_type<T, U>::type>
operator/( const Vec3<U> & t ) const { return { _x / t.x(), _y / t.y(), _z / t.z() }; }
template < typename U,
typename = typename std::enable_if < std::is_integral<T>::value && std::is_integral<U>::value >::type >
Vec3<typename std::common_type<T, U>::type>
operator%( const Vec3<U> & t ) const { return { _x % t.x(), _y % t.y(), _z % t.z() }; }
template < typename U,
typename = typename std::enable_if < std::is_arithmetic<U>::value >::type >
Vec3<typename std::common_type<T, U>::type>
operator+( U t ) const { return { _x + t, _y + t, _z + t }; }
template < typename U,
typename = typename std::enable_if < std::is_arithmetic<U>::value >::type >
Vec3<typename std::common_type<T, U>::type>
operator-( U t ) const { return { _x - t, _y - t, _z - t }; }
template < typename U,
typename = typename std::enable_if < std::is_arithmetic<U>::value >::type >
Vec3<typename std::common_type<T, U>::type>
operator*( U t ) const { return { _x * t, _y * t, _z * t }; }
template < typename U,
typename = typename std::enable_if < std::is_arithmetic<U>::value >::type >
Vec3<typename std::common_type<T, U>::type>
operator/( U t ) const { return { _x / t, _y / t, _z / t }; }
template < typename U,
typename = typename std::enable_if < std::is_integral<T>::value && std::is_integral<U>::value >::type >
Vec3<typename std::common_type<T, U>::type>
operator%( U t ) const { return { _x % t, _y % t, _z % t }; }
Vec3<bool> operator==( const Vec3 & t ) const { return { _x == t._x, _y == t._y, _z == t._z }; }
Vec3<bool> operator!=( const Vec3 & t ) const { return { _x != t._x, _y != t._y, _z != t._z }; }
Vec3<bool> operator>=( const Vec3 & t ) const { return { _x >= t._x, _y >= t._y, _z >= t._z }; }
Vec3<bool> operator>( const Vec3 & t ) const { return { _x > t._x, _y > t._y, _z > t._z }; }
Vec3<bool> operator<=( const Vec3 & t ) const { return { _x <= t._x, _y <= t._y, _z <= t._z }; }
Vec3<bool> operator<( const Vec3 & t ) const { return { _x < t._x, _y < t._y, _z < t._z }; }
T min() const { return std::min( std::min( _x, _y ), _z ); }
T max() const { return std::max( std::max( _x, _y ), _z ); }
T sum() const { return _x + _y + _z; }
T dot( const Vec3<T> & t ) const { return _x * t.x() + _y * t.y() + _z * t.z(); }
// cross product in right-hand side coordinate (i.e. if this=(1,0,0), t=(0,1,0), out=(0,0,1)).
Vec3<T> cross( const Vec3<T> & t ) const
{ return Vec3<T> {_y * t.z() - _z * t.y(), _z * t.x() - _x * t.z(), _x * t.y() - _y * t.x()};}
Vec3 abs() const { return { std::abs( _x ), std::abs( _y ), std::abs( _z ) }; }
const T & x() const { return _x; }
const T & y() const { return _y; }
const T & z() const { return _z; }
void setX( T x ) { _x = x; }
void setY( T y ) { _y = y; }
void setZ( T z ) { _z = z; }
Vec3 & normalize()
{
T len = length(*this);
_x /= len;
_y /= len;
_z /= len;
return *this;
}
private:
T _x, _y, _z;
};
// basic math functions
template<typename T>
T min( const Vec3<T> & t ) { return t.min(); }
template<typename T>
T max( const Vec3<T> & t ) { return t.max(); }
template<typename T>
T sum( const Vec3<T> & t ) { return t.sum(); }
template<typename T>
T dot( const Vec3<T> & a, const Vec3<T> & b ) { return a.dot( b ); }
template<typename T>
Vec3<T> cross( const Vec3<T> & a, const Vec3<T> & b ) { return a.cross( b ); }
template<typename T>
Vec3<T> min( const Vec3<T> & a, const Vec3<T> & b )
{ return { std::min( a.x(), b.x() ), std::min( a.y(), b.y() ), std::min( a.z(), b.z() ) }; }
// template<typename T, typename U>
// typename std::enable_if<std::is_arithmetic<U>::value, Vec3<T> >::type
// min( U a, const Vec3<T> & b )
// { return min( Vec3<T>( a ), b ); }
// template<typename T, typename U>
// typename std::enable_if<std::is_arithmetic<U>::value, Vec3<T> >::type
// min( const Vec3<T> & a, U b )
// { return min( a, Vec3<T>( b ) ); }
// template<typename T>
// Vec3<T> max( const Vec3<T> & a, const Vec3<T> & b )
// { return { max( a.x(), b.x() ), max( a.y(), b.y() ), max( a.z(), b.z() ) }; }
// template<typename T, typename U>
// typename std::enable_if<std::is_arithmetic<U>::value, Vec3<T> >::type
// max( U a, const Vec3<T> & b )
// { return max( Vec3<T>( a ), b ); }
// template<typename T, typename U>
// typename std::enable_if<std::is_arithmetic<U>::value, Vec3<T> >::type
// max( const Vec3<T> & a, U b )
// { return max( a, Vec3<T>( b ) ); }
// template<typename T>
// Vec3<T> clamp( const Vec3<T> & t, const Vec3<T> & min_t, const Vec3<T> & max_t )
// { return min( max( t, min_t ), max_t ); }
// template<typename T, typename U>
// typename std::enable_if<std::is_arithmetic<U>::value, Vec3<T> >::type
// clamp( const Vec3<T> & t, U min_t, const Vec3<T> & max_t )
// { return clamp( t, Vec3<T>( min_t ), max_t ); }
// template<typename T, typename U>
// typename std::enable_if<std::is_arithmetic<U>::value, Vec3<T> >::type
// clamp( const Vec3<T> & t, const Vec3<T> & min_t, U max_t )
// { return clamp( t, min_t, Vec3<T>( max_t ) ); }
// template<typename T, typename U, typename V>
// typename std::enable_if < std::is_arithmetic<U>::value && std::is_arithmetic<V>::value, Vec3<T> >::type
// clamp( const Vec3<T> & t, U min_t, V max_t )
// { return clamp( t, Vec3<T>( min_t ), Vec3<T>( max_t ) ); }
template<typename T>
Vec3<T> abs( const Vec3<T> & t ) { return t.abs(); }
// template<typename T>
// Vec3<T> sign( const Vec3<T> & t ) { return t.sign(); }
template<typename T>
typename std::enable_if<std::is_floating_point<T>::value, T>::type
length( const Vec3<T> & a )
{ return std::sqrt( dot( a, a ) ); }
template<typename T>
typename std::enable_if<std::is_floating_point<T>::value, Vec3<T> >::type
sqrt( const Vec3<T> & a )
{ return { std::sqrt( a.x() ), std::sqrt( a.y() ), std::sqrt( a.z() ) }; }
template<typename T>
typename std::enable_if<std::is_floating_point<T>::value, T>::type
squaredSum( const Vec3<T> & a )
{ return dot( a, a ); }
template<typename T>
typename std::enable_if<std::is_floating_point<T>::value, Vec3<T> >::type
normalize( const Vec3<T> & a )
{
return a / length( a );
}
// template<typename T>
// typename std::enable_if<std::is_floating_point<T>::value, Vec3<T> >::type
// pow( const Vec3<T> & a, const Vec3<T> & b )
// { return { std::pow( a.x(), b.x() ), std::pow( a.y(), b.y() ), std::pow( a.z(), b.z() ) }; }
// template<typename T>
// typename std::enable_if<std::is_floating_point<T>::value, Vec3<T> >::type
// pow( const Vec3<T> & a, T b )
// { return { std::pow( a.x(), b ), std::pow( a.y(), b ), std::pow( a.z(), b ) }; }
// template<typename T>
// typename std::enable_if<std::is_floating_point<T>::value, Vec3<T> >::type
// pow( T a, const Vec3<T> & b )
// { return { std::pow( a, b.x() ), std::pow( a, b.y() ), std::pow( a, b.z() ) }; }
// template<typename T>
// typename std::enable_if<std::is_floating_point<T>::value, Vec3<T> >::type
// floor( const Vec3<T> & a )
// { return { std::floor( a.x() ), std::floor( a.y() ), std::floor( a.z() ) }; }
// template<typename T>
// typename std::enable_if<std::is_floating_point<T>::value, Vec3<T> >::type
// ceil( const Vec3<T> & a )
// { return { std::ceil( a.x() ), std::ceil( a.y() ), std::ceil( a.z() ) }; }
// -----------------------------------------------------------
// Vec4 class
// -----------------------------------------------------------
template<typename T>
class Vec4
{
public:
Vec4() {}
Vec4( T t ) : _x( t ), _y( t ), _z( t ), _a( t ) {}
Vec4( T x, T y, T z, T a ) : _x( x ), _y( y ), _z( z ), _a ( a ){}
Vec4( const Vec4 & t ) : _x( t._x ), _y( t._y ), _z( t._z ), _a( t._a ) {}
template<typename U>
explicit Vec4( const Vec4<U> & t )
: _x( static_cast<T>( t.x() ) )
, _y( static_cast<T>( t.y() ) )
, _z( static_cast<T>( t.z() ) )
, _a( static_cast<T>( t.a() ) ) {}
Vec4 & operator=( const Vec4 & t )
{ _x = t._x; _y = t._y; _z = t._z; _a = t._a; return *this; }
Vec4 & operator/=( const Vec4 & t )
{ _x /= t._x; _y /= t._y; _z /= t._z; _a /= t._a; return *this; }
Vec4 & operator%=( const Vec4 & t )
{ _x %= t._x; _y %= t._y; _z %= t._z; _a %= t._a; return *this; }
Vec4 & operator*=( const Vec4 & t )
{ _x *= t._x; _y *= t._y; _z *= t._z; _a *= t._a; return *this; }
Vec4 & operator+=( const Vec4 & t )
{ _x += t._x; _y += t._y; _z += t._z; _a += t._a; return *this; }
Vec4 & operator-=( const Vec4 & t )
{ _x -= t._x; _y -= t._y; _z -= t._z; _a -= t._a; return *this; }
Vec4 operator-() const { return { -_x, -_y, _z, _a}; }
Vec4<bool> operator==( const Vec4 & t ) const { return { _x == t._x, _y == t._y, _z == t._z, _a == t._a }; }
Vec4<bool> operator!=( const Vec4 & t ) const { return { _x != t._x, _y != t._y, _z != t._z, _a != t._a }; }
Vec4<bool> operator>=( const Vec4 & t ) const { return { _x >= t._x, _y >= t._y, _z >= t._z, _a >= t._a }; }
Vec4<bool> operator>( const Vec4 & t ) const { return { _x > t._x, _y > t._y, _z > t._z, _a > t._a }; }
Vec4<bool> operator<=( const Vec4 & t ) const { return { _x <= t._x, _y <= t._y, _z <= t._z, _a <= t._a }; }
Vec4<bool> operator<( const Vec4 & t ) const { return { _x < t._x, _y < t._y, _z < t._z, _a < t._a }; }
T min() const { return std::min( std::min( std::min( _x, _y ), _z ), _a); }
T max() const { return std::max( std::max( std::max( _x, _y ), _z ), _a); }
T sum() const { return _x + _y + _z + _a; }
T dot( const Vec4<T> & t ) const { return _x * t.x() + _y * t.y() + _z * t.z() + _a * t.a(); }
Vec4 abs() const { return { std::abs( _x ), std::abs( _y ), std::abs( _z ), std::abs( _a ) }; }
const T & x() const { return _x; }
const T & y() const { return _y; }
const T & z() const { return _z; }
const T & a() const { return _a; }
void setX( T x ) { _x = x; }
void setY( T y ) { _y = y; }
void setZ( T z ) { _z = z; }
void setA( T a ) { _a = a; }
private:
T _x, _y, _z, _a;
};
using Vec2f = Vec2<float>;
using Vec2d = Vec2<double>;
using Vec3u16 = Vec3<std::uint16_t>;
using Vec3f = Vec3<float>;
using Vec3d = Vec3<double>;
using Vec4f = Vec4<float>;
using Vec4d = Vec4<double>;
// -----------------------------------------------------------
// Matrix class
// -----------------------------------------------------------
namespace Internal
{
template<typename T, int R, int C>
class MatrixStorage
{
public:
MatrixStorage() {}
protected:
T _data[R * C];
};
#if 0
/// Some Matrix types require aligned storage due to SIMD acceleration
template<>
class MatrixStorage<float, 4, 4>
{
public:
MatrixStorage() {}
protected:
alignas( 16 ) float _data[16];
};
#endif
} // Internal namespace
template<typename T, int R, int C, bool RowMajor = true>
class Matrix : public Internal::MatrixStorage<T, R, C>
{
//static_assert( std::is_floating_point<T>::value, "Matrix template class requires floating point type!" );
static constexpr int kSize = R * C;
static inline constexpr int Idx( int row, int col )
{
return RowMajor ? row * C + col : col * R + row;
}
public:
using ScalarType = T;
static constexpr int kRows = R;
static constexpr int kCols = C;
Matrix() { }
Matrix( const Matrix<T, R, C, true> & src ) { *this = src; }
Matrix( const Matrix<T, R, C, false> & src ) { *this = src; }
/// Input in row-major order.
Matrix( std::initializer_list<T> list ) { *this = list; }
/// Input in row-major order.
explicit Matrix( const std::vector<T> & data ) { *this = data; }
/// Input in row-major order.
explicit Matrix( const T * ptr )
{
for( int i = 0; i < R; ++i )
{
for( int j = 0; j < C; ++j )
{ this->_data[Idx( i, j )] = ptr[i * C + j]; }
}
}
// generic size/type converting constructor
// performs matrix truncation/expansion if necessary
template<typename U, int M, int N, bool D>
explicit Matrix( const Matrix<U, M, N, D> & src )
{
constexpr int kMinRow = M < R ? M : R;
constexpr int kMinCol = N < C ? N : C;
for( int i = 0; i < kMinRow; ++i )
{
for( int j = 0; j < kMinCol; ++j )
{ this->_data[Idx( i, j )] = static_cast<T>( src( i, j ) ); }
for( int j = kMinCol; j < C; ++j )
{ this->_data[Idx( i, j )] = i == j ? T{1} : T{0}; }
}
for( int i = kMinRow; i < R; ++i )
{
for( int j = 0; j < C; ++j )
{ this->_data[Idx( i, j )] = i == j ? T{1} : T{0}; }
}
}
template<int M, int N, bool D>
Matrix & operator=( const Matrix<T, M, N, D> & src )
{
static_assert( R == M && C == N, "matrix size mismatch!" );
if( RowMajor == D )
{
// same element ordering, just copy the elements
const T * src_ptr = src.data();
for( int i = 0; i < kSize; ++i ) { this->_data[i] = src_ptr[i]; }
}
else
{
// different element ordering requires a transpose
for( int i = 0; i < R; ++i )
{
for( int j = 0; j < C; ++j )
{ this->_data[Idx( i, j )] = src( i, j ); }
}
}
return *this;
}
/// Input in row-major order.
Matrix & operator=( const std::vector<T> & src )
{
//if( src.size() != kSize )
//{ LT_THROW( "source data and matrix size mismatch!" ); }
auto it = src.begin();
for( int i = 0; i < R; ++i )
{
for( int j = 0; j < C; ++j, ++it )
{ this->_data[Idx( i, j )] = *it; }
}
return *this;
}
/// Input in row-major order.
Matrix & operator=( const std::initializer_list<T> src )
{
//if( src.size() != kSize )
//{ LT_THROW( "source data and matrix size mismatch!" ); }
auto it = src.begin();
for( int i = 0; i < R; ++i )
{
for( int j = 0; j < C; ++j, ++it )
{ this->_data[Idx( i, j )] = *it; }
}
return *this;
}
Matrix & operator=( T scalar )
{
for( int i = 0; i < kSize; ++i ) { this->_data[i] = scalar; }
return *this;
}
template<typename U, int M, int N, bool D>
bool operator==( const Matrix<U, M, N, D> & mat ) const
{
static_assert( R == M && C == N, "matrix size mismatch!" );
for( int i = 0; i < R; ++i )
{
for( int j = 0; j < C; ++j )
{ if( this->_data[Idx( i, j )] != mat( i, j ) ) { return false; } }
}
return true;
}
template<typename U, int M, int N, bool D>
bool operator!=( const Matrix<U, M, N, D> & mat ) const
{ return !( *this == mat ); }
const T * data() const { return this->_data; }
T * data() { return this->_data; }
T & operator()( int r, int c ) { return this->_data[Idx( r, c )]; }
const T & operator()( int r, int c ) const { return this->_data[Idx( r, c )]; }
template<int M, int N, bool D>
Matrix<T, R, N> operator*( const Matrix<T, M, N, D> & mat ) const
{
static_assert( C == M, "invalid matrix product!" );
Matrix<T, R, N> rval;
// XXX: is this code actually more SIMD-friendly than a naive implementation?
for( int i = 0; i < R; ++i )
{
// set 1st row
for( int j = 0; j < N; ++j )
{ rval( i, j ) = this->_data[Idx( i, 0 )] * mat( 0, j ); }
// accum n-th row
for( int k = 1; k < M; ++k )
{
for( int j = 0; j < N; ++j )
{ rval( i, j ) += this->_data[Idx( i, k )] * mat( k, j ); }
}
}
return rval;
}
template<int M, int N, bool D>
Matrix & operator *=( const Matrix<T, M, N, D> & mat )
{
*this = *this * mat;
return *this;
}
template<int M, int N, bool D>
Matrix & operator +=( const Matrix<T, M, N, D> & mat )
{
static_assert( R == M && C == N, "matrix size mismatch!" );
for( int i = 0; i < R; ++i )
{
for( int j = 0; j < C; ++j )
{ this->_data[Idx( i, j )] += mat( i, j ); }
}
return *this;
}
template<int M, int N, bool D>
Matrix & operator -=( const Matrix<T, M, N, D> & mat )
{
static_assert( R == M && C == N, "matrix size mismatch!" );
for( int i = 0; i < R; ++i )
{
for( int j = 0; j < C; ++j )
{ this->_data[Idx( i, j )] -= mat( i, j ); }
}
return *this;
}
Matrix & operator *=( T scalar )
{
for( int i = 0; i < kSize; ++i ) { this->_data[i] *= scalar; }
return *this;
}
Matrix & operator +=( T scalar )
{
for( int i = 0; i < kSize; ++i ) { this->_data[i] += scalar; }
return *this;
}
Matrix & operator /=( T scalar )
{
scalar = 1.0f / scalar;
for( int i = 0; i < kSize; ++i ) { this->_data[i] *= scalar; }
return *this;
}
Matrix & operator -=( T scalar )
{
for( int i = 0; i < kSize; ++i ) { this->_data[i] -= scalar; }
return *this;
}
template<int M, int N, bool D>
Matrix operator+( const Matrix<T, M, N, D> & mat ) const
{ Matrix rval{*this}; rval += mat; return rval; }
template<int M, int N, bool D>
Matrix operator-( const Matrix<T, M, N, D> & mat ) const
{ Matrix rval{*this}; rval -= mat; return rval; }
Matrix operator*( T scalar ) const
{ Matrix rval{*this}; rval *= scalar; return rval; }
Matrix operator+( T scalar ) const
{ Matrix rval{*this}; rval += scalar; return rval; }
Matrix operator-( T scalar ) const
{ Matrix rval{*this}; rval -= scalar; return rval; }
Matrix operator/( T scalar ) const
{ Matrix rval{*this}; rval /= scalar; return rval; }
Matrix<T, 1, C> row( int i ) const
{
Matrix<T, 1, C> rval;
for( int j = 0; j < C; ++j ) { rval( 0, j ) = this->_data[Idx( i, j )]; }
return rval;
}
Matrix<T, 1, C> column( int i ) const
{
Matrix<T, R, 1> rval;
for( int j = 0; j < R; ++j ) { rval( j, 0 ) = this->_data[Idx( j, i )]; }
return rval;
}
Matrix & swapRow( int i, int j )
{
using std::swap;
for( int k = 0; k < C; ++k )
{ swap( this->_data[Idx( i, k )], this->_data[Idx( j, k )] ); }
return *this;
}
Matrix & swapColumn( int i, int j )
{
using std::swap;
for( int k = 0; k < R; ++k )
{ swap( this->_data[Idx( k, i )], this->_data[Idx( k, j )] ); }
return *this;
}
T sum() const
{
T sum = this->_data[0];
for( int j = 1; j < kSize; ++j ) { sum += this->_data[j]; }
return sum;
}
Matrix & setIdentity()
{
for( int i = 0; i < R; ++i )
{
for( int j = 0; j < C; ++j )
{ this->_data[Idx( i, j )] = i == j ? T{1} : T{0}; }
}
return *this;
}
const Matrix < T, C, R, !RowMajor > & transpose() const
{
return *reinterpret_cast < const Matrix < T, C, R, !RowMajor > * >( this );
}
// friend std::ostream & operator<<( std::ostream & os, const Matrix & m )
// {
// std::stringstream sb;
// sb << std::endl << "[ ";
// for( int i = 0; i < R; ++i )
// {
// for( int j = 0; j < C; ++j ) { sb << m( i, j ) << " "; }
// if( i != R - 1 ) { sb << std::endl; }
// }
// sb << "]" << std::endl;
// return os << sb.rdbuf();
// }
static constexpr bool IsRowMajor() { return RowMajor; }
static Matrix Identity()
{
Matrix rval;
return rval.setIdentity();
}
};
template<typename T, int R, int C, bool D>
Matrix < T, C, R, !D > transpose( const Matrix<T, R, C, D> & mat )
{
// simply copy the data and flip the matrix ordering
Matrix < T, C, R, !D > rval;
T * dst = rval.data();
const T * src = mat.data();
for( int i = 0; i < R * C; ++i ) { dst[i] = src[i]; }
return rval;
}
template<typename T, int N, bool D>
Matrix<T, N, N, D> inverse( const Matrix<T, N, N, D> & mat );
template<typename T, int N, bool D>
T determinant( const Matrix<T, N, N, D> & mat );
// scalar-matrix operators
template<typename T, typename U, int R, int C, bool D>
typename std::enable_if<std::is_arithmetic<T>::value, Matrix<U, R, C, D> >::type
operator+( T a, const Matrix<U, R, C, D> & b ) { return b + a; }
template<typename T, typename U, int R, int C, bool D>
typename std::enable_if<std::is_arithmetic<T>::value, Matrix<U, R, C, D> >::type
operator-( T a, const Matrix<U, R, C, D> & b )
{
Matrix<U, R, C, D> rval;
for( int i = 0; i < R; ++i )
{ for( int j = 0; j < C; ++j ) { rval( i, j ) = U( a ) - b( i, j ); } }
return rval;
}
template<typename T, typename U, int R, int C, bool D>
typename std::enable_if<std::is_arithmetic<T>::value, Matrix<U, R, C, D> >::type
operator*( T a, const Matrix<U, R, C, D> & b ) { return b * a; }
using Matrix2x2f = Matrix<float, 2, 2>;
using Matrix3x3f = Matrix<float, 3, 3>;
using Matrix4x4f = Matrix<float, 4, 4>;
using Matrix2x2d = Matrix<double, 2, 2>;
using Matrix3x3d = Matrix<double, 3, 3>;
using Matrix4x4d = Matrix<double, 4, 4>;
// optimized implementation of matrix-vector operations
// mind the order of color channels in memory is BGRA, i.e.,
// blue channel corresponds to the first matrix dimension!
template<bool D>
Vec4f operator*( const Matrix<float, 4, 4, D> & mat, const Vec4f & vec )
{
return
{
mat( 0, 0 ) * vec.x() + mat( 0, 1 ) * vec.y() + mat( 0, 2 ) * vec.z() + mat( 0, 3 ) * vec.a(),
mat( 1, 0 ) * vec.x() + mat( 1, 1 ) * vec.y() + mat( 1, 2 ) * vec.z() + mat( 1, 3 ) * vec.a(),
mat( 2, 0 ) * vec.x() + mat( 2, 1 ) * vec.y() + mat( 2, 2 ) * vec.z() + mat( 2, 3 ) * vec.a(),
mat( 3, 0 ) * vec.x() + mat( 3, 1 ) * vec.y() + mat( 3, 2 ) * vec.z() + mat( 3, 3 ) * vec.a()
};
}
template<bool D>
Vec4f operator*( const Vec4f & vec, const Matrix<float, 4, 4, D> & mat )
{
return
{
mat( 0, 0 ) * vec.x() + mat( 1, 0 ) * vec.y() + mat( 2, 0 ) * vec.z() + mat( 3, 0 ) * vec.a(),
mat( 0, 1 ) * vec.x() + mat( 1, 1 ) * vec.y() + mat( 2, 1 ) * vec.z() + mat( 3, 1 ) * vec.a(),
mat( 0, 2 ) * vec.x() + mat( 1, 2 ) * vec.y() + mat( 2, 2 ) * vec.z() + mat( 3, 2 ) * vec.a(),
mat( 0, 3 ) * vec.x() + mat( 1, 3 ) * vec.y() + mat( 2, 3 ) * vec.z() + mat( 3, 3 ) * vec.a()
};
}
// Vec3 left- and right-hand side multiplication operator
template<typename T, typename U, bool D>
Vec3<typename std::common_type<T, U>::type> operator*( const Matrix<T, 3, 3, D> & mat, const Vec3<U> & vec )
{
return
{
mat( 0, 0 ) * vec.x() + mat( 0, 1 ) * vec.y() + mat( 0, 2 ) * vec.z(),
mat( 1, 0 ) * vec.x() + mat( 1, 1 ) * vec.y() + mat( 1, 2 ) * vec.z(),
mat( 2, 0 ) * vec.x() + mat( 2, 1 ) * vec.y() + mat( 2, 2 ) * vec.z()
};
}
template<typename T, typename U, bool D>
Vec3<typename std::common_type<T, U>::type> operator*( const Vec3<T> & vec, const Matrix<U, 3, 3, D> & mat )
{
return
{
mat( 0, 0 ) * vec.x() + mat( 1, 0 ) * vec.y() + mat( 2, 0 ) * vec.z(),
mat( 0, 1 ) * vec.x() + mat( 1, 1 ) * vec.y() + mat( 2, 1 ) * vec.z(),
mat( 0, 2 ) * vec.x() + mat( 1, 2 ) * vec.y() + mat( 2, 2 ) * vec.z()
};
}
// mat3x3 and vec2 special multiplication operation used in roitransfer
/// Return H * p for 2D p, p is made homogeneous, division in the end.
template<typename T, typename U, bool D>
Vec2<typename std::common_type<T, U>::type> operator*( const Matrix<T, 3, 3, D> & h, const Vec2<U> & p )
{
T w_inv = T{1} / ( h(2, 0) * p.x() + h(2, 1) * p.y() + h(2, 2) );
return {
( h(0, 0) * p.x() + h(0, 1) * p.y() + h(0, 2) ) * w_inv,
( h(1, 0) * p.x() + h(1, 1) * p.y() + h(1, 2) ) * w_inv
};
}
// Vec2 multiplication operator
//right hand
template<typename T, typename U, bool D>
Vec2<typename std::common_type<T, U>::type> operator*( const Matrix<T, 2, 2, D> & mat, const Vec2<U> & vec )
{
return
{
mat( 0, 0 ) * vec.x() + mat( 0, 1 ) * vec.y(),
mat( 1, 0 ) * vec.x() + mat( 1, 1 ) * vec.y()
};
}
//left hand
template<typename T, typename U, bool D>
Vec2<typename std::common_type<T, U>::type> operator*( const Vec2<U> & vec, const Matrix<T, 2, 2, D> & mat )
{
return
{
mat( 0, 0 ) * vec.x() + mat( 1, 0 ) * vec.y(),
mat( 0, 1 ) * vec.x() + mat( 1, 1 ) * vec.y()
};
}
// Create a diagonal matrix from a vector
inline Matrix4x4f diagonal( const Vec4f & vec )
{
return
{
vec.x(), 0.0f, 0.0f, 0.0f,
0.0f, vec.y(), 0.0f, 0.0f,
0.0f, 0.0f, vec.z(), 0.0f,
0.0f, 0.0f, 0.0f, vec.a()
};
}
template<typename T>
Matrix<T, 3, 3> diagonal( const Vec3<T> & vec )
{
return
{
vec.x(), T{0}, T{0},
T{0}, vec.y(), T{0},
T{0}, T{0}, vec.z()
};
}
template<typename T>
Matrix<T, 2, 2> diagonal( const Vec2<T> & vec )
{
return
{
vec.x(), T{0},
T{0}, vec.y(),
};
}
// ------------------------------------
// determinant, inverse, etc
// ------------------------------------
template<typename T, int N>
struct MatrixDeterminant { };
template<typename T>
struct MatrixDeterminant<T, 2>
{
T operator()( const T * mat ) const
{
return mat[0] * mat[3] - mat[1] * mat[2];
}
};
template<typename T>
struct MatrixDeterminant<T, 3>
{
T operator()( const T * mat ) const
{
return + mat[0] * ( mat[4] * mat[8] - mat[7] * mat[5] )
- mat[1] * ( mat[3] * mat[8] - mat[5] * mat[6] )
+ mat[2] * ( mat[3] * mat[7] - mat[4] * mat[6] );
}
};
template<typename T>
struct MatrixDeterminant<T, 4>
{
T operator()( const T * mat ) const
{
T dst[4];
T tmp[12];
// calculate pairs for first 8 elements (cofactors)
tmp[0] = mat[10] * mat[15];
tmp[1] = mat[11] * mat[14];
tmp[2] = mat[9] * mat[15];
tmp[3] = mat[11] * mat[13];
tmp[4] = mat[9] * mat[14];
tmp[5] = mat[10] * mat[13];
tmp[6] = mat[8] * mat[15];
tmp[7] = mat[11] * mat[12];
tmp[8] = mat[8] * mat[14];
tmp[9] = mat[10] * mat[12];
tmp[10] = mat[8] * mat[13];
tmp[11] = mat[9] * mat[12];
// calculate first 8 elements (cofactors)
dst[0] = tmp[0] * mat[5] + tmp[3] * mat[6] + tmp[4] * mat[7];
dst[0] -= tmp[1] * mat[5] + tmp[2] * mat[6] + tmp[5] * mat[7];
dst[1] = tmp[1] * mat[4] + tmp[6] * mat[6] + tmp[9] * mat[7];
dst[1] -= tmp[0] * mat[4] + tmp[7] * mat[6] + tmp[8] * mat[7];
dst[2] = tmp[2] * mat[4] + tmp[7] * mat[5] + tmp[10] * mat[7];
dst[2] -= tmp[3] * mat[4] + tmp[6] * mat[5] + tmp[11] * mat[7];
dst[3] = tmp[5] * mat[4] + tmp[8] * mat[5] + tmp[11] * mat[6];
dst[3] -= tmp[4] * mat[4] + tmp[9] * mat[5] + tmp[10] * mat[6];
// calculate determinant
return mat[0] * dst[0] + mat[1] * dst[1] + mat[2] * dst[2] + mat[3] * dst[3];
}
};
template<typename T, int N>
struct SquareMatrixInverter { };
template<typename T>
struct SquareMatrixInverter<T, 2>
{
void run( T * mat ) const
{
const T det = mat[0] * mat[3] - mat[1] * mat[2];
const T invdet = T{1} / det;
T tmp[4];
tmp[0] = mat[3];
tmp[1] = -mat[1];
tmp[2] = -mat[2];
tmp[3] = mat[0];
for( int i = 0; i < 4; ++i ) { mat[i] = tmp[i] * invdet; }
}
};
template<typename T>
struct SquareMatrixInverter<T, 3>
{
void run( T * mat ) const
{
const T det = + mat[0] * ( mat[4] * mat[8] - mat[7] * mat[5] )
- mat[1] * ( mat[3] * mat[8] - mat[5] * mat[6] )
+ mat[2] * ( mat[3] * mat[7] - mat[4] * mat[6] );
const T invdet = T{1} / det;
T tmp[9];
tmp[0] = mat[4] * mat[8] - mat[7] * mat[5];
tmp[1] = -( mat[1] * mat[8] - mat[2] * mat[7] );
tmp[2] = mat[1] * mat[5] - mat[2] * mat[4];
tmp[3] = -( mat[3] * mat[8] - mat[5] * mat[6] );
tmp[4] = mat[0] * mat[8] - mat[2] * mat[6];
tmp[5] = -( mat[0] * mat[5] - mat[3] * mat[2] );
tmp[6] = mat[3] * mat[7] - mat[6] * mat[ 4];
tmp[7] = -( mat[0] * mat[7] - mat[6] * mat[1] );
tmp[8] = mat[0] * mat[4] - mat[3] * mat[1];
for( int i = 0; i < 9; ++i ) { mat[i] = tmp[i] * invdet; }
}
};
template<typename T>
struct SquareMatrixInverter<T, 4>
{
void run( T * mat ) const
{
T dst[16];
T tmp[12];
// calculate pairs for first 8 elements (cofactors)
tmp[0] = mat[10] * mat[15];
tmp[1] = mat[11] * mat[14];
tmp[2] = mat[9] * mat[15];
tmp[3] = mat[11] * mat[13];
tmp[4] = mat[9] * mat[14];
tmp[5] = mat[10] * mat[13];
tmp[6] = mat[8] * mat[15];
tmp[7] = mat[11] * mat[12];
tmp[8] = mat[8] * mat[14];
tmp[9] = mat[10] * mat[12];
tmp[10] = mat[8] * mat[13];
tmp[11] = mat[9] * mat[12];
// calculate first 8 elements (cofactors)
dst[0] = tmp[0] * mat[5] + tmp[3] * mat[6] + tmp[4] * mat[7];
dst[0] -= tmp[1] * mat[5] + tmp[2] * mat[6] + tmp[5] * mat[7];
dst[4] = tmp[1] * mat[4] + tmp[6] * mat[6] + tmp[9] * mat[7];
dst[4] -= tmp[0] * mat[4] + tmp[7] * mat[6] + tmp[8] * mat[7];
dst[8] = tmp[2] * mat[4] + tmp[7] * mat[5] + tmp[10] * mat[7];
dst[8] -= tmp[3] * mat[4] + tmp[6] * mat[5] + tmp[11] * mat[7];
dst[12] = tmp[5] * mat[4] + tmp[8] * mat[5] + tmp[11] * mat[6];
dst[12] -= tmp[4] * mat[4] + tmp[9] * mat[5] + tmp[10] * mat[6];
// calculate determinant
const T det = mat[0] * dst[0] + mat[1] * dst[4] + mat[2] * dst[8] + mat[3] * dst[12];
const T inv_det = T{1} / det;
dst[1] = tmp[1] * mat[1] + tmp[2] * mat[2] + tmp[5] * mat[3];
dst[1] -= tmp[0] * mat[1] + tmp[3] * mat[2] + tmp[4] * mat[3];
dst[5] = tmp[0] * mat[0] + tmp[7] * mat[2] + tmp[8] * mat[3];
dst[5] -= tmp[1] * mat[0] + tmp[6] * mat[2] + tmp[9] * mat[3];
dst[9] = tmp[3] * mat[0] + tmp[6] * mat[1] + tmp[11] * mat[3];
dst[9] -= tmp[2] * mat[0] + tmp[7] * mat[1] + tmp[10] * mat[3];
dst[13] = tmp[4] * mat[0] + tmp[9] * mat[1] + tmp[10] * mat[2];
dst[13] -= tmp[5] * mat[0] + tmp[8] * mat[1] + tmp[11] * mat[2];
// calculate pairs for second 8 elements (cofactors)
tmp[0] = mat[2] * mat[7];
tmp[1] = mat[3] * mat[6];
tmp[2] = mat[1] * mat[7];
tmp[3] = mat[3] * mat[5];
tmp[4] = mat[1] * mat[6];
tmp[5] = mat[2] * mat[5];
tmp[6] = mat[0] * mat[7];
tmp[7] = mat[3] * mat[4];
tmp[8] = mat[0] * mat[6];
tmp[9] = mat[2] * mat[4];
tmp[10] = mat[0] * mat[5];
tmp[11] = mat[1] * mat[4];
// calculate second 8 elements (cofactors)
dst[2] = tmp[0] * mat[13] + tmp[3] * mat[14] + tmp[4] * mat[15];
dst[2] -= tmp[1] * mat[13] + tmp[2] * mat[14] + tmp[5] * mat[15];
dst[3] = tmp[2] * mat[10] + tmp[5] * mat[11] + tmp[1] * mat[9];
dst[3] -= tmp[4] * mat[11] + tmp[0] * mat[9] + tmp[3] * mat[10];
dst[6] = tmp[1] * mat[12] + tmp[6] * mat[14] + tmp[9] * mat[15];
dst[6] -= tmp[0] * mat[12] + tmp[7] * mat[14] + tmp[8] * mat[15];
dst[7] = tmp[8] * mat[11] + tmp[0] * mat[8] + tmp[7] * mat[10];
dst[7] -= tmp[6] * mat[10] + tmp[9] * mat[11] + tmp[1] * mat[8];
dst[10] = tmp[2] * mat[12] + tmp[7] * mat[13] + tmp[10] * mat[15];
dst[10] -= tmp[3] * mat[12] + tmp[6] * mat[13] + tmp[11] * mat[15];
dst[11] = tmp[6] * mat[9] + tmp[11] * mat[11] + tmp[3] * mat[8];
dst[11] -= tmp[10] * mat[11] + tmp[2] * mat[8] + tmp[7] * mat[9];
dst[14] = tmp[5] * mat[12] + tmp[8] * mat[13] + tmp[11] * mat[14];
dst[14] -= tmp[4] * mat[12] + tmp[9] * mat[13] + tmp[10] * mat[14];
dst[15] = tmp[10] * mat[10] + tmp[4] * mat[8] + tmp[9] * mat[9];
dst[15] -= tmp[8] * mat[9] + tmp[11] * mat[10] + tmp[5] * mat[8];
// calculate matrix inverse
for( int i = 0; i < 16; i++ ) { mat[i] = dst[i] * inv_det; }
}
};
template<typename T, int N, bool D>
Matrix<T, N, N, D> inverse( const Matrix<T, N, N, D> & mat )
{
Matrix<T, N, N, D> rval( mat );
SquareMatrixInverter<T, N> inverter;
inverter.run( rval.data() );
return rval;
}
template<typename T, int N, bool D>
T determinant( const Matrix<T, N, N, D> & mat )
{
MatrixDeterminant<T, N> det;
return det( mat.data() );
}
template Matrix<float, 2, 2, true> inverse( const Matrix<float, 2, 2, true> & );
template Matrix<float, 3, 3, true> inverse( const Matrix<float, 3, 3, true> & );
template Matrix<float, 4, 4, true> inverse( const Matrix<float, 4, 4, true> & );
template Matrix<float, 2, 2, false> inverse( const Matrix<float, 2, 2, false> & );
template Matrix<float, 3, 3, false> inverse( const Matrix<float, 3, 3, false> & );
template Matrix<float, 4, 4, false> inverse( const Matrix<float, 4, 4, false> & );
template Matrix<double, 2, 2, true> inverse( const Matrix<double, 2, 2, true> & );
template Matrix<double, 3, 3, true> inverse( const Matrix<double, 3, 3, true> & );
template Matrix<double, 4, 4, true> inverse( const Matrix<double, 4, 4, true> & );
template Matrix<double, 2, 2, false> inverse( const Matrix<double, 2, 2, false> & );
template Matrix<double, 3, 3, false> inverse( const Matrix<double, 3, 3, false> & );
template Matrix<double, 4, 4, false> inverse( const Matrix<double, 4, 4, false> & );
template float determinant( const Matrix<float, 2, 2, true> & );
template float determinant( const Matrix<float, 3, 3, true> & );
template float determinant( const Matrix<float, 4, 4, true> & );
template float determinant( const Matrix<float, 2, 2, false> & );
template float determinant( const Matrix<float, 3, 3, false> & );
template float determinant( const Matrix<float, 4, 4, false> & );
template double determinant( const Matrix<double, 2, 2, true> & );
template double determinant( const Matrix<double, 3, 3, true> & );
template double determinant( const Matrix<double, 4, 4, true> & );
template double determinant( const Matrix<double, 2, 2, false> & );
template double determinant( const Matrix<double, 3, 3, false> & );
template double determinant( const Matrix<double, 4, 4, false> & );
} // end namespace ltaf
#endif // #ifdef c++
#endif //#define __MATRIX_H__
| [
"hoantien05@gmail.com"
] | hoantien05@gmail.com |
c5cc430f2e366a55b2f079d5cabf40b3009b8395 | 58b589be581ab55e26b5dd600c89184c849f59d7 | /src/apps/snakegame/GameMenuRenderer.cpp | 71c02ea2f3870ab46187a48cececd9c1c35d7af4 | [
"MIT"
] | permissive | kosua20/Rendu | 02a0b9b39997b03f9c05138749f1f9bed0f223d9 | 6dd327cec52819ee0d04a4d8e8270dbe0a27b194 | refs/heads/master | 2023-08-31T17:11:39.583115 | 2023-07-09T20:58:17 | 2023-07-09T20:58:17 | 58,236,869 | 456 | 32 | null | null | null | null | UTF-8 | C++ | false | false | 4,771 | cpp |
#include "GameMenuRenderer.hpp"
#include "resources/ResourcesManager.hpp"
#include "graphics/GPU.hpp"
#include "resources/Texture.hpp"
#include "Common.hpp"
GameMenuRenderer::GameMenuRenderer() : Renderer("Menu") {
_buttonProgram = Resources::manager().getProgram("menu_button");
_backgroundProgram = Resources::manager().getProgram2D("passthrough");
_imageProgram = Resources::manager().getProgram("menu_image");
_fontProgram = Resources::manager().getProgram("font_sdf");
_button = Resources::manager().getMesh("rounded-button-out", Storage::GPU);
_buttonIn = Resources::manager().getMesh("rounded-button-in", Storage::GPU);
_toggle = Resources::manager().getMesh("rounded-checkbox-out", Storage::GPU);
_toggleIn = Resources::manager().getMesh("rounded-checkbox-in", Storage::GPU);
_quad = Resources::manager().getMesh("plane", Storage::GPU);
}
void GameMenuRenderer::drawMenu(const GameMenu & menu, const glm::vec2 & finalRes, float aspectRatio) const {
static const std::unordered_map<MenuButton::State, glm::vec4> borderColors = {
{MenuButton::State::OFF, glm::vec4(0.8f, 0.8f, 0.8f, 1.0f)},
{MenuButton::State::HOVER, glm::vec4(0.7f, 0.7f, 0.7f, 1.0f)},
{MenuButton::State::ON, glm::vec4(0.95f, 0.95f, 0.95f, 1.0f)}};
static const std::unordered_map<MenuButton::State, glm::vec4> innerColors = {
{MenuButton::State::OFF, glm::vec4(0.9f, 0.9f, 0.9f, 0.5f)},
{MenuButton::State::HOVER, glm::vec4(1.0f, 1.0f, 1.0f, 0.5f)},
{MenuButton::State::ON, glm::vec4(0.95f, 0.95f, 0.95f, 0.5f)}};
static const glm::vec4 labelsColor = glm::vec4(0.3f, 0.0f, 0.0f, 1.0f);
static const glm::vec4 labelsEdgeColor = glm::vec4(1.0f);
static const float labelsEdgeWidth = 0.25f;
GPU::setViewport(0, 0, int(finalRes[0]), int(finalRes[1]));
// Background image.
if(menu.backgroundImage) {
_backgroundProgram->use();
_backgroundProgram->texture(menu.backgroundImage, 0);
GPU::drawQuad();
}
GPU::setDepthState(true, TestFunction::LESS, true);
GPU::setCullState(false);
GPU::setBlendState(true, BlendEquation::ADD, BlendFunction::SRC_ALPHA, BlendFunction::ONE_MINUS_SRC_ALPHA);
// Images.
_imageProgram->use();
for(const auto & image : menu.images) {
_imageProgram->uniform("position", image.pos);
_imageProgram->uniform("scale", image.scale);
_imageProgram->uniform("depth", 0.95f);
_imageProgram->texture(image.tid, 0);
GPU::drawMesh(*_quad);
}
// Buttons.
for(const auto & button : menu.buttons) {
_buttonProgram->use();
_buttonProgram->uniform("position", button.pos);
_buttonProgram->uniform("scale", button.scale);
// Draw the inside half-transparent region.
_buttonProgram->uniform("depth", 0.5f);
_buttonProgram->uniform("color", innerColors.at(button.state));
GPU::drawMesh(*_buttonIn);
// Draw the border of the button.
_buttonProgram->uniform("depth", 0.9f);
_buttonProgram->uniform("color", borderColors.at(button.state));
GPU::drawMesh(*_button);
// Draw the text image.
_imageProgram->use();
_imageProgram->uniform("position", button.pos);
const glm::vec2 newScale = button.scale * 0.7f * glm::vec2(1.0f, button.size[1] / button.size[0]);
_imageProgram->uniform("scale", newScale);
_imageProgram->uniform("depth", 0.2f);
_imageProgram->texture(button.tid, 0);
GPU::drawMesh(*_quad);
}
// Toggles.
for(const auto & toggle : menu.toggles) {
_buttonProgram->use();
_buttonProgram->uniform("position", toggle.posBox);
_buttonProgram->uniform("scale", toggle.scaleBox);
_buttonProgram->uniform("depth", 0.9f);
// Outside border.
_buttonProgram->uniform("color", borderColors.at(MenuButton::State::OFF));
GPU::drawMesh(*_toggle);
// If checked, fill the box.
if(toggle.state == MenuButton::State::ON) {
_buttonProgram->uniform("color", innerColors.at(MenuButton::State::OFF));
GPU::drawMesh(*_toggleIn);
}
// Text display.
const glm::vec2 newScale = toggle.scale * 0.7f * glm::vec2(1.0f, toggle.size[1] / toggle.size[0]);
_imageProgram->use();
_imageProgram->uniform("position", toggle.posImg);
_imageProgram->uniform("scale", newScale);
_imageProgram->uniform("depth", 0.2f);
_imageProgram->texture(toggle.tid, 0);
GPU::drawMesh(*_quad);
}
GPU::setDepthState(false);
// Labels
_fontProgram->use();
for(const auto & label : menu.labels) {
_fontProgram->texture(label.tid, 0);
_fontProgram->uniform("ratio", aspectRatio);
_fontProgram->uniform("position", label.pos);
_fontProgram->uniform("color", labelsColor);
_fontProgram->uniform("edgeColor", labelsEdgeColor);
_fontProgram->uniform("edgeWidth", labelsEdgeWidth);
GPU::drawMesh(label.mesh);
}
GPU::setBlendState(false);
}
glm::vec2 GameMenuRenderer::getButtonSize() const {
return glm::vec2(_button->bbox.getSize());
}
| [
"kosua20@gmail.com"
] | kosua20@gmail.com |
d44e663f52f113a9facff1ab5d2d99ae5ea07514 | 2e1e1555dc6bcf2eb267d41c40bc4d3e56596bae | /sippet/message/headers/alert_info.h | 89face28b8f61c738c197c868c93c116c027f77e | [
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause"
] | permissive | Jenuce/sippet | a57370998769329b6c60fb9c0526e23d87fe1d9d | c6f4b0e9723f56cfb6d345d307a48f1ff0eb2c65 | refs/heads/master | 2020-12-11T01:41:38.150948 | 2015-10-07T11:58:32 | 2015-10-07T11:58:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,483 | h | // Copyright (c) 2013 The Sippet 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 SIPPET_MESSAGE_HEADERS_ALERT_INFO_H_
#define SIPPET_MESSAGE_HEADERS_ALERT_INFO_H_
#include <string>
#include "sippet/message/header.h"
#include "sippet/message/headers/bits/has_multiple.h"
#include "sippet/message/headers/bits/has_parameters.h"
#include "sippet/message/headers/bits/single_value.h"
#include "sippet/base/raw_ostream.h"
#include "url/gurl.h"
namespace sippet {
class AlertParam :
public single_value<GURL>,
public has_parameters {
public:
AlertParam();
AlertParam(const AlertParam &other);
explicit AlertParam(const single_value::value_type &type);
~AlertParam();
AlertParam &operator=(const AlertParam &other);
void print(raw_ostream &os) const;
};
inline
raw_ostream &operator<<(raw_ostream &os, const AlertParam &p) {
p.print(os);
return os;
}
class AlertInfo :
public Header,
public has_multiple<AlertParam> {
private:
DISALLOW_ASSIGN(AlertInfo);
AlertInfo(const AlertInfo &other);
AlertInfo *DoClone() const override;
public:
AlertInfo();
~AlertInfo() override;
scoped_ptr<AlertInfo> Clone() const {
return scoped_ptr<AlertInfo>(DoClone());
}
void print(raw_ostream &os) const override;
};
} // End of sippet namespace
#endif // SIPPET_MESSAGE_HEADERS_ALERT_INFO_H_
| [
"guibv@yahoo.com"
] | guibv@yahoo.com |
e4970481cf9b427d4c34c721edeef44a81e6e6fd | 08c59366b00b1c68ec07d2358e0bbf93be1dba47 | /include/Engine/Util/Condition.h | e43e4ee9d590a0b71154ceaa3d9f0c9930dd4d0a | [] | no_license | minad/isometric | 835c9ba5bbedaa029706a86d7f806813075590c8 | 382d9c30c6714b3fc65e7e3eca936892997c94fa | refs/heads/master | 2023-08-22T17:50:43.961618 | 2017-03-07T00:32:34 | 2017-03-07T00:32:34 | 84,135,423 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 807 | h | #ifndef _Engine_Util_Condition_h
#define _Engine_Util_Condition_h
#include "Engine/Util/Mutex.h"
#include "SDLWrapper.h"
namespace Engine {
namespace Util {
class Condition
{
public:
Condition()
{
cond = SDL::createCond();
}
~Condition()
{
SDL::destroyCond(cond);
}
void wait(const Mutex& mutex)
{
SDL::condWait(cond, mutex.mutex);
}
bool waitTimeout(const Mutex& mutex, int timeout)
{
return (SDL::condWaitTimeout(cond, mutex.mutex, timeout) == 0);
}
void signal(bool all = false)
{
if (all)
SDL::condBroadcast(cond);
else
SDL::condSignal(cond);
}
private:
SDL::Cond* cond;
};
} // namespace Util
} // namespace Engine
#endif // _Engine_Util_Condition_h
| [
"mail@daniel-mendler.de"
] | mail@daniel-mendler.de |
0a7ac693707721a5311e4dcea7a46179be1bf6e8 | 98b6c7cedf3ab2b09f16b854b70741475e07ab64 | /www.cplusplus.com-20180131/reference/type_traits/is_nothrow_default_constructible/is_nothrow_default_constructible.cpp | 9a4ec4031bd631d82a08e277d0878224a16789ee | [] | no_license | yull2310/book-code | 71ef42766acb81dde89ce4ae4eb13d1d61b20c65 | 86a3e5bddbc845f33c5f163c44e74966b8bfdde6 | refs/heads/master | 2023-03-17T16:35:40.741611 | 2019-03-05T08:38:51 | 2019-03-05T08:38:51 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 625 | cpp | // is_nothrow_default_constructible example
#include <iostream>
#include <type_traits>
struct A { };
struct B { B(){} };
struct C { C() noexcept {} };
int main() {
std::cout << std::boolalpha;
std::cout << "is_nothrow_default_constructible:" << std::endl;
std::cout << "int: " << std::is_nothrow_default_constructible<int>::value << std::endl;
std::cout << "A: " << std::is_nothrow_default_constructible<A>::value << std::endl;
std::cout << "B: " << std::is_nothrow_default_constructible<B>::value << std::endl;
std::cout << "C: " << std::is_nothrow_default_constructible<C>::value << std::endl;
return 0;
}
| [
"zhongtao.chen@yourun.com"
] | zhongtao.chen@yourun.com |
2753aa7039c676ea3316969c4601c3b43f20824f | b25795509f9545ea6b9f947492b39e518add0396 | /ACM/南工大ACM-回溯法/0-1背包.cpp | ca938e4cc520f027c6dcf29a0a16bd5fa84a887e | [] | no_license | Autokaka/C-Single-Ranking | 370e09a5d96212dc0fdef71b4cfe2bd6389c5e22 | 111808c552ee81a6109406e770970560501cea79 | refs/heads/master | 2022-01-11T09:43:02.585962 | 2019-07-15T04:48:12 | 2019-07-15T04:48:12 | 176,041,920 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,123 | cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(x, y, z) for(int (x) = (y); (x) < (z); (x)++)
#define N 15
int x[N], ret[N], n, W, cur = 0, ans = 0, ans1 = 0, rest;//x[i] = 0不取第i个物品; x[i] = 1取. cur当前背包已存放物品的重量; rest没有考虑的物品的价值总量
struct node
{
int weight, value;
} goods[N];
void dfs(int dep)
{
int i;
if (dep >= N)
{
if (ans1 > ans)
{
ans = ans1;
for (i = 0; i < n; i++)
ret[i] = x[i];
}
return;
}
//加入第dep个物品
if (cur + goods[dep].weight <= W)
{
x[dep] = 1;
ans1 += goods[dep].value;
cur += goods[dep].weight;
dfs(dep + 1);
cur -= goods[dep].weight;//一定记得回溯以后要减回去
ans1 -= goods[dep].value;
}
//不加入
rest -= goods[dep].value;
if (rest + ans1 > ans)
{
x[dep] = 0;
dfs(dep + 1);
}
rest += goods[dep].value;
}
int main()
{
int i;
cin >> n >> W;
for (i = 0; i < n; i++)
{
cin >> goods[i].weight >> goods[i].value;
rest += goods[i].value;
}
dfs(0);
for (i = 0; i < n; i++)
if (ret[i])
cout << i + 1 << " ";
cout << ans << endl;
return 0;
}
| [
"qq1909698494@gmail.com"
] | qq1909698494@gmail.com |
ecc1699e5d4b59edeed938e7410cd622e504745a | 82730ea9d814a8478a674c563b256fcfb8f07b4f | /BorderGen/ClosureDetDlg.h | 663294d6583db56249c780e1a2108683fabf552f | [] | no_license | zjustarstar/BorderGen | 7d7fa9d9a72302e3836e5c9d556638009370d718 | f0ca5ec13ec21a5bb70faed118ac525c5b61702b | refs/heads/master | 2021-07-16T07:14:33.817142 | 2020-06-11T10:06:07 | 2020-06-11T10:06:07 | 175,133,493 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 809 | h | #pragma once
#include <opencv2\opencv.hpp>
using namespace std;
using namespace cv;
// CClosureDetDlg 对话框
class CClosureDetDlg : public CDialogEx
{
DECLARE_DYNAMIC(CClosureDetDlg)
public:
CClosureDetDlg(CWnd* pParent = NULL); // 标准构造函数
virtual ~CClosureDetDlg();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_DIALOG_CLOSURE_DETECTOR };
#endif
protected:
CString m_strFilePath; //文件夹路径;
CEdit m_editFilePath;
CListBox m_lbFiles;
string getSaveFileName(CString strFile);
void ListAllFiles(CString strFilePath);
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedButtonBrowser();
afx_msg void OnBnClickedButtonStartdetect();
virtual BOOL OnInitDialog();
};
| [
"philous@163.com"
] | philous@163.com |
04cdea0a0756db0d76285001781246c7dafe7f90 | b2949ea1148236fefd080212431d599ba63cca53 | /Fireworks/src/Platform/OpenGL/OpenGLShader.cpp | 2cf015bfe49778b4eb76c191ea52223d5ca3e4f4 | [
"Apache-2.0"
] | permissive | chris-luafau/Fireworks | 640d96e4c000e6ac028dea6a64845c8ed4f77d23 | 9572f7cf464036e7488a088d352c7f41d8b5b6a6 | refs/heads/main | 2023-02-06T19:46:47.355615 | 2020-12-23T20:32:52 | 2020-12-23T20:32:52 | 306,455,381 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,463 | cpp | #include "fzpch.h"
#include "OpenGLShader.h"
#include "glad/glad.h"
#include <glm/gtc/type_ptr.hpp> // value_ptr()
namespace Fireworks {
OpenGLShader::OpenGLShader(const std::string& vertexSrc, const std::string& fragmentSrc) {
// Create an empty vertex shader handle
GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER);
// Send the vertex shader source code to GL
// Note that std::string's .c_str is NULL character terminated.
const GLchar* source = vertexSrc.c_str();
glShaderSource(vertexShader, 1, &source, 0);
// Compile the vertex shader
glCompileShader(vertexShader);
// Check to see if the vertex shader compiled successfully.
GLint isCompiled = 0;
glGetShaderiv(vertexShader, GL_COMPILE_STATUS, &isCompiled);
if (isCompiled == GL_FALSE) {
GLint maxLength = 0;
glGetShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &maxLength);
// The maxLength includes the NULL character
std::vector<GLchar> infoLog(maxLength);
glGetShaderInfoLog(vertexShader, maxLength, &maxLength, &infoLog[0]);
// We don't need the shader anymore.
glDeleteShader(vertexShader);
// Log the error to the console and exit.
FZ_CORE_ERROR("{0}", infoLog.data());
FZ_CORE_ASSERT(false, "Vertex shader compilation failed.");
return;
}
// Create an empty fragment shader handle
GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
// Send the fragment shader source code to GL
// Note that std::string's .c_str is NULL character terminated.
source = fragmentSrc.c_str();
glShaderSource(fragmentShader, 1, &source, 0);
// Compile the fragment shader
glCompileShader(fragmentShader);
// Check to see if the fragment shader compiled successfully.
glGetShaderiv(fragmentShader, GL_COMPILE_STATUS, &isCompiled);
if (isCompiled == GL_FALSE) {
GLint maxLength = 0;
glGetShaderiv(fragmentShader, GL_INFO_LOG_LENGTH, &maxLength);
// The maxLength includes the NULL character
std::vector<GLchar> infoLog(maxLength);
glGetShaderInfoLog(fragmentShader, maxLength, &maxLength, &infoLog[0]);
// We don't need the shader anymore.
glDeleteShader(fragmentShader);
// Either of them. Don't leak shaders.
glDeleteShader(vertexShader);
// Log the error to the console and exit.
FZ_CORE_ERROR("{0}", infoLog.data());
FZ_CORE_ASSERT(false, "Fragment shader compilation failed.");
return;
}
// Vertex and fragment shaders are successfully compiled.
// Now time to link them together into a program.
// Get a program object.
// Save the ID to our member variable for later use.
m_RendererID = glCreateProgram();
GLuint program = m_RendererID;
// Attach our shaders to our program
glAttachShader(program, vertexShader);
glAttachShader(program, fragmentShader);
// Link our program
glLinkProgram(program);
// Check to see if the shader linked successfully.
// Note the different functions here: glGetProgram* instead of glGetShader*.
GLint isLinked = 0;
glGetProgramiv(program, GL_LINK_STATUS, (int*)&isLinked);
if (isLinked == GL_FALSE) {
GLint maxLength = 0;
glGetProgramiv(program, GL_INFO_LOG_LENGTH, &maxLength);
// The maxLength includes the NULL character
std::vector<GLchar> infoLog(maxLength);
glGetProgramInfoLog(program, maxLength, &maxLength, &infoLog[0]);
// We don't need the program anymore.
glDeleteProgram(program);
// Don't leak shaders either.
glDeleteShader(vertexShader);
glDeleteShader(fragmentShader);
// Log the error to the console and exit.
FZ_CORE_ERROR("{0}", infoLog.data());
FZ_CORE_ASSERT(false, "Shader link failed.");
return;
}
// Always detach shaders after a successful link.
glDetachShader(program, vertexShader);
glDetachShader(program, fragmentShader);
}
OpenGLShader::~OpenGLShader() {
glDeleteProgram(m_RendererID);
}
void OpenGLShader::Bind() const {
glUseProgram(m_RendererID);
}
void OpenGLShader::Unbind() const {
glUseProgram(0);
}
void OpenGLShader::UploadUniformInt(const std::string& name, int value) {
GLint location = glGetUniformLocation(m_RendererID, name.c_str());
glUniform1i(location, value);
}
void OpenGLShader::UploadUniformFloat(const std::string& name, float value) {
GLint location = glGetUniformLocation(m_RendererID, name.c_str());
glUniform1f(location, value);
}
void OpenGLShader::UploadUniformFloat2(const std::string& name, const glm::vec2& values) {
GLint location = glGetUniformLocation(m_RendererID, name.c_str());
glUniform2f(location, values.x, values.y);
}
void OpenGLShader::UploadUniformFloat3(const std::string& name, const glm::vec3& values) {
GLint location = glGetUniformLocation(m_RendererID, name.c_str());
glUniform3f(location, values.x, values.y, values.z);
}
void OpenGLShader::UploadUniformFloat4(const std::string& name, const glm::vec4& values) {
GLint location = glGetUniformLocation(m_RendererID, name.c_str());
glUniform4f(location, values.x, values.y, values.z, values.w);
}
void OpenGLShader::UploadUniformMat3(const std::string& name, const glm::mat4& matrix) {
GLint location = glGetUniformLocation(m_RendererID, name.c_str());
glUniformMatrix3fv(location, 1, GL_FALSE, glm::value_ptr(matrix));
}
void OpenGLShader::UploadUniformMat4(const std::string& name, const glm::mat4& matrix) {
GLint location = glGetUniformLocation(m_RendererID, name.c_str());
glUniformMatrix4fv(location, 1, GL_FALSE, glm::value_ptr(matrix));
}
} | [
"31860645+chris-luafau@users.noreply.github.com"
] | 31860645+chris-luafau@users.noreply.github.com |
4b5e4058126991b9975f3af40e34e850d2fd8c36 | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_5669245564223488_0/C++/abczz/B.cpp | 6f7c2214b6ccde059841bd8bb74b32d2c7915c06 | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 2,537 | cpp | #include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
#include <ctime>
#include <list>
#include <map>
#include <set>
#define REP(i,n) for(int i=0;i<(n);i++)
#define TR(i,x) for(__typeof(x.begin()) i=x.begin();i!=x.end();i++)
#define ALL(x) x.begin(),x.end()
#define SORT(x) sort(ALL(x))
#define CLEAR(x) memset(x,0,sizeof(x))
#define FILL(x,c) memset(x,c,sizeof(x))
#define SIZE(x) (int)(x).size()
#define MP make_pair
#define PB push_back
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
const int MOD = 1e9+7;
int n;
string s[110];
bool Check(int per[]) {
string t = "";
REP(i, n) t += s[per[i]];
//cout << "t = " << t << endl;
int p[200];
FILL(p, 0xff);
REP(i, t.length()) {
if (p[t[i]] == -1) {
p[t[i]] = i;
} else {
if (p[t[i]] + 1 != i) {
return false;
} else {
p[t[i]] = i;
}
}
}
return true;
}
bool Gao(string &str) {
int p[200];
FILL(p, 0xff);
string x = "";
REP(i, str.length()) {
if (p[str[i]] == -1) {
p[str[i]] = i;
x += str[i];
} else {
if (p[str[i]] + 1 != i) {
return false;
} else {
p[str[i]] = i;
}
}
}
str = x;
return true;
}
void Solve() {
cin >> n;
bool flag = true;
REP(i, n) {
cin >> s[i];
flag = Gao(s[i]);
}
int cnt = 0;
if (!flag) {
cout << 0 << endl;
return;
}
int p[100];
REP(i, n) p[i] = i;
do {
if (Check(p)) {
++cnt;
}
} while (next_permutation(p, p + n));
cout << cnt << endl;
}
int main() {
// freopen("B-small-attempt0.in","r",stdin);freopen("B-small-attempt0.out","w",stdout);
freopen("B-small-attempt1.in","r",stdin);freopen("B-small-attempt1.out","w",stdout);
// freopen("B-small-attempt2.in","r",stdin);freopen("B-small-attempt2.out","w",stdout);
// freopen("B-large.in","r",stdin);freopen("B-large.out","w",stdout);
int cas;
cin >> cas;
for (int T = 1; T <= cas; ++T) {
printf("Case #%d: ", T);
Solve();
}
return 0;
}
| [
"eewestman@gmail.com"
] | eewestman@gmail.com |
2ce9a3be1b048aa2c0b4f4504180a59a0356f9c7 | 6ee6cc888f0a82e36fd1687fed4a109f0cb800a7 | /leetcode/312.cpp | 195c70c9678f41e36df09fccb7d011a52a8c4a1a | [] | no_license | Rayleigh0328/OJ | 1977e3dfc05f96437749b6259eda4d13133d2c87 | 3d7caaf356c69868a2f4359377ec75e15dafb4c3 | refs/heads/master | 2021-01-21T04:32:03.645841 | 2019-12-01T06:33:44 | 2019-12-01T06:33:44 | 49,385,474 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 897 | cpp | class Solution {
public:
int maxCoins(vector<int>& nums)
{
int n = nums.size()+2;
int* p = new int [n];
p[0] = p[n-1] = 1;
for (int i=1;i<n-1;++i)
p[i] = nums[i-1];
int** f = new int* [n];
for (int i=0;i<n;++i)
f[i] = new int [n];
for (int i=0;i<n;++i)
for (int j=0;j<n;++j)
f[i][j] = 0;
for (int t=0; t<n;++t)
for (int i=1;i<n-1;++i)
if (i+t < n-1)
for (int j=i;j<=i+t;++j)
f[i][i+t] = max(f[i][i+t], (i<=j-1?f[i][j-1]:0) + (j+1<=i+t?f[j+1][i+t]:0) + p[j]*p[i-1]*p[i+t+1]);
/*
for (int i=0;i<n;++i)
{
for (int j=0;j<n;++j)
cout << "\t" << f[i][j];
cout << endl;
}
*/
return f[1][n-2];
}
}; | [
"j4bian@uwaterloo.ca"
] | j4bian@uwaterloo.ca |
22d7eed253cd5a670aec56782e13b3ada7852694 | ba316d9b90e0078275891ed0b9be7f7fd55fb6f8 | /test/work_queue_for_tests_schedule_work.cpp | e3eeb84c902ab749206a7be7a5ec494892464c47 | [] | no_license | o-peregudov/mqmx | 32a706a5eb8c733735a1cc4744b2973fd07676aa | f462bfe465310948dc7263f82a7af0b300969adb | refs/heads/master | 2021-01-16T23:52:33.847232 | 2016-10-12T18:08:29 | 2016-10-12T18:08:29 | 59,597,636 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,221 | cpp | #include "mqmx/testing/work_queue_for_tests.h"
#include "test/FakeIt/single_header/standalone/fakeit.hpp"
#undef NDEBUG
#include <cassert>
struct work_interface
{
virtual bool do_something (const mqmx::work_queue::work_id_type) = 0;
virtual ~work_interface () { }
};
int main ()
{
using namespace mqmx;
using namespace fakeit;
using mock_type = Mock<work_interface>;
mock_type mock;
When (Method (mock, do_something)).AlwaysReturn (true);
{
testing::work_queue_for_tests sut;
status_code ec = ExitStatus::Success;
work_queue::work_id_type work_id = work_queue::INVALID_WORK_ID;
work_queue::client_id_type client_id = sut.get_client_id ();
std::tie (ec, work_id) = sut.schedule_work (
client_id,
std::bind (&work_interface::do_something, &(mock.get ()), std::placeholders::_1));
assert (ec == ExitStatus::Success);
assert (work_id != work_queue::INVALID_WORK_ID);
sut.forward_time ();
ec = sut.cancel_work (work_id);
assert (ec == ExitStatus::NotFound);
Verify (Method (mock, do_something).Using (work_id))
.Once ();
}
VerifyNoOtherInvocations (mock);
return 0;
}
| [
"o.peregudov@gmail.com"
] | o.peregudov@gmail.com |
6e92622216710e1a5917261c8daace1f6f9838de | be04d41cc516caec667467787a238e1463b815eb | /src/py/wrapper_b1580b6f5457571a867a2347d7b1f865.cpp | 72548ee8b932fde1b82a00264b253bc6ca6d84e3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | nikhilkalige/ClangLite | 9f0db6088dee83f89996d4c01da9979c39b3862c | dcb6d7385cca25c0a888bb56ae3ec1eb951cd752 | refs/heads/master | 2020-04-21T23:48:28.409657 | 2019-02-20T08:14:21 | 2019-02-20T08:14:21 | 169,958,200 | 0 | 0 | Apache-2.0 | 2019-02-10T08:37:14 | 2019-02-10T08:37:14 | null | UTF-8 | C++ | false | false | 1,342 | cpp | #include "_clanglite.h"
bool (::clang::FileID::*method_pointer_a2de043c5e1b5973bd96085e9ca023a7)()const= &::clang::FileID::isValid;
bool (::clang::FileID::*method_pointer_8bf8694510d856cf9efe8860ebb4a64f)()const= &::clang::FileID::isInvalid;
class ::clang::FileID (*method_pointer_aab4faec1936510eb177541ad22621a6)()= ::clang::FileID::getSentinel;
unsigned int (::clang::FileID::*method_pointer_c9e884cb5b3e578a9ab51a03e5baa5b5)()const= &::clang::FileID::getHashValue;
namespace autowig {
}
void wrapper_b1580b6f5457571a867a2347d7b1f865(pybind11::module& module)
{
pybind11::class_<class ::clang::FileID, autowig::HolderType< class ::clang::FileID >::Type > class_b1580b6f5457571a867a2347d7b1f865(module, "FileID", "An opaque identifier used by SourceManager which refers to a source file\n(MemoryBuffer) along with its #include path and #line data.\n\n");
class_b1580b6f5457571a867a2347d7b1f865.def("is_valid", method_pointer_a2de043c5e1b5973bd96085e9ca023a7, "");
class_b1580b6f5457571a867a2347d7b1f865.def("is_invalid", method_pointer_8bf8694510d856cf9efe8860ebb4a64f, "");
class_b1580b6f5457571a867a2347d7b1f865.def_static("get_sentinel", method_pointer_aab4faec1936510eb177541ad22621a6, "");
class_b1580b6f5457571a867a2347d7b1f865.def("get_hash_value", method_pointer_c9e884cb5b3e578a9ab51a03e5baa5b5, "");
} | [
"pfernique@gmail.com"
] | pfernique@gmail.com |
0f446c6d77dcbbf94a6e55e8e1adf037327c7c70 | b367fe5f0c2c50846b002b59472c50453e1629bc | /xbox_leak_may_2020/xbox trunk/xbox/private/test/multimedia/dsptest/dsptest.h | 779ce35042fe33d41157071fc9d92b3b92ce0853 | [] | no_license | sgzwiz/xbox_leak_may_2020 | 11b441502a659c8da8a1aa199f89f6236dd59325 | fd00b4b3b2abb1ea6ef9ac64b755419741a3af00 | refs/heads/master | 2022-12-23T16:14:54.706755 | 2020-09-27T18:24:48 | 2020-09-27T18:24:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,901 | h |
#ifndef _DSPTEST_H_
#define _DSPTEST_H_
#define MAX_FREQUENCY_BINS 512
#define M_PI 3.14159265358979323846
typedef enum {
DRAW_SPECTRUM = 0,
DRAW_CYCLES,
MAX_SCREENS
} SCREENS;
//
// defines that control what the app does
//
//#define SRC_TEST 1
//#define BREAK_ON_START
#define DOWNLOAD_SCRATCH_IMAGE
#define USE_DSOUND
#define TRACK_TOTAL_GP_USAGE 1
#define DSP_CLOCK_133 1
//#define DSP_CLOCK_160 1
//#define DSP_CLOCK_200 1
//#define ENABLE_DOLBY_DOWNLOAD 1
//*************************************************************
extern HRESULT
DirectSoundLoadEncoder
(
LPCVOID pvImageBuffer,
DWORD dwImageSize,
LPVOID * ppvScratchData,
LPDIRECTSOUND * ppDirectSound
);
extern HRESULT LoadDolbyCode();
extern HRESULT LoadReverbParameters();
extern HRESULT CreateSineWaveBuffer( double dFrequency, LPDIRECTSOUNDBUFFER8 * ppBuffer );
extern HRESULT SetFXOscillatorParameters(LPDIRECTSOUND pDirectSound,DWORD dwEffectIndex,FLOAT Frequency);
extern HRESULT LoadWaveFile(LPCSTR pszFileName,LPCWAVEFORMATEX * ppwfxFormat,XFileMediaObject ** ppMediaObject);
extern HRESULT
PlayLoopingBuffer
(
LPCSTR pszFile,
LPDIRECTSOUNDBUFFER *pBuffer,
DWORD dwFlags
);
#ifdef DSP_CLOCK_160
// 160Mhz
#define MAX_GP_IDLE_CYCLES 106720 // 32 samples at 160Mhz (or 667us*160Mhz)
#define MAX_EP_IDLE_CYCLES 853333 // 256 samples at 160Mhz (or 667us*160Mhz)
#endif
#ifdef DSP_CLOCK_200
// 200Mhz
#define MAX_GP_IDLE_CYCLES 133333 // 32 samples at 200Mhz
#define MAX_EP_IDLE_CYCLES 1066666 // 256 samples at 200Mhz
#endif
#ifdef DSP_CLOCK_133
// 133 Mhz
#define MAX_GP_IDLE_CYCLES 88666 // 32 samples at 133Mhz
#define MAX_EP_IDLE_CYCLES 709333 // 256 samples at 133Mhz
#endif
//#define MAX_EP_IDLE_CYCLES 10000
//-----------------------------------------------------------------------------
// Name: class CXBoxSample
// Desc: Main class to run this application. Most functionality is inherited
// from the CXBApplication base class.
//-----------------------------------------------------------------------------
class CXBoxSample : public CXBApplication
{
public:
CXBoxSample();
virtual HRESULT Initialize();
virtual HRESULT Render();
virtual HRESULT FrameMove();
HRESULT RenderSpectrum();
HRESULT RenderDSPUsage();
HRESULT FourierTransform();
HRESULT DownloadScratch(PCHAR pszScratchFile);
HRESULT UpdateReverb();
HRESULT VerifySRCEffect(LPDSMIXBINS pDsMixBins);
// Font and help
CXBFont m_Font;
CXBHelp m_Help;
FLOAT m_fEPCycles;
FLOAT m_fEPMinCycles;
FLOAT m_fEPMaxCycles;
DWORD m_dwDelta;
FLOAT m_fGPCycles;
DWORD m_dwGPMinCycles;
DWORD m_dwGPMaxCycles;
DWORD m_dwCount;
DWORD m_dwCurrentEnv;
CHAR m_szCurrentReverb[256];
// Draw help?
BOOL m_bDrawHelp;
BOOL m_bDoDFT;
DWORD m_dwScreenSelected;
HRESULT m_hOpenResult;
LPDIRECTSOUND m_pDirectSound;
LPDIRECTSOUNDBUFFER m_pDSBuffer;
LPDIRECTSOUNDBUFFER m_pOscillatorBuffer0;
LPDIRECTSOUNDBUFFER m_pOscillatorBuffer1;
LPDIRECTSOUNDBUFFER m_pOscillatorBuffer2;
FLOAT m_fMaxLevels[6];
//
// DFT stuff
//
LPDSEFFECTIMAGEDESC m_pEffectsImageDesc;
PDWORD m_pdwAudioData;
DWORD m_dwEffectIndex;
DOUBLE m_fMaxMagnitude;
DOUBLE m_aFrequencyBins[MAX_FREQUENCY_BINS];
DOUBLE m_aMagnitudeBins[MAX_FREQUENCY_BINS];
DOUBLE m_aPhaseBins[MAX_FREQUENCY_BINS];
};
#endif
| [
"benjamin.barratt@icloud.com"
] | benjamin.barratt@icloud.com |
9b107b720ce498f461da5503e16338990f8c1d76 | 3239d1f0223da3bf99305a9cec6733555171abf5 | /MV200/Parameter.h | bc34a02824ac5a7b0f57b910a3287c8401150eda | [] | no_license | qq77457051/crpAlynasis | 5f757e2ff53fe957a2aa9e3ba087a6f2d1086e8c | 6f4036464eb2006d2e1b70d7152d619146d1280a | refs/heads/master | 2023-03-20T10:35:50.334423 | 2017-10-27T10:27:44 | 2017-10-27T10:27:44 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,285 | h | #ifndef GPARAMETER_H
#define GPARAMETER_H
#include <QObject>
#include <QVector>
#include <QMapIterator>
#include "ParamDefine.h"
#include "Object/SQLite/sqlite.h"
//常规项目 结构体保存各个项目的参数(包括Logic5P、项目其他参数)
struct ProjectParamS
{
bool isDiluentPorj; //是否为稀释项目(0:非稀释项目,1:稀释项目)
QString Param_unit; //项目单位 (是否有用,待定)
int Param_accuracy; //项目精度
double Param_lowLinear; //线性下限
double Param_factorK; //K因数值
double Param_bloodFactor; //全血因子(全血模式有效,非全血则为1)
int Param_lightPos1; //测光点1
int Param_lightPos2; //测光点2
int Param_Reagent_R0; //R0试剂ID(试剂表,0:未选择试剂位)
int Param_Reagent_R1; //R1试剂ID(试剂表,0:未选择试剂位)
int Param_Reagent_R2; //R2试剂ID(试剂表,0:未选择试剂位)
int Param_SVol; //样本量(ul)
int Param_R0Vol; //探针吸R0量(ul)
int Param_R1Vol; //探针吸R1量(ul)
int Param_RSVol; //探针吸稀释后的样本量(ul)样本转移量
int Param_R2Vol; //探针吸R2量(ul)
double Param_R0; //参数R0
double Param_K; //参数K
double Param_a; //参数a
double Param_b; //参数b
double Param_c; //参数c
double Param_R; //参数-最大幅度
double Param_C; //参数-最大浓度
bool isLogic5P2; //是否有第二段曲线
double Param2_R0; //参数R0
double Param2_K; //参数K
double Param2_a; //参数a
double Param2_b; //参数b
double Param2_c; //参数c
double Param2_R; //参数-最大幅度
double Param2_C; //参数-最大浓度
};
//组合项目
struct CombineProject
{
//int CombID; //组合项目ID
QString CombProjectNameEn; //组合项目简称
QString CombProjectNameCn; //组合项目全称
QString CombProjectMember; //项目成员,以“+”为间隔,如(CCP+hs-CRP)
QString CombProjectMemberID; //项目id,以“-”为间隔,如(1-2-3)
};
//计算项目
struct CalculateProject
{
//int CalculateID; //计算项目ID
QString CalculateProjectNameEn; //计算项目简称
QString CalculateProjectNameCn; //计算项目全称
QString ProjectList; //项目列表,以“+”为分隔 如:TP+hs-CRP
QString CalculateProjectExpression; //表达式,如:{TP}-{ALB}
QString Unit; //项目单位
int Accracy; //小数位数
double Range1; //参考范围1
double Range2; //参考范围2
QString CalculateProjectExpressionNO; //编号表达式,如:1-2
};
//质控项目参数队列
struct QCParam
{
int Proj_id; //项目id
QString ProjName; //项目名称
double TargetValue; //靶值
double SD; //标准差
double TargetUpperL; //靶值上限
double TargetLowerL; //靶值下限
};
//质控液
struct QCLiquid
{
int id; //质控液ID
QString Name; //质控液名称
int SampleType; //质控液样本类型
QString BatchNo; //批号
QString ValidDate; //有效期
QString BarCode; //条码
QCParam Param[PROJECT_COUNT]; //项目参数
};
//状态枚举表(对应数据库状态表的id)
enum StateTable
{
State_IDLE = 1, //空闲
State_APPLICATE = 2, //已申请
State_WAIT = 3, //待测试(等待)
State_TESTING = 4, //测试中
State_ADD_DILUENT = 5, //加稀释液(R0)
State_ADD_SAMPLE = 6, //加样本
State_ADD_R1 = 7, //加R1
State_ADD_RS = 8, //加稀释样本(RS)
State_ADD_R2 = 9, //加R2
State_DIRTY = 10, //脏杯(反应杯)
State_FINISHED = 11, //完成(测试完成)
State_CLEAN = 12, //清洗(反应杯)
State_ERROR = 13, //出错
State_BLANK = 14, //空跑
State_unFINISHED = 15, //未完成
State_noSAMPLE = 16, //缺少样本
State_END1 = 17, //测试加样完成(END1)
State_END2 = 18, //测试采光完成(END2)
State_BLANKOUT = 19, //取消/作废
State_noREAGENT = 20 //缺少试剂(20170706新增)
//有新状态,则往后添加
};
class GParameter : public QObject
{
Q_OBJECT
public:
explicit GParameter(QObject *parent = 0);
/*************************************************************************************************************************/
/**Build类型(发布版、研发版)**/
bool get_isRelease(); //0:研发版,即供公司内部使用。1:发布版,即供客户端使用。
void set_isRelease(bool flag);
/*************************************************************************************************************************/
/**用户信息**/
QString getCompanyName_En(); //公司英文名称
QString getCompanyName_Cn(); //公司中文名称
void setUserName(QString); //设置用户名
QString getUserName(); //获取用户名
void setUserID(int id); //设置用户ID
int getUserID(); //获取用户ID
QString getHospitalName(); //获取医院名称(打印表头)
void setHospitalName(QString name);
QString getMachineName(); //机器名称,MV200
QString getTCPServerIP(); //tcp服务器ip
void setTCPServerIP(QString ip);
int getTCPServerPort(); //端口
int setTCPServerPort(int port);
int get_isLISAutoStart(); //是否开机自动连接LIS服务器
void set_isLISAutoStart(int flag);
QString get_LIS_IP(); //LIS ip
void set_LIS_IP(QString ip);
int get_LIS_Port(); //LIS 端口
void set_LIS_Port(int port);
int get_ACKTime(); //ACK超时
void set_ACKTime(int time);
/*************************************************************************************************************************/
/**开机流程**/
void set_isSelfCheck(int isCheck); //设置开机是否自检
int get_isSelfCheck(); //获取开机是否自检
/*************************************************************************************************************************/
/**项目信息**/
ProjectParamS getProjectParam(int id); //查询id项目的项目参数
void setProjectParam(int id, ProjectParamS param);//新增/修改项目参数
void removeProjectParam(int id); //移除项目参数(删除项目时用到)
QVector<QString> get_ProjectName(); //MV100测试项目名称
QMap<int, QString> getProjectMap(); //项目名称<id, 项目>
void setProjectMap(QMap<int, QString> map);
int appendProjectMap(int id, QString name); //追加项目
int removeProjectMap(int id); //移除Map中的项目
int getProject_id(QString project);
QString getPorject_Name(int id);
QMap<int, int> getMapReagentSlot(); //试剂仓信息映射<试剂瓶号,项目id>
void setMapReagentSlot(QMap<int, int> map);
void setMapReagentSlot(int key, int value);//设置key位置的项目id为value
int getMapReagentSlotValue(int rNo); //获取试剂位对应的项目ID
void ReleaseReagentNo(int rNo); //释放rNo试剂位
int ReleaseAllReagent(); //释放全部试剂位
bool getReagentNoState(int rNo); //查看rNo试剂位的状态(是否已经占用,0:未占用,1:已占用)
int getReagentPosCount(int pID); //查看项目对应的试剂位置个数
//组合项目
QString getCombProjectMember(int id); //获取组合项目的成员名称组合
QString getCombProjectMemberID(int id); //获取组合项目的成员项目id组合
QVector<QString> getCombineProjectName(); //组合项目的名称
void setCombineProjectMap(QMap<int, CombineProject> map);//组合项目
void setCombineProject(int id, CombineProject param); //新增/修改组合项目
int removeCombineProject(int id); //移除组合项目
int isComgineProjectExist(QString name); //查看name组合项目是否已经存在(若存在,则返回组合项目的id)
//计算项目
int getCalculateProjectAccracy(int id); //计算项目的精度(小数位数)
int getCalculateProject_id(QString name); //获取计算项目的id
QString getCalculateProjectExpression(int id); //获取计算项目表达式
QStringList getCalculateProjectList(int id); //获取计算项目的子项目列表
QString getCalculateProjectExpressionNO(int id); //获取计算项目编号表达式(未使用)
QVector<QString> getCalculateProjectName(); //计算项目的名称
CalculateProject getCalculateProjectParam(int id); //获取指定id的计算项目的参数
void setCalculateProjectMap(QMap<int, CalculateProject> map);//计算项目
void setCalculateProject(int id, CalculateProject param); //新增/修改计算项目
int removeCalculateProject(int id); //移除计算项目
int isCalculateProjectExist(QString name); //查看name计算项目是否已经存在(若存在,则返回计算项目的id)
//质控液
void ResetQcLiquidMap(); //重置质控液映射
void setQCLiquidMap(QMap<int, QCLiquid> map); //质控液(质控液id, 质控液参数)
QMap<int, QCLiquid> getQCLiquidMap();
QStringList getQcLiquidName(); //质控液名称
int insertQcLiquidMap(int id, QCLiquid qc); //添加质控液参数
int removeQcLiquidMap(int id); //移除质控液
int updateQcLiquidMap(int id, QCLiquid param); //更新质控液参数
QCLiquid getQCParam(int id); //相应质控液的参数
QCParam *getQcProjParam(int id); //质控液对应的项目参数
QStringList getQcProject(QString name); //质控液对应的项目名称
int getQcLiquidID(QString name); //质控液id
//加样针到试剂瓶底的步数
void setProbe2Bottom(int step);
int getProbe2Bottom();
QStringList getSampleTypeList(); //样本类型
void setSampleTypeList(QStringList list);
int getSampleNo(); //样本编号(记录作用)
void setSampleNo(int no);
/*************************************************************************************************************************/
/**周期参数**/
int getCycleTime(); //每个周期的时间长度
void setCycleTime(int time);
/*************************************************************************************************************************/
/**系统参数**/
bool get_isLiquidAlarmStop(); //液体状态报警是否要停机
void set_isLiquidAlarmStop(bool flag);
int get_LessWaterTimes(); //提示“缺少去离子水”后最多能运行的次数
void set_LessWaterTimes(int times);
int get_LessCleanLiquidTimes(); //提示“缺少清洗液”后最多能运行的次数
void set_LessCleanLiquidTimes(int times);
int get_Full_L_WasteTimes(); //提示“低浓度废液满”后最多能运行的次数
void set_Full_L_WasteTimes(int times);
int get_Full_H_WasteTimes(); //提示“高浓度废液满”后最多能运行的次数
void set_Full_H_WasteTimes(int times);
bool get_isAutoSaveResult(); //结果是否自动保存到数据库
void set_isAutoSaveResult(bool flag);
void setCupDirtyAD(int value); //设置脏杯的AD值
int getCupDirtyAD();
//清洗机构-清水吸液量(但实际上是控泵阀的开关时间)
int getWaterVol();
void setWaterVol(int vol);
//清洗机构-清液吸液量(但实际上是控泵阀的开关时间)
int getCleanLiquidVol();
void setCleanLiquidVol(int vol);
private:
/*************************************************************************************************************************/
/**Build类型(发布版、研发版)**/
bool isRelease; //0:研发版,即供公司内部使用。1:发布版,即供客户端使用。
/*************************************************************************************************************************/
/**用户信息**/
QString UserName; //用户名
int UserID; //用户ID
QString HospitalName;//获取医院名称
QString MachineName; //机器名称,MV200
QString CompanyName; //公司名称(英文)
QString CompanyName2;//公司名称(中文)
int Port; //端口(中位机)
QString Host_IP; //tcp服务器ip(中位机)
QString LIS_IP; //LIS ip
int LIS_Port; //LIS 端口
int ACKTime; //ACK超时
int isLISAutoStart; //是否开机自动连接LIS服务器
/*************************************************************************************************************************/
/**开机流程**/
int isSelfCheck; //开机是否自检
/*************************************************************************************************************************/
/**项目信息**/
//常规项目
QMap<int, QString> ProjectMap; //项目名称 <id, 项目>
QMap<int, ProjectParamS> *MapProjectParamS; //项目参数映射<项目id, 参数表>
//有点重复 ?? (在项目参数中包含了, 待修改)
QMap<int, int> MapReagentSlot; //试剂仓信息映射<试剂瓶号,项目id> 目前用处:在设置项目对应的试剂位置时,不允许不同项目使用同一个试剂位
//组合项目
QMap<int, CombineProject> CombineProjectMap; //组合项目(项目id, 项目参数)
//计算项目
QMap<int, CalculateProject> CalculateProjectMap; //计算项目(项目id, 项目参数)
//质控液
QCParam *QcParam; //质控液对应的项目参数
QMap<int, QCLiquid> QCLiquidMap; //质控液(质控液id, 质控液参数)
QStringList QcLiquidNameList; //质控液名称列表
//加样针复位位置到试剂瓶底的步数(计算试剂余量)
int Probe2Bottom;
QStringList SampleTypeList; //样本类型
int SampleNo; //样本编号(记录作用,申请样本测试用)
/*************************************************************************************************************************/
/**周期参数**/
int CycleTime; //每个周期的时间长度
/*************************************************************************************************************************/
/**系统参数**/
bool isLiquidAlarmStop; //液体状态报警是否要停机
int LessWaterTimes; //提示“缺少去离子水”后最多能运行的次数
int LessCleanLiquidTimes; //提示“缺少清洗液”后最多能运行的次数
int Full_L_WasteTimes; //提示“低浓度废液满”后最多能运行的次数
int Full_H_WasteTimes; //提示“高浓度废液满”后最多能运行的次数
bool isAutoSaveResult; //结果是否自动保存到数据库
int CupDirtyAD; //脏杯的AD值
//清洗机构-清水吸液量
int WaterVol;
//清洗机构-清液吸液量
int CleanLiquidVol;
signals:
void sig_newProject(); //信号:添加了新的测试项目
void sig_newCombineProject(); //信号:添加了新的组合项目
void sig_newCalculateProject(); //信号:添加了新的计算项目
void sig_UpdateQcLiquidName(); //信号:更新质控液列表
public slots:
};
extern GParameter * gParameter;
#endif // GPARAMETER_H
| [
"474007782@qq.com"
] | 474007782@qq.com |
116a5e0a1205c2e5317e100651c1acfd4541c6f1 | 458414e3ea47a784759a7e2c3c37c97b098baf14 | /main/cppsrc/MyQRectF.cpp | 66ec483538152f44ae3508626cbc51eebd591f53 | [] | no_license | blazern/kovtun-method | 24fab1eee4a027cc2cde66ea6c238963f828d647 | e1d027d445b66c924262c6dea4e676863b3c4775 | refs/heads/master | 2021-01-15T23:07:28.913847 | 2014-02-28T16:41:31 | 2014-02-28T16:41:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,228 | cpp | #include "MyQRectF.h"
#include <QDebug>
namespace KovtunMethod
{
MyQRectF::MyQRectF(const MyQRectF & other) :
QRectF(other),
name(other.name),
neighbors(other.neighbors),
color(other.color),
colorInitialized(other.colorInitialized),
parentsGravityCenter(copy(other.parentsGravityCenter)),
grandParentsGravityCenter(copy(other.grandParentsGravityCenter))
{
}
MyQRectF::~MyQRectF()
{
for (auto & neighbor : neighbors)
{
neighbor->neighbors.remove(this);
}
if (parentsGravityCenter != nullptr)
{
delete parentsGravityCenter;
}
if (grandParentsGravityCenter != nullptr)
{
delete grandParentsGravityCenter;
}
}
MyQRectF::MyQRectF(
const QPointF & topLeft,
const QPointF & bottomRight,
const QString & name,
const QPointF * parentsGravityCenter,
const QPointF * grandParentsGravityCenter) :
QRectF(topLeft, bottomRight),
name(name),
neighbors(),
color(0, 0, 0),
colorInitialized(false),
parentsGravityCenter(copy(parentsGravityCenter)),
grandParentsGravityCenter(copy(grandParentsGravityCenter))
{
}
MyQRectF::MyQRectF(
const qreal x,
const qreal y,
const qreal width,
const qreal height,
const QString & name,
const QPointF * parentsGravityCenter,
const QPointF * grandParentsGravityCenter) :
QRectF(x, y, width, height),
name(name),
neighbors(),
color(0, 0, 0),
colorInitialized(false),
parentsGravityCenter(copy(parentsGravityCenter)),
grandParentsGravityCenter(copy(grandParentsGravityCenter))
{
}
QPointF * MyQRectF::copy(const QPointF * point) const
{
return point == nullptr ? nullptr : new QPointF(*point);
}
void MyQRectF::addNeighbor(MyQRectF & other)
{
neighbors.insert(&other);
other.neighbors.insert(this);
}
const QColor & MyQRectF::getColor() const
{
return color;
}
void MyQRectF::setColor(const QColor & color)
{
colorInitialized = true;
this->color = color;
}
bool MyQRectF::isColorInitialized() const
{
return colorInitialized;
}
}
//uint qHash(const KovtunMethod::MyQRectF & rectangle)
//{
// return qHash(rectangle.getName());
//}
| [
"blazer007@yandex.ru"
] | blazer007@yandex.ru |
cb6718207f0cb5981a7bc4830508bdf8a7498b62 | 9a6d2520a0fe4f045d14ac5d3d8d93311229ba3a | /monthlypaid.cpp | 4088102f7f14c0c646637d2473921687a532f482 | [] | no_license | brijal08/personnelManagment | 09ee83d9bd8479886c72fb8b00930caaff405f53 | 6a491df7a48987c3306faa39b63d2a3732dbeea9 | refs/heads/main | 2023-04-22T09:44:51.167654 | 2021-05-09T15:38:45 | 2021-05-09T15:38:45 | 365,787,037 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,901 | cpp | #include "monthlypaid.h"
#include <QDebug>
MonthlyPaid::MonthlyPaid(QObject *parent) : EmployeeDetails(parent)
{
}
MonthlyPaid::~MonthlyPaid()
{
this->clearSalaryList();
}
int MonthlyPaid::getEmployeeType()
{
return this->enEmployeType;
}
void MonthlyPaid::setEmployeeType(int pEmployeeType)
{
this->enEmployeType = pEmployeeType;
}
float MonthlyPaid::getCompansastion(QDate pDate)
{
float lCompansastion = 0;
if(!qvecSalaryList.isEmpty()) {
foreach (QSharedPointer<MonthlyPaidSalaryData> ldata, qvecSalaryList) {
if((ldata->mDate.month() == pDate.month())
&& (ldata->mDate.year() == pDate.year())) {
lCompansastion = ldata->fCompensastion;
break;
}
}
}
return lCompansastion;
}
QString MonthlyPaid::getEmployeeName()
{
return this->qstrEmloyeeName;
}
void MonthlyPaid::setEmployeeName(QString pEmployeeName)
{
this->qstrEmloyeeName = pEmployeeName;
}
QString MonthlyPaid::getSecurityNumber()
{
return this->qstrSecurityNumber;
}
void MonthlyPaid::setSecurityNumber(QString pSecurityNumber)
{
this->qstrSecurityNumber = pSecurityNumber;
}
bool MonthlyPaid::addSalary(QDate pDate, QString pCompansastion)
{
bool lRet = false;
int laddIndex = 0;
if(!pDate.isValid() || (pCompansastion.toFloat() <= 0)) {
return lRet;
}
if(!qvecSalaryList.isEmpty()) {
foreach (QSharedPointer<MonthlyPaidSalaryData> ldata, qvecSalaryList) {
if((ldata->mDate.month() == pDate.month())
&& (ldata->mDate.year() == pDate.year())) {
laddIndex = -1;
break;
}
if(ldata->mDate < pDate) {
laddIndex = qvecSalaryList.indexOf(ldata);
}
}
}
if(laddIndex != -1) {
beginInsertRows(QModelIndex(), laddIndex, laddIndex);
MonthlyPaidSalaryData lSalaryData = {pDate,pCompansastion.toFloat()};
qvecSalaryList.insert(laddIndex,QSharedPointer<MonthlyPaidSalaryData>(new MonthlyPaidSalaryData(lSalaryData)));
endInsertRows();
lRet = true;
}
return lRet;
}
bool MonthlyPaid::removeSalary(int pIndex)
{
bool lRet = false;
if(validateIndex(pIndex))
{
beginRemoveRows(QModelIndex(),pIndex,pIndex);
qvecSalaryList.removeAt(pIndex);
endRemoveRows();
lRet = true;
}
return lRet;
}
bool MonthlyPaid::clearSalaryList()
{
bool lRet = false;
if(!qvecSalaryList.isEmpty())
{
beginRemoveRows(QModelIndex(),0,qvecSalaryList.count() - 1);
qvecSalaryList.clear();
endRemoveRows();
lRet = true;
}
return lRet;
}
int MonthlyPaid::rowCount(const QModelIndex &pParent) const
{
Q_UNUSED(pParent);
return qvecSalaryList.count();
}
QVariant MonthlyPaid::data(const QModelIndex &pIndex, int pDisplayRole) const
{
QVariant lValue;
if(validateIndex(pIndex.row())) {
switch (pDisplayRole) {
case Date:
lValue = qvecSalaryList.at(pIndex.row())->mDate.toString("MMM-yyyy");
break;
case Compansastion:
lValue = QString::number(qvecSalaryList.at(pIndex.row())->fCompensastion,'f',2);
break;
default:
qInfo() << "Inavlalid roleId" << pDisplayRole;
break;
}
}
return lValue;
}
QHash<int, QByteArray> MonthlyPaid::roleNames() const
{
QHash<int, QByteArray> lSalaryRoles;
lSalaryRoles[Date] = "Date";
lSalaryRoles[Compansastion] = "Compansastion";
return lSalaryRoles;
}
bool MonthlyPaid::validateIndex(const int &pIndex) const
{
if ((pIndex >= 0) && (pIndex < qvecSalaryList.size())) {
return true;
} else {
qWarning() << "invalid Row no" << "[idx]" << pIndex << "[listsize]" << qvecSalaryList.size();
}
return false;
}
| [
"noreply@github.com"
] | brijal08.noreply@github.com |
ff6e58a9ce1bc8232cfafa3d924e2185ad3ccc36 | 08307bdd77ea10309b496c676f14ff492f380177 | /InstantMessaging/InstantMessagingDlg.h | 1e5865dd3ad522eb976bb9b9193934348a6688f2 | [] | no_license | asdlei99/InstantMessaging | 78a38e6155345ff994d4d39ef85ecfc2a77641af | 079d3912b87150bd42a591f12d9606b3b96064ab | refs/heads/master | 2020-12-11T09:55:48.393995 | 2018-02-27T14:26:11 | 2018-02-27T14:26:11 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 9,925 | h | // InstantMessagingDlg.h : header file
//
#if !defined(AFX_INSTANTMESSAGINGDLG_H__7D41D06C_C73A_4AE1_9284_440FC1479084__INCLUDED_)
#define AFX_INSTANTMESSAGINGDLG_H__7D41D06C_C73A_4AE1_9284_440FC1479084__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CInstantMessagingDlg dialog
#include "AdvButton.h"
#include "DialogSetting.h"
#include "FriendsListCtrl.h"
#include "ChatRoomServerDlg.h"
#include "ChatRoomClientDlg.h"
#include "ChatDlg.h"
#include "ShareScreenClientDlg.h"
#include "ShareScreenServerDlg.h"
#include "SendFilesServerDlg.h"
#include "SendFilesClientDlg.h"
#include "WhiteBoardServerDlg.h"
#include "WhiteBoardClientDlg.h"
#include "VideoChatDlg.h"
#include "VideoChatListenSocket.h"
class CListeningSocket;
LRESULT WINAPI EncodeCallback( HWND hWnd, LPVIDEOHDR lpVHdr );
BYTE _clip255( LONG v );
void YUY2_RGB( BYTE *YUY2buff, BYTE *RGBbuff, DWORD dwSize );
class CInstantMessagingDlg : public CDialog
{
// Construction
public:
CInstantMessagingDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CInstantMessagingDlg)
enum { IDD = IDD_INSTANTMESSAGING_DIALOG };
CComboBox m_comboxIP;
CFriendsListCtrl m_listCtrlFriends;
CStatic m_staticFace;
CEdit m_editNickName;
CComboBox m_comboxState;
CComboBox m_comboxFriend;
CAdvButton m_btnWhiteBoard;
CAdvButton m_btnShareScreen;
CAdvButton m_btnSendFiles;
CAdvButton m_btnChatRoom;
CAdvButton m_btnAddFriend;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CInstantMessagingDlg)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
NOTIFYICONDATA m_nid; /// 最小化是托盘所需结构体
CBitmap m_bmpFace; /// 头像
WORD m_wVirtualKeyCode; /// 热键虚拟器码
WORD m_wModifiers; /// 热键修改值
WORD m_wFace; /// 头像
WORD m_wState; /// 状态
CString m_strNickName; /// 昵称
BOOL m_bCamera; /// 摄像头
BOOL m_bAutoAddFriends; /// 自动加为好友
CStringList m_strlstIP; /// 自己的IP列表
CStringList m_strlstRequest; /// 请求加为好友的IP列表
CStringList m_strlstKeepConnent;
/// 保持连接的IP列表
CStringList m_strlstChatRoomRequest;
/// 请求加入聊天室的IP列表
CListeningSocket *m_pLisSocket; /// 监听socket
CArray< USER, USER > m_arrFriends; /// 好友列表
CChatRoomServerDlg m_dlgCRServer; /// 聊天室服务器
CArray< CChatRoomClientDlg *, CChatRoomClientDlg * >
m_arrCRClient; /// 聊天室的客户端列表
CArray< CChatDlg *, CChatDlg *>
m_arrChatDlg; /// 聊天对话框的列表
CMapStringToPtr m_mapIPToData; /// 聊天ip到数据的map
CMapStringToString m_mapIPToTime; /// 聊天ip到时间的map
CMapStringToOb m_mapIPToChat; /// 聊天IP到聊天(时间和内容)的map
CMapStringToString m_mapSendChatMessage;
/// 发送聊天消息的map
CArray< int, int > m_arrMessageArrive; /// 保存有消息到达的用户序号
CImageList m_imageListMA; /// 保存有消息到达的用户头像
int m_nTrayShowIndex; /// 托盘显示的序号
CSendFilesServerDlg m_dlgSendFilesServer;
/// 发送文件服务器对话框
CSendFilesClientDlg m_dlgSendFilesClient;
/// 发送文件服务器对话框
CShareScreenServerDlg m_dlgSSServer; /// 共享屏幕服务器对话框
CShareScreenClientDlg m_dlgSSClient; /// 共享屏幕客户端对话框
CStringList m_strlstShareScreenRequest;
/// 请求加入共享屏幕的IP列表
CWhiteBoardServerDlg m_dlgWhiteBoardServer;
/// 白板服务器对话框
CStringList m_strlstWhiteBoardRequest;
/// 请求加入白板的IP列表
CWhiteBoardClientDlg m_dlgWhiteBoardClient;
/// 白板客户端对话框
CArray< CVideoChatDlg *, CVideoChatDlg *>
m_arrVideoChatDlg; /// 视频聊天对话框的列表
BOOL m_bConnectCamera; /// 连接上视频
CStringList m_strlstVideoChatRequest;
/// 请求视频聊天的IP列表
int m_nMaxUDPDG; /// UDP包支持的最大数据值
HWAVEIN m_hWaveIn;
PWAVEHDR m_pWaveHdr1;
PWAVEHDR m_pWaveHdr2;
char *m_pBuffer1;
char *m_pBuffer2;
WAVEFORMATEX m_WaveForm;
DWORD m_dwTickTime; /// 记录开始录音的时刻
CVideoChatListenSocket *m_pVideoChatListenSocket;
/// 视频聊天的监听socket
public:
CSocket m_pSocket; /// 添加网段用户的socket
HWND m_hWndVideo; /// 视频的窗口句柄
private:
/// 初始化程序
void Init();
/// 鼠标在托盘区的消息响应函数
LRESULT OnShellNotifyProc( WPARAM wParam, LPARAM lParam );
/// 热键响应函数
LRESULT OnHotkey( WPARAM wParam, LPARAM lParam );
void SetState();
void SendOffLineMessage();
void AddRequest( const USER user );
void AddFriend( const USER user );
void DeleteFriend( const USER user );
void KeepConnect( CString strIP );
/// 响应加入聊天室的请求
void OnAddToChatRoomRequest( const USER userServer );
/// 向指定IP、PORT发送指定用户和数据
void SendUserCommandToIP( CONTROLCOMMAND command, LPCSTR szIP, UINT nPort, const USER *pUser );
/// 为接收聊天消息作准备
void PrepareChatMessage( LPCSTR szReceive, LPCSTR szIP );
/// 接收聊天消息
void ReceiveChatMessage( LPCSTR szReceive, LPCSTR szIP );
/// 从历史记录中删除指定记录
void DeleteHistory( int nIndex, const CString strHistory );
/// 开始发送数据
void SendChatMessage( LPCSTR szReceive, LPCSTR szIP );
/// 把指定ip的用户的头像加入到托盘动态显示
void AddTrayIcon( LPCSTR szIP );
/// 回应是否接收传输的文件
void SendFilesResponse( LPCSTR szReceive, LPCSTR szIP );
/// 响应加入共享屏幕的请求
void OnAddToShareScreenRequest( const USER userServer );
/// 响应加入白板的请求
void OnAddToWhiteBoardRequest( const USER userServer );
/// 响应视频聊天请求
void OnAddToVideoChatRequest( const USER user );
/// user拒绝视频
void DenyAddToVideoChatRequest( const USER user );
/// 允许加入视频聊天
void AllowAddToVideoChatRequest( const USER user );
/// user断开视频连接
void UserDisconnectFromVideoChat( const USER user );
public:
WORD GetFace(){ return m_wFace; }
CString GetNickName(){ return m_strNickName; }
BOOL HasCamera(){ return m_bCamera; }
WORD GetVirtualKeyCode(){ return m_wVirtualKeyCode; }
WORD GetModifiers(){ return m_wModifiers; }
BOOL GetAutoAddFriends(){ return m_bAutoAddFriends; }
int GetMaxUDPDG(){ return m_nMaxUDPDG; }
void SetFace( WORD wFace );
void SetNickName( const CString strNickName );
void SetHotKey( WORD wVirtualKeyCode, WORD wModifiers );
void SetAutoAddFriends( BOOL bAutoAddFriends );
void SetMaxUDPDG( int nMaxUDPDG ){ m_nMaxUDPDG = nMaxUDPDG; }
void OnListeningReceive();
void DeleteFriend( int nIndex );
void GetFriendsArray( CArray< USER, USER > &arrFriends ){ arrFriends.Copy( m_arrFriends ); }
void SendFriendMessage( const USER user, CONTROLCOMMAND command );
/// 从列表中删除聊天室客户端
void DelCRClientFromList( LPCSTR szIP );
/// 和第nIndex个好友聊天
void OnChat( UINT nIndex );
/// 关闭聊天窗口
void OnCloseChatDlg( LPCSTR szIP );
/// 发送聊天消息
void SendPreChatMessage( const USER userChat, CString strTime, CString strSend );
/// 向指定IP用户发送传送文件的通知
void SendFilesNotify( LPCSTR szIP, CString strFile, DWORD dwLength );
/// 拒绝接收文件
void DenyReceiveFile( CString strFilePath, LPCSTR szIP );
/// 由IP得到USER
void GetUserFromIP( LPCSTR szIP, USER &user );
/// 得到自己IP列表框的IP
CString GetComboBoxIP();
/// 和第nIndex个好友视频聊天
void OnVideoChat( UINT nIndex );
/// 得到打开的视频聊在对话框列表
void GetVideoChatDlgArray( CArray< CVideoChatDlg *, CVideoChatDlg *> &arrVideoChatDlg ){ arrVideoChatDlg.Copy( m_arrVideoChatDlg ); }
/// 关闭视频聊天窗口
void CloseVideoChatDlg( const USER user );
/// 视频聊天时更新画面
void UpdateVideoPicture( DWORD dwTickCount,
const BITMAPINFO bmpInfo,
unsigned char *pData,
DWORD dwBufferSize );
/// 接受视频聊天的socket
void OnAcceptVideoChat();
// Generated message map functions
//{{AFX_MSG(CInstantMessagingDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnOk();
virtual void OnCancel();
afx_msg void OnDestroy();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnExit();
afx_msg void OnSetting();
afx_msg void OnSelchangeComboState();
afx_msg void OnState();
afx_msg void OnBtnAddfriend();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnBtnChatroom();
afx_msg void OnChatroom();
afx_msg void OnBtnSendfiles();
afx_msg void OnSendfiles();
afx_msg void OnReceivefiles();
afx_msg void OnAddSection();
afx_msg void OnBtnSharescreen();
afx_msg void OnSharescreen();
afx_msg void OnBtnWhiteboard();
afx_msg void OnWhiteboard();
afx_msg LRESULT WaveInOpen( WPARAM wParam, LPARAM lParam ) ;
afx_msg LRESULT WaveInData( WPARAM wParam, LPARAM lParam ) ;
afx_msg LRESULT WaveInClose( WPARAM wParam, LPARAM lParam ) ;
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_INSTANTMESSAGINGDLG_H__7D41D06C_C73A_4AE1_9284_440FC1479084__INCLUDED_)
| [
"1369212327@qq.com"
] | 1369212327@qq.com |
fe6353ff743799cdd644a9c1cc6f39cbb5e0fbbe | 3326db8648ecd23fabebbdece3a0db662b409664 | /Codeforces/Educational Round 49/A.cpp | 906f0790418872d43d80038d480cb14e4b4c5038 | [] | no_license | fazlerahmanejazi/Competitive-Programming | 96b9e934a72a978a9cae69ae50dd02ee84b6ca87 | 796021cdc7196d84976ee7c9e565c9e7feefce09 | refs/heads/master | 2021-11-10T08:23:31.128762 | 2019-12-24T22:11:12 | 2019-12-24T22:11:12 | 117,171,389 | 3 | 1 | null | 2021-10-30T20:31:10 | 2018-01-12T00:39:16 | C++ | UTF-8 | C++ | false | false | 976 | cpp | #include <bits/stdc++.h>
using namespace std ;
#define inf 0x3f3f3f3f
#define INF 1000111000111000111LL
#define mod 1000000007
#define pi acos(-1.0)
#define eps 1e-8
#define endl '\n'
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define fi first
#define se second
#define all(cc) (cc).begin(),(cc).end()
using lli = long long int ;
using pii = pair<int, int> ;
using vi = vector<int> ;
using vb = vector<bool> ;
using vvi = vector<vector<int>> ;
using vlli = vector<long long int> ;
using vpii = vector<pair<int, int>> ;
int main()
{
ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;
int T ;
cin>> T ;
while(T--)
{
int n, x ;
string s ;
bool pos=true ;
cin>> n >> s ;
for(int i=0 ; i<n ; i++) if(abs(s[i]-s[n-i-1])!=2 && abs(s[i]-s[n-i-1])) pos=false ;
if(pos) cout<< "YES" << endl ;
else cout<< "NO" << endl ;
}
}
| [
"ahmed.belal98@gmail.com"
] | ahmed.belal98@gmail.com |
672b3aea545f807138cbafb94d0205c016eab6a1 | 444a6f3fb2c9d9dc042ffd54838bc3dc172ec531 | /src/include/units/physical/si/electric_charge.h | 1bdc153b26fcef4ffd43530d72c625c06a2cfbe8 | [
"MIT"
] | permissive | rtobar/units | ef5a86bdb73c896eac92698d9a8386e11c6dfe48 | 5dd9eaac87a50adc62b170987ebac2d1344d63c5 | refs/heads/master | 2022-09-11T17:37:57.868428 | 2020-05-24T20:49:53 | 2020-05-24T20:49:53 | 266,679,421 | 1 | 0 | MIT | 2020-05-25T04:03:18 | 2020-05-25T04:03:18 | null | UTF-8 | C++ | false | false | 1,913 | h | // The MIT License (MIT)
//
// Copyright (c) 2018 Mateusz Pusz
//
// 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.
#pragma once
#include <units/physical/dimensions.h>
#include <units/physical/si/current.h>
#include <units/physical/si/time.h>
#include <units/quantity.h>
namespace units::physical::si {
struct coulomb : named_unit<coulomb, "C", prefix> {};
struct dim_electric_charge : physical::dim_electric_charge<dim_electric_charge, coulomb, dim_time, dim_electric_current> {};
template<Unit U, Scalar Rep = double>
using electric_charge = quantity<dim_electric_charge, U, Rep>;
inline namespace literals {
// C
constexpr auto operator"" q_C(unsigned long long l) { return electric_charge<coulomb, std::int64_t>(l); }
constexpr auto operator"" q_C(long double l) { return electric_charge<coulomb, long double>(l); }
} // namespace literals
} // namespace units::physical::si
| [
"mateusz.pusz@gmail.com"
] | mateusz.pusz@gmail.com |
5b20e8122fad1449a590077b796fe76ce3aa6b28 | d3f69957671777e6a8b2b12e87c80a85068109c5 | /sfz/sfz.cpp | 70c21fad999e002f1e71403fc66b450cdb6a55c1 | [] | no_license | lilslsls/sfz | 0e1afa246d88ae78b90f153d8d4b10f62e36151e | 2012d5a6146fc82dad586e8b68674d3370e9eb70 | refs/heads/master | 2021-01-24T18:06:26.916234 | 2017-03-08T05:40:33 | 2017-03-08T05:40:33 | 84,396,277 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 9,992 | cpp |
//--------------------------------------【程序说明】------------------------------------------ -
//程序说明:《OpenCV3编程入门》OpenC3版书本配套示例程序70
//程序描述:查找并绘制轮廓综合示例
//开发测试所用操作系统: Windows 7 64bit
//开发测试所用IDE版本:Visual Studio 2010
//开发测试所用OpenCV版本: 3.0 beta
//2014年11月 Created by @浅墨_毛星云
//2014年12月 Revised by @浅墨_毛星云
//------------------------------------------------------------------------------------------------
//
//-------------------------------- - 【头文件、命名空间包含部分】----------------------------
//描述:包含程序所使用的头文件和命名空间
//------------------------------------------------------------------------------------------------
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
using namespace cv;
using namespace std;
void OstuBeresenThreshold(const Mat &in, Mat &out);
bool isEligible(const RotatedRect &candidate);
//---------------------------------- - 【宏定义部分】--------------------------------------------
//描述:定义一些辅助宏
//------------------------------------------------------------------------------------------------
//#include<opencvcv.h>
#include<opencv/highgui.h>
#include<opencv/cxcore.h>
/*#include iostream */
#include <stdio.h >
#include<opencv2/imgproc/imgproc.hpp>
#include<opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int getColSum(Mat src, int col)
{
int sum = 0;
int height = src.rows;
int width = src.cols;
for (int i = 0; i< height; i++)
{
sum = sum + src.at <uchar>(i, col);
}
return sum;
}
int getRowSum(Mat src, int row)
{
int sum = 0;
int height = src.rows;
int width = src.cols;
for (int i = 0; i< width; i++)
{
sum += src.at <uchar>(row, i);
}
return sum;
}
void cutTop(Mat& src, Mat& dstImg)//上下切割
{
int top, bottom;
top = 0;
bottom = src.rows;
int i;
for (i = 0; i< src.rows; i++)
{
int colValue = getRowSum(src, i);
//cout i th colValue endl;
if (colValue>0)
{
top = i;
break;
}
}
for (; i <src.rows; i++)
{
int colValue = getRowSum(src, i);
//cout i th colValue endl;
if (colValue == 0)
{
bottom = i;
break;
}
}
int height = bottom - top;
Rect rect(0, top, src.cols, height);
dstImg = src(rect).clone();
}
int cutLeft(Mat& src, Mat& leftImg, Mat& rightImg)//左右切割
{
int left, right;
left = 0;
right = src.cols;
int colValue = 0;
int i;
for (i = 0; i< src.cols; i++)
{
colValue = getColSum(src, i);
//cout i th colValue endl;
if (colValue>0)
{
left = i;
break;
}
}
if (left == 0 && colValue == 0)
{
return 1;
}
for (; i< src.cols; i++)
{
int colValue = getColSum(src, i);
//cout i th colValue endl;
if (colValue == 0)
{
right = i;
break;
}
}
int width = right - left;
Rect rect(left, 0, width, src.rows);
leftImg = src(rect).clone();
Rect rectRight(right, 0, src.cols - right, src.rows);
rightImg = src(rectRight).clone();
cutTop(leftImg, leftImg);
return 0;
}
void getPXSum(Mat &src, int &a)//获取所有像素点和
{
threshold(src, src, 100, 255, CV_THRESH_BINARY_INV);
a = 0;
for (int i = 0; i< src.rows; i++)
{
for (int j = 0; j< src.cols; j++)
{
a += src.at <uchar>(i, j);
}
}
}
int getSubtract(Mat &src, int TemplateNum) //两张图片相减
{
Mat img_result(32, 48, CV_8UC3);
int min = 1000000;
int serieNum = 0;
for (int i = 0; i< TemplateNum; i++)
{
char name[20];
sprintf_s(name, "CUserssDesktop5%d.jpg", i);
char name[100];
char windowname[100];
sprintf(name, "CUserssDesktop2%d.jpg", i);
cout<< name <<endl;
Mat Template = imread(name, CV_LOAD_IMAGE_GRAYSCALE);
threshold(Template, Template, 100, 255, CV_THRESH_BINARY);
threshold(src, src, 100, 255, CV_THRESH_BINARY);
resize(src, src, Size(32, 48), 0, 0, CV_INTER_LINEAR);
resize(Template, Template, Size(32, 48), 0, 0, CV_INTER_LINEAR);
imshow(src, src);
imshow(temp, Template);
cout<< src.size() << src.type() << endl;
cout << Template.size() << Template.type() << endl;
imshow(name, Template);
absdiff(Template, src, img_result);
imshow(diff, img_result);
waitKey();
int diff = 0;
getPXSum(img_result, diff);
if (diff< min)
{
min = diff;
serieNum = i;
}
int xxxx = 0;
}
printf("最小距离是%d", min);
printf("匹配到第%d个模板匹配的数字是%dn", serieNum, serieNum);
return serieNum;
}
int main()
{
Mat threshold_R = imread("D://身份证8.jpg", CV_LOAD_IMAGE_GRAYSCALE);
resize(threshold_R, threshold_R, Size(1200, 700), 0, 0, CV_INTER_LINEAR);
int blockSize = 25;
int constValue = 10;
Mat img_gray;
adaptiveThreshold(threshold_R, img_gray, 255, CV_ADAPTIVE_THRESH_MEAN_C, CV_THRESH_BINARY_INV, blockSize, constValue);
Mat threshold = Matzeros(threshold_R.rows, threshold_R.cols, CV_8UC3);
OstuBeresenThreshold(threshold_R, threshold); //二值化
threshold_R = threshold_R 119;
imshow("二值化", img_gray);
medianBlur(img_gray, img_gray, 15);
namedWindow("中值滤波", WINDOW_NORMAL);
imshow("中值滤波", img_gray);
Mat imgInv(cvScalar(255));
Mat threshold_Inv = imgInv - img_gray; //黑白色反转,即背景为黑色
namedWindow("背景反转", WINDOW_NORMAL);
imshow("背景反转", threshold_Inv);
Mat threshold_Inv;
Mat element = getStructuringElement(MORPH_RECT, Size(70, 50)); //闭形态学的结构元素
morphologyEx(img_gray, threshold_Inv, CV_MOP_CLOSE, element);
namedWindow("闭", WINDOW_NORMAL);
imshow("闭", threshold_Inv);
imwrite("E计算机视觉源码 身份证识别Id_recognition", threshold_Inv);
waitKey(0);
vector vector Point contours;
cout <<contours.size() << endl;
vectorVec4i hierarchy;
findContours(threshold_Inv, contours, hierarchy, RETR_EXTERNAL, CHAIN_APPROX_SIMPLE); //只检测外轮廓对候选的轮廓进行进一步筛选
int index = 0;
cout << contours.size() << endl;
for (; index = 0; index = hierarchy[index][0])
{
Scalar color(rand() & 255, rand() & 255, rand() & 255);
//此句代码的OpenCV2版为:
//drawContours(dstImage, contours, index, color, CV_FILLED, 8, hierarchy);
//此句代码的OpenCV3版为:
drawContours(threshold, contours, index, color, FILLED, 8, hierarchy);
}
//【7】显示最后的轮廓图
imshow("轮廓图", threshold);
waitKey(0);
vector vector Point iterator itc = contours.begin();
RotatedRect mr = minAreaRect(Mat(itc));
vector RotatedRect rects;
while (itc != contours.end())
{
RotatedRect mr = minAreaRect(Mat(itc)); //返回每个轮廓的最小有界矩形区域
if (!isEligible(mr)) //判断矩形轮廓是否符合要求
{
itc = contours.erase(itc);
}
else
{
rects.push_back(mr);
++itc;
}
}
//测试是否找到了号码区域
cout << rects.size() << endl;
Point2f vertices[4];
rects[0].points(vertices);
for (int i = 0; i 4; i++)
line(threshold_R, vertices[i], vertices[(i + 1) % 4], Scalar(0, 0, 0)); //画黑色线条
namedWindow("背景反转", WINDOW_NORMAL);
imshow("背景反转", threshold_R);
waitKey(0);
Rect brect = rects[0].boundingRect();
Mat src = threshold_R(brect);
imshow("Test_Rplane", src);
imwrite("CUserssDesktop身份证号1.jpg", src);
int blockSize1 = 25;
int constValue1 = 10;
Mat img_gray1;
adaptiveThreshold(src, img_gray1, 255, CV_ADAPTIVE_THRESH_MEAN_C, CV_THRESH_BINARY_INV, blockSize1, constValue1);
imshow("二值化", img_gray1);
Mat out;
medianBlur(img_gray, out, 15);
medianBlur(img_gray1, out, 11);
medianBlur(out, out, 5);
imshow("中值滤波3", out);
Mat leftImg, rightImg;
int res = cutLeft(out, leftImg, rightImg);
int i = 0;
cout res;
while (res == 0)
{
char nameLeft[10];
sprintf(nameLeft, %d, i);
char nameRight[10];
sprintf(nameRight, %dRight, i);
i++;
imshow(nameLeft, leftImg);
stringstream ss;
ss nameLeft;
imwrite("CUserssDesktop7 + ss.str() + .jpg", leftImg);
ss nameLeft;
Mat srcTmp = rightImg;
getSubtract(leftImg, 10);
res = cutLeft(srcTmp, leftImg, rightImg);
}
waitKey(0);
return 0;
}
bool isEligible(const RotatedRect &candidate)
{
float error = 0.5;
const float aspect = 4.5 0.3; //长宽比
int min = 10 aspect 100; //最小区域
int max = 50 aspect 50; //最大区域
float rmin = aspect - aspecterror; //考虑误差后的最小长宽比
float rmax = aspect + aspecterror; //考虑误差后的最大长宽比
int area = candidate.size.height candidate.size.width;
float r = (float)candidate.size.width(float)candidate.size.height;
if (r 1)
r = 1 r;
if ((area min area max) (r rmin r rmax)) //满足该条件才认为该candidate为车牌区域
return false;
else
return true;
}
void OstuBeresenThreshold(const Mat &in, Mat &out) //输入为单通道
{
double ostu_T = threshold(in, out, 0, 255, CV_THRESH_OTSU); //otsu获得全局阈值
double min;
double max;
minMaxIdx(in, &min, &max);
const double CI = 0.12;
double beta = CI(max - min + 1) 128;
double beta_lowT = (1 - beta)ostu_T;
double beta_highT = (1 + beta)ostu_T;
Mat doubleMatIn;
in.copyTo(doubleMatIn);
int rows = doubleMatIn.rows;
int cols = doubleMatIn.cols;
double Tbn;
for (int i = 0; i <rows; ++i)
{
//获取第 i行首像素指针
uchar p = doubleMatIn.ptruchar(i);
uchar outPtr = out.ptruchar(i);
//对第i 行的每个像素(byte)操作
for (int j = 0; j< cols; ++j)
{
if (i 2 irows - 3 j2 jrows - 3)
{
if (p[j] = beta_lowT)
outPtr[j] = 0;
else
outPtr[j] = 255;
}
else
{
Tbn = sum(doubleMatIn(Rect(i - 2, j - 2, 5, 5)))[0] 25; // 窗口大小2525
if (p[j] beta_lowT(p[j] Tbn && (beta_lowT = p[j] && p[j] = beta_highT)))
outPtr[j] = 0;
if (p[j] beta_highT(p[j] = Tbn && (beta_lowT = p[j] && p[j] = beta_highT)))
outPtr[j] = 255;
}
}
}
} | [
"李爽@DESKTOP-R1CM8GA"
] | 李爽@DESKTOP-R1CM8GA |
4aca26ae8468dc3f191cf9ea0d1ab3e426166e0c | 5e3e50634c2cac6f85ff4f8c9ae385a62d2886d0 | /white/equation/main.cpp | b47578e60797c0fef547b404c75f2b6c5a84abb3 | [] | no_license | asek-ll/cpp-belt | 642ffe84c932c6684a5e355eacac68f580351a44 | 86d010c1421ab093d56e3c7a688181d883401662 | refs/heads/master | 2023-04-07T18:36:13.330862 | 2023-04-03T19:49:18 | 2023-04-03T19:49:18 | 205,446,333 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 502 | cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
double a, b, c;
cin >> a >> b >> c;
if (a == 0.0) {
if (b != 0.0) {
cout << -c/b;
}
} else {
double d = b*b - 4 * a * c;
if (d == 0.0) {
cout << (-b / (2 * a));
} if (d > 0) {
double sqrtd = sqrt(d);
cout << ((-b - sqrtd) / (2 * a)) << ' ' << ((-b + sqrtd) / (2 * a));
}
}
cout << endl;
return 0;
}
| [
"sopplet@gmail.com"
] | sopplet@gmail.com |
2da06283e4a66d38bc3e37bd49a43ef923b642ce | dd6147bf9433298a64bbceb7fdccaa4cc477fba6 | /8304/Butko_Artem/lab6/SOURCE/Game/GameField/Field/Field.cpp | a545d111977075529f275ae55c9016314d1b5cfa | [] | no_license | moevm/oop | 64a89677879341a3e8e91ba6d719ab598dcabb49 | faffa7e14003b13c658ccf8853d6189b51ee30e6 | refs/heads/master | 2023-03-16T15:48:35.226647 | 2020-06-08T16:16:31 | 2020-06-08T16:16:31 | 85,785,460 | 42 | 304 | null | 2023-03-06T23:46:08 | 2017-03-22T04:37:01 | C++ | UTF-8 | C++ | false | false | 16,198 | cpp | //
// Created by Artem Butko on 14/05/2020.
//
#include "Field.h"
Field::Field(int height, int width, int numberOfPlayers)
{
this->height = height;
this->width = width;
this->objCount = 0;
this->objLimit = width * height;
this->numberOfPlayers = numberOfPlayers;
basesOnField.resize(numberOfPlayers);
for (int i = 0; i != numberOfPlayers; ++i) basesOnField[numberOfPlayers] = nullptr;
this->logging = new LoggingProxy;
int land;
int neutral;
std::srand(unsigned(std::time(nullptr)));
field = new Tale*[height];
for (int i = 0; i < height; ++i)
field[i] = new Tale[width];
for (int i = 0; i < height; ++i)
for (int j = 0; j < width; ++j)
{
land = rand() % 4;
if (land == 0) field[i][j].landscape = landscapeFactory.getForest();
else if (land == 1) field[i][j].landscape = landscapeFactory.getMountain();
else if (land == 2) field[i][j].landscape = landscapeFactory.getWater();
else field[i][j].landscape = nullptr;
neutral = rand() % 16;
if (neutral == 0) field[i][j].neutral = neutralFactory.createTrap();
else if (neutral == 1) field[i][j].neutral = neutralFactory.createAidKit();
else if (neutral == 2) field[i][j].neutral = neutralFactory.createCurse();
else if (neutral == 3) field[i][j].neutral = neutralFactory.createPotion();
else field[i][j].neutral = nullptr;
field[i][j].object = nullptr;
field[i][j].x = i;
field[i][j].y = j;
field[i][j].isBrightView = false;
field[i][j].isDarkView = false;
field[i][j].isUndeadView = false;
}
}
Field::Field(const Field &other)
{
height = other.height;
width = other.width;
objLimit = other.objLimit;
objCount = other.objCount;
field = new Tale*[height];
for (int i = 0; i < height; ++i)
field[i] = new Tale[width];
for (int i = 0; i < height; ++i)
for (int j = 0; j < width; ++j)
field[i][j] = other.field[i][j];
}
Field::Field(Field&& other)
{
height = other.height;
width = other.width;
objLimit = other.objLimit;
objCount = other.objCount;
field = new Tale*[height];
for (int i = 0; i < height; ++i)
field[i] = new Tale[width];
for (int i = 0; i < height; ++i)
for (int j = 0; j < width; ++j)
field[i][j] = other.field[i][j];
for (int i = 0; i < other.height; ++i)
delete[] other.field[i];
delete[] other.field;
}
Field& Field::operator=(const Field& other)
{
this->height = other.height;
this->width = other.width;
this->base = other.base;
this->field = new Tale*[height];
for (int i = 0; i < height; ++i)
{
field[i] = new Tale[width];
for (int j = 0; j < width; ++j)
field[i][j] = other.field[i][j];
}
return *this;
};
int Field::addObject(Object *object, int x, int y)
{
if (objCount > objLimit)
{
std::cout << "ERROR: limit of objects on the field is exceeded!" << std::endl;
return 1;
}
if (field[x][y].object != nullptr)
{
std::cout << "ERROR: this tale is not empty!" << std::endl;
return 1;
}
field[x][y].object = object;
field[x][y].x = x;
field[x][y].y = y;
field[x][y].object->x = x;
field[x][y].object->y = y;
std::cout << field[x][y].object->baseID << std::endl;
logging->loggingGetUnit(field[x][y].object, x, y);
objCount++;
return 0;
}
int Field::moveObject(int x, int y, int i, int j)
{
/*TODO выход за границы поля*/
if (field[x][y].object != nullptr && field[i][j].object == nullptr && field[x][y].object->id != 'B')
{
if (field[x][y].object->id == 'M' || field[x][y].object->id == 'W' || field[x][y].object->id == 'K' || field[x][y].object->id == 'S' || field[x][y].object->id == 'A' || field[x][y].object->id == 'C')
{
if (field[i][j].neutral != nullptr)
{
field[i][j].neutral->action->impact(field[x][y].object);
std::cout << "UNIT on neutral object " << field[i][j].neutral->id << "!" << std::endl;
field[x][y].object->getInformation();
field[i][j].neutral = nullptr;
}
if (field[i][j].landscape != nullptr)
{
std::cout << "UNIT on landscape " << field[i][j].landscape->getID() << "!" << std::endl;
field[i][j].landscape->getEffect(field[x][y].object);
field[x][y].object->getInformation();
}
logging->loggingMoveUnit(field[x][y].object, x, y, i, j);
}
field[i][j].object = field[x][y].object;
field[x][y].object = nullptr;
if (field[i][j].object->health.get() < 0)
{
std::cout << field[i][j].object->id << " is dead!" << std::endl;
field[i][j].object->death();
this->deleteObject(i, j);
}
}
else
{
std::cout << "ERROR: impossible to move!" << std::endl;
return 1;
}
return 0;
}
int Field::deleteObject(int x, int y)
{
if (field[x][y].object != nullptr)
{
field[x][y].object = nullptr;
objCount --;
}
else
{
std::cout << "ERROR: impossible to delete!" << std::endl;
return 1;
}
return 0;
}
void Field::show(char side)
{
std::cout << "[\\]";
for (int i = 0; i < width; ++i)
std::cout << "[" << i << "]";
std::cout << "--Y" << std::endl;
for (int i = 0; i < height; ++i)
{
std::cout << "[" << i << "]";
for (int j = 0; j < width; ++j)
{
bool isNeutral = (field[i][j].neutral != nullptr);
bool isObject = (field[i][j].object != nullptr);
bool isLandscape = (field[i][j].landscape != nullptr);
if (side == 'M')
{
if (isNeutral) std::cout << "[" << field[i][j].neutral->id << "]";
else if (isObject && (field[i][j].object->id == 'B' || field[i][j].object->id == 'D'|| field[i][j].object->id == 'U')) std::cout << "{" << field[i][j].object->id << "}";
else std::cout << "[ ]";
if (isObject && (field[i][j].object->id == 'B' || field[i][j].object->id == 'D'|| field[i][j].object->id == 'U'))
{
field[i][j].isBrightView = true;
field[i][j].isUndeadView = true;
field[i][j].isDarkView = true;
}
}
else if (side == 'B')
{
bool isVision = field[i][j].isBrightView;
if (!isVision) std::cout << "( )";
else if (isObject && (field[i][j].object->id == 'B' || field[i][j].object->id == 'D'|| field[i][j].object->id == 'U')) std::cout << "{" << field[i][j].object->id << "}";
else if (isLandscape && isObject && field[i][j].object != nullptr) std::cout << field[i][j].landscape->getID() << field[i][j].object->id << field[i][j].landscape->getID();
else if (!isLandscape && isObject && field[i][j].object != nullptr) std::cout << "[" << field[i][j].object->id << "]";
else if (isLandscape && isNeutral) std::cout << field[i][j].landscape->getID() << field[i][j].neutral->id << field[i][j].landscape->getID();
else if (!isLandscape && isNeutral) std::cout << "[" << field[i][j].neutral->id << "]";
else if (isLandscape) std::cout << field[i][j].landscape->getID() << " " << field[i][j].landscape->getID();
else std::cout << "[ ]";
}
else if (side == 'D')
{
bool isVision = field[i][j].isDarkView;
if (!isVision) std::cout << "( )";
else if (isObject && (field[i][j].object->id == 'B' || field[i][j].object->id == 'D'|| field[i][j].object->id == 'U')) std::cout << "{" << field[i][j].object->id << "}";
else if (isLandscape && isObject && field[i][j].object != nullptr) std::cout << field[i][j].landscape->getID() << field[i][j].object->id << field[i][j].landscape->getID();
else if (!isLandscape && isObject && field[i][j].object != nullptr) std::cout << "[" << field[i][j].object->id << "]";
else if (isLandscape && isNeutral) std::cout << field[i][j].landscape->getID() << field[i][j].neutral->id << field[i][j].landscape->getID();
else if (!isLandscape && isNeutral) std::cout << "[" << field[i][j].neutral->id << "]";
else if (isLandscape) std::cout << field[i][j].landscape->getID() << " " << field[i][j].landscape->getID();
else std::cout << "[ ]";
}
else if (side == 'U')
{
bool isVision = field[i][j].isUndeadView;
if (!isVision) std::cout << "( )";
else if (isObject && (field[i][j].object->id == 'B' || field[i][j].object->id == 'D'|| field[i][j].object->id == 'U')) std::cout << "{" << field[i][j].object->id << "}";
else if (isLandscape && isObject) std::cout << field[i][j].landscape->getID() << field[i][j].object->id << field[i][j].landscape->getID();
else if (!isLandscape && isObject) std::cout << "[" << field[i][j].object->id << "]";
else if (isLandscape && isNeutral) std::cout << field[i][j].landscape->getID() << field[i][j].neutral->id << field[i][j].landscape->getID();
else if (!isLandscape && isNeutral) std::cout << "[" << field[i][j].neutral->id << "]";
else if (isLandscape) std::cout << field[i][j].landscape->getID() << " " << field[i][j].landscape->getID();
else std::cout << "[ ]";
}
}
std::cout << std::endl;
}
std::cout << "| "<< std::endl;
std::cout << "X" << std::endl;
}
Field::~Field()
{
for (int i = 0; i < height; ++i) delete[] field[i];
delete[] field;
}
FieldIterator *Field::iterator()
{
return (new FieldIterator(*this));
}
FieldIterator *Field::end()
{
auto* end = new FieldIterator(*this);
end->end();
return end;
}
FieldIterator* Field::begin()
{
auto* begin = new FieldIterator(*this);
begin->begin();
return begin;
}
int Field::createBase(int x, int y, int unitLimit, char id, int number)
{
if (x + 1 < height && y + 1 < width && x >= 0 && y >= 0)
{
if (field[x][y].object == nullptr && field[x + 1][y + 1].object == nullptr && field[x][y + 1].object == nullptr && field[x + 1][y].object == nullptr)
{
basesOnField[number] = new Base(this, x, y, unitLimit);
basesOnField[number]->x = x;
basesOnField[number]->y = y;
basesOnField[number]->id = id;
field[x][y].object = basesOnField[number];
field[x + 1][y].object = field[x][y].object;
field[x][y + 1].object = field[x][y].object;
field[x + 1][y + 1].object = field[x][y].object;
logging->loggingCreateBase(basesOnField[number]);
field[x][y].landscape = nullptr;
field[x + 1][y].landscape = nullptr;
field[x][y + 1].landscape = nullptr;
field[x + 1][y + 1].landscape = nullptr;
field[x][y].neutral = nullptr;
field[x + 1][y].neutral = nullptr;
field[x][y + 1].neutral = nullptr;
field[x + 1][y + 1].neutral = nullptr;
if (number == 0)
{
field[x + 2][y].isBrightView = true;
field[x + 2][y + 1].isBrightView = true;
field[x + 2][y + 2].isBrightView = true;
field[x + 1][y + 2].isBrightView = true;
field[x][y + 2].isBrightView = true;
}
else if (number == 1)
{
field[x - 1][y].isDarkView = true;
field[x - 1][y + 1].isDarkView = true;
field[x - 1][y - 1].isDarkView = true;
field[x][y - 1].isDarkView = true;
field[x + 1][y - 1].isDarkView = true;
}
else if (number == 2)
{
field[x - 1][y].isUndeadView = true;
field[x - 1][y + 1].isUndeadView = true;
field[x - 1][y + 2].isUndeadView = true;
field[x][y + 2].isUndeadView = true;
field[x + 1][y + 2].isUndeadView = true;
}
}
}
return 0;
}
void Field::immediateDeath(int x, int y)
{
field[x][y].object->death();
this->deleteObject(x, y);
}
void Field::makeDamage(int x, int y, int i, int j)
{
if (field[i][j].object != nullptr && field[x][y].object != nullptr && (field[x][y].object->id == 'M' || field[x][y].object->id == 'W' || field[x][y].object->id == 'K' || field[x][y].object->id == 'S' || field[x][y].object->id == 'A' || field[x][y].object->id == 'C' ))
{
static_cast<IUnit*>(field[x][y].object)->makeDamage(static_cast<IUnit*>(field[x][y].object)->damage.getDamage(), field[i][j].object);
logging->loggingAttackUnit(field[x][y].object, x, y, i, j);
if (field[i][j].object->health.get() < 0)
{
std::cout << field[i][j].object->id << " is dead!" << std::endl;
field[i][j].object->death();
this->deleteObject(i, j);
}
else field[i][j].object->getInformation();
}
else std::cout << "ERROR: impossible to attack!" << std::endl;
}
Object *Field::getObject(int x, int y)
{
if(field[x][y].object != nullptr) return field[x][y].object;
else return nullptr;
}
Snapshot* Field::createSnapshot(std::string mode)
{
Snapshot* snap;
if (mode == "save")
{
if (base != nullptr) snap = new Snapshot(this, height, width, objLimit, objCount, base->unitLimit, base->unitCount);
snap = new Snapshot(this, height, width, objLimit, objCount, 0, 0);
}
else
{
snap = new Snapshot(this);
}
return snap;
}
void Field::getVision(char side, int x, int y)
{
if (side == 'B')
{
field[x][y].isBrightView = true;
if (x + 1 < height) field[x + 1][y].isBrightView = true;
if (x - 1 >= 0) field [x - 1][y].isBrightView = true;
if (y + 1 < width) field[x][y + 1].isBrightView = true;
if (y - 1 >= 0) field[x][y - 1].isBrightView = true;
if (x + 1 < height && y - 1 >= 0) field[x + 1][y - 1].isBrightView = true;
if (x + 1 < height && y + 1 < width) field[x + 1][y + 1].isBrightView = true;
if (x - 1 >= height && y - 1 >= 0) field[x - 1][y - 1].isBrightView = true;
if (x - 1 < height && y + 1 < width) field[x - 1][y + 1].isBrightView = true;
}
else if (side == 'D')
{
field[x][y].isDarkView = true;
if (x + 1 < height) field[x + 1][y].isDarkView = true;
if (x - 1 >= 0) field [x - 1][y].isDarkView = true;
if (y + 1 < width) field[x][y + 1].isDarkView = true;
if (y - 1 >= 0) field[x][y - 1].isDarkView = true;
if (x + 1 < height && y - 1 >= 0) field[x + 1][y - 1].isDarkView = true;
if (x + 1 < height && y + 1 < width) field[x + 1][y + 1].isDarkView = true;
if (x - 1 >= height && y - 1 >= 0) field[x - 1][y - 1].isDarkView = true;
if (x - 1 < height && y + 1 < width) field[x - 1][y + 1].isDarkView = true;
}
else
{
field[x][y].isUndeadView = true;
if (x + 1 < height) field[x + 1][y].isUndeadView = true;
if (x - 1 >= 0) field[x - 1][y].isUndeadView = true;
if (y + 1 < width) field[x][y + 1].isUndeadView = true;
if (y - 1 >= 0) field[x][y - 1].isUndeadView = true;
if (x + 1 < height && y - 1 >= 0) field[x + 1][y - 1].isUndeadView = true;
if (x + 1 < height && y + 1 < width) field[x + 1][y + 1].isUndeadView = true;
if (x - 1 >= height && y - 1 >= 0) field[x - 1][y - 1].isUndeadView = true;
if (x - 1 < height && y + 1 < width) field[x - 1][y + 1].isUndeadView = true;
}
}
| [
"artembutko2000@yandex.com"
] | artembutko2000@yandex.com |
3b089921a49480a1e3e52cfe0a9ad5b213540f2b | 4d803e91a03b7e45b46274c8ab06f21fc27b995b | /lab07/lab07.cpp | 2c1667f31b8131cd61303e50958ecd8070aacf13 | [] | no_license | faisal07m/mp | a2218916566502a251821050dcc207a5eaa4d4cd | e6f3153cabeb450d9658ea3ec9feda8f6dcf3c10 | refs/heads/master | 2020-04-08T04:21:48.864140 | 2020-02-16T22:31:47 | 2020-02-16T22:31:47 | 159,013,287 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,779 | cpp |
/* n = 3000, threads = 40 time in seconds
-------------------------------------------------------------------------------------------------------------------------------------------
Chunk | Default | 2 | 8 | 32 | 128 | Single Thread (default Chunk)
Static (Gauss TIME sec) 2.224242e+00 2.559708e+00 2.191239e+00 2.334189e+00 2.693574e+00 1.057281e+01
(back sub TIME sec) 9.880314e-02 1.174744e-01 1.055908e-01 9.576066e-02 1.027680e-01 1.470342e-02
(total TIME sec) 2.323054e+00 2.677189e+00 2.296837e+00 2.429958e+00 2.796349e+00 1.058752e+01
Dynamic (Gauss TIME sec) 2.811208e+00 2.784184e+00 2.666185e+00 2.670090e+00 3.145072e+00 1.059340e+01
(back sub TIME sec) 6.028012e-01 3.655285e-01 1.851279e-01 1.270579e-01 1.157399e-01 6.475342e-02
(total TIME sec) 3.414019e+00 3.149723e+00 2.851323e+00 2.797158e+00 3.260819e+00 1.065816e+01
Guided (Gauss TIME sec) 2.664658e+00 2.647170e+00 2.665661e+00 2.761532e+00 3.125653e+00 1.055963e+01
(back sub TIME sec) 2.839649e-01 2.652135e-01 2.122728e-01 1.625099e-01 1.227327e-01 1.480821e-02
(total TIME sec) 2.948632e+00 2.912393e+00 2.877944e+00 2.924050e+00 3.248396e+00 1.057445e+01
Clearly with 40 threads the program performed alot faster than single threaded computation. Following is the speedup calculation:-
Scheduler (total time) | Multi-Threaded(Default Chunk) Single Thread(Deafult chunk) | Multi-Threaded Speedup
Static 2.323054e+00 < 1.058752e+01 8.264466 seconds faster
Dynamic 3.414019e+00 < 1.065816e+01 7.244141 seconds faster
guided 2.948632e+00 < 1.057445e+01 7.625818 seconds faster
------------------------------------------------------------------------------------------------------------------------------------------
*/
#include <iostream>
#include <time.h>
#include<cstdlib>
#include<stdio.h>
#include <cmath>
#include<omp.h>
using namespace std;
int main(int argc , char *argv[])
{
int n= atoi(argv[1]);
int threads = omp_get_max_threads();
int chunk ; //atoi(argv[2]);
//printf("%d",threads);
//omp_set_num_threads(threads);
double time1,time2,time3,t_time_s,t_time_e;
double A[n][n+1] ;
for (int i=0; i<n; i++) {
for (int j=0; j<n; j++) {
if(i==j){
A[i][j]=(double)n/10;
}
else{
unsigned int seed = (unsigned) time(NULL);
seed= seed + j;
A[i][j]=(double)rand_r(&seed)/(RAND_MAX);
//printf("\n %lf rand",A[i][j]);
}
}
}
for (int i=0; i<n; i++) {
A[i][n]=1;
}
//printf("\n threads %d \n", omp_get_max_threads());
//elimination Ref:- https://en.wikipedia.org/wiki/Gaussian_elimination without pivot
double f=0.0;
int i=0,j=0;
t_time_s=omp_get_wtime();
time1= omp_get_wtime();
for (int k=0; k<n; k++)
{
#pragma omp parallel default(none) num_threads(threads) shared(chunk,A,n,k,f) private(i,j)
{
#pragma omp for schedule(static)
//pragma omp for schedule(dynamic,chunk)
//#pragma omp for schedule(guided,chunk)
for (i=k+1; i<n; i++)
{
f = A[i][k]/A[k][k];
//put 0 for lower triangle
A[i][k] = 0;
for (j=k+1; j<=n; j++)
A[i][j] -= A[k][j]*f;
}
}
}
time2=omp_get_wtime() - time1;
//back substitution
double x[n];
time3= omp_get_wtime();
#pragma omp parallel default(none) num_threads(threads) shared(A,n,x,chunk) private(i,j)
for (int i = n-1; i >= 0; i--)
{
#pragma omp single
x[i] = A[i][n];
#pragma omp for schedule(static)
//#pragma omp for schedule(dynamic,chunk)
//#pragma omp for schedule(guided,chunk)
for (int j=i+1; j<n; j++)
{
x[i] -= A[i][j]*x[j];
}
#pragma omp single
x[i] = x[i]/A[i][i];
}
double time4 = omp_get_wtime() - time3;
t_time_e = omp_get_wtime() - t_time_s;
double arr[n];
double max = arr[0];
for (int i=0; i<n; i++)
{
arr[i]=abs(x[i]-1);
}
for(int i = 1; i<n; i++)
{
if(arr[i] > max)
max = arr[i];
}
printf("Max error in solution %e\n",max);
printf("Time for Gaussian elim : %e seconds\n",time2);
printf("Time back sub : %e seconds\n",time4);
printf("Total Time : %e seconds\n",t_time_e);
return 0;
}
| [
"faisalm@ln-0002.cm.cluster"
] | faisalm@ln-0002.cm.cluster |
0cb062b229fe2902e6297e4832ca5cd6ebc8223e | d0fb46aecc3b69983e7f6244331a81dff42d9595 | /edas/include/alibabacloud/edas/model/ListServiceGroupsRequest.h | fd25bd1901d2f7fcf3db366d4a6659692128b2ff | [
"Apache-2.0"
] | permissive | aliyun/aliyun-openapi-cpp-sdk | 3d8d051d44ad00753a429817dd03957614c0c66a | e862bd03c844bcb7ccaa90571bceaa2802c7f135 | refs/heads/master | 2023-08-29T11:54:00.525102 | 2023-08-29T03:32:48 | 2023-08-29T03:32:48 | 115,379,460 | 104 | 82 | NOASSERTION | 2023-09-14T06:13:33 | 2017-12-26T02:53:27 | C++ | UTF-8 | C++ | false | false | 1,212 | h | /*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_EDAS_MODEL_LISTSERVICEGROUPSREQUEST_H_
#define ALIBABACLOUD_EDAS_MODEL_LISTSERVICEGROUPSREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RoaServiceRequest.h>
#include <alibabacloud/edas/EdasExport.h>
namespace AlibabaCloud
{
namespace Edas
{
namespace Model
{
class ALIBABACLOUD_EDAS_EXPORT ListServiceGroupsRequest : public RoaServiceRequest
{
public:
ListServiceGroupsRequest();
~ListServiceGroupsRequest();
private:
};
}
}
}
#endif // !ALIBABACLOUD_EDAS_MODEL_LISTSERVICEGROUPSREQUEST_H_ | [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
47ef14e6431fd96c303f2e6623a3bd47aa2d5b03 | 74ac82edc17b8b9a026d23f669bdbaf9ddb8c9a0 | /projects/lib/LC3/LC3MachineFunctionInfo.cpp | 1386241e5fe8d1fb9169ed1c614ef943b8c2cc23 | [] | no_license | FeifeiWang7/ECE566 | f53022680f315aba991748b7e15711afde971605 | 31305c20ad4fcd8fb2f528b5c12a7ef86f9072a4 | refs/heads/master | 2021-01-23T09:27:17.177952 | 2015-09-16T01:47:17 | 2015-09-16T01:47:17 | 27,697,803 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 440 | cpp | //===-- LC3MachineFunctionInfo.cpp - LC3 Machine Function Info --------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "LC3MachineFunctionInfo.h"
using namespace llvm;
void LC3MachineFunctionInfo::anchor() { }
| [
"fwang12@ncsu.edu"
] | fwang12@ncsu.edu |
33cbc75e975bd1ede1c5a115f0101891ed826b37 | 9506a40845f40f9f79e20ac87191c5b0d1ef6d7c | /contests/round655/c.cpp | cefcce5dafe3cbd246d6f1f51539eddc27613891 | [] | no_license | anish-rajan/Cp-algos | 9ab16374a154fe9598a49405d1a2b3bf10013320 | 9bcb7264769536cc4ff877a3b6d2f156fddee50a | refs/heads/master | 2022-12-14T09:44:31.960833 | 2020-09-10T12:01:14 | 2020-09-10T12:01:14 | 265,180,210 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,774 | cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define mp make_pair
#define v vector
#define inp_push(no, v) \
ll no; \
cin >> no; \
v.push_back(no);
#define pb push_back
#define fi first
#define se second
#define ALL(v) v.begin(), v.end()
#define UN(v) sort((v).begin(), (v).end()), v.erase(unique(v.begin(), v.end()), v.end())
#define N 300005
#define mod 1000000009
#define INF INT64_MAX
//////////////////////////IMPORTANT FUNCTIONS/////////////////////////////////////////////
/* Guidlines berfore submitting solution
1. Check N value before submitting
2. Check all constant kind of values you are using. Might give WA. Think
3. Check mod value
*/
v<ll> fact(N);
v<ll> prime_check(1e6 + 2);
v<ll> primes;
long long powmod(long long x, long long y, long long m)
{
long long res = 1LL;
while (y)
{
if (y & 1)
res = (res * x) % m;
x = (x * x) % m;
y /= 2;
}
return res;
}
void init_fact()
{
fact[0] = 1;
for (ll i = 1; i < N; i++)
{
fact[i] = (fact[i - 1] * i) % mod;
}
}
ll C(ll n, ll r)
{
if (n < r)
return 0;
ll temp = fact[n] * powmod(fact[r], mod - 2, mod) % mod;
temp *= powmod(fact[n - r], mod - 2, mod);
temp %= mod;
return temp;
}
void Sieve()
{
for (ll i = 2; i <= 1e6 + 1; i++)
{
if (prime_check[i])
continue;
primes.pb(i);
for (ll j = 2 * i; j <= 1e6 + 2; j += i)
prime_check[j] = i;
}
}
ll phi(ll n)
{
ll i, res = n;
for (i = 2; i * i <= n; i++)
if (n % i == 0)
{
while (n % i == 0)
n /= i;
res -= res / i;
}
if (n > 1)
res -= res / n;
return res;
}
/////////////////////////////////////START CODE HERE/////////////////////////////////////////////
ll t;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// init_fact();
// Sieve();
cin >> t;
while (t--)
{
ll n;
cin >> n;
v<ll> a(n + 1);
for (ll i = 1; i <= n; i++)
cin >> a[i];
ll maxpos = 0, eq = 0, ans = 0, neq = 0;
for (ll i = 1; i <= n; i++)
{
if (a[i] != i)
{
maxpos = max(a[i], maxpos);
neq++;
}
else
eq++, maxpos = max(maxpos, i);
if (maxpos == i)
{
if (eq > 0 && neq > 0)
ans += 2;
else if (neq > 0)
ans++;
eq = 0, neq = 0;
}
}
cout << min(2LL, ans) << "\n";
}
} | [
"anishrajan2000@gmail.com"
] | anishrajan2000@gmail.com |
80d6498db105251b6c16dbffc11e9135f25ff81c | acae90de027aff37db6edd18cdae5a602e57dd2f | /chapter7_01/calc_info.cpp | 013c6d612efefeb5419d711822045b19df698856 | [] | no_license | koo-mingi/C-chapter7- | a0f78964dcee9d18dfe7c96a72f0e6ef9d6753d9 | a44b29bbb53a8a72c31c838b5f63b912c31143a6 | refs/heads/master | 2022-09-27T08:45:46.673871 | 2020-06-05T03:39:36 | 2020-06-05T03:39:36 | 269,523,651 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 698 | cpp | #include "weightmanage.h"
void weight::calc_info(char *irum, int gender)
{
// 배열에 값을 담을려면 strcpy_s를 사용. "="는 못 씀.
// strcpy_s(배열,포인터);
strcpy_s(customer_irum, irum);
strcpy_s(customer_irum, irum);
this->gender = gender;
}
void weight::calc_stweight(int h, int w)
{
customer_height = h;
customer_weight = w;
double stdweight = 0; //적정 몸무게
//남자(1 또는 3) (키 - 100)*0.9
//여자(2 또는 4) (키 - 110)*0.9
if (gender == 1 || gender == 3) {
stdweight = (customer_height - 100) *0.9;
}
else if(gender == 2 || gender == 4){
stdweight = (customer_height - 110)*0.9;
}
customer_opt = customer_weight - stdweight;
}
| [
"ekzmfldks295@gmail.com"
] | ekzmfldks295@gmail.com |
e5c657bf9568b89e3d9fef6567b8d99098b952db | 6d241b3146ecb542bc0cc469777c2175e2a341e5 | /344A.cpp | f7eec66a7d471be3d28685f7a7acd1ae01e0c5ee | [] | no_license | jagadeeshnelaturu/codeforces_solutions | d0a84f4c6e3ce94b6c8ee48b5139e4b5352eb902 | 9e058517d86d05b4770bfa1a4b2269edf796acac | refs/heads/master | 2020-05-17T16:24:01.504974 | 2015-09-09T17:35:15 | 2015-09-09T17:35:15 | 42,130,641 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 340 | cpp | #include <iostream>
int main() {
int n;
std::cin >> n;
char left, right, rightmost = '$'; // dummy value of rightmost
int numGroups = 0;
for(int i = 0; i < n; ++i) {
std::cin >> left >> right;
if((i == 0) || (left == rightmost)) {
++numGroups;
rightmost = right;
}
}
std::cout << numGroups << '\n';
}
| [
"jagadeesh@nsl-43.cse.iitb.ac.in"
] | jagadeesh@nsl-43.cse.iitb.ac.in |
1fdf60a2b2b78e50b221564b50e78b92718126b7 | d657d42eba1a5cf80f39719859cb6944e28f0aa0 | /Exercícios Aulas Práticas Resolvidos/Exercicios Vetores Saul Delabrida/17.cpp | eebd45409570c0eba188a3e3be99658a787fae8a | [] | no_license | fonte-nele/BCC201-Introducao-Programacao | ef6b700f2caea2806d57901d9eace1fac85d29a5 | 18383ae82b49595c25add46bfa2e8fcef83afdf1 | refs/heads/master | 2020-06-08T16:17:37.457370 | 2019-06-22T17:29:53 | 2019-06-22T17:29:53 | 193,261,398 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 243 | cpp | #include <iostream>
using namespace std;
int main()
{
int i;
int v[50]; v[1]=v[0]=1;
for (i=2; i< 50; i++)
{
v[i] = v[i-1] + v[i-2];
}
cout<<"A serie de Fibonacci eh:\n";
for (i=0; i<50; i++)
{
cout << v[i] <<endl;
}
return 0;
}
| [
"felipephontinelly@hotmail.com"
] | felipephontinelly@hotmail.com |
67a969aa49492048d27fbc99bacc714227a8619c | 80d2e21257efa70c9bdb88589a9a013a82367f7c | /Fraudulent Activity Notifications.cpp | 79326013a26c09b932578bbe6820dfbed7826756 | [] | no_license | saiful130104/Hackerrank | bd7c299296642a10d85f52edd0db5f99f25149b7 | 7e4537a3df89b42586e13423e849eaed4419db0f | refs/heads/master | 2020-05-18T19:33:36.109240 | 2019-08-22T05:45:02 | 2019-08-22T05:45:02 | 184,610,884 | 0 | 1 | null | 2020-04-10T20:50:39 | 2019-05-02T16:01:10 | C++ | UTF-8 | C++ | false | false | 1,385 | cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,day;
cin>>n>>day;
int cnt[202] , ara[n+2];
memset(cnt,0,sizeof(cnt));
int sum = 0;
for(int i=1; i<=day; i++)
{
cin>>ara[i];
cnt[ara[i]]++;
}
for(int i=day+1; i<=n; i++)
{
cin>>ara[i];
if(day%2)
{
int th = day/2 + 1;
for(int j=0; j<=200; j++)
{
if(cnt[j]>=th)
{
if(j*2<=ara[i])
sum++;
break;
}
th-=cnt[j];
}
}
else
{
int th = day/2;
for(int j=0; j<=200; j++)
{
if(cnt[j]>=th)
{
if(cnt[j]>th)
{
if(j*2<=ara[i])
sum++;
}
else
{
int v = j;
while(cnt[++j]==0);
v+=j;
if(v<=ara[i])
sum++;
}
break;
}
th-=cnt[j];
}
}
cnt[ara[i-day]]--;
cnt[ara[i]]++;
}
cout<<sum<<endl;
return 0;
} | [
"isaifulislam123@yahoo.com"
] | isaifulislam123@yahoo.com |
8306a73ed42a389cfbd021e19b056d694cf76f40 | ef9448d45c18c6e7187afe54c85b0727c701819d | /src/maze/cellborder.cpp | d7d5078133ad007e6fdeae495b7bc9ffb65bdc8e | [
"MIT"
] | permissive | cleojon/mazegenerator | f398e250c8999dbd81b24aabf14e4794a3d0b562 | cb0cbfab43d7a04c22589a5fb911f671e4dae18c | refs/heads/master | 2022-12-03T10:27:57.095244 | 2020-08-18T16:47:04 | 2020-08-18T16:47:04 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,904 | cpp | #include "cellborder.h"
#include <cmath>
#include <tuple>
LineBorder::LineBorder(double x1, double y1, double x2, double y2)
: x1_(x1), y1_(y1), x2_(x2), y2_(y2) {}
LineBorder::LineBorder(std::tuple<double, double, double, double> xy) {
std::tie(x1_, y1_, x2_, y2_) = xy;
}
std::string LineBorder::GnuplotPrintString() const {
return "set arrow from " + std::to_string(x1_) + "," + std::to_string(y1_) +
" to " + std::to_string(x2_) + "," + std::to_string(y2_) +
" nohead lt -1 lw 2";
}
std::string LineBorder::SVGPrintString() const {
return "<line x1=\"" + std::to_string(x1_ * 30) + "\" x2=\"" +
std::to_string(x2_ * 30) + "\" y1=\"" + std::to_string(y1_ * 30) +
"\" y2=\"" + std::to_string(y2_ * 30) +
"\" stroke=\"black\" stroke-linecap=\"round\" stroke-width=\"3\"/>";
}
ArcBorder::ArcBorder(double cx, double cy, double r, double theta1,
double theta2)
: cx_(cx), cy_(cy), r_(r), theta1_(theta1), theta2_(theta2) {}
std::string ArcBorder::GnuplotPrintString() const {
return "set parametric; plot [" + std::to_string(theta1_) + ":" +
std::to_string(theta2_) + "] " + std::to_string(cx_) + "+cos(t)*" +
std::to_string(r_) + "," + std::to_string(cy_) + "+sin(t)*" +
std::to_string(r_) + " w l lw 2 lt -1 notitle;unset parametric";
}
std::string ArcBorder::SVGPrintString() const {
double x1 = cx_ + r_ * cos(theta1_), y1 = cy_ + r_ * sin(theta1_);
double x2 = cx_ + r_ * cos(theta2_), y2 = cy_ + r_ * sin(theta2_);
return "<path d=\"M " + std::to_string(x2 * 30) + " " +
std::to_string(y2 * 30) + " A " + std::to_string(r_ * 30) + " " +
std::to_string(r_ * 30) + ", 0, 0, 0, " + std::to_string(x1 * 30) +
" " + std::to_string(y1 * 30) +
"\" stroke=\"black\" stroke-linecap=\"round\" stroke-width=\"3\" "
"fill=\"transparent\"/>";
}
| [
"razimantv@gmail.com"
] | razimantv@gmail.com |
3492f9ffeace7cc3ccc67a09fce32a5fa7307373 | 8535f518a05f5267671cc3547048c42278e2e6af | /Vehicle.cpp | f500fa42b62b06d15f257818f337110aca1f92e8 | [] | no_license | cgprats/COP3503_Lab01 | 7163c58251958aed81d127e6573e9505571dbc7e | ccb62d9dd77a88d7f7d14067e41bb3a08186eb2e | refs/heads/master | 2022-12-15T22:40:05.952068 | 2020-03-30T22:54:13 | 2020-03-30T22:54:13 | 297,393,172 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 830 | cpp | #include "Vehicle.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
Vehicle::Vehicle() {
_make = "COP3503";
_model = "Rust Bucket";
_year = 1900;
_price = 0;
_mileage = 0;
/*this->make = _make;
this->model = _model;
this->year = _year;
this->price = _price;
this->mileage = _mileage;*/
}
Vehicle::Vehicle(string make, string model, int year, float price, int mileage) {
_make = make;
_model = model;
_year = year;
_price = price;
_mileage = mileage;
}
float Vehicle::GetPrice() {
return _price;
}
string Vehicle::GetYearMakeModel() {
string yearMakeModel = to_string(_year) + " " + _make + " " + _model;
return yearMakeModel;
}
void Vehicle::Display() {
cout << to_string(_year) << " " << _make << " " << _model << " " << to_string(_price) << " " << to_string(_mileage) << endl;
}
| [
"christopher@noreply.example.com"
] | christopher@noreply.example.com |
22dfa14883ee8f747dafc1797175a9d206f7c7eb | 21022df6d610b7dcdda8ee5d67c21bda0a7706c8 | /C++/insertion_sort.cpp | 7fa999fbafac69735e79b5796957483cfd332cd9 | [] | no_license | EdPom/practicing_algorithm | f28417b2686d052f76c9fc161837b25799980283 | c06e88c22ac2f7257b5e87844bd930456e14e0bc | refs/heads/master | 2021-01-22T05:43:10.592854 | 2012-03-03T05:32:30 | 2012-03-03T05:32:30 | 2,901,408 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 955 | cpp | // Name : Insertion Sort
// Dependency : vector
// Requirement : operator > defined for members in vvector
#include <iostream>
#include <vector>
using namespace std;
template <class T>
void insertion_sort(vector<T>& array){
if(array.size() < 2){
return;
}
for(int i = 1; i < array.size(); i++){
for(int j = i - 1; j >= 0; j--){
if(array[j] > array[j + 1]){
swap(array[j], array[j + 1]);
}else{
break;
}
}
}
}
int main(int argc, char** argv){
vector<int> vec;
for(int i = 100; i > 0; i--){
vec.push_back(i);
}
insertion_sort(vec);
int j = 1;
int k = 0;
for(vector<int>::iterator it = vec.begin(); it < vec.end(); it++){
k++;
cout << *it << " ";
if(k == j){
j *= 2;
k = 0;
cout << endl;
}
}
cout << endl;
return 0;
} | [
"shiveringpen@gmail.com"
] | shiveringpen@gmail.com |
2d0dff031a598a3f8d4b3832c7565a959911bfc9 | d29633365ed7e99dfd6413bb126a9cb5d6edd832 | /SolidSphere.h | ad799515fbda5936485255e9d35e2082ad7e136d | [] | no_license | benjaminjoo/3D-Software-Rasterizer | 440e8ff9148fc1427b9ca48de66a34096b1d19ad | a0acba3ec00ac4b4020f9fb3bd9fe54c58cda692 | refs/heads/master | 2020-07-31T15:24:20.276260 | 2020-04-13T23:16:30 | 2020-04-13T23:16:30 | 210,650,527 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 737 | h | #pragma once
#include "Definitions.h"
#include "SolidBody.h"
class SolidSphere: public SolidBody
{
float radius = 0.5f;
float radiusSquared = 0.25f;
int resol = 12;
public:
SolidSphere();
SolidSphere(float, float, float, Uint32);
SolidSphere(float, float, float, float, float, float, float, float, float, Uint32, int, float, int);
SolidSphere(float, float, float, float, float, float, float, float, float, Uint32, int, float, int, bool);
~SolidSphere();
void setRadius(float);
float getRadius();
int getTotalVert();
int getTotalPoly();
void getVertexData(vect3*);
void getTriangleData(triangle3dV*);
bool intersect(const vect3& eye_centre, const vect3& eye_direction, float& depth);
void explode();
};
| [
"benjamin.joo.sd@gmail.com"
] | benjamin.joo.sd@gmail.com |
e11e3cc9d88766e78dd7f578463636119016474b | 19e3050d541b895728d1abf2488d54a9d07862c1 | /Emu installer/SynthesisDrive/include/wpilibc/athena/include/VictorSP.h | d971fdb93b091ef139ddb6594d876c11c483d622 | [
"Apache-2.0"
] | permissive | colins8/synthesis | fd22490ce244139fb91037472d6153dc1257f7f2 | 6f1a34d583c88492f988ed664b278c466de466bf | refs/heads/master | 2020-03-17T00:43:03.302610 | 2018-05-10T03:38:21 | 2018-05-10T03:38:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 747 | h | /*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2017 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "PWMSpeedController.h"
namespace frc {
/**
* Vex Robotics Victor SP Speed Controller
*/
class VictorSP : public PWMSpeedController {
public:
explicit VictorSP(int channel);
virtual ~VictorSP() = default;
};
} // namespace frc
| [
"choquerlauren@gmail.com"
] | choquerlauren@gmail.com |
9eef43a92b711a6dda43239d37eec139e7a101bf | d19c27c64206429c3c412b2c87f5d550efbc6a9b | /src/transform/gcx/buffer.h | 4761c7968cacd96a93c07ac1d9094b9a88e540d8 | [
"BSD-3-Clause"
] | permissive | aep/asgaard-aera | 9823b6334cbccc6bc9072aa72be15d9c4061ed06 | 90b021a1ba65d80f19af1689e7c724631cf05ae9 | refs/heads/master | 2021-01-21T08:01:13.494678 | 2012-05-19T14:59:54 | 2012-05-19T14:59:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,662 | h | /*
| Author: Michael Schmidt;
| Gunnar Jehl (multi-step paths/aggregate functions/optimizations)
===========================================================================
===========================================================================
| Software License Agreement (BSD License)
|
| Copyright (c) 2006-2007, Saarland University Database Group
| All rights reserved.
|
| Redistribution and use of this software 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 the of Saarland University Database Group nor the names
| of its contributors may be used to endorse or promote products derived
| from this software without specific prior written permission of the
| Saarland University Database Group.
|
| 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
* @brief Header file for buffer.cpp.
* @details Header file specifying constructors, destructor and functions for buffer.cpp.
* @author Michael Schmidt
* @author Gunnar Jehl (multi-step paths/aggregate functions/optimizations)
* @version 1.01b
* @license Software License Agreement (BSD License)
*/
#ifndef BUFFER_H
#define BUFFER_H
#include <iostream>
#include "buffernode.h"
#include "projectiondfa.h"
/*! @class Buffer
* @brief Represents the DOM buffer.
* @details The buffer is implemented as a DOM tree. The buffer may contain
* both tag and character nodes, and the class provides methods
* for appending suchlike node types.
* @author Michael Schmidt
* @author Gunnar Jehl (multi-step paths/aggregate functions/optimizations)
* @version 1.01b
* @license Software License Agreement (BSD License)
*/
class Buffer {
public:
/*! @brief Constructor.
* @details Constructs a buffer that contains solely the document root.
* @param[in] _pdfa The ProjectionDFA is used to assign the roles to the document root.
*/
Buffer(ProjectionDFA* _pdfa);
/*! @brief Destructor.
* @details Destructor.
*/
virtual ~Buffer();
/*! @fn inline BufferNode* getRoot()
* @brief Returns the document root.
* @details The document root is the virtual root node of the XML document.
* @retval BufferNode* Pointer to the document root.
*/
inline BufferNode* getRoot() { return root; }
/*! @fn inline BufferNode* getCurrent()
* @brief Returns the current buffer node (i.e. the one that has last
* recently been read into the buffer).
* @retval BufferNode* Pointer to the current buffer node.
*/
inline BufferNode* getCurrent() { return cur; }
/*! @brief Appends a tag node to the buffer.
* @details The tag node is appended at the current position of the buffer.
* @param[in] tag The tag id of the node that will be created.
* @retval void
*/
void appendTag(TAG tag);
/*! @brief Appends a tag node including roles to the buffer.
* @details The tag node is appended at the current position of the buffer.
* @param[in] tag The tag id of the node that will be created.
* @param[in] _cumulative_roles Pointer to a vector containing cumulative roles.
* @param[in] _non_cumulative_roles Pointer to a vector containing non-cumulative roles.
* @retval void
*/
void appendTag(TAG tag, vector<unsigned>* _cumulative_roles,
vector<unsigned>* _non_cumulative_roles);
/*! @brief Appends a text node to the buffer.
* @details The text node is appended at the current position of the buffer.
* @param[in] data The PCDATA content of the node that will be created.
* @retval void
*/
void appendPCData(const char* data);
/*! @brief Appends a text node including some roles to the buffer.
* @details The text node is appended at the current position of the buffer.
* @param[in] data The PCDATA content of the node that will be created.
* @param[in] _cumulative_roles Pointer to a vector containing cumulative roles.
* @param[in] _non_cumulative_roles Pointer to a vector containing non-cumulative roles.
* @retval void
*/
void appendPCData(const char* data, vector<unsigned>* _cumulative_roles,
vector<unsigned>* _non_cumulative_roles);
/*! @brief Closes the current tag node in the buffer.
* @details This is simply realized by marking the tag node as closed.
* @retval void
*/
void closeTag();
/*! @brief Appends a set of roles to the current buffer node.
* @param[in] _cumulative_roles Pointer to a vector containing cumulative roles.
* @param[in] _non_cumulative_roles Pointer to a vector containing non-cumulative roles.
* @retval void
*/
void appendRoles(vector<unsigned>* _cumulative_roles,
vector<unsigned>* _non_cumulative_roles);
/*! @brief Prints the buffer.
* @retval void
*/
void print();
/*! @brief Prints the current node of the buffer (including its subtree).
* @retval void
*/
void printCurrent();
/*! @brief Prints the buffer including debug and role information.
* @retval void
*/
void debugPrint();
private:
/*! @var BufferNode* root
* @brief The root node of the buffer, i.e. the virtual document root.
*/
BufferNode* root;
/*! @var BufferNode* cur
* @brief The current node of the buffer, i.e. the node that has been appended
* last recently.
*/
BufferNode* cur;
};
#endif // BUFFER_H
| [
"aep@localhost.localdomain"
] | aep@localhost.localdomain |
eec49d844d370b8793974216426b137a9809d32d | 91a882547e393d4c4946a6c2c99186b5f72122dd | /Source/XPSP1/NT/shell/themes/themeui/thscheme.h | 4abd5ae8e55a13ccb464e0334f81591be0df2cad | [] | no_license | IAmAnubhavSaini/cryptoAlgorithm-nt5src | 94f9b46f101b983954ac6e453d0cf8d02aa76fc7 | d9e1cdeec650b9d6d3ce63f9f0abe50dabfaf9e2 | refs/heads/master | 2023-09-02T10:14:14.795579 | 2021-11-20T13:47:06 | 2021-11-20T13:47:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,305 | h | /*****************************************************************************\
FILE: thScheme.h
DESCRIPTION:
This is the Autmation Object to theme scheme object. This one will be
a skin.
BryanSt 5/9/2000 (Bryan Starbuck)
Copyright (C) Microsoft Corp 2000-2000. All rights reserved.
\*****************************************************************************/
#ifndef _FILE_H_THSCHEME
#define _FILE_H_THSCHEME
#include <cowsite.h>
#include <atlbase.h>
static const GUID CLSID_SkinScheme = { 0x570fdefa, 0x5907, 0x47fe, { 0x96, 0x6b, 0x90, 0x30, 0xb4, 0xba, 0x10, 0xcd } };// {570FDEFA-5907-47fe-966B-9030B4BA10CD}
HRESULT CSkinScheme_CreateInstance(IN LPCWSTR pszFilename, OUT IThemeScheme ** ppThemeScheme);
class CSkinScheme : public CImpIDispatch
, public CObjectCLSID
, public IThemeScheme
{
public:
//////////////////////////////////////////////////////
// Public Interfaces
//////////////////////////////////////////////////////
// *** IUnknown ***
virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
virtual STDMETHODIMP_(ULONG) AddRef(void);
virtual STDMETHODIMP_(ULONG) Release(void);
// *** IThemeScheme ***
virtual STDMETHODIMP get_DisplayName(OUT BSTR * pbstrDisplayName);
virtual STDMETHODIMP put_DisplayName(IN BSTR bstrDisplayName) {return E_NOTIMPL;}
virtual STDMETHODIMP get_Path(OUT BSTR * pbstrPath);
virtual STDMETHODIMP put_Path(IN BSTR bstrPath);
virtual STDMETHODIMP get_length(OUT long * pnLength);
virtual STDMETHODIMP get_item(IN VARIANT varIndex, OUT IThemeStyle ** ppThemeStyle);
virtual STDMETHODIMP get_SelectedStyle(OUT IThemeStyle ** ppThemeStyle);
virtual STDMETHODIMP put_SelectedStyle(IN IThemeStyle * pThemeStyle);
virtual STDMETHODIMP AddStyle(OUT IThemeStyle ** ppThemeStyle);
// *** IDispatch ***
virtual STDMETHODIMP GetTypeInfoCount(UINT *pctinfo) { return CImpIDispatch::GetTypeInfoCount(pctinfo); }
virtual STDMETHODIMP GetTypeInfo(UINT itinfo,LCID lcid,ITypeInfo **pptinfo) { return CImpIDispatch::GetTypeInfo(itinfo, lcid, pptinfo); }
virtual STDMETHODIMP GetIDsOfNames(REFIID riid,OLECHAR **rgszNames,UINT cNames, LCID lcid, DISPID * rgdispid) { return CImpIDispatch::GetIDsOfNames(riid, rgszNames, cNames, lcid, rgdispid); }
virtual STDMETHODIMP Invoke(DISPID dispidMember,REFIID riid,LCID lcid,WORD wFlags, DISPPARAMS * pdispparams, VARIANT * pvarResult, EXCEPINFO * pexcepinfo,UINT * puArgErr) { return CImpIDispatch::Invoke(dispidMember, riid, lcid, wFlags, pdispparams, pvarResult, pexcepinfo, puArgErr); }
private:
CSkinScheme(IN LPCWSTR pszFilename);
virtual ~CSkinScheme(void);
// Private Member Variables
long m_cRef;
IThemeStyle * m_pSelectedStyle; // The selected style.
LPWSTR m_pszFilename; // This is the full path to the ".thx" file
long m_nSize; // The size of the collection of "Color Styles".
// Private Member Functions
// Friend Functions
friend HRESULT CSkinScheme_CreateInstance(IN LPCWSTR pszFilename, OUT IThemeScheme ** ppThemeScheme);
};
#endif // _FILE_H_THSCHEME
| [
"support@cryptoalgo.cf"
] | support@cryptoalgo.cf |
74e4c678f8240112f3acc4816e96e72686401a18 | 9a3b9d80afd88e1fa9a24303877d6e130ce22702 | /src/Providers/UNIXProviders/QueryStatisticsCollection/tests/QueryStatisticsCollection.Tests/UNIX_QueryStatisticsCollectionFixture.cpp | 71f65e7d314f89635e52b7afddd28a90edb05c5c | [
"MIT"
] | permissive | brunolauze/openpegasus-providers | 3244b76d075bc66a77e4ed135893437a66dd769f | f24c56acab2c4c210a8d165bb499cd1b3a12f222 | refs/heads/master | 2020-04-17T04:27:14.970917 | 2015-01-04T22:08:09 | 2015-01-04T22:08:09 | 19,707,296 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,570 | cpp | //%LICENSE////////////////////////////////////////////////////////////////
//
// Licensed to The Open Group (TOG) under one or more contributor license
// agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
// this work for additional information regarding copyright ownership.
// Each contributor licenses this file to you under the OpenPegasus Open
// Source License; you may not use this file except in compliance with the
// 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.
//
//////////////////////////////////////////////////////////////////////////
//
//%/////////////////////////////////////////////////////////////////////////
#include "UNIX_QueryStatisticsCollectionFixture.h"
#include <QueryStatisticsCollection/UNIX_QueryStatisticsCollectionProvider.h>
UNIX_QueryStatisticsCollectionFixture::UNIX_QueryStatisticsCollectionFixture()
{
}
UNIX_QueryStatisticsCollectionFixture::~UNIX_QueryStatisticsCollectionFixture()
{
}
void UNIX_QueryStatisticsCollectionFixture::Run()
{
CIMName className("UNIX_QueryStatisticsCollection");
CIMNamespaceName nameSpace("root/cimv2");
UNIX_QueryStatisticsCollection _p;
UNIX_QueryStatisticsCollectionProvider _provider;
Uint32 propertyCount;
CIMOMHandle omHandle;
_provider.initialize(omHandle);
_p.initialize();
for(int pIndex = 0; _p.load(pIndex); pIndex++)
{
CIMInstance instance = _provider.constructInstance(className,
nameSpace,
_p);
CIMObjectPath path = instance.getPath();
cout << path.toString() << endl;
propertyCount = instance.getPropertyCount();
for(Uint32 i = 0; i < propertyCount; i++)
{
CIMProperty propertyItem = instance.getProperty(i);
if (propertyItem.getType() == CIMTYPE_REFERENCE) {
CIMValue subValue = propertyItem.getValue();
CIMInstance subInstance;
subValue.get(subInstance);
CIMObjectPath subPath = subInstance.getPath();
cout << " Name: " << propertyItem.getName().getString() << ": " << subPath.toString() << endl;
Uint32 subPropertyCount = subInstance.getPropertyCount();
for(Uint32 j = 0; j < subPropertyCount; j++)
{
CIMProperty subPropertyItem = subInstance.getProperty(j);
cout << " Name: " << subPropertyItem.getName().getString() << " - Value: " << subPropertyItem.getValue().toString() << endl;
}
}
else {
cout << " Name: " << propertyItem.getName().getString() << " - Value: " << propertyItem.getValue().toString() << endl;
}
}
cout << "------------------------------------" << endl;
cout << endl;
}
_p.finalize();
}
| [
"brunolauze@msn.com"
] | brunolauze@msn.com |
c47cf3333123b3ae84d4216395335b37cc603b99 | 5cace7eef01377e4b661a3fa269e7b882e89a57f | /2DGameEngine/src/rendering/textures/animations/AnimatedTexturedModel.cpp | 7f666577f406f8d10180604a2e91141737afd32c | [
"Apache-2.0"
] | permissive | pbeaulieu26/2DGameEngine | c1d9c864aa5c0f38b368afe84bf8b3c743f13162 | 898a7d92d91cd77b51bf71245e78dcc33e344bc5 | refs/heads/master | 2022-04-03T19:44:05.613892 | 2020-02-16T18:24:10 | 2020-02-16T18:24:10 | 185,702,338 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 52 | cpp | #include "pch.h"
#include "AnimatedTexturedModel.h"
| [
"mathieu.favreau@usherbrooke.ca"
] | mathieu.favreau@usherbrooke.ca |
873b281c5a4b65b454699656027586409eeaeb60 | 96c4826ee0a62e2759f1aa3f9a6721327a126d87 | /self-entertaining/ch3/mix_stream_extraction_operator_and_getline/main.cpp | 58192c53a831b2db9d5eb51d84f024c9a36c1e96 | [] | no_license | simomo/cs106L-course-reader-practice | 4e00e5305fbb38534ffe62670aa0176821948c0f | 233dbbb829ab1036bfdd51224ea315f6fcd0ab36 | refs/heads/master | 2022-03-05T13:40:00.063649 | 2019-09-26T15:48:53 | 2019-09-26T15:48:53 | 114,762,052 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 318 | cpp | #include <fstream>
#include <iostream>
using namespace std;
int main() {
int intValue;
string oneLine;
cout << "Please input a int then a string" << endl;
cin >> intValue;
getline(cin, oneLine);
cout << "OK, got you! The int is " << intValue << ", while the string is " << oneLine << endl;
} | [
"qihangzp@gmail.com"
] | qihangzp@gmail.com |
4f6e20fb67e641a3362ca6ca6cf42c329e745ffc | a8fe43a526965f4ff272eec6baaacb931ee98e80 | /tests/strings.cpp | eff76a1519a43f5702ca7daa3a32811f9992f9ff | [
"MIT"
] | permissive | matusnovak/wrenbind17 | 39b50de9d3fa01724d9c031e70ea23cca3386f53 | 4ae1512bbc7b7ce89e50f7979471a1076643b798 | refs/heads/master | 2023-06-25T03:12:45.094594 | 2023-05-07T16:32:26 | 2023-05-07T16:32:26 | 188,119,425 | 62 | 7 | MIT | 2023-06-14T14:44:17 | 2019-05-22T22:00:01 | C++ | UTF-8 | C++ | false | false | 987 | cpp | #include <catch2/catch.hpp>
#include <wrenbind17/wrenbind17.hpp>
namespace wren = wrenbind17;
TEST_CASE("Char strings as array") {
const std::string code = R"(
class Main {
static main(arg) {
return arg
}
}
)";
wren::VM vm;
vm.runFromSource("main", code);
auto main = vm.find("main", "Main").func("main(_)");
auto res = main("Hello World!");
REQUIRE(res.is<std::string>());
REQUIRE(res.as<std::string>() == "Hello World!");
}
TEST_CASE("Char strings as pointer") {
const std::string code = R"(
class Main {
static main(arg) {
return arg
}
}
)";
wren::VM vm;
vm.runFromSource("main", code);
auto main = vm.find("main", "Main").func("main(_)");
const char* ptr = "Hello World!";
auto res = main(ptr);
REQUIRE(res.is<std::string>());
REQUIRE(res.as<std::string>() == "Hello World!");
}
| [
"email@matusnovak.com"
] | email@matusnovak.com |
c17e177880151906c6e8b356edfcf24e9cb5bf6a | 189f52bf5454e724d5acc97a2fa000ea54d0e102 | /ras/weirOverflow/16/alphaPhi | 127f40fe11ac8c74457e651e075a835c3be96035 | [] | 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 | 116,411 | /*--------------------------------*- 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 "16";
object alphaPhi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 3 -1 0 0 0 0];
internalField nonuniform List<scalar>
9981
(
3.64105
0.00774299
3.61142
0.0296307
3.55586
0.0555536
3.48022
0.0756443
3.38644
0.0937817
3.26771
0.118727
3.12919
0.138516
2.97406
0.155131
2.80037
0.173692
2.60925
0.191117
2.40502
0.204237
2.18601
0.219004
1.95013
0.235885
1.70438
0.245747
1.44355
0.260828
1.17177
0.271785
0.901977
0.269789
0.615729
0.286248
0.284757
0.330972
0.284757
3.50487
0.020947
3.4713
0.0632019
3.41961
0.107238
3.34589
0.149366
3.25223
0.187446
3.1381
0.232859
3.00382
0.272794
2.85115
0.307802
2.67848
0.34636
2.49116
0.378435
2.28266
0.412736
2.0587
0.442969
1.82106
0.473525
1.55275
0.514053
1.28292
0.530659
1.00125
0.55345
0.668378
0.602666
0.351344
0.603281
0.132787
0.549528
0.417545
3.38239
0.0306002
3.35096
0.0946341
3.30001
0.158182
3.22957
0.219806
3.13882
0.278203
3.03127
0.34041
2.8998
0.40426
2.75498
0.452623
2.59539
0.505955
2.41384
0.559981
2.22742
0.59916
2.02153
0.648855
1.79525
0.699801
1.56952
0.739791
1.31912
0.781051
1.05041
0.822162
0.798176
0.854901
0.542705
0.858752
0.206333
0.8859
0.623878
3.26089
0.0402415
3.23357
0.121951
3.18289
0.208864
3.11743
0.285258
3.03166
0.363981
2.92511
0.446954
2.80454
0.524833
2.66643
0.590736
2.51213
0.660253
2.3469
0.725205
2.17006
0.776004
1.98377
0.835142
1.79402
0.889557
1.60554
0.928272
1.41597
0.970617
1.24515
0.992978
1.10023
0.999826
0.943486
1.01549
0.711351
1.11803
1.33523
3.14374
0.0498697
3.11649
0.149202
3.0717
0.253651
3.0082
0.348761
2.92709
0.445082
2.82558
0.548474
2.71042
0.639989
2.57561
0.725543
2.42649
0.809372
2.26484
0.886855
2.08604
0.954806
1.89265
1.02853
1.68657
1.09564
1.46111
1.15373
1.2241
1.20763
0.981166
1.23591
0.71876
1.26223
0.407478
1.32678
0.0667489
1.45876
1.40198
3.0318
0.0584629
3.00614
0.174867
2.96313
0.296657
2.90245
0.409446
2.82536
0.522167
2.73072
0.643115
2.61823
0.752479
2.48877
0.855004
2.34398
0.954168
2.18631
1.04452
2.00944
1.13167
1.82164
1.21633
1.61628
1.301
1.39711
1.37289
1.16533
1.43942
0.925934
1.47531
0.673379
1.51479
0.421642
1.57851
0.202275
1.67813
1.60425
2.92441
0.0655291
2.89991
0.199367
2.85979
0.336784
2.80239
0.466844
2.72947
0.595082
2.64027
0.732321
2.53292
0.859825
2.41072
0.977202
2.27506
1.08984
2.12284
1.19673
1.95877
1.29575
1.77921
1.3959
1.59249
1.48772
1.38766
1.57773
1.18493
1.64214
0.962756
1.69748
0.736019
1.74152
0.48713
1.8274
0.245448
1.91981
1.8497
2.81952
0.0724744
2.79749
0.221395
2.76098
0.373292
2.7079
0.519924
2.64038
0.662602
2.55667
0.816035
2.45623
0.96026
2.34376
1.08968
2.21436
1.21923
2.07212
1.33898
1.91207
1.4558
1.74296
1.56501
1.55028
1.6804
1.35198
1.77603
1.12668
1.86744
0.907214
1.91695
0.665319
1.98342
0.476816
2.01591
0.274754
2.12187
2.12445
2.71874
0.0789422
2.70008
0.240051
2.66599
0.40739
2.61879
0.567117
2.55721
0.724186
2.48014
0.893101
2.38826
1.05215
2.2825
1.19543
2.16196
1.33977
2.02488
1.47605
1.87529
1.60539
1.70721
1.73309
1.53118
1.85643
1.32976
1.97745
1.14247
2.05473
0.917341
2.14208
0.716142
2.18462
0.452234
2.27982
0.272191
2.30192
2.39665
2.62222
0.0842968
2.6057
0.256577
2.57553
0.437555
2.53432
0.60833
2.47925
0.779254
2.41024
0.962113
2.32744
1.13495
2.22936
1.29351
2.11911
1.45002
1.99087
1.60429
1.85126
1.745
1.69297
1.89138
1.51489
2.03451
1.32556
2.16678
1.09227
2.28802
0.872195
2.36215
0.585557
2.47126
0.385797
2.47958
0.134648
2.55307
2.53129
2.52876
0.0889882
2.51484
0.270493
2.49013
0.462267
2.45458
0.643877
2.40678
0.827061
2.34786
1.02103
2.27362
1.20919
2.18833
1.3788
2.08652
1.55183
1.97439
1.71642
1.83991
1.87948
1.6968
2.03448
1.52619
2.20513
1.34112
2.35185
1.15494
2.4742
0.924735
2.59235
0.742282
2.65371
0.437866
2.78399
0.250703
2.74023
2.782
2.43856
0.0931136
2.42834
0.280713
2.40936
0.481253
2.37962
0.67362
2.34065
0.866027
2.29133
1.07035
2.22946
1.27107
2.15479
1.45346
2.06979
1.63683
1.9647
1.82151
1.85174
1.99244
1.7083
2.17792
1.55929
2.35415
1.37448
2.53666
1.1636
2.68508
0.949076
2.80688
0.640592
2.9622
0.457088
2.9675
0.148273
3.04905
2.93027
2.35227
0.0960276
2.34564
0.28734
2.33217
0.494727
2.30886
0.696925
2.2801
0.894784
2.24044
1.11001
2.192
1.31951
2.13084
1.51462
2.05985
1.70783
1.97226
1.90909
1.86714
2.09757
1.74896
2.2961
1.59737
2.50573
1.44296
2.69107
1.25731
2.87073
1.04938
3.0148
0.901046
3.11053
0.571195
3.29735
0.386314
3.23393
3.31658
2.26909
0.0977475
2.26596
0.290476
2.25728
0.5034
2.2432
0.711009
2.22243
0.915554
2.19629
1.13615
2.15775
1.35805
2.11713
1.55524
2.05543
1.76953
1.99165
1.97288
1.90017
2.18905
1.79563
2.40064
1.67113
2.63024
1.50641
2.85579
1.32214
3.05499
1.09825
3.2387
0.758257
3.45052
0.569956
3.48565
0.157243
3.64664
3.47383
2.18925
0.0979615
2.18828
0.291445
2.18648
0.505202
2.1799
0.717585
2.16992
0.925534
2.1527
1.15337
2.13502
1.37573
2.09918
1.59108
2.07076
1.79795
2.00941
2.03423
1.95393
2.24454
1.86058
2.49399
1.75286
2.73796
1.62093
2.98772
1.44441
3.23151
1.25058
3.43253
1.11235
3.58876
0.742976
3.85502
0.596798
3.79282
4.07063
2.11177
0.0972178
2.11352
0.289693
2.11862
0.500103
2.11883
0.717375
2.11853
0.925832
2.11618
1.15572
2.10697
1.38493
2.0993
1.59875
2.07205
1.82519
2.05793
2.04835
1.99938
2.30308
1.95191
2.54146
1.86198
2.82789
1.74292
3.10678
1.59316
3.38127
1.36298
3.66271
1.0076
3.94414
0.795205
4.06742
0.202584
4.38544
4.27321
2.03641
0.0962073
2.04251
0.283593
2.05114
0.491473
2.06145
0.707061
2.06701
0.920276
2.07956
1.14318
2.08395
1.38054
2.08982
1.59289
2.09725
1.81776
2.08267
2.06293
2.0847
2.30106
2.03751
2.58864
1.99665
2.86875
1.90963
3.1938
1.76304
3.52786
1.59585
3.8299
1.42489
4.1151
0.98928
4.50302
0.893746
4.48097
5.16696
1.96599
0.092697
1.97189
0.2777
1.9884
0.474961
2.0004
0.695058
2.02012
0.900553
2.03519
1.12811
2.06661
1.34912
2.07737
1.58212
2.11108
1.78405
2.13577
2.03823
2.137
2.29983
2.16369
2.56196
2.12977
2.90267
2.09317
3.2304
2.01198
3.60905
1.82725
4.01463
1.5134
4.42896
1.20541
4.81102
0.308452
5.37793
5.47541
1.89564
0.0892338
1.90527
0.268075
1.92391
0.456319
1.94466
0.674306
1.96536
0.879855
2.00487
1.08861
2.02264
1.33135
2.08506
1.51971
2.10611
1.763
2.17616
1.96819
2.22279
2.2532
2.25284
2.53191
2.31337
2.84214
2.31522
3.22855
2.2738
3.65047
2.21459
4.07384
2.04154
4.60201
1.6349
5.21766
1.69503
5.3178
7.17043
1.82852
0.0851114
1.84166
0.254933
1.8594
0.438579
1.8899
0.643804
1.91361
0.856141
1.95332
1.0489
2.00688
1.2778
2.04379
1.48279
2.14251
1.66427
2.18939
1.92131
2.287
2.15559
2.38621
2.43269
2.43585
2.7925
2.55497
3.10942
2.63084
3.5746
2.55533
4.14935
2.6439
4.51344
2.18584
5.67571
1.25281
6.25083
8.42325
-0.394836
1.52499
-0.789015
0.39418
-1.00029
0.211271
-2.13603
-0.265227
-2.37943
-0.83635
-1.96389
-1.19751
-1.02432
-1.40243
-0.104232
-1.15356
0.0464508
-0.363945
-0.0891794
0.0518958
-0.25007
0.160891
-3.04915e-07
0.063993
-3.04915e-07
1.15909e-16
9.22046e-08
-5.66883e-07
9.22046e-08
-7.10228e-17
-2.27154
0.155236
1.15009
-5.75366
4.57366
-4.3714
6.72762
-3.03289
7.74863
-1.78847
8.2776
-1.07266
8.53843
-0.674798
8.54374
-0.460602
8.0866
-0.322102
6.9531
-0.202278
5.47306
-0.0657758
4.38055
0.0175146
3.68876
0.0596988
3.02296
0.0762362
2.4515
0.0746967
2.36136
0.0659432
2.36587
0.0481217
2.3683
0.0258373
2.37229
0.0275174
4.60699
0.082961
12.4982
0.153993
12.3404
0.157821
12.1984
0.142003
12.0732
0.125119
11.9693
0.103984
11.8875
0.0817746
11.8244
0.0630525
11.7751
0.0493519
11.7367
0.0383869
11.7092
0.0274683
11.6951
0.0140892
11.6956
-0.000466811
11.7059
-0.0103291
11.7164
-0.0104715
11.7128
0.00358255
11.6858
0.0269629
11.6382
0.0476731
11.5791
0.0590491
11.5188
0.0602941
11.4696
0.0492217
11.428
0.0416088
11.4001
0.0279051
11.3754
0.0247352
11.3583
0.0170768
0.0285453
-1.21448
4.65718
-4.05322
2.8468
-4.68903
0.831942
-4.57882
-0.375689
-4.19519
-1.21987
-3.55262
-1.84108
-2.73373
-2.22085
-1.66057
-2.22784
-0.559258
-1.10725
-0.35261
0.108271
-0.188301
0.0846217
-2.26506e-06
0.11453
-2.26506e-06
1.44884e-16
3.63959e-07
-1.24569e-06
3.63959e-07
-2.20837e-16
0.858383
-1.95738
4.66617
-10.8276
7.40804
-7.11326
9.08406
-4.70891
10.3829
-3.08728
11.3043
-1.99407
11.9358
-1.30633
12.3662
-0.891027
12.667
-0.622888
12.885
-0.420274
13.0484
-0.241306
13.0781
-0.0747887
12.9433
0.0635536
12.6911
0.157598
12.4722
0.203021
12.3547
0.207013
12.2386
0.184573
12.0508
0.16703
11.9299
0.203295
12.0682
0.26644
12.5917
0.276539
12.6118
0.261088
12.5064
0.247451
12.4069
0.224592
12.3224
0.188437
12.2561
0.148087
12.2064
0.112758
12.1704
0.0853686
12.1458
0.0629664
12.1319
0.04135
12.1282
0.017778
12.1337
-0.00588676
12.1461
-0.0227144
12.1575
-0.0219258
12.1586
0.00249483
12.1402
0.0453053
12.1028
0.0850993
12.054
0.107915
12.0046
0.10962
11.9615
0.0923833
11.929
0.0740945
11.9039
0.0530119
11.8858
0.0428418
11.8708
0.0320687
0.0507094
-2.67583
8.77853
-4.01686
3.8848
-4.39761
1.21154
-4.42803
-0.345333
-4.25569
-1.39278
-3.89968
-2.19683
-3.38638
-2.73526
-2.73195
-2.67451
-0.659255
-0.645503
-0.0887031
0.0292049
-0.104938
-0.011815
-5.23463e-07
0.053749
-5.23463e-07
1.25547e-16
7.42367e-07
-7.81468e-17
0.684883
-0.684882
5.82337
-9.23273
6.39891
-11.6704
7.84956
-8.56392
9.16469
-6.02403
10.2465
-4.16908
11.0461
-2.7937
11.5895
-1.84974
11.9465
-1.248
12.1876
-0.863944
12.3659
-0.598593
12.5124
-0.387787
12.6372
-0.199593
12.7361
-0.0353896
12.8065
0.0871934
12.8511
0.158476
12.8708
0.187287
12.861
0.194404
12.8253
0.202659
12.7905
0.238069
12.7712
0.285771
12.7433
0.304408
12.6974
0.307222
12.6375
0.307421
12.5718
0.290337
12.5117
0.248577
12.4633
0.196447
12.4275
0.148537
12.4031
0.109833
12.3886
0.0774353
12.3835
0.0464261
12.3872
0.0141213
12.3967
-0.0153815
12.4096
-0.0356867
12.4218
-0.0341233
12.4251
-0.000770115
12.4111
0.059346
12.3791
0.117064
12.3366
0.150378
12.2933
0.152948
12.2557
0.129973
12.228
0.101806
12.2066
0.0743653
12.1914
0.058113
12.1792
0.0442876
0.0690482
-2.34742
7.63191
-3.59948
4.64242
-4.10669
1.71868
-4.27186
-0.180609
-4.26393
-1.40044
-4.12528
-2.33651
-3.8621
-2.99806
-1.17059
-2.21237
-0.0292049
-0.00623129
-1.89793e-17
5.1184e-18
-0.011815
4.36332e-17
-3.3367e-07
-7.00538e-06
2.12426e-17
-3.3367e-07
1.0844e-16
-1.65299e-16
3.84461
-5.43582
6.85233
-12.564
7.01724
-11.8353
8.00663
-9.55331
9.13727
-7.15467
10.1001
-5.1319
10.8129
-3.50651
11.2948
-2.33165
11.6074
-1.56063
11.8178
-1.0743
11.9781
-0.758896
12.1196
-0.529264
12.2534
-0.333384
12.3764
-0.158374
12.4855
-0.0219926
12.5735
0.0705334
12.6381
0.12267
12.6763
0.156245
12.6938
0.18508
12.7097
0.222236
12.7365
0.258929
12.7607
0.28022
12.7682
0.299718
12.7528
0.322797
12.7197
0.323514
12.6829
0.285347
12.6517
0.227652
12.6287
0.171467
12.6142
0.124377
12.6076
0.0840385
12.6089
0.0451239
12.6171
0.00596381
12.6292
-0.0275361
12.6423
-0.0487632
12.6537
-0.0455114
12.6578
-0.004862
12.6463
0.070807
12.618
0.145381
12.5802
0.188191
12.5413
0.191843
12.5082
0.163017
12.4844
0.125663
12.4657
0.0930114
12.4524
0.0714798
12.4422
0.0544318
0.0853602
-1.25449
3.24262
-3.04166
5.47244
-3.69673
2.3724
-4.02036
0.109557
-4.14924
-1.27745
-4.172
-2.31338
-3.93504
-3.06476
-0.0706532
-2.10097
-6.20462e-18
-0.0768845
-7.04992e-18
4.1135e-18
-4.30566e-17
7.79549e-17
-2.59483e-06
-4.41055e-06
2.49431e-06
-1.01896e-10
1.04386
-1.04386
6.5791
-11.5533
7.03621
-13.0211
7.33948
-12.1385
8.11872
-10.3325
9.08633
-8.12228
9.93601
-5.98158
10.5593
-4.12983
10.9877
-2.75999
11.2793
-1.85224
11.4898
-1.28484
11.6618
-0.930908
11.8204
-0.687845
11.976
-0.488949
12.127
-0.309437
12.266
-0.160955
12.3897
-0.0531614
12.4904
0.0219677
12.5663
0.0803017
12.6248
0.126588
12.6809
0.166151
12.7454
0.194467
12.8099
0.215648
12.8612
0.248417
12.8858
0.298242
12.8819
0.32744
12.8657
0.301559
12.8491
0.244208
12.8365
0.184106
12.8292
0.131654
12.8277
0.0855743
12.8323
0.0405109
12.8423
-0.00411574
12.8555
-0.0406614
12.8668
-0.0600937
12.8755
-0.0541587
12.8788
-0.00818049
12.8693
0.0803204
12.8442
0.170484
12.8112
0.221191
12.7762
0.226747
12.7469
0.192353
12.7262
0.146382
12.7087
0.1105
12.6956
0.084624
12.6868
0.0632359
0.102478
-0.681813
3.92444
-2.20546
6.59554
-3.01919
3.18743
-3.61187
0.472935
-3.89326
-1.02436
-4.03183
-2.17557
-4.08612
-3.01044
-0.975968
-2.67185
-2.10962e-06
-0.269016
-2.10962e-06
1.33768e-18
-1.12661e-05
2.19848e-05
7.97169e-07
-4.15418e-07
7.97476e-07
-2.04323e-10
4.60488
-6.2258
6.72513
-13.8013
7.10222
-13.3982
7.52131
-12.5576
8.20196
-11.0132
9.02
-8.94032
9.73851
-6.70009
10.2565
-4.64782
10.6401
-3.14362
10.8275
-2.01684
10.8388
-1.23216
10.8137
-0.802002
10.905
-0.577406
11.1015
-0.449413
11.4
-0.340779
11.7263
-0.243307
12.0094
-0.158236
12.2504
-0.0860442
12.4798
-0.019053
12.6404
0.0317195
12.7316
0.07496
12.818
0.108059
12.9067
0.126989
12.99
0.16509
13.0508
0.237504
13.0739
0.304271
13.075
0.300462
13.0691
0.250113
13.0627
0.190574
13.0587
0.135631
12.9644
0.0637742
12.6381
0.0260431
12.0556
-0.00323183
11.0522
-0.000485665
9.6042
-2.12819e-15
8.26508
-0.000203775
7.12269
-0.00167532
5.80628
0.00809829
4.95804
0.00297538
5.04692
-0.000104929
5.32096
0.000745884
6.02884
0.0047638
6.70013
0.0103834
6.71152
0.0101747
6.64623
0.00792041
6.47993
0.00542549
0.00338396
0.109544
3.81489
-0.879108
7.41005
-1.96531
2.77315
-2.99129
0.617254
-3.50595
-0.622168
-3.73769
-1.94379
-3.8647
-2.88415
-2.06626
-3.19812
-3.73234e-06
-0.654598
-3.73234e-06
-2.76091e-18
-1.77152e-06
2.20905e-05
5.53905e-06
-1.85245e-11
0.822471
-0.822465
6.16241
-11.6342
6.66092
-14.2998
7.12495
-13.8622
7.61298
-13.0457
8.22753
-11.6277
8.89409
-9.60688
9.20676
-7.01275
7.15955
-2.25315
4.94783
-0.435855
3.28669
-1.00812e-13
2.42589
-1.37626e-13
2.07933
-1.90217e-13
2.13621
-2.1408e-13
2.38121
-2.30694e-13
2.79447
-2.09136e-13
3.2625
-1.90534e-13
3.69571
-1.51964e-13
4.11743
-1.15175e-13
4.65218
-0.000474921
5.56454
-0.0109657
7.1613
-0.00255468
8.85157
0.00229458
9.08922
0.00966525
8.4945
0.0206636
5.23805
0.0215454
1.77736
-0.0096725
1.20316
-4.90974e-05
1.09468
-2.69437e-14
0.870785
-1.90924e-14
0.505005
-3.36588e-14
0.16683
-4.45212e-14
0.0113265
-7.79996e-14
0.000485665
-8.73297e-14
1.85272e-14
-1.28426e-15
1.84901e-14
-2.23826e-15
-0.000203775
-1.37837e-15
0.00658201
-8.5897e-14
0.0109797
-4.40699e-14
0.00370987
-6.77008e-14
0.00102839
-5.30501e-14
0.00565151
-3.683e-14
0.0287256
-2.38632e-14
0.0486849
-2.3431e-14
0.0497471
-3.17895e-14
0.0448002
-3.99757e-14
0.0313691
-5.09581e-14
-7.29928e-14
0.513961
3.30093
0.537158
6.53802
-0.582486
0.366634
-1.81267
0.194933
-2.9885
-0.0629434
-3.3331
-1.59994
-3.51734
-2.69987
-2.84223
-3.34011
-0.0396492
-1.56084
-5.61353e-06
-0.0396435
1.39532e-06
2.04853e-05
1.3953e-06
-1.79797e-17
3.10837
-3.8317
6.1368
-14.6384
6.60606
-14.7691
7.11902
-14.3752
7.62637
-13.553
8.16523
-12.1666
7.08231
-7.98659
2.00835
-1.05034
0.435855
-3.1627e-13
4.89301e-14
-7.17146e-14
5.16838e-14
-1.00006e-13
5.37753e-14
-1.43278e-13
5.56634e-14
-1.88545e-13
5.69452e-14
-2.18922e-13
5.82783e-14
-2.28467e-13
5.92655e-14
-2.13684e-13
6.04488e-14
-1.88157e-13
6.12534e-14
-1.56329e-13
6.1893e-14
-1.12255e-13
-0.000474921
-5.56667e-14
0.00345267
-2.39189e-12
0.0470954
-1.1803e-12
0.0917275
-9.05982e-13
0.0965827
-5.83757e-13
0.0840902
-5.32521e-13
0.0178248
7.12077e-14
4.90974e-05
-6.68273e-13
6.18346e-14
-1.57971e-14
6.24853e-14
-2.27825e-14
6.30798e-14
-2.58539e-14
6.35315e-14
-2.86175e-14
6.29385e-14
-5.00974e-14
6.79282e-14
-7.74934e-14
4.58358e-14
-7.14054e-14
3.79225e-13
1.70016e-15
4.35774e-13
-6.42574e-15
3.28278e-13
-1.27126e-14
2.45422e-13
-2.27182e-15
2.46639e-13
-4.66523e-14
2.47814e-13
-6.88478e-14
2.49751e-13
-5.56841e-14
2.52997e-13
-4.0718e-14
2.5669e-13
-2.82518e-14
2.59419e-13
-2.68067e-14
2.60768e-13
-3.38232e-14
2.60941e-13
-4.08086e-14
2.59877e-13
-5.05676e-14
-7.28245e-14
1.23029
9.46516
0.988374
5.107
0.0071169
0.343631
-0.435029
0.179224
-2.1498
0.135499
-2.85669
-1.18396
-3.10149
-2.45604
-3.2049
-3.23597
-0.774127
-2.45366
-2.04853e-05
-0.138138
5.42252e-18
1.2889e-17
4.8978e-17
-6.1538e-17
5.39623
-8.97529
6.04345
-15.2856
6.5565
-15.2822
7.08544
-14.9042
7.57607
-14.0437
6.76428
-11.2338
1.05034
-1.22488
1.36532e-13
-2.18118e-13
9.99834e-14
-2.73622e-13
1.9206e-13
-1.72514e-13
4.2216e-13
-3.68378e-13
8.30684e-13
-6.25899e-13
1.38694e-12
-8.50268e-13
1.97086e-12
-9.80052e-13
2.45758e-12
-1.00372e-12
2.79769e-12
-9.46635e-13
3.09315e-12
-8.42059e-13
3.24402e-12
-7.17228e-13
3.16023e-12
-5.98368e-13
2.42333e-12
-4.89777e-13
1.35415e-12
-1.01397e-12
1.37332e-12
-8.93466e-13
1.38189e-12
-6.11182e-13
1.37757e-12
-2.79533e-13
1.18725e-12
-4.48428e-14
1.16778e-12
-2.0736e-13
1.07094e-12
-2.74066e-13
1.87034e-12
7.55167e-14
2.7868e-12
1.00965e-13
3.58132e-12
1.22629e-13
4.30873e-12
1.58408e-13
5.36033e-12
2.6591e-13
7.61341e-12
3.95552e-13
1.14814e-11
4.10742e-13
1.4184e-11
2.48245e-13
1.44074e-11
8.45679e-14
1.41507e-11
5.90031e-15
1.25965e-11
5.54008e-14
9.62982e-12
1.95048e-13
6.79472e-12
2.43806e-13
5.69493e-12
1.87917e-13
5.65228e-12
1.24582e-13
5.67427e-12
8.48395e-14
5.65319e-12
9.95455e-14
5.62932e-12
1.46632e-13
5.70887e-12
1.94719e-13
6.12276e-12
2.48226e-13
3.29097e-13
1.7708
7.69436
0.933347
5.91994
0.322833
3.10004
-0.103106
0.120443
-0.925265
0.034282
-2.30815
-0.562978
-2.62251
-2.14095
-2.78904
-3.07066
-1.17414
-2.69512
-5.03198e-18
-0.147706
5.45131e-18
2.40573e-18
0.836017
-0.836017
5.3985
-13.3439
5.92557
-15.8127
6.49093
-15.8475
7.02225
-15.4355
6.79644
-13.8178
1.22488
-4.32748
5.64035e-14
-3.11812e-13
1.55697e-13
-3.11262e-13
5.69157e-13
-8.12998e-13
2.45889e-12
-2.27407e-12
5.76962e-12
-3.9928e-12
9.93215e-12
-5.24838e-12
1.41754e-11
-5.71458e-12
1.77023e-11
-5.51257e-12
2.01773e-11
-4.98072e-12
2.1806e-11
-4.35965e-12
2.29546e-11
-3.74871e-12
2.39941e-11
-3.17852e-12
2.50029e-11
-2.70724e-12
2.5382e-11
-2.47672e-12
2.55738e-11
-2.49517e-12
2.57997e-11
-2.33367e-12
2.55221e-11
-1.67424e-12
2.42431e-11
-7.30608e-13
2.23702e-11
2.32473e-13
2.19527e-11
8.35969e-13
2.24181e-11
1.0601e-12
2.40271e-11
1.07935e-12
2.64201e-11
1.09473e-12
2.91813e-11
1.16242e-12
3.23112e-11
1.4105e-12
3.6964e-11
1.97696e-12
4.45906e-11
2.40926e-12
5.24005e-11
2.13333e-12
5.46326e-11
1.34245e-12
5.44026e-11
7.01695e-13
5.25105e-11
3.91863e-13
4.66438e-11
4.63915e-13
3.79099e-11
7.76222e-13
3.20972e-11
9.22546e-13
3.14259e-11
8.45441e-13
3.14369e-11
6.27242e-13
3.16736e-11
4.98969e-13
3.19071e-11
6.18629e-13
3.25768e-11
8.97446e-13
3.44736e-11
1.20615e-12
3.76688e-11
1.51172e-12
1.71967e-12
1.70247
5.99189
2.13316
6.80577
0.658964
4.3708
0.00059982
0.210335
-0.146553
0.00853977
-1.67328
-0.0360596
-2.08133
-1.73416
-2.27122
-2.88051
-1.01609
-2.71751
-5.2765e-18
-0.0552853
4.83633e-18
-7.7071e-18
2.58418
-3.04591
5.16612
-15.8402
5.81629
-16.4628
6.41916
-16.4504
6.94777
-15.9641
3.71391
-10.0142
-6.56919e-13
-0.350462
-3.40665e-13
-6.2151e-13
1.5334e-12
-2.37698e-12
6.80966e-12
-6.94264e-12
1.53058e-11
-1.18891e-11
2.53155e-11
-1.48913e-11
3.45111e-11
-1.52265e-11
4.142e-11
-1.37548e-11
4.58178e-11
-1.16516e-11
4.83425e-11
-9.6164e-12
4.99235e-11
-7.99188e-12
5.12024e-11
-6.68565e-12
5.25757e-11
-5.63167e-12
5.4329e-11
-4.84538e-12
5.6641e-11
-4.46958e-12
5.92198e-11
-4.44088e-12
6.11733e-11
-4.16208e-12
6.16977e-11
-3.1453e-12
6.1422e-11
-1.49568e-12
6.11953e-11
4.14826e-13
6.1658e-11
1.84532e-12
6.41493e-11
2.49798e-12
6.80119e-11
2.69797e-12
7.23458e-11
2.82e-12
7.67486e-11
3.04095e-12
8.17805e-11
3.58061e-12
8.911e-11
4.47782e-12
9.90949e-11
4.94735e-12
1.0664e-10
4.29615e-12
1.07772e-10
2.99199e-12
1.07247e-10
1.92343e-12
1.04263e-10
1.36981e-12
9.66379e-11
1.39501e-12
8.73609e-11
1.80373e-12
8.41562e-11
2.10056e-12
8.41155e-11
2.00179e-12
8.49022e-11
1.62089e-12
8.68415e-11
1.44526e-12
8.97394e-11
1.69625e-12
9.20315e-11
2.16506e-12
9.23049e-11
2.52137e-12
9.22613e-11
2.67764e-12
2.63132e-12
1.07771
4.91419
1.75055
6.13293
0.309895
2.34769
-0.00424008
0.0267997
0.00429969
7.8657e-17
-0.803816
0.102273
-1.49965
-1.22988
-1.72487
-2.6563
-0.43193
-3.09176
-8.91262e-19
-0.0495366
9.58271e-18
-1.81811e-17
4.32406
-7.23436
5.15559
-16.6713
5.78033
-17.0876
6.36894
-17.039
6.05385
-15.649
0.350462
-3.86525
-2.6127e-13
-3.43163e-13
1.25306e-12
-2.65219e-12
1.02335e-11
-1.34751e-11
2.48803e-11
-2.46591e-11
4.02027e-11
-2.99321e-11
5.18699e-11
-2.85597e-11
5.90644e-11
-2.38619e-11
6.26702e-11
-1.88917e-11
6.40046e-11
-1.47926e-11
6.43741e-11
-1.16366e-11
6.45901e-11
-9.36878e-12
6.50291e-11
-7.75245e-12
6.59501e-11
-6.52271e-12
6.75898e-11
-5.63622e-12
7.00814e-11
-5.18846e-12
7.32998e-11
-5.05654e-12
7.69744e-11
-4.70799e-12
8.07371e-11
-3.66979e-12
8.42617e-11
-1.915e-12
8.76799e-11
2.25128e-13
9.13732e-11
1.99579e-12
9.54284e-11
3.00456e-12
9.9734e-11
3.48591e-12
1.04285e-10
3.82441e-12
1.09374e-10
4.26251e-12
1.15892e-10
4.98991e-12
1.25159e-10
5.90127e-12
1.36491e-10
6.20361e-12
1.44149e-10
5.36637e-12
1.45173e-10
3.91319e-12
1.44575e-10
2.92147e-12
1.43194e-10
2.30737e-12
1.40308e-10
2.23475e-12
1.36401e-10
2.51544e-12
1.3225e-10
2.72071e-12
1.27665e-10
2.54961e-12
1.21867e-10
2.17636e-12
1.14525e-10
1.99042e-12
1.06137e-10
2.12374e-12
9.75649e-11
2.39895e-12
8.94468e-11
2.58503e-12
8.17082e-11
2.63171e-12
1.95407e-12
0.203776
4.28014
0.186744
1.05851
-0.0267997
0.00429257
1.26998e-17
2.1227e-16
1.90089e-17
7.24764e-17
-0.237109
0.187146
-0.887229
-0.688702
-1.19425
-2.34928
-0.24933
-3.58757
0.00579963
-0.0283127
0.0827417
-0.0769421
4.65718
-11.6892
5.19416
-17.2083
5.76966
-17.6631
6.32814
-17.5975
3.39789
-12.341
-3.60911e-12
-0.338936
-2.19918e-12
-1.70158e-12
8.1653e-12
-1.44029e-11
2.8927e-11
-3.87853e-11
4.8651e-11
-4.97014e-11
6.06452e-11
-4.54975e-11
6.52591e-11
-3.56388e-11
6.64761e-11
-2.66638e-11
6.60851e-11
-1.99019e-11
6.51272e-11
-1.51611e-11
6.41056e-11
-1.18188e-11
6.35431e-11
-9.40709e-12
6.36242e-11
-7.68174e-12
6.39921e-11
-6.40086e-12
6.52829e-11
-5.53695e-12
6.77216e-11
-5.02371e-12
7.11836e-11
-4.7176e-12
7.55559e-11
-4.27106e-12
8.05998e-11
-3.35695e-12
8.57468e-11
-1.90154e-12
9.05246e-11
-1.35189e-13
9.49769e-11
1.52902e-12
9.94587e-11
2.64696e-12
1.04411e-10
3.3367e-12
1.10355e-10
3.87438e-12
1.17777e-10
4.46626e-12
1.26665e-10
5.23227e-12
1.34888e-10
5.99752e-12
1.38415e-10
6.11932e-12
1.38671e-10
5.35422e-12
1.38435e-10
4.27989e-12
1.3759e-10
3.36876e-12
1.35299e-10
2.81097e-12
1.31081e-10
2.6417e-12
1.24875e-10
2.69068e-12
1.16611e-10
2.5959e-12
1.06082e-10
2.23071e-12
9.35322e-11
1.75966e-12
7.98833e-11
1.40819e-12
6.61917e-11
1.19358e-12
5.31045e-11
1.00732e-12
4.09591e-11
7.70407e-13
2.98421e-11
5.33514e-13
2.2459e-13
-0.153136
4.32526
-0.00429257
0.00270047
-1.86839e-17
1.32123e-16
-5.783e-19
1.87397e-16
1.17668e-17
6.02625e-17
0.130474
0.380122
-0.282926
-0.169481
-0.692209
-1.9407
-0.144589
-3.74982
0.0030456
-1.50739e-15
0.837357
-0.80674
4.49021
-15.2873
5.15387
-17.872
5.73038
-18.2396
6.1965
-18.0636
0.338936
-6.26507
-6.86926e-13
-8.10989e-14
2.75664e-12
-5.49032e-12
2.45236e-11
-3.94961e-11
4.98368e-11
-7.03238e-11
6.16422e-11
-6.65541e-11
6.42337e-11
-5.10788e-11
6.29085e-11
-3.67095e-11
6.14775e-11
-2.68387e-11
5.93984e-11
-1.89045e-11
5.66715e-11
-1.30625e-11
5.37163e-11
-9.09933e-12
5.10257e-11
-6.5398e-12
4.87584e-11
-4.87927e-12
4.76188e-11
-3.75935e-12
4.76831e-11
-2.99796e-12
4.80939e-11
-2.49946e-12
4.94053e-11
-2.21055e-12
5.20592e-11
-1.91583e-12
5.59031e-11
-1.45825e-12
6.01291e-11
-8.60804e-13
6.38283e-11
-2.12458e-13
6.69138e-11
6.00867e-13
7.00773e-11
1.30868e-12
7.41817e-11
1.82905e-12
8.01529e-11
2.30948e-12
8.86678e-11
2.88496e-12
9.91915e-11
3.61635e-12
1.07347e-10
4.28671e-12
1.09071e-10
4.34351e-12
1.09243e-10
3.85822e-12
1.07873e-10
3.19842e-12
1.04047e-10
2.54766e-12
9.65901e-11
2.01485e-12
8.48289e-11
1.60194e-12
6.94381e-11
1.22515e-12
5.24317e-11
8.26276e-13
3.6462e-11
4.69311e-13
2.36539e-11
2.33465e-13
1.46603e-11
1.12233e-13
8.81519e-12
5.52724e-14
5.09874e-12
2.72695e-14
2.76916e-12
1.27332e-14
1.31431e-12
1.72635e-14
3.97436e-15
-0.177373
5.2279
-1.97595e-17
2.00433
-1.50808e-17
1.18809e-16
3.00466e-17
1.33726e-16
2.35405e-17
6.69032e-17
0.55092
1.3444
0.292463
0.379334
-0.145944
-1.50278
-7.59327e-17
-3.37817
7.4285e-16
-2.36309e-15
2.0939
-2.70795
4.36344
-17.5114
5.08683
-18.5954
5.67751
-18.8303
4.75256
-17.1044
-2.8445e-12
-1.47918
-2.85587e-12
-7.24547e-14
1.04465e-11
-1.96966e-11
4.41058e-11
-7.76153e-11
5.96586e-11
-9.14606e-11
6.11513e-11
-7.1649e-11
5.81772e-11
-5.10524e-11
5.328e-11
-3.32706e-11
4.55802e-11
-1.926e-11
3.77132e-11
-1.05633e-11
3.1074e-11
-5.84002e-12
2.60573e-11
-3.39025e-12
2.24423e-11
-2.10138e-12
1.97738e-11
-1.37921e-12
1.76871e-11
-9.367e-13
1.60893e-11
-6.46166e-13
1.5301e-11
-4.51873e-13
1.52558e-11
-3.14839e-13
1.53625e-11
-1.95625e-13
1.53824e-11
-8.9336e-14
1.57306e-11
-3.8882e-14
1.65631e-11
-1.58667e-14
1.81096e-11
2.77181e-14
2.03978e-11
1.28503e-13
2.39808e-11
2.49511e-13
2.97791e-11
4.27849e-13
3.81997e-11
7.07311e-13
4.62001e-11
1.05719e-12
4.83158e-11
1.22917e-12
4.85414e-11
1.17405e-12
4.67874e-11
1.02078e-12
4.19928e-11
7.68022e-13
3.39125e-11
4.91424e-13
2.37554e-11
2.62851e-13
1.41379e-11
1.16702e-13
7.19039e-12
4.30429e-14
3.21874e-12
1.33959e-14
1.3251e-12
3.80102e-15
5.2684e-13
1.20192e-15
2.09965e-13
1.97435e-15
8.63035e-14
4.27384e-16
4.43924e-14
7.70779e-16
3.9087e-14
1.22419e-15
3.88704e-14
1.26193e-15
2.95616e-15
-0.0848401
5.31274
-0.0417002
5.22963
0.00235033
1.07035
2.3097e-17
0.00235033
2.61004e-17
6.39934e-17
1.22881
2.7725
0.76398
0.843387
0.343088
-1.08212
0.0354169
-2.04201
0.0354169
-3.39742e-15
3.28839
-5.71992
4.48752
-18.6919
5.08308
-19.1909
5.62518
-19.3724
1.37083
-12.8237
-1.37492e-11
-0.101396
-7.7195e-12
-6.10093e-12
2.56876e-11
-5.46827e-11
5.68924e-11
-1.13403e-10
5.86732e-11
-9.73846e-11
5.37318e-11
-7.00955e-11
4.28609e-11
-4.07848e-11
2.93009e-11
-1.81967e-11
1.89771e-11
-7.12084e-12
1.24874e-11
-2.81242e-12
8.59654e-12
-1.20585e-12
6.23809e-12
-5.64375e-13
4.7361e-12
-2.78599e-13
3.69125e-12
-1.37916e-13
2.89246e-12
-6.33935e-14
2.25802e-12
-2.37663e-14
1.76699e-12
-5.56618e-15
1.36078e-12
-5.20289e-16
9.31147e-13
-2.35317e-16
5.45398e-13
-2.2067e-16
4.83561e-13
-1.38744e-16
5.28356e-13
-1.00597e-16
7.96877e-13
-5.63167e-17
1.38783e-12
1.13323e-15
2.467e-12
5.81529e-15
4.20822e-12
1.86676e-14
6.10888e-12
4.12062e-14
6.76916e-12
5.59176e-14
6.82631e-12
5.54648e-14
6.34243e-12
4.97773e-14
5.04439e-12
3.45343e-14
3.21247e-12
1.71531e-14
1.53e-12
5.81994e-15
5.31438e-13
1.41207e-15
1.45138e-13
3.31162e-16
3.72571e-14
1.38589e-16
1.30727e-14
1.24911e-16
1.07932e-14
2.76001e-16
9.92243e-15
2.52471e-16
9.92204e-15
2.58472e-16
1.35286e-14
3.26815e-16
3.28218e-14
6.9793e-16
9.36662e-14
2.93872e-15
2.42576e-13
8.66077e-15
8.13332e-14
0.121327
1.74044
0.266619
5.64633
0.195346
5.84339
0.430368
3.37429
1.28908
4.23664
1.42394
3.03667
1.0914
1.17586
0.720109
-0.711626
0.0961644
-1.06213
0.0961644
-4.38957e-15
4.2119
-9.5864
4.6637
-19.1437
5.11578
-19.643
5.56989
-19.8265
0.101396
-7.39334
-1.73915e-12
-9.49203e-14
6.42045e-12
-1.44272e-11
4.61784e-11
-9.65922e-11
5.73593e-11
-1.28753e-10
5.34694e-11
-9.7128e-11
3.87959e-11
-5.62927e-11
1.97946e-11
-2.00719e-11
8.67802e-12
-5.13214e-12
3.94049e-12
-1.23847e-12
1.99313e-12
-3.35734e-13
1.11428e-12
-1.02243e-13
6.58787e-13
-3.14851e-14
3.90012e-13
-7.75536e-15
2.1892e-13
-8.25512e-16
1.06756e-13
-3.06851e-16
3.7685e-14
-1.52162e-16
7.29092e-15
-9.50762e-17
2.12163e-15
-7.0513e-17
2.05886e-15
-3.16633e-17
1.95984e-15
-2.69934e-17
2.43336e-15
-2.40675e-17
3.42536e-15
-1.92982e-17
8.21299e-15
-1.07738e-17
2.47702e-14
-4.22055e-19
6.38704e-14
3.31994e-17
1.24034e-13
1.22949e-16
1.57884e-13
2.27537e-16
1.61133e-13
2.54988e-16
1.47358e-13
2.50712e-16
1.05908e-13
1.89178e-16
5.2633e-14
1.05867e-16
1.66049e-14
5.66954e-17
4.78234e-15
4.54829e-17
3.75426e-15
1.04884e-16
3.24438e-15
8.44961e-17
3.39011e-15
8.49927e-17
4.10523e-15
1.0103e-16
5.29974e-15
1.29306e-16
1.32497e-14
2.55615e-16
3.83247e-14
8.63778e-16
1.1302e-13
2.69336e-15
3.20196e-13
7.8785e-15
8.90412e-13
2.23554e-14
2.14528e-12
5.06924e-14
2.58368e-13
0.0255027
-0.000236164
0.643374
0.462071
1.27896
4.43022
1.66251
5.71484
1.72524
4.69661
1.57818
3.18301
1.32046
1.43296
0.901875
-0.293119
0.121219
-0.138731
0.205066
-0.0838469
4.47023
-13.5985
4.76751
-19.4409
5.1309
-20.0064
4.50694
-19.2025
-4.51561e-12
-2.94188
-4.51754e-12
-9.11832e-14
1.55231e-11
-3.45626e-11
5.62009e-11
-1.39536e-10
5.6367e-11
-1.32958e-10
4.29175e-11
-8.68461e-11
1.78204e-11
-3.13404e-11
4.79382e-12
-5.74745e-12
1.21104e-12
-7.08234e-13
3.69187e-13
-8.81297e-14
1.35633e-13
-1.34942e-14
5.31039e-14
-1.21927e-15
1.87453e-14
-4.49382e-16
4.13421e-15
-1.78221e-16
1.61617e-15
-5.32262e-17
7.41586e-16
-2.91776e-17
4.11766e-16
-1.6772e-17
2.73193e-16
-1.02373e-17
2.29208e-16
-7.04905e-18
2.16909e-16
-5.78866e-18
2.35238e-16
-5.53101e-18
2.93171e-16
-5.58261e-18
3.82173e-16
-5.36446e-18
4.73709e-16
-4.44776e-18
5.64373e-16
-2.70945e-18
6.67612e-16
-3.33738e-19
7.76419e-16
8.88829e-18
8.42263e-16
1.78498e-17
8.50437e-16
2.36678e-17
8.28398e-16
2.61744e-17
8.04146e-16
2.62507e-17
8.32879e-16
2.62022e-17
9.60812e-16
2.78107e-17
1.2065e-15
3.14795e-17
1.56984e-15
3.71442e-17
2.06674e-15
4.55463e-17
2.78168e-15
5.90072e-17
3.77662e-15
7.91002e-17
6.95103e-15
1.16609e-16
1.89172e-14
2.84037e-16
5.48346e-14
8.44206e-16
1.51414e-13
2.52569e-15
3.92493e-13
7.1512e-15
9.7287e-13
1.95825e-14
2.16607e-12
4.42543e-14
1.29996e-13
-0.000236163
-7.98923e-10
0.0644273
-1.09358e-05
1.07279
0.363384
1.76398
2.55032
1.90079
3.20741
1.83082
3.25282
1.26228
1.33063
0.147399
0.0511951
0.00866818
-3.74739e-28
0.975288
-0.858564
4.41335
-16.8629
4.76403
-19.7916
5.09977
-20.3421
2.42308
-16.6976
-8.89117e-12
-0.566432
-8.89617e-12
-8.91515e-14
2.83852e-11
-7.15566e-11
5.57394e-11
-1.69391e-10
5.07253e-11
-1.31845e-10
2.41498e-11
-6.23305e-11
4.90413e-12
-1.17201e-11
5.73765e-13
-8.46485e-13
6.92827e-14
-3.63934e-14
1.1872e-14
-1.21677e-15
2.15019e-15
-4.84322e-16
9.64409e-16
-1.44585e-16
4.38225e-16
-6.03115e-17
2.0292e-16
-2.31428e-17
1.20526e-16
-8.81901e-18
7.62746e-17
-3.77813e-18
5.03098e-17
-2.23363e-18
3.53214e-17
-1.96669e-18
2.83279e-17
-2.153e-18
2.78233e-17
-2.47379e-18
3.32179e-17
-2.77769e-18
4.46255e-17
-2.96348e-18
6.23146e-17
-2.95573e-18
8.57e-17
-2.71632e-18
1.13076e-16
-2.2512e-18
1.42878e-16
-1.58887e-18
1.73604e-16
-7.7041e-19
2.03854e-16
3.64126e-19
2.36143e-16
2.55195e-18
2.74521e-16
4.50894e-18
3.23359e-16
6.16454e-18
3.87302e-16
7.49589e-18
4.71486e-16
8.57147e-18
5.83381e-16
9.60563e-18
7.36558e-16
1.10042e-17
9.60048e-16
1.34538e-17
1.32609e-15
1.8251e-17
1.94405e-15
2.73285e-17
2.8756e-15
4.2494e-17
4.96827e-15
6.46144e-17
1.15995e-14
4.71019e-17
2.877e-14
1.03946e-16
6.68311e-14
2.38099e-16
1.4293e-13
4.89286e-16
2.90821e-13
1.01613e-15
1.41747e-15
1.81663e-11
2.5173e-09
-1.09357e-05
5.99061e-17
0.00092229
5.89806e-17
0.318014
-5.42899e-14
0.730677
-0.000398271
0.735139
0.105064
0.234676
-0.00161999
-6.25175e-29
-8.56831e-12
5.819e-28
-7.15936e-28
2.34277
-2.74671
4.35584
-18.752
4.73808
-20.1739
5.05219
-20.6562
0.53971
-12.3794
-3.00917e-11
-0.040648
-1.58021e-11
-1.43772e-11
4.41799e-11
-1.30386e-10
5.54011e-11
-1.83463e-10
3.93892e-11
-1.19518e-10
9.61056e-12
-3.44652e-11
7.16765e-13
-2.79875e-12
2.52891e-14
-5.86913e-14
9.48429e-16
-6.31823e-16
4.57859e-16
-2.086e-16
2.15711e-16
-7.8962e-17
1.27884e-16
-2.29542e-17
6.3517e-17
-5.54542e-18
2.86116e-17
-1.36741e-18
1.26325e-17
-6.22896e-19
6.22622e-18
-6.19018e-19
4.23494e-18
-7.67481e-19
4.31741e-18
-9.52418e-19
5.5446e-18
-1.13938e-18
7.63677e-18
-1.3076e-18
1.06086e-17
-1.43696e-18
1.45989e-17
-1.50925e-18
1.97758e-17
-1.51303e-18
2.63002e-17
-1.44744e-18
3.43553e-17
-1.32159e-18
4.40854e-17
-1.15054e-18
5.55716e-17
-9.5087e-19
6.89314e-17
-7.37617e-19
8.4092e-17
-5.24832e-19
1.01185e-16
-3.29123e-19
1.20707e-16
-1.70747e-19
1.43308e-16
-6.66712e-20
1.69779e-16
-1.96912e-20
2.01128e-16
-1.21363e-20
2.3886e-16
-8.17866e-21
2.85877e-16
9.88517e-20
3.49132e-16
4.49789e-19
4.39526e-16
1.17974e-18
5.5669e-16
2.48609e-18
6.77903e-16
4.49243e-18
7.63786e-16
7.02726e-18
9.46337e-16
1.15188e-17
1.29077e-15
1.99459e-17
1.82912e-15
3.46479e-17
2.67115e-15
6.00952e-17
8.66853e-17
1.38431e-17
2.5173e-09
1.68945e-18
7.20598e-17
8.01633e-18
5.00113e-17
1.85471e-17
-5.43528e-14
-0.000398271
-2.56197e-15
0.00161999
-6.85354e-10
6.43161e-18
1.23728e-17
-4.95196e-29
-8.5683e-12
0
-1.06872e-27
3.5281
-5.79894
4.50386
-19.6755
4.7761
-20.4461
5.0234
-20.9035
0.040648
-7.59887
-2.72034e-12
-9.87366e-14
9.04823e-12
-2.5779e-11
5.52687e-11
-1.74167e-10
5.24892e-11
-1.83578e-10
2.37072e-11
-9.49167e-11
2.50165e-12
-1.50382e-11
5.13027e-14
-4.23159e-13
3.74657e-16
-1.55034e-15
1.38118e-16
-1.66028e-16
8.00302e-17
-4.59397e-17
3.34857e-17
-8.29386e-18
1.09223e-17
-8.22936e-19
3.00114e-18
-1.49185e-19
8.51005e-19
-1.65245e-19
4.49759e-19
-2.17246e-19
5.2273e-19
-2.80839e-19
7.64102e-19
-3.56975e-19
1.12793e-18
-4.44481e-19
1.62313e-18
-5.33181e-19
2.2754e-18
-6.17026e-19
3.11792e-18
-6.92197e-19
4.18892e-18
-7.52344e-19
5.52897e-18
-7.93103e-19
7.1803e-18
-8.1543e-19
9.18875e-18
-8.21841e-19
1.16143e-17
-8.15539e-19
1.45462e-17
-8.00047e-19
1.81146e-17
-7.79496e-19
2.24885e-17
-7.59214e-19
2.78625e-17
-7.4648e-19
3.44402e-17
-7.50231e-19
4.24266e-17
-7.78219e-19
5.20496e-17
-8.33051e-19
6.36077e-17
-9.09577e-19
7.75468e-17
-9.94719e-19
9.45071e-17
-1.06891e-18
1.1533e-16
-1.10957e-18
1.40741e-16
-1.09414e-18
1.70986e-16
-9.98945e-19
2.05588e-16
-7.95728e-19
2.44378e-16
-4.48829e-19
2.88526e-16
1.82078e-19
3.40046e-16
1.83949e-18
4.01476e-16
4.26377e-18
4.76676e-16
7.73287e-18
1.20285e-17
0.00155026
0.0159032
-9.03316e-14
0.00251336
-9.03697e-14
6.2443e-17
-9.38477e-15
2.94517e-13
-8.23209e-16
6.46207e-15
-1.95378e-17
-6.85355e-10
-1.47645e-11
1.47646e-11
5.54362e-13
6.25751e-12
5.54362e-13
-3.07382e-27
4.27196
-9.75079
4.62298
-20.0154
4.81587
-20.639
4.18219
-20.2699
-5.3304e-12
-3.61309
-5.33283e-12
-9.59885e-14
1.66904e-11
-4.56867e-11
5.53704e-11
-2.09426e-10
4.61575e-11
-1.77067e-10
1.20307e-11
-6.58597e-11
4.27332e-13
-4.86795e-12
1.5855e-15
-3.68529e-14
1.2214e-16
-2.25141e-17
3.12222e-17
-2.80719e-18
7.26044e-18
-1.52663e-19
1.0279e-18
-2.57979e-20
7.8245e-20
-3.88854e-20
1.25573e-20
-5.37022e-20
1.63965e-20
-7.11777e-20
3.05816e-20
-9.18724e-20
5.80196e-20
-1.16414e-19
1.05595e-19
-1.4576e-19
1.82329e-19
-1.80337e-19
2.96035e-19
-2.19064e-19
4.57348e-19
-2.59927e-19
6.81821e-19
-3.09641e-19
9.86904e-19
-3.57645e-19
1.39346e-18
-4.003e-19
1.93151e-18
-4.39732e-19
2.63845e-18
-4.76835e-19
3.55936e-18
-5.11561e-19
4.74623e-18
-5.43599e-19
6.2584e-18
-5.75146e-19
8.16123e-18
-6.09087e-19
1.05238e-17
-6.48939e-19
1.34181e-17
-6.98733e-19
1.69249e-17
-7.61982e-19
2.11501e-17
-8.40331e-19
2.62408e-17
-9.32074e-19
3.23806e-17
-1.03126e-18
3.97548e-17
-1.12793e-18
4.85034e-17
-1.21001e-18
5.86946e-17
-1.26533e-18
7.03615e-17
-1.28202e-18
8.35694e-17
-1.24707e-18
9.85321e-17
-1.1441e-18
1.15764e-16
-9.50617e-19
1.35697e-16
-6.3281e-19
1.58748e-16
-1.42854e-19
1.84888e-16
1.25369e-18
3.14511e-18
0.00650319
0.0226292
-4.81951e-13
0.0076868
-4.81975e-13
8.04296e-17
4.98442e-15
1.71129e-11
-5.90928e-10
5.90958e-10
-1.07213e-08
2.73225e-09
4.8287e-11
4.75152e-09
3.99922e-11
-1.56305e-10
3.99922e-11
-4.8974e-17
4.4487
-13.963
4.67888
-20.2456
4.83268
-20.7928
2.69063
-18.5392
-8.3436e-12
-1.06861
-8.34794e-12
-9.34373e-14
2.45669e-11
-7.15121e-11
5.09222e-11
-2.30936e-10
3.68962e-11
-1.65236e-10
4.53166e-12
-3.96353e-11
4.21869e-14
-1.22031e-12
1.99096e-17
-2.08202e-15
2.099e-18
-1.12338e-17
6.87648e-20
-2.15399e-19
-2.0406e-21
-2.81614e-20
-7.44521e-21
-1.0225e-20
-1.48505e-20
-1.32366e-20
-2.27321e-20
-1.81732e-20
-3.00389e-20
-2.47804e-20
-3.6178e-20
-3.31818e-20
-4.03478e-20
-4.32166e-20
-4.08847e-20
-5.48704e-20
-3.50113e-20
-6.85447e-20
-1.89425e-20
-8.49026e-20
9.51749e-21
-1.04265e-19
5.22226e-20
-1.26297e-19
1.21715e-19
-1.50261e-19
2.26621e-19
-1.75522e-19
3.79956e-19
-2.01733e-19
5.98304e-19
-2.33516e-19
9.00319e-19
-2.66293e-19
1.30461e-18
-2.96981e-19
1.83448e-18
-3.28859e-19
2.51702e-18
-3.63782e-19
3.3837e-18
-4.03426e-19
4.47177e-18
-4.49301e-19
5.8261e-18
-5.0272e-19
7.50164e-18
-5.64452e-19
9.56172e-18
-6.33502e-19
1.20688e-17
-7.06469e-19
1.50728e-17
-7.77758e-19
1.86037e-17
-8.40857e-19
2.26754e-17
-8.90127e-19
2.72979e-17
-9.21053e-19
3.2488e-17
-9.28317e-19
3.82719e-17
-9.04368e-19
4.46795e-17
-8.3805e-19
5.1728e-17
-7.1181e-19
5.93664e-17
-5.02892e-19
6.80029e-17
-2.00924e-19
3.16137e-19
0.0190389
2.63113e-05
-8.5345e-11
0.0191273
-8.5345e-11
8.71893e-17
-1.23637e-09
2.35395e-09
-7.71902e-10
4.85912e-08
-3.88694e-08
3.36556e-08
9.69548e-10
-2.29739e-08
5.86574e-11
-1.73884e-17
0.943658
-0.943658
4.60539
-17.3964
4.73945
-20.3796
4.84728
-20.9006
0.981366
-15.0374
-1.13357e-11
-0.143558
-1.13395e-11
-8.91561e-14
3.14861e-11
-1.01702e-10
4.84272e-11
-2.41468e-10
2.47844e-11
-1.47354e-10
1.29577e-12
-2.20423e-11
2.49492e-15
-2.5492e-13
2.16885e-17
-5.36201e-17
-6.88201e-21
-3.15451e-18
-4.9667e-21
-4.97165e-19
-3.48098e-21
-6.68854e-20
-6.35822e-21
-5.3959e-21
-1.01651e-20
-3.69369e-21
-1.45139e-20
-5.23444e-21
-1.94502e-20
-7.37272e-21
-2.50488e-20
-1.01088e-20
-3.12942e-20
-1.35705e-20
-3.82e-20
-1.79048e-20
-4.56718e-20
-2.31374e-20
-5.29961e-20
-2.9293e-20
-5.86398e-20
-3.65823e-20
-6.0352e-20
-4.53529e-20
-5.52396e-20
-5.59661e-20
-3.94063e-20
-6.85014e-20
-7.96049e-21
-8.26871e-20
3.66183e-20
-9.79817e-20
1.05459e-19
-1.1411e-19
2.06272e-19
-1.31091e-19
3.47595e-19
-1.49303e-19
5.39902e-19
-1.70809e-19
7.95799e-19
-1.95457e-19
1.12992e-18
-2.22955e-19
1.55961e-18
-2.53907e-19
2.10578e-18
-2.88721e-19
2.79028e-18
-3.2658e-19
3.63102e-18
-3.65284e-19
4.63771e-18
-4.01721e-19
5.81091e-18
-4.32988e-19
7.14857e-18
-4.57437e-19
8.6516e-18
-4.73765e-19
1.03163e-17
-4.7905e-19
1.21255e-17
-4.69297e-19
1.40412e-17
-4.39548e-19
1.59879e-17
-3.82904e-19
1.77891e-17
-2.92891e-19
1.92551e-17
-1.75176e-19
-6.87726e-20
0.0522733
-0.161204
9.71445e-17
0.0506458
3.81861e-17
1.42446e-16
2.35395e-09
1.51489e-16
-8.06047e-08
2.44223e-07
-6.72458e-08
6.34521e-07
2.86131e-08
-1.71953e-07
2.86131e-08
-7.52928e-23
2.87011
-3.19435
4.81454
-19.1802
4.84091
-20.406
4.87832
-20.938
0.149962
-10.6161
-3.43468e-11
-0.0117282
-1.4771e-11
-1.96667e-11
3.76464e-11
-1.42653e-10
4.43018e-11
-2.42578e-10
1.56823e-11
-1.27008e-10
3.12033e-13
-1.15072e-11
8.08113e-17
-4.32392e-14
-1.02695e-19
-3.13456e-17
-9.17031e-20
-6.1106e-18
-2.50476e-20
-1.25026e-18
-2.98568e-21
-2.05658e-19
-2.38778e-21
-1.12756e-20
-3.42094e-21
-1.09407e-21
-4.66147e-21
-1.44955e-21
-6.24286e-21
-2.06436e-21
-8.32247e-21
-2.8477e-21
-1.11598e-20
-3.8138e-21
-1.50006e-20
-4.99514e-21
-1.98919e-20
-6.49094e-21
-2.57463e-20
-8.44718e-21
-3.2533e-20
-1.09765e-20
-4.01844e-20
-1.41247e-20
-4.81582e-20
-1.79431e-20
-5.52084e-20
-2.25181e-20
-5.95604e-20
-2.79168e-20
-5.92755e-20
-3.41455e-20
-5.23107e-20
-4.11541e-20
-3.63405e-20
-4.88959e-20
-8.6653e-21
-5.73865e-20
2.79103e-20
-6.6739e-20
7.96476e-20
-7.71393e-20
1.52533e-19
-8.87874e-20
2.51629e-19
-1.01847e-19
3.83098e-19
-1.16299e-19
5.52877e-19
-1.32163e-19
7.6487e-19
-1.47779e-19
1.01967e-18
-1.61734e-19
1.31544e-18
-1.73054e-19
1.65103e-18
-1.81356e-19
2.0251e-18
-1.86157e-19
2.42823e-18
-1.85853e-19
2.8413e-18
-1.78747e-19
3.23433e-18
-1.63374e-19
3.56075e-18
-1.3832e-19
3.74134e-18
-1.03594e-19
3.75434e-18
-6.45954e-20
-3.25453e-20
0.0477814
-0.208985
6.93889e-18
0.0735059
3.76009e-17
1.11781e-16
5.27987e-17
1.36292e-16
4.15864e-08
2.56099e-07
2.57242e-07
4.25092e-07
2.01946e-07
-2.14683e-07
2.01946e-07
-7.21988e-22
4.56849
-7.35479
5.03949
-19.6163
4.9717
-20.3382
4.92342
-20.8897
0.0117282
-5.95618
-3.0883e-12
-9.70281e-14
8.85304e-12
-2.96883e-11
4.27896e-11
-1.67841e-10
3.93386e-11
-2.34904e-10
9.66333e-12
-1.0854e-10
5.85427e-14
-5.58563e-12
-7.56884e-20
-5.87379e-15
-8.6345e-19
-4.98084e-17
-4.14437e-19
-1.26095e-17
-1.09495e-19
-3.32443e-18
-7.21917e-21
-6.70584e-19
-7.05579e-22
-4.06407e-20
-9.13504e-22
-8.28732e-22
-1.28211e-21
-3.7231e-22
-1.74769e-21
-5.37578e-22
-2.33663e-21
-7.49042e-22
-3.0908e-21
-1.01159e-21
-4.07963e-21
-1.33415e-21
-5.44573e-21
-1.73175e-21
-7.40976e-21
-2.22561e-21
-1.01748e-20
-2.85674e-21
-1.38235e-20
-3.6837e-21
-1.83151e-20
-4.77195e-21
-2.35125e-20
-6.17358e-21
-2.91729e-20
-7.90861e-21
-3.48833e-20
-9.96063e-21
-4.00486e-20
-1.23186e-20
-4.39789e-20
-1.49852e-20
-4.59728e-20
-1.79808e-20
-4.52923e-20
-2.13355e-20
-4.10718e-20
-2.50834e-20
-3.22294e-20
-2.9255e-20
-1.74253e-20
-3.38561e-20
3.96876e-21
-3.88049e-20
2.99543e-20
-4.38706e-20
6.48998e-20
-4.86453e-20
1.09072e-19
-5.27086e-20
1.6206e-19
-5.57559e-20
2.23275e-19
-5.76848e-20
2.91596e-19
-5.83214e-20
3.632e-19
-5.71559e-20
4.31646e-19
-5.36119e-20
4.88193e-19
-4.74412e-20
5.21813e-19
-3.87342e-20
5.18963e-19
-2.8148e-20
4.86408e-19
-1.75221e-20
-9.39347e-21
-0.00865856
-0.200327
1.04083e-17
0.034936
2.37865e-17
9.8306e-17
2.22939e-17
1.37784e-16
7.06924e-08
3.29998e-07
2.6969e-07
2.19718e-07
7.42871e-08
-6.31468e-08
7.42871e-08
-3.25676e-17
5.35734
-12.4062
5.23409
-19.4931
5.10971
-20.2138
3.82772
-19.6077
-5.24991e-12
-2.30266
-5.25403e-12
-9.40122e-14
1.41108e-11
-4.65346e-11
4.20593e-11
-1.83221e-10
3.26742e-11
-2.21071e-10
5.77354e-12
-9.50636e-11
6.37021e-15
-2.43815e-12
-3.86588e-18
-2.63832e-16
-3.13198e-18
-8.25044e-17
-1.51234e-18
-2.7126e-17
-3.98538e-19
-9.04098e-18
-2.49791e-20
-2.13473e-18
-5.11127e-22
-1.4492e-19
-2.29485e-22
-2.75358e-21
-3.29814e-22
-8.9339e-23
-4.57633e-22
-1.30533e-22
-6.18322e-22
-1.84167e-22
-8.227e-22
-2.50568e-22
-1.08954e-21
-3.31273e-22
-1.44518e-21
-4.30095e-22
-1.9211e-21
-5.53476e-22
-2.56382e-21
-7.11177e-22
-3.44407e-21
-9.15294e-22
-4.6476e-21
-1.18022e-21
-6.24461e-21
-1.5217e-21
-8.25742e-21
-1.9532e-21
-1.0654e-20
-2.48179e-21
-1.33783e-20
-3.10873e-21
-1.6367e-20
-3.8353e-21
-1.95354e-20
-4.6669e-21
-2.27506e-20
-5.61375e-21
-2.58219e-20
-6.6861e-21
-2.85024e-20
-7.88814e-21
-3.04673e-20
-9.21172e-21
-3.12969e-20
-1.06217e-20
-3.05512e-20
-1.20363e-20
-2.7894e-20
-1.33266e-20
-2.32237e-20
-1.436e-20
-1.66519e-20
-1.50484e-20
-8.36858e-21
-1.53698e-20
1.18833e-21
-1.52876e-20
1.11233e-20
-1.46837e-20
2.12554e-20
-1.34432e-20
3.02225e-20
-1.15755e-20
3.65348e-20
-9.21812e-21
3.87493e-20
-6.63091e-21
3.76276e-20
-4.20611e-21
-2.35296e-21
-0.0502698
-0.150057
-2.31171e-17
0.0186885
1.25047e-18
7.39383e-17
8.52059e-18
1.30514e-16
4.53817e-08
4.66862e-07
7.95879e-08
5.98684e-10
5.2246e-09
-8.6211e-16
1.20587
-1.20587
5.59864
-16.5486
5.40823
-19.3027
5.24012
-20.0457
1.83582
-16.6984
-7.35126e-12
-0.577503
-7.35576e-12
-8.96826e-14
1.81417e-11
-6.77997e-11
3.68021e-11
-1.87238e-10
2.50805e-11
-2.04971e-10
3.28647e-12
-8.80042e-11
-3.48737e-18
-1.04241e-12
-1.27071e-17
-3.43708e-16
-9.38682e-18
-1.39313e-16
-4.73026e-18
-5.91796e-17
-1.224e-18
-2.39349e-17
-8.50335e-20
-6.30997e-18
-1.64266e-21
-4.88307e-19
-5.36373e-23
-1.13573e-20
-7.86137e-23
-2.11991e-23
-1.11205e-22
-2.95462e-23
-1.52161e-22
-4.22196e-23
-2.03357e-22
-5.80311e-23
-2.68413e-22
-7.71615e-23
-3.53624e-22
-1.00241e-22
-4.68246e-22
-1.28597e-22
-6.24804e-22
-1.64431e-22
-8.38036e-22
-2.10782e-22
-1.12291e-21
-2.71411e-22
-1.49239e-21
-3.50303e-22
-1.95602e-21
-4.50659e-22
-2.5199e-21
-5.73968e-22
-3.18899e-21
-7.20242e-22
-3.97039e-21
-8.89356e-22
-4.87307e-21
-1.08235e-21
-5.90624e-21
-1.30099e-21
-7.07485e-21
-1.54685e-21
-8.37116e-21
-1.82046e-21
-9.75483e-21
-2.12021e-21
-1.11308e-20
-2.43902e-21
-1.23509e-20
-2.75847e-21
-1.32553e-20
-3.04756e-21
-1.37317e-20
-3.27157e-21
-1.37421e-20
-3.40606e-21
-1.32559e-20
-3.44627e-21
-1.22004e-20
-3.3893e-21
-1.05568e-20
-3.21307e-21
-8.44866e-21
-2.89527e-21
-6.14046e-21
-2.44649e-21
-3.91365e-21
-1.91556e-21
-2.11954e-21
-1.36773e-21
-7.98235e-22
-8.91211e-22
-5.0743e-22
-0.0578938
-0.0171994
-2.54241e-10
0.00443766
-2.54241e-10
7.32441e-17
-1.19005e-08
7.23697e-09
7.49587e-08
4.39205e-07
3.63501e-08
-1.43407e-09
3.63501e-08
-3.24867e-23
4.12525
-4.54946
5.78599
-18.0611
5.58534
-19.102
5.37192
-19.8323
0.560221
-12.2955
-1.7463e-11
-0.0513563
-8.92918e-12
-8.62474e-12
2.12261e-11
-9.24828e-11
3.05409e-11
-1.80997e-10
1.84983e-11
-1.88471e-10
1.71572e-12
-8.7342e-11
-2.24889e-17
-9.62939e-13
-3.15639e-17
-4.34595e-16
-2.484e-17
-2.33103e-16
-1.25733e-17
-1.25537e-16
-3.41685e-18
-5.87219e-17
-2.77041e-19
-1.73017e-17
-6.52841e-21
-1.56096e-18
-1.23901e-23
-4.30997e-20
-1.74188e-23
-8.16972e-24
-2.50898e-23
-6.32026e-24
-3.47964e-23
-9.04097e-24
-4.68596e-23
-1.25495e-23
-6.19372e-23
-1.67913e-23
-8.12273e-23
-2.18604e-23
-1.06617e-22
-2.7993e-23
-1.40796e-22
-3.56205e-23
-1.87216e-22
-4.53869e-23
-2.49765e-22
-5.81192e-23
-3.31958e-22
-7.47321e-23
-4.35999e-22
-9.59959e-23
-5.62495e-22
-1.22307e-22
-7.11311e-22
-1.5364e-22
-8.82696e-22
-1.89832e-22
-1.07776e-21
-2.30873e-22
-1.29769e-21
-2.76902e-22
-1.54299e-21
-3.27961e-22
-1.81292e-21
-3.83796e-22
-2.10233e-21
-4.43737e-22
-2.39658e-21
-5.0618e-22
-2.66937e-21
-5.67357e-22
-2.88928e-21
-6.20899e-22
-3.03152e-21
-6.59541e-22
-3.08709e-21
-6.78141e-22
-3.04857e-21
-6.76319e-22
-2.89319e-21
-6.55035e-22
-2.6016e-21
-6.11446e-22
-2.18539e-21
-5.41954e-22
-1.70219e-21
-4.49188e-22
-1.20739e-21
-3.45613e-22
-7.89507e-22
-2.43436e-22
-4.7723e-22
-1.60398e-22
-9.8041e-23
-0.00443766
-0.00411339
-4.61843e-17
4.61319e-17
-8.68221e-12
8.68224e-12
-5.55779e-08
3.2092e-08
6.85397e-08
1.1839e-07
2.45452e-08
-3.21561e-09
2.45452e-08
-2.93073e-17
6.07
-10.2061
5.98355
-17.9746
5.76073
-18.8792
5.50681
-19.5784
0.0513563
-7.19835
-1.32803e-12
-1.23595e-13
3.28368e-12
-1.21101e-11
2.40765e-11
-1.06636e-10
2.59157e-11
-1.67465e-10
1.35674e-11
-1.60571e-10
5.44075e-13
-8.70794e-11
-8.00335e-17
-2.15981e-12
-6.75016e-17
-5.75609e-16
-5.71491e-17
-3.90432e-16
-2.92649e-17
-2.41031e-16
-9.10675e-18
-1.34247e-16
-8.4525e-19
-4.5199e-17
-2.40045e-20
-4.73146e-18
-4.63776e-24
-1.47465e-19
-3.64138e-24
-1.13899e-23
-5.27513e-24
-1.45691e-24
-7.41296e-24
-1.81731e-24
-1.0056e-23
-2.54002e-24
-1.33128e-23
-3.42071e-24
-1.74026e-23
-4.46193e-24
-2.26846e-23
-5.70155e-24
-2.96852e-23
-7.21769e-24
-3.91066e-23
-9.13247e-24
-5.17613e-23
-1.16092e-23
-6.84085e-23
-1.48351e-23
-8.95302e-23
-1.89749e-23
-1.15261e-22
-2.41146e-23
-1.45523e-22
-3.0243e-23
-1.80256e-22
-3.7302e-23
-2.19478e-22
-4.52506e-23
-2.63125e-22
-5.40714e-23
-3.10884e-22
-6.37183e-23
-3.62161e-22
-7.40683e-23
-4.15591e-22
-8.49277e-23
-4.68023e-22
-9.59588e-23
-5.14041e-22
-1.06468e-22
-5.47351e-22
-1.15272e-22
-5.63255e-22
-1.21006e-22
-5.61002e-22
-1.22694e-22
-5.4112e-22
-1.20374e-22
-5.01264e-22
-1.14572e-22
-4.39122e-22
-1.05106e-22
-3.57692e-22
-9.15532e-23
-2.69271e-22
-7.44046e-23
-1.84224e-22
-5.61763e-23
-1.15276e-22
-3.90287e-23
-6.73871e-23
-2.5569e-23
-1.60344e-23
-3.22627e-10
-0.00171363
-3.22627e-10
6.31598e-17
-2.01236e-09
5.35844e-10
-1.16452e-08
1.10843e-08
4.31153e-09
1.31017e-09
4.62486e-11
-1.24404e-16
1.31858
-1.31858
6.42227
-15.0075
6.17489
-17.7273
5.93215
-18.6365
4.62953
-18.2757
-2.36444e-12
-2.85175
-2.3746e-12
-1.16761e-13
5.90477e-12
-1.87088e-11
2.58131e-11
-1.18977e-10
2.09035e-11
-1.45744e-10
8.97113e-12
-1.23521e-10
-1.55309e-13
-8.79343e-11
-2.02136e-16
-7.63373e-12
-1.3194e-16
-1.23827e-15
-1.09507e-16
-8.34167e-16
-6.35798e-17
-3.92216e-16
-2.29056e-17
-3.29943e-16
-2.46365e-18
-1.17141e-16
-7.95129e-20
-1.3806e-17
-6.28269e-24
-4.51568e-19
-8.1936e-25
-2.56859e-23
-1.03865e-24
-7.55738e-25
-1.47378e-24
-3.58041e-25
-2.016e-24
-4.82038e-25
-2.67513e-24
-6.52794e-25
-3.48471e-24
-8.53626e-25
-4.50742e-24
-1.08853e-24
-5.8401e-24
-1.36988e-24
-7.61363e-24
-1.71894e-24
-9.98254e-24
-2.16531e-24
-1.30943e-23
-2.74385e-24
-1.70432e-23
-3.48605e-24
-2.18473e-23
-4.40851e-24
-2.74739e-23
-5.50748e-24
-3.38823e-23
-6.76748e-24
-4.10396e-23
-8.17394e-24
-4.88841e-23
-9.71584e-24
-5.72914e-23
-1.13753e-23
-6.60819e-23
-1.3118e-23
-7.49649e-23
-1.48973e-23
-8.33598e-23
-1.66493e-23
-9.02941e-23
-1.82581e-23
-9.46471e-23
-1.95293e-23
-9.55988e-23
-2.02359e-23
-9.31598e-23
-2.02144e-23
-8.77378e-23
-1.9489e-23
-7.92735e-23
-1.82051e-23
-6.76116e-23
-1.63918e-23
-5.33589e-23
-1.40238e-23
-3.87649e-23
-1.11692e-23
-2.55403e-23
-8.26507e-24
-1.53087e-23
-5.64986e-24
-8.60853e-24
-3.64741e-24
-2.29266e-24
-5.41586e-11
-0.000550053
-5.41586e-11
7.68794e-17
-8.96858e-11
1.01241e-10
-1.27221e-08
1.10556e-08
5.2869e-08
-1.96017e-08
5.2869e-08
-1.29379e-16
5.07723
-5.522
6.61109
-16.3637
6.37218
-17.4884
6.09606
-18.3604
2.54401
-15.3182
-3.53018e-12
-0.47988
-3.53568e-12
-1.08968e-13
8.41588e-12
-2.83934e-11
2.38355e-11
-1.26663e-10
1.43567e-11
-1.23062e-10
5.00941e-12
-8.76022e-11
-1.11934e-12
-8.68579e-11
-1.46863e-14
-2.08044e-11
-4.60554e-16
-1.40367e-13
-1.71468e-16
-3.734e-15
-1.52541e-16
-7.03842e-16
-5.66343e-17
-1.1714e-15
-6.96153e-18
-2.85512e-16
-2.3564e-19
-3.94879e-17
-1.37783e-23
-1.22736e-18
-4.14638e-25
-5.69979e-23
-2.00268e-25
-1.17363e-24
-2.74341e-25
-9.90414e-26
-3.77812e-25
-8.71845e-26
-5.02658e-25
-1.16922e-25
-6.53013e-25
-1.53195e-25
-8.38444e-25
-1.94934e-25
-1.0748e-24
-2.43805e-25
-1.3844e-24
-3.03137e-25
-1.79437e-24
-3.77816e-25
-2.33102e-24
-4.7377e-25
-3.01082e-24
-5.96507e-25
-3.83514e-24
-7.48915e-25
-4.79429e-24
-9.3002e-25
-5.87587e-24
-1.13633e-24
-7.06786e-24
-1.36417e-24
-8.35156e-24
-1.61045e-24
-9.6948e-24
-1.87076e-24
-1.10557e-23
-2.13765e-24
-1.23789e-23
-2.4015e-24
-1.35703e-23
-2.65119e-24
-1.44758e-23
-2.86951e-24
-1.49211e-23
-3.02774e-24
-1.47816e-23
-3.09304e-24
-1.40816e-23
-3.04121e-24
-1.29365e-23
-2.87906e-24
-1.13904e-23
-2.636e-24
-9.45726e-24
-2.32641e-24
-7.23517e-24
-1.95272e-24
-5.07614e-24
-1.52276e-24
-3.22634e-24
-1.10251e-24
-1.85769e-24
-7.39429e-25
-1.00659e-24
-4.67606e-25
-2.90676e-25
-2.43681e-17
1.16226e-16
-2.66125e-17
7.91239e-17
-1.47984e-17
1.01241e-10
8.47012e-11
1.09709e-08
9.71429e-08
-4.13875e-08
0.852035
-0.852035
6.99389
-11.2594
6.83305
-16.2029
6.57223
-17.2275
6.24941
-18.0376
0.475599
-9.94037
-7.75756e-12
-0.028711
-4.27018e-12
-3.60009e-12
1.08374e-11
-4.0531e-11
1.99638e-11
-1.28226e-10
1.04354e-11
-1.02466e-10
2.24615e-12
-5.72203e-11
-3.30118e-12
-8.0956e-11
-4.91822e-13
-4.35227e-11
-6.87583e-14
-3.28666e-12
-1.73772e-14
-4.51396e-13
-9.07129e-16
-1.14923e-13
-1.32862e-16
-6.45454e-15
-1.92723e-17
-2.99672e-16
-6.20846e-19
-1.05593e-16
-2.97539e-23
-2.92826e-18
-6.28226e-25
-1.1738e-22
-5.41837e-26
-2.25717e-24
-4.8619e-26
-8.48561e-26
-6.63799e-26
-1.73763e-26
-8.85076e-26
-1.9779e-26
-1.1465e-25
-2.5832e-26
-1.46078e-25
-3.27907e-26
-1.85182e-25
-4.07398e-26
-2.35448e-25
-5.01487e-26
-3.01217e-25
-6.17597e-26
-3.86754e-25
-7.65005e-26
-4.94669e-25
-9.52544e-26
-6.24833e-25
-1.18479e-25
-7.74997e-25
-1.4596e-25
-9.4226e-25
-1.77001e-25
-1.12372e-24
-2.10849e-25
-1.31523e-24
-2.46837e-25
-1.51021e-24
-2.84109e-25
-1.70049e-24
-3.2129e-25
-1.87675e-24
-3.56682e-25
-2.02533e-24
-3.88505e-25
-2.12482e-24
-4.14458e-25
-2.15158e-24
-4.30763e-25
-2.08937e-24
-4.33252e-25
-1.94482e-24
-4.18882e-25
-1.74144e-24
-3.89083e-25
-1.49279e-24
-3.48842e-25
-1.2062e-24
-3.01372e-25
-8.94664e-25
-2.47853e-25
-6.06397e-25
-1.89016e-25
-3.72235e-25
-1.33625e-25
-2.06163e-25
-8.76828e-26
-1.07718e-25
-5.40774e-26
-3.2968e-26
-1.51188e-17
1.32972e-16
-6.90972e-08
6.90972e-08
2.813e-07
5.20632e-07
2.67398e-06
-7.42704e-07
2.81549e-06
-1.04799e-07
3.87451
-4.29203
7.32188
-14.524
7.05719
-15.9382
6.76055
-16.9309
5.77981
-17.0568
0.028711
-4.49995
-7.27809e-13
-1.10611e-13
1.78409e-12
-5.39427e-12
1.42002e-11
-4.87199e-11
1.79095e-11
-1.24042e-10
7.28785e-12
-8.26813e-11
7.64894e-13
-3.39988e-11
-4.99322e-12
-7.18642e-11
-3.90812e-12
-6.5273e-11
-1.51447e-12
-2.10576e-11
-6.51104e-13
-7.65792e-12
-9.39366e-14
-3.22651e-12
-1.91e-15
-4.39832e-13
-9.58972e-17
-1.18058e-14
-1.43893e-18
-2.48207e-16
-5.96953e-23
-6.00564e-18
-1.17949e-24
-2.22833e-22
-4.54085e-26
-4.12678e-24
-9.49041e-27
-1.32264e-25
-1.10052e-26
-7.55442e-27
-1.46275e-26
-3.32955e-27
-1.88907e-26
-4.1048e-27
-2.38804e-26
-5.18811e-27
-2.99183e-26
-6.40058e-27
-3.7506e-26
-7.79475e-27
-4.7287e-26
-9.47416e-27
-5.98995e-26
-1.15739e-26
-7.57215e-26
-1.42247e-26
-9.4672e-26
-1.74933e-26
-1.16301e-25
-2.13381e-26
-1.40036e-25
-2.56364e-26
-1.65312e-25
-3.02539e-26
-1.91372e-25
-3.50698e-26
-2.17081e-25
-3.99408e-26
-2.41073e-25
-4.46495e-26
-2.61936e-25
-4.89308e-26
-2.77914e-25
-5.25304e-26
-2.86368e-25
-5.51649e-26
-2.84533e-25
-5.63983e-26
-2.70639e-25
-5.57699e-26
-2.46054e-25
-5.29558e-26
-2.14616e-25
-4.82194e-26
-1.78967e-25
-4.23026e-26
-1.40669e-25
-3.57258e-26
-1.01151e-25
-2.87535e-26
-6.62321e-26
-2.1414e-26
-3.92847e-26
-1.47517e-26
-2.09378e-26
-9.44694e-27
-1.05479e-26
-5.66163e-27
-3.36583e-27
-3.47209e-17
1.68631e-16
-3.01964e-07
9.03833e-07
3.71806e-06
1.2456e-06
5.34483e-06
5.83917e-08
1.04934
-1.04933
7.51371
-10.4759
7.55654
-14.5668
7.27365
-15.6553
6.94209
-16.5993
4.09629
-14.5397
-1.3608e-12
-0.573112
-1.34941e-12
-1.00634e-13
3.19664e-12
-8.50209e-12
1.56424e-11
-5.55657e-11
1.57705e-11
-1.16071e-10
4.0049e-12
-6.32371e-11
-2.63829e-13
-1.86968e-11
-8.07444e-12
-5.68681e-11
-1.06542e-11
-7.63807e-11
-7.98029e-12
-5.35858e-11
-5.31694e-12
-3.48416e-11
-1.52368e-12
-2.11667e-11
-9.10648e-14
-5.38e-12
-2.24848e-16
-3.528e-13
-2.86854e-18
-4.83251e-16
-1.10571e-22
-1.00352e-17
-2.1071e-24
-3.88746e-22
-6.92513e-26
-6.97788e-24
-4.04056e-27
-2.0872e-25
-1.81492e-27
-8.60791e-27
-2.27674e-27
-8.0794e-28
-2.92557e-27
-6.25602e-28
-3.66795e-27
-7.73329e-28
-4.53904e-27
-9.46539e-28
-5.60528e-27
-1.13971e-27
-6.95505e-27
-1.36583e-27
-8.67702e-27
-1.64317e-27
-1.08214e-26
-1.98982e-27
-1.33677e-26
-2.41495e-27
-1.62366e-26
-2.91141e-27
-1.93306e-26
-3.4599e-27
-2.25537e-26
-4.03878e-27
-2.57879e-26
-4.62894e-27
-2.88633e-26
-5.20957e-27
-3.15794e-26
-5.75e-27
-3.37447e-26
-6.21391e-27
-3.51596e-26
-6.56908e-27
-3.55373e-26
-6.78449e-27
-3.46045e-26
-6.81477e-27
-3.22075e-26
-6.61691e-27
-2.85853e-26
-6.16239e-27
-2.42783e-26
-5.49306e-27
-1.96811e-26
-4.711e-27
-1.50393e-26
-3.8853e-27
-1.04814e-26
-3.05655e-27
-6.62799e-27
-2.22004e-27
-3.79862e-27
-1.48727e-27
-1.94765e-27
-9.27469e-28
-9.45351e-28
-5.38494e-28
-3.109e-28
-1.28955e-17
1.84373e-16
3.49291e-10
9.03484e-07
2.71838e-06
-3.03715e-07
0.345988
-0.345984
5.42641
-5.91791
8.05062
-13.0197
7.79131
-14.3075
7.46418
-15.3282
7.09448
-16.2296
0.582931
-8.34484
-1.96889e-12
-0.0141625
-1.43365e-12
-6.592e-13
4.01366e-12
-1.21797e-11
1.51767e-11
-6.07166e-11
1.24549e-11
-1.05321e-10
1.59251e-12
-4.63539e-11
-1.09404e-12
-1.02281e-11
-9.8447e-12
-3.89532e-11
-1.4566e-11
-7.95919e-11
-1.55305e-11
-7.68024e-11
-1.48054e-11
-6.91552e-11
-7.27493e-12
-5.41992e-11
-8.43291e-13
-2.12182e-11
-2.79501e-15
-2.28551e-12
-9.32852e-18
-1.26408e-14
-1.88533e-22
-1.72611e-17
-3.48789e-24
-6.21124e-22
-1.07031e-25
-1.08767e-23
-4.51101e-27
-3.04275e-25
-4.31443e-28
-1.17195e-26
-3.39755e-28
-5.51064e-28
-4.26613e-28
-1.05946e-28
-5.30015e-28
-1.0934e-28
-6.475e-28
-1.3199e-28
-7.86969e-28
-1.57019e-28
-9.59769e-28
-1.85365e-28
-1.17741e-27
-2.19324e-28
-1.4461e-27
-2.61272e-28
-1.76202e-27
-3.12377e-28
-2.11273e-27
-3.71573e-28
-2.48336e-27
-4.36077e-28
-2.85951e-27
-5.02749e-28
-3.22496e-27
-5.6889e-28
-3.55719e-27
-6.31831e-28
-3.83038e-27
-6.87737e-28
-4.02172e-27
-7.32188e-28
-4.11118e-27
-7.61552e-28
-4.07174e-27
-7.72867e-28
-3.88144e-27
-7.62019e-28
-3.53096e-27
-7.25764e-28
-3.05612e-27
-6.62109e-28
-2.52611e-27
-5.76922e-28
-1.98959e-27
-4.82943e-28
-1.47744e-27
-3.88472e-28
-9.9765e-28
-2.98422e-28
-6.08942e-28
-2.11138e-28
-3.37122e-28
-1.37309e-28
-1.66145e-28
-8.32231e-29
-7.76135e-29
-4.66853e-29
-2.60955e-29
3.6175e-06
0.000434538
0.000207021
1.72163e-05
0.090531
-0.0903231
3.03157
-3.24178
8.34108
-11.1776
8.32274
-13.0013
8.01165
-13.9964
7.65813
-14.9747
6.07123
-14.6427
0.0141625
-2.46534
-1.76652e-13
-9.69286e-14
4.89373e-13
-1.20767e-12
6.52433e-12
-1.6642e-11
1.7117e-11
-6.5615e-11
1.08016e-11
-9.11303e-11
4.18965e-13
-3.15434e-11
-1.21426e-12
-5.93496e-12
-1.05335e-11
-2.89997e-11
-1.70239e-11
-7.75135e-11
-1.70585e-11
-8.75674e-11
-1.99461e-11
-8.33778e-11
-1.48217e-11
-7.73844e-11
-2.67963e-12
-3.93748e-11
-3.05642e-14
-5.51706e-12
-1.60807e-17
-8.31639e-14
-2.95106e-22
-3.18929e-17
-5.34065e-24
-9.05637e-22
-1.5316e-25
-1.56155e-23
-6.02561e-27
-4.07078e-25
-2.88477e-28
-1.49083e-26
-5.63519e-29
-6.24442e-28
-5.90095e-29
-3.67415e-29
-7.22066e-29
-1.5399e-29
-8.7019e-29
-1.73976e-29
-1.04003e-28
-2.04068e-29
-1.24517e-28
-2.3715e-29
-1.4997e-28
-2.75678e-29
-1.81102e-28
-3.22594e-29
-2.17297e-28
-3.79355e-29
-2.56812e-28
-4.44539e-29
-2.97578e-28
-5.1444e-29
-3.37676e-28
-5.84897e-29
-3.75132e-28
-6.52565e-29
-4.07288e-28
-7.14282e-29
-4.312e-28
-7.65787e-29
-4.44502e-28
-8.02297e-29
-4.45482e-28
-8.20207e-29
-4.31975e-28
-8.17361e-29
-4.02765e-28
-7.90396e-29
-3.57772e-28
-7.37719e-29
-3.01594e-28
-6.58658e-29
-2.42333e-28
-5.60293e-29
-1.85302e-28
-4.56958e-29
-1.33676e-28
-3.57747e-29
-8.74282e-29
-2.6803e-29
-5.14757e-29
-1.84535e-29
-2.75143e-29
-1.16336e-29
-1.30185e-29
-6.84345e-30
-5.84557e-30
-3.70062e-30
-1.99835e-30
8.4874e-05
0.000630016
0.0470637
-0.0467344
2.22286
-2.25341
8.3829
-9.35609
8.85113
-11.6459
8.59271
-12.7429
8.20291
-13.6066
7.84491
-14.6167
2.38393
-9.46988
-4.55858e-13
-0.169051
-4.11058e-13
-1.39869e-13
1.07435e-12
-2.46415e-12
8.40342e-12
-2.16185e-11
1.57229e-11
-6.74767e-11
7.16956e-12
-7.55789e-11
-1.23803e-13
-2.08687e-11
-1.35298e-12
-3.33564e-12
-1.11881e-11
-2.0174e-11
-2.16858e-11
-6.76313e-11
-2.04342e-11
-9.24051e-11
-1.91475e-11
-8.30359e-11
-1.79214e-11
-7.91279e-11
-4.20039e-12
-4.36613e-11
-1.00089e-13
-7.03752e-12
-3.0888e-17
-1.85832e-13
-4.24066e-22
-5.36518e-17
-7.56989e-24
-1.20197e-21
-2.01931e-25
-2.06455e-23
-7.54112e-27
-5.01871e-25
-3.21155e-28
-1.72973e-26
-1.9172e-29
-7.03852e-28
-8.14033e-30
-3.04498e-29
-9.30728e-30
-2.96813e-30
-1.10397e-29
-2.19763e-30
-1.29643e-29
-2.50059e-30
-1.52196e-29
-2.85793e-30
-1.79703e-29
-3.26113e-30
-2.13007e-29
-3.74369e-30
-2.51259e-29
-4.32398e-30
-2.92227e-29
-4.98531e-30
-3.33297e-29
-5.68245e-30
-3.72177e-29
-6.36541e-30
-4.06719e-29
-6.9946e-30
-4.34116e-29
-7.53856e-30
-4.51383e-29
-7.95351e-30
-4.56419e-29
-8.19343e-30
-4.48144e-29
-8.22757e-30
-4.2518e-29
-8.04621e-30
-3.87475e-29
-7.62757e-30
-3.35845e-29
-6.97408e-30
-2.75469e-29
-6.09087e-30
-2.14848e-29
-5.05406e-30
-1.59235e-29
-4.0108e-30
-1.11519e-29
-3.04867e-30
-7.06293e-30
-2.22234e-30
-4.00947e-30
-1.48679e-30
-2.06837e-30
-9.07335e-31
-9.38405e-31
-5.17343e-31
-4.04585e-31
-2.69073e-31
-1.40112e-31
0.000128425
0.000501591
2.87303
-2.91268
8.51816
-7.88093
9.36965
-10.2076
9.18875
-11.4649
8.8138
-12.368
8.42588
-13.2187
6.85421
-13.045
0.169051
-2.86811
-2.04002e-14
-7.08382e-14
6.46884e-14
-1.96692e-13
1.65169e-12
-3.61631e-12
9.26667e-12
-2.65414e-11
1.20474e-11
-6.53257e-11
3.18048e-12
-6.01632e-11
-2.35844e-13
-1.44167e-11
-1.17089e-12
-1.60916e-12
-1.03493e-11
-9.95547e-12
-2.95585e-11
-4.03916e-11
-3.14956e-11
-7.64518e-11
-2.58226e-11
-8.23222e-11
-1.96192e-11
-7.33578e-11
-4.58252e-12
-3.73874e-11
-1.59629e-13
-6.44207e-12
-5.28829e-17
-2.12713e-13
-5.60218e-22
-8.03305e-17
-9.91094e-24
-1.45015e-21
-2.46058e-25
-2.51141e-23
-8.62664e-27
-5.73467e-25
-3.56221e-28
-1.84077e-26
-1.56089e-29
-7.2722e-28
-1.53891e-30
-3.01766e-29
-1.15129e-30
-1.43206e-30
-1.32251e-30
-2.96951e-31
-1.52483e-30
-2.8727e-31
-1.75386e-30
-3.21781e-31
-2.02764e-30
-3.60502e-31
-2.35592e-30
-4.05865e-31
-2.72863e-30
-4.60246e-31
-3.11936e-30
-5.21996e-31
-3.49772e-30
-5.86076e-31
-3.83885e-30
-6.46793e-31
-4.12177e-30
-6.99898e-31
-4.3202e-30
-7.42465e-31
-4.40734e-30
-7.70637e-31
-4.3675e-30
-7.80335e-31
-4.19864e-30
-7.69283e-31
-3.89535e-30
-7.37948e-31
-3.46813e-30
-6.85552e-31
-2.9319e-30
-6.13911e-31
-2.33839e-30
-5.24378e-31
-1.76838e-30
-4.24295e-31
-1.26773e-30
-3.27365e-31
-8.60347e-31
-2.41223e-31
-5.27147e-31
-1.70685e-31
-2.88349e-31
-1.10667e-31
-1.435e-31
-6.52422e-32
-6.23346e-32
-3.60208e-32
-2.57785e-32
-1.79858e-32
-9.02592e-33
5.30296
-5.2653
9.26903
-6.85733
10.0187
-8.63059
9.9181
-10.107
9.52377
-11.0706
9.04582
-11.89
8.08766
-12.2605
2.71131
-7.74684
-6.27276e-14
-0.190955
-5.88279e-14
-6.50103e-14
1.67554e-13
-3.67444e-13
2.38209e-12
-5.09474e-12
1.01469e-11
-3.07278e-11
8.20447e-12
-5.81612e-11
1.10614e-14
-4.56901e-11
-2.00887e-13
-1.14878e-11
-6.67613e-13
-6.64962e-13
-5.54695e-12
-2.52698e-12
-2.0841e-11
-1.11366e-11
-3.78564e-11
-2.79728e-11
-3.16528e-11
-4.02367e-11
-2.00447e-11
-3.83858e-11
-4.53262e-12
-1.43625e-11
-1.83011e-13
-3.41982e-12
-3.65923e-17
-1.71355e-13
-6.71754e-22
-5.54454e-17
-1.1847e-23
-1.57645e-21
-2.75257e-25
-2.78504e-23
-8.96682e-27
-6.04652e-25
-3.58862e-28
-1.79736e-26
-1.50647e-29
-6.82168e-28
-7.22383e-31
-2.79737e-29
-1.51216e-31
-1.16803e-30
-1.47562e-31
-6.99849e-32
-1.66606e-31
-2.89724e-32
-1.87987e-31
-3.04748e-32
-2.12937e-31
-3.35168e-32
-2.42651e-31
-3.69424e-32
-2.76153e-31
-4.11577e-32
-3.10572e-31
-4.61704e-32
-3.42616e-31
-5.14982e-32
-3.69726e-31
-5.64945e-32
-3.90107e-31
-6.06739e-32
-4.01544e-31
-6.38229e-32
-4.01897e-31
-6.56428e-32
-3.90211e-31
-6.57775e-32
-3.6718e-31
-6.40125e-32
-3.33056e-31
-6.05548e-32
-2.89687e-31
-5.53873e-32
-2.38852e-31
-4.8827e-32
-1.85189e-31
-4.09866e-32
-1.35726e-31
-3.24117e-32
-9.39857e-32
-2.43305e-32
-6.16803e-32
-1.73488e-32
-3.64805e-32
-1.19077e-32
-1.91957e-32
-7.46122e-33
-9.20921e-33
-4.2194e-33
-3.82342e-33
-2.2419e-33
-1.51654e-33
-1.06586e-33
-5.12363e-34
1.76749
0.0759859
1.7725
0.249923
1.80528
0.405801
1.81986
0.629219
1.8719
0.804109
1.88912
1.03167
1.97633
1.19058
2.02728
1.43185
2.1061
1.58545
2.22652
1.8009
2.32087
2.06123
2.43958
2.31398
2.65521
2.57687
2.69143
3.07321
3.01797
3.24806
3.05814
4.10918
3.33597
4.23561
3.41732
5.59436
4.44195
5.2262
9.1993
3.66589
1.76652
0.0678372
1.77519
0.241245
1.81324
0.367755
1.82811
0.614344
1.88907
0.74315
1.91508
1.00566
2.01131
1.09436
2.06869
1.37447
2.23445
1.41969
2.25208
1.78328
2.56212
1.75119
2.53823
2.33786
2.90047
2.21464
3.0323
2.94137
3.39766
2.8827
3.65091
3.85592
4.37204
3.51449
4.4498
5.5166
6.22014
3.45586
7.51122
7.90823
1.77142
0.0547807
1.77599
0.236673
1.82279
0.320962
1.82398
0.613148
1.92265
0.644485
1.87413
1.05418
2.09345
0.875037
1.97962
1.4883
2.30178
1.09752
2.23258
1.85248
2.54861
1.43516
2.69465
2.19183
3.00221
1.90708
3.22156
2.72202
3.82165
2.28261
3.97934
3.69823
5.08748
2.40635
5.48869
5.11539
6.18005
2.76449
5.2979
8.39337
1.78478
0.0283651
1.76586
0.2556
1.85975
0.227065
1.81049
0.662416
1.98309
0.471881
1.90081
1.13646
2.14772
0.628134
2.13654
1.49947
2.33985
0.894215
2.44108
1.75125
2.71954
1.1567
2.76993
2.14144
3.31729
1.35972
3.30977
2.72954
4.10498
1.4874
4.2859
3.5173
5.02989
1.66237
6.09268
4.0526
6.22642
2.63075
3.71045
7.81387
1.76947
0.0172619
1.78818
0.236886
1.86091
0.154336
1.88155
0.641778
2.00983
0.343602
2.07448
1.07181
2.19923
0.503384
2.29674
1.40196
2.59591
0.595042
2.47713
1.87004
3.08691
0.546913
2.88529
2.34306
3.55243
0.692576
3.58632
2.69565
4.13659
0.937132
4.66167
2.99223
4.87933
1.4447
5.96716
2.96477
6.28372
2.31419
2.63013
7.36405
1.73844
0.0371858
1.81212
0.163207
1.79055
0.175905
1.9057
0.52663
1.94018
0.309118
2.02194
0.99006
2.27719
0.248133
2.12109
1.55806
2.72915
-0.0130201
2.43778
2.1614
2.97951
0.00518749
2.95402
2.36855
3.32298
0.323612
3.71864
2.29999
3.83659
0.819174
4.55241
2.27641
4.67934
1.31777
5.58004
2.06408
6.06812
1.82611
1.80686
6.89139
1.74301
0.0525419
1.80616
0.100055
1.77892
0.203146
1.87868
0.426868
1.94525
0.242552
1.90837
1.02694
2.26301
-0.106511
2.07279
1.74828
2.39968
-0.339915
2.54964
2.01145
2.60501
-0.0501799
2.98291
1.99065
2.97371
0.332806
3.52957
1.74414
3.56227
0.786467
4.22382
1.61487
4.44606
1.09553
5.15147
1.35866
5.67624
1.30134
1.1835
6.29959
1.76762
0.0432917
1.77461
0.0930621
1.81214
0.165616
1.85456
0.384452
1.93848
0.15863
2.01239
0.953033
2.06987
-0.163992
2.33293
1.48522
2.19334
-0.200326
2.66147
1.54333
2.51018
0.101104
3.03023
1.47061
2.97256
0.39048
3.49009
1.2266
3.57966
0.696896
4.12531
1.06922
4.37924
0.841604
4.88719
0.850713
5.36173
0.826798
0.714362
5.83087
1.77317
0.0284882
1.77059
0.0956428
1.82318
0.113028
1.85638
0.351248
1.88649
0.128525
2.12348
0.716037
1.95737
0.00211587
2.44054
1.00205
2.19564
0.044574
2.71769
1.02127
2.57812
0.240682
3.08766
0.961058
3.07242
0.405728
3.50214
0.796878
3.63037
0.568667
4.03513
0.664461
4.28949
0.587242
4.62343
0.516772
5.00369
0.446541
0.325627
5.39242
1.76683
0.0200223
1.77423
0.0882405
1.77747
0.109795
1.85106
0.277654
1.82598
0.153607
2.07753
0.464482
1.95324
0.126412
2.36419
0.591092
2.23503
0.173739
2.64467
0.611636
2.60756
0.277787
2.9962
0.572419
3.04737
0.354558
3.37444
0.46981
3.55128
0.391824
3.84038
0.37536
4.11108
0.316544
4.39465
0.233199
4.71622
0.124976
-0.0207679
5.06262
1.74755
0.0308435
1.72698
0.108803
1.70618
0.1306
1.78668
0.197152
1.78929
0.150994
1.98341
0.270367
1.95704
0.152783
2.21872
0.329411
2.21374
0.178718
2.4941
0.33128
2.56066
0.21122
2.83931
0.293775
2.98165
0.212212
3.23115
0.220312
3.45204
0.170935
3.70515
0.122246
3.96931
0.0523833
4.2453
-0.0427874
4.54033
-0.170057
-0.322199
4.84176
1.69803
0.0911827
1.62692
0.179912
1.61051
0.147006
1.67986
0.127801
1.73321
0.0976433
1.87092
0.132657
1.92145
0.102257
2.09472
0.156143
2.1753
0.0981332
2.37554
0.131038
2.5131
0.073663
2.73302
0.0738618
2.92189
0.0233321
3.1487
-0.0061613
3.37704
-0.0555946
3.60194
-0.100542
3.79084
-0.14066
3.90357
-0.175184
3.89399
-0.200565
-0.168866
3.68186
0.761563
0.0126024
0.884327
0.0180758
1.00093
0.00378026
1.08958
-0.00155714
1.14433
-0.0032544
1.21302
0.00179589
1.24893
0.000868519
1.32598
0.00542135
1.35976
-0.00237684
1.42884
-2.50258e-18
1.45129
-6.98869e-19
1.47491
-8.41599e-19
1.44533
-1.02843e-18
1.37696
-1.12196e-18
1.23924
-1.17031e-18
1.03461
-1.12528e-18
0.78701
-1.01234e-18
0.528259
-8.56788e-19
0.276524
-7.50391e-19
-5.59418e-19
0.0853136
0.00759039
-2.95431e-18
0.0194615
-1.87599e-18
0.0166894
-1.8477e-18
0.00841356
-1.73137e-18
0.000766835
-1.26576e-18
0.000498004
-1.44594e-18
0.000468496
-1.49938e-18
0.00237684
-1.57213e-18
3.13998e-18
-4.07259e-19
1.19993e-18
-5.19402e-19
1.29405e-18
-7.49987e-19
1.40212e-18
-9.06845e-19
1.52228e-18
-1.1059e-18
1.6563e-18
-1.21345e-18
1.80557e-18
-1.27719e-18
1.96833e-18
-1.24582e-18
2.14085e-18
-1.14279e-18
2.28859e-18
-9.62621e-19
2.30818e-18
-7.28197e-19
-4.42137e-19
2.2325e-18
1.02823e-18
-2.89551e-18
1.89483e-18
-1.65507e-18
2.34331e-18
-1.20766e-18
2.5286e-18
-8.27672e-19
2.6688e-18
-3.15962e-19
2.86221e-18
-5.48895e-19
3.07303e-18
-6.18755e-19
3.28519e-18
-6.92378e-19
3.91537e-18
-6.86244e-19
4.22354e-18
-7.45512e-19
4.50189e-18
-8.1834e-19
4.75694e-18
-8.21694e-19
4.82515e-18
-8.04644e-19
4.67946e-18
-7.41421e-19
4.32588e-18
-6.60979e-19
3.8299e-18
-5.54783e-19
3.25838e-18
-4.41035e-19
2.69213e-18
-3.22473e-19
2.19958e-18
-2.0786e-19
-1.20159e-19
1.86823e-18
-2.79496e-19
-1.52998e-18
1.63204e-19
-1.0251e-18
7.79557e-19
-7.70531e-19
1.425e-18
-5.3333e-19
2.22186e-18
-3.77939e-19
2.67544e-18
-3.57357e-19
2.97985e-18
-3.48012e-19
3.1244e-18
-3.33171e-19
3.17898e-18
-3.08837e-19
3.08482e-18
-2.91386e-19
2.8288e-18
-2.77514e-19
2.47153e-18
-2.5859e-19
2.05254e-18
-2.34784e-19
1.63161e-18
-2.03854e-19
1.23317e-18
-1.69305e-19
8.86326e-19
-1.3366e-19
6.03138e-19
-1.0033e-19
3.94458e-19
-7.1122e-20
2.63793e-19
-4.73871e-20
-2.99747e-20
1.92762e-19
-1.98377e-19
-6.70725e-19
-1.83162e-19
-4.72707e-19
-6.07505e-20
-3.6647e-19
1.29513e-19
-2.72587e-19
3.43382e-19
-2.08136e-19
4.94663e-19
-1.76939e-19
5.85932e-19
-1.55033e-19
6.29732e-19
-1.36679e-19
6.39976e-19
-1.19831e-19
6.15793e-19
-1.05565e-19
5.59629e-19
-9.32011e-20
4.81492e-19
-8.1355e-20
3.91882e-19
-6.94963e-20
3.02701e-19
-5.7383e-20
2.21834e-19
-4.56177e-20
1.5434e-19
-3.4803e-20
1.01983e-19
-2.55026e-20
6.46674e-20
-1.79664e-20
4.07234e-20
-1.22595e-20
-8.30848e-21
2.72677e-20
-6.07332e-20
-2.57287e-19
-6.94487e-20
-1.85827e-19
-4.53958e-20
-1.46724e-19
-1.40797e-21
-1.12325e-19
4.89104e-20
-8.76197e-20
8.77137e-20
-7.11814e-20
1.13239e-19
-5.92983e-20
1.26811e-19
-4.97754e-20
1.30692e-19
-4.18006e-20
1.25825e-19
-3.51298e-20
1.13602e-19
-2.94812e-20
9.64566e-20
-2.4534e-20
7.71012e-20
-2.00818e-20
5.81843e-20
-1.60429e-20
4.15083e-20
-1.24675e-20
2.80562e-20
-9.4179e-21
1.80359e-20
-6.92947e-21
1.11769e-20
-4.99028e-21
6.90833e-21
-3.55772e-21
-2.56384e-21
4.48877e-21
-1.48664e-20
-8.36596e-20
-1.87907e-20
-6.31499e-20
-1.46273e-20
-5.03316e-20
-5.6271e-21
-3.91326e-20
4.65926e-21
-3.07615e-20
1.36638e-20
-2.43565e-20
1.99668e-20
-1.96954e-20
2.359e-20
-1.60225e-20
2.48898e-20
-1.30688e-20
2.4189e-20
-1.06661e-20
2.18919e-20
-8.68836e-21
1.85506e-20
-7.03376e-21
1.47724e-20
-5.63062e-21
1.11049e-20
-4.43793e-21
7.91253e-21
-3.43652e-21
5.36796e-21
-2.61186e-21
3.48834e-21
-1.94878e-21
2.19939e-21
-1.43282e-21
1.38169e-21
-1.05042e-21
-7.82334e-22
8.9795e-22
-2.86891e-21
-2.19367e-20
-4.05248e-21
-1.84892e-20
-3.4329e-21
-1.46686e-20
-1.83455e-21
-1.16279e-20
-2.13516e-23
-9.06587e-21
1.83186e-21
-7.07742e-21
3.19194e-21
-5.60172e-21
4.02278e-21
-4.4667e-21
4.36967e-21
-3.58143e-21
4.30487e-21
-2.87903e-21
3.92282e-21
-2.31404e-21
3.33894e-21
-1.85378e-21
2.67214e-21
-1.47502e-21
2.02265e-21
-1.16227e-21
1.45509e-21
-9.04431e-22
9.98626e-22
-6.92575e-22
6.5652e-22
-5.20342e-22
4.17886e-22
-3.85099e-22
2.64117e-22
-2.8531e-22
-2.15886e-22
1.71772e-22
-2.67871e-22
-4.3e-21
-6.51161e-22
-4.50606e-21
-5.89596e-22
-3.48311e-21
-3.98013e-22
-2.83316e-21
-1.19639e-22
-2.16023e-21
1.70823e-22
-1.67268e-21
4.14642e-22
-1.30206e-21
5.7378e-22
-1.02729e-21
6.49849e-22
-8.18292e-22
6.54881e-22
-6.55431e-22
6.05517e-22
-5.26073e-22
5.21315e-22
-4.21704e-22
4.2165e-22
-3.36384e-22
3.22548e-22
-2.66149e-22
2.34443e-22
-2.07844e-22
1.62413e-22
-1.59077e-22
1.07877e-22
-1.18783e-22
7.01424e-23
-8.73901e-23
4.66298e-23
-6.49355e-23
-4.96808e-23
3.31357e-23
6.60462e-23
-5.63448e-22
-6.59721e-23
-8.15904e-22
-6.35207e-23
-6.00897e-22
-6.58708e-23
-5.06399e-22
-3.36067e-23
-3.73013e-22
-2.3834e-24
-2.87967e-22
3.21998e-23
-2.22087e-22
5.65658e-23
-1.74709e-22
6.99768e-23
-1.39371e-22
7.38458e-23
-1.12101e-22
7.02135e-23
-9.04367e-23
6.16077e-23
-7.28518e-23
5.05607e-23
-5.83157e-23
3.92413e-23
-4.62064e-23
2.91158e-23
-3.59605e-23
2.09587e-23
-2.7221e-23
1.50075e-23
-2.00061e-23
1.10566e-23
-1.45835e-23
8.57245e-24
-1.08693e-23
-8.37733e-24
6.93469e-24
1.78283e-23
-3.77559e-23
-4.53567e-24
-8.39804e-23
-3.41504e-24
-5.53454e-23
-8.27543e-24
-4.91839e-23
-5.38916e-24
-3.48556e-23
-3.04799e-24
-2.70891e-23
-2.73181e-25
-2.07947e-23
2.09805e-24
-1.64888e-23
3.70423e-24
-1.32384e-23
4.47276e-24
-1.07327e-23
4.57025e-24
-8.71574e-24
4.21565e-24
-7.04867e-24
3.63199e-24
-5.64141e-24
3.01244e-24
-4.45166e-24
2.47125e-24
-3.42561e-24
2.04179e-24
-2.54322e-24
1.69726e-24
-1.82811e-24
1.38871e-24
-1.31527e-24
1.10119e-24
-9.73928e-25
-7.43511e-25
8.39568e-25
5.23126e-25
-3.0571e-25
-1.45988e-25
-3.97131e-25
-2.54364e-25
-1.97405e-25
-1.02171e-25
-3.7611e-26
1.75171e-26
5.76477e-26
8.14809e-26
9.33613e-26
9.74657e-26
9.61825e-26
8.93902e-26
7.61831e-26
5.74471e-26
3.87231e-26
2.4043e-26
1.44413e-26
-1.39653
5.06242
-3.28451
1.88798
-4.22927
0.944755
-4.27012
0.0408486
-4.01084
-0.259282
-3.39361
-0.617232
-2.44478
-0.948825
-1.26899
-1.17579
0.333765
-1.60275
1.96505
-1.63128
3.40274
-1.43769
5.44365
-2.04092
7.09735
-1.6537
9.53598
-2.43863
-2.58252
12.1185
6.64599
6.32466
3.74671
4.78727
2.17888
2.51258
1.35437
0.865342
1.30393
-0.208833
1.75511
-1.06841
2.57272
-1.76644
3.61458
-2.21762
4.71478
-2.70295
5.95621
-2.87272
7.4471
-2.92858
8.6631
-3.25691
10.2862
-3.27682
11.5871
-3.73948
-3.96153
12.9661
9.36077
5.35726
9.74056
4.40748
9.23387
3.01928
8.59004
1.50916
8.19579
0.185418
8.15421
-1.02684
8.36027
-1.9725
8.81284
-2.67019
9.32171
-3.21182
9.98663
-3.53764
10.7663
-3.70827
11.359
-3.84961
12.0722
-3.98998
12.5261
-4.19341
-4.49639
13.061
9.22858
3.94255
10.2891
3.34696
10.8495
2.45888
11.0668
1.2919
11.2061
0.0460552
11.2218
-1.04253
11.248
-1.99866
11.2888
-2.71099
11.3323
-3.25535
11.3712
-3.57658
11.4449
-3.78194
11.4876
-3.89231
11.5608
-4.06319
11.6562
-4.28881
-4.6521
11.8119
8.50304
2.80357
9.50411
2.34588
10.3258
1.63718
10.845
0.772737
11.0717
-0.180698
11.1148
-1.0856
11.0365
-1.92041
10.8907
-2.56515
10.7114
-3.07606
10.5398
-3.40497
10.4513
-3.69337
10.4677
-3.90881
10.6208
-4.21628
10.8409
-4.50886
-4.92969
11.1185
7.78749
1.90747
8.60786
1.52551
9.30055
0.944482
9.79937
0.273912
10.0899
-0.471214
10.198
-1.19368
10.1777
-1.90015
10.0826
-2.47001
9.97664
-2.97013
9.91562
-3.34395
9.95907
-3.73682
10.0949
-4.04463
10.3306
-4.45198
10.5886
-4.76688
-4.7183
10.3825
7.05859
1.14847
7.74064
0.843468
8.3081
0.377018
8.74359
-0.161581
9.02516
-0.752784
9.17885
-1.34736
9.22653
-1.94784
9.22501
-2.46849
9.25399
-2.99912
9.33526
-3.42522
9.52237
-3.92394
9.76525
-4.28751
9.60443
-4.2856
6.46225
-1.60214
-0.340664
2.12699
6.38725
0.592092
6.9279
0.302813
7.39116
-0.0862408
7.75603
-0.526455
8.02831
-1.02507
8.23889
-1.55793
8.40049
-2.10944
8.5475
-2.6155
8.75867
-3.21029
8.99614
-3.66269
8.79036
-3.71157
5.89169
-1.36692
1.91678
-0.269703
0.340664
-3.21599e-16
-3.93001e-16
7.34025e-16
5.83043
0.154084
6.26762
-0.134377
6.66581
-0.484433
7.02833
-0.88897
7.33545
-1.33219
7.62747
-1.84995
7.9125
-2.39447
8.17859
-2.88159
7.80459
-2.82521
5.16617
-0.998099
1.61114
-0.111744
0.269703
-8.9562e-17
2.64383e-16
-1.38224e-16
2.45876e-16
-2.8813e-16
-5.76019e-16
5.53711e-16
5.45158
-0.234883
5.83974
-0.522539
6.23116
-0.87585
6.60414
-1.26195
6.94841
-1.67645
7.14478
-2.04253
6.1707
-1.395
3.85227
-0.51262
1.08735
-2.84829e-17
0.111744
-2.50207e-17
8.51198e-17
-4.38551e-17
7.896e-17
-9.80334e-17
1.93709e-16
-2.07801e-16
3.81756e-16
-3.6318e-16
-5.85838e-16
6.34651e-16
5.20162
-0.594743
5.56316
-0.887343
5.68955
-1.0094
5.16348
-0.733951
3.84675
-0.343056
1.8423
-1.04502e-17
0.51262
-2.93972e-18
2.45079e-17
-3.92671e-18
1.5843e-17
-1.30593e-17
1.46459e-17
-3.05823e-17
5.98549e-17
-7.29086e-17
1.28526e-16
-1.29115e-16
2.17947e-16
-2.10767e-16
3.48784e-16
-3.0352e-16
-3.76615e-16
4.98421e-16
3.08415
-0.0853136
2.10953
-4.35025e-18
1.05276
-8.81921e-19
0.343056
-9.02129e-19
1.19939e-17
-8.73706e-19
3.33817e-18
-1.44279e-18
3.07353e-18
-2.32228e-18
6.98943e-18
-6.28372e-18
1.77286e-17
-1.86607e-17
4.0172e-17
-3.93404e-17
6.94578e-17
-7.13936e-17
1.1211e-16
-1.06599e-16
1.5984e-16
-1.35351e-16
2.00633e-16
-1.29443e-16
-9.51754e-17
2.02526e-16
5.37375e-18
-6.65229e-19
2.02959e-18
-9.11278e-19
2.15463e-18
-9.12388e-19
2.00949e-18
-6.62785e-19
1.99713e-18
-7.10904e-19
2.1944e-18
-1.28958e-18
3.76509e-18
-2.78323e-18
8.29732e-18
-7.36172e-18
1.67991e-17
-1.79943e-17
3.199e-17
-3.34164e-17
4.91568e-17
-4.82061e-17
6.18997e-17
-5.19739e-17
6.17373e-17
-4.12591e-17
4.50003e-17
-2.22434e-17
-7.45396e-18
2.34659e-17
2.1692e-18
-5.55837e-19
1.91532e-18
-6.09582e-19
1.57307e-18
-5.06951e-19
1.34316e-18
-3.38916e-19
1.19281e-18
-3.73332e-19
1.24349e-18
-8.20146e-19
2.43422e-18
-2.2077e-18
6.14767e-18
-5.68121e-18
1.22133e-17
-1.15803e-17
1.82974e-17
-1.71083e-17
2.01783e-17
-1.83801e-17
1.60275e-17
-1.41081e-17
8.80656e-18
-7.8947e-18
3.14178e-18
-3.37784e-18
-1.17106e-18
6.90408e-19
1.38292e-18
-9.27971e-20
8.57887e-19
-8.27354e-20
4.69024e-19
-7.85754e-20
3.24249e-19
-1.02418e-19
3.69671e-19
-1.9767e-19
6.30617e-19
-4.64632e-19
1.38649e-18
-1.11209e-18
2.95672e-18
-2.40857e-18
4.57637e-18
-4.0163e-18
4.99257e-18
-4.99131e-18
3.86985e-18
-4.86645e-18
2.15643e-18
-3.75347e-18
9.28195e-19
-2.27468e-18
3.46505e-19
-1.08817e-18
-4.06691e-19
1.14645e-19
1.38428e-19
-2.25854e-20
9.17005e-20
-1.92908e-20
6.43348e-20
-2.44113e-20
7.17912e-20
-4.79905e-20
1.23589e-19
-9.59195e-20
2.19672e-19
-1.8098e-19
3.97938e-19
-3.32305e-19
6.74451e-19
-5.86608e-19
8.64545e-19
-9.19194e-19
8.56438e-19
-1.21314e-18
7.14901e-19
-1.28103e-18
4.99199e-19
-1.03613e-18
2.75789e-19
-6.26926e-19
1.13321e-19
-2.84684e-19
-1.01499e-19
3.24921e-20
1.85794e-20
-6.53912e-21
1.2906e-20
-5.76745e-21
1.24049e-20
-8.88001e-21
1.99104e-20
-1.83422e-20
3.37284e-20
-3.11928e-20
5.02663e-20
-4.89386e-20
7.33524e-20
-9.0712e-20
1.08768e-19
-1.76373e-19
1.46435e-19
-2.93238e-19
1.65954e-19
-3.8524e-19
1.44089e-19
-3.81346e-19
8.76281e-20
-2.82184e-19
3.66094e-20
-1.60727e-19
1.2261e-20
-7.14663e-20
-2.47303e-20
4.15221e-21
2.98586e-21
-2.10247e-21
2.25989e-21
-1.86895e-21
2.82296e-21
-2.86288e-21
4.82171e-21
-5.33797e-21
7.03492e-21
-7.88847e-21
9.31097e-21
-1.3081e-20
1.41829e-20
-2.95304e-20
2.16966e-20
-6.10058e-20
2.66731e-20
-9.64201e-20
2.39663e-20
-1.16127e-19
1.67725e-20
-1.06133e-19
1.06737e-20
-7.26666e-20
5.47534e-21
-3.76604e-20
1.7594e-21
-1.52525e-20
-4.98007e-21
3.24677e-22
5.92559e-22
-6.56614e-22
4.52348e-22
-5.77346e-22
5.73412e-22
-8.2078e-22
8.86016e-22
-1.3131e-21
1.09155e-21
-1.71292e-21
1.48512e-21
-3.52206e-21
2.67111e-21
-9.46124e-21
4.47238e-21
-1.94926e-20
6.10843e-21
-2.90732e-20
6.35532e-21
-3.20345e-20
4.25133e-21
-2.62604e-20
1.66172e-21
-1.63068e-20
3.65672e-22
-7.80982e-21
3.32669e-23
-2.95396e-21
-9.0587e-22
-3.60652e-24
1.13811e-22
-1.83626e-22
8.84972e-23
-1.58902e-22
1.12997e-22
-2.03351e-22
1.65115e-22
-2.74349e-22
1.97326e-22
-3.3592e-22
3.7667e-22
-9.42532e-22
9.2396e-22
-2.76324e-21
1.60087e-21
-5.38306e-21
1.81033e-21
-7.40046e-21
1.45502e-21
-7.53834e-21
8.93221e-22
-5.68855e-21
3.97873e-22
-3.24396e-21
1.11849e-22
-1.44499e-21
1.52497e-23
-5.16314e-22
-1.50198e-22
-2.578e-25
2.49357e-23
-4.27081e-23
2.1535e-23
-3.62904e-23
2.72179e-23
-4.15186e-23
3.53951e-23
-4.79803e-23
3.97026e-23
-5.93822e-23
9.67958e-23
-2.15943e-22
2.45069e-22
-6.43845e-22
4.24439e-22
-1.19552e-21
5.15196e-22
-1.52806e-21
4.36384e-22
-1.44006e-21
2.60439e-22
-1.01609e-21
1.16931e-22
-5.46229e-22
4.0727e-23
-2.29447e-22
1.05871e-23
-7.75481e-23
-2.16079e-23
1.92715e-24
5.58496e-24
-7.21346e-24
4.67562e-24
-5.94427e-24
5.00939e-24
-6.12866e-24
5.28736e-24
-6.2321e-24
6.0069e-24
-8.40413e-24
1.9776e-23
-3.61887e-23
5.07668e-23
-1.04154e-22
7.85162e-23
-1.83747e-22
8.58724e-23
-2.24502e-22
7.13623e-23
-2.0059e-22
4.32593e-23
-1.32625e-22
1.89375e-23
-6.7138e-23
6.25524e-24
-2.70188e-23
1.66529e-24
-8.88425e-24
-2.42846e-24
3.67598e-25
5.99158e-25
-6.29801e-25
4.35571e-25
-5.05795e-25
3.93577e-25
-4.94362e-25
3.43343e-25
-4.62272e-25
3.89255e-25
-7.66199e-25
1.4683e-24
-3.65732e-24
3.93279e-24
-9.81072e-24
6.26297e-24
-1.57055e-23
6.22135e-24
-1.75106e-23
4.22956e-24
-1.45068e-23
2.21235e-24
-9.01388e-24
9.44207e-25
-4.33099e-24
3.19601e-25
-1.66518e-24
8.36831e-26
-5.27216e-25
-1.40132e-25
1.7215e-26
8.92231e-27
6.75667e-27
6.87917e-27
6.51394e-27
9.01211e-27
2.52813e-26
2.80739e-26
3.00175e-26
5.57887e-26
6.16043e-26
3.63794e-26
1.32118e-26
3.27161e-27
5.56504e-28
5.54774e-29
12.566
-5.7128
13.3974
-7.68869
13.7803
-9.01352
13.6022
-9.92887
13.2582
-10.7266
12.6117
-11.2436
7.10879
-6.74653
0.190955
-0.824109
-2.41138e-15
-4.16867e-14
3.22996e-14
-9.04583e-14
3.96204e-13
-6.49235e-13
6.13257e-12
-9.66403e-12
2.18464e-11
-4.22415e-11
1.81719e-11
-4.91673e-11
7.33402e-12
-2.86651e-11
2.28108e-13
-2.47992e-12
-4.58416e-14
-1.43395e-13
-4.4653e-13
-1.13882e-12
-2.66607e-12
-3.34188e-12
-7.56373e-12
-6.74394e-12
-9.23864e-12
-8.14999e-12
-4.85708e-12
-6.4475e-12
-1.24069e-12
-1.11894e-12
-7.75168e-14
-1.1071e-13
-1.15455e-17
-3.94289e-16
-3.44341e-22
-7.34069e-20
-6.31e-24
-1.19837e-21
-1.42198e-25
-2.21345e-23
-4.40717e-27
-4.63109e-25
-1.74002e-28
-1.26442e-26
-7.41231e-30
-4.54214e-28
-3.20968e-31
-1.84216e-29
-1.99094e-32
-7.6808e-31
-8.51743e-33
-3.4327e-32
-9.24176e-33
-4.24022e-33
-1.04654e-32
-3.29141e-33
-1.18536e-32
-3.50523e-33
-1.35406e-32
-3.77943e-33
-1.55364e-32
-4.11793e-33
-1.76759e-32
-4.52274e-33
-1.97189e-32
-4.94591e-33
-2.14637e-32
-5.32349e-33
-2.27994e-32
-5.60805e-33
-2.35879e-32
-5.78445e-33
-2.36774e-32
-5.83251e-33
-2.29811e-32
-5.72682e-33
-2.15783e-32
-5.45631e-33
-1.94867e-32
-5.0492e-33
-1.6862e-32
-4.51331e-33
-1.37991e-32
-3.889e-33
-1.05549e-32
-3.18924e-33
-7.5942e-33
-2.45728e-33
-5.13382e-33
-1.79181e-33
-3.29747e-33
-1.23592e-33
-1.90183e-33
-8.21414e-34
-9.70272e-34
-4.97344e-34
-4.53497e-34
-2.70388e-34
-1.82338e-34
-1.38388e-34
-7.09722e-35
-6.2894e-35
-2.90747e-35
13.5736
-6.32034
13.6514
-7.76647
13.3531
-8.71518
12.9544
-9.53019
12.3081
-10.0804
6.95222
-5.86522
0.824109
-0.603217
6.94586e-15
-3.89784e-14
3.07839e-14
-5.76335e-14
1.37047e-13
-1.60072e-13
1.01051e-12
-1.21952e-12
1.03091e-11
-1.58466e-11
1.45744e-11
-3.98203e-11
9.71675e-12
-3.84416e-11
9.90549e-13
-1.40626e-11
-3.3887e-15
-7.19474e-13
-4.37079e-14
-2.52902e-14
-2.32996e-13
-1.09906e-13
-8.37802e-13
-4.29758e-13
-1.68383e-12
-8.33649e-13
-1.64052e-12
-9.69093e-13
-4.07425e-13
-5.89706e-13
-3.65701e-14
-7.69866e-14
-2.09917e-16
-4.45505e-15
-1.68245e-20
-5.44195e-19
-2.76585e-22
-4.487e-20
-5.11602e-24
-8.10658e-22
-1.09266e-25
-1.57277e-23
-3.06899e-27
-3.22595e-25
-1.13772e-28
-8.12655e-27
-4.76245e-30
-2.71662e-28
-2.04863e-31
-1.07362e-29
-9.43542e-33
-4.48442e-31
-1.19959e-33
-1.91796e-32
-9.56939e-34
-1.1046e-33
-1.04555e-33
-3.67697e-34
-1.15443e-33
-3.56267e-34
-1.28547e-33
-3.74723e-34
-1.43954e-33
-3.99013e-34
-1.60108e-33
-4.28614e-34
-1.74766e-33
-4.59052e-34
-1.86128e-33
-4.84219e-34
-1.9342e-33
-4.99801e-34
-1.95745e-33
-5.0496e-34
-1.92138e-33
-4.98522e-34
-1.82192e-33
-4.79189e-34
-1.6701e-33
-4.46525e-34
-1.47092e-33
-4.03899e-34
-1.24135e-33
-3.52419e-34
-9.90329e-34
-2.96498e-34
-7.36424e-34
-2.37398e-34
-5.13528e-34
-1.78137e-34
-3.3504e-34
-1.26166e-34
-2.07864e-34
-8.41279e-35
-1.1561e-34
-5.40888e-35
-5.65774e-35
-3.16304e-35
-2.5427e-35
-1.65197e-35
-9.7632e-36
-8.13316e-36
-3.6537e-36
-3.52657e-36
-1.56494e-36
13.1337
-6.39307
12.7573
-7.3901
12.4369
-8.39473
11.8033
-8.89662
5.97584
-4.21947
0.603217
-0.46213
5.363e-15
-2.81638e-14
1.68962e-14
-4.585e-14
8.56074e-14
-1.02224e-13
1.68306e-13
-1.79896e-13
1.42536e-12
-1.8886e-12
1.0547e-11
-1.9452e-11
1.04806e-11
-3.17782e-11
3.84433e-12
-2.49549e-11
3.15505e-15
-5.38154e-12
-8.06028e-16
-2.40313e-13
-2.14397e-15
-5.52743e-15
-1.84891e-14
-1.4693e-14
-8.26271e-14
-4.7391e-14
-1.54444e-13
-7.43222e-14
-1.31784e-13
-7.65901e-14
-2.12032e-14
-2.85285e-14
-1.10663e-15
-3.71383e-15
-1.12778e-19
-2.72079e-16
-9.69883e-21
-4.60793e-19
-1.79045e-22
-2.37441e-20
-3.48164e-24
-4.82385e-22
-7.34385e-26
-9.92792e-24
-1.89754e-27
-2.04098e-25
-6.53102e-29
-4.82084e-27
-2.65794e-30
-1.48544e-28
-1.14314e-31
-5.62518e-30
-5.03012e-33
-2.33368e-31
-2.97694e-34
-9.98528e-33
-1.01692e-34
-4.59176e-34
-1.00933e-34
-5.17783e-35
-1.08544e-34
-3.55764e-35
-1.17923e-34
-3.59792e-35
-1.28931e-34
-3.74082e-35
-1.4018e-34
-3.92761e-35
-1.49677e-34
-4.11619e-35
-1.5589e-34
-4.25156e-35
-1.5837e-34
-4.29635e-35
-1.56645e-34
-4.24732e-35
-1.50226e-34
-4.10221e-35
-1.39059e-34
-3.85613e-35
-1.24344e-34
-3.51175e-35
-1.06695e-34
-3.10257e-35
-8.7732e-35
-2.64054e-35
-6.81867e-35
-2.16666e-35
-4.92759e-35
-1.69255e-35
-3.32984e-35
-1.23638e-35
-2.09572e-35
-8.50401e-36
-1.2551e-35
-5.4807e-36
-6.72842e-36
-3.40685e-36
-3.15693e-36
-1.92344e-36
-1.36256e-36
-9.64504e-37
-4.98733e-37
-4.56438e-37
-1.791e-37
-1.88671e-37
-8.03063e-38
11.8926
-6.47375
11.8871
-7.38457
11.163
-7.67071
4.51491
-2.20673
0.46213
-0.1328
7.27102e-15
-2.39835e-14
1.39273e-14
-3.12268e-14
6.43563e-14
-7.68933e-14
8.67013e-14
-8.62204e-14
1.42344e-13
-1.55114e-13
1.59238e-12
-2.29712e-12
4.82753e-12
-1.52064e-11
3.82445e-12
-2.22434e-11
2.0768e-13
-1.2301e-11
-1.1533e-14
-1.91394e-12
-2.1345e-16
-6.75441e-14
-6.24541e-16
-1.36039e-15
-1.72764e-15
-1.10835e-15
-5.48741e-15
-3.7986e-15
-7.9722e-15
-5.30249e-15
-5.02765e-15
-4.70947e-15
-4.34486e-16
-8.53985e-16
-5.53625e-17
-4.19425e-16
-9.9997e-20
-4.21064e-17
-5.33454e-21
-2.69971e-19
-1.04067e-22
-1.15634e-20
-2.15346e-24
-2.57961e-22
-4.4893e-26
-5.63845e-24
-1.08367e-27
-1.17675e-25
-3.42322e-29
-2.66004e-27
-1.3315e-30
-7.5519e-29
-5.67404e-32
-2.69603e-30
-2.49278e-33
-1.09663e-31
-1.17581e-34
-4.70175e-33
-1.35828e-35
-2.08053e-34
-9.54546e-36
-1.22088e-35
-9.85531e-36
-3.69155e-36
-1.04385e-35
-3.35315e-36
-1.11383e-35
-3.39285e-36
-1.18325e-35
-3.47947e-36
-1.23527e-35
-3.56607e-36
-1.2576e-35
-3.60445e-36
-1.24836e-35
-3.56335e-36
-1.20603e-35
-3.4447e-36
-1.12946e-35
-3.25214e-36
-1.02012e-35
-2.98738e-36
-8.89517e-36
-2.6569e-36
-7.43136e-36
-2.2915e-36
-5.94936e-36
-1.90111e-36
-4.50281e-36
-1.52014e-36
-3.16173e-36
-1.15767e-36
-2.07094e-36
-8.2283e-37
-1.25717e-36
-5.49561e-37
-7.26507e-37
-3.42295e-37
-3.75312e-37
-2.05649e-37
-1.68777e-37
-1.12077e-37
-6.99099e-38
-5.39457e-38
-2.43676e-38
-2.4524e-38
-8.38542e-39
-9.66158e-39
-3.94118e-39
11.2778
-6.63307
8.81933
-4.90023
2.3122
-1.09269
0.1328
-1.05739e-14
9.57403e-15
-1.93383e-14
1.23564e-14
-2.38188e-14
4.67335e-14
-5.22831e-14
5.75275e-14
-5.79892e-14
5.40139e-14
-4.25626e-14
9.30322e-14
-1.06997e-13
1.10647e-12
-1.87228e-12
2.65264e-12
-7.97111e-12
3.60278e-13
-9.84516e-12
-7.92974e-14
-4.47448e-12
-3.77987e-15
-5.42418e-13
-1.16855e-16
-1.40329e-14
-1.02957e-16
-5.48604e-16
-2.3489e-16
-3.79697e-16
-3.61159e-16
-4.04601e-16
-3.56388e-16
-5.25177e-16
-1.36378e-16
-3.55258e-16
-7.55438e-17
-1.88291e-16
-8.52642e-18
-7.69003e-17
-5.65179e-20
-5.32695e-18
-2.31497e-21
-1.20192e-19
-5.22753e-23
-4.99631e-21
-1.16849e-24
-1.23636e-22
-2.47668e-26
-2.88467e-24
-5.72848e-28
-6.18881e-26
-1.66455e-29
-1.36919e-27
-6.0919e-31
-3.61855e-29
-2.54027e-32
-1.2039e-30
-1.11627e-33
-4.72967e-32
-5.05769e-35
-2.01584e-33
-3.03544e-36
-8.90386e-35
-9.37165e-37
-4.25178e-36
-8.67706e-37
-4.7848e-37
-8.9301e-37
-3.07315e-37
-9.29383e-37
-2.97912e-37
-9.64054e-37
-2.9812e-37
-9.83418e-37
-2.98639e-37
-9.78101e-37
-2.95237e-37
-9.48015e-37
-2.85403e-37
-8.93975e-37
-2.69649e-37
-8.16936e-37
-2.48686e-37
-7.19526e-37
-2.23089e-37
-6.11566e-37
-1.93639e-37
-4.97272e-37
-1.62958e-37
-3.87317e-37
-1.31725e-37
-2.85303e-37
-1.02582e-37
-1.94581e-37
-7.61052e-38
-1.23541e-37
-5.26006e-38
-7.23526e-38
-3.41054e-38
-4.03425e-38
-2.0526e-38
-2.0084e-38
-1.19165e-38
-8.65549e-39
-6.26887e-39
-3.43925e-39
-2.89644e-39
-1.14135e-39
-1.26446e-39
-3.7597e-40
-4.74794e-40
-1.85472e-40
5.70415
-1.92063
1.09269
-0.231201
2.79419e-15
-4.01505e-15
2.42888e-15
-9.65959e-15
1.24398e-14
-2.68367e-14
3.31559e-14
-3.48368e-14
3.61735e-14
-3.47171e-14
2.91442e-14
-2.11311e-14
1.08552e-14
-6.9747e-15
3.87868e-14
-5.77434e-14
3.56407e-13
-6.62047e-13
4.0015e-14
-2.05995e-12
-1.79543e-13
-2.78749e-12
-2.50224e-14
-1.12391e-12
-9.06024e-16
-1.10972e-13
-4.64285e-17
-1.5757e-15
-3.83408e-17
-2.12965e-16
-5.0703e-17
-1.06846e-16
-7.642e-17
-9.43379e-17
-5.68133e-17
-9.34714e-17
-3.38334e-17
-6.20099e-17
-1.51869e-17
-3.17035e-17
-1.07843e-18
-1.03741e-17
-2.3243e-20
-1.34776e-18
-9.67044e-22
-4.63076e-20
-2.42921e-23
-1.98225e-21
-5.70185e-25
-5.40846e-23
-1.24505e-26
-1.33952e-24
-2.80869e-28
-2.97782e-26
-7.59001e-30
-6.5671e-28
-2.58458e-31
-1.64394e-29
-1.03952e-32
-5.08018e-31
-4.53404e-34
-1.89987e-32
-2.04782e-35
-7.95846e-34
-9.98724e-37
-3.51433e-35
-1.14613e-37
-1.60789e-36
-7.49352e-38
-9.82954e-38
-7.37879e-38
-2.92405e-38
-7.48328e-38
-2.54099e-38
-7.57726e-38
-2.47229e-38
-7.55013e-38
-2.41938e-38
-7.3335e-38
-2.33843e-38
-6.93788e-38
-2.20965e-38
-6.38297e-38
-2.03956e-38
-5.68867e-38
-1.8366e-38
-4.88352e-38
-1.60806e-38
-4.04445e-38
-1.3615e-38
-3.1997e-38
-1.11741e-38
-2.42359e-38
-8.79746e-39
-1.7366e-38
-6.66917e-39
-1.1499e-38
-4.81774e-39
-7.07666e-39
-3.23608e-39
-3.99832e-39
-2.03616e-39
-2.15095e-39
-1.18376e-39
-1.03211e-39
-6.63833e-40
-4.26361e-40
-3.37095e-40
-1.62476e-40
-1.4954e-40
-5.13376e-41
-6.26833e-41
-1.61738e-41
-2.24365e-41
-8.38999e-42
0.231201
-1.14413e-15
1.24936e-15
-2.00058e-15
2.06837e-15
-4.16218e-15
1.01003e-14
-1.3973e-14
1.9514e-14
-2.52669e-14
2.01949e-14
-2.14938e-14
1.2665e-14
-1.34464e-14
3.84677e-15
-2.20079e-15
9.48071e-16
-1.02197e-15
6.95608e-15
-1.26697e-14
-9.88747e-15
-1.24709e-13
-8.50497e-14
-3.60569e-13
-4.36694e-14
-4.99449e-13
-5.72446e-15
-1.82351e-13
-1.99719e-16
-1.51947e-14
-1.68942e-17
-5.24575e-16
-1.02176e-17
-7.37908e-17
-1.14322e-17
-3.04506e-17
-1.29882e-17
-2.22156e-17
-9.74966e-18
-1.61695e-17
-5.3745e-18
-1.0256e-17
-1.7758e-18
-5.28597e-18
-2.25353e-19
-1.59154e-18
-7.97106e-21
-3.5062e-19
-3.60026e-22
-1.59584e-20
-9.91875e-24
-7.19899e-22
-2.50644e-25
-2.15247e-23
-5.68448e-27
-5.66657e-25
-1.27953e-28
-1.31307e-26
-3.27338e-30
-2.93067e-28
-1.03414e-31
-7.08951e-30
-3.95459e-33
-2.04687e-31
-1.69289e-34
-7.20869e-33
-7.63441e-36
-2.92972e-34
-3.56237e-37
-1.28437e-35
-2.21797e-38
-5.83683e-37
-6.70724e-39
-2.88725e-38
-5.91313e-39
-3.40043e-39
-5.82328e-39
-2.13274e-39
-5.75299e-39
-1.98745e-39
-5.59754e-39
-1.89808e-39
-5.30795e-39
-1.79302e-39
-4.89975e-39
-1.65566e-39
-4.39599e-39
-1.49254e-39
-3.81915e-39
-1.3118e-39
-3.19398e-39
-1.12048e-39
-2.57649e-39
-9.24886e-40
-1.9826e-39
-7.39981e-40
-1.45986e-39
-5.67243e-40
-1.01711e-39
-4.18429e-40
-6.53603e-40
-2.94218e-40
-3.89787e-40
-1.91972e-40
-2.12434e-40
-1.17164e-40
-1.10238e-40
-6.57728e-41
-5.09899e-41
-3.56115e-41
-2.01978e-41
-1.74533e-41
-7.38161e-42
-7.43551e-42
-2.2212e-42
-2.99259e-42
-6.69054e-43
-1.02131e-42
-3.65565e-43
6.68967e-16
-8.58282e-16
1.63696e-15
-2.51457e-15
8.89514e-15
-8.68698e-15
1.37739e-14
-1.10872e-14
1.44194e-14
-1.31511e-14
9.56409e-15
-6.14804e-15
1.40562e-15
-9.38016e-16
2.27628e-16
-1.10618e-16
7.04349e-17
-2.79318e-16
-4.09322e-16
-1.11571e-15
-6.46892e-15
-1.12638e-14
-1.16599e-14
-3.98393e-14
-7.5883e-15
-5.64675e-14
-9.9848e-16
-1.92287e-14
-3.75323e-17
-1.15202e-15
-5.51267e-18
-1.53396e-16
-2.64494e-18
-2.22464e-17
-2.20168e-18
-1.01706e-17
-1.85102e-18
-6.83715e-18
-1.35225e-18
-4.27599e-18
-7.44174e-19
-2.67835e-18
-2.37029e-19
-1.3661e-18
-5.66909e-20
-4.75701e-19
-2.72703e-21
-9.87496e-20
-1.2322e-22
-5.12177e-21
-3.73833e-24
-2.41762e-22
-1.00529e-25
-7.86782e-24
-2.37191e-27
-2.19792e-25
-5.4047e-29
-5.32353e-27
-1.33523e-30
-1.2157e-28
-3.93815e-32
-2.8957e-30
-1.4167e-33
-7.91378e-32
-5.87765e-35
-2.61364e-33
-2.6283e-36
-1.01792e-34
-1.21677e-37
-4.38636e-36
-6.12254e-39
-1.98542e-37
-7.32184e-40
-9.3162e-39
-4.65334e-40
-5.98306e-40
-4.38392e-40
-1.84819e-40
-4.22188e-40
-1.55424e-40
-4.01012e-40
-1.44383e-40
-3.71175e-40
-1.33245e-40
-3.34252e-40
-1.20207e-40
-2.92359e-40
-1.05813e-40
-2.47496e-40
-9.0743e-41
-2.01558e-40
-7.55815e-41
-1.58305e-40
-6.07968e-41
-1.18461e-40
-4.7399e-41
-8.47712e-41
-3.53657e-41
-5.7414e-41
-2.53758e-41
-3.57928e-41
-1.73625e-41
-2.06772e-41
-1.10019e-41
-1.08678e-41
-6.51078e-42
-5.43793e-42
-3.52771e-42
-2.42465e-42
-1.84303e-42
-9.21296e-43
-8.71537e-43
-3.2292e-43
-3.56633e-43
-9.25629e-44
-1.37811e-43
-2.6656e-44
-4.48583e-44
-1.53707e-44
1.18835e-15
-1.17848e-15
4.44818e-15
-3.21312e-15
6.42471e-15
-5.38547e-15
6.31443e-15
-3.33946e-15
3.39173e-15
-1.83328e-15
1.00583e-15
-2.62909e-16
7.75179e-17
-4.20175e-17
5.20323e-18
-1.03193e-17
-1.51721e-17
-4.2937e-17
-1.48238e-16
-2.20888e-16
-3.62609e-16
-6.86067e-16
-1.20592e-15
-2.76505e-15
-9.36735e-16
-3.84e-15
-7.41656e-17
-1.07675e-15
-1.05005e-17
-2.8724e-16
-1.7851e-18
-3.52569e-17
-9.65806e-19
-6.47273e-18
-7.01998e-19
-3.66017e-18
-4.8609e-19
-2.40211e-18
-3.34507e-19
-1.45427e-18
-1.85198e-19
-8.40444e-19
-6.97779e-20
-4.00469e-19
-1.50655e-20
-1.34471e-19
-7.89289e-22
-2.66684e-20
-3.83453e-23
-1.50938e-21
-1.28485e-24
-7.51274e-23
-3.66189e-26
-2.6515e-24
-9.06568e-28
-7.84287e-26
-2.11388e-29
-1.99084e-27
-5.14165e-31
-4.68703e-29
-1.43466e-32
-1.11658e-30
-4.83581e-34
-2.93699e-32
-1.92081e-35
-9.12728e-34
-8.43361e-37
-3.37525e-35
-3.88466e-38
-1.41404e-36
-1.85216e-39
-6.338e-38
-1.20646e-40
-2.93437e-39
-3.77235e-41
-1.49202e-40
-3.20368e-41
-1.90167e-41
-2.99776e-41
-1.19606e-41
-2.77884e-41
-1.0666e-41
-2.51016e-41
-9.60841e-42
-2.20486e-41
-8.46739e-42
-1.87972e-41
-7.27681e-42
-1.55001e-41
-6.08766e-42
-1.22876e-41
-4.94294e-42
-9.39375e-42
-3.87326e-42
-6.83414e-42
-2.94136e-42
-4.75141e-42
-2.13546e-42
-3.12777e-42
-1.49e-42
-1.89138e-42
-9.91768e-43
-1.0582e-42
-6.10188e-43
-5.36165e-43
-3.50066e-43
-2.58574e-43
-1.83022e-43
-1.11114e-43
-9.22055e-44
-4.05089e-44
-4.20524e-44
-1.36174e-44
-1.65293e-44
-3.71958e-45
-6.13232e-45
-1.02419e-45
-1.90446e-45
-6.24773e-46
8.99084e-16
-1.05086e-15
2.70367e-15
-1.03556e-15
2.15546e-15
-1.17502e-15
1.27622e-15
-4.01705e-16
2.46095e-16
-9.61048e-17
2.93751e-17
-9.52056e-18
6.40081e-19
-3.23204e-19
-1.14966e-18
-1.03911e-18
-5.25116e-18
-4.78353e-18
-1.88793e-17
-2.972e-17
-5.23301e-17
-1.18913e-16
-7.91559e-17
-2.35281e-16
-5.39644e-17
-2.66097e-16
-1.60104e-17
-2.24203e-16
-2.22975e-18
-5.02032e-17
-5.07318e-19
-6.62338e-18
-3.18718e-19
-2.09433e-18
-2.36888e-19
-1.28836e-18
-1.61056e-19
-8.041e-19
-9.98464e-20
-4.66654e-19
-5.12377e-20
-2.50257e-19
-1.81042e-20
-1.10889e-19
-3.71363e-21
-3.53732e-20
-2.19169e-22
-6.69514e-21
-1.12476e-23
-4.14768e-22
-4.05695e-25
-2.1804e-23
-1.22824e-26
-8.27761e-25
-3.18511e-28
-2.58865e-26
-7.65927e-30
-6.89232e-28
-1.86279e-31
-1.68137e-29
-5.00005e-33
-4.05383e-31
-1.58475e-34
-1.0435e-32
-5.97179e-36
-3.08122e-34
-2.54682e-37
-1.07765e-35
-1.16052e-38
-4.34499e-37
-5.45409e-40
-1.91222e-38
-2.80998e-41
-8.77812e-40
-3.62162e-42
-4.17291e-41
-2.29802e-42
-2.83619e-42
-2.06215e-42
-9.42507e-43
-1.86407e-42
-7.67713e-43
-1.64319e-42
-6.73204e-43
-1.40774e-42
-5.7938e-43
-1.1696e-42
-4.86064e-43
-9.39229e-43
-3.96621e-43
-7.24571e-43
-3.13858e-43
-5.38983e-43
-2.39502e-43
-3.81152e-43
-1.77107e-43
-2.5741e-43
-1.25084e-43
-1.64661e-43
-8.48426e-44
-9.65725e-44
-5.49269e-44
-5.23227e-44
-3.28083e-44
-2.55522e-44
-1.82447e-44
-1.18702e-44
-9.20284e-45
-4.91437e-45
-4.46835e-45
-1.71923e-45
-1.96477e-45
-5.5425e-46
-7.41823e-46
-1.44303e-46
-2.64172e-46
-3.79933e-47
-7.82937e-47
-2.45912e-47
5.84815e-16
-3.89783e-16
4.52627e-16
-1.98035e-16
2.13612e-16
-6.85825e-17
7.26961e-17
-1.45306e-17
7.33387e-18
-1.16481e-18
9.00263e-20
-2.92743e-20
-2.29968e-20
-2.40015e-20
-1.91604e-19
-1.32759e-19
-1.32552e-18
-5.82178e-19
-4.74626e-18
-2.81026e-18
-9.82e-18
-1.17628e-17
-1.12382e-17
-2.6213e-17
-1.02543e-17
-3.09514e-17
-2.65681e-18
-2.91469e-17
-4.2925e-19
-5.6967e-18
-1.53271e-19
-1.37045e-18
-1.03016e-19
-7.02682e-19
-7.38708e-20
-4.29782e-19
-4.70194e-20
-2.5779e-19
-2.76511e-20
-1.43081e-19
-1.31295e-20
-7.13556e-20
-4.40267e-21
-2.92973e-20
-8.73605e-22
-8.80348e-21
-5.60484e-23
-1.5793e-21
-3.03309e-24
-1.06739e-22
-1.18363e-25
-5.92122e-24
-3.7903e-27
-2.40467e-25
-1.03211e-28
-7.9352e-27
-2.57207e-30
-2.21697e-28
-6.33049e-32
-5.62192e-30
-1.66214e-33
-1.3836e-31
-5.00244e-35
-3.53617e-33
-1.78149e-36
-1.0053e-34
-7.30594e-38
-3.33221e-36
-3.26607e-39
-1.28345e-37
-1.52054e-40
-5.49626e-39
-7.31752e-42
-2.49101e-40
-5.0245e-43
-1.1594e-41
-1.68298e-43
-6.01607e-43
-1.37821e-43
-8.53782e-44
-1.21159e-43
-5.43553e-44
-1.04209e-43
-4.59026e-44
-8.70714e-44
-3.85582e-44
-7.0494e-44
-3.15759e-44
-5.51197e-44
-2.51294e-44
-4.1371e-44
-1.93767e-44
-2.99375e-44
-1.43955e-44
-2.05752e-44
-1.03631e-44
-1.34943e-44
-7.11873e-45
-8.38742e-45
-4.69258e-45
-4.7708e-45
-2.95407e-45
-2.5029e-45
-1.71288e-45
-1.17807e-45
-9.23288e-46
-5.26896e-46
-4.49345e-46
-2.10099e-46
-2.10183e-46
-7.0532e-47
-8.90635e-47
-2.18038e-47
-3.23006e-47
-5.41223e-48
-1.10405e-47
-1.3625e-48
-3.1235e-48
-9.39081e-49
1.20209e-16
-5.36469e-17
4.01535e-17
-1.33819e-17
7.68998e-18
-1.56874e-18
6.82805e-19
-9.64669e-20
2.49804e-20
-4.91941e-21
7.12403e-22
-5.33868e-22
6.08977e-22
-2.95756e-21
1.84788e-21
-1.10266e-20
-1.73143e-20
-3.76044e-20
-2.56454e-19
-1.44502e-19
-9.24237e-19
-4.0621e-19
-1.37763e-18
-9.36036e-19
-1.37765e-18
-1.69449e-18
-3.26129e-19
-1.65399e-18
-9.10674e-20
-6.55142e-19
-5.05387e-20
-3.66906e-19
-3.54348e-20
-2.18005e-19
-2.31153e-20
-1.33828e-19
-1.38202e-20
-7.78193e-20
-7.42671e-21
-4.13123e-20
-3.23239e-21
-1.93107e-20
-1.0249e-21
-7.39744e-21
-1.9163e-22
-2.0854e-21
-1.34184e-23
-3.5285e-22
-7.68207e-25
-2.58548e-23
-3.20447e-26
-1.51153e-24
-1.08353e-27
-6.52823e-26
-3.09628e-29
-2.26917e-27
-8.01936e-31
-6.65065e-29
-2.01425e-32
-1.75617e-30
-5.24928e-34
-4.43807e-32
-1.51998e-35
-1.13922e-33
-5.12694e-37
-3.16146e-35
-2.00706e-38
-1.00028e-36
-8.72373e-40
-3.66841e-38
-4.00648e-41
-1.51634e-39
-1.88619e-42
-6.73866e-41
-9.87976e-44
-3.09567e-42
-1.41206e-44
-1.47259e-43
-9.03035e-45
-1.07237e-44
-7.63884e-45
-3.90618e-45
-6.40728e-45
-3.05483e-45
-5.22139e-45
-2.49912e-45
-4.11946e-45
-1.9975e-45
-3.13591e-45
-1.55036e-45
-2.28945e-45
-1.16473e-45
-1.61146e-45
-8.4232e-46
-1.07617e-45
-5.90162e-46
-6.85323e-46
-3.94245e-46
-4.13807e-46
-2.52516e-46
-2.28278e-46
-1.54542e-46
-1.15969e-46
-8.69784e-47
-5.26163e-47
-4.54429e-47
-2.26485e-47
-2.13416e-47
-8.69484e-48
-9.61438e-48
-2.80095e-48
-3.9253e-48
-8.30155e-49
-1.36753e-48
-1.96507e-49
-4.48559e-49
-4.72836e-50
-1.21171e-49
-3.48659e-50
6.07337e-18
-1.63841e-18
7.94954e-19
-2.18067e-19
5.79596e-20
-2.85392e-20
3.46582e-21
-3.24459e-21
1.72806e-22
-2.45883e-22
1.66274e-23
-3.34496e-23
1.38006e-22
-1.88064e-22
5.64547e-22
-1.05226e-21
7.18985e-22
-4.38836e-21
-4.47881e-21
-1.80635e-20
-2.32113e-20
-5.93435e-20
-6.48946e-20
-1.351e-19
-8.18437e-20
-2.15112e-19
-3.66422e-20
-2.22219e-19
-2.24296e-20
-1.44113e-19
-1.50739e-20
-9.56607e-20
-1.02595e-20
-6.17557e-20
-6.46205e-21
-3.82801e-20
-3.76244e-21
-2.17628e-20
-1.87539e-21
-1.11329e-20
-7.61992e-22
-4.91727e-21
-2.25288e-22
-1.77205e-21
-3.97054e-23
-4.68751e-22
-3.0172e-24
-7.50974e-23
-1.81888e-25
-5.91935e-24
-8.07361e-27
-3.63702e-25
-2.8765e-28
-1.66234e-26
-8.62367e-30
-6.07622e-28
-2.32584e-31
-1.8675e-29
-5.99681e-33
-5.13964e-31
-1.56863e-34
-1.33892e-32
-4.4318e-36
-3.48148e-34
-1.42601e-37
-9.54993e-36
-5.31164e-39
-2.91362e-37
-2.22682e-40
-1.01873e-38
-1.0021e-41
-4.04097e-40
-4.65306e-43
-1.74832e-41
-2.23258e-44
-7.90814e-43
-1.63613e-45
-3.65082e-44
-5.98209e-46
-1.92842e-45
-4.68259e-46
-3.12393e-46
-3.82228e-46
-1.99937e-46
-3.03783e-46
-1.58001e-46
-2.33564e-46
-1.23212e-46
-1.73093e-46
-9.32643e-47
-1.22915e-46
-6.82616e-47
-8.41332e-47
-4.80479e-47
-5.45948e-47
-3.27589e-47
-3.37526e-47
-2.12799e-47
-1.9796e-47
-1.32419e-47
-1.05903e-47
-7.87664e-48
-5.21014e-48
-4.30279e-48
-2.279e-48
-2.17885e-48
-9.43905e-49
-9.87627e-49
-3.48786e-49
-4.28443e-49
-1.07829e-49
-1.68509e-49
-3.06353e-50
-5.64043e-50
-6.91629e-51
-1.7754e-50
-1.58995e-51
-4.5811e-51
-1.26106e-51
8.72044e-20
-3.5879e-19
1.17488e-20
-7.13758e-20
1.53917e-21
-1.05441e-20
1.18037e-22
-1.12896e-21
3.68324e-24
-9.44703e-23
-5.42638e-25
-1.11641e-23
-4.78681e-23
-4.56351e-23
-3.37419e-22
-1.99514e-22
-9.62676e-22
-7.2428e-22
-2.0475e-21
-2.52434e-21
-4.79995e-21
-7.4569e-21
-8.03186e-21
-1.69567e-20
-1.01545e-20
-2.8721e-20
-7.43173e-21
-3.49659e-20
-5.62547e-21
-3.0974e-20
-4.1277e-21
-2.31674e-20
-2.77468e-21
-1.59456e-20
-1.73208e-21
-1.00224e-20
-9.46441e-22
-5.63661e-21
-4.45402e-22
-2.79201e-21
-1.69421e-22
-1.17515e-21
-4.69385e-23
-4.00685e-22
-7.83328e-24
-9.99241e-23
-6.38935e-25
-1.53009e-23
-4.04678e-26
-1.28531e-24
-1.90024e-27
-8.27366e-26
-7.11728e-29
-3.98443e-27
-2.23713e-30
-1.52914e-28
-6.28703e-32
-4.92553e-30
-1.67013e-33
-1.41331e-31
-4.42367e-35
-3.80512e-33
-1.23467e-36
-1.00839e-34
-3.82865e-38
-2.76229e-36
-1.35881e-39
-8.21653e-38
-5.46306e-41
-2.75322e-39
-2.39185e-42
-1.04527e-40
-1.09281e-43
-4.375e-42
-5.08525e-45
-1.93848e-43
-2.7013e-46
-8.7949e-45
-4.38954e-47
-4.14707e-46
-2.81003e-47
-3.29907e-47
-2.21424e-47
-1.31788e-47
-1.71577e-47
-9.76865e-48
-1.28563e-47
-7.42063e-48
-9.2758e-48
-5.4778e-48
-6.4065e-48
-3.90595e-48
-4.26384e-48
-2.67582e-48
-2.68845e-48
-1.77497e-48
-1.61353e-48
-1.12111e-48
-9.19005e-49
-6.7775e-49
-4.76797e-49
-3.91765e-49
-2.27154e-49
-2.07704e-49
-9.58134e-50
-1.01943e-49
-3.8179e-50
-4.46059e-50
-1.35773e-50
-1.86322e-50
-4.02877e-51
-7.0587e-51
-1.09701e-51
-2.27073e-51
-2.36234e-52
-6.85936e-52
-5.18542e-53
-1.69137e-52
-4.45241e-53
2.62408e-20
-1.22611e-19
4.03065e-21
-2.21069e-20
4.21717e-22
-3.3081e-21
4.1139e-23
-3.83946e-22
2.87499e-24
-3.23826e-23
1.52936e-25
-3.01914e-24
6.29848e-25
-3.74109e-24
3.51777e-24
-1.48711e-23
-7.93376e-24
-6.46944e-23
-1.40722e-22
-2.92227e-22
-4.73302e-22
-1.03312e-21
-1.04561e-21
-2.54437e-21
-1.44552e-21
-4.59678e-21
-1.54644e-21
-6.15828e-21
-1.3213e-21
-6.24059e-21
-9.9162e-22
-5.18336e-21
-6.85881e-22
-3.76792e-21
-4.16151e-22
-2.41203e-21
-2.20792e-22
-1.35002e-21
-9.86903e-23
-6.52468e-22
-3.53988e-23
-2.63671e-22
-9.23366e-24
-8.55031e-23
-1.46878e-24
-2.02318e-23
-1.2761e-25
-2.99341e-24
-8.46243e-27
-2.65523e-25
-4.18478e-28
-1.78469e-26
-1.64499e-29
-9.02208e-28
-5.41669e-31
-3.62979e-29
-1.58663e-32
-1.22441e-30
-4.35393e-34
-3.66297e-32
-1.17478e-35
-1.02077e-33
-3.27307e-37
-2.76871e-35
-9.88977e-39
-7.63451e-37
-3.36189e-40
-2.23692e-38
-1.29297e-41
-7.23845e-40
-5.47349e-43
-2.63225e-41
-2.44817e-44
-1.06106e-42
-1.11898e-45
-4.57966e-44
-5.30316e-47
-2.04168e-45
-4.22945e-48
-9.24355e-47
-1.68895e-48
-4.99223e-48
-1.24756e-48
-9.38724e-49
-9.41148e-49
-5.94137e-49
-6.87316e-49
-4.37038e-49
-4.82816e-49
-3.14535e-49
-3.24338e-49
-2.18504e-49
-2.09875e-49
-1.45688e-49
-1.28585e-49
-9.40104e-50
-7.49153e-50
-5.7737e-50
-4.14342e-50
-3.39078e-50
-2.08465e-50
-1.90445e-50
-9.61826e-51
-9.79918e-51
-3.91282e-51
-4.66147e-51
-1.49987e-51
-1.96936e-51
-5.13246e-52
-7.9202e-52
-1.46199e-52
-2.8899e-52
-3.81538e-53
-8.93817e-53
-7.83821e-54
-2.59171e-53
-1.6414e-54
-6.10966e-54
-1.53753e-54
5.31473e-21
-3.1528e-20
8.55307e-22
-6.08385e-21
1.16386e-22
-8.75926e-22
1.04462e-23
-9.53516e-23
8.34625e-25
-7.15281e-24
1.15943e-25
-5.32632e-25
1.84625e-25
-9.7099e-25
5.21603e-25
-3.732e-24
7.92277e-25
-1.32587e-23
-7.06771e-24
-4.78394e-23
-5.23595e-23
-1.50872e-22
-1.44893e-22
-3.788e-22
-2.44773e-22
-7.33448e-22
-2.82659e-22
-1.06638e-21
-2.64175e-22
-1.18917e-21
-2.14245e-22
-1.07464e-21
-1.50778e-22
-8.20564e-22
-9.1057e-23
-5.36151e-22
-4.71826e-23
-2.99971e-22
-2.01989e-23
-1.42497e-22
-6.89515e-24
-5.56426e-23
-1.70394e-24
-1.72619e-23
-2.61883e-25
-3.90174e-24
-2.40127e-26
-5.63861e-25
-1.66202e-27
-5.23567e-26
-8.62592e-29
-3.66235e-27
-3.55422e-30
-1.93738e-28
-1.22529e-31
-8.15824e-30
-3.74101e-33
-2.87887e-31
-1.06233e-34
-8.97724e-33
-2.93316e-36
-2.59175e-34
-8.22282e-38
-7.21563e-36
-2.44649e-39
-2.01454e-37
-8.02846e-41
-5.86528e-39
-2.95643e-42
-1.84858e-40
-1.20475e-43
-6.46233e-42
-5.24713e-45
-2.50338e-43
-2.35549e-46
-1.04737e-44
-1.07145e-47
-4.57167e-46
-5.79859e-49
-2.02546e-47
-1.08949e-49
-9.41549e-49
-6.86857e-50
-8.38312e-50
-5.01497e-50
-3.61805e-50
-3.56903e-50
-2.52267e-50
-2.44122e-50
-1.76827e-50
-1.59522e-50
-1.19671e-50
-1.00362e-50
-7.7663e-51
-5.97478e-51
-4.87483e-51
-3.37947e-51
-2.91105e-51
-1.8149e-51
-1.66083e-51
-8.85525e-52
-9.06343e-52
-3.95665e-52
-4.52606e-52
-1.55279e-52
-2.0867e-52
-5.725e-53
-8.51435e-53
-1.8848e-53
-3.29679e-53
-5.15501e-54
-1.15848e-53
-1.28929e-54
-3.44603e-54
-2.52742e-55
-9.59326e-55
-5.04517e-56
-2.16332e-55
-5.20229e-56
9.44699e-22
-7.14046e-21
1.28502e-22
-1.31164e-21
1.26845e-23
-1.91379e-22
7.39593e-25
-2.12569e-23
-3.06117e-27
-1.8752e-24
-2.77659e-26
-1.66277e-25
-2.17041e-25
-1.31428e-25
-8.52515e-25
-4.24367e-25
-2.14065e-24
-1.54236e-24
-4.72974e-24
-6.22674e-24
-1.04773e-23
-2.12198e-23
-2.05463e-23
-5.62756e-23
-3.50851e-23
-1.14351e-22
-4.56755e-23
-1.7823e-22
-4.7216e-23
-2.14514e-22
-4.06588e-23
-2.07604e-22
-2.91275e-23
-1.65975e-22
-1.77953e-23
-1.10702e-22
-9.07218e-24
-6.22161e-23
-3.77255e-24
-2.92202e-23
-1.23412e-24
-1.10943e-23
-2.92172e-25
-3.31108e-24
-4.39536e-26
-7.19885e-25
-4.22673e-27
-1.02568e-25
-3.04943e-28
-9.89383e-27
-1.65821e-29
-7.17951e-28
-7.15812e-31
-3.96317e-29
-2.58365e-32
-1.74394e-30
-8.22677e-34
-6.43008e-32
-2.4211e-35
-2.08884e-33
-6.8632e-37
-6.2489e-35
-1.94846e-38
-1.78893e-36
-5.7613e-40
-5.0778e-38
-1.84142e-41
-1.47928e-39
-6.51859e-43
-4.57833e-41
-2.5526e-44
-1.54717e-42
-1.07755e-45
-5.76118e-44
-4.73591e-47
-2.32816e-45
-2.10753e-48
-9.90706e-47
-9.81585e-50
-4.30595e-48
-8.73061e-51
-1.89493e-49
-3.75244e-51
-1.05951e-50
-2.5964e-51
-2.32357e-51
-1.79896e-51
-1.43363e-51
-1.19836e-51
-9.7455e-52
-7.61873e-52
-6.42413e-52
-4.66048e-52
-4.05804e-52
-2.69638e-52
-2.47776e-52
-1.48082e-52
-1.43865e-52
-7.72214e-53
-7.97459e-53
-3.6542e-53
-4.22797e-53
-1.5812e-53
-2.04926e-53
-5.98773e-54
-9.15709e-54
-2.12329e-54
-3.60953e-54
-6.72403e-55
-1.34564e-54
-1.76613e-55
-4.55348e-55
-4.23272e-56
-1.30318e-55
-7.91788e-57
-3.48405e-56
-1.50465e-57
-7.51939e-57
-1.72767e-57
3.17018e-23
-1.39376e-21
4.4071e-24
-2.45928e-22
4.54029e-25
-3.42015e-23
1.11088e-25
-3.64302e-24
2.40686e-26
-2.80995e-25
3.85444e-27
-2.1855e-26
5.19692e-27
-2.56218e-26
1.62339e-26
-8.11964e-26
2.49551e-26
-2.65e-25
-1.34499e-26
-9.2408e-25
-6.53045e-25
-2.98686e-24
-2.25807e-24
-8.02291e-24
-4.35303e-24
-1.7142e-23
-6.31355e-24
-2.83614e-23
-7.09278e-24
-3.65359e-23
-6.39609e-24
-3.75812e-23
-4.79917e-24
-3.13461e-23
-2.9684e-24
-2.14025e-23
-1.52094e-24
-1.21234e-23
-6.21948e-25
-5.6628e-24
-1.98002e-25
-2.10265e-24
-4.55171e-26
-6.07124e-25
-6.80579e-27
-1.2784e-25
-6.8453e-28
-1.80932e-26
-5.15284e-29
-1.80171e-27
-2.93769e-30
-1.35221e-28
-1.33036e-31
-7.76823e-30
-5.03364e-33
-3.56553e-31
-1.67383e-34
-1.3715e-32
-5.11697e-36
-4.63714e-34
-1.49411e-37
-1.43711e-35
-4.31883e-39
-4.23429e-37
-1.27932e-40
-1.22521e-38
-4.01957e-42
-3.59018e-40
-1.37663e-43
-1.09895e-41
-5.18579e-45
-3.61294e-43
-2.11586e-46
-1.29632e-44
-9.0704e-48
-5.05024e-46
-3.96179e-49
-2.08708e-47
-1.74726e-50
-8.87967e-49
-9.76277e-52
-3.80448e-50
-2.13264e-52
-1.74286e-51
-1.30597e-52
-1.77918e-52
-8.77625e-53
-8.12974e-53
-5.69436e-53
-5.28024e-53
-3.52356e-53
-3.38766e-53
-2.09623e-53
-2.08314e-53
-1.17902e-53
-1.23729e-53
-6.2886e-54
-6.98539e-54
-3.1847e-54
-3.7619e-54
-1.46185e-54
-1.93798e-54
-6.12692e-55
-9.11753e-55
-2.23954e-55
-3.94904e-55
-7.63839e-56
-1.50407e-55
-2.32642e-56
-5.39892e-56
-5.86881e-57
-1.75915e-56
-1.34766e-57
-4.84511e-57
-2.40564e-58
-1.24427e-57
-4.34594e-59
-2.57128e-58
-5.6405e-59
-2.05025e-24
-2.43395e-22
-4.26617e-25
-4.19114e-23
-5.36962e-26
-5.72959e-24
-5.3212e-27
-6.06045e-25
-5.34332e-28
-4.81723e-26
-6.99996e-28
-3.88109e-27
-2.75884e-27
-4.20918e-27
-9.65904e-27
-1.24617e-26
-2.49472e-26
-3.81478e-26
-5.75538e-26
-1.25648e-25
-1.23147e-25
-4.01639e-25
-2.42945e-25
-1.10005e-24
-4.50228e-25
-2.44527e-24
-6.59247e-25
-4.28171e-24
-7.96812e-25
-5.85795e-24
-7.84524e-25
-6.37465e-24
-6.1791e-25
-5.55288e-24
-4.0027e-25
-3.8901e-24
-2.09954e-25
-2.23151e-24
-8.63407e-26
-1.04245e-24
-2.72444e-26
-3.80839e-25
-6.19488e-27
-1.07021e-25
-9.36945e-28
-2.19721e-26
-9.88157e-29
-3.10672e-27
-7.79627e-30
-3.17832e-28
-4.67776e-31
-2.46062e-29
-2.23066e-32
-1.46738e-30
-8.87625e-34
-7.01115e-32
-3.09278e-35
-2.80868e-33
-9.85033e-37
-9.87067e-35
-2.97419e-38
-3.16689e-36
-8.80053e-40
-9.60486e-38
-2.63129e-41
-2.8375e-39
-8.20206e-43
-8.39373e-41
-2.74039e-44
-2.55597e-42
-9.97015e-46
-8.22698e-44
-3.93022e-47
-2.85507e-45
-1.63928e-48
-1.07213e-46
-7.02149e-50
-4.29008e-48
-3.01966e-51
-1.78099e-49
-1.38435e-52
-7.47289e-51
-1.40921e-53
-3.17674e-52
-6.39806e-54
-1.87426e-53
-4.1118e-54
-4.77112e-54
-2.59878e-54
-2.81982e-54
-1.56638e-54
-1.75555e-54
-9.06936e-55
-1.05076e-54
-4.96193e-55
-6.07042e-55
-2.57203e-55
-3.33277e-55
-1.26548e-55
-1.74401e-55
-5.63837e-56
-8.72872e-56
-2.28975e-56
-3.98664e-56
-8.08311e-57
-1.67366e-56
-2.65226e-57
-6.16146e-57
-7.76967e-58
-2.12972e-57
-1.88305e-58
-6.68199e-58
-4.14297e-59
-1.77169e-58
-7.05335e-60
-4.37205e-59
-1.20897e-60
-8.65688e-60
-1.81384e-60
-2.13949e-25
-3.82293e-23
-4.6179e-26
-6.28231e-24
-5.77196e-27
-8.34313e-25
-3.76955e-28
-8.67003e-26
-1.87953e-29
-6.75987e-27
-2.19513e-29
-5.71403e-28
-4.66624e-29
-6.74125e-28
-2.47161e-29
-1.95844e-27
-2.76106e-28
-5.644e-27
-1.55692e-27
-1.71586e-26
-5.59256e-27
-5.23193e-26
-1.46861e-26
-1.43116e-25
-2.82104e-26
-3.28785e-25
-4.64207e-26
-6.05424e-25
-6.14569e-26
-8.76784e-25
-6.58675e-26
-1.00784e-24
-5.70828e-26
-9.17576e-25
-3.97315e-26
-6.61736e-25
-2.21163e-26
-3.86145e-25
-9.41781e-27
-1.8152e-25
-3.02378e-27
-6.56977e-26
-6.96393e-28
-1.81003e-26
-1.08723e-28
-3.65127e-27
-1.21139e-29
-5.1845e-28
-1.00953e-30
-5.43332e-29
-6.41684e-32
-4.33117e-30
-3.24124e-33
-2.67543e-31
-1.36317e-34
-1.328e-32
-4.99995e-36
-5.52987e-34
-1.66659e-37
-2.01666e-35
-5.22902e-39
-6.69137e-37
-1.59271e-40
-2.08826e-38
-4.84202e-42
-6.30432e-40
-1.51105e-43
-1.88782e-41
-4.97034e-45
-5.7472e-43
-1.75825e-46
-1.82289e-44
-6.7109e-48
-6.15283e-46
-2.72211e-49
-2.23248e-47
-1.14205e-50
-8.64235e-49
-4.82748e-52
-3.4927e-50
-2.06056e-53
-1.43526e-51
-1.21616e-54
-5.90164e-53
-3.08452e-55
-2.67582e-54
-1.80852e-55
-3.20043e-55
-1.1119e-55
-1.50461e-55
-6.53716e-56
-8.99865e-56
-3.68925e-56
-5.23972e-56
-1.96596e-56
-2.9445e-56
-9.91701e-57
-1.57206e-56
-4.74702e-57
-7.99335e-57
-2.05529e-57
-3.88706e-57
-8.09602e-58
-1.72353e-57
-2.76367e-58
-7.01373e-58
-8.73283e-59
-2.49586e-58
-2.4625e-59
-8.3066e-59
-5.73848e-60
-2.50901e-59
-1.21092e-60
-6.40409e-60
-1.96729e-61
-1.51865e-60
-3.19827e-62
-2.88048e-61
-5.75306e-62
1.40165e-25
-5.33978e-24
-1.12349e-27
-8.63633e-25
-4.71867e-28
-1.13891e-25
-6.53602e-29
-1.19646e-26
-7.3821e-30
-9.69983e-28
-7.95094e-30
-8.55419e-29
-1.99998e-29
-9.76318e-29
-6.4586e-29
-2.73044e-28
-1.8823e-28
-7.51243e-28
-4.7775e-28
-2.15944e-27
-1.00057e-27
-6.34325e-27
-1.71945e-27
-1.72916e-26
-2.54571e-27
-4.07169e-26
-3.23329e-27
-7.83477e-26
-3.94008e-27
-1.19239e-25
-4.34097e-27
-1.44189e-25
-3.99763e-27
-1.37115e-25
-3.01225e-27
-1.01944e-25
-1.79397e-27
-6.07254e-26
-8.02134e-28
-2.888e-26
-2.65956e-28
-1.04303e-26
-6.2975e-29
-2.84078e-27
-1.02717e-29
-5.67777e-28
-1.21314e-30
-8.1357e-29
-1.07233e-31
-8.72464e-30
-7.24538e-33
-7.15431e-31
-3.88834e-34
-4.57033e-32
-1.73346e-35
-2.3524e-33
-6.71304e-37
-1.01632e-34
-2.34818e-38
-3.83953e-36
-7.68195e-40
-1.31594e-37
-2.41847e-41
-4.22374e-39
-7.5192e-43
-1.30389e-40
-2.36733e-44
-3.96161e-42
-7.73763e-46
-1.21131e-43
-2.68282e-47
-3.81157e-45
-9.96377e-49
-1.26045e-46
-3.9359e-50
-4.44314e-48
-1.61746e-51
-1.66812e-49
-6.73632e-53
-6.56421e-51
-2.79662e-54
-2.64183e-52
-1.27519e-55
-1.06408e-53
-1.52732e-56
-4.36322e-55
-7.15819e-57
-2.80918e-56
-4.24591e-57
-8.20201e-57
-2.43942e-57
-4.56137e-57
-1.34456e-57
-2.57931e-57
-6.99413e-58
-1.41001e-57
-3.4402e-58
-7.32199e-58
-1.60516e-58
-3.618e-58
-6.76663e-59
-1.70953e-58
-2.59073e-59
-7.35971e-59
-8.56728e-60
-2.90327e-59
-2.61196e-60
-9.98851e-60
-7.10118e-61
-3.20081e-60
-1.59385e-61
-9.30448e-61
-3.23347e-62
-2.28617e-61
-5.01871e-63
-5.21021e-62
-7.73041e-64
-9.46698e-63
-1.80399e-63
5.27325e-26
-5.91494e-25
5.77413e-27
-9.56414e-26
4.78753e-28
-1.28019e-26
3.30002e-29
-1.39009e-27
1.34958e-30
-1.194e-28
-2.09798e-31
-1.0912e-29
-1.49826e-30
-1.09384e-29
-4.20118e-30
-3.01113e-29
-1.1089e-29
-8.13231e-29
-3.29817e-29
-2.25243e-28
-9.31621e-29
-6.42795e-28
-2.20912e-28
-1.74899e-27
-4.13672e-28
-4.21319e-27
-6.1501e-28
-8.43815e-27
-7.35513e-28
-1.34264e-26
-7.19021e-28
-1.70036e-26
-5.72211e-28
-1.68537e-26
-3.75887e-28
-1.29242e-26
-2.0124e-28
-7.87886e-27
-8.2489e-29
-3.8103e-27
-2.55108e-29
-1.38464e-27
-5.75989e-30
-3.76732e-28
-9.25872e-31
-7.53769e-29
-1.10359e-31
-1.09632e-29
-9.96417e-33
-1.20416e-30
-6.9445e-34
-1.0158e-31
-3.86645e-35
-6.70307e-33
-1.79196e-36
-3.57099e-34
-7.21201e-38
-1.59717e-35
-2.61549e-39
-6.23841e-37
-8.83619e-41
-2.20522e-38
-2.85611e-42
-7.27492e-40
-9.04794e-44
-2.29793e-41
-2.87288e-45
-7.10235e-43
-9.3524e-47
-2.19222e-44
-3.19127e-48
-6.89782e-46
-1.15642e-49
-2.25752e-47
-4.45198e-51
-7.80907e-49
-1.79048e-52
-2.86675e-50
-7.34223e-54
-1.10464e-51
-3.00225e-55
-4.37185e-53
-1.24529e-56
-1.73667e-54
-8.07811e-58
-6.86509e-56
-2.36623e-58
-3.18589e-57
-1.31356e-58
-4.79103e-58
-7.37787e-59
-2.28253e-58
-3.9814e-59
-1.24731e-58
-2.0274e-59
-6.63704e-59
-9.7551e-60
-3.3547e-59
-4.45135e-60
-1.61221e-59
-1.83392e-60
-7.40735e-60
-6.84921e-61
-3.0984e-60
-2.20347e-61
-1.18564e-60
-6.50991e-62
-3.94658e-61
-1.71373e-62
-1.21834e-61
-3.7223e-63
-3.40986e-62
-7.30904e-64
-8.06757e-63
-1.08798e-64
-1.76813e-63
-1.59918e-65
-3.07849e-64
-5.58524e-65
2.22188e-27
-3.36427e-26
2.21734e-28
-5.4506e-27
1.3933e-29
-7.39168e-28
-2.55124e-32
-8.25736e-29
-1.41737e-32
-7.49561e-30
-1.16864e-32
-7.58005e-31
-2.30826e-32
-7.59237e-31
-1.54915e-31
-2.02974e-30
-7.34061e-31
-5.37246e-30
-2.62994e-30
-1.44711e-29
-8.14533e-30
-4.03394e-29
-2.16686e-29
-1.09706e-28
-4.73729e-29
-2.70324e-28
-8.12217e-29
-5.63409e-28
-1.10026e-28
-9.34607e-28
-1.15772e-28
-1.23482e-27
-9.37829e-29
-1.27201e-27
-6.01298e-29
-1.00608e-27
-3.048e-29
-6.29564e-28
-1.1569e-29
-3.11114e-28
-3.27469e-30
-1.1471e-28
-6.79685e-31
-3.15105e-29
-1.02256e-31
-6.3744e-30
-1.15949e-32
-9.45734e-31
-1.0072e-33
-1.06462e-31
-6.82972e-35
-9.23058e-33
-3.72944e-36
-6.27632e-34
-1.70555e-37
-3.44907e-35
-6.79264e-39
-1.59102e-36
-2.44076e-40
-6.40243e-38
-8.16672e-42
-2.32751e-39
-2.60992e-43
-7.87919e-41
-8.14011e-45
-2.54638e-42
-2.53133e-46
-8.02337e-44
-8.01198e-48
-2.51294e-45
-2.63038e-49
-7.97258e-47
-9.12846e-51
-2.61245e-48
-3.35372e-52
-8.98782e-50
-1.29384e-53
-3.26997e-51
-5.11287e-55
-1.24886e-52
-2.0275e-56
-4.91053e-54
-7.99133e-58
-1.94325e-55
-3.69115e-59
-7.61331e-57
-5.51532e-60
-3.13721e-58
-2.60461e-60
-2.72004e-59
-1.40597e-60
-1.00057e-59
-7.36811e-61
-5.25314e-60
-3.65211e-61
-2.73439e-60
-1.71106e-61
-1.35243e-60
-7.61965e-62
-6.35191e-61
-3.06671e-62
-2.85161e-61
-1.11882e-62
-1.16419e-61
-3.51412e-63
-4.34017e-62
-1.01071e-63
-1.40289e-62
-2.59508e-64
-4.18665e-63
-5.49828e-65
-1.13135e-63
-1.06205e-65
-2.58209e-64
-1.52773e-66
-5.45737e-65
-2.16903e-67
-9.11009e-66
-1.5746e-66
-6.69083e-31
-2.53563e-31
-3.46923e-32
-1.98059e-33
-1.79881e-34
-7.68225e-34
-4.11966e-33
-8.80574e-33
-1.46431e-32
-3.2877e-32
-9.81315e-32
-2.9783e-31
-7.76012e-31
-1.58864e-30
-2.53486e-30
-3.09929e-30
-2.85375e-30
-2.04078e-30
-1.13156e-30
-4.60825e-31
-1.37651e-31
-2.99085e-32
-4.7065e-33
-5.56825e-34
-5.02671e-35
-3.53239e-36
-1.99217e-37
-9.37402e-39
-3.82561e-40
-1.4035e-41
-4.76951e-43
-1.5398e-44
-4.8228e-46
-1.49398e-47
-4.66602e-49
-1.49615e-50
-5.01494e-52
-1.76808e-53
-6.50605e-55
-2.45327e-56
-9.26281e-58
-3.44396e-59
-1.34039e-60
-1.09206e-61
-3.76047e-62
-1.84009e-62
-8.89667e-63
-4.07387e-63
-1.76614e-63
-7.30567e-64
-2.74019e-64
-9.38766e-65
-2.78714e-65
-7.64245e-66
-1.88451e-66
-3.91498e-67
-7.67287e-68
-1.08984e-68
-1.65633e-69
)
;
boundaryField
{
inlet
{
type calculated;
value nonuniform List<scalar>
44
(
-3.64879
-3.51807
-3.39204
-3.27053
-3.15336
-3.0404
-2.93148
-2.82646
-2.72521
-2.62758
-2.53345
-2.44269
-2.35518
-2.27081
-2.18946
-2.11103
-2.0354
-1.96248
-1.89218
-1.82439
-1.75837
-1.75837
-1.75837
-1.75837
-1.75837
-1.75837
-1.75837
-1.75837
-1.75837
-1.75837
-1.75837
-1.75837
-0.730867
-0.000129132
-9.75778e-36
-9.73905e-36
-3.29027e-36
-8.65503e-37
-1.6266e-37
-2.02649e-38
-1.53379e-39
-6.07736e-41
-1.01231e-42
-4.27144e-45
)
;
}
outlet
{
type calculated;
value nonuniform List<scalar>
64
(
11.3297
11.8486
12.1608
12.4259
12.6696
5.81477
0.0150812
2.5904e-13
7.34336e-12
4.13001e-11
8.96522e-11
7.29995e-11
2.13918e-11
7.22211e-13
9.16887e-14
1.39755e-12
8.19324e-12
5.61012e-12
4.64828e-13
3.38061e-15
5.64617e-16
2.14353e-16
7.70177e-17
2.02249e-17
3.52774e-18
4.17382e-19
3.27891e-20
-9.37743e-23
-3.33335e-22
-4.79632e-23
-6.142e-24
-7.1917e-25
-7.70227e-26
-7.54334e-27
-6.75673e-28
-5.53996e-29
-4.16396e-30
-2.874e-31
-1.8253e-32
-1.07012e-33
-5.23918e-35
-2.69919e-36
-1.32416e-37
-6.20124e-39
-2.77986e-40
-1.19535e-41
-4.94194e-43
-1.96758e-44
-7.55343e-46
-2.79902e-47
-1.00247e-48
-3.47313e-50
-1.16546e-51
-3.79162e-53
-1.19627e-54
-3.66117e-56
-1.08574e-57
-3.11215e-59
-8.57194e-61
-2.23801e-62
-5.31328e-64
-1.07629e-65
-1.38541e-67
-1.0432e-69
)
;
}
lowerWall
{
type calculated;
value uniform 0;
}
atmosphere
{
type calculated;
value uniform 0;
}
defaultFaces
{
type empty;
value nonuniform 0();
}
}
// ************************************************************************* //
| [
"peterbryz@yahoo.com"
] | peterbryz@yahoo.com | |
3073dce87a04fd14d3ea820596a4d898cef82ab2 | 1a381f952aaf398c77096f043c316921a390fc81 | /assignment1.cpp | cfd67bd6effd8d5c4748e9e6926a6e1c27e37791 | [] | no_license | elisemayo/CPSC350 | 88f53d2867b0affda57b9947777752b8c5ee9d98 | adeb3546ed8aea44f7684d327953aba817b82995 | refs/heads/master | 2020-07-18T02:07:51.487104 | 2019-12-07T02:46:47 | 2019-12-07T02:46:47 | 206,151,022 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,892 | cpp | /*Author: Elise May
Student ID: 2271041
Email: may137@mail.chapman.edu
CPSC 350-02
Assignment 1
This program calculates basic statistics for a given list of DNA strings.
*/
#include "assignment1.h"
#include <fstream>
#include <string>
#include <iostream>
#include <math.h>
#include <stdlib.h>
using namespace std;
assignment1(){
int countA = 0;
int countC = 0;
int countT = 0;
int countG = 0;
double sum = 0.0;
int lineCount = 0;
double mean = 0.0;
double variance = 0.0;
double stdev = 0.0;
double relativeProbA = 0.0;
double relativeProbC = 0.0;
double relativeProbT = 0.0;
double relativeProbG = 0.0;
double countAA = 0.0;
double countAC = 0.0;
double countAT = 0.0;
double countAG = 0.0;
double countCA = 0.0;
double countCC = 0.0;
double countCT = 0.0;
double countCG = 0.0;
double countTA = 0.0;
double countTC = 0.0;
double countTT = 0.0;
double countTG = 0.0;
double countGA = 0.0;
double countGT = 0.0;
double countGC = 0.0;
double countGG = 0.0;
double bigramTotal = 0.0;
double relativeProbAA = 0.0;
double relativeProbAC = 0.0;
double relativeProbAT = 0.0;
double relativeProbAG = 0.0;
double relativeProbCA = 0.0;
double relativeProbCC = 0.0;
double relativeProbCT = 0.0;
double relativeProbCG = 0.0;
double relativeProbTA = 0.0;
double relativeProbTC = 0.0;
double relativeProbTT = 0.0;
double relativeProbTG = 0.0;
double relativeProbGA = 0.0;
double relativeProbGC = 0.0;
double relativeProbGT = 0.0;
double relativeProbGG = 0.0;
double a = 0.0;
double b = 0.0;
double c = 0.0;
double d = 0.0;
double randProb = 0.0;
}
~assignment1(){}
//reading DNA string from file
void assignment1::readFile(instream & ifstream){
ifstream filein(fileName); //open the file
if (fileName.is_open() && fileName.good()) {
string DNAstring = "";
while (!instream.eof()){
getline(fileName, DNAstring, ' ');
}
} else {
cout << "Failed to open file.";
}
inputFile.close();
return 0;
}
void assignment1::statCalc(outstream){
//calculating basic stats (sum, mean, variance, standard deviation)
for(int i = 0; i < DNAstring.length(); ++i){
toupper(DNAstring[i]);
switch(DNAstring[i]){
case('A'): {
countA++;
sum++;
break;
}
case('C'): {
countC++;
sum++;
break;
}
case('T'): {
countT++;
sum++;
break;
}
case('G'): {
countG++;
sum++;
break;
}
}
lineCount++;
}
mean = (double)sum / (double)lineCount;
variance += pow(mean - DNAstring.length());
variance /= lineCount;
stdev = sqrt(variance);
outstream << "Sum: " << sum << endl;
outstream << "Mean: " << mean << endl;
outstream << "Variance: " << variance << endl;
outstream << "Standard Deviation: " << stdev << endl;
//calculating the relative probabilities of each nucleotide
relativeProbA = countA / sum;
relativeProbC = countC / sum;
relativeProbT = countT / sum;
relativeProbG = countG / sum;
outstream << "Relative Probability of A: " << relativeProbA << endl;
outstream << "Relative Probability of C: " << relativeProbC << endl;
outstream << "Relative Probability of T: " << relativeProbT << endl;
outstream << "Relative Probability of G: " << relativeProbG << endl;
for(int i = 0; i < DNAstring.length(); ++i){
toupper(DNAstring[i]);
switch(DNAstring[i]){
case('A'): {
if(DNAstring[i + 1] == 'A'){
countAA++;
bigramTotal++;
}
else if(DNAstring[i + 1] == 'C'){
countAC++;
bigramTotal++;
}
else if(DNAstring[i + 1] == 'T'){
countAT++;
bigramTotal++;
}
else if(DNAstring[i + 1] == 'G'){
countAG++;
bigramTotal++;
}
break;
}
case('C'): {
if(DNAstring[i + 1] == 'A'){
countCA++;
bigramTotal++;
}
else if(DNAstring[i + 1] == 'C'){
countCC++;
bigramTotal++;
}
else if(DNAstring[i + 1] == 'T'){
countCT++;
bigramTotal++;
}
else if(DNAstring[i + 1] == 'G'){
countCG++;
bigramTotal++;
}
break;
}
case('T'): {
if(DNAstring[i + 1] == 'A'){
countTA++;
bigramTotal++;
}
else if(DNAstring[i + 1] == 'C'){
countTC++;
bigramTotal++;
}
else if(DNAstring[i + 1] == 'T'){
countTT++;
bigramTotal++;
}
else if(DNAstring[i + 1] == 'G'){
countTG++;
bigramTotal++;
}
break;
}
case('G'): {
if(DNAstring[i + 1] == 'A'){
countGA++;
bigramTotal++;
}
else if(DNAstring[i + 1] == 'C'){
countGC++;
bigramTotal++;
}
else if(DNAstring[i + 1] == 'T'){
countGT++;
bigramTotal++;
}
else if(DNAstring[i + 1] == 'G'){
countGG++;
bigramTotal++;
}
break;
}
}
}
relativeProbAA = countAA / bigramTotal;
relativeProbAC = countAC / bigramTotal;
relativeProbAT = countAT / bigramTotal;
relativeProbAG = countAG / bigramTotal;
relativeProbCA = countCA / bigramTotal;
relativeProbCC = countCC / bigramTotal;
relativeProbCT = countCT / bigramTotal;
relativeProbCG = countCG / bigramTotal;
relativeProbTA = countTA / bigramTotal;
relativeProbTC = countTC / bigramTotal;
relativeProbTT = countTT / bigramTotal;
relativeProbTG = countTG / bigramTotal;
relativeProbGA = countGA / bigramTotal;
relativeProbGC = countGC / bigramTotal;
relativeProbGT = countGT / bigramTotal;
relativeProbGG = countGG / bigramTotal;
outstream << "Relative Probability of Nucleotide Bigrams:" << endl;
outstream << "AA: " << relativeProbAA << endl;
outstream << "AC: " << relativeProbAC << endl;
outstream << "AT: " << relativeProbAT << endl;
outstream << "AG: " << relativeProbAG << endl;
outstream << "CA: " << relativeProbCA << endl;
outstream << "CC: " << relativeProbCC << endl;
outstream << "CT: " << relativeProbCT << endl;
outstream << "CG: " << relativeProbCG << endl;
outstream << "TA: " << relativeProbTA << endl;
outstream << "TC: " << relativeProbTC << endl;
outstream << "TT: " << relativeProbTT << endl;
outstream << "TG: " << relativeProbTG << endl;
outstream << "GA: " << relativeProbGA << endl;
outstream << "GC: " << relativeProbGC << endl;
outstream << "GT: " << relativeProbGT << endl;
outstream << "GG: " << relativeProbGG << endl;
}
//calculating the gaussian distribution
void assignment1::gaussianDist(outstream){
double a = (double)rand() / (double)(RAND_MAX);
double b = (double)rand() / (double)(RAND_MAX);
double c = sqrt(-2 * log(a)) * (cos(2 * M_PI * b));
double d = (stdev * c) + mean;
//iterating 1000 times
for(int i = 0; i < 1000; ++i){
for(int j = 0; j < d; ++j){
//generating random probability
randProb = (double)rand() % 100
if(randProb <= relativeprobA){
outstream << "A";
}
else if(randProb <= (relativeProbA + relativeProbC)){
outstream << "C";
}
else if(randProb <= (relativeProbA + relativeProbC + relativeProbT)){
outstream << "T";
}
else if(randProb <= (relativeProbA + relativeProbC + relativeProbT + relativeProbG)){
outstream << "G";
}
}
outstream << endl;
}
}
| [
"may137@mail.chapman.edu"
] | may137@mail.chapman.edu |
d440aa2afbf8dce62f7c2d278d3714e8aff5d55e | d389ad009d9c5cd5eb148f27261ab492ca982332 | /TP_GEOM_MODEL_TP1/geom_model/tp_parametrique2/tp_parametrique/src/lib/spline/polygon_grid.cpp | c3b6b50e7f054e59021189ba09b588e5804db67e | [] | no_license | Guillaume0477/3D-Modelisation | 0707f42e9871791def0144d73ae6de354d0aae6c | 8aa529b033a4e37559db95e76e6cd12b49b409d3 | refs/heads/master | 2020-12-30T01:18:26.952071 | 2020-02-06T23:58:39 | 2020-02-06T23:58:39 | 238,809,236 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,751 | cpp | /*
** TP CPE Lyon
** Copyright (C) 2015 Damien Rohmer
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "polygon_grid.hpp"
#include "polygon_patch.hpp"
#include "../common/error_handling.hpp"
#include <fstream>
#include "math.h"
namespace cpe
{
polygon_grid::polygon_grid()
:size_u_data(4),size_v_data(4),
vertex_data({ {0.0f,0.0f,0.0f} , {0.0f,1.0f/3,0.0f} , {0.0f,2.0f/3,0.0f} , {0.0f,1.0f,0.0f} ,
{1.0f/3,0.0f,0.0f} , {1.0f/3,1.0f/3,0.0f} , {1.0f/3,2.0f/3,0.0f} , {1.0f/3,1.0f,0.0f} ,
{2.0f/3,0.0f,0.0f} , {2.0f/3,1.0f/3,0.0f} , {2.0f/3,2.0f/3,0.0f} , {2.0f/3,1.0f,0.0f} ,
{1.0f,0.0f,0.0f} , {1.0f,1.0f/3,0.0f} , {1.0f,2.0f/3,0.0f} , {1.0f,1.0f,0.0f} })
{}
int polygon_grid::size_u() const
{
return size_u_data;
}
int polygon_grid::size_v() const
{
return size_v_data;
}
int polygon_grid::size_patch_u() const
{
return std::max(size_u_data-3,0);
}
int polygon_grid::size_patch_v() const
{
return std::max(size_v_data-3,0);
}
vec3 const& polygon_grid::operator()(int const ku,int const kv) const
{
ASSERT_CPE(ku>=0 && ku<size_u() , "Index ku ("+std::to_string(ku)+") should be between [0,"+std::to_string(size_u())+"]");
ASSERT_CPE(kv>=0 && kv<size_v() , "Index kv ("+std::to_string(kv)+") should be between [0,"+std::to_string(size_v())+"]");
int const offset = ku+size_u()*kv;
ASSERT_CPE(offset>=0 && offset<static_cast<int>(vertex_data.size()),"Invalid offset size");
return vertex_data[offset];
}
vec3& polygon_grid::operator()(int const ku,int const kv)
{
ASSERT_CPE(ku>=0 && ku<size_u() , "Index ku ("+std::to_string(ku)+") should be between [0,"+std::to_string(size_u())+"]");
ASSERT_CPE(kv>=0 && kv<size_v() , "Index kv ("+std::to_string(kv)+") should be between [0,"+std::to_string(size_v())+"]");
int const offset = ku+size_u()*kv;
ASSERT_CPE(offset>=0 && offset<static_cast<int>(vertex_data.size()),"Invalid offset size");
return vertex_data[offset];
}
polygon_patch polygon_grid::patch(int const ku,int const kv) const
{
ASSERT_CPE(ku>=0 && ku<size_patch_u() , "Index patch ku ("+std::to_string(ku)+") should be between [0,"+std::to_string(size_patch_u())+"]");
ASSERT_CPE(kv>=0 && kv<size_patch_v() , "Index patch kv ("+std::to_string(kv)+") should be between [0,"+std::to_string(size_patch_v())+"]");
auto const& S=*this;
polygon_patch patch(S(ku+0,kv+0),S(ku+0,kv+1),S(ku+0,kv+2),S(ku+0,kv+3),
S(ku+1,kv+0),S(ku+1,kv+1),S(ku+1,kv+2),S(ku+1,kv+3),
S(ku+2,kv+0),S(ku+2,kv+1),S(ku+2,kv+2),S(ku+2,kv+3),
S(ku+3,kv+0),S(ku+3,kv+1),S(ku+3,kv+2),S(ku+3,kv+3));
return patch;
}
void polygon_grid::add_back_u()
{
int const Nu=size_u();
resize(size_u()+1,size_v(),0,0);
//add the last row
for(int kv=0;kv<size_v();++kv)
{
vec3 const& p1 = (*this)(Nu-2,kv);
vec3 const& p2 = (*this)(Nu-1,kv);
vec3 const u = p2-p1;
(*this)(Nu,kv) = p2+u;
}
}
void polygon_grid::add_front_u()
{
resize(size_u()+1,size_v(),1,0);
//add the first row
for(int kv=0;kv<size_v();++kv)
{
vec3 const& p1 = (*this)(2,kv);
vec3 const& p2 = (*this)(1,kv);
vec3 const u = p2-p1;
(*this)(0,kv) = p2+u;
}
}
void polygon_grid::add_back_v()
{
int const Nv=size_v();
resize(size_u(),size_v()+1,0,0);
//add the last line
for(int ku=0;ku<size_u();++ku)
{
vec3 const& p1 = (*this)(ku,Nv-2);
vec3 const& p2 = (*this)(ku,Nv-1);
vec3 const u = p2-p1;
(*this)(ku,Nv) = p2+u;
}
}
void polygon_grid::add_front_v()
{
resize(size_u(),size_v()+1,0,1);
//add the last line
for(int ku=0;ku<size_u();++ku)
{
vec3 const& p1 = (*this)(ku,2);
vec3 const& p2 = (*this)(ku,1);
vec3 const u = p2-p1;
(*this)(ku,0) = p2+u;
}
}
void polygon_grid::delete_back_u()
{
if(size_u()<=4) return ;
resize(size_u()-1,size_v());
}
void polygon_grid::delete_front_u()
{
if(size_u()<=4) return ;
resize(size_u()-1,size_v(),0,0,1,0);
}
void polygon_grid::delete_back_v()
{
if(size_v()<=4) return ;
resize(size_u(),size_v()-1);
}
void polygon_grid::delete_front_v()
{
if(size_v()<=4) return ;
resize(size_u(),size_v()-1,0,0,0,1);
}
void polygon_grid::duplicate_boundary()
{
resize(size_u()+2,size_v()+2,1,1);
//fill the corners
int const Nu=size_u();
int const Nv=size_v();
auto& S=*this;
for(int ku=1 ; ku<Nu-1 ; ++ku)
{
S(ku,0) = S(ku,1);
S(ku,Nv-1) = S(ku,Nv-2);
}
for(int kv=1 ; kv<Nv-1 ; ++kv)
{
S(0,kv) = S(1,kv);
S(Nu-1,kv) = S(Nu-2,kv);
}
//4 corners
S(0,0) = S(1,1);
S(Nu-1,0) = S(Nu-2,0);
S(0,Nv-1) = S(0,Nv-2);
S(Nu-1,Nv-1) = S(Nu-2,Nv-2);
}
void polygon_grid::resize(int const size_u_param,int const size_v_param ,
int const offset_u_dest,int const offset_v_dest,
int const offset_u_ori,int const offset_v_ori)
{
ASSERT_CPE(size_u_param>3 && size_v_param>3,"Invalid size");
polygon_grid const& S0=*this;
//resize data storage
polygon_grid S;
S.vertex_data.resize(size_u_param*size_v_param);
S.size_u_data=size_u_param;
S.size_v_data=size_v_param;
//copy the existing data
int const Nu=std::min(size_u_param,size_u());
int const Nv=std::min(size_v_param,size_v());
for(int ku=0 ; ku<Nu ; ++ku)
{
for(int kv=0 ; kv<Nv ; ++kv)
{
int const u_dest = ku+offset_u_dest;
int const v_dest = kv+offset_v_dest;
int const u_ori = ku+offset_u_ori;
int const v_ori = kv+offset_v_ori;
ASSERT_CPE(u_dest>=0 && u_dest<S.size_u(),"Incorrect index");
ASSERT_CPE(v_dest>=0 && v_dest<S.size_v(),"Incorrect index");
ASSERT_CPE(u_ori>=0 && u_ori<S0.size_u(),"Incorrect index");
ASSERT_CPE(v_ori>=0 && v_ori<S0.size_v(),"Incorrect index");
S(u_dest,v_dest) = S0(u_ori,v_ori);
}
}
*this=S;
}
void polygon_grid::save_file(std::string const& filename) const
{
std::ofstream stream(filename.c_str());
if(stream.good()!=true)
throw exception_cpe("Cannot open file"+filename,EXCEPTION_PARAMETERS_CPE);
auto const& G=*this;
int const Nu = size_u();
int const Nv = size_v();
stream<<Nu<<" "<<Nv<<std::endl;
for(int ku=0;ku<Nu;++ku)
{
for(int kv=0;kv<Nv;++kv)
{
vec3 const& p = G(ku,kv);
stream<<p.x()<<" "<<p.y()<<" "<<p.z()<<std::endl;
}
stream<<std::endl;
}
stream.close();
}
void polygon_grid::load_file(std::string const& filename)
{
std::ifstream stream(filename.c_str());
if(stream.good()!=true)
throw std::string("Cannot open file")+filename+" in "+__PRETTY_FUNCTION__;
std::string buffer;
int Nu = 0;
int Nv = 0;
stream>>Nu;
stream>>Nv;
if(Nu<3 || Nv<3 || Nu>5000 || Nv>5000)
throw exception_cpe("Incorect size reading",EXCEPTION_PARAMETERS_CPE);
polygon_grid G;
G.resize(Nu,Nv);
for(int ku=0 ; ku<Nu ; ++ku)
{
for(int kv=0 ; kv<Nv ; ++kv)
{
float x=0.0f;
float y=0.0f;
float z=0.0f;
stream>>x;
stream>>y;
stream>>z;
G(ku,kv)={x,y,z};
}
}
stream.close();
*this=G;
}
void polygon_grid::set_planar_grid(int const size_u_param,int const size_v_param)
{
resize(size_u_param,size_v_param);
auto& S=*this;
for(int kv=0;kv<size_v_param;++kv)
{
float const v = static_cast<float>(kv)/(size_v_param-1);
for(int ku=0;ku<size_u_param;++ku)
{
float const u = static_cast<float>(ku)/(size_u_param-1);
S(u,v) = {u,v,0.0f};
}
}
}
void polygon_grid::set_cylinder(int const size_u_param,int const size_v_param, float h_param, float r_param){
resize(size_u_param+1,size_v_param);
float pas_theta = 2.0f*M_PI/size_u_param;
float pas_hauteur = h_param/size_v_param;
auto& S=*this;
for(int ku=0;ku<=size_u_param;++ku){
float x = r_param*cos(ku*pas_theta);
float y = r_param*sin(ku*pas_theta);
for(int kv=0;kv<size_v_param;++kv){
float z=kv*pas_hauteur;
S(ku,kv)={x,y,z};
}
}
}
void polygon_grid::set_boule(int const size_u_param,int const size_v_param, float r_param){
resize(size_u_param+1,size_v_param+1);
float pas_theta_u = 2.0f*M_PI/size_u_param;
float pas_theta_v = 2.0f*M_PI/size_u_param;
auto& S=*this;
for(int ku=0;ku<=size_u_param;++ku){
for(int kv=0;kv<=size_v_param;++kv){
float x = r_param*cos(ku*pas_theta_u)*cos(kv*pas_theta_v);
float y = r_param*sin(ku*pas_theta_u)*cos(kv*pas_theta_v);
float z = r_param*sin(kv*pas_theta_v);
S(ku,kv)={x,y,z};
}
}
}
}
| [
"guillaumeduret1@gmail.com"
] | guillaumeduret1@gmail.com |
22a710e8c2ed528aa9dce99eb85c5c01936dbe4d | 5d290f3bba4f51f86569580bd1e7b3a16d80a0d8 | /project7/Die.h | cb1c0cf1e144926650b06d5e5e41b5d08e52c967 | [] | no_license | shidoosh/Intro-to-CS-I | 2ce84c56ecca1fc757f6a006712044d979c68d72 | 10675acdd9560b0634b48d4badc5b449cddf67dc | refs/heads/master | 2022-06-08T21:58:43.195576 | 2022-05-20T07:12:21 | 2022-05-20T07:12:21 | 125,438,496 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 714 | h |
#ifndef Die_h
#define Die_h
namespace cs31
{
// CS 31 Students have been provided this class which
// simulates a random Die toss. When roll( ) is called,
// a value between 1 - mSides will be calculated and stored.
// Retrieve the value rolled by calling getValue( ).
class Die
{
public:
Die( int sides = 6 ); // by default, a six sided die
void roll(); // tossing the die, updating mValue
int getValue( ) const; // retrieve the value that was just tossed
private:
int mSides; // how many sides are on this die?
int mValue; // the value of the most recent toss
};
}
#endif /* Die_h */
| [
"stefanieshidoosh@gmail.com"
] | stefanieshidoosh@gmail.com |
8f99c3903001d2d89cd09963f0a984b0378da66f | bf4ee4ef4e44365e88262521350bad4367b43c83 | /3rdparty/CH-HCNetSDK_Win32/Demo示例/1- MFC综合示例/DlgAcsFingerPrintCfg.cpp | 994fb21e2e08a0de7f16a230f1c55adab818ce11 | [] | no_license | jaueone/webvideo | a35109e86ad2e3f3689c75f086717ed2805881fa | 34a4d5d29f81b54a808fcec57309260672b13d67 | refs/heads/master | 2020-08-30T20:40:49.138843 | 2019-10-30T08:54:35 | 2019-10-30T08:54:35 | 218,482,729 | 2 | 1 | null | null | null | null | GB18030 | C++ | false | false | 54,982 | cpp | // DlgAcsFingerPrintCfg.cpp : implementation file
//
#include "stdafx.h"
#include "clientdemo.h"
#include "DlgAcsFingerPrintCfg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
void CALLBACK g_fSetFingerPrintCallback(DWORD dwType, void* lpBuffer, DWORD dwBufLen, void* pUserData);
void CALLBACK g_fGetFingerPrintCallback(DWORD dwType, void* lpBuffer, DWORD dwBufLen, void* pUserData);
UINT __cdecl g_fSendFingerPrintCfgThread(LPVOID pParam);
UINT __cdecl g_fShowFingerPrintListThread(LPVOID pParam);
#define WM_MSG_SET_FINGERPRINT_FINISH 1002
#define WM_MSG_GET_FINGERPRINT_FINISH 1003
#define WM_MSG_ADD_FINGERPRINT_TOLIST 1004
#define WM_MSG_UPDATEDATA_INTERFACE 1005
#define WM_DEL_FINGER_PRINT_FINISH 1006
/////////////////////////////////////////////////////////////////////////////
// DlgAcsFingerPrintCfg dialog
DlgAcsFingerPrintCfg::DlgAcsFingerPrintCfg(CWnd* pParent /*=NULL*/)
: CDialog(DlgAcsFingerPrintCfg::IDD, pParent)
, m_dwNowSendItem(0)
, m_iSelListItem(-1)
, m_lpRecordCardCfg(NULL)
,m_pDisplayListThread(NULL)
,m_dwBatchAddNum(0)
,m_lpNowSendCard(NULL)
,m_byLastCardSendTime(0)
{
//{{AFX_DATA_INIT(DlgAcsFingerPrintCfg)
m_byClearAllCard = FALSE;
m_byCallbackMode = FALSE;
m_sCardNo = _T("");
m_sFingerPrintPath = _T("");
m_byFingerPrintID = 0;
m_dwFingerPrintLen = 0;
m_dwCardReaderNo = 0;
m_dwCardNum = 0;
//}}AFX_DATA_INIT
m_lSetFingerPrintCfgHandle = -1;
m_lGetFingerPrintCfgHandle = -1;
m_hStopProcEvent = CreateEvent(NULL,TRUE,FALSE,NULL);
m_pProcThread = NULL;
}
DlgAcsFingerPrintCfg::~DlgAcsFingerPrintCfg()
{
CloseHandle(m_hStopProcEvent);
if (m_pProcThread != NULL && !m_pProcThread->m_bAutoDelete)
{
delete m_pProcThread;
}
if ( m_lpRecordCardCfg )
{
LPDWORD lpArr = m_lpRecordCardCfg;
// for (int i=0; i<m_dwCardNum; i++)
// {
// delete (LPNET_DVR_CARD_PASSWD_CFG)lpArr[i];
// }
delete [] m_lpRecordCardCfg;
}
}
void DlgAcsFingerPrintCfg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DlgAcsFingerPrintCfg)
DDX_Control(pDX, IDC_LIST_FINGER_PRINT_CFG, m_listFingerPrintCfg);
DDX_Control(pDX, IDC_COMBO_FINGER_TYPE, m_comboFingerType);
DDX_Control(pDX, IDC_TREE_ENABLE_CARD_READER, m_treeEnableCardReader);
DDX_Control(pDX, IDC_TREE_FINGER_PRINT_ID, m_treeDelFingerPrint);
DDX_Control(pDX, IDC_COMBO_MODE, m_comboDelMode);
DDX_Check(pDX, IDC_CHECK_CLEAR_ALL_CARD, m_byClearAllCard);
DDX_Check(pDX, IDC_CHECK_NO_BLOCK, m_byCallbackMode);
DDX_Text(pDX, IDC_EDIT_FINGER_PRINT_ID, m_byFingerPrintID);
DDX_Text(pDX, IDC_EDIT_FINGER_PRINT_LENGTH, m_dwFingerPrintLen);
DDX_Text(pDX, IDC_EDIT_CARD, m_sCardNo);
DDX_Text(pDX, IDC_EDIT_FINGER_PRINT_PATH, m_sFingerPrintPath);
DDX_Text(pDX, IDC_EDIT_FINGER_PRINT_NUMBER, m_dwCardNum);
DDX_Text(pDX, IDC_EDIT_CARD_READER_NO, m_dwCardReaderNo);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DlgAcsFingerPrintCfg, CDialog)
//{{AFX_MSG_MAP(DlgAcsFingerPrintCfg)
//ON_BN_CLICKED(IDC_BTN_SAVE, OnBtnSave)
ON_BN_CLICKED(IDC_BUTTON_SET, OnBtnSetFingerPrintcfg)
ON_BN_CLICKED(IDC_BUTTON_GET, OnBtnGetAllFingerPrint)
ON_BN_CLICKED(IDC_BUTTON_ADD, OnBtnAddToList)
ON_BN_CLICKED(IDC_BUTTON_DEL, OnBtnDel)
ON_NOTIFY(NM_CLICK, IDC_TREE_ENABLE_CARD_READER, OnClickTreeEnableCardReader)
ON_NOTIFY(NM_CLICK, IDC_TREE_FINGER_PRINT_ID, OnClickTreeDelFingerPrint)
ON_BN_CLICKED(IDC_BUTTON_STOP, OnBtnStopSend)
ON_WM_CLOSE()
ON_WM_DESTROY()
ON_MESSAGE(WM_MSG_SET_FINGERPRINT_FINISH,OnMsgSetFingerPrintCfgFinish)
ON_MESSAGE(WM_MSG_GET_FINGERPRINT_FINISH,OnMsgGetFingerPrintCfgFinish)
ON_MESSAGE(WM_MSG_ADD_FINGERPRINT_TOLIST,OnMsgAddFingerPrintCfgToList)
ON_MESSAGE(WM_DEL_FINGER_PRINT_FINISH, OnMsgDelFingerPrintFinish)
ON_MESSAGE(WM_MSG_UPDATEDATA_INTERFACE,OnMsgUpdateData)
//ON_BN_CLICKED(IDC_BTN_EXIT, OnBtnExit)
ON_NOTIFY(NM_CLICK, IDC_LIST_FINGER_PRINT_CFG, OnClickListScreen)
//ON_BN_CLICKED(IDC_BTN_GET_ALL, OnBtnGetAll)
ON_WM_CANCELMODE()
ON_WM_CAPTURECHANGED()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DlgAcsFingerPrintCfg message handlers
LRESULT DlgAcsFingerPrintCfg::OnMsgDelFingerPrintFinish(WPARAM wParam, LPARAM lParam)
{
DWORD dwType = (DWORD)wParam;
char szLan[256] = { 0 };
if (dwType == NET_SDK_CALLBACK_TYPE_DATA)
{
LPNET_DVR_FINGER_PRINT_INFO_STATUS_V50 pStruCaptureFace = (LPNET_DVR_FINGER_PRINT_INFO_STATUS_V50)lParam;
sprintf(szLan, "Device delete finger print status is:[%d], card reader no is:[%d]", pStruCaptureFace->byStatus, pStruCaptureFace->dwCardReaderNo);
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, szLan);
UpdateData(FALSE);
}
else
{
if (!NET_DVR_StopRemoteConfig(m_lRemoteHandle))
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "NET_DVR_StopRemoteConfig");
}
else
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "NET_DVR_StopRemoteConfig");
m_lRemoteHandle = -1;
}
}
return NULL;
}
BOOL DlgAcsFingerPrintCfg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_dwCount = 0;
m_dwDispNum = 0;
m_iCurSel = -1;
m_iDeviceIndex = g_pMainDlg->GetCurDeviceIndex();
m_lUserID = g_struDeviceInfo[m_iDeviceIndex].lLoginID;
memset(m_ModifyChan, 0, sizeof(m_ModifyChan));
memset(m_lDispChan, 0, sizeof(m_lDispChan));
memset(m_lDispChanSet, 0, sizeof(m_lDispChanSet));
memset(m_dwStatus, 0, sizeof(m_dwStatus));
memset(m_struFingerPrintCfg, 0, sizeof(m_struFingerPrintCfg));
memset(&m_struAblity, 0, sizeof(m_struAblity));
memset(&m_struFingerPrintCfgSet, 0, sizeof(m_struFingerPrintCfgSet));
m_lPapamCount = 0;
m_lRecordCount = 0;
memset(&m_struOutput, 0, sizeof(m_struOutput));
memset(&m_struOutputSet, 0, sizeof(m_struOutputSet));
memset(&m_lDispOutputSet, 0, sizeof(m_lDispOutputSet));
memset(m_dwRecordPapam, 0, sizeof(m_dwRecordPapam));
m_dwOutputSet = 0;
CString tmp;
int i = 0;
int ChanNo = -1;
char szLan[128] = {0};
m_listFingerPrintCfg.SetExtendedStyle(LVS_EX_GRIDLINES |LVS_EX_FULLROWSELECT);
g_StringLanType(szLan, "编号", "DispChan No.");
m_listFingerPrintCfg.InsertColumn(0, szLan, LVCFMT_LEFT,80, -1);
g_StringLanType(szLan, "指纹关联卡号", "VideoWall No.");
m_listFingerPrintCfg.InsertColumn(1, szLan,LVCFMT_LEFT,80, -1);
g_StringLanType(szLan, "指纹编号", "Fingerprint Num");
m_listFingerPrintCfg.InsertColumn(2, szLan,LVCFMT_LEFT,80,-1);
g_StringLanType(szLan, "指纹类型", "Fingerprint Type");
m_listFingerPrintCfg.InsertColumn(3, szLan,LVCFMT_LEFT,80,-1);
g_StringLanType(szLan, "指纹数据长度", "Enable");
m_listFingerPrintCfg.InsertColumn(4, szLan,LVCFMT_LEFT,80,-1);
g_StringLanType(szLan, "指纹图片路径", "LinkMode");
m_listFingerPrintCfg.InsertColumn(5, szLan,LVCFMT_LEFT,120,-1);
m_comboFingerType.ResetContent();
g_StringLanType(szLan, "普通指纹", "Common Fingerprint");
m_comboFingerType.InsertString(0,szLan);
g_StringLanType(szLan, "胁迫指纹", "Duress Fingerprint");
m_comboFingerType.InsertString(1,szLan);
m_comboFingerType.SetCurSel(0);
m_comboDelMode.ResetContent();
g_StringLanType(szLan, "按卡号删除", "Delete by CardNum");
m_comboDelMode.InsertString(0,szLan);
g_StringLanType(szLan, "按读卡器删除", "Delete by CardReader");
m_comboDelMode.InsertString(1,szLan);
m_comboDelMode.SetCurSel(0);
CreateTree();
// OnBtnGetAll();
i = 0;
//OnBtnGetAll();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void DlgAcsFingerPrintCfg::OnClose()
{
static BOOL bNotifyQuit = FALSE;
if ((m_pProcThread != NULL && WaitForSingleObject(m_pProcThread->m_hThread,0) != WAIT_OBJECT_0))
{
if (!bNotifyQuit)
{
SetEvent(m_hStopProcEvent);
if (m_pProcThread != NULL)
{
m_pProcThread->SetThreadPriority(THREAD_PRIORITY_ABOVE_NORMAL);
}
PostMessage(WM_CLOSE);
bNotifyQuit = TRUE;
}
PostMessage(WM_CLOSE);
return;
}
bNotifyQuit = FALSE;
CDialog::OnClose();
}
void DlgAcsFingerPrintCfg::OnDestroy()
{
StopProcThread();
CDialog::OnDestroy();
}
LRESULT DlgAcsFingerPrintCfg::OnMsgSetFingerPrintCfgFinish(WPARAM wParam,LPARAM lParam)
{
NET_DVR_StopRemoteConfig(m_lSetFingerPrintCfgHandle);
m_lSetFingerPrintCfgHandle = -1;
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "NET_DVR_SET_FINGERPRINT_CFG Set finish");
//ShowSelListItem();
return 0;
}
LRESULT DlgAcsFingerPrintCfg::OnMsgGetFingerPrintCfgFinish(WPARAM wParam,LPARAM lParam)
{
NET_DVR_StopRemoteConfig(m_lGetFingerPrintCfgHandle);
m_lGetFingerPrintCfgHandle = -1;
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "NET_DVR_GET_FINGERPRINT_CFG Get finish");
//ShowSelListItem();
return 0;
}
LRESULT DlgAcsFingerPrintCfg::OnMsgAddFingerPrintCfgToList(WPARAM wParam,LPARAM lParam)
{
LPNET_DVR_FINGER_PRINT_CFG lpCardCfg = (LPNET_DVR_FINGER_PRINT_CFG)wParam;
if ( lpCardCfg->dwSize == 0)
{
return 0;
}
AddToFingerPrintList(*lpCardCfg);
delete lpCardCfg;
return 0;
}
LRESULT DlgAcsFingerPrintCfg::OnMsgUpdateData(WPARAM wParam,LPARAM lParam)
{
DWORD dwTrue = (DWORD)wParam;
UpdateData(dwTrue);
return 0;
}
BOOL DlgAcsFingerPrintCfg::StartProcThread()
{
if (m_pProcThread != NULL)
{
StopProcThread();
}
m_pProcThread = AfxBeginThread(g_fSendFingerPrintCfgThread,this,THREAD_PRIORITY_NORMAL,0,CREATE_SUSPENDED,NULL);
if (m_pProcThread != NULL)
{
m_pProcThread->m_bAutoDelete = FALSE;
m_pProcThread->ResumeThread();
}
BOOL bResult = m_pProcThread != NULL;
return bResult;
}
BOOL DlgAcsFingerPrintCfg::StopProcThread()
{
BOOL bResult = TRUE;
if (m_pProcThread != NULL)
{
DWORD dwResult = WaitForSingleObject(m_pProcThread->m_hThread,5 * 1000);
if (dwResult == WAIT_TIMEOUT)
{
DWORD dwExitCode = 0;
if (GetExitCodeThread(m_pProcThread->m_hThread,&dwExitCode) && dwExitCode == STILL_ACTIVE)
{
bResult = TerminateThread(m_pProcThread->m_hThread,0);
}
}
if (bResult)
{
if (!m_pProcThread->m_bAutoDelete)
{
delete m_pProcThread;
m_pProcThread = NULL;
}
}
}
if (m_pDisplayListThread != NULL)
{
DWORD dwResult = WaitForSingleObject(m_pDisplayListThread->m_hThread,0);
if (dwResult == WAIT_TIMEOUT)
{
DWORD dwExitCode = 0;
if (GetExitCodeThread(m_pDisplayListThread->m_hThread,&dwExitCode) && dwExitCode == STILL_ACTIVE)
{
bResult = TerminateThread(m_pDisplayListThread->m_hThread,0);
}
}
if (bResult)
{
if (!m_pDisplayListThread->m_bAutoDelete)
{
delete m_pDisplayListThread;
m_pDisplayListThread = NULL;
}
}
}
return bResult;
}
void DlgAcsFingerPrintCfg::CreateTree()
{
CString strTemp =_T("");
CString strChanTmp = _T("");
int i = 0;
m_treeEnableCardReader.DeleteAllItems();
HTREEITEM hChanItem = NULL;
HTREEITEM hFirstItem = NULL;
for (i = 0; i < sizeof(m_struFingerPrintOne.byEnableCardReader); i++)
{
strTemp.Format("CardReader %d", i + 1);
hChanItem = m_treeEnableCardReader.InsertItem(strTemp, 0, 0, TVI_ROOT);
if (hFirstItem == NULL)
{
hFirstItem = hChanItem;
}
m_treeEnableCardReader.SetItemData(hChanItem, i);
if (m_struFingerPrintOne.byEnableCardReader[i])
{
m_treeEnableCardReader.SetCheck(hChanItem, TRUE);
}
}
m_treeEnableCardReader.SelectItem(hFirstItem);
m_treeEnableCardReader.Expand(m_treeEnableCardReader.GetRootItem(), TVE_EXPAND);
hChanItem = NULL;
hFirstItem = NULL;
m_treeDelFingerPrint.DeleteAllItems();
for (i = 0; i < sizeof(m_struDelFingerPrint.struProcessMode.struByCard.byFingerPrintID); i++)
{
strTemp.Format("id %d", i + 1);
hChanItem = m_treeDelFingerPrint.InsertItem(strTemp, 0, 0, TVI_ROOT);
if (hFirstItem == NULL)
{
hFirstItem = hChanItem;
}
m_treeDelFingerPrint.SetItemData(hChanItem, i);
if (m_struDelFingerPrint.struProcessMode.struByCard.byFingerPrintID[i])
{
m_treeDelFingerPrint.SetCheck(hChanItem, TRUE);
}
}
m_treeDelFingerPrint.SelectItem(hFirstItem);
m_treeDelFingerPrint.Expand(m_treeDelFingerPrint.GetRootItem(),TVE_EXPAND);
}
void DlgAcsFingerPrintCfg::GetTreeSel()
{
UpdateData(TRUE);
memset(&m_struFingerPrintOne.byEnableCardReader, 0 , sizeof(m_struFingerPrintOne.byEnableCardReader));
int i = 0;
HTREEITEM hTreeItem;
BOOL bCheck;
DWORD dwIndex;
DWORD dwCount = 0;
CTreeCtrl *treeCtr = &m_treeEnableCardReader;
dwCount = m_treeEnableCardReader.GetCount();
hTreeItem = m_treeEnableCardReader.GetRootItem();
for ( i=0; i<dwCount; i++)
{
bCheck = treeCtr->GetCheck(hTreeItem);
dwIndex = treeCtr->GetItemData(hTreeItem);
m_struFingerPrintOne.byEnableCardReader[dwIndex] = bCheck;
hTreeItem = treeCtr->GetNextSiblingItem(hTreeItem);
}
memset(&m_struDelFingerPrint.struProcessMode.struByCard.byFingerPrintID, 0 , sizeof(m_struDelFingerPrint.struProcessMode.struByCard.byFingerPrintID));
treeCtr = &m_treeDelFingerPrint;
hTreeItem = m_treeDelFingerPrint.GetRootItem();
dwCount = m_treeDelFingerPrint.GetCount();
for ( i=0; i<dwCount; i++)
{
bCheck = treeCtr->GetCheck(hTreeItem);
dwIndex = treeCtr->GetItemData(hTreeItem);
m_struDelFingerPrint.struProcessMode.struByCard.byFingerPrintID[dwIndex] = bCheck;
hTreeItem = treeCtr->GetNextSiblingItem(hTreeItem);
}
}
void DlgAcsFingerPrintCfg::OnClickTreeEnableCardReader(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CPoint pt(0,0);
CRect rc(0,0,0,0);
GetCursorPos(&pt);
m_treeEnableCardReader.ScreenToClient(&pt);
m_treeEnableCardReader.GetWindowRect(&rc);
m_treeEnableCardReader.ScreenToClient(&rc);
pt.x = pt.x - rc.left;
pt.y = pt.y - rc.top;
UINT uFlag = 0;
HTREEITEM hSelect = m_treeEnableCardReader.HitTest(pt, &uFlag);
if (NULL == hSelect)
{
return;
}
m_treeEnableCardReader.SelectItem(hSelect);
DWORD dwIndex = m_treeEnableCardReader.GetItemData(hSelect);
BOOL bCheck = m_treeEnableCardReader.GetCheck(hSelect);
m_treeEnableCardReader.SetCheck(hSelect, !bCheck);
m_struFingerPrintOne.byEnableCardReader[dwIndex] = !bCheck;
//switch checkbox status on click
if (uFlag & LVHT_ONITEM ||uFlag & LVHT_TOLEFT || uFlag & LVHT_ONITEMLABEL)//LVHT_TOLEFT)
{
m_treeEnableCardReader.SetCheck(hSelect, !bCheck);
m_struFingerPrintOne.byEnableCardReader[dwIndex] = !bCheck;
}
else
{
m_treeEnableCardReader.SetCheck(hSelect, bCheck);
m_struFingerPrintOne.byEnableCardReader[dwIndex] = bCheck;
}
UpdateData(FALSE);
*pResult = 0;
}
void DlgAcsFingerPrintCfg::OnClickTreeDelFingerPrint(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CPoint pt(0,0);
CRect rc(0,0,0,0);
GetCursorPos(&pt);
m_treeDelFingerPrint.ScreenToClient(&pt);
m_treeDelFingerPrint.GetWindowRect(&rc);
m_treeDelFingerPrint.ScreenToClient(&rc);
pt.x = pt.x - rc.left;
pt.y = pt.y - rc.top;
UINT uFlag = 0;
HTREEITEM hSelect = m_treeDelFingerPrint.HitTest(pt, &uFlag);
if (NULL == hSelect)
{
return;
}
m_treeDelFingerPrint.SelectItem(hSelect);
DWORD dwIndex = m_treeDelFingerPrint.GetItemData(hSelect);
BOOL bCheck = m_treeDelFingerPrint.GetCheck(hSelect);
m_treeDelFingerPrint.SetCheck(hSelect, !bCheck);
m_struDelFingerPrint.struProcessMode.struByCard.byFingerPrintID[dwIndex] = !bCheck;
//switch checkbox status on click
if (uFlag & LVHT_ONITEM ||uFlag & LVHT_TOLEFT || uFlag & LVHT_ONITEMLABEL)
{
m_treeDelFingerPrint.SetCheck(hSelect, !bCheck);
m_struDelFingerPrint.struProcessMode.struByCard.byFingerPrintID[dwIndex] = !bCheck;
}
else
{
m_treeDelFingerPrint.SetCheck(hSelect, bCheck);
m_struDelFingerPrint.struProcessMode.struByCard.byFingerPrintID[dwIndex] = bCheck;
}
UpdateData(FALSE);
*pResult = 0;
}
void DlgAcsFingerPrintCfg::OnBtnAddToList()
{
NET_DVR_FINGER_PRINT_CFG struFingerPrintCfg = {0};
UpdateFingerPrintCfg(struFingerPrintCfg);
AddToFingerPrintList(struFingerPrintCfg);
//UpdateSubList(&struCardCfg);
}
void DlgAcsFingerPrintCfg::OnDeleteitemListCard(NMHDR* pNMHDR, LRESULT* pResult)
{
// NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
// GATEWAY_CARD_INFO* pCardInfo = (GATEWAY_CARD_INFO*)pNMListView->lParam;
// if (pCardInfo != NULL)
// {
// delete pCardInfo;
// }
// *pResult = 0;
}
int DlgAcsFingerPrintCfg::GetExistItem(const NET_DVR_FINGER_PRINT_CFG *lpCardCfg)
{
int nItemCount = m_listFingerPrintCfg.GetItemCount();
int i = 0;
LPNET_DVR_FINGER_PRINT_CFG lpTemp = NULL;
for (i=0; i<nItemCount; i++)
{
lpTemp = (LPNET_DVR_FINGER_PRINT_CFG) m_listFingerPrintCfg.GetItemData(i);
if ( ! lpCardCfg )
{
continue;
}
if ( strcmp((char *)lpCardCfg->byCardNo, (char *)lpTemp->byCardNo) == 0 && lpCardCfg->byFingerPrintID==lpTemp->byFingerPrintID)
{
return i;
}
}
return -1;
}
void DlgAcsFingerPrintCfg::AddToFingerPrintList(const NET_DVR_FINGER_PRINT_CFG& struCardInfo)
{
LPNET_DVR_FINGER_PRINT_CFG pCardInfo = NULL;
int iItemIndex = GetExistItem(&struCardInfo);
if ( iItemIndex == -1)
{
pCardInfo = new NET_DVR_FINGER_PRINT_CFG;
int iSize = sizeof(NET_DVR_FINGER_PRINT_CFG);
int nItemCount = m_listFingerPrintCfg.GetItemCount();
CString strItem = "";
strItem.Format("%d",nItemCount + 1);
iItemIndex = m_listFingerPrintCfg.InsertItem(nItemCount,strItem);
m_listFingerPrintCfg.SetItemData(nItemCount,(DWORD)pCardInfo);
}
else
{
pCardInfo = (LPNET_DVR_FINGER_PRINT_CFG)m_listFingerPrintCfg.GetItemData(iItemIndex);
}
memcpy(pCardInfo,&struCardInfo,sizeof(struCardInfo));
UpdateList(iItemIndex, *pCardInfo);
LPDWORD lpArr = GetFingerPrintCfgPoint();
lpArr[iItemIndex] = (DWORD)pCardInfo;
}
LPDWORD DlgAcsFingerPrintCfg::GetFingerPrintCfgPoint()
{
if ( !m_lpRecordCardCfg)
{
const int iMaxCardNum = 1000;
m_lpRecordCardCfg = new DWORD[iMaxCardNum];
memset(m_lpRecordCardCfg,0,sizeof(DWORD)*iMaxCardNum);
}
return m_lpRecordCardCfg;
}
void DlgAcsFingerPrintCfg::UpdateList(int iInsertIndex, const NET_DVR_FINGER_PRINT_CFG& m_struFingerPrintCfg)
{
char szLan[1024] = {0};
sprintf(szLan, "%d", iInsertIndex);
//m_listFingerPrintCfg.InsertItem(iInsertIndex, szLan);
sprintf(szLan, "%s", m_struFingerPrintCfg.byCardNo);
m_listFingerPrintCfg.SetItemText(iInsertIndex, 1, szLan);
sprintf(szLan, "%d", m_struFingerPrintCfg.byFingerPrintID);
m_listFingerPrintCfg.SetItemText(iInsertIndex, 2, szLan);
sprintf(szLan, "%d", m_struFingerPrintCfg.byFingerType);
m_listFingerPrintCfg.SetItemText(iInsertIndex, 3, szLan);
sprintf(szLan, "%d", m_struFingerPrintCfg.dwFingerPrintLen);
m_listFingerPrintCfg.SetItemText(iInsertIndex, 4, szLan);
sprintf(szLan, "%s", m_struFingerPrintCfg.byFingerData);
m_listFingerPrintCfg.SetItemText(iInsertIndex, 5, szLan);
if (m_struFingerPrintCfg.dwFingerPrintLen != 0)
{
FILE* fp = NULL;
char szPath[1024] = { 0 };
sprintf(szPath, "%d fingerprint.dat", iInsertIndex);
fp = fopen(szPath, "wb");
if (fp == NULL)
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "fopen write failed");
}
//fread(struFingerPrintCfg.byFingerData, 1, m_dwFingerPrintLen , fp);
fwrite(m_struFingerPrintCfg.byFingerData, m_struFingerPrintCfg.dwFingerPrintLen, 1, fp);
fclose(fp);
}
// CString strItem = "";
// strItem.Format("%d",iInsertIndex + 1);
// // m_listFingerPrintCfg.InsertItem(iInsertIndex,strItem);
//
// m_listFingerPrintCfg.SetItemText(iInsertIndex,1, (char *)struCardInfo.byCardNo);
// // if ( struCardInfo.dwModifyParamType &0x1)
// // {
//
// strItem = (struCardInfo.byCardValid )?"Yes":"No";
// m_listFingerPrintCfg.SetItemText(iInsertIndex,2, strItem);
// // }
// // if (struCardInfo.dwModifyParamType &0x2)
// // {
// strItem = (struCardInfo.struValid.byEnable )?"Yes":"No";
// m_listFingerPrintCfg.SetItemText(iInsertIndex,8, strItem);
// if ( struCardInfo.struValid.byEnable )
// {
// const NET_DVR_TIME_EX *lpTimeEx = & struCardInfo.struValid.struBeginTime;
// strItem.Format("%d-%d-%d, %2d:%2d:%2d", lpTimeEx->wYear, lpTimeEx->byMonth, lpTimeEx->byDay, lpTimeEx->byHour, lpTimeEx->byMinute, lpTimeEx->bySecond);
// m_listFingerPrintCfg.SetItemText(iInsertIndex, 9, strItem);
// lpTimeEx = & struCardInfo.struValid.struEndTime;
// strItem.Format("%d-%d-%d, %2d:%2d:%2d", lpTimeEx->wYear, lpTimeEx->byMonth, lpTimeEx->byDay, lpTimeEx->byHour, lpTimeEx->byMinute, lpTimeEx->bySecond);
// m_listFingerPrintCfg.SetItemText(iInsertIndex, 10, strItem);
// }
// // }
// // if(struCardInfo.dwModifyParamType &0x4)
// // {
// char *p ;
// if (struCardInfo.byCardType == 0 || struCardInfo.byCardType > 7)
// {
// p = pCardType[0];
// }
// else
// p = pCardType[struCardInfo.byCardType];
// m_listFingerPrintCfg.SetItemText(iInsertIndex, 4, p);
// // }
// // if(struCardInfo.dwModifyParamType &0x10)
// // {
// strItem = (struCardInfo.byLeaderCard )?"Yes":"No";
// m_listFingerPrintCfg.SetItemText(iInsertIndex, 5, strItem);
//
// // }
// // if (struCardInfo.dwModifyParamType &0x20)
// // {
// strItem.Format("%d", struCardInfo.dwMaxSwipeTime);
// m_listFingerPrintCfg.SetItemText(iInsertIndex, 6, strItem);
// // }
// strItem.Format("%d", struCardInfo.dwSwipeTime);
// m_listFingerPrintCfg.SetItemText(iInsertIndex, 7, strItem);
// // if (struCardInfo.dwModifyParamType &0x80)
// // {
// char szCardPassTemp[CARD_PASSWORD_LEN+1] = {0};
// memcpy(szCardPassTemp, struCardInfo.byCardPassword, sizeof(struCardInfo.byCardPassword));
// strItem.Format("%s", szCardPassTemp);
// m_listFingerPrintCfg.SetItemText(iInsertIndex, 3, strItem);
// }
}
void DlgAcsFingerPrintCfg::OnBtnSetFingerPrintcfg()
{
if (m_lSetFingerPrintCfgHandle != -1)
{
NET_DVR_StopRemoteConfig(m_lSetFingerPrintCfgHandle);
}
UpdateData(TRUE);
NET_DVR_FINGER_PRINT_INFO_COND struCond = {0};
struCond.dwSize = sizeof(struCond);
struCond.dwFingerPrintNum = m_dwCardNum;
//struCond.byCheckCardNo = (BYTE)m_BcheckCardNo;
struCond.byCallbackMode = m_byCallbackMode;
LPDWORD lpArr = GetFingerPrintCfgPoint();
m_lSetFingerPrintCfgHandle = NET_DVR_StartRemoteConfig(m_lUserID,NET_DVR_SET_FINGERPRINT_CFG,&struCond,sizeof(struCond),g_fSetFingerPrintCallback,this);
if (m_lSetFingerPrintCfgHandle == -1)
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "NET_DVR_SET_FINGERPRINT_CFG failed");
return;
}
else
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "NET_DVR_SET_FINGERPRINT_CFG succ");
}
// StartProcThread();
//发送第一张卡, 失败关闭连接
m_dwSendIndex = 0;
if ( !SendFirstCard())
{
NET_DVR_StopRemoteConfig(m_lSetFingerPrintCfgHandle);
m_lSetFingerPrintCfgHandle = -1;
}
}
void DlgAcsFingerPrintCfg::OnBtnGetAllFingerPrint()
{
if (m_lGetFingerPrintCfgHandle != -1)
{
NET_DVR_StopRemoteConfig(m_lGetFingerPrintCfgHandle);
}
//清除所有卡项
// ClearList();
m_listFingerPrintCfg.DeleteAllItems();
UpdateData(TRUE);
NET_DVR_FINGER_PRINT_INFO_COND struCond = {0};
struCond.dwSize = sizeof(struCond);
struCond.dwFingerPrintNum = m_dwCardNum;
struCond.byFingerPrintID = m_byFingerPrintID;
memcpy(struCond.byCardNo, m_sCardNo.GetBuffer(m_sCardNo.GetLength()), m_sCardNo.GetLength());
//memcpy(struCond.byCardNo, )
GetTreeSel();
memcpy(struCond.byEnableCardReader, m_struFingerPrintOne.byEnableCardReader, sizeof(m_struFingerPrintOne.byEnableCardReader));
m_lGetFingerPrintCfgHandle = NET_DVR_StartRemoteConfig(m_lUserID,NET_DVR_GET_FINGERPRINT_CFG,&struCond,sizeof(struCond),g_fGetFingerPrintCallback,this);
if (m_lGetFingerPrintCfgHandle == -1)
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "NET_DVR_GET_FINGERPRINT_CFG failed");
return;
}
else
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "NET_DVR_GET_FINGERPRINT_CFG succ");
}
}
void CALLBACK g_fDelFingerPrintStatusCallBack(DWORD dwType, void *pRecvDataBuffer, DWORD dwBufSize, void* pUserData)
{
DlgAcsFingerPrintCfg *pThis = (DlgAcsFingerPrintCfg*)pUserData;
DWORD dwTemp = 0;
char szLan[128] = {0};
HWND hWnd = pThis->GetSafeHwnd();
if (NULL == hWnd)
{
return;
}
switch (dwType)
{
case NET_SDK_CALLBACK_TYPE_STATUS:
{
dwTemp = *((DWORD*)pRecvDataBuffer);
g_pMainDlg->AddLog(pThis->m_iDeviceIndex, OPERATION_SUCC_T, "Delete Finger Print CallBack");
::PostMessage(hWnd, WM_DEL_FINGER_PRINT_FINISH, (DWORD)dwTemp, dwType);
}
break;
case NET_SDK_CALLBACK_TYPE_PROGRESS:
g_pMainDlg->AddLog(pThis->m_iDeviceIndex, OPERATION_SUCC_T, "Delete Finger Print CallBack Processing");
break;
case NET_SDK_CALLBACK_TYPE_DATA:
{
char *pDataBuf = new char[sizeof(NET_DVR_FINGER_PRINT_INFO_STATUS_V50)];
if (pDataBuf == NULL)
{
dwType = NET_SDK_CALLBACK_STATUS_FAILED;
break;
}
memset(pDataBuf, 0, sizeof(NET_DVR_FINGER_PRINT_INFO_STATUS_V50));
memcpy(pDataBuf, pRecvDataBuffer, sizeof(NET_DVR_FINGER_PRINT_INFO_STATUS_V50));
LPNET_DVR_FINGER_PRINT_INFO_STATUS_V50 pDelFingerPrintTemp = (NET_DVR_FINGER_PRINT_INFO_STATUS_V50*)pDataBuf;
sprintf(szLan, "Device delete finger print status is:[%d], card reader no is:[%d]", pDelFingerPrintTemp->byStatus, pDelFingerPrintTemp->dwCardReaderNo);
g_pMainDlg->AddLog(pThis->m_iDeviceIndex, OPERATION_SUCC_T, szLan);
::PostMessage(hWnd, WM_DEL_FINGER_PRINT_FINISH, NET_SDK_CALLBACK_TYPE_DATA, (LONG)pDataBuf);
}
break;
default:
break;
}
}
void DlgAcsFingerPrintCfg::OnBtnDel()
{
UpdateData(TRUE);
if (m_lRemoteHandle >= 0)
{
NET_DVR_StopRemoteConfig(m_lRemoteHandle);
}
NET_DVR_FINGER_PRINT_INFO_CTRL_V50 struDelCfg;
memset(&struDelCfg, 0, sizeof(NET_DVR_FINGER_PRINT_INFO_CTRL_V50));
struDelCfg.dwSize = sizeof(NET_DVR_FINGER_PRINT_INFO_CTRL_V50);
struDelCfg.byMode = m_comboDelMode.GetCurSel();
if (struDelCfg.byMode == 0)
{
//struDelCfg.struProcessMode.uLen
memcpy(struDelCfg.struProcessMode.struByCard.byCardNo, m_sCardNo.GetBuffer(m_sCardNo.GetLength()), m_sCardNo.GetLength());
GetTreeSel();
memcpy(struDelCfg.struProcessMode.struByCard.byEnableCardReader, m_struFingerPrintOne.byEnableCardReader, sizeof(m_struFingerPrintOne.byEnableCardReader));
memcpy(struDelCfg.struProcessMode.struByCard.byFingerPrintID, m_struDelFingerPrint.struProcessMode.struByCard.byFingerPrintID, sizeof(m_struDelFingerPrint.struProcessMode.struByCard.byFingerPrintID));
}
else
{
struDelCfg.struProcessMode.struByReader.dwCardReaderNo = m_dwCardReaderNo;
struDelCfg.struProcessMode.struByReader.byClearAllCard = m_byClearAllCard;
memcpy(struDelCfg.struProcessMode.struByReader.byCardNo, m_sCardNo.GetBuffer(m_sCardNo.GetLength()), m_sCardNo.GetLength());
}
/*if (!NET_DVR_RemoteControl(m_lUserID, NET_DVR_DEL_FINGERPRINT_CFG, &struDelCfg, sizeof(struDelCfg)))
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "NET_DVR_DEL_FINGERPRINT_CFG FAILED");
return;
}
else
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "NET_DVR_DEL_FINGERPRINT_CFG SUCC");
}*/
m_lRemoteHandle = NET_DVR_StartRemoteConfig(m_lUserID, NET_DVR_DEL_FINGERPRINT_CFG_V50, &struDelCfg, sizeof(struDelCfg), g_fDelFingerPrintStatusCallBack, this);
if (m_lRemoteHandle < 0)
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "NET_DVR_DEL_FINGERPRINT_CFG_V50");
return;
}
else
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "NET_DVR_DEL_FINGERPRINT_CFG_V50");
}
}
void DlgAcsFingerPrintCfg::OnBtnSave()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
char szLan[128] = {0};
if (m_comboX.GetCurSel() == CB_ERR || m_comboY.GetCurSel() == CB_ERR)
{
g_StringLanType(szLan, "请选择坐标", "Please select Coordinate");
AfxMessageBox(szLan);
return;
}
NET_DVR_FINGER_PRINT_CFG struFingerPrintCfg ={0};
UpdateFingerPrintCfg(struFingerPrintCfg);
UpdateOutputNum(struFingerPrintCfg);
DrawList();
UpdateData(FALSE);
}
// void DlgAcsFingerPrintCfg::OnBtnSet()
// {
// // TODO: Add your control notification handler code here
// memset(m_dwStatus, 0, sizeof(m_dwStatus));
// LPNET_DVR_VIDEOWALLDISPLAYPOSITION lpDisplayPos = GetModifyDisplayPos();
// LONG * lDisplayChan = GetModifyChan();
// char csError[1024]={0};
// char csNum[128] = {0};
// if (!NET_DVR_SetDeviceConfig(m_lUserID, NET_DVR_SET_VIDEOWALLDISPLAYPOSITION, m_dwCount, lDisplayChan, 4 * m_dwCount, m_dwStatus, lpDisplayPos, m_dwCount * sizeof(NET_DVR_VIDEOWALLDISPLAYPOSITION)))
// {
// sprintf(csError, "设置修改失败, Error code: %d", NET_DVR_GetLastError());
// AfxMessageBox(csError);
// g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "NET_DVR_SET_VIDEOWALLDISPLAYPOSITION");
// return;
// }
// g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "NET_DVR_SET_VIDEOWALLDISPLAYPOSITION");
// int i = 0;
// BOOL bOneFail = FALSE;
// for (i = 0; i <m_dwCount; i++)
// {
// if (m_dwStatus[i] > 0)
// {
// sprintf(csNum, "%d ", lpDisplayPos[i].dwDisplayNo);
// strcat(csError, csNum);
// bOneFail = TRUE;
// }
// }
// if (bOneFail)
// {
// // sprintf(csError, "the outputnum failed to set: %s ", csError);
// AfxMessageBox(csError);
// return ;
// }
// OnBtnGetAll();
//
// }
//输出号位置获取
// void DlgAcsFingerPrintCfg::OnBtnGet()
// {
// // TODO: Add your control notification handler code here
// UpdateData(TRUE);
// POSITION iPos = m_listFingerPrintCfg.GetFirstSelectedItemPosition();
// if (iPos == NULL)
// {
// return;
// }
// NET_DVR_VIDEOWALLDISPLAYPOSITION struDisplayPos={0};
// struDisplayPos.dwSize = sizeof(struDisplayPos);
// DWORD dwDispChan = m_dwOutputNum;
// CString csTemp;
// char szLan[128]={0};
// if (!NET_DVR_GetDeviceConfig(m_lUserID, NET_DVR_GET_VIDEOWALLDISPLAYPOSITION, 1, &dwDispChan, sizeof(dwDispChan), NULL, &struDisplayPos, sizeof(NET_DVR_VIDEOWALLDISPLAYPOSITION)))
// {
// sprintf(szLan, "刷新该项失败, Error code %d",NET_DVR_GetLastError());
// AfxMessageBox(szLan);
// g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "NET_DVR_GET_VIDEOWALLDISPLAYPOSITION");
// //return;
// }
// else
// {
// NewOutputNum(struDisplayPos);
// DrawList();
// }
// }
void DlgAcsFingerPrintCfg::OnBtnExit()
{
// TODO: Add your control notification handler code here
CDialog::OnCancel();
}
void DlgAcsFingerPrintCfg::DrawList()
{
m_listFingerPrintCfg.DeleteAllItems();
int i = 0;
int j = 0;
char szLan[128] = {0};
for(i = 0; i < m_dwDispNum; i++)
{
sprintf(szLan, "%d", i);
m_listFingerPrintCfg.InsertItem(i, szLan);
sprintf(szLan, "%s", m_struFingerPrintCfg[i].byCardNo);
m_listFingerPrintCfg.SetItemText(i, 1, szLan);
sprintf(szLan, "%d", m_struFingerPrintCfg[i].byFingerPrintID);
m_listFingerPrintCfg.SetItemText(i, 2, szLan);
sprintf(szLan, "%d", m_struFingerPrintCfg[i].byFingerType);
m_listFingerPrintCfg.SetItemText(i, 3, szLan);
sprintf(szLan, "%d", m_struFingerPrintCfg[i].dwFingerPrintLen);
m_listFingerPrintCfg.SetItemText(i, 4, szLan);
sprintf(szLan, "%s", m_struFingerPrintCfg[i].byFingerData);
m_listFingerPrintCfg.SetItemText(i, 5, szLan);
}
}
void DlgAcsFingerPrintCfg::OnClickListScreen(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
LPNET_DVR_FINGER_PRINT_CFG lpCardCfg = GetSelItem();
if (lpCardCfg == NULL)
{
return;
}
m_sCardNo.Format("%s",lpCardCfg->byCardNo);
m_dwFingerPrintLen = lpCardCfg->dwFingerPrintLen;
memcpy(m_struFingerPrintOne.byEnableCardReader, lpCardCfg->byEnableCardReader, sizeof(lpCardCfg->byEnableCardReader));
CreateTree();
m_byFingerPrintID = lpCardCfg->byFingerPrintID;
m_comboFingerType.SetCurSel(lpCardCfg->byFingerType);
m_sFingerPrintPath.Format("%s",lpCardCfg->byFingerData);
*pResult = 0;
UpdateData(FALSE);
}
LPNET_DVR_FINGER_PRINT_CFG DlgAcsFingerPrintCfg::GetSelItem(char *lpCardNo)
{
UpdateData(TRUE);
POSITION iPos = m_listFingerPrintCfg.GetFirstSelectedItemPosition();
if (iPos == NULL)
{
return NULL;
}
int iCurSel = m_listFingerPrintCfg.GetNextSelectedItem(iPos);
m_iSelListItem = iCurSel;
m_listFingerPrintCfg.SetItemState( m_iSelListItem, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);
if ( lpCardNo )
{
m_listFingerPrintCfg.GetItemText(iCurSel, 1, lpCardNo, ACS_CARD_NO_LEN);
}
LPNET_DVR_FINGER_PRINT_CFG lpCardCfg = (LPNET_DVR_FINGER_PRINT_CFG) m_listFingerPrintCfg.GetItemData(iCurSel);
return lpCardCfg;
}
// void DlgAcsFingerPrintCfg::OnClickListScreen(NMHDR* pNMHDR, LRESULT* pResult)
// {
// // TODO: Add your control notification handler code here
// POSITION iPos = m_listFingerPrintCfg.GetFirstSelectedItemPosition();
// if (iPos == NULL)
// {
// return;
// }
// m_iCurSel = m_listFingerPrintCfg.GetNextSelectedItem(iPos);
// m_sCardNo.Format("%s",m_struFingerPrintCfg[m_iCurSel].byCardNo);
// m_dwFingerPrintLen = m_struFingerPrintCfg[m_iCurSel].dwFingerPrintLen;
// m_byFingerPrintID = m_struFingerPrintCfg[m_iCurSel].byFingerPrintID;
// m_comboFingerType.SetCurSel(m_struFingerPrintCfg[m_iCurSel].byFingerType);
// UpdateData(FALSE);
// *pResult = 0;
// }
// void DlgAcsFingerPrintCfg::OnBtnGetAll()
// {
// // TODO: Add your control notification handler code here
// UpdateData(TRUE);
// int i = 0;
// BOOL bOneFail = FALSE;
// char cs[1024] = {0};
// CString csTemp;
// char *pTemp = new char[4 + MAX_COUNT * sizeof(NET_DVR_VIDEOWALLDISPLAYPOSITION)];
// memset(pTemp, 0, 4 + MAX_COUNT * sizeof(NET_DVR_VIDEOWALLDISPLAYPOSITION));
// // if (!NET_DVR_GetDeviceConfig(m_lUserID, NET_DVR_GET_VIDEOWALLDISPLAYPOSITION, 0xffffffff, NULL, 0, NULL, pTemp, 4 + MAX_COUNT * sizeof(NET_DVR_VIDEOWALLDISPLAYPOSITION)))
// // {
// // sprintf(cs, "获取所有位置失败, Error code: %d", NET_DVR_GetLastError());
// // AfxMessageBox(cs);
// // g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "NET_DVR_GET_VIDEOWALLDISPLAYPOSITION");
// // //return;
// // }
// DWORD dwWallNo = m_byWallNo;
// dwWallNo <<= 24;
// if (!NET_DVR_GetDeviceConfig(m_lUserID, NET_DVR_GET_VIDEOWALLDISPLAYPOSITION, 0xffffffff, &dwWallNo, sizeof(DWORD), NULL, pTemp, 4 + MAX_COUNT * sizeof(NET_DVR_VIDEOWALLDISPLAYPOSITION)))
// {
// sprintf(cs, "获取墙所有输出位置失败, Error code: %d", NET_DVR_GetLastError());
// AfxMessageBox(cs);
// g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "NET_DVR_GET_VIDEOWALLDISPLAYPOSITION");
// //return;
// }
// else
// {
// g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "NET_DVR_GET_VIDEOWALLDISPLAYPOSITION");
// m_dwDispNum = *((DWORD*)pTemp);
// memcpy(m_struWallParam, pTemp + 4, m_dwDispNum * sizeof(NET_DVR_VIDEOWALLDISPLAYPOSITION));
// memset(m_dwStatus, 0, sizeof(m_dwStatus));
// ClearModify();
// m_comboOutput.ResetContent();
// for (i = 0; i<m_dwDispNum; i++)
// {
// m_lDispChan[i] = m_struWallParam[i].dwDisplayNo;
// sprintf(cs, "%d", m_lDispChan[i]);
// m_comboOutput.AddString(cs);
// m_comboOutput.SetItemData(i, m_lDispChan[i]);
// }
// m_lPapamCount = m_dwDispNum;
// }
// delete []pTemp;
// //m_listFingerPrintCfg.DeleteAllItems();
// DrawList();
// m_listFingerPrintCfg.UpdateData(FALSE);
// m_listFingerPrintCfg.SetItemState(m_iCurSel, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);
// }
//更新项记录
BOOL DlgAcsFingerPrintCfg::UpdateOutputNum(const NET_DVR_FINGER_PRINT_CFG &struFingerPrintCfg)
{
//判断是否新修改项
int i=0;
int j = 0;
for (i=0; i<m_dwDispNum; i++)
{
}
m_struFingerPrintCfg[i] = struFingerPrintCfg;
if (i >= m_dwDispNum)
{
//新项
m_dwDispNum ++;
//添加修改记录
m_lDispChanSet[m_dwCount] = i;
m_dwCount ++;
}
else
{
//原有项
// 判断是否添加修改记录
for(j=0; j<m_dwCount; j++)
{
if (m_lDispChanSet[j] == i)
{
break;
}
}
if(j>=m_dwCount)
{
m_lDispChanSet[m_dwCount] = i;
m_dwCount ++;
}
}
return TRUE;
}
//更新界面数值到变量
BOOL DlgAcsFingerPrintCfg::UpdateFingerPrintCfg(NET_DVR_FINGER_PRINT_CFG &struFingerPrintCfg)
{
UpdateData(TRUE);
struFingerPrintCfg.dwSize = sizeof(struFingerPrintCfg);
memcpy(struFingerPrintCfg.byCardNo, m_sCardNo.GetBuffer(m_sCardNo.GetLength()), m_sCardNo.GetLength());
struFingerPrintCfg.dwFingerPrintLen = m_dwFingerPrintLen;
GetTreeSel();
memcpy(struFingerPrintCfg.byEnableCardReader, m_struFingerPrintOne.byEnableCardReader, sizeof(struFingerPrintCfg.byEnableCardReader));
struFingerPrintCfg.byFingerPrintID = m_byFingerPrintID;
struFingerPrintCfg.byFingerType = m_comboFingerType.GetCurSel();
//HPR_HANDLE hFileHandle = HPR_OpenFile(m_sFingerPrintPath, HPR_READ|HPR_BINARY, HPR_ATTR_READONLY);
//HPR_UINT32 NumberOfBytesRead;
// if (HPR_ReadFile(hFileHandle, struFingerPrintCfg.szFingerData, m_dwFingerPrintLen, &NumberOfBytesRead) != HPR_OK)
// {
// g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "HPR_ReadFile failed");
// return TRUE;
// }
FILE* fp = NULL;
fp=fopen(m_sFingerPrintPath,"rb"); //只供读取
if (fp == NULL)
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "HPR_ReadFile failed");
return TRUE;
}
fseek(fp, 0L, SEEK_END);
int len = ftell(fp);
rewind(fp);
fread(struFingerPrintCfg.byFingerData, 1, m_dwFingerPrintLen , fp);
fclose(fp);
//memcpy(struFingerPrintCfg.szFingerData, m_sFingerPrintPath.GetBuffer(m_sFingerPrintPath.GetLength()), m_sFingerPrintPath.GetLength());
//struFingerPrintCfg.pFingerData = strtmp;
//sprintf(struFingerPrintCfg.byCardNo,"%s",m_sCardNo.GetBuffer(m_sCardNo.GetLength()));
return TRUE;
}
BOOL DlgAcsFingerPrintCfg::NewOutputNum(const NET_DVR_FINGER_PRINT_CFG &struDisplayPos)
{
int i=0;
for (i=0; i<m_dwDispNum; i++)
{
// if ( struDisplayPos.dwDisplayNo == m_struFingerPrintCfgSet[i].dwDisplayNo)
// {
// break;
// }
}
m_struFingerPrintCfg[i] = struDisplayPos;
if (i >= m_dwDispNum)
{
//新项
m_dwDispNum ++;
}
else
{
//原有项
//判断是否添加修改记录 删除修改记录
int j;
int iCount = m_dwCount;
for(j=0; j<iCount; j++)
{
if (m_lDispChanSet[j] == i)
{
break;
}
}
for ( ; j<iCount; j++)
{
m_lDispChanSet[j] = m_lDispChanSet[j+1];
}
if ( m_dwCount )
{
m_dwCount --;
}
}
return TRUE;
}
//获取修改过项
LPNET_DVR_FINGER_PRINT_CFG DlgAcsFingerPrintCfg::GetModifyDisplayPos()
{
memset(m_struFingerPrintCfgSet, 0, sizeof(m_struFingerPrintCfgSet));
for (int i=0; i<m_dwCount; i++)
{
m_struFingerPrintCfgSet[i] = m_struFingerPrintCfg[m_lDispChanSet[i]];
//m_ModifyChan[i] = m_struFingerPrintCfgSet[i].dwDisplayNo;
}
return m_struFingerPrintCfgSet;
}
LONG * DlgAcsFingerPrintCfg::GetModifyChan() //获取修改过显示输出号数组
{
memset(m_ModifyChan, 0, sizeof(m_ModifyChan));
for (int i=0; i<m_dwCount; i++)
{
// m_ModifyChan[i] = m_struFingerPrintCfg[m_lDispChanSet[i] ].dwDisplayNo ;
}
return m_ModifyChan;
}
BOOL DlgAcsFingerPrintCfg::ClearModify()
{
memset(m_struFingerPrintCfgSet, 0, sizeof(m_struFingerPrintCfgSet));
m_dwCount = 0;
memset(m_ModifyChan, 0, sizeof(m_ModifyChan));
return TRUE;
}
LONG * DlgAcsFingerPrintCfg::GetModifyPapamChan()
{
memset(m_ModifyChan, 0, sizeof(m_ModifyChan));
for (int i=0; i<m_lRecordCount; i++)
{
m_ModifyChan[i] = m_lDispChan[m_dwRecordPapam[i] ];
}
return m_ModifyChan;
}
void CALLBACK g_fSetFingerPrintCallback(DWORD dwType, void* lpBuffer, DWORD dwBufLen, void* pUserData)
{
DlgAcsFingerPrintCfg* pDlg = (DlgAcsFingerPrintCfg*)pUserData;
if (pDlg == NULL)
{
return;
}
pDlg->ProcessSetFingerPrintCfgCallbackData(dwType,lpBuffer,dwBufLen);
}
void CALLBACK g_fGetFingerPrintCallback(DWORD dwType, void* lpBuffer, DWORD dwBufLen, void* pUserData)
{
DlgAcsFingerPrintCfg* pDlg = (DlgAcsFingerPrintCfg*)pUserData;
if (pDlg == NULL)
{
return;
}
pDlg->ProcessGetFingerPrintCfgCallbackData(dwType,lpBuffer,dwBufLen);
}
void DlgAcsFingerPrintCfg::ProcessSetFingerPrintCfgCallbackData(DWORD dwType, void* lpBuffer, DWORD dwBufLen)
{
CString strItem = "";
// if (dwType != NET_SDK_CALLBACK_TYPE_STATUS)
// {
//g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "recv unknow type[%d]", dwType);
//return;
//}
if (dwType == NET_SDK_CALLBACK_TYPE_STATUS)
{
DWORD dwStatus = *(DWORD*)lpBuffer;
if (dwStatus == NET_SDK_CALLBACK_STATUS_PROCESSING)
{
char szCardNumber[ACS_CARD_NO_LEN + 1] = "\0";
strncpy(szCardNumber,(char*)(lpBuffer) + 4,ACS_CARD_NO_LEN);
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "SetFingerPrint PROCESSING %s", szCardNumber);
//SetFingerPrintCfgState(szCardNumber,TRUE);
SendNextFingerPrint();
}
else if (dwStatus == NET_SDK_CALLBACK_STATUS_FAILED)
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "SetFingerPrint Err:NET_SDK_CALLBACK_STATUS_FAILED");
SendNextFingerPrint();
}
//下面两个关闭长连接
else if (dwStatus == NET_SDK_CALLBACK_STATUS_SUCCESS)
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "SetFingerPrint SUCCESS");
PostMessage(WM_MSG_SET_FINGERPRINT_FINISH,0,0);
}
else if (dwStatus == NET_SDK_CALLBACK_STATUS_EXCEPTION)
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "SetFingerPrint Excepiyion");
PostMessage(WM_MSG_SET_FINGERPRINT_FINISH,0,0);
}
else
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "SetFingerPrint SUCCESS");
PostMessage(WM_MSG_SET_FINGERPRINT_FINISH,0,0);
}
}
else if ( dwType == NET_SDK_CALLBACK_TYPE_DATA)
{
NET_DVR_FINGER_PRINT_STATUS struCfg = {0};
memcpy(&struCfg, lpBuffer, sizeof(struCfg));
int i;
BOOL bSendOk = FALSE;
for (i=0; i<sizeof(struCfg.byCardReaderRecvStatus); i++)
{
if (struCfg.byCardReaderRecvStatus[i] == 1)
{
bSendOk = TRUE;
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "SetFingerPrint PROCESSING %s,CardReader %d, dwCardReaderNo: %d", struCfg.byCardNo, i, struCfg.dwCardReaderNo);
}
else if(struCfg.byCardReaderRecvStatus[i] == 2)
{
bSendOk = TRUE;
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "SetFingerPrint PROCESSING %s,CardReader %d, dwCardReaderNo: %d", struCfg.byCardNo, i, struCfg.dwCardReaderNo);
}
else if(struCfg.byCardReaderRecvStatus[i] == 3)
{
bSendOk = TRUE;
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "SetFingerPrint PROCESSING %s,CardReader %d, dwCardReaderNo: %d", struCfg.byCardNo, i, struCfg.dwCardReaderNo);
}
else if(struCfg.byCardReaderRecvStatus[i] == 4)
{
bSendOk = TRUE;
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "SetFingerPrint PROCESSING %s,CardReader %d, dwCardReaderNo: %d", struCfg.byCardNo, i, struCfg.dwCardReaderNo);
}else if(struCfg.byCardReaderRecvStatus[i] == 5)
{
bSendOk = TRUE;
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "SetFingerPrint PROCESSING %s,CardReader %d, byErrorMsg: %s, dwCardReaderNo: %d", struCfg.byCardNo, i, struCfg.byErrorMsg,struCfg.dwCardReaderNo );
}
else if(struCfg.byCardReaderRecvStatus[i] == 6)
{
bSendOk = TRUE;
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "SetFingerPrint PROCESSING %s,CardReader %d, dwCardReaderNo: %d", struCfg.byCardNo, i, struCfg.dwCardReaderNo);
}
else if(struCfg.byCardReaderRecvStatus[i] == 7)
{
bSendOk = TRUE;
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "SetFingerPrint PROCESSING %s,CardReader %d, dwCardReaderNo: %d", struCfg.byCardNo, i, struCfg.dwCardReaderNo);
}
else if(struCfg.byCardReaderRecvStatus[i] == 8)
{
bSendOk = TRUE;
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "SetFingerPrint PROCESSING %s,CardReader %d, dwCardReaderNo: %d", struCfg.byCardNo, i, struCfg.dwCardReaderNo);
}
}
if (!bSendOk)
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "SetFingerPrint Failed,CardNo:%s", struCfg.byCardNo);
}
if (m_byCallbackMode == 0 || struCfg.byTotalStatus == 1)
{
SendNextFingerPrint();
}
}
}
void DlgAcsFingerPrintCfg::ProcessGetFingerPrintCfgCallbackData(DWORD dwType, void* lpBuffer, DWORD dwBufLen)
{
CString strItem = "";
if (dwType == NET_SDK_CALLBACK_TYPE_DATA)
{
LPNET_DVR_FINGER_PRINT_CFG lpCardCfg = new NET_DVR_FINGER_PRINT_CFG;
memcpy(lpCardCfg, lpBuffer, sizeof(*lpCardCfg));
int i;
BOOL bSendOk = FALSE;
for (i=0; i<sizeof(lpCardCfg->byEnableCardReader); i++)
{
if (lpCardCfg->byEnableCardReader[i] == 1)
{
bSendOk = TRUE;
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_SUCC_T, "GetFingerPrint PROCESSING %s,CardReader %d", lpCardCfg->byCardNo, i);
}
}
if (!bSendOk)
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "GetFingerPrint Failed,CardNo:%s", lpCardCfg->byCardNo);
}
PostMessage(WM_MSG_ADD_FINGERPRINT_TOLIST, (WPARAM)lpCardCfg,0);
}
else if (dwType == NET_SDK_CALLBACK_TYPE_STATUS)
{
DWORD dwStatus = *(DWORD*)lpBuffer;
if (dwStatus == NET_SDK_CALLBACK_STATUS_SUCCESS)
{
PostMessage(WM_MSG_GET_FINGERPRINT_FINISH,0,0);
}
else if ( dwStatus == NET_SDK_CALLBACK_STATUS_FAILED )
{
char szCardNumber[ACS_CARD_NO_LEN + 1] = "\0";
DWORD dwErrCode = *(DWORD*)((char *)lpBuffer + 4);
strncpy(szCardNumber,(char*)(lpBuffer) + 8,ACS_CARD_NO_LEN);
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "GetCard STATUS_FAILED, Error code %d, Card Number %s", dwErrCode, szCardNumber);
}
}
}
void DlgAcsFingerPrintCfg::SendFingerPrintData(LPNET_DVR_FINGER_PRINT_CFG lpCardCfg, DWORD dwDiffTime)
{
}
void DlgAcsFingerPrintCfg::SendFingerPrintData()
{
if (m_lSetFingerPrintCfgHandle == -1)
{
return;
}
LPNET_DVR_FINGER_PRINT_CFG lpCardCfg = NULL;
// if ( m_BSendSel )
// {
// // lpCardCfg = GetSelItem();
// SendCardData( m_lpSelSendCardCfg );
// m_BSendSel = FALSE;
// m_lpSelSendCardCfg = NULL;
// return;
// }
int nItemCount = m_listFingerPrintCfg.GetItemCount();
LPDWORD lpArr = GetFingerPrintCfgPoint();
DWORD beforeWait = 0;
DWORD afterWait = 0;
for (int i = 0; i < nItemCount; i++)
{
// lpCardCfg = (LPNET_DVR_FINGER_PRINT_CFG) m_listFingerPrintCfg.GetItemData(i);
lpCardCfg = (LPNET_DVR_FINGER_PRINT_CFG)lpArr[i];
if ( ! lpCardCfg )
{
continue;
}
// beforeWait = GetTickCount();
if ( i%10 == 9 && WaitForSingleObject(m_hStopProcEvent,0) == WAIT_OBJECT_0)
{
break;
}
// afterWait = GetTickCount();
m_dwNowSendItem = i;
SendFingerPrintData(lpCardCfg, afterWait-beforeWait);
}
}
UINT __cdecl g_fSendFingerPrintCfgThread(LPVOID pParam)
{
DlgAcsFingerPrintCfg* pDlg = (DlgAcsFingerPrintCfg*)pParam;
if (pParam != NULL)
{
pDlg->SendFingerPrintData();
}
return 0;
}
UINT __cdecl g_fShowFingerPrintListThread(LPVOID pParam)
{
DlgAcsFingerPrintCfg* pDlg = (DlgAcsFingerPrintCfg*)pParam;
if (pParam != NULL)
{
pDlg->BatchAddFingerPrintToList();
}
return 0;
}
BOOL DlgAcsFingerPrintCfg::SendFirstCard()
{
if ( m_lSetFingerPrintCfgHandle == -1)
{
return FALSE;
}
// if ( m_BSendSel )
// {
// // lpCardCfg = GetSelItem();
// SendCardData( m_lpSelSendCardCfg );
// m_BSendSel = FALSE;
// m_lpSelSendCardCfg = NULL;
// return TRUE;
// }
m_dwSendIndex = 0;
if( m_dwCardNum < 1)
{
return FALSE;
}
LPDWORD lpArr = GetFingerPrintCfgPoint();
m_lpNowSendCard = (LPNET_DVR_FINGER_PRINT_CFG)lpArr[m_dwSendIndex];
if (!NET_DVR_SendRemoteConfig(m_lSetFingerPrintCfgHandle,3/*ENUM_ACS_SEND_DATA*/, (char *)m_lpNowSendCard ,sizeof(*m_lpNowSendCard)))
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "Send Fail,CardNO: %s", m_lpNowSendCard->byCardNo);
return FALSE;
}
return TRUE;
}
//重发
BOOL DlgAcsFingerPrintCfg::ReSendLastFingerPrint()
{
if ( m_lSetFingerPrintCfgHandle == -1)
{
return FALSE;
}
m_byLastCardSendTime ++;
// if ( m_byLastCardSendTime >= MAX_RESEND_CARD_TIME)
// {
// return FALSE;
// }
if (!NET_DVR_SendRemoteConfig(m_lSetFingerPrintCfgHandle,3/*ENUM_ACS_SEND_DATA*/, (char *)m_lpNowSendCard ,sizeof(*m_lpNowSendCard)))
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "Send Fail,CardNO: %s", m_lpNowSendCard->byCardNo);
return FALSE;
}
return TRUE;
}
//发送下一张
BOOL DlgAcsFingerPrintCfg::SendNextFingerPrint()
{
if ( m_lSetFingerPrintCfgHandle == -1)
{
return FALSE;
}
LPDWORD lpArr = GetFingerPrintCfgPoint();
m_dwSendIndex++;
if ( m_dwSendIndex >= m_dwCardNum)
{
//PostMessage(WM_MSG_SET_FINGERPRINT_FINISH,0,0);
return TRUE;
}
if(lpArr == NULL)
{
return FALSE;
}
m_lpNowSendCard = (LPNET_DVR_FINGER_PRINT_CFG)lpArr[m_dwSendIndex];
if (!NET_DVR_SendRemoteConfig(m_lSetFingerPrintCfgHandle,3/*ENUM_ACS_SEND_DATA*/, (char *)m_lpNowSendCard ,sizeof(*m_lpNowSendCard)))
{
g_pMainDlg->AddLog(m_iDeviceIndex, OPERATION_FAIL_T, "Send Fail,CardNO: %s", m_lpNowSendCard->byCardNo);
//发送失败 关闭连接
PostMessage(WM_MSG_SET_FINGERPRINT_FINISH,0,0);
return FALSE;
}
return TRUE;
}
void DlgAcsFingerPrintCfg::BatchAddFingerPrintToList()
{
LPNET_DVR_FINGER_PRINT_CFG pCardInfo = NULL;
LPDWORD lpArr = GetFingerPrintCfgPoint();
int i = 0;
int nItemCount = m_listFingerPrintCfg.GetItemCount();
CString strItem ;
//m_csBatchFlag.Format("adding");
PostMessage(WM_MSG_UPDATEDATA_INTERFACE, FALSE,0);
for (i=0; i<m_dwCardNum; i++)
{
pCardInfo = (LPNET_DVR_FINGER_PRINT_CFG)lpArr[i];
strItem.Format("%d",nItemCount + 1);
int iItemIndex = m_listFingerPrintCfg.InsertItem(nItemCount,strItem);
m_listFingerPrintCfg.SetItemData(iItemIndex,(DWORD)pCardInfo);
UpdateList(iItemIndex, *pCardInfo);
nItemCount ++;
}
//m_csBatchFlag.Format("finish add");
PostMessage(WM_MSG_UPDATEDATA_INTERFACE, FALSE,0);
}
void DlgAcsFingerPrintCfg::OnBtnStopSend()
{
// TODO: Add your control notification handler code here
StopProcThread();
}
| [
"871463558@qq.com"
] | 871463558@qq.com |
27ddeadfa9f7f07254d40ec226ae849e4f83f96e | 76fe0a0404ca1d71779fc6c1122b87e0d7a7aa1b | /judges/uri/1527 - Guilds.cpp | bee868c6c8801544e91b3726854f463b3866b35c | [] | no_license | vitorguidi/Competitive-Programming | 905dd835671275284418c5885a4a1fae2160f451 | 823a9299dce7b7f662ea741f31b4687f854bb963 | refs/heads/master | 2021-06-25T06:58:53.670233 | 2020-12-19T16:53:15 | 2020-12-19T16:53:15 | 133,260,248 | 3 | 0 | null | 2018-05-13T17:46:43 | 2018-05-13T17:40:24 | null | UTF-8 | C++ | false | false | 1,368 | cpp | #include <iostream>
#include <set>
using namespace std;
#define MAXN 100100
int n,m;
int q,a,b;
int pts[MAXN],gld[MAXN],peso[MAXN];
int find(int x){
if(gld[x]==x) return x;
return gld[x]=find(gld[x]);
}
void join(int x,int y){
x=find(x);
y=find(y);
if(x==y) return;
if(peso[x]>=peso[y]){ //agrego o de menor peso ao de maior peso
gld[y]=x; //guilda com menos gente eh anexada pela guilda de mais
pts[x]+=pts[y]; //atualiza pontos da nova guilda
if(peso[x]==peso[y]) peso[x]++;
}
if(peso[y]>peso[x]){
gld[x]=y; //guilda com menos gente eh anexada pela guilda de mais
pts[y]+=pts[x]; //atualiza ptos da nova guilda
}
return;
}
void game(){
int w_r=0; //wins do rafael
int gr; //guilda do rafael
for(int i=1;i<=n;i++){
cin >> pts[i]; //pontos do player
gld[i]=i; //guilda a qual o player pertence (guarda o index do lider da guilda)
peso[i]=1; //guarda a quantidade de membros da guilda, inicializa como 1
}
for(int i=0;i<m;i++){
cin >> q >> a >> b;
a=find(a);
b=find(b);
gr=find(1);
if(q==1) join(a,b);
if(q==2){
if(a==gr && pts[a]>pts[b]) w_r++;
if(b==gr && pts[b]>pts[a]) w_r++;
}
}
cout << w_r << endl;
return;
}
int main(){
n=m=-1;
ios::sync_with_stdio(false);
cin.tie(0);
while(n!=0 && m!=0){
cin >> n >> m;
if(n!=0 && m!=0){
game();
}
}
return 0;
} | [
"vitorguidi@gmail.com"
] | vitorguidi@gmail.com |
1b8e1fa51469cd2ffd30b73193afc96574ae35f8 | 877fff5bb313ccd23d1d01bf23b1e1f2b13bb85a | /app/src/main/cpp/dir7941/dir22441/dir26975/dir26976/file27028.cpp | 40526178c60bc449590192927c1e28a23bf855c7 | [] | no_license | tgeng/HugeProject | 829c3bdfb7cbaf57727c41263212d4a67e3eb93d | 4488d3b765e8827636ce5e878baacdf388710ef2 | refs/heads/master | 2022-08-21T16:58:54.161627 | 2020-05-28T01:54:03 | 2020-05-28T01:54:03 | 267,468,475 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 115 | cpp | #ifndef file27028
#error "macro file27028 must be defined"
#endif
static const char* file27028String = "file27028"; | [
"tgeng@google.com"
] | tgeng@google.com |
309de37b210572748aff16b34feac15eaa889611 | b835e8841d4a6edab02d5d198e8874ae88218b0c | /firmware/CFunDCMotor/CFunDCMotor.cpp | d346828f6ca237ac4130406901720a5c1a74cd3a | [] | no_license | syjsu/scratch_master_flash | d97d5660fd74e937a38a3b47677025433f34dec5 | 989c9add3df9598a318cc1803d2f5b3effc5408f | refs/heads/master | 2020-03-17T13:39:55.182256 | 2016-11-09T03:14:40 | 2016-11-09T03:14:40 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,590 | cpp | #include "CFunDCMotor.h"
CFunDCMotor::CFunDCMotor(): CFunPort(0)
{
}
CFunDCMotor::CFunDCMotor(uint8_t port): CFunPort(port)
{
}
void CFunDCMotor::motorrun(uint8_t d,uint8_t s)
{
if(d == 1) {
CFunPort::aWrite1(s);
CFunPort::dWrite3(HIGH);
} else {
CFunPort::aWrite1(s);
CFunPort::dWrite3(LOW);
}
}
void CFunDCMotor::motorstop()
{
CFunDCMotor::motorrun(1,0);
}
void CFunDCMotor::carstop()
{
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
analogWrite(5,0);
analogWrite(6,0);
}
void CFunDCMotor::forward(uint8_t speed)
{
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
analogWrite(5,speed);
analogWrite(6,speed);
}
void CFunDCMotor::back(uint8_t speed)
{
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
digitalWrite(7,LOW);
digitalWrite(8,LOW);
analogWrite(5,speed);
analogWrite(6,speed);
}
void CFunDCMotor::turnleft(uint8_t speed)
{
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
digitalWrite(7,LOW);
digitalWrite(8,HIGH);
analogWrite(5,speed);
analogWrite(6,speed);
}
void CFunDCMotor::turnright(uint8_t speed)
{
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
digitalWrite(7,HIGH);
digitalWrite(8,LOW);
analogWrite(5,speed);
analogWrite(6,speed);
}
| [
"xuhaiyang88@163.com"
] | xuhaiyang88@163.com |
90343c681a59559a5f35fbdcc36669cafe40f32f | 46102425de8f2de741cde6b22b9db02793d9197b | /y2018/utils/netThread.cpp | fe505a52d792b5f7b9faaaa13a7d1724732132ab | [
"BSD-2-Clause"
] | permissive | valkyrierobotics/vision2018 | 90ae9997197cc6a5f33842a6857cc3876c62c912 | aa82e936c5481b7cc43a46ff5f6e68702c2166c2 | refs/heads/master | 2021-09-03T15:53:23.705961 | 2018-01-10T07:16:10 | 2018-01-10T07:16:10 | 116,909,153 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,618 | cpp | #include "utils/netThread.hpp"
void sendData (udp_client_server::udp_client& client)
{
double loopTime = 1.0 / LOOPS_PER_SEC;
std::string msg;
while (true)
{
// Stop sending data if an agreed symbol is received
if (buff[0] != STOP_SIGNAL)
{
clock_t start = clock();
// Check if the angles are not NaN or inf and within restrictions
#if 0
if ((buff[0] == GET_SIGNAL || buff[0] == START_SIGNAL) && std::isfinite(yaw) && std::isfinite(pitch) && std::abs(yaw) < 30.0 && pitch < 90.0)
{
msg = std::to_string(yaw) + " " + std::to_string(pitch);
std::cerr << "Sent Data: " << msg << "\n";
client.send(msg.c_str(), strlen(msg.c_str()));
}
else
{
std::cerr << "Data not sent, buff = " << buff << "\n";
}
#endif
clock_t end = clock();
double timeElapsed = (double) (end - start) / CLOCKS_PER_SEC;
// Pause until loop ends
if (timeElapsed < loopTime)
{
unsigned int microseconds = static_cast<int>((loopTime - timeElapsed) * MICROSEC_TO_SEC);
//std::cerr << "Loop took " << timeElapsed << " seconds and stalling for " << static_cast<double>(microseconds) / MICROSEC_TO_SEC << " seconds\n";
usleep(microseconds);
}
// Not on time
else
{
//std::cerr << "Loop took " << timeElapsed << " seconds and new FPS = " << fps << " [ERROR]\n";
}
}
}
}
void receiveData (udp_client_server::udp_server& server)
{
int maxBufferSize = 15;
int maxWaitSec = 1;
while (true)
{
// Receive data from non-blocking server
server.timed_recv(buff, maxBufferSize, maxWaitSec);
std::cerr << "Received Data: " << buff << "\n";
if (buff[0] == STOP_SIGNAL)
std::cerr << "STOP_SIGNAL\n";
else if (buff[0] == START_SIGNAL)
std::cerr << "START_SIGNAL\n";
else if (buff[0] == GET_SIGNAL)
std::cerr << "GET_SIGNAL\n";
else if (buff[0] == RESUME_SIGNAL)
std::cerr << "RESUME_SIGNAL\n";
else if (buff[0] == PAUSE_SIGNAL)
std::cerr << "PAUSE_SIGNAL\n";
}
}
void sendProtobuf(y2018::vision::VisionData& msg, aos::events::TXUdpSocket& client)
{
std::string buf;
msg.SerializeToString(&buf);
// Cannot use strlen for protobuf because they use as few bytes as possible
client.Send(buf.c_str(), msg.ByteSize());
}
| [
"minhoo2000@gmail.com"
] | minhoo2000@gmail.com |
18b2982fe15e226f50e1865a427b9d508c1a0387 | fc9e460e3ed8f0ec0c7ff8b390660c8f964109c6 | /firstrepo/lab-03-composite-and-strategy-pattern-2mememachines/sub.cpp | 03512832399be976b9aa7e23885e8ab0febcac88 | [] | no_license | jterr005/firstrepo | acee6819e67281a402f7080390728c0ce217f25d | 3c7193466a54e9272b74118ad1dc4d36fa622823 | refs/heads/master | 2021-09-08T04:29:29.010204 | 2018-03-07T01:30:51 | 2018-03-07T01:30:51 | 105,844,153 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 230 | cpp | #include "sub.h"
using namespace std;
Sub::Sub(Base* left, Base* right) {
this->left = left;
this->right = right;
}
double Sub::evaluate() {
double LS = left->evaluate();
double RS = right->evaluate();
return (LS - RS);
}
| [
"jterr005@hammer.cs.ucr.edu"
] | jterr005@hammer.cs.ucr.edu |
a2e44defd0dcbc75b0086b3590d89f274a39f046 | 86397654137a5e1ae507aaef806c92fdf0a6d5e4 | /MS/Regular.h | 2d37d6727504d45da6634671a3d2eb017861036d | [] | no_license | MrHassanTariq/Shopping-Management-Sytem | 19ccba3798437d27187696f2c9e9c3f711eeb6a4 | ac803bd4d4810c96e98a639a7e707cacb124b823 | refs/heads/master | 2021-04-15T05:57:30.528339 | 2018-03-26T06:42:27 | 2018-03-26T06:42:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 202 | h | #pragma once
#include "Gender.h"
#include <fstream>
#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
class Regular{
private:
Gender G;
public:
Regular();
~Regular();
}; | [
"hassa@DESKTOP"
] | hassa@DESKTOP |
635344aff4332d8a596cbae28a33c1e010c6cd33 | 4a221e6245f4324298473fc397b9a9392a910790 | /Node.h | fdf7ac44de0c5d9df6aba01233d4795bff78c62a | [] | no_license | nitink-prog/Binary-Tree-Sorting-Demo | a86bdf6e1aac5de1a854a81c514c7593ad36ad3b | e59b0b1b8e0720834a045ae8c66c11337e3030ca | refs/heads/main | 2023-05-28T03:23:58.764429 | 2021-06-16T22:01:13 | 2021-06-16T22:01:13 | 377,638,119 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 810 | h | //
// Node.h
// Trees
//
// Created by Nitin K on 5/2/19.
// Copyright © 2019 CSCI 373. All rights reserved.
//
#ifndef Node_h
#define Node_h
#include <stdio.h>
#include <iostream>
using namespace std;
class Node
// Simple Node, containing pointers to left and right, and var for integer
{
public:
Node()
{ *left = NULL; *right = NULL; }
Node(int data, Node *Lptr = NULL, Node *Rptr = NULL)
{ info = data; left = Lptr; right = Rptr; }
int info;
Node *left, *right;
};
class ANode
// Node for AVLTree, adds Height var
{
public:
ANode()
{ *left = NULL; *right = NULL; }
ANode(int data, ANode *Lptr = NULL, ANode *Rptr = NULL)
{ info = data; left = Lptr; right = Rptr; }
int info; int height;
ANode *left, *right;
};
#endif /* Node_h */
| [
"noreply@github.com"
] | nitink-prog.noreply@github.com |
21fa7c7516f9a7299d9f692ed595a5cf0b7e5631 | 6c996ca5146bd307a062f38819acec16d710656f | /workspace/iw8/code_source/src/bgame/asm/bg_player_asm_util.cpp | 978e71e5537dc8e968054b18b9ba81aa11d719c7 | [] | no_license | Omn1z/OpenIW8 | d46f095d4d743d1d8657f7e396e6d3cf944aa562 | 6c01a9548e4d5f7e1185369a62846f2c6f8304ba | refs/heads/main | 2023-08-15T22:43:01.627895 | 2021-10-10T20:44:57 | 2021-10-10T20:44:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 163,861 | cpp | /*
==============
BG_PlayerASM_GetAnimsetName
==============
*/
scr_string_t __fastcall BG_PlayerASM_GetAnimsetName(const PlayerASM_Context *context)
{
return ?BG_PlayerASM_GetAnimsetName@@YA?AW4scr_string_t@@PEBUPlayerASM_Context@@@Z(context);
}
/*
==============
BG_PlayerASM_CopyAnimDataToEntity
==============
*/
void __fastcall BG_PlayerASM_CopyAnimDataToEntity(const playerState_s *fromPs, entityState_t *es)
{
?BG_PlayerASM_CopyAnimDataToEntity@@YAXPEBUplayerState_s@@PEAUentityState_t@@@Z(fromPs, es);
}
/*
==============
BG_PlayerASM_IsGestureAlias
==============
*/
int __fastcall BG_PlayerASM_IsGestureAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsGestureAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsNoAimingIfProneAlias
==============
*/
int __fastcall BG_PlayerASM_IsNoAimingIfProneAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsNoAimingIfProneAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_GetAssetNameBySuit
==============
*/
scr_string_t __fastcall BG_PlayerASM_GetAssetNameBySuit(unsigned int suitIndex)
{
return ?BG_PlayerASM_GetAssetNameBySuit@@YA?AW4scr_string_t@@I@Z(suitIndex);
}
/*
==============
BG_PlayerASM_GetAnimLength
==============
*/
unsigned int __fastcall BG_PlayerASM_GetAnimLength(const playerState_s *ps, const PlayerASM_AnimSlot slot)
{
return ?BG_PlayerASM_GetAnimLength@@YAIPEBUplayerState_s@@W4PlayerASM_AnimSlot@@@Z(ps, slot);
}
/*
==============
BG_PlayerASM_VerifyAnim
==============
*/
void __fastcall BG_PlayerASM_VerifyAnim(unsigned int animsetIndex, unsigned int packedAnimIndex)
{
?BG_PlayerASM_VerifyAnim@@YAXII@Z(animsetIndex, packedAnimIndex);
}
/*
==============
BG_PlayerASM_IsExecutionAttackerAlias
==============
*/
int __fastcall BG_PlayerASM_IsExecutionAttackerAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsExecutionAttackerAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsNoAimingAlias
==============
*/
int __fastcall BG_PlayerASM_IsNoAimingAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsNoAimingAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsRaiseWeaponAlias
==============
*/
int __fastcall BG_PlayerASM_IsRaiseWeaponAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsRaiseWeaponAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_UnpackAnimFromEntity
==============
*/
unsigned int __fastcall BG_PlayerASM_UnpackAnimFromEntity(const entityState_t *es, const PlayerASM_AnimSlot slot, unsigned int *outAnimsetIndex, unsigned int *outAnimState, unsigned int *outAnimEntry)
{
return ?BG_PlayerASM_UnpackAnimFromEntity@@YAIPEBUentityState_t@@W4PlayerASM_AnimSlot@@PEAI22@Z(es, slot, outAnimsetIndex, outAnimState, outAnimEntry);
}
/*
==============
BG_PlayerASM_IsFiringAlias
==============
*/
int __fastcall BG_PlayerASM_IsFiringAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsFiringAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_GetIndexOfRandomAnimFromAlias<0>
==============
*/
int __fastcall BG_PlayerASM_GetIndexOfRandomAnimFromAlias<0>(unsigned int *holdrand, unsigned int entNum, const unsigned int animsetIndex, const scr_string_t stateName, const scr_string_t aliasName, int animEntryToSkip)
{
return ??$BG_PlayerASM_GetIndexOfRandomAnimFromAlias@$0A@@@YAHPEAIIIW4scr_string_t@@1H@Z(holdrand, entNum, animsetIndex, stateName, aliasName, animEntryToSkip);
}
/*
==============
BG_PlayerASM_IsLadderAlias
==============
*/
int __fastcall BG_PlayerASM_IsLadderAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsLadderAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_EvaluateCondition
==============
*/
int __fastcall BG_PlayerASM_EvaluateCondition(const characterInfo_t *ci, unsigned int index, unsigned int *value)
{
return ?BG_PlayerASM_EvaluateCondition@@YAHPEBUcharacterInfo_t@@IQEAI@Z(ci, index, value);
}
/*
==============
BG_PlayerASM_GetIndexOfRandomAnimFromAlias<0>
==============
*/
int __fastcall BG_PlayerASM_GetIndexOfRandomAnimFromAlias<0>(unsigned int *holdrand, unsigned int entNum, const unsigned int animsetIndex, const AnimsetState *pState, const scr_string_t aliasName, int animEntryToSkip)
{
return ??$BG_PlayerASM_GetIndexOfRandomAnimFromAlias@$0A@@@YAHPEAIIIPEBUAnimsetState@@W4scr_string_t@@H@Z(holdrand, entNum, animsetIndex, pState, aliasName, animEntryToSkip);
}
/*
==============
BG_PlayerASM_GetXAnimLength
==============
*/
unsigned int __fastcall BG_PlayerASM_GetXAnimLength(const XAnimParts *parts, const float rate)
{
return ?BG_PlayerASM_GetXAnimLength@@YAIPEBUXAnimParts@@M@Z(parts, rate);
}
/*
==============
BG_PlayerASM_IsPrepareAlias
==============
*/
int __fastcall BG_PlayerASM_IsPrepareAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsPrepareAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsTurretAlias
==============
*/
int __fastcall BG_PlayerASM_IsTurretAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsTurretAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_flrand
==============
*/
double __fastcall BG_PlayerASM_flrand(unsigned int entNum, const scr_string_t animsetName, const scr_string_t stateName, float min, float max)
{
double result;
*(float *)&result = ?BG_PlayerASM_flrand@@YAMIW4scr_string_t@@0MM@Z(entNum, animsetName, stateName, min, max);
return result;
}
/*
==============
BG_PlayerASM_DebugAnimEventLog_GetNumEntries
==============
*/
int __fastcall BG_PlayerASM_DebugAnimEventLog_GetNumEntries()
{
return ?BG_PlayerASM_DebugAnimEventLog_GetNumEntries@@YAHXZ();
}
/*
==============
BG_PlayerASM_IsClearSyncGroupAlias
==============
*/
int __fastcall BG_PlayerASM_IsClearSyncGroupAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsClearSyncGroupAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_GetAnimset
==============
*/
unsigned int __fastcall BG_PlayerASM_GetAnimset(const playerState_s *ps)
{
return ?BG_PlayerASM_GetAnimset@@YAIPEBUplayerState_s@@@Z(ps);
}
/*
==============
BG_PlayerASM_IsSlideAlias
==============
*/
int __fastcall BG_PlayerASM_IsSlideAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsSlideAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_GetAnim
==============
*/
unsigned int __fastcall BG_PlayerASM_GetAnim(const entityState_t *es, const PlayerASM_AnimSlot slot)
{
return ?BG_PlayerASM_GetAnim@@YAIPEBUentityState_t@@W4PlayerASM_AnimSlot@@@Z(es, slot);
}
/*
==============
BG_PlayerASM_IsCrouchingAlias
==============
*/
int __fastcall BG_PlayerASM_IsCrouchingAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsCrouchingAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_GetIndexOfRandomAnimFromAlias<1>
==============
*/
int __fastcall BG_PlayerASM_GetIndexOfRandomAnimFromAlias<1>(unsigned int *holdrand, unsigned int entNum, const unsigned int animsetIndex, const scr_string_t stateName, const scr_string_t aliasName, int animEntryToSkip)
{
return ??$BG_PlayerASM_GetIndexOfRandomAnimFromAlias@$00@@YAHPEAIIIW4scr_string_t@@1H@Z(holdrand, entNum, animsetIndex, stateName, aliasName, animEntryToSkip);
}
/*
==============
BG_PlayerASM_IsExecutionVictimAlias
==============
*/
int __fastcall BG_PlayerASM_IsExecutionVictimAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsExecutionVictimAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsDropWeaponAlias
==============
*/
int __fastcall BG_PlayerASM_IsDropWeaponAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsDropWeaponAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_GetAnimEntry
==============
*/
bool __fastcall BG_PlayerASM_GetAnimEntry(const PlayerASM_Context *context, int entNum, const scr_string_t stateName, const scr_string_t alias, int *outStateIndex, int *outEntryIndex)
{
return ?BG_PlayerASM_GetAnimEntry@@YA_NPEBUPlayerASM_Context@@HW4scr_string_t@@1PEAH2@Z(context, entNum, stateName, alias, outStateIndex, outEntryIndex);
}
/*
==============
BG_PlayerASM_GetAnim
==============
*/
unsigned int __fastcall BG_PlayerASM_GetAnim(const playerState_s *ps, const PlayerASM_AnimSlot slot)
{
return ?BG_PlayerASM_GetAnim@@YAIPEBUplayerState_s@@W4PlayerASM_AnimSlot@@@Z(ps, slot);
}
/*
==============
BG_PlayerASM_GetAssetBySuit
==============
*/
const ASM *__fastcall BG_PlayerASM_GetAssetBySuit(unsigned int suitIndex)
{
return ?BG_PlayerASM_GetAssetBySuit@@YAPEBUASM@@I@Z(suitIndex);
}
/*
==============
BG_PlayerASM_ShouldSyncAnims
==============
*/
bool __fastcall BG_PlayerASM_ShouldSyncAnims(const unsigned int animsetIndex, const unsigned int oldPackedAnim, const unsigned int anim, unsigned int *inOutTimer)
{
return ?BG_PlayerASM_ShouldSyncAnims@@YA_NIIIPEAI@Z(animsetIndex, oldPackedAnim, anim, inOutTimer);
}
/*
==============
BG_PlayerASM_DebugAnimEventLog_GetEntry
==============
*/
const PlayerASM_DebugAnimEventInfoEntry *__fastcall BG_PlayerASM_DebugAnimEventLog_GetEntry(int entryIndex)
{
return ?BG_PlayerASM_DebugAnimEventLog_GetEntry@@YAPEBUPlayerASM_DebugAnimEventInfoEntry@@H@Z(entryIndex);
}
/*
==============
BG_PlayerASM_IsMeleeExecutionVictimAlias
==============
*/
int __fastcall BG_PlayerASM_IsMeleeExecutionVictimAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsMeleeExecutionVictimAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayersASM_ResetAnimTree
==============
*/
bool __fastcall BG_PlayersASM_ResetAnimTree(const unsigned int animsetIndex, void *(__fastcall *alloc)(unsigned __int64), const XAnimOwner owner, characterInfo_t *inOutCharacterInfo)
{
return ?BG_PlayersASM_ResetAnimTree@@YA_NIP6APEAX_K@ZW4XAnimOwner@@PEAUcharacterInfo_t@@@Z(animsetIndex, alloc, owner, inOutCharacterInfo);
}
/*
==============
BG_PlayerASM_flrand
==============
*/
double __fastcall BG_PlayerASM_flrand(unsigned int *holdrand, float min, float max)
{
double result;
*(float *)&result = ?BG_PlayerASM_flrand@@YAMPEAIMM@Z(holdrand, min, max);
return result;
}
/*
==============
BG_PlayerASM_FindValidAliasAddonOverrides
==============
*/
bool __fastcall BG_PlayerASM_FindValidAliasAddonOverrides(PlayerASM_AnimOverrides *animOverride, scr_string_t overrideType, PlayerASM_AnimOverrideEntry **overrideEntry)
{
return ?BG_PlayerASM_FindValidAliasAddonOverrides@@YA_NPEAUPlayerASM_AnimOverrides@@W4scr_string_t@@PEAPEAUPlayerASM_AnimOverrideEntry@@@Z(animOverride, overrideType, overrideEntry);
}
/*
==============
BG_PlayerASM_GetAnimsetNameBySuit
==============
*/
scr_string_t __fastcall BG_PlayerASM_GetAnimsetNameBySuit(unsigned int suitIndex)
{
return ?BG_PlayerASM_GetAnimsetNameBySuit@@YA?AW4scr_string_t@@I@Z(suitIndex);
}
/*
==============
BG_PlayerASM_UnpackAnimFromCi
==============
*/
unsigned int __fastcall BG_PlayerASM_UnpackAnimFromCi(const characterInfo_t *ci, const PlayerASM_AnimSlot slot, unsigned int *outAnimsetIndex, unsigned int *outAnimState, unsigned int *outAnimEntry)
{
return ?BG_PlayerASM_UnpackAnimFromCi@@YAIPEBUcharacterInfo_t@@W4PlayerASM_AnimSlot@@PEAI22@Z(ci, slot, outAnimsetIndex, outAnimState, outAnimEntry);
}
/*
==============
BG_PlayerASM_HasAnimAlias
==============
*/
bool __fastcall BG_PlayerASM_HasAnimAlias(const PlayerASM_Context *context, const scr_string_t stateName, const scr_string_t aliasName)
{
return ?BG_PlayerASM_HasAnimAlias@@YA_NPEBUPlayerASM_Context@@W4scr_string_t@@1@Z(context, stateName, aliasName);
}
/*
==============
BG_PlayerASM_GetEntityState
==============
*/
entityState_t *__fastcall BG_PlayerASM_GetEntityState(const PlayerASM_Context *context)
{
return ?BG_PlayerASM_GetEntityState@@YAPEAUentityState_t@@PEBUPlayerASM_Context@@@Z(context);
}
/*
==============
BG_PlayerASM_StoreCommandDir
==============
*/
void __fastcall BG_PlayerASM_StoreCommandDir(const int clientNum, const int serverTime, const float oldMoveForward, const float oldMoveRight, const float moveForward, const float moveRight)
{
?BG_PlayerASM_StoreCommandDir@@YAXHHMMMM@Z(clientNum, serverTime, oldMoveForward, oldMoveRight, moveForward, moveRight);
}
/*
==============
BG_PlayerASM_IsAdsAlias
==============
*/
int __fastcall BG_PlayerASM_IsAdsAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsAdsAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsKnockbackAlias
==============
*/
int __fastcall BG_PlayerASM_IsKnockbackAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsKnockbackAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsMeleeExecutionAttackerAlias
==============
*/
int __fastcall BG_PlayerASM_IsMeleeExecutionAttackerAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsMeleeExecutionAttackerAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_DebugAnimEventLog_AddEntry
==============
*/
void __fastcall BG_PlayerASM_DebugAnimEventLog_AddEntry(const int entNum, const int serverTime, events_t *events)
{
?BG_PlayerASM_DebugAnimEventLog_AddEntry@@YAXHHPEAUevents_t@@@Z(entNum, serverTime, events);
}
/*
==============
BG_PlayerASM_UnpackAnimFromPs
==============
*/
unsigned int __fastcall BG_PlayerASM_UnpackAnimFromPs(const playerState_s *ps, const PlayerASM_AnimSlot slot, unsigned int *outAnimSetIndex, unsigned int *outAnimState, unsigned int *outAnimEntry)
{
return ?BG_PlayerASM_UnpackAnimFromPs@@YAIPEBUplayerState_s@@W4PlayerASM_AnimSlot@@PEAI22@Z(ps, slot, outAnimSetIndex, outAnimState, outAnimEntry);
}
/*
==============
BG_PlayerASM_GetFingerPoseSlot
==============
*/
PlayerFingerPoseSlot __fastcall BG_PlayerASM_GetFingerPoseSlot(const unsigned int packedAnimIndex, const unsigned int animsetIndex)
{
return ?BG_PlayerASM_GetFingerPoseSlot@@YA?AW4PlayerFingerPoseSlot@@II@Z(packedAnimIndex, animsetIndex);
}
/*
==============
BG_PlayerASM_ClearAnimOverrides
==============
*/
void __fastcall BG_PlayerASM_ClearAnimOverrides(PlayerASM_AnimOverrides *animOverride)
{
?BG_PlayerASM_ClearAnimOverrides@@YAXPEAUPlayerASM_AnimOverrides@@@Z(animOverride);
}
/*
==============
BG_PlayerASM_IsReloadAlias
==============
*/
int __fastcall BG_PlayerASM_IsReloadAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsReloadAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsStopAlias
==============
*/
int __fastcall BG_PlayerASM_IsStopAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsStopAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsRootMotionAlias
==============
*/
int __fastcall BG_PlayerASM_IsRootMotionAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsRootMotionAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_GetAnim
==============
*/
unsigned int __fastcall BG_PlayerASM_GetAnim(const characterInfo_t *ci, const PlayerASM_AnimSlot slot)
{
return ?BG_PlayerASM_GetAnim@@YAIPEBUcharacterInfo_t@@W4PlayerASM_AnimSlot@@@Z(ci, slot);
}
/*
==============
BG_PlayerASM_LookupAnimFromAlias
==============
*/
int __fastcall BG_PlayerASM_LookupAnimFromAlias(const PlayerASM_Context *context, BgPlayer_Asm *pAsm, int entNum, const scr_string_t stateName, const scr_string_t alias)
{
return ?BG_PlayerASM_LookupAnimFromAlias@@YAHPEBUPlayerASM_Context@@PEAVBgPlayer_Asm@@HW4scr_string_t@@2@Z(context, pAsm, entNum, stateName, alias);
}
/*
==============
BG_PlayerASM_IsProneAlias
==============
*/
int __fastcall BG_PlayerASM_IsProneAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsProneAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_GetXAnimParts
==============
*/
const XAnimParts *__fastcall BG_PlayerASM_GetXAnimParts(const XAnim_s *const anims, unsigned int animIndex, unsigned int *outAnimPartsIndex)
{
return ?BG_PlayerASM_GetXAnimParts@@YAPEBUXAnimParts@@QEBUXAnim_s@@IPEAI@Z(anims, animIndex, outAnimPartsIndex);
}
/*
==============
BG_PlayerASM_GetAnimsetNameByIndex
==============
*/
scr_string_t __fastcall BG_PlayerASM_GetAnimsetNameByIndex(unsigned int animsetIndex)
{
return ?BG_PlayerASM_GetAnimsetNameByIndex@@YA?AW4scr_string_t@@I@Z(animsetIndex);
}
/*
==============
BG_PlayerASM_IsMoveForwardAlias
==============
*/
int __fastcall BG_PlayerASM_IsMoveForwardAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsMoveForwardAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsOnLadder
==============
*/
bool __fastcall BG_PlayerASM_IsOnLadder(const characterInfo_t *ci)
{
return ?BG_PlayerASM_IsOnLadder@@YA_NPEBUcharacterInfo_t@@@Z(ci);
}
/*
==============
BG_PlayerASM_GetAnimsetIndexBySuit
==============
*/
unsigned int __fastcall BG_PlayerASM_GetAnimsetIndexBySuit(unsigned int suitIndex)
{
return ?BG_PlayerASM_GetAnimsetIndexBySuit@@YAII@Z(suitIndex);
}
/*
==============
BG_PlayersASM_ResetSmallAnimTree
==============
*/
bool __fastcall BG_PlayersASM_ResetSmallAnimTree(const unsigned int animsetIndex, const XAnimOwner owner, characterInfo_t *inOutCharacterInfo)
{
return ?BG_PlayersASM_ResetSmallAnimTree@@YA_NIW4XAnimOwner@@PEAUcharacterInfo_t@@@Z(animsetIndex, owner, inOutCharacterInfo);
}
/*
==============
BG_PlayerASM_UnpackAnim
==============
*/
void __fastcall BG_PlayerASM_UnpackAnim(const unsigned int animsetIndex, const unsigned int packedAnimIndex, unsigned int *outAnimState, unsigned int *outAnimEntry)
{
?BG_PlayerASM_UnpackAnim@@YAXIIPEAI0@Z(animsetIndex, packedAnimIndex, outAnimState, outAnimEntry);
}
/*
==============
BG_PlayerASM_PackAnim
==============
*/
unsigned int __fastcall BG_PlayerASM_PackAnim(const unsigned int animsetIndex, const unsigned int animState, const unsigned int animEntry)
{
return ?BG_PlayerASM_PackAnim@@YAIIII@Z(animsetIndex, animState, animEntry);
}
/*
==============
BG_PlayerASM_IsStrafeAlias
==============
*/
int __fastcall BG_PlayerASM_IsStrafeAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsStrafeAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsTurnAlias
==============
*/
int __fastcall BG_PlayerASM_IsTurnAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsTurnAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsSceneAlias
==============
*/
int __fastcall BG_PlayerASM_IsSceneAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsSceneAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_EvalConditionMasks
==============
*/
bool __fastcall BG_PlayerASM_EvalConditionMasks(const characterInfo_t *const ci, const ASM_Instance *pInst, const PlayerASM_ConditionMask *conditionMask, scr_string_t stateName)
{
return ?BG_PlayerASM_EvalConditionMasks@@YA_NQEBUcharacterInfo_t@@PEBUASM_Instance@@PEBUPlayerASM_ConditionMask@@W4scr_string_t@@@Z(ci, pInst, conditionMask, stateName);
}
/*
==============
BG_PlayerASM_GetAnimsetIndexByName
==============
*/
unsigned int __fastcall BG_PlayerASM_GetAnimsetIndexByName(scr_string_t animSetName)
{
return ?BG_PlayerASM_GetAnimsetIndexByName@@YAIW4scr_string_t@@@Z(animSetName);
}
/*
==============
BG_PlayerASM_DebugAnimEventLog_IsEnabled
==============
*/
bool __fastcall BG_PlayerASM_DebugAnimEventLog_IsEnabled(const int entNum)
{
return ?BG_PlayerASM_DebugAnimEventLog_IsEnabled@@YA_NH@Z(entNum);
}
/*
==============
BG_PlayersASM_ResetCorpseAnimTree
==============
*/
void __fastcall BG_PlayersASM_ResetCorpseAnimTree(void *(__fastcall *alloc)(unsigned __int64), XAnimOwner owner, const characterInfo_t *ci, XAnimTree **inOutAnimTree)
{
?BG_PlayersASM_ResetCorpseAnimTree@@YAXP6APEAX_K@ZW4XAnimOwner@@PEBUcharacterInfo_t@@PEAPEAUXAnimTree@@@Z(alloc, owner, ci, inOutAnimTree);
}
/*
==============
BG_PlayerASM_ApplyAliasAddonOverrides
==============
*/
void __fastcall BG_PlayerASM_ApplyAliasAddonOverrides(DObj *obj, const characterInfo_t *ci, PlayerASM_AnimOverrides *animOverrides, scr_string_t overrideType, bool clear, XModelNameMap *modelNameMap, const unsigned int flags)
{
?BG_PlayerASM_ApplyAliasAddonOverrides@@YAXPEAUDObj@@PEBUcharacterInfo_t@@PEAUPlayerASM_AnimOverrides@@W4scr_string_t@@_NPEAUXModelNameMap@@I@Z(obj, ci, animOverrides, overrideType, clear, modelNameMap, flags);
}
/*
==============
BG_PlayerASM_GetAnimset
==============
*/
unsigned int __fastcall BG_PlayerASM_GetAnimset(const PlayerASM_Context *context)
{
return ?BG_PlayerASM_GetAnimset@@YAIPEBUPlayerASM_Context@@@Z(context);
}
/*
==============
BG_PlayerASM_GetPlayerState
==============
*/
playerState_s *__fastcall BG_PlayerASM_GetPlayerState(const PlayerASM_Context *context)
{
return ?BG_PlayerASM_GetPlayerState@@YAPEAUplayerState_s@@PEBUPlayerASM_Context@@@Z(context);
}
/*
==============
BG_PlayerASM_DebugAnimEventLog_Compact
==============
*/
void __fastcall BG_PlayerASM_DebugAnimEventLog_Compact(const int serverTime)
{
?BG_PlayerASM_DebugAnimEventLog_Compact@@YAXH@Z(serverTime);
}
/*
==============
BG_PlayerASM_IsLadderSlideAlias
==============
*/
int __fastcall BG_PlayerASM_IsLadderSlideAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsLadderSlideAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsDeathAlias
==============
*/
int __fastcall BG_PlayerASM_IsDeathAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsDeathAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_SetAnimState
==============
*/
void __fastcall BG_PlayerASM_SetAnimState(const PlayerASM_Context *context, BgPlayer_Asm *pAsm, int entNum, const scr_string_t asmName, scr_string_t stateName, int entryIndex, int gameTime, float animRate, PlayerASM_AnimSlot slot)
{
?BG_PlayerASM_SetAnimState@@YAXPEBUPlayerASM_Context@@PEAVBgPlayer_Asm@@HW4scr_string_t@@W43@HHMW4PlayerASM_AnimSlot@@@Z(context, pAsm, entNum, asmName, stateName, entryIndex, gameTime, animRate, slot);
}
/*
==============
BG_PlayerASM_GetIndexOfRandomAnimFromAlias<1>
==============
*/
int __fastcall BG_PlayerASM_GetIndexOfRandomAnimFromAlias<1>(unsigned int *holdrand, unsigned int entNum, const unsigned int animsetIndex, const AnimsetState *pState, const scr_string_t aliasName, int animEntryToSkip)
{
return ??$BG_PlayerASM_GetIndexOfRandomAnimFromAlias@$00@@YAHPEAIIIPEBUAnimsetState@@W4scr_string_t@@H@Z(holdrand, entNum, animsetIndex, pState, aliasName, animEntryToSkip);
}
/*
==============
BG_PlayerASM_ShouldSkipAddon
==============
*/
bool __fastcall BG_PlayerASM_ShouldSkipAddon(const characterInfo_t *ci, const unsigned int animsetIndex, int addonStateIndex, int entryIndex)
{
return ?BG_PlayerASM_ShouldSkipAddon@@YA_NPEBUcharacterInfo_t@@IHH@Z(ci, animsetIndex, addonStateIndex, entryIndex);
}
/*
==============
BG_PlayerASM_GetVelocityDir
==============
*/
__int16 __fastcall BG_PlayerASM_GetVelocityDir(const playerState_s *ps, const BgHandler *handler)
{
return ?BG_PlayerASM_GetVelocityDir@@YAFPEBUplayerState_s@@PEBVBgHandler@@@Z(ps, handler);
}
/*
==============
BG_PlayerASM_GetAnimset
==============
*/
unsigned int __fastcall BG_PlayerASM_GetAnimset(const entityState_t *es)
{
return ?BG_PlayerASM_GetAnimset@@YAIPEBUentityState_t@@@Z(es);
}
/*
==============
BG_PlayerASM_ClearState
==============
*/
void __fastcall BG_PlayerASM_ClearState(const PlayerASM_Context *context, const PlayerASM_AnimSlot animSlot)
{
?BG_PlayerASM_ClearState@@YAXPEBUPlayerASM_Context@@W4PlayerASM_AnimSlot@@@Z(context, animSlot);
}
/*
==============
BG_PlayerASM_IsAnimEntryValid
==============
*/
bool __fastcall BG_PlayerASM_IsAnimEntryValid(const Animset *pAnimset, const unsigned int stateIndex, const unsigned int entryIndex)
{
return ?BG_PlayerASM_IsAnimEntryValid@@YA_NPEBUAnimset@@II@Z(pAnimset, stateIndex, entryIndex);
}
/*
==============
BG_PlayerASM_GetAnimsetNameByIndexNetConst
==============
*/
scr_string_t __fastcall BG_PlayerASM_GetAnimsetNameByIndexNetConst(unsigned int animsetIndex)
{
return ?BG_PlayerASM_GetAnimsetNameByIndexNetConst@@YA?AW4scr_string_t@@I@Z(animsetIndex);
}
/*
==============
BG_PlayerASM_IsMoveBackwardAlias
==============
*/
int __fastcall BG_PlayerASM_IsMoveBackwardAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsMoveBackwardAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsAirAlias
==============
*/
int __fastcall BG_PlayerASM_IsAirAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsAirAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsRocketHideShowAlias
==============
*/
int __fastcall BG_PlayerASM_IsRocketHideShowAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsRocketHideShowAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_UpdateAngles
==============
*/
void __fastcall BG_PlayerASM_UpdateAngles(const float velocityAngle, characterInfo_t *ci)
{
?BG_PlayerASM_UpdateAngles@@YAXMPEAUcharacterInfo_t@@@Z(velocityAngle, ci);
}
/*
==============
BG_PlayerASM_IsThrowAlias
==============
*/
int __fastcall BG_PlayerASM_IsThrowAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsThrowAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsNoPitchAimingAlias
==============
*/
int __fastcall BG_PlayerASM_IsNoPitchAimingAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsNoPitchAimingAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_GetAnimUser
==============
*/
int __fastcall BG_PlayerASM_GetAnimUser()
{
return ?BG_PlayerASM_GetAnimUser@@YAHXZ();
}
/*
==============
BG_PlayerASM_IsLadderAimAlias
==============
*/
int __fastcall BG_PlayerASM_IsLadderAimAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsLadderAimAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_CopyAnimDataToCharacterInfo
==============
*/
void __fastcall BG_PlayerASM_CopyAnimDataToCharacterInfo(const playerState_s *fromPs, characterInfo_t *ci)
{
?BG_PlayerASM_CopyAnimDataToCharacterInfo@@YAXPEBUplayerState_s@@PEAUcharacterInfo_t@@@Z(fromPs, ci);
}
/*
==============
BG_PlayerASM_IsSceneSkipDoneEventAlias
==============
*/
int __fastcall BG_PlayerASM_IsSceneSkipDoneEventAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsSceneSkipDoneEventAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_GetAnimEntryCount
==============
*/
unsigned int __fastcall BG_PlayerASM_GetAnimEntryCount(const PlayerASM_Context *context, const scr_string_t stateName)
{
return ?BG_PlayerASM_GetAnimEntryCount@@YAIPEBUPlayerASM_Context@@W4scr_string_t@@@Z(context, stateName);
}
/*
==============
BG_PlayerASM_IsKillstreakTriggerAlias
==============
*/
int __fastcall BG_PlayerASM_IsKillstreakTriggerAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsKillstreakTriggerAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_SetState
==============
*/
void __fastcall BG_PlayerASM_SetState(const PlayerASM_Context *context, const PlayerASM_AnimSlot animSlot, const unsigned int animState, const unsigned int animEntry)
{
?BG_PlayerASM_SetState@@YAXPEBUPlayerASM_Context@@W4PlayerASM_AnimSlot@@II@Z(context, animSlot, animState, animEntry);
}
/*
==============
BG_PlayerASM_IsSprintAlias
==============
*/
int __fastcall BG_PlayerASM_IsSprintAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsSprintAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsAnimRestart
==============
*/
bool __fastcall BG_PlayerASM_IsAnimRestart(const Animset *pAnimset, const unsigned int animstateIndex, const unsigned int animEntryIndex, const unsigned int lastAnimstateIndex, const unsigned int lastAnimEntryIndex)
{
return ?BG_PlayerASM_IsAnimRestart@@YA_NPEBUAnimset@@IIII@Z(pAnimset, animstateIndex, animEntryIndex, lastAnimstateIndex, lastAnimEntryIndex);
}
/*
==============
BG_PlayerASM_IsSyncAnim
==============
*/
bool __fastcall BG_PlayerASM_IsSyncAnim(const XAnim_s *baseAnims, unsigned int graftIndex, const XAnim_s *subtreeAnims, unsigned int animIndex, XAnimSyncGroupID *outSyncGroupID, const XAnim_s **outSyncRootAnims, unsigned int *outSyncRoot)
{
return ?BG_PlayerASM_IsSyncAnim@@YA_NPEBUXAnim_s@@I0IPEAW4XAnimSyncGroupID@@PEAPEBU1@PEAI@Z(baseAnims, graftIndex, subtreeAnims, animIndex, outSyncGroupID, outSyncRootAnims, outSyncRoot);
}
/*
==============
BG_PlayerASM_IsThrowOrPrepareAlias
==============
*/
int __fastcall BG_PlayerASM_IsThrowOrPrepareAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsThrowOrPrepareAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_IsUpdateNeededForFunction
==============
*/
bool __fastcall BG_PlayerASM_IsUpdateNeededForFunction(const ASM_Context *context, const ASM_Instance *pInst, PlayerASM_Parameters *parameters, const ASM_Transition *pTransition, const ASM_Function *pFunc)
{
return ?BG_PlayerASM_IsUpdateNeededForFunction@@YA_NPEBUASM_Context@@PEBUASM_Instance@@PEAUPlayerASM_Parameters@@PEBUASM_Transition@@PEBUASM_Function@@@Z(context, pInst, parameters, pTransition, pFunc);
}
/*
==============
BG_PlayerASM_GetAnims
==============
*/
XAnim_s *__fastcall BG_PlayerASM_GetAnims(const unsigned int animsetIndex)
{
return ?BG_PlayerASM_GetAnims@@YAPEAUXAnim_s@@I@Z(animsetIndex);
}
/*
==============
BG_PlayerASM_CopyAnimDataToCharacterInfo
==============
*/
void __fastcall BG_PlayerASM_CopyAnimDataToCharacterInfo(const entityState_t *fromEs, characterInfo_t *ci)
{
?BG_PlayerASM_CopyAnimDataToCharacterInfo@@YAXPEBUentityState_t@@PEAUcharacterInfo_t@@@Z(fromEs, ci);
}
/*
==============
BG_PlayerASM_GetAnimsetByIndex
==============
*/
const Animset *__fastcall BG_PlayerASM_GetAnimsetByIndex(unsigned int animsetIndex)
{
return ?BG_PlayerASM_GetAnimsetByIndex@@YAPEBUAnimset@@I@Z(animsetIndex);
}
/*
==============
BG_PlayerASM_IsTransitionalAlias
==============
*/
int __fastcall BG_PlayerASM_IsTransitionalAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return ?BG_PlayerASM_IsTransitionalAlias@@YAHII@Z(packedAnimIndex, animSet);
}
/*
==============
BG_PlayerASM_GetAnimset
==============
*/
unsigned int __fastcall BG_PlayerASM_GetAnimset(const characterInfo_t *ci)
{
return ?BG_PlayerASM_GetAnimset@@YAIPEBUcharacterInfo_t@@@Z(ci);
}
/*
==============
BG_PlayerASM_GetIndexOfRandomAnimFromAlias<1>
==============
*/
__int64 BG_PlayerASM_GetIndexOfRandomAnimFromAlias<1>(unsigned int *holdrand, unsigned int entNum, const unsigned int animsetIndex, const AnimsetState *pState, const scr_string_t aliasName, int animEntryToSkip)
{
unsigned int v6;
const AnimsetState *v7;
__int64 v9;
scr_string_t v10;
unsigned int v11;
AnimsetAlias *animAliases;
__int64 numAnims;
const Animset *AnimsetByIndex;
__int64 v15;
double v16;
float v17;
__int64 v18;
__int128 v19;
unsigned int v20;
__int64 v21;
__int128 v22;
const char *v23;
const char *v24;
__int64 v25;
const char *v26;
const char *v27;
const char *v28;
const char *v29;
const char *v30;
__int64 result;
bool v32;
unsigned int v33;
unsigned int numAnimAliases;
int v35;
unsigned int seed;
const Animset *v37;
unsigned int v39;
v39 = animsetIndex;
v6 = 0;
v33 = 0;
v7 = pState;
if ( !pState )
{
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 155, ASSERT_TYPE_ASSERT, "(pState)", (const char *)&queryFormat, "pState") )
__debugbreak();
animsetIndex = v39;
}
numAnimAliases = v7->numAnimAliases;
v35 = 0;
if ( !numAnimAliases )
return 0xFFFFFFFFi64;
v9 = 0i64;
v10 = aliasName;
v11 = v7->numAnimAliases;
while ( 1 )
{
animAliases = v7->animAliases;
numAnims = (int)animAliases[v9].numAnims;
if ( animAliases[v9].name == v10 )
break;
v6 += numAnims;
v33 = v6;
LABEL_34:
++v9;
if ( ++v35 >= v11 )
return 0xFFFFFFFFi64;
animsetIndex = v39;
}
if ( (_DWORD)numAnims == 1 )
return v6;
AnimsetByIndex = BG_PlayerASM_GetAnimsetByIndex(animsetIndex);
v37 = AnimsetByIndex;
if ( (_DWORD)numAnims == 2 )
{
result = v6 + 1;
if ( animEntryToSkip == v6 )
return result;
if ( animEntryToSkip != (_DWORD)result && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 175, ASSERT_TYPE_ASSERT, "(animEntryToSkip == index || animEntryToSkip == index + 1)", (const char *)&queryFormat, "animEntryToSkip == index || animEntryToSkip == index + 1") )
__debugbreak();
return v6;
}
v32 = holdrand && (int)numAnims > 2;
v15 = numAnims;
while ( 1 )
{
if ( holdrand )
{
v16 = BG_flrand(0.1, 1.0, holdrand);
v17 = *(float *)&v16;
}
else
{
seed = entNum + v7->name + 7 * AnimsetByIndex->constName;
v17 = (float)((float)BgPlayer_Asm::irandWithSeed(&seed, 0, 0x7FFF) * 0.00002746582) + 0.1;
}
v18 = 0i64;
v19 = 0i64;
if ( v15 > 0 )
break;
LABEL_26:
v7 = pState;
AnimsetByIndex = v37;
if ( !v32 )
{
if ( (int)v15 > 0 )
{
v7 = pState;
v25 = (__int64)v37;
}
else
{
v23 = SL_ConvertToString(aliasName);
v24 = SL_ConvertToString(pState->name);
v25 = (__int64)v37;
v26 = v24;
v27 = SL_ConvertToString(v37->constName);
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 209, ASSERT_TYPE_ASSERT, "(numAnims > 0)", "%s\n\tanimset '%s' state %s alias '%s' has no anims!", "numAnims > 0", v27, v26, v23) )
__debugbreak();
}
v28 = SL_ConvertToString(aliasName);
v29 = SL_ConvertToString(v7->name);
v30 = SL_ConvertToString((scr_string_t)*(_DWORD *)(v25 + 8));
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 210, ASSERT_TYPE_ASSERT, (const char *)&queryFormat.fmt + 3, "animset '%s' state '%s' alias %s has bad weights!", v30, v29, v28) )
__debugbreak();
v11 = numAnimAliases;
v10 = aliasName;
v6 = v33;
goto LABEL_34;
}
}
v20 = v33;
v21 = 0i64;
while ( 1 )
{
if ( v15 <= 2 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 197, ASSERT_TYPE_ASSERT, "(!skipAnim || (skipAnim && numAnims > 2))", (const char *)&queryFormat, "!skipAnim || (skipAnim && numAnims > 2)") )
__debugbreak();
v22 = v19;
*(float *)&v22 = *(float *)&v19 + animAliases[v9].anims[v21].weight;
v19 = v22;
if ( *(float *)&v22 >= v17 && animEntryToSkip != v20 )
return v20;
++v20;
++v18;
++v21;
if ( v18 >= v15 )
goto LABEL_26;
}
}
/*
==============
BG_PlayerASM_GetIndexOfRandomAnimFromAlias<1>
==============
*/
int BG_PlayerASM_GetIndexOfRandomAnimFromAlias<1>(unsigned int *holdrand, unsigned int entNum, const unsigned int animsetIndex, const scr_string_t stateName, const scr_string_t aliasName, int animEntryToSkip)
{
AnimsetState *outState;
outState = NULL;
if ( BG_PlayerASM_GetStateInfoByName(animsetIndex, stateName, &outState, NULL) )
return BG_PlayerASM_GetIndexOfRandomAnimFromAlias<1>(holdrand, entNum, animsetIndex, outState, aliasName, animEntryToSkip);
else
return -1;
}
/*
==============
BG_PlayerASM_GetIndexOfRandomAnimFromAlias<0>
==============
*/
__int64 BG_PlayerASM_GetIndexOfRandomAnimFromAlias<0>(unsigned int *holdrand, unsigned int entNum, const unsigned int animsetIndex, const AnimsetState *pState, const scr_string_t aliasName)
{
unsigned int v5;
unsigned int v7;
__int64 v8;
unsigned int v9;
AnimsetAlias *animAliases;
__int64 numAnims;
const Animset *AnimsetByIndex;
double v13;
float v14;
__int64 v15;
__int128 v16;
unsigned int v17;
float *p_weight;
__int128 v19;
const char *v20;
const char *v21;
const char *v22;
const char *v23;
const char *v24;
const char *v25;
unsigned int seed[4];
unsigned int v30;
unsigned int numAnimAliases;
v30 = animsetIndex;
v5 = 0;
if ( !pState )
{
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 155, ASSERT_TYPE_ASSERT, "(pState)", (const char *)&queryFormat, "pState") )
__debugbreak();
animsetIndex = v30;
}
v7 = 0;
numAnimAliases = pState->numAnimAliases;
if ( numAnimAliases )
{
v8 = 0i64;
v9 = pState->numAnimAliases;
while ( 1 )
{
animAliases = pState->animAliases;
numAnims = (int)animAliases[v8].numAnims;
if ( animAliases[v8].name == aliasName )
{
if ( (_DWORD)numAnims == 1 )
return v5;
AnimsetByIndex = BG_PlayerASM_GetAnimsetByIndex(animsetIndex);
if ( holdrand )
{
v13 = BG_flrand(0.1, 1.0, holdrand);
v14 = *(float *)&v13;
}
else
{
seed[0] = entNum + pState->name + 7 * AnimsetByIndex->constName;
v14 = (float)((float)BgPlayer_Asm::irandWithSeed(seed, 0, 0x7FFF) * 0.00002746582) + 0.1;
}
v15 = 0i64;
v16 = 0i64;
if ( (int)numAnims > 0 )
{
v17 = v5;
p_weight = &animAliases[v8].anims->weight;
do
{
v19 = v16;
*(float *)&v19 = *(float *)&v16 + *p_weight;
v16 = v19;
if ( *(float *)&v19 >= v14 )
return v17;
++v17;
++v15;
p_weight += 6;
}
while ( v15 < numAnims );
if ( (int)numAnims > 0 )
goto LABEL_19;
}
v20 = SL_ConvertToString(aliasName);
v21 = SL_ConvertToString(pState->name);
v22 = SL_ConvertToString(AnimsetByIndex->constName);
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 209, ASSERT_TYPE_ASSERT, "(numAnims > 0)", "%s\n\tanimset '%s' state %s alias '%s' has no anims!", "numAnims > 0", v22, v21, v20) )
__debugbreak();
LABEL_19:
v23 = SL_ConvertToString(aliasName);
v24 = SL_ConvertToString(pState->name);
v25 = SL_ConvertToString(AnimsetByIndex->constName);
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 210, ASSERT_TYPE_ASSERT, (const char *)&queryFormat.fmt + 3, "animset '%s' state '%s' alias %s has bad weights!", v25, v24, v23) )
__debugbreak();
v9 = numAnimAliases;
}
else
{
v5 += numAnims;
}
++v7;
++v8;
if ( v7 >= v9 )
return 0xFFFFFFFFi64;
animsetIndex = v30;
}
}
return 0xFFFFFFFFi64;
}
/*
==============
BG_PlayerASM_GetIndexOfRandomAnimFromAlias<0>
==============
*/
int BG_PlayerASM_GetIndexOfRandomAnimFromAlias<0>(unsigned int *holdrand, unsigned int entNum, const unsigned int animsetIndex, const scr_string_t stateName, const scr_string_t aliasName, int animEntryToSkip)
{
AnimsetState *outState;
outState = NULL;
if ( BG_PlayerASM_GetStateInfoByName(animsetIndex, stateName, &outState, NULL) )
return BG_PlayerASM_GetIndexOfRandomAnimFromAlias<0>(holdrand, entNum, animsetIndex, outState, aliasName, animEntryToSkip);
else
return -1;
}
/*
==============
BG_PlayerASM_ApplyAliasAddonOverrides
==============
*/
void BG_PlayerASM_ApplyAliasAddonOverrides(DObj *obj, const characterInfo_t *ci, PlayerASM_AnimOverrides *animOverrides, scr_string_t overrideType, bool clear, XModelNameMap *modelNameMap, const unsigned int flags)
{
unsigned int count;
int v10;
PlayerASM_AnimOverrideEntry *v11;
unsigned int i;
PlayerASM_AnimOverrideEntry *v13;
int entryIndex;
int v15;
unsigned int animsetIndex;
const Animset *AnimsetByIndex;
char redAnims;
bool v19;
float blendTime;
XAnimTree *tree;
const XAnim_s *SubTreeAnims;
unsigned int v23;
const XAnim_s *v24;
double GoalWeight;
XAnimSubTreeID *pOutAnimSubtreeID;
XAnimCurveID *pOutAnimCurveID;
XAnimSubTreeID v28[2];
unsigned int pOutAnimIndex;
unsigned int pOutGraftNode;
int pOutStateIndex;
AnimsetAlias *ppOutAlias;
AnimsetAnim *ppOutAnim;
AnimsetState *outState;
XAnimCurveID v37;
if ( !obj && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1870, ASSERT_TYPE_ASSERT, "(obj)", (const char *)&queryFormat, "obj") )
__debugbreak();
if ( !animOverrides )
{
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1871, ASSERT_TYPE_ASSERT, "(animOverrides)", (const char *)&queryFormat, "animOverrides") )
__debugbreak();
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1804, ASSERT_TYPE_ASSERT, "(animOverride)", (const char *)&queryFormat, "animOverride") )
__debugbreak();
}
count = animOverrides->count;
v10 = 0;
if ( count )
{
while ( 1 )
{
v11 = &animOverrides->entries[v10];
if ( (!overrideType || v11->overrideType == overrideType) && v11->stateName && v11->overrideType )
break;
if ( ++v10 >= count )
return;
}
if ( v11->animsetIndex >= 4 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1813, ASSERT_TYPE_ASSERT, "(!isValid || (entry->animsetIndex < (1 << 2)))", (const char *)&queryFormat, "!isValid || (entry->animsetIndex < MAX_PLAYERANIM_ANIMSET_COUNT)") )
__debugbreak();
for ( i = 0; i < animOverrides->count; ++i )
{
v13 = &animOverrides->entries[i];
if ( (!overrideType || overrideType == v13->overrideType) && v13->stateName )
{
if ( !BG_PlayerASM_GetStateInfoByName(v13->animsetIndex, (const scr_string_t)v13->stateName, &outState, &pOutStateIndex) )
return;
BG_PlayerASM_GetAnimIndexFromStateIndexAndEntry(v13->animsetIndex, pOutStateIndex, v13->entryIndex, &pOutAnimIndex, &pOutGraftNode, v28, &v37);
entryIndex = v13->entryIndex;
v15 = pOutStateIndex;
animsetIndex = v13->animsetIndex;
if ( !ci && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1833, ASSERT_TYPE_ASSERT, "(ci)", (const char *)&queryFormat, "ci") )
__debugbreak();
ppOutAlias = NULL;
ppOutAnim = NULL;
AnimsetByIndex = BG_PlayerASM_GetAnimsetByIndex(animsetIndex);
if ( !AnimsetByIndex && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1840, ASSERT_TYPE_ASSERT, "(pAnimset)", (const char *)&queryFormat, "pAnimset") )
__debugbreak();
BG_Animset_GetAliasAndAnimFromStateIndexAndEntry(AnimsetByIndex, v15, entryIndex, (const AnimsetAlias **)&ppOutAlias, (const AnimsetAnim **)&ppOutAnim);
if ( !ppOutAlias && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1843, ASSERT_TYPE_ASSERT, "(alias)", (const char *)&queryFormat, "alias") )
__debugbreak();
redAnims = (char)ppOutAlias->u.m_AIAnimsetAlias[5].redAnims;
if ( redAnims == 10 )
{
v19 = !ci->useShadowAnims;
}
else
{
if ( redAnims != 11 )
goto LABEL_38;
v19 = ci->isFemale == 0;
}
if ( !v19 )
{
LABEL_38:
if ( (flags & 4) != 0 )
blendTime = 0.0;
else
blendTime = v13->blendTime;
tree = obj->tree;
if ( clear )
{
SubTreeAnims = XAnimGetSubTreeAnims(tree, v28[0]);
v23 = pOutAnimIndex;
v24 = SubTreeAnims;
if ( pOutAnimIndex >= SubTreeAnims->size )
{
LODWORD(pOutAnimCurveID) = SubTreeAnims->size;
LODWORD(pOutAnimSubtreeID) = pOutAnimIndex;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1912, ASSERT_TYPE_ASSERT, "(unsigned)( animIndex ) < (unsigned)( anims->size )", "animIndex doesn't index anims->size\n\t%i not in [0, %i)", pOutAnimSubtreeID, pOutAnimCurveID) )
__debugbreak();
v23 = pOutAnimIndex;
}
if ( XAnimIsCustomNodeType(v24->entries[v23].nodeType) )
XAnimSetGoalWeight(obj, pOutGraftNode, v28[0], pOutAnimIndex, 0.0, blendTime, v13->rate, (scr_string_t)0, 0, 0, LINEAR, modelNameMap);
else
XAnimClearTreeGoalWeights(obj->tree, pOutGraftNode, v28[0], pOutAnimIndex, blendTime, 0, obj, LINEAR);
}
else
{
GoalWeight = XAnimGetGoalWeight(tree, pOutGraftNode, v28[0], pOutAnimIndex);
if ( *(float *)&GoalWeight != 1.0 )
XAnimSetCompleteGoalWeight(obj, pOutGraftNode, v28[0], pOutAnimIndex, 1.0, blendTime, v13->rate, (scr_string_t)0, 0, v13->restart, LINEAR, modelNameMap);
}
}
}
}
}
}
/*
==============
BG_PlayerASM_ClearAnimOverrides
==============
*/
void BG_PlayerASM_ClearAnimOverrides(PlayerASM_AnimOverrides *animOverride)
{
memset_0(animOverride, 0, sizeof(PlayerASM_AnimOverrides));
}
/*
==============
BG_PlayerASM_ClearState
==============
*/
void BG_PlayerASM_ClearState(const PlayerASM_Context *context, const PlayerASM_AnimSlot animSlot)
{
unsigned __int8 v2;
playerState_s *ps;
int v5;
__int64 v6;
v2 = animSlot;
if ( !context && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1454, ASSERT_TYPE_ASSERT, "(context)", (const char *)&queryFormat, "context") )
__debugbreak();
if ( v2 >= 2u )
{
LODWORD(v6) = v2;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1455, ASSERT_TYPE_ASSERT, "(unsigned)( animSlot ) < (unsigned)( PlayerASM_AnimSlot::COUNT )", "animSlot doesn't index PlayerASM_AnimSlot::COUNT\n\t%i not in [0, %i)", v6, 2) )
__debugbreak();
}
ps = context->ps;
if ( context->useEntityState )
{
if ( !ps && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1461, ASSERT_TYPE_ASSERT, "(es)", (const char *)&queryFormat, "es") )
__debugbreak();
v5 = -1610547201;
if ( !v2 )
v5 = -536936441;
ps->fallStartTime &= v5;
}
else
{
if ( !ps && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1476, ASSERT_TYPE_ASSERT, "(ps)", (const char *)&queryFormat, "ps") )
__debugbreak();
ps->animState.slot[v2] = 0i64;
}
}
/*
==============
BG_PlayerASM_CopyAnimDataToCharacterInfo
==============
*/
void BG_PlayerASM_CopyAnimDataToCharacterInfo(const entityState_t *fromEs, characterInfo_t *ci)
{
unsigned int v4;
unsigned int v5;
int v6;
unsigned int v7;
if ( !fromEs && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 580, ASSERT_TYPE_ASSERT, "(fromEs)", (const char *)&queryFormat, "fromEs") )
__debugbreak();
if ( !ci && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 581, ASSERT_TYPE_ASSERT, "(ci)", (const char *)&queryFormat, "ci") )
__debugbreak();
ci->playerASMAnim.animSet = BG_PlayerASM_GetAnimset(fromEs);
ci->playerAnim.legsAnim = BG_PlayerASM_GetAnim(fromEs, MOVEMENT);
if ( !Com_GameMode_SupportsFeature(WEAPON_SKYDIVE_CUT_CHUTE_LOW) && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 511, ASSERT_TYPE_ASSERT, "(Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION ))", (const char *)&queryFormat, "Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION )") )
__debugbreak();
if ( !fromEs && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 512, ASSERT_TYPE_ASSERT, "(es)", (const char *)&queryFormat, "es") )
__debugbreak();
v4 = fromEs->animInfo.animData & 0x1FFF0000;
v5 = fromEs->animInfo.animData >> 1;
v6 = v5 & 3;
v7 = (v4 | v5 & 0x20000000) >> 16;
BG_PlayerASM_VerifyAnim(v6, v7);
ci->playerAnim.torsoAnim = v7;
}
/*
==============
BG_PlayerASM_CopyAnimDataToCharacterInfo
==============
*/
void BG_PlayerASM_CopyAnimDataToCharacterInfo(const playerState_s *fromPs, characterInfo_t *ci)
{
unsigned int packedAnim;
if ( !fromPs && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 567, ASSERT_TYPE_ASSERT, "(fromPs)", (const char *)&queryFormat, "fromPs") )
__debugbreak();
if ( !ci && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 568, ASSERT_TYPE_ASSERT, "(ci)", (const char *)&queryFormat, "ci") )
__debugbreak();
ci->playerASMAnim.animSet = BG_PlayerASM_GetAnimset(fromPs);
ci->playerAnim.legsAnim = BG_PlayerASM_GetAnim(fromPs, MOVEMENT);
if ( !Com_GameMode_SupportsFeature(WEAPON_SKYDIVE_CUT_CHUTE_LOW) && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 528, ASSERT_TYPE_ASSERT, "(Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION ))", (const char *)&queryFormat, "Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION )") )
__debugbreak();
if ( !fromPs && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 529, ASSERT_TYPE_ASSERT, "(ps)", (const char *)&queryFormat, "ps") )
__debugbreak();
packedAnim = fromPs->animState.slot[1].packedAnim;
if ( packedAnim >= 0x4000 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 535, ASSERT_TYPE_ASSERT, "(slot != PlayerASM_AnimSlot::SECONDARY || anim < (1 << 14))", (const char *)&queryFormat, "slot != PlayerASM_AnimSlot::SECONDARY || anim < MAX_PLAYERANIM_ENTRY_COUNT") )
__debugbreak();
BG_PlayerASM_VerifyAnim(fromPs->animState.animSet, packedAnim);
ci->playerAnim.torsoAnim = packedAnim;
}
/*
==============
BG_PlayerASM_CopyAnimDataToEntity
==============
*/
void BG_PlayerASM_CopyAnimDataToEntity(const playerState_s *fromPs, entityState_t *es)
{
char Animset;
$6F846F8762124C99A58E7E51263A35C4 *v5;
unsigned int Anim;
unsigned int packedAnim;
if ( !fromPs && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 593, ASSERT_TYPE_ASSERT, "(fromPs)", (const char *)&queryFormat, "fromPs") )
__debugbreak();
if ( !es && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 594, ASSERT_TYPE_ASSERT, "(es)", (const char *)&queryFormat, "es") )
__debugbreak();
Animset = BG_PlayerASM_GetAnimset(fromPs);
v5 = &es->animInfo.4;
es->animInfo.animData &= 0xFFFFFFF9;
es->animInfo.animData |= 2 * (Animset & 3);
Anim = BG_PlayerASM_GetAnim(fromPs, MOVEMENT);
playerAnim_t::SetPrimaryAnim((playerAnim_t *)&es->animInfo.4, Anim);
if ( !Com_GameMode_SupportsFeature(WEAPON_SKYDIVE_CUT_CHUTE_LOW) && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 528, ASSERT_TYPE_ASSERT, "(Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION ))", (const char *)&queryFormat, "Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION )") )
__debugbreak();
if ( !fromPs && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 529, ASSERT_TYPE_ASSERT, "(ps)", (const char *)&queryFormat, "ps") )
__debugbreak();
packedAnim = fromPs->animState.slot[1].packedAnim;
if ( packedAnim >= 0x4000 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 535, ASSERT_TYPE_ASSERT, "(slot != PlayerASM_AnimSlot::SECONDARY || anim < (1 << 14))", (const char *)&queryFormat, "slot != PlayerASM_AnimSlot::SECONDARY || anim < MAX_PLAYERANIM_ENTRY_COUNT") )
__debugbreak();
BG_PlayerASM_VerifyAnim(fromPs->animState.animSet, packedAnim);
playerAnim_t::SetSecondaryAnim((playerAnim_t *)v5, packedAnim);
}
/*
==============
BG_PlayerASM_DebugAnimEventLog_AddEntry
==============
*/
void BG_PlayerASM_DebugAnimEventLog_AddEntry(const int entNum, const int serverTime, events_t *events)
{
const dvar_t *v3;
int integer;
bool IsServerThread;
PlayerASM_DebugAnimEventInfoEntry *v9;
bool v10;
int v11;
bool *p_isServer;
PlayerASM_DebugAnimEventInfoLog *v13;
v3 = DVARINT_animscript_debug;
if ( !DVARINT_animscript_debug && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\universal\\dvar.h", 699, ASSERT_TYPE_ASSERT, "(dvar)", "%s\n\tDvar %s accessed after deregistration", "dvar", "animscript_debug") )
__debugbreak();
Dvar_CheckFrontendServerThread(v3);
integer = v3->current.integer;
if ( integer != -1 && integer == entNum && BG_CheckAnyOn(events->events) )
{
Sys_EnterCriticalSection(CRITSECT_DEBUG_ANIM_EVENT_LOG);
IsServerThread = ASM_IsServerThread();
v9 = NULL;
v10 = IsServerThread;
v11 = 0;
if ( s_debugAnimEventInfoLog.entryCount <= 0 )
{
LABEL_13:
if ( s_debugAnimEventInfoLog.entryCount == 8 )
{
v9 = &s_debugAnimEventInfoLog.entries[7];
}
else
{
v13 = &s_debugAnimEventInfoLog;
while ( v13->entries[0].isUsed )
{
v13 = (PlayerASM_DebugAnimEventInfoLog *)((char *)v13 + 108);
if ( (__int64)v13 >= (__int64)&s_debugAnimEventInfoLog.entryCount )
goto LABEL_20;
}
v9 = (PlayerASM_DebugAnimEventInfoEntry *)v13;
++s_debugAnimEventInfoLog.entryCount;
}
LABEL_20:
v9->isUsed = 1;
v9->serverTime = serverTime;
v9->isServer = v10;
*(__m256i *)v9->events.events = *(__m256i *)events->events;
*(__m256i *)v9->events.isContinue = *(__m256i *)events->isContinue;
*(__m256i *)v9->events.force = *(__m256i *)events->force;
*(_DWORD *)&v9->events.hasEvents = *(_DWORD *)&events->hasEvents;
std::_Sort_unchecked<PlayerASM_DebugAnimEventInfoEntry *,bool (*)(PlayerASM_DebugAnimEventInfoEntry &,PlayerASM_DebugAnimEventInfoEntry &)>(s_debugAnimEventInfoLog.entries, (PlayerASM_DebugAnimEventInfoEntry *)&s_debugAnimEventInfoLog.entryCount, 8i64, BG_PlayerASM_DebugAnimEventLog_Sorter);
}
else
{
p_isServer = &s_debugAnimEventInfoLog.entries[0].isServer;
while ( !*(p_isServer - 1) || *(_DWORD *)(p_isServer - 105) != serverTime || *p_isServer != IsServerThread )
{
++v11;
p_isServer += 108;
if ( v11 >= s_debugAnimEventInfoLog.entryCount )
goto LABEL_13;
}
}
Sys_LeaveCriticalSection(CRITSECT_DEBUG_ANIM_EVENT_LOG);
}
}
/*
==============
BG_PlayerASM_DebugAnimEventLog_Compact
==============
*/
void BG_PlayerASM_DebugAnimEventLog_Compact(const int serverTime)
{
char v2;
int v3;
bool v4;
int v5;
bool v6;
int v7;
bool v8;
int v9;
bool v10;
int v11;
bool v12;
int v13;
bool v14;
int v15;
bool v16;
int v17;
bool v18;
Sys_EnterCriticalSection(CRITSECT_DEBUG_ANIM_EVENT_LOG);
v2 = 0;
if ( s_debugAnimEventInfoLog.entries[0].isUsed )
{
v3 = s_debugAnimEventInfoLog.entries[0].serverTime - serverTime;
v4 = s_debugAnimEventInfoLog.entries[0].isServer && (unsigned int)(v3 - 1) <= 0x1F2;
if ( v3 > 0 && !v4 || serverTime - s_debugAnimEventInfoLog.entries[0].serverTime > 500 )
{
memset_0(&s_debugAnimEventInfoLog, 0, 0x6Cui64);
--s_debugAnimEventInfoLog.entryCount;
v2 = 1;
}
}
if ( s_debugAnimEventInfoLog.entries[1].isUsed )
{
v5 = s_debugAnimEventInfoLog.entries[1].serverTime - serverTime;
v6 = s_debugAnimEventInfoLog.entries[1].isServer && (unsigned int)(v5 - 1) <= 0x1F2;
if ( v5 > 0 && !v6 || serverTime - s_debugAnimEventInfoLog.entries[1].serverTime > 500 )
{
memset_0(&s_debugAnimEventInfoLog.entries[1], 0, sizeof(s_debugAnimEventInfoLog.entries[1]));
--s_debugAnimEventInfoLog.entryCount;
v2 = 1;
}
}
if ( s_debugAnimEventInfoLog.entries[2].isUsed )
{
v7 = s_debugAnimEventInfoLog.entries[2].serverTime - serverTime;
v8 = s_debugAnimEventInfoLog.entries[2].isServer && (unsigned int)(v7 - 1) <= 0x1F2;
if ( v7 > 0 && !v8 || serverTime - s_debugAnimEventInfoLog.entries[2].serverTime > 500 )
{
memset_0(&s_debugAnimEventInfoLog.entries[2], 0, sizeof(s_debugAnimEventInfoLog.entries[2]));
--s_debugAnimEventInfoLog.entryCount;
v2 = 1;
}
}
if ( s_debugAnimEventInfoLog.entries[3].isUsed )
{
v9 = s_debugAnimEventInfoLog.entries[3].serverTime - serverTime;
v10 = s_debugAnimEventInfoLog.entries[3].isServer && (unsigned int)(v9 - 1) <= 0x1F2;
if ( v9 > 0 && !v10 || serverTime - s_debugAnimEventInfoLog.entries[3].serverTime > 500 )
{
memset_0(&s_debugAnimEventInfoLog.entries[3], 0, sizeof(s_debugAnimEventInfoLog.entries[3]));
--s_debugAnimEventInfoLog.entryCount;
v2 = 1;
}
}
if ( s_debugAnimEventInfoLog.entries[4].isUsed )
{
v11 = s_debugAnimEventInfoLog.entries[4].serverTime - serverTime;
v12 = s_debugAnimEventInfoLog.entries[4].isServer && (unsigned int)(v11 - 1) <= 0x1F2;
if ( v11 > 0 && !v12 || serverTime - s_debugAnimEventInfoLog.entries[4].serverTime > 500 )
{
memset_0(&s_debugAnimEventInfoLog.entries[4], 0, sizeof(s_debugAnimEventInfoLog.entries[4]));
--s_debugAnimEventInfoLog.entryCount;
v2 = 1;
}
}
if ( s_debugAnimEventInfoLog.entries[5].isUsed )
{
v13 = s_debugAnimEventInfoLog.entries[5].serverTime - serverTime;
v14 = s_debugAnimEventInfoLog.entries[5].isServer && (unsigned int)(v13 - 1) <= 0x1F2;
if ( v13 > 0 && !v14 || serverTime - s_debugAnimEventInfoLog.entries[5].serverTime > 500 )
{
memset_0(&s_debugAnimEventInfoLog.entries[5], 0, sizeof(s_debugAnimEventInfoLog.entries[5]));
--s_debugAnimEventInfoLog.entryCount;
v2 = 1;
}
}
if ( s_debugAnimEventInfoLog.entries[6].isUsed )
{
v15 = s_debugAnimEventInfoLog.entries[6].serverTime - serverTime;
v16 = s_debugAnimEventInfoLog.entries[6].isServer && (unsigned int)(v15 - 1) <= 0x1F2;
if ( v15 > 0 && !v16 || serverTime - s_debugAnimEventInfoLog.entries[6].serverTime > 500 )
{
memset_0(&s_debugAnimEventInfoLog.entries[6], 0, sizeof(s_debugAnimEventInfoLog.entries[6]));
--s_debugAnimEventInfoLog.entryCount;
v2 = 1;
}
}
if ( s_debugAnimEventInfoLog.entries[7].isUsed )
{
v17 = s_debugAnimEventInfoLog.entries[7].serverTime - serverTime;
v18 = s_debugAnimEventInfoLog.entries[7].isServer && (unsigned int)(v17 - 1) <= 0x1F2;
if ( v17 > 0 && !v18 || serverTime - s_debugAnimEventInfoLog.entries[7].serverTime > 500 )
{
memset_0(&s_debugAnimEventInfoLog.entries[7], 0, sizeof(s_debugAnimEventInfoLog.entries[7]));
--s_debugAnimEventInfoLog.entryCount;
LABEL_74:
std::_Sort_unchecked<PlayerASM_DebugAnimEventInfoEntry *,bool (*)(PlayerASM_DebugAnimEventInfoEntry &,PlayerASM_DebugAnimEventInfoEntry &)>(s_debugAnimEventInfoLog.entries, (PlayerASM_DebugAnimEventInfoEntry *)&s_debugAnimEventInfoLog.entryCount, 8i64, BG_PlayerASM_DebugAnimEventLog_Sorter);
goto LABEL_75;
}
}
if ( v2 )
goto LABEL_74;
LABEL_75:
Sys_LeaveCriticalSection(CRITSECT_DEBUG_ANIM_EVENT_LOG);
}
/*
==============
BG_PlayerASM_DebugAnimEventLog_GetEntry
==============
*/
const PlayerASM_DebugAnimEventInfoEntry *BG_PlayerASM_DebugAnimEventLog_GetEntry(int entryIndex)
{
__int64 v1;
int entryCount;
v1 = entryIndex;
if ( (unsigned int)entryIndex >= s_debugAnimEventInfoLog.entryCount )
{
entryCount = s_debugAnimEventInfoLog.entryCount;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 2262, ASSERT_TYPE_ASSERT, "(unsigned)( entryIndex ) < (unsigned)( s_debugAnimEventInfoLog.entryCount )", "entryIndex doesn't index s_debugAnimEventInfoLog.entryCount\n\t%i not in [0, %i)", entryIndex, entryCount) )
__debugbreak();
}
return (const PlayerASM_DebugAnimEventInfoEntry *)((char *)&s_debugAnimEventInfoLog + 108 * v1);
}
/*
==============
BG_PlayerASM_DebugAnimEventLog_GetNumEntries
==============
*/
__int64 BG_PlayerASM_DebugAnimEventLog_GetNumEntries()
{
return (unsigned int)s_debugAnimEventInfoLog.entryCount;
}
/*
==============
BG_PlayerASM_DebugAnimEventLog_IsEnabled
==============
*/
bool BG_PlayerASM_DebugAnimEventLog_IsEnabled(const int entNum)
{
const dvar_t *v1;
int integer;
v1 = DVARINT_animscript_debug;
if ( !DVARINT_animscript_debug && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\universal\\dvar.h", 699, ASSERT_TYPE_ASSERT, "(dvar)", "%s\n\tDvar %s accessed after deregistration", "dvar", "animscript_debug") )
__debugbreak();
Dvar_CheckFrontendServerThread(v1);
integer = v1->current.integer;
return integer != -1 && integer == entNum;
}
/*
==============
BG_PlayerASM_DebugAnimEventLog_Sorter
==============
*/
bool BG_PlayerASM_DebugAnimEventLog_Sorter(PlayerASM_DebugAnimEventInfoEntry *sortItem1, PlayerASM_DebugAnimEventInfoEntry *sortItem2)
{
return sortItem1->isUsed && !sortItem2->isUsed || sortItem1->serverTime > sortItem2->serverTime;
}
/*
==============
BG_PlayerASM_DoesAliasHaveAnyFlags
==============
*/
_BOOL8 BG_PlayerASM_DoesAliasHaveAnyFlags(const unsigned int packedAnimIndex, const unsigned int animsetIndex, const unsigned __int64 flags)
{
const Animset *AnimsetByIndex;
int v6;
AnimsetAlias *ppOutAlias;
AnimsetAnim *ppOutAnim;
unsigned int outAnimState;
unsigned int outAnimEntry;
if ( !packedAnimIndex )
return 0i64;
BG_PlayerASM_UnpackAnim(animsetIndex, packedAnimIndex, &outAnimState, &outAnimEntry);
AnimsetByIndex = BG_PlayerASM_GetAnimsetByIndex(animsetIndex);
if ( !AnimsetByIndex && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 773, ASSERT_TYPE_ASSERT, "(pAnimset)", (const char *)&queryFormat, "pAnimset") )
__debugbreak();
v6 = outAnimState;
if ( !BG_Animset_GetNumEntriesForStateIndex(AnimsetByIndex, outAnimState) )
return 0i64;
BG_Animset_GetAliasAndAnimFromStateIndexAndEntry(AnimsetByIndex, v6, outAnimEntry, (const AnimsetAlias **)&ppOutAlias, (const AnimsetAnim **)&ppOutAnim);
if ( !ppOutAlias && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 780, ASSERT_TYPE_ASSERT, "(pAlias)", (const char *)&queryFormat, "pAlias") )
__debugbreak();
return (flags & *(_QWORD *)&ppOutAlias->u.m_AIAnimsetAlias->numRedAnims) != 0;
}
/*
==============
BG_PlayerASM_DoesAliasHaveAnyMoveTypes
==============
*/
int BG_PlayerASM_DoesAliasHaveAnyMoveTypes(const unsigned int packedAnimIndex, const unsigned int animsetIndex, unsigned int *moveTypes)
{
const Animset *AnimsetByIndex;
AnimsetAlias *ppOutAlias;
AnimsetAnim *ppOutAnim;
unsigned int outAnimState;
unsigned int outAnimEntry;
if ( !packedAnimIndex )
return 0;
BG_PlayerASM_UnpackAnim(animsetIndex, packedAnimIndex, &outAnimState, &outAnimEntry);
if ( !BG_PlayerASM_GetNumEntriesForStateIndex(animsetIndex, outAnimState) )
return 0;
AnimsetByIndex = BG_PlayerASM_GetAnimsetByIndex(animsetIndex);
if ( !AnimsetByIndex && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 801, ASSERT_TYPE_ASSERT, "(pAnimset)", (const char *)&queryFormat, "pAnimset") )
__debugbreak();
BG_Animset_GetAliasAndAnimFromStateIndexAndEntry(AnimsetByIndex, outAnimState, outAnimEntry, (const AnimsetAlias **)&ppOutAlias, (const AnimsetAnim **)&ppOutAnim);
if ( !ppOutAlias && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 806, ASSERT_TYPE_ASSERT, "(pAlias)", (const char *)&queryFormat, "pAlias") )
__debugbreak();
return BG_CheckAnyBits((const unsigned int *)&ppOutAlias->u.m_AIAnimsetAlias[1], moveTypes);
}
/*
==============
BG_PlayerASM_EvalConditionMasks
==============
*/
char BG_PlayerASM_EvalConditionMasks(const characterInfo_t *const ci, const ASM_Instance *pInst, const PlayerASM_ConditionMask *conditionMask, scr_string_t stateName)
{
const characterInfo_t *v7;
bool v8;
bool v9;
const dvar_t *v10;
const char *v11;
const char *v12;
unsigned int *animConditions;
unsigned int *animEvents;
int v16;
unsigned int *v17;
int v18;
bool v19;
int v20;
bool v21;
const dvar_t *v22;
const char *v23;
const char *v24;
const char *v25;
const characterInfo_t *v26;
scr_string_t v27;
const char *v28;
const char *v29;
const char *v30;
v7 = ci;
if ( !ci && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1938, ASSERT_TYPE_ASSERT, "(ci)", (const char *)&queryFormat, "ci") )
__debugbreak();
if ( !conditionMask && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1939, ASSERT_TYPE_ASSERT, "(conditionMask)", (const char *)&queryFormat, "conditionMask") )
__debugbreak();
v8 = 0;
v9 = 0;
if ( conditionMask->usesNotetrackEvents )
{
if ( !pInst )
{
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm.h", 220, ASSERT_TYPE_ASSERT, "(pInst)", (const char *)&queryFormat, "pInst") )
__debugbreak();
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1950, ASSERT_TYPE_ASSERT, "(playerInst)", (const char *)&queryFormat, "playerInst") )
__debugbreak();
}
if ( BYTE1(pInst[1].m_pASM) )
{
v10 = DVARINT_playerasm_condition_mask_debug;
if ( !DVARINT_playerasm_condition_mask_debug )
{
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\universal\\dvar.h", 699, ASSERT_TYPE_ASSERT, "(dvar)", "%s\n\tDvar %s accessed after deregistration", "dvar", "playerasm_condition_mask_debug") )
__debugbreak();
v7 = ci;
}
Dvar_CheckFrontendServerThread(v10);
if ( v10->current.integer == 3 )
{
v11 = "Server";
if ( v7->pXAnimTree->owner[0] == 1 )
v11 = "Client";
v12 = SL_ConvertToString(stateName);
Com_PrintWarning(19, "PlayerASM: Updating alias: '%s' on '%s' - notetrack triggered. \n", v12, v11);
return 0;
}
return 0;
}
}
animConditions = conditionMask->animConditions;
animEvents = conditionMask->animEvents;
v16 = BG_CheckAnyOn(conditionMask->animConditions);
v17 = conditionMask->animEvents;
v18 = v16;
v19 = v16 != 0;
v20 = BG_CheckAnyOn(v17);
v21 = v20 != 0;
if ( v18 || v20 )
{
if ( v19 )
v8 = BG_CheckAnyBits(animConditions, v7->dirtyConditions) == 0;
if ( v21 )
v9 = BG_CheckAnyBits(animEvents, v7->clientEvents.events) == 0;
if ( v19 && !v8 || v21 && !v9 )
return 0;
v25 = "Server";
if ( v19 && v8 )
{
v26 = ci;
v27 = stateName;
if ( Dvar_GetInt_Internal_DebugName(DVARINT_playerasm_condition_mask_debug, "playerasm_condition_mask_debug") == 1 )
{
v28 = "Server";
if ( ci->pXAnimTree->owner[0] == 1 )
v28 = "Client";
v29 = SL_ConvertToString(stateName);
Com_PrintWarning(19, "PlayerASM: Skipped alias: '%s' on '%s' - anim condition mask used. \n", v29, v28);
}
}
else
{
v27 = stateName;
v26 = ci;
}
if ( v21 && v9 && Dvar_GetInt_Internal_DebugName(DVARINT_playerasm_condition_mask_debug, "playerasm_condition_mask_debug") == 1 )
{
if ( v26->pXAnimTree->owner[0] == 1 )
v25 = "Client";
v30 = SL_ConvertToString(v27);
Com_PrintWarning(19, "PlayerASM: Skipped alias: '%s' on '%s' - event mask used. \n", v30, v25);
}
return 1;
}
else
{
v22 = DVARINT_playerasm_condition_mask_debug;
if ( !DVARINT_playerasm_condition_mask_debug )
{
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\universal\\dvar.h", 699, ASSERT_TYPE_ASSERT, "(dvar)", "%s\n\tDvar %s accessed after deregistration", "dvar", "playerasm_condition_mask_debug") )
__debugbreak();
v7 = ci;
}
Dvar_CheckFrontendServerThread(v22);
if ( v22->current.integer != 3 )
return 0;
v23 = "Server";
if ( v7->pXAnimTree->owner[0] == 1 )
v23 = "Client";
v24 = SL_ConvertToString(stateName);
Com_PrintWarning(19, "PlayerASM: Updating alias: '%s' on '%s' - mask not found. \n", v24, v23);
return 0;
}
}
/*
==============
BG_PlayerASM_EvaluateCondition
==============
*/
_BOOL8 BG_PlayerASM_EvaluateCondition(const characterInfo_t *ci, unsigned int index, unsigned int *value)
{
__int64 v3;
PlayerAnimScriptConditionTypes AnimConditionType;
unsigned int *v7;
unsigned int v8;
signed __int64 v9;
v3 = index;
if ( !ci )
return 1i64;
AnimConditionType = BG_GetAnimConditionType(index);
if ( AnimConditionType )
{
if ( AnimConditionType == ANIM_CONDTYPE_VALUE )
{
v7 = ci->clientConditions[(unsigned int)v3];
if ( !v7 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\bg_animation_mp.h", 1057, ASSERT_TYPE_ASSERT, "(array)", (const char *)&queryFormat, "array") )
__debugbreak();
if ( !value && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\bg_animation_mp.h", 1058, ASSERT_TYPE_ASSERT, "(array2)", (const char *)&queryFormat, "array2") )
__debugbreak();
v8 = 0;
v9 = (char *)v7 - (char *)value;
while ( *(unsigned int *)((char *)value + v9) == *value )
{
++v8;
++value;
if ( v8 >= 8 )
return 1i64;
}
return 0i64;
}
return 1i64;
}
return BG_CheckAnyBits(ci->clientConditions[v3], value) != 0;
}
/*
==============
BG_PlayerASM_FindValidAliasAddonOverrides
==============
*/
char BG_PlayerASM_FindValidAliasAddonOverrides(PlayerASM_AnimOverrides *animOverride, scr_string_t overrideType, PlayerASM_AnimOverrideEntry **overrideEntry)
{
unsigned int count;
int v7;
PlayerASM_AnimOverrideEntry *v8;
if ( !animOverride && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1804, ASSERT_TYPE_ASSERT, "(animOverride)", (const char *)&queryFormat, "animOverride") )
__debugbreak();
count = animOverride->count;
v7 = 0;
if ( !count )
return 0;
while ( 1 )
{
v8 = &animOverride->entries[v7];
if ( (!overrideType || v8->overrideType == overrideType) && v8->stateName && v8->overrideType )
break;
if ( ++v7 >= count )
return 0;
}
if ( v8->animsetIndex >= 4 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1813, ASSERT_TYPE_ASSERT, "(!isValid || (entry->animsetIndex < (1 << 2)))", (const char *)&queryFormat, "!isValid || (entry->animsetIndex < MAX_PLAYERANIM_ANIMSET_COUNT)") )
__debugbreak();
if ( overrideEntry )
*overrideEntry = v8;
return 1;
}
/*
==============
BG_PlayerASM_GetAnim
==============
*/
__int64 BG_PlayerASM_GetAnim(const characterInfo_t *ci, const PlayerASM_AnimSlot slot)
{
unsigned __int8 v3;
unsigned int v4;
const char *v5;
int v6;
const char *v7;
__int64 v9;
v3 = slot;
if ( !Com_GameMode_SupportsFeature(WEAPON_SKYDIVE_CUT_CHUTE_LOW) && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 548, ASSERT_TYPE_ASSERT, "(Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION ))", (const char *)&queryFormat, "Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION )") )
__debugbreak();
if ( !ci && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 549, ASSERT_TYPE_ASSERT, "(ci)", (const char *)&queryFormat, "ci") )
__debugbreak();
if ( v3 >= 2u )
{
LODWORD(v9) = v3;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 550, ASSERT_TYPE_ASSERT, "(unsigned)( slot ) < (unsigned)( PlayerASM_AnimSlot::COUNT )", "slot doesn't index PlayerASM_AnimSlot::COUNT\n\t%i not in [0, %i)", v9, 2) )
__debugbreak();
}
v4 = *(&ci->playerAnim.legsAnim + v3);
if ( v3 )
{
if ( v3 != 1 || v4 < 0x4000 )
goto LABEL_18;
v5 = "slot != PlayerASM_AnimSlot::SECONDARY || anim < MAX_PLAYERANIM_ENTRY_COUNT";
v6 = 555;
v7 = "(slot != PlayerASM_AnimSlot::SECONDARY || anim < (1 << 14))";
}
else
{
if ( v4 < 0x4000 )
goto LABEL_18;
v5 = "slot != PlayerASM_AnimSlot::PRIMARY || anim < MAX_PLAYERANIM_ENTRY_COUNT";
v6 = 554;
v7 = "(slot != PlayerASM_AnimSlot::PRIMARY || anim < (1 << 14))";
}
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", v6, ASSERT_TYPE_ASSERT, v7, (const char *)&queryFormat, v5) )
__debugbreak();
LABEL_18:
BG_PlayerASM_VerifyAnim(ci->playerASMAnim.animSet, v4);
return v4;
}
/*
==============
BG_PlayerASM_GetAnim
==============
*/
__int64 BG_PlayerASM_GetAnim(const entityState_t *es, const PlayerASM_AnimSlot slot)
{
unsigned __int8 v3;
unsigned int animData;
unsigned int v5;
__int64 v7;
v3 = slot;
if ( !Com_GameMode_SupportsFeature(WEAPON_SKYDIVE_CUT_CHUTE_LOW) && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 511, ASSERT_TYPE_ASSERT, "(Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION ))", (const char *)&queryFormat, "Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION )") )
__debugbreak();
if ( !es && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 512, ASSERT_TYPE_ASSERT, "(es)", (const char *)&queryFormat, "es") )
__debugbreak();
if ( v3 >= 2u )
{
LODWORD(v7) = v3;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 513, ASSERT_TYPE_ASSERT, "(unsigned)( slot ) < (unsigned)( PlayerASM_AnimSlot::COUNT )", "slot doesn't index PlayerASM_AnimSlot::COUNT\n\t%i not in [0, %i)", v7, 2) )
__debugbreak();
}
animData = es->animInfo.animData;
if ( v3 )
v5 = (animData & 0x1FFF0000 | (animData >> 1) & 0x20000000) >> 16;
else
v5 = ((unsigned __int16)animData >> 3) | *((_WORD *)&es->animInfo.stateAnim + 1) & 0x2000;
BG_PlayerASM_VerifyAnim((animData >> 1) & 3, v5);
return v5;
}
/*
==============
BG_PlayerASM_GetAnim
==============
*/
__int64 BG_PlayerASM_GetAnim(const playerState_s *ps, const PlayerASM_AnimSlot slot)
{
unsigned __int8 v3;
unsigned int packedAnim;
const char *v5;
int v6;
const char *v7;
__int64 v9;
v3 = slot;
if ( !Com_GameMode_SupportsFeature(WEAPON_SKYDIVE_CUT_CHUTE_LOW) && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 528, ASSERT_TYPE_ASSERT, "(Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION ))", (const char *)&queryFormat, "Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION )") )
__debugbreak();
if ( !ps && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 529, ASSERT_TYPE_ASSERT, "(ps)", (const char *)&queryFormat, "ps") )
__debugbreak();
if ( v3 >= 2u )
{
LODWORD(v9) = v3;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 530, ASSERT_TYPE_ASSERT, "(unsigned)( slot ) < (unsigned)( PlayerASM_AnimSlot::COUNT )", "slot doesn't index PlayerASM_AnimSlot::COUNT\n\t%i not in [0, %i)", v9, 2) )
__debugbreak();
}
packedAnim = ps->animState.slot[v3].packedAnim;
if ( v3 )
{
if ( v3 != 1 || packedAnim < 0x4000 )
goto LABEL_18;
v5 = "slot != PlayerASM_AnimSlot::SECONDARY || anim < MAX_PLAYERANIM_ENTRY_COUNT";
v6 = 535;
v7 = "(slot != PlayerASM_AnimSlot::SECONDARY || anim < (1 << 14))";
}
else
{
if ( packedAnim < 0x4000 )
goto LABEL_18;
v5 = "slot != PlayerASM_AnimSlot::PRIMARY || anim < MAX_PLAYERANIM_ENTRY_COUNT";
v6 = 534;
v7 = "(slot != PlayerASM_AnimSlot::PRIMARY || anim < (1 << 14))";
}
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", v6, ASSERT_TYPE_ASSERT, v7, (const char *)&queryFormat, v5) )
__debugbreak();
LABEL_18:
BG_PlayerASM_VerifyAnim(ps->animState.animSet, packedAnim);
return packedAnim;
}
/*
==============
BG_PlayerASM_GetAnimEntry
==============
*/
char BG_PlayerASM_GetAnimEntry(const PlayerASM_Context *context, int entNum, const scr_string_t stateName, const scr_string_t alias, int *outStateIndex, int *outEntryIndex)
{
const playerState_s *const_ps;
unsigned int Animset;
unsigned int v12;
const Animset *v13;
const char *v14;
const char *v15;
int IndexOfRandomAnimFrom;
const Animset *AnimsetByIndex;
const char *v19;
const char *v20;
const char *v21;
AnimsetState *outState;
const_ps = context->const_ps;
if ( context->useEntityState )
Animset = BG_PlayerASM_GetAnimset((const entityState_t *)const_ps);
else
Animset = BG_PlayerASM_GetAnimset(const_ps);
v12 = Animset;
if ( Animset >= 4 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 239, ASSERT_TYPE_ASSERT, "(unsigned)( animsetIndex ) < (unsigned)( (1 << 2) )", "animsetIndex doesn't index MAX_PLAYERANIM_ANIMSET_COUNT\n\t%i not in [0, %i)", Animset, 4) )
__debugbreak();
outState = NULL;
if ( BG_PlayerASM_GetStateInfoByName(v12, stateName, &outState, outStateIndex) )
{
IndexOfRandomAnimFrom = BG_PlayerASM_GetIndexOfRandomAnimFromAlias<0>(context->holdrand, entNum, v12, outState, alias, 0);
*outEntryIndex = IndexOfRandomAnimFrom;
if ( IndexOfRandomAnimFrom >= 0 )
{
return 1;
}
else
{
AnimsetByIndex = BG_PlayerASM_GetAnimsetByIndex(v12);
if ( !AnimsetByIndex && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 257, ASSERT_TYPE_ASSERT, "(pAnimset)", (const char *)&queryFormat, "pAnimset") )
__debugbreak();
v19 = SL_ConvertToString(AnimsetByIndex->constName);
v20 = SL_ConvertToString(stateName);
v21 = SL_ConvertToString(alias);
Com_Error_impl(ERR_DROP, (const ObfuscateErrorText)&stru_143C93100, 1097i64, v21, v20, v19);
return 0;
}
}
else
{
v13 = BG_PlayerASM_GetAnimsetByIndex(v12);
if ( !v13 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 246, ASSERT_TYPE_ASSERT, "(pAnimset)", (const char *)&queryFormat, "pAnimset") )
__debugbreak();
v14 = SL_ConvertToString(v13->constName);
v15 = SL_ConvertToString(stateName);
Com_Error_impl(ERR_DROP, (const ObfuscateErrorText)&stru_143C930A0, 1096i64, v15, v14);
return 0;
}
}
/*
==============
BG_PlayerASM_GetAnimEntryCount
==============
*/
int BG_PlayerASM_GetAnimEntryCount(const PlayerASM_Context *context, const scr_string_t stateName)
{
bool v3;
const playerState_s *const_ps;
unsigned int Animset;
unsigned int v6;
unsigned int v8;
int v9;
int pOutStateIndex;
AnimsetState *outState;
v3 = !context->useEntityState;
const_ps = context->const_ps;
if ( v3 )
Animset = BG_PlayerASM_GetAnimset(const_ps);
else
Animset = BG_PlayerASM_GetAnimset((const entityState_t *)const_ps);
v6 = Animset;
if ( Animset >= 4 )
{
v9 = 4;
v8 = Animset;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 274, ASSERT_TYPE_ASSERT, "(unsigned)( animsetIndex ) < (unsigned)( (1 << 2) )", "animsetIndex doesn't index MAX_PLAYERANIM_ANIMSET_COUNT\n\t%i not in [0, %i)", v8, v9) )
__debugbreak();
}
BG_PlayerASM_GetStateInfoByName(v6, stateName, &outState, &pOutStateIndex);
if ( outState )
return BG_PlayerASM_GetNumEntriesForStateIndex(v6, pOutStateIndex);
else
return 0;
}
/*
==============
BG_PlayerASM_GetAnimLength
==============
*/
int BG_PlayerASM_GetAnimLength(const playerState_s *ps, const PlayerASM_AnimSlot slot)
{
unsigned int XAnimIndex;
unsigned int v4;
unsigned int Animset;
const XAnim_s *Anims;
unsigned int outAnimPartsIndex;
XAnimIndex = BG_PlayerASM_GetXAnimIndex(ps, slot);
v4 = XAnimIndex;
if ( !XAnimIndex )
return 0;
outAnimPartsIndex = XAnimIndex;
Animset = BG_PlayerASM_GetAnimset(ps);
Anims = BG_PlayerASM_GetAnims(Animset);
if ( !Anims && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 669, ASSERT_TYPE_ASSERT, "(anims)", (const char *)&queryFormat, "anims") )
__debugbreak();
if ( BG_PlayerASM_GetXAnimParts(Anims, v4, &outAnimPartsIndex) )
return XAnimGetLengthMsec(Anims, outAnimPartsIndex);
else
return 0;
}
/*
==============
BG_PlayerASM_GetAnimUser
==============
*/
__int64 BG_PlayerASM_GetAnimUser()
{
BgStatic *ActiveStatics;
__int64 v1;
BG_CheckThread();
ActiveStatics = BgStatic::GetActiveStatics();
v1 = (__int64)ActiveStatics->GetAnimStatics(ActiveStatics);
if ( v1 )
return *(unsigned int *)(v1 + 19544);
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 345, ASSERT_TYPE_ASSERT, "(bgameAnim)", (const char *)&queryFormat, "bgameAnim") )
__debugbreak();
return MEMORY[0x4C58];
}
/*
==============
BG_PlayerASM_GetAnims
==============
*/
XAnim_s *BG_PlayerASM_GetAnims(const unsigned int animsetIndex)
{
__int64 v1;
BgStatic *ActiveStatics;
__int64 v3;
v1 = animsetIndex;
BG_CheckThread();
ActiveStatics = BgStatic::GetActiveStatics();
v3 = (__int64)ActiveStatics->GetAnimStatics(ActiveStatics);
if ( v3 )
return *(XAnim_s **)(v3 + 8 * v1 + 18504);
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 328, ASSERT_TYPE_ASSERT, "(bgameAnim)", (const char *)&queryFormat, "bgameAnim") )
__debugbreak();
return *(XAnim_s **)(8 * v1 + 0x4848);
}
/*
==============
BG_PlayerASM_GetAnimset
==============
*/
unsigned int BG_PlayerASM_GetAnimset(const PlayerASM_Context *context)
{
bool v1;
const playerState_s *const_ps;
v1 = !context->useEntityState;
const_ps = context->const_ps;
if ( v1 )
return BG_PlayerASM_GetAnimset(const_ps);
else
return BG_PlayerASM_GetAnimset((const entityState_t *)const_ps);
}
/*
==============
BG_PlayerASM_GetAnimset
==============
*/
__int64 BG_PlayerASM_GetAnimset(const characterInfo_t *ci)
{
__int64 result;
__int64 v3;
if ( !Com_GameMode_SupportsFeature(WEAPON_SKYDIVE_CUT_CHUTE_LOW) && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 501, ASSERT_TYPE_ASSERT, "(Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION ))", (const char *)&queryFormat, "Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION )") )
__debugbreak();
if ( !ci && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 502, ASSERT_TYPE_ASSERT, "(ci)", (const char *)&queryFormat, "ci") )
__debugbreak();
result = ci->playerASMAnim.animSet;
if ( (unsigned int)result >= 4 )
{
LODWORD(v3) = ci->playerAnim.suitAnimIndex;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 503, ASSERT_TYPE_ASSERT, "(unsigned)( ci->playerASMAnim.animSet ) < (unsigned)( (1 << 2) )", "ci->playerASMAnim.animSet doesn't index MAX_PLAYERANIM_ANIMSET_COUNT\n\t%i not in [0, %i)", v3, 4) )
__debugbreak();
return ci->playerASMAnim.animSet;
}
return result;
}
/*
==============
BG_PlayerASM_GetAnimset
==============
*/
__int64 BG_PlayerASM_GetAnimset(const entityState_t *es)
{
if ( !Com_GameMode_SupportsFeature(WEAPON_SKYDIVE_CUT_CHUTE_LOW) && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 481, ASSERT_TYPE_ASSERT, "(Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION ))", (const char *)&queryFormat, "Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION )") )
__debugbreak();
if ( !es && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 482, ASSERT_TYPE_ASSERT, "(es)", (const char *)&queryFormat, "es") )
__debugbreak();
return (es->animInfo.animData >> 1) & 3;
}
/*
==============
BG_PlayerASM_GetAnimset
==============
*/
__int64 BG_PlayerASM_GetAnimset(const playerState_s *ps)
{
__int64 result;
__int64 v3;
if ( !Com_GameMode_SupportsFeature(WEAPON_SKYDIVE_CUT_CHUTE_LOW) && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 491, ASSERT_TYPE_ASSERT, "(Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION ))", (const char *)&queryFormat, "Com_GameMode_SupportsFeature( Com_GameMode_Feature::PLAYER_ANIMATION )") )
__debugbreak();
if ( !ps && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 492, ASSERT_TYPE_ASSERT, "(ps)", (const char *)&queryFormat, "ps") )
__debugbreak();
result = ps->animState.animSet;
if ( (unsigned int)result >= 4 )
{
LODWORD(v3) = ps->animState.animSet;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 493, ASSERT_TYPE_ASSERT, "(unsigned)( ps->animState.animSet ) < (unsigned)( (1 << 2) )", "ps->animState.animSet doesn't index MAX_PLAYERANIM_ANIMSET_COUNT\n\t%i not in [0, %i)", v3, 4) )
__debugbreak();
return ps->animState.animSet;
}
return result;
}
/*
==============
BG_PlayerASM_GetAnimsetByIndex
==============
*/
const Animset *BG_PlayerASM_GetAnimsetByIndex(unsigned int animsetIndex)
{
__int64 v1;
BgStatic *ActiveStatics;
__int64 v3;
__int64 v4;
v1 = animsetIndex;
BG_CheckThread();
ActiveStatics = BgStatic::GetActiveStatics();
v3 = (__int64)ActiveStatics->GetAnimStatics(ActiveStatics);
v4 = v3;
if ( (unsigned int)v1 < 4 && *(_QWORD *)(v3 + 8 * v1 + 19016) )
return *(const Animset **)(v3 + 8 * v1 + 19016);
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 97, ASSERT_TYPE_ASSERT, "((animsetIndex < (1 << 2)) && bgameAnim->playerAnimset[animsetIndex])", (const char *)&queryFormat, "(animsetIndex < MAX_PLAYERANIM_ANIMSET_COUNT) && bgameAnim->playerAnimset[animsetIndex]") )
__debugbreak();
return *(const Animset **)(v4 + 8 * v1 + 19016);
}
/*
==============
BG_PlayerASM_GetAnimsetIndexByName
==============
*/
__int64 BG_PlayerASM_GetAnimsetIndexByName(scr_string_t animSetName)
{
const char *v1;
bool IndexFromName;
unsigned int v3;
unsigned int outIndex;
v1 = SL_ConvertToString(animSetName);
IndexFromName = NetConstStrings_GetIndexFromName(NETCONSTSTRINGTYPE_PLAYERANIMSET, v1, &outIndex);
v3 = 0;
if ( IndexFromName )
return outIndex;
return v3;
}
/*
==============
BG_PlayerASM_GetAnimsetIndexBySuit
==============
*/
__int64 BG_PlayerASM_GetAnimsetIndexBySuit(unsigned int suitIndex)
{
const SuitDef *SuitDef;
Animset *animsetAsset;
const char *v3;
bool IndexFromName;
unsigned int v5;
unsigned int outIndex;
SuitDef = BG_GetSuitDef(suitIndex);
if ( !SuitDef && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1597, ASSERT_TYPE_ASSERT, "(suitDef)", (const char *)&queryFormat, "suitDef") )
__debugbreak();
animsetAsset = SuitDef->animsetAsset;
if ( !animsetAsset )
{
Com_Error_impl(ERR_DROP, (const ObfuscateErrorText)&stru_143C947C8, 1104i64, SuitDef->name);
animsetAsset = SuitDef->animsetAsset;
}
v3 = SL_ConvertToString(animsetAsset->constName);
IndexFromName = NetConstStrings_GetIndexFromName(NETCONSTSTRINGTYPE_PLAYERANIMSET, v3, &outIndex);
v5 = 0;
if ( IndexFromName )
return outIndex;
return v5;
}
/*
==============
BG_PlayerASM_GetAnimsetName
==============
*/
scr_string_t BG_PlayerASM_GetAnimsetName(const PlayerASM_Context *context)
{
bool v1;
const playerState_s *const_ps;
unsigned int Animset;
unsigned int v4;
v1 = !context->useEntityState;
const_ps = context->const_ps;
if ( v1 )
Animset = BG_PlayerASM_GetAnimset(const_ps);
else
Animset = BG_PlayerASM_GetAnimset((const entityState_t *)const_ps);
v4 = Animset;
if ( Animset >= 4 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 127, ASSERT_TYPE_ASSERT, "(animSet < (1 << 2))", (const char *)&queryFormat, "animSet < MAX_PLAYERANIM_ANIMSET_COUNT") )
__debugbreak();
return BG_PlayerASM_GetAnimsetNameByIndex(v4);
}
/*
==============
BG_PlayerASM_GetAnimsetNameByIndex
==============
*/
__int64 BG_PlayerASM_GetAnimsetNameByIndex(unsigned int animsetIndex)
{
__int64 v1;
BgStatic *ActiveStatics;
__int64 v3;
__int64 v4;
v1 = animsetIndex;
BG_CheckThread();
ActiveStatics = BgStatic::GetActiveStatics();
v3 = (__int64)ActiveStatics->GetAnimStatics(ActiveStatics);
v4 = v3;
if ( (unsigned int)v1 < 4 && *(_QWORD *)(v3 + 8 * v1 + 19016) )
return *(unsigned int *)(*(_QWORD *)(v3 + 8 * v1 + 19016) + 8i64);
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 79, ASSERT_TYPE_ASSERT, "((animsetIndex < (1 << 2)) && bgameAnim->playerAnimset[animsetIndex])", (const char *)&queryFormat, "(animsetIndex < MAX_PLAYERANIM_ANIMSET_COUNT) && bgameAnim->playerAnimset[animsetIndex]") )
__debugbreak();
return *(unsigned int *)(*(_QWORD *)(v4 + 8 * v1 + 19016) + 8i64);
}
/*
==============
BG_PlayerASM_GetAnimsetNameByIndexNetConst
==============
*/
scr_string_t BG_PlayerASM_GetAnimsetNameByIndexNetConst(unsigned int animsetIndex)
{
char *outName;
if ( NetConstStrings_GetNameFromIndex(NETCONSTSTRINGTYPE_PLAYERANIMSET, animsetIndex, (const char **)&outName) )
return SL_FindString(outName);
else
return 0;
}
/*
==============
BG_PlayerASM_GetAnimsetNameBySuit
==============
*/
__int64 BG_PlayerASM_GetAnimsetNameBySuit(unsigned int suitIndex)
{
const SuitDef *SuitDef;
Animset *animsetAsset;
SuitDef = BG_GetSuitDef(suitIndex);
if ( !SuitDef && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1597, ASSERT_TYPE_ASSERT, "(suitDef)", (const char *)&queryFormat, "suitDef") )
__debugbreak();
animsetAsset = SuitDef->animsetAsset;
if ( !animsetAsset )
{
Com_Error_impl(ERR_DROP, (const ObfuscateErrorText)&stru_143C947C8, 1104i64, SuitDef->name);
animsetAsset = SuitDef->animsetAsset;
}
return (unsigned int)animsetAsset->constName;
}
/*
==============
BG_PlayerASM_GetAssetBySuit
==============
*/
const ASM *BG_PlayerASM_GetAssetBySuit(unsigned int suitIndex)
{
const SuitDef *SuitDef;
const ASM *result;
SuitDef = BG_GetSuitDef(suitIndex);
if ( !SuitDef && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1569, ASSERT_TYPE_ASSERT, "(suitDef)", (const char *)&queryFormat, "suitDef") )
__debugbreak();
result = SuitDef->asmAsset;
if ( !result )
{
Com_Error_impl(ERR_DROP, (const ObfuscateErrorText)&stru_143C94780, 1102i64, SuitDef->name);
return SuitDef->asmAsset;
}
return result;
}
/*
==============
BG_PlayerASM_GetAssetNameBySuit
==============
*/
__int64 BG_PlayerASM_GetAssetNameBySuit(unsigned int suitIndex)
{
const SuitDef *SuitDef;
ASM *asmAsset;
SuitDef = BG_GetSuitDef(suitIndex);
if ( !SuitDef && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1583, ASSERT_TYPE_ASSERT, "(suitDef)", (const char *)&queryFormat, "suitDef") )
__debugbreak();
asmAsset = SuitDef->asmAsset;
if ( !asmAsset )
{
Com_Error_impl(ERR_DROP, (const ObfuscateErrorText)&stru_143C94780, 1103i64, SuitDef->name);
asmAsset = SuitDef->asmAsset;
}
return (unsigned int)asmAsset->m_Name;
}
/*
==============
BG_PlayerASM_GetEntityState
==============
*/
playerState_s *BG_PlayerASM_GetEntityState(const PlayerASM_Context *context)
{
if ( context )
return context->ps;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 46, ASSERT_TYPE_ASSERT, "(context)", (const char *)&queryFormat, "context") )
__debugbreak();
return (playerState_s *)MEMORY[0];
}
/*
==============
BG_PlayerASM_GetFingerPoseSlot
==============
*/
PlayerFingerPoseSlot BG_PlayerASM_GetFingerPoseSlot(const unsigned int packedAnimIndex, const unsigned int animsetIndex)
{
const Animset *AnimsetByIndex;
int v4;
AnimsetAnim *ppOutAnim;
unsigned int outAnimState;
unsigned int outAnimEntry;
AnimsetAlias *ppOutAlias;
if ( !packedAnimIndex )
return 0;
BG_PlayerASM_UnpackAnim(animsetIndex, packedAnimIndex, &outAnimState, &outAnimEntry);
AnimsetByIndex = BG_PlayerASM_GetAnimsetByIndex(animsetIndex);
if ( !AnimsetByIndex && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 927, ASSERT_TYPE_ASSERT, "(pAnimset)", (const char *)&queryFormat, "pAnimset") )
__debugbreak();
v4 = outAnimState;
if ( !BG_Animset_GetNumEntriesForStateIndex(AnimsetByIndex, outAnimState) )
return 0;
BG_Animset_GetAliasAndAnimFromStateIndexAndEntry(AnimsetByIndex, v4, outAnimEntry, (const AnimsetAlias **)&ppOutAlias, (const AnimsetAnim **)&ppOutAnim);
if ( !ppOutAlias && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 932, ASSERT_TYPE_ASSERT, "(pAlias)", (const char *)&queryFormat, "pAlias") )
__debugbreak();
return ppOutAlias->u.m_AIAnimsetAlias[8].numRedAnims;
}
/*
==============
BG_PlayerASM_GetPlayerState
==============
*/
playerState_s *BG_PlayerASM_GetPlayerState(const PlayerASM_Context *context)
{
if ( context )
return context->ps;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 53, ASSERT_TYPE_ASSERT, "(context)", (const char *)&queryFormat, "context") )
__debugbreak();
return (playerState_s *)MEMORY[0];
}
/*
==============
BG_PlayerASM_GetVelocityDir
==============
*/
__int64 BG_PlayerASM_GetVelocityDir(const playerState_s *ps, const BgHandler *handler)
{
float v4;
__int128 v5;
float v6;
__int128 v7;
double v11;
double v12;
double v13;
unsigned __int16 v14;
vec2_t vec;
vec3_t inOutPlayerVelocity;
WorldUpReferenceFrame v18;
if ( !PlayerASM_IsEnabled() && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1686, ASSERT_TYPE_ASSERT, "(PlayerASM_IsEnabled())", (const char *)&queryFormat, "PlayerASM_IsEnabled()") )
__debugbreak();
if ( !handler && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1687, ASSERT_TYPE_ASSERT, "(handler)", (const char *)&queryFormat, "handler") )
__debugbreak();
WorldUpReferenceFrame::WorldUpReferenceFrame(&v18, ps, handler);
v4 = ps->velocity.v[1];
inOutPlayerVelocity.v[0] = ps->velocity.v[0];
inOutPlayerVelocity.v[2] = ps->velocity.v[2];
v5 = LODWORD(inOutPlayerVelocity.v[2]);
inOutPlayerVelocity.v[1] = v4;
BG_PlayerSecondaryCollision_ClipToVelocityPlane(ps, &inOutPlayerVelocity);
*(double *)&v5 = WorldUpReferenceFrame::GetForwardContribution(&v18, &inOutPlayerVelocity);
vec.v[0] = *(float *)&v5;
*(double *)&v5 = WorldUpReferenceFrame::GetRightContribution(&v18, &inOutPlayerVelocity);
v7 = v5;
vec.v[1] = *(float *)&v5;
v6 = *(float *)&v5;
*(float *)&v7 = (float)(*(float *)&v5 * *(float *)&v5) + (float)(vec.v[0] * vec.v[0]);
if ( *(float *)&v7 <= 0.0 )
{
*(float *)&v11 = ps->viewangles.v[1];
}
else
{
*(float *)&v7 = fsqrt(*(float *)&v7);
_XMM3 = v7;
__asm
{
vcmpless xmm1, xmm3, cs:__real@80000000
vblendvps xmm0, xmm3, xmm2, xmm1
}
vec.v[1] = v6 * (float)(1.0 / *(float *)&_XMM0);
vec.v[0] = vec.v[0] * (float)(1.0 / *(float *)&_XMM0);
v11 = vectoyaw(&vec);
}
v12 = AngleNormalize360(*(const float *)&v11);
v13 = I_fclamp(*(float *)&v12, 0.0, 360.0);
v14 = BG_DegreesToMovementDir(*(float *)&v13);
if ( (unsigned __int8)v14 != v14 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1714, ASSERT_TYPE_ASSERT, "((velocityDir & ((1 << 8) - 1)) == velocityDir)", (const char *)&queryFormat, "(velocityDir & ((1 << MOVEMENTDIR_BITS) - 1)) == velocityDir") )
__debugbreak();
return v14;
}
/*
==============
BG_PlayerASM_GetXAnimLength
==============
*/
__int64 BG_PlayerASM_GetXAnimLength(const XAnimParts *parts, const float rate)
{
__int64 v3;
float v4;
if ( !parts && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 641, ASSERT_TYPE_ASSERT, "(parts)", (const char *)&queryFormat, "parts") )
__debugbreak();
LODWORD(v3) = XAnimGetLengthFromPartsMsec(parts);
if ( (unsigned int)v3 < 0x32 )
v3 = 50i64;
v4 = (float)v3;
return (unsigned int)(10 * (int)(float)(v4 / rate));
}
/*
==============
BG_PlayerASM_GetXAnimParts
==============
*/
const XAnimParts *BG_PlayerASM_GetXAnimParts(const XAnim_s *const anims, unsigned int animIndex, unsigned int *outAnimPartsIndex)
{
const XAnimParts *Parts;
const XAnimParts *result;
unsigned int ChildAt;
if ( animIndex >= anims->size && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 605, ASSERT_TYPE_ASSERT, "(unsigned)( animIndex ) < (unsigned)( anims->size )", "animIndex doesn't index anims->size\n\t%i not in [0, %i)", animIndex, anims->size) )
__debugbreak();
if ( XAnimIsLeafNode(anims, animIndex) )
{
Parts = XAnimGetParts(anims, animIndex);
if ( !Parts && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 613, ASSERT_TYPE_ASSERT, "(parts)", (const char *)&queryFormat, "parts") )
__debugbreak();
result = Parts;
if ( outAnimPartsIndex )
*outAnimPartsIndex = animIndex;
}
else if ( XAnimGetNumChildren(anims, animIndex) > 0 && (ChildAt = XAnimGetChildAt(anims, animIndex, 0), XAnimIsLeafNode(anims, ChildAt)) )
{
result = XAnimGetParts(anims, ChildAt);
if ( outAnimPartsIndex )
*outAnimPartsIndex = ChildAt;
}
else
{
return 0i64;
}
return result;
}
/*
==============
BG_PlayerASM_HasAnimAlias
==============
*/
bool BG_PlayerASM_HasAnimAlias(const PlayerASM_Context *context, const scr_string_t stateName, const scr_string_t aliasName)
{
int v3;
bool v4;
const playerState_s *const_ps;
unsigned int Animset;
unsigned int v9;
const Animset *AnimsetByIndex;
const char *v11;
const char *v12;
unsigned int numAnimAliases;
AnimsetAlias *animAliases;
__int64 v16;
unsigned int v17;
__int64 v18;
int v19;
int pOutStateIndex;
AnimsetState *outState;
v3 = 0;
v4 = !context->useEntityState;
outState = NULL;
const_ps = context->const_ps;
if ( v4 )
Animset = BG_PlayerASM_GetAnimset(const_ps);
else
Animset = BG_PlayerASM_GetAnimset((const entityState_t *)const_ps);
v9 = Animset;
if ( Animset >= 4 )
{
v19 = 4;
v17 = Animset;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 294, ASSERT_TYPE_ASSERT, "(unsigned)( animsetIndex ) < (unsigned)( (1 << 2) )", "animsetIndex doesn't index MAX_PLAYERANIM_ANIMSET_COUNT\n\t%i not in [0, %i)", v17, v19) )
__debugbreak();
}
if ( !BG_PlayerASM_GetStateInfoByName(v9, stateName, &outState, &pOutStateIndex) )
{
AnimsetByIndex = BG_PlayerASM_GetAnimsetByIndex(v9);
if ( v9 >= 4 )
{
LODWORD(v18) = 4;
LODWORD(v16) = v9;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 301, ASSERT_TYPE_ASSERT, "(unsigned)( animsetIndex ) < (unsigned)( (1 << 2) )", "animsetIndex doesn't index MAX_PLAYERANIM_ANIMSET_COUNT\n\t%i not in [0, %i)", v16, v18) )
__debugbreak();
}
v11 = SL_ConvertToString(AnimsetByIndex->constName);
v12 = SL_ConvertToString(stateName);
Com_Error_impl(ERR_DROP, (const ObfuscateErrorText)&stru_143C93170, 1098i64, v12, v11);
}
numAnimAliases = outState->numAnimAliases;
if ( !numAnimAliases )
return 0;
animAliases = outState->animAliases;
while ( animAliases[v3].name != aliasName )
{
if ( ++v3 >= numAnimAliases )
return 0;
}
return animAliases[v3].numAnims != 0;
}
/*
==============
BG_PlayerASM_IsAdsAlias
==============
*/
int BG_PlayerASM_IsAdsAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
unsigned int moveTypes[2];
__int64 v4;
__int64 v5;
__int64 v6;
moveTypes[1] = 0;
moveTypes[0] = 469763070;
v4 = 0i64;
v5 = 0i64;
v6 = 0i64;
return BG_PlayerASM_DoesAliasHaveAnyMoveTypes(packedAnimIndex, animSet, moveTypes);
}
/*
==============
BG_PlayerASM_IsAirAlias
==============
*/
int BG_PlayerASM_IsAirAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
unsigned int moveTypes[2];
__int64 v4;
__int64 v5;
__int64 v6;
moveTypes[0] = 0;
moveTypes[1] = 4;
v4 = 0i64;
v5 = 0i64;
v6 = 0i64;
return BG_PlayerASM_DoesAliasHaveAnyMoveTypes(packedAnimIndex, animSet, moveTypes);
}
/*
==============
BG_PlayerASM_IsAnimEntryValid
==============
*/
bool BG_PlayerASM_IsAnimEntryValid(const Animset *pAnimset, const unsigned int stateIndex, const unsigned int entryIndex)
{
return entryIndex < BG_Animset_GetNumEntriesForStateIndex(pAnimset, stateIndex);
}
/*
==============
BG_PlayerASM_IsAnimRestart
==============
*/
bool BG_PlayerASM_IsAnimRestart(const Animset *pAnimset, const unsigned int animstateIndex, const unsigned int animEntryIndex, const unsigned int lastAnimstateIndex, const unsigned int lastAnimEntryIndex)
{
bool result;
AnimsetAlias *ppOutAlias;
AnimsetAlias *v11;
AnimsetAnim *ppOutAnim;
AnimsetAnim *v13;
ppOutAnim = NULL;
ppOutAlias = NULL;
v13 = NULL;
v11 = NULL;
result = 0;
if ( animstateIndex != -1 && animEntryIndex != -1 && lastAnimstateIndex != -1 && lastAnimEntryIndex != -1 && animEntryIndex < BG_Animset_GetNumEntriesForStateIndex(pAnimset, animstateIndex) && lastAnimEntryIndex < BG_Animset_GetNumEntriesForStateIndex(pAnimset, lastAnimstateIndex) && animstateIndex == lastAnimstateIndex )
{
BG_Animset_GetAliasAndAnimFromStateIndexAndEntry(pAnimset, animstateIndex, animEntryIndex, (const AnimsetAlias **)&ppOutAlias, (const AnimsetAnim **)&ppOutAnim);
BG_Animset_GetAliasAndAnimFromStateIndexAndEntry(pAnimset, lastAnimstateIndex, lastAnimEntryIndex, (const AnimsetAlias **)&v11, (const AnimsetAnim **)&v13);
if ( ppOutAlias )
{
if ( v11 && ppOutAlias == v11 && (*(_QWORD *)&ppOutAlias->u.m_AIAnimsetAlias->numRedAnims & 0x8000000000i64) != 0 && ppOutAnim && v13 )
return 1;
}
}
return result;
}
/*
==============
BG_PlayerASM_IsClearSyncGroupAlias
==============
*/
_BOOL8 BG_PlayerASM_IsClearSyncGroupAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x2000000000ui64);
}
/*
==============
BG_PlayerASM_IsCrouchingAlias
==============
*/
int BG_PlayerASM_IsCrouchingAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
unsigned int moveTypes[2];
__int64 v4;
__int64 v5;
__int64 v6;
moveTypes[1] = 0;
moveTypes[0] = 12484;
v4 = 0i64;
v5 = 0i64;
v6 = 0i64;
return BG_PlayerASM_DoesAliasHaveAnyMoveTypes(packedAnimIndex, animSet, moveTypes);
}
/*
==============
BG_PlayerASM_IsDeathAlias
==============
*/
_BOOL8 BG_PlayerASM_IsDeathAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x80ui64);
}
/*
==============
BG_PlayerASM_IsDropWeaponAlias
==============
*/
_BOOL8 BG_PlayerASM_IsDropWeaponAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x2000ui64);
}
/*
==============
BG_PlayerASM_IsExecutionAttackerAlias
==============
*/
_BOOL8 BG_PlayerASM_IsExecutionAttackerAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x200000000ui64);
}
/*
==============
BG_PlayerASM_IsExecutionVictimAlias
==============
*/
_BOOL8 BG_PlayerASM_IsExecutionVictimAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x400000000ui64);
}
/*
==============
BG_PlayerASM_IsFiringAlias
==============
*/
_BOOL8 BG_PlayerASM_IsFiringAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 8ui64);
}
/*
==============
BG_PlayerASM_IsGestureAlias
==============
*/
_BOOL8 BG_PlayerASM_IsGestureAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x4000000ui64);
}
/*
==============
BG_PlayerASM_IsKillstreakTriggerAlias
==============
*/
_BOOL8 BG_PlayerASM_IsKillstreakTriggerAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x4000ui64);
}
/*
==============
BG_PlayerASM_IsKnockbackAlias
==============
*/
int BG_PlayerASM_IsKnockbackAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
unsigned int moveTypes[2];
__int64 v4;
__int64 v5;
__int64 v6;
moveTypes[0] = 0;
moveTypes[1] = 24;
v4 = 0i64;
v5 = 0i64;
v6 = 0i64;
return BG_PlayerASM_DoesAliasHaveAnyMoveTypes(packedAnimIndex, animSet, moveTypes);
}
/*
==============
BG_PlayerASM_IsLadderAimAlias
==============
*/
_BOOL8 BG_PlayerASM_IsLadderAimAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x100000000ui64);
}
/*
==============
BG_PlayerASM_IsLadderAlias
==============
*/
_BOOL8 BG_PlayerASM_IsLadderAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 2ui64);
}
/*
==============
BG_PlayerASM_IsLadderSlideAlias
==============
*/
int BG_PlayerASM_IsLadderSlideAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
unsigned int moveTypes[2];
__int64 v4;
__int64 v5;
__int64 v6;
moveTypes[1] = 0;
moveTypes[0] = 0x8000;
v4 = 0i64;
v5 = 0i64;
v6 = 0i64;
return BG_PlayerASM_DoesAliasHaveAnyMoveTypes(packedAnimIndex, animSet, moveTypes);
}
/*
==============
BG_PlayerASM_IsMeleeExecutionAttackerAlias
==============
*/
_BOOL8 BG_PlayerASM_IsMeleeExecutionAttackerAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x200000000ui64);
}
/*
==============
BG_PlayerASM_IsMeleeExecutionVictimAlias
==============
*/
_BOOL8 BG_PlayerASM_IsMeleeExecutionVictimAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x400000000ui64);
}
/*
==============
BG_PlayerASM_IsMoveBackwardAlias
==============
*/
int BG_PlayerASM_IsMoveBackwardAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
unsigned int moveTypes[2];
__int64 v4;
__int64 v5;
__int64 v6;
moveTypes[1] = 0;
moveTypes[0] = 10912;
v4 = 0i64;
v5 = 0i64;
v6 = 0i64;
return BG_PlayerASM_DoesAliasHaveAnyMoveTypes(packedAnimIndex, animSet, moveTypes);
}
/*
==============
BG_PlayerASM_IsMoveForwardAlias
==============
*/
int BG_PlayerASM_IsMoveForwardAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
unsigned int moveTypes[2];
__int64 v4;
__int64 v5;
__int64 v6;
moveTypes[1] = 0;
moveTypes[0] = 922960;
v4 = 0i64;
v5 = 0i64;
v6 = 0i64;
return BG_PlayerASM_DoesAliasHaveAnyMoveTypes(packedAnimIndex, animSet, moveTypes);
}
/*
==============
BG_PlayerASM_IsNoAimingAlias
==============
*/
_BOOL8 BG_PlayerASM_IsNoAimingAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x800000000ui64);
}
/*
==============
BG_PlayerASM_IsNoAimingIfProneAlias
==============
*/
_BOOL8 BG_PlayerASM_IsNoAimingIfProneAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x8000ui64);
}
/*
==============
BG_PlayerASM_IsNoPitchAimingAlias
==============
*/
_BOOL8 BG_PlayerASM_IsNoPitchAimingAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x10000ui64);
}
/*
==============
BG_PlayerASM_IsOnLadder
==============
*/
bool BG_PlayerASM_IsOnLadder(const characterInfo_t *ci)
{
unsigned int Animset;
unsigned int Anim;
BOOL HaveAnyFlags;
if ( !ci && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 2102, ASSERT_TYPE_ASSERT, "(ci)", (const char *)&queryFormat, "ci") )
__debugbreak();
if ( PlayerASM_IsEnabled() )
{
Animset = BG_PlayerASM_GetAnimset(ci);
Anim = BG_PlayerASM_GetAnim(ci, MOVEMENT);
if ( BG_PlayerASM_DoesAliasHaveAnyFlags(Anim, Animset, 2ui64) || (HaveAnyFlags = BG_PlayerASM_DoesAliasHaveAnyFlags(Anim, Animset, 0x100000000ui64)) )
LOBYTE(HaveAnyFlags) = 1;
}
else
{
LOBYTE(HaveAnyFlags) = 0;
}
return HaveAnyFlags;
}
/*
==============
BG_PlayerASM_IsPrepareAlias
==============
*/
_BOOL8 BG_PlayerASM_IsPrepareAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x1000ui64);
}
/*
==============
BG_PlayerASM_IsProneAlias
==============
*/
int BG_PlayerASM_IsProneAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
unsigned int moveTypes[2];
__int64 v4;
__int64 v5;
__int64 v6;
moveTypes[1] = 0;
moveTypes[0] = 776;
v4 = 0i64;
v5 = 0i64;
v6 = 0i64;
return BG_PlayerASM_DoesAliasHaveAnyMoveTypes(packedAnimIndex, animSet, moveTypes);
}
/*
==============
BG_PlayerASM_IsRaiseWeaponAlias
==============
*/
_BOOL8 BG_PlayerASM_IsRaiseWeaponAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x10000000000ui64);
}
/*
==============
BG_PlayerASM_IsReloadAlias
==============
*/
_BOOL8 BG_PlayerASM_IsReloadAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x10ui64);
}
/*
==============
BG_PlayerASM_IsRocketHideShowAlias
==============
*/
_BOOL8 BG_PlayerASM_IsRocketHideShowAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x4000000000ui64);
}
/*
==============
BG_PlayerASM_IsRootMotionAlias
==============
*/
_BOOL8 BG_PlayerASM_IsRootMotionAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x20000ui64);
}
/*
==============
BG_PlayerASM_IsSceneAlias
==============
*/
_BOOL8 BG_PlayerASM_IsSceneAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x20000000ui64);
}
/*
==============
BG_PlayerASM_IsSceneSkipDoneEventAlias
==============
*/
_BOOL8 BG_PlayerASM_IsSceneSkipDoneEventAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x20000000000ui64);
}
/*
==============
BG_PlayerASM_IsSlideAlias
==============
*/
int BG_PlayerASM_IsSlideAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
unsigned int moveTypes[2];
__int64 v4;
__int64 v5;
__int64 v6;
moveTypes[1] = 0;
moveTypes[0] = 0x1000000;
v4 = 0i64;
v5 = 0i64;
v6 = 0i64;
return BG_PlayerASM_DoesAliasHaveAnyMoveTypes(packedAnimIndex, animSet, moveTypes);
}
/*
==============
BG_PlayerASM_IsSprintAlias
==============
*/
int BG_PlayerASM_IsSprintAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
unsigned int moveTypes[2];
__int64 v4;
__int64 v5;
__int64 v6;
moveTypes[1] = 0;
moveTypes[0] = 786432;
v4 = 0i64;
v5 = 0i64;
v6 = 0i64;
return BG_PlayerASM_DoesAliasHaveAnyMoveTypes(packedAnimIndex, animSet, moveTypes);
}
/*
==============
BG_PlayerASM_IsStopAlias
==============
*/
_BOOL8 BG_PlayerASM_IsStopAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x1000000000ui64);
}
/*
==============
BG_PlayerASM_IsStrafeAlias
==============
*/
_BOOL8 BG_PlayerASM_IsStrafeAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x60ui64);
}
/*
==============
BG_PlayerASM_IsSyncAnim
==============
*/
bool BG_PlayerASM_IsSyncAnim(const XAnim_s *baseAnims, unsigned int graftIndex, const XAnim_s *subtreeAnims, unsigned int animIndex, XAnimSyncGroupID *outSyncGroupID, const XAnim_s **outSyncRootAnims, unsigned int *outSyncRoot)
{
__int64 v7;
__int64 v9;
const XAnim_s *v11;
__int64 v12;
char v13;
__int64 v14;
bool result;
char v16;
__int64 v17;
v7 = animIndex;
v9 = graftIndex;
if ( !baseAnims && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 681, ASSERT_TYPE_ASSERT, "(baseAnims)", (const char *)&queryFormat, "baseAnims") )
__debugbreak();
if ( (_DWORD)v9 && (unsigned int)v9 > baseAnims->size && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 682, ASSERT_TYPE_ASSERT, "(graftIndex == 0 || graftIndex <= baseAnims->size)", (const char *)&queryFormat, "graftIndex == XANIM_DEFAULT_GRAFT_ANIM_INDEX || graftIndex <= baseAnims->size") )
__debugbreak();
if ( subtreeAnims && (unsigned int)v7 > subtreeAnims->size && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 683, ASSERT_TYPE_ASSERT, "(!subtreeAnims || animIndex <= subtreeAnims->size)", (const char *)&queryFormat, "!subtreeAnims || animIndex <= subtreeAnims->size") )
__debugbreak();
if ( !outSyncGroupID && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 684, ASSERT_TYPE_ASSERT, "(outSyncGroupID)", (const char *)&queryFormat, "outSyncGroupID") )
__debugbreak();
if ( !outSyncRootAnims && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 685, ASSERT_TYPE_ASSERT, "(outSyncRootAnims)", (const char *)&queryFormat, "outSyncRootAnims") )
__debugbreak();
if ( !outSyncRoot && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 686, ASSERT_TYPE_ASSERT, "(outSyncRoot)", (const char *)&queryFormat, "outSyncRoot") )
__debugbreak();
*(_BYTE *)outSyncGroupID = 4;
*outSyncRootAnims = NULL;
v11 = baseAnims;
*outSyncRoot = 0;
if ( subtreeAnims )
v11 = subtreeAnims;
if ( XAnimIsLeafNode(v11, v7) && (_DWORD)v7 )
LODWORD(v7) = v11->entries[v7].parent;
v12 = (unsigned int)v7;
if ( ((__int64)v11->entries[v12].parts & 3) == 0 )
{
if ( !subtreeAnims )
return 0;
if ( XAnimIsLeafNode(baseAnims, v9) && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 731, ASSERT_TYPE_ASSERT, "(!XAnimIsLeafNode( baseAnims, graftIndex ))", (const char *)&queryFormat, "!XAnimIsLeafNode( baseAnims, graftIndex )") )
__debugbreak();
if ( ((__int64)baseAnims->entries[v9].parts & 3) == 0 )
return 0;
v16 = baseAnims->entries[v9].animParent.syncGroup[0];
*(_BYTE *)outSyncGroupID = v16;
if ( v16 == 4 && (_DWORD)v9 )
{
while ( 1 )
{
v17 = (unsigned int)v9;
if ( ((__int64)baseAnims->entries[v17].parts & 4) != 0 )
break;
LODWORD(v9) = baseAnims->entries[v17].parent;
if ( !baseAnims->entries[v17].parent )
return 1;
}
*outSyncRootAnims = baseAnims;
*outSyncRoot = v9;
}
return 1;
}
v13 = v11->entries[v12].animParent.syncGroup[0];
*(_BYTE *)outSyncGroupID = v13;
if ( v13 != 4 || !(_DWORD)v7 )
return 1;
while ( 1 )
{
v14 = (unsigned int)v7;
if ( ((__int64)v11->entries[v14].parts & 4) != 0 )
break;
LODWORD(v7) = v11->entries[v14].parent;
if ( !v11->entries[v14].parent )
return 1;
}
*outSyncRootAnims = v11;
result = 1;
*outSyncRoot = v7;
return result;
}
/*
==============
BG_PlayerASM_IsThrowAlias
==============
*/
_BOOL8 BG_PlayerASM_IsThrowAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x800ui64);
}
/*
==============
BG_PlayerASM_IsThrowOrPrepareAlias
==============
*/
_BOOL8 BG_PlayerASM_IsThrowOrPrepareAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x1800ui64);
}
/*
==============
BG_PlayerASM_IsTransitionalAlias
==============
*/
_BOOL8 BG_PlayerASM_IsTransitionalAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x40000ui64);
}
/*
==============
BG_PlayerASM_IsTurnAlias
==============
*/
_BOOL8 BG_PlayerASM_IsTurnAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 0x200000ui64);
}
/*
==============
BG_PlayerASM_IsTurretAlias
==============
*/
_BOOL8 BG_PlayerASM_IsTurretAlias(const unsigned int packedAnimIndex, const unsigned int animSet)
{
return BG_PlayerASM_DoesAliasHaveAnyFlags(packedAnimIndex, animSet, 4ui64);
}
/*
==============
BG_PlayerASM_IsUpdateNeededForFunction
==============
*/
char BG_PlayerASM_IsUpdateNeededForFunction(const ASM_Context *context, const ASM_Instance *pInst, PlayerASM_Parameters *parameters, const ASM_Transition *pTransition, const ASM_Function *pFunc)
{
const dvar_t *v7;
unsigned __int8 m_Flags;
char v9;
char v10;
characterInfo_t *ci;
char v12;
const PlayerASM_Instance *PlayerASMInstance;
const char *v15;
const char *v16;
if ( !pTransition && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 2032, ASSERT_TYPE_ASSERT, "(pTransition)", (const char *)&queryFormat, "pTransition") )
__debugbreak();
if ( !pFunc && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 2033, ASSERT_TYPE_ASSERT, "(pFunc)", (const char *)&queryFormat, "pFunc") )
__debugbreak();
v7 = DCONST_DVARBOOL_playerasm_enableConditionMask;
if ( !DCONST_DVARBOOL_playerasm_enableConditionMask && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\universal\\dvar.h", 692, ASSERT_TYPE_ASSERT, "(dvar)", "%s\n\tDvar %s accessed after deregistration", "dvar", "playerasm_enableConditionMask") )
__debugbreak();
Dvar_CheckFrontendServerThread(v7);
if ( !v7->current.enabled )
return 1;
m_Flags = pFunc->m_Flags;
v9 = m_Flags & 1;
if ( (m_Flags & 2) != 0 )
return 1;
v10 = m_Flags & 4;
if ( !v9 && !v10 )
return 1;
if ( pFunc->m_NumParams > 0 && pFunc->m_bNegate )
return 1;
ci = parameters->ci;
if ( !ci && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 2063, ASSERT_TYPE_ASSERT, "(ci)", (const char *)&queryFormat, "ci") )
__debugbreak();
v12 = 0;
if ( v9 && ci->clientEvents.hasEvents )
v12 = 1;
if ( v10 )
{
PlayerASMInstance = GetPlayerASMInstance(pInst);
if ( !PlayerASMInstance && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 2076, ASSERT_TYPE_ASSERT, "(playerInst)", (const char *)&queryFormat, "playerInst") )
__debugbreak();
if ( PlayerASMInstance->m_NumEvents )
return 1;
}
if ( !v12 && Dvar_GetInt_Internal_DebugName(DVARINT_playerasm_condition_mask_debug, "playerasm_condition_mask_debug") == 2 )
{
v15 = "Server";
if ( ci->pXAnimTree->owner[0] == 1 )
v15 = "Client";
v16 = SL_ConvertToString(parameters->stateName);
Com_PrintWarning(19, "PlayerASM: Skipped transition function: '%s' on state '%s' on '%s'.\n", s_PlayerASMBuiltinFuncs_3[pFunc->m_FuncID].m_Name, v16, v15);
}
return v12;
}
/*
==============
BG_PlayerASM_LookupAnimFromAlias
==============
*/
__int64 BG_PlayerASM_LookupAnimFromAlias(const PlayerASM_Context *context, BgPlayer_Asm *pAsm, int entNum, const scr_string_t stateName, const scr_string_t alias)
{
int outEntryIndex;
int outStateIndex[5];
BG_PlayerASM_GetAnimEntry(context, entNum, stateName, alias, outStateIndex, &outEntryIndex);
return (unsigned int)outEntryIndex;
}
/*
==============
BG_PlayerASM_PackAnim
==============
*/
__int64 BG_PlayerASM_PackAnim(const unsigned int animsetIndex, const unsigned int animState, const unsigned int animEntry)
{
__int64 v3;
const Animset *AnimsetByIndex;
unsigned int NumEntriesForStateIndex;
Animset_Union v8;
__int64 v10;
__int64 v11;
v3 = animState;
if ( animsetIndex >= 4 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 353, ASSERT_TYPE_ASSERT, "(unsigned)( animsetIndex ) < (unsigned)( (1 << 2) )", "animsetIndex doesn't index MAX_PLAYERANIM_ANIMSET_COUNT\n\t%i not in [0, %i)", animsetIndex, 4) )
__debugbreak();
AnimsetByIndex = BG_PlayerASM_GetAnimsetByIndex(animsetIndex);
if ( !AnimsetByIndex && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 356, ASSERT_TYPE_ASSERT, "(animset)", (const char *)&queryFormat, "animset") )
__debugbreak();
if ( AnimsetByIndex->mode != ASM_MODE_PLAYER && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 357, ASSERT_TYPE_ASSERT, "(animset->mode == ASM_MODE_PLAYER)", (const char *)&queryFormat, "animset->mode == ASM_MODE_PLAYER") )
__debugbreak();
if ( (unsigned int)v3 >= LOWORD(AnimsetByIndex->u.m_AIAnimset->coverLeftOffset.leanYaw) )
{
LODWORD(v11) = LOWORD(AnimsetByIndex->u.m_AIAnimset->coverLeftOffset.leanYaw);
LODWORD(v10) = v3;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 358, ASSERT_TYPE_ASSERT, "(unsigned)( animState ) < (unsigned)( animset->u.m_PlayerAnimset->numPackMapEntries )", "animState doesn't index animset->u.m_PlayerAnimset->numPackMapEntries\n\t%i not in [0, %i)", v10, v11) )
__debugbreak();
}
NumEntriesForStateIndex = BG_PlayerASM_GetNumEntriesForStateIndex(animsetIndex, v3);
if ( NumEntriesForStateIndex && animEntry >= NumEntriesForStateIndex && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 362, ASSERT_TYPE_ASSERT, "(!numAnims || animEntry < numAnims)", (const char *)&queryFormat, "!numAnims || animEntry < numAnims") )
__debugbreak();
v8.m_AIAnimset = (AIAnimset *)AnimsetByIndex->u;
if ( animEntry + *(unsigned __int16 *)(*(_QWORD *)v8.m_AIAnimset + 2 * v3) >= LOWORD(v8.m_AIAnimset->coverLeftCrouchOffset.leanYaw) )
{
LODWORD(v11) = LOWORD(v8.m_AIAnimset->coverLeftCrouchOffset.leanYaw);
LODWORD(v10) = animEntry + *(unsigned __int16 *)(*(_QWORD *)v8.m_AIAnimset + 2 * v3);
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 364, ASSERT_TYPE_ASSERT, "(unsigned)( animset->u.m_PlayerAnimset->packMap[animState] + animEntry ) < (unsigned)( animset->u.m_PlayerAnimset->numUnpackMapEntries )", "animset->u.m_PlayerAnimset->packMap[animState] + animEntry doesn't index animset->u.m_PlayerAnimset->numUnpackMapEntries\n\t%i not in [0, %i)", v10, v11) )
__debugbreak();
}
if ( LOWORD(AnimsetByIndex->u.m_AIAnimset->coverLeftCrouchOffset.leanYaw) > 0x4000u && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 365, ASSERT_TYPE_ASSERT, "(animset->u.m_PlayerAnimset->numUnpackMapEntries <= (1 << 14))", (const char *)&queryFormat, "animset->u.m_PlayerAnimset->numUnpackMapEntries <= MAX_PLAYERANIM_ENTRY_COUNT") )
__debugbreak();
if ( AnimsetByIndex->mode != ASM_MODE_PLAYER && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 367, ASSERT_TYPE_ASSERT, "(animset->mode == ASM_MODE_PLAYER)", (const char *)&queryFormat, "animset->mode == ASM_MODE_PLAYER") )
__debugbreak();
return *(unsigned __int16 *)(*(_QWORD *)AnimsetByIndex->u.m_AIAnimset + 2 * v3) + animEntry + 1;
}
/*
==============
BG_PlayerASM_SetAnimState
==============
*/
void BG_PlayerASM_SetAnimState(const PlayerASM_Context *context, BgPlayer_Asm *pAsm, int entNum, const scr_string_t asmName, scr_string_t stateName, int entryIndex, int gameTime, float animRate, PlayerASM_AnimSlot slot)
{
const playerState_s *const_ps;
unsigned int Animset;
unsigned int v12;
scr_string_t v13;
const Animset *AnimsetByIndex;
const char *v15;
const char *v16;
int v17;
const Animset *v18;
const char *v19;
const char *v20;
const char *v21;
unsigned __int8 v22;
AnimsetState *outState;
int pOutStateIndex;
const_ps = context->const_ps;
if ( context->useEntityState )
Animset = BG_PlayerASM_GetAnimset((const entityState_t *)const_ps);
else
Animset = BG_PlayerASM_GetAnimset(const_ps);
v12 = Animset;
if ( Animset >= 4 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1491, ASSERT_TYPE_ASSERT, "(unsigned)( animsetIndex ) < (unsigned)( (1 << 2) )", "animsetIndex doesn't index MAX_PLAYERANIM_ANIMSET_COUNT\n\t%i not in [0, %i)", Animset, 4) )
__debugbreak();
v13 = stateName;
if ( !BG_PlayerASM_GetStateInfoByName(v12, stateName, &outState, &pOutStateIndex) )
{
AnimsetByIndex = BG_PlayerASM_GetAnimsetByIndex(v12);
v15 = SL_ConvertToString(AnimsetByIndex->constName);
v16 = SL_ConvertToString(v13);
Com_Error_impl(ERR_DROP, (const ObfuscateErrorText)&stru_143C94530, 1099i64, v16, v15);
}
v17 = entryIndex;
if ( entryIndex < 0 || v17 > BG_PlayerASM_GetNumEntriesForStateIndex(v12, pOutStateIndex) )
{
v18 = BG_PlayerASM_GetAnimsetByIndex(v12);
v19 = SL_ConvertToString(v18->constName);
v20 = SL_ConvertToString(v13);
Com_Error_impl(ERR_DROP, (const ObfuscateErrorText)&stru_143C94580, 1100i64, (unsigned int)v17, v20, v19);
}
if ( !outState->u.m_AIAnimsetState && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1510, ASSERT_TYPE_ASSERT, "(pAnimsetState->u.m_PlayerAnimsetState)", (const char *)&queryFormat, "pAnimsetState->u.m_PlayerAnimsetState") )
__debugbreak();
if ( outState->u.m_AIAnimsetState[80] )
{
v21 = SL_ConvertToString(v13);
Com_Error_impl(ERR_DROP, (const ObfuscateErrorText)&stru_143C94680, 5711i64, v21);
}
v22 = slot;
if ( (_BYTE)slot == COUNT && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1517, ASSERT_TYPE_ASSERT, "(slot != PlayerASM_AnimSlot::INVALID)", (const char *)&queryFormat, "slot != PlayerASM_AnimSlot::INVALID") )
__debugbreak();
BG_PlayerASM_SetState(context, (const PlayerASM_AnimSlot)v22, pOutStateIndex, v17);
}
/*
==============
BG_PlayerASM_SetState
==============
*/
void BG_PlayerASM_SetState(const PlayerASM_Context *context, const PlayerASM_AnimSlot animSlot, const unsigned int animState, const unsigned int animEntry)
{
unsigned __int8 v6;
const playerState_s *const_ps;
unsigned int Animset;
unsigned int v10;
unsigned int NumEntriesForStateIndex;
scr_string_t AnimsetNameByIndex;
scr_string_t v13;
unsigned int v14;
playerState_s *ps;
const char *v16;
int v17;
const char *v18;
unsigned int packedAnim;
unsigned int v20;
__int64 v21;
__int64 v22;
unsigned int inOutTimer;
v6 = animSlot;
if ( animState >= 0x400 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1384, ASSERT_TYPE_ASSERT, "(unsigned)( animState ) < (unsigned)( (1 << 10) )", "animState doesn't index MAX_ANIM_STATE_COUNT\n\t%i not in [0, %i)", animState, 1024) )
__debugbreak();
const_ps = context->const_ps;
if ( context->useEntityState )
Animset = BG_PlayerASM_GetAnimset((const entityState_t *)const_ps);
else
Animset = BG_PlayerASM_GetAnimset(const_ps);
v10 = Animset;
if ( Animset >= 4 )
{
LODWORD(v22) = 4;
LODWORD(v21) = Animset;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1387, ASSERT_TYPE_ASSERT, "(unsigned)( animsetIndex ) < (unsigned)( (1 << 2) )", "animsetIndex doesn't index MAX_PLAYERANIM_ANIMSET_COUNT\n\t%i not in [0, %i)", v21, v22) )
__debugbreak();
}
NumEntriesForStateIndex = BG_PlayerASM_GetNumEntriesForStateIndex(v10, animState);
AnimsetNameByIndex = BG_PlayerASM_GetAnimsetNameByIndex(v10);
if ( animState >= BG_Animset_GetNumStates(AnimsetNameByIndex) )
{
v13 = BG_PlayerASM_GetAnimsetNameByIndex(v10);
LODWORD(v22) = BG_Animset_GetNumStates(v13);
LODWORD(v21) = animState;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1391, ASSERT_TYPE_ASSERT, "(unsigned)( animState ) < (unsigned)( BG_Animset_GetNumStates( BG_PlayerASM_GetAnimsetNameByIndex( animsetIndex ) ) )", "animState doesn't index BG_Animset_GetNumStates( BG_PlayerASM_GetAnimsetNameByIndex( animsetIndex ) )\n\t%i not in [0, %i)", v21, v22) )
__debugbreak();
}
if ( NumEntriesForStateIndex && animEntry >= NumEntriesForStateIndex && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1392, ASSERT_TYPE_ASSERT, "(!numAnims || animEntry < numAnims)", (const char *)&queryFormat, "!numAnims || animEntry < numAnims") )
__debugbreak();
v14 = BG_PlayerASM_PackAnim(v10, animState, animEntry);
ps = context->ps;
if ( context->useEntityState )
{
if ( !ps && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1401, ASSERT_TYPE_ASSERT, "(es)", (const char *)&queryFormat, "es") )
__debugbreak();
if ( v6 )
{
if ( v14 >= 0x4000 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1410, ASSERT_TYPE_ASSERT, "(anim < (1 << 14))", (const char *)&queryFormat, "anim < MAX_PLAYERANIM_ENTRY_COUNT") )
__debugbreak();
playerAnim_t::SetSecondaryAnim((playerAnim_t *)&ps->fallStartTime, v14);
}
else
{
if ( v14 >= 0x4000 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1405, ASSERT_TYPE_ASSERT, "(anim < (1 << 14))", (const char *)&queryFormat, "anim < MAX_PLAYERANIM_ENTRY_COUNT") )
__debugbreak();
playerAnim_t::SetPrimaryAnim((playerAnim_t *)&ps->fallStartTime, v14);
}
return;
}
if ( !ps && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1418, ASSERT_TYPE_ASSERT, "(ps)", (const char *)&queryFormat, "ps") )
__debugbreak();
if ( v6 )
{
if ( v6 == 1 && v14 >= 0x4000 )
{
v16 = "animSlot != PlayerASM_AnimSlot::SECONDARY || anim < MAX_PLAYERANIM_ENTRY_COUNT";
v17 = 1420;
v18 = "(animSlot != PlayerASM_AnimSlot::SECONDARY || anim < (1 << 14))";
LABEL_39:
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", v17, ASSERT_TYPE_ASSERT, v18, (const char *)&queryFormat, v16) )
__debugbreak();
}
}
else if ( v14 >= 0x4000 )
{
v16 = "animSlot != PlayerASM_AnimSlot::PRIMARY || anim < MAX_PLAYERANIM_ENTRY_COUNT";
v17 = 1419;
v18 = "(animSlot != PlayerASM_AnimSlot::PRIMARY || anim < (1 << 14))";
goto LABEL_39;
}
packedAnim = ps->animState.slot[v6].packedAnim;
if ( packedAnim != v14 )
{
inOutTimer = ps->animState.slot[v6].m_Timer;
if ( packedAnim && v14 && BG_PlayerASM_ShouldSyncAnims(v10, packedAnim, v14, &inOutTimer) )
{
v20 = inOutTimer;
if ( inOutTimer > 0x7FFFF && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1438, ASSERT_TYPE_ASSERT, "(newTimer <= (1 << 19) - 1)", (const char *)&queryFormat, "newTimer <= (1 << ANIM_TIMER_BITS) - 1") )
__debugbreak();
ps->animState.slot[v6].m_Timer = v20;
}
else
{
ps->animState.slot[v6].m_Timer = 0;
}
}
ps->animState.slot[v6].packedAnim = v14;
}
/*
==============
BG_PlayerASM_ShouldSkipAddon
==============
*/
bool BG_PlayerASM_ShouldSkipAddon(const characterInfo_t *ci, const unsigned int animsetIndex, int addonStateIndex, int entryIndex)
{
const Animset *AnimsetByIndex;
char redAnims;
AnimsetAnim *ppOutAnim;
AnimsetAlias *ppOutAlias;
if ( !ci && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1833, ASSERT_TYPE_ASSERT, "(ci)", (const char *)&queryFormat, "ci") )
__debugbreak();
ppOutAlias = NULL;
ppOutAnim = NULL;
AnimsetByIndex = BG_PlayerASM_GetAnimsetByIndex(animsetIndex);
if ( !AnimsetByIndex && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1840, ASSERT_TYPE_ASSERT, "(pAnimset)", (const char *)&queryFormat, "pAnimset", ppOutAnim) )
__debugbreak();
BG_Animset_GetAliasAndAnimFromStateIndexAndEntry(AnimsetByIndex, addonStateIndex, entryIndex, (const AnimsetAlias **)&ppOutAlias, (const AnimsetAnim **)&ppOutAnim);
if ( !ppOutAlias && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1843, ASSERT_TYPE_ASSERT, "(alias)", (const char *)&queryFormat, "alias") )
__debugbreak();
redAnims = (char)ppOutAlias->u.m_AIAnimsetAlias[5].redAnims;
if ( redAnims == 10 )
return !ci->useShadowAnims;
if ( redAnims == 11 )
return ci->isFemale == 0;
return 0;
}
/*
==============
BG_PlayerASM_ShouldSyncAnims
==============
*/
char BG_PlayerASM_ShouldSyncAnims(const unsigned int animsetIndex, const unsigned int oldPackedAnim, const unsigned int anim, unsigned int *inOutTimer)
{
unsigned int v7;
const Animset *AnimsetByIndex;
int v9;
unsigned int NumEntriesForStateIndex;
unsigned int v11;
int v12;
unsigned int v13;
XAnim_s *v14;
XAnim_s *v15;
char v16;
unsigned int v17;
AnimsetAnim *XAnimParts;
bool IsBlendspaceNode;
bool v20;
__int64 v21;
float v22;
float v23;
float v24;
float XAnimLength;
int v26;
float v27;
unsigned int v28;
float v29;
float v30;
double v31;
__int64 v34;
unsigned int v35;
float v36;
float v37;
__int64 v38;
double v39;
float v40;
XAnimSyncGroupID outSyncGroupID;
unsigned int v43;
AnimsetAlias *outSyncRoot;
unsigned int animIndex;
unsigned int pOutAnimIndex;
unsigned int outAnimEntry[2];
XAnim_s *pSubtreeAnims;
XAnim_s *subtreeAnims;
AnimsetAnim *v50;
XAnim_s *anims;
unsigned int graftIndex;
unsigned int pOutGraftNode;
XAnim_s *v54;
XAnim_s *outSyncRootAnims;
AnimsetAlias *ppOutAlias;
AnimsetAnim *ppOutAnim;
const AnimsetAlias *outAnimState;
if ( *inOutTimer )
{
v7 = 0;
BG_PlayerASM_UnpackAnim(animsetIndex, anim, (unsigned int *)&outAnimState, outAnimEntry);
BG_PlayerASM_UnpackAnim(animsetIndex, oldPackedAnim, (unsigned int *)&outSyncRoot, &v43);
AnimsetByIndex = BG_PlayerASM_GetAnimsetByIndex(animsetIndex);
if ( !AnimsetByIndex && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1261, ASSERT_TYPE_ASSERT, "(pAnimset)", (const char *)&queryFormat, "pAnimset") )
__debugbreak();
v9 = (int)outAnimState;
NumEntriesForStateIndex = BG_Animset_GetNumEntriesForStateIndex(AnimsetByIndex, (int)outAnimState);
v11 = outAnimEntry[0];
if ( outAnimEntry[0] < NumEntriesForStateIndex )
{
v12 = (int)outSyncRoot;
v13 = BG_Animset_GetNumEntriesForStateIndex(AnimsetByIndex, (int)outSyncRoot);
if ( v43 < v13 && (v9 == v12 || !BG_PlayerASM_DoesAliasHaveAnyFlags(anim, animsetIndex, 0x2000000000ui64)) )
{
subtreeAnims = BG_PlayerASM_GetAnims(animsetIndex);
if ( !subtreeAnims && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1276, ASSERT_TYPE_ASSERT, "(anims)", (const char *)&queryFormat, "anims") )
__debugbreak();
BG_PlayerASM_GetAnimIndexFromStateIndexAndEntry(animsetIndex, v9, v11, &pOutAnimIndex, &pOutGraftNode, (const XAnim_s **)&pSubtreeAnims);
BG_PlayerASM_GetAnimIndexFromStateIndexAndEntry(animsetIndex, v12, v43, &animIndex, &graftIndex, (const XAnim_s **)&anims);
v14 = pSubtreeAnims;
v15 = anims;
if ( !pSubtreeAnims )
v14 = subtreeAnims;
pSubtreeAnims = v14;
if ( !anims )
v15 = subtreeAnims;
anims = v15;
v16 = 0;
if ( !BG_PlayerASM_IsSyncAnim(subtreeAnims, graftIndex, v15, animIndex, &outSyncGroupID, (const XAnim_s **)&outSyncRootAnims, (unsigned int *)&outSyncRoot) )
goto LABEL_66;
if ( !BG_PlayerASM_IsSyncAnim(subtreeAnims, pOutGraftNode, pSubtreeAnims, pOutAnimIndex, (XAnimSyncGroupID *)&outAnimState, (const XAnim_s **)&v54, outAnimEntry) )
goto LABEL_66;
ppOutAnim = NULL;
subtreeAnims = NULL;
v50 = NULL;
ppOutAlias = NULL;
if ( v9 != -1 && v11 != -1 && v12 != -1 && v43 != -1 && v11 < BG_Animset_GetNumEntriesForStateIndex(AnimsetByIndex, v9) )
{
v17 = BG_Animset_GetNumEntriesForStateIndex(AnimsetByIndex, v12);
if ( v43 < v17 && v9 == v12 )
{
BG_Animset_GetAliasAndAnimFromStateIndexAndEntry(AnimsetByIndex, v9, v11, (const AnimsetAlias **)&subtreeAnims, (const AnimsetAnim **)&ppOutAnim);
BG_Animset_GetAliasAndAnimFromStateIndexAndEntry(AnimsetByIndex, v12, v43, (const AnimsetAlias **)&ppOutAlias, (const AnimsetAnim **)&v50);
if ( subtreeAnims )
{
if ( ppOutAlias && subtreeAnims == (XAnim_s *)ppOutAlias && (*(_QWORD *)(*(_QWORD *)&subtreeAnims->lodDistances[2] + 8i64) & 0x8000000000i64) != 0 && ppOutAnim && v50 )
goto LABEL_66;
}
}
}
if ( (_BYTE)outSyncGroupID != (_BYTE)outAnimState || (_BYTE)outAnimState == 4 && (outAnimEntry[0] != (_DWORD)outSyncRoot || outSyncRootAnims != v54) )
goto LABEL_66;
*(_QWORD *)outAnimEntry = BG_PlayerASM_GetXAnimParts(anims, animIndex, NULL);
XAnimParts = (AnimsetAnim *)BG_PlayerASM_GetXAnimParts(pSubtreeAnims, pOutAnimIndex, NULL);
v16 = 1;
v50 = XAnimParts;
if ( !*(_QWORD *)outAnimEntry || !XAnimParts )
goto LABEL_66;
outSyncRootAnims = NULL;
outSyncRoot = NULL;
v54 = NULL;
outAnimState = NULL;
BG_Animset_GetAliasAndAnimFromStateIndexAndEntry(AnimsetByIndex, v9, v11, (const AnimsetAlias **)&outSyncRoot, (const AnimsetAnim **)&outSyncRootAnims);
BG_Animset_GetAliasAndAnimFromStateIndexAndEntry(AnimsetByIndex, v12, v43, &outAnimState, (const AnimsetAnim **)&v54);
if ( !outAnimState && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1337, ASSERT_TYPE_ASSERT, "(oldAnimsetAlias)", (const char *)&queryFormat, "oldAnimsetAlias") )
__debugbreak();
if ( !outSyncRoot && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1338, ASSERT_TYPE_ASSERT, "(animsetAlias)", (const char *)&queryFormat, "animsetAlias") )
__debugbreak();
if ( !*inOutTimer && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1339, ASSERT_TYPE_ASSERT, "(*inOutTimer > 0)", (const char *)&queryFormat, "*inOutTimer > 0") )
__debugbreak();
IsBlendspaceNode = XAnimBlendSpace_IsBlendspaceNode(anims, animIndex);
v20 = XAnimBlendSpace_IsBlendspaceNode(pSubtreeAnims, pOutAnimIndex);
if ( IsBlendspaceNode )
{
v21 = *inOutTimer;
if ( v20 )
{
v7 = *inOutTimer;
LABEL_65:
v16 = 1;
LABEL_66:
*inOutTimer = v7;
return v16;
}
if ( (_DWORD)v21 == 0x7FFFF )
{
v22 = FLOAT_1_0;
}
else
{
v23 = (float)v21;
v24 = v23 * 0.0000019073486;
v22 = v24;
if ( (v24 < 0.0 || v24 > 1.0) && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1353, ASSERT_TYPE_ASSERT, "(oldTimer >= 0.f && oldTimer <= 1.f)", (const char *)&queryFormat, "oldTimer >= 0.f && oldTimer <= 1.f") )
__debugbreak();
}
XAnimLength = (float)BG_PlayerASM_GetXAnimLength((const XAnimParts *)v50, *((const float *)&outSyncRoot->u.m_AIAnimsetAlias->redAnims + 1));
v26 = (int)(float)(XAnimLength * v22);
}
else
{
v27 = *((float *)&outAnimState->u.m_AIAnimsetAlias->redAnims + 1);
if ( v20 )
{
v28 = BG_PlayerASM_GetXAnimLength(*(const XAnimParts **)outAnimEntry, v27);
v29 = (float)*inOutTimer;
v30 = (float)v28;
v31 = I_fclamp(v29 / v30, 0.0, 1.0);
if ( *(float *)&v31 < 0.0 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.h", 182, ASSERT_TYPE_ASSERT, "(value >= 0.f)", (const char *)&queryFormat, "value >= 0.f") )
__debugbreak();
_XMM1 = 0i64;
__asm { vroundss xmm1, xmm1, xmm0, 1 }
v26 = (int)*(float *)&_XMM1;
if ( (int)*(float *)&_XMM1 > 0x7FFFF )
v26 = 0x7FFFF;
}
else
{
v34 = BG_PlayerASM_GetXAnimLength(*(const XAnimParts **)outAnimEntry, v27);
v35 = BG_PlayerASM_GetXAnimLength((const XAnimParts *)v50, *((const float *)&outSyncRoot->u.m_AIAnimsetAlias->redAnims + 1));
v36 = (float)*inOutTimer;
v37 = (float)v34;
v38 = v35;
v39 = I_fclamp(v36 / v37, 0.0, 1.0);
v40 = (float)v38;
v26 = (int)(float)(*(float *)&v39 * v40);
}
}
v7 = v26;
goto LABEL_65;
}
}
}
return 0;
}
/*
==============
BG_PlayerASM_StoreCommandDir
==============
*/
void BG_PlayerASM_StoreCommandDir(const int clientNum, const int serverTime, const float oldMoveForward, const float oldMoveRight, const float moveForward, const float moveRight)
{
__int64 v7;
BgStatic *ActiveStatics;
cg_t *LocalClientGlobals;
characterInfo_t *CharacterInfo;
__int64 v11;
unsigned int v12;
_DWORD *v13;
double v14;
__int64 v15;
vec2_t vec;
v7 = clientNum;
ActiveStatics = BgStatic::GetActiveStatics();
if ( !ActiveStatics->IsClient(ActiveStatics) )
{
CharacterInfo = (characterInfo_t *)((__int64 (__fastcall *)(BgStatic *, _QWORD))ActiveStatics->__vftable[1].GetAnimStatics)(ActiveStatics, (unsigned int)v7);
goto LABEL_12;
}
LocalClientGlobals = CG_GetLocalClientGlobals((const LocalClientNum_t)LODWORD(ActiveStatics[1].__vftable));
if ( !LocalClientGlobals && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\cgame\\cg_static_inline.h", 25, ASSERT_TYPE_ASSERT, "(cgameGlob)", (const char *)&queryFormat, "cgameGlob") )
__debugbreak();
if ( !LocalClientGlobals->IsMP(LocalClientGlobals) )
{
CharacterInfo = CgGlobalsSP::GetCharacterInfo((CgGlobalsSP *)LocalClientGlobals, v7);
LABEL_12:
v11 = (__int64)CharacterInfo;
goto LABEL_13;
}
if ( (unsigned int)v7 >= LocalClientGlobals[1].predictedPlayerState.rxvOmnvars[64].timeModified )
{
LODWORD(v15) = v7;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\cgame_mp\\cg_globals_mp_inline.h", 12, ASSERT_TYPE_ASSERT, "(unsigned)( characterIndex ) < (unsigned)( static_cast<int>( m_characterInfoCount ) )", "characterIndex doesn't index static_cast<int>( m_characterInfoCount )\n\t%i not in [0, %i)", v15, LocalClientGlobals[1].predictedPlayerState.rxvOmnvars[64].timeModified) )
__debugbreak();
}
v11 = *(_QWORD *)&LocalClientGlobals[1].predictedPlayerState.rxvOmnvars[62] + 14792 * v7;
LABEL_13:
if ( !v11 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1765, ASSERT_TYPE_ASSERT, "(ci)", (const char *)&queryFormat, "ci") )
__debugbreak();
vec.v[0] = moveRight;
vec.v[1] = moveForward;
if ( serverTime <= 0 )
{
LABEL_20:
memmove_0((void *)(v11 + 2644), (const void *)(v11 + 2636), 0x28ui64);
*(_QWORD *)(v11 + 2636) = 0i64;
*(_DWORD *)(v11 + 2640) = serverTime;
v14 = vectoyaw(&vec);
*(_WORD *)(v11 + 2636) = (int)*(float *)&v14;
*(_WORD *)(v11 + 2638) = (int)fsqrt((float)(vec.v[1] * vec.v[1]) + (float)(vec.v[0] * vec.v[0]));
}
else
{
v12 = 0;
v13 = (_DWORD *)(v11 + 2640);
while ( *v13 != serverTime )
{
++v12;
v13 += 2;
if ( v12 >= 6 )
goto LABEL_20;
}
}
}
/*
==============
BG_PlayerASM_UnpackAnim
==============
*/
void BG_PlayerASM_UnpackAnim(const unsigned int animsetIndex, const unsigned int packedAnimIndex, unsigned int *outAnimState, unsigned int *outAnimEntry)
{
bool v8;
const Animset *AnimsetByIndex;
__int64 v10;
__int64 v11;
__int64 v12;
__int64 v13;
if ( !outAnimState && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 374, ASSERT_TYPE_ASSERT, "(outAnimState)", (const char *)&queryFormat, "outAnimState") )
__debugbreak();
if ( !outAnimEntry && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 375, ASSERT_TYPE_ASSERT, "(outAnimEntry)", (const char *)&queryFormat, "outAnimEntry") )
__debugbreak();
if ( packedAnimIndex )
{
if ( packedAnimIndex < 0x4000 )
goto LABEL_13;
LODWORD(v12) = packedAnimIndex;
v8 = CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 377, ASSERT_TYPE_ASSERT, "(unsigned)( packedAnimIndex ) < (unsigned)( (1 << 14) )", "packedAnimIndex doesn't index MAX_PLAYERANIM_ENTRY_COUNT\n\t%i not in [0, %i)", v12, 0x4000);
}
else
{
v8 = CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 376, ASSERT_TYPE_ASSERT, "(packedAnimIndex != (0))", (const char *)&queryFormat, "packedAnimIndex != BG_PLAYERASM_PACKED_ANIM_INVALID");
}
if ( v8 )
__debugbreak();
LABEL_13:
AnimsetByIndex = BG_PlayerASM_GetAnimsetByIndex(animsetIndex);
if ( !AnimsetByIndex && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 380, ASSERT_TYPE_ASSERT, "(animset)", (const char *)&queryFormat, "animset") )
__debugbreak();
if ( AnimsetByIndex->mode != ASM_MODE_PLAYER && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 381, ASSERT_TYPE_ASSERT, "(animset->mode == ASM_MODE_PLAYER)", (const char *)&queryFormat, "animset->mode == ASM_MODE_PLAYER") )
__debugbreak();
v10 = packedAnimIndex - 1;
if ( (unsigned int)v10 >= LOWORD(AnimsetByIndex->u.m_AIAnimset->coverLeftCrouchOffset.leanYaw) )
{
LODWORD(v13) = LOWORD(AnimsetByIndex->u.m_AIAnimset->coverLeftCrouchOffset.leanYaw);
LODWORD(v12) = v10;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 384, ASSERT_TYPE_ASSERT, "(unsigned)( anim ) < (unsigned)( animset->u.m_PlayerAnimset->numUnpackMapEntries )", "anim doesn't index animset->u.m_PlayerAnimset->numUnpackMapEntries\n\t%i not in [0, %i)", v12, v13) )
__debugbreak();
}
v11 = *(unsigned __int16 *)(*(_QWORD *)&AnimsetByIndex->u.m_AIAnimset->coverLeftCrouchOffset.hideYaw + 2 * v10);
if ( (unsigned int)v11 >= AnimsetByIndex->numStates )
{
LODWORD(v13) = AnimsetByIndex->numStates;
LODWORD(v12) = *(unsigned __int16 *)(*(_QWORD *)&AnimsetByIndex->u.m_AIAnimset->coverLeftCrouchOffset.hideYaw + 2 * v10);
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 388, ASSERT_TYPE_ASSERT, "(unsigned)( animState ) < (unsigned)( animset->numStates )", "animState doesn't index animset->numStates\n\t%i not in [0, %i)", v12, v13) )
__debugbreak();
}
if ( (unsigned int)v10 < *(unsigned __int16 *)(*(_QWORD *)AnimsetByIndex->u.m_AIAnimset + 2 * v11) && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 389, ASSERT_TYPE_ASSERT, "(anim >= animset->u.m_PlayerAnimset->packMap[animState])", (const char *)&queryFormat, "anim >= animset->u.m_PlayerAnimset->packMap[animState]") )
__debugbreak();
*outAnimEntry = v10 - *(unsigned __int16 *)(*(_QWORD *)AnimsetByIndex->u.m_AIAnimset + 2 * v11);
*outAnimState = v11;
}
/*
==============
BG_PlayerASM_UnpackAnimFromCi
==============
*/
__int64 BG_PlayerASM_UnpackAnimFromCi(const characterInfo_t *ci, const PlayerASM_AnimSlot slot, unsigned int *outAnimsetIndex, unsigned int *outAnimState, unsigned int *outAnimEntry)
{
unsigned __int8 v7;
unsigned int Anim;
unsigned int Animset;
__int64 v12;
v7 = slot;
if ( !outAnimState && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 398, ASSERT_TYPE_ASSERT, "(outAnimState)", (const char *)&queryFormat, "outAnimState") )
__debugbreak();
if ( !outAnimEntry && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 399, ASSERT_TYPE_ASSERT, "(outAnimEntry)", (const char *)&queryFormat, "outAnimEntry") )
__debugbreak();
if ( !ci && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 400, ASSERT_TYPE_ASSERT, "(ci)", (const char *)&queryFormat, "ci") )
__debugbreak();
if ( v7 >= 2u )
{
LODWORD(v12) = v7;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 401, ASSERT_TYPE_ASSERT, "(unsigned)( slot ) < (unsigned)( PlayerASM_AnimSlot::COUNT )", "slot doesn't index PlayerASM_AnimSlot::COUNT\n\t%i not in [0, %i)", v12, 2) )
__debugbreak();
}
Anim = BG_PlayerASM_GetAnim(ci, (const PlayerASM_AnimSlot)v7);
Animset = BG_PlayerASM_GetAnimset(ci);
*outAnimsetIndex = Animset;
if ( Anim )
BG_PlayerASM_UnpackAnim(Animset, Anim, outAnimState, outAnimEntry);
return Anim;
}
/*
==============
BG_PlayerASM_UnpackAnimFromEntity
==============
*/
__int64 BG_PlayerASM_UnpackAnimFromEntity(const entityState_t *es, const PlayerASM_AnimSlot slot, unsigned int *outAnimsetIndex, unsigned int *outAnimState, unsigned int *outAnimEntry)
{
unsigned __int8 v7;
unsigned int Anim;
unsigned int Animset;
__int64 v12;
v7 = slot;
if ( !outAnimState && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 419, ASSERT_TYPE_ASSERT, "(outAnimState)", (const char *)&queryFormat, "outAnimState") )
__debugbreak();
if ( !outAnimEntry && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 420, ASSERT_TYPE_ASSERT, "(outAnimEntry)", (const char *)&queryFormat, "outAnimEntry") )
__debugbreak();
if ( !es && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 421, ASSERT_TYPE_ASSERT, "(es)", (const char *)&queryFormat, "es") )
__debugbreak();
if ( v7 >= 2u )
{
LODWORD(v12) = v7;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 422, ASSERT_TYPE_ASSERT, "(unsigned)( slot ) < (unsigned)( PlayerASM_AnimSlot::COUNT )", "slot doesn't index PlayerASM_AnimSlot::COUNT\n\t%i not in [0, %i)", v12, 2) )
__debugbreak();
}
Anim = BG_PlayerASM_GetAnim(es, (const PlayerASM_AnimSlot)v7);
Animset = BG_PlayerASM_GetAnimset(es);
*outAnimsetIndex = Animset;
if ( Anim )
BG_PlayerASM_UnpackAnim(Animset, Anim, outAnimState, outAnimEntry);
return Anim;
}
/*
==============
BG_PlayerASM_UnpackAnimFromPs
==============
*/
__int64 BG_PlayerASM_UnpackAnimFromPs(const playerState_s *ps, const PlayerASM_AnimSlot slot, unsigned int *outAnimSetIndex, unsigned int *outAnimState, unsigned int *outAnimEntry)
{
unsigned __int8 v7;
unsigned int Anim;
unsigned int Animset;
__int64 v12;
v7 = slot;
if ( !outAnimState && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 440, ASSERT_TYPE_ASSERT, "(outAnimState)", (const char *)&queryFormat, "outAnimState") )
__debugbreak();
if ( !outAnimEntry && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 441, ASSERT_TYPE_ASSERT, "(outAnimEntry)", (const char *)&queryFormat, "outAnimEntry") )
__debugbreak();
if ( !outAnimSetIndex && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 442, ASSERT_TYPE_ASSERT, "(outAnimSetIndex)", (const char *)&queryFormat, "outAnimSetIndex") )
__debugbreak();
if ( !ps && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 443, ASSERT_TYPE_ASSERT, "(ps)", (const char *)&queryFormat, "ps") )
__debugbreak();
if ( v7 >= 2u )
{
LODWORD(v12) = v7;
if ( CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 444, ASSERT_TYPE_ASSERT, "(unsigned)( slot ) < (unsigned)( PlayerASM_AnimSlot::COUNT )", "slot doesn't index PlayerASM_AnimSlot::COUNT\n\t%i not in [0, %i)", v12, 2) )
__debugbreak();
}
Anim = BG_PlayerASM_GetAnim(ps, (const PlayerASM_AnimSlot)v7);
Animset = BG_PlayerASM_GetAnimset(ps);
*outAnimSetIndex = Animset;
if ( Anim )
BG_PlayerASM_UnpackAnim(Animset, Anim, outAnimState, outAnimEntry);
return Anim;
}
/*
==============
BG_PlayerASM_UpdateAngles
==============
*/
void __fastcall BG_PlayerASM_UpdateAngles(double velocityAngle, characterInfo_t *ci)
{
__int128 v3;
float yawAngle;
__int128 v6;
int v7;
int v8;
int v9;
__int128 v10;
v3 = *(_OWORD *)&velocityAngle;
if ( !ci && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1751, ASSERT_TYPE_ASSERT, "(ci)", (const char *)&queryFormat, "ci") )
__debugbreak();
yawAngle = ci->legs.yawAngle;
LODWORD(_XMM6) = 0;
ci->playerASMLocomotion.lerpVelocityDir = *(float *)&v3;
if ( yawAngle != 0.0 || *(float *)&v3 != 0.0 )
{
*((_QWORD *)&v6 + 1) = *((_QWORD *)&v3 + 1);
v7 = BG_DegreesToMovementDir(yawAngle);
v8 = BG_DegreesToMovementDir(*(float *)&v3);
v9 = BG_MovementDirNormalize180(v8 - v7);
*(double *)&v6 = BG_MovementDirToDegrees(v9);
v10 = v6;
*(float *)&v10 = *(float *)&v6 * 0.0027777778;
_XMM0 = 0i64;
__asm { vroundss xmm4, xmm0, xmm3, 1 }
*(float *)&v10 = (float)(*(float *)&v10 - *(float *)&_XMM4) * 360.0;
_XMM2 = v10;
if ( *(float *)&v10 != 180.0 )
{
__asm
{
vcmpeqss xmm0, xmm2, cs:__real@c3340000
vblendvps xmm6, xmm2, xmm3, xmm0
}
}
}
ci->playerASMLocomotion.strafeAngle = *(float *)&_XMM6;
}
/*
==============
BG_PlayerASM_VerifyAnim
==============
*/
void BG_PlayerASM_VerifyAnim(unsigned int animsetIndex, unsigned int packedAnimIndex)
{
const Animset *AnimsetByIndex;
if ( animsetIndex >= 4 && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 463, ASSERT_TYPE_ASSERT, "(unsigned)( animsetIndex ) < (unsigned)( (1 << 2) )", "animsetIndex doesn't index MAX_PLAYERANIM_ANIMSET_COUNT\n\t%i not in [0, %i)", animsetIndex, 4) )
__debugbreak();
if ( packedAnimIndex )
{
AnimsetByIndex = BG_PlayerASM_GetAnimsetByIndex(animsetIndex);
if ( !AnimsetByIndex && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 471, ASSERT_TYPE_ASSERT, "(animset)", (const char *)&queryFormat, "animset") )
__debugbreak();
if ( AnimsetByIndex->mode != ASM_MODE_PLAYER && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 472, ASSERT_TYPE_ASSERT, "(animset->mode == ASM_MODE_PLAYER)", (const char *)&queryFormat, "animset->mode == ASM_MODE_PLAYER") )
__debugbreak();
if ( packedAnimIndex - 1 >= LOWORD(AnimsetByIndex->u.m_AIAnimset->coverLeftCrouchOffset.leanYaw) && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 474, ASSERT_TYPE_ASSERT, "(packedAnimIndex == (0) || packedAnimIndex - (1) < animset->u.m_PlayerAnimset->numUnpackMapEntries)", (const char *)&queryFormat, "packedAnimIndex == BG_PLAYERASM_PACKED_ANIM_INVALID || packedAnimIndex - BG_PLAYERASM_PACKED_ANIM_OFFSET < animset->u.m_PlayerAnimset->numUnpackMapEntries") )
__debugbreak();
}
}
/*
==============
BG_PlayerASM_flrand
==============
*/
float BG_PlayerASM_flrand(unsigned int entNum, const scr_string_t animsetName, const scr_string_t stateName, float min, float max)
{
int v5;
unsigned int seed;
seed = stateName + entNum + 7 * animsetName;
v5 = BgPlayer_Asm::irandWithSeed(&seed, 0, 0x7FFF);
return (float)((float)((float)v5 * (float)(max - min)) * 0.000030517578) + min;
}
/*
==============
BG_PlayerASM_flrand
==============
*/
double BG_PlayerASM_flrand(unsigned int *holdrand, float min, float max)
{
return BG_flrand(min, max, holdrand);
}
/*
==============
BG_PlayersASM_ResetAnimTree
==============
*/
char BG_PlayersASM_ResetAnimTree(const unsigned int animsetIndex, void *(*alloc)(unsigned __int64), const XAnimOwner owner, characterInfo_t *inOutCharacterInfo)
{
unsigned __int8 v5;
XAnim_s *Anims;
XAnim_s *v9;
XAnimTree *pXAnimTree;
v5 = owner;
if ( !PlayerASM_IsEnabled() && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1617, ASSERT_TYPE_ASSERT, "(PlayerASM_IsEnabled())", (const char *)&queryFormat, "PlayerASM_IsEnabled()") )
__debugbreak();
if ( !inOutCharacterInfo && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1618, ASSERT_TYPE_ASSERT, "(inOutCharacterInfo)", (const char *)&queryFormat, "inOutCharacterInfo") )
__debugbreak();
if ( inOutCharacterInfo->usingAnimState )
return 0;
if ( !inOutCharacterInfo->pXAnimTree )
return 0;
Anims = BG_PlayerASM_GetAnims(animsetIndex);
v9 = Anims;
if ( !Anims )
return 0;
pXAnimTree = inOutCharacterInfo->pXAnimTree;
if ( pXAnimTree->anims == Anims )
return 0;
inOutCharacterInfo->animTreeDirty = 1;
inOutCharacterInfo->dobjDirty = 1;
XAnimFreeTree(pXAnimTree, NULL);
inOutCharacterInfo->pXAnimTree = XAnimCreateTree(v9, alloc, (XAnimOwner)v5);
return 1;
}
/*
==============
BG_PlayersASM_ResetCorpseAnimTree
==============
*/
void BG_PlayersASM_ResetCorpseAnimTree(void *(*alloc)(unsigned __int64), XAnimOwner owner, const characterInfo_t *ci, XAnimTree **inOutAnimTree)
{
unsigned __int8 v6;
v6 = owner;
if ( !ci && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1662, ASSERT_TYPE_ASSERT, "(ci)", (const char *)&queryFormat, "ci") )
__debugbreak();
if ( !inOutAnimTree && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1663, ASSERT_TYPE_ASSERT, "(inOutAnimTree)", (const char *)&queryFormat, "inOutAnimTree") )
__debugbreak();
if ( !PlayerASM_IsEnabled() && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1664, ASSERT_TYPE_ASSERT, "(PlayerASM_IsEnabled())", (const char *)&queryFormat, "PlayerASM_IsEnabled()") )
__debugbreak();
if ( !ci->usingAnimState )
{
if ( *inOutAnimTree )
{
if ( XAnimGetAnims(*inOutAnimTree) == ci->pXAnimTree->anims )
return;
if ( *inOutAnimTree )
XAnimFreeTree(*inOutAnimTree, NULL);
}
*inOutAnimTree = XAnimCreateTree(ci->pXAnimTree->anims, alloc, (XAnimOwner)v6);
}
}
/*
==============
BG_PlayersASM_ResetSmallAnimTree
==============
*/
char BG_PlayersASM_ResetSmallAnimTree(const unsigned int animsetIndex, const XAnimOwner owner, characterInfo_t *inOutCharacterInfo)
{
unsigned __int8 v4;
XAnim_s *Anims;
XAnim_s *v7;
XAnimTree *pXAnimTree;
v4 = owner;
if ( !inOutCharacterInfo && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1640, ASSERT_TYPE_ASSERT, "(inOutCharacterInfo)", (const char *)&queryFormat, "inOutCharacterInfo") )
__debugbreak();
if ( !PlayerASM_IsEnabled() && CoreAssert_Handler("c:\\workspace\\iw8\\code_source\\src\\bgame\\asm\\bg_player_asm_util.cpp", 1641, ASSERT_TYPE_ASSERT, "(PlayerASM_IsEnabled())", (const char *)&queryFormat, "PlayerASM_IsEnabled()") )
__debugbreak();
if ( inOutCharacterInfo->usingAnimState )
return 0;
if ( !inOutCharacterInfo->pXAnimTree )
return 0;
Anims = BG_PlayerASM_GetAnims(animsetIndex);
v7 = Anims;
if ( !Anims )
return 0;
pXAnimTree = inOutCharacterInfo->pXAnimTree;
if ( pXAnimTree->anims == Anims )
return 0;
inOutCharacterInfo->animTreeDirty = 1;
Com_XAnimFreeSmallTree(pXAnimTree);
inOutCharacterInfo->pXAnimTree = Com_XAnimCreateSmallTree(v7, (XAnimOwner)v4);
return 1;
}
| [
"zkitx@zkitx.jp"
] | zkitx@zkitx.jp |
9ca4317c1c00448c9ec21e64dd85ada4bc240cc9 | f0a2352098eb7531d6c41b8e927d36b5d7c4df85 | /Graphical/nCurses/Srcs/Graphic.hpp | 8a5d18acec13e6c6b722cdde8c54958c6483f5e3 | [] | no_license | AurelienFT/Arcade | ebd0f1475659825e6fce929e793eff014cbbdd22 | 0dfab443354cd5292d2bbad565181274d76490ee | refs/heads/master | 2020-05-18T00:44:51.129996 | 2019-04-29T13:25:25 | 2019-04-29T13:25:25 | 184,071,749 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,736 | hpp | /*
** EPITECH PROJECT, 2019
** OOP_arcade_2018
** File description:
** Graphic
*/
#ifndef GRAPHIC_HPP_
#define GRAPHIC_HPP_
#include "arcade/interface/graphic/Graphic.hpp"
#include <curses.h>
#include "Window.hpp"
#include <iostream>
#include <string>
namespace arcade::nCurses {
class GraphicalLibrary : public arcade::interface::graphic::IGraphicalLibrary {
public:
GraphicalLibrary();
~GraphicalLibrary();
arcade::interface::graphic::WindowPtr createWindow();
arcade::interface::graphic::TexturePtr createTexture();
arcade::interface::graphic::TexturePtr createTexture(const std::string &path);
arcade::interface::graphic::SpritePtr createSprite();
arcade::interface::graphic::SpritePtr createSprite(arcade::interface::graphic::TexturePtr texture);
arcade::interface::graphic::ColorPtr createColor();
arcade::interface::graphic::ColorPtr createColor(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha);
arcade::interface::graphic::ColorPtr createColor(uint32_t color);
arcade::interface::graphic::RectanglePtr createRectangle();
arcade::interface::graphic::RectanglePtr createRectangle(int top, int left, int width, int height);
arcade::interface::graphic::FontPtr createFont(const std::string &path);
arcade::interface::graphic::TextPtr createText();
arcade::interface::graphic::TextPtr createText(arcade::interface::graphic::FontPtr font);
arcade::interface::graphic::Vector2fPtr createVector2f();
arcade::interface::graphic::Vector2fPtr createVector2f(float x, float y);
arcade::interface::graphic::Vector2iPtr createVector2i();
arcade::interface::graphic::Vector2iPtr createVector2i(int x, int y);
protected:
private:
};
}
#endif /* !GRAPHIC_HPP_ */
| [
"aurelien.foucault@epitech.eu"
] | aurelien.foucault@epitech.eu |
4ae16ae45011271f516bbed54f530c604ab9b1f3 | 27f473ccc76bb3da481eafb8cd2da4b78058096a | /[구현] 체스판 다시 칠하기.cpp | b1060c0f4e5c48cb2f44f565b05870a22299c5a0 | [
"MIT"
] | permissive | ChangYeop-Yang/Study-Algorithm | 07f838be1a41d6f6a1293a21ae4b7e9f623b39f4 | 7dc83df6ad4bb015ef46788e72e10ea6b5ec84cf | refs/heads/master | 2022-03-07T13:26:06.781186 | 2022-02-26T15:35:17 | 2022-02-26T15:35:17 | 70,337,924 | 7 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,027 | cpp | #include <string>
#include <vector>
#include <climits>
#include <iostream>
#include <algorithm>
using namespace std;
#define WHITE 'W'
#define BLACK 'B'
#define MAX_V 8
#define INT_PAIR pair<int, int>
const int convertCheckBoard(vector<string> & board, const vector<char> casePhone, const INT_PAIR there) {
int answer = 0;
vector<char> phone = casePhone;
for (int ii = there.first; ii < MAX_V + there.first; ii++) {
int index = 0;
for (int jj = there.second; jj < MAX_V + there.second; jj++) {
// Case 체스판을 다시 칠해야 하는 경우.
if (board[ii][jj] != phone[index]) { answer++; }
index = (index + 1) % phone.size();
}
std::swap(phone.front(), phone.back());
}
return answer;
}
int main(void)
{
INT_PAIR input = make_pair(0, 0);
cin >> input.first >> input.second;
vector<string> board = vector<string>(input.first, string());
for (int ii = 0; ii < input.first; ii++) { cin >> board[ii]; }
int answer = INT_MAX;
// Case N * M Matrix
for (int ii = 0; ii < input.first; ii++) {
// MARK: - Row Out of Range
if (ii + MAX_V > input.first) { break; }
for (int jj = 0; jj < input.second; jj++) {
// MARK: - Column Out of Rnage
if (jj + MAX_V > input.second) { break; }
/* ※ CAPTION ※
체스판은 각 정사각형이 검정 또는 흰색이며,
변을 공유하는 두 개의 사각형이 같은 색이 아닐 때 이다.
따라서 위 정의에 의하면 체스판의 색은 항상 두 가지가 가능한데,
하나는 왼쪽 위 코너가 흰색인 것, 검정색인 것 두가지이다.
*/
// Case Left-Top Black
const int black = convertCheckBoard(board, { BLACK, WHITE }, make_pair(ii, jj));
answer = std::min(answer, black);
// Case Left-Top White
const int white = convertCheckBoard(board, { WHITE, BLACK }, make_pair(ii, jj));
answer = std::min(answer, white);
//answer = std::min(answer, 64 - count); // 90도를 회전 한 다음 칸의 개수를 확인
}
}
cout << answer << endl;
return 0;
}
| [
"noreply@github.com"
] | ChangYeop-Yang.noreply@github.com |
b47c857c427daf1a120a9f44cb925f5a05281643 | 867ee0c866e481939964ad35a8e54d2e2b07fe2a | /d02/ex01/main.cpp | fb047c706d3f3a553aae881d396f7ff50f026b14 | [] | no_license | rjwhobbs/cpp_bootcamp | 0db7ceaeeb0b19d898965ceb26b5b84635b36a5d | 8edc3bd419ee3587966a14bb3bebcf94c6efa8d4 | refs/heads/master | 2021-05-18T20:11:31.886529 | 2020-08-26T08:46:24 | 2020-08-26T08:46:24 | 251,397,756 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 498 | cpp | #include <iostream>
#include "Fixed.hpp"
int main(void) {
Fixed a(42.42f);
Fixed b(-42.42f);
Fixed c(42.0f);
Fixed d(-42.0f);
std::cout << "a \n" << a.toInt() << std::endl;
std::cout << "b \n" << b.toInt() << std::endl;
std::cout << "d \n" << d.toInt() << std::endl;
std::cout << "c \n" << c.toInt() << std::endl;
std::cout << "a \n" << a << std::endl;
std::cout << "b \n" << b << std::endl;
std::cout << "d \n" << d << std::endl;
std::cout << "c \n" << c << std::endl;
return 0;
} | [
"rhobbs@student.wethinkcode.co.za"
] | rhobbs@student.wethinkcode.co.za |
beb5cbd68e76e7e40aab325005a7bab07d9165e9 | 842c1543f09968c3dfb666836f66fce9569831bf | /src/create.cpp | 741e0d8f669ebaed18cea53592a1174340ded079 | [
"ISC"
] | permissive | jfreax/mergerfs | b30309b9687231633fb34066301cffdd1c8de5b9 | 577bc67fa70ff549092a1649f4524efcb5f3746e | refs/heads/master | 2020-12-26T21:52:23.887879 | 2016-08-26T18:44:43 | 2016-08-26T18:44:43 | 67,310,163 | 0 | 0 | null | 2016-09-03T20:25:51 | 2016-09-03T20:25:51 | null | UTF-8 | C++ | false | false | 3,447 | cpp | /*
Copyright (c) 2016, Antonio SJ Musumeci <trapexit@spawn.link>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <fuse.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <string>
#include <vector>
#include "config.hpp"
#include "fileinfo.hpp"
#include "fs_path.hpp"
#include "fs_clonepath.hpp"
#include "rwlock.hpp"
#include "ugid.hpp"
using std::string;
using std::vector;
using mergerfs::Policy;
using namespace mergerfs;
static
int
_create_core(const string &existingpath,
const string &createpath,
const char *fusepath,
const char *fusedirpath,
const mode_t mode,
const int flags,
uint64_t &fh)
{
int fd;
string fullpath;
if(createpath != existingpath)
{
const ugid::SetRootGuard ugidGuard;
fs::clonepath(existingpath,createpath,fusedirpath);
}
fs::path::make(&createpath,fusepath,fullpath);
fd = ::open(fullpath.c_str(),flags,mode);
if(fd == -1)
return -errno;
fh = reinterpret_cast<uint64_t>(new FileInfo(fd));
return 0;
}
static
int
_create(Policy::Func::Search searchFunc,
Policy::Func::Create createFunc,
const vector<string> &srcmounts,
const uint64_t minfreespace,
const char *fusepath,
const mode_t mode,
const int flags,
uint64_t &fh)
{
int rv;
string fullpath;
string fusedirpath;
const char *fusedirpathcstr;
vector<const string*> createpaths;
vector<const string*> existingpaths;
fusedirpath = fusepath;
fs::path::dirname(fusedirpath);
fusedirpathcstr = fusedirpath.c_str();
rv = searchFunc(srcmounts,fusedirpathcstr,minfreespace,existingpaths);
if(rv == -1)
return -errno;
rv = createFunc(srcmounts,fusedirpathcstr,minfreespace,createpaths);
if(rv == -1)
return -errno;
return _create_core(*existingpaths[0],*createpaths[0],
fusepath,fusedirpathcstr,
mode,flags,fh);
}
namespace mergerfs
{
namespace fuse
{
int
create(const char *fusepath,
mode_t mode,
fuse_file_info *ffi)
{
const fuse_context *fc = fuse_get_context();
const Config &config = Config::get(fc);
const ugid::Set ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _create(config.getattr,
config.create,
config.srcmounts,
config.minfreespace,
fusepath,
(mode & ~fc->umask),
ffi->flags,
ffi->fh);
}
}
}
| [
"trapexit@spawn.link"
] | trapexit@spawn.link |
17ef17df891f2b35182ccb44c050bfd2b8ecbe29 | b9026583848709d8f8dbf7129789d8f15093582a | /linked_list_template/Source.cpp | 5b3d3f632336117ee57a6b85323b6f03d9c8dad1 | [] | no_license | Afpherian/cis_labs | 965bce0c4f5086ed5db291134bf2811ede32826a | c063572f254ec3c4db9eec41501e0e3993f8a883 | refs/heads/master | 2020-12-31T00:53:29.955682 | 2017-02-01T00:32:47 | 2017-02-01T00:32:47 | 80,574,478 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,361 | cpp | //CIS22C
//Lab 1
//Crystal Hupp
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
using namespace std;
static int nodeCounter=0; //to count number of nodes created
//template to create list nodes
template <class T>
class ListNode {
public:
T value;
ListNode<T> *next;
//constructor
ListNode(T nodeValue) {
value = nodeValue;
next = nullptr;
++nodeCounter;
}
};
template <class T>
class LinkedList {
private:
ListNode<T> *head; //list head pointer
public:
//constructor
LinkedList() {
head = nullptr;
}
//deconstructor
~LinkedList();
//operations for linked list
int getCurrentSize();
bool isEmpty();
bool insert(T);
bool remove(T);
void clear();
bool contains(T);
};
template <class T>
int LinkedList<T>::getCurrentSize() {
return nodeCounter;
}
template <class T>
bool LinkedList<T>::isEmpty() {
if (!head)
return true;
else
return false;
}
template <class T>
bool LinkedList<T>::insert(T newValue) {
ListNode<T> *newNode; //points to new node
ListNode<T> *nodePtr; //to move through list
//create new node and store newValue there
newNode = new ListNode<T>(newValue);
//if list empty, make newNode the first node
if (!head) {
head = newNode;
return true;
}
else { //if there are nodes, insert newNode at end
nodePtr = head; //set pointer to head of list
while (nodePtr->next) //search for the end of the list (null)
nodePtr = nodePtr->next;
nodePtr->next = newNode; //add node to end of list
return true;
}
return false;
}
template <class T>
bool LinkedList<T>::remove(T searchValue) {
ListNode<T> *nodePtr; //to search list
ListNode<T> *previousNode=nullptr; //to point to previous node
if (!head)//if list is empty, return false and do nothing
return false;
//if value is the first node in the list
if (head->value == searchValue) {
nodePtr = head->next; //assign pointer to next in list
delete head; //delete first node
head = nodePtr; //assign head to next in the list
--nodeCounter;
return true;
}
else {
nodePtr = head;
//while value is not the one being searched for, continue on
while (nodePtr != nullptr && nodePtr->value != searchValue) {
previousNode = nodePtr;
nodePtr = nodePtr->next;
}
//as long as node isn't at end of list (condition checked above),
//link previous node to node after nodePtr, then delete nodePtr
if (nodePtr) {
previousNode->next = nodePtr->next;
delete nodePtr;
--nodeCounter;
return true;
}
return false;
}
return false;
}
template <class T>
void LinkedList<T>::clear() {
ListNode<T> *nodePtr; //To Traverse the list
ListNode<T> *nextNode; //points to next node
nodePtr = head;
while (nodePtr != nullptr) { //while not at the end of the list
nextNode = nodePtr->next; //points to next in list to safely delete nodePtr
delete nodePtr;
nodePtr = nextNode; //move to next in the list and then enter loop again to delete
}
head = nullptr;
nodeCounter = 0;
}
template <class T>
LinkedList<T>::~LinkedList() {
ListNode<T> *nodePtr; //To Traverse the list
ListNode<T> *nextNode; //points to next node
nodePtr = head;
while (nodePtr != nullptr) { //while not at the end of the list
nextNode = nodePtr->next; //points to next in list to safely delete nodePtr
delete nodePtr;
nodePtr = nextNode; //move to next in the list and then enter loop again to delete
}
}
template <class T>
bool LinkedList<T>::contains(T nEntry) {
ListNode<T> *nodePtr; //move through list
nodePtr = head; //start at beginning of list
while (nodePtr != nullptr && nodePtr->value != nEntry)
nodePtr = nodePtr->next;
if (nodePtr) //if not at the end of the list, value was found
return true;
else //end of list was reached without value being found
return false;
}
//function prototype
int main_menu();
int main() {
int choice; //menu choice
char again; //to indicate if user is done or not
string new_value; //receive new product
fstream input_file; //to read from file
LinkedList<string> list; //define a LinkedList to hold string values
input_file.open("UProducts.csv", ios::in);
//load contents of file into the linked list
while (getline(input_file, new_value)) {
list.insert(new_value);
}
cout << "The contents of the file UProducts.csv has been loaded into the Linked List" << endl;
do {
choice = main_menu(); //call main menu function
cout << endl;
if (choice == 1)
cout << "Number of entries: " << list.getCurrentSize() << endl;
if (choice == 2) {
if (list.isEmpty())
cout << "Linked List is empty" << endl;
else
cout << "Linked List is not empty" << endl;
}
if (choice == 3) {
cout << "Enter a product and price with format item,price: ";
cin.get();
getline(cin, new_value);
list.insert(new_value);
cout << "New product added to list." << endl;
}
if (choice == 4) {
bool isremoved;
cout << "Which product do you want to remove? ";
cin.get();
getline(cin, new_value); //holds user entered product value
isremoved = list.remove(new_value);
if (isremoved)
cout << "First instance of product was removed.";
else
cout << "No product was removed.";
}
if (choice == 5){
bool isfound;
cout << "What product do you want to search for? ";
cin.get();
getline(cin, new_value);
isfound = list.contains(new_value);
if (isfound)
cout << "Product was found in the list." << endl;
else
cout << "Product was not found in the list." << endl;
}
if (choice == 6) {
list.clear();
cout << "All entries were removed" << endl;
}
cout << endl;
cout << "Would you like to select another option? Y/N: \n";
cin >> again;
while (again != 'y' && again != 'Y' && again != 'n' && again != 'N')
{
cout << "Invalid entry.\nPlease enter Y or N.\n";
cin >> again;
}
} while (again == 'y' || again == 'Y');
return 0;
}
int main_menu() {
int choice;
cout << "1) Get current size of the linked list\n"
<< "2) Check if the linked list is empty\n"
<< "3) Add a new entry to the linked list\n"
<< "4) Remove an entry from the linked list\n"
<< "5) Test whether the linked list contains a specific entry\n"
<< "6) Remove all entries from the linked list\n";
cin >> choice;
while (choice < 1 || choice > 6)
{
cout << "Invalid entry.\nPlease enter a valid menu choice.\n";
cin >> choice;
}
return choice;
} | [
"crhupp@gmail.com"
] | crhupp@gmail.com |
31fdbcd5cae189743f166f3b291f7666dc07ce4b | 34090b851ee2d1f12dbe13f30d199bb328fb11f6 | /src/script/sign.h | 46936b8b4d9e6f5ac28d3c8b2413d9352e0e9f27 | [
"MIT"
] | permissive | Creddit-lol/Creddit-Core | 7e4962d1e1dfb63c56236485938f7d4bf148e54f | 2514c8867fd2bdc34ae4c5466b9a31816dcc0b6c | refs/heads/master | 2023-05-12T18:45:39.377629 | 2021-06-07T23:54:09 | 2021-06-07T23:54:09 | 370,868,857 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 4,215 | h | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2016-2019 The CREDD developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_SCRIPT_SIGN_H
#define BITCOIN_SCRIPT_SIGN_H
#include "script/interpreter.h"
class CKeyID;
class CKeyStore;
class CScript;
class CTransaction;
struct CMutableTransaction;
/** Virtual base class for signature creators. */
class BaseSignatureCreator {
protected:
const CKeyStore* keystore;
public:
BaseSignatureCreator(const CKeyStore* keystoreIn) : keystore(keystoreIn) {}
const CKeyStore& KeyStore() const { return *keystore; };
virtual ~BaseSignatureCreator() {}
virtual const BaseSignatureChecker& Checker() const =0;
/** Create a singular (non-script) signature. */
virtual bool CreateSig(std::vector<unsigned char>& vchSig, const CKeyID& keyid, const CScript& scriptCode, SigVersion sigversion) const =0;
};
/** A signature creator for transactions. */
class TransactionSignatureCreator : public BaseSignatureCreator {
const CTransaction* txTo;
unsigned int nIn;
int nHashType;
CAmount amount;
const TransactionSignatureChecker checker;
public:
TransactionSignatureCreator(const CKeyStore* keystoreIn, const CTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn, int nHashTypeIn=SIGHASH_ALL);
const BaseSignatureChecker& Checker() const { return checker; }
bool CreateSig(std::vector<unsigned char>& vchSig, const CKeyID& keyid, const CScript& scriptCode, SigVersion sigversion) const;
};
class MutableTransactionSignatureCreator : public TransactionSignatureCreator {
const CTransaction tx;
public:
MutableTransactionSignatureCreator(const CKeyStore* keystoreIn, const CMutableTransaction* txToIn, unsigned int nInIn, const CAmount& amount, int nHashTypeIn) : TransactionSignatureCreator(keystoreIn, &tx, nInIn, amount, nHashTypeIn), tx(*txToIn) {}
};
/** A signature creator that just produces 72-byte empty signatyres. */
class DummySignatureCreator : public BaseSignatureCreator {
public:
DummySignatureCreator(const CKeyStore* keystoreIn) : BaseSignatureCreator(keystoreIn) {}
const BaseSignatureChecker& Checker() const;
bool CreateSig(std::vector<unsigned char>& vchSig, const CKeyID& keyid, const CScript& scriptCode, SigVersion sigversion) const;
};
struct SignatureData {
CScript scriptSig;
SignatureData() {}
explicit SignatureData(const CScript& script) : scriptSig(script) {}
};
/** Produce a script signature using a generic signature creator. */
bool ProduceSignature(const BaseSignatureCreator& creator, const CScript& fromPubKey, SignatureData& sigdata, SigVersion sigversion, bool fColdStake, ScriptError* serror = nullptr);
/** Produce a script signature for a transaction. */
bool SignSignature(const CKeyStore& keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, const CAmount& amount, int nHashType, bool fColdStake = false);
bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType, bool fColdStake = false);
/** Combine two script signatures using a generic signature checker, intelligently, possibly with OP_0 placeholders. */
SignatureData CombineSignatures(const CScript& scriptPubKey, const BaseSignatureChecker& checker, const SignatureData& scriptSig1, const SignatureData& scriptSig2);
/** Extract signature data from a transaction, and insert it. */
SignatureData DataFromTransaction(const CMutableTransaction& tx, unsigned int nIn);
void UpdateTransaction(CMutableTransaction& tx, unsigned int nIn, const SignatureData& data);
/* Check whether we know how to sign for an output like this, assuming we
* have all private keys. While this function does not need private keys, the passed
* keystore is used to look up public keys and redeemscripts by hash.
* Solvability is unrelated to whether we consider this output to be ours. */
bool IsSolvable(const CKeyStore& store, const CScript& script, bool fColdStaking);
#endif // BITCOIN_SCRIPT_SIGN_H
| [
"bobski.robertson122@gmail.com"
] | bobski.robertson122@gmail.com |
1d34f30e09c94c800680e33a7090b21e03efee33 | 60d3a641aa3ea1f1c47d5f72deadb4e890a29f2f | /tests/cpp/unit-tests/test_client_ensemble.cpp | 6db78c802887cd334f5b8311d4c8199ac80fe760 | [
"BSD-2-Clause"
] | permissive | ctandon11/SmartRedis | ccdace919e1209ecbd4b48b33f7c0a0ee53ce669 | 47479331e06d9dc8ef06e200d91facc8a8c7f657 | refs/heads/develop | 2023-09-04T07:09:35.127959 | 2021-08-24T23:53:55 | 2021-08-24T23:53:55 | 374,810,948 | 0 | 0 | BSD-2-Clause | 2021-10-15T22:19:23 | 2021-06-07T22:01:21 | C++ | UTF-8 | C++ | false | false | 8,914 | cpp | #include "../../../third-party/catch/catch.hpp"
#include "client.h"
#include "dataset.h"
#include "../client_test_utils.h"
using namespace SmartRedis;
// helper function for resetting environment
// variables to their original state
void reset_env_vars(const char* old_keyin, const char* old_keyout)
{
if (old_keyin != nullptr) {
std::string reset_keyin =
std::string("SSKEYIN=") + std::string(old_keyin);
char* reset_keyin_c = new char[reset_keyin.size() + 1];
std::copy(reset_keyin.begin(), reset_keyin.end(), reset_keyin_c);
reset_keyin_c[reset_keyin.size()] = '\0';
putenv( reset_keyin_c);
delete [] reset_keyin_c;
}
else {
unsetenv("SSKEYIN");
}
if (old_keyout != nullptr) {
std::string reset_keyout =
std::string("SSKEYOUT=") + std::string(old_keyout);
char* reset_keyout_c = new char[reset_keyout.size() + 1];
std::copy(reset_keyout.begin(), reset_keyout.end(), reset_keyout_c);
reset_keyout_c[reset_keyout.size()] = '\0';
putenv( reset_keyout_c);
delete [] reset_keyout_c;
}
else {
unsetenv("SSKEYOUT");
}
}
// helper function for loading mnist
void load_mnist_image_to_array(float**** img)
{
std::string image_file = "../../mnist_data/one.raw";
std::ifstream fin(image_file, std::ios::binary);
std::ostringstream ostream;
ostream << fin.rdbuf();
fin.close();
const std::string tmp = ostream.str();
const char *image_buf = tmp.data();
int image_buf_length = tmp.length();
int position = 0;
for(int i=0; i<28; i++) {
for(int j=0; j<28; j++) {
img[0][0][i][j] = ((float*)image_buf)[position++];
}
}
}
SCENARIO("Testing Client ensemble using a producer/consumer paradigm")
{
GIVEN("Variables that will be used by the producer and consumer")
{
const char* old_keyin = std::getenv("SSKEYIN");
const char* old_keyout = std::getenv("SSKEYOUT");
char keyin_env_put[] = "SSKEYIN=producer_0,producer_1";
char keyout_env_put[] = "SSKEYOUT=producer_0";
char keyin_env_get[] = "SSKEYIN=producer_1,producer_0";
char keyout_env_get[] = "SSKEYOUT=producer_1";
size_t dim1 = 10;
std::vector<size_t> dims = {dim1};
std::string producer_keyout = "producer_0";
std::string producer_keyin = "producer_0";
std::string consumer_keyout = "producer_1";
std::string consumer_keyin = "producer_0";
// for tensor
std::string tensor_key = "ensemble_test";
// for model
std::string model_key = "mnist_model";
std::string model_file = "./../../mnist_data/mnist_cnn.pt";
// for script
std::string script_key = "mnist_script";
std::string script_file =
"./../../mnist_data/data_processing_script.txt";
// for setup mnist
std::string in_key = "mnist_input";
std::string out_key = "mnist_output";
std::string script_out_key = "mnist_processed_input";
std::string model_name = "mnist_model";
std::string script_name = "mnist_script";
// for setup mnist with dataset
std::string in_key_ds = "mnist_input_ds";
std::string script_out_key_ds = "mnist_processed_input_ds";
std::string out_key_ds = "mnist_output_ds";
std::string dataset_name = "mnist_input_dataset_ds";
std::string dataset_in_key = "{" + dataset_name + "}." + in_key_ds;
// for consumer tensor
TensorType g_type;
std::vector<size_t> g_dims;
void* g_result;
THEN("The Client ensemble can be tested with "
"a producer/consumer relationship")
{
// do producer stuff
putenv(keyin_env_put);
putenv(keyout_env_put);
Client producer_client(use_cluster());
producer_client.use_model_ensemble_prefix(true);
// Tensors
float* array = (float*)malloc(dims[0]*sizeof(float));
for(int i=0; i<dims[0]; i++)
array[i] = (float)(rand()/((float)RAND_MAX/10.0));
producer_client.put_tensor(tensor_key, (void*)array,
dims, TensorType::flt,
MemoryLayout::nested);
CHECK(producer_client.tensor_exists(tensor_key) == true);
CHECK(producer_client.key_exists(producer_keyout+"."+tensor_key) ==
true);
// Models
producer_client.set_model_from_file(model_key, model_file,
"TORCH", "CPU");
CHECK(producer_client.model_exists(model_key) == true);
CHECK(producer_client.poll_model(model_key, 300, 100) == true);
// Scripts
producer_client.set_script_from_file(script_key, "CPU",
script_file);
CHECK(producer_client.model_exists(script_key) == true);
// Setup mnist
float**** mnist_array = allocate_4D_array<float>(1,1,28,28);
load_mnist_image_to_array(mnist_array);
producer_client.put_tensor(in_key, mnist_array, {1,1,28,28},
TensorType::flt, MemoryLayout::nested);
producer_client.run_script(script_name, "pre_process",
{in_key}, {script_out_key});
producer_client.run_model(model_name, {script_out_key}, {out_key});
// Setup mnist with dataset
DataSet dataset = DataSet(dataset_name);
dataset.add_tensor(in_key_ds, mnist_array, {1,1,28,28},
TensorType::flt, MemoryLayout::nested);
producer_client.put_dataset(dataset);
CHECK(producer_client.tensor_exists(dataset_name) == true);
producer_client.run_script(script_name, "pre_process",
{dataset_in_key}, {script_out_key_ds});
producer_client.run_model(model_name, {script_out_key_ds},
{out_key_ds});
free_4D_array(mnist_array, 1, 1, 28);
// do consumer stuff
putenv(keyin_env_get);
putenv(keyout_env_get);
Client consumer_client(use_cluster());
consumer_client.use_model_ensemble_prefix(true);
// Tensors
float* u_result = (float*)malloc(dims[0]*sizeof(float));
CHECK(consumer_client.tensor_exists(tensor_key) == false);
CHECK(consumer_client.key_exists(consumer_keyout+"."+tensor_key) ==
false);
consumer_client.set_data_source("producer_0");
CHECK(consumer_client.tensor_exists(tensor_key) == true);
CHECK(consumer_client.key_exists(consumer_keyin+"."+tensor_key) ==
true);
consumer_client.unpack_tensor(tensor_key, u_result,
dims, TensorType::flt,
MemoryLayout::nested);
for(int i=0; i<dims[0]; i++)
CHECK(array[i] == u_result[i]);
consumer_client.get_tensor(tensor_key, g_result, g_dims,
g_type, MemoryLayout::nested);
float* g_type_result = (float*)g_result;
for(int i=0; i<dims[0]; i++)
CHECK(array[i] == g_type_result[i]);
CHECK(TensorType::flt == g_type);
CHECK(g_dims == dims);
free_1D_array(array);
free_1D_array(u_result);
// Models
consumer_client.set_data_source("producer_1");
CHECK(consumer_client.model_exists(model_key) == false);
consumer_client.set_data_source("producer_0");
std::string_view model = consumer_client.get_model(model_key);
// Scripts
consumer_client.set_data_source("producer_1");
CHECK(consumer_client.model_exists(script_key) == false);
consumer_client.set_data_source("producer_0");
std::string_view script = consumer_client.get_script(script_key);
// Get mnist result
float** mnist_result = allocate_2D_array<float>(1, 10);
consumer_client.unpack_tensor(out_key, mnist_result,
{1,10}, TensorType::flt,
MemoryLayout::nested);
consumer_client.unpack_tensor(out_key_ds, mnist_result,
{1,10}, TensorType::flt,
MemoryLayout::nested);
free_2D_array(mnist_result, 1);
// reset environment variables to their original state
reset_env_vars(old_keyin, old_keyout);
}
}
} | [
"ericgustin44@gmail.com"
] | ericgustin44@gmail.com |
942acc6a70f33b6b42348b96ea4bb4d9a8d45c35 | 84283cea46b67170bb50f22dcafef2ca6ddaedff | /Codeforces/632/C.cpp | 324e57fe3cdecf45011c2f2b113539335a0fc603 | [] | no_license | ssyze/Codes | b36fedf103c18118fd7375ce7a40e864dbef7928 | 1376c40318fb67a7912f12765844f5eefb055c13 | refs/heads/master | 2023-01-09T18:36:05.417233 | 2020-11-03T15:45:45 | 2020-11-03T15:45:45 | 282,236,294 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 634 | cpp | /*
* @Date : 2020-04-17 19:09:52
* @Author : ssyze
* @Description :
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2e5 + 5;
ll n, a[maxn], sum[maxn];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
map<ll, ll> pre;
pre[0] = 0;
for (int i = 1; i <= n; i++) {
cin >> a[i];
sum[i] = sum[i - 1] + a[i];
}
ll ans = 0, mx = -1;
for (int i = 1; i <= n; i++) {
if (pre.count(sum[i]))
mx = max(mx, pre[sum[i]]);
ans += i - (mx + 1);
pre[sum[i]] = i;
}
cout << ans << endl;
} | [
"46869158+shu-ssyze@users.noreply.github.com"
] | 46869158+shu-ssyze@users.noreply.github.com |
ee28e799078d609b1e0a00d27a9468951a65ea8f | 27a7b51c853902d757c50cb6fc5774310d09385a | /[Server]Agent/ChatRoomMgr.cpp | 6f2daef5b74e5269d44e931ff034cf0bcee60d44 | [] | no_license | WildGenie/LUNAPlus | f3ce20cf5b685efe98ab841eb1068819d2314cf3 | a1d6c24ece725df097ac9a975a94139117166124 | refs/heads/master | 2021-01-11T05:24:16.253566 | 2015-06-19T21:34:46 | 2015-06-19T21:34:46 | 71,666,622 | 4 | 2 | null | 2016-10-22T21:27:35 | 2016-10-22T21:27:34 | null | UHC | C++ | false | false | 38,512 | cpp | //=================================================================================================
// FILE : CChatRoomMgr.cpp
// DESC : Implementation part of chatroom manager class.
// DATE : MARCH 31, 2008 LYW
//=================================================================================================
//-------------------------------------------------------------------------------------------------
// Include part.
//-------------------------------------------------------------------------------------------------
#include "stdafx.h" // An include file for standard system include files
#include "../[CC]ServerModule/Network.h" // An include file for network.
#include "./ChatRoomMgr.h" // An include file for chatroom manager.
#include "./AgentDBMsgParser.h"
#include "./FilteringTable.h"
//-------------------------------------------------------------------------------------------------
// NAME : CChatRoomMgr
// DESC : The function constructor.
// DATE : MARCH 31, 2008 LYW
//-------------------------------------------------------------------------------------------------
CChatRoomMgr::CChatRoomMgr(void)
{
}
//-------------------------------------------------------------------------------------------------
// NAME : ~CChatRoomMgr
// DESC : The function destructor.
// DATE : MARCH 31, 2008 LYW
//-------------------------------------------------------------------------------------------------
CChatRoomMgr::~CChatRoomMgr(void)
{
}
//-------------------------------------------------------------------------------------------------
// NAME : RegistPlayer_To_Lobby
// DESC : 유저 정보를 담아 Dist 서버로 보내는 함수.
// DATE : MARCH 31, 2008 LYW
//-------------------------------------------------------------------------------------------------
BYTE CChatRoomMgr::IsAddedUser(DWORD dwCharacterID)
{
// 유저 정보 받기.
USERINFO* pInfo = NULL ;
pInfo = g_pUserTableForObjectID->FindUser(dwCharacterID) ;
ASSERT(pInfo) ;
if(!pInfo)
{
// 080704 LYW --- ChatRoomMgr : 임시 버퍼 사이즈 확장.
//char tempMsg[128] = {0, } ;
char tempMsg[257] = {0, } ;
sprintf(tempMsg, "%d : Failed to find user to user id", dwCharacterID) ;
Throw_Error(tempMsg, __FUNCTION__) ;
return FALSE ;
}
if(pInfo->byAddedChatSystem) return TRUE ;
else return FALSE ;
}
//-------------------------------------------------------------------------------------------------
// NAME : RegistPlayer_To_Lobby
// DESC : 유저 정보를 담아 Dist 서버로 보내는 함수.
// DATE : MARCH 31, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::RegistPlayer_To_Lobby(USERINFO* pUserInfo, BYTE byProtocol)
{
// 함수 파라메터 체크.
ASSERT(pUserInfo) ;
if(!pUserInfo)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 임시 유저 데이터.
int nNameLength ;
ST_CR_USER guest ;
memset(&guest, 0, sizeof(ST_CR_USER)) ;
for(BYTE count = 0 ; count < MAX_CHARACTER_NUM ; ++count)
{
if(pUserInfo->SelectInfoArray[count].dwCharacterID != pUserInfo->dwCharacterID) continue ;
// 캐릭터 정보를 받는다.
guest.dwUserID = pUserInfo->dwUserID ;
guest.dwPlayerID = pUserInfo->SelectInfoArray[count].dwCharacterID ;
//guest.wClassIdx = pUserInfo->SelectInfoArray[count].wClassIndex ;
guest.byLevel = (BYTE)pUserInfo->SelectInfoArray[count].Level ;
guest.byMapNum = (BYTE)pUserInfo->SelectInfoArray[count].MapNum ;
// 캐릭터의 이름을 체크한다.
nNameLength = 0 ;
nNameLength = strlen(pUserInfo->SelectInfoArray[count].name) ;
ASSERT(nNameLength > 0) ;
if(nNameLength <= 0)
{
Throw_Error("Failed to receive user name!!", __FUNCTION__) ;
}
strcpy(guest.name, pUserInfo->SelectInfoArray[count].name) ;
// 캐릭터 정보를 담는다.
MSG_CR_USER msg ;
memset(&msg, 0, sizeof(MSG_CR_USER)) ;
msg.Category = MP_CHATROOM ;
msg.Protocol = byProtocol ;
msg.dwObjectID = guest.dwPlayerID ;
memcpy(&msg.user, &guest, sizeof(ST_CR_USER)) ;
// Dist로 등록 메시지 전송.
g_Network.Send2DistributeServer((char*)&msg, sizeof(MSG_CR_USER)) ;
// 캐릭터의 상태를 Lobby에 있는 상태로 세팅.
pUserInfo->byAddedChatSystem = TRUE ;
break ;
}
}
//-------------------------------------------------------------------------------------------------
// NAME : RegistPlayer_To_Lobby
// DESC : 유저 정보를 담아 Dist 서버로 보내는 함수.
// DATE : MAY 7, 2008 LYW
//-------------------------------------------------------------------------------------------------
BYTE CChatRoomMgr::RegistPlayer_To_Lobby(ST_CR_USER* pUserInfo)
{
// 함수 파라메터 체크.
ASSERT(pUserInfo) ;
if(!pUserInfo)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return FALSE ;
}
// 이름 체크.
int nNameLength = 0 ;
nNameLength = strlen(pUserInfo->name) ;
ASSERT(nNameLength > 0) ;
if(nNameLength <= 0 || !pUserInfo->name)
{
Throw_Error("Failed to receive name!!", __FUNCTION__) ;
return FALSE ;
}
// 캐릭터 정보를 담는다.
MSG_CR_USER msg ;
memset(&msg, 0, sizeof(MSG_CR_USER)) ;
msg.Category = MP_CHATROOM ;
msg.Protocol = MP_CHATROOM_ADD_USER_SYN ;
msg.dwObjectID = pUserInfo->dwPlayerID ;
memcpy(&msg.user, pUserInfo, sizeof(ST_CR_USER)) ;
// Dist로 등록 메시지 전송.
g_Network.Send2DistributeServer((char*)&msg, sizeof(MSG_CR_USER)) ;
return TRUE ;
}
//-------------------------------------------------------------------------------------------------
// NAME : ForceRegistPlayer_To_Lobby
// DESC : 강제로 캐릭터 정보를 Dist에 등록 시키는 함수.
// DATE : APRIL 14, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::ForceRegistPlayer_To_Lobby(DWORD dwIndex, char* pMsg, DWORD dwLength)
{
// 함수 파라메터 체크.
ASSERT(pMsg) ;
if(!pMsg)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 기본 메시지 변환.
MSGBASE* pmsg = NULL ;
pmsg = (MSGBASE*)pMsg ;
ASSERT(pMsg) ;
if(!pMsg)
{
Throw_Error(err_FCMTO, __FUNCTION__) ;
return ;
}
// 유저 정보 받기.
USERINFO* pInfo = NULL ;
pInfo = g_pUserTableForObjectID->FindUser(pmsg->dwObjectID) ;
if(!pInfo)
{
Throw_Error(err_FRUI, __FUNCTION__) ;
MSGBASE msg ;
memset(&msg, 0, sizeof(MSGBASE)) ;
msg.Category = MP_CHATROOM ;
msg.Protocol = MP_CHATROOM_FORCE_ADD_USER_NACK ;
msg.dwObjectID = pmsg->dwObjectID ;
g_Network.Send2User(dwIndex, (char*)&msg, sizeof(MSGBASE)) ;
return ;
}
// 유저 정보 등록.
RegistPlayer_To_Lobby(pInfo, MP_CHATROOM_FORCE_ADD_USER_SYN) ;
}
//-------------------------------------------------------------------------------------------------
// NAME : ChatMsg_Normal_Syn
// DESC : 채팅방 내에서 메시지 처리를 하는 함수.
// DATE : APRIL 24, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::ChatMsg_Normal_Syn(DWORD dwIndex, char* pMsg, DWORD dwLength)
{
// 함수 파라메터 체크.
ASSERT(pMsg) ;
if(!pMsg)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 원본 메시지 변환.
MSG_CR_MSG_BROADCAST* pmsg = NULL ;
pmsg = (MSG_CR_MSG_BROADCAST*)pMsg ;
ASSERT(pmsg) ;
if(!pmsg)
{
Throw_Error(err_FCMTO, __FUNCTION__) ;
return ;
}
// 메시지 전송 처리.
USERINFO* pInfo ;
for(BYTE count = 0 ; count < pmsg->byCount ; ++count)
{
// 유저를 검색.
pInfo = NULL ;
pInfo = g_pUserTableForObjectID->FindUser(pmsg->dwUser[count]) ;
if(!pInfo) continue ;
MSG_CR_MSG msg ;
memset(&msg, 0, sizeof(MSG_CR_MSG)) ;
msg.Category = MP_CHATROOM ;
msg.Protocol = MP_CHATROOM_CHATMSG_NORMAL_NOTICE ;
msg.dwObjectID = pmsg->dwObjectID ;
SafeStrCpy(msg.name, pmsg->name, MAX_NAME_LENGTH + 1) ;
SafeStrCpy(msg.Msg, pmsg->Msg, MAX_CHAT_LENGTH + 1) ;
// 메시지를 유저에게 전송.
g_Network.Send2User(pInfo->dwConnectionIndex, (char*)&msg, sizeof(MSG_CR_MSG)) ;
}
// 다른 에이전트에도 전송.
if(pmsg->Protocol == MP_CHATROOM_CHATMSG_NORMAL_SYN)
{
MSG_CR_MSG_BROADCAST msg ;
memset(&msg, 0, sizeof(MSG_CR_MSG_BROADCAST)) ;
msg.Category = MP_CHATROOM ;
msg.Protocol = MP_CHATROOM_CHATMSG_NORMAL_NOTICE_OTHER_AGENT ;
msg.dwObjectID = pmsg->dwObjectID ;
SafeStrCpy(msg.name, pmsg->name, MAX_NAME_LENGTH + 1) ;
SafeStrCpy(msg.Msg, pmsg->Msg, MAX_CHAT_LENGTH+1) ;
for(BYTE count = 0 ; count < pmsg->byCount ; ++count)
{
msg.dwUser[count] = pmsg->dwUser[count] ;
++msg.byCount ;
}
// 다른 에이전트에 메시지를 전송.
g_Network.Send2AgentExceptThis((char*)&msg, sizeof(MSG_CR_MSG_BROADCAST)) ;
}
}
//-------------------------------------------------------------------------------------------------
// NAME : DestroyPlayer_From_Lobby
// DESC : 유저 정보를 삭제하는 함수.
// DATE : APRIL 2, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::DestroyPlayer_From_Lobby(USERINFO* pUserInfo)
{
// 함수 파라메터 체크.
ASSERT(pUserInfo) ;
if(!pUserInfo)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
if(pUserInfo->dwCharacterID == 0 || pUserInfo->dwUserID == 0) return ;
pUserInfo->byAddedChatSystem = FALSE ;
// 유저 삭제 요청을 보낸다.
MSGBASE msg ;
memset(&msg, 0, sizeof(MSGBASE)) ;
msg.Category = MP_CHATROOM ;
msg.Protocol = MP_CHATROOM_DEL_USER_SYN ;
msg.dwObjectID = pUserInfo->dwCharacterID ;
g_Network.Send2DistributeServer((char*)&msg, sizeof(MSGBASE)) ;
}
//-------------------------------------------------------------------------------------------------
// NAME : UpdatePlayerInfo
// DESC : 유저의 정보를 업데이트 시키는 함수.
// DATE : MARCH 31, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::UpdatePlayerInfo(USERINFO* pUserInfo)
{
// 함수 파라메터 체크.
ASSERT(pUserInfo) ;
if(!pUserInfo)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 임시 유저 데이터.
ST_CR_USER guest ;
memset(&guest, 0, sizeof(ST_CR_USER)) ;
for(BYTE count = 0 ; count < MAX_CHARACTER_NUM ; ++count)
{
if(pUserInfo->SelectInfoArray[count].dwCharacterID != pUserInfo->dwCharacterID) continue ;
// 캐릭터 정보를 받는다.
//guest.wClassIdx = pUserInfo->SelectInfoArray[count].wClassIndex ;
guest.byLevel = (BYTE)pUserInfo->SelectInfoArray[count].Level ;
guest.byMapNum = (BYTE)pUserInfo->SelectInfoArray[count].MapNum ;
strcpy(guest.name, pUserInfo->SelectInfoArray[count].name) ;
MSG_CR_USER msg ;
memset(&msg, 0, sizeof(MSG_CR_USER)) ;
msg.Category = MP_CHATROOM ;
msg.Protocol = MP_CHATROOM_UPDATE_USERINFO_SYN ;
msg.dwObjectID = pUserInfo->dwCharacterID ;
msg.user.byLevel = guest.byLevel ;
msg.user.byMapNum = guest.byMapNum ;
//msg.user.wClassIdx = guest.wClassIdx ;
SafeStrCpy(msg.user.name, guest.name, MAX_NAME_LENGTH + 1) ;
g_Network.Send2DistributeServer((char*)&msg, sizeof(MSG_CR_USER)) ;
break ;
}
}
//-------------------------------------------------------------------------------------------------
// NAME : UserMsgParser
// DESC : 유저로 부터 오는 네트워크 메시지 처리를 하는 함수.
// DATE : MARCH 31, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::UserMsgParser(DWORD dwIndex, char* pMsg, DWORD dwLength)
{
// 함수 파라메터 체크.
ASSERT(pMsg) ;
if(!pMsg)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 기본 메시지 변환.
MSGBASE* pmsg = NULL ;
pmsg = (MSGBASE*)pMsg ;
ASSERT(pmsg) ;
if(!pmsg)
{
Throw_Error(err_FCMTB, __FUNCTION__) ;
return ;
}
// 프로토콜 체크.
switch(pmsg->Protocol)
{
case MP_CHATROOM_FORCE_ADD_USER_SYN : ForceRegistPlayer_To_Lobby(dwIndex, pMsg, dwLength) ; break ;
case MP_CHATROOM_CHATMSG_NORMAL_SYN : ChatMsg_Normal_Syn(dwIndex, pMsg, dwLength) ; break ;
default : g_Network.Send2DistributeServer(pMsg, dwLength) ; break ;
}
}
//-------------------------------------------------------------------------------------------------
// NAME : ServerMsgParser
// DESC : 서버로 부터 오는 네트워크 메시지 처리를 하는 합수.
// DATE : MARCH 31, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::ServerMsgParser(DWORD dwIndex, char* pMsg, DWORD dwLength)
{
// 함수 파라메터 체크.
ASSERT(pMsg) ;
if(!pMsg)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 기본 메시지 변환.
MSGBASE* pmsg = NULL ;
pmsg = (MSGBASE*)pMsg ;
ASSERT(pmsg) ;
if(!pmsg)
{
Throw_Error(err_FCMTB, __FUNCTION__) ;
return ;
}
// 프로토콜 확인.
switch(pmsg->Protocol)
{
case MP_CHATROOM_ADD_USER_ACK :
case MP_CHATROOM_ROOMLIST_ACK :
case MP_CHATROOM_ROOMLIST_NACK :
case MP_CHATROOM_CREATE_ROOM_ACK :
case MP_CHATROOM_CREATE_ROOM_NACK :
case MP_CHATROOM_JOIN_ROOM_ACK :
case MP_CHATROOM_JOIN_ROOM_NACK :
case MP_CHATROOM_OUT_ROOM_ACK :
case MP_CHATROOM_OUT_ROOM_NACK :
case MP_CHATROOM_OUT_ROOM_EMPTYROOM :
case MP_CHATROOM_OUT_ROOM_LAST_MAN :
case MP_CHATROOM_CHANGE_OPTION_NACK :
case MP_CHATROOM_CHANGE_OWNER_NACK :
case MP_CHATROOM_KICK_GUEST_NACK :
case MP_CHATROOM_REQUEST_FRIEND_NACK :
case MP_CHATROOM_CHATMSG_NORMAL_NACK :
case MP_CHATROOM_SEARCH_FOR_NAME_ACK :
case MP_CHATROOM_SEARCH_FOR_NAME_NACK :
case MP_CHATROOM_SEARCH_FOR_TITLE_ACK :
case MP_CHATROOM_SEARCH_FOR_TITLE_NACK :
case MP_CHATROOM_UPDATEINFO_CREATED_ROOM :
case MP_CHATROOM_UPDATEINFO_DELETED_ROOM :
case MP_CHATROOM_UPDATEINFO_SECRETMODE :
case MP_CHATROOM_UPDATEINFO_ROOMTYPE :
case MP_CHATROOM_UPDATEINFO_TITLE :
case MP_CHATROOM_UPDATEINFO_CUR_GUESTCOUNT :
case MP_CHATROOM_UPDATEINFO_TOTAL_GUESTCOUNT : SendMsg2User(dwIndex, pMsg, dwLength) ; break ;
case MP_CHATROOM_JOIN_ROOM_NOTICE :
case MP_CHATROOM_JOIN_ROOM_OTHER_AGENT : Join_Room_Notice(dwIndex, pMsg, dwLength) ; break ;
case MP_CHATROOM_OUT_ROOM_NOTICE :
case MP_CHATROOM_OUT_ROOM_NOTICE_OTHER_AGENT : Out_Room_Notice(dwIndex, pMsg, dwLength) ; break ;
case MP_CHATROOM_OUT_ROOM_CHANGE_OWNER_NOTICE :
case MP_CHATROOM_OUT_ROOM_CHANGE_OWNER_NOTICE_OTHER_AGENT : Out_Room_Change_Owner_Notcie(dwIndex, pMsg, dwLength) ; break ;
case MP_CHATROOM_CHANGE_OPTION_NOTICE :
case MP_CHATROOM_CHANGE_OPTION_NOTICE_OTHER_AGENT : Change_Option_Notice(dwIndex, pMsg, dwLength) ; break ;
case MP_CHATROOM_CHANGE_OWNER_NOTICE :
case MP_CHATROOM_CHANGE_OWNER_NOTICE_OTHER_AGENT : Change_Owner_Notice(dwIndex, pMsg, dwLength) ; break ;
case MP_CHATROOM_KICK_GUEST_ACK :
case MP_CHATROOM_KICK_GUEST_ACK_OTHER_AGENT : Kick_Guest_Ack(dwIndex, pMsg, dwLength) ; break ;
case MP_CHATROOM_KICK_GUEST_NOTICE :
case MP_CHATROOM_KICK_GUEST_NOTICE_OTHER_AGENT : Kick_Guest_Notice(dwIndex, pMsg, dwLength) ; break ;
case MP_CHATROOM_REQUEST_FRIEND_ACK : Request_Friend_Ack(dwIndex, pMsg, dwLength) ; break ;
case MP_CHATROOM_CHATMSG_NORMAL_NOTICE_OTHER_AGENT : ChatMsg_Normal_Syn(dwIndex, pMsg, dwLength) ; break ;
default : break ;
}
}
//-------------------------------------------------------------------------------------------------
// NAME : SendMsg2User
// DESC : 서버(Dist)로 부터 전달 된 메시지를 클라이언트로 전송.
// DATE : APRIL 2, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::SendMsg2User(DWORD dwIndex, char* pMsg, DWORD dwLength)
{
// 함수 파라메터 체크.
ASSERT(pMsg) ;
if(!pMsg)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 원본 메시지 변환.
MSGBASE* pmsg = NULL ;
pmsg = (MSGBASE*)pMsg ;
ASSERT(pmsg) ;
if(!pmsg)
{
Throw_Error(err_FCMTO, __FUNCTION__) ;
return ;
}
// 유저 찾기.
USERINFO* pInfo = NULL ;
pInfo = g_pUserTableForObjectID->FindUser(pmsg->dwObjectID) ;
if(!pInfo) return ;
// 메시지 전달.
g_Network.Send2User(pInfo->dwConnectionIndex, pMsg, dwLength) ;
}
//-------------------------------------------------------------------------------------------------
// NAME : Join_Room_Ack
// :
// DESC : 채팅방 참여 성공 처리를 하는 함수.
// :
// : 1. 전송용 메시지 선언.
// : 2. 유저 검색.
// : 3. 참가한 유저일경우는 성공 메시지 전송.
// : 4. 참가한 유저가 아닐경우에는 참여 공지 전송.
// : 5. 다른 에이전트에도 같은 방식으로 전송.
// :
// DATE : APRIL 7, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::Join_Room_Notice(DWORD dwIndex, char* pMsg, DWORD dwLength)
{
// 함수 파라메터 체크.
ASSERT(pMsg) ;
if(!pMsg)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 원본 메시지 변환.
MSG_CR_JOIN_NOTICE* pmsg = NULL ;
pmsg = (MSG_CR_JOIN_NOTICE*)pMsg ;
ASSERT(pmsg) ;
if(!pmsg)
{
Throw_Error(err_FCMTO, __FUNCTION__) ;
return ;
}
// 많이 사용되는 연산 - 사이즈 받기.
int nSize = 0 ;
nSize = sizeof(MSG_CR_JOIN_NOTICE) ;
USERINFO* pInfo ;
for(BYTE count = 0 ; count < pmsg->byCount ; ++count)
{
// 유저를 검색.
pInfo = NULL ;
pInfo = g_pUserTableForObjectID->FindUser(pmsg->dwUser[count]) ;
if(!pInfo) continue ;
// 메시지를 복사.
MSG_CR_JOIN_NOTICE sendMsg ;
memset(&sendMsg, 0, nSize) ;
memcpy(&sendMsg, pmsg, nSize) ;
sendMsg.Protocol = MP_CHATROOM_JOIN_ROOM_NOTICE ;
// 메시지를 유저에게 전송.
g_Network.Send2User(pInfo->dwConnectionIndex, (char*)&sendMsg, nSize) ;
}
// 다른 에이전트에도 전송.
if(pmsg->Protocol == MP_CHATROOM_JOIN_ROOM_NOTICE)
{
// 메시지를 복사.
MSG_CR_JOIN_NOTICE sendMsg ;
memset(&sendMsg, 0, nSize) ;
memcpy(&sendMsg, pmsg, nSize) ;
// 다른 에이전트에게 전송 할 프로토콜 세팅.
sendMsg.Protocol = MP_CHATROOM_JOIN_ROOM_OTHER_AGENT ;
// 다른 에이전트에 메시지를 전송.
g_Network.Send2AgentExceptThis((char*)&sendMsg, nSize) ;
}
}
//-------------------------------------------------------------------------------------------------
// NAME : Out_Room_Notice
// :
// DESC : 채팅방 나가기 성공 처리를 하는 함수.
// :
// : 1. 유저 검색.
// : 2. 나가는 유저일경우는 성공 메시지 전송.
// : 3. 나가는 유저가 아닐경우에는 참여 공지 전송.
// : 4. 다른 에이전트에도 같은 방식으로 전송.
// :
// DATE : APRIL 7, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::Out_Room_Notice(DWORD dwIndex, char* pMsg, DWORD dwLength)
{
// 함수 파라메터 체크.
ASSERT(pMsg) ;
if(!pMsg)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 원본 메시지 변환.
MSG_CR_IDNAME* pmsg = NULL ;
pmsg = (MSG_CR_IDNAME*)pMsg ;
ASSERT(pmsg) ;
if(!pmsg)
{
Throw_Error(err_FCMTO, __FUNCTION__) ;
return ;
}
// 많이 사용되는 연산 - 사이즈 받기.
int nSize = 0 ;
nSize = sizeof(MSG_CR_IDNAME) ;
USERINFO* pInfo ;
for(BYTE count = 0 ; count < pmsg->byCount ; ++count)
{
// 유저를 검색.
pInfo = NULL ;
pInfo = g_pUserTableForObjectID->FindUser(pmsg->dwUser[count]) ;
if(!pInfo) continue ;
// 메시지를 복사.
MSG_CR_IDNAME sendMsg ;
memset(&sendMsg, 0, nSize) ;
memcpy(&sendMsg, pmsg, nSize) ;
sendMsg.Protocol = MP_CHATROOM_OUT_ROOM_NOTICE ;
// 메시지를 유저에게 전송.
g_Network.Send2User(pInfo->dwConnectionIndex, (char*)&sendMsg, nSize) ;
}
// 다른 에이전트에도 전송.
if(pmsg->Protocol == MP_CHATROOM_OUT_ROOM_NOTICE)
{
// 메시지를 복사.
MSG_CR_IDNAME sendMsg ;
memset(&sendMsg, 0, nSize) ;
memcpy(&sendMsg, pmsg, nSize) ;
// 다른 에이전트에게 전송 할 프로토콜 세팅.
sendMsg.Protocol = MP_CHATROOM_OUT_ROOM_NOTICE_OTHER_AGENT ;
// 다른 에이전트에 메시지를 전송.
g_Network.Send2AgentExceptThis((char*)&sendMsg, nSize) ;
}
}
//-------------------------------------------------------------------------------------------------
// NAME : Out_Room_Change_Owner_Notcie
// :
// DESC : 채팅방을 나간 사람 처리를 하는데, 방장이 정상적이지 않은 경로로 나갔을 때 처리하는 함수.
// :
// : 1. 유저 검색.
// : 2. 메시지 전송.
// : 3. 다른 에이전트에도 같은 방식으로 전송.
// :
// DATE : APRIL 14, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::Out_Room_Change_Owner_Notcie(DWORD dwIndex, char* pMsg, DWORD dwLength)
{
// 함수 파라메터 체크.
ASSERT(pMsg) ;
if(!pMsg)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 원본 메시지 변환.
MSG_CR_IDNAME* pmsg = NULL ;
pmsg = (MSG_CR_IDNAME*)pMsg ;
ASSERT(pmsg) ;
if(!pmsg)
{
Throw_Error(err_FCMTO, __FUNCTION__) ;
return ;
}
// 많이 사용되는 연산 - 사이즈 받기.
int nSize = 0 ;
nSize = sizeof(MSG_CR_IDNAME) ;
USERINFO* pInfo ;
for(BYTE count = 0 ; count < pmsg->byCount ; ++count)
{
// 유저를 검색.
pInfo = NULL ;
pInfo = g_pUserTableForObjectID->FindUser(pmsg->dwUser[count]) ;
if(!pInfo) continue ;
// 메시지를 복사.
MSG_CR_IDNAME sendMsg ;
memset(&sendMsg, 0, nSize) ;
memcpy(&sendMsg, pmsg, nSize) ;
sendMsg.Protocol = MP_CHATROOM_OUT_ROOM_CHANGE_OWNER_NOTICE ;
// 메시지를 유저에게 전송.
g_Network.Send2User(pInfo->dwConnectionIndex, (char*)&sendMsg, nSize) ;
}
// 다른 에이전트에도 전송.
if(pmsg->Protocol == MP_CHATROOM_OUT_ROOM_CHANGE_OWNER_NOTICE)
{
// 메시지를 복사.
MSG_CR_IDNAME sendMsg ;
memset(&sendMsg, 0, nSize) ;
memcpy(&sendMsg, pmsg, nSize) ;
// 다른 에이전트에게 전송 할 프로토콜 세팅.
sendMsg.Protocol = MP_CHATROOM_OUT_ROOM_CHANGE_OWNER_NOTICE_OTHER_AGENT ;
// 다른 에이전트에 메시지를 전송.
g_Network.Send2AgentExceptThis((char*)&sendMsg, nSize) ;
}
}
//-------------------------------------------------------------------------------------------------
// NAME : Change_Option_Notice
// :
// DESC : 채팅방 옵션이 변경되었다는 처리를 하는 함수.
// :
// : 1. 유저 검색.
// : 2. 메시지 전송.
// : 3. 다른 에이전트에도 같은 방식으로 전송.
// :
// DATE : APRIL 14, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::Change_Option_Notice(DWORD dwIndex, char* pMsg, DWORD dwLength)
{
// 함수 파라메터 체크.
ASSERT(pMsg) ;
if(!pMsg)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 원본 메시지 변환.
MSG_CR_ROOM_NOTICE* pmsg = NULL ;
pmsg = (MSG_CR_ROOM_NOTICE*)pMsg ;
ASSERT(pmsg) ;
if(!pmsg)
{
Throw_Error(err_FCMTO, __FUNCTION__) ;
return ;
}
// 많이 사용되는 연산 - 사이즈 받기.
int nSize = 0 ;
nSize = sizeof(MSG_CR_ROOM_NOTICE) ;
USERINFO* pInfo ;
for(BYTE count = 0 ; count < pmsg->byCount ; ++count)
{
// 유저를 검색.
pInfo = NULL ;
pInfo = g_pUserTableForObjectID->FindUser(pmsg->dwUser[count]) ;
if(!pInfo) continue ;
// 메시지를 복사.
MSG_CR_ROOM_NOTICE sendMsg ;
memset(&sendMsg, 0, nSize) ;
memcpy(&sendMsg, pmsg, nSize) ;
sendMsg.Protocol = MP_CHATROOM_CHANGE_OPTION_NOTICE ;
// 메시지를 유저에게 전송.
g_Network.Send2User(pInfo->dwConnectionIndex, (char*)&sendMsg, nSize) ;
}
// 다른 에이전트에도 전송.
if(pmsg->Protocol == MP_CHATROOM_CHANGE_OPTION_NOTICE)
{
// 메시지를 복사.
MSG_CR_ROOM_NOTICE sendMsg ;
memset(&sendMsg, 0, nSize) ;
memcpy(&sendMsg, pmsg, nSize) ;
// 다른 에이전트에게 전송 할 프로토콜 세팅.
sendMsg.Protocol = MP_CHATROOM_CHANGE_OPTION_NOTICE_OTHER_AGENT ;
// 다른 에이전트에 메시지를 전송.
g_Network.Send2AgentExceptThis((char*)&sendMsg, nSize) ;
}
}
//-------------------------------------------------------------------------------------------------
// NAME : Change_Owner_Notice
// :
// DESC : 방장 변경 성공 처리를 하는 함수.
// :
// : 1. 유저 검색.
// : 2. 메시지 전송.
// : 3. 다른 에이전트에도 같은 방식으로 전송.
// :
// DATE : APRIL 14, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::Change_Owner_Notice(DWORD dwIndex, char* pMsg, DWORD dwLength)
{
// 함수 파라메터 체크.
ASSERT(pMsg) ;
if(!pMsg)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 원본 메시지 변환.
MSG_CR_IDNAME* pmsg = NULL ;
pmsg = (MSG_CR_IDNAME*)pMsg ;
ASSERT(pmsg) ;
if(!pmsg)
{
Throw_Error(err_FCMTO, __FUNCTION__) ;
return ;
}
// 많이 사용되는 연산 - 사이즈 받기.
int nSize = 0 ;
nSize = sizeof(MSG_CR_IDNAME) ;
// 유저 수 만큼 루프.
USERINFO* pInfo ;
for(BYTE count = 0 ; count < pmsg->byCount ; ++count)
{
// 유저를 검색.
pInfo = NULL ;
pInfo = g_pUserTableForObjectID->FindUser(pmsg->dwUser[count]) ;
if(!pInfo) continue ;
// 메시지를 복사.
MSG_CR_IDNAME sendMsg ;
memset(&sendMsg, 0, nSize) ;
memcpy(&sendMsg, pmsg, nSize) ;
sendMsg.Protocol = MP_CHATROOM_CHANGE_OWNER_NOTICE ;
// 메시지를 유저에게 전송.
g_Network.Send2User(pInfo->dwConnectionIndex, (char*)&sendMsg, nSize) ;
}
// 다른 에이전트에도 전송.
if(pmsg->Protocol == MP_CHATROOM_CHANGE_OWNER_NOTICE)
{
// 메시지를 복사.
MSG_CR_IDNAME sendMsg ;
memset(&sendMsg, 0, nSize) ;
memcpy(&sendMsg, pmsg, nSize) ;
// 다른 에이전트에게 전송 할 프로토콜 세팅.
sendMsg.Protocol = MP_CHATROOM_CHANGE_OWNER_NOTICE_OTHER_AGENT ;
// 다른 에이전트에 메시지를 전송.
g_Network.Send2AgentExceptThis((char*)&sendMsg, nSize) ;
}
}
//-------------------------------------------------------------------------------------------------
// NAME : Kick_Guest_Ack
// :
// DESC : 강제 퇴장 당한 사람에게 전하는 처리.
// :
// : 1. 유저 검색.
// : 2. 메시지 전송.
// : 3. 다른 에이전트에도 같은 방식으로 전송.
// :
// DATE : APRIL 14, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::Kick_Guest_Ack(DWORD dwIndex, char* pMsg, DWORD dwLength)
{
// 함수 파라메터 체크.
ASSERT(pMsg) ;
if(!pMsg)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 원본 메시지 변환.
MSG_CR_KICK_ACK* pmsg = NULL ;
pmsg = (MSG_CR_KICK_ACK*)pMsg ;
ASSERT(pmsg) ;
if(!pmsg)
{
Throw_Error(err_FCMTO, __FUNCTION__) ;
return ;
}
// 많이 사용되는 연산 - 사이즈 받기.
int nSize = 0 ;
nSize = sizeof(MSG_CR_KICK_ACK) ;
// 유저를 검색.
USERINFO* pInfo = NULL ;
pInfo = g_pUserTableForObjectID->FindUser(pmsg->dwKickPlayer) ;
if(pInfo)
{
// 메시지를 복사.
MSG_CR_KICK_ACK sendMsg ;
memset(&sendMsg, 0, nSize) ;
memcpy(&sendMsg, pmsg, nSize) ;
sendMsg.Protocol = MP_CHATROOM_KICK_GUEST_ACK ;
// 메시지를 유저에게 전송.
g_Network.Send2User(pInfo->dwConnectionIndex, (char*)&sendMsg, nSize) ;
}
else
{
// 다른 에이전트에도 전송.
if(pmsg->Protocol == MP_CHATROOM_KICK_GUEST_ACK)
{
// 메시지를 복사.
MSG_CR_KICK_ACK sendMsg ;
memset(&sendMsg, 0, nSize) ;
memcpy(&sendMsg, pmsg, nSize) ;
// 다른 에이전트에게 전송 할 프로토콜 세팅.
sendMsg.Protocol = MP_CHATROOM_KICK_GUEST_ACK_OTHER_AGENT ;
// 다른 에이전트에 메시지를 전송.
g_Network.Send2AgentExceptThis((char*)&sendMsg, nSize) ;
}
}
}
//-------------------------------------------------------------------------------------------------
// NAME : Kick_Guest_Notice
// :
// DESC : 강제 퇴장 성공 처리를 하는 함수.
// :
// : 1. 유저 검색.
// : 2. 메시지 전송.
// : 3. 다른 에이전트에도 같은 방식으로 전송.
// :
// DATE : APRIL 14, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::Kick_Guest_Notice(DWORD dwIndex, char* pMsg, DWORD dwLength)
{
// 함수 파라메터 체크.
ASSERT(pMsg) ;
if(!pMsg)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 원본 메시지 변환.
MSG_CR_IDNAME* pmsg = NULL ;
pmsg = (MSG_CR_IDNAME*)pMsg ;
ASSERT(pmsg) ;
if(!pmsg)
{
Throw_Error(err_FCMTO, __FUNCTION__) ;
return ;
}
// 많이 사용되는 연산 - 사이즈 받기.
int nSize = 0 ;
nSize = sizeof(MSG_CR_IDNAME) ;
// 유저 수 만큼 루프.
USERINFO* pInfo ;
for(BYTE count = 0 ; count < pmsg->byCount ; ++count)
{
// 유저를 검색.
pInfo = NULL ;
pInfo = g_pUserTableForObjectID->FindUser(pmsg->dwUser[count]) ;
if(!pInfo) continue ;
// 메시지를 복사.
MSG_CR_IDNAME sendMsg ;
memset(&sendMsg, 0, nSize) ;
memcpy(&sendMsg, pmsg, nSize) ;
sendMsg.Protocol = MP_CHATROOM_KICK_GUEST_NOTICE ;
// 메시지를 유저에게 전송.
g_Network.Send2User(pInfo->dwConnectionIndex, (char*)&sendMsg, nSize) ;
}
// 다른 에이전트에도 전송.
if(pmsg->Protocol == MP_CHATROOM_KICK_GUEST_NOTICE)
{
// 메시지를 복사.
MSG_CR_IDNAME sendMsg ;
memset(&sendMsg, 0, nSize) ;
memcpy(&sendMsg, pmsg, nSize) ;
// 다른 에이전트에게 전송 할 프로토콜 세팅.
sendMsg.Protocol = MP_CHATROOM_KICK_GUEST_NOTICE_OTHER_AGENT ;
// 다른 에이전트에 메시지를 전송.
g_Network.Send2AgentExceptThis((char*)&sendMsg, nSize) ;
}
}
////-------------------------------------------------------------------------------------------------
//// NAME : ChatMsg_Normal_Notice
//// :
//// DESC : 채팅방 내 메시지 전송 처리를 하는 함수.
//// :
//// DESC : 강제 퇴장 성공 처리를 하는 함수.
//// :
//// : 1. 유저 검색.
//// : 2. 메시지 전송.
//// : 3. 다른 에이전트에도 같은 방식으로 전송.
//// :
//// DATE : APRIL 14, 2008 LYW
////-------------------------------------------------------------------------------------------------
//void CChatRoomMgr::ChatMsg_Normal_Notice(DWORD dwIndex, char* pMsg, DWORD dwLength)
//{
// // 함수 파라메터 체크.
// ASSERT(pMsg) ;
//
// if(!pMsg)
// {
// Throw_Error(err_IMP, __FUNCTION__) ;
// return ;
// }
//
// // 원본 메시지 변환.
// MSG_CR_MSG_RESULT* pmsg = NULL ;
// pmsg = (MSG_CR_MSG_RESULT*)pMsg ;
//
// ASSERT(pmsg) ;
//
// if(!pmsg)
// {
// Throw_Error(err_FCMTO, __FUNCTION__) ;
// return ;
// }
//
// // 많이 사용되는 연산 - 사이즈 받기.
// int nSize = 0 ;
// nSize = sizeof(MSG_CR_MSG_RESULT) ;
//
// // 유저 수 만큼 루프.
// USERINFO* pInfo ;
// for(BYTE count = 0 ; count < pmsg->byCount ; ++count)
// {
// // 유저를 검색.
// pInfo = NULL ;
// pInfo = g_pUserTableForObjectID->FindUser(pmsg->dwUser[count]) ;
//
// if(!pInfo) continue ;
//
// // 메시지를 복사.
// MSG_CR_MSG_RESULT sendMsg ;
// memset(&sendMsg, 0, nSize) ;
// memcpy(&sendMsg, pmsg, nSize) ;
//
// // 메시지를 유저에게 전송.
// g_Network.Send2User(pInfo->dwConnectionIndex, (char*)&sendMsg, nSize) ;
// }
//
// // 다른 에이전트에도 전송.
// if(pmsg->Protocol == MP_CHATROOM_CHATMSG_NORMAL_NOTICE)
// {
// // 메시지를 복사.
// MSG_CR_MSG_RESULT sendMsg ;
// memset(&sendMsg, 0, nSize) ;
// memcpy(&sendMsg, pmsg, nSize) ;
//
// // 다른 에이전트에게 전송 할 프로토콜 세팅.
// sendMsg.Protocol = MP_CHATROOM_CHATMSG_NORMAL_NOTICE_OTHER_AGENT ;
//
// // 다른 에이전트에 메시지를 전송.
// g_Network.Send2AgentExceptThis((char*)&sendMsg, nSize) ;
// }
//}
//-------------------------------------------------------------------------------------------------
// NAME : Request_Friend_Ack
// :
// DESC : 친구 요청 체크 성공 처리를 하는 함수.
// :
// : 1. 유저 찾기.
// : 2. 친구 추가 처리.
// :
// DATE : APRIL 14, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::Request_Friend_Ack(DWORD dwIndex, char* pMsg, DWORD dwLength)
{
// 함수 파라메터 체크.
ASSERT(pMsg) ;
if(!pMsg)
{
Throw_Error(err_IMP, __FUNCTION__) ;
return ;
}
// 원본 메시지 변환.
MSG_NAME* pmsg = NULL ;
pmsg = (MSG_NAME*)pMsg ;
ASSERT(pmsg) ;
if(!pmsg)
{
Throw_Error(err_FCMTO, __FUNCTION__) ;
return ;
}
// 유저 찾기.
USERINFO * userinfo = NULL ;
userinfo = (USERINFO *)g_pUserTableForObjectID->FindUser(pmsg->dwObjectID) ;
if(!userinfo) return ;
// 친구 추가 처리.
// 080704 LYW --- ChatRoomMgr : 임시 버퍼 사이즈 확장.
//char buf[MAX_NAME_LENGTH+1] = {0, } ;
//SafeStrCpy( buf, pmsg->Name, MAX_NAME_LENGTH+1 ) ;
char buf[257] = {0, } ;
SafeStrCpy( buf, pmsg->Name, 256 ) ;
//금지문자 체크 "'"등...
if( FILTERTABLE->IsInvalidCharInclude( (unsigned char*) buf ) ) return ;
// 100305 ONS 허락여부를 묻지않고 친구를 추가하도록 수정.
FriendAddFriendByName(pmsg->dwObjectID, buf) ;
}
//-------------------------------------------------------------------------------------------------
// NAME : Error
// DESC : 채팅방 내, 에러 메시지 관련 로그를 남기는 함수.
// DATE : APRIL 14, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::Throw_Error(BYTE errType, char* szCaption)
{
// 함수 파라메터 체크.
ASSERT(szCaption) ;
if(!szCaption || strlen(szCaption) <= 1)
{
#ifdef _USE_ERR_MSGBOX_
MessageBox( NULL, "Invalid Caption!!", "Throw_Error", MB_OK) ;
#else
// 080704 LYW --- ChatRoomMgr : 임시 버퍼 사이즈 확장.
//char tempStr[128] = {0, } ;
//SafeStrCpy(tempStr, __FUNCTION__, 128) ;
char tempStr[257] = {0, } ;
SafeStrCpy(tempStr, __FUNCTION__, 256) ;
strcat(tempStr, " - ") ;
strcat(tempStr, "Invalid Caption!!") ;
WriteLog(tempStr) ;
#endif //_USE_ERR_MSGBOX_
return ;
}
// 080704 LYW --- ChatRoomMgr : 임시 버퍼 사이즈 확장.
// 에러 타입 확인.
//char tempErr[128] = {0, } ;
//switch(errType)
//{
//case err_IMP : SafeStrCpy(tempErr, "Invalid a message parameter!!", 128) ; break ;
//case err_FCMTB : SafeStrCpy(tempErr, "Failed to convert a message to base!!", 128) ; break ;
//case err_FCMTO : SafeStrCpy(tempErr, "Failed to convert a message to original!!", 128) ; break ;
//case err_FRUI : SafeStrCpy(tempErr, "Failed to receive a user info!!", 128) ; break ;
//default : break ;
//}
char tempErr[257] = {0, } ;
switch(errType)
{
case err_IMP : SafeStrCpy(tempErr, "Invalid a message parameter!!", 256) ; break ;
case err_FCMTB : SafeStrCpy(tempErr, "Failed to convert a message to base!!", 256) ; break ;
case err_FCMTO : SafeStrCpy(tempErr, "Failed to convert a message to original!!", 256) ; break ;
case err_FRUI : SafeStrCpy(tempErr, "Failed to receive a user info!!", 256) ; break ;
default : break ;
}
// 에러 출력/로그.
#ifdef _USE_ERR_MSGBOX_
MessageBox( NULL, tempErr, szCaption, MB_OK) ;
#else
// 080704 LYW --- ChatRoomMgr : 임시 버퍼 사이즈 확장.
//char tempStr[128] = {0, } ;
//SafeStrCpy(tempStr, szCaption, 128) ;
char tempStr[257] = {0, } ;
SafeStrCpy(tempStr, szCaption, 256) ;
strcat(tempStr, " - ") ;
strcat(tempStr, tempErr) ;
WriteLog(tempStr) ;
#endif //_USE_ERR_MSGBOX_
}
//-------------------------------------------------------------------------------------------------
// NAME : Throw_Error
// DESC : 채팅방 내, 에러 메시지 관련 로그를 남기는 함수.
// DATE : APRIL 14, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::Throw_Error(char* szErr, char* szCaption)
{
// 함수 파라메터 체크.
ASSERT(szCaption) ;
if(!szErr || strlen(szErr) <= 1)
{
#ifdef _USE_ERR_MSGBOX_
MessageBox( NULL, "Invalid err message!!", "Throw_Error", MB_OK) ;
#else
// 080704 LYW --- ChatRoomMgr : 임시 버퍼 사이즈 확장.
//char tempStr[128] = {0, } ;
//SafeStrCpy(tempStr, __FUNCTION__, 128) ;
char tempStr[257] = {0, } ;
SafeStrCpy(tempStr, __FUNCTION__, 256) ;
strcat(tempStr, " - ") ;
strcat(tempStr, "Invalid err message!!") ;
WriteLog(tempStr) ;
#endif //_USE_ERR_MSGBOX_
return ;
}
if(!szCaption || strlen(szCaption) <= 1)
{
#ifdef _USE_ERR_MSGBOX_
MessageBox( NULL, "Invalid Caption!!", "Throw_Error", MB_OK) ;
#else
// 080704 LYW --- ChatRoomMgr : 임시 버퍼 사이즈 확장.
//char tempStr[128] = {0, } ;
//SafeStrCpy(tempStr, __FUNCTION__, 128) ;
char tempStr[257] = {0, } ;
SafeStrCpy(tempStr, __FUNCTION__, 256) ;
strcat(tempStr, " - ") ;
strcat(tempStr, "Invalid Caption!!") ;
WriteLog(tempStr) ;
#endif //_USE_ERR_MSGBOX_
return ;
}
// 에러 출력/로그.
#ifdef _USE_ERR_MSGBOX_
MessageBox( NULL, szErr, szCaption, MB_OK) ;
#else
// 080704 LYW --- ChatRoomMgr : 임시 버퍼 사이즈 확장.
//char tempStr[128] = {0, } ;
//SafeStrCpy(tempStr, szCaption, 128) ;
char tempStr[257] = {0, } ;
SafeStrCpy(tempStr, szCaption, 256) ;
strcat(tempStr, " - ") ;
strcat(tempStr, szErr) ;
WriteLog(tempStr) ;
#endif //_USE_ERR_MSGBOX_
}
//-------------------------------------------------------------------------------------------------
// NAME : WriteLog
// DESC : 채팅방 내, 에러 메시지 관련 로그를 남기는 함수.
// DATE : APRIL 14, 2008 LYW
//-------------------------------------------------------------------------------------------------
void CChatRoomMgr::WriteLog(char* pMsg)
{
SYSTEMTIME time ;
GetLocalTime(&time) ;
TCHAR szTime[_MAX_PATH] = {0, } ;
sprintf(szTime, "%04d-%02d-%02d %02d:%02d:%02d", time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond) ;
FILE *fp = fopen("Log/Agent-ChatRoomErr.log", "a+");
if (fp)
{
fprintf(fp, "%s [%s]\n", pMsg, szTime);
fclose(fp);
}
}
| [
"brandonroode75@gmail.com"
] | brandonroode75@gmail.com |
d2904c7ddab1f5a017c23938d3583fdb1db8f1f8 | 3c833cbb5c47831a91a99e9ecf904c51ad8fa7bc | /lib/handler/src/ConnectionHandler.cpp | 48ea908e96befd3558beb1521aa8367c4d89218a | [
"MIT"
] | permissive | blockspacer/Adventure2019 | 1dd3859f2ee9c50f9ad5d5bdd6d424ecd2b799f6 | a07b6ffee7ee196d9f499aa145906732ee067af0 | refs/heads/master | 2021-02-12T20:30:17.528264 | 2019-04-06T07:07:08 | 2019-04-06T07:07:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 987 | cpp | //
// Created by steph on 3/14/2019.
//
#include <ConnectionHandler.h>
#include "ConnectionHandler.h"
ConnectionHandler::ConnectionHandler(std::vector<Connection> &clients,
std::vector<Connection> &newClients,
std::vector<Connection> &disconnectedClients,
std::function<void(const Connection &)> disconnectFn)
: clients(clients),
newClients(newClients),
disconnectedClients(disconnectedClients),
disconnectFn(std::move(disconnectFn)) {}
std::vector<Connection> &ConnectionHandler::getClients() {
return this->clients;
}
std::vector<Connection> &ConnectionHandler::getNewClients() {
return this->newClients;
}
std::vector<Connection> &ConnectionHandler::getDisconnectedClients() {
return this->disconnectedClients;
}
void ConnectionHandler::disconnectClient(const Connection &client) {
this->disconnectFn(client);
}
| [
"stephen_wanhella@sfu.ca"
] | stephen_wanhella@sfu.ca |
a0c4507989c4a271d7ec4bad4b3bed712c8095c7 | c67a30c7d6a7329392b9274b1c0d5debb876dda7 | /src/engine/asmjs/input_system.cpp | cc6c474a0b394012a70e7dac4ae5c4474984f85b | [
"MIT"
] | permissive | yyyy3531614/LumixEngine | bb117210fe44f222bb973d2bda0f9fa4ab531baf | d39be9a5a84acd27e4bae1814c3020ef8ad98401 | refs/heads/master | 2021-07-05T20:02:08.031574 | 2017-09-30T12:18:58 | 2017-09-30T12:18:58 | 105,466,232 | 1 | 0 | null | 2017-10-01T18:59:57 | 2017-10-01T18:59:57 | null | UTF-8 | C++ | false | false | 1,191 | cpp | #include "engine/input_system.h"
#include "engine/associative_array.h"
#include "engine/profiler.h"
#include "engine/string.h"
#include "engine/vec.h"
namespace Lumix
{
struct InputSystemImpl : public InputSystem
{
InputSystemImpl(IAllocator& allocator) : m_allocator(allocator) {}
bool create() { return false; }
void enable(bool enabled) override {}
void update(float dt) override {}
float getActionValue(u32 action) override { return 0; }
void injectMouseXMove(float value) override {}
void injectMouseYMove(float value) override {}
float getMouseXMove() const override { return 0; }
float getMouseYMove() const override { return 0; }
void addAction(u32 action, InputType type, int key, int controller_id) override {}
IAllocator& m_allocator;
};
InputSystem* InputSystem::create(IAllocator& allocator)
{
auto* system = LUMIX_NEW(allocator, InputSystemImpl)(allocator);
if (!system->create())
{
LUMIX_DELETE(allocator, system);
return nullptr;
}
return system;
}
void InputSystem::destroy(InputSystem& system)
{
auto* impl = static_cast<InputSystemImpl*>(&system);
LUMIX_DELETE(impl->m_allocator, impl);
}
} // namespace Lumix
| [
"mikulas.florek@gamedev.sk"
] | mikulas.florek@gamedev.sk |
b9028eff75de46fb8c6aa3a920646e9265c7b921 | 194aebef213d64d46d8fc915f99cd6d8c88696cd | /basic to advance pattern problems/star pattern/pattern6.cpp | cb0476ec07005d638244ef584e3af2ffcbc1d876 | [] | no_license | shivangi-coder/basic-c-programs | 0d08df20e39d4b107cfcc457b9e7434dec94d912 | 9a57771255e7b4cf3fbff1a14c7def808ccf6d78 | refs/heads/main | 2023-08-17T13:33:03.473218 | 2021-10-05T18:05:36 | 2021-10-05T18:05:36 | 413,040,221 | 0 | 2 | null | 2021-10-05T18:05:37 | 2021-10-03T10:05:49 | C++ | UTF-8 | C++ | false | false | 395 | cpp | /* print upper left triangle
* * * * *
* * * *
* * *
* *
*
*/
#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if((i+j)<=n-1)
{
cout<<"*";
}
else{
cout<<" ";
}
cout<<" ";
}
cout<<"\n";
}
return 0;
} | [
"noreply@github.com"
] | shivangi-coder.noreply@github.com |
cdbdae592f7abb1f1a93a24f137704fb4bee3521 | 60c4dd4426efcab6b1e5c6552242a114eb147802 | /MinesweeperGame/AIPlayer.h | 96efa047d82e8badd79338dcea5647c62cb6988e | [] | no_license | tyskwo/MinesweeperAgent | 767fc65fe4ca0925f6b7aebf26b4a6abb74c16ac | 46322ac13015ae02df060df0b22d9270209577d0 | refs/heads/master | 2020-05-26T12:59:19.287596 | 2017-02-19T18:09:31 | 2017-02-19T18:09:31 | 82,478,633 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 267 | h | #pragma once
#include "../GameLib/Player.h"
class AIHolder;
class AIPlayer : public Player
{
public:
AIPlayer( AIHolder* pHolder );
virtual ~AIPlayer();
void update(){};
void setActive( bool isActive );
private:
AIHolder* mpHolder;
};
| [
"tyskwo@gmail.com"
] | tyskwo@gmail.com |
a8ce94bb0ea223ccaa395233c348eb1fdc905e6e | 5b9add05f5630207728aa9fa92df40d0f624188c | /Castleforce/Intermediate/Build/Win64/UE4Editor/Inc/Castleforce/CastleforceUnit.gen.cpp | 842c5ea473d09d38cbaf7aae3538ff769abd3e46 | [] | no_license | rh27un/castleforce | ff6bdb2f3719bee2e3d23b8c12084fa0f1ef5ad2 | a1f70316e3876bfe2812f720fff4969ce83a1f3f | refs/heads/master | 2021-10-26T10:55:05.166505 | 2019-02-08T13:33:25 | 2019-02-08T13:33:25 | 168,685,731 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,194 | cpp | // Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
===========================================================================*/
#include "UObject/GeneratedCppIncludes.h"
#include "Castleforce/CastleforceUnit.h"
#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable : 4883)
#endif
PRAGMA_DISABLE_DEPRECATION_WARNINGS
void EmptyLinkFunctionForGeneratedCodeCastleforceUnit() {}
// Cross Module References
CASTLEFORCE_API UClass* Z_Construct_UClass_ACastleforceUnit_NoRegister();
CASTLEFORCE_API UClass* Z_Construct_UClass_ACastleforceUnit();
ENGINE_API UClass* Z_Construct_UClass_AActor();
UPackage* Z_Construct_UPackage__Script_Castleforce();
// End Cross Module References
void ACastleforceUnit::StaticRegisterNativesACastleforceUnit()
{
}
UClass* Z_Construct_UClass_ACastleforceUnit_NoRegister()
{
return ACastleforceUnit::StaticClass();
}
struct Z_Construct_UClass_ACastleforceUnit_Statics
{
static UObject* (*const DependentSingletons[])();
#if WITH_METADATA
static const UE4CodeGen_Private::FMetaDataPairParam Class_MetaDataParams[];
#endif
static const FCppClassTypeInfoStatic StaticCppClassTypeInfo;
static const UE4CodeGen_Private::FClassParams ClassParams;
};
UObject* (*const Z_Construct_UClass_ACastleforceUnit_Statics::DependentSingletons[])() = {
(UObject* (*)())Z_Construct_UClass_AActor,
(UObject* (*)())Z_Construct_UPackage__Script_Castleforce,
};
#if WITH_METADATA
const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_ACastleforceUnit_Statics::Class_MetaDataParams[] = {
{ "IncludePath", "CastleforceUnit.h" },
{ "ModuleRelativePath", "CastleforceUnit.h" },
};
#endif
const FCppClassTypeInfoStatic Z_Construct_UClass_ACastleforceUnit_Statics::StaticCppClassTypeInfo = {
TCppClassTypeTraits<ACastleforceUnit>::IsAbstract,
};
const UE4CodeGen_Private::FClassParams Z_Construct_UClass_ACastleforceUnit_Statics::ClassParams = {
&ACastleforceUnit::StaticClass,
DependentSingletons, ARRAY_COUNT(DependentSingletons),
0x009000A0u,
nullptr, 0,
nullptr, 0,
nullptr,
&StaticCppClassTypeInfo,
nullptr, 0,
METADATA_PARAMS(Z_Construct_UClass_ACastleforceUnit_Statics::Class_MetaDataParams, ARRAY_COUNT(Z_Construct_UClass_ACastleforceUnit_Statics::Class_MetaDataParams))
};
UClass* Z_Construct_UClass_ACastleforceUnit()
{
static UClass* OuterClass = nullptr;
if (!OuterClass)
{
UE4CodeGen_Private::ConstructUClass(OuterClass, Z_Construct_UClass_ACastleforceUnit_Statics::ClassParams);
}
return OuterClass;
}
IMPLEMENT_CLASS(ACastleforceUnit, 2385044540);
static FCompiledInDefer Z_CompiledInDefer_UClass_ACastleforceUnit(Z_Construct_UClass_ACastleforceUnit, &ACastleforceUnit::StaticClass, TEXT("/Script/Castleforce"), TEXT("ACastleforceUnit"), false, nullptr, nullptr, nullptr);
DEFINE_VTABLE_PTR_HELPER_CTOR(ACastleforceUnit);
PRAGMA_ENABLE_DEPRECATION_WARNINGS
#ifdef _MSC_VER
#pragma warning (pop)
#endif
| [
"rh27un@gmail.com"
] | rh27un@gmail.com |
3142102762a52ad081b802498af8d2e39fb4c47d | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/CMake/CMake-gumtree/Kitware_CMake_old_new_new_log_69.cpp | b805ea46947de30ad2be409877731ab65368ad4c | [] | 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 | 92 | cpp | fsobj_error(a_eno, a_estr, 0,
"Cannot extract through "
"symlink ", path); | [
"993273596@qq.com"
] | 993273596@qq.com |
78162fe3e50b8600186bbfe4855c15e61d204871 | 6cc8635ec5ca10301c27c92c01b40204c9f9250d | /Source/practice_umg/Private/UMG/MainContainer_WS.cpp | a4aaa7499cdeafa4d9f5db8e5d640af3b988d7d0 | [] | no_license | lineCode/UE4_GameUI | 5ca8d5ee672b134b2501143a4aa8034b9d14902b | 8377b55ef4caf03430055d787668657b64c7e694 | refs/heads/master | 2023-06-16T18:02:18.634126 | 2019-05-01T14:04:57 | 2019-05-01T14:04:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,758 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "MainContainer_WS.h"
#include "Runtime/UMG/Public/Components/CanvasPanel.h"
#include "Runtime/UMG/Public/Components/CanvasPanelSlot.h"
#include "Runtime/UMG/Public/Components/Button.h"
#include "Runtime/UMG/Public/Blueprint/SlateBlueprintLibrary.h"
#include "Runtime/Engine/Classes/Engine/ObjectLibrary.h"
#include "Runtime/Core/Public/Misc/MessageDialog.h"
#include "UMG/Exit_WS.h"
#include "UMG/Inventory_WS.h"
#include "UMG/ItemDesc_WS.h"
#include "UMG/WidgetDragDrop.h"
#include "UMG/TestDragPanel_WS.h"
#include "UMG/ItemDragDrop.h"
#include "UMG/InventorySlot_WS.h"
#include "Item/InventoryItem.h"
#include "practice_umgPlayerController.h"
UClass* UMainContainer_WS::GetWidgetClassStatic()
{
FSoftObjectPath AssetLoader(TEXT("WidgetBlueprint'/Game/UMG/MainContainer_WB.MainContainer_WB_C'"));
UClass* Object = Cast<UClass>(AssetLoader.TryLoad());
if (!IsValid(Object))
return nullptr;
return Object;
// FSoftClassPath WidgetClassLoader(TEXT("WidgetBlueprint'/Game/UMG/MainContainer_WB.MainContainer_WB_C'"));
// UClass* WidgetClass = WidgetClassLoader.TryLoadClass<UUserWidget>();
// return WidgetClass;
}
bool UMainContainer_WS::Initialize()
{
Super::Initialize();
if (IsValid(ItemDesc))
{
ItemDesc->SetVisibility(ESlateVisibility::Collapsed);
UCanvasPanelSlot* ItemDescCanvasSlot = Cast<UCanvasPanelSlot>(ItemDesc->Slot);
if (IsValid(ItemDescCanvasSlot))
{
ItemDescCanvasSlot->SetZOrder(255);
}
}
SetVisibility(ESlateVisibility::Visible);
return true;
}
bool UMainContainer_WS::OpenWidget(UUserWidget* Widget, FAnchors Anchors, FVector2D Alignment, FVector2D Position)
{
if (!IsValid(MainContainer) || !IsValid(Widget))
{
return false;
}
UCanvasPanelSlot* CanvasPanelSlot = MainContainer->AddChildToCanvas(Widget);
if (!IsValid(CanvasPanelSlot))
return false;
CanvasPanelSlot->SetAutoSize(true);
CanvasPanelSlot->SetAlignment(Alignment);
CanvasPanelSlot->SetAnchors(Anchors);
CanvasPanelSlot->SetPosition(Position);
return true;
}
bool UMainContainer_WS::NativeOnDrop(const FGeometry& InGeometry, const FDragDropEvent& InDragDropEvent, UDragDropOperation* InOperation)
{
Super::NativeOnDrop(InGeometry, InDragDropEvent, InOperation);
UItemDragDrop* ItemDragDropOperation = Cast<UItemDragDrop>(InOperation);
if (!IsValid(ItemDragDropOperation))
return false;
Apractice_umgPlayerController* practice_umgPlayerController = Cast<Apractice_umgPlayerController>(GetOwningPlayer());
if (!IsValid(practice_umgPlayerController))
return false;
practice_umgPlayerController->OnclieckedContextThrow(ItemDragDropOperation->InventoryItemRef, ItemDragDropOperation->FromInventorySlotRef);
return true;
} | [
"peace-day@hanmail.net"
] | peace-day@hanmail.net |
1918ceaaa3c0197468c4d501d544e61558ec2934 | 89c18e3ed276ca5fff7bd747548fd97a4ecf880a | /third_party/protozero/include/protozero/version.hpp | 32a494f4b6beac56a22811cc6d15a37722124ca1 | [
"Apache-2.0",
"BSD-2-Clause"
] | permissive | developmentseed/osrm-backend | 98d4705554dee6df1e2e0786bebc6b2a90494638 | 0c344ae98ffd3cdadd405b4991d7bf5ceb70c3b4 | refs/heads/master | 2021-07-05T19:29:43.092863 | 2020-07-21T10:43:33 | 2020-07-21T10:46:04 | 135,611,823 | 3 | 1 | BSD-2-Clause | 2020-07-14T08:30:16 | 2018-05-31T16:54:21 | C++ | UTF-8 | C++ | false | false | 919 | hpp | #ifndef PROTOZERO_VERSION_HPP
#define PROTOZERO_VERSION_HPP
/*****************************************************************************
protozero - Minimalistic protocol buffer decoder and encoder in C++.
This file is from https://github.com/mapbox/protozero where you can find more
documentation.
*****************************************************************************/
/**
* @file version.hpp
*
* @brief Contains macros defining the protozero version.
*/
/// The major version number
#define PROTOZERO_VERSION_MAJOR 1
/// The minor version number
#define PROTOZERO_VERSION_MINOR 6
/// The patch number
#define PROTOZERO_VERSION_PATCH 2
/// The complete version number
#define PROTOZERO_VERSION_CODE (PROTOZERO_VERSION_MAJOR * 10000 + PROTOZERO_VERSION_MINOR * 100 + PROTOZERO_VERSION_PATCH)
/// Version number as string
#define PROTOZERO_VERSION_STRING "1.6.2"
#endif // PROTOZERO_VERSION_HPP
| [
"michael.krasnyk@gmail.com"
] | michael.krasnyk@gmail.com |
2e21b75a58e5b4862a0864f9cd689830d65a6f66 | 1d3dd2d4a0e865ec178ee3491b137ebd2bf5c4bc | /trunk/src/motors/servo.cpp | e55dde9538f8ea9f475fe2aa6ac43366a20007c8 | [] | no_license | BGCX067/ezdynlib-svn-to-git | 7f9e926a322e06c51ff492df2c94bb2715bc293d | 39f3b2f439d19391b7046b4ff124e34c10f02244 | refs/heads/master | 2016-09-01T08:51:43.901538 | 2015-12-28T14:37:06 | 2015-12-28T14:37:06 | 48,874,218 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,262 | cpp | // Windows version
//#include <windows.h>
#include <math.h>
#include <limits>
#include <stdio.h>
#include <iostream>
#include "../dynamixel.h"
#include "servo.h"
/*
* servo.cpp
*
* Created on: 5. okt. 2011
* Author: Lars
*/
//#pragma comment(lib, "dynamixel.lib");
//int id;
//Communication *comm;
//bool port;
// Initializes the servos.
Servo::Servo(int id, Communication *comm) : id(id), comm(comm) {
//this->id = id;
//this->comm = comm;
//this->port = true;
dxl_ping(this->id);
if(dxl_get_result()==COMM_RXSUCCESS)
{
std::cout << "Ping " << BROADCAST_ID << std::endl;
}
}
Servo::Servo() {
}
//TODO set servo illegal positions to avoid conflicts with robot hardware.
int Servo::getType() {
int type = comm->getInfo(id, 0);
if (type == -1) {
std::cout << "Error getting type" << std::endl;
return -1;
}
return type;
}
int Servo::getCWAngleLimit() {
int cwAngleLimit = comm->getInfo(id, 6);
if (cwAngleLimit == -1) {
std::cout << "Error getting cwAngleLimit" << std::endl;
return -1;
}
return cwAngleLimit;
}
int Servo::getCCWAngleLimit() {
int ccwAngleLimit = comm->getInfo(id, 8);
if (ccwAngleLimit == -1) {
std::cout << "Error getting ccwAngleLimit" << std::endl;
return -1;
}
return ccwAngleLimit;
}
int Servo::getAngle() {
int angle = comm->getInfo(id, 36);
if (angle == -1) {
std::cout << "Error getting servo angle" << std::endl;
return -1;
}
return angle;
}
int Servo::getTemp(){
int temp = comm->getInfo(id, 43);
if(temp == -1){
std::cout << "Error getting temperature" << std::endl;
return -1;
}
return temp;
}
int Servo::getLoad(){
int load = comm->getInfo(id, 40);
if(load == -1){
std::cout << "Error getting load" << std::endl;
return -1;
}
return load;
}
int Servo::getVolt(){
int volt = comm->getInfo(id, 42);
if(volt == -1){
std::cout << "Error getting volt" << std::endl;
return -1;
}
return volt;
}
int Servo::getId(){
return this->id;
}
int Servo::isMoving() {
return comm->getInfo(id, 46);
}
int Servo::getSpeed() {
return comm->getInfo(id, 32);
}
| [
"you@example.com"
] | you@example.com |
8d2302b624de080ede8203cdfff35627579d1d0e | 078544d216185416a840399172f07ccd1caad07f | /friendtrackerUI/src/LoginReply.h | 284ea6143cd91ddd0514cc3d253de202f9aece5d | [] | no_license | sukwon0709/friendtrackerUI | 23bec4ee5e885e5a6829c26dc02155ae1707ff41 | 14d64d60288b53584b968e018e2e979f6732a2a8 | refs/heads/master | 2021-01-10T19:45:06.595769 | 2013-04-03T00:41:29 | 2013-04-03T00:41:29 | 8,827,293 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 549 | h | /*
* LoginReply.h
*
* Created on: 2013-03-16
* Author: Sukwon Oh
*/
#ifndef LOGINREPLY_H_
#define LOGINREPLY_H_
#include <QString>
#include <QByteArray>
#include <QStringList>
#include "Reply.h"
class LoginReply : public Reply
{
public:
LoginReply();
bool parse(const QByteArray& data);
QString getType() const;
QString getSessionKey() const;
QStringList getFriends() const;
QStringList getPins() const;
private:
bool m_status;
QString m_sessionKey;
QStringList m_ppIds;
QStringList m_pins;
};
#endif /* LOGINREPLY_H_ */
| [
"s3oh@uwaterloo.ca"
] | s3oh@uwaterloo.ca |
f13a21a711c9c04a42ef6d71a5b492a74a58daea | c4821962a4d51d2df4d58834117ce63ea87bc812 | /injector.cpp | 1c0d45664399d4c1077d6dd0c4bfc4acaa99eecb | [] | no_license | Theadd/WickedExile | 564df02f2487c050862a72710532dacd9e62a03c | 020769cf02df61b68a3f1e57eabce065e32a6abd | refs/heads/master | 2020-05-26T20:43:31.338544 | 2013-10-12T16:58:39 | 2013-10-12T16:58:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,117 | cpp | #pragma once
#include <SDKDDKVer.h>
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <windows.h>
#include <tchar.h>
#include <shellapi.h>
#include <string>
#include <sstream>
#include <functional>
#include <iostream>
#include <Winternl.h>
static PROCESS_INFORMATION pi;
typedef ULONG (NTAPI *RtlNtStatusToDosErrorType)(NTSTATUS Status);
typedef VOID (NTAPI *RtlInitAnsiStringType)(PANSI_STRING DestinationString, PCSZ SourceString);
typedef VOID (NTAPI *RtlInitUnicodeStringType)(PUNICODE_STRING DestinationString, PCWSTR SourceString);
static RtlNtStatusToDosErrorType RtlNtStatusToDosErrorFunc;
static RtlInitAnsiStringType RtlInitAnsiStringFunc;
static RtlInitUnicodeStringType RtlInitUnicodeStringFunc;
#ifdef _UNICODE
typedef std::wstring string;
typedef std::wstringstream stringstream;
#else
typedef std::string string;
typedef std::stringstream stringstream;
#endif
void raise_error_num(const string &message, DWORD err_no)
{
TCHAR *msg_buffer;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0, err_no, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&msg_buffer, 0, 0);
stringstream msg;
msg << message << _T("\nError #") << err_no << ": " << string(msg_buffer);
LocalFree(msg_buffer);
throw msg.str();
}
void raise_last_error(const string &message)
{
raise_error_num(message, GetLastError());
}
struct External
{
void *data;
External(const void *input, size_t size)
{
data = VirtualAllocEx(pi.hProcess, 0, size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
if(!data)
raise_last_error(_T("Unable to allocate external memory"));
if(!WriteProcessMemory(pi.hProcess, data, input, size, 0))
raise_last_error(_T("Unable to write to external memory"));
}
void read(void *output, size_t size)
{
if(!ReadProcessMemory(pi.hProcess, data, output, size, 0))
raise_last_error(_T("Unable to read from external memory"));
}
~External()
{
VirtualFreeEx(pi.hProcess, data, 0, MEM_RELEASE);
}
};
struct HandleScope
{
HANDLE handle;
HandleScope(HANDLE handle) : handle(handle) {}
~HandleScope()
{
CloseHandle(handle);
}
};
struct Finally
{
std::function<void()> func;
bool execute;
template<typename F> Finally(F func) : func(func), execute(true) {}
~Finally()
{
if(execute)
func();
}
};
enum ErrorType
{
IE_ERROR_NONE,
IE_ERROR_LOAD_LIBRARY,
IE_ERROR_GET_PROC_ADDRESS,
IE_ERROR_CALLBACK
};
struct Data
{
ErrorType error;
NTSTATUS err_num;
UNICODE_STRING dll;
ANSI_STRING func;
DWORD main_thread;
NTSTATUS (NTAPI *LdrLoadDll)(PWCHAR PathToFile, ULONG *Flags, UNICODE_STRING *ModuleFileName, HMODULE *ModuleHandle);
NTSTATUS (NTAPI *LdrGetProcedureAddress)(HMODULE ModuleHandle, PANSI_STRING FunctionName, WORD Oridinal, PVOID *FunctionAddress);
#ifndef REMOTE_THREAD
HANDLE event;
NTSTATUS (NTAPI *NtSetEvent)(HANDLE EventHandle, PLONG PreviousState);
#endif
};
typedef DWORD (_cdecl *after_injection_t)(HMODULE module, DWORD main_thread);
#pragma code_seg(push, ".cave")
#pragma runtime_checks("", off)
#pragma check_stack(off)
#pragma strict_gs_check(push, off)
#ifdef REMOTE_THREAD
extern "C" static DWORD WINAPI code_cave(Data &data)
#else
extern "C" static void _fastcall code_cave(Data &data)
#endif
{
HMODULE module;
ULONG flags = LOAD_WITH_ALTERED_SEARCH_PATH;
NTSTATUS error = data.LdrLoadDll(NULL, &flags, &data.dll, &module);
if(!NT_SUCCESS(error))
{
data.error = IE_ERROR_LOAD_LIBRARY;
data.err_num = error;
goto exit;
}
after_injection_t func;
error = data.LdrGetProcedureAddress(module, &data.func, 0, (PVOID *)&func);
if(!NT_SUCCESS(error))
{
data.error = IE_ERROR_GET_PROC_ADDRESS;
data.err_num = error;
goto exit;
}
auto result = func(module, data.main_thread);
if(result != ERROR_SUCCESS)
{
data.error = IE_ERROR_CALLBACK;
data.err_num = result;
goto exit;
}
exit:
#ifdef REMOTE_THREAD
return 0;
#else
data.NtSetEvent(data.event, NULL);
while(true);
#endif
}
extern "C" static void code_cave_end()
{
}
#pragma strict_gs_check(pop)
#pragma code_seg(pop)
#define LOAD_ADDRESS_IMPL(var, module, name) do { \
var = (decltype(var))GetProcAddress(module, #name); \
if(var == NULL) \
raise_last_error(_T("Unable to get the address of ") _T(#name)); \
} while (0)
#define LOAD_ADDRESS(var, module, name) LOAD_ADDRESS_IMPL(var, module, name)
#define STORE_ADDRESS(data, module, name) LOAD_ADDRESS_IMPL(data.name, module, name)
void run_code_cave()
{
Data data;
External func(&code_cave, (size_t)&code_cave_end - (size_t)&code_cave);
wchar_t exename[0x8000];
auto exename_size = GetModuleFileNameW(NULL, exename, sizeof(exename) / sizeof(wchar_t));
if(exename_size == 0)
throw string(_T("Unable to get executable path"));
auto dll_name = std::wstring(exename, exename_size);
dll_name = dll_name.substr(0, dll_name.find_last_of(L".") + 1) + L"dll";
const char *func_name = "after_injection";
External dll_str(dll_name.c_str(), dll_name.length() * sizeof(wchar_t));
External func_str(func_name, strlen(func_name) + 1);
HMODULE ntdll = GetModuleHandle(_T("ntdll.dll"));
if(ntdll == NULL)
raise_last_error(_T("Unable to get the address of ntdll.dll"));
LOAD_ADDRESS(RtlNtStatusToDosErrorFunc, ntdll, RtlNtStatusToDosError);
LOAD_ADDRESS(RtlInitAnsiStringFunc, ntdll, RtlInitAnsiString);
LOAD_ADDRESS(RtlInitUnicodeStringFunc, ntdll, RtlInitUnicodeString);
data.error = IE_ERROR_NONE;
data.main_thread = pi.dwThreadId;
RtlInitUnicodeStringFunc(&data.dll, dll_name.c_str());
RtlInitAnsiStringFunc(&data.func, func_name);
data.dll.Buffer = (PWSTR)dll_str.data;
data.func.Buffer = (PCHAR)func_str.data;
STORE_ADDRESS(data, ntdll, LdrLoadDll);
STORE_ADDRESS(data, ntdll, LdrGetProcedureAddress);
#ifndef REMOTE_THREAD
STORE_ADDRESS(data, ntdll, NtSetEvent);
HANDLE event = CreateEvent(NULL, TRUE, FALSE, NULL);
if(!event)
raise_last_error(_T("Unable to create event"));
HandleScope event_scope(event);
if(!DuplicateHandle(GetCurrentProcess(), event, pi.hProcess, &data.event, 0, FALSE, DUPLICATE_SAME_ACCESS))
raise_last_error(_T("Unable to duplicate event handle"));
Finally close_remote_event([&] {
DuplicateHandle(pi.hProcess, data.event, NULL, NULL, 0, FALSE, DUPLICATE_CLOSE_SOURCE);
});
#endif
External info(&data, sizeof(Data));
#ifdef REMOTE_THREAD
HANDLE thread = CreateRemoteThread(pi.hProcess, 0, 0, (LPTHREAD_START_ROUTINE)func.data, info.data, 0, 0);
if(thread == NULL)
raise_last_error(_T("Unable to create remote thread"));
if(WaitForSingleObject(thread, INFINITE) == WAIT_FAILED)
raise_last_error(_T("Unable to wait for remote thread"));
#else
CONTEXT context;
context.ContextFlags = CONTEXT_ALL;
if(!GetThreadContext(pi.hThread, &context))
raise_last_error(_T("Unable to get thread context"));
CONTEXT new_context = context;
#ifdef _M_AMD64
new_context.Rip = (size_t)func.data;
new_context.Rcx = (size_t)info.data;
new_context.Rsp -= 128; // Skip the redzone
new_context.Rsp = new_context.Rsp & ~15; // Align to 16 byte boundary
#else
new_context.Eip = (size_t)func.data;
new_context.Ecx = (size_t)info.data;
#endif
if(!SetThreadContext(pi.hThread, &new_context))
raise_last_error(_T("Unable to set thread context"));
if(ResumeThread(pi.hThread) == (DWORD)-1)
raise_last_error(_T("Unable to start code cave"));
if(WaitForSingleObject(event, INFINITE) == WAIT_FAILED)
raise_last_error(_T("Unable to wait for code cave"));
#endif
info.read(&data, sizeof(Data));
switch(data.error)
{
case IE_ERROR_NONE:
break;
case IE_ERROR_LOAD_LIBRARY:
raise_error_num(_T("Unable to load the library"), RtlNtStatusToDosErrorFunc(data.err_num));
case IE_ERROR_GET_PROC_ADDRESS:
raise_error_num(_T("Unable to find the address of the initialization routine"), RtlNtStatusToDosErrorFunc(data.err_num));
case IE_ERROR_CALLBACK:
{
stringstream msg;
msg << _T("The initialization routine failed to execute") << _T("\nError #") << data.err_num;
throw msg.str();
}
}
#ifndef REMOTE_THREAD
if(!SetThreadContext(pi.hThread, &context))
raise_last_error(_T("Unable to restore thread context"));
#endif
}
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
try
{
LPWSTR *argv;
int argc;
STARTUPINFOW si;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
argv = CommandLineToArgvW(GetCommandLineW(), &argc);
if(argc < 2)
throw string(_T("No executable was specified"));
if(CreateProcessW(argv[1], 0, 0, 0, false, CREATE_SUSPENDED, 0, 0, &si, &pi) == 0)
raise_last_error(_T("Unable to create process"));
HandleScope process_scope(pi.hProcess);
HandleScope thread_scope(pi.hThread);
{
Finally process_exit([&] {
TerminateProcess(pi.hProcess, 1);
});
run_code_cave();
if(ResumeThread(pi.hThread) == (DWORD)-1)
raise_last_error(_T("Unable to start the main thread"));
process_exit.execute = false;
}
return 0;
} catch(string error)
{
MessageBox(NULL, error.c_str(), _T("Injector"), MB_OK | MB_ICONERROR);
return 1;
}
}
| [
"pantallazo@gmail.com"
] | pantallazo@gmail.com |
5e711afff229d1d2efb831ece3987c9a560af72d | cfd5915e5e8569052d9813a159a7fc06e7740347 | /SmartAuthCredentialProvider/SmartAuthCredentialProvider/Auth.h | 5bd8a547fa7f9d5c690fc8c01359bb12f7d21f95 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | zk2013/smart_auth | e7709a20eecda7cff65ec15d91ca8fd4a9e33278 | bb0c789c4dfb17e1ba90c0fb622fa69e374b2c8a | refs/heads/master | 2020-05-20T21:27:12.118612 | 2016-11-26T07:43:35 | 2016-11-26T07:43:35 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 172 | h | #ifndef __AUTH_H__
#define __AUTH_H__
#include <windows.h>
#include "OtpCheck.h"
class Authentication{
public :
void googleOTP(PWSTR otpKey, PWSTR &username);
};
#endif | [
"hongsun571@naver.com"
] | hongsun571@naver.com |
12b7a01f422d14db9d9940377b19af1d663db7d2 | 3cc59a92b32997af11b82b78b3577289d62a681d | /c++/day05/cons.cpp | 645a58e5754add5121e388f071789d2650937e6a | [] | no_license | zzy0119/emb20200210 | a5d40658382142d0743c6aaf401eb28dc9f96ea8 | a12ef895933dd392066ce064b4accd115610b8d9 | refs/heads/master | 2022-11-04T05:48:45.136308 | 2020-06-24T02:30:22 | 2020-06-24T02:30:22 | 261,624,651 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 973 | cpp | #include <iostream>
using namespace std;
// 基类
class Person {
protected:
const char *m_name;
int m_age;
public:
Person();// 默认的构造方法
Person(const char *, int );
};
Person::Person():m_name("默认"), m_age(0) {}
Person::Person(const char *name, int age) : m_name(name), m_age(age) {}
// 派生类
class Student:public Person{
private:
float m_score;
public:
Student();
Student(const char *name, int age, float score);
void show();
};
Student::Student():m_score(0.0){}
// 派生类的构造函数中调用基类的构造函数
// Student::Student(const char *name, int age, float score) : Person(name, age), m_score(score){}
Student::Student(const char *name, int age, float score) : m_score(score){}
void Student::show()
{
cout << m_name << endl;
cout << m_age << endl;
cout << m_score << endl;
}
int main(void)
{
Student stu("c++", 20, 100);
stu.show();
Student stu2;// 默认构造方法
stu2.show();
return 0;
}
| [
"you@example.com"
] | you@example.com |
29c897f3bfd90b2fce20dee6c8203f5992462f72 | 69b49dbff2f6b0209d27368ae177c1b8846972ff | /Run/Classes/keepRun/KRActor.cpp | b61fc33961c542da650d3264c15270c33d92e29f | [] | no_license | spzktshow/JustRun | 43e75fe2b1bd6bef13e6ac942a6e907298b05459 | 3fbd15a9d708186f0cf7cc0851f5f9a551cfc4fa | refs/heads/master | 2021-01-23T22:07:31.570094 | 2014-03-15T03:37:40 | 2014-03-15T03:37:40 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,420 | cpp | //
// KRActor.cpp
// Run
//
// Created by RockLee on 14-3-10.
//
//
#include "KRActor.h"
#include "AnimationConfig.h"
#include "MSDataStructure.h"
NS_KR_BEGIN
/***********BehaviorEvent*********************/
BehaviorRunEvent::~BehaviorRunEvent()
{
}
BehaviorJumpEvent::~BehaviorJumpEvent()
{
}
/**********Actor**************************/
void Actor::executeEvent(moonsugar::BehaviorEvent * behaviorEvent)
{
if (behaviorEvent->eventType == RUN_EVENT)
{
handlerRunEvent(behaviorEvent);
}
else if (behaviorEvent->eventType == JUMP_EVENT)
{
handlerJumpEvent(behaviorEvent);
}
else if (behaviorEvent->eventType == CANCEL_JUMP_EVENT)
{
cancelJumpEvent(behaviorEvent);
}
}
void Actor::handlerJumpEvent(moonsugar::BehaviorEvent *jumpEvent)
{
if (stateContext->currentState->itemName == STATE_RUN)
{
moonsugar::StateData * stateData = new moonsugar::StateData(STATE_JUMP);
stateContext->insertStateData(stateData);
//
converToCurrent();
}
else if (stateContext->currentState->itemName == STATE_JUMP)
{
moonsugar::StateData * stateData = new moonsugar::StateData(STATE_JUMP2);
stateContext->cancelStateDataChange(stateData);
//
converToCurrent();
}
}
void Actor::cancelJumpEvent(moonsugar::BehaviorEvent *behaviorEvent)
{
if (stateContext->currentState->itemName == STATE_JUMP || stateContext->currentState->itemName == STATE_JUMP2)
{
stateContext->popStateDataChangeNext();
//
converToCurrent();
}
}
void Actor::handlerRunEvent(moonsugar::BehaviorEvent *runEvent)
{
moonsugar::StateData * stateData = new moonsugar::StateData(STATE_RUN);
stateContext->insertStateData(stateData);
//
converToCurrent();
}
void Actor::setPosition(cocos2d::Point pointValue)
{
cocos2d::Point p1(pointValue.x, pointValue.y + INIT_VIEW_GAP);
entry->view->setPosition(p1);
entry->rect->setPosition(pointValue);
point = pointValue;
viewPoint = p1;
}
void Actor::pauseAction()
{
this->isPlaying = false;
isJumping = false;
cocos2d::Director::getInstance()->getActionManager()->pauseTarget(this->entry->view);
}
void Actor::continueAction()
{
cocos2d::Director::getInstance()->getActionManager()->resumeTarget(this->entry->view);
isPlaying = true;
isJumping = true;
}
Actor::Actor()
{
}
Actor::~Actor()
{
delete entry;
}
void Actor::converToCurrent()
{
if (!isPlaying) return;
if (stateContext->currentState->itemName == STATE_RUN)
{
run();
}
else if (stateContext->currentState->itemName == STATE_JUMP)
{
jump();
}
else if (stateContext->currentState->itemName == STATE_JUMP2)
{
jump();
}
}
void Actor::jump()
{
entry->runAction(ANIMATION_CONFIG_JUMP01);
startJump();
}
void Actor::onJumpComplete()
{
cancelJumpEvent(nullptr);
}
void Actor::run()
{
entry->runAction(ANIMATION_CONFIG_RUN01);
}
void Actor::update(float dt)
{
if (isJumping)
{
cocos2d::log("%s", "Jump");
startJumpValue = startJumpValue + gravity;
float targetY = entry->view->getPositionY() + startJumpValue;
float targetY1 = entry->rect->getPositionY() + startJumpValue;
if (targetY < viewPoint.y)
{
targetY = viewPoint.y;
endJump();
}
if (targetY1 < point.y)
{
targetY1 = point.y;
}
entry->view->setPositionY(targetY);
entry->rect->setPositionY(targetY1);
}
}
void Actor::startJump()
{
isJumping = true;
startJumpValue = JUMP_VALUE;
}
void Actor::endJump()
{
isJumping = false;
onJumpComplete();
}
/***************ActorEntry**********************/
ActorEntry::ActorEntry(cocos2d::Map<std::string, cocos2d::Animation *> animationDicValue, cocos2d::Sprite * viewValue, cocos2d::Sprite * rectValue)
{
view = viewValue;
animationDic = animationDicValue;
rect = rectValue;
}
ActorEntry::~ActorEntry()
{
view->release();
}
cocos2d::Animate * ActorEntry::runAction(std::string actionName)
{
currentAction = nullptr;
cocos2d::Animation * animation;
cocos2d::Animate * animate;
cocos2d::RepeatForever * repeatf;
if (actionName == ANIMATION_CONFIG_RUN01)
{
animation = animationDic.at(ANIMATION_CONFIG_RUN01);
animate = cocos2d::Animate::create(animation);
view->stopAllActions();
if (ANIMATION_CONFIG_RUN_LOOP == 0)
{
repeatf = cocos2d::RepeatForever::create(animate);
view->runAction(repeatf);
//
currentAction = repeatf;
}
else
{
view->runAction(animate);
currentAction = animate;
}
}
else if (actionName == ANIMATION_CONFIG_JUMP01)
{
animation = animationDic.at(ANIMATION_CONFIG_JUMP01);
animate = cocos2d::Animate::create(animation);
view->stopAllActions();
if (ANIMATION_CONFIG_JUMP_LOOP == 0)
{
repeatf = cocos2d::RepeatForever::create(animate);
view->runAction(repeatf);
currentAction = repeatf;
}
else
{
view->runAction(animate);
currentAction = animate;
}
}
return animate;
}
NS_KR_END; | [
"gdspzkt@gmail.com"
] | gdspzkt@gmail.com |
5ea68b777ee1a67b80fcc2d6137164a3f85c2ef8 | cf04c27812a16fbe138cc2b06efb853ef7982869 | /Chapter3/1.BookSample/FileAttributes/FileAttributes/FileAttributes.cpp | d3d7ff5cf3f7ed08c3afede7e1c340c8d450ffab | [] | no_license | a5932016/WindowsSoftwareRansomware | d2111f62733eaa8b133ad4d741d075faec335126 | e45fa0f875f130a860a90fe91c31da96c24b331d | refs/heads/master | 2022-11-23T06:13:31.581354 | 2020-07-29T09:07:24 | 2020-07-29T09:07:24 | 282,945,293 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 894 | cpp | #include <windows.h>
#include <tchar.h>
BOOL UpdateFileAttributes(
LPCTSTR lpFileName,
DWORD dwFileAttributes,
BOOL bFlag)
{
BOOL bResult = TRUE;
DWORD dwAttrs = GetFileAttributes(lpFileName);
if (dwAttrs == INVALID_FILE_ATTRIBUTES)
return false;
if (bFlag)
{
if (!(dwAttrs & dwFileAttributes))
{
bResult = SetFileAttributes(lpFileName, dwAttrs | dwFileAttributes);
}
}
else
{
if (dwAttrs & dwFileAttributes)
{
DWORD dwNewAttrs = dwAttrs & ~dwFileAttributes;
bResult = SetFileAttributes(lpFileName, dwNewAttrs);
}
}
return bResult;
}
int main()
{
LPCTSTR lpFileName;
DWORD dwFileAttributes;
lpFileName = _T("C:\\TEMP\\test.txt");
dwFileAttributes = FILE_ATTRIBUTE_READONLY;
if (!UpdateFileAttributes(lpFileName, dwFileAttributes, FALSE))
{
_tprintf(TEXT("SetFileAttributes() Error: %d\n"), GetLastError());
}
system("pause");
return 0;
} | [
"a5932016@gmail.com"
] | a5932016@gmail.com |
575ace3d83253d5982b3ce76ecccfdc50ed92d87 | 6f7a9da07955d7e9a6f9a57d65917b3c11a282c8 | /Problem Solving/2.Patterns 1/5.alpha_pattern.cpp | 5777b632563f6af77c5311127b53debd356d18f2 | [] | no_license | jaguar-paw33/CODE_AAI | 3465014b0c87494dbbbaa957427c9b8a2652a27d | c10912b512e69b45e7d24d449d2e0cc4480df518 | refs/heads/master | 2023-06-29T05:37:44.487972 | 2021-08-13T07:47:55 | 2021-08-13T07:47:55 | 351,182,645 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 583 | cpp | /*
Print the following pattern for the given N number of rows.
Pattern for N = 3
A
BB
CCC
Input format :
Integer N (Total no. of rows)
Output format :
Pattern in N lines
Constraints
0 <= N <= 26
Sample Input 1:
7
Sample Output 1:
A
BB
CCC
DDDD
EEEEE
FFFFFF
GGGGGGG
Sample Input 2:
6
Sample Output 2:
A
BB
CCC
DDDD
EEEEE
FFFFFF
*/
#include<iostream>
using namespace std;
void pattern(int n) {
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i; j++) {
cout << char('A' + i - 1);
}
cout << endl;
}
}
int main() {
int n;
cin >> n;
pattern(n);
return 0;
} | [
"mr.priyankmishra@gmail.com"
] | mr.priyankmishra@gmail.com |
039fe63a79f19dd0d78603edecc7f9185fe7cc82 | 93a4880445525c38bf118746d2349d734919c85b | /LgpCpp/data/ejemplo_parameters_trafo1.h | 98d47f83b702e09cf69faae2833add1e308d8ac8 | [] | no_license | nahu/lgp | f48cca0b82dadad7c1e11b46c18aba61909dc5d2 | e84b92eecc181c1b7c6b89a63dc793ef41366cd4 | refs/heads/master | 2021-05-02T08:34:48.257529 | 2017-07-25T21:30:25 | 2017-07-25T21:30:25 | 7,716,660 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,940 | h | /*
* parameters_base.h
*
* Created on: Mar 16, 2013
* Author: Vanessa Cañete, Nahuel Hernández
*/
#define _USE_MATH_DEFINES
#define FILE_ANALISIS "./analisis-link/analisis.csv"
#define FILE_PROBABILIDADES "./analisis-link/probabilidades.csv"
#define FILE_NAME_ERRORES_X_DEME_TRAINING "errores_x_deme_training.csv"
#define FILE_NAME_ERRORES_X_DEME_VALIDATION "errores_x_deme_validation.csv"
#define FILE_NAME "./data/datos_historicos_trafo_1.csv"
//Solo faltan 5 transformadores. [1,7,15,23,39]
std::string CONFIG = "10111111";
#define CONFIG_POSITION 1 //el transformador dentro de la configuración a encontrar
//#define N 8
#define N 8
//#define K 5
#define K 7
#define N_K (N - K)
//#define Q 10
#define DELTA 0
#define CNT_PRUEBAS 7
/*condiciones de parada */
#define ERROR_TO_STOP 0.01
#define NUM_MAX_GENERATION 1000
/******************************* DATOS **********************************/
#define LINES 248
#define TRAINING_LINES 200
#define VALIDATION_LINES 48
#define TRAINING 0
#define VALIDATION 1
#define W_OB1 1 //error
#define W_OB2 0 //desviacion
//para la función de evaluación de individuos
#define FITNESS 0
#define OB1 1
#define OB2 2
//para el operador de reproduccion, posibles tipos de estados despues de participar del torneo
#define NONE 0
#define WINNER 1
#define REPLACE 2
/*INSTRUCCIONES
Cada individuo posee una lista de instrucciones
Cada instrucción se representa como una lista de 4 enteros como sigue
[operación, destino, operador1, operador2]
la convención para asegurar que el programa tenga una salida es que la
última instrucción sea del tipo [operación, 0, operador1, operador2]
*/
#define NUM_MIN_INSTRUCTIONS (3)
#define NUM_MAX_INSTRUCTIONS (30)
#define NUM_INI_INSTRUCTIONS (5)
#define NUM_OPERATORS 9
#define NUM_VAR_REGISTER 10//K
#ifdef Q
#define NUM_CONST_IN_REGISTERS (Q + DELTA)
#else
#define NUM_CONST_IN_REGISTERS (K + DELTA)
#endif
#define NUM_OUT_REGISTERS 1
#define NUM_CONST_RANDOM_REGISTERS 4//K
#define NUM_CONST_MATH_REGISTERS 4
#define NUM_CONTS_REGISTERS (NUM_CONST_RANDOM_REGISTERS + NUM_CONST_IN_REGISTERS + NUM_CONST_MATH_REGISTERS)
#define NUM_REGISTERS (NUM_CONTS_REGISTERS + NUM_VAR_REGISTER + NUM_OUT_REGISTERS)
#define NUM_INDIVIDUAL_REGISTERS (NUM_REGISTERS - NUM_CONST_IN_REGISTERS)
//Límites en las instrucciones
#define REG_OUT 0
#define VAR_MIN 1
#define VAR_MAX NUM_VAR_REGISTER
#define CONST_AL_MIN (VAR_MAX + 1)
#define CONST_AL_MAX (VAR_MAX + NUM_CONST_RANDOM_REGISTERS + NUM_CONST_MATH_REGISTERS) //3*K //aca le agrego las constantes matematicas
#define CONST_IN_MIN (CONST_AL_MAX + 1)
#define CONST_IN_MAX (CONST_AL_MAX + NUM_CONST_IN_REGISTERS - DELTA)
#define CONST_IN_DELTA_MIN CONST_IN_MAX + 0 // if DELTA > 0(CONST_IN_MAX + 1)
#define CONST_IN_DELTA_MAX (CONST_IN_MAX + DELTA)
#define OP_MIN 1
#define OP_MAX 9
#define REGISTER_OFFSET (CONST_AL_MAX + 1)
/*REGISTROS
r[0] registro variable de salida - inicializado a 1
r[1] .. r[k] registros variables inicializados a 1
r[k + 1] .. r[2*k] registros aleatorios constantes
r[2*k + 1] .. r[3*k] registros de entrada constantes
*/
#define INIT_VAR_VALUE 1.0 //Valor inicial de los registros variables
/************************************ OPERACIONES ************************************/
#define ADD 1
#define SUB 2
#define MUL 3
#define DIV 4
#define POW2 5
#define LOG10 6
#define SQRT 7
#define SIN 8
#define COS 9
#define C_UNDEF 1.0
#define HUGE_NUMBER 9999999999
//Tipos de micromutaciones
#define CONSTANTES 0
#define REGISTROS 1
#define OPERACIONES 2
//Posiciones en una instruccion
#define OPERATION 0
#define DEST 1
#define OPERAND_1 2
#define OPERAND_2 3
/************************************ ALGORITMO EVOLUTIVO ***********************************
num_generations: cantidad de generaciones de individuos en el algoritmo evolutivo
population_size: el tamaño de la población.
demes: cantidad de subpoblaciones que se procesarán en paralelo.
freq_stats: cada cuantas generaciones se imprimirá el estado del algoritmo.
pool_size: cantidad de individuos qeu participaran del torneo
migration_rate: porcentaje de individuos de la subpoblacion que van a migrar.
**********************************************************************************************/
#define NUM_GENERATIONS NUM_MAX_GENERATION
#define POPULATION_SIZE 262144 //460000//262144 //18
#define DEMES 16
#define FREQ_STATS 100
#define POOL_SIZE 4//32
#define POOL_REPRODUCTION 1 //4
#define MIGRATION_RATE 0.005
#define GEN_TO_MIGRATE 100 //250
#define CANT_ESTANCAMIENTO 10
#define ERROR_STEP 50
#define MIN_ERROR_STEP 1
#define TOURNAMENTS 6 //número par
#define P_DIVERSITY 0
/*************************************** PROBABILIDADES **************************************
p_reg_op2_const: probabilidad de que el segundo operando de una instrucción sea constante
p_const_in: probabilidad de que si un operando es constante sea de entrada
const_max: Constante máxima para inicialización de registros
p_macro_mutation: probabilidad de que un individuo sea sometido al proceso
de macro mutación (agregacion/eliminación de instrucciones)
p_ins: probabilidad de agregar una instrucciòn. Segùn el libro mayor a la de eliminar.
p_del: probabilidad de eliminar una instrucción.
p_micro_mutation: probabilidad de que un individuo sea sometido al
proceso de micro mutación (mutación interna de instrucciones)
p_regmut: probabilidad de que se aplique la micro mutación a los registros
p_opermut: probabilidad de que se aplique la micro mutación a las operaciones
p_constmut: probabilidad de que se aplique la micro mutación a las constantes
utilizando step_size_const para la variación
step_size_const: variacion de las constantes cuando hay una mutacion de registros
p_crossover: probabilidad de carplia la operación de cruzamiento.
*************************************************************************************************/
#define P_MIGRATION 0.2
#define P_MIGRATION_CRITERIA 1
#define P_REG_OP1_CONST 0.4
#define P_REG_OP2_CONST 0.6
#define P_REG_CONST_DELTA 0.0
#define P_CONST_IN 0.80
#define CONST_MIN 0 //50
#define CONST_MAX 1 //50
#define P_MACRO_MUTATION 0.50
#define P_INS 0.51
#define P_DEL 0.49
#define P_MICRO_MUTATION 0.90
#define P_REGMUT 0.25
#define P_OPERMUT 0.7
#define P_CONSTMUT 0.05
#define STEP_SIZE_CONST 0.1
#define P_CROSSOVER 0.20
/************************************* MULTIPROCESAMIENTO *************************************
Las operaciones sobre la población,como la inicialización y la evaluación de fitness se realiza
utilizando multiprocessing de Python
*/
#define NUM_PROCESSORS 4 //NÚMERO DE PROCESOS WORKERS
#define WHILE_BLOCK 1000 //para evitar whiles infinitos, por si pudiera llegarse a dar
#define PARALLELIZED 0
| [
"jnahuelhernandez@gmail.com"
] | jnahuelhernandez@gmail.com |
fc61e3791107ddf9cdd403301b2cfeccfdcb8dfa | b924ba76b66e50ee1b82c1ce29c5e20b584af67f | /code/terrainfactory.cc | a53163cc0ba050005306aed6c94b02c488dd88f1 | [] | no_license | joelkyu/cc3k | 6f453c36c8038b38f7c0484e13725c8f7b1a0ec4 | d4a72a0e5c4b251390ffbd8126cc8730ac71a7ec | refs/heads/master | 2023-01-13T11:25:48.281484 | 2020-11-14T20:14:49 | 2020-11-14T20:14:49 | 297,366,792 | 0 | 0 | null | 2020-11-14T20:14:50 | 2020-09-21T14:34:47 | C++ | UTF-8 | C++ | false | false | 1,272 | cc | #include "terrainfactory.h"
#include "emptychambertile.h"
#include "horizontalwall.h"
#include "verticalwall.h"
#include "door.h"
#include "passage.h"
#include "stairs.h"
shared_ptr<GameObject> TerrainFactory::spawnObject(int x, int y)
{
shared_ptr<Terrain> newTerrain;
switch (type) {
case '.' : // empty chamber wall
newTerrain = make_shared<EmptyChamberTile>();
break;
case '-' : // horizontal wall
newTerrain = make_shared<HorizontalWall>();
break;
case '|' : // vertical wall
newTerrain = make_shared<VerticalWall>();
break;
case '+' : // door
newTerrain = make_shared<Door>();
break;
case '#' : // passage
newTerrain = make_shared<Passage>();
break;
case '\\' : // stairs
newTerrain = make_shared<Stairs>();
break;
}
return newTerrain;
}
TerrainFactory::TerrainFactory(char type) : type{ type } {}
void TerrainFactory::setTerrainMade(char newType)
{
type = newType;
}
| [
"noreply@github.com"
] | joelkyu.noreply@github.com |
bd0f4715dc34acc6947bc311fe156018682a7279 | f5ef92bffee09c1f56470c445c9c296992ac6aa3 | /maxclique.cpp | 7076e8e14930bd5fa4377f1bddb938f11bb0637b | [] | no_license | aniagut/Projekt-Blokada-Krola-2021 | 567ce8b030ad1fd4c711048661a5657138c3f085 | c3a96943686e41b4c890eb4b3e865780e7e147f6 | refs/heads/master | 2023-03-12T14:56:10.263613 | 2021-03-01T17:19:43 | 2021-03-01T17:19:43 | 343,496,858 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,418 | cpp | #include <bits/stdc++.h>
using namespace std;
struct Node {
public:
int color;
int lambda;
bool visited;
vector<int> edges;
};
Node G[600];
bool processed[600];
vector<int> ordering(Node G[600],int n){
for(int i=0;i<n;i++){
processed[i]=false;
}
int idx=0;
int maximum=0;
vector<int> ordered_vertices;
ordered_vertices.push_back(1);
for(int i=0;i<n-1;i++){
int m=G[idx].edges.size();
for(int k=0;k<m;k++){
if(processed[G[idx].edges[k]-1]==false){
G[G[idx].edges[k]-1].lambda+=1;
}
}
processed[idx]=true;
idx=-1;
maximum=-1;
for(int j=0;j<n;j++){
if(processed[j]==false){
if(G[j].lambda>maximum){
maximum=G[j].lambda;
idx=j;
}
}
}
ordered_vertices.push_back(idx+1);
}
return ordered_vertices;
}
int maxcliquesize(Node G[600],int n){
vector<int> ordered_vertices=ordering(G,n);
G[ordered_vertices[0]-1].color=0;
int used_colors=1;
bool available[n];
for(int i=0;i<n;i++){
available[i]=true;
}
for(int i=1;i<n;i++){
int n=G[ordered_vertices[i]-1].edges.size();
for(int j=0;j<n;j++){
if(G[G[ordered_vertices[i]-1].edges[j]-1].color!=-1){
available[G[G[ordered_vertices[i]-1].edges[j]-1].color]=false;
}
}
int k=0;
while(available[k]==false){
k+=1;
}
G[ordered_vertices[i]-1].color=k;
if(k+1>used_colors){
used_colors=k+1;
}
for(int j=0;j<n;j++){
if(G[G[ordered_vertices[i]-1].edges[j]-1].color!=-1){
available[G[G[ordered_vertices[i]-1].edges[j]-1].color]=true;
}
}
}
return used_colors;
}
int main(){
int T;
cin >> T;
for(int i=0;i<T;i++){
int N,M;
cin>>N>>M;
for(int i=0;i<N;i++){
G[i].lambda=0;
G[i].color=-1;
G[i].edges.clear();
}
for(int i=0;i<M;i++){
int a,b;
cin>>a>>b;
G[a-1].edges.push_back(b);
G[b-1].edges.push_back(a);
}
int result=maxcliquesize(G,N);
if(result!=2){
result-=1;
}
cout<<result<<endl;
}
}
| [
"noreply@github.com"
] | aniagut.noreply@github.com |
04fcc65d904c8af0d3c165bb970bb85569824a6a | 11ef4bbb8086ba3b9678a2037d0c28baaf8c010e | /Source Code/server/binaries/chromium/gen/components/content_capture/common/content_capture.mojom.cc | 6ff1f3bb8cd9878a7df085776dc822f8a81c11fb | [] | no_license | lineCode/wasmview.github.io | 8f845ec6ba8a1ec85272d734efc80d2416a6e15b | eac4c69ea1cf0e9af9da5a500219236470541f9b | refs/heads/master | 2020-09-22T21:05:53.766548 | 2019-08-24T05:34:04 | 2019-08-24T05:34:04 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 23,043 | 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.
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#elif defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4056)
#pragma warning(disable:4065)
#pragma warning(disable:4756)
#endif
#include "components/content_capture/common/content_capture.mojom.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/hash/md5_constexpr.h"
#include "base/logging.h"
#include "base/run_loop.h"
#include "base/task/common/task_annotator.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_context.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "components/content_capture/common/content_capture.mojom-params-data.h"
#include "components/content_capture/common/content_capture.mojom-shared-message-ids.h"
#include "components/content_capture/common/content_capture.mojom-import-headers.h"
#ifndef COMPONENTS_CONTENT_CAPTURE_COMMON_CONTENT_CAPTURE_MOJOM_JUMBO_H_
#define COMPONENTS_CONTENT_CAPTURE_COMMON_CONTENT_CAPTURE_MOJOM_JUMBO_H_
#include "components/content_capture/common/content_capture_struct_traits.h"
#include "mojo/public/cpp/base/string16_mojom_traits.h"
#include "ui/gfx/geometry/mojo/geometry_struct_traits.h"
#endif
namespace content_capture {
namespace mojom {
const char ContentCaptureReceiver::Name_[] = "content_capture.mojom.ContentCaptureReceiver";
ContentCaptureReceiverProxy::ContentCaptureReceiverProxy(mojo::MessageReceiverWithResponder* receiver)
: receiver_(receiver) {
}
void ContentCaptureReceiverProxy::DidCaptureContent(
const content_capture::ContentCaptureData& in_data, bool in_first_data) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT0("mojom", "<class 'jinja2::utils::Namespace'>::ContentCaptureReceiver::DidCaptureContent");
#endif
const bool kExpectsResponse = false;
const bool kIsSync = false;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0);
mojo::Message message(
internal::kContentCaptureReceiver_DidCaptureContent_Name, kFlags, 0, 0, nullptr);
auto* buffer = message.payload_buffer();
::content_capture::mojom::internal::ContentCaptureReceiver_DidCaptureContent_Params_Data::BufferWriter
params;
mojo::internal::SerializationContext serialization_context;
params.Allocate(buffer);
typename decltype(params->data)::BaseType::BufferWriter
data_writer;
mojo::internal::Serialize<::content_capture::mojom::ContentCaptureDataDataView>(
in_data, buffer, &data_writer, &serialization_context);
params->data.Set(
data_writer.is_null() ? nullptr : data_writer.data());
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
params->data.is_null(),
mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
"null data in ContentCaptureReceiver.DidCaptureContent request");
params->first_data = in_first_data;
message.AttachHandlesFromSerializationContext(
&serialization_context);
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(ContentCaptureReceiver::Name_);
message.set_method_name("DidCaptureContent");
#endif
// This return value may be ignored as false implies the Connector has
// encountered an error, which will be visible through other means.
ignore_result(receiver_->Accept(&message));
}
void ContentCaptureReceiverProxy::DidUpdateContent(
const content_capture::ContentCaptureData& in_data) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT0("mojom", "<class 'jinja2::utils::Namespace'>::ContentCaptureReceiver::DidUpdateContent");
#endif
const bool kExpectsResponse = false;
const bool kIsSync = false;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0);
mojo::Message message(
internal::kContentCaptureReceiver_DidUpdateContent_Name, kFlags, 0, 0, nullptr);
auto* buffer = message.payload_buffer();
::content_capture::mojom::internal::ContentCaptureReceiver_DidUpdateContent_Params_Data::BufferWriter
params;
mojo::internal::SerializationContext serialization_context;
params.Allocate(buffer);
typename decltype(params->data)::BaseType::BufferWriter
data_writer;
mojo::internal::Serialize<::content_capture::mojom::ContentCaptureDataDataView>(
in_data, buffer, &data_writer, &serialization_context);
params->data.Set(
data_writer.is_null() ? nullptr : data_writer.data());
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
params->data.is_null(),
mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
"null data in ContentCaptureReceiver.DidUpdateContent request");
message.AttachHandlesFromSerializationContext(
&serialization_context);
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(ContentCaptureReceiver::Name_);
message.set_method_name("DidUpdateContent");
#endif
// This return value may be ignored as false implies the Connector has
// encountered an error, which will be visible through other means.
ignore_result(receiver_->Accept(&message));
}
void ContentCaptureReceiverProxy::DidRemoveContent(
const std::vector<int64_t>& in_ids) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT0("mojom", "<class 'jinja2::utils::Namespace'>::ContentCaptureReceiver::DidRemoveContent");
#endif
const bool kExpectsResponse = false;
const bool kIsSync = false;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0);
mojo::Message message(
internal::kContentCaptureReceiver_DidRemoveContent_Name, kFlags, 0, 0, nullptr);
auto* buffer = message.payload_buffer();
::content_capture::mojom::internal::ContentCaptureReceiver_DidRemoveContent_Params_Data::BufferWriter
params;
mojo::internal::SerializationContext serialization_context;
params.Allocate(buffer);
typename decltype(params->ids)::BaseType::BufferWriter
ids_writer;
const mojo::internal::ContainerValidateParams ids_validate_params(
0, false, nullptr);
mojo::internal::Serialize<mojo::ArrayDataView<int64_t>>(
in_ids, buffer, &ids_writer, &ids_validate_params,
&serialization_context);
params->ids.Set(
ids_writer.is_null() ? nullptr : ids_writer.data());
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
params->ids.is_null(),
mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
"null ids in ContentCaptureReceiver.DidRemoveContent request");
message.AttachHandlesFromSerializationContext(
&serialization_context);
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(ContentCaptureReceiver::Name_);
message.set_method_name("DidRemoveContent");
#endif
// This return value may be ignored as false implies the Connector has
// encountered an error, which will be visible through other means.
ignore_result(receiver_->Accept(&message));
}
// static
bool ContentCaptureReceiverStubDispatch::Accept(
ContentCaptureReceiver* impl,
mojo::Message* message) {
switch (message->header()->name) {
case internal::kContentCaptureReceiver_DidCaptureContent_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT1(
"mojom",
"(Impl)<class 'jinja2::utils::Namespace'>::ContentCaptureReceiver::DidCaptureContent",
"message", message->name());
#endif
static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
"(Impl)<class 'jinja2::utils::Namespace'>::ContentCaptureReceiver::DidCaptureContent");
base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);
mojo::internal::MessageDispatchContext context(message);
DCHECK(message->is_serialized());
internal::ContentCaptureReceiver_DidCaptureContent_Params_Data* params =
reinterpret_cast<internal::ContentCaptureReceiver_DidCaptureContent_Params_Data*>(
message->mutable_payload());
mojo::internal::SerializationContext serialization_context;
serialization_context.TakeHandlesFromMessage(message);
bool success = true;
content_capture::ContentCaptureData p_data{};
bool p_first_data{};
ContentCaptureReceiver_DidCaptureContent_ParamsDataView input_data_view(params, &serialization_context);
if (!input_data_view.ReadData(&p_data))
success = false;
p_first_data = input_data_view.first_data();
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
ContentCaptureReceiver::Name_, 0, false);
return false;
}
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->DidCaptureContent(
std::move(p_data),
std::move(p_first_data));
return true;
}
case internal::kContentCaptureReceiver_DidUpdateContent_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT1(
"mojom",
"(Impl)<class 'jinja2::utils::Namespace'>::ContentCaptureReceiver::DidUpdateContent",
"message", message->name());
#endif
static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
"(Impl)<class 'jinja2::utils::Namespace'>::ContentCaptureReceiver::DidUpdateContent");
base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);
mojo::internal::MessageDispatchContext context(message);
DCHECK(message->is_serialized());
internal::ContentCaptureReceiver_DidUpdateContent_Params_Data* params =
reinterpret_cast<internal::ContentCaptureReceiver_DidUpdateContent_Params_Data*>(
message->mutable_payload());
mojo::internal::SerializationContext serialization_context;
serialization_context.TakeHandlesFromMessage(message);
bool success = true;
content_capture::ContentCaptureData p_data{};
ContentCaptureReceiver_DidUpdateContent_ParamsDataView input_data_view(params, &serialization_context);
if (!input_data_view.ReadData(&p_data))
success = false;
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
ContentCaptureReceiver::Name_, 1, false);
return false;
}
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->DidUpdateContent(
std::move(p_data));
return true;
}
case internal::kContentCaptureReceiver_DidRemoveContent_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT1(
"mojom",
"(Impl)<class 'jinja2::utils::Namespace'>::ContentCaptureReceiver::DidRemoveContent",
"message", message->name());
#endif
static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
"(Impl)<class 'jinja2::utils::Namespace'>::ContentCaptureReceiver::DidRemoveContent");
base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);
mojo::internal::MessageDispatchContext context(message);
DCHECK(message->is_serialized());
internal::ContentCaptureReceiver_DidRemoveContent_Params_Data* params =
reinterpret_cast<internal::ContentCaptureReceiver_DidRemoveContent_Params_Data*>(
message->mutable_payload());
mojo::internal::SerializationContext serialization_context;
serialization_context.TakeHandlesFromMessage(message);
bool success = true;
std::vector<int64_t> p_ids{};
ContentCaptureReceiver_DidRemoveContent_ParamsDataView input_data_view(params, &serialization_context);
if (!input_data_view.ReadIds(&p_ids))
success = false;
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
ContentCaptureReceiver::Name_, 2, false);
return false;
}
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->DidRemoveContent(
std::move(p_ids));
return true;
}
}
return false;
}
// static
bool ContentCaptureReceiverStubDispatch::AcceptWithResponder(
ContentCaptureReceiver* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
switch (message->header()->name) {
case internal::kContentCaptureReceiver_DidCaptureContent_Name: {
break;
}
case internal::kContentCaptureReceiver_DidUpdateContent_Name: {
break;
}
case internal::kContentCaptureReceiver_DidRemoveContent_Name: {
break;
}
}
return false;
}
bool ContentCaptureReceiverRequestValidator::Accept(mojo::Message* message) {
if (!message->is_serialized() ||
mojo::internal::ControlMessageHandler::IsControlMessage(message)) {
return true;
}
mojo::internal::ValidationContext validation_context(
message->payload(), message->payload_num_bytes(),
message->handles()->size(), message->payload_num_interface_ids(), message,
"ContentCaptureReceiver RequestValidator");
switch (message->header()->name) {
case internal::kContentCaptureReceiver_DidCaptureContent_Name: {
if (!mojo::internal::ValidateMessageIsRequestWithoutResponse(
message, &validation_context)) {
return false;
}
if (!mojo::internal::ValidateMessagePayload<
internal::ContentCaptureReceiver_DidCaptureContent_Params_Data>(
message, &validation_context)) {
return false;
}
return true;
}
case internal::kContentCaptureReceiver_DidUpdateContent_Name: {
if (!mojo::internal::ValidateMessageIsRequestWithoutResponse(
message, &validation_context)) {
return false;
}
if (!mojo::internal::ValidateMessagePayload<
internal::ContentCaptureReceiver_DidUpdateContent_Params_Data>(
message, &validation_context)) {
return false;
}
return true;
}
case internal::kContentCaptureReceiver_DidRemoveContent_Name: {
if (!mojo::internal::ValidateMessageIsRequestWithoutResponse(
message, &validation_context)) {
return false;
}
if (!mojo::internal::ValidateMessagePayload<
internal::ContentCaptureReceiver_DidRemoveContent_Params_Data>(
message, &validation_context)) {
return false;
}
return true;
}
default:
break;
}
// Unrecognized message.
ReportValidationError(
&validation_context,
mojo::internal::VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD);
return false;
}
const char ContentCaptureSender::Name_[] = "content_capture.mojom.ContentCaptureSender";
ContentCaptureSenderProxy::ContentCaptureSenderProxy(mojo::MessageReceiverWithResponder* receiver)
: receiver_(receiver) {
}
void ContentCaptureSenderProxy::StartCapture(
) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT0("mojom", "<class 'jinja2::utils::Namespace'>::ContentCaptureSender::StartCapture");
#endif
const bool kExpectsResponse = false;
const bool kIsSync = false;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0);
mojo::Message message(
internal::kContentCaptureSender_StartCapture_Name, kFlags, 0, 0, nullptr);
auto* buffer = message.payload_buffer();
::content_capture::mojom::internal::ContentCaptureSender_StartCapture_Params_Data::BufferWriter
params;
mojo::internal::SerializationContext serialization_context;
params.Allocate(buffer);
message.AttachHandlesFromSerializationContext(
&serialization_context);
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(ContentCaptureSender::Name_);
message.set_method_name("StartCapture");
#endif
// This return value may be ignored as false implies the Connector has
// encountered an error, which will be visible through other means.
ignore_result(receiver_->Accept(&message));
}
void ContentCaptureSenderProxy::StopCapture(
) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT0("mojom", "<class 'jinja2::utils::Namespace'>::ContentCaptureSender::StopCapture");
#endif
const bool kExpectsResponse = false;
const bool kIsSync = false;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0);
mojo::Message message(
internal::kContentCaptureSender_StopCapture_Name, kFlags, 0, 0, nullptr);
auto* buffer = message.payload_buffer();
::content_capture::mojom::internal::ContentCaptureSender_StopCapture_Params_Data::BufferWriter
params;
mojo::internal::SerializationContext serialization_context;
params.Allocate(buffer);
message.AttachHandlesFromSerializationContext(
&serialization_context);
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(ContentCaptureSender::Name_);
message.set_method_name("StopCapture");
#endif
// This return value may be ignored as false implies the Connector has
// encountered an error, which will be visible through other means.
ignore_result(receiver_->Accept(&message));
}
// static
bool ContentCaptureSenderStubDispatch::Accept(
ContentCaptureSender* impl,
mojo::Message* message) {
switch (message->header()->name) {
case internal::kContentCaptureSender_StartCapture_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT1(
"mojom",
"(Impl)<class 'jinja2::utils::Namespace'>::ContentCaptureSender::StartCapture",
"message", message->name());
#endif
static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
"(Impl)<class 'jinja2::utils::Namespace'>::ContentCaptureSender::StartCapture");
base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);
mojo::internal::MessageDispatchContext context(message);
DCHECK(message->is_serialized());
internal::ContentCaptureSender_StartCapture_Params_Data* params =
reinterpret_cast<internal::ContentCaptureSender_StartCapture_Params_Data*>(
message->mutable_payload());
mojo::internal::SerializationContext serialization_context;
serialization_context.TakeHandlesFromMessage(message);
bool success = true;
ContentCaptureSender_StartCapture_ParamsDataView input_data_view(params, &serialization_context);
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
ContentCaptureSender::Name_, 0, false);
return false;
}
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->StartCapture();
return true;
}
case internal::kContentCaptureSender_StopCapture_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT1(
"mojom",
"(Impl)<class 'jinja2::utils::Namespace'>::ContentCaptureSender::StopCapture",
"message", message->name());
#endif
static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
"(Impl)<class 'jinja2::utils::Namespace'>::ContentCaptureSender::StopCapture");
base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);
mojo::internal::MessageDispatchContext context(message);
DCHECK(message->is_serialized());
internal::ContentCaptureSender_StopCapture_Params_Data* params =
reinterpret_cast<internal::ContentCaptureSender_StopCapture_Params_Data*>(
message->mutable_payload());
mojo::internal::SerializationContext serialization_context;
serialization_context.TakeHandlesFromMessage(message);
bool success = true;
ContentCaptureSender_StopCapture_ParamsDataView input_data_view(params, &serialization_context);
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
ContentCaptureSender::Name_, 1, false);
return false;
}
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->StopCapture();
return true;
}
}
return false;
}
// static
bool ContentCaptureSenderStubDispatch::AcceptWithResponder(
ContentCaptureSender* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
switch (message->header()->name) {
case internal::kContentCaptureSender_StartCapture_Name: {
break;
}
case internal::kContentCaptureSender_StopCapture_Name: {
break;
}
}
return false;
}
bool ContentCaptureSenderRequestValidator::Accept(mojo::Message* message) {
if (!message->is_serialized() ||
mojo::internal::ControlMessageHandler::IsControlMessage(message)) {
return true;
}
mojo::internal::ValidationContext validation_context(
message->payload(), message->payload_num_bytes(),
message->handles()->size(), message->payload_num_interface_ids(), message,
"ContentCaptureSender RequestValidator");
switch (message->header()->name) {
case internal::kContentCaptureSender_StartCapture_Name: {
if (!mojo::internal::ValidateMessageIsRequestWithoutResponse(
message, &validation_context)) {
return false;
}
if (!mojo::internal::ValidateMessagePayload<
internal::ContentCaptureSender_StartCapture_Params_Data>(
message, &validation_context)) {
return false;
}
return true;
}
case internal::kContentCaptureSender_StopCapture_Name: {
if (!mojo::internal::ValidateMessageIsRequestWithoutResponse(
message, &validation_context)) {
return false;
}
if (!mojo::internal::ValidateMessagePayload<
internal::ContentCaptureSender_StopCapture_Params_Data>(
message, &validation_context)) {
return false;
}
return true;
}
default:
break;
}
// Unrecognized message.
ReportValidationError(
&validation_context,
mojo::internal::VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD);
return false;
}
} // namespace mojom
} // namespace content_capture
namespace mojo {
} // namespace mojo
#if defined(__clang__)
#pragma clang diagnostic pop
#elif defined(_MSC_VER)
#pragma warning(pop)
#endif | [
"wasmview@gmail.com"
] | wasmview@gmail.com |
6cf30b47fea5f4b7da8af82c14fd1d24640e2545 | 8ca0a2000da77211cda8d4f7a67232a79424004b | /ball.cpp | 26c00ff494ea2145803a761cf5873e6758d289b1 | [] | no_license | nosferatu037/Pong_Game | 395ee5e935859ca471a127db75fc83014c113085 | 7c3b46b4a8e36d69b342134f8fd68cc650a88b57 | refs/heads/master | 2020-05-20T09:21:21.642364 | 2015-09-14T05:36:08 | 2015-09-14T05:36:08 | 42,428,700 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 17,574 | cpp | #include <curses.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include "ball.h"
#include "character.h"
Ball::Ball(DrawEngine* de, Level* lvl, int index, float x, float y,
int numlives, char left_key, char right_key) :
Sprite(de, lvl, index, x, y, numlives)
{
//set our random direction
srand(time(NULL));
facingDir.y = -(0.5 * ((double) rand() / (RAND_MAX)) + 0.5);
facingDir.x = (1 - 2 * ((rand() % 100)/100.0));
// facingDir.x = ((double) rand() / (RAND_MAX)) * 0.5;
// facingDir.y = -2 * ((rand() % 100)/100.0);
facingDir = normalize(facingDir);
//init ballOn to false, make the ball sit on pong
ballOn = false;
leftKey = left_key;
rightKey = right_key;
moveCounter = 0;
classID = BALL_CLASSID;
hitSide = HIT_NOHIT;
lives = 3;
}
//set the pointer to player
void Ball::setPlayer(Character* p)
{
player = p;
}
//update the balls position
void Ball::update()
{
if(ballOn)
{
//signal that we have started to move from the pong
if(moveCounter < 2)
{
moveCounter++;
}
//get the future/new position
vector newpos;
facingDir = normalize(facingDir);
newpos.x = (int)(pos.x + facingDir.x);
newpos.y = (int)(pos.y + facingDir.y);
//check for collision
int collision = checkMove(newpos.x, newpos.y);
//are we are not hitting anything
if(collision == 2)
{
//if we are not hitting the bricks
if(level->getLevelInfo(newpos.x, newpos.y) == TILE_EMPTY)
{
//keep moving
move(facingDir.x, facingDir.y);
}
//if we are hitting the BLOCKS
else
{
//move the ball on top of the block
move(facingDir.x,facingDir.y);
//get the current blocks normal
vector normDir;
normDir = level->getEnemiesNormal(newpos.x, newpos.y);
//kill the block
// drawArea->emptyTile(newpos.x, newpos.y);
level->emptyBlock(newpos.x, newpos.y);
//update our blocks normals since we have killed/deleted a block
// level->updateEnemiesDir();
//update our blocks and empty spaces
level->updateEnemies();
drawArea->drawSprite(SPRITE_BALL, newpos.x, newpos.y);
// //get the current blocks normal true - using laplace, false - no laplace
// vector normDir;
// normDir.x = level->getEnemiesDirX(newpos.x, newpos.y);
// normDir.y = level->getEnemiesDirY(newpos.x, newpos.y);
//bounce the ball off of the blocks normal and set
//the last member to true meaning that we are conducting bounce off blocks
bounceBall(normDir.x, normDir.y, true);
}
}
//if we are hitting the pong player
else if(collision == 1)
{
//bounce the ball based on the side of the player we hit
bounceBall(0,0,false);
}
//if we are hitting the wall
else if(collision == 0)
{
//just bounce the ball
bounceBall(0,0,false);
}
//if we have died
else if(collision == -1)
{
//if player is alive
if(player->isAlive())
{
//remove balls lives/players lives
player->addLives(-1);
addLives(-1);
//reset the ball position and the players pos
resetPos();
player->resetPos();
}
}
}
}
//check if we can move
//return 2 if the space is empty, we havent died and hit the pong player
//return 1 if we have hit the pong player
//return 0 if we have hit a wall
//return -1 if we went down too far and have died
int Ball::checkMove(int posx, int posy)
{
//check if the space is empty, by checking
//if we are not hitting the wall or have died
bool wall = isNotHittingWall(posx, posy);
//we havent hit the wall
if(wall)
{
//we can go and check
//if we are not hitting the pong player
bool p = isNotHittingPlayer(posx, posy);
//if we havent hit the player
if(p)
{
//did we die?
bool die = notDead(posx, posy);
//if we didnt die
if(die)
{
//signal that we can move (return 2)
return 2;
}
//if we have died
else
{
//signal that we have died (return -1)
return -1;
}
}
//if we have hit the player
else
{
//signal that we have hit the player (return 1)
return 1;
}
}
//if we have hit the wall
else
{
//signal that we have hit the wall (return 0)
return 0;
}
}
//are we dead?
bool Ball::notDead(int posx, int posy)
{
if((int)posy < (player->getY()))
{
return true;
}
return false;
}
//are we hitting the player?
bool Ball::isNotHittingPlayer(int posx, int posy)
{
//if we still havent moved from pongs pos
//or we just moved a moment ago
if(moveCounter > 1)
{
//if we are not dead, gone too low
//or if we are not just above the pong player
bool distOn = false;
float distance;
//aimPlayer is going to point towards the ball from player
//or maybe its better to just use the normal of the player
vector aimPlayer;
aimPlayer.x = 0;
aimPlayer.y = -1;
//normalize our aim vector
aimPlayer = normalize(aimPlayer);
//get the dot product between the balls facingDir
//and the vector from player to ball
float dotProd = dotProduct(facingDir, aimPlayer);
//get the distance from ball to player
//we also need to sum up the distance from all the parts
//of the pong player and not only from the center
int i, tmpi;
float minDist = 100;
for(i = -3; i <= 3; i++)
{
distance = sqrt(((player->getX() + i) - posx) * ((player->getX() + i) - posx)
+ (player->getY() - posy) * (player->getY() - posy));
if(distance < minDist)
{
minDist = distance;
tmpi = i;
}
else
{
break;
}
}
if(minDist < 1.5)
{
distOn = true;
}
//if dotProd < 0 - if the facingDir is facing towards the player
//and if distance is pretty small
//we are probably pretty low heading towards the bottom
if(dotProd < 0 && distOn)
{
//if we are not dead
if(notDead(posx, posy))
{
//if we are just above the player
if((int)posy > (player->getY() - 2))
{
//if we are not in pongs player width vicinity
if(((int)posx > (3 + player->getX()) && (int)posx < (player->getX() - 3)))
{
//we havent hit the player
hitSide = HIT_NOHIT;
return true;
}
player->setHitSide(tmpi);
//we have hit the player
hitSide = HIT_PLAYER;
return false;
}
}
//we are either dead or have hit the player
hitSide = HIT_NOHIT;
return false;
}
hitSide = HIT_NOHIT;
return true;
}
//we are not moving and havent hit anything
hitSide = HIT_NOHIT;
return true;
}
//are we hitting the wall?
bool Ball::isNotHittingWall(int posx, int posy)
{
//are we hitting left side
if((int)posx == 0)
{
hitSide = HIT_LSIDE;
return false;
}
//or are we hitting right side
if((int)posx == drawArea->getScreenW())
{
hitSide = HIT_RSIDE;
return false;
}
//or are we hitting top
if((int)posy == 0)
{
hitSide = HIT_TOP;
return false;
}
//or are we hitting bottom
if((int)posy == drawArea->getScreenH())
{
hitSide = HIT_BOTTOM;
return false;
}
//if not then we are not hitting the wall
else
{
hitSide = HIT_NOHIT;
return true;
}
}
//add/remove lives from the ball
void Ball::addLives(int num)
{
Sprite::addLives(num);
}
//bounce the ball
//the most important part of the game
bool Ball::bounceBall(float x, float y, bool block)
{
//if we are hitting an enemy block
if(block)
{
//create temp vectors
vector collNorm, tempDir;
//set the enemies collision normal
collNorm.x = x;
collNorm.y = y;
//calc the reflection vector from our dir and
//enemies collision normal
tempDir = reflect(facingDir, collNorm);
//just check to see if our y is extremely low, cannot have that
if(fabs(tempDir.y) < 0.1)
tempDir.y += 0.15;
tempDir = normalize(tempDir);
//set our facing dir
facingDir = tempDir;
//we are successful
return true;
}
//if we are not hitting an enemy block
//check what is it that we are hitting
else
{
//are we hitting bottom wall
if(hitSide == HIT_BOTTOM)
{
//first move to bottom side of the wall
if((int)pos.y != drawArea->getScreenH())
{
// moveToPos((pos.x + facingDir.x), drawArea->getScreenH());
// move(facingDir.x, drawArea->getScreenH() - pos.y);
move(facingDir.x, facingDir.y);
}
//then update our facing dir
//so next run we will bounce off of the wall
vector bottom, tempDir;
bottom.x = 0;
bottom.y = -1;
tempDir = reflect(facingDir, bottom);
//just check to see if our y is extremely low, cannot have that
if(fabs(tempDir.y) < 0.1)
tempDir.y += 0.15;
tempDir = normalize(tempDir);
facingDir = tempDir;
return true;
}
//or top
else if(hitSide == HIT_TOP)
{
//first move to top side of the wall
if((int)pos.y != 0)
{
// moveToPos((pos.x + facingDir.x), 0);
// move(facingDir.x, 0 - pos.y);
move(facingDir.x, facingDir.y);
}
//then update our facing dir
//so next run we will bounce off of the wall
vector top, tempDir;
top.x = 0;
top.y = 1;
tempDir = reflect(facingDir, top);
//just check to see if our y is extremely low, cannot have that
if(fabs(tempDir.y) < 0.1)
tempDir.y += 0.15;
tempDir = normalize(tempDir);
facingDir = tempDir;
return true;
}
//or left side
else if(hitSide == HIT_LSIDE)
{
//first move to left side of the wall
if((int)pos.x != 0)
{
// moveToPos(0,(pos.y + facingDir.y));
// move(0 - pos.x, facingDir.y);
move(facingDir.x, facingDir.y);
}
//then update our facing dir
//so next run we will bounce off of the wall
vector lside, tempDir;
lside.x = 1;
lside.y = 0;
tempDir = reflect(facingDir, lside);
//just check to see if our y is extremely low, cannot have that
if(fabs(tempDir.y) < 0.1)
tempDir.y += 0.15;
tempDir = normalize(tempDir);
facingDir = tempDir;
return true;
}
//or right side
else if(hitSide == HIT_RSIDE)
{
//first move to right side of the wall
if((int)pos.x != drawArea->getScreenW())
{
// moveToPos(drawArea->getScreenW(), (pos.y + facingDir.y));
// move(drawArea->getScreenW() - pos.x, facingDir.y);
move(facingDir.x, facingDir.y);
}
//then update our facing dir
//so next run we will bounce off of the wall
vector rside, tempDir;
rside.x = -1;
rside.y = 0;
tempDir = reflect(facingDir, rside);
//just check to see if our y is extremely low, cannot have that
if(fabs(tempDir.y) < 0.1)
tempDir.y += 0.15;
tempDir = normalize(tempDir);
facingDir = tempDir;
return true;
}
else if(hitSide == HIT_PLAYER)
{
//first move to bottom side of the wall
if((int)pos.y != drawArea->getScreenH())
{
move(facingDir.x, facingDir.y);
}
vector normal, tempDir;
int side = player->getHitSide();
normal.x = (side) * (0.7 / 3.0);
normal.y = -1;
normal = normalize(normal);
tempDir = reflect(facingDir, normal);
//just check to see if our y is extremely low, cannot have that
if(fabs(tempDir.y) < 0.1)
tempDir.y += 0.15;
tempDir = normalize(tempDir);
facingDir = tempDir;
return true;
}
//or maybe nothing
else
{
return false;
}
}
}
//draw the ball
void Ball::draw(float x, float y)
{
drawArea->drawSprite(SPRITE_BALL, x, y);
}
//erase the ball
void Ball::erase(float x, float y)
{
drawArea->deleteSprite(x, y);
}
//move the ball if it hasnt been launched yet
bool Ball::keyPress(char c)
{
if(c == leftKey)
{
return move(-1, 0);
}
else if(c == rightKey)
{
return move(1, 0);
}
else
{
return false;
}
}
//set the ball status
//ballOn = true if the ball has been launched
//ballOn = false if its still sitting on the player
void Ball::setBallOn(bool set)
{
ballOn = set;
}
//return the ball status
bool Ball::getBallStatus()
{
return ballOn;
}
//move our ball based off of facingDir
//this is a relative move
bool Ball::move(float x, float y)
{
//this is a relative move
//meaning we move by increment (accel/facingDir)
//rather than moving to actual pos
erase(pos.x, pos.y);
//just add to our current pos
pos.x += x;
pos.y += y;
draw(pos.x, pos.y);
return true;
}
//move the ball at specific location
//this is an absolute move
bool Ball::moveToPos(float x, float y)
{
//this is an absolute move
//meaning we draw the ball at a specific location
//without updating the facingDir
//first erase the ball at current pos
erase(pos.x, pos.y);
//then update our future pos
pos.x = x;
pos.y = y;
//draw us at the future pos
draw(pos.x, pos.y);
return true;
}
//reset the balls position and the center bottom screen
//on top of the pong player, also reset the facingDirection
void Ball::resetPos()
{
//erase ball from the dead pos
erase(pos.x, pos.y);
//reset the pos
pos.x = drawArea->getScreenW() / 2;
pos.y = drawArea->getScreenH() - 3;
//draw at the default pos
draw(drawArea->getScreenW() / 2, drawArea->getScreenH() - 3);
//regenerate the facingDir
srand(time(NULL));
facingDir.x = (1 - 2 * ((rand() % 100)/100.0));
facingDir.y = -2 * ((rand() % 100)/100.0);
facingDir = normalize(facingDir);
//reset the pos on top of the pong
ballOn = false;
//and our move counter
moveCounter = 0;
//and our hitSide
hitSide = HIT_NOHIT;
}
//return a dot product between two vectors
float Ball::dotProduct(vector dir, vector norm)
{
// float dirMag = sqrt(dir.x * dir.x + dir.y * dir.y);
// float normMag = sqrt(norm.x * norm.x + norm.y * norm.y);
// float costh = cos(dirMag/normMag);
// return (dirMag * normMag * costh);
return (dir.x * norm.x + dir.y * norm.y);
}
//calculate the reflection vector when we collide
//between our direction and enemies normal
vector Ball::reflect(vector dir, vector norm)
{
vector temp;
float dot = dotProduct(dir, norm);
temp.x = dir.x - 2 * dot * norm.x;
temp.y = dir.y - 2 * dot * norm.y;
return temp;
}
//calc vectors magnitude
float Ball::vecMag(vector Vec)
{
return (sqrt(Vec.x * Vec.x + Vec.y * Vec.y));
}
//normalize a vector
vector Ball::normalize(vector Vec)
{
vector tmp;
tmp.x = Vec.x / vecMag(Vec);
tmp.y = Vec.y / vecMag(Vec);
return tmp;
}
//get the facing direction
vector Ball::getFacingDir()
{
return facingDir;
}
| [
"nosferatu037@gmail.com"
] | nosferatu037@gmail.com |
cd5826431da6d9fe778ef2db817f768eafa01c23 | 6aa5fe3343c2c4b867ea945763010dbdb24ca647 | /Bulletshot/src/Game/TestsManager.h | 739e3d4349a63d0727bc62647e83a4f2f24f8341 | [] | no_license | denyskryvytskyi/Bulletshot | 690a48992291c7c78e5df06c4290246608d08d52 | 8db841288e0e8d03546c769182e166e7e315db07 | refs/heads/main | 2023-04-28T05:35:34.959476 | 2021-05-22T16:29:39 | 2021-05-22T16:29:39 | 317,813,604 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 491 | h | #pragma once
class TestsManager
{
public:
TestsManager() = default;
static void ToggleGenerateObjects(const uint32_t wallsCount, const uint32_t bulletsCount);
static void ToggleGenerateObjects();
static void ToggleCleanupScene(bool toggle);
static void ToggleMTStressTest();
public:
static uint32_t m_WallsCount;
static uint32_t m_BulletsCount;
static bool m_GenerateObjects;
static bool m_CleanupScene;
static bool m_AllowMTStabilityStressTest;
}; | [
"kryvytskyi.denys@gmail.com"
] | kryvytskyi.denys@gmail.com |
d82e9cebcad2c9c6a3f8582bae4d7b01f381db78 | 6f05f7d5a67b6bb87956a22b988067ec772ba966 | /data/train/cpp/2812a2fef629ad0864203c12711902af4a93cd12NGramModel.h | eb4a7dd7f45129c3c735f820ee3b0ab531d6a2e5 | [
"MIT"
] | permissive | harshp8l/deep-learning-lang-detection | 93b6d24a38081597c610ecf9b1f3b92c7d669be5 | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | refs/heads/master | 2020-04-07T18:07:00.697994 | 2018-11-29T23:21:23 | 2018-11-29T23:21:23 | 158,597,498 | 0 | 0 | MIT | 2018-11-21T19:36:42 | 2018-11-21T19:36:41 | null | UTF-8 | C++ | false | false | 652 | h | #pragma once;
#include "pocketsphinx.h"
using namespace System;
using namespace System::Runtime::InteropServices;
namespace PocketSphinxNet
{
public ref class NGramModel
{
internal:
ngram_model_t* model;
public:
NGramModel()
{
this->model = 0;
}
~NGramModel()
{
this->Free();
}
internal:
NGramModel(ngram_model_t* model)
{
this->model = model;
}
operator ngram_model_t* ()
{
return this->model;
}
public:
bool Free()
{
bool done = true;
if(this->model !=0)
{
done = ngram_model_free(this->model) == 0;
if(done)
{
this->model = 0;
}
}
return done;
}
};
} | [
"aliostad+github@gmail.com"
] | aliostad+github@gmail.com |
0fffb6060e07a61dc20c555bd5909ea7fc90a666 | 5e9d97b7ebb378a351c77f805cf467a314295e57 | /Pakna And His Polygon.cpp | e79903898c714df91f7efa3e067f6b3ed30f0aae | [] | no_license | mjannat/Online-Judge-Problems-Solution-in-Cpp | bd62157ee39ebc997f8cdbacd26abb0401aea600 | ce0defaee9c2bffbc3e5d5b67b0a2ae529507b80 | refs/heads/master | 2020-12-20T11:36:07.916260 | 2020-04-28T10:04:24 | 2020-04-28T10:04:24 | 236,060,998 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 227 | cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int test;
cin >> test;
while(test--)
{
double a;
cin >> a;
cout << fixed << setprecision(5)<< (3 * sqrt(3))/2.0*(a * a)<<endl;
}
}
| [
"noreply@github.com"
] | mjannat.noreply@github.com |
c99db3acca81d07b4b0a7af1b4298e43dda198d1 | 32512f5eb7ad308f25ba450e64b4b6c175159600 | /src/functions.cpp | 652d707257be99b82c329f1ac7322f639018823e | [] | no_license | projunk/SpotMicro | 1d8b0e732402a3b16dfea7519d447c5ba4aa6420 | 02f677a01b151045570e851887b3d7c87f8814e4 | refs/heads/main | 2023-04-21T04:26:05.662868 | 2021-05-15T14:48:37 | 2021-05-15T14:48:37 | 367,656,640 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 37,386 | cpp | #include <functions.h>
volatile bool APStarted = false;
volatile unsigned long previousTimerValue;
volatile int channel[NR_OF_RECEIVER_CHANNELS];
volatile float voltage;
String robotName;
volatile bool signal_detected = false;
int signal_detected_count = 0;
int signal_lost_count = SIGNALS_DETECTED_LOST_THRESHOLD;
volatile bool buzzerDisabled = false;
volatile double voltageCorrectionFactor = defaultVoltageCorrectionFactor;
IPAddress *ipAddress;
volatile long usedUpLoopTime;
short gyro_x, gyro_y, gyro_z;
short acc_x, acc_y, acc_z;
volatile short temperature;
long gyro_x_cal, gyro_y_cal, gyro_z_cal;
bool mpu_6050_found = false;
bool displayFound;
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
volatile unsigned int distanceLeft, distanceRight;
HardwareSerial hs(2);
IBusBM IBus;
DogMode dogMode;
TwoPosSwitch switchA(4);
TwoPosSwitch switchB(6);
TwoPosSwitch switchD(7);
ThreePosSwitch switchC(5);
Dog dog;
Ultrasonic ultrasonicLeft(TRIGGER_PIN_LEFT, ECHO_PIN_LEFT);
Ultrasonic ultrasonicRight(TRIGGER_PIN_RIGHT, ECHO_PIN_RIGHT);
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire1, OLED_RESET);
double lowPassFilter(const double prmAlpha, const double prmCurrentValue, const double prmPreviousValue) {
// https://sites.google.com/site/myimuestimationexperience/filters/complementary-filter
return prmAlpha * prmPreviousValue + (1.0 - prmAlpha) * prmCurrentValue;
}
double averageFilter(const double prmCurrentValue) {
const int nrOfMeasurements = 100;
static double measurements[nrOfMeasurements];
static int index = -1;
static bool doCalcAverage = false;
index++;
if (index == nrOfMeasurements) {
index = 0;
doCalcAverage = true;
}
measurements[index] = prmCurrentValue;
if (doCalcAverage) {
double sum = 0.0;
for (int i = 0; i < nrOfMeasurements; i++) {
sum += measurements[i];
}
return sum / nrOfMeasurements;
} else {
return 0.0;
}
}
int checkCenterOffset(const int prmCenterOffset) {
if (prmCenterOffset > (MAX_PULSE - MID_CHANNEL)) {
return (MAX_PULSE - MID_CHANNEL);
}
if (prmCenterOffset < (MIN_PULSE - MID_CHANNEL)) {
return (MIN_PULSE - MID_CHANNEL);
}
return prmCenterOffset;
}
void printProps() {
dog.printOffsetNeutralMicros();
Serial.print(voltageCorrectionFactor);
Serial.println();
}
void loadProps() {
Serial.println("loadProps");
buzzerDisabled = true;
if (SPIFFS.exists("/props")) {
File f = SPIFFS.open("/props", "r");
if (f) {
dog.loadProps(f);
voltageCorrectionFactor = f.readStringUntil('\n').toDouble();
f.close();
}
}
buzzerDisabled = false;
}
void saveProps() {
Serial.println("saveProps");
buzzerDisabled = true;
File f = SPIFFS.open("/props", "w");
if (f) {
dog.saveProps(f);
f.println(String(voltageCorrectionFactor, 2));
f.close();
}
buzzerDisabled = false;
}
bool isEqualID(const uint8_t prmID[UniqueIDsize]) {
for (size_t i = 0; i < UniqueIDsize; i++) {
if (UniqueID[i] != prmID[i]) {
return false;
}
}
return true;
}
String identifyRobot() {
String name;
if (isEqualID(BREADBOARD_SPOT)) {
name = "Breadboard Spot";
} else if (isEqualID(YELLOW_SPOT)) {
name = "Yellow Spot";
} else {
name = "Unknown";
}
return name;
}
bool isValidSignal(int prmPulse) {
return (prmPulse > INVALID_SIGNAL_PULSE);
}
int getNrOfCells(float prmVBatTotal) {
const float ABS_MAX_CELLVOLTAGE = FULLY_CHARGED_VOLTAGE+0.2;
if (prmVBatTotal < 0.1) {
return 0;
} else if (prmVBatTotal < ABS_MAX_CELLVOLTAGE) {
return 1;
} else if (prmVBatTotal < 2*ABS_MAX_CELLVOLTAGE) {
return 2;
} else if (prmVBatTotal < 3*ABS_MAX_CELLVOLTAGE) {
return 3;
} else if (prmVBatTotal < 4*ABS_MAX_CELLVOLTAGE) {
return 4;
} else {
// not supported
return 0;
}
}
float readVoltage() {
const float R1 = 4700.0;
const float R2 = 1000.0;
float vBatTotal = analogRead(VOLTAGE_SENSOR_PIN) * (3.3 / 4095.0) * (R1+R2)/R2;
int nrOfCells = getNrOfCells(vBatTotal);
float cellVoltage = 0.0;
if (nrOfCells > 0) {
cellVoltage = voltageCorrectionFactor * vBatTotal / nrOfCells;
}
/*
Serial.print(vBatTotal);
Serial.print("\t");
Serial.print(nrOfCells);
Serial.print("\t");
Serial.println(cellVoltage);
*/
return cellVoltage;
}
String getVoltageStr() {
return String(voltage, 2);
}
int fixChannelDirection(int prmChannel, boolean prmReversed) {
if (prmReversed) {
return map(prmChannel, MIN_PULSE, MAX_PULSE, MAX_PULSE, MIN_PULSE);
} else {
return prmChannel;
}
}
bool isDisplayFound() {
Wire1.beginTransmission(OLED_ADDR);
return Wire1.endTransmission() == 0;
}
bool is_mpu_6050_found() {
Wire.beginTransmission(0x68);
return Wire.endTransmission() == 0;
}
void setup_mpu_6050_registers() {
if (!mpu_6050_found) return;
//Activate the MPU-6050
Wire.beginTransmission(0x68); //Start communicating with the MPU-6050
Wire.write(0x6B); //Send the requested starting register
Wire.write(0x00); //Set the requested starting register
Wire.endTransmission(); //End the transmission
//Configure the accelerometer (+/-8g)
Wire.beginTransmission(0x68); //Start communicating with the MPU-6050
Wire.write(0x1C); //Send the requested starting register
Wire.write(0x10); //Set the requested starting register
Wire.endTransmission(); //End the transmission
//Configure the gyro (500dps full scale)
Wire.beginTransmission(0x68); //Start communicating with the MPU-6050
Wire.write(0x1B); //Send the requested starting register
Wire.write(0x08); //Set the requested starting register
Wire.endTransmission(); //End the transmission
}
void read_mpu_6050_data() {
if (mpu_6050_found) {
Wire.beginTransmission(0x68); //Start communicating with the MPU-6050
Wire.write(0x3B); //Send the requested starting register
Wire.endTransmission(); //End the transmission
Wire.requestFrom(0x68,14); //Request 14 bytes from the MPU-6050
while(Wire.available() < 14); //Wait until all the bytes are received
acc_x = Wire.read()<<8 | Wire.read(); //Add the low and high byte to the acc_x variable
acc_y = Wire.read()<<8 | Wire.read(); //Add the low and high byte to the acc_y variable
acc_z = Wire.read()<<8 | Wire.read(); //Add the low and high byte to the acc_z variable
temperature = Wire.read()<<8 | Wire.read(); //Add the low and high byte to the temperature variable
gyro_x = Wire.read()<<8 | Wire.read(); //Add the low and high byte to the gyro_x variable
gyro_y = Wire.read()<<8 | Wire.read(); //Add the low and high byte to the gyro_y variable
gyro_z = Wire.read()<<8 | Wire.read(); //Add the low and high byte to the gyro_z variable
} else {
acc_x = 0;
acc_y = 0;
acc_z = 0;
temperature = 0;
gyro_x = 0;
gyro_y = 0;
gyro_z = 0;
}
}
void calibrate_mpu_6050() {
if (mpu_6050_found) {
for (int cal_int = 0; cal_int < GYRO_CALIBRATION_COUNT ; cal_int ++) { //Run this code GYRO_CALIBRATION_COUNT times
read_mpu_6050_data(); //Read the raw acc and gyro data from the MPU-6050
gyro_x_cal += gyro_x; //Add the gyro x-axis offset to the gyro_x_cal variable
gyro_y_cal += gyro_y; //Add the gyro y-axis offset to the gyro_y_cal variable
gyro_z_cal += gyro_z; //Add the gyro z-axis offset to the gyro_z_cal variable
delay(3); //Delay 3us to simulate the 250Hz program loop
}
gyro_x_cal /= GYRO_CALIBRATION_COUNT; //Divide the gyro_x_cal variable by GYRO_CALIBRATION_COUNT to get the avarage offset
gyro_y_cal /= GYRO_CALIBRATION_COUNT; //Divide the gyro_y_cal variable by GYRO_CALIBRATION_COUNT to get the avarage offset
gyro_z_cal /= GYRO_CALIBRATION_COUNT; //Divide the gyro_z_cal variable by GYRO_CALIBRATION_COUNT to get the avarage offset
} else {
gyro_x_cal = 0;
gyro_y_cal = 0;
gyro_z_cal = 0;
}
Serial.print(" gyro_x_cal:");
Serial.print(gyro_x_cal);
Serial.print(" gyro_y_cal:");
Serial.print(gyro_y_cal);
Serial.print(" gyro_z_cal:");
Serial.println(gyro_z_cal);
}
float getTempCelsius() {
return 36.53 + temperature/340.0;
}
void print_gyro_values() {
/*
Serial.print("acc_x:\t");
Serial.print(acc_x);
Serial.print("\tacc_y:\t");
Serial.print(acc_y);
Serial.print("\tacc_z:\t");
Serial.print(acc_z);
*/
Serial.print("\ttemp:\t");
Serial.print(getTempCelsius());
Serial.print("\tgyro_x:\t");
Serial.print(gyro_x);
Serial.print("\tgyro_y:\t");
Serial.print(gyro_y);
Serial.print("\tgyro_z:\t");
Serial.println(gyro_z);
}
bool isArmed() {
return (signal_detected && (switchA.readPos() == 2));
}
DogMode getDogMode() {
switch (switchC.readPos()) {
case 1:
return dmManual;
case 2:
return dmSit;
default:
return dmCrawl;
}
}
void playTune(String prmTune) {
if (!buzzerDisabled) {
static char buf[64];
strcpy(buf, prmTune.c_str());
rtttl::begin(BUZZER_PIN, buf);
rtttl::play();
}
}
void playShortBeep() {
playTune("ShortBeep:d=32,o=5,b=140:c5");
}
void playLowVoltageAlarm() {
playTune("LowVoltageAlarm:d=16,o=5,b=140:c6,P,c5,P,c6,P,c5,P");
}
void playArmed() {
Serial.println("Armed");
playTune("Armed:d=16,o=5,b=140:c5,P,c6,P,a7");
}
void playDisarmed() {
Serial.println("Disarmed");
playTune("DisArmed:d=16,o=5,b=140:a7,P,c6,P,c5");
}
void playSignalDetected() {
Serial.println("Signal Detected");
playTune("SignalDetected:d=16,o=5,b=140:c5,P,c5,P,c5,P,c5,P,c5,P,c5,P,a7,P");
}
void playSignalLost() {
Serial.println("Signal Lost");
playTune("SignalLost:d=16,o=5,b=140:a7,P,c5,P,c5,P,c5,P,c5,P,c5,P,c5,P");
}
void servoTest() {
int servonum = 15;
Serial.println(servonum);
for (;;) {
pwm.writeMicroseconds(servonum, 1500);
delay(2000);
pwm.writeMicroseconds(servonum, 800);
delay(2000);
pwm.writeMicroseconds(servonum, 1500);
delay(2000);
pwm.writeMicroseconds(servonum, 2200);
delay(2000);
}
}
void readChannels() {
for (int i = 0; i < NR_OF_RECEIVER_CHANNELS; i++) {
channel[i] = IBus.readChannel(i);
}
}
bool isSignalLostDetected(int prmPulse) {
// https://github.com/aanon4/FlySkyIBus/issues/1
// last 4bits of prmPulse
unsigned int failBits = (prmPulse >> 12) & 0xF;
if (failBits == 0x2) {
// the first 12 bits of channel the value contains the actual value from receiver
for (int i = 0; i < NR_OF_RECEIVER_CHANNELS; i++) {
channel[i] = channel[i] & 0xFFF;
}
return true;
} else {
return false;
}
}
void printChannels() {
for (int i = 0; i < NR_OF_RECEIVER_CHANNELS; i++) {
Serial.print(channel[i]);
Serial.print("\t");
}
Serial.println();
}
void updateDisplay() {
int lineDistance = 12;
if (displayFound) {
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(0, 0);
display.print("STATUS SPOTMICRO");
int yPos = 16;
display.setCursor(0, yPos);
display.print("IP:");
display.print(ipAddress->toString());
yPos += lineDistance;
display.setCursor(0, yPos);
display.print("Distance Left:");
display.print(distanceLeft);
display.print(" cm");
yPos += lineDistance;
display.setCursor(0, yPos);
display.print("Distance Right:");
display.print(distanceRight);
display.print(" cm");
yPos += lineDistance;
display.setCursor(0, yPos);
display.print("Voltage:");
display.print(voltage);
display.print(" V");
display.display();
}
}
void printString(String prmValue, String prmTitle, String prmUnit)
{
char buf[64];
sprintf(buf, "%s : %4s %s", prmTitle.c_str(), prmValue.c_str(), prmUnit.c_str());
Serial.println(buf);
}
void printInt(int32_t prmValue, String prmTitle, String prmUnit)
{
char buf[64];
sprintf(buf, "%s : %6d %s", prmTitle.c_str(), prmValue, prmUnit.c_str());
Serial.println(buf);
}
String getSSID() {
String ssid = SSID_BASE + robotName;
ssid.toUpperCase();
return ssid;
}
String getBSSID(uint8_t* prmStrongestBssid) {
if (prmStrongestBssid == NULL) {
return "";
}
static char BSSID_char[18];
for (int i = 0; i < 6; ++i){
sprintf(BSSID_char,"%s%02x:",BSSID_char,prmStrongestBssid[i]);
}
BSSID_char[17] = '\0';
return String(BSSID_char);
}
uint8_t* getChannelWithStrongestSignal(String prmSSID, int32_t *prmStrongestChannel) {
Serial.println("getChannelWithStrongestSignal ...............");
byte available_networks = WiFi.scanNetworks();
uint8_t* strongestBssid = NULL;
int32_t rssiMax = -2147483648;
*prmStrongestChannel = -1;
for (int network = 0; network < available_networks; network++) {
if (WiFi.SSID(network).equalsIgnoreCase(prmSSID)) {
if (WiFi.RSSI(network) > rssiMax) {
rssiMax = WiFi.RSSI(network);
strongestBssid = WiFi.BSSID(network);
*prmStrongestChannel = WiFi.channel(network);
}
}
}
printInt(rssiMax, "rssiMax", "dB");
printInt(*prmStrongestChannel, "StrongestChannel", "");
printString(getBSSID(strongestBssid), "StrongestBssid", "");
Serial.println();
return strongestBssid;
}
String getIdFromName(String prmName) {
String id = prmName;
id.replace(" ", "_");
id.replace("[", "");
id.replace("]", "");
id.replace("(", "");
id.replace(")", "");
return id;
}
String getIdFromName(String prmName, int prmIndex) {
String id = prmName;
id.replace(" ", "_");
id.replace("[", "");
id.replace("]", "");
id.replace("(", "");
id.replace(")", "");
return id + String(prmIndex);
}
bool isAPStarted() {
return APStarted;
}
void WiFiAPStarted(WiFiEvent_t event, WiFiEventInfo_t info) {
APStarted = true;
Serial.println("AP Started");
}
String addDQuotes(String prmValue) {
return "\"" + prmValue + "\"";
}
String addRow(String prmName, bool prmIsEditableCell, bool prmIsHeader, String prmValue = "") {
String editableCell = prmIsEditableCell ? "contenteditable='true'" : "";
String prefix = prmIsHeader ? "<th " : "<td ";
String suffix = prmIsHeader ? "</th>" : "</td>";
String col1 = prefix + "style=\"width:20%\" ALIGN=CENTER>" + prmName + suffix;
String col2 = prefix + editableCell + " id=" + addDQuotes(getIdFromName(prmName)) + " style=\"width:20%\" ALIGN=CENTER>" + prmValue + suffix;
return "<tr>" + col1 + col2 + "</tr>";
}
String addRow(String name, String value1, String value2, String value3, bool prmIsEditableCell, bool prmIsHeader = false) {
String editableCell = prmIsEditableCell ? "contenteditable='true'" : "";
String prefix = prmIsHeader ? "<th " : "<td ";
String suffix = prmIsHeader ? "</th>" : "</td>";
String col1 = prefix + "style=\"width:25%\" ALIGN=CENTER>" + name + suffix;
String col2 = prefix + editableCell + " id=" + addDQuotes(getIdFromName(name, 1)) + " style=\"width:25%\" ALIGN=CENTER>" + value1 + suffix;
String col3 = prefix + editableCell + " id=" + addDQuotes(getIdFromName(name, 2)) + " style=\"width:25%\" ALIGN=CENTER>" + value2 + suffix;
String col4 = prefix + editableCell + " id=" + addDQuotes(getIdFromName(name, 3)) + " style=\"width:25%\" ALIGN=CENTER>" + value3 + suffix;
return "<tr>" + col1 + col2 + col3 + col4 + "</tr>";
}
String toString(bool prmValue) {
if (prmValue) return "True";
return "False";
}
String toString(int prmValue) {
return String(prmValue);
}
String toString(double prmValue) {
return String(prmValue, 2);
}
String getBatteryProgressStr() {
return "<div class=\"progress\"><div id=\"" ID_PROGRESS_BATTERY "\" class=\"progress-bar progress-bar-danger\" role=\"progressbar\" aria-valuenow=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width:0%\">0%</div></div>";
}
String getChannelProgressStr(String prmChannelDivID, String prmChannelSpanID, String prmColor) {
return "<div class=\"progress\"><div id=\"" + prmChannelDivID + "\" class=\"progress-bar " + prmColor + "\"" + " role=\"progressbar\" aria-valuenow=\"0\" aria-valuemin=\"800\" aria-valuemax=\"2200\" style=\"width:0%\"><span id=\"" + prmChannelSpanID + "\" ></span></div></div>";
}
String getHtmlHeader() {
String s = "";
s += "<head>";
s += " <meta><title>WebService: " + robotName + "</title>";
s += " <style>";
s += " table, th, td {border: 1px solid black; border-collapse: collapse;}";
s += " tr:nth-child(even) { background-color: #eee }";
s += " tr:nth-child(odd) { background-color: #fff;}";
s += " td:first-child { background-color: lightgrey; color: black;}";
s += " th { background-color: lightgrey; color: black;}";
s += " </style>";
s += " <style>";
s += " html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-align: center;}";
s += " .button { border-radius: 12px; background-color: grey; border: none; color: white; padding: 16px 40px;";
s += " text-decoration: none; font-size: 30px; margin: 10px; cursor: pointer;}";
s += " .progress-bar{float:left;width:0%;height:100%;font-size:16px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}";
s += " .progress-bar-success{background-color:#5cb85c}";
s += " .progress-bar-warning{background-color:#f0ad4e}";
s += " .progress-bar-danger{background-color:#d9534f}";
s += " .progress-bar-ch1{background-color:#cc0000}";
s += " .progress-bar-ch2{background-color:purple}";
s += " .progress-bar-ch3{background-color:#0066cc}";
s += " .progress-bar-ch4{background-color:#2eb8b8}";
s += " .progress-bar-ch5{background-color:#26734d}";
s += " .progress-bar-ch6{background-color:#2eb82e}";
s += " .progress-bar-ch7{background-color:#ccff99}";
s += " .progress-bar-ch8{background-color:#ffcc00}";
s += " .progress-bar-ch9{background-color:#ff6600}";
s += " .progress-bar-ch10{background-color:#663300}";
s += " </style>";
s += " <style>";
s += " .progress {";
s += " position: relative;";
s += " height:20px;";
s += " }";
s += " .progress span {";
s += " position: absolute;";
s += " display: block;";
s += " width: 100%;";
s += " color: black;";
s += " }";
s += " </style>";
s += "</head>";
return s;
}
String getScript() {
String s = "";
s += "<script>";
s += "requestData();";
s += "var timerId = setInterval(requestData, " WEBPAGE_REFRESH_INTERVAL ");";
s += "function getBatColorMsg(prmVoltage) {";
s += " if (prmVoltage < " + String(LOW_VOLTAGE_ALARM, 2) + ") {";
s += " return \"progress-bar progress-bar-danger\";";
s += " } else if (prmVoltage <" + String(WARNING_VOLTAGE, 2) + ") {";
s += " return \"progress-bar progress-bar-warning\";";
s += " } else {";
s += " return \"progress-bar progress-bar-success\";";
s += " }";
s += "}";
s += "function getBatPercentage(prmVoltage) {";
s += " var percentage = 100.0*((prmVoltage - " + String(LOW_VOLTAGE_ALARM, 2) + ")/" + String(FULLY_CHARGED_VOLTAGE - LOW_VOLTAGE_ALARM, 2) + ");";
s += " if (percentage > 100.0) {";
s += " percentage = 100.0;";
s += " }";
s += " if (percentage < 0.0) {";
s += " percentage = 0.0;";
s += " }";
s += " return percentage;";
s += "}";
s += "function getChannelPercentage(prmPulse) {";
s += " var percentage = 100.0*((prmPulse - 800)/(2200-800));";
s += " if (percentage > 100.0) {";
s += " percentage = 100.0;";
s += " }";
s += " if (percentage < 0.0) {";
s += " percentage = 0.0;";
s += " }";
s += " return percentage;";
s += "}";
s += "function updateChannel(prmDivProgressID, prmSpanProgressID, prmValue) {";
s += " var divProgressElem = document.getElementById(prmDivProgressID);";
s += " var spanProgressElem = document.getElementById(prmSpanProgressID);";
s += " var value = parseInt(prmValue);";
s += " divProgressElem.setAttribute(\"aria-valuenow\", value);";
s += " divProgressElem.setAttribute(\"style\", \"width:\" + parseFloat(getChannelPercentage(value)).toFixed(0) + \"%\");";
s += " spanProgressElem.innerText = value;";
s += "}";
s += "function requestData() {";
s += " var xhr = new XMLHttpRequest();";
s += " xhr.open(\"GET\", \"/RequestLatestData\", true);";
s += " xhr.timeout = (" WEBPAGE_TIMEOUT ");";
s += " xhr.onload = function() {";
s += " if (xhr.status == 200) {";
s += " if (xhr.responseText) {";
s += " var data = JSON.parse(xhr.responseText);";
s += " var parser = new DOMParser();";
s += " document.getElementById(\"" + getIdFromName(NAME_SIGNAL_DETECTED) + "\").innerText = data." + getIdFromName(NAME_SIGNAL_DETECTED) + ";";
s += " document.getElementById(\"" + getIdFromName(NAME_ARMED) + "\").innerText = data." + getIdFromName(NAME_ARMED) + ";";
s += " document.getElementById(\"" + getIdFromName(NAME_MODE) + "\").innerText = data." + getIdFromName(NAME_MODE) + ";";
s += " updateChannel(\"" + getIdFromName(ID_PROGRESS_CHANNEL_1) + "\"," + "\"" + getIdFromName(ID_SPAN_PROGRESS_CHANNEL_1) + "\"," + "data." + getIdFromName(NAME_CHANNEL_1) + ");";
s += " updateChannel(\"" + getIdFromName(ID_PROGRESS_CHANNEL_2) + "\"," + "\"" + getIdFromName(ID_SPAN_PROGRESS_CHANNEL_2) + "\"," + "data." + getIdFromName(NAME_CHANNEL_2) + ");";
s += " updateChannel(\"" + getIdFromName(ID_PROGRESS_CHANNEL_3) + "\"," + "\"" + getIdFromName(ID_SPAN_PROGRESS_CHANNEL_3) + "\"," + "data." + getIdFromName(NAME_CHANNEL_3) + ");";
s += " updateChannel(\"" + getIdFromName(ID_PROGRESS_CHANNEL_4) + "\"," + "\"" + getIdFromName(ID_SPAN_PROGRESS_CHANNEL_4) + "\"," + "data." + getIdFromName(NAME_CHANNEL_4) + ");";
s += " updateChannel(\"" + getIdFromName(ID_PROGRESS_CHANNEL_5) + "\"," + "\"" + getIdFromName(ID_SPAN_PROGRESS_CHANNEL_5) + "\"," + "data." + getIdFromName(NAME_CHANNEL_5) + ");";
s += " updateChannel(\"" + getIdFromName(ID_PROGRESS_CHANNEL_6) + "\"," + "\"" + getIdFromName(ID_SPAN_PROGRESS_CHANNEL_6) + "\"," + "data." + getIdFromName(NAME_CHANNEL_6) + ");";
s += " updateChannel(\"" + getIdFromName(ID_PROGRESS_CHANNEL_7) + "\"," + "\"" + getIdFromName(ID_SPAN_PROGRESS_CHANNEL_7) + "\"," + "data." + getIdFromName(NAME_CHANNEL_7) + ");";
s += " updateChannel(\"" + getIdFromName(ID_PROGRESS_CHANNEL_8) + "\"," + "\"" + getIdFromName(ID_SPAN_PROGRESS_CHANNEL_8) + "\"," + "data." + getIdFromName(NAME_CHANNEL_8) + ");";
s += " updateChannel(\"" + getIdFromName(ID_PROGRESS_CHANNEL_9) + "\"," + "\"" + getIdFromName(ID_SPAN_PROGRESS_CHANNEL_9) + "\"," + "data." + getIdFromName(NAME_CHANNEL_9) + ");";
s += " updateChannel(\"" + getIdFromName(ID_PROGRESS_CHANNEL_10) + "\"," + "\"" + getIdFromName(ID_SPAN_PROGRESS_CHANNEL_10) + "\"," + "data." + getIdFromName(NAME_CHANNEL_10) + ");";
s += " document.getElementById(\"" + getIdFromName(NAME_BATTERY) + "\").innerText = data." + getIdFromName(NAME_BATTERY) + ";";
s += " var progressElem = document.getElementById(\"" ID_PROGRESS_BATTERY "\");";
s += " var voltage = parseFloat(data." + getIdFromName(NAME_BATTERY) + ");";
s += " progressElem.setAttribute(\"class\", getBatColorMsg(voltage));";
s += " progressElem.setAttribute(\"aria-valuenow\", parseFloat(getBatPercentage(voltage)).toFixed(0));";
s += " progressElem.setAttribute(\"style\", \"width:\" + parseFloat(getBatPercentage(voltage)).toFixed(0) + \"%\");";
s += " progressElem.innerText = parseFloat(getBatPercentage(voltage)).toFixed(0) + \"%\";";
s += " document.getElementById(\"" + getIdFromName(NAME_DISTANCE_LEFT) + "\").innerText = data." + getIdFromName(NAME_DISTANCE_LEFT) + ";";
s += " document.getElementById(\"" + getIdFromName(NAME_DISTANCE_RIGHT) + "\").innerText = data." + getIdFromName(NAME_DISTANCE_RIGHT) + ";";
s += " document.getElementById(\"" + getIdFromName(NAME_USED_UP_LOOPTIME) + "\").innerText = data." + getIdFromName(NAME_USED_UP_LOOPTIME) + ";";
s += " document.getElementById(\"" + getIdFromName(NAME_TEMPERATURE) + "\").innerText = data." + getIdFromName(NAME_TEMPERATURE) + ";";
s += " }";
s += " }";
s += " };";
s += " xhr.send();";
s += "}";
s += "function getNameValue(prmName) {";
s += " var value = document.getElementById(prmName).innerHTML;";
s += " return prmName + \"=\" + value;";
s += "}";
s += "function savePropValues() {";
s += " clearInterval(timerId);";
s += " var xhr = new XMLHttpRequest();";
s += " var frontLeftLegValues = getNameValue(\"" + getIdFromName(NAME_FRONT_LEFT_LEG, 1) + "\") + \"&\" + getNameValue(\"" + getIdFromName(NAME_FRONT_LEFT_LEG, 2) + "\") + \"&\" + getNameValue(\"" + getIdFromName(NAME_FRONT_LEFT_LEG, 3) + "\");";
s += " var backLeftLegValues = getNameValue(\"" + getIdFromName(NAME_BACK_LEFT_LEG, 1) + "\") + \"&\" + getNameValue(\"" + getIdFromName(NAME_BACK_LEFT_LEG, 2) + "\") + \"&\" + getNameValue(\"" + getIdFromName(NAME_BACK_LEFT_LEG, 3) + "\");";
s += " var frontRightLegValues = getNameValue(\"" + getIdFromName(NAME_FRONT_RIGHT_LEG, 1) + "\") + \"&\" + getNameValue(\"" + getIdFromName(NAME_FRONT_RIGHT_LEG, 2) + "\") + \"&\" + getNameValue(\"" + getIdFromName(NAME_FRONT_RIGHT_LEG, 3) + "\");";
s += " var backRightLegValues = getNameValue(\"" + getIdFromName(NAME_BACK_RIGHT_LEG, 1) + "\") + \"&\" + getNameValue(\"" + getIdFromName(NAME_BACK_RIGHT_LEG, 2) + "\") + \"&\" + getNameValue(\"" + getIdFromName(NAME_BACK_RIGHT_LEG, 3) + "\");";
s += " var voltageCorrectionFactor = getNameValue(\"" + getIdFromName(NAME_VOLTAGE_CORRECTION) + "\");";
s += " xhr.open(\"GET\", \"/Save?\" + frontLeftLegValues + \"&\" + backLeftLegValues + \"&\" + frontRightLegValues + \"&\" + backRightLegValues + \"&\" + voltageCorrectionFactor, false);";
s += " xhr.send();";
s += " location.reload();";
s += "}";
s += "</script>";
return s;
}
String getDogModeSt() {
switch (dogMode) {
case dmManual:
return "Manual";
case dmSit:
return "Sit";
default:
return "Crawl";
}
}
String getWebPage() {
String s = "<!DOCTYPE html><html>";
s += getHtmlHeader();
s += "<table ALIGN=CENTER style=width:50%>";
s += addRow(NAME_MODEL, false, true, robotName);
s += addRow(NAME_VERSION, false, false, SPOTMICRO_VERSION);
s += addRow(NAME_SIGNAL_DETECTED, false, false);
s += addRow(NAME_ARMED, false, false);
s += addRow(NAME_MODE, false, false);
s += addRow(NAME_CHANNEL_1, false, false, getChannelProgressStr(ID_PROGRESS_CHANNEL_1, ID_SPAN_PROGRESS_CHANNEL_1, "progress-bar-ch1"));
s += addRow(NAME_CHANNEL_2, false, false, getChannelProgressStr(ID_PROGRESS_CHANNEL_2, ID_SPAN_PROGRESS_CHANNEL_2, "progress-bar-ch2"));
s += addRow(NAME_CHANNEL_3, false, false, getChannelProgressStr(ID_PROGRESS_CHANNEL_3, ID_SPAN_PROGRESS_CHANNEL_3, "progress-bar-ch3"));
s += addRow(NAME_CHANNEL_4, false, false, getChannelProgressStr(ID_PROGRESS_CHANNEL_4, ID_SPAN_PROGRESS_CHANNEL_4, "progress-bar-ch4"));
s += addRow(NAME_CHANNEL_5, false, false, getChannelProgressStr(ID_PROGRESS_CHANNEL_5, ID_SPAN_PROGRESS_CHANNEL_5, "progress-bar-ch5"));
s += addRow(NAME_CHANNEL_6, false, false, getChannelProgressStr(ID_PROGRESS_CHANNEL_6, ID_SPAN_PROGRESS_CHANNEL_6, "progress-bar-ch6"));
s += addRow(NAME_CHANNEL_7, false, false, getChannelProgressStr(ID_PROGRESS_CHANNEL_7, ID_SPAN_PROGRESS_CHANNEL_7, "progress-bar-ch7"));
s += addRow(NAME_CHANNEL_8, false, false, getChannelProgressStr(ID_PROGRESS_CHANNEL_8, ID_SPAN_PROGRESS_CHANNEL_8, "progress-bar-ch8"));
s += addRow(NAME_CHANNEL_9, false, false, getChannelProgressStr(ID_PROGRESS_CHANNEL_9, ID_SPAN_PROGRESS_CHANNEL_9, "progress-bar-ch9"));
s += addRow(NAME_CHANNEL_10, false, false, getChannelProgressStr(ID_PROGRESS_CHANNEL_10, ID_SPAN_PROGRESS_CHANNEL_10, "progress-bar-ch10"));
s += addRow(NAME_BATTERY, false, false);
s += addRow(NAME_BATTERY_PROGRESS, false, false, getBatteryProgressStr());
s += addRow(NAME_DISTANCE_LEFT, false, false);
s += addRow(NAME_DISTANCE_RIGHT, false, false);
s += addRow(NAME_USED_UP_LOOPTIME, false, false);
s += addRow(NAME_TEMPERATURE, false, false);
s += addRow(NAME_VOLTAGE_CORRECTION, true, false, String(voltageCorrectionFactor, 2));
s += "</table>";
s += "<br>";
s += "<br>";
s += "<table ALIGN=CENTER style=width:50%>";
s += addRow("Servo Center Offset", "Shoulder", "Upper Leg", "Knee", false, true);
s += addRow(NAME_FRONT_LEFT_LEG, toString(dog.getFrontLeftLeg()->getShoulderJoint()->getOffsetNeutralMicros()), toString(dog.getFrontLeftLeg()->getUpperLegJoint()->getOffsetNeutralMicros()), toString(dog.getFrontLeftLeg()->getKneeJoint()->getOffsetNeutralMicros()), true);
s += addRow(NAME_BACK_LEFT_LEG, toString(dog.getBackLeftLeg()->getShoulderJoint()->getOffsetNeutralMicros()), toString(dog.getBackLeftLeg()->getUpperLegJoint()->getOffsetNeutralMicros()), toString(dog.getBackLeftLeg()->getKneeJoint()->getOffsetNeutralMicros()), true);
s += addRow(NAME_FRONT_RIGHT_LEG, toString(dog.getFrontRightLeg()->getShoulderJoint()->getOffsetNeutralMicros()), toString(dog.getFrontRightLeg()->getUpperLegJoint()->getOffsetNeutralMicros()), toString(dog.getFrontRightLeg()->getKneeJoint()->getOffsetNeutralMicros()), true);
s += addRow(NAME_BACK_RIGHT_LEG, toString(dog.getBackRightLeg()->getShoulderJoint()->getOffsetNeutralMicros()), toString(dog.getBackRightLeg()->getUpperLegJoint()->getOffsetNeutralMicros()), toString(dog.getBackRightLeg()->getKneeJoint()->getOffsetNeutralMicros()), true);
s += "</table>";
s += "<br>";
s += "<div class=\"btn-group\" style=\"width:100%\">";
s += "<a><button onclick=\"savePropValues()\" type=\"button\" style=\"width:170px\" class=\"button\">Save</button></a>";
s += "<a href=\"/Cancel\"><button type=\"button\" style=\"width:170px\" class=\"button\">Cancel</button></a>";
s += "<a href=\"/WifiOff\"><button type=\"button\" style=\"width:170px;white-space:nowrap\" class=\"button\">Wifi Off</button></a>";
s += "<a href=\"/Defaults\"><button type=\"button\" style=\"width:170px\" class=\"button\">Defaults</button></a>";
s += "</div>";
s += getScript();
s += "</body></html>";
return s;
}
String getLatestData() {
String data = "{";
data += "\"" + getIdFromName(NAME_SIGNAL_DETECTED) + "\":" + addDQuotes(toString(signal_detected)) + ",";
data += "\"" + getIdFromName(NAME_ARMED) + "\":" + addDQuotes(toString(isArmed())) + ",";
data += "\"" + getIdFromName(NAME_MODE) + "\":" + addDQuotes(getDogModeSt()) + ",";
data += "\"" + getIdFromName(NAME_CHANNEL_1) + "\":" + addDQuotes(toString(channel[0])) + ",";
data += "\"" + getIdFromName(NAME_CHANNEL_2) + "\":" + addDQuotes(toString(channel[1])) + ",";
data += "\"" + getIdFromName(NAME_CHANNEL_3) + "\":" + addDQuotes(toString(channel[2])) + ",";
data += "\"" + getIdFromName(NAME_CHANNEL_4) + "\":" + addDQuotes(toString(channel[3])) + ",";
data += "\"" + getIdFromName(NAME_CHANNEL_5) + "\":" + addDQuotes(toString(channel[4])) + ",";
data += "\"" + getIdFromName(NAME_CHANNEL_6) + "\":" + addDQuotes(toString(channel[5])) + ",";
data += "\"" + getIdFromName(NAME_CHANNEL_7) + "\":" + addDQuotes(toString(channel[6])) + ",";
data += "\"" + getIdFromName(NAME_CHANNEL_8) + "\":" + addDQuotes(toString(channel[7])) + ",";
data += "\"" + getIdFromName(NAME_CHANNEL_9) + "\":" + addDQuotes(toString(channel[8])) + ",";
data += "\"" + getIdFromName(NAME_CHANNEL_10) + "\":" + addDQuotes(toString(channel[9])) + ",";
data += "\"" + getIdFromName(NAME_BATTERY) + "\":" + addDQuotes(getVoltageStr()) + ",";
data += "\"" + getIdFromName(NAME_DISTANCE_LEFT) + "\":" + addDQuotes(String(distanceLeft)) + ",";
data += "\"" + getIdFromName(NAME_DISTANCE_RIGHT) + "\":" + addDQuotes(String(distanceRight)) + ",";
data += "\"" + getIdFromName(NAME_USED_UP_LOOPTIME) + "\":" + String(usedUpLoopTime) + ",";
data += "\"" + getIdFromName(NAME_TEMPERATURE) + "\":" + addDQuotes(String(getTempCelsius(), 1));
data += "}";
//Serial.println(data);
return data;
}
void initDogNeutralMicros() {
dog.getFrontLeftLeg()->getShoulderJoint()->setOffsetNeutralMicros(-50);
dog.getFrontLeftLeg()->getUpperLegJoint()->setOffsetNeutralMicros(-150);
dog.getFrontLeftLeg()->getKneeJoint()->setOffsetNeutralMicros(-180);
dog.getBackLeftLeg()->getShoulderJoint()->setOffsetNeutralMicros(20);
dog.getBackLeftLeg()->getUpperLegJoint()->setOffsetNeutralMicros(-100);
dog.getBackLeftLeg()->getKneeJoint()->setOffsetNeutralMicros(-130);
dog.getFrontRightLeg()->getShoulderJoint()->setOffsetNeutralMicros(5);
dog.getFrontRightLeg()->getUpperLegJoint()->setOffsetNeutralMicros(-50);
dog.getFrontRightLeg()->getKneeJoint()->setOffsetNeutralMicros(10);
dog.getBackRightLeg()->getShoulderJoint()->setOffsetNeutralMicros(-50);
dog.getBackRightLeg()->getUpperLegJoint()->setOffsetNeutralMicros(-100);
dog.getBackRightLeg()->getKneeJoint()->setOffsetNeutralMicros(-30);
}
void initDogSpecs() {
Leg frontLeftLeg(12, 13, 14, LENGTH_SHOULDER, LENGTH_UPPER_ARM, LENGTH_LOWER_ARM);
frontLeftLeg.getShoulderJoint()->setReversed(true);
frontLeftLeg.getKneeJoint()->setReversed(true);
Leg backLeftLeg(8, 9, 10, LENGTH_SHOULDER, LENGTH_UPPER_ARM, LENGTH_LOWER_ARM);
backLeftLeg.getKneeJoint()->setReversed(true);
Leg frontRightLeg(0, 1, 2, LENGTH_SHOULDER, LENGTH_UPPER_ARM, LENGTH_LOWER_ARM);
frontRightLeg.getUpperLegJoint()->setReversed(true);
Leg backRightLeg(4, 5, 6, LENGTH_SHOULDER, LENGTH_UPPER_ARM, LENGTH_LOWER_ARM);
backRightLeg.getShoulderJoint()->setReversed(true);
backRightLeg.getUpperLegJoint()->setReversed(true);
dog.setBackLeftLeg(backLeftLeg);
dog.setFrontLeftLeg(frontLeftLeg);
dog.setFrontRightLeg(frontRightLeg);
dog.setBackRightLeg(backRightLeg);
initDogNeutralMicros();
//dog.printInfo();
}
void doWalkMethod1(int prmWalkAngleUpperLeg, int prmWalkAngleKnee, LegAngles *prmLegAngles) {
prmLegAngles->frontLeftShoulderAngle = 0;
prmLegAngles->frontRightShoulderAngle = 0;
prmLegAngles->backLeftShoulderAngle = 0;
prmLegAngles->backRightShoulderAngle = 0;
prmLegAngles->frontLeftUpperLegAngle = NEUTRAL_WALK_ANGLE_UPPERLEG + prmWalkAngleUpperLeg;
prmLegAngles->frontRightUpperLegAngle = NEUTRAL_WALK_ANGLE_UPPERLEG - prmWalkAngleUpperLeg;
prmLegAngles->backLeftUpperLegAngle = NEUTRAL_WALK_ANGLE_UPPERLEG - prmWalkAngleUpperLeg;
prmLegAngles->backRightUpperLegAngle = NEUTRAL_WALK_ANGLE_UPPERLEG + prmWalkAngleUpperLeg;
prmLegAngles->frontLeftKneeAngle = NEUTRAL_WALK_ANGLE_KNEE + prmWalkAngleKnee;
prmLegAngles->frontRightKneeAngle = NEUTRAL_WALK_ANGLE_KNEE - prmWalkAngleKnee;
prmLegAngles->backLeftKneeAngle = NEUTRAL_WALK_ANGLE_KNEE - prmWalkAngleKnee;
prmLegAngles->backRightKneeAngle = NEUTRAL_WALK_ANGLE_KNEE + prmWalkAngleKnee;
}
| [
"noreply@github.com"
] | projunk.noreply@github.com |
1625825c3f98b367d39df881cd9b1b28758f57a6 | f74256b079b12a02406b0eda5321f2dc22b3226c | /lizhiqiang/Integer Break.cpp | 4bec1e68f9fa0c276c615ad8636b626220965d61 | [
"Apache-2.0"
] | permissive | ylovesy/CodeFun | e716c840c0c08227c4cae0120161e99e15d3c1e2 | 4469a88b5fe8796054d4d60025c857c18eb374db | refs/heads/master | 2021-07-17T19:45:11.099724 | 2017-12-14T12:34:29 | 2017-12-14T12:34:29 | 96,773,933 | 0 | 3 | null | 2017-07-15T06:55:14 | 2017-07-10T12:16:28 | C++ | UTF-8 | C++ | false | false | 579 | cpp | class Solution {
public:
int integerBreak(int n) {
int product = 1;
int count = 1;
while (n > 4) {
if (n > 3) {
n -= 3;
product *= 3;
count++;
}
}
if (count == 1 && n != 4) {
n = n - 1;
product *= n;
}
if (n == 4) {
product *= 4;
} else if (n == 2 && count >= 2) {
product *= 2;
} else if (n == 3 && count >= 2) {
product *= 3;
}
return product;
}
};
| [
"noreply@github.com"
] | ylovesy.noreply@github.com |
70a2326cfe61e8079156aa8282c1cbe2b6350dbf | 0b287a97e0919c5323919bcb57efae923a029899 | /src/qt/optionsdialog.cpp | 71791ff34787ac8d7a0d4714c78be016bf1da89a | [
"MIT"
] | permissive | lmcchain/wallet | 490dd95b4d82c91b06ebd9e63bbcbaeb0d791da8 | 354fb335df518174ad2a3c9e5b919da7e9052c7e | refs/heads/master | 2020-03-11T14:07:52.102368 | 2018-04-19T05:01:55 | 2018-04-19T05:01:55 | 130,044,899 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,886 | cpp | #include "optionsdialog.h"
#include "ui_optionsdialog.h"
#include "bitcoinunits.h"
#include "monitoreddatamapper.h"
#include "netbase.h"
#include "optionsmodel.h"
#include <QDir>
#include <QIntValidator>
#include <QLocale>
#include <QMessageBox>
OptionsDialog::OptionsDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::OptionsDialog),
model(0),
mapper(0),
fRestartWarningDisplayed_Proxy(false),
fRestartWarningDisplayed_Lang(false),
fProxyIpValid(true)
{
ui->setupUi(this);
/* Network elements init */
#ifndef USE_UPNP
ui->mapPortUpnp->setEnabled(false);
#endif
ui->proxyIp->setEnabled(false);
ui->proxyPort->setEnabled(false);
ui->proxyPort->setValidator(new QIntValidator(1, 65535, this));
ui->socksVersion->setEnabled(false);
ui->socksVersion->addItem("5", 5);
ui->socksVersion->addItem("4", 4);
ui->socksVersion->setCurrentIndex(0);
connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyIp, SLOT(setEnabled(bool)));
connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyPort, SLOT(setEnabled(bool)));
connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->socksVersion, SLOT(setEnabled(bool)));
connect(ui->connectSocks, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning_Proxy()));
ui->proxyIp->installEventFilter(this);
/* Window elements init */
#ifdef Q_OS_MAC
ui->tabWindow->setVisible(false);
#endif
/* Display elements init */
QDir translations(":translations");
ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant(""));
foreach(const QString &langStr, translations.entryList())
{
QLocale locale(langStr);
/** check if the locale name consists of 2 parts (language_country) */
if(langStr.contains("_"))
{
#if QT_VERSION >= 0x040800
/** display language strings as "native language - native country (locale name)", e.g. "Deutsch - Deutschland (de)" */
ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeCountryName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
#else
/** display language strings as "language - country (locale name)", e.g. "German - Germany (de)" */
ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(" - ") + QLocale::countryToString(locale.country()) + QString(" (") + langStr + QString(")"), QVariant(langStr));
#endif
}
else
{
#if QT_VERSION >= 0x040800
/** display language strings as "native language (locale name)", e.g. "Deutsch (de)" */
ui->lang->addItem(locale.nativeLanguageName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
#else
/** display language strings as "language (locale name)", e.g. "German (de)" */
ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(" (") + langStr + QString(")"), QVariant(langStr));
#endif
}
}
ui->unit->setModel(new BitcoinUnits(this));
/* Widget-to-option mapper */
mapper = new MonitoredDataMapper(this);
mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
mapper->setOrientation(Qt::Vertical);
/* enable apply button when data modified */
connect(mapper, SIGNAL(viewModified()), this, SLOT(enableApplyButton()));
/* disable apply button when new data loaded */
connect(mapper, SIGNAL(currentIndexChanged(int)), this, SLOT(disableApplyButton()));
/* setup/change UI elements when proxy IP is invalid/valid */
connect(this, SIGNAL(proxyIpValid(QValidatedLineEdit *, bool)), this, SLOT(handleProxyIpValid(QValidatedLineEdit *, bool)));
}
OptionsDialog::~OptionsDialog()
{
delete ui;
}
void OptionsDialog::setModel(OptionsModel *model)
{
this->model = model;
if(model)
{
connect(model, SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
mapper->setModel(model);
setMapper();
mapper->toFirst();
}
/* update the display unit, to not use the default ("BTC") */
updateDisplayUnit();
/* warn only when language selection changes by user action (placed here so init via mapper doesn't trigger this) */
connect(ui->lang, SIGNAL(valueChanged()), this, SLOT(showRestartWarning_Lang()));
/* disable apply button after settings are loaded as there is nothing to save */
disableApplyButton();
}
void OptionsDialog::setMapper()
{
/* Main */
mapper->addMapping(ui->transactionFee, OptionsModel::Fee);
mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup);
/* Network */
mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);
mapper->addMapping(ui->connectSocks, OptionsModel::ProxyUse);
mapper->addMapping(ui->proxyIp, OptionsModel::ProxyIP);
mapper->addMapping(ui->proxyPort, OptionsModel::ProxyPort);
mapper->addMapping(ui->socksVersion, OptionsModel::ProxySocksVersion);
/* Window */
#ifndef Q_OS_MAC
mapper->addMapping(ui->minimizeToTray, OptionsModel::MinimizeToTray);
mapper->addMapping(ui->minimizeOnClose, OptionsModel::MinimizeOnClose);
#endif
/* Display */
mapper->addMapping(ui->lang, OptionsModel::Language);
mapper->addMapping(ui->unit, OptionsModel::DisplayUnit);
mapper->addMapping(ui->displayAddresses, OptionsModel::DisplayAddresses);
}
void OptionsDialog::enableApplyButton()
{
ui->applyButton->setEnabled(true);
}
void OptionsDialog::disableApplyButton()
{
ui->applyButton->setEnabled(false);
}
void OptionsDialog::enableSaveButtons()
{
/* prevent enabling of the save buttons when data modified, if there is an invalid proxy address present */
if(fProxyIpValid)
setSaveButtonState(true);
}
void OptionsDialog::disableSaveButtons()
{
setSaveButtonState(false);
}
void OptionsDialog::setSaveButtonState(bool fState)
{
ui->applyButton->setEnabled(fState);
ui->okButton->setEnabled(fState);
}
void OptionsDialog::on_resetButton_clicked()
{
if(model)
{
// confirmation dialog
QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr("Confirm options reset"),
tr("Some settings may require a client restart to take effect.") + "<br><br>" + tr("Do you want to proceed?"),
QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
if(btnRetVal == QMessageBox::Cancel)
return;
disableApplyButton();
/* disable restart warning messages display */
fRestartWarningDisplayed_Lang = fRestartWarningDisplayed_Proxy = true;
/* reset all options and save the default values (QSettings) */
model->Reset();
mapper->toFirst();
mapper->submit();
/* re-enable restart warning messages display */
fRestartWarningDisplayed_Lang = fRestartWarningDisplayed_Proxy = false;
}
}
void OptionsDialog::on_okButton_clicked()
{
mapper->submit();
accept();
}
void OptionsDialog::on_cancelButton_clicked()
{
reject();
}
void OptionsDialog::on_applyButton_clicked()
{
mapper->submit();
disableApplyButton();
}
void OptionsDialog::showRestartWarning_Proxy()
{
if(!fRestartWarningDisplayed_Proxy)
{
QMessageBox::warning(this, tr("Warning"), tr("This setting will take effect after restarting lmccoin."), QMessageBox::Ok);
fRestartWarningDisplayed_Proxy = true;
}
}
void OptionsDialog::showRestartWarning_Lang()
{
if(!fRestartWarningDisplayed_Lang)
{
QMessageBox::warning(this, tr("Warning"), tr("This setting will take effect after restarting lmccoin."), QMessageBox::Ok);
fRestartWarningDisplayed_Lang = true;
}
}
void OptionsDialog::updateDisplayUnit()
{
if(model)
{
/* Update transactionFee with the current unit */
ui->transactionFee->setDisplayUnit(model->getDisplayUnit());
}
}
void OptionsDialog::handleProxyIpValid(QValidatedLineEdit *object, bool fState)
{
// this is used in a check before re-enabling the save buttons
fProxyIpValid = fState;
if(fProxyIpValid)
{
enableSaveButtons();
ui->statusLabel->clear();
}
else
{
disableSaveButtons();
object->setValid(fProxyIpValid);
ui->statusLabel->setStyleSheet("QLabel { color: red; }");
ui->statusLabel->setText(tr("The supplied proxy address is invalid."));
}
}
bool OptionsDialog::eventFilter(QObject *object, QEvent *event)
{
if(event->type() == QEvent::FocusOut)
{
if(object == ui->proxyIp)
{
CService addr;
/* Check proxyIp for a valid IPv4/IPv6 address and emit the proxyIpValid signal */
emit proxyIpValid(ui->proxyIp, LookupNumeric(ui->proxyIp->text().toStdString().c_str(), addr));
}
}
return QDialog::eventFilter(object, event);
}
| [
"root@DESKTOP-3AA8BQ8.localdomain"
] | root@DESKTOP-3AA8BQ8.localdomain |
04fd05384ad2bd04443dbfbfef86474c5aa10c2f | 94c221fca52cc85b4f7813415a7cb4c79ad3583b | /mod05/ex01/main.cpp | a191eb062d417c1ad282746ce20a8ea3b4ebf572 | [] | no_license | chudopak/CPP_start | aa3814e3658456317399411722cdaddbef9518e6 | 85a873f6f2f68f44b0abc397fd58e48d625ef991 | refs/heads/main | 2023-07-31T11:19:30.643969 | 2021-09-12T12:55:28 | 2021-09-12T12:55:28 | 394,989,515 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,613 | cpp | #include "Bureaucrat.hpp"
#include "Form.hpp"
int main(void)
{
std::cout << "TRYING GOOD VALUES in Form constructor" << std::endl;
std::cout << std::endl;
try {
Form test("Form1", 1, 1);
std::cout << "TEST (1): OK" << std::endl << test << std::endl;
} catch (std::exception & e) {
std::cout << "TEST (1): " << e.what() << std::endl;
}
std::cout << std::endl;
try {
Form test("Form2", 150, 150);
std::cout << "TEST (2): OK: " << std::endl << test << std::endl;
} catch (std::exception & e) {
std::cout << "TEST (2): " << e.what() << std::endl;
}
std::cout << std::endl;
std::cout << "TRYING BAD VALUES in Form constructor" << std::endl;
std::cout << std::endl;
try {
Form test("Form3", 151, 150);
std::cout << "TEST (3): OK: " << std::endl << test << std::endl;
} catch (std::exception & e) {
std::cout << "TEST (3): " << e.what() << ": sign Grade - 151" << std::endl;
}
std::cout << std::endl;
try {
Form test("Form4", 1, 0);
std::cout << "TEST (4): OK" << std::endl << test << std::endl;
} catch (std::exception & e) {
std::cout << "TEST (4): " << e.what() << ": execute Grade - 0" << std::endl;
}
std::cout << std::endl;
std::cout << "TRYING SIGN Forms" << std::endl;
std::cout << std::endl;
try {
Form testF("Form5", 1, 1);
std::cout << testF << std::endl;
Bureaucrat testB("bureaucrat", 150);
std::cout << testB << std::endl;
std::cout << "trying to sign" << std::endl;
testB.signForm(testF);
std::cout << "TEST (5): OK" << ": form signed" << testF.getName() << std::endl;
} catch (std::exception & e) {
std::cout << "TEST (5): " << e.what() << ": form can't be signed" << std::endl;
}
std::cout << std::endl;
try {
Form testF("Form6", 1, 1);
std::cout << testF << std::endl;
Bureaucrat testB("bureaucratBIGBOSS", 1);
std::cout << testB << std::endl;
//testB.incrementGrade();
std::cout << "trying to sign" << std::endl;
testB.signForm(testF);
std::cout << "TEST (6): OK" << ": form signed " << testF.getName() << std::endl;
} catch (std::exception & e) {
std::cout << "TEST (6): " << e.what() << ": form can't be signed" << std::endl;
}
std::cout << std::endl;
try {
Form testF("Form7", 100, 1);
std::cout << testF << std::endl;
Bureaucrat testB("bureaucratSmallShrimp", 99);
std::cout << testB << std::endl;
std::cout << "trying to sign" << std::endl;
testB.signForm(testF);
std::cout << "TEST (7): OK" << ": form signed " << testF.getName() << std::endl;
} catch (std::exception & e) {
std::cout << "TEST (7): " << e.what() << ": form can't be signed" << std::endl;
}
return (0);
} | [
"stepakirillov59@gmail.com"
] | stepakirillov59@gmail.com |
04fd937687c557810dcab70ec14d0a4f1c096acd | cecb4e2d362f2b8d30602dec42946f2b74aaf4cf | /policies/DIF/RA/PDUFG/GRE/ClosRouting/GRE_Clos1R.cc | 43529458bfd46521d13ada9d6db77b56d8e86dae | [
"MIT"
] | permissive | kaleal/RINA | f4819dac38d51f525ba98ff11190549da27d90c7 | b1cec2a1f6dff4bbf95a967350cd4d533833a1d0 | refs/heads/master | 2021-06-24T16:48:24.875361 | 2017-08-13T20:54:19 | 2017-08-13T20:54:19 | 78,782,267 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,906 | cc | //
// 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 3 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, see http://www.gnu.org/licenses/.
//
#include "GRE_Clos1R.h"
namespace GRE_Clos {
Register_Class(GRE_ClosR1);
// Called after initialize
void GRE_ClosR1::postPolicyInit() {
//Set Forwarding policy
fwd_ = dynamic_cast<Clos1 *>(fwd);
fwd_->setZone(zone);
fwd_->setIdentifier(ident);
fwd_->setNumSpines(f);
fwd->addPort(f + t - 1, nullptr);
fwd->setGroup(1, vPortsIndex());
fwd->setGroup(2, vPortsIndex());
for (addr_t d = 0; d < t; d++) {
aliveNeis.push_back(false);
addr_t dst_addr = getAddr(zone, d + f);
fwd->setNeighbour(dst_addr, d);
elink_t dst_link = getELink(myaddr, dst_addr);
neiLinks[dst_addr] = dst_link;
linkNei[dst_link] = dst_addr;
string dst_raw = getRaw(dst_addr);
rt->registerLink(dst_link, Address(dst_raw.c_str(), dif.c_str()));
if (FailureSimulation::instance) {
FailureSimulation::instance->registerLink(to_string(dst_link), this);
}
}
for (addr_t d = 0; d < s; d++) {
aliveNeis.push_back(false);
addr_t dst_addr = getAddr(ident, d);
fwd->setNeighbour(dst_addr, d + t);
elink_t dst_link = getELink(myaddr, dst_addr);
neiLinks[dst_addr] = dst_link;
linkNei[dst_link] = dst_addr;
string dst_raw = getRaw(dst_addr);
rt->registerLink(dst_link, Address(dst_raw.c_str(), dif.c_str()));
if (FailureSimulation::instance) {
FailureSimulation::instance->registerLink(to_string(dst_link), this);
}
}
}
index_t GRE_ClosR1::getNeiId(const addr_t & d) {
index_t id = getIdentifier(d);
addr_t z = getZone(d);
if (z == zone) {
return id - f;
} else {
return id + t;
}
}
void GRE_ClosR1::resetNeiGroups() {
vPortsIndex neis;
for (addr_t d = 0; d < t; d++) {
if (aliveNeis[d]) {
neis.push_back(d);
}
}
fwd->setGroup(1, neis);
neis.clear();
for (addr_t d = 0; d < s; d++) {
if (aliveNeis[d + t]) {
neis.push_back(d + t);
}
}
fwd->setGroup(2, neis);
}
//Routing has processes a routing update
void GRE_ClosR1::routingUpdated() {
nodesStatus st = rt->getProblems();
Errors e;
map<mask_t, exception_t> exceptions;
vPortsIndex list;
for (elink_t & l : st.othersFailures) {
addr_s src = addr_s(getESrc(l));
addr_s dst = addr_s(getEDst(l));
if (src.Z < f) {
// To Pod Error // Only same Spine set if spine alive
if (src.Z != ident || !aliveNeis[src.Id + t]) {
continue;
}
e.PF2S[dst.Z][dst.Id].insert(src.Id);
e.FP2S[dst.Id][dst.Z].insert(src.Id);
e.FS2P[src.Z][src.Id].insert(dst.Z);
} else {
// To Pod Error // Only same Spine set if spine alive
if (dst.addr == myaddr) { // Don't record my own
continue;
}
// In Pod Error
e.PT2F[dst.Z][dst.Id].insert(src.Id);
e.PF2T[src.Z][src.Id].insert(dst.Id);
e.FP2T[src.Id][src.Z].insert(dst.Id);
}
//Spine to Pod errors in other spine-sets not considered
}
vector<bool> group1(aliveNeis.begin(), aliveNeis.begin() + t); // towards any ToR down
vector<bool> group2(aliveNeis.begin() + t, aliveNeis.end()); // towards any Pod up
// Check for unreachable ToRs in same Pod or distinct from group1
auto & m2T = e.PF2T[zone][ident];
if (!m2T.empty()) {
int ok = t - m2T.size();
if (ok > 0) {
// Check if some ToR is connected only to me (err = f-1)
for(auto t2F : e.PT2F[zone]) {
if(t2F.second.size()+1 >= f) { // Not connected to others
group1[t2F.first - f] = false;
}
}
bool superF = false;
vector< vector<bool> > N(f, vector<bool>(t, true) ); // Reachable ToRs from neighbour fabrics
for(addr_t i = 0; i < f; i++) {
if(f == ident) { continue; }
auto & f2T = e.PF2T[zone][i];
if(f2T.empty()) {
superF = true; // Theres is at least one fabric neighbour connected to all ToRs
break;
} else {
// Set all unreachable ToRs from neighbour
for(auto _t : f2T) {
N[i][_t-f] = false;
}
}
}
if(!superF) {
//Check if reachable from problematic ToR neis == groups1
for(auto _t : m2T) {
auto & F = e.PT2F[zone][_t];
if(F.size() +1 >= f) {
//Disconnected ToR
/// Unreachable ToR
exceptions[mask_t(getAddr(zone, _t), 0)] =
exception_t();
} else {
//Check fabrics reachable through ToR
vector<bool>reachT(f, true);
reachT[ident] = false;
for(auto _f : F) {
reachT[_f] = false;
}
//Check ToRs reachables through some fabrics
vector<bool>reachF(t, false);
int k = 0;
for(addr_t i = 0; i < f; i++) {
if(reachT[i]) {
k = intersectBv(reachF, N[i], reachF);
}
}
if(k <= 0) {
//ToR unreachable (3 hops)
/// Unreachable ToR
exceptions[mask_t(getAddr(zone, _t), 0)] =
exception_t();
} else if(! includedBv(group1, reachF)) {
// Tor reachable by some nodes of group 1 (reachF), not all
list.clear();
for (addr_t i = 0; i < t; i++) {
if (reachF[i]) {
list.push_back(i);
}
}
exceptions[mask_t(getAddr(zone, _t), 0)] =
exception_t(COMMON, 0, list);
} //Default group 1 rule works
}
}
} // Else, there is always a way to go to the "Super Fabric"
} // Else disconnected down, nothing to do
}
//Check problems reaching other Pods
//Remove spines disconnected to all other nodes from group 2
for(auto s2F : e.FS2P[ident]) {
if(s2F.second.size() + 1 >= p) {
group2[s2F.first] = false;
}
}
auto & m2S = e.FP2S[ident][zone];
int m2Sc = m2S.size();
set<addr_t> disP;
//Search disconnected Fabrics
for(auto p2T : e.FP2T[ident]) {
if(p2T.first == zone) { continue; } // skip own pod
if(p2T.second.size() >= t) {
disP.insert(p2T.first);
}
}
for(auto p2S : e.FP2S[ident]) {
if(p2S.first == zone) { continue; } // skip own pod
if(p2S.second.size() + m2Sc >= p) {
disP.insert(p2S.first);
}
if(disP.find(p2S.first) == disP.end() ) {
//Pod is not disconnected up nor down
//Check good paths
vector<bool> valids = group2;
for(auto _s : p2S.second) {
valids[_s] = false;
}
list.clear();
for (addr_t i = 0; i < s; i++) {
if (valids[i]) {
list.push_back(i+t);
}
}
if(list.empty()) {
///Unreachable Pod p
exceptions[mask_t(getAddr(p2S.first, 0), 8)] =
exception_t();
} else {
exceptions[mask_t(getAddr(p2S.first, 0), 8)] =
exception_t(COMMON, 0, list);
}
}
}
//Exceptions to disconnected Pods
for(auto p : disP) {
///Unreachable Pod p
exceptions[mask_t(getAddr(p, 0), 8)] =
exception_t();
}
//Check problems reaching ToRs at other Pods
// unreachable if Pod 2 hops reachable but fabric disconnected from ToR
for(auto p2T : e.FP2T[ident]) {
if(disP.find(p2T.first) == disP.end() ) {
for(auto _t : p2T.second) {
///Unreachable ToR _t
exceptions[mask_t(getAddr(p2T.first, _t), 0)] =
exception_t();
}
}
}
/// Replace group1
list.clear();
for (addr_t i = 0; i < t; i++) {
if (group1[i]) {
list.push_back(i);
}
}
fwd->setGroup(1, list);
/// Replace group2
list.clear();
for (addr_t i = 0; i < f; i++) {
if (group2[i]) {
list.push_back(i+t);
}
}
fwd->setGroup(2, list);
//Save Exceptions
fwd->setExceptions(exceptions);
}
}
| [
"gaixas1@gmail.com"
] | gaixas1@gmail.com |
018aa6c3b4db336bc878ec66fc81f5ad8f159334 | f468741573d6dfc931cf13d5ef75017086ddf9e4 | /MathLibraryTest/Tests/KazmathTests.cpp | 0772fc73e965186924a1730e19edad5310106ec6 | [] | no_license | chunkyguy/Math-Library-Test | 8f806dd41eaa0cf237a4062d1b505244f71b6fcc | ad13c4001625a3b5532160adf36d64c79050659f | refs/heads/master | 2021-12-01T15:50:20.559528 | 2021-11-12T13:24:24 | 2021-11-12T13:24:24 | 8,921,811 | 6 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,930 | cpp | //
// Created by Sidharth Juyal on 18/11/2020.
// Copyright © 2020 Noise & Heat. All rights reserved.
//
#include "KazmathTests.hpp"
#include "kazmath/kazmath.h"
namespace {
// since Kazmath does not provide any add function writing this in the style of kmMat4Multiply
kmMat4* kmMat4Add(kmMat4* pOut, const kmMat4* pM1, const kmMat4* pM2)
{
kmScalar mat[16];
const kmScalar *m1 = pM1->mat, *m2 = pM2->mat;
for (int i = 0; i < 16; ++i) {
mat[i] = m1[i] + m2[i];
}
memcpy(pOut->mat, mat, sizeof(kmScalar)*16);
return pOut;
}
}
namespace {
typedef kmMat4 Matrix;
Matrix* generate(int count){
float* randomNumbers = generateRandomNumbers(count);
Matrix* mats = new Matrix[count];
for(int i = 0; i < count; i++) {
mats[i].mat[0] = randomNumbers[i];
mats[i].mat[5] = randomNumbers[i];
mats[i].mat[10] = randomNumbers[i];
mats[i].mat[15] = 1.0f;
}
delete[] randomNumbers;
return mats;
}
void test_addition(Matrix* inputA, Matrix* inputB,
Matrix* output, int count){
for(int i = 0; i < count; i++) {
kmMat4Add(&output[i], &inputA[i], &inputB[i]);
}
}
void test_multiplication(Matrix* inputA, Matrix* inputB,
Matrix* output, int count){
for(int i = 0; i < count; i++) {
kmMat4Multiply(&output[i], &inputA[i], &inputB[i]);
}
}
}
TestResult test_kazmath(int count, int num_tests)
{
TestResult tr;
tr.name = "Kazmath";
Matrix* inputA = generate(count);
Matrix* inputB = generate(count);
Matrix* output = generate(count);
{
kClockBegin
for(int i = 0; i < num_tests; i++) {
test_addition(inputA, inputB, output, count);
}
kClockEnd(tr.additions);
}
{
kClockBegin
for(int i = 0; i < num_tests; i++) {
test_multiplication(inputA, inputB, output, count);
}
kClockEnd(tr.multiplications);
}
delete[] inputA;
delete[] inputB;
delete[] output;
return tr;
}
| [
"juyal.sidharth@gmail.com"
] | juyal.sidharth@gmail.com |
0d1d258baa8fdce1e111e8ce240571acaef9ef6e | 21553f6afd6b81ae8403549467230cdc378f32c9 | /arm/cortex/Freescale/MK80F25615/include/arch/reg/rcm.hpp | d9d5c5a13630a19d9390f7cce75d65711e7962d6 | [] | no_license | digint/openmptl-reg-arm-cortex | 3246b68dcb60d4f7c95a46423563cab68cb02b5e | 88e105766edc9299348ccc8d2ff7a9c34cddacd3 | refs/heads/master | 2021-07-18T19:56:42.569685 | 2017-10-26T11:11:35 | 2017-10-26T11:11:35 | 108,407,162 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 5,423 | hpp | /*
* OpenMPTL - C++ Microprocessor Template Library
*
* This program is a derivative representation of a CMSIS System View
* Description (SVD) file, and is subject to the corresponding license
* (see "Freescale CMSIS-SVD License Agreement.pdf" in the parent directory).
*
* 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.
*/
////////////////////////////////////////////////////////////////////////
//
// Import from CMSIS-SVD: "Freescale/MK80F25615.svd"
//
// vendor: Freescale Semiconductor, Inc.
// vendorID: Freescale
// name: MK80F25615
// series: Kinetis_K
// version: 1.6
// description: MK80F25615 Freescale Microcontroller
// --------------------------------------------------------------------
//
// C++ Header file, containing architecture specific register
// declarations for use in OpenMPTL. It has been converted directly
// from a CMSIS-SVD file.
//
// https://digint.ch/openmptl
// https://github.com/posborne/cmsis-svd
//
#ifndef ARCH_REG_RCM_HPP_INCLUDED
#define ARCH_REG_RCM_HPP_INCLUDED
#warning "using untested register declarations"
#include <register.hpp>
namespace mptl {
/**
* Reset Control Module
*/
struct RCM
{
static constexpr reg_addr_t base_addr = 0x4007f000;
/**
* System Reset Status Register 0
*/
struct SRS0
: public reg< uint8_t, base_addr + 0, ro, 0x82 >
{
using type = reg< uint8_t, base_addr + 0, ro, 0x82 >;
using WAKEUP = regbits< type, 0, 1 >; /**< Low Leakage Wakeup Reset */
using LVD = regbits< type, 1, 1 >; /**< Low-Voltage Detect Reset */
using LOC = regbits< type, 2, 1 >; /**< Loss-of-Clock Reset */
using LOL = regbits< type, 3, 1 >; /**< Loss-of-Lock Reset */
using WDOG = regbits< type, 5, 1 >; /**< Watchdog */
using PIN = regbits< type, 6, 1 >; /**< External Reset Pin */
using POR = regbits< type, 7, 1 >; /**< Power-On Reset */
};
/**
* System Reset Status Register 1
*/
struct SRS1
: public reg< uint8_t, base_addr + 0x1, ro, 0 >
{
using type = reg< uint8_t, base_addr + 0x1, ro, 0 >;
using JTAG = regbits< type, 0, 1 >; /**< JTAG Generated Reset */
using LOCKUP = regbits< type, 1, 1 >; /**< Core Lockup */
using SW = regbits< type, 2, 1 >; /**< Software */
using MDM_AP = regbits< type, 3, 1 >; /**< MDM-AP System Reset Request */
using SACKERR = regbits< type, 5, 1 >; /**< Stop Mode Acknowledge Error Reset */
};
/**
* Reset Pin Filter Control register
*/
struct RPFC
: public reg< uint8_t, base_addr + 0x4, rw, 0 >
{
using type = reg< uint8_t, base_addr + 0x4, rw, 0 >;
using RSTFLTSRW = regbits< type, 0, 2 >; /**< Reset Pin Filter Select in Run and Wait Modes */
using RSTFLTSS = regbits< type, 2, 1 >; /**< Reset Pin Filter Select in Stop Mode */
};
/**
* Reset Pin Filter Width register
*/
struct RPFW
: public reg< uint8_t, base_addr + 0x5, rw, 0 >
{
using type = reg< uint8_t, base_addr + 0x5, rw, 0 >;
using RSTFLTSEL = regbits< type, 0, 5 >; /**< Reset Pin Filter Bus Clock Select */
};
/**
* Force Mode Register
*/
struct FM
: public reg< uint8_t, base_addr + 0x6, rw, 0 >
{
using type = reg< uint8_t, base_addr + 0x6, rw, 0 >;
using FORCEROM = regbits< type, 1, 2 >; /**< Force ROM Boot */
};
/**
* Mode Register
*/
struct MR
: public reg< uint8_t, base_addr + 0x7, rw, 0 >
{
using type = reg< uint8_t, base_addr + 0x7, rw, 0 >;
using BOOTROM = regbits< type, 1, 2 >; /**< Boot ROM Configuration */
};
/**
* Sticky System Reset Status Register 0
*/
struct SSRS0
: public reg< uint8_t, base_addr + 0x8, rw, 0x82 >
{
using type = reg< uint8_t, base_addr + 0x8, rw, 0x82 >;
using SWAKEUP = regbits< type, 0, 1 >; /**< Sticky Low Leakage Wakeup Reset */
using SLVD = regbits< type, 1, 1 >; /**< Sticky Low-Voltage Detect Reset */
using SLOC = regbits< type, 2, 1 >; /**< Sticky Loss-of-Clock Reset */
using SLOL = regbits< type, 3, 1 >; /**< Sticky Loss-of-Lock Reset */
using SWDOG = regbits< type, 5, 1 >; /**< Sticky Watchdog */
using SPIN = regbits< type, 6, 1 >; /**< Sticky External Reset Pin */
using SPOR = regbits< type, 7, 1 >; /**< Sticky Power-On Reset */
};
/**
* Sticky System Reset Status Register 1
*/
struct SSRS1
: public reg< uint8_t, base_addr + 0x9, rw, 0 >
{
using type = reg< uint8_t, base_addr + 0x9, rw, 0 >;
using SJTAG = regbits< type, 0, 1 >; /**< Sticky JTAG Generated Reset */
using SLOCKUP = regbits< type, 1, 1 >; /**< Sticky Core Lockup */
using SSW = regbits< type, 2, 1 >; /**< Sticky Software */
using SMDM_AP = regbits< type, 3, 1 >; /**< Sticky MDM-AP System Reset Request */
using SSACKERR = regbits< type, 5, 1 >; /**< Sticky Stop Mode Acknowledge Error Reset */
};
};
} // namespace mptl
#endif // ARCH_REG_RCM_HPP_INCLUDED
| [
"axel@tty0.ch"
] | axel@tty0.ch |
da943ac4006889a4db557313d31aba0a7d018dfb | 8209f893a1e7effbf56d8114206e952eaf577b1d | /test/example/entity_copy.cpp | 2c678aaf32e5d540647e71f9dc51ed81fd201d76 | [
"CC-BY-SA-4.0",
"CC-BY-4.0",
"MIT"
] | permissive | aimoonchen/entt | 78d5e05c38e57c68926bd1b1418efcc39d67991f | cb974bf5671c757cbce2e0248787bad616b06bf9 | refs/heads/master | 2023-08-18T20:14:45.347641 | 2023-06-13T09:54:29 | 2023-06-13T09:56:56 | 159,793,898 | 0 | 0 | MIT | 2018-11-30T08:41:24 | 2018-11-30T08:41:24 | null | UTF-8 | C++ | false | false | 3,912 | cpp | #include <gtest/gtest.h>
#include <entt/core/hashed_string.hpp>
#include <entt/core/utility.hpp>
#include <entt/entity/registry.hpp>
#include <entt/entity/storage.hpp>
#include <entt/meta/factory.hpp>
#include <entt/meta/resolve.hpp>
enum class my_entity : entt::id_type {};
template<typename Type>
struct meta_mixin: Type {
using allocator_type = typename Type::allocator_type;
using value_type = typename Type::value_type;
explicit meta_mixin(const allocator_type &allocator);
};
template<typename Type, typename Entity>
struct entt::storage_type<Type, Entity> {
using type = meta_mixin<basic_storage<Type, Entity>>;
};
template<typename Type>
meta_mixin<Type>::meta_mixin(const allocator_type &allocator)
: Type{allocator} {
using namespace entt::literals;
entt::meta<value_type>()
// cross registry, same type
.template func<entt::overload<entt::storage_for_t<value_type, entt::entity> &(const entt::id_type)>(&entt::basic_registry<entt::entity>::storage<value_type>), entt::as_ref_t>("storage"_hs)
// cross registry, different types
.template func<entt::overload<entt::storage_for_t<value_type, my_entity> &(const entt::id_type)>(&entt::basic_registry<my_entity>::storage<value_type>), entt::as_ref_t>("storage"_hs);
}
template<typename Type>
struct EntityCopy: testing::Test {
using type = Type;
};
using EntityCopyTypes = ::testing::Types<entt::basic_registry<entt::entity>, entt::basic_registry<my_entity>>;
TYPED_TEST_SUITE(EntityCopy, EntityCopyTypes, );
TEST(EntityCopy, SameRegistry) {
using namespace entt::literals;
entt::registry registry{};
auto &&custom = registry.storage<double>("custom"_hs);
const auto src = registry.create();
const auto dst = registry.create();
custom.emplace(src, 1.);
registry.emplace<int>(src, 42);
registry.emplace<char>(src, 'c');
ASSERT_EQ(registry.size(), 2u);
ASSERT_TRUE(custom.contains(src));
ASSERT_FALSE(custom.contains(dst));
ASSERT_TRUE((registry.all_of<int, char>(src)));
ASSERT_FALSE((registry.any_of<int, char>(dst)));
for(auto [id, storage]: registry.storage()) {
// discard the custom storage because why not, this is just an example after all
if(id != "custom"_hs && storage.contains(src)) {
storage.push(dst, storage.value(src));
}
}
ASSERT_EQ(registry.size(), 2u);
ASSERT_TRUE(custom.contains(src));
ASSERT_FALSE(custom.contains(dst));
ASSERT_TRUE((registry.all_of<int, char>(src)));
ASSERT_TRUE((registry.all_of<int, char>(dst)));
ASSERT_EQ(registry.get<int>(dst), 42);
ASSERT_EQ(registry.get<char>(dst), 'c');
}
TYPED_TEST(EntityCopy, CrossRegistry) {
using namespace entt::literals;
entt::basic_registry<entt::entity> src{};
// other registry type, see typed test suite
typename TestFixture::type dst{};
const auto entity = src.create();
const auto copy = dst.create();
src.emplace<int>(entity, 42);
src.emplace<char>(entity, 'c');
ASSERT_EQ(src.size(), 1u);
ASSERT_EQ(dst.size(), 1u);
ASSERT_TRUE((src.all_of<int, char>(entity)));
ASSERT_FALSE((dst.template all_of<int, char>(copy)));
for(auto [id, storage]: src.storage()) {
if(storage.contains(entity)) {
auto *other = dst.storage(id);
if(!other) {
using namespace entt::literals;
entt::resolve(storage.type()).invoke("storage"_hs, {}, entt::forward_as_meta(dst), id);
other = dst.storage(id);
}
other->push(copy, storage.value(entity));
}
}
ASSERT_EQ(src.size(), 1u);
ASSERT_EQ(dst.size(), 1u);
ASSERT_TRUE((src.all_of<int, char>(entity)));
ASSERT_TRUE((dst.template all_of<int, char>(copy)));
ASSERT_EQ(dst.template get<int>(copy), 42);
ASSERT_EQ(dst.template get<char>(copy), 'c');
}
| [
"michele.caini@gmail.com"
] | michele.caini@gmail.com |
9cc28d84fd517ce301ff1e33367116880a1ae622 | ad7127e67815f4488e762866b2a13ca3d0b62ca7 | /imp/Graph500-HPX/src/generator/mod_arith.hpp | 53b68f5e973a5d5718dea93399d69d8239e92c41 | [] | no_license | yanfengchun87/Graph500 | 1332ddf83bac019055579bb1f0cc321762ae6c2f | e7dc9967f44242431414d0203c7170517c8fa523 | refs/heads/master | 2021-02-22T18:05:20.210247 | 2016-07-15T17:55:17 | 2016-07-15T17:55:17 | 245,382,066 | 1 | 0 | null | 2020-03-06T09:43:38 | 2020-03-06T09:43:38 | null | UTF-8 | C++ | false | false | 1,185 | hpp | /* Copyright (C) 2010 The Trustees of Indiana University. */
/* */
/* Use, modification and distribution is subject to the Boost Software */
/* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */
/* http://www.boost.org/LICENSE_1_0.txt) */
/* */
/* Authors: Jeremiah Willcock */
/* Andrew Lumsdaine */
#ifndef GRAPH500_MOD_ARITH_HPP
#define GRAPH500_MOD_ARITH_HPP
#include <generator/user_settings.hpp>
/* Various modular arithmetic operations for modulus 2^31-1 (0x7FFFFFFF).
* These may need to be tweaked to get acceptable performance on some platforms
* (especially ones without conditional moves). */
/* This code is now just a dispatcher that chooses the right header file to use
* per-platform. */
#ifdef FAST_64BIT_ARITHMETIC
#include <generator/mod_arith_64bit.hpp>
#else
#include <generator/mod_arith_32bit.hpp>
#endif
#endif /* MOD_ARITH_H */
| [
"emc2314@mai.ustc.edu.cn"
] | emc2314@mai.ustc.edu.cn |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.